@lssm/example.learning-journey-registry 0.0.0-canary-20251217060834 → 0.0.0-canary-20251217073102

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 (112) hide show
  1. package/.turbo/turbo-build$colon$bundle.log +410 -64
  2. package/.turbo/turbo-build.log +55 -65
  3. package/CHANGELOG.md +14 -12
  4. package/dist/api.js +170 -1
  5. package/dist/docs/index.js +1 -1
  6. package/dist/docs/learning-journey-registry.docblock.js +38 -1
  7. package/dist/example.js +34 -1
  8. package/dist/examples/learning-journey-ambient-coach/src/track.js +41 -0
  9. package/dist/examples/learning-journey-crm-onboarding/dist/track.js +98 -0
  10. package/dist/examples/learning-journey-duo-drills/src/track.js +65 -0
  11. package/dist/examples/learning-journey-platform-tour/dist/track.js +105 -0
  12. package/dist/examples/learning-journey-quest-challenges/src/track.js +35 -0
  13. package/dist/examples/learning-journey-studio-onboarding/dist/track.js +90 -0
  14. package/dist/examples/learning-journey-ui-coaching/src/CoachingMiniApp.js +64 -0
  15. package/dist/examples/learning-journey-ui-coaching/src/components/EngagementMeter.js +107 -0
  16. package/dist/examples/learning-journey-ui-coaching/src/components/TipCard.js +75 -0
  17. package/dist/examples/learning-journey-ui-coaching/src/components/TipFeed.js +65 -0
  18. package/dist/examples/learning-journey-ui-coaching/src/components/index.js +3 -0
  19. package/dist/examples/learning-journey-ui-coaching/src/docs/index.js +1 -0
  20. package/dist/examples/learning-journey-ui-coaching/src/docs/learning-journey-ui-coaching.docblock.js +20 -0
  21. package/dist/examples/learning-journey-ui-coaching/src/index.js +11 -0
  22. package/dist/examples/learning-journey-ui-coaching/src/views/Overview.js +152 -0
  23. package/dist/examples/learning-journey-ui-coaching/src/views/Progress.js +117 -0
  24. package/dist/examples/learning-journey-ui-coaching/src/views/Steps.js +68 -0
  25. package/dist/examples/learning-journey-ui-coaching/src/views/Timeline.js +112 -0
  26. package/dist/examples/learning-journey-ui-coaching/src/views/index.js +4 -0
  27. package/dist/examples/learning-journey-ui-gamified/src/GamifiedMiniApp.js +64 -0
  28. package/dist/examples/learning-journey-ui-gamified/src/components/DayCalendar.js +32 -0
  29. package/dist/examples/learning-journey-ui-gamified/src/components/FlashCard.js +79 -0
  30. package/dist/examples/learning-journey-ui-gamified/src/components/MasteryRing.js +81 -0
  31. package/dist/examples/learning-journey-ui-gamified/src/components/index.js +3 -0
  32. package/dist/examples/learning-journey-ui-gamified/src/docs/index.js +1 -0
  33. package/dist/examples/learning-journey-ui-gamified/src/docs/learning-journey-ui-gamified.docblock.js +20 -0
  34. package/dist/examples/learning-journey-ui-gamified/src/index.js +11 -0
  35. package/dist/examples/learning-journey-ui-gamified/src/views/Overview.js +163 -0
  36. package/dist/examples/learning-journey-ui-gamified/src/views/Progress.js +144 -0
  37. package/dist/examples/learning-journey-ui-gamified/src/views/Steps.js +55 -0
  38. package/dist/examples/learning-journey-ui-gamified/src/views/Timeline.js +132 -0
  39. package/dist/examples/learning-journey-ui-gamified/src/views/index.js +4 -0
  40. package/dist/examples/learning-journey-ui-onboarding/src/OnboardingMiniApp.js +64 -0
  41. package/dist/examples/learning-journey-ui-onboarding/src/components/CodeSnippet.js +4 -0
  42. package/dist/examples/learning-journey-ui-onboarding/src/components/JourneyMap.js +48 -0
  43. package/dist/examples/learning-journey-ui-onboarding/src/components/StepChecklist.js +79 -0
  44. package/dist/examples/learning-journey-ui-onboarding/src/components/index.js +3 -0
  45. package/dist/examples/learning-journey-ui-onboarding/src/docs/index.js +1 -0
  46. package/dist/examples/learning-journey-ui-onboarding/src/docs/learning-journey-ui-onboarding.docblock.js +20 -0
  47. package/dist/examples/learning-journey-ui-onboarding/src/index.js +10 -0
  48. package/dist/examples/learning-journey-ui-onboarding/src/views/Overview.js +180 -0
  49. package/dist/examples/learning-journey-ui-onboarding/src/views/Progress.js +162 -0
  50. package/dist/examples/learning-journey-ui-onboarding/src/views/Steps.js +91 -0
  51. package/dist/examples/learning-journey-ui-onboarding/src/views/Timeline.js +97 -0
  52. package/dist/examples/learning-journey-ui-onboarding/src/views/index.js +4 -0
  53. package/dist/examples/learning-journey-ui-shared/src/components/BadgeDisplay.js +44 -0
  54. package/dist/examples/learning-journey-ui-shared/src/components/StreakCounter.js +45 -0
  55. package/dist/examples/learning-journey-ui-shared/src/components/ViewTabs.js +48 -0
  56. package/dist/examples/learning-journey-ui-shared/src/components/XpBar.js +46 -0
  57. package/dist/examples/learning-journey-ui-shared/src/components/index.js +4 -0
  58. package/dist/examples/learning-journey-ui-shared/src/docs/index.js +1 -0
  59. package/dist/examples/learning-journey-ui-shared/src/docs/learning-journey-ui-shared.docblock.js +20 -0
  60. package/dist/examples/learning-journey-ui-shared/src/hooks/index.js +1 -0
  61. package/dist/examples/learning-journey-ui-shared/src/hooks/useLearningProgress.js +73 -0
  62. package/dist/examples/learning-journey-ui-shared/src/index.js +8 -0
  63. package/dist/index.js +13 -1
  64. package/dist/learning-journey-registry.feature.js +66 -1
  65. package/dist/libs/contracts/dist/docs/PUBLISHING.docblock.js +16 -76
  66. package/dist/libs/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js +16 -350
  67. package/dist/libs/contracts/dist/docs/index.js +29 -1
  68. package/dist/libs/contracts/dist/docs/presentations.js +71 -1
  69. package/dist/libs/contracts/dist/docs/registry.js +44 -1
  70. package/dist/libs/contracts/dist/docs/tech/PHASE_1_QUICKSTART.docblock.js +16 -383
  71. package/dist/libs/contracts/dist/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js +16 -68
  72. package/dist/libs/contracts/dist/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.js +16 -140
  73. package/dist/libs/contracts/dist/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js +16 -86
  74. package/dist/libs/contracts/dist/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js +16 -1
  75. package/dist/libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js +24 -2
  76. package/dist/libs/contracts/dist/docs/tech/contracts/openapi-export.docblock.js +21 -2
  77. package/dist/libs/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js +16 -213
  78. package/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js +73 -5
  79. package/dist/libs/contracts/dist/docs/tech/mcp-endpoints.docblock.js +37 -1
  80. package/dist/libs/contracts/dist/docs/tech/presentation-runtime.docblock.js +16 -1
  81. package/dist/libs/contracts/dist/docs/tech/schema/README.docblock.js +20 -262
  82. package/dist/libs/contracts/dist/docs/tech/studio/learning-events.docblock.js +48 -1
  83. package/dist/libs/contracts/dist/docs/tech/studio/learning-journeys.docblock.js +24 -2
  84. package/dist/libs/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js +23 -2
  85. package/dist/libs/contracts/dist/docs/tech/studio/project-access-teams.docblock.js +25 -16
  86. package/dist/libs/contracts/dist/docs/tech/studio/project-routing.docblock.js +67 -1
  87. package/dist/libs/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js +22 -2
  88. package/dist/libs/contracts/dist/docs/tech/studio/team-invitations.docblock.js +40 -36
  89. package/dist/libs/contracts/dist/docs/tech/studio/workspace-ops.docblock.js +47 -1
  90. package/dist/libs/contracts/dist/docs/tech/studio/workspaces.docblock.js +23 -2
  91. package/dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js +36 -3
  92. package/dist/libs/contracts/dist/docs/tech/templates/runtime.docblock.js +20 -1
  93. package/dist/libs/contracts/dist/docs/tech/vscode-extension.docblock.js +36 -3
  94. package/dist/libs/contracts/dist/docs/tech/workflows/overview.docblock.js +20 -1
  95. package/dist/libs/design-system/dist/_virtual/rolldown_runtime.js +5 -0
  96. package/dist/libs/design-system/dist/components/atoms/Button.js +33 -0
  97. package/dist/libs/design-system/dist/ui-kit-web/dist/ui/button.js +55 -0
  98. package/dist/libs/design-system/dist/ui-kit-web/dist/ui-kit-core/dist/utils.js +13 -0
  99. package/dist/libs/ui-kit-core/dist/utils.js +10 -0
  100. package/dist/libs/ui-kit-web/dist/ui/card.js +36 -0
  101. package/dist/libs/ui-kit-web/dist/ui/progress.js +23 -0
  102. package/dist/libs/ui-kit-web/dist/ui/utils.js +10 -0
  103. package/dist/libs/ui-kit-web/dist/ui-kit-core/dist/utils.js +10 -0
  104. package/dist/presentations/index.js +64 -1
  105. package/dist/progress-store.js +30 -1
  106. package/dist/tracks.d.ts +1 -1
  107. package/dist/tracks.js +47 -1
  108. package/dist/ui/LearningMiniApp.d.ts +0 -1
  109. package/dist/ui/LearningMiniApp.js +82 -1
  110. package/dist/ui/index.js +3 -1
  111. package/package.json +16 -14
  112. package/tsconfig.tsbuildinfo +1 -1
