@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
@@ -1,16 +1,8 @@
1
- import * as react_jsx_runtime0 from "react/jsx-runtime";
2
-
3
- //#region src/components/CodeSnippet.d.ts
4
1
  interface CodeSnippetProps {
5
- code: string;
6
- language?: string;
7
- title?: string;
2
+ code: string;
3
+ language?: string;
4
+ title?: string;
8
5
  }
9
- declare function CodeSnippet({
10
- code,
11
- language,
12
- title
13
- }: CodeSnippetProps): react_jsx_runtime0.JSX.Element;
14
- //#endregion
15
- export { CodeSnippet };
6
+ export declare function CodeSnippet({ code, language, title, }: CodeSnippetProps): import("react/jsx-runtime").JSX.Element;
7
+ export {};
16
8
  //# sourceMappingURL=CodeSnippet.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CodeSnippet.d.ts","names":[],"sources":["../../src/components/CodeSnippet.tsx"],"mappings":";;;UAKU,gBAAA;EACR,IAAA;EACA,QAAA;EACA,KAAA;AAAA;AAAA,iBAGc,WAAA,CAAA;EACd,IAAA;EACA,QAAA;EACA;AAAA,GACC,gBAAA,GAAgB,kBAAA,CAAA,GAAA,CAAA,OAAA"}
1
+ {"version":3,"file":"CodeSnippet.d.ts","sourceRoot":"","sources":["../../src/components/CodeSnippet.tsx"],"names":[],"mappings":"AAKA,UAAU,gBAAgB;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,WAAW,CAAC,EAC1B,IAAI,EACJ,QAAuB,EACvB,KAAK,GACN,EAAE,gBAAgB,2CAwClB"}
@@ -1,50 +1,66 @@
1
- 'use client';
2
-
1
+ // @bun
2
+ // src/components/CodeSnippet.tsx
3
3
  import { useState } from "react";
4
4
  import { Button } from "@contractspec/lib.design-system";
5
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
-
7
- //#region src/components/CodeSnippet.tsx
8
- function CodeSnippet({ code, language = "typescript", title }) {
9
- const [copied, setCopied] = useState(false);
10
- const handleCopy = async () => {
11
- await navigator.clipboard.writeText(code);
12
- setCopied(true);
13
- setTimeout(() => setCopied(false), 2e3);
14
- };
15
- return /* @__PURE__ */ jsxs("div", {
16
- className: "bg-muted/50 overflow-hidden rounded-lg border",
17
- children: [/* @__PURE__ */ jsxs("div", {
18
- className: "bg-muted flex items-center justify-between border-b px-4 py-2",
19
- children: [/* @__PURE__ */ jsxs("div", {
20
- className: "flex items-center gap-2",
21
- children: [/* @__PURE__ */ jsx("span", {
22
- className: "text-muted-foreground text-xs font-medium uppercase",
23
- children: language
24
- }), title && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
25
- className: "text-muted-foreground",
26
- children: "•"
27
- }), /* @__PURE__ */ jsx("span", {
28
- className: "text-sm",
29
- children: title
30
- })] })]
31
- }), /* @__PURE__ */ jsx(Button, {
32
- variant: "ghost",
33
- size: "sm",
34
- onClick: handleCopy,
35
- className: "h-7 text-xs",
36
- children: copied ? "✓ Copied" : "Copy"
37
- })]
38
- }), /* @__PURE__ */ jsx("pre", {
39
- className: "overflow-x-auto p-4",
40
- children: /* @__PURE__ */ jsx("code", {
41
- className: "text-sm",
42
- children: code
43
- })
44
- })]
45
- });
5
+ import { jsxDEV, Fragment } from "react/jsx-dev-runtime";
6
+ "use client";
7
+ function CodeSnippet({
8
+ code,
9
+ language = "typescript",
10
+ title
11
+ }) {
12
+ const [copied, setCopied] = useState(false);
13
+ const handleCopy = async () => {
14
+ await navigator.clipboard.writeText(code);
15
+ setCopied(true);
16
+ setTimeout(() => setCopied(false), 2000);
17
+ };
18
+ return /* @__PURE__ */ jsxDEV("div", {
19
+ className: "bg-muted/50 overflow-hidden rounded-lg border",
20
+ children: [
21
+ /* @__PURE__ */ jsxDEV("div", {
22
+ className: "bg-muted flex items-center justify-between border-b px-4 py-2",
23
+ children: [
24
+ /* @__PURE__ */ jsxDEV("div", {
25
+ className: "flex items-center gap-2",
26
+ children: [
27
+ /* @__PURE__ */ jsxDEV("span", {
28
+ className: "text-muted-foreground text-xs font-medium uppercase",
29
+ children: language
30
+ }, undefined, false, undefined, this),
31
+ title && /* @__PURE__ */ jsxDEV(Fragment, {
32
+ children: [
33
+ /* @__PURE__ */ jsxDEV("span", {
34
+ className: "text-muted-foreground",
35
+ children: "\u2022"
36
+ }, undefined, false, undefined, this),
37
+ /* @__PURE__ */ jsxDEV("span", {
38
+ className: "text-sm",
39
+ children: title
40
+ }, undefined, false, undefined, this)
41
+ ]
42
+ }, undefined, true, undefined, this)
43
+ ]
44
+ }, undefined, true, undefined, this),
45
+ /* @__PURE__ */ jsxDEV(Button, {
46
+ variant: "ghost",
47
+ size: "sm",
48
+ onClick: handleCopy,
49
+ className: "h-7 text-xs",
50
+ children: copied ? "\u2713 Copied" : "Copy"
51
+ }, undefined, false, undefined, this)
52
+ ]
53
+ }, undefined, true, undefined, this),
54
+ /* @__PURE__ */ jsxDEV("pre", {
55
+ className: "overflow-x-auto p-4",
56
+ children: /* @__PURE__ */ jsxDEV("code", {
57
+ className: "text-sm",
58
+ children: code
59
+ }, undefined, false, undefined, this)
60
+ }, undefined, false, undefined, this)
61
+ ]
62
+ }, undefined, true, undefined, this);
46
63
  }
