@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.
- package/.turbo/turbo-build.log +58 -62
- package/.turbo/turbo-prebuild.log +1 -0
- package/CHANGELOG.md +19 -0
- package/dist/OnboardingMiniApp.d.ts +4 -14
- package/dist/OnboardingMiniApp.d.ts.map +1 -1
- package/dist/OnboardingMiniApp.js +991 -59
- package/dist/browser/OnboardingMiniApp.js +994 -0
- package/dist/browser/components/CodeSnippet.js +65 -0
- package/dist/browser/components/JourneyMap.js +59 -0
- package/dist/browser/components/StepChecklist.js +97 -0
- package/dist/browser/components/index.js +219 -0
- package/dist/browser/docs/index.js +22 -0
- package/dist/browser/docs/learning-journey-ui-onboarding.docblock.js +22 -0
- package/dist/browser/example.js +32 -0
- package/dist/browser/index.js +1116 -0
- package/dist/browser/views/Overview.js +240 -0
- package/dist/browser/views/Progress.js +275 -0
- package/dist/browser/views/Steps.js +192 -0
- package/dist/browser/views/Timeline.js +213 -0
- package/dist/browser/views/index.js +915 -0
- package/dist/components/CodeSnippet.d.ts +5 -13
- package/dist/components/CodeSnippet.d.ts.map +1 -1
- package/dist/components/CodeSnippet.js +63 -47
- package/dist/components/JourneyMap.d.ts +6 -14
- package/dist/components/JourneyMap.d.ts.map +1 -1
- package/dist/components/JourneyMap.js +57 -46
- package/dist/components/StepChecklist.d.ts +10 -22
- package/dist/components/StepChecklist.d.ts.map +1 -1
- package/dist/components/StepChecklist.js +95 -77
- package/dist/components/index.d.ts +4 -4
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +219 -4
- package/dist/docs/index.d.ts +2 -1
- package/dist/docs/index.d.ts.map +1 -0
- package/dist/docs/index.js +23 -1
- package/dist/docs/learning-journey-ui-onboarding.docblock.d.ts +2 -1
- package/dist/docs/learning-journey-ui-onboarding.docblock.d.ts.map +1 -0
- package/dist/docs/learning-journey-ui-onboarding.docblock.js +21 -18
- package/dist/example.d.ts +2 -6
- package/dist/example.d.ts.map +1 -1
- package/dist/example.js +31 -39
- package/dist/index.d.ts +6 -12
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1117 -14
- package/dist/node/OnboardingMiniApp.js +994 -0
- package/dist/node/components/CodeSnippet.js +65 -0
- package/dist/node/components/JourneyMap.js +59 -0
- package/dist/node/components/StepChecklist.js +97 -0
- package/dist/node/components/index.js +219 -0
- package/dist/node/docs/index.js +22 -0
- package/dist/node/docs/learning-journey-ui-onboarding.docblock.js +22 -0
- package/dist/node/example.js +32 -0
- package/dist/node/index.js +1116 -0
- package/dist/node/views/Overview.js +240 -0
- package/dist/node/views/Progress.js +275 -0
- package/dist/node/views/Steps.js +192 -0
- package/dist/node/views/Timeline.js +213 -0
- package/dist/node/views/index.js +915 -0
- package/dist/views/Overview.d.ts +4 -12
- package/dist/views/Overview.d.ts.map +1 -1
- package/dist/views/Overview.js +238 -177
- package/dist/views/Progress.d.ts +3 -10
- package/dist/views/Progress.d.ts.map +1 -1
- package/dist/views/Progress.js +273 -158
- package/dist/views/Steps.d.ts +2 -11
- package/dist/views/Steps.d.ts.map +1 -1
- package/dist/views/Steps.js +188 -87
- package/dist/views/Timeline.d.ts +2 -10
- package/dist/views/Timeline.d.ts.map +1 -1
- package/dist/views/Timeline.js +211 -95
- package/dist/views/index.d.ts +5 -5
- package/dist/views/index.d.ts.map +1 -0
- package/dist/views/index.js +915 -5
- package/package.json +155 -39
- package/tsdown.config.js +1 -2
- package/.turbo/turbo-build$colon$bundle.log +0 -59
- package/dist/OnboardingMiniApp.js.map +0 -1
- package/dist/components/CodeSnippet.js.map +0 -1
- package/dist/components/JourneyMap.js.map +0 -1
- package/dist/components/StepChecklist.js.map +0 -1
- package/dist/docs/learning-journey-ui-onboarding.docblock.js.map +0 -1
- package/dist/example.js.map +0 -1
- package/dist/views/Overview.js.map +0 -1
- package/dist/views/Progress.js.map +0 -1
- package/dist/views/Steps.js.map +0 -1
- package/dist/views/Timeline.js.map +0 -1
- 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
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
code: string;
|
|
3
|
+
language?: string;
|
|
4
|
+
title?: string;
|
|
8
5
|
}
|
|
9
|
-
declare function CodeSnippet({
|
|
10
|
-
|
|
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","
|
|
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
|
-
|
|
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 {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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
|
-
|
|
49
|
-
|
|
50
|
-
//# sourceMappingURL=CodeSnippet.js.map
|
|
64
|
+
export {
|
|
65
|
+
CodeSnippet
|
|
66
|
+
};
|
|
@@ -1,17 +1,9 @@
|
|
|
1
|
-
import
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
steps: LearningJourneyStepSpec[];
|
|
4
|
+
completedStepIds: string[];
|
|
5
|
+
currentStepId?: string | null;
|
|
9
6
|
}
|
|
10
|
-
declare function JourneyMap({
|
|
11
|
-
|
|
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","
|
|
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
|
-
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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({
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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
|
-
|
|
48
|
-
|
|
49
|
-
//# sourceMappingURL=JourneyMap.js.map
|
|
58
|
+
export {
|
|
59
|
+
JourneyMap
|
|
60
|
+
};
|
|
@@ -1,25 +1,13 @@
|
|
|
1
|
-
import
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
|
|
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","
|
|
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
|
-
|
|
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
|
-
|
|
8
|
-
function StepChecklist({
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
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
|
-
|
|
79
|
-
|
|
80
|
-
//# sourceMappingURL=StepChecklist.js.map
|
|
96
|
+
export {
|
|
97
|
+
StepChecklist
|
|
98
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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"}
|