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