@contractspec/example.learning-journey-ui-onboarding 1.57.0 → 1.58.0

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 (87) hide show
  1. package/.turbo/turbo-build.log +58 -62
  2. package/.turbo/turbo-prebuild.log +1 -0
  3. package/CHANGELOG.md +19 -0
  4. package/dist/OnboardingMiniApp.d.ts +4 -14
  5. package/dist/OnboardingMiniApp.d.ts.map +1 -1
  6. package/dist/OnboardingMiniApp.js +991 -59
  7. package/dist/browser/OnboardingMiniApp.js +994 -0
  8. package/dist/browser/components/CodeSnippet.js +65 -0
  9. package/dist/browser/components/JourneyMap.js +59 -0
  10. package/dist/browser/components/StepChecklist.js +97 -0
  11. package/dist/browser/components/index.js +219 -0
  12. package/dist/browser/docs/index.js +22 -0
  13. package/dist/browser/docs/learning-journey-ui-onboarding.docblock.js +22 -0
  14. package/dist/browser/example.js +32 -0
  15. package/dist/browser/index.js +1116 -0
  16. package/dist/browser/views/Overview.js +240 -0
  17. package/dist/browser/views/Progress.js +275 -0
  18. package/dist/browser/views/Steps.js +192 -0
  19. package/dist/browser/views/Timeline.js +213 -0
  20. package/dist/browser/views/index.js +915 -0
  21. package/dist/components/CodeSnippet.d.ts +5 -13
  22. package/dist/components/CodeSnippet.d.ts.map +1 -1
  23. package/dist/components/CodeSnippet.js +63 -47
  24. package/dist/components/JourneyMap.d.ts +6 -14
  25. package/dist/components/JourneyMap.d.ts.map +1 -1
  26. package/dist/components/JourneyMap.js +57 -46
  27. package/dist/components/StepChecklist.d.ts +10 -22
  28. package/dist/components/StepChecklist.d.ts.map +1 -1
  29. package/dist/components/StepChecklist.js +95 -77
  30. package/dist/components/index.d.ts +4 -4
  31. package/dist/components/index.d.ts.map +1 -0
  32. package/dist/components/index.js +219 -4
  33. package/dist/docs/index.d.ts +2 -1
  34. package/dist/docs/index.d.ts.map +1 -0
  35. package/dist/docs/index.js +23 -1
  36. package/dist/docs/learning-journey-ui-onboarding.docblock.d.ts +2 -1
  37. package/dist/docs/learning-journey-ui-onboarding.docblock.d.ts.map +1 -0
  38. package/dist/docs/learning-journey-ui-onboarding.docblock.js +21 -18
  39. package/dist/example.d.ts +2 -6
  40. package/dist/example.d.ts.map +1 -1
  41. package/dist/example.js +31 -39
  42. package/dist/index.d.ts +6 -12
  43. package/dist/index.d.ts.map +1 -0
  44. package/dist/index.js +1117 -14
  45. package/dist/node/OnboardingMiniApp.js +994 -0
  46. package/dist/node/components/CodeSnippet.js +65 -0
  47. package/dist/node/components/JourneyMap.js +59 -0
  48. package/dist/node/components/StepChecklist.js +97 -0
  49. package/dist/node/components/index.js +219 -0
  50. package/dist/node/docs/index.js +22 -0
  51. package/dist/node/docs/learning-journey-ui-onboarding.docblock.js +22 -0
  52. package/dist/node/example.js +32 -0
  53. package/dist/node/index.js +1116 -0
  54. package/dist/node/views/Overview.js +240 -0
  55. package/dist/node/views/Progress.js +275 -0
  56. package/dist/node/views/Steps.js +192 -0
  57. package/dist/node/views/Timeline.js +213 -0
  58. package/dist/node/views/index.js +915 -0
  59. package/dist/views/Overview.d.ts +4 -12
  60. package/dist/views/Overview.d.ts.map +1 -1
  61. package/dist/views/Overview.js +238 -177
  62. package/dist/views/Progress.d.ts +3 -10
  63. package/dist/views/Progress.d.ts.map +1 -1
  64. package/dist/views/Progress.js +273 -158
  65. package/dist/views/Steps.d.ts +2 -11
  66. package/dist/views/Steps.d.ts.map +1 -1
  67. package/dist/views/Steps.js +188 -87
  68. package/dist/views/Timeline.d.ts +2 -10
  69. package/dist/views/Timeline.d.ts.map +1 -1
  70. package/dist/views/Timeline.js +211 -95
  71. package/dist/views/index.d.ts +5 -5
  72. package/dist/views/index.d.ts.map +1 -0
  73. package/dist/views/index.js +915 -5
  74. package/package.json +155 -39
  75. package/tsdown.config.js +1 -2
  76. package/.turbo/turbo-build$colon$bundle.log +0 -59
  77. package/dist/OnboardingMiniApp.js.map +0 -1
  78. package/dist/components/CodeSnippet.js.map +0 -1
  79. package/dist/components/JourneyMap.js.map +0 -1
  80. package/dist/components/StepChecklist.js.map +0 -1
  81. package/dist/docs/learning-journey-ui-onboarding.docblock.js.map +0 -1
  82. package/dist/example.js.map +0 -1
  83. package/dist/views/Overview.js.map +0 -1
  84. package/dist/views/Progress.js.map +0 -1
  85. package/dist/views/Steps.js.map +0 -1
  86. package/dist/views/Timeline.js.map +0 -1
  87. package/tsconfig.tsbuildinfo +0 -1
