@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.
Files changed (48) hide show
  1. package/.turbo/turbo-build.log +48 -48
  2. package/CHANGELOG.md +17 -0
  3. package/dist/CoachingMiniApp.js +1 -1059
  4. package/dist/browser/CoachingMiniApp.js +1 -1059
  5. package/dist/browser/components/EngagementMeter.js +1 -143
  6. package/dist/browser/components/TipCard.js +1 -89
  7. package/dist/browser/components/TipFeed.js +1 -90
  8. package/dist/browser/components/index.js +1 -320
  9. package/dist/browser/docs/index.js +2 -16
  10. package/dist/browser/docs/learning-journey-ui-coaching.docblock.js +2 -16
  11. package/dist/browser/example.js +1 -32
  12. package/dist/browser/index.js +2 -1129
  13. package/dist/browser/learning-journey-ui-coaching.feature.js +1 -18
  14. package/dist/browser/views/Overview.js +1 -303
  15. package/dist/browser/views/Progress.js +1 -344
  16. package/dist/browser/views/Steps.js +1 -159
  17. package/dist/browser/views/Timeline.js +1 -266
  18. package/dist/browser/views/index.js +1 -980
  19. package/dist/components/EngagementMeter.js +1 -143
  20. package/dist/components/TipCard.js +1 -89
  21. package/dist/components/TipFeed.js +1 -90
  22. package/dist/components/index.js +1 -320
  23. package/dist/docs/index.js +2 -16
  24. package/dist/docs/learning-journey-ui-coaching.docblock.js +2 -16
  25. package/dist/example.js +1 -32
  26. package/dist/index.js +2 -1129
  27. package/dist/learning-journey-ui-coaching.feature.js +1 -18
  28. package/dist/node/CoachingMiniApp.js +1 -1059
  29. package/dist/node/components/EngagementMeter.js +1 -143
  30. package/dist/node/components/TipCard.js +1 -89
  31. package/dist/node/components/TipFeed.js +1 -90
  32. package/dist/node/components/index.js +1 -320
  33. package/dist/node/docs/index.js +2 -16
  34. package/dist/node/docs/learning-journey-ui-coaching.docblock.js +2 -16
  35. package/dist/node/example.js +1 -32
  36. package/dist/node/index.js +2 -1129
  37. package/dist/node/learning-journey-ui-coaching.feature.js +1 -18
  38. package/dist/node/views/Overview.js +1 -303
  39. package/dist/node/views/Progress.js +1 -344
  40. package/dist/node/views/Steps.js +1 -159
  41. package/dist/node/views/Timeline.js +1 -266
  42. package/dist/node/views/index.js +1 -980
  43. package/dist/views/Overview.js +1 -303
  44. package/dist/views/Progress.js +1 -344
  45. package/dist/views/Steps.js +1 -159
  46. package/dist/views/Timeline.js +1 -266
  47. package/dist/views/index.js +1 -980
  48. package/package.json +11 -11
@@ -1,144 +1,2 @@
1
1
  // @bun
