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