@@ -0,0 +1,65 @@
1
+ // src/components/CodeSnippet.tsx
2
+ import { useState } from "react";
3
+ import { Button } from "@contractspec/lib.design-system";
4
+ import { jsxDEV, Fragment } from "react/jsx-dev-runtime";
5
+ "use client";
6
+ function CodeSnippet({
7
+ code,
8
+ language = "typescript",
9
+ title
10
+ }) {
11
+ const [copied, setCopied] = useState(false);
12
+ const handleCopy = async () => {
13
+ await navigator.clipboard.writeText(code);
14
+ setCopied(true);
15
+ setTimeout(() => setCopied(false), 2000);
16
+ };
17
+ return /* @__PURE__ */ jsxDEV("div", {
18
+ className: "bg-muted/50 overflow-hidden rounded-lg border",
19
+ children: [
20
+ /* @__PURE__ */ jsxDEV("div", {
21
+ className: "bg-muted flex items-center justify-between border-b px-4 py-2",
22
+ children: [
23
+ /* @__PURE__ */ jsxDEV("div", {
24
+ className: "flex items-center gap-2",
25
+ children: [
26
+ /* @__PURE__ */ jsxDEV("span", {
27
+ className: "text-muted-foreground text-xs font-medium uppercase",
28
+ children: language
29
+ }, undefined, false, undefined, this),
30
+ title && /* @__PURE__ */ jsxDEV(Fragment, {
31
+ children: [
32
+ /* @__PURE__ */ jsxDEV("span", {
33
+ className: "text-muted-foreground",
34
+ children: "•"
35
+ }, undefined, false, undefined, this),
36
+ /* @__PURE__ */ jsxDEV("span", {
37
+ className: "text-sm",
38
+ children: title
39
+ }, undefined, false, undefined, this)
40
+ ]
41
+ }, undefined, true, undefined, this)
42
+ ]
43
+ }, undefined, true, undefined, this),
44
+ /* @__PURE__ */ jsxDEV(Button, {
45
+ variant: "ghost",
46
+ size: "sm",
47
+ onClick: handleCopy,
48
+ className: "h-7 text-xs",
49
+ children: copied ? "✓ Copied" : "Copy"
50
+ }, undefined, false, undefined, this)
51
+ ]
52
+ }, undefined, true, undefined, this),
53
+ /* @__PURE__ */ jsxDEV("pre", {
54
+ className: "overflow-x-auto p-4",
55
+ children: /* @__PURE__ */ jsxDEV("code", {
56
+ className: "text-sm",
57
+ children: code
58
+ }, undefined, false, undefined, this)
59
+ }, undefined, false, undefined, this)
60
+ ]
61
+ }, undefined, true, undefined, this);
62
+ }
63
+ export {
64
+ CodeSnippet
65
+ };
@@ -0,0 +1,59 @@
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 text-xs font-medium", 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
+ export {
58
+ JourneyMap
59
+ };
@@ -0,0 +1,97 @@
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 text-sm font-semibold 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: "text-muted-foreground truncate 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 text-xs font-semibold", 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: "text-muted-foreground mb-4",
59
+ children: step.description
60
+ }, undefined, false, undefined, this),
61
+ step.instructions && /* @__PURE__ */ jsxDEV("div", {
62
+ className: "bg-muted mb-4 rounded-lg p-4",
63
+ children: [
64
+ /* @__PURE__ */ jsxDEV("p", {
65
+ className: "mb-2 text-sm font-medium",
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
+ export {
96
+ StepChecklist
97
+ };
@@ -0,0 +1,219 @@
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 text-sm font-semibold 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: "text-muted-foreground truncate 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 text-xs font-semibold", 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: "text-muted-foreground mb-4",
59
+ children: step.description
60
+ }, undefined, false, undefined, this),
61
+ step.instructions && /* @__PURE__ */ jsxDEV("div", {
62
+ className: "bg-muted mb-4 rounded-lg p-4",
63
+ children: [
64
+ /* @__PURE__ */ jsxDEV("p", {
65
+ className: "mb-2 text-sm font-medium",
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/components/JourneyMap.tsx
97
+ import { cn as cn2 } from "@contractspec/lib.ui-kit-web/ui/utils";
98
+ import { jsxDEV as jsxDEV2 } from "react/jsx-dev-runtime";
99
+ "use client";
100
+ var SURFACE_ICONS = {
101
+ templates: "\uD83D\uDCCB",
102
+ "spec-editor": "✏️",
103
+ regenerator: "\uD83D\uDD04",
104
+ playground: "\uD83C\uDFAE",
105
+ evolution: "\uD83E\uDD16",
106
+ dashboard: "\uD83D\uDCCA",
107
+ settings: "⚙️",
108
+ default: "\uD83D\uDCCD"
109
+ };
110
+ function JourneyMap({
111
+ steps,
112
+ completedStepIds,
113
+ currentStepId
114
+ }) {
115
+ return /* @__PURE__ */ jsxDEV2("div", {
116
+ className: "relative overflow-x-auto pb-4",
117
+ children: /* @__PURE__ */ jsxDEV2("div", {
118
+ className: "flex min-w-max items-center gap-2",
119
+ children: steps.map((step, index) => {
120
+ const isCompleted = completedStepIds.includes(step.id);
121
+ const isCurrent = step.id === currentStepId;
122
+ const surface = step.metadata?.surface ?? "default";
123
+ const icon = SURFACE_ICONS[surface] ?? SURFACE_ICONS.default;
124
+ return /* @__PURE__ */ jsxDEV2("div", {
125
+ className: "flex items-center",
126
+ children: [
127
+ /* @__PURE__ */ jsxDEV2("div", {
128
+ className: "flex flex-col items-center gap-2",
129
+ children: [
130
+ /* @__PURE__ */ jsxDEV2("div", {
131
+ className: cn2("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"),
132
+ children: isCompleted ? "✓" : icon
133
+ }, undefined, false, undefined, this),
134
+ /* @__PURE__ */ jsxDEV2("div", {
135
+ className: "text-center",
136
+ children: /* @__PURE__ */ jsxDEV2("p", {
137
+ className: cn2("max-w-[100px] truncate text-xs font-medium", isCompleted && "text-green-500", isCurrent && !isCompleted && "text-violet-500", !isCompleted && !isCurrent && "text-muted-foreground"),
138
+ children: step.title
139
+ }, undefined, false, undefined, this)
140
+ }, undefined, false, undefined, this)
141
+ ]
142
+ }, undefined, true, undefined, this),
143
+ index < steps.length - 1 && /* @__PURE__ */ jsxDEV2("div", {
144
+ className: cn2("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")
145
+ }, undefined, false, undefined, this)
146
+ ]
147
+ }, step.id, true, undefined, this);
148
+ })
149
+ }, undefined, false, undefined, this)
150
+ }, undefined, false, undefined, this);
151
+ }
152
+
153
+ // src/components/CodeSnippet.tsx
154
+ import { useState } from "react";
155
+ import { Button as Button2 } from "@contractspec/lib.design-system";
156
+ import { jsxDEV as jsxDEV3, Fragment } from "react/jsx-dev-runtime";
157
+ "use client";
158
+ function CodeSnippet({
159
+ code,
160
+ language = "typescript",
161
+ title
162
+ }) {
163
+ const [copied, setCopied] = useState(false);
164
+ const handleCopy = async () => {
165
+ await navigator.clipboard.writeText(code);
166
+ setCopied(true);
167
+ setTimeout(() => setCopied(false), 2000);
168
+ };
169
+ return /* @__PURE__ */ jsxDEV3("div", {
170
+ className: "bg-muted/50 overflow-hidden rounded-lg border",
171
+ children: [
172
+ /* @__PURE__ */ jsxDEV3("div", {
173
+ className: "bg-muted flex items-center justify-between border-b px-4 py-2",
174
+ children: [
175
+ /* @__PURE__ */ jsxDEV3("div", {
176
+ className: "flex items-center gap-2",
177
+ children: [
178
+ /* @__PURE__ */ jsxDEV3("span", {
179
+ className: "text-muted-foreground text-xs font-medium uppercase",
180
+ children: language
181
+ }, undefined, false, undefined, this),
182
+ title && /* @__PURE__ */ jsxDEV3(Fragment, {
183
+ children: [
184
+ /* @__PURE__ */ jsxDEV3("span", {
185
+ className: "text-muted-foreground",
186
+ children: "•"
187
+ }, undefined, false, undefined, this),
188
+ /* @__PURE__ */ jsxDEV3("span", {
189
+ className: "text-sm",
190
+ children: title
191
+ }, undefined, false, undefined, this)
192
+ ]
193
+ }, undefined, true, undefined, this)
194
+ ]
195
+ }, undefined, true, undefined, this),
196
+ /* @__PURE__ */ jsxDEV3(Button2, {
197
+ variant: "ghost",
198
+ size: "sm",
199
+ onClick: handleCopy,
200
+ className: "h-7 text-xs",
201
+ children: copied ? "✓ Copied" : "Copy"
202
+ }, undefined, false, undefined, this)
203
+ ]
204
+ }, undefined, true, undefined, this),
205
+ /* @__PURE__ */ jsxDEV3("pre", {
206
+ className: "overflow-x-auto p-4",
207
+ children: /* @__PURE__ */ jsxDEV3("code", {
208
+ className: "text-sm",
209
+ children: code
210
+ }, undefined, false, undefined, this)
211
+ }, undefined, false, undefined, this)
212
+ ]
213
+ }, undefined, true, undefined, this);
214
+ }
215
+ export {
216
+ StepChecklist,
217
+ JourneyMap,
218
+ CodeSnippet
219
+ };
@@ -0,0 +1,22 @@
1
+ // src/docs/learning-journey-ui-onboarding.docblock.ts
2
+ import { registerDocBlocks } from "@contractspec/lib.contracts/docs";
3
+ var blocks = [
4
+ {
5
+ id: "docs.examples.learning-journey-ui-onboarding",
6
+ title: "Learning Journey UI — Onboarding",
7
+ summary: "UI mini-app components for onboarding: checklists, snippets, and journey mapping.",
8
+ kind: "reference",
9
+ visibility: "public",
10
+ route: "/docs/examples/learning-journey-ui-onboarding",
11
+ tags: ["learning", "ui", "onboarding"],
12
+ body: `## Includes
13
+ - Onboarding mini-app shell
14
+ - Views: overview, steps, progress, timeline
15
+ - Components: step checklist, code snippet, journey map
16
+
17
+ ## Notes
18
+ - Compose with design system components.
19
+ - Ensure accessible labels and keyboard navigation.`
20
+ }
21
+ ];
22
+ registerDocBlocks(blocks);
@@ -0,0 +1,22 @@
1
+ // src/docs/learning-journey-ui-onboarding.docblock.ts
2
+ import { registerDocBlocks } from "@contractspec/lib.contracts/docs";
3
+ var blocks = [
4
+ {
5
+ id: "docs.examples.learning-journey-ui-onboarding",
6
+ title: "Learning Journey UI — Onboarding",
7
+ summary: "UI mini-app components for onboarding: checklists, snippets, and journey mapping.",
8
+ kind: "reference",
9
+ visibility: "public",
10
+ route: "/docs/examples/learning-journey-ui-onboarding",
11
+ tags: ["learning", "ui", "onboarding"],
12
+ body: `## Includes
13
+ - Onboarding mini-app shell
14
+ - Views: overview, steps, progress, timeline
15
+ - Components: step checklist, code snippet, journey map
16
+
17
+ ## Notes
18
+ - Compose with design system components.
19
+ - Ensure accessible labels and keyboard navigation.`
20
+ }
21
+ ];
22
+ registerDocBlocks(blocks);
@@ -0,0 +1,32 @@
1
+ // src/example.ts
2
+ import { defineExample } from "@contractspec/lib.contracts";
3
+ var example = defineExample({
4
+ meta: {
5
+ key: "learning-journey-ui-onboarding",
6
+ version: "1.0.0",
7
+ title: "Learning Journey UI — Onboarding",
8
+ description: "UI mini-app for onboarding patterns: checklists, code snippets, journey map.",
9
+ kind: "ui",
10
+ visibility: "public",
11
+ stability: "experimental",
12
+ owners: ["@platform.core"],
13
+ tags: ["learning", "ui", "onboarding"]
14
+ },
15
+ docs: {
16
+ rootDocId: "docs.examples.learning-journey-ui-onboarding"
17
+ },
18
+ entrypoints: {
19
+ packageName: "@contractspec/example.learning-journey-ui-onboarding",
20
+ docs: "./docs"
21
+ },
22
+ surfaces: {
23
+ templates: true,
24
+ sandbox: { enabled: true, modes: ["playground", "markdown"] },
25
+ studio: { enabled: true, installable: true },
26
+ mcp: { enabled: true }
27
+ }
28
+ });
29
+ var example_default = example;
30
+ export {
31
+ example_default as default
32
+ };