@burdenoff/microfe-timecampus 2026.1031.13 → 2026.1102.1

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 (62) hide show
  1. package/dist/generated/wspace-operations.d.ts +181 -0
  2. package/dist/generated/wspace-operations.d.ts.map +1 -1
  3. package/dist/generated/wspace-operations.js +1373 -1273
  4. package/dist/generated/wspace-operations.js.map +1 -1
  5. package/dist/generated/wspace-types.d.ts +574 -13
  6. package/dist/generated/wspace-types.d.ts.map +1 -1
  7. package/dist/generated/wspace-types.js +10 -8
  8. package/dist/generated/wspace-types.js.map +1 -1
  9. package/dist/index.js +7 -7
  10. package/dist/timecampus/TimeCampusRoot.d.ts.map +1 -1
  11. package/dist/timecampus/TimeCampusRoot.js +116 -96
  12. package/dist/timecampus/TimeCampusRoot.js.map +1 -1
  13. package/dist/timecampus/TimeCampusRoutes.d.ts.map +1 -1
  14. package/dist/timecampus/TimeCampusRoutes.js +26 -14
  15. package/dist/timecampus/TimeCampusRoutes.js.map +1 -1
  16. package/dist/timecampus/components/ToggleSwitch.d.ts +12 -0
  17. package/dist/timecampus/components/ToggleSwitch.d.ts.map +1 -0
  18. package/dist/timecampus/components/ToggleSwitch.js +19 -0
  19. package/dist/timecampus/components/ToggleSwitch.js.map +1 -0
  20. package/dist/timecampus/components/index.d.ts +1 -0
  21. package/dist/timecampus/components/index.d.ts.map +1 -1
  22. package/dist/timecampus/components/index.js +11 -10
  23. package/dist/timecampus/index.js +7 -7
  24. package/dist/timecampus/pages/dashboard/ReportsPage.d.ts.map +1 -1
  25. package/dist/timecampus/pages/dashboard/ReportsPage.js +143 -129
  26. package/dist/timecampus/pages/dashboard/ReportsPage.js.map +1 -1
  27. package/dist/timecampus/pages/dashboard/ServerReportExports.d.ts +6 -0
  28. package/dist/timecampus/pages/dashboard/ServerReportExports.d.ts.map +1 -0
  29. package/dist/timecampus/pages/dashboard/ServerReportExports.js +257 -0
  30. package/dist/timecampus/pages/dashboard/ServerReportExports.js.map +1 -0
  31. package/dist/timecampus/pages/dashboard/reportTemplates.d.ts +33 -0
  32. package/dist/timecampus/pages/dashboard/reportTemplates.d.ts.map +1 -0
  33. package/dist/timecampus/pages/dashboard/reportTemplates.js +129 -0
  34. package/dist/timecampus/pages/dashboard/reportTemplates.js.map +1 -0
  35. package/dist/timecampus/pages/lifetime/PersonalCorporatePage.d.ts.map +1 -1
  36. package/dist/timecampus/pages/lifetime/PersonalCorporatePage.js +147 -162
  37. package/dist/timecampus/pages/lifetime/PersonalCorporatePage.js.map +1 -1
  38. package/dist/timecampus/pages/settings/PrivacySettingsPage.d.ts +2 -0
  39. package/dist/timecampus/pages/settings/PrivacySettingsPage.d.ts.map +1 -0
  40. package/dist/timecampus/pages/settings/PrivacySettingsPage.js +268 -0
  41. package/dist/timecampus/pages/settings/PrivacySettingsPage.js.map +1 -0
  42. package/dist/timecampus/pages/settings/SettingsPage.d.ts +2 -0
  43. package/dist/timecampus/pages/settings/SettingsPage.d.ts.map +1 -0
  44. package/dist/timecampus/pages/settings/SettingsPage.js +175 -0
  45. package/dist/timecampus/pages/settings/SettingsPage.js.map +1 -0
  46. package/dist/timecampus/pages/settings/ThemePreferenceSync.d.ts +15 -0
  47. package/dist/timecampus/pages/settings/ThemePreferenceSync.d.ts.map +1 -0
  48. package/dist/timecampus/pages/settings/ThemePreferenceSync.js +80 -0
  49. package/dist/timecampus/pages/settings/ThemePreferenceSync.js.map +1 -0
  50. package/dist/timecampus/pages/settings/retention.d.ts +25 -0
  51. package/dist/timecampus/pages/settings/retention.d.ts.map +1 -0
  52. package/dist/timecampus/pages/settings/retention.js +34 -0
  53. package/dist/timecampus/pages/settings/retention.js.map +1 -0
  54. package/dist/timecampus/pages/settings/themePreference.d.ts +45 -0
  55. package/dist/timecampus/pages/settings/themePreference.d.ts.map +1 -0
  56. package/dist/timecampus/pages/settings/themePreference.js +49 -0
  57. package/dist/timecampus/pages/settings/themePreference.js.map +1 -0
  58. package/dist/timecampus/utils/helpers.d.ts +2 -0
  59. package/dist/timecampus/utils/helpers.d.ts.map +1 -1
  60. package/dist/timecampus/utils/helpers.js +5 -1
  61. package/dist/timecampus/utils/helpers.js.map +1 -1
  62. package/package.json +1 -1
@@ -11,82 +11,86 @@ import { BarsChart as d } from "../../components/charts/BarsChart.js";
11
11
  import { RadialGauge as f } from "../../components/charts/RadialGauge.js";
12
12
  import { ProgressMeter as p } from "../../components/charts/ProgressMeter.js";
13
13
  import "../../components/index.js";
14
- import { useState as m } from "react";
15
- import { Brain as h, CalendarRange as g, Clock as _, DollarSign as v, Download as y, RefreshCw as b } from "lucide-react";
16
- import { jsx as x, jsxs as S } from "react/jsx-runtime";
17
- import { GlassCard as C } from "@burdenoff/fe-libs/ui";
14
+ import { ServerReportExports as m } from "./ServerReportExports.js";
15
+ import { useState as h } from "react";
16
+ import { Brain as g, CalendarRange as _, Clock as v, DollarSign as y, Download as b, RefreshCw as x } from "lucide-react";
17
+ import { jsx as S, jsxs as C } from "react/jsx-runtime";
18
+ import { GlassCard as w } from "@burdenoff/fe-libs/ui";
18
19
  //#region src/timecampus/pages/dashboard/ReportsPage.tsx
