@burdenoff/microfe-planmagnet 2026.930.11 → 2026.930.13

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 (60) hide show
  1. package/dist/planmagnet/PlanMagnetRoot.d.ts.map +1 -1
  2. package/dist/planmagnet/PlanMagnetRoot.js +20 -11
  3. package/dist/planmagnet/PlanMagnetRoot.js.map +1 -1
  4. package/dist/planmagnet/PlanMagnetRoutes.d.ts.map +1 -1
  5. package/dist/planmagnet/PlanMagnetRoutes.js +227 -223
  6. package/dist/planmagnet/PlanMagnetRoutes.js.map +1 -1
  7. package/dist/planmagnet/admin/PlanMagnetAdminRoot.js +37 -37
  8. package/dist/planmagnet/automation/AutomationRuleFields.js +41 -41
  9. package/dist/planmagnet/board/BulkActions.js +6 -6
  10. package/dist/planmagnet/board/ProjectBoard.js +24 -24
  11. package/dist/planmagnet/budgets/BudgetControls.js +18 -18
  12. package/dist/planmagnet/controls/FeatureControls.js +24 -24
  13. package/dist/planmagnet/controls/ObjectiveControls.js +11 -11
  14. package/dist/planmagnet/controls/ProgramControls.js +9 -9
  15. package/dist/planmagnet/controls/WorkItemControls.js +27 -27
  16. package/dist/planmagnet/dependency/DependencyPanel.js +7 -7
  17. package/dist/planmagnet/pages/AiPlanPagePage.js +6 -6
  18. package/dist/planmagnet/pages/AnalyticsAnalyticsPagePage.d.ts.map +1 -1
  19. package/dist/planmagnet/pages/AnalyticsAnalyticsPagePage.js +370 -221
  20. package/dist/planmagnet/pages/AnalyticsAnalyticsPagePage.js.map +1 -1
  21. package/dist/planmagnet/pages/DashboardDashboardPagePage.d.ts.map +1 -1
  22. package/dist/planmagnet/pages/DashboardDashboardPagePage.js +140 -135
  23. package/dist/planmagnet/pages/DashboardDashboardPagePage.js.map +1 -1
  24. package/dist/planmagnet/pages/ProjectsBudgetDetailPagePage.d.ts.map +1 -1
  25. package/dist/planmagnet/pages/ProjectsBudgetDetailPagePage.js +160 -108
  26. package/dist/planmagnet/pages/ProjectsBudgetDetailPagePage.js.map +1 -1
  27. package/dist/planmagnet/pages/ProjectsBudgetsPagePage.js +10 -10
  28. package/dist/planmagnet/pages/ProjectsEditProjectPagePage.js +5 -5
  29. package/dist/planmagnet/pages/ProjectsQualityGatesPagePage.js +4 -4
  30. package/dist/planmagnet/pages/ProjectsWorkflowPagePage.js +30 -30
  31. package/dist/planmagnet/pages/TasksMyDashboardPagePage.d.ts +2 -0
  32. package/dist/planmagnet/pages/TasksMyDashboardPagePage.d.ts.map +1 -0
  33. package/dist/planmagnet/pages/TasksMyDashboardPagePage.js +329 -0
  34. package/dist/planmagnet/pages/TasksMyDashboardPagePage.js.map +1 -0
  35. package/dist/planmagnet/pages/TasksTaskDetailPagePage.js +26 -26
  36. package/dist/planmagnet/pages/analytics/DeliveryHealthCards.d.ts +14 -2
  37. package/dist/planmagnet/pages/analytics/DeliveryHealthCards.d.ts.map +1 -1
  38. package/dist/planmagnet/pages/analytics/DeliveryHealthCards.js +173 -113
  39. package/dist/planmagnet/pages/analytics/DeliveryHealthCards.js.map +1 -1
  40. package/dist/planmagnet/pages/analytics/DeliveryKpisCard.d.ts +8 -0
  41. package/dist/planmagnet/pages/analytics/DeliveryKpisCard.d.ts.map +1 -0
  42. package/dist/planmagnet/pages/analytics/DeliveryKpisCard.js +211 -0
  43. package/dist/planmagnet/pages/analytics/DeliveryKpisCard.js.map +1 -0
  44. package/dist/planmagnet/pages/analytics/QualityMetricsCard.d.ts +8 -0
  45. package/dist/planmagnet/pages/analytics/QualityMetricsCard.d.ts.map +1 -0
  46. package/dist/planmagnet/pages/analytics/QualityMetricsCard.js +177 -0
  47. package/dist/planmagnet/pages/analytics/QualityMetricsCard.js.map +1 -0
  48. package/dist/planmagnet/pages/analytics/ThroughputCard.d.ts +7 -0
  49. package/dist/planmagnet/pages/analytics/ThroughputCard.d.ts.map +1 -0
  50. package/dist/planmagnet/pages/analytics/ThroughputCard.js +137 -0
  51. package/dist/planmagnet/pages/analytics/ThroughputCard.js.map +1 -0
  52. package/dist/planmagnet/pages/analytics/analyticsRange.d.ts +42 -0
  53. package/dist/planmagnet/pages/analytics/analyticsRange.d.ts.map +1 -0
  54. package/dist/planmagnet/pages/analytics/analyticsRange.js +47 -0
  55. package/dist/planmagnet/pages/analytics/analyticsRange.js.map +1 -0
  56. package/dist/planmagnet/roadmaps/RoadmapNowNextLater.d.ts.map +1 -1
  57. package/dist/planmagnet/roadmaps/RoadmapNowNextLater.js +12 -0
  58. package/dist/planmagnet/roadmaps/RoadmapNowNextLater.js.map +1 -1
  59. package/dist/planmagnet/time/TimeEntryControls.js +12 -12
  60. package/package.json +1 -1
