@devalok/shilp-sutra-karm 0.9.0 → 0.11.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.
Files changed (41) hide show
  1. package/dist/_chunks/kanban-board.js +1834 -482
  2. package/dist/_chunks/task-detail-panel.js +123 -109
  3. package/dist/_chunks/vendor.js +1 -1
  4. package/dist/board/board-column.d.ts +2 -13
  5. package/dist/board/board-column.d.ts.map +1 -1
  6. package/dist/board/board-constants.d.ts +17 -0
  7. package/dist/board/board-constants.d.ts.map +1 -0
  8. package/dist/board/board-context.d.ts +65 -0
  9. package/dist/board/board-context.d.ts.map +1 -0
  10. package/dist/board/board-toolbar.d.ts +5 -0
  11. package/dist/board/board-toolbar.d.ts.map +1 -0
  12. package/dist/board/board-types.d.ts +48 -0
  13. package/dist/board/board-types.d.ts.map +1 -0
  14. package/dist/board/board-utils.d.ts +13 -0
  15. package/dist/board/board-utils.d.ts.map +1 -0
  16. package/dist/board/bulk-action-bar.d.ts +5 -0
  17. package/dist/board/bulk-action-bar.d.ts.map +1 -0
  18. package/dist/board/column-empty.d.ts +14 -0
  19. package/dist/board/column-empty.d.ts.map +1 -0
  20. package/dist/board/column-header.d.ts +10 -0
  21. package/dist/board/column-header.d.ts.map +1 -0
  22. package/dist/board/index.d.ts +13 -3
  23. package/dist/board/index.d.ts.map +1 -1
  24. package/dist/board/index.js +20 -5
  25. package/dist/board/kanban-board.d.ts +4 -13
  26. package/dist/board/kanban-board.d.ts.map +1 -1
  27. package/dist/board/task-card.d.ts +11 -16
  28. package/dist/board/task-card.d.ts.map +1 -1
  29. package/dist/board/task-context-menu.d.ts +10 -0
  30. package/dist/board/task-context-menu.d.ts.map +1 -0
  31. package/dist/board/use-board-filters.d.ts +3 -0
  32. package/dist/board/use-board-filters.d.ts.map +1 -0
  33. package/dist/board/use-board-keyboard.d.ts +14 -0
  34. package/dist/board/use-board-keyboard.d.ts.map +1 -0
  35. package/dist/index.d.ts +1 -1
  36. package/dist/index.d.ts.map +1 -1
  37. package/dist/index.js +129 -119
  38. package/dist/tasks/conversation-tab.d.ts +1 -1
  39. package/dist/tasks/conversation-tab.d.ts.map +1 -1
  40. package/package.json +1 -1
  41. package/dist/_chunks/task-constants.js +0 -22
@@ -1,382 +1,1645 @@
1
1
  "use client";
