@contractspec/example.learning-journey-ui-onboarding 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 +18 -0
  3. package/dist/OnboardingMiniApp.js +1 -994
  4. package/dist/browser/OnboardingMiniApp.js +1 -994
  5. package/dist/browser/components/CodeSnippet.js +1 -65
  6. package/dist/browser/components/JourneyMap.js +1 -59
  7. package/dist/browser/components/StepChecklist.js +1 -97
  8. package/dist/browser/components/index.js +1 -219
  9. package/dist/browser/docs/index.js +2 -16
  10. package/dist/browser/docs/learning-journey-ui-onboarding.docblock.js +2 -16
  11. package/dist/browser/example.js +1 -32
  12. package/dist/browser/index.js +2 -1127
  13. package/dist/browser/learning-journey-ui-onboarding.feature.js +1 -18
  14. package/dist/browser/views/Overview.js +1 -240
  15. package/dist/browser/views/Progress.js +1 -275
  16. package/dist/browser/views/Steps.js +1 -192
  17. package/dist/browser/views/Timeline.js +1 -213
  18. package/dist/browser/views/index.js +1 -915
  19. package/dist/components/CodeSnippet.js +1 -65
  20. package/dist/components/JourneyMap.js +1 -59
  21. package/dist/components/StepChecklist.js +1 -97
  22. package/dist/components/index.js +1 -219
  23. package/dist/docs/index.js +2 -16
  24. package/dist/docs/learning-journey-ui-onboarding.docblock.js +2 -16
  25. package/dist/example.js +1 -32
  26. package/dist/index.js +2 -1127
  27. package/dist/learning-journey-ui-onboarding.feature.js +1 -18
  28. package/dist/node/OnboardingMiniApp.js +1 -994
  29. package/dist/node/components/CodeSnippet.js +1 -65
  30. package/dist/node/components/JourneyMap.js +1 -59
  31. package/dist/node/components/StepChecklist.js +1 -97
  32. package/dist/node/components/index.js +1 -219
  33. package/dist/node/docs/index.js +2 -16
  34. package/dist/node/docs/learning-journey-ui-onboarding.docblock.js +2 -16
  35. package/dist/node/example.js +1 -32
  36. package/dist/node/index.js +2 -1127
  37. package/dist/node/learning-journey-ui-onboarding.feature.js +1 -18
  38. package/dist/node/views/Overview.js +1 -240
  39. package/dist/node/views/Progress.js +1 -275
  40. package/dist/node/views/Steps.js +1 -192
  41. package/dist/node/views/Timeline.js +1 -213
  42. package/dist/node/views/index.js +1 -915
  43. package/dist/views/Overview.js +1 -240
  44. package/dist/views/Progress.js +1 -275
  45. package/dist/views/Steps.js +1 -192
  46. package/dist/views/Timeline.js +1 -213
  47. package/dist/views/index.js +1 -915
  48. package/package.json +11 -11
@@ -1,193 +1,2 @@
1
1
  // @bun
