@lssm/example.learning-journey-registry 0.0.0-canary-20251217060834 → 0.0.0-canary-20251217072406
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$colon$bundle.log +402 -57
- package/.turbo/turbo-build.log +401 -56
- package/CHANGELOG.md +14 -12
- package/dist/api.js +170 -1
- package/dist/docs/index.js +1 -1
- package/dist/docs/learning-journey-registry.docblock.js +38 -1
- package/dist/example.js +34 -1
- package/dist/examples/learning-journey-ambient-coach/src/track.js +41 -0
- package/dist/examples/learning-journey-crm-onboarding/dist/track.js +98 -0
- package/dist/examples/learning-journey-duo-drills/src/track.js +65 -0
- package/dist/examples/learning-journey-platform-tour/dist/track.js +105 -0
- package/dist/examples/learning-journey-quest-challenges/src/track.js +35 -0
- package/dist/examples/learning-journey-studio-onboarding/dist/track.js +90 -0
- package/dist/examples/learning-journey-ui-coaching/src/CoachingMiniApp.js +64 -0
- package/dist/examples/learning-journey-ui-coaching/src/components/EngagementMeter.js +107 -0
- package/dist/examples/learning-journey-ui-coaching/src/components/TipCard.js +75 -0
- package/dist/examples/learning-journey-ui-coaching/src/components/TipFeed.js +65 -0
- package/dist/examples/learning-journey-ui-coaching/src/components/index.js +3 -0
- package/dist/examples/learning-journey-ui-coaching/src/docs/index.js +1 -0
- package/dist/examples/learning-journey-ui-coaching/src/docs/learning-journey-ui-coaching.docblock.js +20 -0
- package/dist/examples/learning-journey-ui-coaching/src/index.js +11 -0
- package/dist/examples/learning-journey-ui-coaching/src/views/Overview.js +152 -0
- package/dist/examples/learning-journey-ui-coaching/src/views/Progress.js +117 -0
- package/dist/examples/learning-journey-ui-coaching/src/views/Steps.js +68 -0
- package/dist/examples/learning-journey-ui-coaching/src/views/Timeline.js +112 -0
- package/dist/examples/learning-journey-ui-coaching/src/views/index.js +4 -0
- package/dist/examples/learning-journey-ui-gamified/src/GamifiedMiniApp.js +64 -0
- package/dist/examples/learning-journey-ui-gamified/src/components/DayCalendar.js +32 -0
- package/dist/examples/learning-journey-ui-gamified/src/components/FlashCard.js +79 -0
- package/dist/examples/learning-journey-ui-gamified/src/components/MasteryRing.js +81 -0
- package/dist/examples/learning-journey-ui-gamified/src/components/index.js +3 -0
- package/dist/examples/learning-journey-ui-gamified/src/docs/index.js +1 -0
- package/dist/examples/learning-journey-ui-gamified/src/docs/learning-journey-ui-gamified.docblock.js +20 -0
- package/dist/examples/learning-journey-ui-gamified/src/index.js +11 -0
- package/dist/examples/learning-journey-ui-gamified/src/views/Overview.js +163 -0
- package/dist/examples/learning-journey-ui-gamified/src/views/Progress.js +144 -0
- package/dist/examples/learning-journey-ui-gamified/src/views/Steps.js +55 -0
- package/dist/examples/learning-journey-ui-gamified/src/views/Timeline.js +132 -0
- package/dist/examples/learning-journey-ui-gamified/src/views/index.js +4 -0
- package/dist/examples/learning-journey-ui-onboarding/src/OnboardingMiniApp.js +64 -0
- package/dist/examples/learning-journey-ui-onboarding/src/components/CodeSnippet.js +4 -0
- package/dist/examples/learning-journey-ui-onboarding/src/components/JourneyMap.js +48 -0
- package/dist/examples/learning-journey-ui-onboarding/src/components/StepChecklist.js +79 -0
- package/dist/examples/learning-journey-ui-onboarding/src/components/index.js +3 -0
- package/dist/examples/learning-journey-ui-onboarding/src/docs/index.js +1 -0
- package/dist/examples/learning-journey-ui-onboarding/src/docs/learning-journey-ui-onboarding.docblock.js +20 -0
- package/dist/examples/learning-journey-ui-onboarding/src/index.js +10 -0
- package/dist/examples/learning-journey-ui-onboarding/src/views/Overview.js +180 -0
- package/dist/examples/learning-journey-ui-onboarding/src/views/Progress.js +162 -0
- package/dist/examples/learning-journey-ui-onboarding/src/views/Steps.js +91 -0
- package/dist/examples/learning-journey-ui-onboarding/src/views/Timeline.js +97 -0
- package/dist/examples/learning-journey-ui-onboarding/src/views/index.js +4 -0
- package/dist/examples/learning-journey-ui-shared/src/components/BadgeDisplay.js +44 -0
- package/dist/examples/learning-journey-ui-shared/src/components/StreakCounter.js +45 -0
- package/dist/examples/learning-journey-ui-shared/src/components/ViewTabs.js +48 -0
- package/dist/examples/learning-journey-ui-shared/src/components/XpBar.js +46 -0
- package/dist/examples/learning-journey-ui-shared/src/components/index.js +4 -0
- package/dist/examples/learning-journey-ui-shared/src/docs/index.js +1 -0
- package/dist/examples/learning-journey-ui-shared/src/docs/learning-journey-ui-shared.docblock.js +20 -0
- package/dist/examples/learning-journey-ui-shared/src/hooks/index.js +1 -0
- package/dist/examples/learning-journey-ui-shared/src/hooks/useLearningProgress.js +73 -0
- package/dist/examples/learning-journey-ui-shared/src/index.js +8 -0
- package/dist/index.js +13 -1
- package/dist/learning-journey-registry.feature.js +66 -1
- package/dist/libs/contracts/dist/docs/PUBLISHING.docblock.js +16 -76
- package/dist/libs/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js +16 -350
- package/dist/libs/contracts/dist/docs/index.js +29 -1
- package/dist/libs/contracts/dist/docs/presentations.js +71 -1
- package/dist/libs/contracts/dist/docs/registry.js +44 -1
- package/dist/libs/contracts/dist/docs/tech/PHASE_1_QUICKSTART.docblock.js +16 -383
- package/dist/libs/contracts/dist/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js +16 -68
- package/dist/libs/contracts/dist/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.js +16 -140
- package/dist/libs/contracts/dist/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js +16 -86
- package/dist/libs/contracts/dist/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js +16 -1
- package/dist/libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js +24 -2
- package/dist/libs/contracts/dist/docs/tech/contracts/openapi-export.docblock.js +21 -2
- package/dist/libs/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js +16 -213
- package/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js +73 -5
- package/dist/libs/contracts/dist/docs/tech/mcp-endpoints.docblock.js +37 -1
- package/dist/libs/contracts/dist/docs/tech/presentation-runtime.docblock.js +16 -1
- package/dist/libs/contracts/dist/docs/tech/schema/README.docblock.js +20 -262
- package/dist/libs/contracts/dist/docs/tech/studio/learning-events.docblock.js +48 -1
- package/dist/libs/contracts/dist/docs/tech/studio/learning-journeys.docblock.js +24 -2
- package/dist/libs/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js +23 -2
- package/dist/libs/contracts/dist/docs/tech/studio/project-access-teams.docblock.js +25 -16
- package/dist/libs/contracts/dist/docs/tech/studio/project-routing.docblock.js +67 -1
- package/dist/libs/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js +22 -2
- package/dist/libs/contracts/dist/docs/tech/studio/team-invitations.docblock.js +40 -36
- package/dist/libs/contracts/dist/docs/tech/studio/workspace-ops.docblock.js +47 -1
- package/dist/libs/contracts/dist/docs/tech/studio/workspaces.docblock.js +23 -2
- package/dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js +36 -3
- package/dist/libs/contracts/dist/docs/tech/templates/runtime.docblock.js +20 -1
- package/dist/libs/contracts/dist/docs/tech/vscode-extension.docblock.js +36 -3
- package/dist/libs/contracts/dist/docs/tech/workflows/overview.docblock.js +20 -1
- package/dist/libs/design-system/dist/_virtual/rolldown_runtime.js +5 -0
- package/dist/libs/design-system/dist/components/atoms/Button.js +33 -0
- package/dist/libs/design-system/dist/ui-kit-web/dist/ui/button.js +55 -0
- package/dist/libs/design-system/dist/ui-kit-web/dist/ui-kit-core/dist/utils.js +13 -0
- package/dist/libs/ui-kit-core/dist/utils.js +10 -0
- package/dist/libs/ui-kit-web/dist/ui/card.js +36 -0
- package/dist/libs/ui-kit-web/dist/ui/progress.js +23 -0
- package/dist/libs/ui-kit-web/dist/ui/utils.js +10 -0
- package/dist/libs/ui-kit-web/dist/ui-kit-core/dist/utils.js +10 -0
- package/dist/presentations/index.js +64 -1
- package/dist/progress-store.js +30 -1
- package/dist/tracks.d.ts +1 -1
- package/dist/tracks.js +47 -1
- package/dist/ui/LearningMiniApp.d.ts +0 -1
- package/dist/ui/LearningMiniApp.js +82 -1
- package/dist/ui/index.js +3 -1
- package/package.json +16 -14
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
//#region ../learning-journey-studio-onboarding/dist/track.js
|
|
2
|
+
const studioGettingStartedTrack = {
|
|
3
|
+
id: "studio_getting_started",
|
|
4
|
+
productId: "contractspec-studio",
|
|
5
|
+
name: "Studio Getting Started",
|
|
6
|
+
description: "First 30 minutes in Studio: create a project, edit the spec, deploy/regenerate, and try key modules.",
|
|
7
|
+
targetUserSegment: "new_studio_user",
|
|
8
|
+
targetRole: "developer",
|
|
9
|
+
totalXp: 110,
|
|
10
|
+
streakRule: {
|
|
11
|
+
hoursWindow: 48,
|
|
12
|
+
bonusXp: 25
|
|
13
|
+
},
|
|
14
|
+
completionRewards: {
|
|
15
|
+
xpBonus: 25,
|
|
16
|
+
badgeKey: "studio_first_30m"
|
|
17
|
+
},
|
|
18
|
+
steps: [
|
|
19
|
+
{
|
|
20
|
+
id: "choose_template",
|
|
21
|
+
title: "Choose a template",
|
|
22
|
+
description: "Create your first Studio project (starter template).",
|
|
23
|
+
order: 1,
|
|
24
|
+
completion: {
|
|
25
|
+
eventName: "studio.template.instantiated",
|
|
26
|
+
sourceModule: "@lssm/bundle.contractspec-studio"
|
|
27
|
+
},
|
|
28
|
+
xpReward: 20,
|
|
29
|
+
metadata: { surface: "projects" }
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
id: "edit_spec",
|
|
33
|
+
title: "Edit the spec",
|
|
34
|
+
description: "Change the spec (not generated code) and save.",
|
|
35
|
+
instructions: "Open spec editor, tweak a contract or presentation, save.",
|
|
36
|
+
order: 2,
|
|
37
|
+
completion: {
|
|
38
|
+
eventName: "spec.changed",
|
|
39
|
+
sourceModule: "@lssm/bundle.contractspec-studio"
|
|
40
|
+
},
|
|
41
|
+
xpReward: 20,
|
|
42
|
+
metadata: { surface: "spec-editor" }
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
id: "regenerate_app",
|
|
46
|
+
title: "Regenerate the app",
|
|
47
|
+
description: "Regenerate artifacts from the updated spec.",
|
|
48
|
+
order: 3,
|
|
49
|
+
completion: {
|
|
50
|
+
eventName: "regeneration.completed",
|
|
51
|
+
sourceModule: "@lssm/lib.contracts/regenerator"
|
|
52
|
+
},
|
|
53
|
+
xpReward: 20,
|
|
54
|
+
metadata: { surface: "regenerator" }
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
id: "open_canvas",
|
|
58
|
+
title: "Open the canvas",
|
|
59
|
+
description: "Visit the canvas module for your project.",
|
|
60
|
+
order: 4,
|
|
61
|
+
completion: {
|
|
62
|
+
eventName: "module.navigated",
|
|
63
|
+
sourceModule: "@lssm/bundle.contractspec-studio",
|
|
64
|
+
payloadFilter: { moduleId: "canvas" }
|
|
65
|
+
},
|
|
66
|
+
xpReward: 20,
|
|
67
|
+
metadata: { surface: "canvas" }
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
id: "try_evolution_mode",
|
|
71
|
+
title: "Try evolution mode",
|
|
72
|
+
description: "Request a change via Evolution, then regenerate.",
|
|
73
|
+
order: 5,
|
|
74
|
+
completion: {
|
|
75
|
+
eventName: "studio.evolution.applied",
|
|
76
|
+
sourceModule: "@lssm/lib.evolution"
|
|
77
|
+
},
|
|
78
|
+
xpReward: 30,
|
|
79
|
+
metadata: { surface: "evolution" }
|
|
80
|
+
}
|
|
81
|
+
],
|
|
82
|
+
metadata: {
|
|
83
|
+
persona: "first_run",
|
|
84
|
+
surfacedIn: ["studio/home", "studio/sidebar/learning"]
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
const studioLearningTracks = [studioGettingStartedTrack];
|
|
88
|
+
|
|
89
|
+
//#endregion
|
|
90
|
+
export { studioLearningTracks };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { Card, CardContent } from "../../../libs/ui-kit-web/dist/ui/card.js";
|
|
4
|
+
import { useLearningProgress } from "../../learning-journey-ui-shared/src/hooks/useLearningProgress.js";
|
|
5
|
+
import { ViewTabs } from "../../learning-journey-ui-shared/src/components/ViewTabs.js";
|
|
6
|
+
import "../../learning-journey-ui-shared/src/index.js";
|
|
7
|
+
import { Overview } from "./views/Overview.js";
|
|
8
|
+
import { Steps } from "./views/Steps.js";
|
|
9
|
+
import { ProgressView } from "./views/Progress.js";
|
|
10
|
+
import { Timeline } from "./views/Timeline.js";
|
|
11
|
+
import { useCallback, useState } from "react";
|
|
12
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
+
|
|
14
|
+
//#region ../learning-journey-ui-coaching/src/CoachingMiniApp.tsx
|
|
15
|
+
function CoachingMiniApp({ track, progress: externalProgress, onStepComplete: externalOnStepComplete, onViewChange, initialView = "overview" }) {
|
|
16
|
+
const [currentView, setCurrentView] = useState(initialView);
|
|
17
|
+
const { progress: internalProgress, completeStep: internalCompleteStep } = useLearningProgress(track);
|
|
18
|
+
const progress = externalProgress ?? internalProgress;
|
|
19
|
+
const handleViewChange = useCallback((view) => {
|
|
20
|
+
setCurrentView(view);
|
|
21
|
+
onViewChange?.(view);
|
|
22
|
+
}, [onViewChange]);
|
|
23
|
+
const handleStepComplete = useCallback((stepId) => {
|
|
24
|
+
if (externalOnStepComplete) externalOnStepComplete(stepId);
|
|
25
|
+
else internalCompleteStep(stepId);
|
|
26
|
+
}, [externalOnStepComplete, internalCompleteStep]);
|
|
27
|
+
const handleStartFromOverview = useCallback(() => {
|
|
28
|
+
setCurrentView("steps");
|
|
29
|
+
onViewChange?.("steps");
|
|
30
|
+
}, [onViewChange]);
|
|
31
|
+
const renderView = () => {
|
|
32
|
+
const viewProps = {
|
|
33
|
+
track,
|
|
34
|
+
progress,
|
|
35
|
+
onStepComplete: handleStepComplete
|
|
36
|
+
};
|
|
37
|
+
switch (currentView) {
|
|
38
|
+
case "overview": return /* @__PURE__ */ jsx(Overview, {
|
|
39
|
+
...viewProps,
|
|
40
|
+
onStart: handleStartFromOverview
|
|
41
|
+
});
|
|
42
|
+
case "steps": return /* @__PURE__ */ jsx(Steps, { ...viewProps });
|
|
43
|
+
case "progress": return /* @__PURE__ */ jsx(ProgressView, { ...viewProps });
|
|
44
|
+
case "timeline": return /* @__PURE__ */ jsx(Timeline, { ...viewProps });
|
|
45
|
+
default: return /* @__PURE__ */ jsx(Overview, {
|
|
46
|
+
...viewProps,
|
|
47
|
+
onStart: handleStartFromOverview
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
52
|
+
className: "space-y-6",
|
|
53
|
+
children: [/* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsx(CardContent, {
|
|
54
|
+
className: "p-4",
|
|
55
|
+
children: /* @__PURE__ */ jsx(ViewTabs, {
|
|
56
|
+
currentView,
|
|
57
|
+
onViewChange: handleViewChange
|
|
58
|
+
})
|
|
59
|
+
}) }), renderView()]
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
//#endregion
|
|
64
|
+
export { CoachingMiniApp };
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region ../learning-journey-ui-coaching/src/components/EngagementMeter.tsx
|
|
6
|
+
function EngagementMeter({ acknowledged, actioned, pending, streak = 0 }) {
|
|
7
|
+
const total = acknowledged + actioned + pending;
|
|
8
|
+
const actionedPercent = total > 0 ? actioned / total * 100 : 0;
|
|
9
|
+
const acknowledgedPercent = total > 0 ? acknowledged / total * 100 : 0;
|
|
10
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
11
|
+
className: "space-y-4",
|
|
12
|
+
children: [
|
|
13
|
+
/* @__PURE__ */ jsx("div", {
|
|
14
|
+
className: "flex items-center justify-center",
|
|
15
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
16
|
+
className: "relative h-32 w-32",
|
|
17
|
+
children: [/* @__PURE__ */ jsxs("svg", {
|
|
18
|
+
className: "h-full w-full -rotate-90",
|
|
19
|
+
viewBox: "0 0 100 100",
|
|
20
|
+
children: [
|
|
21
|
+
/* @__PURE__ */ jsx("circle", {
|
|
22
|
+
cx: "50",
|
|
23
|
+
cy: "50",
|
|
24
|
+
r: "40",
|
|
25
|
+
fill: "none",
|
|
26
|
+
strokeWidth: "12",
|
|
27
|
+
className: "stroke-muted"
|
|
28
|
+
}),
|
|
29
|
+
/* @__PURE__ */ jsx("circle", {
|
|
30
|
+
cx: "50",
|
|
31
|
+
cy: "50",
|
|
32
|
+
r: "40",
|
|
33
|
+
fill: "none",
|
|
34
|
+
strokeWidth: "12",
|
|
35
|
+
strokeLinecap: "round",
|
|
36
|
+
strokeDasharray: `${actionedPercent * 2.51} 251`,
|
|
37
|
+
className: "stroke-green-500 transition-all duration-500"
|
|
38
|
+
}),
|
|
39
|
+
/* @__PURE__ */ jsx("circle", {
|
|
40
|
+
cx: "50",
|
|
41
|
+
cy: "50",
|
|
42
|
+
r: "40",
|
|
43
|
+
fill: "none",
|
|
44
|
+
strokeWidth: "12",
|
|
45
|
+
strokeLinecap: "round",
|
|
46
|
+
strokeDasharray: `${acknowledgedPercent * 2.51} 251`,
|
|
47
|
+
strokeDashoffset: `${-actionedPercent * 2.51}`,
|
|
48
|
+
className: "stroke-amber-500 transition-all duration-500"
|
|
49
|
+
})
|
|
50
|
+
]
|
|
51
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
52
|
+
className: "absolute inset-0 flex flex-col items-center justify-center",
|
|
53
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
54
|
+
className: "text-2xl font-bold",
|
|
55
|
+
children: total
|
|
56
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
57
|
+
className: "text-muted-foreground text-xs",
|
|
58
|
+
children: "tips"
|
|
59
|
+
})]
|
|
60
|
+
})]
|
|
61
|
+
})
|
|
62
|
+
}),
|
|
63
|
+
/* @__PURE__ */ jsxs("div", {
|
|
64
|
+
className: "flex justify-center gap-4 text-sm",
|
|
65
|
+
children: [
|
|
66
|
+
/* @__PURE__ */ jsxs("div", {
|
|
67
|
+
className: "flex items-center gap-1.5",
|
|
68
|
+
children: [/* @__PURE__ */ jsx("div", { className: "h-3 w-3 rounded-full bg-green-500" }), /* @__PURE__ */ jsxs("span", { children: [
|
|
69
|
+
"Actioned (",
|
|
70
|
+
actioned,
|
|
71
|
+
")"
|
|
72
|
+
] })]
|
|
73
|
+
}),
|
|
74
|
+
/* @__PURE__ */ jsxs("div", {
|
|
75
|
+
className: "flex items-center gap-1.5",
|
|
76
|
+
children: [/* @__PURE__ */ jsx("div", { className: "h-3 w-3 rounded-full bg-amber-500" }), /* @__PURE__ */ jsxs("span", { children: [
|
|
77
|
+
"Acknowledged (",
|
|
78
|
+
acknowledged,
|
|
79
|
+
")"
|
|
80
|
+
] })]
|
|
81
|
+
}),
|
|
82
|
+
/* @__PURE__ */ jsxs("div", {
|
|
83
|
+
className: "flex items-center gap-1.5",
|
|
84
|
+
children: [/* @__PURE__ */ jsx("div", { className: "bg-muted h-3 w-3 rounded-full" }), /* @__PURE__ */ jsxs("span", { children: [
|
|
85
|
+
"Pending (",
|
|
86
|
+
pending,
|
|
87
|
+
")"
|
|
88
|
+
] })]
|
|
89
|
+
})
|
|
90
|
+
]
|
|
91
|
+
}),
|
|
92
|
+
streak > 0 && /* @__PURE__ */ jsxs("div", {
|
|
93
|
+
className: "flex items-center justify-center gap-2 rounded-lg bg-orange-500/10 px-4 py-2",
|
|
94
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
95
|
+
className: "text-xl",
|
|
96
|
+
children: "🔥"
|
|
97
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
98
|
+
className: "font-semibold text-orange-500",
|
|
99
|
+
children: [streak, " day engagement streak!"]
|
|
100
|
+
})]
|
|
101
|
+
})
|
|
102
|
+
]
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
//#endregion
|
|
107
|
+
export { EngagementMeter };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { Card, CardContent } from "../../../../libs/ui-kit-web/dist/ui/card.js";
|
|
4
|
+
import { cn } from "../../../../libs/ui-kit-web/dist/ui/utils.js";
|
|
5
|
+
import { Button$1 } from "../../../../libs/design-system/dist/components/atoms/Button.js";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
|
|
8
|
+
//#region ../learning-journey-ui-coaching/src/components/TipCard.tsx
|
|
9
|
+
const TIP_ICONS = {
|
|
10
|
+
cash_buffer_too_high: "💰",
|
|
11
|
+
no_savings_goal: "🎯",
|
|
12
|
+
irregular_savings: "📅",
|
|
13
|
+
noise_late_evening: "🔇",
|
|
14
|
+
guest_frequency_high: "👥",
|
|
15
|
+
shared_space_conflicts: "🏠",
|
|
16
|
+
default: "💡"
|
|
17
|
+
};
|
|
18
|
+
function TipCard({ step, isCompleted, isCurrent, onComplete, onDismiss }) {
|
|
19
|
+
const icon = TIP_ICONS[step.metadata?.tipId ?? "default"] ?? TIP_ICONS.default;
|
|
20
|
+
return /* @__PURE__ */ jsx(Card, {
|
|
21
|
+
className: cn("transition-all", isCompleted && "opacity-60", isCurrent && "ring-2 ring-amber-500"),
|
|
22
|
+
children: /* @__PURE__ */ jsx(CardContent, {
|
|
23
|
+
className: "p-4",
|
|
24
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
25
|
+
className: "flex gap-4",
|
|
26
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
27
|
+
className: cn("flex h-12 w-12 shrink-0 items-center justify-center rounded-xl text-2xl", isCompleted ? "bg-green-500/10" : isCurrent ? "bg-amber-500/10" : "bg-muted"),
|
|
28
|
+
children: isCompleted ? "✓" : icon
|
|
29
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
30
|
+
className: "min-w-0 flex-1",
|
|
31
|
+
children: [
|
|
32
|
+
/* @__PURE__ */ jsxs("div", {
|
|
33
|
+
className: "flex items-start justify-between gap-2",
|
|
34
|
+
children: [/* @__PURE__ */ jsx("h4", {
|
|
35
|
+
className: "font-semibold",
|
|
36
|
+
children: step.title
|
|
37
|
+
}), step.xpReward && /* @__PURE__ */ jsxs("span", {
|
|
38
|
+
className: cn("shrink-0 rounded-full px-2 py-0.5 text-xs font-semibold", isCompleted ? "bg-green-500/10 text-green-500" : "bg-amber-500/10 text-amber-500"),
|
|
39
|
+
children: [
|
|
40
|
+
"+",
|
|
41
|
+
step.xpReward,
|
|
42
|
+
" XP"
|
|
43
|
+
]
|
|
44
|
+
})]
|
|
45
|
+
}),
|
|
46
|
+
/* @__PURE__ */ jsx("p", {
|
|
47
|
+
className: "text-muted-foreground mt-1 text-sm",
|
|
48
|
+
children: step.description
|
|
49
|
+
}),
|
|
50
|
+
!isCompleted && /* @__PURE__ */ jsxs("div", {
|
|
51
|
+
className: "mt-3 flex flex-wrap gap-2",
|
|
52
|
+
children: [/* @__PURE__ */ jsx(Button$1, {
|
|
53
|
+
size: "sm",
|
|
54
|
+
onClick: onComplete,
|
|
55
|
+
children: "Take Action"
|
|
56
|
+
}), /* @__PURE__ */ jsx(Button$1, {
|
|
57
|
+
variant: "outline",
|
|
58
|
+
size: "sm",
|
|
59
|
+
onClick: onDismiss,
|
|
60
|
+
children: "Dismiss"
|
|
61
|
+
})]
|
|
62
|
+
}),
|
|
63
|
+
isCompleted && /* @__PURE__ */ jsx("p", {
|
|
64
|
+
className: "mt-2 text-sm text-green-500",
|
|
65
|
+
children: "✓ Tip acknowledged"
|
|
66
|
+
})
|
|
67
|
+
]
|
|
68
|
+
})]
|
|
69
|
+
})
|
|
70
|
+
})
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
//#endregion
|
|
75
|
+
export { TipCard };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { cn } from "../../../../libs/ui-kit-web/dist/ui/utils.js";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
//#region ../learning-journey-ui-coaching/src/components/TipFeed.tsx
|
|
7
|
+
const TIP_ICONS = {
|
|
8
|
+
cash_buffer_too_high: "💰",
|
|
9
|
+
no_savings_goal: "🎯",
|
|
10
|
+
irregular_savings: "📅",
|
|
11
|
+
noise_late_evening: "🔇",
|
|
12
|
+
guest_frequency_high: "👥",
|
|
13
|
+
shared_space_conflicts: "🏠",
|
|
14
|
+
default: "💡"
|
|
15
|
+
};
|
|
16
|
+
function TipFeed({ items }) {
|
|
17
|
+
if (items.length === 0) return /* @__PURE__ */ jsx("div", {
|
|
18
|
+
className: "text-muted-foreground py-8 text-center",
|
|
19
|
+
children: "No tips yet. Start engaging with coaching tips!"
|
|
20
|
+
});
|
|
21
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
22
|
+
className: "relative",
|
|
23
|
+
children: [/* @__PURE__ */ jsx("div", { className: "bg-border absolute top-0 left-4 h-full w-0.5" }), /* @__PURE__ */ jsx("div", {
|
|
24
|
+
className: "space-y-4",
|
|
25
|
+
children: items.map((item, index) => {
|
|
26
|
+
const icon = TIP_ICONS[item.step.metadata?.tipId ?? "default"] ?? TIP_ICONS.default;
|
|
27
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
28
|
+
className: "relative flex gap-4 pl-2",
|
|
29
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
30
|
+
className: cn("relative z-10 flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-sm", item.isCompleted ? "bg-green-500 text-white" : "bg-muted text-muted-foreground"),
|
|
31
|
+
children: item.isCompleted ? "✓" : icon
|
|
32
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
33
|
+
className: "bg-card flex-1 rounded-lg border p-3",
|
|
34
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
35
|
+
className: "flex items-start justify-between gap-2",
|
|
36
|
+
children: [/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("p", {
|
|
37
|
+
className: "font-medium",
|
|
38
|
+
children: item.step.title
|
|
39
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
40
|
+
className: "text-muted-foreground mt-0.5 text-sm",
|
|
41
|
+
children: item.step.description
|
|
42
|
+
})] }), item.step.xpReward && /* @__PURE__ */ jsxs("span", {
|
|
43
|
+
className: cn("shrink-0 text-xs font-medium", item.isCompleted ? "text-green-500" : "text-muted-foreground"),
|
|
44
|
+
children: [
|
|
45
|
+
"+",
|
|
46
|
+
item.step.xpReward,
|
|
47
|
+
" XP"
|
|
48
|
+
]
|
|
49
|
+
})]
|
|
50
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
51
|
+
className: "text-muted-foreground mt-2 flex items-center gap-2 text-xs",
|
|
52
|
+
children: item.isCompleted ? /* @__PURE__ */ jsxs("span", {
|
|
53
|
+
className: "text-green-500",
|
|
54
|
+
children: ["✓ Completed", item.completedAt && ` • ${item.completedAt}`]
|
|
55
|
+
}) : /* @__PURE__ */ jsx("span", { children: "Pending action" })
|
|
56
|
+
})]
|
|
57
|
+
})]
|
|
58
|
+
}, item.step.id);
|
|
59
|
+
})
|
|
60
|
+
})]
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
//#endregion
|
|
65
|
+
export { TipFeed };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./learning-journey-ui-coaching.docblock.js";
|
package/dist/examples/learning-journey-ui-coaching/src/docs/learning-journey-ui-coaching.docblock.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { registerDocBlocks } from "../../../../libs/contracts/dist/docs/registry.js";
|
|
2
|
+
import "../../../../libs/contracts/dist/docs/index.js";
|
|
3
|
+
|
|
4
|
+
//#region ../learning-journey-ui-coaching/src/docs/learning-journey-ui-coaching.docblock.ts
|
|
5
|
+
registerDocBlocks([{
|
|
6
|
+
id: "docs.examples.learning-journey-ui-coaching",
|
|
7
|
+
title: "Learning Journey UI — Coaching",
|
|
8
|
+
summary: "UI mini-app components for coaching: tips, engagement, progress.",
|
|
9
|
+
kind: "reference",
|
|
10
|
+
visibility: "public",
|
|
11
|
+
route: "/docs/examples/learning-journey-ui-coaching",
|
|
12
|
+
tags: [
|
|
13
|
+
"learning",
|
|
14
|
+
"ui",
|
|
15
|
+
"coaching"
|
|
16
|
+
],
|
|
17
|
+
body: `## Includes\n- Coaching mini-app shell\n- Views: overview, steps, progress, timeline\n- Components: tip card, engagement meter, tip feed\n\n## Notes\n- Compose using design system components.\n- Keep accessibility and mobile-friendly tap targets.`
|
|
18
|
+
}]);
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TipCard } from "./components/TipCard.js";
|
|
2
|
+
import { Overview } from "./views/Overview.js";
|
|
3
|
+
import { Steps } from "./views/Steps.js";
|
|
4
|
+
import { EngagementMeter } from "./components/EngagementMeter.js";
|
|
5
|
+
import { ProgressView } from "./views/Progress.js";
|
|
6
|
+
import { TipFeed } from "./components/TipFeed.js";
|
|
7
|
+
import { Timeline } from "./views/Timeline.js";
|
|
8
|
+
import { CoachingMiniApp } from "./CoachingMiniApp.js";
|
|
9
|
+
import "./views/index.js";
|
|
10
|
+
import "./components/index.js";
|
|
11
|
+
import "./docs/index.js";
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { Card, CardContent, CardHeader, CardTitle } from "../../../../libs/ui-kit-web/dist/ui/card.js";
|
|
4
|
+
import { XpBar } from "../../../learning-journey-ui-shared/src/components/XpBar.js";
|
|
5
|
+
import { StreakCounter } from "../../../learning-journey-ui-shared/src/components/StreakCounter.js";
|
|
6
|
+
import { Button$1 } from "../../../../libs/design-system/dist/components/atoms/Button.js";
|
|
7
|
+
import "../../../learning-journey-ui-shared/src/index.js";
|
|
8
|
+
import { TipCard } from "../components/TipCard.js";
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
|
|
11
|
+
//#region ../learning-journey-ui-coaching/src/views/Overview.tsx
|
|
12
|
+
function Overview({ track, progress, onStepComplete, onStart }) {
|
|
13
|
+
const totalXp = track.totalXp ?? track.steps.reduce((sum, s) => sum + (s.xpReward ?? 0), 0);
|
|
14
|
+
const completedSteps = progress.completedStepIds.length;
|
|
15
|
+
const totalSteps = track.steps.length;
|
|
16
|
+
const pendingSteps = totalSteps - completedSteps;
|
|
17
|
+
const activeTips = track.steps.filter((s) => !progress.completedStepIds.includes(s.id)).slice(0, 3);
|
|
18
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
19
|
+
className: "space-y-6",
|
|
20
|
+
children: [
|
|
21
|
+
/* @__PURE__ */ jsx(Card, {
|
|
22
|
+
className: "overflow-hidden bg-gradient-to-br from-amber-500/10 via-orange-500/10 to-red-500/10",
|
|
23
|
+
children: /* @__PURE__ */ jsx(CardContent, {
|
|
24
|
+
className: "p-6",
|
|
25
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
26
|
+
className: "flex flex-col items-center gap-4 text-center md:flex-row md:text-left",
|
|
27
|
+
children: [
|
|
28
|
+
/* @__PURE__ */ jsx("div", {
|
|
29
|
+
className: "flex h-16 w-16 items-center justify-center rounded-2xl bg-gradient-to-br from-amber-500 to-orange-600 text-3xl shadow-lg",
|
|
30
|
+
children: "💡"
|
|
31
|
+
}),
|
|
32
|
+
/* @__PURE__ */ jsxs("div", {
|
|
33
|
+
className: "flex-1",
|
|
34
|
+
children: [/* @__PURE__ */ jsx("h1", {
|
|
35
|
+
className: "text-2xl font-bold",
|
|
36
|
+
children: track.name
|
|
37
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
38
|
+
className: "text-muted-foreground mt-1",
|
|
39
|
+
children: track.description
|
|
40
|
+
})]
|
|
41
|
+
}),
|
|
42
|
+
/* @__PURE__ */ jsx("div", {
|
|
43
|
+
className: "flex items-center gap-4",
|
|
44
|
+
children: /* @__PURE__ */ jsx(StreakCounter, {
|
|
45
|
+
days: progress.streakDays,
|
|
46
|
+
size: "lg"
|
|
47
|
+
})
|
|
48
|
+
})
|
|
49
|
+
]
|
|
50
|
+
})
|
|
51
|
+
})
|
|
52
|
+
}),
|
|
53
|
+
/* @__PURE__ */ jsxs("div", {
|
|
54
|
+
className: "grid gap-4 md:grid-cols-3",
|
|
55
|
+
children: [
|
|
56
|
+
/* @__PURE__ */ jsxs(Card, { children: [/* @__PURE__ */ jsx(CardHeader, {
|
|
57
|
+
className: "pb-2",
|
|
58
|
+
children: /* @__PURE__ */ jsx(CardTitle, {
|
|
59
|
+
className: "text-muted-foreground text-sm font-medium",
|
|
60
|
+
children: "Active Tips"
|
|
61
|
+
})
|
|
62
|
+
}), /* @__PURE__ */ jsxs(CardContent, { children: [/* @__PURE__ */ jsx("div", {
|
|
63
|
+
className: "text-3xl font-bold text-amber-500",
|
|
64
|
+
children: pendingSteps
|
|
65
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
66
|
+
className: "text-muted-foreground text-sm",
|
|
67
|
+
children: "tips for you today"
|
|
68
|
+
})] })] }),
|
|
69
|
+
/* @__PURE__ */ jsxs(Card, { children: [/* @__PURE__ */ jsx(CardHeader, {
|
|
70
|
+
className: "pb-2",
|
|
71
|
+
children: /* @__PURE__ */ jsx(CardTitle, {
|
|
72
|
+
className: "text-muted-foreground text-sm font-medium",
|
|
73
|
+
children: "Tips Actioned"
|
|
74
|
+
})
|
|
75
|
+
}), /* @__PURE__ */ jsxs(CardContent, { children: [/* @__PURE__ */ jsx("div", {
|
|
76
|
+
className: "text-3xl font-bold text-green-500",
|
|
77
|
+
children: completedSteps
|
|
78
|
+
}), /* @__PURE__ */ jsxs("p", {
|
|
79
|
+
className: "text-muted-foreground text-sm",
|
|
80
|
+
children: [
|
|
81
|
+
"out of ",
|
|
82
|
+
totalSteps,
|
|
83
|
+
" total"
|
|
84
|
+
]
|
|
85
|
+
})] })] }),
|
|
86
|
+
/* @__PURE__ */ jsxs(Card, { children: [/* @__PURE__ */ jsx(CardHeader, {
|
|
87
|
+
className: "pb-2",
|
|
88
|
+
children: /* @__PURE__ */ jsx(CardTitle, {
|
|
89
|
+
className: "text-muted-foreground text-sm font-medium",
|
|
90
|
+
children: "XP Earned"
|
|
91
|
+
})
|
|
92
|
+
}), /* @__PURE__ */ jsxs(CardContent, { children: [/* @__PURE__ */ jsx("div", {
|
|
93
|
+
className: "text-3xl font-bold text-orange-500",
|
|
94
|
+
children: progress.xpEarned
|
|
95
|
+
}), /* @__PURE__ */ jsx(XpBar, {
|
|
96
|
+
current: progress.xpEarned,
|
|
97
|
+
max: totalXp,
|
|
98
|
+
showLabel: false,
|
|
99
|
+
size: "sm"
|
|
100
|
+
})] })] })
|
|
101
|
+
]
|
|
102
|
+
}),
|
|
103
|
+
activeTips.length > 0 && /* @__PURE__ */ jsxs(Card, { children: [/* @__PURE__ */ jsxs(CardHeader, {
|
|
104
|
+
className: "flex flex-row items-center justify-between",
|
|
105
|
+
children: [/* @__PURE__ */ jsxs(CardTitle, {
|
|
106
|
+
className: "flex items-center gap-2",
|
|
107
|
+
children: [/* @__PURE__ */ jsx("span", { children: "💡" }), /* @__PURE__ */ jsx("span", { children: "Tips for You" })]
|
|
108
|
+
}), activeTips.length < pendingSteps && /* @__PURE__ */ jsxs(Button$1, {
|
|
109
|
+
variant: "outline",
|
|
110
|
+
size: "sm",
|
|
111
|
+
onClick: onStart,
|
|
112
|
+
children: [
|
|
113
|
+
"View All (",
|
|
114
|
+
pendingSteps,
|
|
115
|
+
")"
|
|
116
|
+
]
|
|
117
|
+
})]
|
|
118
|
+
}), /* @__PURE__ */ jsx(CardContent, {
|
|
119
|
+
className: "space-y-3",
|
|
120
|
+
children: activeTips.map((step) => /* @__PURE__ */ jsx(TipCard, {
|
|
121
|
+
step,
|
|
122
|
+
isCompleted: false,
|
|
123
|
+
isCurrent: step.id === activeTips[0]?.id,
|
|
124
|
+
onComplete: () => onStepComplete?.(step.id)
|
|
125
|
+
}, step.id))
|
|
126
|
+
})] }),
|
|
127
|
+
pendingSteps === 0 && /* @__PURE__ */ jsx(Card, {
|
|
128
|
+
className: "border-green-500/50 bg-green-500/5",
|
|
129
|
+
children: /* @__PURE__ */ jsxs(CardContent, {
|
|
130
|
+
className: "flex items-center gap-4 p-6",
|
|
131
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
132
|
+
className: "text-4xl",
|
|
133
|
+
children: "🎉"
|
|
134
|
+
}), /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h3", {
|
|
135
|
+
className: "text-lg font-semibold text-green-500",
|
|
136
|
+
children: "All Tips Actioned!"
|
|
137
|
+
}), /* @__PURE__ */ jsxs("p", {
|
|
138
|
+
className: "text-muted-foreground",
|
|
139
|
+
children: [
|
|
140
|
+
"Great job! You've addressed all ",
|
|
141
|
+
totalSteps,
|
|
142
|
+
" coaching tips."
|
|
143
|
+
]
|
|
144
|
+
})] })]
|
|
145
|
+
})
|
|
146
|
+
})
|
|
147
|
+
]
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
//#endregion
|
|
152
|
+
export { Overview };
|