@burdenoff/microfe-buildmyiq 2026.706.11 → 2026.709.2

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 (33) hide show
  1. package/dist/buildmyiq/BuildmyiqRoutes.js +67 -49
  2. package/dist/buildmyiq/BuildmyiqRoutes.js.map +1 -1
  3. package/dist/buildmyiq/components/Avatar.js.map +1 -1
  4. package/dist/buildmyiq/components/BuiDiscussion.js +1 -1
  5. package/dist/buildmyiq/components/Viz.js.map +1 -1
  6. package/dist/buildmyiq/index.js +1 -1
  7. package/dist/buildmyiq/pages/DashboardPage.js +159 -122
  8. package/dist/buildmyiq/pages/DashboardPage.js.map +1 -1
  9. package/dist/buildmyiq/pages/assessments/AssessmentDetailPage.js +1 -1
  10. package/dist/buildmyiq/pages/assessments/AssessmentDetailPage.js.map +1 -1
  11. package/dist/buildmyiq/pages/assessments/AssessmentsPage.js +1 -1
  12. package/dist/buildmyiq/pages/assessments/TakeAssessmentPage.js +1 -1
  13. package/dist/buildmyiq/pages/assessments/TakeAssessmentPage.js.map +1 -1
  14. package/dist/buildmyiq/pages/authoring/AuthoringPage.js +1 -1
  15. package/dist/buildmyiq/pages/authoring/CourseBuilderPage.js +1 -1
  16. package/dist/buildmyiq/pages/authoring/CourseBuilderPage.js.map +1 -1
  17. package/dist/buildmyiq/pages/catalog/CatalogPage.js +1 -1
  18. package/dist/buildmyiq/pages/catalog/CourseDetailPage.js +1 -1
  19. package/dist/buildmyiq/pages/certificates/CertificatesPage.js +1 -1
  20. package/dist/buildmyiq/pages/certificates/CertificatesPage.js.map +1 -1
  21. package/dist/buildmyiq/pages/cohorts/CohortsPage.js +1 -1
  22. package/dist/buildmyiq/pages/insights/InsightsPage.js.map +1 -1
  23. package/dist/buildmyiq/pages/learning/LessonPlayerPage.js +1 -1
  24. package/dist/buildmyiq/pages/learning/MyLearningPage.js +1 -1
  25. package/dist/buildmyiq/pages/learning/MyLearningPage.js.map +1 -1
  26. package/dist/buildmyiq/pages/paths/PathsPage.js +1 -1
  27. package/dist/buildmyiq/pages/paths/PathsPage.js.map +1 -1
  28. package/dist/buildmyiq/pages/skills/SkillsPage.js.map +1 -1
  29. package/dist/buildmyiq/pages/submissions/SubmissionsPage.js +5 -9
  30. package/dist/buildmyiq/pages/submissions/SubmissionsPage.js.map +1 -1
  31. package/dist/buildmyiq/shared/hooks/useTr.js +14 -0
  32. package/dist/buildmyiq/shared/hooks/useTr.js.map +1 -0
  33. package/package.json +1 -1
@@ -1,25 +1,27 @@
1
1
  import { useBuildmyiq as e } from "../context/BuildmyiqContext.js";
2
- import { cn as t } from "../utils/cn.js";
3
- import { PageLayout as n } from "../components/PageLayout.js";
4
- import { MetricsCard as r } from "../components/MetricsCard.js";
5
- import { formatEnumLabel as i, formatRelativeTime as a } from "../utils/formatters.js";
6
- import { EmptyState as o } from "../components/EmptyState.js";
7
- import { LoadingView as s, Section as c } from "../components/StateViews.js";
8
- import { MiniBar as l } from "../components/MiniBar.js";
9
- import { Avatar as u } from "../components/Avatar.js";
10
- import { Sparkline as d } from "../components/Viz.js";
11
2
  import "../context/index.js";
12
- import { useBuiCertificates as f, useBuiCourses as p, useBuiEnrollments as m } from "../hooks/useBuildmyiqApi.js";
3
+ import { useTr as t } from "../shared/hooks/useTr.js";
4
+ import { cn as n } from "../utils/cn.js";
5
+ import { PageLayout as r } from "../components/PageLayout.js";
6
+ import { MetricsCard as i } from "../components/MetricsCard.js";
7
+ import { formatEnumLabel as a, formatRelativeTime as o } from "../utils/formatters.js";
8
+ import { EmptyState as s } from "../components/EmptyState.js";
9
+ import { LoadingView as c, Section as l } from "../components/StateViews.js";
10
+ import { MiniBar as u } from "../components/MiniBar.js";
11
+ import { Avatar as d } from "../components/Avatar.js";
12
+ import { Sparkline as f } from "../components/Viz.js";
13
+ import { useBuiCertificates as p, useBuiCourses as m, useBuiEnrollments as h } from "../hooks/useBuildmyiqApi.js";
13
14
  import "../hooks/index.js";
14
15
  import "../components/index.js";
15
- import { CourseCard as h } from "./_shared/CourseCard.js";
16
+ import { CourseCard as g } from "./_shared/CourseCard.js";
16
17
  import "./_shared/index.js";
17
- import { useMemo as g } from "react";
18
- import { ArrowRight as _, Award as v, BookOpen as y, CheckCircle2 as b, Clock as x, Play as S } from "lucide-react";
19
- import { jsx as C, jsxs as w } from "react/jsx-runtime";
20
- import { Button as T, GlassCard as E } from "@burdenoff/fe-libs/ui";
18
+ import { useMemo as _ } from "react";
19
+ import { ArrowRight as v, Award as y, BookOpen as b, CheckCircle2 as x, Clock as S, Play as C } from "lucide-react";
20
+ import { jsx as w, jsxs as T } from "react/jsx-runtime";
21
+ import { Button as E, GlassCard as D } from "@burdenoff/fe-libs/ui";
22
+ import { useEventBus as O } from "@burdenoff/fe-libs/shared/events";
21
23
  //#region src/buildmyiq/pages/DashboardPage.tsx
