@devalok/shilp-sutra-karm 0.18.0 → 0.19.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 (115) hide show
  1. package/dist/_chunks/task-detail-panel.js +1339 -1144
  2. package/dist/tasks/activity-tab.d.ts +2 -11
  3. package/dist/tasks/activity-tab.d.ts.map +1 -1
  4. package/dist/tasks/conversation-tab.d.ts +2 -21
  5. package/dist/tasks/conversation-tab.d.ts.map +1 -1
  6. package/dist/tasks/files-tab.d.ts +2 -18
  7. package/dist/tasks/files-tab.d.ts.map +1 -1
  8. package/dist/tasks/index.d.ts +12 -6
  9. package/dist/tasks/index.d.ts.map +1 -1
  10. package/dist/tasks/index.js +765 -8
  11. package/dist/tasks/pickers/index.d.ts +16 -0
  12. package/dist/tasks/pickers/index.d.ts.map +1 -0
  13. package/dist/tasks/pickers/task-assignee-picker.d.ts +14 -0
  14. package/dist/tasks/pickers/task-assignee-picker.d.ts.map +1 -0
  15. package/dist/tasks/pickers/task-column-picker.d.ts +13 -0
  16. package/dist/tasks/pickers/task-column-picker.d.ts.map +1 -0
  17. package/dist/tasks/pickers/task-date-picker.d.ts +12 -0
  18. package/dist/tasks/pickers/task-date-picker.d.ts.map +1 -0
  19. package/dist/tasks/pickers/task-label-editor.d.ts +13 -0
  20. package/dist/tasks/pickers/task-label-editor.d.ts.map +1 -0
  21. package/dist/tasks/pickers/task-member-picker.d.ts +14 -0
  22. package/dist/tasks/pickers/task-member-picker.d.ts.map +1 -0
  23. package/dist/tasks/pickers/task-priority-picker.d.ts +12 -0
  24. package/dist/tasks/pickers/task-priority-picker.d.ts.map +1 -0
  25. package/dist/tasks/pickers/task-visibility-picker.d.ts +13 -0
  26. package/dist/tasks/pickers/task-visibility-picker.d.ts.map +1 -0
  27. package/dist/tasks/review-tab.d.ts +4 -20
  28. package/dist/tasks/review-tab.d.ts.map +1 -1
  29. package/dist/tasks/subtasks-tab.d.ts +2 -18
  30. package/dist/tasks/subtasks-tab.d.ts.map +1 -1
  31. package/dist/tasks/tabs/activity-entry.d.ts +9 -0
  32. package/dist/tasks/tabs/activity-entry.d.ts.map +1 -0
  33. package/dist/tasks/tabs/activity-timeline.d.ts +8 -0
  34. package/dist/tasks/tabs/activity-timeline.d.ts.map +1 -0
  35. package/dist/tasks/tabs/file-drop-zone.d.ts +10 -0
  36. package/dist/tasks/tabs/file-drop-zone.d.ts.map +1 -0
  37. package/dist/tasks/tabs/file-item.d.ts +11 -0
  38. package/dist/tasks/tabs/file-item.d.ts.map +1 -0
  39. package/dist/tasks/tabs/file-list.d.ts +8 -0
  40. package/dist/tasks/tabs/file-list.d.ts.map +1 -0
  41. package/dist/tasks/tabs/index.d.ts +34 -0
  42. package/dist/tasks/tabs/index.d.ts.map +1 -0
  43. package/dist/tasks/tabs/message-bubble.d.ts +14 -0
  44. package/dist/tasks/tabs/message-bubble.d.ts.map +1 -0
  45. package/dist/tasks/tabs/message-input.d.ts +16 -0
  46. package/dist/tasks/tabs/message-input.d.ts.map +1 -0
  47. package/dist/tasks/tabs/message-list.d.ts +9 -0
  48. package/dist/tasks/tabs/message-list.d.ts.map +1 -0
  49. package/dist/tasks/tabs/review-card.d.ts +10 -0
  50. package/dist/tasks/tabs/review-card.d.ts.map +1 -0
  51. package/dist/tasks/tabs/review-request-button.d.ts +10 -0
  52. package/dist/tasks/tabs/review-request-button.d.ts.map +1 -0
  53. package/dist/tasks/tabs/review-response-form.d.ts +11 -0
  54. package/dist/tasks/tabs/review-response-form.d.ts.map +1 -0
  55. package/dist/tasks/tabs/subtask-add-form.d.ts +9 -0
  56. package/dist/tasks/tabs/subtask-add-form.d.ts.map +1 -0
  57. package/dist/tasks/tabs/subtask-item.d.ts +12 -0
  58. package/dist/tasks/tabs/subtask-item.d.ts.map +1 -0
  59. package/dist/tasks/tabs/subtask-list.d.ts +8 -0
  60. package/dist/tasks/tabs/subtask-list.d.ts.map +1 -0
  61. package/dist/tasks/tabs/subtask-progress.d.ts +9 -0
  62. package/dist/tasks/tabs/subtask-progress.d.ts.map +1 -0
  63. package/dist/tasks/tabs/visibility-warning.d.ts +7 -0
  64. package/dist/tasks/tabs/visibility-warning.d.ts.map +1 -0
  65. package/dist/tasks/task-panel.d.ts +104 -0
  66. package/dist/tasks/task-panel.d.ts.map +1 -0
  67. package/dist/tasks/task-properties.d.ts +2 -12
  68. package/dist/tasks/task-properties.d.ts.map +1 -1
  69. package/dist/tasks/task-types.d.ts +104 -0
  70. package/dist/tasks/task-types.d.ts.map +1 -0
  71. package/docs/components/admin/admin-dashboard.md +215 -0
  72. package/docs/components/admin/admin-types.md +167 -0
  73. package/docs/components/admin/admin-utils.md +165 -0
  74. package/docs/components/admin/break-admin.md +167 -0
  75. package/docs/components/board/board-column.md +35 -0
  76. package/docs/components/board/board-provider.md +89 -0
  77. package/docs/components/board/board-toolbar.md +36 -0
  78. package/docs/components/board/board-types.md +62 -0
  79. package/docs/components/board/bulk-action-bar.md +38 -0
  80. package/docs/components/board/column-empty.md +33 -0
  81. package/docs/components/board/column-header.md +36 -0
  82. package/docs/components/board/kanban-board.md +53 -0
  83. package/docs/components/board/task-card.md +62 -0
  84. package/docs/components/board/task-context-menu.md +36 -0
  85. package/docs/components/chat/chat-input.md +37 -0
  86. package/docs/components/chat/chat-panel.md +58 -0
  87. package/docs/components/chat/conversation-list.md +47 -0
  88. package/docs/components/chat/message-list.md +44 -0
  89. package/docs/components/chat/streaming-text.md +29 -0
  90. package/docs/components/client/accent-provider.md +29 -0
  91. package/docs/components/client/client-portal-header.md +40 -0
  92. package/docs/components/client/project-card.md +39 -0
  93. package/docs/components/dashboard/attendance-cta.md +47 -0
  94. package/docs/components/dashboard/daily-brief.md +45 -0
  95. package/docs/components/dashboard/scratchpad-widget.md +52 -0
  96. package/docs/components/dashboard/sidebar-scratchpad.md +39 -0
  97. package/docs/components/other/karm-command-registry.md +61 -0
  98. package/docs/components/other/page-skeletons.md +52 -0
  99. package/docs/components/tasks/activity-tab.md +45 -0
  100. package/docs/components/tasks/conversation-tab.md +56 -0
  101. package/docs/components/tasks/files-tab.md +55 -0
  102. package/docs/components/tasks/review-tab.md +53 -0
  103. package/docs/components/tasks/subtasks-tab.md +61 -0
  104. package/docs/components/tasks/task-assignee-picker.md +36 -0
  105. package/docs/components/tasks/task-column-picker.md +37 -0
  106. package/docs/components/tasks/task-date-picker.md +49 -0
  107. package/docs/components/tasks/task-detail-panel.md +275 -0
  108. package/docs/components/tasks/task-label-editor.md +42 -0
  109. package/docs/components/tasks/task-member-picker.md +35 -0
  110. package/docs/components/tasks/task-panel.md +89 -0
  111. package/docs/components/tasks/task-priority-picker.md +37 -0
  112. package/docs/components/tasks/task-properties.md +84 -0
  113. package/docs/components/tasks/task-visibility-picker.md +38 -0
  114. package/llms.txt +40 -13
  115. package/package.json +82 -80
@@ -1,1054 +1,747 @@
1
1
  "use client";
2
- import { jsxs as t, jsx as e, Fragment as be } from "react/jsx-runtime";
3
- import * as o from "react";
4
- import { cn as p } from "@devalok/shilp-sutra/ui/lib/utils";
5
- import { Sheet as ts, SheetContent as rs, SheetTitle as as } from "@devalok/shilp-sutra/ui/sheet";
6
- import { VisuallyHidden as ns } from "@devalok/shilp-sutra/ui/visually-hidden";
7
- import { Skeleton as L } from "@devalok/shilp-sutra/ui/skeleton";
8
- import { Progress as cs, Tabs as ls, TabsList as is, TabsTrigger as Z } from "@devalok/shilp-sutra/ui";
9
- import { Avatar as j, AvatarImage as H, AvatarFallback as G } from "@devalok/shilp-sutra/ui/avatar";
2
+ import { jsxs as r, jsx as s, Fragment as ge } from "react/jsx-runtime";
3
+ import * as c from "react";
4
+ import { cn as h } from "@devalok/shilp-sutra/ui/lib/utils";
5
+ import { Sheet as xs, SheetContent as Ns, SheetTitle as vs } from "@devalok/shilp-sutra/ui/sheet";
6
+ import { VisuallyHidden as ys } from "@devalok/shilp-sutra/ui/visually-hidden";
7
+ import { Skeleton as A } from "@devalok/shilp-sutra/ui/skeleton";
8
+ import { Progress as ws, Tabs as Is, TabsList as Cs, TabsTrigger as U } from "@devalok/shilp-sutra/ui";
9
+ import { Avatar as F, AvatarImage as V, AvatarFallback as j } from "@devalok/shilp-sutra/ui/avatar";
10
10
  import { Popover as de, PopoverTrigger as ue, PopoverContent as me } from "@devalok/shilp-sutra/ui/popover";