@@ -0,0 +1,91 @@
1
+ 'use client';
2
+
3
+ import { Progress } from "../../../../libs/ui-kit-web/dist/ui/progress.js";
4
+ import { StepChecklist } from "../components/StepChecklist.js";
5
+ import { useState } from "react";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+
8
+ //#region ../learning-journey-ui-onboarding/src/views/Steps.tsx
9
+ function Steps({ track, progress, onStepComplete }) {
10
+ const [expandedStepId, setExpandedStepId] = useState(() => {
11
+ return track.steps.find((s) => !progress.completedStepIds.includes(s.id))?.id ?? null;
12
+ });
13
+ const completedSteps = progress.completedStepIds.length;
14
+ const totalSteps = track.steps.length;
15
+ const percentComplete = totalSteps > 0 ? completedSteps / totalSteps * 100 : 0;
16
+ const currentStepIndex = track.steps.findIndex((s) => !progress.completedStepIds.includes(s.id));
17
+ return /* @__PURE__ */ jsxs("div", {
18
+ className: "space-y-6",
19
+ children: [
20
+ /* @__PURE__ */ jsxs("div", {
21
+ className: "space-y-2",
22
+ children: [/* @__PURE__ */ jsxs("div", {
23
+ className: "flex items-center justify-between",
24
+ children: [/* @__PURE__ */ jsx("h2", {
25
+ className: "text-xl font-bold",
26
+ children: "Complete Each Step"
27
+ }), /* @__PURE__ */ jsxs("span", {
28
+ className: "text-muted-foreground text-sm",
29
+ children: [
30
+ completedSteps,
31
+ " / ",
32
+ totalSteps,
33
+ " completed"
34
+ ]
35
+ })]
36
+ }), /* @__PURE__ */ jsx(Progress, {
37
+ value: percentComplete,
38
+ className: "h-2"
39
+ })]
40
+ }),
41
+ /* @__PURE__ */ jsx("div", {
42
+ className: "space-y-3",
43
+ children: track.steps.map((step, index) => {
44
+ const isCompleted = progress.completedStepIds.includes(step.id);
45
+ const isCurrent = index === currentStepIndex;
46
+ return /* @__PURE__ */ jsx(StepChecklist, {
47
+ step,
48
+ stepNumber: index + 1,
49
+ isCompleted,
50
+ isCurrent,
51
+ isExpanded: expandedStepId === step.id,
52
+ onToggle: () => setExpandedStepId(expandedStepId === step.id ? null : step.id),
53
+ onComplete: () => {
54
+ onStepComplete?.(step.id);
55
+ const nextStep = track.steps[index + 1];
56
+ if (nextStep && !progress.completedStepIds.includes(nextStep.id)) setExpandedStepId(nextStep.id);
57
+ }
58
+ }, step.id);
59
+ })
60
+ }),
61
+ track.completionRewards && percentComplete < 100 && /* @__PURE__ */ jsx("div", {
62
+ className: "rounded-lg border border-blue-500/30 bg-blue-500/5 p-4",
63
+ children: /* @__PURE__ */ jsxs("p", {
64
+ className: "text-sm",
65
+ children: [
66
+ "🎁 Complete all steps to unlock:",
67
+ track.completionRewards.xpBonus && /* @__PURE__ */ jsxs("span", {
68
+ className: "ml-2 font-semibold text-blue-500",
69
+ children: [
70
+ "+",
71
+ track.completionRewards.xpBonus,
72
+ " XP bonus"
73
+ ]
74
+ }),
75
+ track.completionRewards.badgeKey && /* @__PURE__ */ jsxs("span", {
76
+ className: "ml-2 font-semibold text-amber-500",
77
+ children: [
78
+ "+ \"",
79
+ track.completionRewards.badgeKey,
80
+ "\" badge"
81
+ ]
82
+ })
83
+ ]
84
+ })
85
+ })
86
+ ]
87
+ });
88
+ }
89
+
90
+ //#endregion
91
+ export { Steps };
@@ -0,0 +1,97 @@
1
+ 'use client';
2
+
3
+ import { Card, CardContent, CardHeader, CardTitle } from "../../../../libs/ui-kit-web/dist/ui/card.js";
4
+ import { JourneyMap } from "../components/JourneyMap.js";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+
7
+ //#region ../learning-journey-ui-onboarding/src/views/Timeline.tsx
8
+ function Timeline({ track, progress }) {
9
+ const currentStepId = track.steps.find((s) => !progress.completedStepIds.includes(s.id))?.id ?? null;
10
+ return /* @__PURE__ */ jsxs("div", {
11
+ className: "space-y-6",
12
+ children: [
13
+ /* @__PURE__ */ jsxs("div", {
14
+ className: "text-center",
15
+ children: [/* @__PURE__ */ jsx("h2", {
16
+ className: "text-xl font-bold",
17
+ children: "Your Learning Journey"
18
+ }), /* @__PURE__ */ jsx("p", {
19
+ className: "text-muted-foreground",
20
+ children: "Follow the path through each surface and feature"
21
+ })]
22
+ }),
23
+ /* @__PURE__ */ jsxs(Card, { children: [/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsxs(CardTitle, {
24
+ className: "flex items-center gap-2",
25
+ children: [/* @__PURE__ */ jsx("span", { children: "🗺️" }), /* @__PURE__ */ jsx("span", { children: "Journey Map" })]
26
+ }) }), /* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsx(JourneyMap, {
27
+ steps: track.steps,
28
+ completedStepIds: progress.completedStepIds,
29
+ currentStepId
30
+ }) })] }),
31
+ /* @__PURE__ */ jsxs(Card, { children: [/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsxs(CardTitle, {
32
+ className: "flex items-center gap-2",
33
+ children: [/* @__PURE__ */ jsx("span", { children: "📍" }), /* @__PURE__ */ jsx("span", { children: "Step by Step" })]
34
+ }) }), /* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsxs("div", {
35
+ className: "relative",
36
+ children: [/* @__PURE__ */ jsx("div", { className: "bg-border absolute top-0 left-4 h-full w-0.5" }), /* @__PURE__ */ jsx("div", {
37
+ className: "space-y-6",
38
+ children: track.steps.map((step, index) => {
39
+ const isCompleted = progress.completedStepIds.includes(step.id);
40
+ const isCurrent = step.id === currentStepId;
41
+ const surface = step.metadata?.surface ?? "general";
42
+ return /* @__PURE__ */ jsxs("div", {
43
+ className: "relative flex gap-4 pl-2",
44
+ children: [/* @__PURE__ */ jsx("div", {
45
+ className: `relative z-10 flex h-8 w-8 shrink-0 items-center justify-center rounded-full border-2 transition-all ${isCompleted ? "border-green-500 bg-green-500 text-white" : isCurrent ? "border-blue-500 bg-blue-500 text-white ring-4 ring-blue-500/20" : "border-border bg-background text-muted-foreground"}`,
46
+ children: isCompleted ? "✓" : index + 1
47
+ }), /* @__PURE__ */ jsx("div", {
48
+ className: "flex-1 pb-2",
49
+ children: /* @__PURE__ */ jsxs("div", {
50
+ className: "rounded-lg border p-4",
51
+ children: [/* @__PURE__ */ jsxs("div", {
52
+ className: "flex items-start justify-between gap-2",
53
+ children: [/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsxs("div", {
54
+ className: "flex items-center gap-2",
55
+ children: [/* @__PURE__ */ jsx("h4", {
56
+ className: `font-semibold ${isCompleted ? "text-green-500" : isCurrent ? "text-blue-500" : "text-foreground"}`,
57
+ children: step.title
58
+ }), /* @__PURE__ */ jsx("span", {
59
+ className: "bg-muted text-muted-foreground rounded px-2 py-0.5 text-xs",
60
+ children: surface
61
+ })]
62
+ }), /* @__PURE__ */ jsx("p", {
63
+ className: "text-muted-foreground mt-1 text-sm",
64
+ children: step.description
65
+ })] }), step.xpReward && /* @__PURE__ */ jsxs("span", {
66
+ className: `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"}`,
67
+ children: [
68
+ "+",
69
+ step.xpReward,
70
+ " XP"
71
+ ]
72
+ })]
73
+ }), /* @__PURE__ */ jsx("div", {
74
+ className: "mt-3 text-xs",
75
+ children: isCompleted ? /* @__PURE__ */ jsx("span", {
76
+ className: "text-green-500",
77
+ children: "✓ Completed"
78
+ }) : isCurrent ? /* @__PURE__ */ jsx("span", {
79
+ className: "text-blue-500",
80
+ children: "→ In Progress"
81
+ }) : /* @__PURE__ */ jsx("span", {
82
+ className: "text-muted-foreground",
83
+ children: "○ Not Started"
84
+ })
85
+ })]
86
+ })
87
+ })]
88
+ }, step.id);
89
+ })
90
+ })]
91
+ }) })] })
92
+ ]
93
+ });
94
+ }
95
+
96
+ //#endregion
97
+ export { Timeline };
@@ -0,0 +1,4 @@
1
+ import { Overview } from "./Overview.js";
2
+ import { Steps } from "./Steps.js";
3
+ import { ProgressView } from "./Progress.js";
4
+ import { Timeline } from "./Timeline.js";
@@ -0,0 +1,44 @@
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-shared/src/components/BadgeDisplay.tsx
7
+ const BADGE_ICONS = {
8
+ studio_first_30m: "🎯",
9
+ platform_tour: "🗺️",
10
+ crm_first_win: "🏆",
11
+ drill_master: "🧠",
12
+ coach_listener: "👂",
13
+ quest_complete: "⭐",
14
+ streak_7: "🔥",
15
+ streak_30: "💎",
16
+ default: "🏅"
17
+ };
18
+ const sizeStyles = {
19
+ sm: "h-6 w-6 text-sm",
20
+ md: "h-8 w-8 text-base",
21
+ lg: "h-10 w-10 text-lg"
22
+ };
23
+ function BadgeDisplay({ badges, maxVisible = 5, size = "md" }) {
24
+ const visibleBadges = badges.slice(0, maxVisible);
25
+ const hiddenCount = badges.length - maxVisible;
26
+ if (badges.length === 0) return /* @__PURE__ */ jsx("div", {
27
+ className: "text-muted-foreground text-sm",
28
+ children: "No badges earned yet"
29
+ });
30
+ return /* @__PURE__ */ jsxs("div", {
31
+ className: "flex items-center gap-1",
32
+ children: [visibleBadges.map((badge) => /* @__PURE__ */ jsx("div", {
33
+ className: cn("flex items-center justify-center rounded-full bg-gradient-to-br from-amber-400/20 to-amber-600/20", sizeStyles[size]),
34
+ title: badge.replace(/_/g, " "),
35
+ children: BADGE_ICONS[badge] ?? BADGE_ICONS.default
36
+ }, badge)), hiddenCount > 0 && /* @__PURE__ */ jsxs("div", {
37
+ className: cn("text-muted-foreground bg-muted flex items-center justify-center rounded-full", sizeStyles[size], "text-xs font-medium"),
38
+ children: ["+", hiddenCount]
39
+ })]
40
+ });
41
+ }
42
+
43
+ //#endregion
44
+ export { BadgeDisplay };
@@ -0,0 +1,45 @@
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-shared/src/components/StreakCounter.tsx
7
+ const sizeStyles = {
8
+ sm: {
9
+ container: "gap-1 px-2 py-1",
10
+ icon: "text-base",
11
+ text: "text-xs"
12
+ },
13
+ md: {
14
+ container: "gap-1.5 px-3 py-1.5",
15
+ icon: "text-lg",
16
+ text: "text-sm"
17
+ },
18
+ lg: {
19
+ container: "gap-2 px-4 py-2",
20
+ icon: "text-xl",
21
+ text: "text-base"
22
+ }
23
+ };
24
+ function StreakCounter({ days, isActive = true, size = "md" }) {
25
+ const styles = sizeStyles[size];
26
+ return /* @__PURE__ */ jsxs("div", {
27
+ className: cn("inline-flex items-center rounded-full font-semibold", styles.container, isActive ? "bg-orange-500/10 text-orange-500" : "bg-muted text-muted-foreground"),
28
+ children: [/* @__PURE__ */ jsx("span", {
29
+ className: styles.icon,
30
+ role: "img",
31
+ "aria-label": "streak",
32
+ children: "🔥"
33
+ }), /* @__PURE__ */ jsxs("span", {
34
+ className: styles.text,
35
+ children: [
36
+ days,
37
+ " ",
38
+ days === 1 ? "day" : "days"
39
+ ]
40
+ })]
41
+ });
42
+ }
43
+
44
+ //#endregion
45
+ export { StreakCounter };
@@ -0,0 +1,48 @@
1
+ 'use client';
2
+
3
+ import { Button$1 } from "../../../../libs/design-system/dist/components/atoms/Button.js";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+
6
+ //#region ../learning-journey-ui-shared/src/components/ViewTabs.tsx
7
+ const VIEW_LABELS = {
8
+ overview: {
9
+ label: "Overview",
10
+ icon: "📊"
11
+ },
12
+ steps: {
13
+ label: "Steps",
14
+ icon: "📝"
15
+ },
16
+ progress: {
17
+ label: "Progress",
18
+ icon: "📈"
19
+ },
20
+ timeline: {
21
+ label: "Timeline",
22
+ icon: "📅"
23
+ }
24
+ };
25
+ const DEFAULT_VIEWS = [
26
+ "overview",
27
+ "steps",
28
+ "progress",
29
+ "timeline"
30
+ ];
31
+ function ViewTabs({ currentView, onViewChange, availableViews = DEFAULT_VIEWS }) {
32
+ return /* @__PURE__ */ jsx("div", {
33
+ className: "flex flex-wrap gap-2",
34
+ children: availableViews.map((view) => {
35
+ const { label, icon } = VIEW_LABELS[view];
36
+ return /* @__PURE__ */ jsxs(Button$1, {
37
+ variant: currentView === view ? "default" : "outline",
38
+ size: "sm",
39
+ onClick: () => onViewChange(view),
40
+ className: "gap-1.5",
41
+ children: [/* @__PURE__ */ jsx("span", { children: icon }), /* @__PURE__ */ jsx("span", { children: label })]
42
+ }, view);
43
+ })
44
+ });
45
+ }
46
+
47
+ //#endregion
48
+ export { ViewTabs };
@@ -0,0 +1,46 @@
1
+ 'use client';
2
+
3
+ import { Progress } from "../../../../libs/ui-kit-web/dist/ui/progress.js";
4
+ import { cn } from "../../../../libs/ui-kit-web/dist/ui/utils.js";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+
7
+ //#region ../learning-journey-ui-shared/src/components/XpBar.tsx
8
+ const sizeStyles = {
9
+ sm: "h-2",
10
+ md: "h-3",
11
+ lg: "h-4"
12
+ };
13
+ const labelSizeStyles = {
14
+ sm: "text-xs",
15
+ md: "text-sm",
16
+ lg: "text-base"
17
+ };
18
+ function XpBar({ current, max, level, showLabel = true, size = "md" }) {
19
+ const percentage = max > 0 ? Math.min(current / max * 100, 100) : 0;
20
+ return /* @__PURE__ */ jsxs("div", {
21
+ className: "w-full space-y-1",
22
+ children: [showLabel && /* @__PURE__ */ jsxs("div", {
23
+ className: cn("flex items-center justify-between", labelSizeStyles[size]),
24
+ children: [/* @__PURE__ */ jsxs("span", {
25
+ className: "text-muted-foreground font-medium",
26
+ children: [level !== void 0 && /* @__PURE__ */ jsxs("span", {
27
+ className: "text-primary mr-1",
28
+ children: ["Lvl ", level]
29
+ }), "XP"]
30
+ }), /* @__PURE__ */ jsxs("span", {
31
+ className: "font-semibold",
32
+ children: [
33
+ current.toLocaleString(),
34
+ " / ",
35
+ max.toLocaleString()
36
+ ]
37
+ })]
38
+ }), /* @__PURE__ */ jsx(Progress, {
39
+ value: percentage,
40
+ className: cn("bg-muted", sizeStyles[size])
41
+ })]
42
+ });
43
+ }
44
+
45
+ //#endregion
46
+ export { XpBar };
@@ -0,0 +1,4 @@
1
+ import { XpBar } from "./XpBar.js";
2
+ import { StreakCounter } from "./StreakCounter.js";
3
+ import { BadgeDisplay } from "./BadgeDisplay.js";
4
+ import { ViewTabs } from "./ViewTabs.js";
@@ -0,0 +1 @@
1
+ import "./learning-journey-ui-shared.docblock.js";
@@ -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-shared/src/docs/learning-journey-ui-shared.docblock.ts
5
+ registerDocBlocks([{
6
+ id: "docs.examples.learning-journey-ui-shared",
7
+ title: "Learning Journey UI — Shared",
8
+ summary: "Shared UI components and hooks for learning journey mini-apps.",
9
+ kind: "reference",
10
+ visibility: "public",
11
+ route: "/docs/examples/learning-journey-ui-shared",
12
+ tags: [
13
+ "learning",
14
+ "ui",
15
+ "shared"
16
+ ],
17
+ body: `## Includes\n- Hooks: useLearningProgress\n- Components: XpBar, StreakCounter, BadgeDisplay, ViewTabs\n\n## Notes\n- Keep components accessible (labels, focus, contrast).\n- Prefer design-system tokens and components.`
18
+ }]);
19
+
20
+ //#endregion
@@ -0,0 +1 @@
1
+ import { useLearningProgress } from "./useLearningProgress.js";
@@ -0,0 +1,73 @@
1
+ 'use client';
2
+
3
+ import { useCallback, useMemo, useState } from "react";
4
+
5
+ //#region ../learning-journey-ui-shared/src/hooks/useLearningProgress.ts
6
+ /** Default progress state for a new track */
7
+ function createDefaultProgress(trackId) {
8
+ return {
9
+ trackId,
10
+ completedStepIds: [],
11
+ currentStepId: null,
12
+ xpEarned: 0,
13
+ streakDays: 0,
14
+ lastActivityDate: null,
15
+ badges: []
16
+ };
17
+ }
18
+ /** Hook for managing learning progress state */
19
+ function useLearningProgress(track) {
20
+ const [progress, setProgress] = useState(() => createDefaultProgress(track.id));
21
+ const completeStep = useCallback((stepId) => {
22
+ const step = track.steps.find((s) => s.id === stepId);
23
+ if (!step || progress.completedStepIds.includes(stepId)) return;
24
+ setProgress((prev) => {
25
+ const newCompletedIds = [...prev.completedStepIds, stepId];
26
+ const xpReward = step.xpReward ?? 0;
27
+ const nextStep = track.steps.find((s) => !newCompletedIds.includes(s.id));
28
+ const isTrackComplete = newCompletedIds.length === track.steps.length;
29
+ const completionBonus = isTrackComplete ? track.completionRewards?.xpBonus ?? 0 : 0;
30
+ return {
31
+ ...prev,
32
+ completedStepIds: newCompletedIds,
33
+ currentStepId: nextStep?.id ?? null,
34
+ xpEarned: prev.xpEarned + xpReward + completionBonus,
35
+ lastActivityDate: (/* @__PURE__ */ new Date()).toISOString(),
36
+ badges: isTrackComplete && track.completionRewards?.badgeKey ? [...prev.badges, track.completionRewards.badgeKey] : prev.badges
37
+ };
38
+ });
39
+ }, [track, progress.completedStepIds]);
40
+ const resetProgress = useCallback(() => {
41
+ setProgress(createDefaultProgress(track.id));
42
+ }, [track.id]);
43
+ const incrementStreak = useCallback(() => {
44
+ setProgress((prev) => ({
45
+ ...prev,
46
+ streakDays: prev.streakDays + 1,
47
+ lastActivityDate: (/* @__PURE__ */ new Date()).toISOString()
48
+ }));
49
+ }, []);
50
+ return {
51
+ progress,
52
+ stats: useMemo(() => {
53
+ const totalSteps = track.steps.length;
54
+ const completedSteps = progress.completedStepIds.length;
55
+ const percentComplete = totalSteps > 0 ? Math.round(completedSteps / totalSteps * 100) : 0;
56
+ const totalXp = track.totalXp ?? track.steps.reduce((sum, s) => sum + (s.xpReward ?? 0), 0) + (track.completionRewards?.xpBonus ?? 0);
57
+ return {
58
+ totalSteps,
59
+ completedSteps,
60
+ remainingSteps: totalSteps - completedSteps,
61
+ percentComplete,
62
+ totalXp,
63
+ isComplete: completedSteps === totalSteps
64
+ };
65
+ }, [track, progress.completedStepIds]),
66
+ completeStep,
67
+ resetProgress,
68
+ incrementStreak
69
+ };
70
+ }
71
+
72
+ //#endregion
73
+ export { useLearningProgress };
@@ -0,0 +1,8 @@
1
+ import { useLearningProgress } from "./hooks/useLearningProgress.js";
2
+ import "./hooks/index.js";
3
+ import { XpBar } from "./components/XpBar.js";
4
+ import { StreakCounter } from "./components/StreakCounter.js";
5
+ import { BadgeDisplay } from "./components/BadgeDisplay.js";
6
+ import { ViewTabs } from "./components/ViewTabs.js";
7
+ import "./components/index.js";
8
+ import "./docs/index.js";
package/dist/index.js CHANGED
@@ -1 +1,13 @@
1
- import{crmLearningTracks as e,learningJourneyTracks as t,mapStep as n,mapTrackSpecToDto as r,onboardingTrackCatalog as i,platformLearningTracks as a,studioLearningTracks as o}from"./tracks.js";import{getProgress as s,listTracks as c,recordEvent as l}from"./api.js";import u from"./example.js";import"./docs/index.js";import{LearningTrackDetailPresentation as d,LearningTrackListPresentation as f,LearningTrackProgressWidgetPresentation as p,learningJourneyPresentations as m}from"./presentations/index.js";import{LearningJourneyRegistryFeature as h}from"./learning-journey-registry.feature.js";import{LearningMiniApp as g,getLearningTemplateIds as _,isLearningTemplate as v}from"./ui/LearningMiniApp.js";import"./ui/index.js";export{h as LearningJourneyRegistryFeature,g as LearningMiniApp,d as LearningTrackDetailPresentation,f as LearningTrackListPresentation,p as LearningTrackProgressWidgetPresentation,e as crmLearningTracks,u as example,_ as getLearningTemplateIds,s as getProgress,v as isLearningTemplate,m as learningJourneyPresentations,t as learningJourneyTracks,c as listTracks,n as mapStep,r as mapTrackSpecToDto,i as onboardingTrackCatalog,a as platformLearningTracks,l as recordEvent,o as studioLearningTracks};
1
+ import { crmLearningTracks } from "./examples/learning-journey-crm-onboarding/dist/track.js";
2
+ import { platformLearningTracks } from "./examples/learning-journey-platform-tour/dist/track.js";
3
+ import { studioLearningTracks } from "./examples/learning-journey-studio-onboarding/dist/track.js";
4
+ import { learningJourneyTracks, mapStep, mapTrackSpecToDto, onboardingTrackCatalog } from "./tracks.js";
5
+ import { getProgress, listTracks, recordEvent } from "./api.js";
6
+ import example_default from "./example.js";
7
+ import "./docs/index.js";
8
+ import { LearningTrackDetailPresentation, LearningTrackListPresentation, LearningTrackProgressWidgetPresentation, learningJourneyPresentations } from "./presentations/index.js";
9
+ import { LearningJourneyRegistryFeature } from "./learning-journey-registry.feature.js";
10
+ import { LearningMiniApp, getLearningTemplateIds, isLearningTemplate } from "./ui/LearningMiniApp.js";
11
+ import "./ui/index.js";
12
+
13
+ export { LearningJourneyRegistryFeature, LearningMiniApp, LearningTrackDetailPresentation, LearningTrackListPresentation, LearningTrackProgressWidgetPresentation, crmLearningTracks, example_default as example, getLearningTemplateIds, getProgress, isLearningTemplate, learningJourneyPresentations, learningJourneyTracks, listTracks, mapStep, mapTrackSpecToDto, onboardingTrackCatalog, platformLearningTracks, recordEvent, studioLearningTracks };
@@ -1 +1,66 @@
1
- const e={meta:{key:`learning-journey-registry`,title:`Learning Journey Registry`,description:`Shared registry and presentations for learning journey tracks`,domain:`learning-journey`,owners:[`@learning-team`],tags:[`learning`,`journey`,`onboarding`,`registry`],stability:`experimental`},operations:[],events:[],presentations:[{name:`learning.journey.track_list`,version:1},{name:`learning.journey.track_detail`,version:1},{name:`learning.journey.progress_widget`,version:1}],opToPresentation:[],presentationsTargets:[{name:`learning.journey.track_list`,version:1,targets:[`react`,`markdown`]},{name:`learning.journey.track_detail`,version:1,targets:[`react`,`markdown`,`application/json`]},{name:`learning.journey.progress_widget`,version:1,targets:[`react`]}],capabilities:{requires:[{key:`identity`,version:1}]}};export{e as LearningJourneyRegistryFeature};
1
+ //#region src/learning-journey-registry.feature.ts
2
+ /**
3
+ * Learning Journey Registry feature module that bundles
4
+ * the shared presentations for learning journey tracks.
5
+ */
6
+ const LearningJourneyRegistryFeature = {
7
+ meta: {
8
+ key: "learning-journey-registry",
9
+ title: "Learning Journey Registry",
10
+ description: "Shared registry and presentations for learning journey tracks",
11
+ domain: "learning-journey",
12
+ owners: ["@learning-team"],
13
+ tags: [
14
+ "learning",
15
+ "journey",
16
+ "onboarding",
17
+ "registry"
18
+ ],
19
+ stability: "experimental"
20
+ },
21
+ operations: [],
22
+ events: [],
23
+ presentations: [
24
+ {
25
+ name: "learning.journey.track_list",
26
+ version: 1
27
+ },
28
+ {
29
+ name: "learning.journey.track_detail",
30
+ version: 1
31
+ },
32
+ {
33
+ name: "learning.journey.progress_widget",
34
+ version: 1
35
+ }
36
+ ],
37
+ opToPresentation: [],
38
+ presentationsTargets: [
39
+ {
40
+ name: "learning.journey.track_list",
41
+ version: 1,
42
+ targets: ["react", "markdown"]
43
+ },
44
+ {
45
+ name: "learning.journey.track_detail",
46
+ version: 1,
47
+ targets: [
48
+ "react",
49
+ "markdown",
50
+ "application/json"
51
+ ]
52
+ },
53
+ {
54
+ name: "learning.journey.progress_widget",
55
+ version: 1,
56
+ targets: ["react"]
57
+ }
58
+ ],
59
+ capabilities: { requires: [{
60
+ key: "identity",
61
+ version: 1
62
+ }] }
63
+ };
64
+
65
+ //#endregion
66
+ export { LearningJourneyRegistryFeature };