@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
package/dist/components/index.js
CHANGED
|
@@ -1,321 +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/components/EngagementMeter.tsx
|
|
90
|
-
import { jsxDEV as jsxDEV2 } from "react/jsx-dev-runtime";
|
|
91
|
-
"use client";
|
|
92
|
-
function EngagementMeter({
|
|
93
|
-
acknowledged,
|
|
94
|
-
actioned,
|
|
95
|
-
pending,
|
|
96
|
-
streak = 0
|
|
97
|
-
}) {
|
|
98
|
-
const total = acknowledged + actioned + pending;
|
|
99
|
-
const actionedPercent = total > 0 ? actioned / total * 100 : 0;
|
|
100
|
-
const acknowledgedPercent = total > 0 ? acknowledged / total * 100 : 0;
|
|
101
|
-
return /* @__PURE__ */ jsxDEV2("div", {
|
|
102
|
-
className: "space-y-4",
|
|
103
|
-
children: [
|
|
104
|
-
/* @__PURE__ */ jsxDEV2("div", {
|
|
105
|
-
className: "flex items-center justify-center",
|
|
106
|
-
children: /* @__PURE__ */ jsxDEV2("div", {
|
|
107
|
-
className: "relative h-32 w-32",
|
|
108
|
-
children: [
|
|
109
|
-
/* @__PURE__ */ jsxDEV2("svg", {
|
|
110
|
-
className: "h-full w-full -rotate-90",
|
|
111
|
-
viewBox: "0 0 100 100",
|
|
112
|
-
children: [
|
|
113
|
-
/* @__PURE__ */ jsxDEV2("circle", {
|
|
114
|
-
cx: "50",
|
|
115
|
-
cy: "50",
|
|
116
|
-
r: "40",
|
|
117
|
-
fill: "none",
|
|
118
|
-
strokeWidth: "12",
|
|
119
|
-
className: "stroke-muted"
|
|
120
|
-
}, undefined, false, undefined, this),
|
|
121
|
-
/* @__PURE__ */ jsxDEV2("circle", {
|
|
122
|
-
cx: "50",
|
|
123
|
-
cy: "50",
|
|
124
|
-
r: "40",
|
|
125
|
-
fill: "none",
|
|
126
|
-
strokeWidth: "12",
|
|
127
|
-
strokeLinecap: "round",
|
|
128
|
-
strokeDasharray: `${actionedPercent * 2.51} 251`,
|
|
129
|
-
className: "stroke-green-500 transition-all duration-500"
|
|
130
|
-
}, undefined, false, undefined, this),
|
|
131
|
-
/* @__PURE__ */ jsxDEV2("circle", {
|
|
132
|
-
cx: "50",
|
|
133
|
-
cy: "50",
|
|
134
|
-
r: "40",
|
|
135
|
-
fill: "none",
|
|
136
|
-
strokeWidth: "12",
|
|
137
|
-
strokeLinecap: "round",
|
|
138
|
-
strokeDasharray: `${acknowledgedPercent * 2.51} 251`,
|
|
139
|
-
strokeDashoffset: `${-actionedPercent * 2.51}`,
|
|
140
|
-
className: "stroke-amber-500 transition-all duration-500"
|
|
141
|
-
}, undefined, false, undefined, this)
|
|
142
|
-
]
|
|
143
|
-
}, undefined, true, undefined, this),
|
|
144
|
-
/* @__PURE__ */ jsxDEV2("div", {
|
|
145
|
-
className: "absolute inset-0 flex flex-col items-center justify-center",
|
|
146
|
-
children: [
|
|
147
|
-
/* @__PURE__ */ jsxDEV2("span", {
|
|
148
|
-
className: "font-bold text-2xl",
|
|
149
|
-
children: total
|
|
150
|
-
}, undefined, false, undefined, this),
|
|
151
|
-
/* @__PURE__ */ jsxDEV2("span", {
|
|
152
|
-
className: "text-muted-foreground text-xs",
|
|
153
|
-
children: "tips"
|
|
154
|
-
}, undefined, false, undefined, this)
|
|
155
|
-
]
|
|
156
|
-
}, undefined, true, undefined, this)
|
|
157
|
-
]
|
|
158
|
-
}, undefined, true, undefined, this)
|
|
159
|
-
}, undefined, false, undefined, this),
|
|
160
|
-
/* @__PURE__ */ jsxDEV2("div", {
|
|
161
|
-
className: "flex justify-center gap-4 text-sm",
|
|
162
|
-
children: [
|
|
163
|
-
/* @__PURE__ */ jsxDEV2("div", {
|
|
164
|
-
className: "flex items-center gap-1.5",
|
|
165
|
-
children: [
|
|
166
|
-
/* @__PURE__ */ jsxDEV2("div", {
|
|
167
|
-
className: "h-3 w-3 rounded-full bg-green-500"
|
|
168
|
-
}, undefined, false, undefined, this),
|
|
169
|
-
/* @__PURE__ */ jsxDEV2("span", {
|
|
170
|
-
children: [
|
|
171
|
-
"Actioned (",
|
|
172
|
-
actioned,
|
|
173
|
-
")"
|
|
174
|
-
]
|
|
175
|
-
}, undefined, true, undefined, this)
|
|
176
|
-
]
|
|
177
|
-
}, undefined, true, undefined, this),
|
|
178
|
-
/* @__PURE__ */ jsxDEV2("div", {
|
|
179
|
-
className: "flex items-center gap-1.5",
|
|
180
|
-
children: [
|
|
181
|
-
/* @__PURE__ */ jsxDEV2("div", {
|
|
182
|
-
className: "h-3 w-3 rounded-full bg-amber-500"
|
|
183
|
-
}, undefined, false, undefined, this),
|
|
184
|
-
/* @__PURE__ */ jsxDEV2("span", {
|
|
185
|
-
children: [
|
|
186
|
-
"Acknowledged (",
|
|
187
|
-
acknowledged,
|
|
188
|
-
")"
|
|
189
|
-
]
|
|
190
|
-
}, undefined, true, undefined, this)
|
|
191
|
-
]
|
|
192
|
-
}, undefined, true, undefined, this),
|
|
193
|
-
/* @__PURE__ */ jsxDEV2("div", {
|
|
194
|
-
className: "flex items-center gap-1.5",
|
|
195
|
-
children: [
|
|
196
|
-
/* @__PURE__ */ jsxDEV2("div", {
|
|
197
|
-
className: "h-3 w-3 rounded-full bg-muted"
|
|
198
|
-
}, undefined, false, undefined, this),
|
|
199
|
-
/* @__PURE__ */ jsxDEV2("span", {
|
|
200
|
-
children: [
|
|
201
|
-
"Pending (",
|
|
202
|
-
pending,
|
|
203
|
-
")"
|
|
204
|
-
]
|
|
205
|
-
}, undefined, true, undefined, this)
|
|
206
|
-
]
|
|
207
|
-
}, undefined, true, undefined, this)
|
|
208
|
-
]
|
|
209
|
-
}, undefined, true, undefined, this),
|
|
210
|
-
streak > 0 && /* @__PURE__ */ jsxDEV2("div", {
|
|
211
|
-
className: "flex items-center justify-center gap-2 rounded-lg bg-orange-500/10 px-4 py-2",
|
|
212
|
-
children: [
|
|
213
|
-
/* @__PURE__ */ jsxDEV2("span", {
|
|
214
|
-
className: "text-xl",
|
|
215
|
-
children: "\uD83D\uDD25"
|
|
216
|
-
}, undefined, false, undefined, this),
|
|
217
|
-
/* @__PURE__ */ jsxDEV2("span", {
|
|
218
|
-
className: "font-semibold text-orange-500",
|
|
219
|
-
children: [
|
|
220
|
-
streak,
|
|
221
|
-
" day engagement streak!"
|
|
222
|
-
]
|
|
223
|
-
}, undefined, true, undefined, this)
|
|
224
|
-
]
|
|
225
|
-
}, undefined, true, undefined, this)
|
|
226
|
-
]
|
|
227
|
-
}, undefined, true, undefined, this);
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
// src/components/TipFeed.tsx
|
|
231
|
-
import { cn as cn2 } from "@contractspec/lib.ui-kit-web/ui/utils";
|
|
232
|
-
import { jsxDEV as jsxDEV3 } from "react/jsx-dev-runtime";
|
|
233
|
-
"use client";
|
|
234
|
-
var TIP_ICONS2 = {
|
|
235
|
-
cash_buffer_too_high: "\uD83D\uDCB0",
|
|
236
|
-
no_savings_goal: "\uD83C\uDFAF",
|
|
237
|
-
irregular_savings: "\uD83D\uDCC5",
|
|
238
|
-
noise_late_evening: "\uD83D\uDD07",
|
|
239
|
-
guest_frequency_high: "\uD83D\uDC65",
|
|
240
|
-
shared_space_conflicts: "\uD83C\uDFE0",
|
|
241
|
-
default: "\uD83D\uDCA1"
|
|
242
|
-
};
|
|
243
|
-
function TipFeed({ items }) {
|
|
244
|
-
if (items.length === 0) {
|
|
245
|
-
return /* @__PURE__ */ jsxDEV3("div", {
|
|
246
|
-
className: "py-8 text-center text-muted-foreground",
|
|
247
|
-
children: "No tips yet. Start engaging with coaching tips!"
|
|
248
|
-
}, undefined, false, undefined, this);
|
|
249
|
-
}
|
|
250
|
-
return /* @__PURE__ */ jsxDEV3("div", {
|
|
251
|
-
className: "relative",
|
|
252
|
-
children: [
|
|
253
|
-
/* @__PURE__ */ jsxDEV3("div", {
|
|
254
|
-
className: "absolute top-0 left-4 h-full w-0.5 bg-border"
|
|
255
|
-
}, undefined, false, undefined, this),
|
|
256
|
-
/* @__PURE__ */ jsxDEV3("div", {
|
|
257
|
-
className: "space-y-4",
|
|
258
|
-
children: items.map((item) => {
|
|
259
|
-
const tipId = item.step.metadata?.tipId ?? "default";
|
|
260
|
-
const icon = TIP_ICONS2[tipId] ?? TIP_ICONS2.default;
|
|
261
|
-
return /* @__PURE__ */ jsxDEV3("div", {
|
|
262
|
-
className: "relative flex gap-4 pl-2",
|
|
263
|
-
children: [
|
|
264
|
-
/* @__PURE__ */ jsxDEV3("div", {
|
|
265
|
-
className: cn2("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"),
|
|
266
|
-
children: item.isCompleted ? "\u2713" : icon
|
|
267
|
-
}, undefined, false, undefined, this),
|
|
268
|
-
/* @__PURE__ */ jsxDEV3("div", {
|
|
269
|
-
className: "flex-1 rounded-lg border bg-card p-3",
|
|
270
|
-
children: [
|
|
271
|
-
/* @__PURE__ */ jsxDEV3("div", {
|
|
272
|
-
className: "flex items-start justify-between gap-2",
|
|
273
|
-
children: [
|
|
274
|
-
/* @__PURE__ */ jsxDEV3("div", {
|
|
275
|
-
children: [
|
|
276
|
-
/* @__PURE__ */ jsxDEV3("p", {
|
|
277
|
-
className: "font-medium",
|
|
278
|
-
children: item.step.title
|
|
279
|
-
}, undefined, false, undefined, this),
|
|
280
|
-
/* @__PURE__ */ jsxDEV3("p", {
|
|
281
|
-
className: "mt-0.5 text-muted-foreground text-sm",
|
|
282
|
-
children: item.step.description
|
|
283
|
-
}, undefined, false, undefined, this)
|
|
284
|
-
]
|
|
285
|
-
}, undefined, true, undefined, this),
|
|
286
|
-
item.step.xpReward && /* @__PURE__ */ jsxDEV3("span", {
|
|
287
|
-
className: cn2("shrink-0 font-medium text-xs", item.isCompleted ? "text-green-500" : "text-muted-foreground"),
|
|
288
|
-
children: [
|
|
289
|
-
"+",
|
|
290
|
-
item.step.xpReward,
|
|
291
|
-
" XP"
|
|
292
|
-
]
|
|
293
|
-
}, undefined, true, undefined, this)
|
|
294
|
-
]
|
|
295
|
-
}, undefined, true, undefined, this),
|
|
296
|
-
/* @__PURE__ */ jsxDEV3("div", {
|
|
297
|
-
className: "mt-2 flex items-center gap-2 text-muted-foreground text-xs",
|
|
298
|
-
children: item.isCompleted ? /* @__PURE__ */ jsxDEV3("span", {
|
|
299
|
-
className: "text-green-500",
|
|
300
|
-
children: [
|
|
301
|
-
"\u2713 Completed",
|
|
302
|
-
item.completedAt && ` \u2022 ${item.completedAt}`
|
|
303
|
-
]
|
|
304
|
-
}, undefined, true, undefined, this) : /* @__PURE__ */ jsxDEV3("span", {
|
|
305
|
-
children: "Pending action"
|
|
306
|
-
}, undefined, false, undefined, this)
|
|
307
|
-
}, undefined, false, undefined, this)
|
|
308
|
-
]
|
|
309
|
-
}, undefined, true, undefined, this)
|
|
310
|
-
]
|
|
311
|
-
}, item.step.id, true, undefined, this);
|
|
312
|
-
})
|
|
313
|
-
}, undefined, false, undefined, this)
|
|
314
|
-
]
|
|
315
|
-
}, undefined, true, undefined, this);
|
|
316
|
-
}
|
|
317
|
-
export {
|
|
318
|
-
TipFeed,
|
|
319
|
-
TipCard,
|
|
320
|
-
EngagementMeter
|
|
321
|
-
};
|
|
2
|
+
import{Button as U}from"@contractspec/lib.design-system";import{Card as Y,CardContent as Z}from"@contractspec/lib.ui-kit-web/ui/card";import{cn as R}from"@contractspec/lib.ui-kit-web/ui/utils";import{jsx as h,jsxs as J}from"react/jsx-runtime";var V={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 $({step:F,isCompleted:f,isCurrent:v,onComplete:H,onDismiss:z}){let K=F.metadata?.tipId??"default",Q=V[K]??V.default;return h(Y,{className:R("transition-all",f&&"opacity-60",v&&"ring-2 ring-amber-500"),children:h(Z,{className:"p-4",children:J("div",{className:"flex gap-4",children:[h("div",{className:R("flex h-12 w-12 shrink-0 items-center justify-center rounded-xl text-2xl",f?"bg-green-500/10":v?"bg-amber-500/10":"bg-muted"),children:f?"\u2713":Q}),J("div",{className:"min-w-0 flex-1",children:[J("div",{className:"flex items-start justify-between gap-2",children:[h("h4",{className:"font-semibold",children:F.title}),F.xpReward&&J("span",{className:R("shrink-0 rounded-full px-2 py-0.5 font-semibold text-xs",f?"bg-green-500/10 text-green-500":"bg-amber-500/10 text-amber-500"),children:["+",F.xpReward," XP"]})]}),h("p",{className:"mt-1 text-muted-foreground text-sm",children:F.description}),!f&&J("div",{className:"mt-3 flex flex-wrap gap-2",children:[h(U,{size:"sm",onClick:H,children:"Take Action"}),h(U,{variant:"outline",size:"sm",onClick:z,children:"Dismiss"})]}),f&&h("p",{className:"mt-2 text-green-500 text-sm",children:"\u2713 Tip acknowledged"})]})]})})})}import{jsx as M,jsxs as E}from"react/jsx-runtime";function y({acknowledged:F,actioned:f,pending:v,streak:H=0}){let z=F+f+v,K=z>0?f/z*100:0,Q=z>0?F/z*100:0;return E("div",{className:"space-y-4",children:[M("div",{className:"flex items-center justify-center",children:E("div",{className:"relative h-32 w-32",children:[E("svg",{className:"h-full w-full -rotate-90",viewBox:"0 0 100 100",children:[M("circle",{cx:"50",cy:"50",r:"40",fill:"none",strokeWidth:"12",className:"stroke-muted"}),M("circle",{cx:"50",cy:"50",r:"40",fill:"none",strokeWidth:"12",strokeLinecap:"round",strokeDasharray:`${K*2.51} 251`,className:"stroke-green-500 transition-all duration-500"}),M("circle",{cx:"50",cy:"50",r:"40",fill:"none",strokeWidth:"12",strokeLinecap:"round",strokeDasharray:`${Q*2.51} 251`,strokeDashoffset:`${-K*2.51}`,className:"stroke-amber-500 transition-all duration-500"})]}),E("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[M("span",{className:"font-bold text-2xl",children:z}),M("span",{className:"text-muted-foreground text-xs",children:"tips"})]})]})}),E("div",{className:"flex justify-center gap-4 text-sm",children:[E("div",{className:"flex items-center gap-1.5",children:[M("div",{className:"h-3 w-3 rounded-full bg-green-500"}),E("span",{children:["Actioned (",f,")"]})]}),E("div",{className:"flex items-center gap-1.5",children:[M("div",{className:"h-3 w-3 rounded-full bg-amber-500"}),E("span",{children:["Acknowledged (",F,")"]})]}),E("div",{className:"flex items-center gap-1.5",children:[M("div",{className:"h-3 w-3 rounded-full bg-muted"}),E("span",{children:["Pending (",v,")"]})]})]}),H>0&&E("div",{className:"flex items-center justify-center gap-2 rounded-lg bg-orange-500/10 px-4 py-2",children:[M("span",{className:"text-xl",children:"\uD83D\uDD25"}),E("span",{className:"font-semibold text-orange-500",children:[H," day engagement streak!"]})]})]})}import{cn as W}from"@contractspec/lib.ui-kit-web/ui/utils";import{jsx as q,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 A({items:F}){if(F.length===0)return q("div",{className:"py-8 text-center text-muted-foreground",children:"No tips yet. Start engaging with coaching tips!"});return G("div",{className:"relative",children:[q("div",{className:"absolute top-0 left-4 h-full w-0.5 bg-border"}),q("div",{className:"space-y-4",children:F.map((f)=>{let v=f.step.metadata?.tipId??"default",H=X[v]??X.default;return G("div",{className:"relative flex gap-4 pl-2",children:[q("div",{className:W("relative z-10 flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-sm",f.isCompleted?"bg-green-500 text-white":"bg-muted text-muted-foreground"),children:f.isCompleted?"\u2713":H}),G("div",{className:"flex-1 rounded-lg border bg-card p-3",children:[G("div",{className:"flex items-start justify-between gap-2",children:[G("div",{children:[q("p",{className:"font-medium",children:f.step.title}),q("p",{className:"mt-0.5 text-muted-foreground text-sm",children:f.step.description})]}),f.step.xpReward&&G("span",{className:W("shrink-0 font-medium text-xs",f.isCompleted?"text-green-500":"text-muted-foreground"),children:["+",f.step.xpReward," XP"]})]}),q("div",{className:"mt-2 flex items-center gap-2 text-muted-foreground text-xs",children:f.isCompleted?G("span",{className:"text-green-500",children:["\u2713 Completed",f.completedAt&&` \u2022 ${f.completedAt}`]}):q("span",{children:"Pending action"})})]})]},f.step.id)})})]})}export{A as TipFeed,$ as TipCard,y as EngagementMeter};
|
package/dist/docs/index.js
CHANGED
|
@@ -1,23 +1,9 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
|
|
3
|
-
import { registerDocBlocks } from "@contractspec/lib.contracts-spec/docs";
|
|
4
|
-
var blocks = [
|
|
5
|
-
{
|
|
6
|
-
id: "docs.examples.learning-journey-ui-coaching",
|
|
7
|
-
title: "Learning Journey UI \u2014 Coaching",
|
|
8
|
-
summary: "UI mini-app components for coaching: tips, engagement, progress.",
|
|
9
|
-
kind: "reference",
|
|
10
|
-
visibility: "public",
|
|
11
|
-
route: "/docs/examples/learning-journey-ui-coaching",
|
|
12
|
-
tags: ["learning", "ui", "coaching"],
|
|
13
|
-
body: `## Includes
|
|
2
|
+
import{registerDocBlocks as f}from"@contractspec/lib.contracts-spec/docs";var m=[{id:"docs.examples.learning-journey-ui-coaching",title:"Learning Journey UI \u2014 Coaching",summary:"UI mini-app components for coaching: tips, engagement, progress.",kind:"reference",visibility:"public",route:"/docs/examples/learning-journey-ui-coaching",tags:["learning","ui","coaching"],body:`## Includes
|
|
14
3
|
- Coaching mini-app shell
|
|
15
4
|
- Views: overview, steps, progress, timeline
|
|
16
5
|
- Components: tip card, engagement meter, tip feed
|
|
17
6
|
|
|
18
7
|
## Notes
|
|
19
8
|
- Compose using design system components.
|
|
20
|
-
- Keep accessibility and mobile-friendly tap targets.`
|
|
21
|
-
}
|
|
22
|
-
];
|
|
23
|
-
registerDocBlocks(blocks);
|
|
9
|
+
- Keep accessibility and mobile-friendly tap targets.`}];f(m);
|
|
@@ -1,23 +1,9 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
|
|
3
|
-
import { registerDocBlocks } from "@contractspec/lib.contracts-spec/docs";
|
|
4
|
-
var blocks = [
|
|
5
|
-
{
|
|
6
|
-
id: "docs.examples.learning-journey-ui-coaching",
|
|
7
|
-
title: "Learning Journey UI \u2014 Coaching",
|
|
8
|
-
summary: "UI mini-app components for coaching: tips, engagement, progress.",
|
|
9
|
-
kind: "reference",
|
|
10
|
-
visibility: "public",
|
|
11
|
-
route: "/docs/examples/learning-journey-ui-coaching",
|
|
12
|
-
tags: ["learning", "ui", "coaching"],
|
|
13
|
-
body: `## Includes
|
|
2
|
+
import{registerDocBlocks as f}from"@contractspec/lib.contracts-spec/docs";var h=[{id:"docs.examples.learning-journey-ui-coaching",title:"Learning Journey UI \u2014 Coaching",summary:"UI mini-app components for coaching: tips, engagement, progress.",kind:"reference",visibility:"public",route:"/docs/examples/learning-journey-ui-coaching",tags:["learning","ui","coaching"],body:`## Includes
|
|
14
3
|
- Coaching mini-app shell
|
|
15
4
|
- Views: overview, steps, progress, timeline
|
|
16
5
|
- Components: tip card, engagement meter, tip feed
|
|
17
6
|
|
|
18
7
|
## Notes
|
|
19
8
|
- Compose using design system components.
|
|
20
|
-
- Keep accessibility and mobile-friendly tap targets.`
|
|
21
|
-
}
|
|
22
|
-
];
|
|
23
|
-
registerDocBlocks(blocks);
|
|
9
|
+
- Keep accessibility and mobile-friendly tap targets.`}];f(h);
|
package/dist/example.js
CHANGED
|
@@ -1,33 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
|
|
3
|
-
import { defineExample } from "@contractspec/lib.contracts-spec";
|
|
4
|
-
var example = defineExample({
|
|
5
|
-
meta: {
|
|
6
|
-
key: "learning-journey-ui-coaching",
|
|
7
|
-
version: "1.0.0",
|
|
8
|
-
title: "Learning Journey UI \u2014 Coaching",
|
|
9
|
-
description: "UI mini-app for coaching patterns: tips, engagement meter, progress.",
|
|
10
|
-
kind: "ui",
|
|
11
|
-
visibility: "public",
|
|
12
|
-
stability: "experimental",
|
|
13
|
-
owners: ["@platform.core"],
|
|
14
|
-
tags: ["learning", "ui", "coaching"]
|
|
15
|
-
},
|
|
16
|
-
docs: {
|
|
17
|
-
rootDocId: "docs.examples.learning-journey-ui-coaching"
|
|
18
|
-
},
|
|
19
|
-
entrypoints: {
|
|
20
|
-
packageName: "@contractspec/example.learning-journey-ui-coaching",
|
|
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
|
-
});
|
|
30
|
-
var example_default = example;
|
|
31
|
-
export {
|
|
32
|
-
example_default as default
|
|
33
|
-
};
|
|
2
|
+
import{defineExample as g}from"@contractspec/lib.contracts-spec";var h=g({meta:{key:"learning-journey-ui-coaching",version:"1.0.0",title:"Learning Journey UI \u2014 Coaching",description:"UI mini-app for coaching patterns: tips, engagement meter, progress.",kind:"ui",visibility:"public",stability:"experimental",owners:["@platform.core"],tags:["learning","ui","coaching"]},docs:{rootDocId:"docs.examples.learning-journey-ui-coaching"},entrypoints:{packageName:"@contractspec/example.learning-journey-ui-coaching",docs:"./docs"},surfaces:{templates:!0,sandbox:{enabled:!0,modes:["playground","markdown"]},studio:{enabled:!0,installable:!0},mcp:{enabled:!0}}}),q=h;export{q as default};
|