@parallelworks/tandem-web 0.183.0 → 0.185.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.
@@ -7,54 +7,56 @@ import { useNavigate as ie } from "../lib/router.js";
7
7
  import { useTime as ae } from "../lib/time.js";
8
8
  import { Editor as oe } from "./Editor.js";
9
9
  import { EntityIcon as i } from "./EntityIcon.js";
10
- import { IconUpload as a } from "./IconUpload.js";
11
- import { AddIcon as se, CalendarIcon as ce, ChevronRightIcon as le, CloseIcon as o, PriorityIcon as s, ProjectIcon as ue, UserIcon as de, UsersIcon as c, usePriorityNames as fe } from "./icons.js";
12
- import { ProjectStatusIcon as l } from "./Planning.js";
13
- import { Avatar as u, Button as d, Card as pe, Combobox as f, DatePicker as me, ErrorText as he, IconButton as p, Modal as ge, ModalTitle as _e, Select as m, buttonClasses as h } from "@parallelworks/ui";
14
- import { useState as g } from "react";
15
- import { useErrorMessage as ve } from "@parallelworks/problem/react";
16
- import { useTranslations as _ } from "use-intl";
17
- import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
18
- import { useQuery as x, useQueryClient as ye } from "@tanstack/react-query";
10
+ import { IconUpload as se } from "./IconUpload.js";
11
+ import { AddIcon as ce, CalendarIcon as le, ChevronRightIcon as ue, CloseIcon as a, PriorityIcon as o, ProjectIcon as de, UserIcon as fe, UsersIcon as s, usePriorityNames as pe } from "./icons.js";
12
+ import { ParentProjectSelect as me } from "./ParentProjectSelect.js";
13
+ import { ProjectStatusIcon as c } from "./Planning.js";
14
+ import { Avatar as l, Button as u, Card as he, Combobox as d, DatePicker as ge, ErrorText as _e, IconButton as f, Modal as ve, ModalTitle as ye, Select as p, buttonClasses as m } from "@parallelworks/ui";
15
+ import { useState as h } from "react";
16
+ import { useErrorMessage as be } from "@parallelworks/problem/react";
17
+ import { useTranslations as g } from "use-intl";
18
+ import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
19
+ import { useQuery as b, useQueryClient as xe } from "@tanstack/react-query";
19
20
  // src/components/NewProjectDialog.tsx
