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