@@ -1,8 +1,8 @@
1
1
  import { usePlanMagnet as e, usePlanMagnetNavigate as t } from "../providers/PlanMagnetProvider.js";
2
2
  import { PersonName as n } from "../people/People.js";
3
3
  import { throwOnError as r } from "../utils/mutationResult.js";
4
- import { DocSearchSelect as i } from "../controls/Pickers.js";
5
- import { WORK_ITEM_PRIORITIES as a, WorkItemAssigneeSelect as o, WorkItemEnumSelect as s, WorkItemHeaderActions as c, WorkItemStatusSelect as l } from "../controls/WorkItemControls.js";
4
+ import { WORK_ITEM_PRIORITIES as i, WorkItemAssigneeSelect as a, WorkItemEnumSelect as o, WorkItemHeaderActions as s, WorkItemStatusSelect as c } from "../controls/WorkItemControls.js";
5
+ import { DocSearchSelect as l } from "../controls/Pickers.js";
6
6
  import { MarkdownEditor as u } from "../../components/MarkdownEditor.js";
7
7
  import { WorkItemMilestoneSelect as d } from "../milestones/MilestoneControls.js";
8
8
  import { WorkItemComments as f } from "../comments/WorkItemComments.js";
@@ -80,7 +80,7 @@ var F = C`
80
80
  ARCHIVED: "bg-gray-100 text-gray-500"
81
81
  };
82
82
  function V({ workItemId: e }) {
83
- let n = t(), [a, o] = v(!1), [s, c] = v(!1), [l, d] = v(""), [f, p] = v(""), [m, h] = v(""), { data: g, loading: _, error: C, refetch: O } = T(I, {
83
+ let n = t(), [i, a] = v(!1), [o, s] = v(!1), [c, d] = v(""), [f, p] = v(""), [m, h] = v(""), { data: g, loading: _, error: C, refetch: O } = T(I, {
84
84
  variables: { workItemId: e },
85
85
  skip: !e
86
86
  }), [F, { loading: V }] = w(L), [H, { loading: U }] = w(R), [W, { loading: G }] = w(z), [K, q] = v(null), J = g?.planmagnetWorkItemDocs ?? [], Y = async () => {
@@ -99,21 +99,21 @@ function V({ workItemId: e }) {
99
99
  q(e instanceof Error ? e.message : "The doc could not be saved.");
100
100
  return;
101
101
  }
102
- p(""), h(""), o(!1), O();
102
+ p(""), h(""), a(!1), O();
103
103
  }
104
104
  }, X = async () => {
105
- if (l) {
105
+ if (c) {
106
106
  q(null);
107
107
  try {
108
108
  await r(H({ variables: {
109
- docId: l,
109
+ docId: c,
110
110
  workItemId: e
111
111
  } }));
112
112
  } catch (e) {
113
113
  q(e instanceof Error ? e.message : "The doc could not be linked.");
114
114
  return;
115
115
  }
116
- d(""), c(!1), O();
116
+ d(""), s(!1), O();
117
117
  }
118
118
  }, Z = async (t) => {
119
119
  q(null);
@@ -130,28 +130,28 @@ function V({ workItemId: e }) {
130
130
  };
131
131
  return /* @__PURE__ */ D(A, { children: [/* @__PURE__ */ D(M, {
132
132
  className: "flex flex-row items-center justify-between space-y-0",
133
- children: [/* @__PURE__ */ E(N, { children: "Linked Docs" }), !a && !s && /* @__PURE__ */ D("div", {
133
+ children: [/* @__PURE__ */ E(N, { children: "Linked Docs" }), !i && !o && /* @__PURE__ */ D("div", {
134
134
  className: "flex gap-2",
135
135
  children: [/* @__PURE__ */ D(k, {
136
136
  size: "sm",
137
137
  variant: "outline",
138
- onClick: () => c(!0),
138
+ onClick: () => s(!0),
139
139
  children: [/* @__PURE__ */ E(b, { className: "h-4 w-4 mr-1" }), "Link existing doc"]
140
140
  }), /* @__PURE__ */ D(k, {
141
141
  size: "sm",
142
142
  variant: "outline",
143
- onClick: () => o(!0),
143
+ onClick: () => a(!0),
144
144
  children: [/* @__PURE__ */ E(x, { className: "h-4 w-4 mr-1" }), "New Doc"]
145
145
  })]
146
146
  })]
147
147
  }), /* @__PURE__ */ D(j, {
148
148
  className: "space-y-4",
149
149
  children: [
150
- s && /* @__PURE__ */ D("div", {
150
+ o && /* @__PURE__ */ D("div", {
151
151
  className: "space-y-2 rounded-md border border-input p-3",
152
- children: [/* @__PURE__ */ E(i, {
152
+ children: [/* @__PURE__ */ E(l, {
153
153
  id: "task-link-doc",
154
- value: l,
154
+ value: c,
155
155
  onChange: d,
156
156
  exclude: J.map((e) => e.id)
157
157
  }), /* @__PURE__ */ D("div", {
@@ -160,18 +160,18 @@ function V({ workItemId: e }) {
160
160
  size: "sm",
161
161
  variant: "ghost",
162
162
  onClick: () => {
163
- c(!1), d("");
163
+ s(!1), d("");
164
164
  },
165
165
  children: "Cancel"
166
166
  }), /* @__PURE__ */ E(k, {
167
167
  size: "sm",
168
- disabled: !l || U,
168
+ disabled: !c || U,
169
169
  onClick: X,
170
170
  children: U ? "Linking..." : "Link"
171
171
  })]
172
172
  })]
173
173
  }),
174
- a && /* @__PURE__ */ D("div", {
174
+ i && /* @__PURE__ */ D("div", {
175
175
  className: "space-y-3 rounded-md border border-input p-3",
176
176
  children: [
177
177
  /* @__PURE__ */ E(P, {
@@ -191,7 +191,7 @@ function V({ workItemId: e }) {
191
191
  size: "sm",
192
192
  variant: "ghost",
193
193
  onClick: () => {
194
- o(!1), p(""), h("");
194
+ a(!1), p(""), h("");
195
195
  },
196
196
  children: "Cancel"
197
197
  }), /* @__PURE__ */ E(k, {
@@ -216,7 +216,7 @@ function V({ workItemId: e }) {
216
216
  className: "text-sm text-destructive",
217
217
  children: K
218
218
  }),
219
- !_ && !C && J.length === 0 && !a && !s && /* @__PURE__ */ E("p", {
219
+ !_ && !C && J.length === 0 && !i && !o && /* @__PURE__ */ E("p", {
220
220
  className: "text-sm text-muted-foreground",
221
221
  children: "No docs linked to this work item yet."
222
222
  }),
@@ -255,11 +255,11 @@ function V({ workItemId: e }) {
255
255
  })] });
256
256
  }
257
257
  function H() {
258
- let { workspaceId: t } = e(), r = new URLSearchParams(window.location.search).get("taskId") ?? "", { data: i, loading: u, error: v } = T(F, {
258
+ let { workspaceId: t } = e(), r = new URLSearchParams(window.location.search).get("taskId") ?? "", { data: l, loading: u, error: v } = T(F, {
259
259
  variables: { workItemId: r },
260
260
  skip: !t || !r
261
261
  });
262
- if (u && !i) return /* @__PURE__ */ E("div", {
262
+ if (u && !l) return /* @__PURE__ */ E("div", {
263
263
  className: "flex items-center justify-center p-12",
264
264
  children: /* @__PURE__ */ E("div", { className: "animate-spin h-8 w-8 border-2 border-primary border-t-transparent rounded-full" })
265
265
  });
@@ -267,7 +267,7 @@ function H() {
267
267
  className: "p-6 text-red-500",
268
268
  children: ["Error: ", v.message]
269
269
  });
270
- let y = i?.planmagnetWorkItem;
270
+ let y = l?.planmagnetWorkItem;
271
271
  return y ? /* @__PURE__ */ D("div", {
272
272
  className: "space-y-6 p-6",
273
273
  children: [/* @__PURE__ */ D("div", {
@@ -282,7 +282,7 @@ function H() {
282
282
  " · ",
283
283
  y.type.toLowerCase()
284
284
  ]
285
- })] }), /* @__PURE__ */ E(c, {
285
+ })] }), /* @__PURE__ */ E(s, {
286
286
  workItemId: y.id,
287
287
  title: y.title
288
288
  })]
@@ -326,7 +326,7 @@ function H() {
326
326
  children: [/* @__PURE__ */ E("span", {
327
327
  className: "text-muted-foreground",
328
328
  children: "Status"
329
- }), /* @__PURE__ */ E(l, {
329
+ }), /* @__PURE__ */ E(c, {
330
330
  workItemId: y.id,
331
331
  projectId: y.projectId,
332
332
  value: y.status
@@ -337,11 +337,11 @@ function H() {
337
337
  children: [/* @__PURE__ */ E("span", {
338
338
  className: "text-muted-foreground",
339
339
  children: "Priority"
340
- }), /* @__PURE__ */ E(s, {
340
+ }), /* @__PURE__ */ E(o, {
341
341
  workItemId: y.id,
342
342
  field: "priority",
343
343
  value: y.priority,
344
- options: a,
344
+ options: i,
345
345
  label: "Priority"
346
346
  })]
347
347
  }),
@@ -382,7 +382,7 @@ function H() {
382
382
  children: [/* @__PURE__ */ E("span", {
383
383
  className: "text-muted-foreground",
384
384
  children: "Assignee"
385
- }), /* @__PURE__ */ E(o, {
385
+ }), /* @__PURE__ */ E(a, {
386
386
  workItemId: y.id,
387
387
  assigneeId: y.assigneeId
388
388
  })]
@@ -1,10 +1,22 @@
1
1
  /** Hours read naturally up to two days; beyond that, days. */
2
2
  export declare function formatDuration(hours: number | null | undefined): string;
3
- export declare function CycleTimeCard({ workspaceId, projectId, }: {
3
+ /** Shared by every analytics stat row (cycle time here; quality/delivery/budget/my-dashboard cards reuse it) so a
4
+ * headline number and its one-line definition always read the same way. */
5
+ export declare function StatTile({ label, value, hint }: {
6
+ label: string;
7
+ value: string;
8
+ hint?: string;
9
+ }): import("react/jsx-runtime").JSX.Element;
10
+ export declare function CycleTimeCard({ workspaceId, projectId, startDate, endDate, }: {
4
11
  workspaceId?: string | null;
5
12
  projectId: string;
13
+ /** ANR-09: when omitted, the server's own default (no bound) applies — every completed item. */
14
+ startDate?: string;
15
+ endDate?: string;
6
16
  }): import("react/jsx-runtime").JSX.Element;
7
- export declare function BudgetPerformanceCard({ workspaceId }: {
17
+ export declare function BudgetPerformanceCard({ workspaceId, projectId, }: {
8
18
  workspaceId?: string | null;
19
+ /** ANR-09 project scope. Omitted/undefined = every project's budgets, the page's original behavior. */
20
+ projectId?: string;
9
21
  }): import("react/jsx-runtime").JSX.Element;
10
22
  //# sourceMappingURL=DeliveryHealthCards.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DeliveryHealthCards.d.ts","sourceRoot":"","sources":["../../../../src/planmagnet/pages/analytics/DeliveryHealthCards.tsx"],"names":[],"mappings":"AA2FA,8DAA8D;AAC9D,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAKvE;AAYD,wBAAgB,aAAa,CAAC,EAC5B,WAAW,EACX,SAAS,GACV,EAAE;IACD,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;CACnB,2CAkGA;AAED,wBAAgB,qBAAqB,CAAC,EAAE,WAAW,EAAE,EAAE;IAAE,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,2CA8HrF"}
1
+ {"version":3,"file":"DeliveryHealthCards.d.ts","sourceRoot":"","sources":["../../../../src/planmagnet/pages/analytics/DeliveryHealthCards.tsx"],"names":[],"mappings":"AA8GA,8DAA8D;AAC9D,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAKvE;AAED;4EAC4E;AAC5E,wBAAgB,QAAQ,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,2CAQ/F;AAED,wBAAgB,aAAa,CAAC,EAC5B,WAAW,EACX,SAAS,EACT,SAAS,EACT,OAAO,GACR,EAAE;IACD,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,gGAAgG;IAChG,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,2CAkGA;AAED,wBAAgB,qBAAqB,CAAC,EACpC,WAAW,EACX,SAAS,GACV,EAAE;IACD,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,uGAAuG;IACvG,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,2CAoLA"}
@@ -7,8 +7,18 @@ import { useI18n as u } from "@burdenoff/fe-libs/shared/providers/shell/I18nProv
7
7
  import { Card as d, CardContent as f, CardHeader as p, CardTitle as m } from "@burdenoff/fe-libs/ui";
8
8
  //#region src/planmagnet/pages/analytics/DeliveryHealthCards.tsx
9
9
  var h = o`