2
- // src/components/StepChecklist.tsx
3
- import { Button } from "@contractspec/lib.design-system";
4
- import { cn } from "@contractspec/lib.ui-kit-core";
5
- import { jsxDEV } from "react/jsx-dev-runtime";
6
- "use client";
7
- function StepChecklist({
8
- step,
9
- stepNumber,
10
- isCompleted,
11
- isCurrent,
12
- isExpanded,
13
- onToggle,
14
- onComplete
15
- }) {
16
- return /* @__PURE__ */ jsxDEV("div", {
17
- className: cn("rounded-xl border transition-all", isCompleted && "border-green-500/50 bg-green-500/5", isCurrent && !isCompleted && "border-violet-500 bg-violet-500/5", !isCompleted && !isCurrent && "border-border"),
18
- children: [
19
- /* @__PURE__ */ jsxDEV("button", {
20
- type: "button",
21
- className: "flex w-full items-center gap-4 p-4 text-left",
22
- onClick: onToggle,
23
- children: [
24
- /* @__PURE__ */ jsxDEV("div", {
25
- className: cn("flex h-8 w-8 shrink-0 items-center justify-center rounded-full border-2 font-semibold text-sm transition-colors", isCompleted && "border-green-500 bg-green-500 text-white", isCurrent && !isCompleted && "border-violet-500 text-violet-500", !isCompleted && !isCurrent && "border-muted-foreground text-muted-foreground"),
26
- children: isCompleted ? "\u2713" : stepNumber
27
- }, undefined, false, undefined, this),
28
- /* @__PURE__ */ jsxDEV("div", {
29
- className: "min-w-0 flex-1",
30
- children: [
31
- /* @__PURE__ */ jsxDEV("h4", {
32
- className: cn("font-semibold", isCompleted && "text-green-500", isCurrent && !isCompleted && "text-foreground", !isCompleted && !isCurrent && "text-muted-foreground"),
33
- children: step.title
34
- }, undefined, false, undefined, this),
35
- !isExpanded && step.description && /* @__PURE__ */ jsxDEV("p", {
36
- className: "truncate text-muted-foreground text-sm",
37
- children: step.description
38
- }, undefined, false, undefined, this)
39
- ]
40
- }, undefined, true, undefined, this),
41
- step.xpReward && /* @__PURE__ */ jsxDEV("span", {
42
- className: cn("shrink-0 rounded-full px-2 py-1 font-semibold text-xs", isCompleted ? "bg-green-500/10 text-green-500" : "bg-muted text-muted-foreground"),
43
- children: [
44
- "+",
45
- step.xpReward,
46
- " XP"
47
- ]
48
- }, undefined, true, undefined, this),
49
- /* @__PURE__ */ jsxDEV("span", {
50
- className: cn("shrink-0 transition-transform", isExpanded && "rotate-180"),
51
- children: "\u25BC"
52
- }, undefined, false, undefined, this)
53
- ]
54
- }, undefined, true, undefined, this),
55
- isExpanded && /* @__PURE__ */ jsxDEV("div", {
56
- className: "border-t px-4 py-4",
57
- children: [
58
- step.description && /* @__PURE__ */ jsxDEV("p", {
59
- className: "mb-4 text-muted-foreground",
60
- children: step.description
61
- }, undefined, false, undefined, this),
62
- step.instructions && /* @__PURE__ */ jsxDEV("div", {
63
- className: "mb-4 rounded-lg bg-muted p-4",
64
- children: [
65
- /* @__PURE__ */ jsxDEV("p", {
66
- className: "mb-2 font-medium text-sm",
67
- children: "Instructions:"
68
- }, undefined, false, undefined, this),
69
- /* @__PURE__ */ jsxDEV("p", {
70
- className: "text-muted-foreground text-sm",
71
- children: step.instructions
72
- }, undefined, false, undefined, this)
73
- ]
74
- }, undefined, true, undefined, this),
75
- /* @__PURE__ */ jsxDEV("div", {
76
- className: "flex flex-wrap gap-2",
77
- children: [
78
- step.actionUrl && /* @__PURE__ */ jsxDEV(Button, {
79
- variant: "outline",
80
- size: "sm",
81
- onClick: () => window.open(step.actionUrl, "_blank"),
82
- children: step.actionLabel ?? "Try it"
83
- }, undefined, false, undefined, this),
84
- !isCompleted && /* @__PURE__ */ jsxDEV(Button, {
85
- size: "sm",
86
- onClick: onComplete,
87
- children: "Mark as Complete"
88
- }, undefined, false, undefined, this)
89
- ]
90
- }, undefined, true, undefined, this)
91
- ]
92
- }, undefined, true, undefined, this)
93
- ]
94
- }, undefined, true, undefined, this);
95
- }
96
-
97
- // src/views/Steps.tsx
98
- import { Progress } from "@contractspec/lib.ui-kit-web/ui/progress";
99
- import { useState } from "react";
100
- import { jsxDEV as jsxDEV2 } from "react/jsx-dev-runtime";
101
- "use client";
102
- function Steps({ track, progress, onStepComplete }) {
103
- const [expandedStepId, setExpandedStepId] = useState(() => {
104
- const firstIncomplete = track.steps.find((s) => !progress.completedStepIds.includes(s.id));
105
- return firstIncomplete?.id ?? null;
106
- });
107
- const completedSteps = progress.completedStepIds.length;
108
- const totalSteps = track.steps.length;
109
- const percentComplete = totalSteps > 0 ? completedSteps / totalSteps * 100 : 0;
110
- const currentStepIndex = track.steps.findIndex((s) => !progress.completedStepIds.includes(s.id));
111
- return /* @__PURE__ */ jsxDEV2("div", {
112
- className: "space-y-6",
113
- children: [
114
- /* @__PURE__ */ jsxDEV2("div", {
115
- className: "space-y-2",
116
- children: [
117
- /* @__PURE__ */ jsxDEV2("div", {
118
- className: "flex items-center justify-between",
119
- children: [
120
- /* @__PURE__ */ jsxDEV2("h2", {
121
- className: "font-bold text-xl",
122
- children: "Complete Each Step"
123
- }, undefined, false, undefined, this),
124
- /* @__PURE__ */ jsxDEV2("span", {
125
- className: "text-muted-foreground text-sm",
126
- children: [
127
- completedSteps,
128
- " / ",
129
- totalSteps,
130
- " completed"
131
- ]
132
- }, undefined, true, undefined, this)
133
- ]
134
- }, undefined, true, undefined, this),
135
- /* @__PURE__ */ jsxDEV2(Progress, {
136
- value: percentComplete,
137
- className: "h-2"
138
- }, undefined, false, undefined, this)
139
- ]
140
- }, undefined, true, undefined, this),
141
- /* @__PURE__ */ jsxDEV2("div", {
142
- className: "space-y-3",
143
- children: track.steps.map((step, index) => {
144
- const isCompleted = progress.completedStepIds.includes(step.id);
145
- const isCurrent = index === currentStepIndex;
146
- return /* @__PURE__ */ jsxDEV2(StepChecklist, {
147
- step,
148
- stepNumber: index + 1,
149
- isCompleted,
150
- isCurrent,
151
- isExpanded: expandedStepId === step.id,
152
- onToggle: () => setExpandedStepId(expandedStepId === step.id ? null : step.id),
153
- onComplete: () => {
154
- onStepComplete?.(step.id);
155
- const nextStep = track.steps[index + 1];
156
- if (nextStep && !progress.completedStepIds.includes(nextStep.id)) {
157
- setExpandedStepId(nextStep.id);
158
- }
159
- }
160
- }, step.id, false, undefined, this);
161
- })
162
- }, undefined, false, undefined, this),
163
- track.completionRewards && percentComplete < 100 && /* @__PURE__ */ jsxDEV2("div", {
164
- className: "rounded-lg border border-blue-500/30 bg-blue-500/5 p-4",
165
- children: /* @__PURE__ */ jsxDEV2("p", {
166
- className: "text-sm",
167
- children: [
168
- "\uD83C\uDF81 Complete all steps to unlock:",
169
- track.completionRewards.xpBonus && /* @__PURE__ */ jsxDEV2("span", {
170
- className: "ml-2 font-semibold text-blue-500",
171
- children: [
172
- "+",
173
- track.completionRewards.xpBonus,
174
- " XP bonus"
175
- ]
176
- }, undefined, true, undefined, this),
177
- track.completionRewards.badgeKey && /* @__PURE__ */ jsxDEV2("span", {
178
- className: "ml-2 font-semibold text-amber-500",
179
- children: [
180
- '+ "',
181
- track.completionRewards.badgeKey,
182
- '" badge'
183
- ]
184
- }, undefined, true, undefined, this)
185
- ]
186
- }, undefined, true, undefined, this)
187
- }, undefined, false, undefined, this)
188
- ]
189
- }, undefined, true, undefined, this);
190
- }
191
- export {
192
- Steps
193
- };
2
+ import{Button as c}from"@contractspec/lib.design-system";import{cn as e}from"@contractspec/lib.ui-kit-core";import{jsx as u,jsxs as m}from"react/jsx-runtime";function y({step:n,stepNumber:r,isCompleted:o,isCurrent:l,isExpanded:a,onToggle:g,onComplete:f}){return m("div",{className:e("rounded-xl border transition-all",o&&"border-green-500/50 bg-green-500/5",l&&!o&&"border-violet-500 bg-violet-500/5",!o&&!l&&"border-border"),children:[m("button",{type:"button",className:"flex w-full items-center gap-4 p-4 text-left",onClick:g,children:[u("div",{className:e("flex h-8 w-8 shrink-0 items-center justify-center rounded-full border-2 font-semibold text-sm transition-colors",o&&"border-green-500 bg-green-500 text-white",l&&!o&&"border-violet-500 text-violet-500",!o&&!l&&"border-muted-foreground text-muted-foreground"),children:o?"\u2713":r}),m("div",{className:"min-w-0 flex-1",children:[u("h4",{className:e("font-semibold",o&&"text-green-500",l&&!o&&"text-foreground",!o&&!l&&"text-muted-foreground"),children:n.title}),!a&&n.description&&u("p",{className:"truncate text-muted-foreground text-sm",children:n.description})]}),n.xpReward&&m("span",{className:e("shrink-0 rounded-full px-2 py-1 font-semibold text-xs",o?"bg-green-500/10 text-green-500":"bg-muted text-muted-foreground"),children:["+",n.xpReward," XP"]}),u("span",{className:e("shrink-0 transition-transform",a&&"rotate-180"),children:"\u25BC"})]}),a&&m("div",{className:"border-t px-4 py-4",children:[n.description&&u("p",{className:"mb-4 text-muted-foreground",children:n.description}),n.instructions&&m("div",{className:"mb-4 rounded-lg bg-muted p-4",children:[u("p",{className:"mb-2 font-medium text-sm",children:"Instructions:"}),u("p",{className:"text-muted-foreground text-sm",children:n.instructions})]}),m("div",{className:"flex flex-wrap gap-2",children:[n.actionUrl&&u(c,{variant:"outline",size:"sm",onClick:()=>window.open(n.actionUrl,"_blank"),children:n.actionLabel??"Try it"}),!o&&u(c,{size:"sm",onClick:f,children:"Mark as Complete"})]})]})]})}import{Progress as L}from"@contractspec/lib.ui-kit-web/ui/progress";import{useState as z}from"react";import{jsx as v,jsxs as b}from"react/jsx-runtime";function _({track:n,progress:r,onStepComplete:o}){let[l,a]=z(()=>{return n.steps.find((d)=>!r.completedStepIds.includes(d.id))?.id??null}),g=r.completedStepIds.length,f=n.steps.length,N=f>0?g/f*100:0,h=n.steps.findIndex((i)=>!r.completedStepIds.includes(i.id));return b("div",{className:"space-y-6",children:[b("div",{className:"space-y-2",children:[b("div",{className:"flex items-center justify-between",children:[v("h2",{className:"font-bold text-xl",children:"Complete Each Step"}),b("span",{className:"text-muted-foreground text-sm",children:[g," / ",f," completed"]})]}),v(L,{value:N,className:"h-2"})]}),v("div",{className:"space-y-3",children:n.steps.map((i,d)=>{let w=r.completedStepIds.includes(i.id),B=d===h;return v(y,{step:i,stepNumber:d+1,isCompleted:w,isCurrent:B,isExpanded:l===i.id,onToggle:()=>a(l===i.id?null:i.id),onComplete:()=>{o?.(i.id);let t=n.steps[d+1];if(t&&!r.completedStepIds.includes(t.id))a(t.id)}},i.id)})}),n.completionRewards&&N<100&&v("div",{className:"rounded-lg border border-blue-500/30 bg-blue-500/5 p-4",children:b("p",{className:"text-sm",children:["\uD83C\uDF81 Complete all steps to unlock:",n.completionRewards.xpBonus&&b("span",{className:"ml-2 font-semibold text-blue-500",children:["+",n.completionRewards.xpBonus," XP bonus"]}),n.completionRewards.badgeKey&&b("span",{className:"ml-2 font-semibold text-amber-500",children:['+ "',n.completionRewards.badgeKey,'" badge']})]})})]})}export{_ as Steps};
@@ -1,214 +1,2 @@
1
1
  // @bun