47
-
48
- //#endregion
49
- export { CodeSnippet };
50
- //# sourceMappingURL=CodeSnippet.js.map
64
+ export {
65
+ CodeSnippet
66
+ };
@@ -1,17 +1,9 @@
1
- import * as react_jsx_runtime0 from "react/jsx-runtime";
2
- import { LearningJourneyStepSpec } from "@contractspec/module.learning-journey/track-spec";
3
-
4
- //#region src/components/JourneyMap.d.ts
1
+ import type { LearningJourneyStepSpec } from '@contractspec/module.learning-journey/track-spec';
5
2
  interface JourneyMapProps {
6
- steps: LearningJourneyStepSpec[];
7
- completedStepIds: string[];
8
- currentStepId?: string | null;
3
+ steps: LearningJourneyStepSpec[];
4
+ completedStepIds: string[];
5
+ currentStepId?: string | null;
9
6
  }
10
- declare function JourneyMap({
11
- steps,
12
- completedStepIds,
13
- currentStepId
14
- }: JourneyMapProps): react_jsx_runtime0.JSX.Element;
15
- //#endregion
16
- export { JourneyMap };
7
+ export declare function JourneyMap({ steps, completedStepIds, currentStepId, }: JourneyMapProps): import("react/jsx-runtime").JSX.Element;
8
+ export {};
17
9
  //# sourceMappingURL=JourneyMap.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"JourneyMap.d.ts","names":[],"sources":["../../src/components/JourneyMap.tsx"],"mappings":";;;;UAKU,eAAA;EACR,KAAA,EAAO,uBAAA;EACP,gBAAA;EACA,aAAA;AAAA;AAAA,iBAcc,UAAA,CAAA;EACd,KAAA;EACA,gBAAA;EACA;AAAA,GACC,eAAA,GAAe,kBAAA,CAAA,GAAA,CAAA,OAAA"}