2
- // src/components/EngagementMeter.tsx
3
- import { jsxDEV } from "react/jsx-dev-runtime";
4
- "use client";
5
- function EngagementMeter({
6
- acknowledged,
7
- actioned,
8
- pending,
9
- streak = 0
10
- }) {
11
- const total = acknowledged + actioned + pending;
12
- const actionedPercent = total > 0 ? actioned / total * 100 : 0;
13
- const acknowledgedPercent = total > 0 ? acknowledged / total * 100 : 0;
14
- return /* @__PURE__ */ jsxDEV("div", {
15
- className: "space-y-4",
16
- children: [
17
- /* @__PURE__ */ jsxDEV("div", {
18
- className: "flex items-center justify-center",
19
- children: /* @__PURE__ */ jsxDEV("div", {
20
- className: "relative h-32 w-32",
21
- children: [
22
- /* @__PURE__ */ jsxDEV("svg", {
23
- className: "h-full w-full -rotate-90",
24
- viewBox: "0 0 100 100",
25
- children: [
26
- /* @__PURE__ */ jsxDEV("circle", {
27
- cx: "50",
28
- cy: "50",
29
- r: "40",
30
- fill: "none",
31
- strokeWidth: "12",
32
- className: "stroke-muted"
33
- }, undefined, false, undefined, this),
34
- /* @__PURE__ */ jsxDEV("circle", {
35
- cx: "50",
36
- cy: "50",
37
- r: "40",
38
- fill: "none",
39
- strokeWidth: "12",
40
- strokeLinecap: "round",
41
- strokeDasharray: `${actionedPercent * 2.51} 251`,
42
- className: "stroke-green-500 transition-all duration-500"
43
- }, undefined, false, undefined, this),
44
- /* @__PURE__ */ jsxDEV("circle", {
45
- cx: "50",
46
- cy: "50",
47
- r: "40",
48
- fill: "none",
49
- strokeWidth: "12",
50
- strokeLinecap: "round",
51
- strokeDasharray: `${acknowledgedPercent * 2.51} 251`,
52
- strokeDashoffset: `${-actionedPercent * 2.51}`,
53
- className: "stroke-amber-500 transition-all duration-500"
54
- }, undefined, false, undefined, this)
55
- ]
56
- }, undefined, true, undefined, this),
57
- /* @__PURE__ */ jsxDEV("div", {
58
- className: "absolute inset-0 flex flex-col items-center justify-center",
59
- children: [
60
- /* @__PURE__ */ jsxDEV("span", {
61
- className: "font-bold text-2xl",
62
- children: total
63
- }, undefined, false, undefined, this),
64
- /* @__PURE__ */ jsxDEV("span", {
65
- className: "text-muted-foreground text-xs",
66
- children: "tips"
67
- }, undefined, false, undefined, this)
68
- ]
69
- }, undefined, true, undefined, this)
70
- ]
71
- }, undefined, true, undefined, this)
72
- }, undefined, false, undefined, this),
73
- /* @__PURE__ */ jsxDEV("div", {
74
- className: "flex justify-center gap-4 text-sm",
75
- children: [
76
- /* @__PURE__ */ jsxDEV("div", {
77
- className: "flex items-center gap-1.5",
78
- children: [
79
- /* @__PURE__ */ jsxDEV("div", {
80
- className: "h-3 w-3 rounded-full bg-green-500"
81
- }, undefined, false, undefined, this),
82
- /* @__PURE__ */ jsxDEV("span", {
83
- children: [
84
- "Actioned (",
85
- actioned,
86
- ")"
87
- ]
88
- }, undefined, true, undefined, this)
89
- ]
90
- }, undefined, true, undefined, this),
91
- /* @__PURE__ */ jsxDEV("div", {
92
- className: "flex items-center gap-1.5",
93
- children: [
94
- /* @__PURE__ */ jsxDEV("div", {
95
- className: "h-3 w-3 rounded-full bg-amber-500"
96
- }, undefined, false, undefined, this),
97
- /* @__PURE__ */ jsxDEV("span", {
98
- children: [
99
- "Acknowledged (",
100
- acknowledged,
101
- ")"
102
- ]
103
- }, undefined, true, undefined, this)
104
- ]
105
- }, undefined, true, undefined, this),
106
- /* @__PURE__ */ jsxDEV("div", {
107
- className: "flex items-center gap-1.5",
108
- children: [
109
- /* @__PURE__ */ jsxDEV("div", {
110
- className: "h-3 w-3 rounded-full bg-muted"
111
- }, undefined, false, undefined, this),
112
- /* @__PURE__ */ jsxDEV("span", {
113
- children: [
114
- "Pending (",
115
- pending,
116
- ")"
117
- ]
118
- }, undefined, true, undefined, this)
119
- ]
120
- }, undefined, true, undefined, this)
121
- ]
122
- }, undefined, true, undefined, this),
123
- streak > 0 && /* @__PURE__ */ jsxDEV("div", {
124
- className: "flex items-center justify-center gap-2 rounded-lg bg-orange-500/10 px-4 py-2",
125
- children: [
126
- /* @__PURE__ */ jsxDEV("span", {
127
- className: "text-xl",
128
- children: "\uD83D\uDD25"
129
- }, undefined, false, undefined, this),
130
- /* @__PURE__ */ jsxDEV("span", {
131
- className: "font-semibold text-orange-500",
132
- children: [
133
- streak,
134
- " day engagement streak!"
135
- ]
136
- }, undefined, true, undefined, this)
137
- ]
138
- }, undefined, true, undefined, this)
139
- ]
140
- }, undefined, true, undefined, this);
141
- }
142
- export {
143
- EngagementMeter
144
- };
2
+ import{jsx as q,jsxs as h}from"react/jsx-runtime";function G({acknowledged:z,actioned:B,pending:C,streak:D=0}){let v=z+B+C,E=v>0?B/v*100:0,F=v>0?z/v*100:0;return h("div",{className:"space-y-4",children:[q("div",{className:"flex items-center justify-center",children:h("div",{className:"relative h-32 w-32",children:[h("svg",{className:"h-full w-full -rotate-90",viewBox:"0 0 100 100",children:[q("circle",{cx:"50",cy:"50",r:"40",fill:"none",strokeWidth:"12",className:"stroke-muted"}),q("circle",{cx:"50",cy:"50",r:"40",fill:"none",strokeWidth:"12",strokeLinecap:"round",strokeDasharray:`${E*2.51} 251`,className:"stroke-green-500 transition-all duration-500"}),q("circle",{cx:"50",cy:"50",r:"40",fill:"none",strokeWidth:"12",strokeLinecap:"round",strokeDasharray:`${F*2.51} 251`,strokeDashoffset:`${-E*2.51}`,className:"stroke-amber-500 transition-all duration-500"})]}),h("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[q("span",{className:"font-bold text-2xl",children:v}),q("span",{className:"text-muted-foreground text-xs",children:"tips"})]})]})}),h("div",{className:"flex justify-center gap-4 text-sm",children:[h("div",{className:"flex items-center gap-1.5",children:[q("div",{className:"h-3 w-3 rounded-full bg-green-500"}),h("span",{children:["Actioned (",B,")"]})]}),h("div",{className:"flex items-center gap-1.5",children:[q("div",{className:"h-3 w-3 rounded-full bg-amber-500"}),h("span",{children:["Acknowledged (",z,")"]})]}),h("div",{className:"flex items-center gap-1.5",children:[q("div",{className:"h-3 w-3 rounded-full bg-muted"}),h("span",{children:["Pending (",C,")"]})]})]}),D>0&&h("div",{className:"flex items-center justify-center gap-2 rounded-lg bg-orange-500/10 px-4 py-2",children:[q("span",{className:"text-xl",children:"\uD83D\uDD25"}),h("span",{className:"font-semibold text-orange-500",children:[D," day engagement streak!"]})]})]})}export{G as EngagementMeter};
@@ -1,90 +1,2 @@
1
1
  // @bun
2
- // src/components/TipCard.tsx
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
- export {
89
- TipCard
90
- };
2
+ import{Button as z}from"@contractspec/lib.design-system";import{Card as J,CardContent as K}from"@contractspec/lib.ui-kit-web/ui/card";import{cn as v}from"@contractspec/lib.ui-kit-web/ui/utils";import{jsx as f,jsxs as q}from"react/jsx-runtime";var A={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 R({step:h,isCompleted:g,isCurrent:y,onComplete:E,onDismiss:F}){let G=h.metadata?.tipId??"default",H=A[G]??A.default;return f(J,{className:v("transition-all",g&&"opacity-60",y&&"ring-2 ring-amber-500"),children:f(K,{className:"p-4",children:q("div",{className:"flex gap-4",children:[f("div",{className:v("flex h-12 w-12 shrink-0 items-center justify-center rounded-xl text-2xl",g?"bg-green-500/10":y?"bg-amber-500/10":"bg-muted"),children:g?"\u2713":H}),q("div",{className:"min-w-0 flex-1",children:[q("div",{className:"flex items-start justify-between gap-2",children:[f("h4",{className:"font-semibold",children:h.title}),h.xpReward&&q("span",{className:v("shrink-0 rounded-full px-2 py-0.5 font-semibold text-xs",g?"bg-green-500/10 text-green-500":"bg-amber-500/10 text-amber-500"),children:["+",h.xpReward," XP"]})]}),f("p",{className:"mt-1 text-muted-foreground text-sm",children:h.description}),!g&&q("div",{className:"mt-3 flex flex-wrap gap-2",children:[f(z,{size:"sm",onClick:E,children:"Take Action"}),f(z,{variant:"outline",size:"sm",onClick:F,children:"Dismiss"})]}),g&&f("p",{className:"mt-2 text-green-500 text-sm",children:"\u2713 Tip acknowledged"})]})]})})})}export{R as TipCard};
@@ -1,91 +1,2 @@
1
1
  // @bun
2
- // src/components/TipFeed.tsx
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
- export {
90
- TipFeed
91
- };
2
+ import{cn as v}from"@contractspec/lib.ui-kit-web/ui/utils";import{jsx as g,jsxs as h}from"react/jsx-runtime";var y={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 D({items:q}){if(q.length===0)return g("div",{className:"py-8 text-center text-muted-foreground",children:"No tips yet. Start engaging with coaching tips!"});return h("div",{className:"relative",children:[g("div",{className:"absolute top-0 left-4 h-full w-0.5 bg-border"}),g("div",{className:"space-y-4",children:q.map((f)=>{let z=f.step.metadata?.tipId??"default",A=y[z]??y.default;return h("div",{className:"relative flex gap-4 pl-2",children:[g("div",{className:v("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":A}),h("div",{className:"flex-1 rounded-lg border bg-card p-3",children:[h("div",{className:"flex items-start justify-between gap-2",children:[h("div",{children:[g("p",{className:"font-medium",children:f.step.title}),g("p",{className:"mt-0.5 text-muted-foreground text-sm",children:f.step.description})]}),f.step.xpReward&&h("span",{className:v("shrink-0 font-medium text-xs",f.isCompleted?"text-green-500":"text-muted-foreground"),children:["+",f.step.xpReward," XP"]})]}),g("div",{className:"mt-2 flex items-center gap-2 text-muted-foreground text-xs",children:f.isCompleted?h("span",{className:"text-green-500",children:["\u2713 Completed",f.completedAt&&` \u2022 ${f.completedAt}`]}):g("span",{children:"Pending action"})})]})]},f.step.id)})})]})}export{D as TipFeed};