11
- import { IconColumns3 as os, IconChevronDown as ds, IconCheck as xe, IconUser as us, IconUsers as ms, IconX as W, IconPlus as $, IconFlag as Ne, IconCalendarEvent as ve, IconTag as ye, IconEye as we, IconSquareCheck as fs, IconSquare as hs, IconListCheck as Ie, IconMessage as Ce, IconGitPullRequest as se, IconMessageCircle as De, IconSend as ps, IconUpload as gs, IconExternalLink as bs, IconDownload as xs, IconTrash as Ns, IconPaperclip as te, IconFile as fe, IconPhoto as vs, IconFileText as ys, IconFileCode as ws, IconFileSpreadsheet as Is, IconFileZip as Cs, IconActivity as re, IconCircleCheck as Ds, IconUserMinus as Es, IconUserPlus as Ts, IconArrowRight as Rs, IconEdit as As } from "@tabler/icons-react";
12
- import { getInitials as B } from "@devalok/shilp-sutra/composed/lib/string-utils";
13
- import { MemberPicker as ee } from "@devalok/shilp-sutra/composed/member-picker";
14
- import { EmptyState as F } from "@devalok/shilp-sutra/composed/empty-state";
15
- import { Badge as Ss } from "@devalok/shilp-sutra/ui/badge";
16
- import { RichTextViewer as ks, RichTextEditor as Ps } from "@devalok/shilp-sutra/composed/rich-text-editor";
17
- import { formatRelativeTime as Ls } from "@devalok/shilp-sutra/ui/lib/date-utils";
18
- import { Dialog as Os, DialogTrigger as _s, DialogContent as Vs, DialogHeader as js, DialogTitle as Hs, DialogDescription as Gs, DialogFooter as $s, DialogClose as he } from "@devalok/shilp-sutra/ui/dialog";
19
- import { Button as pe } from "@devalok/shilp-sutra/ui/button";
20
- const Bs = {
11
+ import { IconSquareCheck as Ds, IconSquare as Rs, IconPlus as B, IconSend as Es, IconUpload as Ts, IconExternalLink as As, IconDownload as Ss, IconTrash as ks, IconFile as fe, IconPhoto as Ls, IconFileText as Ps, IconFileCode as Os, IconFileSpreadsheet as _s, IconFileZip as Fs, IconCheck as xe, IconMessage as Ne, IconX as Y, IconCalendarEvent as ve, IconTag as ye, IconFlag as we, IconEye as Ie, IconCircleCheck as Vs, IconGitPullRequest as ee, IconPaperclip as se, IconUserMinus as js, IconUserPlus as Bs, IconArrowRight as Hs, IconEdit as qs, IconActivity as te, IconListCheck as Ce, IconMessageCircle as De, IconColumns3 as Gs, IconChevronDown as $s, IconUser as Ms, IconUsers as zs } from "@tabler/icons-react";
12
+ import { getInitials as H } from "@devalok/shilp-sutra/composed/lib/string-utils";
13
+ import { MemberPicker as X } from "@devalok/shilp-sutra/composed/member-picker";
14
+ import { EmptyState as q } from "@devalok/shilp-sutra/composed/empty-state";
15
+ import { Badge as Ys } from "@devalok/shilp-sutra/ui/badge";
16
+ import { RichTextViewer as Ws, RichTextEditor as Ks } from "@devalok/shilp-sutra/composed/rich-text-editor";
17
+ import { formatRelativeTime as Zs } from "@devalok/shilp-sutra/ui/lib/date-utils";
18
+ import { Dialog as Js, DialogTrigger as Qs, DialogContent as Us, DialogHeader as Xs, DialogTitle as et, DialogDescription as st, DialogFooter as tt, DialogClose as pe } from "@devalok/shilp-sutra/ui/dialog";
19
+ import { Button as he } from "@devalok/shilp-sutra/ui/button";
20
+ const rt = {
21
21
  LOW: "Low",
22
22
  MEDIUM: "Medium",
23
23
  HIGH: "High",
24
24
  URGENT: "Urgent"
25
- }, Ee = {
25
+ }, Re = {
26
26
  LOW: "bg-category-slate-9",
27
27
  MEDIUM: "bg-warning-9",
28
28
  HIGH: "bg-error-9",
29
29
  URGENT: "bg-error-9"
30
- }, Fs = {
30
+ }, at = {
31
31
  PENDING: { color: "warning", label: "Pending" },
32
32
  APPROVED: { color: "success", label: "Approved" },
33
33
  CHANGES_REQUESTED: { color: "brand", label: "Changes Requested" },
34
34
  REJECTED: { color: "error", label: "Rejected" }
35
- }, zs = ["LOW", "MEDIUM", "HIGH", "URGENT"];
36
- function O({
37
- icon: n,
38
- label: s,
39
- children: g,
40
- className: h
41
- }) {
42
- return /* @__PURE__ */ t(
43
- "div",
44
- {
45
- className: p(
46
- "flex items-center gap-ds-04 py-ds-03",
47
- h
48
- ),
49
- children: [
50
- /* @__PURE__ */ t("div", { className: "flex w-[120px] shrink-0 items-center gap-ds-03 text-surface-fg-subtle", children: [
51
- /* @__PURE__ */ e(n, { className: "h-ico-sm w-ico-sm", stroke: 1.5 }),
52
- /* @__PURE__ */ e("span", { className: "text-ds-sm", children: s })
53
- ] }),
54
- /* @__PURE__ */ e("div", { className: "flex-1 min-w-0", children: g })
55
- ]
56
- }
57
- );
58
- }
59
- function qs({ priority: n }) {
60
- return /* @__PURE__ */ t("div", { className: "flex items-center gap-ds-02b", children: [
61
- /* @__PURE__ */ e("div", { className: p("h-2 w-2 rounded-ds-full", Ee[n]) }),
62
- /* @__PURE__ */ e("span", { className: "text-ds-md text-surface-fg", children: Bs[n] || n })
63
- ] });
64
- }
65
- const Te = o.forwardRef(
66
- function({
67
- task: s,
68
- columns: g,
69
- members: h,
70
- onUpdate: b,
71
- onAssign: m,
72
- onUnassign: y,
73
- className: D,
74
- readOnly: x = !1,
75
- editableFields: d,
76
- renderPriorityIndicator: C,
77
- renderDatePicker: N,
78
- onConfirmVisibilityChange: w,
79
- ...I
80
- }, i) {
81
- const [v, l] = o.useState(""), [c, f] = o.useState(!1), u = s.assignees.map((a) => a.user.id), E = o.useMemo(
82
- () => h.map((a) => ({ id: a.id, name: a.name, avatar: a.image ?? void 0 })),
83
- [h]
84
- ), T = (a) => {
85
- b("columnId", a);
86
- }, S = (a) => {
87
- b("ownerId", a === s.ownerId ? null : a);
88
- }, _ = (a) => {
89
- u.includes(a) ? y(a) : m(a);
90
- }, R = (a) => {
91
- b("priority", a);
92
- }, k = (a) => {
93
- b("dueDate", a ? a.toISOString() : null);
94
- }, z = () => {
95
- const a = v.trim();
96
- a && !s.labels.includes(a) && b("labels", [...s.labels, a]), l(""), f(!1);
97
- }, J = (a) => {
98
- b("labels", s.labels.filter((Q) => Q !== a));
99
- }, M = () => {
100
- const a = s.visibility === "INTERNAL" ? "EVERYONE" : "INTERNAL";
101
- if (a === "EVERYONE" && w) {
102
- w();
103
- return;
104
- }
105
- b("visibility", a);
106
- }, q = C || qs;
107
- return /* @__PURE__ */ t("div", { ref: i, className: p("space-y-ds-01", D), ...I, children: [
108
- /* @__PURE__ */ e(O, { icon: os, label: "Column", children: x && !(d != null && d.includes("columnId")) ? /* @__PURE__ */ e("span", { className: "px-ds-03 py-ds-02 text-ds-md text-surface-fg", children: s.column.name }) : /* @__PURE__ */ t(de, { children: [
109
- /* @__PURE__ */ e(ue, { asChild: !0, children: /* @__PURE__ */ t(
110
- "button",
111
- {
112
- type: "button",
113
- className: "inline-flex items-center gap-ds-02b rounded-ds-md px-ds-03 py-ds-02 text-ds-md text-surface-fg transition-colors hover:bg-surface-3",
114
- children: [
115
- /* @__PURE__ */ e("span", { children: s.column.name }),
116
- /* @__PURE__ */ e(ds, { className: "h-3 w-3 text-surface-fg-subtle" })
117
- ]
118
- }
119
- ) }),
120
- /* @__PURE__ */ e(
121
- me,
122
- {
123
- className: "w-[180px] border-surface-border-strong bg-surface-1 p-ds-02",
124
- align: "start",
125
- sideOffset: 4,
126
- children: g.map((a) => /* @__PURE__ */ t(
127
- "button",
128
- {
129
- type: "button",
130
- onClick: () => T(a.id),
131
- className: p(
132
- "flex w-full items-center gap-ds-03 rounded-ds-md px-ds-03 py-ds-02b text-left text-ds-md transition-colors",
133
- "hover:bg-surface-3",
134
- a.id === s.columnId ? "text-accent-11" : "text-surface-fg"
135
- ),
136
- children: [
137
- a.name,
138
- a.id === s.columnId && /* @__PURE__ */ e(xe, { className: "ml-auto h-ico-sm w-ico-sm" })
139
- ]
140
- },
141
- a.id
142
- ))
143
- }
144
- )
145
- ] }) }),
146
- !x && /* @__PURE__ */ e(O, { icon: us, label: "Owner", children: /* @__PURE__ */ e(
147
- ee,
148
- {
149
- members: E,
150
- selectedIds: s.ownerId ? [s.ownerId] : [],
151
- onSelect: S,
152
- children: /* @__PURE__ */ e(
35
+ }, Ee = c.forwardRef(
36
+ function({ completed: e, total: i, className: l, ...d }, u) {
37
+ return /* @__PURE__ */ r("div", { ref: u, className: h("mb-ds-05 flex items-center gap-ds-04", l), ...d, children: [
38
+ /* @__PURE__ */ s(ws, { value: i > 0 ? e / i * 100 : 0, className: "h-ds-02b" }),
39
+ /* @__PURE__ */ r("span", { className: "shrink-0 text-ds-sm font-medium text-surface-fg-subtle", children: [
40
+ e,
41
+ "/",
42
+ i
43
+ ] })
44
+ ] });
45
+ }
46
+ );
47
+ Ee.displayName = "SubtaskProgress";
48
+ const Te = c.forwardRef(
49
+ function({ children: e, className: i, ...l }, d) {
50
+ return /* @__PURE__ */ s("div", { ref: d, className: h("space-y-ds-01", i), ...l, children: e });
51
+ }
52
+ );
53
+ Te.displayName = "SubtaskList";
54
+ const Ae = c.forwardRef(
55
+ function({ subtask: e, isComplete: i, onToggle: l, onClick: d, className: u, ...f }, m) {
56
+ var o;
57
+ const p = (o = e.assignees[0]) == null ? void 0 : o.user;
58
+ return /* @__PURE__ */ r(
59
+ "div",
60
+ {
61
+ ref: m,
62
+ role: "button",
63
+ tabIndex: 0,
64
+ className: h(
65
+ "group flex items-center gap-ds-03 rounded-ds-lg px-ds-03 py-ds-02b transition-colors",
66
+ "hover:bg-surface-3 cursor-pointer",
67
+ u
68
+ ),
69
+ onClick: () => d == null ? void 0 : d(e.id),
70
+ onKeyDown: (x) => {
71
+ (x.key === "Enter" || x.key === " ") && (x.preventDefault(), d == null || d(e.id));
72
+ },
73
+ ...f,
74
+ children: [
75
+ /* @__PURE__ */ s(
153
76
  "button",
154
77
  {
155
78
  type: "button",
156
- className: "inline-flex items-center gap-ds-03 rounded-ds-md px-ds-03 py-ds-02 transition-colors hover:bg-surface-3",
157
- children: s.owner ? /* @__PURE__ */ t(be, { children: [
158
- /* @__PURE__ */ t(j, { className: "h-ico-md w-ico-md", children: [
159
- s.owner.image && /* @__PURE__ */ e(H, { src: s.owner.image, alt: s.owner.name }),
160
- /* @__PURE__ */ e(G, { className: "bg-surface-3 text-ds-xs font-semibold text-accent-fg", children: B(s.owner.name) })
161
- ] }),
162
- /* @__PURE__ */ e("span", { className: "text-ds-md text-surface-fg", children: s.owner.name })
163
- ] }) : /* @__PURE__ */ e("span", { className: "text-ds-md text-surface-fg-subtle", children: "No owner" })
164
- }
165
- )
166
- }
167
- ) }),
168
- /* @__PURE__ */ e(O, { icon: ms, label: "Assignees", children: /* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-ds-02b", children: [
169
- s.assignees.map((a) => /* @__PURE__ */ t(
170
- "div",
171
- {
172
- className: "inline-flex items-center gap-ds-02 rounded-ds-full bg-surface-2 py-ds-01 pl-ds-01 pr-ds-03",
173
- children: [
174
- /* @__PURE__ */ t(j, { className: "h-ico-sm w-ico-sm", children: [
175
- a.user.image && /* @__PURE__ */ e(H, { src: a.user.image, alt: a.user.name }),
176
- /* @__PURE__ */ e(G, { className: "bg-surface-3 text-ds-xs font-semibold text-accent-fg", children: B(a.user.name) })
177
- ] }),
178
- /* @__PURE__ */ e("span", { className: "text-ds-sm text-surface-fg-muted", children: a.user.name.split(" ")[0] }),
179
- !x && /* @__PURE__ */ e(
180
- "button",
181
- {
182
- type: "button",
183
- onClick: () => y(a.user.id),
184
- className: "ml-ds-01 rounded-ds-full p-ds-01 transition-colors hover:bg-surface-3",
185
- "aria-label": `Remove ${a.user.name}`,
186
- children: /* @__PURE__ */ e(W, { className: "h-ds-03 w-ds-03 text-surface-fg-subtle" })
187
- }
188
- )
189
- ]
190
- },
191
- a.user.id
192
- )),
193
- !x && /* @__PURE__ */ e(
194
- ee,
195
- {
196
- members: E,
197
- selectedIds: u,
198
- onSelect: _,
199
- multiple: !0,
200
- children: /* @__PURE__ */ e(
201
- "button",
202
- {
203
- type: "button",
204
- className: "inline-flex h-ico-md w-ico-md items-center justify-center rounded-ds-full border border-dashed border-surface-border transition-colors hover:bg-surface-3 hover:border-surface-border",
205
- "aria-label": "Add assignee",
206
- children: /* @__PURE__ */ e($, { className: "h-3 w-3 text-surface-fg-subtle" })
207
- }
208
- )
209
- }
210
- ),
211
- x && s.assignees.length === 0 && /* @__PURE__ */ e("span", { className: "text-ds-md text-surface-fg-subtle", children: "None" })
212
- ] }) }),
213
- /* @__PURE__ */ e(O, { icon: Ne, label: "Priority", children: /* @__PURE__ */ t(de, { children: [
214
- /* @__PURE__ */ e(ue, { asChild: !0, children: /* @__PURE__ */ e(
215
- "button",
216
- {
217
- type: "button",
218
- className: "rounded-ds-md px-ds-03 py-ds-02 transition-colors hover:bg-surface-3",
219
- children: /* @__PURE__ */ e(q, { priority: s.priority })
220
- }
221
- ) }),
222
- /* @__PURE__ */ e(
223
- me,
224
- {
225
- className: "w-[160px] border-surface-border-strong bg-surface-1 p-ds-02",
226
- align: "start",
227
- sideOffset: 4,
228
- children: zs.map((a) => /* @__PURE__ */ e(
229
- "button",
230
- {
231
- type: "button",
232
- onClick: () => R(a),
233
- className: p(
234
- "flex w-full items-center gap-ds-03 rounded-ds-md px-ds-03 py-ds-02b transition-colors",
235
- "hover:bg-surface-3",
236
- a === s.priority && "bg-surface-3"
237
- ),
238
- children: /* @__PURE__ */ e(q, { priority: a })
79
+ onClick: (x) => {
80
+ x.stopPropagation(), l == null || l(e.id, !i);
239
81
  },
240
- a
241
- ))
242
- }
243
- )
244
- ] }) }),
245
- /* @__PURE__ */ e(O, { icon: ve, label: "Due Date", children: /* @__PURE__ */ t("div", { className: "flex items-center gap-ds-02", children: [
246
- N ? N({
247
- value: s.dueDate ? new Date(s.dueDate) : null,
248
- onChange: k,
249
- placeholder: "No due date",
250
- className: "h-ds-xs-plus border-none bg-transparent px-ds-03 text-ds-md hover:bg-surface-3"
251
- }) : /* @__PURE__ */ e(
252
- "input",
253
- {
254
- type: "date",
255
- value: s.dueDate ? new Date(s.dueDate).toISOString().split("T")[0] : "",
256
- onChange: (a) => k(a.target.value ? new Date(a.target.value) : null),
257
- "aria-label": "Due date",
258
- className: "h-ds-xs-plus border-none bg-transparent px-ds-03 text-ds-md text-surface-fg outline-none hover:bg-surface-3 rounded-ds-md"
259
- }
260
- ),
261
- s.dueDate && /* @__PURE__ */ e(
262
- "button",
263
- {
264
- type: "button",
265
- onClick: () => k(null),
266
- className: "rounded-ds-md p-ds-02 transition-colors hover:bg-surface-3",
267
- "aria-label": "Clear due date",
268
- children: /* @__PURE__ */ e(W, { className: "h-3 w-3 text-surface-fg-subtle" })
269
- }
270
- )
271
- ] }) }),
272
- /* @__PURE__ */ e(O, { icon: ye, label: "Labels", children: /* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-ds-02b", children: [
273
- s.labels.map((a) => /* @__PURE__ */ t(
274
- "span",
275
- {
276
- className: "inline-flex items-center gap-ds-02 rounded-ds-full bg-accent-2 px-ds-03 py-ds-01 text-ds-sm font-medium text-accent-11",
277
- children: [
278
- a,
279
- !x && /* @__PURE__ */ e(
280
- "button",
281
- {
282
- type: "button",
283
- onClick: () => J(a),
284
- className: "rounded-ds-full p-ds-01 transition-colors hover:bg-surface-3",
285
- "aria-label": `Remove label ${a}`,
286
- children: /* @__PURE__ */ e(W, { className: "h-ds-03 w-ds-03" })
287
- }
82
+ className: h(
83
+ "shrink-0 rounded p-ds-01 transition-colors",
84
+ l ? "hover:bg-surface-2" : "cursor-default"
85
+ ),
86
+ children: i ? /* @__PURE__ */ s(Ds, { className: "h-ico-sm w-ico-sm text-accent-11", stroke: 1.5 }) : /* @__PURE__ */ s(Rs, { className: "h-ico-sm w-ico-sm text-surface-fg-subtle", stroke: 1.5 })
87
+ }
88
+ ),
89
+ /* @__PURE__ */ s(
90
+ "div",
91
+ {
92
+ className: h(
93
+ "h-2 w-2 shrink-0 rounded-ds-full",
94
+ Re[e.priority]
288
95
  )
289
- ]
96
+ }
97
+ ),
98
+ /* @__PURE__ */ s(
99
+ "span",
100
+ {
101
+ className: h(
102
+ "flex-1 truncate text-ds-md",
103
+ i ? "text-surface-fg-subtle line-through" : "text-surface-fg"
104
+ ),
105
+ children: e.title
106
+ }
107
+ ),
108
+ p && /* @__PURE__ */ r(F, { className: "h-ico-md w-ico-md shrink-0", children: [
109
+ p.image && /* @__PURE__ */ s(V, { src: p.image, alt: p.name }),
110
+ /* @__PURE__ */ s(j, { className: "bg-surface-3 text-ds-xs font-semibold text-accent-fg", children: H(p.name) })
111
+ ] })
112
+ ]
113
+ }
114
+ );
115
+ }
116
+ );
117
+ Ae.displayName = "SubtaskItem";
118
+ const Se = c.forwardRef(
119
+ function({ onCreate: e, placeholder: i = "Subtask title...", className: l, ...d }, u) {
120
+ const [f, m] = c.useState(""), [p, o] = c.useState(!1), x = c.useRef(null), b = () => {
121
+ const g = f.trim();
122
+ g && (e(g), m(""));
123
+ }, N = (g) => {
124
+ g.key === "Enter" && (g.preventDefault(), b()), g.key === "Escape" && (o(!1), m(""));
125
+ };
126
+ return c.useEffect(() => {
127
+ p && x.current && x.current.focus();
128
+ }, [p]), /* @__PURE__ */ s("div", { ref: u, className: h(l), ...d, children: p ? /* @__PURE__ */ r("div", { className: "mt-ds-03 flex items-center gap-ds-03 rounded-ds-lg border border-surface-border-strong bg-surface-1 shadow-01 px-ds-04 py-ds-03", children: [
129
+ /* @__PURE__ */ s(
130
+ "input",
131
+ {
132
+ ref: x,
133
+ type: "text",
134
+ value: f,
135
+ onChange: (g) => m(g.target.value),
136
+ onKeyDown: N,
137
+ onBlur: () => {
138
+ f.trim() || o(!1);
290
139
  },
291
- a
292
- )),
293
- !x && (c ? /* @__PURE__ */ e("div", { className: "inline-flex items-center gap-ds-02", children: /* @__PURE__ */ e(
294
- "input",
295
- {
296
- type: "text",
297
- value: v,
298
- onChange: (a) => l(a.target.value),
299
- "aria-label": "New label name",
300
- onKeyDown: (a) => {
301
- a.key === "Enter" && z(), a.key === "Escape" && (f(!1), l(""));
302
- },
303
- onBlur: z,
304
- placeholder: "Label name",
305
- className: "h-5 w-20 rounded border border-surface-border-strong bg-transparent px-ds-02b text-ds-sm text-surface-fg outline-none placeholder:text-surface-fg-subtle focus:border-surface-border",
306
- autoFocus: !0
307
- }
308
- ) }) : /* @__PURE__ */ e(
309
- "button",
310
- {
311
- type: "button",
312
- onClick: () => f(!0),
313
- className: "inline-flex h-ico-md w-ico-md items-center justify-center rounded-ds-full border border-dashed border-surface-border transition-colors hover:bg-surface-3 hover:border-surface-border",
314
- "aria-label": "Add label",
315
- children: /* @__PURE__ */ e($, { className: "h-3 w-3 text-surface-fg-subtle" })
316
- }
317
- )),
318
- x && s.labels.length === 0 && /* @__PURE__ */ e("span", { className: "text-ds-md text-surface-fg-subtle", children: "None" })
319
- ] }) }),
320
- !x && /* @__PURE__ */ e(O, { icon: we, label: "Visibility", children: /* @__PURE__ */ t(
140
+ placeholder: i,
141
+ className: "flex-1 bg-transparent text-ds-md text-surface-fg placeholder:text-surface-fg-subtle outline-none"
142
+ }
143
+ ),
144
+ /* @__PURE__ */ s(
321
145
  "button",
322
146
  {
323
147
  type: "button",
324
- onClick: M,
325
- className: p(
326
- "inline-flex items-center gap-ds-02b rounded-ds-full px-ds-03 py-ds-01 text-ds-sm font-semibold tracking-wide transition-colors",
327
- s.visibility === "EVERYONE" ? "bg-success-3 text-success-11" : "bg-surface-2 text-surface-fg-subtle"
328
- ),
329
- children: [
330
- /* @__PURE__ */ e(
331
- "span",
332
- {
333
- className: p(
334
- "h-ds-02b w-ds-02b rounded-ds-full",
335
- s.visibility === "EVERYONE" ? "bg-success-9" : "bg-disabled"
336
- )
337
- }
338
- ),
339
- s.visibility === "EVERYONE" ? "Everyone" : "Internal"
340
- ]
148
+ onClick: b,
149
+ disabled: !f.trim(),
150
+ className: "inline-flex h-6 items-center gap-ds-02 rounded-ds-md bg-accent-9 px-ds-03 text-ds-sm font-semibold text-accent-fg transition-colors hover:bg-accent-10 disabled:opacity-action-disabled",
151
+ children: "Add"
341
152
  }
342
- ) })
343
- ] });
153
+ )
154
+ ] }) : /* @__PURE__ */ r(
155
+ "button",
156
+ {
157
+ type: "button",
158
+ onClick: () => o(!0),
159
+ className: "mt-ds-03 inline-flex items-center gap-ds-02b rounded-ds-lg px-ds-03 py-ds-02b text-ds-md text-surface-fg-subtle transition-colors hover:bg-surface-3 hover:text-surface-fg-muted",
160
+ children: [
161
+ /* @__PURE__ */ s(B, { className: "h-ico-sm w-ico-sm", stroke: 1.5 }),
162
+ "Add subtask"
163
+ ]
164
+ }
165
+ ) });
344
166
  }
345
167
  );