2
- import { jsx as e, jsxs as c, Fragment as X } from "react/jsx-runtime";
3
- import * as F from "react";
4
- import { useState as O, useRef as J, useEffect as Z, useMemo as le, useCallback as L } from "react";
5
- import { u as se } from "./use-composed-ref.js";
6
- import { createPortal as me } from "react-dom";
7
- import { u as fe, C as ue, c as he, a as pe, S as re, v as xe, b as be, d as U, D as ge, e as ve, h as ye, f as Ne, s as we, K as ke, T as Ie, P as De } from "./vendor.js";
8
- import { cn as j } from "@devalok/shilp-sutra/ui/lib/utils";
9
- import { Button as $ } from "@devalok/shilp-sutra/ui/button";
10
- import { Input as H } from "@devalok/shilp-sutra/ui/input";
11
- import { DropdownMenu as Ce, DropdownMenuTrigger as Se, DropdownMenuContent as Oe, DropdownMenuItem as q, DropdownMenuSeparator as Ee } from "@devalok/shilp-sutra/ui/dropdown-menu";
12
- import { IconGripVertical as Re, IconCalendar as Be, IconEye as ee, IconPlus as Q, IconDots as Ke, IconPencil as Ae, IconEyeOff as Te, IconTrash as ze } from "@tabler/icons-react";
13
- import { Badge as Le } from "@devalok/shilp-sutra/ui";
14
- import { AvatarGroup as $e } from "@devalok/shilp-sutra/composed/avatar-group";
15
- import { P as je, a as Me } from "./task-constants.js";
16
- function _e(s) {
17
- const t = new Date(s), r = /* @__PURE__ */ new Date(), h = t.getTime() - r.getTime(), m = Math.ceil(h / (1e3 * 60 * 60 * 24));
18
- return m < 0 ? { label: "Overdue", className: "text-text-error" } : m === 0 ? { label: "Today", className: "text-text-warning" } : m === 1 ? { label: "Tomorrow", className: "text-text-warning" } : {
2
+ import { jsx as e, jsxs as a, Fragment as se } from "react/jsx-runtime";
3
+ import * as j from "react";
4
+ import { useMemo as ne, useState as A, useEffect as oe, useCallback as E, useContext as Ye, createContext as qe, useRef as ae } from "react";
5
+ import { createPortal as Xe } from "react-dom";
6
+ import { u as Ce, C as Ne, c as Ie, a as Je, S as De, v as Ze, b as et, d as he, D as tt, e as st, h as nt, f as at, s as rt, K as it, T as ot, P as lt } from "./vendor.js";
7
+ import { cn as I } from "@devalok/shilp-sutra/ui/lib/utils";
8
+ import { Input as re } from "@devalok/shilp-sutra/ui/input";
9
+ import { Button as O } from "@devalok/shilp-sutra/ui/button";
10
+ import { Badge as ct } from "@devalok/shilp-sutra/ui/badge";
11
+ import { DropdownMenu as z, DropdownMenuTrigger as V, DropdownMenuContent as F, DropdownMenuLabel as Q, DropdownMenuSeparator as G, DropdownMenuCheckboxItem as ge, DropdownMenuRadioGroup as dt, DropdownMenuRadioItem as mt, DropdownMenuItem as $ } from "@devalok/shilp-sutra/ui/dropdown-menu";
12
+ import { SegmentedControl as ut } from "@devalok/shilp-sutra/ui/segmented-control";
13
+ import { IconX as ie, IconSearch as ht, IconFilter as gt, IconUser as q, IconLayoutGrid as ft, IconLayoutList as pt, IconArrowRight as fe, IconAlertTriangle as le, IconEye as X, IconTrash as pe, IconPlus as xe, IconDots as xt, IconPencil as yt, IconGauge as vt, IconEyeOff as Te, IconCalendar as ye, IconCheck as wt, IconArrowUp as Re, IconArrowDown as Se, IconGripVertical as bt, IconSubtask as kt, IconLock as Ct, IconTag as Nt } from "@tabler/icons-react";
14
+ import { AvatarGroup as It } from "@devalok/shilp-sutra/composed/avatar-group";
15
+ import { u as Ae } from "./use-composed-ref.js";
16
+ import { Checkbox as Me } from "@devalok/shilp-sutra/ui";
17
+ import { Avatar as Dt, AvatarImage as Tt, AvatarFallback as Rt } from "@devalok/shilp-sutra/ui/avatar";
18
+ import { ContextMenu as St, ContextMenuTrigger as At, ContextMenuContent as Mt, ContextMenuSub as Z, ContextMenuSubTrigger as ee, ContextMenuSubContent as te, ContextMenuItem as H, ContextMenuSeparator as Lt } from "@devalok/shilp-sutra/ui/context-menu";
19
+ const Et = 320, ve = [
20
+ "bg-category-cyan",
21
+ "bg-category-amber",
22
+ "bg-category-teal",
23
+ "bg-category-indigo",
24
+ "bg-category-orange",
25
+ "bg-category-emerald",
26
+ "bg-category-slate",
27
+ "bg-accent"
28
+ ], fs = {
29
+ LOW: "IconArrowDown",
30
+ MEDIUM: "IconArrowRight",
31
+ HIGH: "IconArrowUp",
32
+ URGENT: "IconAlertTriangle"
33
+ }, ce = {
34
+ LOW: "text-text-tertiary",
35
+ MEDIUM: "text-warning",
36
+ HIGH: "text-error",
37
+ URGENT: "text-error"
38
+ }, we = {
39
+ search: "",
40
+ assignees: [],
41
+ priorities: [],
42
+ labels: [],
43
+ dueDateRange: null
44
+ };
45
+ function Ot(s, t) {
46
+ if (t.search) {
47
+ const n = t.search.toLowerCase();
48
+ if (!s.title.toLowerCase().includes(n) && !s.taskId.toLowerCase().includes(n))
49
+ return !1;
50
+ }
51
+ if (t.priorities.length > 0 && !t.priorities.includes(s.priority))
52
+ return !1;
53
+ if (t.assignees.length > 0) {
54
+ const n = [
55
+ ...s.owner ? [s.owner.id] : [],
56
+ ...s.assignees.map((r) => r.id)
57
+ ];
58
+ if (!t.assignees.some((r) => n.includes(r))) return !1;
59
+ }
60
+ if (t.labels.length > 0 && !t.labels.some((n) => s.labels.includes(n)))
61
+ return !1;
62
+ if (t.dueDateRange && t.dueDateRange !== "none") {
63
+ if (!s.dueDate) return !1;
64
+ const n = new Date(s.dueDate), r = /* @__PURE__ */ new Date();
65
+ r.setHours(0, 0, 0, 0);
66
+ const o = new Date(r);
67
+ switch (o.setHours(23, 59, 59, 999), t.dueDateRange) {
68
+ case "overdue":
69
+ if (n >= r) return !1;
70
+ break;
71
+ case "today":
72
+ if (n < r || n > o) return !1;
73
+ break;
74
+ case "this-week": {
75
+ const h = new Date(r);
76
+ if (h.setDate(r.getDate() + (7 - r.getDay())), h.setHours(23, 59, 59, 999), n > h) return !1;
77
+ break;
78
+ }
79
+ }
80
+ }
81
+ return !0;
82
+ }
83
+ function Bt(s, t) {
84
+ return ne(() => t.search !== "" || t.priorities.length > 0 || t.assignees.length > 0 || t.labels.length > 0 || t.dueDateRange != null && t.dueDateRange !== "none" ? s.map((r) => ({
85
+ ...r,
86
+ tasks: r.tasks.filter((o) => Ot(o, t))
87
+ })) : s, [s, t]);
88
+ }
89
+ const Le = qe(null);
90
+ function U() {
91
+ const s = Ye(Le);
92
+ if (!s) throw new Error("useBoardContext must be used within <BoardProvider>");
93
+ return s;
94
+ }
95
+ const L = () => {
96
+ };
97
+ function Pt({
98
+ initialData: s,
99
+ currentUserId: t = null,
100
+ children: n,
101
+ ...r
102
+ }) {
103
+ const [o, h] = A(s.columns);
104
+ oe(() => {
105
+ h(s.columns);
106
+ }, [s]);
107
+ const [b, v] = A("default"), [d, c] = A(we), x = E((B) => {
108
+ c((_) => ({ ..._, ...B }));
109
+ }, []), T = E(() => c(we), []), y = ne(
110
+ () => d.search !== "" || d.priorities.length > 0 || d.assignees.length > 0 || d.labels.length > 0 || d.dueDateRange != null && d.dueDateRange !== "none",
111
+ [d]
112
+ ), g = Bt(o, d), [S, u] = A(/* @__PURE__ */ new Set()), k = E((B) => {
113
+ u((_) => {
114
+ const P = new Set(_);
115
+ return P.has(B) ? P.delete(B) : P.add(B), P;
116
+ });
117
+ }, []), l = E(
118
+ (B, _) => {
119
+ const P = g.flatMap((W) => W.tasks), Y = P.findIndex((W) => W.id === B), K = P.findIndex((W) => W.id === _);
120
+ if (Y === -1 || K === -1) return;
121
+ const [J, me] = Y < K ? [Y, K] : [K, Y], ue = P.slice(J, me + 1).map((W) => W.id);
122
+ u((W) => {
123
+ const w = new Set(W);
124
+ return ue.forEach((je) => w.add(je)), w;
125
+ });
126
+ },
127
+ [g]
128
+ ), p = E(() => {
129
+ const B = g.flatMap((_) => _.tasks.map((P) => P.id));
130
+ u(new Set(B));
131
+ }, [g]), m = E(() => u(/* @__PURE__ */ new Set()), []), [C, i] = A(null), [f, D] = A(!1), [M, N] = A(null), R = ne(
132
+ () => ({
133
+ columns: g,
134
+ rawColumns: o,
135
+ viewMode: b,
136
+ setViewMode: v,
137
+ filters: d,
138
+ setFilters: x,
139
+ clearFilters: T,
140
+ hasActiveFilters: y,
141
+ selectedTaskIds: S,
142
+ toggleTaskSelection: k,
143
+ selectRange: l,
144
+ selectAll: p,
145
+ clearSelection: m,
146
+ focusedTaskId: C,
147
+ setFocusedTaskId: i,
148
+ currentUserId: t,
149
+ highlightMyTasks: f,
150
+ setHighlightMyTasks: D,
151
+ activeTask: M,
152
+ setActiveTask: N,
153
+ onTaskMove: r.onTaskMove ?? L,
154
+ onTaskAdd: r.onTaskAdd ?? L,
155
+ onBulkAction: r.onBulkAction ?? L,
156
+ onColumnReorder: r.onColumnReorder ?? L,
157
+ onColumnRename: r.onColumnRename ?? L,
158
+ onColumnDelete: r.onColumnDelete ?? L,
159
+ onColumnToggleVisibility: r.onColumnToggleVisibility ?? L,
160
+ onColumnWipLimitChange: r.onColumnWipLimitChange ?? L,
161
+ onClickTask: r.onClickTask ?? L,
162
+ onAddColumn: r.onAddColumn ?? L,
163
+ onQuickPriorityChange: r.onQuickPriorityChange ?? L,
164
+ onQuickAssign: r.onQuickAssign ?? L,
165
+ onQuickDueDateChange: r.onQuickDueDateChange ?? L,
166
+ onQuickLabelAdd: r.onQuickLabelAdd ?? L,
167
+ onQuickVisibilityChange: r.onQuickVisibilityChange ?? L,
168
+ onQuickDelete: r.onQuickDelete ?? L
169
+ }),
170
+ [
171
+ g,
172
+ o,
173
+ b,
174
+ d,
175
+ x,
176
+ T,
177
+ y,
178
+ S,
179
+ k,
180
+ l,
181
+ p,
182
+ m,
183
+ C,
184
+ t,
185
+ f,
186
+ M,
187
+ r
188
+ ]
189
+ );
190
+ return /* @__PURE__ */ e(Le.Provider, { value: R, children: n });
191
+ }
192
+ function de(s) {
193
+ const t = /* @__PURE__ */ new Set(), n = [];
194
+ for (const r of s)
195
+ for (const o of r.tasks) {
196
+ o.owner && !t.has(o.owner.id) && (t.add(o.owner.id), n.push(o.owner));
197
+ for (const h of o.assignees)
198
+ t.has(h.id) || (t.add(h.id), n.push(h));
199
+ }
200
+ return n;
201
+ }
202
+ function Ee(s) {
203
+ const t = /* @__PURE__ */ new Set();
204
+ for (const n of s)
205
+ for (const r of n.tasks)
206
+ for (const o of r.labels) t.add(o);
207
+ return Array.from(t).sort();
208
+ }
209
+ const Wt = ["LOW", "MEDIUM", "HIGH", "URGENT"], be = [
210
+ { value: "overdue", label: "Overdue" },
211
+ { value: "today", label: "Today" },
212
+ { value: "this-week", label: "This week" }
213
+ ];
214
+ function Oe() {
215
+ const {
216
+ rawColumns: s,
217
+ filters: t,
218
+ setFilters: n,
219
+ clearFilters: r,
220
+ hasActiveFilters: o,
221
+ viewMode: h,
222
+ setViewMode: b,
223
+ highlightMyTasks: v,
224
+ setHighlightMyTasks: d
225
+ } = U(), [c, x] = A(t.search), T = ae(null), y = E(
226
+ (i) => {
227
+ const f = i.target.value;
228
+ x(f), T.current && clearTimeout(T.current), T.current = setTimeout(() => {
229
+ n({ search: f });
230
+ }, 200);
231
+ },
232
+ [n]
233
+ );
234
+ oe(() => {
235
+ x(t.search);
236
+ }, [t.search]);
237
+ const g = de(s), S = Ee(s), u = (i) => {
238
+ const f = t.priorities;
239
+ n({
240
+ priorities: f.includes(i) ? f.filter((D) => D !== i) : [...f, i]
241
+ });
242
+ }, k = (i) => {
243
+ const f = t.assignees;
244
+ n({
245
+ assignees: f.includes(i) ? f.filter((D) => D !== i) : [...f, i]
246
+ });
247
+ }, l = (i) => {
248
+ const f = t.labels;
249
+ n({
250
+ labels: f.includes(i) ? f.filter((D) => D !== i) : [...f, i]
251
+ });
252
+ }, p = (i) => {
253
+ n({
254
+ dueDateRange: i === t.dueDateRange ? null : i
255
+ });
256
+ }, m = [
257
+ { id: "default", text: "Board", icon: ft },
258
+ { id: "compact", text: "Compact", icon: pt }
259
+ ], C = [];
260
+ for (const i of t.priorities)
261
+ C.push({
262
+ key: `priority-${i}`,
263
+ label: i.charAt(0) + i.slice(1).toLowerCase(),
264
+ onRemove: () => u(i)
265
+ });
266
+ for (const i of t.assignees) {
267
+ const f = g.find((D) => D.id === i);
268
+ C.push({
269
+ key: `assignee-${i}`,
270
+ label: (f == null ? void 0 : f.name) ?? i,
271
+ onRemove: () => k(i)
272
+ });
273
+ }
274
+ for (const i of t.labels)
275
+ C.push({
276
+ key: `label-${i}`,
277
+ label: i,
278
+ onRemove: () => l(i)
279
+ });
280
+ if (t.dueDateRange && t.dueDateRange !== "none") {
281
+ const i = be.find((f) => f.value === t.dueDateRange);
282
+ C.push({
283
+ key: "due-date",
284
+ label: (i == null ? void 0 : i.label) ?? t.dueDateRange,
285
+ onRemove: () => n({ dueDateRange: null })
286
+ });
287
+ }
288
+ return /* @__PURE__ */ a("div", { className: "flex flex-col gap-ds-02", children: [
289
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-ds-03", children: [
290
+ /* @__PURE__ */ e("div", { className: "relative flex-1 max-w-xs", children: /* @__PURE__ */ e(
291
+ re,
292
+ {
293
+ value: c,
294
+ onChange: y,
295
+ placeholder: "Search tasks...",
296
+ "aria-label": "Search tasks",
297
+ size: "sm",
298
+ startIcon: /* @__PURE__ */ e(ht, { className: "h-ico-sm w-ico-sm" }),
299
+ endIcon: c ? /* @__PURE__ */ e(
300
+ "button",
301
+ {
302
+ onClick: () => {
303
+ x(""), n({ search: "" });
304
+ },
305
+ className: "pointer-events-auto cursor-pointer text-text-tertiary hover:text-text-primary",
306
+ "aria-label": "Clear search",
307
+ children: /* @__PURE__ */ e(ie, { className: "h-3 w-3" })
308
+ }
309
+ ) : void 0
310
+ }
311
+ ) }),
312
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-ds-01", children: [
313
+ /* @__PURE__ */ a(z, { children: [
314
+ /* @__PURE__ */ e(V, { asChild: !0, children: /* @__PURE__ */ a(
315
+ O,
316
+ {
317
+ variant: "ghost",
318
+ size: "sm",
319
+ className: I(
320
+ t.priorities.length > 0 && "text-interactive"
321
+ ),
322
+ title: "Filter by priority",
323
+ children: [
324
+ /* @__PURE__ */ e(gt, { className: "h-ico-sm w-ico-sm mr-ds-01" }),
325
+ "Priority",
326
+ t.priorities.length > 0 && /* @__PURE__ */ a("span", { className: "ml-ds-01 text-ds-xs", children: [
327
+ "(",
328
+ t.priorities.length,
329
+ ")"
330
+ ] })
331
+ ]
332
+ }
333
+ ) }),
334
+ /* @__PURE__ */ a(F, { align: "start", className: "w-44", children: [
335
+ /* @__PURE__ */ e(Q, { children: "Priority" }),
336
+ /* @__PURE__ */ e(G, {}),
337
+ Wt.map((i) => /* @__PURE__ */ e(
338
+ ge,
339
+ {
340
+ checked: t.priorities.includes(i),
341
+ onCheckedChange: () => u(i),
342
+ children: i.charAt(0) + i.slice(1).toLowerCase()
343
+ },
344
+ i
345
+ ))
346
+ ] })
347
+ ] }),
348
+ g.length > 0 && /* @__PURE__ */ a(z, { children: [
349
+ /* @__PURE__ */ e(V, { asChild: !0, children: /* @__PURE__ */ a(
350
+ O,
351
+ {
352
+ variant: "ghost",
353
+ size: "sm",
354
+ className: I(
355
+ t.assignees.length > 0 && "text-interactive"
356
+ ),
357
+ title: "Filter by assignee",
358
+ children: [
359
+ /* @__PURE__ */ e(q, { className: "h-ico-sm w-ico-sm mr-ds-01" }),
360
+ "Assignee",
361
+ t.assignees.length > 0 && /* @__PURE__ */ a("span", { className: "ml-ds-01 text-ds-xs", children: [
362
+ "(",
363
+ t.assignees.length,
364
+ ")"
365
+ ] })
366
+ ]
367
+ }
368
+ ) }),
369
+ /* @__PURE__ */ a(F, { align: "start", className: "w-48 max-h-56 overflow-y-auto", children: [
370
+ /* @__PURE__ */ e(Q, { children: "Assignee" }),
371
+ /* @__PURE__ */ e(G, {}),
372
+ g.map((i) => /* @__PURE__ */ e(
373
+ ge,
374
+ {
375
+ checked: t.assignees.includes(i.id),
376
+ onCheckedChange: () => k(i.id),
377
+ children: i.name
378
+ },
379
+ i.id
380
+ ))
381
+ ] })
382
+ ] }),
383
+ S.length > 0 && /* @__PURE__ */ a(z, { children: [
384
+ /* @__PURE__ */ e(V, { asChild: !0, children: /* @__PURE__ */ a(
385
+ O,
386
+ {
387
+ variant: "ghost",
388
+ size: "sm",
389
+ className: I(
390
+ t.labels.length > 0 && "text-interactive"
391
+ ),
392
+ title: "Filter by label",
393
+ children: [
394
+ "Label",
395
+ t.labels.length > 0 && /* @__PURE__ */ a("span", { className: "ml-ds-01 text-ds-xs", children: [
396
+ "(",
397
+ t.labels.length,
398
+ ")"
399
+ ] })
400
+ ]
401
+ }
402
+ ) }),
403
+ /* @__PURE__ */ a(F, { align: "start", className: "w-44 max-h-56 overflow-y-auto", children: [
404
+ /* @__PURE__ */ e(Q, { children: "Label" }),
405
+ /* @__PURE__ */ e(G, {}),
406
+ S.map((i) => /* @__PURE__ */ e(
407
+ ge,
408
+ {
409
+ checked: t.labels.includes(i),
410
+ onCheckedChange: () => l(i),
411
+ children: i
412
+ },
413
+ i
414
+ ))
415
+ ] })
416
+ ] }),
417
+ /* @__PURE__ */ a(z, { children: [
418
+ /* @__PURE__ */ e(V, { asChild: !0, children: /* @__PURE__ */ e(
419
+ O,
420
+ {
421
+ variant: "ghost",
422
+ size: "sm",
423
+ className: I(
424
+ t.dueDateRange && t.dueDateRange !== "none" && "text-interactive"
425
+ ),
426
+ title: "Filter by due date",
427
+ children: "Due date"
428
+ }
429
+ ) }),
430
+ /* @__PURE__ */ a(F, { align: "start", className: "w-40", children: [
431
+ /* @__PURE__ */ e(Q, { children: "Due date" }),
432
+ /* @__PURE__ */ e(G, {}),
433
+ /* @__PURE__ */ e(
434
+ dt,
435
+ {
436
+ value: t.dueDateRange ?? "",
437
+ onValueChange: p,
438
+ children: be.map((i) => /* @__PURE__ */ e(mt, { value: i.value, children: i.label }, i.value))
439
+ }
440
+ )
441
+ ] })
442
+ ] })
443
+ ] }),
444
+ /* @__PURE__ */ e("div", { className: "flex-1" }),
445
+ /* @__PURE__ */ e(
446
+ O,
447
+ {
448
+ variant: v ? "outline" : "ghost",
449
+ size: "sm",
450
+ onClick: () => d(!v),
451
+ title: "Highlight my tasks",
452
+ "aria-label": "Highlight my tasks",
453
+ "aria-pressed": v,
454
+ className: I(v && "text-interactive"),
455
+ children: /* @__PURE__ */ e(q, { className: "h-ico-sm w-ico-sm" })
456
+ }
457
+ ),
458
+ /* @__PURE__ */ e(
459
+ ut,
460
+ {
461
+ size: "sm",
462
+ variant: "tonal",
463
+ options: m,
464
+ selectedId: h,
465
+ onSelect: (i) => b(i)
466
+ }
467
+ )
468
+ ] }),
469
+ C.length > 0 && /* @__PURE__ */ a("div", { className: "flex items-center gap-ds-02 flex-wrap", children: [
470
+ C.map((i, f) => /* @__PURE__ */ e(
471
+ "div",
472
+ {
473
+ className: "animate-scale-in delay-stagger",
474
+ style: { "--stagger-index": f },
475
+ children: /* @__PURE__ */ e(
476
+ ct,
477
+ {
478
+ variant: "subtle",
479
+ size: "sm",
480
+ onDismiss: i.onRemove,
481
+ children: i.label
482
+ }
483
+ )
484
+ },
485
+ i.key
486
+ )),
487
+ /* @__PURE__ */ e(
488
+ "button",
489
+ {
490
+ onClick: r,
491
+ className: "text-ds-xs text-text-tertiary hover:text-interactive transition-colors",
492
+ "aria-label": "Clear all filters",
493
+ children: "Clear all"
494
+ }
495
+ )
496
+ ] })
497
+ ] });
498
+ }
499
+ Oe.displayName = "BoardToolbar";
500
+ const $t = ["LOW", "MEDIUM", "HIGH", "URGENT"];
501
+ function Be() {
502
+ const {
503
+ rawColumns: s,
504
+ columns: t,
505
+ selectedTaskIds: n,
506
+ clearSelection: r,
507
+ onBulkAction: o
508
+ } = U(), h = n.size, b = Array.from(n), v = de(s), d = (c, x) => {
509
+ o({ type: c, taskIds: b, value: x }), r();
510
+ };
511
+ return /* @__PURE__ */ e(
512
+ "div",
513
+ {
514
+ className: I(
515
+ "grid transition-[grid-template-rows,opacity] duration-moderate-02 ease-expressive-entrance",
516
+ h > 0 ? "grid-rows-[1fr] opacity-100" : "grid-rows-[0fr] opacity-0"
517
+ ),
518
+ "aria-live": "polite",
519
+ children: /* @__PURE__ */ e("div", { className: "overflow-hidden", children: /* @__PURE__ */ a("div", { className: "flex items-center gap-ds-03 py-ds-02", children: [
520
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-ds-02", children: [
521
+ /* @__PURE__ */ a("span", { className: "text-ds-sm font-medium text-text-primary", children: [
522
+ h,
523
+ " selected"
524
+ ] }),
525
+ /* @__PURE__ */ e(
526
+ O,
527
+ {
528
+ variant: "ghost",
529
+ size: "icon-md",
530
+ onClick: r,
531
+ "aria-label": "Clear selection",
532
+ title: "Clear selection",
533
+ className: "h-6 w-6",
534
+ children: /* @__PURE__ */ e(ie, { className: "h-3.5 w-3.5" })
535
+ }
536
+ )
537
+ ] }),
538
+ /* @__PURE__ */ e("div", { className: "h-4 w-px bg-border-subtle" }),
539
+ /* @__PURE__ */ e("div", { className: "animate-fade-in delay-stagger", style: { "--stagger-index": 0 }, children: /* @__PURE__ */ a(z, { children: [
540
+ /* @__PURE__ */ e(V, { asChild: !0, children: /* @__PURE__ */ a(O, { variant: "ghost", size: "sm", title: "Move to column", tabIndex: h > 0 ? 0 : -1, children: [
541
+ /* @__PURE__ */ e(fe, { className: "h-ico-sm w-ico-sm mr-ds-01" }),
542
+ "Move"
543
+ ] }) }),
544
+ /* @__PURE__ */ a(F, { align: "start", className: "w-44", children: [
545
+ /* @__PURE__ */ e(Q, { children: "Move to" }),
546
+ /* @__PURE__ */ e(G, {}),
547
+ t.map((c) => /* @__PURE__ */ e(
548
+ $,
549
+ {
550
+ onClick: () => d("move", c.id),
551
+ children: c.name
552
+ },
553
+ c.id
554
+ ))
555
+ ] })
556
+ ] }) }),
557
+ /* @__PURE__ */ e("div", { className: "animate-fade-in delay-stagger", style: { "--stagger-index": 1 }, children: /* @__PURE__ */ a(z, { children: [
558
+ /* @__PURE__ */ e(V, { asChild: !0, children: /* @__PURE__ */ a(O, { variant: "ghost", size: "sm", title: "Set priority", tabIndex: h > 0 ? 0 : -1, children: [
559
+ /* @__PURE__ */ e(le, { className: "h-ico-sm w-ico-sm mr-ds-01" }),
560
+ "Priority"
561
+ ] }) }),
562
+ /* @__PURE__ */ a(F, { align: "start", className: "w-40", children: [
563
+ /* @__PURE__ */ e(Q, { children: "Set priority" }),
564
+ /* @__PURE__ */ e(G, {}),
565
+ $t.map((c) => /* @__PURE__ */ e(
566
+ $,
567
+ {
568
+ onClick: () => d("priority", c),
569
+ className: ce[c],
570
+ children: c.charAt(0) + c.slice(1).toLowerCase()
571
+ },
572
+ c
573
+ ))
574
+ ] })
575
+ ] }) }),
576
+ v.length > 0 && /* @__PURE__ */ e("div", { className: "animate-fade-in delay-stagger", style: { "--stagger-index": 2 }, children: /* @__PURE__ */ a(z, { children: [
577
+ /* @__PURE__ */ e(V, { asChild: !0, children: /* @__PURE__ */ a(O, { variant: "ghost", size: "sm", title: "Assign", tabIndex: h > 0 ? 0 : -1, children: [
578
+ /* @__PURE__ */ e(q, { className: "h-ico-sm w-ico-sm mr-ds-01" }),
579
+ "Assign"
580
+ ] }) }),
581
+ /* @__PURE__ */ a(F, { align: "start", className: "w-44 max-h-48 overflow-y-auto", children: [
582
+ /* @__PURE__ */ e(Q, { children: "Assign to" }),
583
+ /* @__PURE__ */ e(G, {}),
584
+ v.map((c) => /* @__PURE__ */ e(
585
+ $,
586
+ {
587
+ onClick: () => d("assign", c.id),
588
+ children: c.name
589
+ },
590
+ c.id
591
+ ))
592
+ ] })
593
+ ] }) }),
594
+ /* @__PURE__ */ e("div", { className: "animate-fade-in delay-stagger", style: { "--stagger-index": 3 }, children: /* @__PURE__ */ a(z, { children: [
595
+ /* @__PURE__ */ e(V, { asChild: !0, children: /* @__PURE__ */ a(O, { variant: "ghost", size: "sm", title: "Set visibility", tabIndex: h > 0 ? 0 : -1, children: [
596
+ /* @__PURE__ */ e(X, { className: "h-ico-sm w-ico-sm mr-ds-01" }),
597
+ "Visibility"
598
+ ] }) }),
599
+ /* @__PURE__ */ a(F, { align: "start", className: "w-40", children: [
600
+ /* @__PURE__ */ e($, { onClick: () => d("visibility", "INTERNAL"), children: "Internal only" }),
601
+ /* @__PURE__ */ e($, { onClick: () => d("visibility", "EVERYONE"), children: "Visible to all" })
602
+ ] })
603
+ ] }) }),
604
+ /* @__PURE__ */ e("div", { className: "flex-1" }),
605
+ /* @__PURE__ */ e("div", { className: "animate-fade-in delay-stagger", style: { "--stagger-index": 4 }, children: /* @__PURE__ */ a(
606
+ O,
607
+ {
608
+ variant: "ghost",
609
+ size: "sm",
610
+ className: "text-error hover:text-error",
611
+ onClick: () => d("delete"),
612
+ title: "Delete selected tasks",
613
+ tabIndex: h > 0 ? 0 : -1,
614
+ children: [
615
+ /* @__PURE__ */ e(pe, { className: "h-ico-sm w-ico-sm mr-ds-01" }),
616
+ "Delete"
617
+ ]
618
+ }
619
+ ) })
620
+ ] }) })
621
+ }
622
+ );
623
+ }
624
+ Be.displayName = "BulkActionBar";
625
+ function _t(s) {
626
+ const t = /* @__PURE__ */ new Set(), n = [];
627
+ for (const r of s.tasks) {
628
+ r.owner && !t.has(r.owner.id) && (t.add(r.owner.id), n.push(r.owner));
629
+ for (const o of r.assignees)
630
+ t.has(o.id) || (t.add(o.id), n.push(o));
631
+ }
632
+ return n;
633
+ }
634
+ function zt({ columnId: s, currentLimit: t, onClose: n }) {
635
+ const { onColumnWipLimitChange: r } = U(), [o, h] = A(t != null ? String(t) : ""), b = E(() => {
636
+ const d = o.trim();
637
+ if (d === "")
638
+ r(s, null);
639
+ else {
640
+ const c = parseInt(d, 10);
641
+ !isNaN(c) && c > 0 && r(s, c);
642
+ }
643
+ n();
644
+ }, [o, s, r, n]);
645
+ return (
646
+ // eslint-disable-next-line jsx-a11y/no-autofocus -- intentional: input opens after user selects "Set WIP Limit"
647
+ /* @__PURE__ */ e(
648
+ re,
649
+ {
650
+ type: "number",
651
+ min: 1,
652
+ value: o,
653
+ onChange: (d) => h(d.target.value),
654
+ onBlur: b,
655
+ onKeyDown: (d) => {
656
+ d.key === "Enter" && b(), d.key === "Escape" && n();
657
+ },
658
+ placeholder: "Limit...",
659
+ "aria-label": "WIP limit",
660
+ size: "sm",
661
+ className: "w-16 text-center",
662
+ autoFocus: !0
663
+ }
664
+ )
665
+ );
666
+ }
667
+ function Pe({ column: s, index: t }) {
668
+ var W;
669
+ const {
670
+ rawColumns: n,
671
+ onColumnRename: r,
672
+ onColumnDelete: o,
673
+ onColumnToggleVisibility: h,
674
+ onTaskAdd: b
675
+ } = U(), [v, d] = A(!1), [c, x] = A(s.name), [T, y] = A(!1), [g, S] = A(!1), [u, k] = A(""), [l, p] = A(null), [m, C] = A(""), i = ae(null), f = de(n), D = ve[t % ve.length], M = s.tasks.length, N = s.wipLimit ?? null, R = N != null && M > N, B = _t(s), _ = () => {
676
+ x(s.name), d(!0);
677
+ }, P = () => {
678
+ const w = c.trim();
679
+ w && w !== s.name && r(s.id, w), d(!1);
680
+ }, Y = (w) => {
681
+ w.key === "Enter" && P(), w.key === "Escape" && (x(s.name), d(!1));
682
+ }, K = () => {
683
+ k(""), p(null), C(""), S(!1);
684
+ }, J = () => {
685
+ const w = u.trim();
686
+ w && (b(s.id, {
687
+ title: w,
688
+ ownerId: l,
689
+ dueDate: m || null
690
+ }), K());
691
+ }, me = (w) => {
692
+ w.key === "Enter" && J(), w.key === "Escape" && K();
693
+ }, ue = () => {
694
+ g ? K() : (S(!0), setTimeout(() => {
695
+ var w;
696
+ return (w = i.current) == null ? void 0 : w.focus();
697
+ }, 50));
698
+ };
699
+ return /* @__PURE__ */ a("div", { className: "group/header flex flex-col gap-ds-02", children: [
700
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-ds-02 px-ds-04 pt-ds-03 pb-ds-02", children: [
701
+ /* @__PURE__ */ e(
702
+ "span",
703
+ {
704
+ className: I("h-2.5 w-2.5 flex-shrink-0 rounded-full", D),
705
+ "aria-hidden": "true",
706
+ title: s.name
707
+ }
708
+ ),
709
+ v ? (
710
+ // eslint-disable-next-line jsx-a11y/no-autofocus -- intentional: input appears after user double-clicks to rename
711
+ /* @__PURE__ */ e(
712
+ re,
713
+ {
714
+ value: c,
715
+ onChange: (w) => x(w.target.value),
716
+ onBlur: P,
717
+ onKeyDown: Y,
718
+ "aria-label": "Column name",
719
+ size: "sm",
720
+ className: "h-ds-xs flex-1 text-ds-sm font-semibold",
721
+ autoFocus: !0
722
+ }
723
+ )
724
+ ) : /* @__PURE__ */ a(
725
+ "h3",
726
+ {
727
+ className: "flex-1 truncate text-ds-sm font-semibold text-text-primary",
728
+ onDoubleClick: _,
729
+ title: s.name,
730
+ "aria-label": N != null ? `${s.name}, ${M} of ${N} tasks${R ? ", WIP limit exceeded" : ""}` : `${s.name}, ${M} tasks`,
731
+ children: [
732
+ s.name,
733
+ /* @__PURE__ */ a("span", { className: "ml-ds-02 text-ds-xs font-normal text-text-tertiary", children: [
734
+ "(",
735
+ M,
736
+ ")"
737
+ ] })
738
+ ]
739
+ }
740
+ ),
741
+ T ? /* @__PURE__ */ e(
742
+ zt,
743
+ {
744
+ columnId: s.id,
745
+ currentLimit: N,
746
+ onClose: () => y(!1)
747
+ }
748
+ ) : N != null ? /* @__PURE__ */ a(
749
+ "span",
750
+ {
751
+ className: I(
752
+ "flex-shrink-0 text-ds-xs tabular-nums",
753
+ R ? "font-semibold text-error" : "text-text-tertiary"
754
+ ),
755
+ "aria-label": `WIP limit: ${N}${R ? ", exceeded" : ""}`,
756
+ children: [
757
+ "/ ",
758
+ N
759
+ ]
760
+ }
761
+ ) : null,
762
+ /* @__PURE__ */ e(
763
+ O,
764
+ {
765
+ variant: "ghost",
766
+ size: "icon-md",
767
+ className: I(
768
+ "h-ds-xs w-ds-xs flex-shrink-0 opacity-0 transition-opacity",
769
+ "group-hover/header:opacity-100 focus:opacity-100",
770
+ "hover:bg-interactive-subtle hover:text-interactive"
771
+ ),
772
+ "aria-label": "Add task",
773
+ title: "Add task",
774
+ onClick: ue,
775
+ children: /* @__PURE__ */ e(xe, { className: "h-ico-sm w-ico-sm" })
776
+ }
777
+ ),
778
+ /* @__PURE__ */ a(z, { children: [
779
+ /* @__PURE__ */ e(V, { asChild: !0, children: /* @__PURE__ */ e(
780
+ O,
781
+ {
782
+ variant: "ghost",
783
+ size: "icon-md",
784
+ className: I(
785
+ "h-ds-xs w-ds-xs flex-shrink-0 opacity-0 transition-opacity",
786
+ "group-hover/header:opacity-100 focus:opacity-100"
787
+ ),
788
+ "aria-label": "Column options",
789
+ title: "Column options",
790
+ children: /* @__PURE__ */ e(xt, { className: "h-ico-sm w-ico-sm" })
791
+ }
792
+ ) }),
793
+ /* @__PURE__ */ a(F, { align: "end", className: "w-48", children: [
794
+ /* @__PURE__ */ a($, { onClick: _, children: [
795
+ /* @__PURE__ */ e(yt, { className: "mr-ds-03 h-ico-sm w-ico-sm" }),
796
+ "Rename"
797
+ ] }),
798
+ /* @__PURE__ */ a($, { onClick: () => y(!0), children: [
799
+ /* @__PURE__ */ e(vt, { className: "mr-ds-03 h-ico-sm w-ico-sm" }),
800
+ "Set WIP Limit"
801
+ ] }),
802
+ /* @__PURE__ */ e(
803
+ $,
804
+ {
805
+ onClick: () => h(s.id, !(s.isClientVisible ?? !1)),
806
+ children: s.isClientVisible ? /* @__PURE__ */ a(se, { children: [
807
+ /* @__PURE__ */ e(Te, { className: "mr-ds-03 h-ico-sm w-ico-sm" }),
808
+ "Hide from client"
809
+ ] }) : /* @__PURE__ */ a(se, { children: [
810
+ /* @__PURE__ */ e(X, { className: "mr-ds-03 h-ico-sm w-ico-sm" }),
811
+ "Show to client"
812
+ ] })
813
+ }
814
+ ),
815
+ /* @__PURE__ */ e(G, {}),
816
+ /* @__PURE__ */ a(
817
+ $,
818
+ {
819
+ className: "text-error focus:text-error",
820
+ onClick: () => o(s.id),
821
+ children: [
822
+ /* @__PURE__ */ e(pe, { className: "mr-ds-03 h-ico-sm w-ico-sm" }),
823
+ "Delete column"
824
+ ]
825
+ }
826
+ )
827
+ ] })
828
+ ] })
829
+ ] }),
830
+ B.length > 0 && /* @__PURE__ */ e("div", { className: "px-ds-04 pb-ds-02", children: /* @__PURE__ */ e(
831
+ It,
832
+ {
833
+ users: B,
834
+ max: 3,
835
+ size: "sm",
836
+ showTooltip: !0
837
+ }
838
+ ) }),
839
+ /* @__PURE__ */ e(
840
+ "div",
841
+ {
842
+ className: I(
843
+ "grid transition-[grid-template-rows,opacity] duration-moderate-02 ease-expressive-entrance",
844
+ g ? "grid-rows-[1fr] opacity-100" : "grid-rows-[0fr] opacity-0"
845
+ ),
846
+ children: /* @__PURE__ */ e("div", { className: "overflow-hidden", children: /* @__PURE__ */ a("div", { className: "px-ds-04 pb-ds-03 flex flex-col gap-ds-02", children: [
847
+ /* @__PURE__ */ e(
848
+ re,
849
+ {
850
+ ref: i,
851
+ value: u,
852
+ onChange: (w) => k(w.target.value),
853
+ onKeyDown: me,
854
+ placeholder: "Task title...",
855
+ "aria-label": "New task title",
856
+ size: "sm",
857
+ tabIndex: g ? 0 : -1,
858
+ autoFocus: g
859
+ }
860
+ ),
861
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-ds-01", children: [
862
+ /* @__PURE__ */ a(z, { children: [
863
+ /* @__PURE__ */ e(V, { asChild: !0, children: /* @__PURE__ */ e(
864
+ "button",
865
+ {
866
+ className: I(
867
+ "flex items-center justify-center h-6 w-6 rounded-ds-md transition-colors",
868
+ l ? "text-interactive bg-interactive-subtle" : "text-text-tertiary hover:text-text-primary hover:bg-layer-active"
869
+ ),
870
+ title: l ? `Lead: ${(W = f.find((w) => w.id === l)) == null ? void 0 : W.name}` : "Assign task lead",
871
+ "aria-label": "Assign task lead",
872
+ tabIndex: g ? 0 : -1,
873
+ children: /* @__PURE__ */ e(q, { className: "h-3.5 w-3.5" })
874
+ }
875
+ ) }),
876
+ /* @__PURE__ */ a(F, { align: "start", className: "w-44 max-h-48 overflow-y-auto", children: [
877
+ f.length === 0 && /* @__PURE__ */ e("div", { className: "px-ds-03 py-ds-02 text-ds-xs text-text-tertiary", children: "No members found" }),
878
+ l && /* @__PURE__ */ a(se, { children: [
879
+ /* @__PURE__ */ a($, { onClick: () => p(null), children: [
880
+ /* @__PURE__ */ e(ie, { className: "mr-ds-02 h-3 w-3 text-text-tertiary" }),
881
+ "Clear lead"
882
+ ] }),
883
+ /* @__PURE__ */ e(G, {})
884
+ ] }),
885
+ f.map((w) => /* @__PURE__ */ e(
886
+ $,
887
+ {
888
+ onClick: () => p(w.id),
889
+ className: I(l === w.id && "bg-interactive-subtle"),
890
+ children: w.name
891
+ },
892
+ w.id
893
+ ))
894
+ ] })
895
+ ] }),
896
+ /* @__PURE__ */ a(
897
+ "label",
898
+ {
899
+ className: I(
900
+ "relative flex items-center justify-center h-6 w-6 rounded-ds-md cursor-pointer transition-colors",
901
+ m ? "text-interactive bg-interactive-subtle" : "text-text-tertiary hover:text-text-primary hover:bg-layer-active"
902
+ ),
903
+ title: m ? `Due: ${m}` : "Set due date",
904
+ "aria-label": "Set due date",
905
+ children: [
906
+ /* @__PURE__ */ e(ye, { className: "h-3.5 w-3.5" }),
907
+ /* @__PURE__ */ e(
908
+ "input",
909
+ {
910
+ type: "date",
911
+ value: m,
912
+ onChange: (w) => C(w.target.value),
913
+ className: "absolute inset-0 opacity-0 cursor-pointer w-full h-full",
914
+ "aria-label": "Due date",
915
+ tabIndex: g ? 0 : -1
916
+ }
917
+ )
918
+ ]
919
+ }
920
+ ),
921
+ /* @__PURE__ */ e("div", { className: "flex-1" }),
922
+ /* @__PURE__ */ e(
923
+ "button",
924
+ {
925
+ onClick: J,
926
+ disabled: !u.trim(),
927
+ className: I(
928
+ "flex items-center justify-center h-6 w-6 rounded-ds-md transition-colors",
929
+ u.trim() ? "text-success hover:bg-success-surface" : "text-text-quaternary cursor-not-allowed"
930
+ ),
931
+ title: "Confirm add task",
932
+ "aria-label": "Confirm add task",
933
+ tabIndex: g ? 0 : -1,
934
+ children: /* @__PURE__ */ e(wt, { className: "h-3.5 w-3.5" })
935
+ }
936
+ ),
937
+ /* @__PURE__ */ e(
938
+ "button",
939
+ {
940
+ onClick: K,
941
+ className: "flex items-center justify-center h-6 w-6 rounded-ds-md text-text-tertiary hover:text-text-primary hover:bg-layer-active transition-colors",
942
+ title: "Cancel",
943
+ "aria-label": "Cancel adding task",
944
+ tabIndex: g ? 0 : -1,
945
+ children: /* @__PURE__ */ e(ie, { className: "h-3.5 w-3.5" })
946
+ }
947
+ )
948
+ ] })
949
+ ] }) })
950
+ }
951
+ )
952
+ ] });
953
+ }
954
+ Pe.displayName = "ColumnHeader";
955
+ function Vt() {
956
+ return /* @__PURE__ */ a(
957
+ "svg",
958
+ {
959
+ width: "48",
960
+ height: "48",
961
+ viewBox: "0 0 48 48",
962
+ fill: "none",
963
+ "aria-hidden": "true",
964
+ xmlns: "http://www.w3.org/2000/svg",
965
+ children: [
966
+ /* @__PURE__ */ e("rect", { x: "10", y: "12", width: "28", height: "32", rx: "3", stroke: "currentColor", strokeWidth: "1.5" }),
967
+ /* @__PURE__ */ e("rect", { x: "18", y: "8", width: "12", height: "8", rx: "2", stroke: "currentColor", strokeWidth: "1.5" }),
968
+ /* @__PURE__ */ e("line", { x1: "16", y1: "24", x2: "32", y2: "24", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }),
969
+ /* @__PURE__ */ e("line", { x1: "16", y1: "30", x2: "28", y2: "30", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }),
970
+ /* @__PURE__ */ e("line", { x1: "16", y1: "36", x2: "24", y2: "36", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })
971
+ ]
972
+ }
973
+ );
974
+ }
975
+ function Ft() {
976
+ return /* @__PURE__ */ a(
977
+ "svg",
978
+ {
979
+ width: "48",
980
+ height: "48",
981
+ viewBox: "0 0 48 48",
982
+ fill: "none",
983
+ "aria-hidden": "true",
984
+ xmlns: "http://www.w3.org/2000/svg",
985
+ children: [
986
+ /* @__PURE__ */ e("rect", { x: "14", y: "10", width: "26", height: "16", rx: "3", stroke: "currentColor", strokeWidth: "1.5" }),
987
+ /* @__PURE__ */ e("rect", { x: "10", y: "19", width: "26", height: "16", rx: "3", stroke: "currentColor", strokeWidth: "1.5" }),
988
+ /* @__PURE__ */ e("rect", { x: "6", y: "28", width: "26", height: "16", rx: "3", stroke: "currentColor", strokeWidth: "1.5" }),
989
+ /* @__PURE__ */ e("line", { x1: "12", y1: "35", x2: "26", y2: "35", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })
990
+ ]
991
+ }
992
+ );
993
+ }
994
+ function Ut() {
995
+ return /* @__PURE__ */ a(
996
+ "svg",
997
+ {
998
+ width: "48",
999
+ height: "48",
1000
+ viewBox: "0 0 48 48",
1001
+ fill: "none",
1002
+ "aria-hidden": "true",
1003
+ xmlns: "http://www.w3.org/2000/svg",
1004
+ children: [
1005
+ /* @__PURE__ */ e("circle", { cx: "24", cy: "24", r: "14", stroke: "currentColor", strokeWidth: "1.5" }),
1006
+ /* @__PURE__ */ e(
1007
+ "polyline",
1008
+ {
1009
+ points: "17,24 22,30 31,18",
1010
+ stroke: "currentColor",
1011
+ strokeWidth: "1.5",
1012
+ strokeLinecap: "round",
1013
+ strokeLinejoin: "round"
1014
+ }
1015
+ )
1016
+ ]
1017
+ }
1018
+ );
1019
+ }
1020
+ function Kt() {
1021
+ return /* @__PURE__ */ a(
1022
+ "svg",
1023
+ {
1024
+ width: "48",
1025
+ height: "48",
1026
+ viewBox: "0 0 48 48",
1027
+ fill: "none",
1028
+ "aria-hidden": "true",
1029
+ xmlns: "http://www.w3.org/2000/svg",
1030
+ children: [
1031
+ /* @__PURE__ */ e("rect", { x: "8", y: "26", width: "32", height: "16", rx: "3", stroke: "currentColor", strokeWidth: "1.5" }),
1032
+ /* @__PURE__ */ e(
1033
+ "path",
1034
+ {
1035
+ d: "M8 26 L14 14 H34 L40 26",
1036
+ stroke: "currentColor",
1037
+ strokeWidth: "1.5",
1038
+ strokeLinejoin: "round"
1039
+ }
1040
+ ),
1041
+ /* @__PURE__ */ e("line", { x1: "24", y1: "8", x2: "24", y2: "22", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }),
1042
+ /* @__PURE__ */ e(
1043
+ "polyline",
1044
+ {
1045
+ points: "19,17 24,22 29,17",
1046
+ stroke: "currentColor",
1047
+ strokeWidth: "1.5",
1048
+ strokeLinecap: "round",
1049
+ strokeLinejoin: "round"
1050
+ }
1051
+ )
1052
+ ]
1053
+ }
1054
+ );
1055
+ }
1056
+ const ke = [
1057
+ Vt,
1058
+ Ft,
1059
+ Ut,
1060
+ Kt
1061
+ ];
1062
+ function We({ index: s, onAddTask: t, isDropTarget: n = !1, className: r }) {
1063
+ const o = ke[s % ke.length];
1064
+ return /* @__PURE__ */ a(
1065
+ "div",
1066
+ {
1067
+ className: I(
1068
+ "flex flex-col items-center justify-center gap-ds-03 py-ds-07 text-center",
1069
+ r
1070
+ ),
1071
+ children: [
1072
+ /* @__PURE__ */ e("span", { className: "text-text-quaternary", children: /* @__PURE__ */ e(o, {}) }),
1073
+ n ? /* @__PURE__ */ e("p", { className: "text-ds-sm text-text-tertiary", children: "Drop tasks here" }) : /* @__PURE__ */ a(se, { children: [
1074
+ /* @__PURE__ */ e("p", { className: "text-ds-sm text-text-tertiary", children: "No tasks yet" }),
1075
+ /* @__PURE__ */ a(
1076
+ O,
1077
+ {
1078
+ variant: "ghost",
1079
+ size: "sm",
1080
+ onClick: t,
1081
+ children: [
1082
+ /* @__PURE__ */ e(xe, { className: "h-ico-sm w-ico-sm" }),
1083
+ "Add a task"
1084
+ ]
1085
+ }
1086
+ )
1087
+ ] })
1088
+ ]
1089
+ }
1090
+ );
1091
+ }
1092
+ We.displayName = "ColumnEmpty";
1093
+ function Gt(s) {
1094
+ const t = new Date(s), n = /* @__PURE__ */ new Date(), r = t.getTime() - n.getTime(), o = Math.ceil(r / (1e3 * 60 * 60 * 24));
1095
+ return o < 0 ? { label: "Overdue", className: "text-error" } : o === 0 ? { label: "Today", className: "text-warning" } : o === 1 ? { label: "Tomorrow", className: "text-warning" } : {
19
1096
  label: t.toLocaleDateString("en-IN", { month: "short", day: "numeric" }),
20
1097
  className: "text-text-tertiary"
21
1098
  };
22
1099
  }