1
+ {"version":3,"file":"JourneyMap.d.ts","sourceRoot":"","sources":["../../src/components/JourneyMap.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,kDAAkD,CAAC;AAEhG,UAAU,eAAe;IACvB,KAAK,EAAE,uBAAuB,EAAE,CAAC;IACjC,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B;AAaD,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,gBAAgB,EAChB,aAAa,GACd,EAAE,eAAe,2CA2DjB"}
@@ -1,49 +1,60 @@
1
- 'use client';
2
-
3
- import { jsx, jsxs } from "react/jsx-runtime";
1
+ // @bun
2
+ // src/components/JourneyMap.tsx
4
3
  import { cn } from "@contractspec/lib.ui-kit-web/ui/utils";
5
-
6
- //#region src/components/JourneyMap.tsx
7
- const SURFACE_ICONS = {
8
- templates: "📋",
9
- "spec-editor": "✏️",
10
- regenerator: "🔄",
11
- playground: "🎮",
12
- evolution: "🤖",
13
- dashboard: "📊",
14
- settings: "⚙️",
15
- default: "📍"
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"
16
15
  };
17
- function JourneyMap({ steps, completedStepIds, currentStepId }) {
18
- return /* @__PURE__ */ jsx("div", {
19
- className: "relative overflow-x-auto pb-4",
20
- children: /* @__PURE__ */ jsx("div", {
21
- className: "flex min-w-max items-center gap-2",
22
- children: steps.map((step, index) => {
23
- const isCompleted = completedStepIds.includes(step.id);
24
- const isCurrent = step.id === currentStepId;
25
- const icon = SURFACE_ICONS[step.metadata?.surface ?? "default"] ?? SURFACE_ICONS.default;
26
- return /* @__PURE__ */ jsxs("div", {
27
- className: "flex items-center",
28
- children: [/* @__PURE__ */ jsxs("div", {
29
- className: "flex flex-col items-center gap-2",
30
- children: [/* @__PURE__ */ jsx("div", {
31
- 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"),
32
- children: isCompleted ? "✓" : icon
33
- }), /* @__PURE__ */ jsx("div", {
34
- className: "text-center",
35
- children: /* @__PURE__ */ jsx("p", {
36
- className: cn("max-w-[100px] truncate text-xs font-medium", isCompleted && "text-green-500", isCurrent && !isCompleted && "text-violet-500", !isCompleted && !isCurrent && "text-muted-foreground"),
37
- children: step.title
38
- })
39
- })]
40
- }), index < steps.length - 1 && /* @__PURE__ */ jsx("div", { 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") })]
41
- }, step.id);
42
- })
43
- })
44
- });
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 text-xs font-medium", 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);
45
57
  }
46
-
47
- //#endregion
48
- export { JourneyMap };
49
- //# sourceMappingURL=JourneyMap.js.map
58
+ export {
59
+ JourneyMap
60
+ };
@@ -1,25 +1,13 @@
1
- import * as react_jsx_runtime0 from "react/jsx-runtime";
2
- import { LearningJourneyStepSpec } from "@contractspec/module.learning-journey/track-spec";
3
-
4
- //#region src/components/StepChecklist.d.ts
1
+ import type { LearningJourneyStepSpec } from '@contractspec/module.learning-journey/track-spec';
5
2
  interface StepChecklistProps {
6
- step: LearningJourneyStepSpec;
7
- stepNumber: number;
8
- isCompleted: boolean;
9
- isCurrent: boolean;
10
- isExpanded: boolean;
11
- onToggle: () => void;
12
- onComplete?: () => void;
3
+ step: LearningJourneyStepSpec;
4
+ stepNumber: number;
5
+ isCompleted: boolean;
6
+ isCurrent: boolean;
7
+ isExpanded: boolean;
8
+ onToggle: () => void;
9
+ onComplete?: () => void;
13
10
  }
14
- declare function StepChecklist({
15
- step,
16
- stepNumber,
17
- isCompleted,
18
- isCurrent,
19
- isExpanded,
20
- onToggle,
21
- onComplete
22
- }: StepChecklistProps): react_jsx_runtime0.JSX.Element;
23
- //#endregion
24
- export { StepChecklist };
11
+ export declare function StepChecklist({ step, stepNumber, isCompleted, isCurrent, isExpanded, onToggle, onComplete, }: StepChecklistProps): import("react/jsx-runtime").JSX.Element;
12
+ export {};
25
13
  //# sourceMappingURL=StepChecklist.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"StepChecklist.d.ts","names":[],"sources":["../../src/components/StepChecklist.tsx"],"mappings":";;;;UAMU,kBAAA;EACR,IAAA,EAAM,uBAAA;EACN,UAAA;EACA,WAAA;EACA,SAAA;EACA,UAAA;EACA,QAAA;EACA,UAAA;AAAA;AAAA,iBAGc,aAAA,CAAA;EACd,IAAA;EACA,UAAA;EACA,WAAA;EACA,SAAA;EACA,UAAA;EACA,QAAA;EACA;AAAA,GACC,kBAAA,GAAkB,kBAAA,CAAA,GAAA,CAAA,OAAA"}
1
+ {"version":3,"file":"StepChecklist.d.ts","sourceRoot":"","sources":["../../src/components/StepChecklist.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,kDAAkD,CAAC;AAEhG,UAAU,kBAAkB;IAC1B,IAAI,EAAE,uBAAuB,CAAC;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB;AAED,wBAAgB,aAAa,CAAC,EAC5B,IAAI,EACJ,UAAU,EACV,WAAW,EACX,SAAS,EACT,UAAU,EACV,QAAQ,EACR,UAAU,GACX,EAAE,kBAAkB,2CA+GpB"}
@@ -1,80 +1,98 @@
1
- 'use client';
2
-
1
+ // @bun
2
+ // src/components/StepChecklist.tsx
3
3
  import { Button } from "@contractspec/lib.design-system";
4
- import { jsx, jsxs } from "react/jsx-runtime";
5
4
  import { cn } from "@contractspec/lib.ui-kit-core";
6
-
7
- //#region src/components/StepChecklist.tsx
8
- function StepChecklist({ step, stepNumber, isCompleted, isCurrent, isExpanded, onToggle, onComplete }) {
9
- return /* @__PURE__ */ jsxs("div", {
10
- 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"),
11
- children: [/* @__PURE__ */ jsxs("button", {
12
- type: "button",
13
- className: "flex w-full items-center gap-4 p-4 text-left",
14
- onClick: onToggle,
15
- children: [
16
- /* @__PURE__ */ jsx("div", {
17
- 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"),
18
- children: isCompleted ? "" : stepNumber
19
- }),
20
- /* @__PURE__ */ jsxs("div", {
21
- className: "min-w-0 flex-1",
22
- children: [/* @__PURE__ */ jsx("h4", {
23
- className: cn("font-semibold", isCompleted && "text-green-500", isCurrent && !isCompleted && "text-foreground", !isCompleted && !isCurrent && "text-muted-foreground"),
24
- children: step.title
25
- }), !isExpanded && step.description && /* @__PURE__ */ jsx("p", {
26
- className: "text-muted-foreground truncate text-sm",
27
- children: step.description
28
- })]
29
- }),
30
- step.xpReward && /* @__PURE__ */ jsxs("span", {
31
- 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"),
32
- children: [
33
- "+",
34
- step.xpReward,
35
- " XP"
36
- ]
37
- }),
38
- /* @__PURE__ */ jsx("span", {
39
- className: cn("shrink-0 transition-transform", isExpanded && "rotate-180"),
40
- children: "▼"
41
- })
42
- ]
43
- }), isExpanded && /* @__PURE__ */ jsxs("div", {
44
- className: "border-t px-4 py-4",
45
- children: [
46
- step.description && /* @__PURE__ */ jsx("p", {
47
- className: "text-muted-foreground mb-4",
48
- children: step.description
49
- }),
50
- step.instructions && /* @__PURE__ */ jsxs("div", {
51
- className: "bg-muted mb-4 rounded-lg p-4",
52
- children: [/* @__PURE__ */ jsx("p", {
53
- className: "mb-2 text-sm font-medium",
54
- children: "Instructions:"
55
- }), /* @__PURE__ */ jsx("p", {
56
- className: "text-muted-foreground text-sm",
57
- children: step.instructions
58
- })]
59
- }),
60
- /* @__PURE__ */ jsxs("div", {
61
- className: "flex flex-wrap gap-2",
62
- children: [step.actionUrl && /* @__PURE__ */ jsx(Button, {
63
- variant: "outline",
64
- size: "sm",
65
- onClick: () => window.open(step.actionUrl, "_blank"),
66
- children: step.actionLabel ?? "Try it"
67
- }), !isCompleted && /* @__PURE__ */ jsx(Button, {
68
- size: "sm",
69
- onClick: onComplete,
70
- children: "Mark as Complete"
71
- })]
72
- })
73
- ]
74
- })]
75
- });
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 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"),
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: "text-muted-foreground truncate 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 text-xs font-semibold", 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: "text-muted-foreground mb-4",
60
+ children: step.description
61
+ }, undefined, false, undefined, this),
62
+ step.instructions && /* @__PURE__ */ jsxDEV("div", {
63
+ className: "bg-muted mb-4 rounded-lg p-4",
64
+ children: [
65
+ /* @__PURE__ */ jsxDEV("p", {
66
+ className: "mb-2 text-sm font-medium",
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);
76
95
  }
77
-
78
- //#endregion
79
- export { StepChecklist };
80
- //# sourceMappingURL=StepChecklist.js.map
96
+ export {
97
+ StepChecklist
98
+ };
@@ -1,4 +1,4 @@
1
- import { CodeSnippet } from "./CodeSnippet.js";
2
- import { JourneyMap } from "./JourneyMap.js";
3
- import { StepChecklist } from "./StepChecklist.js";
4
- export { CodeSnippet, JourneyMap, StepChecklist };
1
+ export { StepChecklist } from './StepChecklist';
2
+ export { CodeSnippet } from './CodeSnippet';
3
+ export { JourneyMap } from './JourneyMap';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC"}