346
- Te.displayName = "TaskProperties";
347
- const Re = o.forwardRef(
348
- function({
349
- subtasks: s,
350
- terminalColumnId: g,
351
- onCreateSubtask: h,
352
- onToggleSubtask: b,
353
- onClickSubtask: m,
354
- className: y,
355
- readOnly: D = !1,
356
- ...x
357
- }, d) {
358
- const [C, N] = o.useState(""), [w, I] = o.useState(!1), i = o.useRef(null), v = s.filter(
359
- (u) => {
360
- var E;
361
- return ((E = u.column) == null ? void 0 : E.isTerminal) || u.columnId === g;
168
+ Se.displayName = "SubtaskAddForm";
169
+ const ke = c.forwardRef(
170
+ function({ children: e, autoScroll: i = !0, className: l, ...d }, u) {
171
+ const f = c.useRef(null), m = c.Children.count(e);
172
+ c.useEffect(() => {
173
+ i && f.current && (f.current.scrollTop = f.current.scrollHeight);
174
+ }, [i, m]);
175
+ const p = c.useCallback(
176
+ (o) => {
177
+ f.current = o, typeof u == "function" ? u(o) : u && (u.current = o);
178
+ },
179
+ [u]
180
+ );
181
+ return /* @__PURE__ */ s(
182
+ "div",
183
+ {
184
+ ref: p,
185
+ className: h("flex-1 space-y-ds-05 overflow-y-auto", l),
186
+ ...d,
187
+ children: e
362
188
  }
363
- ).length, l = s.length, c = () => {
364
- const u = C.trim();
365
- u && (h(u), N(""));
366
- }, f = (u) => {
367
- u.key === "Enter" && (u.preventDefault(), c()), u.key === "Escape" && (I(!1), N(""));
368
- };
369
- return o.useEffect(() => {
370
- w && i.current && i.current.focus();
371
- }, [w]), /* @__PURE__ */ t("div", { ref: d, className: p("flex flex-col", y), ...x, children: [
372
- l > 0 && /* @__PURE__ */ t("div", { className: "mb-ds-05 flex items-center gap-ds-04", children: [
373
- /* @__PURE__ */ e(cs, { value: l > 0 ? v / l * 100 : 0, className: "h-ds-02b" }),
374
- /* @__PURE__ */ t("span", { className: "shrink-0 text-ds-sm font-medium text-surface-fg-subtle", children: [
375
- v,
376
- "/",
377
- l
378
- ] })
379
- ] }),
380
- s.length > 0 ? /* @__PURE__ */ e("div", { className: "space-y-ds-01", children: s.map((u) => {
381
- var S, _;
382
- const E = ((S = u.column) == null ? void 0 : S.isTerminal) || u.columnId === g, T = (_ = u.assignees[0]) == null ? void 0 : _.user;
383
- return /* @__PURE__ */ t(
384
- "div",
189
+ );
190
+ }
191
+ );
192
+ ke.displayName = "MessageList";
193
+ function Le(t) {
194
+ const e = new Date(t), l = (/* @__PURE__ */ new Date()).getTime() - e.getTime();
195
+ return Math.floor(l / 864e5) < 7 ? Zs(t) : e.toLocaleDateString("en-IN", {
196
+ month: "short",
197
+ day: "numeric",
198
+ hour: "numeric",
199
+ minute: "2-digit"
200
+ });
201
+ }
202
+ function nt(t) {
203
+ return t.authorType === "INTERNAL" && t.internalAuthor ? t.internalAuthor : t.authorType === "CLIENT" && t.clientAuthor ? {
204
+ id: t.clientAuthor.id,
205
+ name: t.clientAuthor.name,
206
+ email: t.clientAuthor.email,
207
+ image: null
208
+ } : { id: t.authorId, name: "Unknown", image: null };
209
+ }
210
+ function it(t) {
211
+ return t.replace(/<[^>]*>/g, "");
212
+ }
213
+ const Pe = c.forwardRef(
214
+ function({ comment: e, clientMode: i = !1, renderViewer: l, className: d, ...u }, f) {
215
+ const m = nt(e), p = e.authorType === "CLIENT";
216
+ return /* @__PURE__ */ r("div", { ref: f, className: h("flex gap-ds-03", d), ...u, children: [
217
+ /* @__PURE__ */ r(F, { className: "h-ds-xs-plus w-ds-xs-plus shrink-0 mt-ds-01", children: [
218
+ m.image && /* @__PURE__ */ s(V, { src: m.image, alt: m.name }),
219
+ /* @__PURE__ */ s(
220
+ j,
385
221
  {
386
- role: "button",
387
- tabIndex: 0,
388
- className: p(
389
- "group flex items-center gap-ds-03 rounded-ds-lg px-ds-03 py-ds-02b transition-colors",
390
- "hover:bg-surface-3 cursor-pointer"
222
+ className: h(
223
+ "text-ds-xs font-semibold",
224
+ p ? "bg-warning-3 text-warning-11" : "bg-surface-3 text-accent-fg"
391
225
  ),
392
- onClick: () => m == null ? void 0 : m(u.id),
393
- onKeyDown: (R) => {
394
- (R.key === "Enter" || R.key === " ") && (R.preventDefault(), m == null || m(u.id));
395
- },
396
- children: [
397
- /* @__PURE__ */ e(
398
- "button",
399
- {
400
- type: "button",
401
- onClick: (R) => {
402
- R.stopPropagation(), D || b(u.id, !E);
403
- },
404
- className: p(
405
- "shrink-0 rounded p-ds-01 transition-colors",
406
- D ? "cursor-default" : "hover:bg-surface-2"
407
- ),
408
- children: E ? /* @__PURE__ */ e(fs, { className: "h-ico-sm w-ico-sm text-accent-11", stroke: 1.5 }) : /* @__PURE__ */ e(hs, { className: "h-ico-sm w-ico-sm text-surface-fg-subtle", stroke: 1.5 })
409
- }
410
- ),
411
- /* @__PURE__ */ e(
412
- "div",
413
- {
414
- className: p(
415
- "h-2 w-2 shrink-0 rounded-ds-full",
416
- Ee[u.priority]
417
- )
418
- }
419
- ),
420
- /* @__PURE__ */ e(
421
- "span",
422
- {
423
- className: p(
424
- "flex-1 truncate text-ds-md",
425
- E ? "text-surface-fg-subtle line-through" : "text-surface-fg"
426
- ),
427
- children: u.title
428
- }
429
- ),
430
- T && /* @__PURE__ */ t(j, { className: "h-ico-md w-ico-md shrink-0", children: [
431
- T.image && /* @__PURE__ */ e(H, { src: T.image, alt: T.name }),
432
- /* @__PURE__ */ e(G, { className: "bg-surface-3 text-ds-xs font-semibold text-accent-fg", children: B(T.name) })
433
- ] })
434
- ]
435
- },
436
- u.id
437
- );
438
- }) }) : !w && /* @__PURE__ */ e(
439
- F,
226
+ children: H(m.name)
227
+ }
228
+ )
229
+ ] }),
230
+ /* @__PURE__ */ r("div", { className: "flex-1 min-w-0", children: [
231
+ /* @__PURE__ */ r("div", { className: "flex items-baseline gap-ds-03", children: [
232
+ /* @__PURE__ */ s("span", { className: "text-ds-md font-medium text-surface-fg", children: m.name }),
233
+ i ? !p && /* @__PURE__ */ s("span", { className: "rounded bg-surface-3 px-ds-02 py-px text-ds-xs font-semibold uppercase tracking-wider text-accent-fg", children: "Team" }) : p && /* @__PURE__ */ s("span", { className: "rounded bg-warning-3 px-ds-02 py-px text-ds-xs font-semibold uppercase tracking-wider text-warning-11", children: "Client" }),
234
+ /* @__PURE__ */ s("span", { className: "text-ds-sm text-surface-fg-subtle", children: Le(e.createdAt) })
235
+ ] }),
236
+ /* @__PURE__ */ s("div", { className: "mt-ds-02", children: l ? l({
237
+ content: e.content,
238
+ className: "[&_.ProseMirror]:!min-h-0 [&_.ProseMirror]:!p-0"
239
+ }) : /* @__PURE__ */ s("p", { className: "text-ds-md text-surface-fg-muted whitespace-pre-wrap", children: it(e.content) }) })
240
+ ] })
241
+ ] });
242
+ }
243
+ );
244
+ Pe.displayName = "MessageBubble";
245
+ const Oe = c.forwardRef(
246
+ function({
247
+ onSubmit: e,
248
+ renderEditor: i,
249
+ placeholder: l = "Write a comment...",
250
+ clientMode: d = !1,
251
+ className: u,
252
+ ...f
253
+ }, m) {
254
+ const [p, o] = c.useState(""), x = () => {
255
+ const b = p.trim();
256
+ b.replace(/<[^>]*>/g, "").trim() && (e(b, d ? "CLIENT" : "INTERNAL"), o(""));
257
+ };
258
+ return /* @__PURE__ */ r("div", { ref: m, className: h("space-y-ds-03", u), ...f, children: [
259
+ i ? i({
260
+ content: p,
261
+ onChange: o,
262
+ placeholder: l
263
+ }) : /* @__PURE__ */ s(
264
+ "textarea",
440
265
  {
441
- icon: /* @__PURE__ */ e(Ie, {}),
442
- title: "No subtasks",
443
- description: "Break this task into smaller pieces",
444
- compact: !0
266
+ value: p,
267
+ onChange: (b) => o(b.target.value),
268
+ placeholder: l,
269
+ rows: 3,
270
+ className: "w-full resize-none rounded-ds-md border border-surface-border-strong bg-transparent px-ds-04 py-ds-03 text-ds-md text-surface-fg placeholder:text-surface-fg-subtle outline-none focus:border-surface-border"
445
271
  }
446
272
  ),
447
- !D && (w ? /* @__PURE__ */ t("div", { className: "mt-ds-03 flex items-center gap-ds-03 rounded-ds-lg border border-surface-border-strong bg-surface-1 shadow-01 px-ds-04 py-ds-03", children: [
448
- /* @__PURE__ */ e(
449
- "input",
450
- {
451
- ref: i,
452
- type: "text",
453
- value: C,
454
- onChange: (u) => N(u.target.value),
455
- onKeyDown: f,
456
- onBlur: () => {
457
- C.trim() || I(!1);
458
- },
459
- placeholder: "Subtask title...",
460
- className: "flex-1 bg-transparent text-ds-md text-surface-fg placeholder:text-surface-fg-subtle outline-none"
461
- }
462
- ),
463
- /* @__PURE__ */ e(
464
- "button",
465
- {
466
- type: "button",
467
- onClick: c,
468
- disabled: !C.trim(),
469
- className: "inline-flex h-6 items-center gap-ds-02 rounded-ds-md bg-accent-9 px-ds-03 text-ds-sm font-semibold text-accent-fg transition-colors hover:bg-accent-10 disabled:opacity-action-disabled",
470
- children: "Add"
471
- }
472
- )
473
- ] }) : /* @__PURE__ */ t(
273
+ /* @__PURE__ */ s("div", { className: "flex justify-end", children: /* @__PURE__ */ r(
474
274
  "button",
475
275
  {
476
276
  type: "button",
477
- onClick: () => I(!0),
478
- className: "mt-ds-03 inline-flex items-center gap-ds-02b rounded-ds-lg px-ds-03 py-ds-02b text-ds-md text-surface-fg-subtle transition-colors hover:bg-surface-3 hover:text-surface-fg-muted",
277
+ onClick: x,
278
+ disabled: !p.replace(/<[^>]*>/g, "").trim(),
279
+ className: "inline-flex items-center gap-ds-02b rounded-ds-lg bg-accent-9 px-ds-04 py-ds-02b text-ds-sm font-semibold text-accent-fg transition-colors hover:bg-accent-10 disabled:opacity-action-disabled disabled:cursor-not-allowed",
479
280
  children: [
480
- /* @__PURE__ */ e($, { className: "h-ico-sm w-ico-sm", stroke: 1.5 }),
481
- "Add subtask"
281
+ /* @__PURE__ */ s(Es, { className: "h-ico-sm w-ico-sm", stroke: 2 }),
282
+ "Comment"
482
283
  ]
483
284
  }
484
- ))
285
+ ) })
485
286
  ] });
486
287
  }
487
288
  );
488
- Re.displayName = "SubtasksTab";
489
- function Ys(n) {
490
- return new Date(n).toLocaleDateString("en-IN", {
491
- month: "short",
492
- day: "numeric",
493
- hour: "numeric",
494
- minute: "2-digit"
495
- });
496
- }
497
- const Ks = [
498
- { status: "APPROVED", label: "Approve", icon: xe },
499
- { status: "CHANGES_REQUESTED", label: "Request Changes", icon: Ce },
500
- { status: "REJECTED", label: "Reject", icon: W }
501
- ], Ae = o.forwardRef(
502
- function({
503
- reviews: s,
504
- members: g,
505
- onRequestReview: h,
506
- onUpdateStatus: b,
507
- className: m,
508
- ...y
509
- }, D) {
510
- const [x, d] = o.useState({}), [C, N] = o.useState(null), w = o.useMemo(
511
- () => g.map((i) => ({ id: i.id, name: i.name, avatar: i.image ?? void 0 })),
512
- [g]
513
- ), I = (i, v) => {
514
- b(i, v, x[i]), d((l) => {
515
- const c = { ...l };
516
- return delete c[i], c;
517
- }), N(null);
289
+ Oe.displayName = "MessageInput";
290
+ const _e = c.forwardRef(
291
+ function({ className: e, ...i }, l) {
292
+ return /* @__PURE__ */ s(
293
+ "p",
294
+ {
295
+ ref: l,
296
+ className: h("text-ds-xs text-warning-11", e),
297
+ ...i,
298
+ children: "This task is visible to clients. Comments may be seen by external users."
299
+ }
300
+ );
301
+ }
302
+ );
303
+ _e.displayName = "VisibilityWarning";
304
+ const Fe = c.forwardRef(
305
+ function({ onUpload: e, isUploading: i = !1, accept: l, className: d, ...u }, f) {
306
+ const m = c.useRef(null), [p, o] = c.useState(!1), x = (v) => {
307
+ var y;
308
+ const w = (y = v.target.files) == null ? void 0 : y[0];
309
+ w && e(w), m.current && (m.current.value = "");
518
310
  };
519
- return /* @__PURE__ */ t("div", { ref: D, className: p("flex flex-col", m), ...y, children: [
520
- s.length > 0 ? /* @__PURE__ */ e("div", { className: "space-y-ds-04", children: s.map((i) => {
521
- const v = Fs[i.status], l = C === i.id;
522
- return /* @__PURE__ */ t(
523
- "div",
524
- {
525
- className: "rounded-ds-lg border border-surface-border-strong bg-surface-1 shadow-01 p-ds-04",
526
- children: [
527
- /* @__PURE__ */ t("div", { className: "flex items-center gap-ds-03", children: [
528
- /* @__PURE__ */ t(j, { className: "h-ds-xs w-ds-xs shrink-0", children: [
529
- i.reviewer.image && /* @__PURE__ */ e(
530
- H,
531
- {
532
- src: i.reviewer.image,
533
- alt: i.reviewer.name
534
- }
535
- ),
536
- /* @__PURE__ */ e(G, { className: "bg-surface-3 text-ds-xs font-semibold text-accent-fg", children: B(i.reviewer.name) })
537
- ] }),
538
- /* @__PURE__ */ t("div", { className: "flex-1 min-w-0", children: [
539
- /* @__PURE__ */ e("span", { className: "text-ds-md font-medium text-surface-fg", children: i.reviewer.name }),
540
- /* @__PURE__ */ t("span", { className: "ml-ds-03 text-ds-sm text-surface-fg-subtle", children: [
541
- "requested by ",
542
- i.requestedBy.name
543
- ] })
544
- ] }),
545
- /* @__PURE__ */ e(
546
- Ss,
547
- {
548
- color: v.color,
549
- children: v.label
550
- }
551
- )
552
- ] }),
553
- i.feedback && /* @__PURE__ */ e("div", { className: "mt-ds-03 rounded-ds-md bg-surface-2 px-ds-04 py-ds-03", children: /* @__PURE__ */ e("p", { className: "text-ds-sm text-surface-fg-muted", children: i.feedback }) }),
554
- i.status === "PENDING" && /* @__PURE__ */ e("div", { className: "mt-ds-03", children: l ? /* @__PURE__ */ t("div", { className: "space-y-ds-03", children: [
555
- /* @__PURE__ */ e(
556
- "textarea",
557
- {
558
- value: x[i.id] || "",
559
- onChange: (c) => d((f) => ({
560
- ...f,
561
- [i.id]: c.target.value
562
- })),
563
- placeholder: "Add feedback (optional)...",
564
- rows: 2,
565
- className: "w-full resize-none rounded-ds-md border border-surface-border-strong bg-transparent px-ds-03 py-ds-03 text-ds-sm text-surface-fg placeholder:text-surface-fg-subtle outline-none focus:border-surface-border"
566
- }
567
- ),
568
- /* @__PURE__ */ t("div", { className: "flex items-center gap-ds-02b", children: [
569
- Ks.map((c) => {
570
- const f = c.icon;
571
- return /* @__PURE__ */ t(
572
- "button",
573
- {
574
- type: "button",
575
- onClick: () => I(i.id, c.status),
576
- className: p(
577
- "inline-flex items-center gap-ds-02 rounded-ds-md px-ds-03 py-ds-02 text-ds-sm font-semibold transition-colors",
578
- c.status === "APPROVED" && "bg-success-3 text-success-11 hover:opacity-90",
579
- c.status === "CHANGES_REQUESTED" && "bg-warning-3 text-warning-11 hover:opacity-90",
580
- c.status === "REJECTED" && "bg-error-3 text-error-11 hover:opacity-90"
581
- ),
582
- children: [
583
- /* @__PURE__ */ e(f, { className: "h-3 w-3", stroke: 2 }),
584
- c.label
585
- ]
586
- },
587
- c.status
588
- );
589
- }),
590
- /* @__PURE__ */ e(
591
- "button",
592
- {
593
- type: "button",
594
- onClick: () => N(null),
595
- className: "ml-auto text-ds-sm text-surface-fg-subtle hover:text-surface-fg-muted",
596
- children: "Cancel"
597
- }
598
- )
599
- ] })
600
- ] }) : /* @__PURE__ */ e(
311
+ return /* @__PURE__ */ r(
312
+ "div",
313
+ {
314
+ ref: f,
315
+ role: "region",
316
+ "aria-label": "File upload drop zone",
317
+ onDrop: (v) => {
318
+ var y;
319
+ v.preventDefault(), o(!1);
320
+ const w = (y = v.dataTransfer.files) == null ? void 0 : y[0];
321
+ w && e(w);
322
+ },
323
+ onDragOver: (v) => {
324
+ v.preventDefault(), o(!0);
325
+ },
326
+ onDragLeave: () => {
327
+ o(!1);
328
+ },
329
+ className: h(
330
+ "rounded-ds-lg border-2 border-dashed transition-colors",
331
+ p ? "border-accent-7 bg-accent-1" : "border-surface-border-strong",
332
+ d
333
+ ),
334
+ ...u,
335
+ children: [
336
+ /* @__PURE__ */ r("div", { className: "flex flex-col items-center gap-ds-03 py-ds-06", children: [
337
+ /* @__PURE__ */ s("div", { className: "flex h-ds-sm-plus w-ds-sm-plus items-center justify-center rounded-ds-lg bg-surface-2", children: /* @__PURE__ */ s(
338
+ Ts,
339
+ {
340
+ className: "h-ico-sm w-ico-sm text-surface-fg-subtle",
341
+ stroke: 1.5
342
+ }
343
+ ) }),
344
+ /* @__PURE__ */ r("div", { className: "text-center", children: [
345
+ /* @__PURE__ */ s(
601
346
  "button",
602
347
  {
603
348
  type: "button",
604
- onClick: () => N(i.id),
605
- className: "text-ds-sm font-medium text-accent-11 transition-colors hover:underline",
606
- children: "Respond"
349
+ onClick: () => {
350
+ var v;
351
+ return (v = m.current) == null ? void 0 : v.click();
352
+ },
353
+ disabled: i,
354
+ className: "text-ds-md font-medium text-accent-11 transition-colors hover:underline disabled:opacity-action-disabled",
355
+ children: i ? "Uploading..." : "Click to upload"
607
356
  }
608
- ) }),
609
- /* @__PURE__ */ e("p", { className: "mt-ds-03 text-ds-xs text-surface-fg-subtle", children: Ys(i.createdAt) })
610
- ]
611
- },
612
- i.id
613
- );
614
- }) }) : /* @__PURE__ */ e(
615
- F,
616
- {
617
- icon: /* @__PURE__ */ e(se, {}),
618
- title: "No reviews yet",
619
- description: "Request a review from a team member",
620
- compact: !0
621
- }
622
- ),
623
- /* @__PURE__ */ e(
624
- ee,
625
- {
626
- members: w,
627
- selectedIds: [],
628
- onSelect: (i) => h(i),
629
- children: /* @__PURE__ */ t(
630
- "button",
357
+ ),
358
+ /* @__PURE__ */ r("span", { className: "text-ds-md text-surface-fg-subtle", children: [
359
+ " ",
360
+ "or drag and drop"
361
+ ] })
362
+ ] })
363
+ ] }),
364
+ /* @__PURE__ */ s(
365
+ "input",
631
366
  {
632
- type: "button",
633
- className: "mt-ds-04 inline-flex items-center gap-ds-02b rounded-ds-lg px-ds-03 py-ds-02b text-ds-md text-surface-fg-subtle transition-colors hover:bg-surface-3 hover:text-surface-fg-muted",
634
- children: [
635
- /* @__PURE__ */ e($, { className: "h-ico-sm w-ico-sm", stroke: 1.5 }),
636
- "Request Review"
637
- ]
367
+ ref: m,
368
+ type: "file",
369
+ accept: l,
370
+ onChange: x,
371
+ className: "hidden"
638
372
  }
639
373
  )
640
- }
641
- )
642
- ] });
374
+ ]
375
+ }
376
+ );
377
+ }
378
+ );
379
+ Fe.displayName = "FileDropZone";
380
+ const Ve = c.forwardRef(
381
+ function({ children: e, className: i, ...l }, d) {
382
+ return /* @__PURE__ */ s("div", { ref: d, className: h("space-y-ds-02", i), ...l, children: e });
643
383
  }
644
384
  );
645
- Ae.displayName = "ReviewTab";
646
- function Se(n) {
647
- const s = new Date(n), h = (/* @__PURE__ */ new Date()).getTime() - s.getTime();
648
- return Math.floor(h / 864e5) < 7 ? Ls(n) : s.toLocaleDateString("en-IN", {
385
+ Ve.displayName = "FileList";
386
+ function ct(t) {
387
+ if (!t) return fe;
388
+ const e = t.toLowerCase();
389
+ return ["jpg", "jpeg", "png", "gif", "svg", "webp", "bmp"].includes(e) ? Ls : ["pdf", "doc", "docx", "txt", "rtf"].includes(e) ? Ps : ["js", "ts", "jsx", "tsx", "py", "rb", "go", "rs", "html", "css", "json"].includes(e) ? Os : ["xls", "xlsx", "csv"].includes(e) ? _s : ["zip", "tar", "gz", "rar", "7z"].includes(e) ? Fs : fe;
390
+ }
391
+ function lt(t) {
392
+ return new Date(t).toLocaleDateString("en-IN", {
649
393
  month: "short",
650
394
  day: "numeric",
651
- hour: "numeric",
652
- minute: "2-digit"
395
+ year: "numeric"
653
396
  });
654
397
  }
655
- function Ws(n) {
656
- return n.authorType === "INTERNAL" && n.internalAuthor ? n.internalAuthor : n.authorType === "CLIENT" && n.clientAuthor ? {
657
- id: n.clientAuthor.id,
658
- name: n.clientAuthor.name,
659
- email: n.clientAuthor.email,
660
- image: null
661
- } : { id: n.authorId, name: "Unknown", image: null };
662
- }
663
- function Js(n) {
664
- return n.replace(/<[^>]*>/g, "");
665
- }
666
- const ke = o.forwardRef(
667
- function({
668
- comments: s,
669
- taskVisibility: g,
670
- onPostComment: h,
671
- className: b,
672
- clientMode: m = !1,
673
- richText: y = !0,
674
- renderEditor: D,
675
- renderViewer: x,
676
- ...d
677
- }, C) {
678
- const [N, w] = o.useState(""), I = o.useRef(null), i = D ?? (y ? (c) => /* @__PURE__ */ e(
679
- Ps,
398
+ const je = c.forwardRef(
399
+ function({ file: e, onDelete: i, readOnly: l = !1, className: d, ...u }, f) {
400
+ const m = ct(e.fileType);
401
+ return /* @__PURE__ */ r(
402
+ "div",
680
403
  {
681
- content: c.content,
682
- onChange: c.onChange,
683
- placeholder: c.placeholder,
684
- editable: !0,
685
- className: "min-h-[80px]"
686
- }
687
- ) : void 0), v = x ?? (y ? (c) => /* @__PURE__ */ e(ks, { content: c.content, className: c.className }) : void 0), l = () => {
688
- const c = N.trim();
689
- c.replace(/<[^>]*>/g, "").trim() && (h(c, m ? "CLIENT" : "INTERNAL"), w(""));
690
- };
691
- return o.useEffect(() => {
692
- I.current && (I.current.scrollTop = I.current.scrollHeight);
693
- }, [s.length]), /* @__PURE__ */ t("div", { ref: C, className: p("flex flex-col", b), ...d, children: [
694
- s.length > 0 ? /* @__PURE__ */ e(
695
- "div",
696
- {
697
- ref: I,
698
- className: "flex-1 space-y-ds-05 overflow-y-auto",
699
- children: s.map((c) => {
700
- const f = Ws(c), u = c.authorType === "CLIENT";
701
- return /* @__PURE__ */ t("div", { className: "flex gap-ds-03", children: [
702
- /* @__PURE__ */ t(j, { className: "h-ds-xs-plus w-ds-xs-plus shrink-0 mt-ds-01", children: [
703
- f.image && /* @__PURE__ */ e(H, { src: f.image, alt: f.name }),
704
- /* @__PURE__ */ e(
705
- G,
706
- {
707
- className: p(
708
- "text-ds-xs font-semibold",
709
- /* avatar initials — below scale, leave as-is */
710
- u ? "bg-warning-3 text-warning-11" : "bg-surface-3 text-accent-fg"
711
- ),
712
- children: B(f.name)
713
- }
714
- )
715
- ] }),
716
- /* @__PURE__ */ t("div", { className: "flex-1 min-w-0", children: [
717
- /* @__PURE__ */ t("div", { className: "flex items-baseline gap-ds-03", children: [
718
- /* @__PURE__ */ e("span", { className: "text-ds-md font-medium text-surface-fg", children: f.name }),
719
- m ? !u && /* @__PURE__ */ e("span", { className: "rounded bg-surface-3 px-ds-02 py-px text-ds-xs font-semibold uppercase tracking-wider text-accent-fg", children: "Team" }) : u && /* @__PURE__ */ e("span", { className: "rounded bg-warning-3 px-ds-02 py-px text-ds-xs font-semibold uppercase tracking-wider text-warning-11", children: "Client" }),
720
- /* @__PURE__ */ e("span", { className: "text-ds-sm text-surface-fg-subtle", children: Se(c.createdAt) })
404
+ ref: f,
405
+ className: h(
406
+ "group flex items-center gap-ds-04 rounded-ds-lg px-ds-03 py-ds-03 transition-colors hover:bg-surface-3",
407
+ d
408
+ ),
409
+ ...u,
410
+ children: [
411
+ /* @__PURE__ */ s("div", { className: "flex h-ds-sm w-ds-sm shrink-0 items-center justify-center rounded-ds-lg bg-surface-2", children: /* @__PURE__ */ s(
412
+ m,
413
+ {
414
+ className: "h-ico-sm w-ico-sm text-surface-fg-subtle",
415
+ stroke: 1.5
416
+ }
417
+ ) }),
418
+ /* @__PURE__ */ r("div", { className: "flex-1 min-w-0", children: [
419
+ /* @__PURE__ */ s("p", { className: "truncate text-ds-md font-medium text-surface-fg", children: e.title }),
420
+ /* @__PURE__ */ r("p", { className: "text-ds-sm text-surface-fg-subtle", children: [
421
+ lt(e.createdAt),
422
+ /* @__PURE__ */ s("span", { className: "mx-ds-02b", children: "by" }),
423
+ e.uploadedBy.name
424
+ ] })
425
+ ] }),
426
+ /* @__PURE__ */ r("div", { className: "flex items-center gap-ds-02 opacity-0 transition-opacity group-hover:opacity-100", children: [
427
+ e.externalUrl && /* @__PURE__ */ s(
428
+ "a",
429
+ {
430
+ href: /^https?:\/\//.test(e.externalUrl) ? e.externalUrl : "#",
431
+ target: "_blank",
432
+ rel: "noopener noreferrer",
433
+ className: "inline-flex h-ds-xs-plus w-ds-xs-plus items-center justify-center rounded-ds-md transition-colors hover:bg-surface-2",
434
+ title: e.externalLabel ?? "Open externally",
435
+ children: /* @__PURE__ */ s(As, { className: "h-ico-sm w-ico-sm text-surface-fg-subtle" })
436
+ }
437
+ ),
438
+ e.downloadUrl && /* @__PURE__ */ s(
439
+ "a",
440
+ {
441
+ href: /^https?:\/\//.test(e.downloadUrl) ? e.downloadUrl : "#",
442
+ target: "_blank",
443
+ rel: "noopener noreferrer",
444
+ className: "inline-flex h-ds-xs-plus w-ds-xs-plus items-center justify-center rounded-ds-md transition-colors hover:bg-surface-2",
445
+ title: "Download",
446
+ children: /* @__PURE__ */ s(Ss, { className: "h-ico-sm w-ico-sm text-surface-fg-subtle" })
447
+ }
448
+ ),
449
+ !l && i && /* @__PURE__ */ r(Js, { children: [
450
+ /* @__PURE__ */ s(Qs, { asChild: !0, children: /* @__PURE__ */ s(
451
+ "button",
452
+ {
453
+ type: "button",
454
+ className: "inline-flex h-ds-xs-plus w-ds-xs-plus items-center justify-center rounded-ds-md transition-colors hover:bg-error-3",
455
+ "aria-label": "Delete file",
456
+ children: /* @__PURE__ */ s(ks, { className: "h-ico-sm w-ico-sm text-error-11" })
457
+ }
458
+ ) }),
459
+ /* @__PURE__ */ r(Us, { children: [
460
+ /* @__PURE__ */ r(Xs, { children: [
461
+ /* @__PURE__ */ s(et, { children: "Delete file?" }),
462
+ /* @__PURE__ */ r(st, { children: [
463
+ '"',
464
+ e.title,
465
+ '" will be permanently deleted. This cannot be undone.'
466
+ ] })
721
467
  ] }),
722
- /* @__PURE__ */ e("div", { className: "mt-ds-02", children: v ? v({
723
- content: c.content,
724
- className: "[&_.ProseMirror]:!min-h-0 [&_.ProseMirror]:!p-0"
725
- }) : /* @__PURE__ */ e("p", { className: "text-ds-md text-surface-fg-muted whitespace-pre-wrap", children: Js(c.content) }) })
468
+ /* @__PURE__ */ r(tt, { children: [
469
+ /* @__PURE__ */ s(pe, { asChild: !0, children: /* @__PURE__ */ s(he, { variant: "outline", size: "sm", children: "Cancel" }) }),
470
+ /* @__PURE__ */ s(pe, { asChild: !0, children: /* @__PURE__ */ s(
471
+ he,
472
+ {
473
+ variant: "solid",
474
+ color: "error",
475
+ size: "sm",
476
+ onClick: () => i(e.id),
477
+ children: "Delete"
478
+ }
479
+ ) })
480
+ ] })
726
481
  ] })
727
- ] }, c.id);
728
- })
729
- }
730
- ) : /* @__PURE__ */ e(
731
- F,
482
+ ] })
483
+ ] })
484
+ ]
485
+ }
486
+ );
487
+ }
488
+ );
489
+ je.displayName = "FileItem";
490
+ const ot = [
491
+ { status: "APPROVED", label: "Approve", icon: xe },
492
+ { status: "CHANGES_REQUESTED", label: "Request Changes", icon: Ne },
493
+ { status: "REJECTED", label: "Reject", icon: Y }
494
+ ], Be = c.forwardRef(
495
+ function({ reviewId: e, onSubmit: i, className: l, ...d }, u) {
496
+ const [f, m] = c.useState(""), [p, o] = c.useState(!1), x = (b) => {
497
+ i(e, b, f || void 0), m(""), o(!1);
498
+ };
499
+ return /* @__PURE__ */ s("div", { ref: u, className: h(l), ...d, children: p ? /* @__PURE__ */ r("div", { className: "space-y-ds-03", children: [
500
+ /* @__PURE__ */ s(
501
+ "textarea",
732
502
  {
733
- icon: /* @__PURE__ */ e(De, {}),
734
- title: "No comments yet",
735
- description: "Start a conversation about this task",
736
- compact: !0
503
+ value: f,
504
+ onChange: (b) => m(b.target.value),
505
+ placeholder: "Add feedback (optional)...",
506
+ rows: 2,
507
+ className: "w-full resize-none rounded-ds-md border border-surface-border-strong bg-transparent px-ds-03 py-ds-03 text-ds-sm text-surface-fg placeholder:text-surface-fg-subtle outline-none focus:border-surface-border"
737
508
  }
738
509
  ),
739
- /* @__PURE__ */ t("div", { className: "mt-ds-05 space-y-ds-03", children: [
740
- g === "EVERYONE" && !m && /* @__PURE__ */ e("p", { className: "text-ds-xs text-warning-11", children: "This task is visible to clients. Comments may be seen by external users." }),
741
- i ? i({
742
- content: N,
743
- onChange: w,
744
- placeholder: "Write a comment..."
745
- }) : /* @__PURE__ */ e(
746
- "textarea",
747
- {
748
- value: N,
749
- onChange: (c) => w(c.target.value),
750
- placeholder: "Write a comment...",
751
- rows: 3,
752
- className: "w-full resize-none rounded-ds-md border border-surface-border-strong bg-transparent px-ds-04 py-ds-03 text-ds-md text-surface-fg placeholder:text-surface-fg-subtle outline-none focus:border-surface-border"
753
- }
754
- ),
755
- /* @__PURE__ */ e("div", { className: "flex justify-end", children: /* @__PURE__ */ t(
510
+ /* @__PURE__ */ r("div", { className: "flex items-center gap-ds-02b", children: [
511
+ ot.map((b) => {
512
+ const N = b.icon;
513
+ return /* @__PURE__ */ r(
514
+ "button",
515
+ {
516
+ type: "button",
517
+ onClick: () => x(b.status),
518
+ className: h(
519
+ "inline-flex items-center gap-ds-02 rounded-ds-md px-ds-03 py-ds-02 text-ds-sm font-semibold transition-colors",
520
+ b.status === "APPROVED" && "bg-success-3 text-success-11 hover:opacity-90",
521
+ b.status === "CHANGES_REQUESTED" && "bg-warning-3 text-warning-11 hover:opacity-90",
522
+ b.status === "REJECTED" && "bg-error-3 text-error-11 hover:opacity-90"
523
+ ),
524
+ children: [
525
+ /* @__PURE__ */ s(N, { className: "h-3 w-3", stroke: 2 }),
526
+ b.label
527
+ ]
528
+ },
529
+ b.status
530
+ );
531
+ }),
532
+ /* @__PURE__ */ s(
756
533
  "button",
757
534
  {
758
535
  type: "button",
759
- onClick: l,
760
- disabled: !N.replace(/<[^>]*>/g, "").trim(),
761
- className: "inline-flex items-center gap-ds-02b rounded-ds-lg bg-accent-9 px-ds-04 py-ds-02b text-ds-sm font-semibold text-accent-fg transition-colors hover:bg-accent-10 disabled:opacity-action-disabled disabled:cursor-not-allowed",
762
- children: [
763
- /* @__PURE__ */ e(ps, { className: "h-ico-sm w-ico-sm", stroke: 2 }),
764
- "Comment"
765
- ]
536
+ onClick: () => o(!1),
537
+ className: "ml-auto text-ds-sm text-surface-fg-subtle hover:text-surface-fg-muted",
538
+ children: "Cancel"
766
539
  }
767
- ) })
540
+ )
768
541
  ] })
769
- ] });
542
+ ] }) : /* @__PURE__ */ s(
543
+ "button",
544
+ {
545
+ type: "button",
546
+ onClick: () => o(!0),
547
+ className: "text-ds-sm font-medium text-accent-11 transition-colors hover:underline",
548
+ children: "Respond"
549
+ }
550
+ ) });
770
551
  }
771
552
  );
772
- ke.displayName = "ConversationTab";
773
- function Ms(n) {
774
- if (!n) return fe;
775
- const s = n.toLowerCase();
776
- return ["jpg", "jpeg", "png", "gif", "svg", "webp", "bmp"].includes(s) ? vs : ["pdf", "doc", "docx", "txt", "rtf"].includes(s) ? ys : ["js", "ts", "jsx", "tsx", "py", "rb", "go", "rs", "html", "css", "json"].includes(s) ? ws : ["xls", "xlsx", "csv"].includes(s) ? Is : ["zip", "tar", "gz", "rar", "7z"].includes(s) ? Cs : fe;
777
- }
778
- function Qs(n) {
779
- return new Date(n).toLocaleDateString("en-IN", {
553
+ Be.displayName = "ReviewResponseForm";
554
+ function dt(t) {
555
+ return new Date(t).toLocaleDateString("en-IN", {
780
556
  month: "short",
781
557
  day: "numeric",
782
- year: "numeric"
558
+ hour: "numeric",
559
+ minute: "2-digit"
783
560
  });
784
561
  }
785
- const Pe = o.forwardRef(
786
- function({
787
- files: s,
788
- onUpload: g,
789
- onDelete: h,
790
- isUploading: b = !1,
791
- className: m,
792
- readOnly: y = !1,
793
- ...D
794
- }, x) {
795
- const d = o.useRef(null), [C, N] = o.useState(!1), w = (l) => {
796
- var f;
797
- const c = (f = l.target.files) == null ? void 0 : f[0];
798
- c && g(c), d.current && (d.current.value = "");
799
- }, I = (l) => {
800
- var f;
801
- l.preventDefault(), N(!1);
802
- const c = (f = l.dataTransfer.files) == null ? void 0 : f[0];
803
- c && g(c);
804
- }, i = (l) => {
805
- l.preventDefault(), N(!0);
806
- }, v = () => {
807
- N(!1);
808
- };
809
- return /* @__PURE__ */ t("div", { ref: x, className: p("flex flex-col", m), ...D, children: [
810
- !y && /* @__PURE__ */ t(
811
- "div",
812
- {
813
- role: "region",
814
- "aria-label": "File upload drop zone",
815
- onDrop: I,
816
- onDragOver: i,
817
- onDragLeave: v,
818
- className: p(
819
- "rounded-ds-lg border-2 border-dashed transition-colors",
820
- C ? "border-accent-7 bg-accent-1" : "border-surface-border-strong"
821
- ),
822
- children: [
823
- /* @__PURE__ */ t("div", { className: "flex flex-col items-center gap-ds-03 py-ds-06", children: [
824
- /* @__PURE__ */ e("div", { className: "flex h-ds-sm-plus w-ds-sm-plus items-center justify-center rounded-ds-lg bg-surface-2", children: /* @__PURE__ */ e(
825
- gs,
562
+ const He = c.forwardRef(
563
+ function({ review: e, onUpdateStatus: i, className: l, ...d }, u) {
564
+ const f = at[e.status];
565
+ return /* @__PURE__ */ r(
566
+ "div",
567
+ {
568
+ ref: u,
569
+ className: h(
570
+ "rounded-ds-lg border border-surface-border-strong bg-surface-1 shadow-01 p-ds-04",
571
+ l
572
+ ),
573
+ ...d,
574
+ children: [
575
+ /* @__PURE__ */ r("div", { className: "flex items-center gap-ds-03", children: [
576
+ /* @__PURE__ */ r(F, { className: "h-ds-xs w-ds-xs shrink-0", children: [
577
+ e.reviewer.image && /* @__PURE__ */ s(
578
+ V,
826
579
  {
827
- className: "h-ico-sm w-ico-sm text-surface-fg-subtle",
828
- stroke: 1.5
580
+ src: e.reviewer.image,
581
+ alt: e.reviewer.name
829
582
  }
830
- ) }),
831
- /* @__PURE__ */ t("div", { className: "text-center", children: [
832
- /* @__PURE__ */ e(
833
- "button",
834
- {
835
- type: "button",
836
- onClick: () => {
837
- var l;
838
- return (l = d.current) == null ? void 0 : l.click();
839
- },
840
- disabled: b,
841
- className: "text-ds-md font-medium text-accent-11 transition-colors hover:underline disabled:opacity-action-disabled",
842
- children: b ? "Uploading..." : "Click to upload"
843
- }
844
- ),
845
- /* @__PURE__ */ t("span", { className: "text-ds-md text-surface-fg-subtle", children: [
846
- " ",
847
- "or drag and drop"
848
- ] })
583
+ ),
584
+ /* @__PURE__ */ s(j, { className: "bg-surface-3 text-ds-xs font-semibold text-accent-fg", children: H(e.reviewer.name) })
585
+ ] }),
586
+ /* @__PURE__ */ r("div", { className: "flex-1 min-w-0", children: [
587
+ /* @__PURE__ */ s("span", { className: "text-ds-md font-medium text-surface-fg", children: e.reviewer.name }),
588
+ /* @__PURE__ */ r("span", { className: "ml-ds-03 text-ds-sm text-surface-fg-subtle", children: [
589
+ "requested by ",
590
+ e.requestedBy.name
849
591
  ] })
850
592
  ] }),
851
- /* @__PURE__ */ e(
852
- "input",
593
+ /* @__PURE__ */ s(
594
+ Ys,
853
595
  {
854
- ref: d,
855
- type: "file",
856
- onChange: w,
857
- className: "hidden"
596
+ color: f.color,
597
+ children: f.label
858
598
  }
859
599
  )
860
- ]
861
- }
862
- ),
863
- s.length > 0 ? /* @__PURE__ */ e("div", { className: "mt-ds-05 space-y-ds-02", children: s.map((l) => {
864
- const c = Ms(l.fileType);
865
- return /* @__PURE__ */ t(
866
- "div",
600
+ ] }),
601
+ e.feedback && /* @__PURE__ */ s("div", { className: "mt-ds-03 rounded-ds-md bg-surface-2 px-ds-04 py-ds-03", children: /* @__PURE__ */ s("p", { className: "text-ds-sm text-surface-fg-muted", children: e.feedback }) }),
602
+ e.status === "PENDING" && i && /* @__PURE__ */ s("div", { className: "mt-ds-03", children: /* @__PURE__ */ s(
603
+ Be,
604
+ {
605
+ reviewId: e.id,
606
+ onSubmit: i
607
+ }
608
+ ) }),
609
+ /* @__PURE__ */ s("p", { className: "mt-ds-03 text-ds-xs text-surface-fg-subtle", children: dt(e.createdAt) })
610
+ ]
611
+ }
612
+ );
613
+ }
614
+ );
615
+ He.displayName = "ReviewCard";
616
+ const qe = c.forwardRef(
617
+ function({ members: e, onRequest: i, className: l, ...d }, u) {
618
+ const f = c.useMemo(
619
+ () => e.map((m) => ({ id: m.id, name: m.name, avatar: m.image ?? void 0 })),
620
+ [e]
621
+ );
622
+ return /* @__PURE__ */ s("div", { ref: u, className: h(l), ...d, children: /* @__PURE__ */ s(
623
+ X,
624
+ {
625
+ members: f,
626
+ selectedIds: [],
627
+ onSelect: (m) => i(m),
628
+ children: /* @__PURE__ */ r(
629
+ "button",
867
630
  {
868
- className: "group flex items-center gap-ds-04 rounded-ds-lg px-ds-03 py-ds-03 transition-colors hover:bg-surface-3",
631
+ type: "button",
632
+ className: "mt-ds-04 inline-flex items-center gap-ds-02b rounded-ds-lg px-ds-03 py-ds-02b text-ds-md text-surface-fg-subtle transition-colors hover:bg-surface-3 hover:text-surface-fg-muted",
869
633
  children: [
870
- /* @__PURE__ */ e("div", { className: "flex h-ds-sm w-ds-sm shrink-0 items-center justify-center rounded-ds-lg bg-surface-2", children: /* @__PURE__ */ e(
871
- c,
872
- {
873
- className: "h-ico-sm w-ico-sm text-surface-fg-subtle",
874
- stroke: 1.5
875
- }
876
- ) }),
877
- /* @__PURE__ */ t("div", { className: "flex-1 min-w-0", children: [
878
- /* @__PURE__ */ e("p", { className: "truncate text-ds-md font-medium text-surface-fg", children: l.title }),
879
- /* @__PURE__ */ t("p", { className: "text-ds-sm text-surface-fg-subtle", children: [
880
- Qs(l.createdAt),
881
- /* @__PURE__ */ e("span", { className: "mx-ds-02b", children: "by" }),
882
- l.uploadedBy.name
883
- ] })
884
- ] }),
885
- /* @__PURE__ */ t("div", { className: "flex items-center gap-ds-02 opacity-0 transition-opacity group-hover:opacity-100", children: [
886
- l.externalUrl && /* @__PURE__ */ e(
887
- "a",
888
- {
889
- href: /^https?:\/\//.test(l.externalUrl) ? l.externalUrl : "#",
890
- target: "_blank",
891
- rel: "noopener noreferrer",
892
- className: "inline-flex h-ds-xs-plus w-ds-xs-plus items-center justify-center rounded-ds-md transition-colors hover:bg-surface-2",
893
- title: l.externalLabel ?? "Open externally",
894
- children: /* @__PURE__ */ e(bs, { className: "h-ico-sm w-ico-sm text-surface-fg-subtle" })
895
- }
896
- ),
897
- l.downloadUrl && /* @__PURE__ */ e(
898
- "a",
899
- {
900
- href: /^https?:\/\//.test(l.downloadUrl) ? l.downloadUrl : "#",
901
- target: "_blank",
902
- rel: "noopener noreferrer",
903
- className: "inline-flex h-ds-xs-plus w-ds-xs-plus items-center justify-center rounded-ds-md transition-colors hover:bg-surface-2",
904
- title: "Download",
905
- children: /* @__PURE__ */ e(xs, { className: "h-ico-sm w-ico-sm text-surface-fg-subtle" })
906
- }
907
- ),
908
- !y && /* @__PURE__ */ t(Os, { children: [
909
- /* @__PURE__ */ e(_s, { asChild: !0, children: /* @__PURE__ */ e(
910
- "button",
911
- {
912
- type: "button",
913
- className: "inline-flex h-ds-xs-plus w-ds-xs-plus items-center justify-center rounded-ds-md transition-colors hover:bg-error-3",
914
- "aria-label": "Delete file",
915
- children: /* @__PURE__ */ e(Ns, { className: "h-ico-sm w-ico-sm text-error-11" })
916
- }
917
- ) }),
918
- /* @__PURE__ */ t(Vs, { children: [
919
- /* @__PURE__ */ t(js, { children: [
920
- /* @__PURE__ */ e(Hs, { children: "Delete file?" }),
921
- /* @__PURE__ */ t(Gs, { children: [
922
- '"',
923
- l.title,
924
- '" will be permanently deleted. This cannot be undone.'
925
- ] })
926
- ] }),
927
- /* @__PURE__ */ t($s, { children: [
928
- /* @__PURE__ */ e(he, { asChild: !0, children: /* @__PURE__ */ e(pe, { variant: "outline", size: "sm", children: "Cancel" }) }),
929
- /* @__PURE__ */ e(he, { asChild: !0, children: /* @__PURE__ */ e(
930
- pe,
931
- {
932
- variant: "solid",
933
- color: "error",
934
- size: "sm",
935
- onClick: () => h(l.id),
936
- children: "Delete"
937
- }
938
- ) })
939
- ] })
940
- ] })
941
- ] })
942
- ] })
943
- ]
944
- },
945
- l.id
946
- );
947
- }) }) : /* @__PURE__ */ e("div", { className: "mt-ds-03", children: /* @__PURE__ */ e(
948
- F,
949
- {
950
- icon: /* @__PURE__ */ e(te, {}),
951
- title: "No files attached",
952
- description: "Upload files to share with your team",
953
- compact: !0
954
- }
955
- ) })
634
+ /* @__PURE__ */ s(B, { className: "h-ico-sm w-ico-sm", stroke: 1.5 }),
635
+ "Request Review"
636
+ ]
637
+ }
638
+ )
639
+ }
640
+ ) });
641
+ }
642
+ );
643
+ qe.displayName = "ReviewRequestButton";
644
+ const Ge = c.forwardRef(
645
+ function({ children: e, className: i, ...l }, d) {
646
+ return /* @__PURE__ */ r("div", { ref: d, className: h("relative", i), ...l, children: [
647
+ /* @__PURE__ */ s("div", { className: "absolute left-[11px] top-2 bottom-2 w-px bg-surface-border" }),
648
+ /* @__PURE__ */ s("div", { className: "space-y-ds-05", children: e })
956
649
  ] });
957
650
  }
958
651
  );
959
- Pe.displayName = "FilesTab";
960
- const Us = {
652
+ Ge.displayName = "ActivityTimeline";
653
+ const ut = {
961
654
  "task.created": {
962
- icon: $,
655
+ icon: B,
963
656
  color: "text-success-11",
964
657
  dotColor: "bg-success-9",
965
658
  getDescription: () => "created this task"
966
659
  },
967
660
  "task.updated": {
968
- icon: As,
661
+ icon: qs,
969
662
  color: "text-category-slate-11",
970
663
  dotColor: "bg-category-slate-9",
971
- getDescription: (n) => {
972
- const s = n.metadata;
973
- return (s == null ? void 0 : s.field) === "title" ? "updated the title" : (s == null ? void 0 : s.field) === "description" ? "updated the description" : (s == null ? void 0 : s.field) === "priority" ? `changed priority to ${(s == null ? void 0 : s.newValue) || "unknown"}` : (s == null ? void 0 : s.field) === "dueDate" ? "updated the due date" : (s == null ? void 0 : s.field) === "labels" ? "updated labels" : "updated this task";
664
+ getDescription: (t) => {
665
+ const e = t.metadata;
666
+ return (e == null ? void 0 : e.field) === "title" ? "updated the title" : (e == null ? void 0 : e.field) === "description" ? "updated the description" : (e == null ? void 0 : e.field) === "priority" ? `changed priority to ${(e == null ? void 0 : e.newValue) || "unknown"}` : (e == null ? void 0 : e.field) === "dueDate" ? "updated the due date" : (e == null ? void 0 : e.field) === "labels" ? "updated labels" : "updated this task";
974
667
  }
975
668
  },
976
669
  "task.moved": {
977
- icon: Rs,
670
+ icon: Hs,
978
671
  color: "text-warning-11",
979
672
  dotColor: "bg-warning-9",
980
- getDescription: (n) => {
981
- const s = n.metadata, g = (s == null ? void 0 : s.fromColumn) || "unknown", h = (s == null ? void 0 : s.toColumn) || "unknown";
982
- return `moved from ${g} to ${h}`;
673
+ getDescription: (t) => {
674
+ const e = t.metadata, i = (e == null ? void 0 : e.fromColumn) || "unknown", l = (e == null ? void 0 : e.toColumn) || "unknown";
675
+ return `moved from ${i} to ${l}`;
983
676
  }
984
677
  },
985
678
  "task.assigned": {
986
- icon: Ts,
679
+ icon: Bs,
987
680
  color: "text-category-cyan-11",
988
681
  dotColor: "bg-category-cyan-9",
989
- getDescription: (n) => {
990
- const s = n.metadata;
991
- return `assigned ${(s == null ? void 0 : s.assigneeName) || "a user"}`;
682
+ getDescription: (t) => {
683
+ const e = t.metadata;
684
+ return `assigned ${(e == null ? void 0 : e.assigneeName) || "a user"}`;
992
685
  }
993
686
  },
994
687
  "task.unassigned": {
995
- icon: Es,
688
+ icon: js,
996
689
  color: "text-surface-fg-muted",
997
690
  dotColor: "bg-disabled",
998
- getDescription: (n) => {
999
- const s = n.metadata;
1000
- return `removed ${(s == null ? void 0 : s.assigneeName) || "a user"}`;
691
+ getDescription: (t) => {
692
+ const e = t.metadata;
693
+ return `removed ${(e == null ? void 0 : e.assigneeName) || "a user"}`;
1001
694
  }
1002
695
  },
1003
696
  "task.commented": {
1004
- icon: Ce,
697
+ icon: Ne,
1005
698
  color: "text-accent-11",
1006
699
  dotColor: "bg-accent-9",
1007
700
  getDescription: () => "added a comment"
1008
701
  },
1009
702
  "task.file_uploaded": {
1010
- icon: te,
703
+ icon: se,
1011
704
  color: "text-category-indigo-11",
1012
705
  dotColor: "bg-category-indigo-9",
1013
- getDescription: (n) => {
1014
- const s = n.metadata;
1015
- return `uploaded ${(s == null ? void 0 : s.fileName) || "a file"}`;
706
+ getDescription: (t) => {
707
+ const e = t.metadata;
708
+ return `uploaded ${(e == null ? void 0 : e.fileName) || "a file"}`;
1016
709
  }
1017
710
  },
1018
711
  "task.review_requested": {
1019
- icon: se,
712
+ icon: ee,
1020
713
  color: "text-warning-11",
1021
714
  dotColor: "bg-warning-9",
1022
- getDescription: (n) => {
1023
- const s = n.metadata;
1024
- return `requested review from ${(s == null ? void 0 : s.reviewerName) || "a reviewer"}`;
715
+ getDescription: (t) => {
716
+ const e = t.metadata;
717
+ return `requested review from ${(e == null ? void 0 : e.reviewerName) || "a reviewer"}`;
1025
718
  }
1026
719
  },
1027
720
  "task.review_completed": {
1028
- icon: Ds,
721
+ icon: Vs,
1029
722
  color: "text-success-11",
1030
723
  dotColor: "bg-success-9",
1031
- getDescription: (n) => {
1032
- const s = n.metadata;
1033
- return `${(s == null ? void 0 : s.status) || "reviewed"} the task`;
724
+ getDescription: (t) => {
725
+ const e = t.metadata;
726
+ return `${(e == null ? void 0 : e.status) || "reviewed"} the task`;
1034
727
  }
1035
728
  },
1036
729
  "task.visibility_changed": {
1037
- icon: we,
730
+ icon: Ie,
1038
731
  color: "text-surface-fg-subtle",
1039
732
  dotColor: "bg-surface-fg-subtle",
1040
- getDescription: (n) => {
1041
- const s = n.metadata;
1042
- return `changed visibility to ${(s == null ? void 0 : s.visibility) || "unknown"}`;
733
+ getDescription: (t) => {
734
+ const e = t.metadata;
735
+ return `changed visibility to ${(e == null ? void 0 : e.visibility) || "unknown"}`;
1043
736
  }
1044
737
  },
1045
738
  "task.priority_changed": {
1046
- icon: Ne,
739
+ icon: we,
1047
740
  color: "text-error-11",
1048
741
  dotColor: "bg-error-9",
1049
- getDescription: (n) => {
1050
- const s = n.metadata;
1051
- return `changed priority to ${(s == null ? void 0 : s.priority) || "unknown"}`;
742
+ getDescription: (t) => {
743
+ const e = t.metadata;
744
+ return `changed priority to ${(e == null ? void 0 : e.priority) || "unknown"}`;
1052
745
  }
1053
746
  },
1054
747
  "task.labels_changed": {
@@ -1061,294 +754,779 @@ const Us = {
1061
754
  icon: ve,
1062
755
  color: "text-warning-11",
1063
756
  dotColor: "bg-warning-9",
1064
- getDescription: (n) => {
1065
- const s = n.metadata;
1066
- return s != null && s.dueDate ? `set due date to ${s.dueDate}` : "updated the due date";
757
+ getDescription: (t) => {
758
+ const e = t.metadata;
759
+ return e != null && e.dueDate ? `set due date to ${e.dueDate}` : "updated the due date";
1067
760
  }
1068
761
  }
1069
- }, Xs = {
1070
- icon: re,
762
+ }, mt = {
763
+ icon: te,
1071
764
  color: "text-surface-fg-subtle",
1072
765
  dotColor: "bg-disabled",
1073
- getDescription: (n) => n.action
766
+ getDescription: (t) => t.action
1074
767
  };
1075
- function Zs(n) {
1076
- const s = n.metadata;
1077
- return s != null && s.actorName ? s.actorName : n.actorType === "SYSTEM" ? "System" : n.actorType === "AGENT" ? "AI Agent" : "Someone";
768
+ function ft(t) {
769
+ const e = t.metadata;
770
+ return e != null && e.actorName ? e.actorName : t.actorType === "SYSTEM" ? "System" : t.actorType === "AGENT" ? "AI Agent" : "Someone";
1078
771
  }
1079
- const Le = o.forwardRef(
1080
- function({ activities: s, className: g, ...h }, b) {
1081
- return s.length === 0 ? /* @__PURE__ */ e(
1082
- F,
772
+ const $e = c.forwardRef(
773
+ function({ entry: e, className: i, ...l }, d) {
774
+ const u = ut[e.action] || mt, f = u.icon, m = ft(e), p = u.getDescription(e);
775
+ return /* @__PURE__ */ r("div", { ref: d, className: h("relative flex gap-ds-04 pl-0", i), ...l, children: [
776
+ /* @__PURE__ */ s("div", { className: "relative z-raised flex h-[22px] w-[22px] shrink-0 items-center justify-center rounded-ds-full bg-surface-1", children: /* @__PURE__ */ s(
777
+ "div",
778
+ {
779
+ className: h(
780
+ "flex h-ico-md w-ico-md items-center justify-center rounded-ds-full bg-surface-2"
781
+ ),
782
+ children: /* @__PURE__ */ s(
783
+ f,
784
+ {
785
+ className: h("h-3 w-3", u.color),
786
+ stroke: 2
787
+ }
788
+ )
789
+ }
790
+ ) }),
791
+ /* @__PURE__ */ r("div", { className: "flex-1 min-w-0 pt-ds-01", children: [
792
+ /* @__PURE__ */ r("p", { className: "text-ds-sm", children: [
793
+ /* @__PURE__ */ s("span", { className: "font-medium text-surface-fg", children: m }),
794
+ /* @__PURE__ */ r("span", { className: "text-surface-fg-subtle", children: [
795
+ " ",
796
+ p
797
+ ] })
798
+ ] }),
799
+ /* @__PURE__ */ s("p", { className: "mt-ds-01 text-ds-xs text-surface-fg-subtle", children: Le(e.timestamp) })
800
+ ] })
801
+ ] });
802
+ }
803
+ );
804
+ $e.displayName = "ActivityEntry";
805
+ const Me = c.forwardRef(
806
+ function({
807
+ subtasks: e,
808
+ terminalColumnId: i,
809
+ onCreateSubtask: l,
810
+ onToggleSubtask: d,
811
+ onClickSubtask: u,
812
+ className: f,
813
+ readOnly: m = !1,
814
+ ...p
815
+ }, o) {
816
+ const x = e.filter(
817
+ (N) => {
818
+ var g;
819
+ return ((g = N.column) == null ? void 0 : g.isTerminal) || N.columnId === i;
820
+ }
821
+ ).length, b = e.length;
822
+ return /* @__PURE__ */ r("div", { ref: o, className: h("flex flex-col", f), ...p, children: [
823
+ b > 0 && /* @__PURE__ */ s(Ee, { completed: x, total: b }),
824
+ e.length > 0 ? /* @__PURE__ */ s(Te, { children: e.map((N) => {
825
+ var v;
826
+ const g = ((v = N.column) == null ? void 0 : v.isTerminal) || N.columnId === i;
827
+ return /* @__PURE__ */ s(
828
+ Ae,
829
+ {
830
+ subtask: N,
831
+ isComplete: !!g,
832
+ onToggle: m ? void 0 : d,
833
+ onClick: u
834
+ },
835
+ N.id
836
+ );
837
+ }) }) : !m && /* @__PURE__ */ s(
838
+ q,
839
+ {
840
+ icon: /* @__PURE__ */ s(Ce, {}),
841
+ title: "No subtasks",
842
+ description: "Break this task into smaller pieces",
843
+ compact: !0
844
+ }
845
+ ),
846
+ !m && /* @__PURE__ */ s(Se, { onCreate: l })
847
+ ] });
848
+ }
849
+ );
850
+ Me.displayName = "SubtasksTab";
851
+ const ze = c.forwardRef(
852
+ function({
853
+ comments: e,
854
+ taskVisibility: i,
855
+ onPostComment: l,
856
+ className: d,
857
+ clientMode: u = !1,
858
+ richText: f = !0,
859
+ renderEditor: m,
860
+ renderViewer: p,
861
+ ...o
862
+ }, x) {
863
+ const b = m ?? (f ? (g) => /* @__PURE__ */ s(
864
+ Ks,
865
+ {
866
+ content: g.content,
867
+ onChange: g.onChange,
868
+ placeholder: g.placeholder,
869
+ editable: !0,
870
+ className: "min-h-[80px]"
871
+ }
872
+ ) : void 0), N = p ?? (f ? (g) => /* @__PURE__ */ s(Ws, { content: g.content, className: g.className }) : void 0);
873
+ return /* @__PURE__ */ r("div", { ref: x, className: h("flex flex-col", d), ...o, children: [
874
+ e.length > 0 ? /* @__PURE__ */ s(ke, { children: e.map((g) => /* @__PURE__ */ s(
875
+ Pe,
876
+ {
877
+ comment: g,
878
+ clientMode: u,
879
+ renderViewer: N
880
+ },
881
+ g.id
882
+ )) }) : /* @__PURE__ */ s(
883
+ q,
884
+ {
885
+ icon: /* @__PURE__ */ s(De, {}),
886
+ title: "No comments yet",
887
+ description: "Start a conversation about this task",
888
+ compact: !0
889
+ }
890
+ ),
891
+ /* @__PURE__ */ r("div", { className: "mt-ds-05", children: [
892
+ i === "EVERYONE" && !u && /* @__PURE__ */ s(_e, { className: "mb-ds-03" }),
893
+ /* @__PURE__ */ s(
894
+ Oe,
895
+ {
896
+ onSubmit: l,
897
+ renderEditor: b,
898
+ clientMode: u
899
+ }
900
+ )
901
+ ] })
902
+ ] });
903
+ }
904
+ );
905
+ ze.displayName = "ConversationTab";
906
+ const Ye = c.forwardRef(
907
+ function({
908
+ files: e,
909
+ onUpload: i,
910
+ onDelete: l,
911
+ isUploading: d = !1,
912
+ className: u,
913
+ readOnly: f = !1,
914
+ ...m
915
+ }, p) {
916
+ return /* @__PURE__ */ r("div", { ref: p, className: h("flex flex-col", u), ...m, children: [
917
+ !f && /* @__PURE__ */ s(Fe, { onUpload: i, isUploading: d }),
918
+ e.length > 0 ? /* @__PURE__ */ s(Ve, { className: "mt-ds-05", children: e.map((o) => /* @__PURE__ */ s(
919
+ je,
920
+ {
921
+ file: o,
922
+ onDelete: l,
923
+ readOnly: f
924
+ },
925
+ o.id
926
+ )) }) : /* @__PURE__ */ s("div", { className: "mt-ds-03", children: /* @__PURE__ */ s(
927
+ q,
928
+ {
929
+ icon: /* @__PURE__ */ s(se, {}),
930
+ title: "No files attached",
931
+ description: "Upload files to share with your team",
932
+ compact: !0
933
+ }
934
+ ) })
935
+ ] });
936
+ }
937
+ );
938
+ Ye.displayName = "FilesTab";
939
+ const We = c.forwardRef(
940
+ function({
941
+ reviews: e,
942
+ members: i,
943
+ onRequestReview: l,
944
+ onUpdateStatus: d,
945
+ className: u,
946
+ readOnly: f = !1,
947
+ ...m
948
+ }, p) {
949
+ return /* @__PURE__ */ r("div", { ref: p, className: h("flex flex-col", u), ...m, children: [
950
+ e.length > 0 ? /* @__PURE__ */ s("div", { className: "space-y-ds-04", children: e.map((o) => /* @__PURE__ */ s(
951
+ He,
952
+ {
953
+ review: o,
954
+ onUpdateStatus: f ? void 0 : d
955
+ },
956
+ o.id
957
+ )) }) : /* @__PURE__ */ s(
958
+ q,
959
+ {
960
+ icon: /* @__PURE__ */ s(ee, {}),
961
+ title: "No reviews yet",
962
+ description: "Request a review from a team member",
963
+ compact: !0
964
+ }
965
+ ),
966
+ !f && /* @__PURE__ */ s(
967
+ qe,
968
+ {
969
+ members: i,
970
+ onRequest: l
971
+ }
972
+ )
973
+ ] });
974
+ }
975
+ );
976
+ We.displayName = "ReviewTab";
977
+ const Ke = c.forwardRef(
978
+ function({ activities: e, className: i, ...l }, d) {
979
+ return e.length === 0 ? /* @__PURE__ */ s(
980
+ q,
1083
981
  {
1084
- ref: b,
1085
- icon: /* @__PURE__ */ e(re, {}),
982
+ ref: d,
983
+ icon: /* @__PURE__ */ s(te, {}),
1086
984
  title: "No activity yet",
1087
985
  description: "Actions on this task will appear here",
1088
986
  compact: !0,
1089
- className: g,
1090
- ...h
987
+ className: i,
988
+ ...l
1091
989
  }
1092
- ) : /* @__PURE__ */ t("div", { ref: b, className: p("relative", g), ...h, children: [
1093
- /* @__PURE__ */ e("div", { className: "absolute left-[11px] top-2 bottom-2 w-px bg-surface-border" }),
1094
- /* @__PURE__ */ e("div", { className: "space-y-ds-05", children: s.map((m) => {
1095
- const y = Us[m.action] || Xs, D = y.icon, x = Zs(m), d = y.getDescription(m);
1096
- return /* @__PURE__ */ t("div", { className: "relative flex gap-ds-04 pl-0", children: [
1097
- /* @__PURE__ */ e("div", { className: "relative z-raised flex h-[22px] w-[22px] shrink-0 items-center justify-center rounded-ds-full bg-surface-1", children: /* @__PURE__ */ e(
1098
- "div",
990
+ ) : /* @__PURE__ */ s(Ge, { ref: d, className: h(i), ...l, children: e.map((u) => /* @__PURE__ */ s($e, { entry: u }, u.id)) });
991
+ }
992
+ );
993
+ Ke.displayName = "ActivityTab";
994
+ const pt = ["LOW", "MEDIUM", "HIGH", "URGENT"];
995
+ function S({
996
+ icon: t,
997
+ label: e,
998
+ children: i,
999
+ className: l
1000
+ }) {
1001
+ return /* @__PURE__ */ r(
1002
+ "div",
1003
+ {
1004
+ className: h(
1005
+ "flex items-center gap-ds-04 py-ds-03",
1006
+ l
1007
+ ),
1008
+ children: [
1009
+ /* @__PURE__ */ r("div", { className: "flex w-[120px] shrink-0 items-center gap-ds-03 text-surface-fg-subtle", children: [
1010
+ /* @__PURE__ */ s(t, { className: "h-ico-sm w-ico-sm", stroke: 1.5 }),
1011
+ /* @__PURE__ */ s("span", { className: "text-ds-sm", children: e })
1012
+ ] }),
1013
+ /* @__PURE__ */ s("div", { className: "flex-1 min-w-0", children: i })
1014
+ ]
1015
+ }
1016
+ );
1017
+ }
1018
+ function ht({ priority: t }) {
1019
+ return /* @__PURE__ */ r("div", { className: "flex items-center gap-ds-02b", children: [
1020
+ /* @__PURE__ */ s("div", { className: h("h-2 w-2 rounded-ds-full", Re[t]) }),
1021
+ /* @__PURE__ */ s("span", { className: "text-ds-md text-surface-fg", children: rt[t] || t })
1022
+ ] });
1023
+ }
1024
+ const Ze = c.forwardRef(
1025
+ function({
1026
+ task: e,
1027
+ columns: i,
1028
+ members: l,
1029
+ onUpdate: d,
1030
+ onAssign: u,
1031
+ onUnassign: f,
1032
+ className: m,
1033
+ readOnly: p = !1,
1034
+ editableFields: o,
1035
+ renderPriorityIndicator: x,
1036
+ renderDatePicker: b,
1037
+ onConfirmVisibilityChange: N,
1038
+ ...g
1039
+ }, v) {
1040
+ const [w, y] = c.useState(""), [k, C] = c.useState(!1), R = e.assignees.map((n) => n.user.id), E = c.useMemo(
1041
+ () => l.map((n) => ({ id: n.id, name: n.name, avatar: n.image ?? void 0 })),
1042
+ [l]
1043
+ ), L = (n) => {
1044
+ d("columnId", n);
1045
+ }, P = (n) => {
1046
+ d("ownerId", n === e.ownerId ? null : n);
1047
+ }, re = (n) => {
1048
+ R.includes(n) ? f(n) : u(n);
1049
+ }, O = (n) => {
1050
+ d("priority", n);
1051
+ }, D = (n) => {
1052
+ d("dueDate", n ? n.toISOString() : null);
1053
+ }, G = () => {
1054
+ const n = w.trim();
1055
+ n && !e.labels.includes(n) && d("labels", [...e.labels, n]), y(""), C(!1);
1056
+ }, W = (n) => {
1057
+ d("labels", e.labels.filter((Z) => Z !== n));
1058
+ }, K = () => {
1059
+ const n = e.visibility === "INTERNAL" ? "EVERYONE" : "INTERNAL";
1060
+ if (n === "EVERYONE" && N) {
1061
+ N();
1062
+ return;
1063
+ }
1064
+ d("visibility", n);
1065
+ }, $ = x || ht;
1066
+ return /* @__PURE__ */ r("div", { ref: v, className: h("space-y-ds-01", m), ...g, children: [
1067
+ /* @__PURE__ */ s(S, { icon: Gs, label: "Column", children: p && !(o != null && o.includes("columnId")) ? /* @__PURE__ */ s("span", { className: "px-ds-03 py-ds-02 text-ds-md text-surface-fg", children: e.column.name }) : /* @__PURE__ */ r(de, { children: [
1068
+ /* @__PURE__ */ s(ue, { asChild: !0, children: /* @__PURE__ */ r(
1069
+ "button",
1070
+ {
1071
+ type: "button",
1072
+ className: "inline-flex items-center gap-ds-02b rounded-ds-md px-ds-03 py-ds-02 text-ds-md text-surface-fg transition-colors hover:bg-surface-3",
1073
+ children: [
1074
+ /* @__PURE__ */ s("span", { children: e.column.name }),
1075
+ /* @__PURE__ */ s($s, { className: "h-3 w-3 text-surface-fg-subtle" })
1076
+ ]
1077
+ }
1078
+ ) }),
1079
+ /* @__PURE__ */ s(
1080
+ me,
1081
+ {
1082
+ className: "w-[180px] border-surface-border-strong bg-surface-1 p-ds-02",
1083
+ align: "start",
1084
+ sideOffset: 4,
1085
+ children: i.map((n) => /* @__PURE__ */ r(
1086
+ "button",
1087
+ {
1088
+ type: "button",
1089
+ onClick: () => L(n.id),
1090
+ className: h(
1091
+ "flex w-full items-center gap-ds-03 rounded-ds-md px-ds-03 py-ds-02b text-left text-ds-md transition-colors",
1092
+ "hover:bg-surface-3",
1093
+ n.id === e.columnId ? "text-accent-11" : "text-surface-fg"
1094
+ ),
1095
+ children: [
1096
+ n.name,
1097
+ n.id === e.columnId && /* @__PURE__ */ s(xe, { className: "ml-auto h-ico-sm w-ico-sm" })
1098
+ ]
1099
+ },
1100
+ n.id
1101
+ ))
1102
+ }
1103
+ )
1104
+ ] }) }),
1105
+ !p && /* @__PURE__ */ s(S, { icon: Ms, label: "Owner", children: /* @__PURE__ */ s(
1106
+ X,
1107
+ {
1108
+ members: E,
1109
+ selectedIds: e.ownerId ? [e.ownerId] : [],
1110
+ onSelect: P,
1111
+ children: /* @__PURE__ */ s(
1112
+ "button",
1099
1113
  {
1100
- className: p(
1101
- "flex h-ico-md w-ico-md items-center justify-center rounded-ds-full bg-surface-2"
1102
- ),
1103
- children: /* @__PURE__ */ e(
1104
- D,
1114
+ type: "button",
1115
+ className: "inline-flex items-center gap-ds-03 rounded-ds-md px-ds-03 py-ds-02 transition-colors hover:bg-surface-3",
1116
+ children: e.owner ? /* @__PURE__ */ r(ge, { children: [
1117
+ /* @__PURE__ */ r(F, { className: "h-ico-md w-ico-md", children: [
1118
+ e.owner.image && /* @__PURE__ */ s(V, { src: e.owner.image, alt: e.owner.name }),
1119
+ /* @__PURE__ */ s(j, { className: "bg-surface-3 text-ds-xs font-semibold text-accent-fg", children: H(e.owner.name) })
1120
+ ] }),
1121
+ /* @__PURE__ */ s("span", { className: "text-ds-md text-surface-fg", children: e.owner.name })
1122
+ ] }) : /* @__PURE__ */ s("span", { className: "text-ds-md text-surface-fg-subtle", children: "No owner" })
1123
+ }
1124
+ )
1125
+ }
1126
+ ) }),
1127
+ /* @__PURE__ */ s(S, { icon: zs, label: "Assignees", children: /* @__PURE__ */ r("div", { className: "flex flex-wrap items-center gap-ds-02b", children: [
1128
+ e.assignees.map((n) => /* @__PURE__ */ r(
1129
+ "div",
1130
+ {
1131
+ className: "inline-flex items-center gap-ds-02 rounded-ds-full bg-surface-2 py-ds-01 pl-ds-01 pr-ds-03",
1132
+ children: [
1133
+ /* @__PURE__ */ r(F, { className: "h-ico-sm w-ico-sm", children: [
1134
+ n.user.image && /* @__PURE__ */ s(V, { src: n.user.image, alt: n.user.name }),
1135
+ /* @__PURE__ */ s(j, { className: "bg-surface-3 text-ds-xs font-semibold text-accent-fg", children: H(n.user.name) })
1136
+ ] }),
1137
+ /* @__PURE__ */ s("span", { className: "text-ds-sm text-surface-fg-muted", children: n.user.name.split(" ")[0] }),
1138
+ !p && /* @__PURE__ */ s(
1139
+ "button",
1105
1140
  {
1106
- className: p("h-3 w-3", y.color),
1107
- stroke: 2
1141
+ type: "button",
1142
+ onClick: () => f(n.user.id),
1143
+ className: "ml-ds-01 rounded-ds-full p-ds-01 transition-colors hover:bg-surface-3",
1144
+ "aria-label": `Remove ${n.user.name}`,
1145
+ children: /* @__PURE__ */ s(Y, { className: "h-ds-03 w-ds-03 text-surface-fg-subtle" })
1108
1146
  }
1109
1147
  )
1110
- }
1111
- ) }),
1112
- /* @__PURE__ */ t("div", { className: "flex-1 min-w-0 pt-ds-01", children: [
1113
- /* @__PURE__ */ t("p", { className: "text-ds-sm", children: [
1114
- /* @__PURE__ */ e("span", { className: "font-medium text-surface-fg", children: x }),
1115
- /* @__PURE__ */ t("span", { className: "text-surface-fg-subtle", children: [
1116
- " ",
1117
- d
1118
- ] })
1119
- ] }),
1120
- /* @__PURE__ */ e("p", { className: "mt-ds-01 text-ds-xs text-surface-fg-subtle", children: Se(m.timestamp) })
1121
- ] })
1122
- ] }, m.id);
1123
- }) })
1148
+ ]
1149
+ },
1150
+ n.user.id
1151
+ )),
1152
+ !p && /* @__PURE__ */ s(
1153
+ X,
1154
+ {
1155
+ members: E,
1156
+ selectedIds: R,
1157
+ onSelect: re,
1158
+ multiple: !0,
1159
+ children: /* @__PURE__ */ s(
1160
+ "button",
1161
+ {
1162
+ type: "button",
1163
+ className: "inline-flex h-ico-md w-ico-md items-center justify-center rounded-ds-full border border-dashed border-surface-border transition-colors hover:bg-surface-3 hover:border-surface-border",
1164
+ "aria-label": "Add assignee",
1165
+ children: /* @__PURE__ */ s(B, { className: "h-3 w-3 text-surface-fg-subtle" })
1166
+ }
1167
+ )
1168
+ }
1169
+ ),
1170
+ p && e.assignees.length === 0 && /* @__PURE__ */ s("span", { className: "text-ds-md text-surface-fg-subtle", children: "None" })
1171
+ ] }) }),
1172
+ /* @__PURE__ */ s(S, { icon: we, label: "Priority", children: /* @__PURE__ */ r(de, { children: [
1173
+ /* @__PURE__ */ s(ue, { asChild: !0, children: /* @__PURE__ */ s(
1174
+ "button",
1175
+ {
1176
+ type: "button",
1177
+ className: "rounded-ds-md px-ds-03 py-ds-02 transition-colors hover:bg-surface-3",
1178
+ children: /* @__PURE__ */ s($, { priority: e.priority })
1179
+ }
1180
+ ) }),
1181
+ /* @__PURE__ */ s(
1182
+ me,
1183
+ {
1184
+ className: "w-[160px] border-surface-border-strong bg-surface-1 p-ds-02",
1185
+ align: "start",
1186
+ sideOffset: 4,
1187
+ children: pt.map((n) => /* @__PURE__ */ s(
1188
+ "button",
1189
+ {
1190
+ type: "button",
1191
+ onClick: () => O(n),
1192
+ className: h(
1193
+ "flex w-full items-center gap-ds-03 rounded-ds-md px-ds-03 py-ds-02b transition-colors",
1194
+ "hover:bg-surface-3",
1195
+ n === e.priority && "bg-surface-3"
1196
+ ),
1197
+ children: /* @__PURE__ */ s($, { priority: n })
1198
+ },
1199
+ n
1200
+ ))
1201
+ }
1202
+ )
1203
+ ] }) }),
1204
+ /* @__PURE__ */ s(S, { icon: ve, label: "Due Date", children: /* @__PURE__ */ r("div", { className: "flex items-center gap-ds-02", children: [
1205
+ b ? b({
1206
+ value: e.dueDate ? new Date(e.dueDate) : null,
1207
+ onChange: D,
1208
+ placeholder: "No due date",
1209
+ className: "h-ds-xs-plus border-none bg-transparent px-ds-03 text-ds-md hover:bg-surface-3"
1210
+ }) : /* @__PURE__ */ s(
1211
+ "input",
1212
+ {
1213
+ type: "date",
1214
+ value: e.dueDate ? new Date(e.dueDate).toISOString().split("T")[0] : "",
1215
+ onChange: (n) => D(n.target.value ? new Date(n.target.value) : null),
1216
+ "aria-label": "Due date",
1217
+ className: "h-ds-xs-plus border-none bg-transparent px-ds-03 text-ds-md text-surface-fg outline-none hover:bg-surface-3 rounded-ds-md"
1218
+ }
1219
+ ),
1220
+ e.dueDate && /* @__PURE__ */ s(
1221
+ "button",
1222
+ {
1223
+ type: "button",
1224
+ onClick: () => D(null),
1225
+ className: "rounded-ds-md p-ds-02 transition-colors hover:bg-surface-3",
1226
+ "aria-label": "Clear due date",
1227
+ children: /* @__PURE__ */ s(Y, { className: "h-3 w-3 text-surface-fg-subtle" })
1228
+ }
1229
+ )
1230
+ ] }) }),
1231
+ /* @__PURE__ */ s(S, { icon: ye, label: "Labels", children: /* @__PURE__ */ r("div", { className: "flex flex-wrap items-center gap-ds-02b", children: [
1232
+ e.labels.map((n) => /* @__PURE__ */ r(
1233
+ "span",
1234
+ {
1235
+ className: "inline-flex items-center gap-ds-02 rounded-ds-full bg-accent-2 px-ds-03 py-ds-01 text-ds-sm font-medium text-accent-11",
1236
+ children: [
1237
+ n,
1238
+ !p && /* @__PURE__ */ s(
1239
+ "button",
1240
+ {
1241
+ type: "button",
1242
+ onClick: () => W(n),
1243
+ className: "rounded-ds-full p-ds-01 transition-colors hover:bg-surface-3",
1244
+ "aria-label": `Remove label ${n}`,
1245
+ children: /* @__PURE__ */ s(Y, { className: "h-ds-03 w-ds-03" })
1246
+ }
1247
+ )
1248
+ ]
1249
+ },
1250
+ n
1251
+ )),
1252
+ !p && (k ? /* @__PURE__ */ s("div", { className: "inline-flex items-center gap-ds-02", children: /* @__PURE__ */ s(
1253
+ "input",
1254
+ {
1255
+ type: "text",
1256
+ value: w,
1257
+ onChange: (n) => y(n.target.value),
1258
+ "aria-label": "New label name",
1259
+ onKeyDown: (n) => {
1260
+ n.key === "Enter" && G(), n.key === "Escape" && (C(!1), y(""));
1261
+ },
1262
+ onBlur: G,
1263
+ placeholder: "Label name",
1264
+ className: "h-5 w-20 rounded border border-surface-border-strong bg-transparent px-ds-02b text-ds-sm text-surface-fg outline-none placeholder:text-surface-fg-subtle focus:border-surface-border",
1265
+ autoFocus: !0
1266
+ }
1267
+ ) }) : /* @__PURE__ */ s(
1268
+ "button",
1269
+ {
1270
+ type: "button",
1271
+ onClick: () => C(!0),
1272
+ className: "inline-flex h-ico-md w-ico-md items-center justify-center rounded-ds-full border border-dashed border-surface-border transition-colors hover:bg-surface-3 hover:border-surface-border",
1273
+ "aria-label": "Add label",
1274
+ children: /* @__PURE__ */ s(B, { className: "h-3 w-3 text-surface-fg-subtle" })
1275
+ }
1276
+ )),
1277
+ p && e.labels.length === 0 && /* @__PURE__ */ s("span", { className: "text-ds-md text-surface-fg-subtle", children: "None" })
1278
+ ] }) }),
1279
+ !p && /* @__PURE__ */ s(S, { icon: Ie, label: "Visibility", children: /* @__PURE__ */ r(
1280
+ "button",
1281
+ {
1282
+ type: "button",
1283
+ onClick: K,
1284
+ className: h(
1285
+ "inline-flex items-center gap-ds-02b rounded-ds-full px-ds-03 py-ds-01 text-ds-sm font-semibold tracking-wide transition-colors",
1286
+ e.visibility === "EVERYONE" ? "bg-success-3 text-success-11" : "bg-surface-2 text-surface-fg-subtle"
1287
+ ),
1288
+ children: [
1289
+ /* @__PURE__ */ s(
1290
+ "span",
1291
+ {
1292
+ className: h(
1293
+ "h-ds-02b w-ds-02b rounded-ds-full",
1294
+ e.visibility === "EVERYONE" ? "bg-success-9" : "bg-disabled"
1295
+ )
1296
+ }
1297
+ ),
1298
+ e.visibility === "EVERYONE" ? "Everyone" : "Internal"
1299
+ ]
1300
+ }
1301
+ ) })
1124
1302
  ] });
1125
1303
  }
1126
1304
  );
1127
- Le.displayName = "ActivityTab";
1128
- const ge = [
1129
- { id: "subtasks", label: "Subtasks", icon: Ie },
1130
- { id: "review", label: "Review", icon: se },
1305
+ Ze.displayName = "TaskProperties";
1306
+ const be = [
1307
+ { id: "subtasks", label: "Subtasks", icon: Ce },
1308
+ { id: "review", label: "Review", icon: ee },
1131
1309
  { id: "conversation", label: "Conversation", icon: De },
1132
- { id: "files", label: "Files", icon: te },
1133
- { id: "activity", label: "Activity", icon: re }
1310
+ { id: "files", label: "Files", icon: se },
1311
+ { id: "activity", label: "Activity", icon: te }
1134
1312
  ];
1135
- function et() {
1136
- return /* @__PURE__ */ t("div", { className: "space-y-ds-06 p-ds-06", children: [
1137
- /* @__PURE__ */ e(L, { className: "h-ds-xs-plus w-3/4 bg-surface-3" }),
1138
- /* @__PURE__ */ e("div", { className: "space-y-ds-04", children: Array.from({ length: 6 }).map((n, s) => /* @__PURE__ */ t("div", { className: "flex items-center gap-ds-04", children: [
1139
- /* @__PURE__ */ e(L, { className: "h-[16px] w-[120px] bg-surface-3" }),
1140
- /* @__PURE__ */ e(L, { className: "h-[16px] flex-1 bg-surface-3" })
1141
- ] }, s)) }),
1142
- /* @__PURE__ */ e("div", { className: "flex gap-ds-05 border-b border-surface-border-strong pb-ds-03", children: Array.from({ length: 5 }).map((n, s) => /* @__PURE__ */ e(L, { className: "h-[12px] w-[64px] bg-surface-3" }, s)) }),
1143
- /* @__PURE__ */ t("div", { className: "space-y-ds-04", children: [
1144
- /* @__PURE__ */ e(L, { className: "h-ds-md w-full bg-surface-3" }),
1145
- /* @__PURE__ */ e(L, { className: "h-ds-md w-full bg-surface-3" }),
1146
- /* @__PURE__ */ e(L, { className: "h-ds-md w-4/5 bg-surface-3" })
1313
+ function bt() {
1314
+ return /* @__PURE__ */ r("div", { className: "space-y-ds-06 p-ds-06", children: [
1315
+ /* @__PURE__ */ s(A, { className: "h-ds-xs-plus w-3/4 bg-surface-3" }),
1316
+ /* @__PURE__ */ s("div", { className: "space-y-ds-04", children: Array.from({ length: 6 }).map((t, e) => /* @__PURE__ */ r("div", { className: "flex items-center gap-ds-04", children: [
1317
+ /* @__PURE__ */ s(A, { className: "h-[16px] w-[120px] bg-surface-3" }),
1318
+ /* @__PURE__ */ s(A, { className: "h-[16px] flex-1 bg-surface-3" })
1319
+ ] }, e)) }),
1320
+ /* @__PURE__ */ s("div", { className: "flex gap-ds-05 border-b border-surface-border-strong pb-ds-03", children: Array.from({ length: 5 }).map((t, e) => /* @__PURE__ */ s(A, { className: "h-[12px] w-[64px] bg-surface-3" }, e)) }),
1321
+ /* @__PURE__ */ r("div", { className: "space-y-ds-04", children: [
1322
+ /* @__PURE__ */ s(A, { className: "h-ds-md w-full bg-surface-3" }),
1323
+ /* @__PURE__ */ s(A, { className: "h-ds-md w-full bg-surface-3" }),
1324
+ /* @__PURE__ */ s(A, { className: "h-ds-md w-4/5 bg-surface-3" })
1147
1325
  ] })
1148
1326
  ] });
1149
1327
  }
1150
- const st = o.forwardRef(function({
1151
- task: s,
1152
- loading: g = !1,
1153
- open: h,
1154
- onOpenChange: b,
1155
- columns: m,
1156
- members: y,
1157
- activities: D = [],
1158
- enrichedComments: x,
1159
- clientMode: d = !1,
1160
- clientEditableFields: C = ["priority", "dueDate"],
1161
- headerSlot: N,
1162
- extraTabs: w = [],
1163
- onTitleUpdate: I,
1164
- onPropertyUpdate: i,
1165
- onAssign: v,
1166
- onUnassign: l,
1167
- onCreateSubtask: c,
1168
- onToggleSubtask: f,
1169
- onRequestReview: u,
1328
+ const gt = c.forwardRef(function({
1329
+ task: e,
1330
+ loading: i = !1,
1331
+ open: l,
1332
+ onOpenChange: d,
1333
+ columns: u,
1334
+ members: f,
1335
+ activities: m = [],
1336
+ enrichedComments: p,
1337
+ clientMode: o = !1,
1338
+ clientEditableFields: x = ["priority", "dueDate"],
1339
+ headerSlot: b,
1340
+ extraTabs: N = [],
1341
+ onTitleUpdate: g,
1342
+ onPropertyUpdate: v,
1343
+ onAssign: w,
1344
+ onUnassign: y,
1345
+ onCreateSubtask: k,
1346
+ onToggleSubtask: C,
1347
+ onRequestReview: R,
1170
1348
  onUpdateReviewStatus: E,
1171
- onPostComment: T,
1172
- onUploadFile: S,
1173
- onUploadDeliverable: _,
1174
- onDeleteFile: R,
1175
- onTabChange: k,
1176
- renderEditor: z,
1177
- renderViewer: J,
1178
- renderPriorityIndicator: M,
1179
- renderDatePicker: q,
1180
- isUploading: a = !1,
1181
- className: Q,
1182
- ...Oe
1183
- }, _e) {
1184
- var le, ie, oe;
1185
- const [P, ae] = o.useState(d ? "conversation" : "subtasks"), [U, V] = o.useState(!1), [ne, Y] = o.useState(""), K = o.useRef(null);
1186
- o.useEffect(() => {
1187
- s && (Y(s.title), V(!1));
1188
- }, [s == null ? void 0 : s.id]), o.useEffect(() => {
1189
- h && ae(d ? "conversation" : "subtasks");
1190
- }, [h, d]);
1191
- const Ve = o.useCallback((r) => {
1192
- ae(r), k == null || k(r);
1193
- }, [k]), je = o.useCallback((r, A) => {
1194
- d && !C.includes(r) || i == null || i(r, A);
1195
- }, [d, C, i]), He = o.useCallback((r) => {
1196
- v == null || v(r);
1197
- }, [v]), Ge = o.useCallback((r) => {
1198
- l == null || l(r);
1199
- }, [l]), $e = o.useCallback((r) => {
1200
- c == null || c(r);
1201
- }, [c]), Be = o.useCallback((r, A) => {
1202
- f == null || f(r, A);
1203
- }, [f]), Fe = o.useCallback((r) => {
1204
- u == null || u(r);
1205
- }, [u]), ze = o.useCallback((r, A, ss) => {
1206
- E == null || E(r, A, ss);
1207
- }, [E]), qe = o.useCallback((r, A) => {
1208
- T == null || T(r, A);
1209
- }, [T]), Ye = o.useCallback((r, A) => {
1210
- S == null || S(r, A);
1211
- }, [S]), Ke = o.useCallback((r) => {
1212
- R == null || R(r);
1213
- }, [R]), X = o.useCallback((...r) => {
1214
- }, []), We = o.useCallback((r, A) => {
1215
- }, []), ce = () => {
1216
- V(!1);
1217
- const r = ne.trim();
1218
- r && r !== (s == null ? void 0 : s.title) ? I == null || I(r) : s && Y(s.title);
1219
- }, Je = (r) => {
1220
- r.key === "Enter" && (r.preventDefault(), ce()), r.key === "Escape" && (V(!1), s && Y(s.title));
1349
+ onPostComment: L,
1350
+ onUploadFile: P,
1351
+ onUploadDeliverable: re,
1352
+ onDeleteFile: O,
1353
+ onTabChange: D,
1354
+ renderEditor: G,
1355
+ renderViewer: W,
1356
+ renderPriorityIndicator: K,
1357
+ renderDatePicker: $,
1358
+ isUploading: n = !1,
1359
+ className: Z,
1360
+ ...Je
1361
+ }, Qe) {
1362
+ var ce, le, oe;
1363
+ const [T, ae] = c.useState(o ? "conversation" : "subtasks"), [J, _] = c.useState(!1), [ne, M] = c.useState(""), z = c.useRef(null);
1364
+ c.useEffect(() => {
1365
+ e && (M(e.title), _(!1));
1366
+ }, [e == null ? void 0 : e.id]), c.useEffect(() => {
1367
+ l && ae(o ? "conversation" : "subtasks");
1368
+ }, [l, o]);
1369
+ const Ue = c.useCallback((a) => {
1370
+ ae(a), D == null || D(a);
1371
+ }, [D]), Xe = c.useCallback((a, I) => {
1372
+ o && !x.includes(a) || v == null || v(a, I);
1373
+ }, [o, x, v]), es = c.useCallback((a) => {
1374
+ w == null || w(a);
1375
+ }, [w]), ss = c.useCallback((a) => {
1376
+ y == null || y(a);
1377
+ }, [y]), ts = c.useCallback((a) => {
1378
+ k == null || k(a);
1379
+ }, [k]), rs = c.useCallback((a, I) => {
1380
+ C == null || C(a, I);
1381
+ }, [C]), as = c.useCallback((a) => {
1382
+ R == null || R(a);
1383
+ }, [R]), ns = c.useCallback((a, I, gs) => {
1384
+ E == null || E(a, I, gs);
1385
+ }, [E]), is = c.useCallback((a, I) => {
1386
+ L == null || L(a, I);
1387
+ }, [L]), cs = c.useCallback((a, I) => {
1388
+ P == null || P(a, I);
1389
+ }, [P]), ls = c.useCallback((a) => {
1390
+ O == null || O(a);
1391
+ }, [O]), Q = c.useCallback((...a) => {
1392
+ }, []), os = c.useCallback((a, I) => {
1393
+ }, []), ie = () => {
1394
+ _(!1);
1395
+ const a = ne.trim();
1396
+ a && a !== (e == null ? void 0 : e.title) ? g == null || g(a) : e && M(e.title);
1397
+ }, ds = (a) => {
1398
+ a.key === "Enter" && (a.preventDefault(), ie()), a.key === "Escape" && (_(!1), e && M(e.title));
1221
1399
  };
1222
- o.useEffect(() => {
1223
- U && K.current && (K.current.focus(), K.current.select());
1224
- }, [U]);
1225
- const Me = (le = m.find((r) => r.isTerminal)) == null ? void 0 : le.id, Qe = ((ie = m.find((r) => r.isDefault)) == null ? void 0 : ie.id) || ((oe = m[0]) == null ? void 0 : oe.id) || "", Ue = d ? ge.filter((r) => r.id === "conversation") : ge, Xe = w.filter((r) => r.position === "before"), Ze = w.filter((r) => r.position !== "before"), es = x || (s == null ? void 0 : s.comments) || [];
1226
- return /* @__PURE__ */ e(ts, { open: h, onOpenChange: b, children: /* @__PURE__ */ t(
1227
- rs,
1400
+ c.useEffect(() => {
1401
+ J && z.current && (z.current.focus(), z.current.select());
1402
+ }, [J]);
1403
+ const us = (ce = u.find((a) => a.isTerminal)) == null ? void 0 : ce.id, ms = ((le = u.find((a) => a.isDefault)) == null ? void 0 : le.id) || ((oe = u[0]) == null ? void 0 : oe.id) || "", fs = o ? be.filter((a) => a.id === "conversation") : be, ps = N.filter((a) => a.position === "before"), hs = N.filter((a) => a.position !== "before"), bs = p || (e == null ? void 0 : e.comments) || [];
1404
+ return /* @__PURE__ */ s(xs, { open: l, onOpenChange: d, children: /* @__PURE__ */ r(
1405
+ Ns,
1228
1406
  {
1229
- ref: _e,
1407
+ ref: Qe,
1230
1408
  side: "right",
1231
- className: p(
1409
+ className: h(
1232
1410
  /* intentional: task detail side panel takes 40% of screen, min 380px for form usability */
1233
1411
  "w-full sm:max-w-none sm:w-[40%] min-w-[380px] p-0",
1234
1412
  "flex flex-col overflow-hidden",
1235
1413
  "border-l border-surface-border-strong bg-surface-1",
1236
- Q
1414
+ Z
1237
1415
  ),
1238
- ...Oe,
1416
+ ...Je,
1239
1417
  children: [
1240
- /* @__PURE__ */ e(ns, { children: /* @__PURE__ */ e(as, { children: (s == null ? void 0 : s.title) || "Task Details" }) }),
1241
- g || !s ? /* @__PURE__ */ e(et, {}) : /* @__PURE__ */ t(be, { children: [
1242
- /* @__PURE__ */ t("div", { className: "shrink-0 border-b border-surface-border-strong px-ds-06 pb-ds-05 pt-ds-06", children: [
1243
- !d && U ? /* @__PURE__ */ e(
1418
+ /* @__PURE__ */ s(ys, { children: /* @__PURE__ */ s(vs, { children: (e == null ? void 0 : e.title) || "Task Details" }) }),
1419
+ i || !e ? /* @__PURE__ */ s(bt, {}) : /* @__PURE__ */ r(ge, { children: [
1420
+ /* @__PURE__ */ r("div", { className: "shrink-0 border-b border-surface-border-strong px-ds-06 pb-ds-05 pt-ds-06", children: [
1421
+ !o && J ? /* @__PURE__ */ s(
1244
1422
  "input",
1245
1423
  {
1246
- ref: K,
1424
+ ref: z,
1247
1425
  type: "text",
1248
1426
  value: ne,
1249
- onChange: (r) => Y(r.target.value),
1250
- onBlur: ce,
1251
- onKeyDown: Je,
1427
+ onChange: (a) => M(a.target.value),
1428
+ onBlur: ie,
1429
+ onKeyDown: ds,
1252
1430
  className: "w-full bg-transparent text-ds-lg font-semibold text-surface-fg outline-none"
1253
1431
  }
1254
- ) : /* @__PURE__ */ e(
1432
+ ) : /* @__PURE__ */ s(
1255
1433
  "h2",
1256
1434
  {
1257
- onClick: d ? void 0 : () => V(!0),
1258
- ...!d && {
1435
+ onClick: o ? void 0 : () => _(!0),
1436
+ ...!o && {
1259
1437
  role: "button",
1260
1438
  tabIndex: 0,
1261
- onKeyDown: (r) => {
1262
- (r.key === "Enter" || r.key === " ") && (r.preventDefault(), V(!0));
1439
+ onKeyDown: (a) => {
1440
+ (a.key === "Enter" || a.key === " ") && (a.preventDefault(), _(!0));
1263
1441
  }
1264
1442
  },
1265
- className: p(
1443
+ className: h(
1266
1444
  "text-ds-lg font-semibold text-surface-fg",
1267
- !d && "cursor-text hover:text-accent-11 transition-colors"
1445
+ !o && "cursor-text hover:text-accent-11 transition-colors"
1268
1446
  ),
1269
- children: s.title
1447
+ children: e.title
1270
1448
  }
1271
1449
  ),
1272
- s.parentTaskId && /* @__PURE__ */ e("p", { className: "mt-ds-02 text-ds-sm text-surface-fg-subtle", children: "Subtask" }),
1273
- N && /* @__PURE__ */ e("div", { className: "mt-ds-03 flex items-center gap-ds-03", children: N })
1450
+ e.parentTaskId && /* @__PURE__ */ s("p", { className: "mt-ds-02 text-ds-sm text-surface-fg-subtle", children: "Subtask" }),
1451
+ b && /* @__PURE__ */ s("div", { className: "mt-ds-03 flex items-center gap-ds-03", children: b })
1274
1452
  ] }),
1275
- /* @__PURE__ */ t("div", { className: "flex-1 overflow-y-auto", children: [
1276
- /* @__PURE__ */ e("div", { className: "border-b border-surface-border-strong px-ds-06 py-ds-05", children: /* @__PURE__ */ e(
1277
- Te,
1453
+ /* @__PURE__ */ r("div", { className: "flex-1 overflow-y-auto", children: [
1454
+ /* @__PURE__ */ s("div", { className: "border-b border-surface-border-strong px-ds-06 py-ds-05", children: /* @__PURE__ */ s(
1455
+ Ze,
1278
1456
  {
1279
- task: s,
1280
- columns: m,
1281
- members: y,
1282
- onUpdate: je,
1283
- onAssign: He,
1284
- onUnassign: Ge,
1285
- readOnly: d,
1286
- editableFields: d ? C : void 0,
1287
- renderPriorityIndicator: M,
1288
- renderDatePicker: q
1457
+ task: e,
1458
+ columns: u,
1459
+ members: f,
1460
+ onUpdate: Xe,
1461
+ onAssign: es,
1462
+ onUnassign: ss,
1463
+ readOnly: o,
1464
+ editableFields: o ? x : void 0,
1465
+ renderPriorityIndicator: K,
1466
+ renderDatePicker: $
1289
1467
  }
1290
1468
  ) }),
1291
- /* @__PURE__ */ e("div", { className: "sticky top-0 z-raised bg-surface-1 px-ds-06", children: /* @__PURE__ */ e(ls, { value: P, onValueChange: Ve, children: /* @__PURE__ */ t(is, { variant: "line", children: [
1292
- Xe.map((r) => /* @__PURE__ */ t(Z, { value: r.id, children: [
1293
- r.icon && /* @__PURE__ */ e("span", { className: "[&>svg]:h-ico-sm [&>svg]:w-ico-sm shrink-0", children: r.icon }),
1294
- r.label
1295
- ] }, r.id)),
1296
- Ue.map((r) => /* @__PURE__ */ t(Z, { value: r.id, children: [
1297
- /* @__PURE__ */ e(r.icon, { className: "h-ico-sm w-ico-sm", stroke: 1.5 }),
1298
- r.label
1299
- ] }, r.id)),
1300
- Ze.map((r) => /* @__PURE__ */ t(Z, { value: r.id, children: [
1301
- r.icon && /* @__PURE__ */ e("span", { className: "[&>svg]:h-ico-sm [&>svg]:w-ico-sm shrink-0", children: r.icon }),
1302
- r.label
1303
- ] }, r.id))
1469
+ /* @__PURE__ */ s("div", { className: "sticky top-0 z-raised bg-surface-1 px-ds-06", children: /* @__PURE__ */ s(Is, { value: T, onValueChange: Ue, children: /* @__PURE__ */ r(Cs, { variant: "line", children: [
1470
+ ps.map((a) => /* @__PURE__ */ r(U, { value: a.id, children: [
1471
+ a.icon && /* @__PURE__ */ s("span", { className: "[&>svg]:h-ico-sm [&>svg]:w-ico-sm shrink-0", children: a.icon }),
1472
+ a.label
1473
+ ] }, a.id)),
1474
+ fs.map((a) => /* @__PURE__ */ r(U, { value: a.id, children: [
1475
+ /* @__PURE__ */ s(a.icon, { className: "h-ico-sm w-ico-sm", stroke: 1.5 }),
1476
+ a.label
1477
+ ] }, a.id)),
1478
+ hs.map((a) => /* @__PURE__ */ r(U, { value: a.id, children: [
1479
+ a.icon && /* @__PURE__ */ s("span", { className: "[&>svg]:h-ico-sm [&>svg]:w-ico-sm shrink-0", children: a.icon }),
1480
+ a.label
1481
+ ] }, a.id))
1304
1482
  ] }) }) }),
1305
- /* @__PURE__ */ t("div", { className: "px-ds-06 py-ds-05", children: [
1306
- P === "subtasks" && /* @__PURE__ */ e(
1307
- Re,
1483
+ /* @__PURE__ */ r("div", { className: "px-ds-06 py-ds-05", children: [
1484
+ T === "subtasks" && /* @__PURE__ */ s(
1485
+ Me,
1308
1486
  {
1309
- subtasks: s.subtasks ?? [],
1310
- terminalColumnId: Me,
1311
- projectId: s.projectId,
1312
- parentTaskId: s.id,
1313
- defaultColumnId: Qe,
1314
- onCreateSubtask: d ? X : $e,
1315
- onToggleSubtask: d ? We : Be,
1316
- readOnly: d
1487
+ subtasks: e.subtasks ?? [],
1488
+ terminalColumnId: us,
1489
+ projectId: e.projectId,
1490
+ parentTaskId: e.id,
1491
+ defaultColumnId: ms,
1492
+ onCreateSubtask: o ? Q : ts,
1493
+ onToggleSubtask: o ? os : rs,
1494
+ readOnly: o
1317
1495
  }
1318
1496
  ),
1319
- P === "review" && !d && /* @__PURE__ */ e(
1320
- Ae,
1497
+ T === "review" && !o && /* @__PURE__ */ s(
1498
+ We,
1321
1499
  {
1322
- reviews: s.reviewRequests,
1323
- members: y,
1324
- onRequestReview: Fe,
1325
- onUpdateStatus: ze
1500
+ reviews: e.reviewRequests,
1501
+ members: f,
1502
+ onRequestReview: as,
1503
+ onUpdateStatus: ns
1326
1504
  }
1327
1505
  ),
1328
- P === "conversation" && /* @__PURE__ */ e(
1329
- ke,
1506
+ T === "conversation" && /* @__PURE__ */ s(
1507
+ ze,
1330
1508
  {
1331
- comments: es,
1332
- taskVisibility: s.visibility,
1333
- onPostComment: qe,
1334
- clientMode: d,
1335
- renderEditor: z,
1336
- renderViewer: J
1509
+ comments: bs,
1510
+ taskVisibility: e.visibility,
1511
+ onPostComment: is,
1512
+ clientMode: o,
1513
+ renderEditor: G,
1514
+ renderViewer: W
1337
1515
  }
1338
1516
  ),
1339
- P === "files" && /* @__PURE__ */ e(
1340
- Pe,
1517
+ T === "files" && /* @__PURE__ */ s(
1518
+ Ye,
1341
1519
  {
1342
- files: s.files ?? [],
1343
- onUpload: d ? X : Ye,
1344
- onDelete: d ? X : Ke,
1345
- isUploading: a,
1346
- readOnly: d
1520
+ files: e.files ?? [],
1521
+ onUpload: o ? Q : cs,
1522
+ onDelete: o ? Q : ls,
1523
+ isUploading: n,
1524
+ readOnly: o
1347
1525
  }
1348
1526
  ),
1349
- P === "activity" && /* @__PURE__ */ e(Le, { activities: D }),
1350
- w.map(
1351
- (r) => P === r.id ? /* @__PURE__ */ e(o.Fragment, { children: r.content }, r.id) : null
1527
+ T === "activity" && /* @__PURE__ */ s(Ke, { activities: m }),
1528
+ N.map(
1529
+ (a) => T === a.id ? /* @__PURE__ */ s(c.Fragment, { children: a.content }, a.id) : null
1352
1530
  )
1353
1531
  ] })
1354
1532
  ] })
@@ -1357,13 +1535,30 @@ const st = o.forwardRef(function({
1357
1535
  }
1358
1536
  ) });
1359
1537
  });
1360
- st.displayName = "TaskDetailPanel";
1538
+ gt.displayName = "TaskDetailPanel";
1361
1539
  export {
1362
- Le as A,
1363
- ke as C,
1364
- Pe as F,
1365
- Ae as R,
1366
- Re as S,
1367
- st as T,
1368
- Te as a
1540
+ Ke as A,
1541
+ ze as C,
1542
+ Ye as F,
1543
+ Pe as M,
1544
+ rt as P,
1545
+ We as R,
1546
+ Me as S,
1547
+ gt as T,
1548
+ _e as V,
1549
+ Ze as a,
1550
+ $e as b,
1551
+ Ge as c,
1552
+ Fe as d,
1553
+ je as e,
1554
+ Ve as f,
1555
+ Oe as g,
1556
+ ke as h,
1557
+ He as i,
1558
+ qe as j,
1559
+ Be as k,
1560
+ Se as l,
1561
+ Ae as m,
1562
+ Te as n,
1563
+ Ee as o
1369
1564
  };