@lssm/example.learning-journey-registry 0.0.0-canary-20251217062139 → 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.
Files changed (110) hide show
  1. package/.turbo/turbo-build$colon$bundle.log +409 -410
  2. package/.turbo/turbo-build.log +410 -55
  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 -1
  9. package/dist/examples/learning-journey-crm-onboarding/dist/track.js +98 -1
  10. package/dist/examples/learning-journey-duo-drills/src/track.js +65 -1
  11. package/dist/examples/learning-journey-platform-tour/dist/track.js +105 -1
  12. package/dist/examples/learning-journey-quest-challenges/src/track.js +35 -1
  13. package/dist/examples/learning-journey-studio-onboarding/dist/track.js +90 -1
  14. package/dist/examples/learning-journey-ui-coaching/src/CoachingMiniApp.js +64 -1
  15. package/dist/examples/learning-journey-ui-coaching/src/components/EngagementMeter.js +107 -1
  16. package/dist/examples/learning-journey-ui-coaching/src/components/TipCard.js +75 -1
  17. package/dist/examples/learning-journey-ui-coaching/src/components/TipFeed.js +65 -1
  18. package/dist/examples/learning-journey-ui-coaching/src/components/index.js +3 -1
  19. package/dist/examples/learning-journey-ui-coaching/src/docs/index.js +1 -1
  20. package/dist/examples/learning-journey-ui-coaching/src/docs/learning-journey-ui-coaching.docblock.js +19 -7
  21. package/dist/examples/learning-journey-ui-coaching/src/index.js +11 -1
  22. package/dist/examples/learning-journey-ui-coaching/src/views/Overview.js +152 -1
  23. package/dist/examples/learning-journey-ui-coaching/src/views/Progress.js +117 -1
  24. package/dist/examples/learning-journey-ui-coaching/src/views/Steps.js +68 -1
  25. package/dist/examples/learning-journey-ui-coaching/src/views/Timeline.js +112 -1
  26. package/dist/examples/learning-journey-ui-coaching/src/views/index.js +4 -1
  27. package/dist/examples/learning-journey-ui-gamified/src/GamifiedMiniApp.js +64 -1
  28. package/dist/examples/learning-journey-ui-gamified/src/components/DayCalendar.js +32 -1
  29. package/dist/examples/learning-journey-ui-gamified/src/components/FlashCard.js +79 -1
  30. package/dist/examples/learning-journey-ui-gamified/src/components/MasteryRing.js +81 -1
  31. package/dist/examples/learning-journey-ui-gamified/src/components/index.js +3 -1
  32. package/dist/examples/learning-journey-ui-gamified/src/docs/index.js +1 -1
  33. package/dist/examples/learning-journey-ui-gamified/src/docs/learning-journey-ui-gamified.docblock.js +19 -7
  34. package/dist/examples/learning-journey-ui-gamified/src/index.js +11 -1
  35. package/dist/examples/learning-journey-ui-gamified/src/views/Overview.js +163 -1
  36. package/dist/examples/learning-journey-ui-gamified/src/views/Progress.js +144 -1
  37. package/dist/examples/learning-journey-ui-gamified/src/views/Steps.js +55 -1
  38. package/dist/examples/learning-journey-ui-gamified/src/views/Timeline.js +132 -1
  39. package/dist/examples/learning-journey-ui-gamified/src/views/index.js +4 -1
  40. package/dist/examples/learning-journey-ui-onboarding/src/OnboardingMiniApp.js +64 -1
  41. package/dist/examples/learning-journey-ui-onboarding/src/components/CodeSnippet.js +4 -1
  42. package/dist/examples/learning-journey-ui-onboarding/src/components/JourneyMap.js +48 -1
  43. package/dist/examples/learning-journey-ui-onboarding/src/components/StepChecklist.js +79 -1
  44. package/dist/examples/learning-journey-ui-onboarding/src/components/index.js +3 -1
  45. package/dist/examples/learning-journey-ui-onboarding/src/docs/index.js +1 -1
  46. package/dist/examples/learning-journey-ui-onboarding/src/docs/learning-journey-ui-onboarding.docblock.js +19 -7
  47. package/dist/examples/learning-journey-ui-onboarding/src/index.js +10 -1
  48. package/dist/examples/learning-journey-ui-onboarding/src/views/Overview.js +180 -1
  49. package/dist/examples/learning-journey-ui-onboarding/src/views/Progress.js +162 -1
  50. package/dist/examples/learning-journey-ui-onboarding/src/views/Steps.js +91 -1
  51. package/dist/examples/learning-journey-ui-onboarding/src/views/Timeline.js +97 -1
  52. package/dist/examples/learning-journey-ui-onboarding/src/views/index.js +4 -1
  53. package/dist/examples/learning-journey-ui-shared/src/components/BadgeDisplay.js +44 -1
  54. package/dist/examples/learning-journey-ui-shared/src/components/StreakCounter.js +45 -1
  55. package/dist/examples/learning-journey-ui-shared/src/components/ViewTabs.js +48 -1
  56. package/dist/examples/learning-journey-ui-shared/src/components/XpBar.js +46 -1
  57. package/dist/examples/learning-journey-ui-shared/src/components/index.js +4 -1
  58. package/dist/examples/learning-journey-ui-shared/src/docs/index.js +1 -1
  59. package/dist/examples/learning-journey-ui-shared/src/docs/learning-journey-ui-shared.docblock.js +19 -6
  60. package/dist/examples/learning-journey-ui-shared/src/hooks/index.js +1 -1
  61. package/dist/examples/learning-journey-ui-shared/src/hooks/useLearningProgress.js +73 -1
  62. package/dist/examples/learning-journey-ui-shared/src/index.js +8 -1
  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 -1
  96. package/dist/libs/design-system/dist/components/atoms/Button.js +33 -1
  97. package/dist/libs/design-system/dist/ui-kit-web/dist/ui/button.js +55 -1
  98. package/dist/libs/design-system/dist/ui-kit-web/dist/ui-kit-core/dist/utils.js +13 -1
  99. package/dist/libs/ui-kit-core/dist/utils.js +10 -1
  100. package/dist/libs/ui-kit-web/dist/ui/card.js +36 -1
  101. package/dist/libs/ui-kit-web/dist/ui/progress.js +23 -1
  102. package/dist/libs/ui-kit-web/dist/ui/utils.js +10 -1
  103. package/dist/libs/ui-kit-web/dist/ui-kit-core/dist/utils.js +10 -1
  104. package/dist/presentations/index.js +64 -1
  105. package/dist/progress-store.js +30 -1
  106. package/dist/tracks.js +47 -1
  107. package/dist/ui/LearningMiniApp.js +82 -1
  108. package/dist/ui/index.js +3 -1
  109. package/package.json +16 -14
  110. package/tsconfig.tsbuildinfo +1 -1