2
- // src/components/JourneyMap.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 SURFACE_ICONS = {
7
- templates: "\uD83D\uDCCB",
8
- "spec-editor": "\u270F\uFE0F",
9
- regenerator: "\uD83D\uDD04",
10
- playground: "\uD83C\uDFAE",
11
- evolution: "\uD83E\uDD16",
12
- dashboard: "\uD83D\uDCCA",
13
- settings: "\u2699\uFE0F",
14
- default: "\uD83D\uDCCD"
15
- };
16
- function JourneyMap({
17
- steps,
18
- completedStepIds,
19
- currentStepId
20
- }) {
21
- return /* @__PURE__ */ jsxDEV("div", {
22
- className: "relative overflow-x-auto pb-4",
23
- children: /* @__PURE__ */ jsxDEV("div", {
24
- className: "flex min-w-max items-center gap-2",
25
- children: steps.map((step, index) => {
26
- const isCompleted = completedStepIds.includes(step.id);
27
- const isCurrent = step.id === currentStepId;
28
- const surface = step.metadata?.surface ?? "default";
29
- const icon = SURFACE_ICONS[surface] ?? SURFACE_ICONS.default;
30
- return /* @__PURE__ */ jsxDEV("div", {
31
- className: "flex items-center",
32
- children: [
33
- /* @__PURE__ */ jsxDEV("div", {
34
- className: "flex flex-col items-center gap-2",
35
- children: [
36
- /* @__PURE__ */ jsxDEV("div", {
37
- className: cn("flex h-14 w-14 items-center justify-center rounded-2xl border-2 text-2xl transition-all", isCompleted && "border-green-500 bg-green-500/10", isCurrent && !isCompleted && "border-violet-500 bg-violet-500/10 ring-4 ring-violet-500/20", !isCompleted && !isCurrent && "border-muted bg-muted/50"),
38
- children: isCompleted ? "\u2713" : icon
39
- }, undefined, false, undefined, this),
40
- /* @__PURE__ */ jsxDEV("div", {
41
- className: "text-center",
42
- children: /* @__PURE__ */ jsxDEV("p", {
43
- className: cn("max-w-[100px] truncate font-medium text-xs", isCompleted && "text-green-500", isCurrent && !isCompleted && "text-violet-500", !isCompleted && !isCurrent && "text-muted-foreground"),
44
- children: step.title
45
- }, undefined, false, undefined, this)
46
- }, undefined, false, undefined, this)
47
- ]
48
- }, undefined, true, undefined, this),
49
- index < steps.length - 1 && /* @__PURE__ */ jsxDEV("div", {
50
- className: cn("mx-2 h-1 w-8 rounded-full transition-colors", completedStepIds.includes(steps[index + 1]?.id ?? "") ? "bg-green-500" : isCompleted ? "bg-green-500/50" : "bg-muted")
51
- }, undefined, false, undefined, this)
52
- ]
53
- }, step.id, true, undefined, this);
54
- })
55
- }, undefined, false, undefined, this)
56
- }, undefined, false, undefined, this);
57
- }
58
-
59
- // src/views/Timeline.tsx
60
- import {
61
- Card,
62
- CardContent,
63
- CardHeader,
64
- CardTitle
65
- } from "@contractspec/lib.ui-kit-web/ui/card";
66
- import { jsxDEV as jsxDEV2 } from "react/jsx-dev-runtime";
67
- "use client";
68
- function Timeline({ track, progress }) {
69
- const currentStepId = track.steps.find((s) => !progress.completedStepIds.includes(s.id))?.id ?? null;
70
- return /* @__PURE__ */ jsxDEV2("div", {
71
- className: "space-y-6",
72
- children: [
73
- /* @__PURE__ */ jsxDEV2("div", {
74
- className: "text-center",
75
- children: [
76
- /* @__PURE__ */ jsxDEV2("h2", {
77
- className: "font-bold text-xl",
78
- children: "Your Learning Journey"
79
- }, undefined, false, undefined, this),
80
- /* @__PURE__ */ jsxDEV2("p", {
81
- className: "text-muted-foreground",
82
- children: "Follow the path through each surface and feature"
83
- }, undefined, false, undefined, this)
84
- ]
85
- }, undefined, true, undefined, this),
86
- /* @__PURE__ */ jsxDEV2(Card, {
87
- children: [
88
- /* @__PURE__ */ jsxDEV2(CardHeader, {
89
- children: /* @__PURE__ */ jsxDEV2(CardTitle, {
90
- className: "flex items-center gap-2",
91
- children: [
92
- /* @__PURE__ */ jsxDEV2("span", {
93
- children: "\uD83D\uDDFA\uFE0F"
94
- }, undefined, false, undefined, this),
95
- /* @__PURE__ */ jsxDEV2("span", {
96
- children: "Journey Map"
97
- }, undefined, false, undefined, this)
98
- ]
99
- }, undefined, true, undefined, this)
100
- }, undefined, false, undefined, this),
101
- /* @__PURE__ */ jsxDEV2(CardContent, {
102
- children: /* @__PURE__ */ jsxDEV2(JourneyMap, {
103
- steps: track.steps,
104
- completedStepIds: progress.completedStepIds,
105
- currentStepId
106
- }, undefined, false, undefined, this)
107
- }, undefined, false, undefined, this)
108
- ]
109
- }, undefined, true, undefined, this),
110
- /* @__PURE__ */ jsxDEV2(Card, {
111
- children: [
112
- /* @__PURE__ */ jsxDEV2(CardHeader, {
113
- children: /* @__PURE__ */ jsxDEV2(CardTitle, {
114
- className: "flex items-center gap-2",
115
- children: [
116
- /* @__PURE__ */ jsxDEV2("span", {
117
- children: "\uD83D\uDCCD"
118
- }, undefined, false, undefined, this),
119
- /* @__PURE__ */ jsxDEV2("span", {
120
- children: "Step by Step"
121
- }, undefined, false, undefined, this)
122
- ]
123
- }, undefined, true, undefined, this)
124
- }, undefined, false, undefined, this),
125
- /* @__PURE__ */ jsxDEV2(CardContent, {
126
- children: /* @__PURE__ */ jsxDEV2("div", {
127
- className: "relative",
128
- children: [
129
- /* @__PURE__ */ jsxDEV2("div", {
130
- className: "absolute top-0 left-4 h-full w-0.5 bg-border"
131
- }, undefined, false, undefined, this),
132
- /* @__PURE__ */ jsxDEV2("div", {
133
- className: "space-y-6",
134
- children: track.steps.map((step, index) => {
135
- const isCompleted = progress.completedStepIds.includes(step.id);
136
- const isCurrent = step.id === currentStepId;
137
- const surface = step.metadata?.surface ?? "general";
138
- return /* @__PURE__ */ jsxDEV2("div", {
139
- className: "relative flex gap-4 pl-2",
140
- children: [
141
- /* @__PURE__ */ jsxDEV2("div", {
142
- className: `relative z-10 flex h-8 w-8 shrink-0 items-center justify-center rounded-full border-2 transition-all ${isCompleted ? "border-green-500 bg-green-500 text-white" : isCurrent ? "border-blue-500 bg-blue-500 text-white ring-4 ring-blue-500/20" : "border-border bg-background text-muted-foreground"}`,
143
- children: isCompleted ? "\u2713" : index + 1
144
- }, undefined, false, undefined, this),
145
- /* @__PURE__ */ jsxDEV2("div", {
146
- className: "flex-1 pb-2",
147
- children: /* @__PURE__ */ jsxDEV2("div", {
148
- className: "rounded-lg border p-4",
149
- children: [
150
- /* @__PURE__ */ jsxDEV2("div", {
151
- className: "flex items-start justify-between gap-2",
152
- children: [
153
- /* @__PURE__ */ jsxDEV2("div", {
154
- children: [
155
- /* @__PURE__ */ jsxDEV2("div", {
156
- className: "flex items-center gap-2",
157
- children: [
158
- /* @__PURE__ */ jsxDEV2("h4", {
159
- className: `font-semibold ${isCompleted ? "text-green-500" : isCurrent ? "text-blue-500" : "text-foreground"}`,
160
- children: step.title
161
- }, undefined, false, undefined, this),
162
- /* @__PURE__ */ jsxDEV2("span", {
163
- className: "rounded bg-muted px-2 py-0.5 text-muted-foreground text-xs",
164
- children: surface
165
- }, undefined, false, undefined, this)
166
- ]
167
- }, undefined, true, undefined, this),
168
- /* @__PURE__ */ jsxDEV2("p", {
169
- className: "mt-1 text-muted-foreground text-sm",
170
- children: step.description
171
- }, undefined, false, undefined, this)
172
- ]
173
- }, undefined, true, undefined, this),
174
- step.xpReward && /* @__PURE__ */ jsxDEV2("span", {
175
- className: `shrink-0 rounded-full px-2 py-1 font-semibold text-xs ${isCompleted ? "bg-green-500/10 text-green-500" : "bg-muted text-muted-foreground"}`,
176
- children: [
177
- "+",
178
- step.xpReward,
179
- " XP"
180
- ]
181
- }, undefined, true, undefined, this)
182
- ]
183
- }, undefined, true, undefined, this),
184
- /* @__PURE__ */ jsxDEV2("div", {
185
- className: "mt-3 text-xs",
186
- children: isCompleted ? /* @__PURE__ */ jsxDEV2("span", {
187
- className: "text-green-500",
188
- children: "\u2713 Completed"
189
- }, undefined, false, undefined, this) : isCurrent ? /* @__PURE__ */ jsxDEV2("span", {
190
- className: "text-blue-500",
191
- children: "\u2192 In Progress"
192
- }, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV2("span", {
193
- className: "text-muted-foreground",
194
- children: "\u25CB Not Started"
195
- }, undefined, false, undefined, this)
196
- }, undefined, false, undefined, this)
197
- ]
198
- }, undefined, true, undefined, this)
199
- }, undefined, false, undefined, this)
200
- ]
201
- }, step.id, true, undefined, this);
202
- })
203
- }, undefined, false, undefined, this)
204
- ]
205
- }, undefined, true, undefined, this)
206
- }, undefined, false, undefined, this)
207
- ]
208
- }, undefined, true, undefined, this)
209
- ]
210
- }, undefined, true, undefined, this);
211
- }
212
- export {
213
- Timeline
214
- };
2
+ import{cn as V}from"@contractspec/lib.ui-kit-web/ui/utils";import{jsx as K,jsxs as X}from"react/jsx-runtime";var W={templates:"\uD83D\uDCCB","spec-editor":"\u270F\uFE0F",regenerator:"\uD83D\uDD04",playground:"\uD83C\uDFAE",evolution:"\uD83E\uDD16",dashboard:"\uD83D\uDCCA",settings:"\u2699\uFE0F",default:"\uD83D\uDCCD"};function Y({steps:D,completedStepIds:G,currentStepId:L}){return K("div",{className:"relative overflow-x-auto pb-4",children:K("div",{className:"flex min-w-max items-center gap-2",children:D.map((q,P)=>{let v=G.includes(q.id),B=q.id===L,Q=q.metadata?.surface??"default",y=W[Q]??W.default;return X("div",{className:"flex items-center",children:[X("div",{className:"flex flex-col items-center gap-2",children:[K("div",{className:V("flex h-14 w-14 items-center justify-center rounded-2xl border-2 text-2xl transition-all",v&&"border-green-500 bg-green-500/10",B&&!v&&"border-violet-500 bg-violet-500/10 ring-4 ring-violet-500/20",!v&&!B&&"border-muted bg-muted/50"),children:v?"\u2713":y}),K("div",{className:"text-center",children:K("p",{className:V("max-w-[100px] truncate font-medium text-xs",v&&"text-green-500",B&&!v&&"text-violet-500",!v&&!B&&"text-muted-foreground"),children:q.title})})]}),P<D.length-1&&K("div",{className:V("mx-2 h-1 w-8 rounded-full transition-colors",G.includes(D[P+1]?.id??"")?"bg-green-500":v?"bg-green-500/50":"bg-muted")})]},q.id)})})})}import{Card as Z,CardContent as $,CardHeader as f,CardTitle as w}from"@contractspec/lib.ui-kit-web/ui/card";import{jsx as h,jsxs as z}from"react/jsx-runtime";function M({track:D,progress:G}){let L=D.steps.find((q)=>!G.completedStepIds.includes(q.id))?.id??null;return z("div",{className:"space-y-6",children:[z("div",{className:"text-center",children:[h("h2",{className:"font-bold text-xl",children:"Your Learning Journey"}),h("p",{className:"text-muted-foreground",children:"Follow the path through each surface and feature"})]}),z(Z,{children:[h(f,{children:z(w,{className:"flex items-center gap-2",children:[h("span",{children:"\uD83D\uDDFA\uFE0F"}),h("span",{children:"Journey Map"})]})}),h($,{children:h(Y,{steps:D.steps,completedStepIds:G.completedStepIds,currentStepId:L})})]}),z(Z,{children:[h(f,{children:z(w,{className:"flex items-center gap-2",children:[h("span",{children:"\uD83D\uDCCD"}),h("span",{children:"Step by Step"})]})}),h($,{children:z("div",{className:"relative",children:[h("div",{className:"absolute top-0 left-4 h-full w-0.5 bg-border"}),h("div",{className:"space-y-6",children:D.steps.map((q,P)=>{let v=G.completedStepIds.includes(q.id),B=q.id===L,Q=q.metadata?.surface??"general";return z("div",{className:"relative flex gap-4 pl-2",children:[h("div",{className:`relative z-10 flex h-8 w-8 shrink-0 items-center justify-center rounded-full border-2 transition-all ${v?"border-green-500 bg-green-500 text-white":B?"border-blue-500 bg-blue-500 text-white ring-4 ring-blue-500/20":"border-border bg-background text-muted-foreground"}`,children:v?"\u2713":P+1}),h("div",{className:"flex-1 pb-2",children:z("div",{className:"rounded-lg border p-4",children:[z("div",{className:"flex items-start justify-between gap-2",children:[z("div",{children:[z("div",{className:"flex items-center gap-2",children:[h("h4",{className:`font-semibold ${v?"text-green-500":B?"text-blue-500":"text-foreground"}`,children:q.title}),h("span",{className:"rounded bg-muted px-2 py-0.5 text-muted-foreground text-xs",children:Q})]}),h("p",{className:"mt-1 text-muted-foreground text-sm",children:q.description})]}),q.xpReward&&z("span",{className:`shrink-0 rounded-full px-2 py-1 font-semibold text-xs ${v?"bg-green-500/10 text-green-500":"bg-muted text-muted-foreground"}`,children:["+",q.xpReward," XP"]})]}),h("div",{className:"mt-3 text-xs",children:v?h("span",{className:"text-green-500",children:"\u2713 Completed"}):B?h("span",{className:"text-blue-500",children:"\u2192 In Progress"}):h("span",{className:"text-muted-foreground",children:"\u25CB Not Started"})})]})})]},q.id)})})]})})]})]})}export{M as Timeline};