@contractspec/example.learning-journey-ui-coaching 3.7.6 → 3.7.10
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 -25
- package/CHANGELOG.md +32 -0
- package/README.md +63 -20
- package/dist/CoachingMiniApp.js +178 -178
- package/dist/browser/CoachingMiniApp.js +178 -178
- package/dist/browser/components/EngagementMeter.js +2 -2
- package/dist/browser/components/TipCard.js +3 -3
- package/dist/browser/components/TipFeed.js +6 -6
- package/dist/browser/components/index.js +11 -11
- package/dist/browser/index.js +179 -178
- package/dist/browser/views/Overview.js +16 -16
- package/dist/browser/views/Progress.js +10 -10
- package/dist/browser/views/Steps.js +6 -6
- package/dist/browser/views/Timeline.js +9 -9
- package/dist/browser/views/index.js +174 -174
- package/dist/components/EngagementMeter.js +2 -2
- package/dist/components/TipCard.js +3 -3
- package/dist/components/TipFeed.js +6 -6
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +11 -11
- package/dist/index.d.ts +3 -3
- package/dist/index.js +179 -178
- package/dist/node/CoachingMiniApp.js +178 -178
- package/dist/node/components/EngagementMeter.js +2 -2
- package/dist/node/components/TipCard.js +3 -3
- package/dist/node/components/TipFeed.js +6 -6
- package/dist/node/components/index.js +11 -11
- package/dist/node/index.js +179 -178
- package/dist/node/views/Overview.js +16 -16
- package/dist/node/views/Progress.js +10 -10
- package/dist/node/views/Steps.js +6 -6
- package/dist/node/views/Timeline.js +9 -9
- package/dist/node/views/index.js +174 -174
- package/dist/views/Overview.js +16 -16
- package/dist/views/Progress.js +10 -10
- package/dist/views/Steps.js +6 -6
- package/dist/views/Timeline.js +9 -9
- package/dist/views/index.d.ts +1 -1
- package/dist/views/index.js +174 -174
- package/package.json +12 -12
- package/src/CoachingMiniApp.tsx +70 -70
- package/src/components/EngagementMeter.tsx +82 -82
- package/src/components/TipCard.tsx +81 -81
- package/src/components/TipFeed.tsx +80 -80
- package/src/components/index.ts +1 -1
- package/src/docs/learning-journey-ui-coaching.docblock.ts +10 -10
- package/src/example.ts +25 -25
- package/src/index.ts +4 -6
- package/src/learning-journey-ui-coaching.feature.ts +12 -12
- package/src/views/Overview.tsx +136 -136
- package/src/views/Progress.tsx +146 -146
- package/src/views/Steps.tsx +57 -57
- package/src/views/Timeline.tsx +101 -101
- package/src/views/index.ts +1 -1
- package/tsconfig.json +7 -8
- package/tsdown.config.js +7 -13
|
@@ -44,7 +44,7 @@ function TipCard({
|
|
|
44
44
|
children: step.title
|
|
45
45
|
}, undefined, false, undefined, this),
|
|
46
46
|
step.xpReward && /* @__PURE__ */ jsxDEV("span", {
|
|
47
|
-
className: cn("shrink-0 rounded-full px-2 py-0.5 text-xs
|
|
47
|
+
className: cn("shrink-0 rounded-full px-2 py-0.5 font-semibold text-xs", isCompleted ? "bg-green-500/10 text-green-500" : "bg-amber-500/10 text-amber-500"),
|
|
48
48
|
children: [
|
|
49
49
|
"+",
|
|
50
50
|
step.xpReward,
|
|
@@ -54,7 +54,7 @@ function TipCard({
|
|
|
54
54
|
]
|
|
55
55
|
}, undefined, true, undefined, this),
|
|
56
56
|
/* @__PURE__ */ jsxDEV("p", {
|
|
57
|
-
className: "text-muted-foreground
|
|
57
|
+
className: "mt-1 text-muted-foreground text-sm",
|
|
58
58
|
children: step.description
|
|
59
59
|
}, undefined, false, undefined, this),
|
|
60
60
|
!isCompleted && /* @__PURE__ */ jsxDEV("div", {
|
|
@@ -74,7 +74,7 @@ function TipCard({
|
|
|
74
74
|
]
|
|
75
75
|
}, undefined, true, undefined, this),
|
|
76
76
|
isCompleted && /* @__PURE__ */ jsxDEV("p", {
|
|
77
|
-
className: "mt-2 text-
|
|
77
|
+
className: "mt-2 text-green-500 text-sm",
|
|
78
78
|
children: "✓ Tip acknowledged"
|
|
79
79
|
}, undefined, false, undefined, this)
|
|
80
80
|
]
|
|
@@ -86,6 +86,10 @@ function TipCard({
|
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
// src/views/Overview.tsx
|
|
89
|
+
import {
|
|
90
|
+
StreakCounter,
|
|
91
|
+
XpBar
|
|
92
|
+
} from "@contractspec/example.learning-journey-ui-shared";
|
|
89
93
|
import { Button as Button2 } from "@contractspec/lib.design-system";
|
|
90
94
|
import {
|
|
91
95
|
Card as Card2,
|
|
@@ -93,10 +97,6 @@ import {
|
|
|
93
97
|
CardHeader,
|
|
94
98
|
CardTitle
|
|
95
99
|
} from "@contractspec/lib.ui-kit-web/ui/card";
|
|
96
|
-
import {
|
|
97
|
-
XpBar,
|
|
98
|
-
StreakCounter
|
|
99
|
-
} from "@contractspec/example.learning-journey-ui-shared";
|
|
100
100
|
import { jsxDEV as jsxDEV2 } from "react/jsx-dev-runtime";
|
|
101
101
|
"use client";
|
|
102
102
|
function Overview({
|
|
@@ -128,11 +128,11 @@ function Overview({
|
|
|
128
128
|
className: "flex-1",
|
|
129
129
|
children: [
|
|
130
130
|
/* @__PURE__ */ jsxDEV2("h1", {
|
|
131
|
-
className: "text-2xl
|
|
131
|
+
className: "font-bold text-2xl",
|
|
132
132
|
children: track.name
|
|
133
133
|
}, undefined, false, undefined, this),
|
|
134
134
|
/* @__PURE__ */ jsxDEV2("p", {
|
|
135
|
-
className: "text-muted-foreground
|
|
135
|
+
className: "mt-1 text-muted-foreground",
|
|
136
136
|
children: track.description
|
|
137
137
|
}, undefined, false, undefined, this)
|
|
138
138
|
]
|
|
@@ -156,14 +156,14 @@ function Overview({
|
|
|
156
156
|
/* @__PURE__ */ jsxDEV2(CardHeader, {
|
|
157
157
|
className: "pb-2",
|
|
158
158
|
children: /* @__PURE__ */ jsxDEV2(CardTitle, {
|
|
159
|
-
className: "text-muted-foreground text-sm
|
|
159
|
+
className: "font-medium text-muted-foreground text-sm",
|
|
160
160
|
children: "Active Tips"
|
|
161
161
|
}, undefined, false, undefined, this)
|
|
162
162
|
}, undefined, false, undefined, this),
|
|
163
163
|
/* @__PURE__ */ jsxDEV2(CardContent2, {
|
|
164
164
|
children: [
|
|
165
165
|
/* @__PURE__ */ jsxDEV2("div", {
|
|
166
|
-
className: "
|
|
166
|
+
className: "font-bold text-3xl text-amber-500",
|
|
167
167
|
children: pendingSteps
|
|
168
168
|
}, undefined, false, undefined, this),
|
|
169
169
|
/* @__PURE__ */ jsxDEV2("p", {
|
|
@@ -179,14 +179,14 @@ function Overview({
|
|
|
179
179
|
/* @__PURE__ */ jsxDEV2(CardHeader, {
|
|
180
180
|
className: "pb-2",
|
|
181
181
|
children: /* @__PURE__ */ jsxDEV2(CardTitle, {
|
|
182
|
-
className: "text-muted-foreground text-sm
|
|
182
|
+
className: "font-medium text-muted-foreground text-sm",
|
|
183
183
|
children: "Tips Actioned"
|
|
184
184
|
}, undefined, false, undefined, this)
|
|
185
185
|
}, undefined, false, undefined, this),
|
|
186
186
|
/* @__PURE__ */ jsxDEV2(CardContent2, {
|
|
187
187
|
children: [
|
|
188
188
|
/* @__PURE__ */ jsxDEV2("div", {
|
|
189
|
-
className: "
|
|
189
|
+
className: "font-bold text-3xl text-green-500",
|
|
190
190
|
children: completedSteps
|
|
191
191
|
}, undefined, false, undefined, this),
|
|
192
192
|
/* @__PURE__ */ jsxDEV2("p", {
|
|
@@ -206,14 +206,14 @@ function Overview({
|
|
|
206
206
|
/* @__PURE__ */ jsxDEV2(CardHeader, {
|
|
207
207
|
className: "pb-2",
|
|
208
208
|
children: /* @__PURE__ */ jsxDEV2(CardTitle, {
|
|
209
|
-
className: "text-muted-foreground text-sm
|
|
209
|
+
className: "font-medium text-muted-foreground text-sm",
|
|
210
210
|
children: "XP Earned"
|
|
211
211
|
}, undefined, false, undefined, this)
|
|
212
212
|
}, undefined, false, undefined, this),
|
|
213
213
|
/* @__PURE__ */ jsxDEV2(CardContent2, {
|
|
214
214
|
children: [
|
|
215
215
|
/* @__PURE__ */ jsxDEV2("div", {
|
|
216
|
-
className: "
|
|
216
|
+
className: "font-bold text-3xl text-orange-500",
|
|
217
217
|
children: progress.xpEarned
|
|
218
218
|
}, undefined, false, undefined, this),
|
|
219
219
|
/* @__PURE__ */ jsxDEV2(XpBar, {
|
|
@@ -279,7 +279,7 @@ function Overview({
|
|
|
279
279
|
/* @__PURE__ */ jsxDEV2("div", {
|
|
280
280
|
children: [
|
|
281
281
|
/* @__PURE__ */ jsxDEV2("h3", {
|
|
282
|
-
className: "
|
|
282
|
+
className: "font-semibold text-green-500 text-lg",
|
|
283
283
|
children: "All Tips Actioned!"
|
|
284
284
|
}, undefined, false, undefined, this),
|
|
285
285
|
/* @__PURE__ */ jsxDEV2("p", {
|
|
@@ -299,78 +299,8 @@ function Overview({
|
|
|
299
299
|
}, undefined, true, undefined, this);
|
|
300
300
|
}
|
|
301
301
|
|
|
302
|
-
// src/views/Steps.tsx
|
|
303
|
-
import { jsxDEV as jsxDEV3 } from "react/jsx-dev-runtime";
|
|
304
|
-
"use client";
|
|
305
|
-
function Steps({ track, progress, onStepComplete }) {
|
|
306
|
-
const completedSteps = progress.completedStepIds.length;
|
|
307
|
-
const totalSteps = track.steps.length;
|
|
308
|
-
const sortedSteps = [...track.steps].sort((a, b) => {
|
|
309
|
-
const aCompleted = progress.completedStepIds.includes(a.id);
|
|
310
|
-
const bCompleted = progress.completedStepIds.includes(b.id);
|
|
311
|
-
if (aCompleted === bCompleted)
|
|
312
|
-
return 0;
|
|
313
|
-
return aCompleted ? 1 : -1;
|
|
314
|
-
});
|
|
315
|
-
const currentStepId = track.steps.find((s) => !progress.completedStepIds.includes(s.id))?.id;
|
|
316
|
-
return /* @__PURE__ */ jsxDEV3("div", {
|
|
317
|
-
className: "space-y-6",
|
|
318
|
-
children: [
|
|
319
|
-
/* @__PURE__ */ jsxDEV3("div", {
|
|
320
|
-
className: "text-center",
|
|
321
|
-
children: [
|
|
322
|
-
/* @__PURE__ */ jsxDEV3("h2", {
|
|
323
|
-
className: "text-xl font-bold",
|
|
324
|
-
children: "Coaching Tips"
|
|
325
|
-
}, undefined, false, undefined, this),
|
|
326
|
-
/* @__PURE__ */ jsxDEV3("p", {
|
|
327
|
-
className: "text-muted-foreground",
|
|
328
|
-
children: "Review and take action on personalized tips"
|
|
329
|
-
}, undefined, false, undefined, this),
|
|
330
|
-
/* @__PURE__ */ jsxDEV3("p", {
|
|
331
|
-
className: "text-muted-foreground mt-2 text-sm",
|
|
332
|
-
children: [
|
|
333
|
-
completedSteps,
|
|
334
|
-
" of ",
|
|
335
|
-
totalSteps,
|
|
336
|
-
" tips actioned"
|
|
337
|
-
]
|
|
338
|
-
}, undefined, true, undefined, this)
|
|
339
|
-
]
|
|
340
|
-
}, undefined, true, undefined, this),
|
|
341
|
-
/* @__PURE__ */ jsxDEV3("div", {
|
|
342
|
-
className: "space-y-3",
|
|
343
|
-
children: sortedSteps.map((step) => {
|
|
344
|
-
const isCompleted = progress.completedStepIds.includes(step.id);
|
|
345
|
-
const isCurrent = step.id === currentStepId;
|
|
346
|
-
return /* @__PURE__ */ jsxDEV3(TipCard, {
|
|
347
|
-
step,
|
|
348
|
-
isCompleted,
|
|
349
|
-
isCurrent,
|
|
350
|
-
onComplete: () => onStepComplete?.(step.id),
|
|
351
|
-
onDismiss: () => onStepComplete?.(step.id)
|
|
352
|
-
}, step.id, false, undefined, this);
|
|
353
|
-
})
|
|
354
|
-
}, undefined, false, undefined, this),
|
|
355
|
-
completedSteps === totalSteps && /* @__PURE__ */ jsxDEV3("div", {
|
|
356
|
-
className: "text-muted-foreground text-center",
|
|
357
|
-
children: [
|
|
358
|
-
/* @__PURE__ */ jsxDEV3("span", {
|
|
359
|
-
className: "text-2xl",
|
|
360
|
-
children: "✨"
|
|
361
|
-
}, undefined, false, undefined, this),
|
|
362
|
-
/* @__PURE__ */ jsxDEV3("p", {
|
|
363
|
-
className: "mt-2",
|
|
364
|
-
children: "All tips have been addressed!"
|
|
365
|
-
}, undefined, false, undefined, this)
|
|
366
|
-
]
|
|
367
|
-
}, undefined, true, undefined, this)
|
|
368
|
-
]
|
|
369
|
-
}, undefined, true, undefined, this);
|
|
370
|
-
}
|
|
371
|
-
|
|
372
302
|
// src/components/EngagementMeter.tsx
|
|
373
|
-
import { jsxDEV as
|
|
303
|
+
import { jsxDEV as jsxDEV3 } from "react/jsx-dev-runtime";
|
|
374
304
|
"use client";
|
|
375
305
|
function EngagementMeter({
|
|
376
306
|
acknowledged,
|
|
@@ -381,19 +311,19 @@ function EngagementMeter({
|
|
|
381
311
|
const total = acknowledged + actioned + pending;
|
|
382
312
|
const actionedPercent = total > 0 ? actioned / total * 100 : 0;
|
|
383
313
|
const acknowledgedPercent = total > 0 ? acknowledged / total * 100 : 0;
|
|
384
|
-
return /* @__PURE__ */
|
|
314
|
+
return /* @__PURE__ */ jsxDEV3("div", {
|
|
385
315
|
className: "space-y-4",
|
|
386
316
|
children: [
|
|
387
|
-
/* @__PURE__ */
|
|
317
|
+
/* @__PURE__ */ jsxDEV3("div", {
|
|
388
318
|
className: "flex items-center justify-center",
|
|
389
|
-
children: /* @__PURE__ */
|
|
319
|
+
children: /* @__PURE__ */ jsxDEV3("div", {
|
|
390
320
|
className: "relative h-32 w-32",
|
|
391
321
|
children: [
|
|
392
|
-
/* @__PURE__ */
|
|
322
|
+
/* @__PURE__ */ jsxDEV3("svg", {
|
|
393
323
|
className: "h-full w-full -rotate-90",
|
|
394
324
|
viewBox: "0 0 100 100",
|
|
395
325
|
children: [
|
|
396
|
-
/* @__PURE__ */
|
|
326
|
+
/* @__PURE__ */ jsxDEV3("circle", {
|
|
397
327
|
cx: "50",
|
|
398
328
|
cy: "50",
|
|
399
329
|
r: "40",
|
|
@@ -401,7 +331,7 @@ function EngagementMeter({
|
|
|
401
331
|
strokeWidth: "12",
|
|
402
332
|
className: "stroke-muted"
|
|
403
333
|
}, undefined, false, undefined, this),
|
|
404
|
-
/* @__PURE__ */
|
|
334
|
+
/* @__PURE__ */ jsxDEV3("circle", {
|
|
405
335
|
cx: "50",
|
|
406
336
|
cy: "50",
|
|
407
337
|
r: "40",
|
|
@@ -411,7 +341,7 @@ function EngagementMeter({
|
|
|
411
341
|
strokeDasharray: `${actionedPercent * 2.51} 251`,
|
|
412
342
|
className: "stroke-green-500 transition-all duration-500"
|
|
413
343
|
}, undefined, false, undefined, this),
|
|
414
|
-
/* @__PURE__ */
|
|
344
|
+
/* @__PURE__ */ jsxDEV3("circle", {
|
|
415
345
|
cx: "50",
|
|
416
346
|
cy: "50",
|
|
417
347
|
r: "40",
|
|
@@ -424,14 +354,14 @@ function EngagementMeter({
|
|
|
424
354
|
}, undefined, false, undefined, this)
|
|
425
355
|
]
|
|
426
356
|
}, undefined, true, undefined, this),
|
|
427
|
-
/* @__PURE__ */
|
|
357
|
+
/* @__PURE__ */ jsxDEV3("div", {
|
|
428
358
|
className: "absolute inset-0 flex flex-col items-center justify-center",
|
|
429
359
|
children: [
|
|
430
|
-
/* @__PURE__ */
|
|
431
|
-
className: "text-2xl
|
|
360
|
+
/* @__PURE__ */ jsxDEV3("span", {
|
|
361
|
+
className: "font-bold text-2xl",
|
|
432
362
|
children: total
|
|
433
363
|
}, undefined, false, undefined, this),
|
|
434
|
-
/* @__PURE__ */
|
|
364
|
+
/* @__PURE__ */ jsxDEV3("span", {
|
|
435
365
|
className: "text-muted-foreground text-xs",
|
|
436
366
|
children: "tips"
|
|
437
367
|
}, undefined, false, undefined, this)
|
|
@@ -440,16 +370,16 @@ function EngagementMeter({
|
|
|
440
370
|
]
|
|
441
371
|
}, undefined, true, undefined, this)
|
|
442
372
|
}, undefined, false, undefined, this),
|
|
443
|
-
/* @__PURE__ */
|
|
373
|
+
/* @__PURE__ */ jsxDEV3("div", {
|
|
444
374
|
className: "flex justify-center gap-4 text-sm",
|
|
445
375
|
children: [
|
|
446
|
-
/* @__PURE__ */
|
|
376
|
+
/* @__PURE__ */ jsxDEV3("div", {
|
|
447
377
|
className: "flex items-center gap-1.5",
|
|
448
378
|
children: [
|
|
449
|
-
/* @__PURE__ */
|
|
379
|
+
/* @__PURE__ */ jsxDEV3("div", {
|
|
450
380
|
className: "h-3 w-3 rounded-full bg-green-500"
|
|
451
381
|
}, undefined, false, undefined, this),
|
|
452
|
-
/* @__PURE__ */
|
|
382
|
+
/* @__PURE__ */ jsxDEV3("span", {
|
|
453
383
|
children: [
|
|
454
384
|
"Actioned (",
|
|
455
385
|
actioned,
|
|
@@ -458,13 +388,13 @@ function EngagementMeter({
|
|
|
458
388
|
}, undefined, true, undefined, this)
|
|
459
389
|
]
|
|
460
390
|
}, undefined, true, undefined, this),
|
|
461
|
-
/* @__PURE__ */
|
|
391
|
+
/* @__PURE__ */ jsxDEV3("div", {
|
|
462
392
|
className: "flex items-center gap-1.5",
|
|
463
393
|
children: [
|
|
464
|
-
/* @__PURE__ */
|
|
394
|
+
/* @__PURE__ */ jsxDEV3("div", {
|
|
465
395
|
className: "h-3 w-3 rounded-full bg-amber-500"
|
|
466
396
|
}, undefined, false, undefined, this),
|
|
467
|
-
/* @__PURE__ */
|
|
397
|
+
/* @__PURE__ */ jsxDEV3("span", {
|
|
468
398
|
children: [
|
|
469
399
|
"Acknowledged (",
|
|
470
400
|
acknowledged,
|
|
@@ -473,13 +403,13 @@ function EngagementMeter({
|
|
|
473
403
|
}, undefined, true, undefined, this)
|
|
474
404
|
]
|
|
475
405
|
}, undefined, true, undefined, this),
|
|
476
|
-
/* @__PURE__ */
|
|
406
|
+
/* @__PURE__ */ jsxDEV3("div", {
|
|
477
407
|
className: "flex items-center gap-1.5",
|
|
478
408
|
children: [
|
|
479
|
-
/* @__PURE__ */
|
|
480
|
-
className: "
|
|
409
|
+
/* @__PURE__ */ jsxDEV3("div", {
|
|
410
|
+
className: "h-3 w-3 rounded-full bg-muted"
|
|
481
411
|
}, undefined, false, undefined, this),
|
|
482
|
-
/* @__PURE__ */
|
|
412
|
+
/* @__PURE__ */ jsxDEV3("span", {
|
|
483
413
|
children: [
|
|
484
414
|
"Pending (",
|
|
485
415
|
pending,
|
|
@@ -490,14 +420,14 @@ function EngagementMeter({
|
|
|
490
420
|
}, undefined, true, undefined, this)
|
|
491
421
|
]
|
|
492
422
|
}, undefined, true, undefined, this),
|
|
493
|
-
streak > 0 && /* @__PURE__ */
|
|
423
|
+
streak > 0 && /* @__PURE__ */ jsxDEV3("div", {
|
|
494
424
|
className: "flex items-center justify-center gap-2 rounded-lg bg-orange-500/10 px-4 py-2",
|
|
495
425
|
children: [
|
|
496
|
-
/* @__PURE__ */
|
|
426
|
+
/* @__PURE__ */ jsxDEV3("span", {
|
|
497
427
|
className: "text-xl",
|
|
498
428
|
children: "\uD83D\uDD25"
|
|
499
429
|
}, undefined, false, undefined, this),
|
|
500
|
-
/* @__PURE__ */
|
|
430
|
+
/* @__PURE__ */ jsxDEV3("span", {
|
|
501
431
|
className: "font-semibold text-orange-500",
|
|
502
432
|
children: [
|
|
503
433
|
streak,
|
|
@@ -511,18 +441,18 @@ function EngagementMeter({
|
|
|
511
441
|
}
|
|
512
442
|
|
|
513
443
|
// src/views/Progress.tsx
|
|
444
|
+
import {
|
|
445
|
+
BadgeDisplay,
|
|
446
|
+
StreakCounter as StreakCounter2,
|
|
447
|
+
XpBar as XpBar2
|
|
448
|
+
} from "@contractspec/example.learning-journey-ui-shared";
|
|
514
449
|
import {
|
|
515
450
|
Card as Card3,
|
|
516
451
|
CardContent as CardContent3,
|
|
517
452
|
CardHeader as CardHeader2,
|
|
518
453
|
CardTitle as CardTitle2
|
|
519
454
|
} from "@contractspec/lib.ui-kit-web/ui/card";
|
|
520
|
-
import {
|
|
521
|
-
XpBar as XpBar2,
|
|
522
|
-
BadgeDisplay,
|
|
523
|
-
StreakCounter as StreakCounter2
|
|
524
|
-
} from "@contractspec/example.learning-journey-ui-shared";
|
|
525
|
-
import { jsxDEV as jsxDEV5 } from "react/jsx-dev-runtime";
|
|
455
|
+
import { jsxDEV as jsxDEV4 } from "react/jsx-dev-runtime";
|
|
526
456
|
"use client";
|
|
527
457
|
function ProgressView({ track, progress }) {
|
|
528
458
|
const totalXp = track.totalXp ?? track.steps.reduce((sum, s) => sum + (s.xpReward ?? 0), 0);
|
|
@@ -531,26 +461,26 @@ function ProgressView({ track, progress }) {
|
|
|
531
461
|
const pendingSteps = totalSteps - completedSteps;
|
|
532
462
|
const actioned = Math.floor(completedSteps * 0.7);
|
|
533
463
|
const acknowledged = completedSteps - actioned;
|
|
534
|
-
return /* @__PURE__ */
|
|
464
|
+
return /* @__PURE__ */ jsxDEV4("div", {
|
|
535
465
|
className: "space-y-6",
|
|
536
466
|
children: [
|
|
537
|
-
/* @__PURE__ */
|
|
467
|
+
/* @__PURE__ */ jsxDEV4(Card3, {
|
|
538
468
|
children: [
|
|
539
|
-
/* @__PURE__ */
|
|
540
|
-
children: /* @__PURE__ */
|
|
469
|
+
/* @__PURE__ */ jsxDEV4(CardHeader2, {
|
|
470
|
+
children: /* @__PURE__ */ jsxDEV4(CardTitle2, {
|
|
541
471
|
className: "flex items-center gap-2",
|
|
542
472
|
children: [
|
|
543
|
-
/* @__PURE__ */
|
|
473
|
+
/* @__PURE__ */ jsxDEV4("span", {
|
|
544
474
|
children: "\uD83D\uDCCA"
|
|
545
475
|
}, undefined, false, undefined, this),
|
|
546
|
-
/* @__PURE__ */
|
|
476
|
+
/* @__PURE__ */ jsxDEV4("span", {
|
|
547
477
|
children: "Engagement Overview"
|
|
548
478
|
}, undefined, false, undefined, this)
|
|
549
479
|
]
|
|
550
480
|
}, undefined, true, undefined, this)
|
|
551
481
|
}, undefined, false, undefined, this),
|
|
552
|
-
/* @__PURE__ */
|
|
553
|
-
children: /* @__PURE__ */
|
|
482
|
+
/* @__PURE__ */ jsxDEV4(CardContent3, {
|
|
483
|
+
children: /* @__PURE__ */ jsxDEV4(EngagementMeter, {
|
|
554
484
|
actioned,
|
|
555
485
|
acknowledged,
|
|
556
486
|
pending: pendingSteps,
|
|
@@ -559,29 +489,29 @@ function ProgressView({ track, progress }) {
|
|
|
559
489
|
}, undefined, false, undefined, this)
|
|
560
490
|
]
|
|
561
491
|
}, undefined, true, undefined, this),
|
|
562
|
-
/* @__PURE__ */
|
|
492
|
+
/* @__PURE__ */ jsxDEV4("div", {
|
|
563
493
|
className: "grid gap-4 md:grid-cols-2",
|
|
564
494
|
children: [
|
|
565
|
-
/* @__PURE__ */
|
|
495
|
+
/* @__PURE__ */ jsxDEV4(Card3, {
|
|
566
496
|
children: [
|
|
567
|
-
/* @__PURE__ */
|
|
497
|
+
/* @__PURE__ */ jsxDEV4(CardHeader2, {
|
|
568
498
|
className: "pb-2",
|
|
569
|
-
children: /* @__PURE__ */
|
|
570
|
-
className: "text-muted-foreground text-sm
|
|
499
|
+
children: /* @__PURE__ */ jsxDEV4(CardTitle2, {
|
|
500
|
+
className: "font-medium text-muted-foreground text-sm",
|
|
571
501
|
children: "XP Earned"
|
|
572
502
|
}, undefined, false, undefined, this)
|
|
573
503
|
}, undefined, false, undefined, this),
|
|
574
|
-
/* @__PURE__ */
|
|
504
|
+
/* @__PURE__ */ jsxDEV4(CardContent3, {
|
|
575
505
|
className: "space-y-3",
|
|
576
506
|
children: [
|
|
577
|
-
/* @__PURE__ */
|
|
507
|
+
/* @__PURE__ */ jsxDEV4("div", {
|
|
578
508
|
className: "flex items-baseline gap-2",
|
|
579
509
|
children: [
|
|
580
|
-
/* @__PURE__ */
|
|
581
|
-
className: "
|
|
510
|
+
/* @__PURE__ */ jsxDEV4("span", {
|
|
511
|
+
className: "font-bold text-3xl text-orange-500",
|
|
582
512
|
children: progress.xpEarned
|
|
583
513
|
}, undefined, false, undefined, this),
|
|
584
|
-
/* @__PURE__ */
|
|
514
|
+
/* @__PURE__ */ jsxDEV4("span", {
|
|
585
515
|
className: "text-muted-foreground",
|
|
586
516
|
children: [
|
|
587
517
|
"/ ",
|
|
@@ -591,7 +521,7 @@ function ProgressView({ track, progress }) {
|
|
|
591
521
|
}, undefined, true, undefined, this)
|
|
592
522
|
]
|
|
593
523
|
}, undefined, true, undefined, this),
|
|
594
|
-
/* @__PURE__ */
|
|
524
|
+
/* @__PURE__ */ jsxDEV4(XpBar2, {
|
|
595
525
|
current: progress.xpEarned,
|
|
596
526
|
max: totalXp,
|
|
597
527
|
showLabel: false,
|
|
@@ -601,24 +531,24 @@ function ProgressView({ track, progress }) {
|
|
|
601
531
|
}, undefined, true, undefined, this)
|
|
602
532
|
]
|
|
603
533
|
}, undefined, true, undefined, this),
|
|
604
|
-
/* @__PURE__ */
|
|
534
|
+
/* @__PURE__ */ jsxDEV4(Card3, {
|
|
605
535
|
children: [
|
|
606
|
-
/* @__PURE__ */
|
|
536
|
+
/* @__PURE__ */ jsxDEV4(CardHeader2, {
|
|
607
537
|
className: "pb-2",
|
|
608
|
-
children: /* @__PURE__ */
|
|
609
|
-
className: "text-muted-foreground text-sm
|
|
538
|
+
children: /* @__PURE__ */ jsxDEV4(CardTitle2, {
|
|
539
|
+
className: "font-medium text-muted-foreground text-sm",
|
|
610
540
|
children: "Engagement Streak"
|
|
611
541
|
}, undefined, false, undefined, this)
|
|
612
542
|
}, undefined, false, undefined, this),
|
|
613
|
-
/* @__PURE__ */
|
|
614
|
-
children: /* @__PURE__ */
|
|
543
|
+
/* @__PURE__ */ jsxDEV4(CardContent3, {
|
|
544
|
+
children: /* @__PURE__ */ jsxDEV4("div", {
|
|
615
545
|
className: "flex items-center gap-4",
|
|
616
546
|
children: [
|
|
617
|
-
/* @__PURE__ */
|
|
547
|
+
/* @__PURE__ */ jsxDEV4(StreakCounter2, {
|
|
618
548
|
days: progress.streakDays,
|
|
619
549
|
size: "lg"
|
|
620
550
|
}, undefined, false, undefined, this),
|
|
621
|
-
/* @__PURE__ */
|
|
551
|
+
/* @__PURE__ */ jsxDEV4("div", {
|
|
622
552
|
className: "text-muted-foreground text-sm",
|
|
623
553
|
children: progress.streakDays > 0 ? "Keep going!" : "Start your streak today!"
|
|
624
554
|
}, undefined, false, undefined, this)
|
|
@@ -629,29 +559,29 @@ function ProgressView({ track, progress }) {
|
|
|
629
559
|
}, undefined, true, undefined, this)
|
|
630
560
|
]
|
|
631
561
|
}, undefined, true, undefined, this),
|
|
632
|
-
/* @__PURE__ */
|
|
562
|
+
/* @__PURE__ */ jsxDEV4(Card3, {
|
|
633
563
|
children: [
|
|
634
|
-
/* @__PURE__ */
|
|
635
|
-
children: /* @__PURE__ */
|
|
564
|
+
/* @__PURE__ */ jsxDEV4(CardHeader2, {
|
|
565
|
+
children: /* @__PURE__ */ jsxDEV4(CardTitle2, {
|
|
636
566
|
className: "flex items-center gap-2",
|
|
637
567
|
children: [
|
|
638
|
-
/* @__PURE__ */
|
|
568
|
+
/* @__PURE__ */ jsxDEV4("span", {
|
|
639
569
|
children: "\uD83C\uDFC5"
|
|
640
570
|
}, undefined, false, undefined, this),
|
|
641
|
-
/* @__PURE__ */
|
|
571
|
+
/* @__PURE__ */ jsxDEV4("span", {
|
|
642
572
|
children: "Achievements"
|
|
643
573
|
}, undefined, false, undefined, this)
|
|
644
574
|
]
|
|
645
575
|
}, undefined, true, undefined, this)
|
|
646
576
|
}, undefined, false, undefined, this),
|
|
647
|
-
/* @__PURE__ */
|
|
577
|
+
/* @__PURE__ */ jsxDEV4(CardContent3, {
|
|
648
578
|
children: [
|
|
649
|
-
/* @__PURE__ */
|
|
579
|
+
/* @__PURE__ */ jsxDEV4(BadgeDisplay, {
|
|
650
580
|
badges: progress.badges,
|
|
651
581
|
size: "lg",
|
|
652
582
|
maxVisible: 10
|
|
653
583
|
}, undefined, false, undefined, this),
|
|
654
|
-
progress.badges.length === 0 && /* @__PURE__ */
|
|
584
|
+
progress.badges.length === 0 && /* @__PURE__ */ jsxDEV4("p", {
|
|
655
585
|
className: "text-muted-foreground text-sm",
|
|
656
586
|
children: "Action tips to unlock achievements!"
|
|
657
587
|
}, undefined, false, undefined, this)
|
|
@@ -659,43 +589,43 @@ function ProgressView({ track, progress }) {
|
|
|
659
589
|
}, undefined, true, undefined, this)
|
|
660
590
|
]
|
|
661
591
|
}, undefined, true, undefined, this),
|
|
662
|
-
/* @__PURE__ */
|
|
592
|
+
/* @__PURE__ */ jsxDEV4(Card3, {
|
|
663
593
|
children: [
|
|
664
|
-
/* @__PURE__ */
|
|
665
|
-
children: /* @__PURE__ */
|
|
594
|
+
/* @__PURE__ */ jsxDEV4(CardHeader2, {
|
|
595
|
+
children: /* @__PURE__ */ jsxDEV4(CardTitle2, {
|
|
666
596
|
className: "flex items-center gap-2",
|
|
667
597
|
children: [
|
|
668
|
-
/* @__PURE__ */
|
|
598
|
+
/* @__PURE__ */ jsxDEV4("span", {
|
|
669
599
|
children: "\uD83D\uDCA1"
|
|
670
600
|
}, undefined, false, undefined, this),
|
|
671
|
-
/* @__PURE__ */
|
|
601
|
+
/* @__PURE__ */ jsxDEV4("span", {
|
|
672
602
|
children: "Tip Status"
|
|
673
603
|
}, undefined, false, undefined, this)
|
|
674
604
|
]
|
|
675
605
|
}, undefined, true, undefined, this)
|
|
676
606
|
}, undefined, false, undefined, this),
|
|
677
|
-
/* @__PURE__ */
|
|
678
|
-
children: /* @__PURE__ */
|
|
607
|
+
/* @__PURE__ */ jsxDEV4(CardContent3, {
|
|
608
|
+
children: /* @__PURE__ */ jsxDEV4("div", {
|
|
679
609
|
className: "space-y-3",
|
|
680
610
|
children: track.steps.map((step) => {
|
|
681
611
|
const isCompleted = progress.completedStepIds.includes(step.id);
|
|
682
|
-
return /* @__PURE__ */
|
|
612
|
+
return /* @__PURE__ */ jsxDEV4("div", {
|
|
683
613
|
className: "flex items-center justify-between rounded-lg border p-3",
|
|
684
614
|
children: [
|
|
685
|
-
/* @__PURE__ */
|
|
615
|
+
/* @__PURE__ */ jsxDEV4("div", {
|
|
686
616
|
className: "flex items-center gap-3",
|
|
687
617
|
children: [
|
|
688
|
-
/* @__PURE__ */
|
|
618
|
+
/* @__PURE__ */ jsxDEV4("span", {
|
|
689
619
|
className: isCompleted ? "text-green-500" : "text-amber-500",
|
|
690
620
|
children: isCompleted ? "✓" : "○"
|
|
691
621
|
}, undefined, false, undefined, this),
|
|
692
|
-
/* @__PURE__ */
|
|
622
|
+
/* @__PURE__ */ jsxDEV4("span", {
|
|
693
623
|
className: isCompleted ? "text-muted-foreground" : "text-foreground",
|
|
694
624
|
children: step.title
|
|
695
625
|
}, undefined, false, undefined, this)
|
|
696
626
|
]
|
|
697
627
|
}, undefined, true, undefined, this),
|
|
698
|
-
/* @__PURE__ */
|
|
628
|
+
/* @__PURE__ */ jsxDEV4("span", {
|
|
699
629
|
className: `text-sm ${isCompleted ? "text-green-500" : "text-muted-foreground"}`,
|
|
700
630
|
children: isCompleted ? "Actioned" : "Pending"
|
|
701
631
|
}, undefined, false, undefined, this)
|
|
@@ -709,6 +639,76 @@ function ProgressView({ track, progress }) {
|
|
|
709
639
|
]
|
|
710
640
|
}, undefined, true, undefined, this);
|
|
711
641
|
}
|
|
642
|
+
// src/views/Steps.tsx
|
|
643
|
+
import { jsxDEV as jsxDEV5 } from "react/jsx-dev-runtime";
|
|
644
|
+
"use client";
|
|
645
|
+
function Steps({ track, progress, onStepComplete }) {
|
|
646
|
+
const completedSteps = progress.completedStepIds.length;
|
|
647
|
+
const totalSteps = track.steps.length;
|
|
648
|
+
const sortedSteps = [...track.steps].sort((a, b) => {
|
|
649
|
+
const aCompleted = progress.completedStepIds.includes(a.id);
|
|
650
|
+
const bCompleted = progress.completedStepIds.includes(b.id);
|
|
651
|
+
if (aCompleted === bCompleted)
|
|
652
|
+
return 0;
|
|
653
|
+
return aCompleted ? 1 : -1;
|
|
654
|
+
});
|
|
655
|
+
const currentStepId = track.steps.find((s) => !progress.completedStepIds.includes(s.id))?.id;
|
|
656
|
+
return /* @__PURE__ */ jsxDEV5("div", {
|
|
657
|
+
className: "space-y-6",
|
|
658
|
+
children: [
|
|
659
|
+
/* @__PURE__ */ jsxDEV5("div", {
|
|
660
|
+
className: "text-center",
|
|
661
|
+
children: [
|
|
662
|
+
/* @__PURE__ */ jsxDEV5("h2", {
|
|
663
|
+
className: "font-bold text-xl",
|
|
664
|
+
children: "Coaching Tips"
|
|
665
|
+
}, undefined, false, undefined, this),
|
|
666
|
+
/* @__PURE__ */ jsxDEV5("p", {
|
|
667
|
+
className: "text-muted-foreground",
|
|
668
|
+
children: "Review and take action on personalized tips"
|
|
669
|
+
}, undefined, false, undefined, this),
|
|
670
|
+
/* @__PURE__ */ jsxDEV5("p", {
|
|
671
|
+
className: "mt-2 text-muted-foreground text-sm",
|
|
672
|
+
children: [
|
|
673
|
+
completedSteps,
|
|
674
|
+
" of ",
|
|
675
|
+
totalSteps,
|
|
676
|
+
" tips actioned"
|
|
677
|
+
]
|
|
678
|
+
}, undefined, true, undefined, this)
|
|
679
|
+
]
|
|
680
|
+
}, undefined, true, undefined, this),
|
|
681
|
+
/* @__PURE__ */ jsxDEV5("div", {
|
|
682
|
+
className: "space-y-3",
|
|
683
|
+
children: sortedSteps.map((step) => {
|
|
684
|
+
const isCompleted = progress.completedStepIds.includes(step.id);
|
|
685
|
+
const isCurrent = step.id === currentStepId;
|
|
686
|
+
return /* @__PURE__ */ jsxDEV5(TipCard, {
|
|
687
|
+
step,
|
|
688
|
+
isCompleted,
|
|
689
|
+
isCurrent,
|
|
690
|
+
onComplete: () => onStepComplete?.(step.id),
|
|
691
|
+
onDismiss: () => onStepComplete?.(step.id)
|
|
692
|
+
}, step.id, false, undefined, this);
|
|
693
|
+
})
|
|
694
|
+
}, undefined, false, undefined, this),
|
|
695
|
+
completedSteps === totalSteps && /* @__PURE__ */ jsxDEV5("div", {
|
|
696
|
+
className: "text-center text-muted-foreground",
|
|
697
|
+
children: [
|
|
698
|
+
/* @__PURE__ */ jsxDEV5("span", {
|
|
699
|
+
className: "text-2xl",
|
|
700
|
+
children: "✨"
|
|
701
|
+
}, undefined, false, undefined, this),
|
|
702
|
+
/* @__PURE__ */ jsxDEV5("p", {
|
|
703
|
+
className: "mt-2",
|
|
704
|
+
children: "All tips have been addressed!"
|
|
705
|
+
}, undefined, false, undefined, this)
|
|
706
|
+
]
|
|
707
|
+
}, undefined, true, undefined, this)
|
|
708
|
+
]
|
|
709
|
+
}, undefined, true, undefined, this);
|
|
710
|
+
}
|
|
711
|
+
|
|
712
712
|
// src/components/TipFeed.tsx
|
|
713
713
|
import { cn as cn2 } from "@contractspec/lib.ui-kit-web/ui/utils";
|
|
714
714
|
import { jsxDEV as jsxDEV6 } from "react/jsx-dev-runtime";
|
|
@@ -725,7 +725,7 @@ var TIP_ICONS2 = {
|
|
|
725
725
|
function TipFeed({ items }) {
|
|
726
726
|
if (items.length === 0) {
|
|
727
727
|
return /* @__PURE__ */ jsxDEV6("div", {
|
|
728
|
-
className: "
|
|
728
|
+
className: "py-8 text-center text-muted-foreground",
|
|
729
729
|
children: "No tips yet. Start engaging with coaching tips!"
|
|
730
730
|
}, undefined, false, undefined, this);
|
|
731
731
|
}
|
|
@@ -733,7 +733,7 @@ function TipFeed({ items }) {
|
|
|
733
733
|
className: "relative",
|
|
734
734
|
children: [
|
|
735
735
|
/* @__PURE__ */ jsxDEV6("div", {
|
|
736
|
-
className: "
|
|
736
|
+
className: "absolute top-0 left-4 h-full w-0.5 bg-border"
|
|
737
737
|
}, undefined, false, undefined, this),
|
|
738
738
|
/* @__PURE__ */ jsxDEV6("div", {
|
|
739
739
|
className: "space-y-4",
|
|
@@ -748,7 +748,7 @@ function TipFeed({ items }) {
|
|
|
748
748
|
children: item.isCompleted ? "✓" : icon
|
|
749
749
|
}, undefined, false, undefined, this),
|
|
750
750
|
/* @__PURE__ */ jsxDEV6("div", {
|
|
751
|
-
className: "
|
|
751
|
+
className: "flex-1 rounded-lg border bg-card p-3",
|
|
752
752
|
children: [
|
|
753
753
|
/* @__PURE__ */ jsxDEV6("div", {
|
|
754
754
|
className: "flex items-start justify-between gap-2",
|
|
@@ -760,13 +760,13 @@ function TipFeed({ items }) {
|
|
|
760
760
|
children: item.step.title
|
|
761
761
|
}, undefined, false, undefined, this),
|
|
762
762
|
/* @__PURE__ */ jsxDEV6("p", {
|
|
763
|
-
className: "
|
|
763
|
+
className: "mt-0.5 text-muted-foreground text-sm",
|
|
764
764
|
children: item.step.description
|
|
765
765
|
}, undefined, false, undefined, this)
|
|
766
766
|
]
|
|
767
767
|
}, undefined, true, undefined, this),
|
|
768
768
|
item.step.xpReward && /* @__PURE__ */ jsxDEV6("span", {
|
|
769
|
-
className: cn2("shrink-0 text-xs
|
|
769
|
+
className: cn2("shrink-0 font-medium text-xs", item.isCompleted ? "text-green-500" : "text-muted-foreground"),
|
|
770
770
|
children: [
|
|
771
771
|
"+",
|
|
772
772
|
item.step.xpReward,
|
|
@@ -776,7 +776,7 @@ function TipFeed({ items }) {
|
|
|
776
776
|
]
|
|
777
777
|
}, undefined, true, undefined, this),
|
|
778
778
|
/* @__PURE__ */ jsxDEV6("div", {
|
|
779
|
-
className: "
|
|
779
|
+
className: "mt-2 flex items-center gap-2 text-muted-foreground text-xs",
|
|
780
780
|
children: item.isCompleted ? /* @__PURE__ */ jsxDEV6("span", {
|
|
781
781
|
className: "text-green-500",
|
|
782
782
|
children: [
|
|
@@ -827,7 +827,7 @@ function Timeline({ track, progress }) {
|
|
|
827
827
|
className: "text-center",
|
|
828
828
|
children: [
|
|
829
829
|
/* @__PURE__ */ jsxDEV7("h2", {
|
|
830
|
-
className: "text-xl
|
|
830
|
+
className: "font-bold text-xl",
|
|
831
831
|
children: "Activity Timeline"
|
|
832
832
|
}, undefined, false, undefined, this),
|
|
833
833
|
/* @__PURE__ */ jsxDEV7("p", {
|
|
@@ -844,7 +844,7 @@ function Timeline({ track, progress }) {
|
|
|
844
844
|
className: "p-4 text-center",
|
|
845
845
|
children: [
|
|
846
846
|
/* @__PURE__ */ jsxDEV7("div", {
|
|
847
|
-
className: "
|
|
847
|
+
className: "font-bold text-2xl text-green-500",
|
|
848
848
|
children: completedCount
|
|
849
849
|
}, undefined, false, undefined, this),
|
|
850
850
|
/* @__PURE__ */ jsxDEV7("div", {
|
|
@@ -859,7 +859,7 @@ function Timeline({ track, progress }) {
|
|
|
859
859
|
className: "p-4 text-center",
|
|
860
860
|
children: [
|
|
861
861
|
/* @__PURE__ */ jsxDEV7("div", {
|
|
862
|
-
className: "
|
|
862
|
+
className: "font-bold text-2xl text-amber-500",
|
|
863
863
|
children: pendingCount
|
|
864
864
|
}, undefined, false, undefined, this),
|
|
865
865
|
/* @__PURE__ */ jsxDEV7("div", {
|
|
@@ -974,12 +974,12 @@ function Timeline({ track, progress }) {
|
|
|
974
974
|
}
|
|
975
975
|
|
|
976
976
|
// src/CoachingMiniApp.tsx
|
|
977
|
-
import { useState, useCallback } from "react";
|
|
978
|
-
import { Card as Card5, CardContent as CardContent5 } from "@contractspec/lib.ui-kit-web/ui/card";
|
|
979
977
|
import {
|
|
980
|
-
|
|
981
|
-
|
|
978
|
+
useLearningProgress,
|
|
979
|
+
ViewTabs
|
|
982
980
|
} from "@contractspec/example.learning-journey-ui-shared";
|
|
981
|
+
import { Card as Card5, CardContent as CardContent5 } from "@contractspec/lib.ui-kit-web/ui/card";
|
|
982
|
+
import { useCallback, useState } from "react";
|
|
983
983
|
import { jsxDEV as jsxDEV8 } from "react/jsx-dev-runtime";
|
|
984
984
|
"use client";
|
|
985
985
|
function CoachingMiniApp({
|