@@ -1 +1,79 @@
1
- "use client";import{Button$1 as e}from"../../../../libs/design-system/dist/components/atoms/Button.js";import{cn as t}from"../../../../libs/ui-kit-core/dist/utils.js";import{jsx as n,jsxs as r}from"react/jsx-runtime";function i({step:i,stepNumber:a,isCompleted:o,isCurrent:s,isExpanded:c,onToggle:l,onComplete:u}){return r(`div`,{className:t(`rounded-xl border transition-all`,o&&`border-green-500/50 bg-green-500/5`,s&&!o&&`border-violet-500 bg-violet-500/5`,!o&&!s&&`border-border`),children:[r(`button`,{type:`button`,className:`flex w-full items-center gap-4 p-4 text-left`,onClick:l,children:[n(`div`,{className:t(`flex h-8 w-8 shrink-0 items-center justify-center rounded-full border-2 text-sm font-semibold transition-colors`,o&&`border-green-500 bg-green-500 text-white`,s&&!o&&`border-violet-500 text-violet-500`,!o&&!s&&`border-muted-foreground text-muted-foreground`),children:o?`✓`:a}),r(`div`,{className:`min-w-0 flex-1`,children:[n(`h4`,{className:t(`font-semibold`,o&&`text-green-500`,s&&!o&&`text-foreground`,!o&&!s&&`text-muted-foreground`),children:i.title}),!c&&i.description&&n(`p`,{className:`text-muted-foreground truncate text-sm`,children:i.description})]}),i.xpReward&&r(`span`,{className:t(`shrink-0 rounded-full px-2 py-1 text-xs font-semibold`,o?`bg-green-500/10 text-green-500`:`bg-muted text-muted-foreground`),children:[`+`,i.xpReward,` XP`]}),n(`span`,{className:t(`shrink-0 transition-transform`,c&&`rotate-180`),children:`▼`})]}),c&&r(`div`,{className:`border-t px-4 py-4`,children:[i.description&&n(`p`,{className:`text-muted-foreground mb-4`,children:i.description}),i.instructions&&r(`div`,{className:`bg-muted mb-4 rounded-lg p-4`,children:[n(`p`,{className:`mb-2 text-sm font-medium`,children:`Instructions:`}),n(`p`,{className:`text-muted-foreground text-sm`,children:i.instructions})]}),r(`div`,{className:`flex flex-wrap gap-2`,children:[i.actionUrl&&n(e,{variant:`outline`,size:`sm`,onClick:()=>window.open(i.actionUrl,`_blank`),children:i.actionLabel??`Try it`}),!o&&n(e,{size:`sm`,onClick:u,children:`Mark as Complete`})]})]})]})}export{i as StepChecklist};
1
+ 'use client';
2
+
3
+ import { Button$1 } from "../../../../libs/design-system/dist/components/atoms/Button.js";
4
+ import { cn } from "../../../../libs/ui-kit-core/dist/utils.js";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+
7
+ //#region ../learning-journey-ui-onboarding/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$1, {
63
+ variant: "outline",
64
+ size: "sm",
65
+ onClick: () => window.open(step.actionUrl, "_blank"),
66
+ children: step.actionLabel ?? "Try it"
67
+ }), !isCompleted && /* @__PURE__ */ jsx(Button$1, {
68
+ size: "sm",
69
+ onClick: onComplete,
70
+ children: "Mark as Complete"
71
+ })]
72
+ })
73
+ ]
74
+ })]
75
+ });
76
+ }
77
+
78
+ //#endregion
79
+ export { StepChecklist };
@@ -1 +1,3 @@
1
- import{StepChecklist as e}from"./StepChecklist.js";import{JourneyMap as t}from"./JourneyMap.js";import"./CodeSnippet.js";
1
+ import { StepChecklist } from "./StepChecklist.js";
2
+ import { JourneyMap } from "./JourneyMap.js";
3
+ import "./CodeSnippet.js";
@@ -1 +1 @@
1
- import"./learning-journey-ui-onboarding.docblock.js";
1
+ import "./learning-journey-ui-onboarding.docblock.js";
@@ -1,8 +1,20 @@
1
- import{a as e}from"../../../../libs/contracts/dist/docs/registry.js";import"../../../../libs/contracts/dist/docs/index.js";e([{id:`docs.examples.learning-journey-ui-onboarding`,title:`Learning Journey UI — Onboarding`,summary:`UI mini-app components for onboarding: checklists, snippets, and journey mapping.`,kind:`reference`,visibility:`public`,route:`/docs/examples/learning-journey-ui-onboarding`,tags:[`learning`,`ui`,`onboarding`],body:`## Includes
2
- - Onboarding mini-app shell
3
- - Views: overview, steps, progress, timeline
4
- - Components: step checklist, code snippet, journey map
1
+ import { registerDocBlocks } from "../../../../libs/contracts/dist/docs/registry.js";
2
+ import "../../../../libs/contracts/dist/docs/index.js";
5
3
 
6
- ## Notes
7
- - Compose with design system components.
8
- - Ensure accessible labels and keyboard navigation.`}]);
4
+ //#region ../learning-journey-ui-onboarding/src/docs/learning-journey-ui-onboarding.docblock.ts
5
+ registerDocBlocks([{
6
+ id: "docs.examples.learning-journey-ui-onboarding",
7
+ title: "Learning Journey UI — Onboarding",
8
+ summary: "UI mini-app components for onboarding: checklists, snippets, and journey mapping.",
9
+ kind: "reference",
10
+ visibility: "public",
11
+ route: "/docs/examples/learning-journey-ui-onboarding",
12
+ tags: [
13
+ "learning",
14
+ "ui",
15
+ "onboarding"
16
+ ],
17
+ body: `## Includes\n- Onboarding mini-app shell\n- Views: overview, steps, progress, timeline\n- Components: step checklist, code snippet, journey map\n\n## Notes\n- Compose with design system components.\n- Ensure accessible labels and keyboard navigation.`
18
+ }]);
19
+
20
+ //#endregion
@@ -1 +1,10 @@
1
- import{Overview as e}from"./views/Overview.js";import{StepChecklist as t}from"./components/StepChecklist.js";import{Steps as n}from"./views/Steps.js";import{ProgressView as r}from"./views/Progress.js";import{JourneyMap as i}from"./components/JourneyMap.js";import{Timeline as a}from"./views/Timeline.js";import{OnboardingMiniApp as o}from"./OnboardingMiniApp.js";import"./views/index.js";import"./components/index.js";import"./docs/index.js";
1
+ import { Overview } from "./views/Overview.js";
2
+ import { StepChecklist } from "./components/StepChecklist.js";
3
+ import { Steps } from "./views/Steps.js";
4
+ import { ProgressView } from "./views/Progress.js";
5
+ import { JourneyMap } from "./components/JourneyMap.js";
6
+ import { Timeline } from "./views/Timeline.js";
7
+ import { OnboardingMiniApp } from "./OnboardingMiniApp.js";
8
+ import "./views/index.js";
9
+ import "./components/index.js";
10
+ import "./docs/index.js";
@@ -1 +1,180 @@
1
- "use client";import{Card as e,CardContent as t,CardHeader as n,CardTitle as r}from"../../../../libs/ui-kit-web/dist/ui/card.js";import{Progress as i}from"../../../../libs/ui-kit-web/dist/ui/progress.js";import{XpBar as a}from"../../../learning-journey-ui-shared/src/components/XpBar.js";import{Button$1 as o}from"../../../../libs/design-system/dist/components/atoms/Button.js";import"../../../learning-journey-ui-shared/src/index.js";import{jsx as s,jsxs as c}from"react/jsx-runtime";function l({track:l,progress:u,onStart:d}){let f=l.steps.length,p=u.completedStepIds.length,m=f>0?p/f*100:0,h=p===f,g=f-p,_=g*5,v=l.totalXp??l.steps.reduce((e,t)=>e+(t.xpReward??0),0)+(l.completionRewards?.xpBonus??0);return c(`div`,{className:`space-y-6`,children:[s(e,{className:`overflow-hidden bg-gradient-to-r from-blue-500/10 via-violet-500/10 to-purple-500/10`,children:s(t,{className:`p-8`,children:c(`div`,{className:`flex flex-col items-center gap-6 text-center md:flex-row md:text-left`,children:[s(`div`,{className:`flex h-20 w-20 items-center justify-center rounded-2xl bg-gradient-to-br from-blue-500 to-violet-600 text-4xl shadow-lg`,children:h?`🎉`:`🚀`}),c(`div`,{className:`flex-1`,children:[s(`h1`,{className:`text-2xl font-bold`,children:l.name}),s(`p`,{className:`text-muted-foreground mt-1 max-w-2xl`,children:l.description}),!h&&c(`p`,{className:`text-muted-foreground mt-3 text-sm`,children:[`⏱️ Estimated time:`,` `,_>0?`~${_} minutes`:`Less than a minute`]})]}),!h&&s(o,{size:`lg`,onClick:d,children:p>0?`Continue`:`Get Started`})]})})}),c(`div`,{className:`grid gap-4 md:grid-cols-3`,children:[c(e,{children:[s(n,{className:`pb-2`,children:s(r,{className:`text-muted-foreground text-sm font-medium`,children:`Progress`})}),c(t,{children:[c(`div`,{className:`text-3xl font-bold`,children:[Math.round(m),`%`]}),s(i,{value:m,className:`mt-2 h-2`}),c(`p`,{className:`text-muted-foreground mt-2 text-sm`,children:[p,` of `,f,` steps completed`]})]})]}),c(e,{children:[s(n,{className:`pb-2`,children:s(r,{className:`text-muted-foreground text-sm font-medium`,children:`XP Earned`})}),c(t,{children:[s(`div`,{className:`text-3xl font-bold text-blue-500`,children:u.xpEarned}),s(a,{current:u.xpEarned,max:v,showLabel:!1,size:`sm`})]})]}),c(e,{children:[s(n,{className:`pb-2`,children:s(r,{className:`text-muted-foreground text-sm font-medium`,children:`Time Remaining`})}),c(t,{children:[s(`div`,{className:`text-3xl font-bold`,children:h?`✓`:`~${_}m`}),s(`p`,{className:`text-muted-foreground mt-2 text-sm`,children:h?`All done!`:`${g} steps to go`})]})]})]}),c(e,{children:[s(n,{children:c(r,{className:`flex items-center gap-2`,children:[s(`span`,{children:`📋`}),s(`span`,{children:`Your Journey`})]})}),s(t,{children:s(`div`,{className:`space-y-3`,children:l.steps.map((e,t)=>{let n=u.completedStepIds.includes(e.id),r=!n&&l.steps.slice(0,t).every(e=>u.completedStepIds.includes(e.id));return c(`div`,{className:`flex items-center gap-4 rounded-lg border p-3`,children:[s(`div`,{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-sm font-semibold ${n?`bg-green-500 text-white`:r?`bg-blue-500 text-white`:`bg-muted text-muted-foreground`}`,children:n?`✓`:t+1}),s(`div`,{className:`min-w-0 flex-1`,children:s(`p`,{className:`font-medium ${n?`text-green-500`:r?`text-foreground`:`text-muted-foreground`}`,children:e.title})}),e.xpReward&&c(`span`,{className:`text-muted-foreground text-sm`,children:[`+`,e.xpReward,` XP`]})]},e.id)})})})]}),h&&s(e,{className:`border-green-500/50 bg-green-500/5`,children:c(t,{className:`flex items-center gap-4 p-6`,children:[s(`div`,{className:`text-4xl`,children:`🎉`}),c(`div`,{children:[s(`h3`,{className:`text-lg font-semibold text-green-500`,children:`Onboarding Complete!`}),c(`p`,{className:`text-muted-foreground`,children:[`You've completed all `,f,` steps. Welcome aboard!`]})]})]})})]})}export{l as Overview};
1
+ 'use client';
2
+
3
+ import { Card, CardContent, CardHeader, CardTitle } from "../../../../libs/ui-kit-web/dist/ui/card.js";
4
+ import { Progress } from "../../../../libs/ui-kit-web/dist/ui/progress.js";
5
+ import { XpBar } from "../../../learning-journey-ui-shared/src/components/XpBar.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 { jsx, jsxs } from "react/jsx-runtime";
9
+
10
+ //#region ../learning-journey-ui-onboarding/src/views/Overview.tsx
11
+ function Overview({ track, progress, onStart }) {
12
+ const totalSteps = track.steps.length;
13
+ const completedSteps = progress.completedStepIds.length;
14
+ const percentComplete = totalSteps > 0 ? completedSteps / totalSteps * 100 : 0;
15
+ const isComplete = completedSteps === totalSteps;
16
+ const remainingSteps = totalSteps - completedSteps;
17
+ const estimatedMinutes = remainingSteps * 5;
18
+ const totalXp = track.totalXp ?? track.steps.reduce((sum, s) => sum + (s.xpReward ?? 0), 0) + (track.completionRewards?.xpBonus ?? 0);
19
+ return /* @__PURE__ */ jsxs("div", {
20
+ className: "space-y-6",
21
+ children: [
22
+ /* @__PURE__ */ jsx(Card, {
23
+ className: "overflow-hidden bg-gradient-to-r from-blue-500/10 via-violet-500/10 to-purple-500/10",
24
+ children: /* @__PURE__ */ jsx(CardContent, {
25
+ className: "p-8",
26
+ children: /* @__PURE__ */ jsxs("div", {
27
+ className: "flex flex-col items-center gap-6 text-center md:flex-row md:text-left",
28
+ children: [
29
+ /* @__PURE__ */ jsx("div", {
30
+ className: "flex h-20 w-20 items-center justify-center rounded-2xl bg-gradient-to-br from-blue-500 to-violet-600 text-4xl shadow-lg",
31
+ children: isComplete ? "🎉" : "🚀"
32
+ }),
33
+ /* @__PURE__ */ jsxs("div", {
34
+ className: "flex-1",
35
+ children: [
36
+ /* @__PURE__ */ jsx("h1", {
37
+ className: "text-2xl font-bold",
38
+ children: track.name
39
+ }),
40
+ /* @__PURE__ */ jsx("p", {
41
+ className: "text-muted-foreground mt-1 max-w-2xl",
42
+ children: track.description
43
+ }),
44
+ !isComplete && /* @__PURE__ */ jsxs("p", {
45
+ className: "text-muted-foreground mt-3 text-sm",
46
+ children: [
47
+ "⏱️ Estimated time:",
48
+ " ",
49
+ estimatedMinutes > 0 ? `~${estimatedMinutes} minutes` : "Less than a minute"
50
+ ]
51
+ })
52
+ ]
53
+ }),
54
+ !isComplete && /* @__PURE__ */ jsx(Button$1, {
55
+ size: "lg",
56
+ onClick: onStart,
57
+ children: completedSteps > 0 ? "Continue" : "Get Started"
58
+ })
59
+ ]
60
+ })
61
+ })
62
+ }),
63
+ /* @__PURE__ */ jsxs("div", {
64
+ className: "grid gap-4 md:grid-cols-3",
65
+ children: [
66
+ /* @__PURE__ */ jsxs(Card, { children: [/* @__PURE__ */ jsx(CardHeader, {
67
+ className: "pb-2",
68
+ children: /* @__PURE__ */ jsx(CardTitle, {
69
+ className: "text-muted-foreground text-sm font-medium",
70
+ children: "Progress"
71
+ })
72
+ }), /* @__PURE__ */ jsxs(CardContent, { children: [
73
+ /* @__PURE__ */ jsxs("div", {
74
+ className: "text-3xl font-bold",
75
+ children: [Math.round(percentComplete), "%"]
76
+ }),
77
+ /* @__PURE__ */ jsx(Progress, {
78
+ value: percentComplete,
79
+ className: "mt-2 h-2"
80
+ }),
81
+ /* @__PURE__ */ jsxs("p", {
82
+ className: "text-muted-foreground mt-2 text-sm",
83
+ children: [
84
+ completedSteps,
85
+ " of ",
86
+ totalSteps,
87
+ " steps completed"
88
+ ]
89
+ })
90
+ ] })] }),
91
+ /* @__PURE__ */ jsxs(Card, { children: [/* @__PURE__ */ jsx(CardHeader, {
92
+ className: "pb-2",
93
+ children: /* @__PURE__ */ jsx(CardTitle, {
94
+ className: "text-muted-foreground text-sm font-medium",
95
+ children: "XP Earned"
96
+ })
97
+ }), /* @__PURE__ */ jsxs(CardContent, { children: [/* @__PURE__ */ jsx("div", {
98
+ className: "text-3xl font-bold text-blue-500",
99
+ children: progress.xpEarned
100
+ }), /* @__PURE__ */ jsx(XpBar, {
101
+ current: progress.xpEarned,
102
+ max: totalXp,
103
+ showLabel: false,
104
+ size: "sm"
105
+ })] })] }),
106
+ /* @__PURE__ */ jsxs(Card, { children: [/* @__PURE__ */ jsx(CardHeader, {
107
+ className: "pb-2",
108
+ children: /* @__PURE__ */ jsx(CardTitle, {
109
+ className: "text-muted-foreground text-sm font-medium",
110
+ children: "Time Remaining"
111
+ })
112
+ }), /* @__PURE__ */ jsxs(CardContent, { children: [/* @__PURE__ */ jsx("div", {
113
+ className: "text-3xl font-bold",
114
+ children: isComplete ? "✓" : `~${estimatedMinutes}m`
115
+ }), /* @__PURE__ */ jsx("p", {
116
+ className: "text-muted-foreground mt-2 text-sm",
117
+ children: isComplete ? "All done!" : `${remainingSteps} steps to go`
118
+ })] })] })
119
+ ]
120
+ }),
121
+ /* @__PURE__ */ jsxs(Card, { children: [/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsxs(CardTitle, {
122
+ className: "flex items-center gap-2",
123
+ children: [/* @__PURE__ */ jsx("span", { children: "📋" }), /* @__PURE__ */ jsx("span", { children: "Your Journey" })]
124
+ }) }), /* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsx("div", {
125
+ className: "space-y-3",
126
+ children: track.steps.map((step, index) => {
127
+ const isStepCompleted = progress.completedStepIds.includes(step.id);
128
+ const isCurrent = !isStepCompleted && track.steps.slice(0, index).every((s) => progress.completedStepIds.includes(s.id));
129
+ return /* @__PURE__ */ jsxs("div", {
130
+ className: "flex items-center gap-4 rounded-lg border p-3",
131
+ children: [
132
+ /* @__PURE__ */ jsx("div", {
133
+ className: `flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-sm font-semibold ${isStepCompleted ? "bg-green-500 text-white" : isCurrent ? "bg-blue-500 text-white" : "bg-muted text-muted-foreground"}`,
134
+ children: isStepCompleted ? "✓" : index + 1
135
+ }),
136
+ /* @__PURE__ */ jsx("div", {
137
+ className: "min-w-0 flex-1",
138
+ children: /* @__PURE__ */ jsx("p", {
139
+ className: `font-medium ${isStepCompleted ? "text-green-500" : isCurrent ? "text-foreground" : "text-muted-foreground"}`,
140
+ children: step.title
141
+ })
142
+ }),
143
+ step.xpReward && /* @__PURE__ */ jsxs("span", {
144
+ className: "text-muted-foreground text-sm",
145
+ children: [
146
+ "+",
147
+ step.xpReward,
148
+ " XP"
149
+ ]
150
+ })
151
+ ]
152
+ }, step.id);
153
+ })
154
+ }) })] }),
155
+ isComplete && /* @__PURE__ */ jsx(Card, {
156
+ className: "border-green-500/50 bg-green-500/5",
157
+ children: /* @__PURE__ */ jsxs(CardContent, {
158
+ className: "flex items-center gap-4 p-6",
159
+ children: [/* @__PURE__ */ jsx("div", {
160
+ className: "text-4xl",
161
+ children: "🎉"
162
+ }), /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h3", {
163
+ className: "text-lg font-semibold text-green-500",
164
+ children: "Onboarding Complete!"
165
+ }), /* @__PURE__ */ jsxs("p", {
166
+ className: "text-muted-foreground",
167
+ children: [
168
+ "You've completed all ",
169
+ totalSteps,
170
+ " steps. Welcome aboard!"
171
+ ]
172
+ })] })]
173
+ })
174
+ })
175
+ ]
176
+ });
177
+ }
178
+
179
+ //#endregion
180
+ export { Overview };
@@ -1 +1,162 @@
1
- "use client";import{Card as e,CardContent as t,CardHeader as n,CardTitle as r}from"../../../../libs/ui-kit-web/dist/ui/card.js";import{Progress as i}from"../../../../libs/ui-kit-web/dist/ui/progress.js";import{XpBar as a}from"../../../learning-journey-ui-shared/src/components/XpBar.js";import{BadgeDisplay as o}from"../../../learning-journey-ui-shared/src/components/BadgeDisplay.js";import"../../../learning-journey-ui-shared/src/index.js";import{jsx as s,jsxs as c}from"react/jsx-runtime";function l({track:l,progress:u}){let d=l.steps.length,f=u.completedStepIds.length,p=d>0?f/d*100:0,m=l.totalXp??l.steps.reduce((e,t)=>e+(t.xpReward??0),0)+(l.completionRewards?.xpBonus??0),h=d-f,g=h*5;return c(`div`,{className:`space-y-6`,children:[c(e,{children:[s(n,{children:c(r,{className:`flex items-center gap-2`,children:[s(`span`,{children:`📈`}),s(`span`,{children:`Your Progress`})]})}),c(t,{className:`space-y-6`,children:[s(`div`,{className:`flex items-center justify-center`,children:c(`div`,{className:`relative flex h-40 w-40 items-center justify-center`,children:[c(`svg`,{className:`absolute h-full w-full -rotate-90`,viewBox:`0 0 100 100`,children:[s(`circle`,{cx:`50`,cy:`50`,r:`45`,fill:`none`,strokeWidth:`8`,className:`stroke-muted`}),s(`circle`,{cx:`50`,cy:`50`,r:`45`,fill:`none`,strokeWidth:`8`,strokeLinecap:`round`,strokeDasharray:`${p*2.83} 283`,className:`stroke-blue-500 transition-all duration-500`})]}),c(`div`,{className:`text-center`,children:[c(`div`,{className:`text-3xl font-bold`,children:[Math.round(p),`%`]}),s(`div`,{className:`text-muted-foreground text-sm`,children:`Complete`})]})]})}),c(`div`,{className:`grid grid-cols-3 gap-4 text-center`,children:[c(`div`,{children:[s(`div`,{className:`text-2xl font-bold text-green-500`,children:f}),s(`div`,{className:`text-muted-foreground text-sm`,children:`Completed`})]}),c(`div`,{children:[s(`div`,{className:`text-2xl font-bold text-orange-500`,children:h}),s(`div`,{className:`text-muted-foreground text-sm`,children:`Remaining`})]}),c(`div`,{children:[c(`div`,{className:`text-2xl font-bold`,children:[g,`m`]}),s(`div`,{className:`text-muted-foreground text-sm`,children:`Est. Time`})]})]})]})]}),c(e,{children:[s(n,{children:c(r,{className:`flex items-center gap-2`,children:[s(`span`,{children:`⚡`}),s(`span`,{children:`Experience Points`})]})}),c(t,{className:`space-y-4`,children:[c(`div`,{className:`flex items-baseline gap-2`,children:[s(`span`,{className:`text-3xl font-bold text-blue-500`,children:u.xpEarned}),c(`span`,{className:`text-muted-foreground`,children:[`/ `,m,` XP`]})]}),s(a,{current:u.xpEarned,max:m,showLabel:!1,size:`lg`})]})]}),c(e,{children:[s(n,{children:c(r,{className:`flex items-center gap-2`,children:[s(`span`,{children:`🏅`}),s(`span`,{children:`Achievements`})]})}),c(t,{children:[s(o,{badges:u.badges,size:`lg`}),u.badges.length===0&&l.completionRewards?.badgeKey&&c(`p`,{className:`text-muted-foreground text-sm`,children:[`Complete all steps to earn the "`,l.completionRewards.badgeKey,`" badge!`]})]})]}),c(e,{children:[s(n,{children:c(r,{className:`flex items-center gap-2`,children:[s(`span`,{children:`📋`}),s(`span`,{children:`Step Details`})]})}),s(t,{children:s(`div`,{className:`space-y-3`,children:l.steps.map((e,t)=>{let n=u.completedStepIds.includes(e.id),r=n?100:0;return c(`div`,{className:`space-y-1`,children:[c(`div`,{className:`flex items-center justify-between text-sm`,children:[c(`span`,{className:n?`text-green-500`:`text-foreground`,children:[t+1,`. `,e.title]}),s(`span`,{className:n?`text-green-500`:`text-muted-foreground`,children:n?`✓`:`Pending`})]}),s(i,{value:r,className:`h-1`})]},e.id)})})})]})]})}export{l as ProgressView};
1
+ 'use client';
2
+
3
+ import { Card, CardContent, CardHeader, CardTitle } from "../../../../libs/ui-kit-web/dist/ui/card.js";
4
+ import { Progress } from "../../../../libs/ui-kit-web/dist/ui/progress.js";
5
+ import { XpBar } from "../../../learning-journey-ui-shared/src/components/XpBar.js";
6
+ import { BadgeDisplay } from "../../../learning-journey-ui-shared/src/components/BadgeDisplay.js";
7
+ import "../../../learning-journey-ui-shared/src/index.js";
8
+ import { jsx, jsxs } from "react/jsx-runtime";
9
+
10
+ //#region ../learning-journey-ui-onboarding/src/views/Progress.tsx
11
+ function ProgressView({ track, progress }) {
12
+ const totalSteps = track.steps.length;
13
+ const completedSteps = progress.completedStepIds.length;
14
+ const percentComplete = totalSteps > 0 ? completedSteps / totalSteps * 100 : 0;
15
+ const totalXp = track.totalXp ?? track.steps.reduce((sum, s) => sum + (s.xpReward ?? 0), 0) + (track.completionRewards?.xpBonus ?? 0);
16
+ const remainingSteps = totalSteps - completedSteps;
17
+ const estimatedMinutes = remainingSteps * 5;
18
+ return /* @__PURE__ */ jsxs("div", {
19
+ className: "space-y-6",
20
+ children: [
21
+ /* @__PURE__ */ jsxs(Card, { children: [/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsxs(CardTitle, {
22
+ className: "flex items-center gap-2",
23
+ children: [/* @__PURE__ */ jsx("span", { children: "📈" }), /* @__PURE__ */ jsx("span", { children: "Your Progress" })]
24
+ }) }), /* @__PURE__ */ jsxs(CardContent, {
25
+ className: "space-y-6",
26
+ children: [/* @__PURE__ */ jsx("div", {
27
+ className: "flex items-center justify-center",
28
+ children: /* @__PURE__ */ jsxs("div", {
29
+ className: "relative flex h-40 w-40 items-center justify-center",
30
+ children: [/* @__PURE__ */ jsxs("svg", {
31
+ className: "absolute h-full w-full -rotate-90",
32
+ viewBox: "0 0 100 100",
33
+ children: [/* @__PURE__ */ jsx("circle", {
34
+ cx: "50",
35
+ cy: "50",
36
+ r: "45",
37
+ fill: "none",
38
+ strokeWidth: "8",
39
+ className: "stroke-muted"
40
+ }), /* @__PURE__ */ jsx("circle", {
41
+ cx: "50",
42
+ cy: "50",
43
+ r: "45",
44
+ fill: "none",
45
+ strokeWidth: "8",
46
+ strokeLinecap: "round",
47
+ strokeDasharray: `${percentComplete * 2.83} 283`,
48
+ className: "stroke-blue-500 transition-all duration-500"
49
+ })]
50
+ }), /* @__PURE__ */ jsxs("div", {
51
+ className: "text-center",
52
+ children: [/* @__PURE__ */ jsxs("div", {
53
+ className: "text-3xl font-bold",
54
+ children: [Math.round(percentComplete), "%"]
55
+ }), /* @__PURE__ */ jsx("div", {
56
+ className: "text-muted-foreground text-sm",
57
+ children: "Complete"
58
+ })]
59
+ })]
60
+ })
61
+ }), /* @__PURE__ */ jsxs("div", {
62
+ className: "grid grid-cols-3 gap-4 text-center",
63
+ children: [
64
+ /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("div", {
65
+ className: "text-2xl font-bold text-green-500",
66
+ children: completedSteps
67
+ }), /* @__PURE__ */ jsx("div", {
68
+ className: "text-muted-foreground text-sm",
69
+ children: "Completed"
70
+ })] }),
71
+ /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("div", {
72
+ className: "text-2xl font-bold text-orange-500",
73
+ children: remainingSteps
74
+ }), /* @__PURE__ */ jsx("div", {
75
+ className: "text-muted-foreground text-sm",
76
+ children: "Remaining"
77
+ })] }),
78
+ /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsxs("div", {
79
+ className: "text-2xl font-bold",
80
+ children: [estimatedMinutes, "m"]
81
+ }), /* @__PURE__ */ jsx("div", {
82
+ className: "text-muted-foreground text-sm",
83
+ children: "Est. Time"
84
+ })] })
85
+ ]
86
+ })]
87
+ })] }),
88
+ /* @__PURE__ */ jsxs(Card, { children: [/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsxs(CardTitle, {
89
+ className: "flex items-center gap-2",
90
+ children: [/* @__PURE__ */ jsx("span", { children: "⚡" }), /* @__PURE__ */ jsx("span", { children: "Experience Points" })]
91
+ }) }), /* @__PURE__ */ jsxs(CardContent, {
92
+ className: "space-y-4",
93
+ children: [/* @__PURE__ */ jsxs("div", {
94
+ className: "flex items-baseline gap-2",
95
+ children: [/* @__PURE__ */ jsx("span", {
96
+ className: "text-3xl font-bold text-blue-500",
97
+ children: progress.xpEarned
98
+ }), /* @__PURE__ */ jsxs("span", {
99
+ className: "text-muted-foreground",
100
+ children: [
101
+ "/ ",
102
+ totalXp,
103
+ " XP"
104
+ ]
105
+ })]
106
+ }), /* @__PURE__ */ jsx(XpBar, {
107
+ current: progress.xpEarned,
108
+ max: totalXp,
109
+ showLabel: false,
110
+ size: "lg"
111
+ })]
112
+ })] }),
113
+ /* @__PURE__ */ jsxs(Card, { children: [/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsxs(CardTitle, {
114
+ className: "flex items-center gap-2",
115
+ children: [/* @__PURE__ */ jsx("span", { children: "🏅" }), /* @__PURE__ */ jsx("span", { children: "Achievements" })]
116
+ }) }), /* @__PURE__ */ jsxs(CardContent, { children: [/* @__PURE__ */ jsx(BadgeDisplay, {
117
+ badges: progress.badges,
118
+ size: "lg"
119
+ }), progress.badges.length === 0 && track.completionRewards?.badgeKey && /* @__PURE__ */ jsxs("p", {
120
+ className: "text-muted-foreground text-sm",
121
+ children: [
122
+ "Complete all steps to earn the \"",
123
+ track.completionRewards.badgeKey,
124
+ "\" badge!"
125
+ ]
126
+ })] })] }),
127
+ /* @__PURE__ */ jsxs(Card, { children: [/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsxs(CardTitle, {
128
+ className: "flex items-center gap-2",
129
+ children: [/* @__PURE__ */ jsx("span", { children: "📋" }), /* @__PURE__ */ jsx("span", { children: "Step Details" })]
130
+ }) }), /* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsx("div", {
131
+ className: "space-y-3",
132
+ children: track.steps.map((step, index) => {
133
+ const isCompleted = progress.completedStepIds.includes(step.id);
134
+ const stepProgress = isCompleted ? 100 : 0;
135
+ return /* @__PURE__ */ jsxs("div", {
136
+ className: "space-y-1",
137
+ children: [/* @__PURE__ */ jsxs("div", {
138
+ className: "flex items-center justify-between text-sm",
139
+ children: [/* @__PURE__ */ jsxs("span", {
140
+ className: isCompleted ? "text-green-500" : "text-foreground",
141
+ children: [
142
+ index + 1,
143
+ ". ",
144
+ step.title
145
+ ]
146
+ }), /* @__PURE__ */ jsx("span", {
147
+ className: isCompleted ? "text-green-500" : "text-muted-foreground",
148
+ children: isCompleted ? "✓" : "Pending"
149
+ })]
150
+ }), /* @__PURE__ */ jsx(Progress, {
151
+ value: stepProgress,
152
+ className: "h-1"
153
+ })]
154
+ }, step.id);
155
+ })
156
+ }) })] })
157
+ ]
158
+ });
159
+ }
160
+
161
+ //#endregion
162
+ export { ProgressView };
@@ -1 +1,91 @@
1
- "use client";import{Progress as e}from"../../../../libs/ui-kit-web/dist/ui/progress.js";import{StepChecklist as t}from"../components/StepChecklist.js";import{useState as n}from"react";import{jsx as r,jsxs as i}from"react/jsx-runtime";function a({track:a,progress:o,onStepComplete:s}){let[c,l]=n(()=>a.steps.find(e=>!o.completedStepIds.includes(e.id))?.id??null),u=o.completedStepIds.length,d=a.steps.length,f=d>0?u/d*100:0,p=a.steps.findIndex(e=>!o.completedStepIds.includes(e.id));return i(`div`,{className:`space-y-6`,children:[i(`div`,{className:`space-y-2`,children:[i(`div`,{className:`flex items-center justify-between`,children:[r(`h2`,{className:`text-xl font-bold`,children:`Complete Each Step`}),i(`span`,{className:`text-muted-foreground text-sm`,children:[u,` / `,d,` completed`]})]}),r(e,{value:f,className:`h-2`})]}),r(`div`,{className:`space-y-3`,children:a.steps.map((e,n)=>{let i=o.completedStepIds.includes(e.id),u=n===p;return r(t,{step:e,stepNumber:n+1,isCompleted:i,isCurrent:u,isExpanded:c===e.id,onToggle:()=>l(c===e.id?null:e.id),onComplete:()=>{s?.(e.id);let t=a.steps[n+1];t&&!o.completedStepIds.includes(t.id)&&l(t.id)}},e.id)})}),a.completionRewards&&f<100&&r(`div`,{className:`rounded-lg border border-blue-500/30 bg-blue-500/5 p-4`,children:i(`p`,{className:`text-sm`,children:[`🎁 Complete all steps to unlock:`,a.completionRewards.xpBonus&&i(`span`,{className:`ml-2 font-semibold text-blue-500`,children:[`+`,a.completionRewards.xpBonus,` XP bonus`]}),a.completionRewards.badgeKey&&i(`span`,{className:`ml-2 font-semibold text-amber-500`,children:[`+ "`,a.completionRewards.badgeKey,`" badge`]})]})})]})}export{a as Steps};
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 };