20
- var S = h({ size: "sm" });
21
- function C({ workspace: h, teamId: C, onClose: w }) {
22
- let T = _("planning"), E = _("common"), be = ve(), xe = ae(), D = fe(), Se = ye(), O = ie(), { members: k, person: Ce } = te(h), { data: A } = x(ee(h)), { data: we = [] } = x(n(h)), { data: Te = [] } = x(r(h)), j = Te.filter((e) => e.template), [M, Ee] = g(""), [N, De] = g(""), [P, Oe] = g(""), [F, ke] = g(""), [I, Ae] = g(""), [L, je] = g("planned"), [R, Me] = g(0), [z, Ne] = g(""), [B, Pe] = g([]), [V, Fe] = g(C ? [C] : []), [H, Ie] = g(""), [U, Le] = g(""), [W, G] = g([]), [K, q] = g(null), [J, Y] = g(!1), [Re, X] = g(null), Z = we.filter((e) => !e.archivedAt), Q = (e, t, n) => /* @__PURE__ */ y(me, {
21
+ var x = m({ size: "sm" });
22
+ function S({ workspace: m, teamId: S, parentId: Se, onClose: C }) {
23
+ let w = g("planning"), T = g("common"), Ce = be(), we = ae(), E = pe(), Te = xe(), Ee = ie(), { members: D, person: O } = te(m), { data: k } = b(ee(m)), { data: De = [] } = b(n(m)), { data: Oe = [] } = b(r(m)), A = Oe.filter((e) => e.template), [j, ke] = h(""), [M, Ae] = h(""), [N, je] = h(""), [P, Me] = h(""), [F, Ne] = h(""), [I, Pe] = h("planned"), [L, Fe] = h(0), [R, Ie] = h(""), [z, Le] = h([]), [B, Re] = h(S ? [S] : []), [V, ze] = h(Se ?? ""), [H, Be] = h(""), [U, Ve] = h(""), [W, G] = h([]), [K, q] = h(null), [J, Y] = h(!1), [He, X] = h(null), Z = De.filter((e) => !e.archivedAt), Q = (e, t, n) => /* @__PURE__ */ v(ge, {
23
24
  value: t,
24
25
  onValueChange: n,
25
26
  "aria-label": e,
26
- trigger: /* @__PURE__ */ b("button", {
27
+ trigger: /* @__PURE__ */ y("button", {
27
28
  type: "button",
28
- className: S,
29
- children: [/* @__PURE__ */ y(ce, { className: "size-3.5 text-muted-foreground" }), /* @__PURE__ */ y("span", {
29
+ className: x,
30
+ children: [/* @__PURE__ */ v(le, { className: "size-3.5 text-muted-foreground" }), /* @__PURE__ */ v("span", {
30
31
  className: t ? "" : "text-muted-foreground",
31
- children: t ? xe.day(t) : e
32
+ children: t ? we.day(t) : e
32
33
  })]
33
34
  })
34
- }), ze = async (n) => {
35
- if (n.preventDefault(), P.trim()) {
35
+ }), Ue = async (n) => {
36
+ if (n.preventDefault(), N.trim()) {
36
37
  Y(!0), X(null);
37
38
  try {
38
39
  let n = t(await e.POST("/api/v1/workspaces/{workspace}/projects", {
39
- params: { path: { workspace: h } },
40
+ params: { path: { workspace: m } },
40
41
  body: {
41
- name: P.trim(),
42
- status: L,
43
- ...M && { from: M },
44
- ...F.trim() && { summary: F.trim() },
45
- ...I && { description: I },
46
- ...R && { priority: R },
47
- ...N && { icon: N },
48
- ...z && { lead: z },
49
- ...B.length > 0 && { members: B },
50
- ...V.length > 0 && { teamIds: V },
42
+ name: N.trim(),
43
+ status: I,
44
+ ...j && { from: j },
45
+ ...P.trim() && { summary: P.trim() },
46
+ ...F && { description: F },
47
+ ...L && { priority: L },
48
+ ...M && { icon: M },
49
+ ...R && { lead: R },
50
+ ...z.length > 0 && { members: z },
51
+ ...B.length > 0 && { teamIds: B },
51
52
  ...H && { startDate: H },
52
- ...U && { targetDate: U }
53
+ ...U && { targetDate: U },
54
+ ...V && { parentId: V }
53
55
  }
54
56
  }));
55
57
  for (let r of W.filter((e) => e.name.trim())) t(await e.POST("/api/v1/workspaces/{workspace}/projects/{projectId}/milestones", {
56
58
  params: { path: {
57
- workspace: h,
59
+ workspace: m,
58
60
  projectId: n.id
59
61
  } },
60
62
  body: {
@@ -62,105 +64,105 @@ function C({ workspace: h, teamId: C, onClose: w }) {
62
64
  ...r.targetDate && { targetDate: r.targetDate }
63
65
  }
64
66
  }));
65
- Se.invalidateQueries({ queryKey: r(h).queryKey }), w(), O({
67
+ Te.invalidateQueries({ queryKey: r(m).queryKey }), C(), Ee({
66
68
  to: "/$workspace/projects/$projectId",
67
69
  params: {
68
- workspace: h,
70
+ workspace: m,
69
71
  projectId: re(n)
70
72
  }
71
73
  });
72
74
  } catch (e) {
73
- X(be(e));
75
+ X(Ce(e));
74
76
  } finally {
75
77
  Y(!1);
76
78
  }
77
79
  }
78
- }, $ = z ? Ce(z) : void 0;
79
- return /* @__PURE__ */ y(ge, {
80
+ }, $ = R ? O(R) : void 0;
81
+ return /* @__PURE__ */ v(ve, {
80
82
  open: !0,
81
- onClose: w,
83
+ onClose: C,
82
84
  className: "flex max-h-[90vh] w-full max-w-3xl flex-col",
83
- children: /* @__PURE__ */ b("form", {
84
- onSubmit: ze,
85
+ children: /* @__PURE__ */ y("form", {
86
+ onSubmit: Ue,
85
87
  className: "flex min-h-0 flex-1 flex-col",
86
88
  children: [
87
- /* @__PURE__ */ b("div", {
89
+ /* @__PURE__ */ y("div", {
88
90
  className: "flex items-center gap-2 px-5 pt-4 text-sm",
89
91
  children: [
90
- A && /* @__PURE__ */ b("span", {
92
+ k && /* @__PURE__ */ y("span", {
91
93
  className: "flex items-center gap-1.5 rounded-md border border-border px-2 py-0.5",
92
- children: [/* @__PURE__ */ y(i, {
93
- icon: A.icon,
94
- color: A.color,
95
- name: A.name
96
- }), A.name]
94
+ children: [/* @__PURE__ */ v(i, {
95
+ icon: k.icon,
96
+ color: k.color,
97
+ name: k.name
98
+ }), k.name]
97
99
  }),
98
- /* @__PURE__ */ y(le, { className: "size-3.5 text-muted-foreground" }),
99
- /* @__PURE__ */ y(_e, {
100
+ /* @__PURE__ */ v(ue, { className: "size-3.5 text-muted-foreground" }),
101
+ /* @__PURE__ */ v(ye, {
100
102
  className: "text-sm",
101
- children: T("newProject")
103
+ children: w("newProject")
102
104
  }),
103
- /* @__PURE__ */ y(p, {
105
+ /* @__PURE__ */ v(f, {
104
106
  variant: "ghost",
105
107
  size: "sm",
106
- icon: /* @__PURE__ */ y(o, {}),
107
- label: E("close"),
108
- onClick: w,
108
+ icon: /* @__PURE__ */ v(a, {}),
109
+ label: T("close"),
110
+ onClick: C,
109
111
  className: "ml-auto"
110
112
  })
111
113
  ]
112
114
  }),
113
- /* @__PURE__ */ b("div", {
115
+ /* @__PURE__ */ y("div", {
114
116
  className: "min-h-0 flex-1 overflow-y-auto px-5 pt-4 pb-2",
115
117
  children: [
116
- /* @__PURE__ */ y(a, {
117
- workspace: h,
118
- icon: N,
119
- name: P || T("project"),
120
- onChange: De,
118
+ /* @__PURE__ */ v(se, {
119
+ workspace: m,
120
+ icon: M,
121
+ name: N || w("project"),
122
+ onChange: Ae,
121
123
  size: 40
122
124
  }),
123
- /* @__PURE__ */ y("input", {
124
- value: P,
125
- onChange: (e) => Oe(e.target.value),
125
+ /* @__PURE__ */ v("input", {
126
+ value: N,
127
+ onChange: (e) => je(e.target.value),
126
128
  autoFocus: !0,
127
129
  required: !0,
128
130
  maxLength: 200,
129
- "aria-label": T("projectName"),
130
- placeholder: T("projectName"),
131
+ "aria-label": w("projectName"),
132
+ placeholder: w("projectName"),
131
133
  className: "mt-3 w-full bg-transparent text-2xl font-semibold tracking-tight outline-none placeholder:text-muted-foreground/60"
132
134
  }),
133
- /* @__PURE__ */ y("input", {
134
- value: F,
135
- onChange: (e) => ke(e.target.value),
135
+ /* @__PURE__ */ v("input", {
136
+ value: P,
137
+ onChange: (e) => Me(e.target.value),
136
138
  maxLength: 200,
137
- "aria-label": T("summary"),
138
- placeholder: T("summaryPlaceholder"),
139
+ "aria-label": w("summary"),
140
+ placeholder: w("summaryPlaceholder"),
139
141
  className: "mt-1 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"
140
142
  }),
141
- /* @__PURE__ */ y("div", {
143
+ /* @__PURE__ */ v("div", {
142
144
  className: "mt-4",
143
- children: /* @__PURE__ */ y(oe, {
145
+ children: /* @__PURE__ */ v(oe, {
144
146
  value: "",
145
- onChange: Ae,
146
- placeholder: T("projectBrief"),
147
- label: E("description"),
147
+ onChange: Ne,
148
+ placeholder: w("projectBrief"),
149
+ label: T("description"),
148
150
  className: "min-h-32"
149
151
  })
150
152
  }),
151
- /* @__PURE__ */ b(pe, {
153
+ /* @__PURE__ */ y(he, {
152
154
  size: "fill",
153
155
  padding: "none",
154
- render: /* @__PURE__ */ y("section", {}),
156
+ render: /* @__PURE__ */ v("section", {}),
155
157
  className: "mt-4",
156
- children: [/* @__PURE__ */ b("div", {
158
+ children: [/* @__PURE__ */ y("div", {
157
159
  className: "flex h-10 items-center px-3",
158
- children: [/* @__PURE__ */ y("h2", {
160
+ children: [/* @__PURE__ */ v("h2", {
159
161
  className: "text-sm font-medium",
160
- children: T("milestones")
161
- }), /* @__PURE__ */ y(p, {
162
- icon: /* @__PURE__ */ y(se, { className: "size-3.5" }),
163
- label: T("addMilestone"),
162
+ children: w("milestones")
163
+ }), /* @__PURE__ */ v(f, {
164
+ icon: /* @__PURE__ */ v(ce, { className: "size-3.5" }),
165
+ label: w("addMilestone"),
164
166
  size: "xs",
165
167
  onClick: () => G((e) => [...e, {
166
168
  key: Date.now(),
@@ -169,29 +171,29 @@ function C({ workspace: h, teamId: C, onClose: w }) {
169
171
  }]),
170
172
  className: "ml-auto"
171
173
  })]
172
- }), W.map((e) => /* @__PURE__ */ b("div", {
174
+ }), W.map((e) => /* @__PURE__ */ y("div", {
173
175
  className: "flex items-center gap-2 border-t border-border px-3 py-1.5",
174
176
  children: [
175
- /* @__PURE__ */ y("input", {
177
+ /* @__PURE__ */ v("input", {
176
178
  value: e.name,
177
179
  autoFocus: !0,
178
180
  onChange: (t) => G((n) => n.map((n) => n.key === e.key ? {
179
181
  ...n,
180
182
  name: t.target.value
181
183
  } : n)),
182
- "aria-label": T("milestoneName"),
183
- placeholder: T("milestoneName"),
184
+ "aria-label": w("milestoneName"),
185
+ placeholder: w("milestoneName"),
184
186
  className: "h-7 min-w-0 flex-1 bg-transparent text-sm outline-none"
185
187
  }),
186
- Q(T("targetDate"), e.targetDate, (t) => G((n) => n.map((n) => n.key === e.key ? {
188
+ Q(w("targetDate"), e.targetDate, (t) => G((n) => n.map((n) => n.key === e.key ? {
187
189
  ...n,
188
190
  targetDate: t
189
191
  } : n))),
190
- /* @__PURE__ */ y(p, {
192
+ /* @__PURE__ */ v(f, {
191
193
  variant: "ghost",
192
194
  size: "sm",
193
- icon: /* @__PURE__ */ y(o, {}),
194
- label: T("removeMilestone"),
195
+ icon: /* @__PURE__ */ v(a, {}),
196
+ label: w("removeMilestone"),
195
197
  onClick: () => G((t) => t.filter((t) => t.key !== e.key))
196
198
  })
197
199
  ]
@@ -199,116 +201,116 @@ function C({ workspace: h, teamId: C, onClose: w }) {
199
201
  })
200
202
  ]
201
203
  }),
202
- /* @__PURE__ */ b("div", {
204
+ /* @__PURE__ */ y("div", {
203
205
  className: "flex flex-wrap items-center gap-1.5 border-t border-border px-5 pt-3",
204
206
  children: [
205
- j.length > 0 && /* @__PURE__ */ y(m, {
206
- "aria-label": T("startFrom"),
207
- value: M,
208
- onValueChange: (e) => Ee(e ?? ""),
207
+ A.length > 0 && /* @__PURE__ */ v(p, {
208
+ "aria-label": w("startFrom"),
209
+ value: j,
210
+ onValueChange: (e) => ke(e ?? ""),
209
211
  items: [{
210
212
  value: "",
211
- label: T("blankProject")
212
- }, ...j.map((e) => ({
213
+ label: w("blankProject")
214
+ }, ...A.map((e) => ({
213
215
  value: e.id,
214
216
  label: e.name
215
217
  }))],
216
- trigger: /* @__PURE__ */ b("button", {
218
+ trigger: /* @__PURE__ */ y("button", {
217
219
  type: "button",
218
- className: S,
219
- children: [/* @__PURE__ */ y(ue, { className: "size-3.5 text-muted-foreground" }), M ? T("fromTemplate", { name: j.find((e) => e.id === M)?.name ?? "" }) : T("blankProject")]
220
+ className: x,
221
+ children: [/* @__PURE__ */ v(de, { className: "size-3.5 text-muted-foreground" }), j ? w("fromTemplate", { name: A.find((e) => e.id === j)?.name ?? "" }) : w("blankProject")]
220
222
  })
221
223
  }),
222
- /* @__PURE__ */ y(m, {
223
- "aria-label": T("statusLabel"),
224
- value: L,
225
- onValueChange: (e) => e && je(e),
224
+ /* @__PURE__ */ v(p, {
225
+ "aria-label": w("statusLabel"),
226
+ value: I,
227
+ onValueChange: (e) => e && Pe(e),
226
228
  items: ne.map((e) => ({
227
229
  value: e,
228
- label: T(`status.${e}`),
229
- icon: /* @__PURE__ */ y(l, { status: e })
230
+ label: w(`status.${e}`),
231
+ icon: /* @__PURE__ */ v(c, { status: e })
230
232
  })),
231
- trigger: /* @__PURE__ */ b("button", {
233
+ trigger: /* @__PURE__ */ y("button", {
232
234
  type: "button",
233
- className: S,
234
- children: [/* @__PURE__ */ y(l, { status: L }), T(`status.${L}`)]
235
+ className: x,
236
+ children: [/* @__PURE__ */ v(c, { status: I }), w(`status.${I}`)]
235
237
  })
236
238
  }),
237
- /* @__PURE__ */ y(m, {
238
- "aria-label": T("priority"),
239
- value: String(R),
240
- onValueChange: (e) => e && Me(Number(e)),
241
- items: D.map((e, t) => ({
239
+ /* @__PURE__ */ v(p, {
240
+ "aria-label": w("priority"),
241
+ value: String(L),
242
+ onValueChange: (e) => e && Fe(Number(e)),
243
+ items: E.map((e, t) => ({
242
244
  value: String(t),
243
245
  label: e,
244
- icon: /* @__PURE__ */ y(s, { priority: t })
246
+ icon: /* @__PURE__ */ v(o, { priority: t })
245
247
  })),
246
- trigger: /* @__PURE__ */ b("button", {
248
+ trigger: /* @__PURE__ */ y("button", {
247
249
  type: "button",
248
- className: S,
249
- children: [/* @__PURE__ */ y(s, { priority: R }), R ? D[R] : T("noPriority")]
250
+ className: x,
251
+ children: [/* @__PURE__ */ v(o, { priority: L }), L ? E[L] : w("noPriority")]
250
252
  })
251
253
  }),
252
- /* @__PURE__ */ y(f, {
253
- "aria-label": T("lead"),
254
- value: z,
255
- onValueChange: (e) => Ne(e ?? ""),
254
+ /* @__PURE__ */ v(d, {
255
+ "aria-label": w("lead"),
256
+ value: R,
257
+ onValueChange: (e) => Ie(e ?? ""),
256
258
  items: [{
257
259
  value: "",
258
- label: T("noLead")
259
- }, ...k.map((e) => ({
260
+ label: w("noLead")
261
+ }, ...D.map((e) => ({
260
262
  value: e.user.username,
261
263
  label: e.user.name,
262
- icon: /* @__PURE__ */ y(u, {
264
+ icon: /* @__PURE__ */ v(l, {
263
265
  name: e.user.name,
264
266
  src: e.user.avatarUrl,
265
267
  size: "xs",
266
268
  decorative: !0
267
269
  })
268
270
  }))],
269
- trigger: /* @__PURE__ */ y("button", {
271
+ trigger: /* @__PURE__ */ v("button", {
270
272
  type: "button",
271
- className: S,
272
- children: $ ? /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y(u, {
273
+ className: x,
274
+ children: $ ? /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(l, {
273
275
  name: $.name,
274
276
  src: $.avatarUrl,
275
277
  size: "xs",
276
278
  decorative: !0
277
- }), $.name] }) : /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y(de, { className: "size-3.5 text-muted-foreground" }), /* @__PURE__ */ y("span", {
279
+ }), $.name] }) : /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(fe, { className: "size-3.5 text-muted-foreground" }), /* @__PURE__ */ v("span", {
278
280
  className: "text-muted-foreground",
279
- children: T("lead")
281
+ children: w("lead")
280
282
  })] })
281
283
  })
282
284
  }),
283
- /* @__PURE__ */ y(f, {
285
+ /* @__PURE__ */ v(d, {
284
286
  open: K === "members",
285
287
  onOpenChange: (e) => q(e ? "members" : null),
286
288
  multiple: !0,
287
- items: k.map((e) => ({
289
+ items: D.map((e) => ({
288
290
  value: e.user.username,
289
291
  label: e.user.name,
290
- icon: /* @__PURE__ */ y(u, {
292
+ icon: /* @__PURE__ */ v(l, {
291
293
  name: e.user.name,
292
294
  src: e.user.avatarUrl,
293
295
  size: "xs",
294
296
  decorative: !0
295
297
  })
296
298
  })),
297
- value: B,
298
- onValueChange: Pe,
299
- placeholder: T("members"),
300
- trigger: /* @__PURE__ */ b("button", {
299
+ value: z,
300
+ onValueChange: Le,
301
+ placeholder: w("members"),
302
+ trigger: /* @__PURE__ */ y("button", {
301
303
  type: "button",
302
- className: S,
303
- children: [/* @__PURE__ */ y(c, { className: "size-3.5 text-muted-foreground" }), /* @__PURE__ */ y("span", {
304
- className: B.length ? "" : "text-muted-foreground",
305
- children: B.length ? T("memberCount", { count: B.length }) : T("members")
304
+ className: x,
305
+ children: [/* @__PURE__ */ v(s, { className: "size-3.5 text-muted-foreground" }), /* @__PURE__ */ v("span", {
306
+ className: z.length ? "" : "text-muted-foreground",
307
+ children: z.length ? w("memberCount", { count: z.length }) : w("members")
306
308
  })]
307
309
  })
308
310
  }),
309
- Q(T("startDate"), H, Ie),
310
- Q(T("targetDate"), U, Le),
311
- /* @__PURE__ */ y(f, {
311
+ Q(w("startDate"), H, Be),
312
+ Q(w("targetDate"), U, Ve),
313
+ /* @__PURE__ */ v(d, {
312
314
  open: K === "teams",
313
315
  onOpenChange: (e) => q(e ? "teams" : null),
314
316
  multiple: !0,
@@ -316,45 +318,50 @@ function C({ workspace: h, teamId: C, onClose: w }) {
316
318
  value: e.id,
317
319
  label: e.name,
318
320
  hint: e.key,
319
- icon: /* @__PURE__ */ y(i, {
321
+ icon: /* @__PURE__ */ v(i, {
320
322
  icon: e.icon,
321
323
  color: e.color,
322
324
  name: e.name
323
325
  })
324
326
  })),
325
- value: V,
326
- onValueChange: Fe,
327
- placeholder: T("teams"),
328
- trigger: /* @__PURE__ */ b("button", {
327
+ value: B,
328
+ onValueChange: Re,
329
+ placeholder: w("teams"),
330
+ trigger: /* @__PURE__ */ y("button", {
329
331
  type: "button",
330
- className: S,
331
- children: [/* @__PURE__ */ y(c, { className: "size-3.5 text-muted-foreground" }), /* @__PURE__ */ y("span", {
332
- className: V.length ? "" : "text-muted-foreground",
333
- children: V.length ? Z.filter((e) => V.includes(e.id)).map((e) => e.key).join(", ") : T("teams")
332
+ className: x,
333
+ children: [/* @__PURE__ */ v(s, { className: "size-3.5 text-muted-foreground" }), /* @__PURE__ */ v("span", {
334
+ className: B.length ? "" : "text-muted-foreground",
335
+ children: B.length ? Z.filter((e) => B.includes(e.id)).map((e) => e.key).join(", ") : w("teams")
334
336
  })]
335
337
  })
338
+ }),
339
+ /* @__PURE__ */ v(me, {
340
+ workspace: m,
341
+ value: V,
342
+ onChange: ze
336
343
  })
337
344
  ]
338
345
  }),
339
- /* @__PURE__ */ b("div", {
346
+ /* @__PURE__ */ y("div", {
340
347
  className: "flex items-center gap-2 px-5 py-3",
341
348
  children: [
342
- /* @__PURE__ */ y(he, {
349
+ /* @__PURE__ */ v(_e, {
343
350
  size: "md",
344
351
  className: "min-w-0 flex-1",
345
- children: Re
352
+ children: He
346
353
  }),
347
- /* @__PURE__ */ y(d, {
354
+ /* @__PURE__ */ v(u, {
348
355
  type: "button",
349
- onClick: w,
356
+ onClick: C,
350
357
  className: "ml-auto",
351
- children: E("cancel")
358
+ children: T("cancel")
352
359
  }),
353
- /* @__PURE__ */ y(d, {
360
+ /* @__PURE__ */ v(u, {
354
361
  type: "submit",
355
362
  variant: "primary",
356
- disabled: J || !P.trim(),
357
- children: T(J ? "creating" : "createProject")
363
+ disabled: J || !N.trim(),
364
+ children: w(J ? "creating" : "createProject")
358
365
  })
359
366
  ]
360
367
  })
@@ -362,4 +369,4 @@ function C({ workspace: h, teamId: C, onClose: w }) {
362
369
  })
363
370
  });
364
371
  }
365
- export { C as NewProjectDialog };
372
+ export { S as NewProjectDialog };
@@ -0,0 +1,35 @@
1
+ import { projectsQuery as e } from "../api/queries.js";
2
+ import { projectLevel as t, projectsUnder as n } from "../lib/projects.js";
3
+ import { ProjectIcon as r } from "./icons.js";
4
+ import { Combobox as i, buttonClasses as a } from "@parallelworks/ui";
5
+ import { useTranslations as o } from "use-intl";
6
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
7
+ import { useQuery as l } from "@tanstack/react-query";
8
+ // src/components/ParentProjectSelect.tsx
9
+ function u({ workspace: u, projectId: d, value: f, disabled: p, onChange: m }) {
10
+ let h = o("planning"), { data: g = [] } = l(e(u)), _ = new Set(d ? n(g, d).map((e) => e.id) : []), v = g.find((e) => e.id === f);
11
+ return /* @__PURE__ */ s(i, {
12
+ disabled: p,
13
+ items: [{
14
+ value: "",
15
+ label: h("noParentProject")
16
+ }, ...g.filter((e) => e.id !== d && !_.has(e.id) && !e.template && t(g, e.id) < 5).map((e) => ({
17
+ value: e.id,
18
+ label: e.name
19
+ }))],
20
+ value: f,
21
+ onValueChange: (e) => m(e ?? ""),
22
+ placeholder: h("parentProject"),
23
+ "aria-label": h("parentProject"),
24
+ trigger: /* @__PURE__ */ c("button", {
25
+ type: "button",
26
+ disabled: p,
27
+ className: a({ size: "sm" }),
28
+ children: [/* @__PURE__ */ s(r, { className: "size-3.5 text-muted-foreground" }), /* @__PURE__ */ s("span", {
29
+ className: v ? "" : "text-muted-foreground",
30
+ children: v ? h("underProject", { name: v.name }) : h("parentProject")
31
+ })]
32
+ })
33
+ });
34
+ }
35
+ export { u as ParentProjectSelect };
@@ -2,34 +2,37 @@ import { api as e, unwrap as t } from "../api/client.js";
2
2
  import { projectAccessQuery as n } from "../api/queries.js";
3
3
  import { useCan as r } from "../lib/roles.js";
4
4
  import { AccessGrants as i } from "./AccessGrants.js";
5
- import { Button as a, Modal as o, ModalTitle as s } from "@parallelworks/ui";
6
- import { Suspense as c } from "react";
7
- import { useTranslations as l } from "use-intl";
8
- import { jsx as u, jsxs as d } from "react/jsx-runtime";
9
- import { useQueryClient as f, useSuspenseQuery as p } from "@tanstack/react-query";
5
+ import { Button as a, Loader as o, Modal as s, ModalTitle as c } from "@parallelworks/ui";
6
+ import { Suspense as l } from "react";
7
+ import { useTranslations as u } from "use-intl";
8
+ import { jsx as d, jsxs as f } from "react/jsx-runtime";
9
+ import { useQueryClient as p, useSuspenseQuery as m } from "@tanstack/react-query";
10
10
  // src/components/ProjectAccess.tsx
11
- function m({ workspace: e, project: t, onClose: n }) {
12
- let r = l("projectAccess"), i = l("common");
13
- return /* @__PURE__ */ d(o, {
11
+ function h({ workspace: e, project: t, onClose: n }) {
12
+ let r = u("projectAccess"), i = u("common");
13
+ return /* @__PURE__ */ f(s, {
14
14
  open: !0,
15
15
  onClose: n,
16
16
  className: "w-full max-w-2xl p-5",
17
17
  children: [
18
- /* @__PURE__ */ u(s, {
18
+ /* @__PURE__ */ d(c, {
19
19
  className: "text-sm font-semibold",
20
20
  children: r("title", { name: t.name })
21
21
  }),
22
- /* @__PURE__ */ u("p", {
22
+ /* @__PURE__ */ d("p", {
23
23
  className: "mt-1 mb-4 text-sm text-muted-foreground",
24
24
  children: r("description")
25
25
  }),
26
- /* @__PURE__ */ u(c, { children: /* @__PURE__ */ u(h, {
27
- workspace: e,
28
- project: t
29
- }) }),
30
- /* @__PURE__ */ u("div", {
26
+ /* @__PURE__ */ d(l, {
27
+ fallback: /* @__PURE__ */ d(o, { fill: "section" }),
28
+ children: /* @__PURE__ */ d(g, {
29
+ workspace: e,
30
+ project: t
31
+ })
32
+ }),
33
+ /* @__PURE__ */ d("div", {
31
34
  className: "mt-5 flex justify-end",
32
- children: /* @__PURE__ */ u(a, {
35
+ children: /* @__PURE__ */ d(a, {
33
36
  type: "button",
34
37
  onClick: n,
35
38
  children: i("close")
@@ -38,9 +41,9 @@ function m({ workspace: e, project: t, onClose: n }) {
38
41
  ]
39
42
  });
40
43
  }
41
- function h({ workspace: a, project: o }) {
42
- let s = f(), { data: c } = p(n(a, o.id)), l = r(a, "manage_members", { project: o.id });
43
- return /* @__PURE__ */ u(i, {
44
+ function g({ workspace: a, project: o }) {
45
+ let s = p(), { data: c } = m(n(a, o.id)), l = r(a, "manage_members", { project: o.id });
46
+ return /* @__PURE__ */ d(i, {
44
47
  workspace: a,
45
48
  resourceName: o.name,
46
49
  access: c,
@@ -60,4 +63,4 @@ function h({ workspace: a, project: o }) {
60
63
  }
61
64
  });
62
65
  }
63
- export { m as ProjectAccessDialog };
66
+ export { h as ProjectAccessDialog };