19
- function w(e, t) {
20
+ function T(e, t) {
20
21
  let n = (e) => `"${String(e).replace(/"/g, "\"\"")}"`, r = ["Metric,Value", ...t.map(([e, t]) => `${n(e)},${n(t)}`)].join("\n"), i = new Blob([r], { type: "text/csv;charset=utf-8;" }), a = URL.createObjectURL(i), o = document.createElement("a");
21
22
  o.href = a, o.download = e, document.body.appendChild(o), o.click(), document.body.removeChild(o), URL.revokeObjectURL(a);
22
23
  }
23
- function T() {
24
+ function E() {
24
25
  c("reports");
25
- let { workspaceId: T = "" } = e(), [E, D] = m(!1), { data: O, loading: k, error: A, refetch: j } = o({ skip: !T }), { data: M, loading: N, refetch: P } = s({ skip: !T }), { data: F, loading: I, refetch: L } = a({ skip: !T }), R = O?.timeEntryStats, z = M?.workPatternSummary, B = F?.focusScoreSummary, V = async () => {
26
- D(!0);
26
+ let { workspaceId: E = "" } = e(), [D, O] = h(!1), { data: k, loading: A, error: j, refetch: M } = o({ skip: !E }), { data: N, loading: P, refetch: F } = s({ skip: !E }), { data: I, loading: L, refetch: R } = a({ skip: !E }), z = k?.timeEntryStats, B = N?.workPatternSummary, V = I?.focusScoreSummary, H = async () => {
27
+ O(!0);
27
28
  try {
28
29
  await Promise.all([
29
- j(),
30
- P(),
31
- L()
30
+ M(),
31
+ F(),
32
+ R()
32
33
  ]);
33
34
  } finally {
34
- D(!1);
35
+ O(!1);
35
36
  }
36
- }, H = (e) => {
37
- (e === "time-summary" || e === "billable-summary") && R ? w(`${e}.csv`, [
38
- ["Total hours", Math.round(R.totalHours)],
39
- ["Billable hours", Math.round(R.billableHours)],
40
- ["Total entries", R.totalEntries],
41
- ["Active timers", R.activeTimers]
42
- ]) : e === "work-pattern" && z ? w("work-pattern-analysis.csv", [["Average focus hours", z.averageFocusHours.toFixed(1)], ["Average productivity %", Math.round(z.averageProductivity)]]) : e === "focus-score" && B && w("focus-score-report.csv", [
43
- ["Average score", Math.round(B.averageScore)],
44
- ["Highest score", Math.round(B.highestScore)],
45
- ["Lowest score", Math.round(B.lowestScore)]
37
+ }, U = (e) => {
38
+ (e === "time-summary" || e === "billable-summary") && z ? T(`${e}.csv`, [
39
+ ["Total hours", Math.round(z.totalHours)],
40
+ ["Billable hours", Math.round(z.billableHours)],
41
+ ["Total entries", z.totalEntries],
42
+ ["Active timers", z.activeTimers]
43
+ ]) : e === "work-pattern" && B ? T("work-pattern-analysis.csv", [["Average focus hours", B.averageFocusHours.toFixed(1)], ["Average productivity %", Math.round(B.averageProductivity)]]) : e === "focus-score" && V && T("focus-score-report.csv", [
44
+ ["Average score", Math.round(V.averageScore)],
45
+ ["Highest score", Math.round(V.highestScore)],
46
+ ["Lowest score", Math.round(V.lowestScore)]
46
47
  ]);
47
48
  };
48
- if (k || N || I) return /* @__PURE__ */ x(l, {
49
+ if (A && !k || P && !N || L && !I) return /* @__PURE__ */ S(l, {
49
50
  title: "Reports",
50
51
  description: "Generate and view time tracking reports",
51
- actions: /* @__PURE__ */ S("button", {
52
+ actions: /* @__PURE__ */ C("button", {
52
53
  disabled: !0,
53
54
  className: "inline-flex items-center gap-1.5 rounded-md bg-action-primary-bg px-3 py-2 text-sm font-medium text-action-primary-text opacity-70",
54
- children: [/* @__PURE__ */ x(b, { className: "h-4 w-4" }), "Refresh"]
55
+ children: [/* @__PURE__ */ S(x, { className: "h-4 w-4" }), "Refresh"]
55
56
  }),
56
- children: /* @__PURE__ */ x(r, {
57
+ children: /* @__PURE__ */ S(r, {
57
58
  variant: "list",
58
59
  count: 4
59
60
  })
60
61
  });
61
- if (A) return /* @__PURE__ */ x(l, {
62
+ if (j) return /* @__PURE__ */ C(l, {
62
63
  title: "Reports",
63
64
  description: "Generate and view time tracking reports",
64
- children: /* @__PURE__ */ x("div", {
65
+ children: [/* @__PURE__ */ S("div", {
66
+ className: "mb-6",
67
+ children: /* @__PURE__ */ S(m, {})
68
+ }), /* @__PURE__ */ S("div", {
65
69
  className: "rounded-lg border border-status-error-bg/40 bg-status-error-bg p-4 text-sm text-status-error-text",
66
- children: "Failed to load reports data. Please try again later."
67
- })
70
+ children: "Failed to load the summary figures. Please try again later."
71
+ })]
68
72
  });
69
- let U = R ? Math.max(0, R.totalHours - R.billableHours) : 0, W = R && R.totalHours > 0 ? Math.round(R.billableHours / R.totalHours * 100) : 0, G = [
70
- ...R ? [{
73
+ let W = z ? Math.max(0, z.totalHours - z.billableHours) : 0, G = z && z.totalHours > 0 ? Math.round(z.billableHours / z.totalHours * 100) : 0, K = [
74
+ ...z ? [{
71
75
  id: "time-summary",
72
76
  name: "Time Tracking Summary",
73
77
  typeLabel: "Time",
74
78
  typeVariant: "info",
75
- period: `${n(R.totalHours)} total · ${R.totalEntries} entries`,
76
- icon: /* @__PURE__ */ x(_, { className: "h-5 w-5" }),
79
+ period: `${n(z.totalHours)} total · ${z.totalEntries} entries`,
80
+ icon: /* @__PURE__ */ S(v, { className: "h-5 w-5" }),
77
81
  accent: "bg-status-info-bg text-status-info-text",
78
- visual: /* @__PURE__ */ S("div", {
82
+ visual: /* @__PURE__ */ C("div", {
79
83
  className: "space-y-2",
80
- children: [/* @__PURE__ */ x(p, {
81
- value: R.billableHours,
82
- max: R.totalHours > 0 ? R.totalHours : 1,
84
+ children: [/* @__PURE__ */ S(p, {
85
+ value: z.billableHours,
86
+ max: z.totalHours > 0 ? z.totalHours : 1,
83
87
  higherIsWorse: !1,
84
88
  label: "Billable share",
85
89
  format: n,
86
90
  size: "md"
87
- }), /* @__PURE__ */ S("div", {
91
+ }), /* @__PURE__ */ C("div", {
88
92
  className: "flex items-center justify-between text-xs text-text-secondary",
89
- children: [/* @__PURE__ */ S("span", { children: [R.totalEntries, " entries logged"] }), /* @__PURE__ */ x("span", { children: R.activeTimers > 0 ? `${R.activeTimers} timer(s) running` : "No active timers" })]
93
+ children: [/* @__PURE__ */ C("span", { children: [z.totalEntries, " entries logged"] }), /* @__PURE__ */ S("span", { children: z.activeTimers > 0 ? `${z.activeTimers} timer(s) running` : "No active timers" })]
90
94
  })]
91
95
  })
92
96
  }, {
@@ -94,16 +98,16 @@ function T() {
94
98
  name: "Billable Hours Report",
95
99
  typeLabel: "Billing",
96
100
  typeVariant: "success",
97
- period: `${n(R.billableHours)} billable · ${W}% of tracked`,
98
- icon: /* @__PURE__ */ x(v, { className: "h-5 w-5" }),
101
+ period: `${n(z.billableHours)} billable · ${G}% of tracked`,
102
+ icon: /* @__PURE__ */ S(y, { className: "h-5 w-5" }),
99
103
  accent: "bg-status-success-bg text-status-success-text",
100
- visual: /* @__PURE__ */ x(d, {
104
+ visual: /* @__PURE__ */ S(d, {
101
105
  data: [{
102
106
  label: "Billable",
103
- hours: R.billableHours
107
+ hours: z.billableHours
104
108
  }, {
105
109
  label: "Non-billable",
106
- hours: U
110
+ hours: W
107
111
  }],
108
112
  xKey: "label",
109
113
  series: [{
@@ -118,49 +122,49 @@ function T() {
118
122
  ariaLabel: "Billable versus non-billable hours"
119
123
  })
120
124
  }] : [],
121
- ...z ? [{
125
+ ...B ? [{
122
126
  id: "work-pattern",
123
127
  name: "Work Pattern Analysis",
124
128
  typeLabel: "Patterns",
125
129
  typeVariant: "default",
126
- period: `${n(z.averageFocusHours)} avg focus · ${Math.round(z.averageProductivity)}% productivity`,
127
- icon: /* @__PURE__ */ x(g, { className: "h-5 w-5" }),
130
+ period: `${n(B.averageFocusHours)} avg focus · ${Math.round(B.averageProductivity)}% productivity`,
131
+ icon: /* @__PURE__ */ S(_, { className: "h-5 w-5" }),
128
132
  accent: "bg-action-primary-bg/10 text-primary",
129
- visual: /* @__PURE__ */ S("div", {
133
+ visual: /* @__PURE__ */ C("div", {
130
134
  className: "space-y-2",
131
- children: [/* @__PURE__ */ x(p, {
132
- value: z.averageProductivity,
135
+ children: [/* @__PURE__ */ S(p, {
136
+ value: B.averageProductivity,
133
137
  max: 100,
134
138
  higherIsWorse: !1,
135
139
  label: "Productivity",
136
140
  format: (e) => `${Math.round(e)}%`,
137
141
  size: "md"
138
- }), (z.mostProductiveDay || z.leastProductiveDay) && /* @__PURE__ */ S("div", {
142
+ }), (B.mostProductiveDay || B.leastProductiveDay) && /* @__PURE__ */ C("div", {
139
143
  className: "flex flex-wrap items-center gap-2",
140
- children: [z.mostProductiveDay && /* @__PURE__ */ x(u, {
144
+ children: [B.mostProductiveDay && /* @__PURE__ */ S(u, {
141
145
  variant: "success",
142
- label: `Peak: ${z.mostProductiveDay}`
143
- }), z.leastProductiveDay && /* @__PURE__ */ x(u, {
146
+ label: `Peak: ${B.mostProductiveDay}`
147
+ }), B.leastProductiveDay && /* @__PURE__ */ S(u, {
144
148
  variant: "muted",
145
- label: `Quietest: ${z.leastProductiveDay}`
149
+ label: `Quietest: ${B.leastProductiveDay}`
146
150
  })]
147
151
  })]
148
152
  })
149
153
  }] : [],
150
- ...B ? [{
154
+ ...V ? [{
151
155
  id: "focus-score",
152
156
  name: "Focus Score Report",
153
157
  typeLabel: "Productivity",
154
158
  typeVariant: "warning",
155
- period: `Avg ${Math.round(B.averageScore)} · High ${Math.round(B.highestScore)} · Low ${Math.round(B.lowestScore)}`,
156
- icon: /* @__PURE__ */ x(h, { className: "h-5 w-5" }),
159
+ period: `Avg ${Math.round(V.averageScore)} · High ${Math.round(V.highestScore)} · Low ${Math.round(V.lowestScore)}`,
160
+ icon: /* @__PURE__ */ S(g, { className: "h-5 w-5" }),
157
161
  accent: "bg-status-warning-bg text-status-warning-text",
158
- visual: /* @__PURE__ */ S("div", {
162
+ visual: /* @__PURE__ */ C("div", {
159
163
  className: "flex items-center gap-4",
160
- children: [/* @__PURE__ */ x("div", {
164
+ children: [/* @__PURE__ */ S("div", {
161
165
  className: "shrink-0",
162
- children: /* @__PURE__ */ x(f, {
163
- value: B.averageScore,
166
+ children: /* @__PURE__ */ S(f, {
167
+ value: V.averageScore,
164
168
  min: 0,
165
169
  max: 100,
166
170
  label: "Avg",
@@ -171,37 +175,37 @@ function T() {
171
175
  height: 128,
172
176
  className: "w-32"
173
177
  })
174
- }), /* @__PURE__ */ S("div", {
178
+ }), /* @__PURE__ */ C("div", {
175
179
  className: "min-w-0 flex-1 space-y-1.5 text-xs",
176
180
  children: [
177
- /* @__PURE__ */ S("div", {
181
+ /* @__PURE__ */ C("div", {
178
182
  className: "flex items-center justify-between",
179
- children: [/* @__PURE__ */ x("span", {
183
+ children: [/* @__PURE__ */ S("span", {
180
184
  className: "text-text-secondary",
181
185
  children: "Highest"
182
- }), /* @__PURE__ */ x("span", {
186
+ }), /* @__PURE__ */ S("span", {
183
187
  className: "font-semibold tabular-nums text-text-primary",
184
- children: Math.round(B.highestScore)
188
+ children: Math.round(V.highestScore)
185
189
  })]
186
190
  }),
187
- /* @__PURE__ */ S("div", {
191
+ /* @__PURE__ */ C("div", {
188
192
  className: "flex items-center justify-between",
189
- children: [/* @__PURE__ */ x("span", {
193
+ children: [/* @__PURE__ */ S("span", {
190
194
  className: "text-text-secondary",
191
195
  children: "Lowest"
192
- }), /* @__PURE__ */ x("span", {
196
+ }), /* @__PURE__ */ S("span", {
193
197
  className: "font-semibold tabular-nums text-text-primary",
194
- children: Math.round(B.lowestScore)
198
+ children: Math.round(V.lowestScore)
195
199
  })]
196
200
  }),
197
- B.trend && /* @__PURE__ */ S("div", {
201
+ V.trend && /* @__PURE__ */ C("div", {
198
202
  className: "flex items-center justify-between",
199
- children: [/* @__PURE__ */ x("span", {
203
+ children: [/* @__PURE__ */ S("span", {
200
204
  className: "text-text-secondary",
201
205
  children: "Trend"
202
- }), /* @__PURE__ */ x("span", {
206
+ }), /* @__PURE__ */ S("span", {
203
207
  className: "font-medium capitalize text-text-primary",
204
- children: B.trend
208
+ children: V.trend
205
209
  })]
206
210
  })
207
211
  ]
@@ -209,71 +213,81 @@ function T() {
209
213
  })
210
214
  }] : []
211
215
  ];
212
- return /* @__PURE__ */ x(l, {
216
+ return /* @__PURE__ */ C(l, {
213
217
  title: "Reports",
214
218
  description: "Generate and view time tracking reports",
215
- purpose: "Package your tracked time into shareable, exportable reports — the deliverables you hand to clients for billing or to leadership for capacity and utilisation decisions. Reports build automatically from your data; refresh to pull the latest, and download any report as CSV.",
216
- actions: /* @__PURE__ */ S("button", {
217
- onClick: V,
218
- disabled: E,
219
+ purpose: "Package your tracked time into shareable, exportable reports — the deliverables you hand to clients for billing or to leadership for capacity and utilisation decisions. Generate a full report from your complete records on the server, or grab a quick summary CSV of the figures below.",
220
+ actions: /* @__PURE__ */ C("button", {
221
+ onClick: H,
222
+ disabled: D,
219
223
  className: "inline-flex items-center gap-1.5 rounded-md bg-action-primary-bg px-3 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90 disabled:opacity-70",
220
- children: [/* @__PURE__ */ x(b, { className: `h-4 w-4 ${E ? "motion-safe:animate-spin" : ""}` }), E ? "Refreshing..." : "Refresh"]
224
+ children: [/* @__PURE__ */ S(x, { className: `h-4 w-4 ${D ? "motion-safe:animate-spin" : ""}` }), D ? "Refreshing..." : "Refresh"]
221
225
  }),
222
- children: G.length === 0 ? /* @__PURE__ */ x(i, {
223
- illustration: "empty-data",
224
- title: "No report data available yet",
225
- description: "Track some time first — once you have entries, focus scores or work patterns, ready-to-export reports appear here."
226
- }) : /* @__PURE__ */ x("div", {
227
- className: "grid grid-cols-1 gap-4 xl:grid-cols-2",
228
- children: G.map((e) => /* @__PURE__ */ S(C, {
229
- treatment: "glass",
230
- className: "flex flex-col p-4 sm:p-5",
231
- children: [/* @__PURE__ */ S("div", {
232
- className: "flex items-start justify-between gap-3",
233
- children: [/* @__PURE__ */ S("div", {
234
- className: "flex min-w-0 items-start gap-3",
235
- children: [/* @__PURE__ */ x("div", {
236
- className: t("flex h-10 w-10 shrink-0 items-center justify-center rounded-lg", e.accent),
237
- children: e.icon
238
- }), /* @__PURE__ */ S("div", {
239
- className: "min-w-0",
226
+ children: [
227
+ /* @__PURE__ */ S("div", {
228
+ className: "mb-6",
229
+ children: /* @__PURE__ */ S(m, {})
230
+ }),
231
+ /* @__PURE__ */ S("h2", {
232
+ className: "mb-3 text-sm font-semibold text-text-primary",
233
+ children: "Summary snapshots"
234
+ }),
235
+ K.length === 0 ? /* @__PURE__ */ S(i, {
236
+ illustration: "empty-data",
237
+ title: "No report data available yet",
238
+ description: "Track some time first — once you have entries, focus scores or work patterns, ready-to-export reports appear here."
239
+ }) : /* @__PURE__ */ S("div", {
240
+ className: "grid grid-cols-1 gap-4 xl:grid-cols-2",
241
+ children: K.map((e) => /* @__PURE__ */ C(w, {
242
+ treatment: "glass",
243
+ className: "flex flex-col p-4 sm:p-5",
244
+ children: [/* @__PURE__ */ C("div", {
245
+ className: "flex items-start justify-between gap-3",
246
+ children: [/* @__PURE__ */ C("div", {
247
+ className: "flex min-w-0 items-start gap-3",
240
248
  children: [/* @__PURE__ */ S("div", {
241
- className: "flex flex-wrap items-center gap-2",
242
- children: [/* @__PURE__ */ x("p", {
243
- className: "text-sm font-semibold text-text-primary",
244
- children: e.name
245
- }), /* @__PURE__ */ x(u, {
246
- variant: e.typeVariant,
247
- label: e.typeLabel
249
+ className: t("flex h-10 w-10 shrink-0 items-center justify-center rounded-lg", e.accent),
250
+ children: e.icon
251
+ }), /* @__PURE__ */ C("div", {
252
+ className: "min-w-0",
253
+ children: [/* @__PURE__ */ C("div", {
254
+ className: "flex flex-wrap items-center gap-2",
255
+ children: [/* @__PURE__ */ S("p", {
256
+ className: "text-sm font-semibold text-text-primary",
257
+ children: e.name
258
+ }), /* @__PURE__ */ S(u, {
259
+ variant: e.typeVariant,
260
+ label: e.typeLabel
261
+ })]
262
+ }), /* @__PURE__ */ S("p", {
263
+ className: "mt-1 text-xs text-text-secondary",
264
+ children: e.period
248
265
  })]
249
- }), /* @__PURE__ */ x("p", {
250
- className: "mt-1 text-xs text-text-secondary",
251
- children: e.period
266
+ })]
267
+ }), /* @__PURE__ */ C("div", {
268
+ className: "flex shrink-0 items-center gap-2",
269
+ children: [/* @__PURE__ */ S(u, {
270
+ variant: "success",
271
+ label: "Ready",
272
+ dot: !0
273
+ }), /* @__PURE__ */ C("button", {
274
+ onClick: () => U(e.id),
275
+ title: "Download summary as CSV",
276
+ "aria-label": `Download ${e.name} summary as CSV`,
277
+ className: "inline-flex items-center gap-1 rounded-md border border-border-seam bg-bg-surface px-2 py-1.5 text-xs font-medium text-text-secondary hover:bg-bg-sunken",
278
+ children: [/* @__PURE__ */ S(b, { className: "h-4 w-4" }), "CSV"]
252
279
  })]
253
280
  })]
254
281
  }), /* @__PURE__ */ S("div", {
255
- className: "flex shrink-0 items-center gap-2",
256
- children: [/* @__PURE__ */ x(u, {
257
- variant: "success",
258
- label: "Ready",
259
- dot: !0
260
- }), /* @__PURE__ */ S("button", {
261
- onClick: () => H(e.id),
262
- title: "Download as CSV",
263
- "aria-label": `Download ${e.name} as CSV`,
264
- className: "inline-flex items-center gap-1 rounded-md border border-border-seam bg-bg-surface px-2 py-1.5 text-xs font-medium text-text-secondary hover:bg-bg-sunken",
265
- children: [/* @__PURE__ */ x(y, { className: "h-4 w-4" }), "CSV"]
266
- })]
282
+ className: "mt-4 border-t border-border-subtle pt-4",
283
+ children: e.visual
267
284
  })]
268
- }), /* @__PURE__ */ x("div", {
269
- className: "mt-4 border-t border-border-subtle pt-4",
270
- children: e.visual
271
- })]
272
- }, e.id))
273
- })
285
+ }, e.id))
286
+ })
287
+ ]
274
288
  });
275
289
  }
276
290
  //#endregion
277
- export { T as ReportsPage };
291
+ export { E as ReportsPage };
278
292
 
279
293
  //# sourceMappingURL=ReportsPage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ReportsPage.js","names":[],"sources":["../../../../src/timecampus/pages/dashboard/ReportsPage.tsx"],"sourcesContent":["import { useState, type ReactNode } from \"react\";\nimport {\n RefreshCw,\n Download,\n Clock,\n DollarSign,\n CalendarRange,\n Brain,\n} from \"lucide-react\";\nimport { GlassCard } from \"@burdenoff/fe-libs/ui\";\nimport { PageLayout } from \"../../components/PageLayout\";\nimport { EmptyState } from \"../../components/EmptyState\";\nimport { LoadingSkeleton } from \"../../components/LoadingSkeleton\";\nimport {\n StatusBadge,\n ProgressMeter,\n RadialGauge,\n BarsChart,\n} from \"../../components\";\nimport { cn, formatHours } from \"../../utils/helpers\";\n\n/** Trigger a client-side CSV download from an array of [key, value] rows. */\nfunction downloadCsv(filename: string, rows: Array<[string, string | number]>) {\n const escape = (v: string | number) => `\"${String(v).replace(/\"/g, '\"\"')}\"`;\n const csv = [\n \"Metric,Value\",\n ...rows.map(([k, v]) => `${escape(k)},${escape(v)}`),\n ].join(\"\\n\");\n const blob = new Blob([csv], { type: \"text/csv;charset=utf-8;\" });\n const url = URL.createObjectURL(blob);\n const link = document.createElement(\"a\");\n link.href = url;\n link.download = filename;\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n URL.revokeObjectURL(url);\n}\nimport { useTimeCampus } from \"../../providers/TimeCampusProvider\";\nimport {\n useGetTimeEntryStatsQuery,\n useGetWorkPatternSummaryQuery,\n useGetFocusScoreSummaryQuery,\n} from \"@/generated/wspace-operations\";\nimport { usePageViewed } from \"../../analytics\";\n\ntype ReportTypeVariant = \"info\" | \"success\" | \"warning\" | \"default\";\n\ninterface ReportCard {\n id: string;\n name: string;\n typeLabel: string;\n typeVariant: ReportTypeVariant;\n period: string;\n icon: ReactNode;\n accent: string;\n visual: ReactNode;\n}\n\nexport function ReportsPage() {\n usePageViewed(\"reports\");\n const { workspaceId = \"\" } = useTimeCampus();\n const [refreshing, setRefreshing] = useState(false);\n\n const {\n data: statsData,\n loading: statsLoading,\n error: statsError,\n refetch: refetchStats,\n } = useGetTimeEntryStatsQuery({\n skip: !workspaceId,\n });\n\n const {\n data: patternData,\n loading: patternLoading,\n refetch: refetchPattern,\n } = useGetWorkPatternSummaryQuery({\n skip: !workspaceId,\n });\n\n const {\n data: focusData,\n loading: focusLoading,\n refetch: refetchFocus,\n } = useGetFocusScoreSummaryQuery({\n skip: !workspaceId,\n });\n\n const stats = statsData?.timeEntryStats;\n const pattern = patternData?.workPatternSummary;\n const focus = focusData?.focusScoreSummary;\n\n const handleRefresh = async () => {\n setRefreshing(true);\n try {\n await Promise.all([refetchStats(), refetchPattern(), refetchFocus()]);\n } finally {\n setRefreshing(false);\n }\n };\n\n const handleDownload = (reportId: string) => {\n if (\n (reportId === \"time-summary\" || reportId === \"billable-summary\") &&\n stats\n ) {\n downloadCsv(`${reportId}.csv`, [\n [\"Total hours\", Math.round(stats.totalHours)],\n [\"Billable hours\", Math.round(stats.billableHours)],\n [\"Total entries\", stats.totalEntries],\n [\"Active timers\", stats.activeTimers],\n ]);\n } else if (reportId === \"work-pattern\" && pattern) {\n downloadCsv(\"work-pattern-analysis.csv\", [\n [\"Average focus hours\", pattern.averageFocusHours.toFixed(1)],\n [\"Average productivity %\", Math.round(pattern.averageProductivity)],\n ]);\n } else if (reportId === \"focus-score\" && focus) {\n downloadCsv(\"focus-score-report.csv\", [\n [\"Average score\", Math.round(focus.averageScore)],\n [\"Highest score\", Math.round(focus.highestScore)],\n [\"Lowest score\", Math.round(focus.lowestScore)],\n ]);\n }\n };\n\n const isLoading = statsLoading || patternLoading || focusLoading;\n\n if (isLoading) {\n return (\n <PageLayout\n title=\"Reports\"\n description=\"Generate and view time tracking reports\"\n actions={\n <button\n disabled\n className=\"inline-flex items-center gap-1.5 rounded-md bg-action-primary-bg px-3 py-2 text-sm font-medium text-action-primary-text opacity-70\"\n >\n <RefreshCw className=\"h-4 w-4\" />\n Refresh\n </button>\n }\n >\n <LoadingSkeleton variant=\"list\" count={4} />\n </PageLayout>\n );\n }\n\n if (statsError) {\n return (\n <PageLayout\n title=\"Reports\"\n description=\"Generate and view time tracking reports\"\n >\n <div className=\"rounded-lg border border-status-error-bg/40 bg-status-error-bg p-4 text-sm text-status-error-text\">\n Failed to load reports data. Please try again later.\n </div>\n </PageLayout>\n );\n }\n\n // Derived, real figures shared by the report visuals.\n const nonBillableHours = stats\n ? Math.max(0, stats.totalHours - stats.billableHours)\n : 0;\n const billablePct =\n stats && stats.totalHours > 0\n ? Math.round((stats.billableHours / stats.totalHours) * 100)\n : 0;\n\n // Build dynamic report cards from available analytics data. Each carries a\n // small, real visual fed only by the aggregate the page already fetched.\n const reports: ReportCard[] = [\n ...(stats\n ? [\n {\n id: \"time-summary\",\n name: \"Time Tracking Summary\",\n typeLabel: \"Time\",\n typeVariant: \"info\" as const,\n period: `${formatHours(stats.totalHours)} total · ${stats.totalEntries} entries`,\n icon: <Clock className=\"h-5 w-5\" />,\n accent: \"bg-status-info-bg text-status-info-text\",\n visual: (\n <div className=\"space-y-2\">\n <ProgressMeter\n value={stats.billableHours}\n max={stats.totalHours > 0 ? stats.totalHours : 1}\n higherIsWorse={false}\n label=\"Billable share\"\n format={formatHours}\n size=\"md\"\n />\n <div className=\"flex items-center justify-between text-xs text-text-secondary\">\n <span>{stats.totalEntries} entries logged</span>\n <span>\n {stats.activeTimers > 0\n ? `${stats.activeTimers} timer(s) running`\n : \"No active timers\"}\n </span>\n </div>\n </div>\n ),\n },\n {\n id: \"billable-summary\",\n name: \"Billable Hours Report\",\n typeLabel: \"Billing\",\n typeVariant: \"success\" as const,\n period: `${formatHours(stats.billableHours)} billable · ${billablePct}% of tracked`,\n icon: <DollarSign className=\"h-5 w-5\" />,\n accent: \"bg-status-success-bg text-status-success-text\",\n visual: (\n <BarsChart\n data={[\n { label: \"Billable\", hours: stats.billableHours },\n { label: \"Non-billable\", hours: nonBillableHours },\n ]}\n xKey=\"label\"\n series={[{ key: \"hours\", label: \"Hours\" }]}\n orientation=\"horizontal\"\n valueFormat={formatHours}\n categoryWidth={92}\n height={120}\n showGrid={false}\n ariaLabel=\"Billable versus non-billable hours\"\n />\n ),\n },\n ]\n : []),\n ...(pattern\n ? [\n {\n id: \"work-pattern\",\n name: \"Work Pattern Analysis\",\n typeLabel: \"Patterns\",\n typeVariant: \"default\" as const,\n period: `${formatHours(pattern.averageFocusHours)} avg focus · ${Math.round(pattern.averageProductivity)}% productivity`,\n icon: <CalendarRange className=\"h-5 w-5\" />,\n accent: \"bg-action-primary-bg/10 text-primary\",\n visual: (\n <div className=\"space-y-2\">\n <ProgressMeter\n value={pattern.averageProductivity}\n max={100}\n higherIsWorse={false}\n label=\"Productivity\"\n format={(v) => `${Math.round(v)}%`}\n size=\"md\"\n />\n {(pattern.mostProductiveDay || pattern.leastProductiveDay) && (\n <div className=\"flex flex-wrap items-center gap-2\">\n {pattern.mostProductiveDay && (\n <StatusBadge\n variant=\"success\"\n label={`Peak: ${pattern.mostProductiveDay}`}\n />\n )}\n {pattern.leastProductiveDay && (\n <StatusBadge\n variant=\"muted\"\n label={`Quietest: ${pattern.leastProductiveDay}`}\n />\n )}\n </div>\n )}\n </div>\n ),\n },\n ]\n : []),\n ...(focus\n ? [\n {\n id: \"focus-score\",\n name: \"Focus Score Report\",\n typeLabel: \"Productivity\",\n typeVariant: \"warning\" as const,\n period: `Avg ${Math.round(focus.averageScore)} · High ${Math.round(focus.highestScore)} · Low ${Math.round(focus.lowestScore)}`,\n icon: <Brain className=\"h-5 w-5\" />,\n accent: \"bg-status-warning-bg text-status-warning-text\",\n visual: (\n <div className=\"flex items-center gap-4\">\n <div className=\"shrink-0\">\n <RadialGauge\n value={focus.averageScore}\n min={0}\n max={100}\n label=\"Avg\"\n thresholds={{ warning: 75, danger: 50 }}\n height={128}\n className=\"w-32\"\n />\n </div>\n <div className=\"min-w-0 flex-1 space-y-1.5 text-xs\">\n <div className=\"flex items-center justify-between\">\n <span className=\"text-text-secondary\">Highest</span>\n <span className=\"font-semibold tabular-nums text-text-primary\">\n {Math.round(focus.highestScore)}\n </span>\n </div>\n <div className=\"flex items-center justify-between\">\n <span className=\"text-text-secondary\">Lowest</span>\n <span className=\"font-semibold tabular-nums text-text-primary\">\n {Math.round(focus.lowestScore)}\n </span>\n </div>\n {focus.trend && (\n <div className=\"flex items-center justify-between\">\n <span className=\"text-text-secondary\">Trend</span>\n <span className=\"font-medium capitalize text-text-primary\">\n {focus.trend}\n </span>\n </div>\n )}\n </div>\n </div>\n ),\n },\n ]\n : []),\n ];\n\n return (\n <PageLayout\n title=\"Reports\"\n description=\"Generate and view time tracking reports\"\n purpose=\"Package your tracked time into shareable, exportable reports — the deliverables you hand to clients for billing or to leadership for capacity and utilisation decisions. Reports build automatically from your data; refresh to pull the latest, and download any report as CSV.\"\n actions={\n <button\n onClick={handleRefresh}\n disabled={refreshing}\n className=\"inline-flex items-center gap-1.5 rounded-md bg-action-primary-bg px-3 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90 disabled:opacity-70\"\n >\n <RefreshCw\n className={`h-4 w-4 ${refreshing ? \"motion-safe:animate-spin\" : \"\"}`}\n />\n {refreshing ? \"Refreshing...\" : \"Refresh\"}\n </button>\n }\n >\n {reports.length === 0 ? (\n <EmptyState\n illustration=\"empty-data\"\n title=\"No report data available yet\"\n description=\"Track some time first — once you have entries, focus scores or work patterns, ready-to-export reports appear here.\"\n />\n ) : (\n <div className=\"grid grid-cols-1 gap-4 xl:grid-cols-2\">\n {reports.map((report) => (\n <GlassCard\n key={report.id}\n treatment=\"glass\"\n className=\"flex flex-col p-4 sm:p-5\"\n >\n <div className=\"flex items-start justify-between gap-3\">\n <div className=\"flex min-w-0 items-start gap-3\">\n <div\n className={cn(\n \"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg\",\n report.accent,\n )}\n >\n {report.icon}\n </div>\n <div className=\"min-w-0\">\n <div className=\"flex flex-wrap items-center gap-2\">\n <p className=\"text-sm font-semibold text-text-primary\">\n {report.name}\n </p>\n <StatusBadge\n variant={report.typeVariant}\n label={report.typeLabel}\n />\n </div>\n <p className=\"mt-1 text-xs text-text-secondary\">\n {report.period}\n </p>\n </div>\n </div>\n <div className=\"flex shrink-0 items-center gap-2\">\n <StatusBadge variant=\"success\" label=\"Ready\" dot />\n <button\n onClick={() => handleDownload(report.id)}\n title=\"Download as CSV\"\n aria-label={`Download ${report.name} as CSV`}\n className=\"inline-flex items-center gap-1 rounded-md border border-border-seam bg-bg-surface px-2 py-1.5 text-xs font-medium text-text-secondary hover:bg-bg-sunken\"\n >\n <Download className=\"h-4 w-4\" />\n CSV\n </button>\n </div>\n </div>\n <div className=\"mt-4 border-t border-border-subtle pt-4\">\n {report.visual}\n </div>\n </GlassCard>\n ))}\n </div>\n )}\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAsBA,SAAS,EAAY,GAAkB,GAAwC;CAC7E,IAAM,KAAU,MAAuB,IAAI,OAAO,CAAC,CAAC,CAAC,QAAQ,MAAM,MAAI,EAAE,IACnE,IAAM,CACV,gBACA,GAAG,EAAK,KAAK,CAAC,GAAG,OAAO,GAAG,EAAO,CAAC,EAAE,GAAG,EAAO,CAAC,GAAG,CACrD,CAAC,CAAC,KAAK,IAAI,GACL,IAAO,IAAI,KAAK,CAAC,CAAG,GAAG,EAAE,MAAM,0BAA0B,CAAC,GAC1D,IAAM,IAAI,gBAAgB,CAAI,GAC9B,IAAO,SAAS,cAAc,GAAG;CAMvC,AALA,EAAK,OAAO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js","names":[],"sources":["../../../../src/timecampus/pages/dashboard/ReportsPage.tsx"],"sourcesContent":["import { useState, type ReactNode } from \"react\";\nimport {\n RefreshCw,\n Download,\n Clock,\n DollarSign,\n CalendarRange,\n Brain,\n} from \"lucide-react\";\nimport { GlassCard } from \"@burdenoff/fe-libs/ui\";\nimport { PageLayout } from \"../../components/PageLayout\";\nimport { EmptyState } from \"../../components/EmptyState\";\nimport { LoadingSkeleton } from \"../../components/LoadingSkeleton\";\nimport {\n StatusBadge,\n ProgressMeter,\n RadialGauge,\n BarsChart,\n} from \"../../components\";\nimport { cn, formatHours } from \"../../utils/helpers\";\nimport { ServerReportExports } from \"./ServerReportExports\";\n\n/** Trigger a client-side CSV download from an array of [key, value] rows. */\nfunction downloadCsv(filename: string, rows: Array<[string, string | number]>) {\n const escape = (v: string | number) => `\"${String(v).replace(/\"/g, '\"\"')}\"`;\n const csv = [\n \"Metric,Value\",\n ...rows.map(([k, v]) => `${escape(k)},${escape(v)}`),\n ].join(\"\\n\");\n const blob = new Blob([csv], { type: \"text/csv;charset=utf-8;\" });\n const url = URL.createObjectURL(blob);\n const link = document.createElement(\"a\");\n link.href = url;\n link.download = filename;\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n URL.revokeObjectURL(url);\n}\nimport { useTimeCampus } from \"../../providers/TimeCampusProvider\";\nimport {\n useGetTimeEntryStatsQuery,\n useGetWorkPatternSummaryQuery,\n useGetFocusScoreSummaryQuery,\n} from \"@/generated/wspace-operations\";\nimport { usePageViewed } from \"../../analytics\";\n\ntype ReportTypeVariant = \"info\" | \"success\" | \"warning\" | \"default\";\n\ninterface ReportCard {\n id: string;\n name: string;\n typeLabel: string;\n typeVariant: ReportTypeVariant;\n period: string;\n icon: ReactNode;\n accent: string;\n visual: ReactNode;\n}\n\nexport function ReportsPage() {\n usePageViewed(\"reports\");\n const { workspaceId = \"\" } = useTimeCampus();\n const [refreshing, setRefreshing] = useState(false);\n\n const {\n data: statsData,\n loading: statsLoading,\n error: statsError,\n refetch: refetchStats,\n } = useGetTimeEntryStatsQuery({\n skip: !workspaceId,\n });\n\n const {\n data: patternData,\n loading: patternLoading,\n refetch: refetchPattern,\n } = useGetWorkPatternSummaryQuery({\n skip: !workspaceId,\n });\n\n const {\n data: focusData,\n loading: focusLoading,\n refetch: refetchFocus,\n } = useGetFocusScoreSummaryQuery({\n skip: !workspaceId,\n });\n\n const stats = statsData?.timeEntryStats;\n const pattern = patternData?.workPatternSummary;\n const focus = focusData?.focusScoreSummary;\n\n const handleRefresh = async () => {\n setRefreshing(true);\n try {\n await Promise.all([refetchStats(), refetchPattern(), refetchFocus()]);\n } finally {\n setRefreshing(false);\n }\n };\n\n const handleDownload = (reportId: string) => {\n if (\n (reportId === \"time-summary\" || reportId === \"billable-summary\") &&\n stats\n ) {\n downloadCsv(`${reportId}.csv`, [\n [\"Total hours\", Math.round(stats.totalHours)],\n [\"Billable hours\", Math.round(stats.billableHours)],\n [\"Total entries\", stats.totalEntries],\n [\"Active timers\", stats.activeTimers],\n ]);\n } else if (reportId === \"work-pattern\" && pattern) {\n downloadCsv(\"work-pattern-analysis.csv\", [\n [\"Average focus hours\", pattern.averageFocusHours.toFixed(1)],\n [\"Average productivity %\", Math.round(pattern.averageProductivity)],\n ]);\n } else if (reportId === \"focus-score\" && focus) {\n downloadCsv(\"focus-score-report.csv\", [\n [\"Average score\", Math.round(focus.averageScore)],\n [\"Highest score\", Math.round(focus.highestScore)],\n [\"Lowest score\", Math.round(focus.lowestScore)],\n ]);\n }\n };\n\n // Gate the skeleton on the first load only. A Refresh refetch must not\n // swap the page for a skeleton, or the report builder below would unmount\n // and lose the exports generated this session.\n const isLoading =\n (statsLoading && !statsData) ||\n (patternLoading && !patternData) ||\n (focusLoading && !focusData);\n\n if (isLoading) {\n return (\n <PageLayout\n title=\"Reports\"\n description=\"Generate and view time tracking reports\"\n actions={\n <button\n disabled\n className=\"inline-flex items-center gap-1.5 rounded-md bg-action-primary-bg px-3 py-2 text-sm font-medium text-action-primary-text opacity-70\"\n >\n <RefreshCw className=\"h-4 w-4\" />\n Refresh\n </button>\n }\n >\n <LoadingSkeleton variant=\"list\" count={4} />\n </PageLayout>\n );\n }\n\n if (statsError) {\n return (\n <PageLayout\n title=\"Reports\"\n description=\"Generate and view time tracking reports\"\n >\n <div className=\"mb-6\">\n <ServerReportExports />\n </div>\n <div className=\"rounded-lg border border-status-error-bg/40 bg-status-error-bg p-4 text-sm text-status-error-text\">\n Failed to load the summary figures. Please try again later.\n </div>\n </PageLayout>\n );\n }\n\n // Derived, real figures shared by the report visuals.\n const nonBillableHours = stats\n ? Math.max(0, stats.totalHours - stats.billableHours)\n : 0;\n const billablePct =\n stats && stats.totalHours > 0\n ? Math.round((stats.billableHours / stats.totalHours) * 100)\n : 0;\n\n // Build dynamic report cards from available analytics data. Each carries a\n // small, real visual fed only by the aggregate the page already fetched.\n const reports: ReportCard[] = [\n ...(stats\n ? [\n {\n id: \"time-summary\",\n name: \"Time Tracking Summary\",\n typeLabel: \"Time\",\n typeVariant: \"info\" as const,\n period: `${formatHours(stats.totalHours)} total · ${stats.totalEntries} entries`,\n icon: <Clock className=\"h-5 w-5\" />,\n accent: \"bg-status-info-bg text-status-info-text\",\n visual: (\n <div className=\"space-y-2\">\n <ProgressMeter\n value={stats.billableHours}\n max={stats.totalHours > 0 ? stats.totalHours : 1}\n higherIsWorse={false}\n label=\"Billable share\"\n format={formatHours}\n size=\"md\"\n />\n <div className=\"flex items-center justify-between text-xs text-text-secondary\">\n <span>{stats.totalEntries} entries logged</span>\n <span>\n {stats.activeTimers > 0\n ? `${stats.activeTimers} timer(s) running`\n : \"No active timers\"}\n </span>\n </div>\n </div>\n ),\n },\n {\n id: \"billable-summary\",\n name: \"Billable Hours Report\",\n typeLabel: \"Billing\",\n typeVariant: \"success\" as const,\n period: `${formatHours(stats.billableHours)} billable · ${billablePct}% of tracked`,\n icon: <DollarSign className=\"h-5 w-5\" />,\n accent: \"bg-status-success-bg text-status-success-text\",\n visual: (\n <BarsChart\n data={[\n { label: \"Billable\", hours: stats.billableHours },\n { label: \"Non-billable\", hours: nonBillableHours },\n ]}\n xKey=\"label\"\n series={[{ key: \"hours\", label: \"Hours\" }]}\n orientation=\"horizontal\"\n valueFormat={formatHours}\n categoryWidth={92}\n height={120}\n showGrid={false}\n ariaLabel=\"Billable versus non-billable hours\"\n />\n ),\n },\n ]\n : []),\n ...(pattern\n ? [\n {\n id: \"work-pattern\",\n name: \"Work Pattern Analysis\",\n typeLabel: \"Patterns\",\n typeVariant: \"default\" as const,\n period: `${formatHours(pattern.averageFocusHours)} avg focus · ${Math.round(pattern.averageProductivity)}% productivity`,\n icon: <CalendarRange className=\"h-5 w-5\" />,\n accent: \"bg-action-primary-bg/10 text-primary\",\n visual: (\n <div className=\"space-y-2\">\n <ProgressMeter\n value={pattern.averageProductivity}\n max={100}\n higherIsWorse={false}\n label=\"Productivity\"\n format={(v) => `${Math.round(v)}%`}\n size=\"md\"\n />\n {(pattern.mostProductiveDay || pattern.leastProductiveDay) && (\n <div className=\"flex flex-wrap items-center gap-2\">\n {pattern.mostProductiveDay && (\n <StatusBadge\n variant=\"success\"\n label={`Peak: ${pattern.mostProductiveDay}`}\n />\n )}\n {pattern.leastProductiveDay && (\n <StatusBadge\n variant=\"muted\"\n label={`Quietest: ${pattern.leastProductiveDay}`}\n />\n )}\n </div>\n )}\n </div>\n ),\n },\n ]\n : []),\n ...(focus\n ? [\n {\n id: \"focus-score\",\n name: \"Focus Score Report\",\n typeLabel: \"Productivity\",\n typeVariant: \"warning\" as const,\n period: `Avg ${Math.round(focus.averageScore)} · High ${Math.round(focus.highestScore)} · Low ${Math.round(focus.lowestScore)}`,\n icon: <Brain className=\"h-5 w-5\" />,\n accent: \"bg-status-warning-bg text-status-warning-text\",\n visual: (\n <div className=\"flex items-center gap-4\">\n <div className=\"shrink-0\">\n <RadialGauge\n value={focus.averageScore}\n min={0}\n max={100}\n label=\"Avg\"\n thresholds={{ warning: 75, danger: 50 }}\n height={128}\n className=\"w-32\"\n />\n </div>\n <div className=\"min-w-0 flex-1 space-y-1.5 text-xs\">\n <div className=\"flex items-center justify-between\">\n <span className=\"text-text-secondary\">Highest</span>\n <span className=\"font-semibold tabular-nums text-text-primary\">\n {Math.round(focus.highestScore)}\n </span>\n </div>\n <div className=\"flex items-center justify-between\">\n <span className=\"text-text-secondary\">Lowest</span>\n <span className=\"font-semibold tabular-nums text-text-primary\">\n {Math.round(focus.lowestScore)}\n </span>\n </div>\n {focus.trend && (\n <div className=\"flex items-center justify-between\">\n <span className=\"text-text-secondary\">Trend</span>\n <span className=\"font-medium capitalize text-text-primary\">\n {focus.trend}\n </span>\n </div>\n )}\n </div>\n </div>\n ),\n },\n ]\n : []),\n ];\n\n return (\n <PageLayout\n title=\"Reports\"\n description=\"Generate and view time tracking reports\"\n purpose=\"Package your tracked time into shareable, exportable reports — the deliverables you hand to clients for billing or to leadership for capacity and utilisation decisions. Generate a full report from your complete records on the server, or grab a quick summary CSV of the figures below.\"\n actions={\n <button\n onClick={handleRefresh}\n disabled={refreshing}\n className=\"inline-flex items-center gap-1.5 rounded-md bg-action-primary-bg px-3 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90 disabled:opacity-70\"\n >\n <RefreshCw\n className={`h-4 w-4 ${refreshing ? \"motion-safe:animate-spin\" : \"\"}`}\n />\n {refreshing ? \"Refreshing...\" : \"Refresh\"}\n </button>\n }\n >\n <div className=\"mb-6\">\n <ServerReportExports />\n </div>\n <h2 className=\"mb-3 text-sm font-semibold text-text-primary\">\n Summary snapshots\n </h2>\n {reports.length === 0 ? (\n <EmptyState\n illustration=\"empty-data\"\n title=\"No report data available yet\"\n description=\"Track some time first — once you have entries, focus scores or work patterns, ready-to-export reports appear here.\"\n />\n ) : (\n <div className=\"grid grid-cols-1 gap-4 xl:grid-cols-2\">\n {reports.map((report) => (\n <GlassCard\n key={report.id}\n treatment=\"glass\"\n className=\"flex flex-col p-4 sm:p-5\"\n >\n <div className=\"flex items-start justify-between gap-3\">\n <div className=\"flex min-w-0 items-start gap-3\">\n <div\n className={cn(\n \"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg\",\n report.accent,\n )}\n >\n {report.icon}\n </div>\n <div className=\"min-w-0\">\n <div className=\"flex flex-wrap items-center gap-2\">\n <p className=\"text-sm font-semibold text-text-primary\">\n {report.name}\n </p>\n <StatusBadge\n variant={report.typeVariant}\n label={report.typeLabel}\n />\n </div>\n <p className=\"mt-1 text-xs text-text-secondary\">\n {report.period}\n </p>\n </div>\n </div>\n <div className=\"flex shrink-0 items-center gap-2\">\n <StatusBadge variant=\"success\" label=\"Ready\" dot />\n <button\n onClick={() => handleDownload(report.id)}\n title=\"Download summary as CSV\"\n aria-label={`Download ${report.name} summary as CSV`}\n className=\"inline-flex items-center gap-1 rounded-md border border-border-seam bg-bg-surface px-2 py-1.5 text-xs font-medium text-text-secondary hover:bg-bg-sunken\"\n >\n <Download className=\"h-4 w-4\" />\n CSV\n </button>\n </div>\n </div>\n <div className=\"mt-4 border-t border-border-subtle pt-4\">\n {report.visual}\n </div>\n </GlassCard>\n ))}\n </div>\n )}\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAuBA,SAAS,EAAY,GAAkB,GAAwC;CAC7E,IAAM,KAAU,MAAuB,IAAI,OAAO,CAAC,CAAC,CAAC,QAAQ,MAAM,MAAI,EAAE,IACnE,IAAM,CACV,gBACA,GAAG,EAAK,KAAK,CAAC,GAAG,OAAO,GAAG,EAAO,CAAC,EAAE,GAAG,EAAO,CAAC,GAAG,CACrD,CAAC,CAAC,KAAK,IAAI,GACL,IAAO,IAAI,KAAK,CAAC,CAAG,GAAG,EAAE,MAAM,0BAA0B,CAAC,GAC1D,IAAM,IAAI,gBAAgB,CAAI,GAC9B,IAAO,SAAS,cAAc,GAAG;CAMvC,AALA,EAAK,OAAO,GACZ,EAAK,WAAW,GAChB,SAAS,KAAK,YAAY,CAAI,GAC9B,EAAK,MAAM,GACX,SAAS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F,CAAA,CAAA;KACL,CAAA,GAAA,kBAAC,OAAD;MAAK,WAAU;MACZ,UAAA,EAAO;KACL,CAAA,CACI;IA7CJ,GAAA,EAAO,EA6CH,CACZ;GACE,CAAA;EAEG;;AAEhB"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Server-side report builder: pick a template, a period and a format, and
3
+ * wspace-export-svc builds the full dataset asynchronously.
4
+ */
5
+ export declare function ServerReportExports(): import("react").JSX.Element;
6
+ //# sourceMappingURL=ServerReportExports.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ServerReportExports.d.ts","sourceRoot":"","sources":["../../../../src/timecampus/pages/dashboard/ServerReportExports.tsx"],"names":[],"mappings":"AAoLA;;;GAGG;AACH,wBAAgB,mBAAmB,gCA4JlC"}