10
- query GetProjectCycleTime($workspaceId: ID!, $projectId: ID!) {
11
- planmagnetCycleTime(workspaceId: $workspaceId, projectId: $projectId) {
10
+ query GetProjectCycleTime(
11
+ $workspaceId: ID!
12
+ $projectId: ID!
13
+ $startDate: DateTime
14
+ $endDate: DateTime
15
+ ) {
16
+ planmagnetCycleTime(
17
+ workspaceId: $workspaceId
18
+ projectId: $projectId
19
+ startDate: $startDate
20
+ endDate: $endDate
21
+ ) {
12
22
  averageCycleTimeHours
13
23
  medianCycleTimeHours
14
24
  sampleSize
@@ -21,8 +31,8 @@ var h = o`
21
31
  }
22
32
  }
23
33
  `, g = o`
24
- query GetBudgetPerformance($workspaceId: ID!) {
25
- planmagnetBudgets(workspaceId: $workspaceId, pagination: { first: 50 }) {
34
+ query GetBudgetPerformance($workspaceId: ID!, $filter: PlanmagnetBudgetFilter) {
35
+ planmagnetBudgets(workspaceId: $workspaceId, filter: $filter, pagination: { first: 50 }) {
26
36
  items {
27
37
  id
28
38
  name
@@ -30,6 +40,10 @@ var h = o`
30
40
  plannedAmount
31
41
  spentAmount
32
42
  remainingAmount
43
+ varianceAmount
44
+ variancePercent
45
+ deliverablesDone
46
+ costPerDeliverable
33
47
  project {
34
48
  id
35
49
  name
@@ -64,50 +78,52 @@ function v({ label: e, value: t, hint: n }) {
64
78
  ]
65
79
  });
66
80
  }
67
- function y({ workspaceId: e, projectId: t }) {
68
- let { t: n } = u(), { data: r, loading: a, error: o } = s(h, {
81
+ function y({ workspaceId: e, projectId: t, startDate: n, endDate: r }) {
82
+ let { t: a } = u(), { data: o, loading: g, error: y } = s(h, {
69
83
  variables: {
70
84
  workspaceId: e,
71
- projectId: t
85
+ projectId: t,
86
+ startDate: n,
87
+ endDate: r
72
88
  },
73
89
  skip: !e || !t
74
- }), g = r?.planmagnetCycleTime, y = [...g?.items ?? []].sort((e, t) => t.cycleTimeHours - e.cycleTimeHours).slice(0, 5);
90
+ }), b = o?.planmagnetCycleTime, x = [...b?.items ?? []].sort((e, t) => t.cycleTimeHours - e.cycleTimeHours).slice(0, 5);
75
91
  return /* @__PURE__ */ l(d, { children: [/* @__PURE__ */ l(p, { children: [/* @__PURE__ */ l(m, {
76
92
  className: "flex items-center gap-2",
77
- children: [/* @__PURE__ */ c(i, { className: "h-4 w-4" }), n("planmagnet.analytics.cycleTime.title", "Cycle time")]
93
+ children: [/* @__PURE__ */ c(i, { className: "h-4 w-4" }), a("planmagnet.analytics.cycleTime.title", "Cycle time")]
78
94
  }), /* @__PURE__ */ c("p", {
79
95
  className: "text-xs text-muted-foreground",
80
- children: n("planmagnet.analytics.cycleTime.subtitle", "From first moving to In Progress (or creation) to Done, for the selected project.")
81
- })] }), /* @__PURE__ */ c(f, { children: t ? a ? /* @__PURE__ */ c("p", {
96
+ children: a("planmagnet.analytics.cycleTime.subtitle", "From first moving to In Progress (or creation) to Done, for the selected project.")
97
+ })] }), /* @__PURE__ */ c(f, { children: t ? g ? /* @__PURE__ */ c("p", {
82
98
  className: "text-sm text-muted-foreground",
83
- children: n("planmagnet.analytics.loading", "Loading…")
84
- }) : o ? /* @__PURE__ */ l("p", {
99
+ children: a("planmagnet.analytics.loading", "Loading…")
100
+ }) : y ? /* @__PURE__ */ l("p", {
85
101
  className: "text-sm text-status-error-text",
86
102
  children: [
87
- n("planmagnet.analytics.cycleTime.error", "Cycle time could not be loaded"),
103
+ a("planmagnet.analytics.cycleTime.error", "Cycle time could not be loaded"),
88
104
  ":",
89
105
  " ",
90
- o.message
106
+ y.message
91
107
  ]
92
- }) : !g || g.sampleSize === 0 ? /* @__PURE__ */ c("p", {
108
+ }) : !b || b.sampleSize === 0 ? /* @__PURE__ */ c("p", {
93
109
  className: "text-sm text-muted-foreground",
94
- children: n("planmagnet.analytics.cycleTime.empty", "No completed work items in this project yet — cycle time appears once items reach Done.")
110
+ children: a("planmagnet.analytics.cycleTime.empty", "No completed work items in this project yet — cycle time appears once items reach Done.")
95
111
  }) : /* @__PURE__ */ l("div", {
96
112
  className: "space-y-4",
97
113
  children: [/* @__PURE__ */ l("div", {
98
114
  className: "grid grid-cols-3 gap-3",
99
115
  children: [
100
116
  /* @__PURE__ */ c(v, {
101
- label: n("planmagnet.analytics.cycleTime.median", "Median"),
102
- value: _(g.medianCycleTimeHours)
117
+ label: a("planmagnet.analytics.cycleTime.median", "Median"),
118
+ value: _(b.medianCycleTimeHours)
103
119
  }),
104
120
  /* @__PURE__ */ c(v, {
105
- label: n("planmagnet.analytics.cycleTime.average", "Average"),
106
- value: _(g.averageCycleTimeHours)
121
+ label: a("planmagnet.analytics.cycleTime.average", "Average"),
122
+ value: _(b.averageCycleTimeHours)
107
123
  }),
108
124
  /* @__PURE__ */ c(v, {
109
- label: n("planmagnet.analytics.cycleTime.sample", "Items measured"),
110
- value: String(g.sampleSize)
125
+ label: a("planmagnet.analytics.cycleTime.sample", "Items measured"),
126
+ value: String(b.sampleSize)
111
127
  })
112
128
  ]
113
129
  }), /* @__PURE__ */ l("table", {
@@ -115,19 +131,19 @@ function y({ workspaceId: e, projectId: t }) {
115
131
  children: [
116
132
  /* @__PURE__ */ c("caption", {
117
133
  className: "mb-2 text-left text-xs text-muted-foreground",
118
- children: n("planmagnet.analytics.cycleTime.slowest", "Slowest completed items")
134
+ children: a("planmagnet.analytics.cycleTime.slowest", "Slowest completed items")
119
135
  }),
120
136
  /* @__PURE__ */ c("thead", { children: /* @__PURE__ */ l("tr", {
121
137
  className: "text-left text-xs text-muted-foreground",
122
138
  children: [/* @__PURE__ */ c("th", {
123
139
  className: "py-1 pr-2 font-normal",
124
- children: n("planmagnet.analytics.cycleTime.item", "Item")
140
+ children: a("planmagnet.analytics.cycleTime.item", "Item")
125
141
  }), /* @__PURE__ */ c("th", {
126
142
  className: "py-1 text-right font-normal",
127
- children: n("planmagnet.analytics.cycleTime.duration", "Cycle time")
143
+ children: a("planmagnet.analytics.cycleTime.duration", "Cycle time")
128
144
  })]
129
145
  }) }),
130
- /* @__PURE__ */ c("tbody", { children: y.map((e) => /* @__PURE__ */ l("tr", {
146
+ /* @__PURE__ */ c("tbody", { children: x.map((e) => /* @__PURE__ */ l("tr", {
131
147
  className: "border-t",
132
148
  children: [/* @__PURE__ */ l("td", {
133
149
  className: "py-1.5 pr-2",
@@ -151,114 +167,158 @@ function y({ workspaceId: e, projectId: t }) {
151
167
  })]
152
168
  }) : /* @__PURE__ */ c("p", {
153
169
  className: "text-sm text-muted-foreground",
154
- children: n("planmagnet.analytics.cycleTime.noProject", "Select a project to see its cycle time.")
170
+ children: a("planmagnet.analytics.cycleTime.noProject", "Select a project to see its cycle time.")
155
171
  }) })] });
156
172
  }
157
- function b({ workspaceId: i }) {
158
- let { t: o } = u(), { data: h, loading: _, error: v } = s(g, {
159
- variables: { workspaceId: i },
173
+ function b({ workspaceId: i, projectId: o }) {
174
+ let { t: h } = u(), { data: _, loading: v, error: y } = s(g, {
175
+ variables: {
176
+ workspaceId: i,
177
+ filter: o ? { projectId: o } : void 0
178
+ },
160
179
  skip: !i
161
- }), y = [...h?.planmagnetBudgets?.items ?? []].sort((e, t) => (n(t.plannedAmount, t.spentAmount) ?? -1) - (n(e.plannedAmount, e.spentAmount) ?? -1)), b = h?.planmagnetBudgets?.totalCount ?? y.length, x = {
162
- "no-plan": o("planmagnet.analytics.budget.noPlan", "No plan set"),
163
- "on-track": o("planmagnet.analytics.budget.onTrack", "On track"),
164
- "near-limit": o("planmagnet.analytics.budget.nearLimit", "Near limit"),
165
- "over-budget": o("planmagnet.analytics.budget.over", "Over budget")
180
+ }), b = [..._?.planmagnetBudgets?.items ?? []].sort((e, t) => (n(t.plannedAmount, t.spentAmount) ?? -1) - (n(e.plannedAmount, e.spentAmount) ?? -1)), x = _?.planmagnetBudgets?.totalCount ?? b.length, S = {
181
+ "no-plan": h("planmagnet.analytics.budget.noPlan", "No plan set"),
182
+ "on-track": h("planmagnet.analytics.budget.onTrack", "On track"),
183
+ "near-limit": h("planmagnet.analytics.budget.nearLimit", "Near limit"),
184
+ "over-budget": h("planmagnet.analytics.budget.over", "Over budget")
166
185
  };
167
186
  return /* @__PURE__ */ l(d, { children: [/* @__PURE__ */ l(p, { children: [/* @__PURE__ */ l(m, {
168
187
  className: "flex items-center gap-2",
169
- children: [/* @__PURE__ */ c(a, { className: "h-4 w-4" }), o("planmagnet.analytics.budget.title", "Budget performance")]
188
+ children: [/* @__PURE__ */ c(a, { className: "h-4 w-4" }), h("planmagnet.analytics.budget.title", "Budget performance")]
170
189
  }), /* @__PURE__ */ c("p", {
171
190
  className: "text-xs text-muted-foreground",
172
- children: b > y.length ? o("planmagnet.analytics.budget.subtitlePartial", "Spent against plan, per budget — the newest {{shown}} of {{total}}, riskiest first.", {
173
- shown: y.length,
174
- total: b
175
- }) : o("planmagnet.analytics.budget.subtitle", "Spent against plan, per budget, across the workspace.")
176
- })] }), /* @__PURE__ */ c(f, { children: _ ? /* @__PURE__ */ c("p", {
191
+ children: x > b.length ? h("planmagnet.analytics.budget.subtitlePartial", "Spent against plan, per budget — the newest {{shown}} of {{total}}, riskiest first.", {
192
+ shown: b.length,
193
+ total: x
194
+ }) : o ? h("planmagnet.analytics.budget.subtitleProject", "Spent against plan, per budget, for the selected project.") : h("planmagnet.analytics.budget.subtitle", "Spent against plan, per budget, across the workspace.")
195
+ })] }), /* @__PURE__ */ c(f, { children: v ? /* @__PURE__ */ c("p", {
177
196
  className: "text-sm text-muted-foreground",
178
- children: o("planmagnet.analytics.loading", "Loading…")
179
- }) : v ? /* @__PURE__ */ l("p", {
197
+ children: h("planmagnet.analytics.loading", "Loading…")
198
+ }) : y ? /* @__PURE__ */ l("p", {
180
199
  className: "text-sm text-status-error-text",
181
200
  children: [
182
- o("planmagnet.analytics.budget.error", "Budgets could not be loaded"),
201
+ h("planmagnet.analytics.budget.error", "Budgets could not be loaded"),
183
202
  ": ",
184
- v.message
203
+ y.message
185
204
  ]
186
- }) : y.length === 0 ? /* @__PURE__ */ c("p", {
205
+ }) : b.length === 0 ? /* @__PURE__ */ c("p", {
187
206
  className: "text-sm text-muted-foreground",
188
- children: o("planmagnet.analytics.budget.empty", "No budgets in this workspace yet.")
189
- }) : /* @__PURE__ */ l("table", {
190
- className: "w-full text-sm",
191
- children: [/* @__PURE__ */ c("thead", { children: /* @__PURE__ */ l("tr", {
192
- className: "text-left text-xs text-muted-foreground",
193
- children: [
194
- /* @__PURE__ */ c("th", {
195
- className: "py-1 pr-2 font-normal",
196
- children: o("planmagnet.analytics.budget.name", "Budget")
197
- }),
198
- /* @__PURE__ */ c("th", {
199
- className: "py-1 pr-2 text-right font-normal",
200
- children: o("planmagnet.analytics.budget.spent", "Spent")
201
- }),
202
- /* @__PURE__ */ c("th", {
203
- className: "py-1 pr-2 text-right font-normal",
204
- children: o("planmagnet.analytics.budget.planned", "Planned")
205
- }),
206
- /* @__PURE__ */ c("th", {
207
- className: "w-2/5 py-1 font-normal",
208
- children: o("planmagnet.analytics.budget.usage", "Used")
209
- })
210
- ]
211
- }) }), /* @__PURE__ */ c("tbody", { children: y.map((i) => {
212
- let a = n(i.plannedAmount, i.spentAmount), o = t(a), s = e[o], u = a === null ? null : Math.round(a * 100);
213
- return /* @__PURE__ */ l("tr", {
214
- className: "border-t align-middle",
207
+ children: o ? h("planmagnet.analytics.budget.emptyProject", "No budgets for this project yet.") : h("planmagnet.analytics.budget.empty", "No budgets in this workspace yet.")
208
+ }) : /* @__PURE__ */ l("div", {
209
+ className: "space-y-2 overflow-x-auto",
210
+ children: [/* @__PURE__ */ l("table", {
211
+ className: "w-full text-sm",
212
+ children: [/* @__PURE__ */ c("thead", { children: /* @__PURE__ */ l("tr", {
213
+ className: "text-left text-xs text-muted-foreground",
215
214
  children: [
216
- /* @__PURE__ */ l("td", {
217
- className: "py-2 pr-2",
218
- children: [/* @__PURE__ */ c("span", {
219
- className: "font-medium",
220
- children: i.name
221
- }), i.project ? /* @__PURE__ */ c("span", {
222
- className: "block text-xs text-muted-foreground",
223
- children: i.project.name
224
- }) : null]
215
+ /* @__PURE__ */ c("th", {
216
+ className: "py-1 pr-2 font-normal",
217
+ children: h("planmagnet.analytics.budget.name", "Budget")
225
218
  }),
226
- /* @__PURE__ */ c("td", {
227
- className: "py-2 pr-2 text-right tabular-nums",
228
- children: r(i.spentAmount, i.currency)
219
+ /* @__PURE__ */ c("th", {
220
+ className: "py-1 pr-2 text-right font-normal",
221
+ children: h("planmagnet.analytics.budget.spent", "Spent")
229
222
  }),
230
- /* @__PURE__ */ c("td", {
231
- className: "py-2 pr-2 text-right tabular-nums",
232
- children: r(i.plannedAmount, i.currency)
223
+ /* @__PURE__ */ c("th", {
224
+ className: "py-1 pr-2 text-right font-normal",
225
+ children: h("planmagnet.analytics.budget.planned", "Planned")
233
226
  }),
234
- /* @__PURE__ */ l("td", {
235
- className: "py-2",
236
- children: [/* @__PURE__ */ c("div", {
237
- role: "meter",
238
- "aria-valuemin": 0,
239
- "aria-valuemax": Math.max(100, u ?? 0),
240
- "aria-valuenow": u ?? 0,
241
- "aria-label": `${i.name}: ${u === null ? "no plan" : `${u}%`} ${x[o]}`,
242
- title: `${r(i.spentAmount, i.currency)} of ${r(i.plannedAmount, i.currency)}`,
243
- className: `h-2 w-full overflow-hidden rounded-full ${s.track}`,
244
- children: /* @__PURE__ */ c("div", {
245
- className: `h-full rounded-full ${s.fill}`,
246
- style: { width: `${Math.min(u ?? 0, 100)}%` }
247
- })
248
- }), /* @__PURE__ */ l("span", {
249
- className: `mt-1 flex items-center gap-1 text-xs ${s.text}`,
250
- children: [/* @__PURE__ */ c(s.icon, {
251
- className: "h-3 w-3",
252
- "aria-hidden": !0
253
- }), u === null ? x[o] : `${u}% · ${x[o]}`]
254
- })]
227
+ /* @__PURE__ */ c("th", {
228
+ className: "py-1 pr-2 text-right font-normal",
229
+ children: h("planmagnet.analytics.budget.variance", "Variance")
230
+ }),
231
+ /* @__PURE__ */ c("th", {
232
+ className: "py-1 pr-2 text-right font-normal",
233
+ children: h("planmagnet.analytics.budget.costPerDeliverable", "Cost / deliverable")
234
+ }),
235
+ /* @__PURE__ */ c("th", {
236
+ className: "w-2/5 py-1 font-normal",
237
+ children: h("planmagnet.analytics.budget.usage", "Used")
255
238
  })
256
239
  ]
257
- }, i.id);
258
- }) })]
240
+ }) }), /* @__PURE__ */ c("tbody", { children: b.map((i) => {
241
+ let a = n(i.plannedAmount, i.spentAmount), o = t(a), s = e[o], u = a === null ? null : Math.round(a * 100), d = i.varianceAmount > 0;
242
+ return /* @__PURE__ */ l("tr", {
243
+ className: "border-t align-middle",
244
+ children: [
245
+ /* @__PURE__ */ l("td", {
246
+ className: "py-2 pr-2",
247
+ children: [/* @__PURE__ */ c("span", {
248
+ className: "font-medium",
249
+ children: i.name
250
+ }), i.project ? /* @__PURE__ */ c("span", {
251
+ className: "block text-xs text-muted-foreground",
252
+ children: i.project.name
253
+ }) : null]
254
+ }),
255
+ /* @__PURE__ */ c("td", {
256
+ className: "py-2 pr-2 text-right tabular-nums",
257
+ children: r(i.spentAmount, i.currency)
258
+ }),
259
+ /* @__PURE__ */ c("td", {
260
+ className: "py-2 pr-2 text-right tabular-nums",
261
+ children: r(i.plannedAmount, i.currency)
262
+ }),
263
+ /* @__PURE__ */ l("td", {
264
+ className: `py-2 pr-2 text-right tabular-nums ${d ? "text-status-error-text" : "text-status-success-text"}`,
265
+ "data-testid": "budget-variance",
266
+ children: [
267
+ d ? "+" : "",
268
+ r(i.varianceAmount, i.currency),
269
+ i.variancePercent === null ? /* @__PURE__ */ c("span", {
270
+ className: "block text-xs text-muted-foreground",
271
+ children: h("planmagnet.analytics.budget.varianceNoPlan", "no plan")
272
+ }) : /* @__PURE__ */ l("span", {
273
+ className: "block text-xs text-muted-foreground",
274
+ children: [
275
+ i.variancePercent > 0 ? "+" : "",
276
+ Math.round(i.variancePercent),
277
+ "%"
278
+ ]
279
+ })
280
+ ]
281
+ }),
282
+ /* @__PURE__ */ l("td", {
283
+ className: "py-2 pr-2 text-right tabular-nums",
284
+ "data-testid": "budget-cost-per-deliverable",
285
+ children: [i.costPerDeliverable === null ? "—" : r(i.costPerDeliverable, i.currency), /* @__PURE__ */ c("span", {
286
+ className: "block text-xs text-muted-foreground",
287
+ children: h("planmagnet.analytics.budget.deliverablesDone", "{{count}} done", { count: i.deliverablesDone })
288
+ })]
289
+ }),
290
+ /* @__PURE__ */ l("td", {
291
+ className: "py-2",
292
+ children: [/* @__PURE__ */ c("div", {
293
+ role: "meter",
294
+ "aria-valuemin": 0,
295
+ "aria-valuemax": Math.max(100, u ?? 0),
296
+ "aria-valuenow": u ?? 0,
297
+ "aria-label": `${i.name}: ${u === null ? "no plan" : `${u}%`} ${S[o]}`,
298
+ title: `${r(i.spentAmount, i.currency)} of ${r(i.plannedAmount, i.currency)}`,
299
+ className: `h-2 w-full overflow-hidden rounded-full ${s.track}`,
300
+ children: /* @__PURE__ */ c("div", {
301
+ className: `h-full rounded-full ${s.fill}`,
302
+ style: { width: `${Math.min(u ?? 0, 100)}%` }
303
+ })
304
+ }), /* @__PURE__ */ l("span", {
305
+ className: `mt-1 flex items-center gap-1 text-xs ${s.text}`,
306
+ children: [/* @__PURE__ */ c(s.icon, {
307
+ className: "h-3 w-3",
308
+ "aria-hidden": !0
309
+ }), u === null ? S[o] : `${u}% · ${S[o]}`]
310
+ })]
311
+ })
312
+ ]
313
+ }, i.id);
314
+ }) })]
315
+ }), /* @__PURE__ */ c("p", {
316
+ className: "text-xs text-muted-foreground",
317
+ children: h("planmagnet.analytics.budget.definitions", "Variance = spent − planned (a positive amount and % is over budget). Cost / deliverable = spent ÷ work items this budget’s project completed in its period — \"—\" when none have.")
318
+ })]
259
319
  }) })] });
260
320
  }
261
321
  //#endregion
262
- export { b as BudgetPerformanceCard, y as CycleTimeCard };
322
+ export { b as BudgetPerformanceCard, y as CycleTimeCard, v as StatTile, _ as formatDuration };
263
323
 
264
324
  //# sourceMappingURL=DeliveryHealthCards.js.map