@parallelworks/tandem-web 0.166.0 → 0.167.0

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.
package/pages/projects.js CHANGED
@@ -10,31 +10,31 @@ import { HealthIcon as g, ProgressBar as _, ProjectStatusIcon as v, healthOf as
10
10
  import { projectRef as b, projectTree as x, projectsUnder as S } from "../lib/projects.js";
11
11
  import { EntityIcon as C } from "../components/EntityIcon.js";
12
12
  import { useCan as w } from "../lib/roles.js";
13
- import { healthStates as T, projectStatuses as ee } from "../lib/projectStates.js";
14
- import { storeLayout as te, storedLayout as ne } from "../lib/projectList.js";
13
+ import { healthStates as T, projectStatuses as ee, shownStatus as te } from "../lib/projectStates.js";
14
+ import { storeLayout as ne, storedLayout as E } from "../lib/projectList.js";
15
15
  import { FavoriteStar as re } from "../components/FavoriteStar.js";
16
16
  import { DisplayMenu as ie } from "../components/DisplayMenu.js";
17
17
  import { NewProjectDialog as ae } from "../components/NewProjectDialog.js";
18
- import { Avatar as E, Button as D, Combobox as oe, EmptyState as O, PageHeaderAddButton as k, Switch as A, Tabs as j, ToggleGroup as se, Tooltip as M, menuDivider as ce, useOpenMenu as le } from "@parallelworks/ui";
19
- import { useParams as ue, useSearch as de } from "@tanstack/react-router";
20
- import { useEffect as N, useId as fe, useRef as P, useState as F } from "react";
21
- import { useFormatter as I, useTranslations as L } from "use-intl";
22
- import { jsx as R, jsxs as z } from "react/jsx-runtime";
23
- import { useSuspenseQuery as B } from "@tanstack/react-query";
24
- import { MoreButton as V } from "@parallelworks/ui/list";
18
+ import { Avatar as D, Button as O, Combobox as oe, EmptyState as se, PageHeaderAddButton as ce, Switch as le, Tabs as k, ToggleGroup as ue, Tooltip as A, menuDivider as de, useOpenMenu as fe } from "@parallelworks/ui";
19
+ import { useParams as j, useSearch as M } from "@tanstack/react-router";
20
+ import { useEffect as N, useId as P, useRef as F, useState as I } from "react";
21
+ import { useFormatter as L, useTranslations as R } from "use-intl";
22
+ import { jsx as z, jsxs as B } from "react/jsx-runtime";
23
+ import { useSuspenseQuery as V } from "@tanstack/react-query";
24
+ import { MoreButton as H } from "@parallelworks/ui/list";
25
25
  // src/pages/projects.tsx
26
- function H() {
27
- let { workspace: t, key: c } = ue({ strict: !1 }), u = de({ strict: !1 }), p = c ? {
26
+ function U() {
27
+ let { workspace: t, key: c } = j({ strict: !1 }), u = M({ strict: !1 }), p = c ? {
28
28
  ...u,
29
29
  team: c
30
- } : u, m = L("planning"), h = L("common"), { data: g } = B(r(t)), { data: _ } = B(i(t)), v = _.find((e) => e.key === p.team);
30
+ } : u, m = R("planning"), h = R("common"), { data: g } = V(r(t)), { data: _ } = V(i(t)), v = _.find((e) => e.key === p.team);
31
31
  e(v ? m("teamProjects", { team: v.name }) : m("projects"));
32
- let x = c ? "list" : "timeline", C = p.view ?? ne(!!c) ?? x, T = g.filter((e) => (!v || e.teamIds.includes(v.id)) && !!e.template == (C === "templates")), E = w(t, "manage_projects"), [j, M] = F(!1), N = fe(), P = n(), I = le(), V = s(), H = p.parent ? g.find((e) => e.id === p.parent) : void 0, U = H && new Set(S(g, H.id).map((e) => e.id)), W = T.filter((e) => (!p.status || e.status === p.status) && (!p.health || y(e) === p.health) && (!U || U.has(e.id))), G = (e) => {
32
+ let x = c ? "list" : "timeline", C = p.view ?? E(!!c) ?? x, T = g.filter((e) => (!v || e.teamIds.includes(v.id)) && !!e.template == (C === "templates")), D = w(t, "manage_projects"), [k, A] = I(!1), N = P(), F = n(), L = fe(), H = s(), U = p.parent ? g.find((e) => e.id === p.parent) : void 0, W = U && new Set(S(g, U.id).map((e) => e.id)), G = te(p.status, C === "templates"), K = T.filter((e) => (!G || e.status === G) && (!p.health || y(e) === p.health) && (!W || W.has(e.id))), q = T.length > 0 && (!!G || !!p.health), J = (e) => {
33
33
  let { team: n, ...r } = Object.fromEntries(Object.entries({
34
34
  ...p,
35
35
  ...e
36
36
  }).filter(([, e]) => e !== void 0));
37
- return P(c ? {
37
+ return F(c ? {
38
38
  to: "/$workspace/teams/$key/projects",
39
39
  params: {
40
40
  workspace: t,
@@ -48,10 +48,10 @@ function H() {
48
48
  search: r,
49
49
  replace: !0
50
50
  });
51
- }, K = a(t), q = L("favorites"), J = (e) => [
51
+ }, Y = a(t), X = R("favorites"), Z = (e) => [
52
52
  {
53
53
  label: h("open"),
54
- onClick: () => P({
54
+ onClick: () => F({
55
55
  to: "/$workspace/projects/$projectId",
56
56
  params: {
57
57
  workspace: t,
@@ -61,7 +61,7 @@ function H() {
61
61
  },
62
62
  {
63
63
  label: m("viewIssues"),
64
- onClick: () => P({
64
+ onClick: () => F({
65
65
  to: "/$workspace/projects/$projectId",
66
66
  params: {
67
67
  workspace: t,
@@ -71,77 +71,77 @@ function H() {
71
71
  })
72
72
  },
73
73
  {
74
- label: K.find("project", e.id) ? q("remove") : q("add"),
75
- onClick: () => K.toggle("project", e.id)
74
+ label: Y.find("project", e.id) ? X("remove") : X("add"),
75
+ onClick: () => Y.toggle("project", e.id)
76
76
  },
77
- ce,
78
- ...V(`/${t}/projects/${b(e)}`),
77
+ de,
78
+ ...H(`/${t}/projects/${b(e)}`),
79
79
  o(h("copyName"), e.name)
80
- ], Y = (e) => ({
80
+ ], Q = (e) => ({
81
81
  workspace: t,
82
82
  project: e,
83
- onContextMenu: (t) => I(t, J(e)),
84
- menu: () => J(e)
83
+ onContextMenu: (t) => L(t, Z(e)),
84
+ menu: () => Z(e)
85
85
  });
86
- return /* @__PURE__ */ z("div", {
86
+ return /* @__PURE__ */ B("div", {
87
87
  className: "flex h-full min-h-0 flex-col",
88
88
  children: [
89
- /* @__PURE__ */ z("header", {
89
+ /* @__PURE__ */ B("header", {
90
90
  className: "flex h-12 shrink-0 items-center gap-2 border-b border-border px-4 md:px-5",
91
91
  children: [
92
- /* @__PURE__ */ R("h1", {
92
+ /* @__PURE__ */ z("h1", {
93
93
  className: "min-w-0 truncate text-sm font-semibold",
94
94
  children: v ? m("teamProjects", { team: v.name }) : m("projects")
95
95
  }),
96
- !v && /* @__PURE__ */ R(re, {
96
+ !v && /* @__PURE__ */ z(re, {
97
97
  workspace: t,
98
98
  kind: "page",
99
99
  target: "projects"
100
100
  }),
101
- /* @__PURE__ */ R("span", {
101
+ /* @__PURE__ */ z("span", {
102
102
  className: "ml-auto flex items-center gap-1",
103
- children: /* @__PURE__ */ R(ie, {
103
+ children: /* @__PURE__ */ z(ie, {
104
104
  ...C !== "templates" && {
105
105
  layouts: [{
106
106
  value: "list",
107
107
  label: m("views.list"),
108
- icon: /* @__PURE__ */ R(l, {})
108
+ icon: /* @__PURE__ */ z(l, {})
109
109
  }, {
110
110
  value: "timeline",
111
111
  label: m("views.timeline"),
112
- icon: /* @__PURE__ */ R(f, {})
112
+ icon: /* @__PURE__ */ z(f, {})
113
113
  }],
114
114
  layout: C,
115
115
  onLayoutChange: (e) => {
116
- te(!!c, e), G({ view: e });
116
+ ne(!!c, e), J({ view: e });
117
117
  }
118
118
  },
119
119
  changed: C !== x,
120
- children: /* @__PURE__ */ z("div", {
120
+ children: /* @__PURE__ */ B("div", {
121
121
  className: "flex items-center justify-between gap-3",
122
- children: [/* @__PURE__ */ R("span", {
122
+ children: [/* @__PURE__ */ z("span", {
123
123
  id: N,
124
124
  className: "text-sm",
125
125
  children: m("showTemplates")
126
- }), /* @__PURE__ */ R(A, {
126
+ }), /* @__PURE__ */ z(le, {
127
127
  size: "sm",
128
128
  checked: C === "templates",
129
- onCheckedChange: (e) => G({ view: e ? "templates" : void 0 }),
129
+ onCheckedChange: (e) => J({ view: e ? "templates" : void 0 }),
130
130
  "aria-labelledby": N
131
131
  })]
132
132
  })
133
133
  })
134
134
  }),
135
- E && /* @__PURE__ */ R(k, {
135
+ D && /* @__PURE__ */ z(ce, {
136
136
  label: m("newProject"),
137
- onClick: () => M(!0)
137
+ onClick: () => A(!0)
138
138
  })
139
139
  ]
140
140
  }),
141
- /* @__PURE__ */ z("div", {
141
+ /* @__PURE__ */ B("div", {
142
142
  className: "flex shrink-0 flex-wrap items-center gap-1 border-b border-border px-4 py-2 md:px-5",
143
143
  children: [
144
- /* @__PURE__ */ R(se, {
144
+ /* @__PURE__ */ z(ue, {
145
145
  label: m("filterStatus"),
146
146
  multiple: !1,
147
147
  all: { count: T.length },
@@ -150,17 +150,17 @@ function H() {
150
150
  label: m(`status.${e}`),
151
151
  count: T.filter((t) => t.status === e).length
152
152
  })),
153
- value: p.status ? [p.status] : [],
154
- onValueChange: ([e]) => G({ status: e })
153
+ value: G ? [G] : [],
154
+ onValueChange: ([e]) => J({ status: e ?? "all" })
155
155
  }),
156
- p.health && /* @__PURE__ */ R(D, {
156
+ p.health && /* @__PURE__ */ z(O, {
157
157
  variant: "outline",
158
158
  size: "sm",
159
159
  "aria-pressed": !0,
160
- onClick: () => G({ health: void 0 }),
160
+ onClick: () => J({ health: void 0 }),
161
161
  children: m("healthFilter", { health: m(`health.${p.health}`) })
162
162
  }),
163
- T.some((e) => e.parentId) && /* @__PURE__ */ R(oe, {
163
+ T.some((e) => e.parentId) && /* @__PURE__ */ z(oe, {
164
164
  items: [{
165
165
  value: "",
166
166
  label: m("anyParent")
@@ -169,90 +169,90 @@ function H() {
169
169
  label: e.name
170
170
  }))],
171
171
  value: p.parent ?? "",
172
- onValueChange: (e) => G({ parent: e || void 0 }),
172
+ onValueChange: (e) => J({ parent: e || void 0 }),
173
173
  placeholder: m("parentProject"),
174
174
  "aria-label": m("parentProject"),
175
- trigger: /* @__PURE__ */ R(D, {
175
+ trigger: /* @__PURE__ */ z(O, {
176
176
  variant: "outline",
177
177
  size: "sm",
178
- className: H ? "border-(--theme-link) text-(--theme-app)" : void 0,
179
- children: H ? m("underProject", { name: H.name }) : m("parentProject")
178
+ className: U ? "border-(--theme-link) text-(--theme-app)" : void 0,
179
+ children: U ? m("underProject", { name: U.name }) : m("parentProject")
180
180
  })
181
181
  })
182
182
  ]
183
183
  }),
184
- /* @__PURE__ */ z("div", {
184
+ /* @__PURE__ */ B("div", {
185
185
  className: "flex min-h-0 flex-1",
186
- children: [/* @__PURE__ */ R("div", {
186
+ children: [/* @__PURE__ */ z("div", {
187
187
  className: "min-h-0 min-w-0 flex-1 overflow-auto",
188
- children: W.length === 0 ? /* @__PURE__ */ R("div", {
188
+ children: K.length === 0 ? /* @__PURE__ */ z("div", {
189
189
  className: "p-6",
190
- children: /* @__PURE__ */ R(O, {
191
- icon: /* @__PURE__ */ R(d, {}),
192
- title: p.status || p.health ? m("noProjectsWithStatus") : m(C === "templates" ? "noTemplates" : "noProjects"),
193
- ...!p.status && !p.health && { description: m(C === "templates" ? "noTemplatesDescription" : "noProjectsDescription") },
194
- ...E && !p.status && !p.health && C !== "templates" && { action: /* @__PURE__ */ R(D, {
190
+ children: /* @__PURE__ */ z(se, {
191
+ icon: /* @__PURE__ */ z(d, {}),
192
+ title: m(q ? "noProjectsWithStatus" : C === "templates" ? "noTemplates" : "noProjects"),
193
+ ...!q && { description: m(C === "templates" ? "noTemplatesDescription" : "noProjectsDescription") },
194
+ ...D && !q && C !== "templates" && { action: /* @__PURE__ */ z(O, {
195
195
  type: "button",
196
196
  variant: "primary",
197
- onClick: () => M(!0),
197
+ onClick: () => A(!0),
198
198
  children: m("newProject")
199
199
  }) }
200
200
  })
201
- }) : C === "timeline" ? /* @__PURE__ */ R(ge, {
201
+ }) : C === "timeline" ? /* @__PURE__ */ z(ge, {
202
202
  workspace: t,
203
- projects: W,
204
- rowProps: Y
205
- }) : /* @__PURE__ */ R(pe, {
206
- projects: W,
207
- rowProps: Y
203
+ projects: K,
204
+ rowProps: Q
205
+ }) : /* @__PURE__ */ z(pe, {
206
+ projects: K,
207
+ rowProps: Q
208
208
  })
209
- }), /* @__PURE__ */ R(_e, {
209
+ }), /* @__PURE__ */ z(ve, {
210
210
  workspace: t,
211
211
  projects: T,
212
212
  health: p.health,
213
- onHealth: (e) => G({ health: e === p.health ? void 0 : e })
213
+ onHealth: (e) => J({ health: e === p.health ? void 0 : e })
214
214
  })]
215
215
  }),
216
- j && /* @__PURE__ */ R(ae, {
216
+ k && /* @__PURE__ */ z(ae, {
217
217
  workspace: t,
218
218
  teamId: v?.id,
219
- onClose: () => M(!1)
219
+ onClose: () => A(!1)
220
220
  })
221
221
  ]
222
222
  });
223
223
  }
224
- var U = "@4xl:grid @4xl:grid-cols-[minmax(0,1fr)_10rem_2rem_2rem_6rem_8rem_2rem]";
224
+ var W = "@4xl:grid @4xl:grid-cols-[minmax(0,1fr)_10rem_2rem_2rem_6rem_8rem_2rem]";
225
225
  function pe({ projects: e, rowProps: t }) {
226
- let n = L("planning"), [r, i] = F(/* @__PURE__ */ new Set()), a = new Set([...r].flatMap((t) => S(e, t).map((e) => e.id))), o = (e) => i((t) => {
226
+ let n = R("planning"), [r, i] = I(/* @__PURE__ */ new Set()), a = new Set([...r].flatMap((t) => S(e, t).map((e) => e.id))), o = (e) => i((t) => {
227
227
  let n = new Set(t);
228
228
  return n.delete(e) || n.add(e), n;
229
229
  });
230
- return /* @__PURE__ */ z("div", {
230
+ return /* @__PURE__ */ B("div", {
231
231
  className: "@container",
232
- children: [/* @__PURE__ */ z("div", {
233
- className: `hidden h-8 items-center gap-3 border-b border-border px-4 text-xs text-muted-foreground md:px-5 ${U}`,
232
+ children: [/* @__PURE__ */ B("div", {
233
+ className: `hidden h-8 items-center gap-3 border-b border-border px-4 text-xs text-muted-foreground md:px-5 ${W}`,
234
234
  children: [
235
- /* @__PURE__ */ R("span", { children: n("name") }),
236
- /* @__PURE__ */ R("span", { children: n("healthLabel") }),
237
- /* @__PURE__ */ R(M, {
235
+ /* @__PURE__ */ z("span", { children: n("name") }),
236
+ /* @__PURE__ */ z("span", { children: n("healthLabel") }),
237
+ /* @__PURE__ */ z(A, {
238
238
  content: n("priority"),
239
- children: /* @__PURE__ */ R("span", { children: /* @__PURE__ */ R("span", {
239
+ children: /* @__PURE__ */ z("span", { children: /* @__PURE__ */ z("span", {
240
240
  className: "sr-only",
241
241
  children: n("priority")
242
242
  }) })
243
243
  }),
244
- /* @__PURE__ */ R(M, {
244
+ /* @__PURE__ */ z(A, {
245
245
  content: n("lead"),
246
- children: /* @__PURE__ */ R("span", { children: /* @__PURE__ */ R("span", {
246
+ children: /* @__PURE__ */ z("span", { children: /* @__PURE__ */ z("span", {
247
247
  className: "sr-only",
248
248
  children: n("lead")
249
249
  }) })
250
250
  }),
251
- /* @__PURE__ */ R("span", { children: n("targetDate") }),
252
- /* @__PURE__ */ R("span", { children: n("progressTitle") }),
253
- /* @__PURE__ */ R("span", {})
251
+ /* @__PURE__ */ z("span", { children: n("targetDate") }),
252
+ /* @__PURE__ */ z("span", { children: n("progressTitle") }),
253
+ /* @__PURE__ */ z("span", {})
254
254
  ]
255
- }), /* @__PURE__ */ R("ul", { children: x(e).filter((e) => !a.has(e.project.id)).map((e) => /* @__PURE__ */ R(G, {
255
+ }), /* @__PURE__ */ z("ul", { children: x(e).filter((e) => !a.has(e.project.id)).map((e) => /* @__PURE__ */ z(K, {
256
256
  ...t(e.project),
257
257
  depth: e.depth,
258
258
  childCount: e.children,
@@ -261,124 +261,124 @@ function pe({ projects: e, rowProps: t }) {
261
261
  }, e.project.id)) })]
262
262
  });
263
263
  }
264
- function W({ project: e }) {
265
- return e.icon || e.color ? /* @__PURE__ */ R(C, {
264
+ function G({ project: e }) {
265
+ return e.icon || e.color ? /* @__PURE__ */ z(C, {
266
266
  icon: e.icon ?? "",
267
267
  color: e.color ?? "",
268
268
  name: e.name
269
- }) : /* @__PURE__ */ R(d, { className: "size-4 text-muted-foreground" });
269
+ }) : /* @__PURE__ */ z(d, { className: "size-4 text-muted-foreground" });
270
270
  }
271
- function G({ workspace: e, project: n, onContextMenu: r, menu: i, depth: a = 0, childCount: o = 0, folded: s = !1, onFold: l }) {
272
- let d = L("planning"), f = L("common"), x = h(), S = p(), { person: C } = m(e), w = n.lead ? C(n.lead) : void 0, T = y(n);
273
- return /* @__PURE__ */ z("li", {
271
+ function K({ workspace: e, project: n, onContextMenu: r, menu: i, depth: a = 0, childCount: o = 0, folded: s = !1, onFold: l }) {
272
+ let d = R("planning"), f = R("common"), x = h(), S = p(), { person: C } = m(e), w = n.lead ? C(n.lead) : void 0, T = y(n);
273
+ return /* @__PURE__ */ B("li", {
274
274
  className: "group flex items-center border-b border-border pr-2 hover:bg-muted/60",
275
275
  children: [
276
- /* @__PURE__ */ R("span", {
276
+ /* @__PURE__ */ z("span", {
277
277
  className: "flex shrink-0 justify-end pl-2 md:pl-3",
278
278
  style: { width: `${a * 1.25 + 2}rem` },
279
- children: o > 0 && /* @__PURE__ */ R("button", {
279
+ children: o > 0 && /* @__PURE__ */ z("button", {
280
280
  type: "button",
281
281
  onClick: l,
282
282
  "aria-expanded": !s,
283
283
  "aria-label": d(s ? "showSubProjects" : "hideSubProjects", { name: n.name }),
284
284
  className: "rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground",
285
- children: /* @__PURE__ */ R(c, { className: `size-3.5 transition-transform ${s ? "-rotate-90" : ""}` })
285
+ children: /* @__PURE__ */ z(c, { className: `size-3.5 transition-transform ${s ? "-rotate-90" : ""}` })
286
286
  })
287
287
  }),
288
- /* @__PURE__ */ z(t, {
288
+ /* @__PURE__ */ B(t, {
289
289
  to: "/$workspace/projects/$projectId",
290
290
  params: {
291
291
  workspace: e,
292
292
  projectId: b(n)
293
293
  },
294
294
  onContextMenu: r,
295
- className: `flex min-w-0 flex-1 flex-wrap items-center gap-x-3 gap-y-1 py-2.5 pl-1 ${U}`,
295
+ className: `flex min-w-0 flex-1 flex-wrap items-center gap-x-3 gap-y-1 py-2.5 pl-1 ${W}`,
296
296
  children: [
297
- /* @__PURE__ */ z("span", {
297
+ /* @__PURE__ */ B("span", {
298
298
  className: "flex min-w-0 basis-full items-center gap-2.5 @4xl:basis-auto",
299
- children: [/* @__PURE__ */ R(W, { project: n }), /* @__PURE__ */ z("span", {
299
+ children: [/* @__PURE__ */ z(G, { project: n }), /* @__PURE__ */ B("span", {
300
300
  className: "min-w-0",
301
- children: [/* @__PURE__ */ R("span", {
301
+ children: [/* @__PURE__ */ z("span", {
302
302
  className: "block truncate text-sm font-medium",
303
303
  children: n.name
304
- }), n.summary && /* @__PURE__ */ R("span", {
304
+ }), n.summary && /* @__PURE__ */ z("span", {
305
305
  className: "block truncate text-xs text-muted-foreground",
306
306
  children: n.summary
307
307
  })]
308
308
  })]
309
309
  }),
310
- /* @__PURE__ */ z("span", {
310
+ /* @__PURE__ */ B("span", {
311
311
  className: "flex items-center gap-1.5 whitespace-nowrap text-xs text-muted-foreground",
312
- children: [/* @__PURE__ */ R(g, { state: T }), d(`health.${T}`)]
312
+ children: [/* @__PURE__ */ z(g, { state: T }), d(`health.${T}`)]
313
313
  }),
314
- /* @__PURE__ */ R(M, {
314
+ /* @__PURE__ */ z(A, {
315
315
  content: S[n.priority],
316
- children: /* @__PURE__ */ R("span", {
316
+ children: /* @__PURE__ */ z("span", {
317
317
  role: "img",
318
318
  "aria-label": S[n.priority],
319
319
  className: "flex",
320
- children: /* @__PURE__ */ R(u, { priority: n.priority })
320
+ children: /* @__PURE__ */ z(u, { priority: n.priority })
321
321
  })
322
322
  }),
323
- /* @__PURE__ */ R("span", {
323
+ /* @__PURE__ */ z("span", {
324
324
  className: "flex",
325
- children: w && /* @__PURE__ */ R(M, {
325
+ children: w && /* @__PURE__ */ z(A, {
326
326
  content: d("leadIs", { name: w.name }),
327
- children: /* @__PURE__ */ R("span", { children: /* @__PURE__ */ R(E, {
327
+ children: /* @__PURE__ */ z("span", { children: /* @__PURE__ */ z(D, {
328
328
  name: w.name,
329
329
  src: w.avatarUrl,
330
330
  size: "sm"
331
331
  }) })
332
332
  })
333
333
  }),
334
- /* @__PURE__ */ R("span", {
334
+ /* @__PURE__ */ z("span", {
335
335
  className: "text-xs text-muted-foreground tabular-nums",
336
336
  children: n.targetDate ? x.day(n.targetDate) : ""
337
337
  }),
338
- /* @__PURE__ */ R("span", { children: /* @__PURE__ */ R(_, {
338
+ /* @__PURE__ */ z("span", { children: /* @__PURE__ */ z(_, {
339
339
  progress: o > 0 ? n.treeProgress : n.progress,
340
340
  compact: !0
341
341
  }) }),
342
- /* @__PURE__ */ R(M, {
342
+ /* @__PURE__ */ z(A, {
343
343
  content: d(`status.${n.status}`),
344
- children: /* @__PURE__ */ R("span", {
344
+ children: /* @__PURE__ */ z("span", {
345
345
  role: "img",
346
346
  "aria-label": d(`status.${n.status}`),
347
347
  className: "flex",
348
- children: /* @__PURE__ */ R(v, { status: n.status })
348
+ children: /* @__PURE__ */ z(v, { status: n.status })
349
349
  })
350
350
  })
351
351
  ]
352
352
  }),
353
- /* @__PURE__ */ R(V, {
353
+ /* @__PURE__ */ z(H, {
354
354
  items: i,
355
355
  label: f("moreActionsFor", { name: n.name })
356
356
  })
357
357
  ]
358
358
  });
359
359
  }
360
- var K = 864e5, q = 5, J = 64, Y = 256, X = 56, Z = (e) => Date.parse(`${e}T00:00:00Z`), Q = (e) => {
360
+ var q = 864e5, J = 5, Y = 64, X = 256, Z = 56, Q = (e) => Date.parse(`${e}T00:00:00Z`), $ = (e) => {
361
361
  let t = new Date(e);
362
362
  return Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), 1);
363
363
  }, me = () => {
364
364
  let e = /* @__PURE__ */ new Date();
365
365
  return Date.UTC(e.getFullYear(), e.getMonth(), e.getDate());
366
- }, he = (e) => e - (new Date(e).getUTCDay() + 6) % 7 * K;
366
+ }, he = (e) => e - (new Date(e).getUTCDay() + 6) % 7 * q;
367
367
  function ge({ workspace: e, projects: n, rowProps: r }) {
368
- let i = L("planning"), a = I(), o = P(null), [s, c] = F({
368
+ let i = R("planning"), a = L(), o = F(null), [s, c] = I({
369
369
  left: 0,
370
370
  width: 0
371
371
  }), l = me(), u = n.map((e) => {
372
- let t = e.targetDate ? Z(e.targetDate) : void 0;
372
+ let t = e.targetDate ? Q(e.targetDate) : void 0;
373
373
  return {
374
374
  p: e,
375
- start: e.startDate ? Z(e.startDate) : t === void 0 ? void 0 : Math.min(Date.parse(e.createdAt), t),
375
+ start: e.startDate ? Q(e.startDate) : t === void 0 ? void 0 : Math.min(Date.parse(e.createdAt), t),
376
376
  end: t
377
377
  };
378
- }), d = u.flatMap((e) => [e.start, e.end].filter((e) => e !== void 0)), f = Q(Math.min(l - 90 * K, ...d)), p = Q(Math.max(l + 300 * K, ...d) + 40 * K), m = (e) => (e - f) / K * q, h = m(p), g = [];
379
- for (let e = f; e < p; e = Q(e + 32 * K)) g.push(e);
378
+ }), d = u.flatMap((e) => [e.start, e.end].filter((e) => e !== void 0)), f = $(Math.min(l - 90 * q, ...d)), p = $(Math.max(l + 300 * q, ...d) + 40 * q), m = (e) => (e - f) / q * J, h = m(p), g = [];
379
+ for (let e = f; e < p; e = $(e + 32 * q)) g.push(e);
380
380
  let _ = [];
381
- for (let e = he(f) + 7 * K; e < p; e += 7 * K) _.push(e);
381
+ for (let e = he(f) + 7 * q; e < p; e += 7 * q) _.push(e);
382
382
  let v = (e, t) => a.dateTime(new Date(e), {
383
383
  ...t,
384
384
  timeZone: "UTC"
@@ -392,48 +392,48 @@ function ge({ workspace: e, projects: n, rowProps: r }) {
392
392
  let e = o.current;
393
393
  e && c({
394
394
  left: e.scrollLeft,
395
- width: e.clientWidth - Y
395
+ width: e.clientWidth - X
396
396
  });
397
397
  }, S = (e = "smooth") => {
398
398
  let t = o.current;
399
399
  t && t.scrollTo({
400
- left: m(l) - (t.clientWidth - Y) / 2,
400
+ left: m(l) - (t.clientWidth - X) / 2,
401
401
  behavior: e
402
402
  });
403
403
  };
404
- return N(() => (S("instant"), x(), window.addEventListener("resize", x), () => window.removeEventListener("resize", x)), []), /* @__PURE__ */ R("div", {
404
+ return N(() => (S("instant"), x(), window.addEventListener("resize", x), () => window.removeEventListener("resize", x)), []), /* @__PURE__ */ z("div", {
405
405
  ref: o,
406
406
  onScroll: x,
407
407
  className: "relative h-full min-h-0 overflow-auto",
408
- children: /* @__PURE__ */ z("div", {
408
+ children: /* @__PURE__ */ B("div", {
409
409
  className: "relative",
410
410
  style: {
411
- width: h + Y,
411
+ width: h + X,
412
412
  minHeight: "100%"
413
413
  },
414
414
  children: [
415
- /* @__PURE__ */ R("div", {
415
+ /* @__PURE__ */ z("div", {
416
416
  "aria-hidden": "true",
417
417
  className: "pointer-events-none sticky left-0 z-[2] float-left -mb-[100vh] h-full min-h-[100vh] border-r border-border bg-background",
418
- style: { width: Y }
418
+ style: { width: X }
419
419
  }),
420
- /* @__PURE__ */ z("div", {
420
+ /* @__PURE__ */ B("div", {
421
421
  className: "sticky top-0 z-[3] flex border-b border-border bg-background",
422
- style: { height: X },
423
- children: [/* @__PURE__ */ R("div", {
422
+ style: { height: Z },
423
+ children: [/* @__PURE__ */ z("div", {
424
424
  className: "sticky left-0 z-[3] flex shrink-0 items-end border-r border-border bg-background px-4 pb-2",
425
- style: { width: Y },
426
- children: /* @__PURE__ */ R(D, {
425
+ style: { width: X },
426
+ children: /* @__PURE__ */ z(O, {
427
427
  type: "button",
428
428
  size: "xs",
429
429
  onClick: () => S(),
430
430
  children: i("today")
431
431
  })
432
- }), /* @__PURE__ */ z("div", {
432
+ }), /* @__PURE__ */ B("div", {
433
433
  className: "relative",
434
434
  style: { width: h },
435
435
  children: [
436
- g.map((e) => /* @__PURE__ */ R("span", {
436
+ g.map((e) => /* @__PURE__ */ z("span", {
437
437
  className: "absolute top-2 pl-1.5 text-[11px] font-medium text-muted-foreground uppercase",
438
438
  style: { left: m(e) },
439
439
  children: v(e, {
@@ -441,12 +441,12 @@ function ge({ workspace: e, projects: n, rowProps: r }) {
441
441
  ...new Date(e).getUTCMonth() === 0 && { year: "numeric" }
442
442
  })
443
443
  }, e)),
444
- _.filter((e) => Math.abs(m(e) - m(l)) > 36).map((e) => /* @__PURE__ */ R("span", {
444
+ _.filter((e) => Math.abs(m(e) - m(l)) > 36).map((e) => /* @__PURE__ */ z("span", {
445
445
  className: "absolute bottom-2 -translate-x-1/2 text-[11px] text-muted-foreground tabular-nums",
446
446
  style: { left: m(e) },
447
447
  children: v(e, { day: "numeric" })
448
448
  }, e)),
449
- /* @__PURE__ */ R("span", {
449
+ /* @__PURE__ */ z("span", {
450
450
  className: "absolute bottom-1.5 z-[1] -translate-x-1/2 rounded-full bg-primary px-2 py-px text-[11px] font-medium text-primary-foreground uppercase tabular-nums",
451
451
  style: { left: m(l) },
452
452
  children: v(l, {
@@ -457,43 +457,43 @@ function ge({ workspace: e, projects: n, rowProps: r }) {
457
457
  ]
458
458
  })]
459
459
  }),
460
- _.map((e) => /* @__PURE__ */ R("div", {
460
+ _.map((e) => /* @__PURE__ */ z("div", {
461
461
  "aria-hidden": "true",
462
462
  className: "pointer-events-none absolute bottom-0 border-l border-dashed border-border/40",
463
463
  style: {
464
- left: Y + m(e),
465
- top: X
464
+ left: X + m(e),
465
+ top: Z
466
466
  }
467
467
  }, e)),
468
- g.map((e) => /* @__PURE__ */ R("div", {
468
+ g.map((e) => /* @__PURE__ */ z("div", {
469
469
  "aria-hidden": "true",
470
470
  className: "pointer-events-none absolute bottom-0 w-px bg-border/70",
471
471
  style: {
472
- left: Y + m(e),
473
- top: X
472
+ left: X + m(e),
473
+ top: Z
474
474
  }
475
475
  }, e)),
476
- /* @__PURE__ */ R("div", {
476
+ /* @__PURE__ */ z("div", {
477
477
  "aria-hidden": "true",
478
478
  className: "pointer-events-none absolute bottom-0 z-[1] w-px bg-primary",
479
479
  style: {
480
- left: Y + m(l),
481
- top: X
480
+ left: X + m(l),
481
+ top: Z
482
482
  }
483
483
  }),
484
- /* @__PURE__ */ R("ul", {
484
+ /* @__PURE__ */ z("ul", {
485
485
  className: "relative",
486
486
  children: u.map(({ p: n, start: i, end: a }) => {
487
- let o = i !== void 0 && a !== void 0, c = o ? m(i) : 0, u = o ? Math.max(m(a + K), c + 24) : 0, d = o && u < s.left, f = o && c > s.left + s.width, p = o ? Math.min(Math.max(m(l) - c, 0), u - c) : 0, g = Math.min(Math.max(s.left + 8 - c, 0), Math.max(u - c - 80, 0));
488
- return /* @__PURE__ */ z("li", {
487
+ let o = i !== void 0 && a !== void 0, c = o ? m(i) : 0, u = o ? Math.max(m(a + q), c + 24) : 0, d = o && u < s.left, f = o && c > s.left + s.width, p = o ? Math.min(Math.max(m(l) - c, 0), u - c) : 0, g = Math.min(Math.max(s.left + 8 - c, 0), Math.max(u - c - 80, 0));
488
+ return /* @__PURE__ */ B("li", {
489
489
  className: "group flex hover:bg-muted/40",
490
- style: { height: J },
491
- children: [/* @__PURE__ */ R($, { ...r(n) }), /* @__PURE__ */ z("div", {
490
+ style: { height: Y },
491
+ children: [/* @__PURE__ */ z(_e, { ...r(n) }), /* @__PURE__ */ B("div", {
492
492
  className: "relative",
493
493
  style: { width: h },
494
- children: [o && !d && !f && /* @__PURE__ */ R(M, {
494
+ children: [o && !d && !f && /* @__PURE__ */ z(A, {
495
495
  content: `${n.name}, ${y(i, a)}`,
496
- children: /* @__PURE__ */ z(t, {
496
+ children: /* @__PURE__ */ B(t, {
497
497
  to: "/$workspace/projects/$projectId",
498
498
  params: {
499
499
  workspace: e,
@@ -504,25 +504,25 @@ function ge({ workspace: e, projects: n, rowProps: r }) {
504
504
  left: c,
505
505
  width: u - c
506
506
  },
507
- children: [/* @__PURE__ */ R("span", {
507
+ children: [/* @__PURE__ */ z("span", {
508
508
  className: "block self-start truncate px-0.5 text-xs font-medium",
509
509
  style: {
510
510
  marginLeft: g,
511
511
  maxWidth: Math.max(h - c - g, u - c - g)
512
512
  },
513
513
  children: n.name
514
- }), /* @__PURE__ */ z("span", {
514
+ }), /* @__PURE__ */ B("span", {
515
515
  className: "relative block h-6 overflow-hidden rounded-md border border-border",
516
- children: [/* @__PURE__ */ R("span", {
516
+ children: [/* @__PURE__ */ z("span", {
517
517
  className: "absolute inset-y-0 left-0 bg-muted-foreground/20",
518
518
  style: { width: p }
519
- }), /* @__PURE__ */ R("span", {
519
+ }), /* @__PURE__ */ z("span", {
520
520
  className: "absolute inset-y-0 right-0 border-l border-dashed border-primary/50 bg-primary/10",
521
521
  style: { left: p }
522
522
  })]
523
523
  })]
524
524
  })
525
- }), (d || f) && /* @__PURE__ */ z(t, {
525
+ }), (d || f) && /* @__PURE__ */ B(t, {
526
526
  to: "/$workspace/projects/$projectId",
527
527
  params: {
528
528
  workspace: e,
@@ -534,12 +534,12 @@ function ge({ workspace: e, projects: n, rowProps: r }) {
534
534
  transform: "translate(-100%, -50%)"
535
535
  },
536
536
  children: [
537
- d && /* @__PURE__ */ R("span", {
537
+ d && /* @__PURE__ */ z("span", {
538
538
  "aria-hidden": "true",
539
539
  children: "←"
540
540
  }),
541
541
  y(i, a),
542
- f && /* @__PURE__ */ R("span", {
542
+ f && /* @__PURE__ */ z("span", {
543
543
  "aria-hidden": "true",
544
544
  children: "→"
545
545
  })
@@ -553,9 +553,9 @@ function ge({ workspace: e, projects: n, rowProps: r }) {
553
553
  })
554
554
  });
555
555
  }
556
- function $({ workspace: e, project: n, onContextMenu: r }) {
557
- let i = L("planning"), { person: a } = m(e), o = n.lead ? a(n.lead) : void 0, s = y(n);
558
- return /* @__PURE__ */ z(t, {
556
+ function _e({ workspace: e, project: n, onContextMenu: r }) {
557
+ let i = R("planning"), { person: a } = m(e), o = n.lead ? a(n.lead) : void 0, s = y(n);
558
+ return /* @__PURE__ */ B(t, {
559
559
  to: "/$workspace/projects/$projectId",
560
560
  params: {
561
561
  workspace: e,
@@ -563,22 +563,31 @@ function $({ workspace: e, project: n, onContextMenu: r }) {
563
563
  },
564
564
  onContextMenu: r,
565
565
  className: "sticky left-0 z-[2] flex shrink-0 items-center gap-2 border-r border-border bg-background px-4 group-hover:bg-muted",
566
- style: { width: Y },
566
+ style: { width: X },
567
567
  children: [
568
- /* @__PURE__ */ R(W, { project: n }),
569
- /* @__PURE__ */ R("span", {
568
+ /* @__PURE__ */ z(G, { project: n }),
569
+ /* @__PURE__ */ z("span", {
570
570
  className: "min-w-0 flex-1 truncate text-sm",
571
571
  children: n.name
572
572
  }),
573
- /* @__PURE__ */ R(M, {
573
+ /* @__PURE__ */ z(A, {
574
+ content: i(`status.${n.status}`),
575
+ children: /* @__PURE__ */ z("span", {
576
+ role: "img",
577
+ "aria-label": i(`status.${n.status}`),
578
+ className: "flex",
579
+ children: /* @__PURE__ */ z(v, { status: n.status })
580
+ })
581
+ }),
582
+ /* @__PURE__ */ z(A, {
574
583
  content: i(`health.${s}`),
575
- children: /* @__PURE__ */ R("span", {
584
+ children: /* @__PURE__ */ z("span", {
576
585
  role: "img",
577
586
  "aria-label": i(`health.${s}`),
578
- children: /* @__PURE__ */ R(g, { state: s })
587
+ children: /* @__PURE__ */ z(g, { state: s })
579
588
  })
580
589
  }),
581
- o && /* @__PURE__ */ R(E, {
590
+ o && /* @__PURE__ */ z(D, {
582
591
  name: o.name,
583
592
  src: o.avatarUrl,
584
593
  size: "xs",
@@ -587,12 +596,12 @@ function $({ workspace: e, project: n, onContextMenu: r }) {
587
596
  ]
588
597
  });
589
598
  }
590
- function _e({ workspace: e, projects: t, health: n, onHealth: r }) {
591
- let a = L("planning"), { data: o } = B(i(e)), { person: s } = m(e), [c, l] = F("health"), u = (e) => t.filter(e).length, d = "flex h-9 w-full items-center gap-2.5 rounded-md px-2 text-sm", f = [...new Set(t.map((e) => e.lead ?? ""))];
592
- return /* @__PURE__ */ z("aside", {
599
+ function ve({ workspace: e, projects: t, health: n, onHealth: r }) {
600
+ let a = R("planning"), { data: o } = V(i(e)), { person: s } = m(e), [c, l] = I("health"), u = (e) => t.filter(e).length, d = "flex h-9 w-full items-center gap-2.5 rounded-md px-2 text-sm", f = [...new Set(t.map((e) => e.lead ?? ""))];
601
+ return /* @__PURE__ */ B("aside", {
593
602
  "aria-label": a("breakdown"),
594
603
  className: "hidden w-72 shrink-0 overflow-y-auto border-l border-border p-3 xl:block",
595
- children: [/* @__PURE__ */ R(j, {
604
+ children: [/* @__PURE__ */ z(k, {
596
605
  variant: "segmented",
597
606
  size: "sm",
598
607
  label: a("breakdown"),
@@ -606,24 +615,24 @@ function _e({ workspace: e, projects: t, health: n, onHealth: r }) {
606
615
  })),
607
616
  value: c,
608
617
  onValueChange: l
609
- }), /* @__PURE__ */ z("ul", {
618
+ }), /* @__PURE__ */ B("ul", {
610
619
  className: "mt-2",
611
620
  children: [
612
621
  c === "health" && T.map((e) => ({
613
622
  h: e,
614
623
  n: u((t) => y(t) === e)
615
- })).filter(({ n: e }) => e > 0).map(({ h: e, n: t }) => /* @__PURE__ */ R("li", { children: /* @__PURE__ */ z("button", {
624
+ })).filter(({ n: e }) => e > 0).map(({ h: e, n: t }) => /* @__PURE__ */ z("li", { children: /* @__PURE__ */ B("button", {
616
625
  type: "button",
617
626
  "aria-pressed": n === e,
618
627
  onClick: () => r(e),
619
628
  className: `${d} hover:bg-muted aria-pressed:bg-muted`,
620
629
  children: [
621
- /* @__PURE__ */ R(g, { state: e }),
622
- /* @__PURE__ */ R("span", {
630
+ /* @__PURE__ */ z(g, { state: e }),
631
+ /* @__PURE__ */ z("span", {
623
632
  className: "flex-1 text-left",
624
633
  children: a(`health.${e}`)
625
634
  }),
626
- /* @__PURE__ */ R("span", {
635
+ /* @__PURE__ */ z("span", {
627
636
  className: "text-muted-foreground tabular-nums",
628
637
  children: t
629
638
  })
@@ -632,19 +641,19 @@ function _e({ workspace: e, projects: t, health: n, onHealth: r }) {
632
641
  c === "teams" && o.filter((e) => !e.archivedAt).map((e) => ({
633
642
  team: e,
634
643
  n: u((t) => t.teamIds.includes(e.id))
635
- })).filter(({ n: e }) => e > 0).map(({ team: e, n: t }) => /* @__PURE__ */ z("li", {
644
+ })).filter(({ n: e }) => e > 0).map(({ team: e, n: t }) => /* @__PURE__ */ B("li", {
636
645
  className: d,
637
646
  children: [
638
- /* @__PURE__ */ R(C, {
647
+ /* @__PURE__ */ z(C, {
639
648
  icon: e.icon,
640
649
  color: e.color,
641
650
  name: e.name
642
651
  }),
643
- /* @__PURE__ */ R("span", {
652
+ /* @__PURE__ */ z("span", {
644
653
  className: "flex-1 truncate",
645
654
  children: e.name
646
655
  }),
647
- /* @__PURE__ */ R("span", {
656
+ /* @__PURE__ */ z("span", {
648
657
  className: "text-muted-foreground tabular-nums",
649
658
  children: t
650
659
  })
@@ -652,20 +661,20 @@ function _e({ workspace: e, projects: t, health: n, onHealth: r }) {
652
661
  }, e.id)),
653
662
  c === "leads" && f.map((e) => {
654
663
  let t = e ? s(e) : void 0;
655
- return /* @__PURE__ */ z("li", {
664
+ return /* @__PURE__ */ B("li", {
656
665
  className: d,
657
666
  children: [
658
- t ? /* @__PURE__ */ R(E, {
667
+ t ? /* @__PURE__ */ z(D, {
659
668
  name: t.name,
660
669
  src: t.avatarUrl,
661
670
  size: "xs",
662
671
  decorative: !0
663
- }) : /* @__PURE__ */ R("span", { className: "size-4" }),
664
- /* @__PURE__ */ R("span", {
672
+ }) : /* @__PURE__ */ z("span", { className: "size-4" }),
673
+ /* @__PURE__ */ z("span", {
665
674
  className: "flex-1 truncate",
666
675
  children: t ? t.name : a("noLead")
667
676
  }),
668
- /* @__PURE__ */ R("span", {
677
+ /* @__PURE__ */ z("span", {
669
678
  className: "text-muted-foreground tabular-nums",
670
679
  children: u((t) => (t.lead ?? "") === e)
671
680
  })
@@ -676,4 +685,4 @@ function _e({ workspace: e, projects: t, health: n, onHealth: r }) {
676
685
  })]
677
686
  });
678
687
  }
679
- export { H as Projects };
688
+ export { U as Projects };