22
- var D = (e, t = 8) => {
24
+ var k = (e, t = 8) => {
23
25
  let n = e.map((e) => e ? new Date(e).getTime() : NaN).filter((e) => !Number.isNaN(e)).sort((e, t) => e - t);
24
26
  if (n.length < 2) return n.length === 1 ? [1] : [];
25
27
  let r = n[0], i = Math.max(1, Date.now() - r), a = [];
@@ -28,187 +30,211 @@ var D = (e, t = 8) => {
28
30
  a.push(n.filter((e) => e <= o).length);
29
31
  }
30
32
  return a;
31
- }, O = ({ tint: e, children: n }) => /* @__PURE__ */ C("span", {
32
- className: t("inline-flex h-10 w-10 items-center justify-center rounded-xl", e),
33
+ }, A = ({ tint: e, children: t }) => /* @__PURE__ */ w("span", {
34
+ className: n("inline-flex h-10 w-10 items-center justify-center rounded-xl", e),
33
35
  "aria-hidden": "true",
34
- children: n
35
- }), k = () => {
36
- let { currentUser: t, navigateTo: k } = e(), A = t?.id, j = p({
36
+ children: t
37
+ }), j = () => {
38
+ let { currentUser: n, navigateTo: j, workspaceId: M } = e(), N = t(), P = O(), F = n?.id, I = m({
37
39
  status: "PUBLISHED",
38
40
  limit: 50
39
- }), M = m({
40
- learnerId: A,
41
+ }), L = h({
42
+ learnerId: F,
41
43
  limit: 50,
42
- enabled: !!A
43
- }), N = f(void 0, A), P = j.data?.items ?? [], F = M.data?.items ?? [], I = N.data ?? [], L = g(() => F.filter((e) => e.status === "ENROLLED" || e.status === "IN_PROGRESS").sort((e, t) => (t.lastActiveAt ?? t.enrolledAt).localeCompare(e.lastActiveAt ?? e.enrolledAt)), [F]), R = F.filter((e) => e.status === "COMPLETED").length, z = t?.firstName || t?.name?.split(" ")[0] || "there", B = [t?.firstName, t?.lastName].filter(Boolean).join(" ").trim(), V = t?.name || B || (z === "there" ? "" : z), H = t?.role ? i(t.role) : t?.email, U = j.isLoading || !!A && M.isLoading, W = g(() => {
44
+ enabled: !!F
45
+ }), R = p(void 0, F), z = I.data?.items ?? [], B = L.data?.items ?? [], V = R.data ?? [], H = _(() => B.filter((e) => e.status === "ENROLLED" || e.status === "IN_PROGRESS").sort((e, t) => (t.lastActiveAt ?? t.enrolledAt).localeCompare(e.lastActiveAt ?? e.enrolledAt)), [B]), U = B.filter((e) => e.status === "COMPLETED").length, W = n?.firstName || n?.name?.split(" ")[0] || "there", G = [n?.firstName, n?.lastName].filter(Boolean).join(" ").trim(), K = n?.name || G || (W === "there" ? "" : W), q = n?.role ? a(n.role) : n?.email, J = I.isLoading || !!F && L.isLoading, Y = _(() => {
44
46
  let e = /* @__PURE__ */ new Map();
45
- for (let t of P) e.set(t.id, t);
47
+ for (let t of z) e.set(t.id, t);
46
48
  return e;
47
- }, [P]), G = g(() => ({
48
- published: D(P.map((e) => e.publishedAt ?? e.createdAt)),
49
- inProgress: D(F.map((e) => e.enrolledAt)),
50
- completed: D(F.filter((e) => e.status === "COMPLETED").map((e) => e.completedAt ?? e.updatedAt)),
51
- certificates: D(I.map((e) => e.issuedAt))
49
+ }, [z]), X = _(() => ({
50
+ published: k(z.map((e) => e.publishedAt ?? e.createdAt)),
51
+ inProgress: k(B.map((e) => e.enrolledAt)),
52
+ completed: k(B.filter((e) => e.status === "COMPLETED").map((e) => e.completedAt ?? e.updatedAt)),
53
+ certificates: k(V.map((e) => e.issuedAt))
52
54
  }), [
53
- P,
54
- F,
55
- I
56
- ]), K = [
55
+ z,
56
+ B,
57
+ V
58
+ ]), Z = [
57
59
  {
58
60
  key: "published",
59
- icon: /* @__PURE__ */ C(y, { className: "h-5 w-5" }),
61
+ icon: /* @__PURE__ */ w(b, { className: "h-5 w-5" }),
60
62
  tint: "bg-[var(--color-accent-soft)] text-[var(--color-accent-primary)]",
61
- value: `${P.length}${j.data?.pageInfo?.hasMore ? "+" : ""}`,
62
- label: "Published courses",
63
+ value: `${z.length}${I.data?.pageInfo?.hasMore ? "+" : ""}`,
64
+ label: N("buildmyiq.dashboard.publishedCourses", "Published courses"),
63
65
  featured: !0,
64
- series: G.published,
66
+ series: X.published,
65
67
  sparkColor: "var(--color-accent-primary)"
66
68
  },
67
69
  {
68
70
  key: "in-progress",
69
- icon: /* @__PURE__ */ C(x, { className: "h-5 w-5" }),
71
+ icon: /* @__PURE__ */ w(S, { className: "h-5 w-5" }),
70
72
  tint: "bg-[color-mix(in_srgb,var(--color-accent-teal)_16%,transparent)] text-[var(--color-accent-teal)]",
71
- value: L.length,
72
- label: "Courses in progress",
73
- series: G.inProgress,
73
+ value: H.length,
74
+ label: N("buildmyiq.dashboard.coursesInProgress", "Courses in progress"),
75
+ series: X.inProgress,
74
76
  sparkColor: "var(--color-accent-teal)"
75
77
  },
76
78
  {
77
79
  key: "completed",
78
- icon: /* @__PURE__ */ C(b, { className: "h-5 w-5" }),
80
+ icon: /* @__PURE__ */ w(x, { className: "h-5 w-5" }),
79
81
  tint: "bg-status-success-bg-subtle text-status-success-text",
80
- value: R,
81
- label: "Completed",
82
- series: G.completed,
82
+ value: U,
83
+ label: N("buildmyiq.dashboard.completed", "Completed"),
84
+ series: X.completed,
83
85
  sparkColor: "var(--color-status-success-text)"
84
86
  },
85
87
  {
86
88
  key: "certificates",
87
- icon: /* @__PURE__ */ C(v, { className: "h-5 w-5" }),
89
+ icon: /* @__PURE__ */ w(y, { className: "h-5 w-5" }),
88
90
  tint: "bg-status-warning-bg-subtle text-status-warning-text",
89
- value: I.length,
90
- label: "Certificates earned",
91
- series: G.certificates,
91
+ value: V.length,
92
+ label: N("buildmyiq.dashboard.certificatesEarned", "Certificates earned"),
93
+ series: X.certificates,
92
94
  sparkColor: "var(--color-status-warning-text)"
93
95
  }
94
96
  ];
95
- return /* @__PURE__ */ C(n, {
96
- title: `Welcome back, ${z}`,
97
- description: "Your learning, teaching and credentialing — all in one workspace.",
97
+ return /* @__PURE__ */ w(r, {
98
+ title: N("buildmyiq.dashboard.welcomeBack", "Welcome back, {{name}}", { name: W }),
99
+ description: N("buildmyiq.dashboard.subtitle", "Your learning, teaching and credentialing — all in one workspace."),
98
100
  titleGradient: !0,
99
101
  aurora: !0,
100
- actions: t ? /* @__PURE__ */ w("div", {
102
+ actions: n ? /* @__PURE__ */ T("div", {
101
103
  className: "flex w-fit items-center gap-2.5 rounded-full border border-border-seam bg-bg-surface/60 py-1.5 pl-1.5 pr-3.5 backdrop-blur",
102
- children: [/* @__PURE__ */ C(u, {
103
- name: V || null,
104
- seed: t.id,
105
- src: t.avatar,
104
+ children: [/* @__PURE__ */ w(d, {
105
+ name: K || null,
106
+ seed: n.id,
107
+ src: n.avatar,
106
108
  size: "sm"
107
- }), (V || H) && /* @__PURE__ */ w("div", {
109
+ }), (K || q) && /* @__PURE__ */ T("div", {
108
110
  className: "min-w-0 leading-tight",
109
- children: [V && /* @__PURE__ */ C("p", {
111
+ children: [K && /* @__PURE__ */ w("p", {
110
112
  className: "truncate text-sm font-medium text-text-primary",
111
- children: V
112
- }), H && /* @__PURE__ */ C("p", {
113
+ children: K
114
+ }), q && /* @__PURE__ */ w("p", {
113
115
  className: "max-w-[10rem] truncate text-xs text-text-secondary",
114
- children: H
116
+ children: q
115
117
  })]
116
118
  })]
117
119
  }) : void 0,
118
- children: U ? /* @__PURE__ */ C(s, { label: "Loading your learning dashboard…" }) : /* @__PURE__ */ w("div", {
120
+ children: J ? /* @__PURE__ */ w(c, { label: N("buildmyiq.dashboard.loading", "Loading your learning dashboard…") }) : /* @__PURE__ */ T("div", {
119
121
  className: "flex flex-col gap-8",
122
+ "data-tour": "buildmyiq-dashboard-content",
120
123
  children: [
121
- /* @__PURE__ */ C("div", {
124
+ /* @__PURE__ */ w("div", {
122
125
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-4",
123
- children: K.map((e) => /* @__PURE__ */ C(r, {
124
- icon: /* @__PURE__ */ C(O, {
126
+ "data-tour": "buildmyiq-dashboard-kpis",
127
+ children: Z.map((e) => /* @__PURE__ */ w(i, {
128
+ icon: /* @__PURE__ */ w(A, {
125
129
  tint: e.tint,
126
130
  children: e.icon
127
131
  }),
128
132
  value: e.value,
129
133
  label: e.label,
130
134
  featured: e.featured,
131
- pill: e.series.length >= 2 ? /* @__PURE__ */ C(d, {
135
+ pill: e.series.length >= 2 ? /* @__PURE__ */ w(f, {
132
136
  data: e.series,
133
137
  color: e.sparkColor
134
138
  }) : void 0
135
139
  }, e.key))
136
140
  }),
137
- /* @__PURE__ */ C(c, {
138
- title: "Continue learning",
139
- description: "Pick up where you left off.",
140
- action: /* @__PURE__ */ w(T, {
141
+ /* @__PURE__ */ w(l, {
142
+ title: N("buildmyiq.dashboard.continueLearning", "Continue learning"),
143
+ description: N("buildmyiq.dashboard.continueLearningDescription", "Pick up where you left off."),
144
+ action: /* @__PURE__ */ T(E, {
141
145
  variant: "ghost",
142
146
  size: "sm",
143
- onClick: () => k("learning"),
144
- children: ["My learning ", /* @__PURE__ */ C(_, { className: "ml-1 h-4 w-4" })]
147
+ onClick: () => {
148
+ P.emitCustom("buildmyiq.dashboard.my_learning_clicked", { workspaceId: M }), j("learning");
149
+ },
150
+ "data-tour": "buildmyiq-dashboard-my-learning",
151
+ children: [
152
+ N("buildmyiq.dashboard.myLearning", "My learning"),
153
+ " ",
154
+ /* @__PURE__ */ w(v, { className: "ml-1 h-4 w-4" })
155
+ ]
145
156
  }),
146
- children: L.length === 0 ? /* @__PURE__ */ C(o, {
157
+ children: H.length === 0 ? /* @__PURE__ */ w(s, {
147
158
  illustration: "onboarding",
148
- title: "No active courses yet",
149
- description: "Browse the catalog and enrol in a course to start learning.",
150
- action: /* @__PURE__ */ C(T, {
151
- onClick: () => k("catalog"),
152
- children: "Explore the catalog"
159
+ title: N("buildmyiq.dashboard.noActiveCoursesTitle", "No active courses yet"),
160
+ description: N("buildmyiq.dashboard.noActiveCoursesDescription", "Browse the catalog and enrol in a course to start learning."),
161
+ action: /* @__PURE__ */ w(E, {
162
+ onClick: () => {
163
+ P.emitCustom("buildmyiq.dashboard.explore_catalog_clicked", { workspaceId: M }), j("catalog");
164
+ },
165
+ "data-tour": "buildmyiq-dashboard-explore-catalog",
166
+ children: N("common.explore", "Explore the catalog")
153
167
  })
154
- }) : /* @__PURE__ */ C("div", {
168
+ }) : /* @__PURE__ */ w("div", {
155
169
  className: "grid grid-cols-1 gap-4 md:grid-cols-2",
156
- children: L.slice(0, 4).map((e) => {
157
- let t = W.get(e.courseId), n = t?.title ?? "Course", r = (t) => {
158
- t?.stopPropagation(), k(`learning/${e.id}`);
170
+ "data-tour": "buildmyiq-dashboard-continue-cards",
171
+ children: H.slice(0, 4).map((e) => {
172
+ let t = Y.get(e.courseId), n = t?.title ?? "Course", r = (t) => {
173
+ t?.stopPropagation(), j(`learning/${e.id}`);
159
174
  };
160
- return /* @__PURE__ */ w(E, {
175
+ return /* @__PURE__ */ T(D, {
161
176
  treatment: "plain",
162
177
  className: "group flex cursor-pointer flex-col overflow-hidden transition-shadow hover:shadow-lg sm:flex-row",
163
178
  onClick: () => r(),
164
- children: [/* @__PURE__ */ w("div", {
179
+ children: [/* @__PURE__ */ T("div", {
165
180
  className: "relative h-36 w-full shrink-0 overflow-hidden bg-bg-sunken sm:h-auto sm:w-40",
166
- children: [t?.cover?.downloadUrl ? /* @__PURE__ */ C("img", {
181
+ children: [t?.cover?.downloadUrl ? /* @__PURE__ */ w("img", {
167
182
  src: t.cover.downloadUrl,
168
183
  alt: "",
169
184
  className: "h-full w-full object-cover transition-transform duration-500 group-hover:scale-105"
170
- }) : /* @__PURE__ */ C("div", {
185
+ }) : /* @__PURE__ */ w("div", {
171
186
  className: "flex h-full w-full items-center justify-center bg-gradient-to-br from-[var(--color-accent-soft)] to-bg-sunken",
172
- children: /* @__PURE__ */ C(y, { className: "h-8 w-8 text-text-secondary opacity-60" })
173
- }), /* @__PURE__ */ C("div", {
187
+ children: /* @__PURE__ */ w(b, { className: "h-8 w-8 text-text-secondary opacity-60" })
188
+ }), /* @__PURE__ */ w("div", {
174
189
  className: "absolute inset-0 flex items-center justify-center",
175
- children: /* @__PURE__ */ C("span", {
190
+ children: /* @__PURE__ */ w("span", {
176
191
  className: "inline-flex h-11 w-11 items-center justify-center rounded-full bg-bg-surface/85 shadow-lg backdrop-blur transition-transform duration-200 group-hover:scale-110",
177
- children: /* @__PURE__ */ C(S, { className: "ml-0.5 h-5 w-5 fill-current text-[var(--color-accent-primary)]" })
192
+ children: /* @__PURE__ */ w(C, { className: "ml-0.5 h-5 w-5 fill-current text-[var(--color-accent-primary)]" })
178
193
  })
179
194
  })]
180
- }), /* @__PURE__ */ w("div", {
195
+ }), /* @__PURE__ */ T("div", {
181
196
  className: "flex min-w-0 flex-1 flex-col gap-2 p-4",
182
197
  children: [
183
- /* @__PURE__ */ C("p", {
198
+ /* @__PURE__ */ w("p", {
184
199
  className: "line-clamp-1 font-semibold text-text-primary",
185
200
  children: n
186
201
  }),
187
- t?.summary && /* @__PURE__ */ C("p", {
202
+ t?.summary && /* @__PURE__ */ w("p", {
188
203
  className: "line-clamp-2 text-sm text-text-secondary",
189
204
  children: t.summary
190
205
  }),
191
- /* @__PURE__ */ w("div", {
206
+ /* @__PURE__ */ T("div", {
192
207
  className: "mt-auto space-y-2.5 pt-2",
193
- children: [/* @__PURE__ */ w("div", {
208
+ children: [/* @__PURE__ */ T("div", {
194
209
  className: "flex items-center gap-2",
195
- children: [/* @__PURE__ */ C(l, {
210
+ children: [/* @__PURE__ */ w(u, {
196
211
  value: e.progressPct,
197
212
  className: "flex-1"
198
- }), /* @__PURE__ */ w("span", {
213
+ }), /* @__PURE__ */ T("span", {
199
214
  className: "shrink-0 text-xs font-semibold tabular-nums text-text-secondary",
200
215
  children: [e.progressPct, "%"]
201
216
  })]
202
- }), /* @__PURE__ */ w("div", {
217
+ }), /* @__PURE__ */ T("div", {
203
218
  className: "flex items-center justify-between gap-2",
204
- children: [/* @__PURE__ */ w("span", {
219
+ children: [/* @__PURE__ */ T("span", {
205
220
  className: "truncate text-xs text-text-secondary",
206
- children: ["Active ", a(e.lastActiveAt ?? e.enrolledAt)]
207
- }), /* @__PURE__ */ w(T, {
221
+ children: ["Active ", o(e.lastActiveAt ?? e.enrolledAt)]
222
+ }), /* @__PURE__ */ T(E, {
208
223
  size: "sm",
209
224
  className: "min-h-[40px] shrink-0",
210
- onClick: (e) => r(e),
211
- children: [/* @__PURE__ */ C(S, { className: "mr-1 h-4 w-4 fill-current" }), " Continue"]
225
+ onClick: (t) => {
226
+ P.emitCustom("buildmyiq.dashboard.continue_course_clicked", {
227
+ workspaceId: M,
228
+ enrollmentId: e.id,
229
+ courseId: e.courseId
230
+ }), r(t);
231
+ },
232
+ "data-tour": "buildmyiq-dashboard-continue-button",
233
+ children: [
234
+ /* @__PURE__ */ w(C, { className: "mr-1 h-4 w-4 fill-current" }),
235
+ " ",
236
+ N("common.continue", "Continue")
237
+ ]
212
238
  })]
213
239
  })]
214
240
  })
@@ -218,28 +244,39 @@ var D = (e, t = 8) => {
218
244
  })
219
245
  })
220
246
  }),
221
- /* @__PURE__ */ C(c, {
222
- title: "Explore the catalog",
223
- description: "Newly published courses in your workspace.",
224
- action: /* @__PURE__ */ w(T, {
247
+ /* @__PURE__ */ w(l, {
248
+ title: N("buildmyiq.dashboard.exploreCatalog", "Explore the catalog"),
249
+ description: N("buildmyiq.dashboard.exploreCatalogDescription", "Newly published courses in your workspace."),
250
+ action: /* @__PURE__ */ T(E, {
225
251
  variant: "ghost",
226
252
  size: "sm",
227
- onClick: () => k("catalog"),
228
- children: ["Browse all ", /* @__PURE__ */ C(_, { className: "ml-1 h-4 w-4" })]
253
+ onClick: () => {
254
+ P.emitCustom("buildmyiq.dashboard.browse_all_catalog_clicked", { workspaceId: M }), j("catalog");
255
+ },
256
+ "data-tour": "buildmyiq-dashboard-browse-all",
257
+ children: [
258
+ N("common.browseAll", "Browse all"),
259
+ " ",
260
+ /* @__PURE__ */ w(v, { className: "ml-1 h-4 w-4" })
261
+ ]
229
262
  }),
230
- children: P.length === 0 ? /* @__PURE__ */ C(o, {
263
+ children: z.length === 0 ? /* @__PURE__ */ w(s, {
231
264
  illustration: "empty-data",
232
- title: "No published courses yet",
233
- description: "Create and publish a course in Authoring to populate the catalog.",
234
- action: /* @__PURE__ */ C(T, {
235
- onClick: () => k("authoring"),
236
- children: "Go to Authoring"
265
+ title: N("buildmyiq.dashboard.noPublishedCoursesTitle", "No published courses yet"),
266
+ description: N("buildmyiq.dashboard.noPublishedCoursesDescription", "Create and publish a course in Authoring to populate the catalog."),
267
+ action: /* @__PURE__ */ w(E, {
268
+ onClick: () => {
269
+ P.emitCustom("buildmyiq.dashboard.go_to_authoring_clicked", { workspaceId: M }), j("authoring");
270
+ },
271
+ "data-tour": "buildmyiq-dashboard-go-authoring",
272
+ children: N("common.create", "Go to Authoring")
237
273
  })
238
- }) : /* @__PURE__ */ C("div", {
274
+ }) : /* @__PURE__ */ w("div", {
239
275
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",
240
- children: P.slice(0, 8).map((e) => /* @__PURE__ */ C(h, {
276
+ "data-tour": "buildmyiq-dashboard-catalog-grid",
277
+ children: z.slice(0, 8).map((e) => /* @__PURE__ */ w(g, {
241
278
  course: e,
242
- onClick: () => k(`catalog/${e.id}`)
279
+ onClick: () => j(`catalog/${e.id}`)
243
280
  }, e.id))
244
281
  })
245
282
  })
@@ -248,6 +285,6 @@ var D = (e, t = 8) => {
248
285
  });
249
286
  };
250
287
  //#endregion
251
- export { k as DashboardPage };
288
+ export { j as DashboardPage };
252
289
 
253
290
  //# sourceMappingURL=DashboardPage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DashboardPage.js","names":[],"sources":["../../../src/buildmyiq/pages/DashboardPage.tsx"],"sourcesContent":["/**\n * DashboardPage — the Buildmyiq landing surface.\n * @module buildmyiq/pages\n *\n * A learner + educator overview built entirely from real `bui*` data:\n * - KPI row: published courses, my active enrollments, completed, certificates\n * — each stat card carries a tinted icon tile and (where derivable) a\n * Sparkline trend built from the REAL timestamps of the underlying rows.\n * - Continue learning: the caller's in-progress enrollments as rich cards with\n * real cover art, summary, a progress bar and a Continue action.\n * - Explore: recently published catalog courses.\n * Every number, row, avatar and trend is derived from live hooks; empty states\n * are honest and no value is fabricated.\n */\n\nimport type { FC, ReactNode, MouseEvent } from 'react';\nimport { useMemo } from 'react';\nimport { BookOpen, Clock, CheckCircle2, Award, ArrowRight, Play } from 'lucide-react';\nimport { Button, GlassCard } from '@burdenoff/fe-libs/ui';\nimport {\n PageLayout,\n MetricsCard,\n EmptyState,\n LoadingView,\n Section,\n MiniBar,\n Avatar,\n Sparkline,\n} from '../components';\nimport { CourseCard } from './_shared';\nimport { cn } from '../utils/cn';\nimport { useBuildmyiq } from '../context';\nimport { useBuiCourses, useBuiEnrollments, useBuiCertificates } from '../hooks';\nimport { formatRelativeTime, formatEnumLabel } from '../utils/formatters';\nimport type { BuiCourse, BuiEnrollment } from '../types';\n\n/**\n * Build a cumulative-count trend series from a set of REAL event timestamps\n * (e.g. `publishedAt`, `enrolledAt`, `issuedAt`). The span from the earliest\n * event to now is split into `buckets` slots and each slot holds the running\n * count of events up to its boundary — a genuine, non-fabricated growth line.\n * Returns fewer than two points when there is not enough history to plot; the\n * caller then omits the sparkline rather than drawing a meaningless flat line.\n */\nconst cumulativeSeries = (\n isoDates: Array<string | null | undefined>,\n buckets = 8\n): number[] => {\n const times = isoDates\n .map((d) => (d ? new Date(d).getTime() : Number.NaN))\n .filter((t) => !Number.isNaN(t))\n .sort((a, b) => a - b);\n if (times.length < 2) return times.length === 1 ? [1] : [];\n const start = times[0];\n const end = Date.now();\n const span = Math.max(1, end - start);\n const series: number[] = [];\n for (let i = 1; i <= buckets; i += 1) {\n const boundary = start + (span * i) / buckets;\n series.push(times.filter((t) => t <= boundary).length);\n }\n return series;\n};\n\n/** A tinted, rounded icon tile used in the KPI stat cards. */\nconst StatIcon: FC<{ tint: string; children: ReactNode }> = ({ tint, children }) => (\n <span\n className={cn('inline-flex h-10 w-10 items-center justify-center rounded-xl', tint)}\n aria-hidden=\"true\"\n >\n {children}\n </span>\n);\n\nexport const DashboardPage: FC = () => {\n const { currentUser, navigateTo } = useBuildmyiq();\n const learnerId = currentUser?.id;\n\n const coursesQuery = useBuiCourses({ status: 'PUBLISHED', limit: 50 });\n const enrollmentsQuery = useBuiEnrollments({ learnerId, limit: 50, enabled: Boolean(learnerId) });\n const certsQuery = useBuiCertificates(undefined, learnerId);\n\n const courses: BuiCourse[] = coursesQuery.data?.items ?? [];\n const enrollments: BuiEnrollment[] = enrollmentsQuery.data?.items ?? [];\n const certificates = certsQuery.data ?? [];\n\n const activeEnrollments = useMemo(\n () =>\n enrollments\n .filter((e) => e.status === 'ENROLLED' || e.status === 'IN_PROGRESS')\n .sort((a, b) =>\n (b.lastActiveAt ?? b.enrolledAt).localeCompare(a.lastActiveAt ?? a.enrolledAt)\n ),\n [enrollments]\n );\n const completedCount = enrollments.filter((e) => e.status === 'COMPLETED').length;\n\n const firstName = currentUser?.firstName || currentUser?.name?.split(' ')[0] || 'there';\n const fullName = [currentUser?.firstName, currentUser?.lastName].filter(Boolean).join(' ').trim();\n const displayName = currentUser?.name || fullName || (firstName === 'there' ? '' : firstName);\n const roleLabel = currentUser?.role ? formatEnumLabel(currentUser.role) : currentUser?.email;\n\n const isLoading = coursesQuery.isLoading || (Boolean(learnerId) && enrollmentsQuery.isLoading);\n\n const courseById = useMemo(() => {\n const map = new Map<string, BuiCourse>();\n for (const c of courses) map.set(c.id, c);\n return map;\n }, [courses]);\n\n // REAL trend lines — cumulative growth from each entity's own timestamps.\n const trends = useMemo(\n () => ({\n published: cumulativeSeries(courses.map((c) => c.publishedAt ?? c.createdAt)),\n inProgress: cumulativeSeries(enrollments.map((e) => e.enrolledAt)),\n completed: cumulativeSeries(\n enrollments\n .filter((e) => e.status === 'COMPLETED')\n .map((e) => e.completedAt ?? e.updatedAt)\n ),\n certificates: cumulativeSeries(certificates.map((c) => c.issuedAt)),\n }),\n [courses, enrollments, certificates]\n );\n\n const kpis: Array<{\n key: string;\n icon: ReactNode;\n tint: string;\n value: string | number;\n label: string;\n featured?: boolean;\n series: number[];\n sparkColor: string;\n }> = [\n {\n key: 'published',\n icon: <BookOpen className=\"h-5 w-5\" />,\n tint: 'bg-[var(--color-accent-soft)] text-[var(--color-accent-primary)]',\n value: `${courses.length}${coursesQuery.data?.pageInfo?.hasMore ? '+' : ''}`,\n label: 'Published courses',\n featured: true,\n series: trends.published,\n sparkColor: 'var(--color-accent-primary)',\n },\n {\n key: 'in-progress',\n icon: <Clock className=\"h-5 w-5\" />,\n tint: 'bg-[color-mix(in_srgb,var(--color-accent-teal)_16%,transparent)] text-[var(--color-accent-teal)]',\n value: activeEnrollments.length,\n label: 'Courses in progress',\n series: trends.inProgress,\n sparkColor: 'var(--color-accent-teal)',\n },\n {\n key: 'completed',\n icon: <CheckCircle2 className=\"h-5 w-5\" />,\n tint: 'bg-status-success-bg-subtle text-status-success-text',\n value: completedCount,\n label: 'Completed',\n series: trends.completed,\n sparkColor: 'var(--color-status-success-text)',\n },\n {\n key: 'certificates',\n icon: <Award className=\"h-5 w-5\" />,\n tint: 'bg-status-warning-bg-subtle text-status-warning-text',\n value: certificates.length,\n label: 'Certificates earned',\n series: trends.certificates,\n sparkColor: 'var(--color-status-warning-text)',\n },\n ];\n\n return (\n <PageLayout\n title={`Welcome back, ${firstName}`}\n description=\"Your learning, teaching and credentialing — all in one workspace.\"\n titleGradient\n aurora\n actions={\n currentUser ? (\n <div className=\"flex w-fit items-center gap-2.5 rounded-full border border-border-seam bg-bg-surface/60 py-1.5 pl-1.5 pr-3.5 backdrop-blur\">\n <Avatar name={displayName || null} seed={currentUser.id} src={currentUser.avatar} size=\"sm\" />\n {(displayName || roleLabel) && (\n <div className=\"min-w-0 leading-tight\">\n {displayName && (\n <p className=\"truncate text-sm font-medium text-text-primary\">{displayName}</p>\n )}\n {roleLabel && (\n <p className=\"max-w-[10rem] truncate text-xs text-text-secondary\">{roleLabel}</p>\n )}\n </div>\n )}\n </div>\n ) : undefined\n }\n >\n {isLoading ? (\n <LoadingView label=\"Loading your learning dashboard…\" />\n ) : (\n <div className=\"flex flex-col gap-8\">\n {/* KPI row */}\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-4\">\n {kpis.map((k) => (\n <MetricsCard\n key={k.key}\n icon={<StatIcon tint={k.tint}>{k.icon}</StatIcon>}\n value={k.value}\n label={k.label}\n featured={k.featured}\n pill={\n k.series.length >= 2 ? (\n <Sparkline data={k.series} color={k.sparkColor} />\n ) : undefined\n }\n />\n ))}\n </div>\n\n {/* Continue learning */}\n <Section\n title=\"Continue learning\"\n description=\"Pick up where you left off.\"\n action={\n <Button variant=\"ghost\" size=\"sm\" onClick={() => navigateTo('learning')}>\n My learning <ArrowRight className=\"ml-1 h-4 w-4\" />\n </Button>\n }\n >\n {activeEnrollments.length === 0 ? (\n <EmptyState\n illustration=\"onboarding\"\n title=\"No active courses yet\"\n description=\"Browse the catalog and enrol in a course to start learning.\"\n action={<Button onClick={() => navigateTo('catalog')}>Explore the catalog</Button>}\n />\n ) : (\n <div className=\"grid grid-cols-1 gap-4 md:grid-cols-2\">\n {activeEnrollments.slice(0, 4).map((e) => {\n const course = courseById.get(e.courseId);\n const title = course?.title ?? 'Course';\n const goToCourse = (ev?: MouseEvent) => {\n ev?.stopPropagation();\n navigateTo(`learning/${e.id}`);\n };\n return (\n <GlassCard\n key={e.id}\n treatment=\"plain\"\n className=\"group flex cursor-pointer flex-col overflow-hidden transition-shadow hover:shadow-lg sm:flex-row\"\n onClick={() => goToCourse()}\n >\n {/* Cover / play thumbnail */}\n <div className=\"relative h-36 w-full shrink-0 overflow-hidden bg-bg-sunken sm:h-auto sm:w-40\">\n {course?.cover?.downloadUrl ? (\n <img\n src={course.cover.downloadUrl}\n alt=\"\"\n className=\"h-full w-full object-cover transition-transform duration-500 group-hover:scale-105\"\n />\n ) : (\n <div className=\"flex h-full w-full items-center justify-center bg-gradient-to-br from-[var(--color-accent-soft)] to-bg-sunken\">\n <BookOpen className=\"h-8 w-8 text-text-secondary opacity-60\" />\n </div>\n )}\n <div className=\"absolute inset-0 flex items-center justify-center\">\n <span className=\"inline-flex h-11 w-11 items-center justify-center rounded-full bg-bg-surface/85 shadow-lg backdrop-blur transition-transform duration-200 group-hover:scale-110\">\n <Play className=\"ml-0.5 h-5 w-5 fill-current text-[var(--color-accent-primary)]\" />\n </span>\n </div>\n </div>\n\n {/* Content */}\n <div className=\"flex min-w-0 flex-1 flex-col gap-2 p-4\">\n <p className=\"line-clamp-1 font-semibold text-text-primary\">{title}</p>\n {course?.summary && (\n <p className=\"line-clamp-2 text-sm text-text-secondary\">\n {course.summary}\n </p>\n )}\n <div className=\"mt-auto space-y-2.5 pt-2\">\n <div className=\"flex items-center gap-2\">\n <MiniBar value={e.progressPct} className=\"flex-1\" />\n <span className=\"shrink-0 text-xs font-semibold tabular-nums text-text-secondary\">\n {e.progressPct}%\n </span>\n </div>\n <div className=\"flex items-center justify-between gap-2\">\n <span className=\"truncate text-xs text-text-secondary\">\n Active {formatRelativeTime(e.lastActiveAt ?? e.enrolledAt)}\n </span>\n <Button\n size=\"sm\"\n className=\"min-h-[40px] shrink-0\"\n onClick={(ev: MouseEvent) => goToCourse(ev)}\n >\n <Play className=\"mr-1 h-4 w-4 fill-current\" /> Continue\n </Button>\n </div>\n </div>\n </div>\n </GlassCard>\n );\n })}\n </div>\n )}\n </Section>\n\n {/* Explore catalog */}\n <Section\n title=\"Explore the catalog\"\n description=\"Newly published courses in your workspace.\"\n action={\n <Button variant=\"ghost\" size=\"sm\" onClick={() => navigateTo('catalog')}>\n Browse all <ArrowRight className=\"ml-1 h-4 w-4\" />\n </Button>\n }\n >\n {courses.length === 0 ? (\n <EmptyState\n illustration=\"empty-data\"\n title=\"No published courses yet\"\n description=\"Create and publish a course in Authoring to populate the catalog.\"\n action={<Button onClick={() => navigateTo('authoring')}>Go to Authoring</Button>}\n />\n ) : (\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4\">\n {courses.slice(0, 8).map((course) => (\n <CourseCard\n key={course.id}\n course={course}\n onClick={() => navigateTo(`catalog/${course.id}`)}\n />\n ))}\n </div>\n )}\n </Section>\n </div>\n )}\n </PageLayout>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA4CA,IAAM,KACJ,GACA,IAAU,MACG;CACb,IAAM,IAAQ,EACX,KAAK,MAAO,IAAI,IAAI,KAAK,EAAE,CAAC,SAAS,GAAG,IAAY,CACpD,QAAQ,MAAM,CAAC,OAAO,MAAM,EAAE,CAAC,CAC/B,MAAM,GAAG,MAAM,IAAI,EAAE;AACxB,KAAI,EAAM,SAAS,EAAG,QAAO,EAAM,WAAW,IAAI,CAAC,EAAE,GAAG,EAAE;CAC1D,IAAM,IAAQ,EAAM,IAEd,IAAO,KAAK,IAAI,GADV,KAAK,KAAK,GACS,EAAM,EAC/B,IAAmB,EAAE;AAC3B,MAAK,IAAI,IAAI,GAAG,KAAK,GAAS,KAAK,GAAG;EACpC,IAAM,IAAW,IAAS,IAAO,IAAK;AACtC,IAAO,KAAK,EAAM,QAAQ,MAAM,KAAK,EAAS,CAAC,OAAO;;AAExD,QAAO;GAIH,KAAuD,EAAE,SAAM,kBACnE,kBAAC,QAAD;CACE,WAA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EF,kBAAC,OAAD;MAAK,WAAU;gBACZ,EAAQ,MAAM,GAAG,EAAE,CAAC,KAAK,MACxB,kBAAC,GAAD;OAEU;OACR,eAAe,EAAW,WAAW,EAAO,KAAK;OACjD,EAHK,EAAO,GAGZ,CACF;MACE,CAAA;KAEA,CAAA;IACN;;EAEG,CAAA"}
1
+ {"version":3,"file":"DashboardPage.js","names":[],"sources":["../../../src/buildmyiq/pages/DashboardPage.tsx"],"sourcesContent":["/**\n * DashboardPage — the Buildmyiq landing surface.\n * @module buildmyiq/pages\n *\n * A learner + educator overview built entirely from real `bui*` data:\n * - KPI row: published courses, my active enrollments, completed, certificates\n * — each stat card carries a tinted icon tile and (where derivable) a\n * Sparkline trend built from the REAL timestamps of the underlying rows.\n * - Continue learning: the caller's in-progress enrollments as rich cards with\n * real cover art, summary, a progress bar and a Continue action.\n * - Explore: recently published catalog courses.\n * Every number, row, avatar and trend is derived from live hooks; empty states\n * are honest and no value is fabricated.\n */\n\nimport type { FC, ReactNode, MouseEvent } from 'react';\nimport { useMemo } from 'react';\nimport { BookOpen, Clock, CheckCircle2, Award, ArrowRight, Play } from 'lucide-react';\nimport { Button, GlassCard } from '@burdenoff/fe-libs/ui';\nimport { useEventBus } from '@burdenoff/fe-libs/shared/events';\nimport {\n PageLayout,\n MetricsCard,\n EmptyState,\n LoadingView,\n Section,\n MiniBar,\n Avatar,\n Sparkline,\n} from '../components';\nimport { CourseCard } from './_shared';\nimport { cn } from '../utils/cn';\nimport { useBuildmyiq } from '../context';\nimport { useBuiCourses, useBuiEnrollments, useBuiCertificates } from '../hooks';\nimport { useTr } from '../shared/hooks/useTr';\nimport { formatRelativeTime, formatEnumLabel } from '../utils/formatters';\nimport type { BuiCourse, BuiEnrollment } from '../types';\n\n/**\n * Build a cumulative-count trend series from a set of REAL event timestamps\n * (e.g. `publishedAt`, `enrolledAt`, `issuedAt`). The span from the earliest\n * event to now is split into `buckets` slots and each slot holds the running\n * count of events up to its boundary — a genuine, non-fabricated growth line.\n * Returns fewer than two points when there is not enough history to plot; the\n * caller then omits the sparkline rather than drawing a meaningless flat line.\n */\nconst cumulativeSeries = (isoDates: Array<string | null | undefined>, buckets = 8): number[] => {\n const times = isoDates\n .map((d) => (d ? new Date(d).getTime() : Number.NaN))\n .filter((t) => !Number.isNaN(t))\n .sort((a, b) => a - b);\n if (times.length < 2) return times.length === 1 ? [1] : [];\n const start = times[0];\n const end = Date.now();\n const span = Math.max(1, end - start);\n const series: number[] = [];\n for (let i = 1; i <= buckets; i += 1) {\n const boundary = start + (span * i) / buckets;\n series.push(times.filter((t) => t <= boundary).length);\n }\n return series;\n};\n\n/** A tinted, rounded icon tile used in the KPI stat cards. */\nconst StatIcon: FC<{ tint: string; children: ReactNode }> = ({ tint, children }) => (\n <span\n className={cn('inline-flex h-10 w-10 items-center justify-center rounded-xl', tint)}\n aria-hidden=\"true\"\n >\n {children}\n </span>\n);\n\nexport const DashboardPage: FC = () => {\n const { currentUser, navigateTo, workspaceId } = useBuildmyiq();\n const tr = useTr();\n const bus = useEventBus();\n const learnerId = currentUser?.id;\n\n const coursesQuery = useBuiCourses({ status: 'PUBLISHED', limit: 50 });\n const enrollmentsQuery = useBuiEnrollments({ learnerId, limit: 50, enabled: Boolean(learnerId) });\n const certsQuery = useBuiCertificates(undefined, learnerId);\n\n const courses: BuiCourse[] = coursesQuery.data?.items ?? [];\n const enrollments: BuiEnrollment[] = enrollmentsQuery.data?.items ?? [];\n const certificates = certsQuery.data ?? [];\n\n const activeEnrollments = useMemo(\n () =>\n enrollments\n .filter((e) => e.status === 'ENROLLED' || e.status === 'IN_PROGRESS')\n .sort((a, b) =>\n (b.lastActiveAt ?? b.enrolledAt).localeCompare(a.lastActiveAt ?? a.enrolledAt)\n ),\n [enrollments]\n );\n const completedCount = enrollments.filter((e) => e.status === 'COMPLETED').length;\n\n const firstName = currentUser?.firstName || currentUser?.name?.split(' ')[0] || 'there';\n const fullName = [currentUser?.firstName, currentUser?.lastName].filter(Boolean).join(' ').trim();\n const displayName = currentUser?.name || fullName || (firstName === 'there' ? '' : firstName);\n const roleLabel = currentUser?.role ? formatEnumLabel(currentUser.role) : currentUser?.email;\n\n const isLoading = coursesQuery.isLoading || (Boolean(learnerId) && enrollmentsQuery.isLoading);\n\n const courseById = useMemo(() => {\n const map = new Map<string, BuiCourse>();\n for (const c of courses) map.set(c.id, c);\n return map;\n }, [courses]);\n\n // REAL trend lines — cumulative growth from each entity's own timestamps.\n const trends = useMemo(\n () => ({\n published: cumulativeSeries(courses.map((c) => c.publishedAt ?? c.createdAt)),\n inProgress: cumulativeSeries(enrollments.map((e) => e.enrolledAt)),\n completed: cumulativeSeries(\n enrollments.filter((e) => e.status === 'COMPLETED').map((e) => e.completedAt ?? e.updatedAt)\n ),\n certificates: cumulativeSeries(certificates.map((c) => c.issuedAt)),\n }),\n [courses, enrollments, certificates]\n );\n\n const kpis: Array<{\n key: string;\n icon: ReactNode;\n tint: string;\n value: string | number;\n label: string;\n featured?: boolean;\n series: number[];\n sparkColor: string;\n }> = [\n {\n key: 'published',\n icon: <BookOpen className=\"h-5 w-5\" />,\n tint: 'bg-[var(--color-accent-soft)] text-[var(--color-accent-primary)]',\n value: `${courses.length}${coursesQuery.data?.pageInfo?.hasMore ? '+' : ''}`,\n label: tr('buildmyiq.dashboard.publishedCourses', 'Published courses'),\n featured: true,\n series: trends.published,\n sparkColor: 'var(--color-accent-primary)',\n },\n {\n key: 'in-progress',\n icon: <Clock className=\"h-5 w-5\" />,\n tint: 'bg-[color-mix(in_srgb,var(--color-accent-teal)_16%,transparent)] text-[var(--color-accent-teal)]',\n value: activeEnrollments.length,\n label: tr('buildmyiq.dashboard.coursesInProgress', 'Courses in progress'),\n series: trends.inProgress,\n sparkColor: 'var(--color-accent-teal)',\n },\n {\n key: 'completed',\n icon: <CheckCircle2 className=\"h-5 w-5\" />,\n tint: 'bg-status-success-bg-subtle text-status-success-text',\n value: completedCount,\n label: tr('buildmyiq.dashboard.completed', 'Completed'),\n series: trends.completed,\n sparkColor: 'var(--color-status-success-text)',\n },\n {\n key: 'certificates',\n icon: <Award className=\"h-5 w-5\" />,\n tint: 'bg-status-warning-bg-subtle text-status-warning-text',\n value: certificates.length,\n label: tr('buildmyiq.dashboard.certificatesEarned', 'Certificates earned'),\n series: trends.certificates,\n sparkColor: 'var(--color-status-warning-text)',\n },\n ];\n\n return (\n <PageLayout\n title={tr('buildmyiq.dashboard.welcomeBack', 'Welcome back, {{name}}', { name: firstName })}\n description={tr(\n 'buildmyiq.dashboard.subtitle',\n 'Your learning, teaching and credentialing — all in one workspace.'\n )}\n titleGradient\n aurora\n actions={\n currentUser ? (\n <div className=\"flex w-fit items-center gap-2.5 rounded-full border border-border-seam bg-bg-surface/60 py-1.5 pl-1.5 pr-3.5 backdrop-blur\">\n <Avatar\n name={displayName || null}\n seed={currentUser.id}\n src={currentUser.avatar}\n size=\"sm\"\n />\n {(displayName || roleLabel) && (\n <div className=\"min-w-0 leading-tight\">\n {displayName && (\n <p className=\"truncate text-sm font-medium text-text-primary\">{displayName}</p>\n )}\n {roleLabel && (\n <p className=\"max-w-[10rem] truncate text-xs text-text-secondary\">{roleLabel}</p>\n )}\n </div>\n )}\n </div>\n ) : undefined\n }\n >\n {isLoading ? (\n <LoadingView\n label={tr('buildmyiq.dashboard.loading', 'Loading your learning dashboard…')}\n />\n ) : (\n <div className=\"flex flex-col gap-8\" data-tour=\"buildmyiq-dashboard-content\">\n {/* KPI row */}\n <div\n className=\"grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-4\"\n data-tour=\"buildmyiq-dashboard-kpis\"\n >\n {kpis.map((k) => (\n <MetricsCard\n key={k.key}\n icon={<StatIcon tint={k.tint}>{k.icon}</StatIcon>}\n value={k.value}\n label={k.label}\n featured={k.featured}\n pill={\n k.series.length >= 2 ? (\n <Sparkline data={k.series} color={k.sparkColor} />\n ) : undefined\n }\n />\n ))}\n </div>\n\n {/* Continue learning */}\n <Section\n title={tr('buildmyiq.dashboard.continueLearning', 'Continue learning')}\n description={tr(\n 'buildmyiq.dashboard.continueLearningDescription',\n 'Pick up where you left off.'\n )}\n action={\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={() => {\n bus.emitCustom('buildmyiq.dashboard.my_learning_clicked', { workspaceId });\n navigateTo('learning');\n }}\n data-tour=\"buildmyiq-dashboard-my-learning\"\n >\n {tr('buildmyiq.dashboard.myLearning', 'My learning')}{' '}\n <ArrowRight className=\"ml-1 h-4 w-4\" />\n </Button>\n }\n >\n {activeEnrollments.length === 0 ? (\n <EmptyState\n illustration=\"onboarding\"\n title={tr('buildmyiq.dashboard.noActiveCoursesTitle', 'No active courses yet')}\n description={tr(\n 'buildmyiq.dashboard.noActiveCoursesDescription',\n 'Browse the catalog and enrol in a course to start learning.'\n )}\n action={\n <Button\n onClick={() => {\n bus.emitCustom('buildmyiq.dashboard.explore_catalog_clicked', {\n workspaceId,\n });\n navigateTo('catalog');\n }}\n data-tour=\"buildmyiq-dashboard-explore-catalog\"\n >\n {tr('common.explore', 'Explore the catalog')}\n </Button>\n }\n />\n ) : (\n <div\n className=\"grid grid-cols-1 gap-4 md:grid-cols-2\"\n data-tour=\"buildmyiq-dashboard-continue-cards\"\n >\n {activeEnrollments.slice(0, 4).map((e) => {\n const course = courseById.get(e.courseId);\n const title = course?.title ?? 'Course';\n const goToCourse = (ev?: MouseEvent) => {\n ev?.stopPropagation();\n navigateTo(`learning/${e.id}`);\n };\n return (\n <GlassCard\n key={e.id}\n treatment=\"plain\"\n className=\"group flex cursor-pointer flex-col overflow-hidden transition-shadow hover:shadow-lg sm:flex-row\"\n onClick={() => goToCourse()}\n >\n {/* Cover / play thumbnail */}\n <div className=\"relative h-36 w-full shrink-0 overflow-hidden bg-bg-sunken sm:h-auto sm:w-40\">\n {course?.cover?.downloadUrl ? (\n <img\n src={course.cover.downloadUrl}\n alt=\"\"\n className=\"h-full w-full object-cover transition-transform duration-500 group-hover:scale-105\"\n />\n ) : (\n <div className=\"flex h-full w-full items-center justify-center bg-gradient-to-br from-[var(--color-accent-soft)] to-bg-sunken\">\n <BookOpen className=\"h-8 w-8 text-text-secondary opacity-60\" />\n </div>\n )}\n <div className=\"absolute inset-0 flex items-center justify-center\">\n <span className=\"inline-flex h-11 w-11 items-center justify-center rounded-full bg-bg-surface/85 shadow-lg backdrop-blur transition-transform duration-200 group-hover:scale-110\">\n <Play className=\"ml-0.5 h-5 w-5 fill-current text-[var(--color-accent-primary)]\" />\n </span>\n </div>\n </div>\n\n {/* Content */}\n <div className=\"flex min-w-0 flex-1 flex-col gap-2 p-4\">\n <p className=\"line-clamp-1 font-semibold text-text-primary\">{title}</p>\n {course?.summary && (\n <p className=\"line-clamp-2 text-sm text-text-secondary\">\n {course.summary}\n </p>\n )}\n <div className=\"mt-auto space-y-2.5 pt-2\">\n <div className=\"flex items-center gap-2\">\n <MiniBar value={e.progressPct} className=\"flex-1\" />\n <span className=\"shrink-0 text-xs font-semibold tabular-nums text-text-secondary\">\n {e.progressPct}%\n </span>\n </div>\n <div className=\"flex items-center justify-between gap-2\">\n <span className=\"truncate text-xs text-text-secondary\">\n Active {formatRelativeTime(e.lastActiveAt ?? e.enrolledAt)}\n </span>\n <Button\n size=\"sm\"\n className=\"min-h-[40px] shrink-0\"\n onClick={(ev: MouseEvent) => {\n bus.emitCustom('buildmyiq.dashboard.continue_course_clicked', {\n workspaceId,\n enrollmentId: e.id,\n courseId: e.courseId,\n });\n goToCourse(ev);\n }}\n data-tour=\"buildmyiq-dashboard-continue-button\"\n >\n <Play className=\"mr-1 h-4 w-4 fill-current\" />{' '}\n {tr('common.continue', 'Continue')}\n </Button>\n </div>\n </div>\n </div>\n </GlassCard>\n );\n })}\n </div>\n )}\n </Section>\n\n {/* Explore catalog */}\n <Section\n title={tr('buildmyiq.dashboard.exploreCatalog', 'Explore the catalog')}\n description={tr(\n 'buildmyiq.dashboard.exploreCatalogDescription',\n 'Newly published courses in your workspace.'\n )}\n action={\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={() => {\n bus.emitCustom('buildmyiq.dashboard.browse_all_catalog_clicked', { workspaceId });\n navigateTo('catalog');\n }}\n data-tour=\"buildmyiq-dashboard-browse-all\"\n >\n {tr('common.browseAll', 'Browse all')} <ArrowRight className=\"ml-1 h-4 w-4\" />\n </Button>\n }\n >\n {courses.length === 0 ? (\n <EmptyState\n illustration=\"empty-data\"\n title={tr(\n 'buildmyiq.dashboard.noPublishedCoursesTitle',\n 'No published courses yet'\n )}\n description={tr(\n 'buildmyiq.dashboard.noPublishedCoursesDescription',\n 'Create and publish a course in Authoring to populate the catalog.'\n )}\n action={\n <Button\n onClick={() => {\n bus.emitCustom('buildmyiq.dashboard.go_to_authoring_clicked', {\n workspaceId,\n });\n navigateTo('authoring');\n }}\n data-tour=\"buildmyiq-dashboard-go-authoring\"\n >\n {tr('common.create', 'Go to Authoring')}\n </Button>\n }\n />\n ) : (\n <div\n className=\"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4\"\n data-tour=\"buildmyiq-dashboard-catalog-grid\"\n >\n {courses.slice(0, 8).map((course) => (\n <CourseCard\n key={course.id}\n course={course}\n onClick={() => navigateTo(`catalog/${course.id}`)}\n />\n ))}\n </div>\n )}\n </Section>\n </div>\n )}\n </PageLayout>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA8CA,IAAM,KAAoB,GAA4C,IAAU,MAAgB;CAC9F,IAAM,IAAQ,EACX,KAAK,MAAO,IAAI,IAAI,KAAK,EAAE,CAAC,SAAS,GAAG,IAAY,CACpD,QAAQ,MAAM,CAAC,OAAO,MAAM,EAAE,CAAC,CAC/B,MAAM,GAAG,MAAM,IAAI,EAAE;AACxB,KAAI,EAAM,SAAS,EAAG,QAAO,EAAM,WAAW,IAAI,CAAC,EAAE,GAAG,EAAE;CAC1D,IAAM,IAAQ,EAAM,IAEd,IAAO,KAAK,IAAI,GADV,KAAK,KAAK,GACS,EAAM,EAC/B,IAAmB,EAAE;AAC3B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EAHK,EAAO,GAGZ,CACF;MACE,CAAA;KAEA,CAAA;IACN;;EAEG,CAAA"}
@@ -1,11 +1,11 @@
1
1
  import { useBuildmyiq as e } from "../../context/BuildmyiqContext.js";
2
+ import "../../context/index.js";
2
3
  import { cn as t } from "../../utils/cn.js";
3
4
  import { PageLayout as n } from "../../components/PageLayout.js";
4
5
  import { formatDuration as r, formatEnumLabel as i } from "../../utils/formatters.js";
5
6
  import { StatusBadge as a } from "../../components/StatusBadge.js";
6
7
  import { EmptyState as o } from "../../components/EmptyState.js";
7
8
  import { ErrorView as ee, LoadingView as te, Section as ne } from "../../components/StateViews.js";
8
- import "../../context/index.js";
9
9
  import { useBuiAssessment as re, useBuiCreateQuestion as s, useBuiPublishAssessment as c } from "../../hooks/useBuildmyiqApi.js";
10
10
  import "../../hooks/index.js";
11
11
  import "../../components/index.js";