23
- const Fe = he(
24
- "group/card relative rounded-ds-lg border border-border/60 bg-layer-01 p-ds-04 shadow-01 transition-[color,background-color,border-color,box-shadow] duration-fast-02 ease-productive-standard hover:shadow-02 hover:border-border cursor-pointer",
1100
+ const $e = {
1101
+ LOW: Se,
1102
+ MEDIUM: fe,
1103
+ HIGH: Re,
1104
+ URGENT: le
1105
+ }, Ht = Ie(
1106
+ "group/card relative rounded-ds-lg border border-transparent bg-layer-01 pl-3 pr-ds-03 py-ds-03 transition-all duration-fast-02 ease-productive-standard cursor-pointer",
25
1107
  {
26
1108
  variants: {
27
1109
  state: {
28
- default: "",
1110
+ default: "shadow-01 hover:shadow-02 hover:-translate-y-px hover:border-border",
29
1111
  dragging: "opacity-[0.38]",
30
- overlay: "rotate-[2deg] shadow-03 border-border-interactive/60 ring-1 ring-interactive/40"
1112
+ overlay: "rotate-[2deg] shadow-03 backdrop-blur-sm ring-1 ring-interactive/40"
31
1113
  },
32
1114
  blocked: {
33
1115
  true: "border-l-2 border-l-error",
34
1116
  false: ""
1117
+ },
1118
+ selected: {
1119
+ true: "ring-1 ring-accent/50 shadow-[0_0_6px_rgba(var(--accent-rgb,99,102,241),0.15)] animate-glow-pulse",
1120
+ false: ""
1121
+ },
1122
+ dimmed: {
1123
+ true: "opacity-40",
1124
+ false: ""
35
1125
  }
36
1126
  },
37
1127
  defaultVariants: {
38
1128
  state: "default",
39
- blocked: !1
1129
+ blocked: !1,
1130
+ selected: !1,
1131
+ dimmed: !1
40
1132
  }
41
1133
  }
42
1134
  );
43
- function ae({
1135
+ function _e(s) {
1136
+ const t = s.trim();
1137
+ if (!t) return "";
1138
+ const n = t.split(/\s+/);
1139
+ return n.length >= 2 ? (n[0][0] + n[1][0]).toUpperCase() : t.slice(0, 2).toUpperCase();
1140
+ }
1141
+ function ze({
44
1142
  task: s,
45
1143
  isDragging: t,
46
- isDragOverlay: r,
47
- dragHandleProps: h,
48
- onClickTask: m
1144
+ isDragOverlay: n,
1145
+ dragHandleProps: r
49
1146
  }) {
50
- const w = s.dueDate ? _e(s.dueDate) : null;
51
- return /* @__PURE__ */ c(
1147
+ var p;
1148
+ const {
1149
+ selectedTaskIds: o,
1150
+ toggleTaskSelection: h,
1151
+ focusedTaskId: b,
1152
+ currentUserId: v,
1153
+ highlightMyTasks: d,
1154
+ onClickTask: c
1155
+ } = U(), x = o.has(s.id), T = o.size > 0, y = b === s.id, g = s.dueDate ? Gt(s.dueDate) : null, S = $e[s.priority], u = ce[s.priority], k = d && v != null && ((p = s.owner) == null ? void 0 : p.id) !== v && !s.assignees.some((m) => m.id === v), l = [];
1156
+ s.owner && l.push({ name: s.owner.name, image: s.owner.image, isOwner: !0 });
1157
+ for (const m of s.assignees)
1158
+ s.owner && m.id === s.owner.id || l.push({ name: m.name, image: m.image, isOwner: !1 });
1159
+ return /* @__PURE__ */ a(
52
1160
  "div",
53
1161
  {
54
- role: "button",
1162
+ role: "group",
55
1163
  tabIndex: 0,
56
- className: Fe({
57
- state: r ? "overlay" : t ? "dragging" : "default",
58
- blocked: s.isBlocked
59
- }),
60
- onClick: () => m == null ? void 0 : m(s.id),
61
- onKeyDown: (f) => {
62
- (f.key === "Enter" || f.key === " ") && (f.preventDefault(), m == null || m(s.id));
1164
+ "data-task-id": s.id,
1165
+ "aria-label": `Task ${s.taskId}: ${s.title}`,
1166
+ className: I(
1167
+ Ht({
1168
+ state: n ? "overlay" : t ? "dragging" : "default",
1169
+ blocked: s.isBlocked,
1170
+ selected: x,
1171
+ dimmed: k
1172
+ }),
1173
+ n && "scale-[1.03] rotate-[1.5deg] shadow-03",
1174
+ t && "opacity-40",
1175
+ y && "ring-1 ring-focus"
1176
+ ),
1177
+ onClick: () => c(s.id),
1178
+ onKeyDown: (m) => {
1179
+ (m.key === "Enter" || m.key === " ") && (m.preventDefault(), c(s.id));
63
1180
  },
64
1181
  children: [
65
- /* @__PURE__ */ c("div", { className: "flex items-start gap-ds-02b", children: [
1182
+ /* @__PURE__ */ e(
1183
+ "div",
1184
+ {
1185
+ className: I(
1186
+ "absolute -top-2 -left-2 z-10 transition-opacity",
1187
+ T || x ? "opacity-100 animate-scale-bounce" : "opacity-0 group-hover/card:opacity-100"
1188
+ ),
1189
+ children: /* @__PURE__ */ e(
1190
+ Me,
1191
+ {
1192
+ checked: x,
1193
+ onCheckedChange: () => h(s.id),
1194
+ onClick: (m) => m.stopPropagation(),
1195
+ "aria-label": `Select task ${s.taskId}`,
1196
+ className: "rounded-full bg-layer-01 shadow-01"
1197
+ }
1198
+ )
1199
+ }
1200
+ ),
1201
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-ds-02", children: [
1202
+ /* @__PURE__ */ e("span", { className: "text-ds-xs font-mono leading-none text-text-tertiary", children: s.taskId }),
1203
+ /* @__PURE__ */ e(S, { className: I("h-3 w-3 flex-shrink-0", u), title: `Priority: ${s.priority}` }),
1204
+ /* @__PURE__ */ e("div", { className: "flex-1" }),
66
1205
  /* @__PURE__ */ e(
67
1206
  "button",
68
1207
  {
69
- className: j(
70
- "mt-ds-01 flex-shrink-0 cursor-grab rounded p-ds-01 opacity-0 transition-opacity",
1208
+ className: I(
1209
+ "flex-shrink-0 cursor-grab rounded p-ds-01 opacity-0 transition-opacity",
71
1210
  "group-hover/card:opacity-[0.38] hover:!opacity-100",
72
1211
  "active:cursor-grabbing",
73
- r && "opacity-[0.38]"
1212
+ n && "opacity-[0.38]"
74
1213
  ),
75
- ...(h == null ? void 0 : h.attributes) ?? {},
76
- ...(h == null ? void 0 : h.listeners) ?? {},
1214
+ ...(r == null ? void 0 : r.attributes) ?? {},
1215
+ ...(r == null ? void 0 : r.listeners) ?? {},
77
1216
  "aria-label": `Drag handle for task: ${s.title}`,
78
1217
  "aria-roledescription": "sortable",
79
- onClick: (f) => f.stopPropagation(),
80
- children: /* @__PURE__ */ e(Re, { className: "h-ico-sm w-ico-sm text-icon-secondary" })
1218
+ onClick: (m) => m.stopPropagation(),
1219
+ children: /* @__PURE__ */ e(bt, { className: "h-ico-sm w-ico-sm text-icon-secondary" })
81
1220
  }
82
- ),
83
- /* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ e("p", { className: "text-ds-md font-medium text-text-primary line-clamp-2", children: s.title }) })
1221
+ )
84
1222
  ] }),
85
- /* @__PURE__ */ c("div", { className: "mt-ds-03 flex items-center gap-ds-03", children: [
86
- /* @__PURE__ */ e(
1223
+ /* @__PURE__ */ e("p", { className: "mt-ds-02 text-ds-sm font-medium text-text-primary line-clamp-2", children: s.title }),
1224
+ /* @__PURE__ */ a("div", { className: "mt-ds-03 flex items-center gap-ds-02", children: [
1225
+ g && /* @__PURE__ */ a(
87
1226
  "div",
88
1227
  {
89
- className: j(
90
- "h-2 w-2 rounded-ds-full flex-shrink-0",
91
- Me[s.priority]
1228
+ className: I(
1229
+ "flex items-center gap-ds-01 text-ds-xs leading-tight",
1230
+ g.className
92
1231
  ),
93
- title: je[s.priority]
1232
+ title: `Due: ${g.label}`,
1233
+ children: [
1234
+ /* @__PURE__ */ e(ye, { className: "h-3 w-3" }),
1235
+ /* @__PURE__ */ e("span", { children: g.label })
1236
+ ]
94
1237
  }
95
1238
  ),
96
- s.labels.length > 0 && /* @__PURE__ */ c("div", { className: "flex items-center gap-ds-02 overflow-hidden", children: [
97
- s.labels.slice(0, 2).map((f) => /* @__PURE__ */ e(Le, { size: "sm", className: "max-w-[80px] truncate", children: f }, f)),
98
- s.labels.length > 2 && /* @__PURE__ */ c("span", { className: "text-ds-xs text-text-tertiary", children: [
99
- "+",
100
- s.labels.length - 2
101
- ] })
102
- ] }),
103
- /* @__PURE__ */ e("div", { className: "flex-1" }),
104
- w && /* @__PURE__ */ c(
1239
+ s.subtaskCount > 0 && /* @__PURE__ */ a(
105
1240
  "div",
106
1241
  {
107
- className: j(
108
- "flex items-center gap-ds-01 text-ds-xs leading-tight",
109
- w.className
110
- ),
1242
+ className: "flex items-center gap-ds-01 text-ds-xs text-text-tertiary",
1243
+ title: `Subtasks: ${s.subtasksDone} of ${s.subtaskCount} done`,
111
1244
  children: [
112
- /* @__PURE__ */ e(Be, { className: "h-2.5 w-2.5" }),
113
- /* @__PURE__ */ e("span", { children: w.label })
1245
+ /* @__PURE__ */ e(kt, { className: "h-3 w-3" }),
1246
+ /* @__PURE__ */ a("span", { children: [
1247
+ s.subtasksDone,
1248
+ "/",
1249
+ s.subtaskCount
1250
+ ] })
114
1251
  ]
115
1252
  }
116
1253
  ),
117
- s.assignees.length > 0 && /* @__PURE__ */ e(
118
- $e,
119
- {
120
- users: s.assignees,
121
- size: "sm",
122
- max: 2,
123
- showTooltip: !1
124
- }
125
- )
1254
+ s.visibility === "EVERYONE" && /* @__PURE__ */ e("span", { className: "flex items-center text-text-tertiary", "aria-label": "Client visible", title: "Visible to client", children: /* @__PURE__ */ e(X, { className: "h-3 w-3" }) }),
1255
+ s.isBlocked && /* @__PURE__ */ e("span", { className: "flex items-center text-error", "aria-label": "Blocked", title: "Blocked", children: /* @__PURE__ */ e(Ct, { className: "h-3 w-3" }) }),
1256
+ /* @__PURE__ */ e("div", { className: "flex-1" }),
1257
+ l.length > 0 && /* @__PURE__ */ a("div", { className: "flex items-center flex-shrink-0", children: [
1258
+ l.slice(0, 3).map((m, C) => /* @__PURE__ */ a(
1259
+ Dt,
1260
+ {
1261
+ size: "xs",
1262
+ className: I(
1263
+ "text-ds-xs border-2 border-layer-01",
1264
+ C > 0 && "-ml-ds-02b",
1265
+ m.isOwner && "shadow-[0_0_0_1.5px_rgba(var(--accent-rgb,99,102,241),0.35),0_0_6px_rgba(var(--accent-rgb,99,102,241),0.2)]"
1266
+ ),
1267
+ style: { zIndex: l.length - C },
1268
+ title: m.name,
1269
+ children: [
1270
+ m.image && /* @__PURE__ */ e(Tt, { src: m.image, alt: m.name }),
1271
+ /* @__PURE__ */ e(Rt, { className: "font-body font-semibold", children: _e(m.name) })
1272
+ ]
1273
+ },
1274
+ C
1275
+ )),
1276
+ l.length > 3 && /* @__PURE__ */ a("span", { className: "ml-ds-01 text-ds-xs text-text-tertiary", children: [
1277
+ "+",
1278
+ l.length - 3
1279
+ ] })
1280
+ ] })
126
1281
  ] })
127
1282
  ]
128
1283
  }
129
1284
  );
130
1285
  }
131
- const ie = F.forwardRef(
132
- function({ task: t, onClickTask: r }, h) {
1286
+ const Ve = j.forwardRef(
1287
+ function({ task: t }, n) {
133
1288
  const {
134
- attributes: m,
135
- listeners: w,
136
- setNodeRef: f,
137
- transform: D,
138
- transition: C,
139
- isDragging: T
140
- } = fe({
1289
+ attributes: r,
1290
+ listeners: o,
1291
+ setNodeRef: h,
1292
+ transform: b,
1293
+ transition: v,
1294
+ isDragging: d
1295
+ } = Ce({
141
1296
  id: t.id,
142
1297
  data: {
143
1298
  type: "task",
144
1299
  task: t
145
1300
  }
146
- }), E = se(f, h), x = {
147
- transform: ue.Transform.toString(D),
148
- transition: C
1301
+ }), c = Ae(h, n), x = {
1302
+ transform: Ne.Transform.toString(b),
1303
+ transition: v
149
1304
  };
150
- return /* @__PURE__ */ e("div", { ref: E, style: x, children: /* @__PURE__ */ e(
151
- ae,
1305
+ return /* @__PURE__ */ e("div", { ref: c, style: x, children: /* @__PURE__ */ e(
1306
+ ze,
152
1307
  {
153
1308
  task: t,
154
- isDragging: T,
155
- dragHandleProps: { attributes: m, listeners: w },
156
- onClickTask: r
1309
+ isDragging: d,
1310
+ dragHandleProps: { attributes: r, listeners: o }
157
1311
  }
158
1312
  ) });
159
1313
  }
160
1314
  );
161
- ie.displayName = "TaskCard";
162
- const ne = F.forwardRef(
163
- function({ task: t }, r) {
164
- return /* @__PURE__ */ e("div", { ref: r, children: /* @__PURE__ */ e(ae, { task: t, isDragOverlay: !0 }) });
1315
+ Ve.displayName = "TaskCard";
1316
+ const Qt = Ie(
1317
+ "group/card flex items-center gap-ds-02 py-2 pl-3 pr-ds-03 border border-transparent rounded-ds-lg bg-layer-01 transition-all duration-fast-02 ease-productive-standard cursor-pointer hover:bg-layer-active hover:shadow-02 hover:-translate-y-px",
1318
+ {
1319
+ variants: {
1320
+ selected: {
1321
+ true: "ring-1 ring-accent/50 shadow-[0_0_6px_rgba(var(--accent-rgb,99,102,241),0.15)] animate-glow-pulse",
1322
+ false: ""
1323
+ },
1324
+ dimmed: {
1325
+ true: "opacity-40",
1326
+ false: ""
1327
+ }
1328
+ },
1329
+ defaultVariants: {
1330
+ selected: !1,
1331
+ dimmed: !1
1332
+ }
165
1333
  }
166
1334
  );
167
- ne.displayName = "TaskCardOverlay";
168
- const te = [
169
- "border-l-category-cyan",
170
- "border-l-category-amber",
171
- "border-l-category-teal",
172
- "border-l-category-indigo",
173
- "border-l-category-orange",
174
- "border-l-category-emerald",
175
- "border-l-category-slate",
176
- "border-l-accent"
177
- ], oe = F.forwardRef(
178
- function({
179
- column: t,
180
- index: r,
181
- isOverlay: h,
182
- onAddTask: m,
183
- onClickTask: w,
184
- onRenameColumn: f,
185
- onDeleteColumn: D,
186
- onToggleVisibility: C
187
- }, T) {
188
- const [E, x] = O(!1), [k, S] = O(""), [G, R] = O(!1), [B, K] = O(t.name), z = J(null), P = J(null), { setNodeRef: g, isOver: V } = pe({
189
- id: `column-${t.id}`,
190
- data: {
191
- type: "column",
192
- column: t
193
- }
194
- }), I = t.tasks.map((o) => o.id), A = te[r % te.length], M = () => {
195
- k.trim() && (m(t.id, k.trim()), S(""), x(!1));
196
- }, W = (o) => {
197
- o.key === "Enter" && M(), o.key === "Escape" && (S(""), x(!1));
198
- }, _ = () => {
199
- B.trim() && B.trim() !== t.name && (f == null || f(t.id, B.trim())), R(!1);
200
- }, Y = (o) => {
201
- o.key === "Enter" && _(), o.key === "Escape" && (K(t.name), R(!1));
202
- };
203
- return /* @__PURE__ */ c(
204
- "div",
205
- {
206
- ref: T,
207
- className: j(
208
- /* intentional: board column fixed width matches add-column button */
209
- "flex h-full w-[300px] flex-shrink-0 flex-col rounded-ds-xl border-l-[3px] bg-layer-01 shadow-01",
210
- A,
211
- h && "shadow-04"
212
- ),
213
- children: [
214
- /* @__PURE__ */ c("div", { className: "flex items-center gap-ds-03 px-ds-04 py-ds-04", children: [
215
- G ? /* @__PURE__ */ e(
216
- H,
217
- {
218
- ref: P,
219
- value: B,
220
- onChange: (o) => K(o.target.value),
221
- onBlur: _,
222
- onKeyDown: Y,
223
- className: "h-ds-xs-plus text-ds-md font-semibold",
224
- autoFocus: !0
225
- }
226
- ) : /* @__PURE__ */ e(
227
- "h3",
228
- {
229
- className: "text-ds-md font-semibold text-text-primary truncate",
230
- onDoubleClick: () => {
231
- K(t.name), R(!0);
232
- },
233
- children: t.name
234
- }
1335
+ function Fe({
1336
+ task: s,
1337
+ isDragging: t,
1338
+ isDragOverlay: n
1339
+ }) {
1340
+ var k;
1341
+ const {
1342
+ selectedTaskIds: r,
1343
+ toggleTaskSelection: o,
1344
+ focusedTaskId: h,
1345
+ currentUserId: b,
1346
+ highlightMyTasks: v,
1347
+ onClickTask: d
1348
+ } = U(), c = r.has(s.id), x = r.size > 0, T = h === s.id, y = $e[s.priority], g = ce[s.priority], S = v && b != null && ((k = s.owner) == null ? void 0 : k.id) !== b && !s.assignees.some((l) => l.id === b), u = s.owner ?? s.assignees[0] ?? null;
1349
+ return /* @__PURE__ */ a(
1350
+ "div",
1351
+ {
1352
+ role: "group",
1353
+ tabIndex: 0,
1354
+ "data-task-id": s.id,
1355
+ "aria-label": `Task ${s.taskId}: ${s.title}`,
1356
+ className: I(
1357
+ "relative",
1358
+ Qt({
1359
+ selected: c,
1360
+ dimmed: S
1361
+ }),
1362
+ t && "opacity-40",
1363
+ n && "scale-[1.03] rotate-[1.5deg] shadow-03",
1364
+ T && "ring-1 ring-focus"
1365
+ ),
1366
+ onClick: () => d(s.id),
1367
+ onKeyDown: (l) => {
1368
+ (l.key === "Enter" || l.key === " ") && (l.preventDefault(), d(s.id));
1369
+ },
1370
+ children: [
1371
+ /* @__PURE__ */ e(
1372
+ "div",
1373
+ {
1374
+ className: I(
1375
+ "absolute -top-1.5 -left-1.5 z-10 transition-opacity",
1376
+ x || c ? "opacity-100 animate-scale-bounce" : "opacity-0 group-hover/card:opacity-100"
235
1377
  ),
236
- /* @__PURE__ */ e("span", { className: "flex h-5 min-w-[20px] items-center justify-center rounded-ds-full bg-field px-ds-02b text-ds-sm font-medium text-text-tertiary", children: t.tasks.length }),
237
- t.isClientVisible && /* @__PURE__ */ e(
238
- ee,
1378
+ children: /* @__PURE__ */ e(
1379
+ Me,
239
1380
  {
240
- className: "h-3 w-3 text-text-tertiary",
241
- "aria-label": "Visible to client"
242
- }
243
- ),
244
- /* @__PURE__ */ e("div", { className: "flex-1" }),
245
- /* @__PURE__ */ e(
246
- $,
247
- {
248
- variant: "ghost",
249
- size: "icon-md",
250
- className: "h-ds-xs w-ds-xs opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 focus:opacity-100 hover:bg-interactive-subtle hover:text-interactive transition-opacity",
251
- "aria-label": "Add task",
252
- onClick: () => {
253
- x(!0), setTimeout(() => {
254
- var o;
255
- return (o = z.current) == null ? void 0 : o.focus();
256
- }, 50);
257
- },
258
- children: /* @__PURE__ */ e(Q, { className: "h-ico-sm w-ico-sm" })
1381
+ checked: c,
1382
+ onCheckedChange: () => o(s.id),
1383
+ onClick: (l) => l.stopPropagation(),
1384
+ "aria-label": `Select task ${s.taskId}`,
1385
+ className: "rounded-full bg-layer-01 shadow-01"
259
1386
  }
1387
+ )
1388
+ }
1389
+ ),
1390
+ /* @__PURE__ */ e(y, { className: I("h-3.5 w-3.5 flex-shrink-0", g), title: `Priority: ${s.priority}` }),
1391
+ /* @__PURE__ */ e("span", { className: "text-ds-xs font-mono text-text-tertiary flex-shrink-0", children: s.taskId }),
1392
+ /* @__PURE__ */ e("span", { className: "text-ds-sm text-text-primary line-clamp-1 flex-1 min-w-0", children: s.title }),
1393
+ s.subtaskCount > 0 && /* @__PURE__ */ a("span", { className: "text-ds-xs text-text-tertiary flex-shrink-0", children: [
1394
+ s.subtasksDone,
1395
+ "/",
1396
+ s.subtaskCount
1397
+ ] }),
1398
+ u && /* @__PURE__ */ e(
1399
+ "div",
1400
+ {
1401
+ className: I(
1402
+ "flex h-[14px] w-[14px] shrink-0 items-center justify-center rounded-full border border-layer-01 bg-interactive-subtle text-[6px] font-semibold leading-none text-interactive overflow-hidden",
1403
+ s.owner && "shadow-[0_0_0_1px_rgba(var(--accent-rgb,99,102,241),0.35),0_0_4px_rgba(var(--accent-rgb,99,102,241),0.2)]"
260
1404
  ),
261
- /* @__PURE__ */ c(Ce, { children: [
262
- /* @__PURE__ */ e(Se, { asChild: !0, children: /* @__PURE__ */ e(
263
- $,
264
- {
265
- variant: "ghost",
266
- size: "icon-md",
267
- className: "h-ds-xs w-ds-xs opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 focus:opacity-100 transition-opacity",
268
- "aria-label": "Column options",
269
- children: /* @__PURE__ */ e(Ke, { className: "h-ico-sm w-ico-sm" })
270
- }
271
- ) }),
272
- /* @__PURE__ */ c(Oe, { align: "end", className: "w-44", children: [
273
- /* @__PURE__ */ c(
274
- q,
275
- {
276
- onClick: () => {
277
- K(t.name), R(!0);
278
- },
279
- children: [
280
- /* @__PURE__ */ e(Ae, { className: "mr-ds-03 h-ico-sm w-ico-sm" }),
281
- "Rename"
282
- ]
283
- }
284
- ),
1405
+ title: u.name,
1406
+ children: u.image ? /* @__PURE__ */ e("img", { src: u.image, alt: u.name, className: "h-full w-full object-cover" }) : _e(u.name)
1407
+ }
1408
+ )
1409
+ ]
1410
+ }
1411
+ );
1412
+ }
1413
+ const Ue = j.forwardRef(
1414
+ function({ task: t }, n) {
1415
+ const {
1416
+ attributes: r,
1417
+ listeners: o,
1418
+ setNodeRef: h,
1419
+ transform: b,
1420
+ transition: v,
1421
+ isDragging: d
1422
+ } = Ce({
1423
+ id: t.id,
1424
+ data: {
1425
+ type: "task",
1426
+ task: t
1427
+ }
1428
+ }), c = Ae(h, n), x = {
1429
+ transform: Ne.Transform.toString(b),
1430
+ transition: v
1431
+ };
1432
+ return /* @__PURE__ */ e("div", { ref: c, style: x, children: /* @__PURE__ */ e(
1433
+ Fe,
1434
+ {
1435
+ task: t,
1436
+ isDragging: d,
1437
+ dragHandleProps: { attributes: r, listeners: o }
1438
+ }
1439
+ ) });
1440
+ }
1441
+ );
1442
+ Ue.displayName = "TaskCardCompact";
1443
+ const Ke = j.forwardRef(function({ task: t }, n) {
1444
+ return /* @__PURE__ */ e("div", { ref: n, children: /* @__PURE__ */ e(Fe, { task: t, isDragOverlay: !0 }) });
1445
+ });
1446
+ Ke.displayName = "TaskCardCompactOverlay";
1447
+ const Ge = j.forwardRef(
1448
+ function({ task: t }, n) {
1449
+ return /* @__PURE__ */ e("div", { ref: n, children: /* @__PURE__ */ e(ze, { task: t, isDragOverlay: !0 }) });
1450
+ }
1451
+ );
1452
+ Ge.displayName = "TaskCardOverlay";
1453
+ const jt = [
1454
+ { value: "LOW", label: "Low", icon: Se },
1455
+ { value: "MEDIUM", label: "Medium", icon: fe },
1456
+ { value: "HIGH", label: "High", icon: Re },
1457
+ { value: "URGENT", label: "Urgent", icon: le }
1458
+ ];
1459
+ function He({ taskId: s, children: t }) {
1460
+ const {
1461
+ rawColumns: n,
1462
+ onQuickPriorityChange: r,
1463
+ onQuickAssign: o,
1464
+ onQuickLabelAdd: h,
1465
+ onQuickDueDateChange: b,
1466
+ onQuickVisibilityChange: v,
1467
+ onQuickDelete: d
1468
+ } = U(), c = de(n), x = Ee(n), T = j.useRef(null);
1469
+ return /* @__PURE__ */ a(St, { children: [
1470
+ /* @__PURE__ */ e(At, { children: t }),
1471
+ /* @__PURE__ */ a(Mt, { className: "w-52 animate-scale-in", children: [
1472
+ /* @__PURE__ */ a(Z, { children: [
1473
+ /* @__PURE__ */ a(ee, { children: [
1474
+ /* @__PURE__ */ e(le, { className: "mr-ds-03 h-ico-sm w-ico-sm" }),
1475
+ "Set Priority"
1476
+ ] }),
1477
+ /* @__PURE__ */ e(te, { className: "w-40", children: jt.map((y) => {
1478
+ const g = y.icon;
1479
+ return /* @__PURE__ */ a(
1480
+ H,
1481
+ {
1482
+ onSelect: () => r(s, y.value),
1483
+ children: [
285
1484
  /* @__PURE__ */ e(
286
- q,
1485
+ g,
287
1486
  {
288
- onClick: () => C == null ? void 0 : C(t.id, !t.isClientVisible),
289
- children: t.isClientVisible ? /* @__PURE__ */ c(X, { children: [
290
- /* @__PURE__ */ e(Te, { className: "mr-ds-03 h-ico-sm w-ico-sm" }),
291
- "Hide from client"
292
- ] }) : /* @__PURE__ */ c(X, { children: [
293
- /* @__PURE__ */ e(ee, { className: "mr-ds-03 h-ico-sm w-ico-sm" }),
294
- "Show to client"
295
- ] })
1487
+ className: I(
1488
+ "mr-ds-03 h-ico-sm w-ico-sm",
1489
+ ce[y.value]
1490
+ )
296
1491
  }
297
1492
  ),
298
- /* @__PURE__ */ e(Ee, {}),
299
- /* @__PURE__ */ c(
300
- q,
301
- {
302
- className: "text-error focus:text-error",
303
- onClick: () => D == null ? void 0 : D(t.id),
304
- children: [
305
- /* @__PURE__ */ e(ze, { className: "mr-ds-03 h-ico-sm w-ico-sm" }),
306
- "Delete column"
307
- ]
308
- }
309
- )
310
- ] })
311
- ] })
312
- ] }),
313
- /* @__PURE__ */ c(
314
- "div",
315
- {
316
- ref: g,
317
- className: j(
318
- "no-scrollbar flex flex-1 flex-col gap-ds-03 overflow-y-auto px-ds-03 pb-ds-03 transition-colors duration-fast-02 ease-productive-standard",
319
- V && "bg-interactive-subtle/50"
320
- ),
321
- children: [
322
- /* @__PURE__ */ e(re, { items: I, strategy: xe, children: t.tasks.map((o) => /* @__PURE__ */ e(ie, { task: o, onClickTask: w }, o.id)) }),
323
- t.tasks.length === 0 && !E && /* @__PURE__ */ e("div", { className: "flex flex-1 items-center justify-center py-ds-07", children: /* @__PURE__ */ e("p", { className: "text-ds-sm text-text-placeholder", children: "No tasks" }) })
1493
+ y.label
324
1494
  ]
325
- }
326
- ),
327
- E ? /* @__PURE__ */ c("div", { className: "border-t border-border-subtle p-ds-03", children: [
1495
+ },
1496
+ y.value
1497
+ );
1498
+ }) })
1499
+ ] }),
1500
+ c.length > 0 && /* @__PURE__ */ a(Z, { children: [
1501
+ /* @__PURE__ */ a(ee, { children: [
1502
+ /* @__PURE__ */ e(q, { className: "mr-ds-03 h-ico-sm w-ico-sm" }),
1503
+ "Assign"
1504
+ ] }),
1505
+ /* @__PURE__ */ e(te, { className: "w-44 max-h-48 overflow-y-auto", children: c.map((y) => /* @__PURE__ */ e(
1506
+ H,
1507
+ {
1508
+ onSelect: () => o(s, y.id),
1509
+ children: y.name
1510
+ },
1511
+ y.id
1512
+ )) })
1513
+ ] }),
1514
+ /* @__PURE__ */ a(Z, { children: [
1515
+ /* @__PURE__ */ a(ee, { children: [
1516
+ /* @__PURE__ */ e(Nt, { className: "mr-ds-03 h-ico-sm w-ico-sm" }),
1517
+ "Add Label"
1518
+ ] }),
1519
+ /* @__PURE__ */ e(te, { className: "w-40 max-h-48 overflow-y-auto", children: x.length > 0 ? x.map((y) => /* @__PURE__ */ e(
1520
+ H,
1521
+ {
1522
+ onSelect: () => h(s, y),
1523
+ children: y
1524
+ },
1525
+ y
1526
+ )) : /* @__PURE__ */ e("div", { className: "px-ds-03 py-ds-02 text-ds-xs text-text-tertiary", children: "No labels found" }) })
1527
+ ] }),
1528
+ /* @__PURE__ */ a(
1529
+ H,
1530
+ {
1531
+ onSelect: (y) => {
1532
+ var g;
1533
+ y.preventDefault(), (g = T.current) == null || g.showPicker();
1534
+ },
1535
+ children: [
1536
+ /* @__PURE__ */ e(ye, { className: "mr-ds-03 h-ico-sm w-ico-sm" }),
1537
+ "Set Due Date",
328
1538
  /* @__PURE__ */ e(
329
- H,
1539
+ "input",
330
1540
  {
331
- ref: z,
332
- value: k,
333
- onChange: (o) => S(o.target.value),
334
- onKeyDown: W,
335
- onBlur: () => {
336
- k.trim() || x(!1);
1541
+ ref: T,
1542
+ type: "date",
1543
+ className: "absolute opacity-0 pointer-events-none w-0 h-0",
1544
+ onChange: (y) => {
1545
+ b(s, y.target.value || null);
337
1546
  },
338
- placeholder: "Task title...",
339
- className: "h-ds-sm text-ds-md",
340
- autoFocus: !0
1547
+ tabIndex: -1
341
1548
  }
342
- ),
343
- /* @__PURE__ */ c("div", { className: "mt-ds-02b flex items-center gap-ds-02", children: [
344
- /* @__PURE__ */ e(
345
- $,
346
- {
347
- size: "sm",
348
- className: "h-ds-xs-plus bg-interactive hover:bg-interactive-hover text-text-on-color text-ds-sm",
349
- onClick: M,
350
- disabled: !k.trim(),
351
- children: "Add"
352
- }
353
- ),
354
- /* @__PURE__ */ e(
355
- $,
356
- {
357
- variant: "ghost",
358
- size: "sm",
359
- className: "h-ds-xs-plus text-ds-sm",
360
- onClick: () => {
361
- S(""), x(!1);
362
- },
363
- children: "Cancel"
364
- }
365
- )
366
- ] })
367
- ] }) : /* @__PURE__ */ c(
368
- "button",
1549
+ )
1550
+ ]
1551
+ }
1552
+ ),
1553
+ /* @__PURE__ */ a(Z, { children: [
1554
+ /* @__PURE__ */ a(ee, { children: [
1555
+ /* @__PURE__ */ e(X, { className: "mr-ds-03 h-ico-sm w-ico-sm" }),
1556
+ "Visibility"
1557
+ ] }),
1558
+ /* @__PURE__ */ a(te, { className: "w-44", children: [
1559
+ /* @__PURE__ */ a(
1560
+ H,
369
1561
  {
370
- onClick: () => {
371
- x(!0), setTimeout(() => {
372
- var o;
373
- return (o = z.current) == null ? void 0 : o.focus();
374
- }, 50);
375
- },
376
- className: "flex items-center gap-ds-02b border-t border-border-subtle px-ds-04 py-ds-03 text-ds-sm text-text-placeholder transition-colors hover:bg-field hover:text-text-tertiary",
1562
+ onSelect: () => v(s, "INTERNAL"),
1563
+ children: [
1564
+ /* @__PURE__ */ e(Te, { className: "mr-ds-03 h-ico-sm w-ico-sm" }),
1565
+ "Internal only"
1566
+ ]
1567
+ }
1568
+ ),
1569
+ /* @__PURE__ */ a(
1570
+ H,
1571
+ {
1572
+ onSelect: () => v(s, "EVERYONE"),
1573
+ children: [
1574
+ /* @__PURE__ */ e(X, { className: "mr-ds-03 h-ico-sm w-ico-sm" }),
1575
+ "Visible to all"
1576
+ ]
1577
+ }
1578
+ )
1579
+ ] })
1580
+ ] }),
1581
+ /* @__PURE__ */ e(Lt, {}),
1582
+ /* @__PURE__ */ a(
1583
+ H,
1584
+ {
1585
+ className: "text-error focus:text-error",
1586
+ onSelect: () => d(s),
1587
+ children: [
1588
+ /* @__PURE__ */ e(pe, { className: "mr-ds-03 h-ico-sm w-ico-sm" }),
1589
+ "Delete"
1590
+ ]
1591
+ }
1592
+ )
1593
+ ] })
1594
+ ] });
1595
+ }
1596
+ He.displayName = "TaskContextMenu";
1597
+ const Qe = j.forwardRef(
1598
+ function({ column: t, index: n, isOverlay: r }, o) {
1599
+ const { viewMode: h } = U(), { setNodeRef: b, isOver: v } = Je({
1600
+ id: `column-${t.id}`,
1601
+ data: {
1602
+ type: "column",
1603
+ column: t
1604
+ }
1605
+ }), d = t.tasks.map((x) => x.id), c = t.wipLimit != null && t.tasks.length > t.wipLimit;
1606
+ return /* @__PURE__ */ a(
1607
+ "div",
1608
+ {
1609
+ ref: o,
1610
+ className: I(
1611
+ "flex h-full flex-shrink-0 flex-col rounded-ds-xl bg-layer-01/40 backdrop-blur-[2px] border border-border-subtle/20 hover:border-border-subtle/40 transition-colors p-1",
1612
+ r && "shadow-04",
1613
+ c && "bg-error-surface/50"
1614
+ ),
1615
+ style: { width: Et },
1616
+ children: [
1617
+ /* @__PURE__ */ e(Pe, { column: t, index: n }),
1618
+ /* @__PURE__ */ a(
1619
+ "div",
1620
+ {
1621
+ ref: b,
1622
+ className: I(
1623
+ "no-scrollbar flex flex-1 flex-col gap-ds-02 overflow-y-auto px-ds-03 pt-2.5 pb-ds-03 transition-colors duration-fast-02 ease-productive-standard",
1624
+ v && "bg-interactive-subtle/30"
1625
+ ),
377
1626
  children: [
378
- /* @__PURE__ */ e(Q, { className: "h-3 w-3" }),
379
- "Add task"
1627
+ /* @__PURE__ */ e(De, { items: d, strategy: Ze, children: t.tasks.map((x, T) => /* @__PURE__ */ e(
1628
+ "div",
1629
+ {
1630
+ className: "animate-slide-up delay-stagger",
1631
+ style: { "--stagger-index": T },
1632
+ children: /* @__PURE__ */ e(He, { taskId: x.id, children: h === "compact" ? /* @__PURE__ */ e(Ue, { task: x }) : /* @__PURE__ */ e(Ve, { task: x }) })
1633
+ },
1634
+ x.id
1635
+ )) }),
1636
+ t.tasks.length === 0 && /* @__PURE__ */ e(
1637
+ We,
1638
+ {
1639
+ index: n,
1640
+ isDropTarget: v
1641
+ }
1642
+ )
380
1643
  ]
381
1644
  }
382
1645
  )
@@ -385,8 +1648,118 @@ const te = [
385
1648
  );
386
1649
  }
387
1650
  );
388
- oe.displayName = "BoardColumn";
389
- function Ge() {
1651
+ Qe.displayName = "BoardColumn";
1652
+ function Yt(s) {
1653
+ const {
1654
+ columns: t,
1655
+ focusedTaskId: n,
1656
+ setFocusedTaskId: r,
1657
+ selectedTaskIds: o,
1658
+ toggleTaskSelection: h,
1659
+ selectRange: b,
1660
+ clearSelection: v,
1661
+ clearFilters: d,
1662
+ hasActiveFilters: c,
1663
+ onClickTask: x
1664
+ } = U(), T = E(
1665
+ (u) => {
1666
+ for (let k = 0; k < t.length; k++)
1667
+ for (let l = 0; l < t[k].tasks.length; l++)
1668
+ if (t[k].tasks[l].id === u)
1669
+ return { columnIndex: k, taskIndex: l, taskId: u };
1670
+ return null;
1671
+ },
1672
+ [t]
1673
+ ), y = E(
1674
+ (u, k) => {
1675
+ const l = t[u];
1676
+ if (!l) return null;
1677
+ const p = l.tasks[k];
1678
+ return (p == null ? void 0 : p.id) ?? null;
1679
+ },
1680
+ [t]
1681
+ ), g = E((u) => {
1682
+ const k = document.querySelector(`[data-task-id="${u}"]`);
1683
+ k && k.scrollIntoView({ block: "nearest", behavior: "smooth" });
1684
+ }, []), S = E(
1685
+ (u) => {
1686
+ const k = u.target;
1687
+ if (!(k.tagName === "INPUT" || k.tagName === "TEXTAREA" || k.isContentEditable))
1688
+ switch (u.key) {
1689
+ case "ArrowDown":
1690
+ case "ArrowUp": {
1691
+ u.preventDefault();
1692
+ const l = u.key === "ArrowDown" ? 1 : -1;
1693
+ if (!n) {
1694
+ for (const i of t)
1695
+ if (i.tasks.length > 0) {
1696
+ const f = i.tasks[0].id;
1697
+ r(f), g(f);
1698
+ break;
1699
+ }
1700
+ return;
1701
+ }
1702
+ const p = T(n);
1703
+ if (!p) return;
1704
+ const m = p.taskIndex + l, C = y(p.columnIndex, m);
1705
+ C && (r(C), g(C), u.shiftKey && n && b(n, C));
1706
+ return;
1707
+ }
1708
+ case "ArrowLeft":
1709
+ case "ArrowRight": {
1710
+ u.preventDefault();
1711
+ const l = u.key === "ArrowRight" ? 1 : -1;
1712
+ if (!n) return;
1713
+ const p = T(n);
1714
+ if (!p) return;
1715
+ let m = p.columnIndex + l;
1716
+ for (; m >= 0 && m < t.length; ) {
1717
+ if (t[m].tasks.length > 0) {
1718
+ const C = Math.min(p.taskIndex, t[m].tasks.length - 1), i = t[m].tasks[C].id;
1719
+ r(i), g(i);
1720
+ return;
1721
+ }
1722
+ m += l;
1723
+ }
1724
+ return;
1725
+ }
1726
+ case "Enter": {
1727
+ n && (u.preventDefault(), x(n));
1728
+ return;
1729
+ }
1730
+ case " ": {
1731
+ n && (u.preventDefault(), h(n));
1732
+ return;
1733
+ }
1734
+ case "Escape": {
1735
+ u.preventDefault(), o.size > 0 ? v() : c && d();
1736
+ return;
1737
+ }
1738
+ }
1739
+ },
1740
+ [
1741
+ n,
1742
+ t,
1743
+ o,
1744
+ c,
1745
+ T,
1746
+ y,
1747
+ r,
1748
+ g,
1749
+ h,
1750
+ b,
1751
+ v,
1752
+ d,
1753
+ x
1754
+ ]
1755
+ );
1756
+ oe(() => {
1757
+ const u = s.current;
1758
+ if (u)
1759
+ return u.addEventListener("keydown", S), () => u.removeEventListener("keydown", S);
1760
+ }, [s, S]);
1761
+ }
1762
+ function qt() {
390
1763
  return {
391
1764
  onDragStart({ active: s }) {
392
1765
  const t = s.data.current;
@@ -394,204 +1767,183 @@ function Ge() {
394
1767
  },
395
1768
  onDragOver({ active: s, over: t }) {
396
1769
  if (!t) return;
397
- const r = s.data.current;
398
- if ((r == null ? void 0 : r.type) === "task")
399
- return `Task ${r.task.title} is over ${t.id}`;
1770
+ const n = s.data.current;
1771
+ if ((n == null ? void 0 : n.type) === "task")
1772
+ return `Task ${n.task.title} is over ${t.id}`;
400
1773
  },
401
1774
  onDragEnd({ active: s, over: t }) {
402
1775
  if (!t) return "Dropped item";
403
- const r = s.data.current;
404
- return (r == null ? void 0 : r.type) === "task" ? `Dropped task: ${r.task.title}` : "Dropped item";
1776
+ const n = s.data.current;
1777
+ return (n == null ? void 0 : n.type) === "task" ? `Dropped task: ${n.task.title}` : "Dropped item";
405
1778
  },
406
1779
  onDragCancel() {
407
1780
  return "Dragging cancelled";
408
1781
  }
409
1782
  };
410
1783
  }
411
- const Pe = F.forwardRef(
412
- function({
413
- initialData: t,
414
- onTaskMove: r,
415
- onTaskAdd: h,
416
- onColumnRename: m,
417
- onColumnDelete: w,
418
- onColumnToggleVisibility: f,
419
- onClickTask: D,
420
- onAddColumn: C
421
- }, T) {
422
- const [E, x] = O(t), [k, S] = O(null), [G, R] = O(!1), B = J(null), K = se(B, T);
423
- Z(() => {
424
- x(t);
425
- }, [t]), Z(() => {
426
- R(!0);
427
- }, []);
428
- const z = be(
429
- U(De, {
430
- activationConstraint: {
431
- distance: 5
432
- }
433
- }),
434
- U(Ie, {
435
- activationConstraint: {
436
- delay: 200,
437
- tolerance: 5
438
- }
439
- }),
440
- U(ke, {
441
- coordinateGetter: we
442
- })
443
- ), P = le(() => Ge(), []), g = E.columns, V = g.map((a) => `column-${a.id}`), I = L(
444
- (a) => {
445
- for (const i of g)
446
- if (i.tasks.some((p) => p.id === a))
447
- return i.id;
448
- return null;
449
- },
450
- [g]
451
- ), A = L(
452
- (a, i, p, u) => {
453
- x((v) => {
454
- const y = v.columns.map((b) => ({
455
- ...b,
456
- tasks: [...b.tasks]
457
- })), d = y.find((b) => b.id === i), N = y.find((b) => b.id === p);
458
- if (!d || !N) return v;
459
- const n = d.tasks.findIndex((b) => b.id === a);
460
- if (n === -1) return v;
461
- const [l] = d.tasks.splice(n, 1);
462
- return N.tasks.splice(u, 0, l), { columns: y };
463
- });
464
- },
465
- []
466
- ), M = L((a) => {
467
- const i = a.active.data.current;
468
- (i == null ? void 0 : i.type) === "task" && S(i.task);
469
- }, []), W = L(
470
- (a) => {
471
- const { active: i, over: p } = a;
472
- if (!p) return;
473
- const u = i.id, v = p.id, y = I(u);
474
- if (!y) return;
475
- let d = null, N = 0;
476
- if (v.startsWith("column-")) {
477
- d = v.replace("column-", "");
478
- const n = g.find((l) => l.id === d);
479
- N = (n == null ? void 0 : n.tasks.length) ?? 0;
480
- } else if (d = I(v), d) {
481
- const n = g.find((l) => l.id === d);
482
- N = (n == null ? void 0 : n.tasks.findIndex((l) => l.id === v)) ?? 0;
1784
+ function Xt({ className: s }) {
1785
+ const {
1786
+ columns: t,
1787
+ viewMode: n,
1788
+ activeTask: r,
1789
+ setActiveTask: o,
1790
+ onTaskMove: h,
1791
+ onAddColumn: b
1792
+ } = U(), [v, d] = A(!1);
1793
+ ae(null);
1794
+ const c = ae(null);
1795
+ Yt(c), oe(() => {
1796
+ d(!0);
1797
+ }, []);
1798
+ const x = et(
1799
+ he(lt, {
1800
+ activationConstraint: { distance: 5 }
1801
+ }),
1802
+ he(ot, {
1803
+ activationConstraint: { delay: 200, tolerance: 5 }
1804
+ }),
1805
+ he(it, {
1806
+ coordinateGetter: rt
1807
+ })
1808
+ ), T = ne(() => qt(), []), y = t.map((l) => `column-${l.id}`), g = E(
1809
+ (l) => {
1810
+ for (const p of t)
1811
+ if (p.tasks.some((m) => m.id === l))
1812
+ return p.id;
1813
+ return null;
1814
+ },
1815
+ [t]
1816
+ ), S = E(
1817
+ (l) => {
1818
+ const p = l.active.data.current;
1819
+ (p == null ? void 0 : p.type) === "task" && o(p.task);
1820
+ },
1821
+ [o]
1822
+ ), u = E(
1823
+ (l) => {
1824
+ const { active: p, over: m } = l;
1825
+ if (!m) return;
1826
+ const C = p.id, i = m.id, f = g(C);
1827
+ if (!f) return;
1828
+ let D = null, M = 0;
1829
+ if (i.startsWith("column-")) {
1830
+ D = i.replace("column-", "");
1831
+ const N = t.find((R) => R.id === D);
1832
+ M = (N == null ? void 0 : N.tasks.length) ?? 0;
1833
+ } else if (D = g(i), D) {
1834
+ const N = t.find((R) => R.id === D);
1835
+ M = (N == null ? void 0 : N.tasks.findIndex((R) => R.id === i)) ?? 0;
1836
+ }
1837
+ !D || f === D || h(C, D, M);
1838
+ },
1839
+ [t, g, h]
1840
+ ), k = E(
1841
+ (l) => {
1842
+ const { active: p, over: m } = l;
1843
+ if (o(null), !m) return;
1844
+ const C = p.id, i = m.id, f = g(C);
1845
+ if (!f) return;
1846
+ let D, M;
1847
+ if (i.startsWith("column-")) {
1848
+ D = i.replace("column-", "");
1849
+ const N = t.find((R) => R.id === D);
1850
+ if (M = (N == null ? void 0 : N.tasks.length) ?? 0, f === D) {
1851
+ const R = N == null ? void 0 : N.tasks.findIndex((B) => B.id === C);
1852
+ R !== void 0 && R >= 0 && (M = R);
483
1853
  }
484
- !d || y === d || A(u, y, d, N);
485
- },
486
- [g, I, A]
487
- ), _ = L(
488
- (a) => {
489
- const { active: i, over: p } = a;
490
- if (S(null), !p) return;
491
- const u = i.id, v = p.id, y = I(u);
492
- if (!y) return;
493
- let d, N;
494
- if (v.startsWith("column-")) {
495
- d = v.replace("column-", "");
496
- const n = g.find((l) => l.id === d);
497
- if (N = (n == null ? void 0 : n.tasks.length) ?? 0, y === d) {
498
- const l = n == null ? void 0 : n.tasks.findIndex((b) => b.id === u);
499
- l !== void 0 && l >= 0 && (N = l);
1854
+ } else {
1855
+ D = g(i) ?? f;
1856
+ const N = t.find((R) => R.id === D);
1857
+ M = (N == null ? void 0 : N.tasks.findIndex((R) => R.id === i)) ?? 0;
1858
+ }
1859
+ h(C, D, M);
1860
+ },
1861
+ [t, g, o, h]
1862
+ );
1863
+ return /* @__PURE__ */ a(
1864
+ tt,
1865
+ {
1866
+ sensors: x,
1867
+ collisionDetection: st,
1868
+ onDragStart: S,
1869
+ onDragOver: u,
1870
+ onDragEnd: k,
1871
+ accessibility: { announcements: T },
1872
+ children: [
1873
+ /* @__PURE__ */ a(
1874
+ "div",
1875
+ {
1876
+ ref: c,
1877
+ tabIndex: 0,
1878
+ className: "no-scrollbar flex h-full gap-ds-05 overflow-x-auto pb-ds-05 outline-none",
1879
+ children: [
1880
+ /* @__PURE__ */ e(
1881
+ De,
1882
+ {
1883
+ items: y,
1884
+ strategy: nt,
1885
+ children: t.map((l, p) => /* @__PURE__ */ e(
1886
+ "div",
1887
+ {
1888
+ className: "flex-shrink-0 animate-slide-right delay-stagger-50",
1889
+ style: { "--stagger-index": p },
1890
+ children: /* @__PURE__ */ e(Qe, { column: l, index: p })
1891
+ },
1892
+ l.id
1893
+ ))
1894
+ }
1895
+ ),
1896
+ /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: /* @__PURE__ */ a(
1897
+ O,
1898
+ {
1899
+ variant: "ghost",
1900
+ onClick: b,
1901
+ className: "h-ds-md w-[320px] justify-start gap-ds-03 rounded-ds-xl border border-dashed border-border/60 bg-layer-02 text-text-tertiary hover:border-border-interactive hover:bg-interactive-subtle/50 hover:text-interactive",
1902
+ children: [
1903
+ /* @__PURE__ */ e(xe, { className: "h-ico-sm w-ico-sm" }),
1904
+ "Add column"
1905
+ ]
1906
+ }
1907
+ ) })
1908
+ ]
500
1909
  }
501
- } else {
502
- d = I(v) ?? y;
503
- const n = g.find((l) => l.id === d);
504
- N = (n == null ? void 0 : n.tasks.findIndex((l) => l.id === v)) ?? 0;
505
- }
506
- if (y === d) {
507
- const n = g.find((b) => b.id === d), l = n == null ? void 0 : n.tasks.findIndex((b) => b.id === u);
508
- l !== void 0 && l !== N && A(u, y, d, N);
509
- }
510
- r == null || r(u, d, N);
511
- },
512
- [g, I, A, r]
513
- ), Y = (a, i) => {
514
- h == null || h(a, i);
515
- }, o = (a, i) => {
516
- x((p) => ({
517
- columns: p.columns.map(
518
- (u) => u.id === a ? { ...u, name: i } : u
519
- )
520
- })), m == null || m(a, i);
521
- }, de = (a) => {
522
- x((i) => ({
523
- columns: i.columns.filter((p) => p.id !== a)
524
- })), w == null || w(a);
525
- }, ce = (a, i) => {
526
- x((p) => ({
527
- columns: p.columns.map(
528
- (u) => u.id === a ? { ...u, isClientVisible: i } : u
1910
+ ),
1911
+ v && Xe(
1912
+ /* @__PURE__ */ e(at, { dropAnimation: { duration: 240, easing: "cubic-bezier(0.34, 1.56, 0.64, 1)" }, children: r ? n === "compact" ? /* @__PURE__ */ e(Ke, { task: r }) : /* @__PURE__ */ e(Ge, { task: r }) : null }),
1913
+ document.body
529
1914
  )
530
- })), f == null || f(a, i);
531
- };
532
- return /* @__PURE__ */ c(
533
- ge,
534
- {
535
- sensors: z,
536
- collisionDetection: ve,
537
- onDragStart: M,
538
- onDragOver: W,
539
- onDragEnd: _,
540
- accessibility: { announcements: P },
541
- children: [
542
- /* @__PURE__ */ c(
543
- "div",
544
- {
545
- ref: K,
546
- className: "no-scrollbar flex h-full gap-ds-05 overflow-x-auto pb-ds-05",
547
- children: [
548
- /* @__PURE__ */ e(
549
- re,
550
- {
551
- items: V,
552
- strategy: ye,
553
- children: g.map((a, i) => /* @__PURE__ */ e("div", { className: "group flex-shrink-0", children: /* @__PURE__ */ e(
554
- oe,
555
- {
556
- column: a,
557
- index: i,
558
- onAddTask: Y,
559
- onClickTask: D,
560
- onRenameColumn: o,
561
- onDeleteColumn: de,
562
- onToggleVisibility: ce
563
- }
564
- ) }, a.id))
565
- }
566
- ),
567
- /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: /* @__PURE__ */ c(
568
- $,
569
- {
570
- variant: "ghost",
571
- onClick: C,
572
- className: "h-ds-md w-[300px] justify-start gap-ds-03 rounded-ds-xl border border-dashed border-border/60 bg-layer-02 text-text-tertiary hover:border-border-interactive hover:bg-interactive-subtle/50 hover:text-interactive",
573
- children: [
574
- /* @__PURE__ */ e(Q, { className: "h-ico-sm w-ico-sm" }),
575
- "Add column"
576
- ]
577
- }
578
- ) })
579
- ]
580
- }
581
- ),
582
- G && me(
583
- /* @__PURE__ */ e(Ne, { dropAnimation: null, children: k ? /* @__PURE__ */ e(ne, { task: k }) : null }),
584
- document.body
585
- )
586
- ]
587
- }
588
- );
1915
+ ]
1916
+ }
1917
+ );
1918
+ }
1919
+ const Jt = j.forwardRef(
1920
+ function({ className: t, ...n }, r) {
1921
+ return /* @__PURE__ */ e("div", { ref: r, className: t, children: /* @__PURE__ */ e(Pt, { ...n, children: /* @__PURE__ */ a("div", { className: "flex flex-col gap-ds-03", children: [
1922
+ /* @__PURE__ */ e(Oe, {}),
1923
+ /* @__PURE__ */ e(Be, {}),
1924
+ /* @__PURE__ */ e(Xt, {})
1925
+ ] }) }) });
589
1926
  }
590
1927
  );
591
- Pe.displayName = "KanbanBoard";
1928
+ Jt.displayName = "KanbanBoard";
592
1929
  export {
593
- oe as B,
594
- Pe as K,
595
- ie as T,
596
- ne as a
1930
+ Qe as B,
1931
+ ve as C,
1932
+ we as D,
1933
+ Jt as K,
1934
+ ce as P,
1935
+ Ve as T,
1936
+ Pt as a,
1937
+ Oe as b,
1938
+ Be as c,
1939
+ Et as d,
1940
+ We as e,
1941
+ Pe as f,
1942
+ fs as g,
1943
+ Ue as h,
1944
+ Ke as i,
1945
+ Ge as j,
1946
+ He as k,
1947
+ Yt as l,
1948
+ U as u
597
1949
  };