@devalok/shilp-sutra-karm 0.7.0 → 0.8.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 (58) hide show
  1. package/dist/admin/break/break-admin-skeleton.js +1 -1
  2. package/dist/admin/break/break-admin.js +2 -2
  3. package/dist/admin/break/break-balance.js +1 -1
  4. package/dist/admin/break/breaks.js +2 -2
  5. package/dist/admin/break/delete-break.js +4 -4
  6. package/dist/admin/break/edit-break-balance.js +4 -4
  7. package/dist/admin/break/edit-break.js +4 -4
  8. package/dist/admin/break/header.js +3 -3
  9. package/dist/admin/break/leave-request.js +5 -5
  10. package/dist/admin/dashboard/admin-dashboard.js +1 -1
  11. package/dist/admin/dashboard/associate-detail.js +4 -4
  12. package/dist/admin/dashboard/attendance-overview.js +2 -2
  13. package/dist/admin/dashboard/break-request.js +4 -4
  14. package/dist/admin/dashboard/calendar.js +3 -3
  15. package/dist/admin/dashboard/correction-list.js +3 -3
  16. package/dist/admin/dashboard/dashboard-header.js +5 -5
  17. package/dist/admin/dashboard/dashboard-skeleton.js +8 -8
  18. package/dist/admin/dashboard/leave-requests.js +3 -3
  19. package/dist/admin/dashboard/render-date.js +1 -1
  20. package/dist/admin/types.d.ts +6 -6
  21. package/dist/admin/types.d.ts.map +1 -1
  22. package/dist/board/board-column.d.ts.map +1 -1
  23. package/dist/board/board-column.js +18 -16
  24. package/dist/board/kanban-board.d.ts.map +1 -1
  25. package/dist/board/kanban-board.js +118 -119
  26. package/dist/board/task-card.d.ts.map +1 -1
  27. package/dist/board/task-card.js +113 -115
  28. package/dist/chat/chat-input.d.ts.map +1 -1
  29. package/dist/chat/chat-input.js +2 -1
  30. package/dist/chat/chat-panel.js +2 -2
  31. package/dist/chat/conversation-list.js +1 -1
  32. package/dist/chat/markdown-components.d.ts +4 -0
  33. package/dist/chat/markdown-components.d.ts.map +1 -1
  34. package/dist/chat/markdown-components.js +30 -12
  35. package/dist/chat/message-list.d.ts.map +1 -1
  36. package/dist/chat/message-list.js +29 -30
  37. package/dist/chat/streaming-text.js +9 -9
  38. package/dist/client/client-portal-header.js +2 -2
  39. package/dist/client/project-card.js +3 -3
  40. package/dist/dashboard/daily-brief.js +1 -1
  41. package/dist/index.d.ts +0 -1
  42. package/dist/index.d.ts.map +1 -1
  43. package/dist/index.js +78 -82
  44. package/dist/page-skeletons.js +2 -2
  45. package/dist/tasks/activity-tab.js +2 -2
  46. package/dist/tasks/conversation-tab.d.ts +2 -0
  47. package/dist/tasks/conversation-tab.d.ts.map +1 -1
  48. package/dist/tasks/conversation-tab.js +68 -57
  49. package/dist/tasks/files-tab.js +25 -25
  50. package/dist/tasks/review-tab.js +6 -6
  51. package/dist/tasks/subtasks-tab.js +4 -4
  52. package/dist/tasks/task-detail-panel.js +4 -4
  53. package/dist/tasks/task-properties.d.ts.map +1 -1
  54. package/dist/tasks/task-properties.js +66 -59
  55. package/dist/utils/use-composed-ref.d.ts +3 -0
  56. package/dist/utils/use-composed-ref.d.ts.map +1 -0
  57. package/dist/utils/use-composed-ref.js +12 -0
  58. package/package.json +73 -69
@@ -1,28 +1,29 @@
1
1
  "use client";
2
2
  import { jsxs as C, jsx as p } from "react/jsx-runtime";
3
- import * as Z from "react";
4
- import { useState as B, useRef as _, useCallback as v, useEffect as P, useMemo as R } from "react";
5
- import { createPortal as V } from "react-dom";
6
- import { useSensors as T, useSensor as N, PointerSensor as M, TouchSensor as tt, KeyboardSensor as nt, DndContext as rt, closestCorners as et, DragOverlay as st } from "@dnd-kit/core";
7
- import { sortableKeyboardCoordinates as ot, SortableContext as it, horizontalListSortingStrategy as at } from "@dnd-kit/sortable";
3
+ import * as Y from "react";
4
+ import { useState as D, useRef as Z, useEffect as O, useMemo as _, useCallback as g } from "react";
5
+ import { useComposedRef as V } from "../utils/use-composed-ref.js";
6
+ import { createPortal as T } from "react-dom";
7
+ import { useSensors as M, useSensor as B, PointerSensor as tt, TouchSensor as et, KeyboardSensor as rt, DndContext as nt, closestCorners as st, DragOverlay as ot } from "@dnd-kit/core";
8
+ import { sortableKeyboardCoordinates as it, SortableContext as at, horizontalListSortingStrategy as dt } from "@dnd-kit/sortable";
8
9
  import { BoardColumn as ct } from "./board-column.js";
9
- import { TaskCardOverlay as dt } from "./task-card.js";
10
- import { IconPlus as lt } from "@tabler/icons-react";
11
- import { Button as ut } from "@devalok/shilp-sutra/ui";
12
- function ft() {
10
+ import { TaskCardOverlay as lt } from "./task-card.js";
11
+ import { IconPlus as ut } from "@tabler/icons-react";
12
+ import { Button as ft } from "@devalok/shilp-sutra/ui/button";
13
+ function mt() {
13
14
  return {
14
15
  onDragStart({ active: h }) {
15
- const d = h.data.current;
16
- return (d == null ? void 0 : d.type) === "task" ? `Picked up task: ${d.task.title}` : "Picked up item";
16
+ const c = h.data.current;
17
+ return (c == null ? void 0 : c.type) === "task" ? `Picked up task: ${c.task.title}` : "Picked up item";
17
18
  },
18
- onDragOver({ active: h, over: d }) {
19
- if (!d) return;
19
+ onDragOver({ active: h, over: c }) {
20
+ if (!c) return;
20
21
  const a = h.data.current;
21
22
  if ((a == null ? void 0 : a.type) === "task")
22
- return `Task ${a.task.title} is over ${d.id}`;
23
+ return `Task ${a.task.title} is over ${c.id}`;
23
24
  },
24
- onDragEnd({ active: h, over: d }) {
25
- if (!d) return "Dropped item";
25
+ onDragEnd({ active: h, over: c }) {
26
+ if (!c) return "Dropped item";
26
27
  const a = h.data.current;
27
28
  return (a == null ? void 0 : a.type) === "task" ? `Dropped task: ${a.task.title}` : "Dropped item";
28
29
  },
@@ -31,172 +32,170 @@ function ft() {
31
32
  }
32
33
  };
33
34
  }
34
- const mt = Z.forwardRef(
35
+ const pt = Y.forwardRef(
35
36
  function({
36
- initialData: d,
37
+ initialData: c,
37
38
  onTaskMove: a,
38
- onTaskAdd: I,
39
- onColumnRename: y,
40
- onColumnDelete: S,
41
- onColumnToggleVisibility: D,
42
- onClickTask: $,
43
- onAddColumn: E
44
- }, g) {
45
- const [j, x] = B(d), [O, K] = B(null), [w, A] = B(!1), W = _(null), z = v((t) => {
46
- W.current = t, typeof g == "function" ? g(t) : g && (g.current = t);
47
- }, [g]);
48
- P(() => {
49
- x(d);
50
- }, [d]), P(() => {
51
- A(!0);
39
+ onTaskAdd: b,
40
+ onColumnRename: I,
41
+ onColumnDelete: y,
42
+ onColumnToggleVisibility: S,
43
+ onClickTask: K,
44
+ onAddColumn: P
45
+ }, $) {
46
+ const [E, v] = D(c), [w, N] = D(null), [R, j] = D(!1), A = Z(null), W = V(A, $);
47
+ O(() => {
48
+ v(c);
49
+ }, [c]), O(() => {
50
+ j(!0);
52
51
  }, []);
53
- const G = T(
54
- N(M, {
52
+ const z = M(
53
+ B(tt, {
55
54
  activationConstraint: {
56
55
  distance: 5
57
56
  }
58
57
  }),
59
- N(tt, {
58
+ B(et, {
60
59
  activationConstraint: {
61
60
  delay: 200,
62
61
  tolerance: 5
63
62
  }
64
63
  }),
65
- N(nt, {
66
- coordinateGetter: ot
64
+ B(rt, {
65
+ coordinateGetter: it
67
66
  })
68
- ), L = R(() => ft(), []), m = j.columns, q = m.map((t) => `column-${t.id}`), k = v(
67
+ ), G = _(() => mt(), []), m = E.columns, L = m.map((t) => `column-${t.id}`), k = g(
69
68
  (t) => {
70
- for (const n of m)
71
- if (n.tasks.some((i) => i.id === t))
72
- return n.id;
69
+ for (const e of m)
70
+ if (e.tasks.some((i) => i.id === t))
71
+ return e.id;
73
72
  return null;
74
73
  },
75
74
  [m]
76
- ), b = v(
77
- (t, n, i, o) => {
78
- x((l) => {
79
- const u = l.columns.map((c) => ({
80
- ...c,
81
- tasks: [...c.tasks]
82
- })), e = u.find((c) => c.id === n), f = u.find((c) => c.id === i);
83
- if (!e || !f) return l;
84
- const r = e.tasks.findIndex((c) => c.id === t);
75
+ ), x = g(
76
+ (t, e, i, o) => {
77
+ v((l) => {
78
+ const u = l.columns.map((d) => ({
79
+ ...d,
80
+ tasks: [...d.tasks]
81
+ })), n = u.find((d) => d.id === e), f = u.find((d) => d.id === i);
82
+ if (!n || !f) return l;
83
+ const r = n.tasks.findIndex((d) => d.id === t);
85
84
  if (r === -1) return l;
86
- const [s] = e.tasks.splice(r, 1);
85
+ const [s] = n.tasks.splice(r, 1);
87
86
  return f.tasks.splice(o, 0, s), { columns: u };
88
87
  });
89
88
  },
90
89
  []
91
- ), F = v((t) => {
92
- const n = t.active.data.current;
93
- (n == null ? void 0 : n.type) === "task" && K(n.task);
94
- }, []), H = v(
90
+ ), q = g((t) => {
91
+ const e = t.active.data.current;
92
+ (e == null ? void 0 : e.type) === "task" && N(e.task);
93
+ }, []), F = g(
95
94
  (t) => {
96
- const { active: n, over: i } = t;
95
+ const { active: e, over: i } = t;
97
96
  if (!i) return;
98
- const o = n.id, l = i.id, u = k(o);
97
+ const o = e.id, l = i.id, u = k(o);
99
98
  if (!u) return;
100
- let e = null, f = 0;
99
+ let n = null, f = 0;
101
100
  if (l.startsWith("column-")) {
102
- e = l.replace("column-", "");
103
- const r = m.find((s) => s.id === e);
101
+ n = l.replace("column-", "");
102
+ const r = m.find((s) => s.id === n);
104
103
  f = (r == null ? void 0 : r.tasks.length) ?? 0;
105
- } else if (e = k(l), e) {
106
- const r = m.find((s) => s.id === e);
104
+ } else if (n = k(l), n) {
105
+ const r = m.find((s) => s.id === n);
107
106
  f = (r == null ? void 0 : r.tasks.findIndex((s) => s.id === l)) ?? 0;
108
107
  }
109
- !e || u === e || b(o, u, e, f);
108
+ !n || u === n || x(o, u, n, f);
110
109
  },
111
- [m, k, b]
112
- ), J = v(
110
+ [m, k, x]
111
+ ), H = g(
113
112
  (t) => {
114
- const { active: n, over: i } = t;
115
- if (K(null), !i) return;
116
- const o = n.id, l = i.id, u = k(o);
113
+ const { active: e, over: i } = t;
114
+ if (N(null), !i) return;
115
+ const o = e.id, l = i.id, u = k(o);
117
116
  if (!u) return;
118
- let e, f;
117
+ let n, f;
119
118
  if (l.startsWith("column-")) {
120
- e = l.replace("column-", "");
121
- const r = m.find((s) => s.id === e);
122
- if (f = (r == null ? void 0 : r.tasks.length) ?? 0, u === e) {
123
- const s = r == null ? void 0 : r.tasks.findIndex((c) => c.id === o);
119
+ n = l.replace("column-", "");
120
+ const r = m.find((s) => s.id === n);
121
+ if (f = (r == null ? void 0 : r.tasks.length) ?? 0, u === n) {
122
+ const s = r == null ? void 0 : r.tasks.findIndex((d) => d.id === o);
124
123
  s !== void 0 && s >= 0 && (f = s);
125
124
  }
126
125
  } else {
127
- e = k(l) ?? u;
128
- const r = m.find((s) => s.id === e);
126
+ n = k(l) ?? u;
127
+ const r = m.find((s) => s.id === n);
129
128
  f = (r == null ? void 0 : r.tasks.findIndex((s) => s.id === l)) ?? 0;
130
129
  }
131
- if (u === e) {
132
- const r = m.find((c) => c.id === e), s = r == null ? void 0 : r.tasks.findIndex((c) => c.id === o);
133
- s !== void 0 && s !== f && b(o, u, e, f);
130
+ if (u === n) {
131
+ const r = m.find((d) => d.id === n), s = r == null ? void 0 : r.tasks.findIndex((d) => d.id === o);
132
+ s !== void 0 && s !== f && x(o, u, n, f);
134
133
  }
135
- a == null || a(o, e, f);
134
+ a == null || a(o, n, f);
136
135
  },
137
- [m, k, b, a]
138
- ), Q = (t, n) => {
139
- I == null || I(t, n);
140
- }, U = (t, n) => {
141
- x((i) => ({
136
+ [m, k, x, a]
137
+ ), J = (t, e) => {
138
+ b == null || b(t, e);
139
+ }, Q = (t, e) => {
140
+ v((i) => ({
142
141
  columns: i.columns.map(
143
- (o) => o.id === t ? { ...o, name: n } : o
142
+ (o) => o.id === t ? { ...o, name: e } : o
144
143
  )
145
- })), y == null || y(t, n);
146
- }, X = (t) => {
147
- x((n) => ({
148
- columns: n.columns.filter((i) => i.id !== t)
149
- })), S == null || S(t);
150
- }, Y = (t, n) => {
151
- x((i) => ({
144
+ })), I == null || I(t, e);
145
+ }, U = (t) => {
146
+ v((e) => ({
147
+ columns: e.columns.filter((i) => i.id !== t)
148
+ })), y == null || y(t);
149
+ }, X = (t, e) => {
150
+ v((i) => ({
152
151
  columns: i.columns.map(
153
- (o) => o.id === t ? { ...o, isClientVisible: n } : o
152
+ (o) => o.id === t ? { ...o, isClientVisible: e } : o
154
153
  )
155
- })), D == null || D(t, n);
154
+ })), S == null || S(t, e);
156
155
  };
157
156
  return /* @__PURE__ */ C(
158
- rt,
157
+ nt,
159
158
  {
160
- sensors: G,
161
- collisionDetection: et,
162
- onDragStart: F,
163
- onDragOver: H,
164
- onDragEnd: J,
165
- accessibility: { announcements: L },
159
+ sensors: z,
160
+ collisionDetection: st,
161
+ onDragStart: q,
162
+ onDragOver: F,
163
+ onDragEnd: H,
164
+ accessibility: { announcements: G },
166
165
  children: [
167
166
  /* @__PURE__ */ C(
168
167
  "div",
169
168
  {
170
- ref: z,
169
+ ref: W,
171
170
  className: "no-scrollbar flex h-full gap-ds-05 overflow-x-auto pb-ds-05",
172
171
  children: [
173
172
  /* @__PURE__ */ p(
174
- it,
173
+ at,
175
174
  {
176
- items: q,
177
- strategy: at,
178
- children: m.map((t, n) => /* @__PURE__ */ p("div", { className: "group flex-shrink-0", children: /* @__PURE__ */ p(
175
+ items: L,
176
+ strategy: dt,
177
+ children: m.map((t, e) => /* @__PURE__ */ p("div", { className: "group flex-shrink-0", children: /* @__PURE__ */ p(
179
178
  ct,
180
179
  {
181
180
  column: t,
182
- index: n,
183
- onAddTask: Q,
184
- onClickTask: $,
185
- onRenameColumn: U,
186
- onDeleteColumn: X,
187
- onToggleVisibility: Y
181
+ index: e,
182
+ onAddTask: J,
183
+ onClickTask: K,
184
+ onRenameColumn: Q,
185
+ onDeleteColumn: U,
186
+ onToggleVisibility: X
188
187
  }
189
188
  ) }, t.id))
190
189
  }
191
190
  ),
192
191
  /* @__PURE__ */ p("div", { className: "flex-shrink-0", children: /* @__PURE__ */ C(
193
- ut,
192
+ ft,
194
193
  {
195
194
  variant: "ghost",
196
- onClick: E,
195
+ onClick: P,
197
196
  className: "h-ds-md w-[300px] justify-start gap-ds-03 rounded-ds-xl border border-dashed border-border/60 bg-layer-02 text-text-tertiary hover:border-border-interactive hover:bg-interactive-subtle/50 hover:text-interactive",
198
197
  children: [
199
- /* @__PURE__ */ p(lt, { className: "h-ico-sm w-ico-sm" }),
198
+ /* @__PURE__ */ p(ut, { className: "h-ico-sm w-ico-sm" }),
200
199
  "Add column"
201
200
  ]
202
201
  }
@@ -204,8 +203,8 @@ const mt = Z.forwardRef(
204
203
  ]
205
204
  }
206
205
  ),
207
- w && V(
208
- /* @__PURE__ */ p(st, { dropAnimation: null, children: O ? /* @__PURE__ */ p(dt, { task: O }) : null }),
206
+ R && T(
207
+ /* @__PURE__ */ p(ot, { dropAnimation: null, children: w ? /* @__PURE__ */ p(lt, { task: w }) : null }),
209
208
  document.body
210
209
  )
211
210
  ]
@@ -213,7 +212,7 @@ const mt = Z.forwardRef(
213
212
  );
214
213
  }
215
214
  );
216
- mt.displayName = "KanbanBoard";
215
+ pt.displayName = "KanbanBoard";
217
216
  export {
218
- mt as KanbanBoard
217
+ pt as KanbanBoard
219
218
  };
@@ -1 +1 @@
1
- {"version":3,"file":"task-card.d.ts","sourceRoot":"","sources":["../../src/board/task-card.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAgB9B,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,EAAE,CAAA;IAChB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,SAAS,EAAE,OAAO,CAAA;IAClB,SAAS,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,EAAE,CAAA;CAChE;AAqKD,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,SAAS,CAAA;IACf,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;CACvC;AAED,QAAA,MAAM,QAAQ,sFA6Cb,CAAA;AAID,OAAO,EAAE,QAAQ,EAAE,CAAA;AAMnB,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,SAAS,CAAA;CAChB;AAED,eAAO,MAAM,eAAe,6FAQ3B,CAAA"}
1
+ {"version":3,"file":"task-card.d.ts","sourceRoot":"","sources":["../../src/board/task-card.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAkB9B,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,EAAE,CAAA;IAChB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,SAAS,EAAE,OAAO,CAAA;IAClB,SAAS,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,EAAE,CAAA;CAChE;AA4KD,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,SAAS,CAAA;IACf,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;CACvC;AAED,QAAA,MAAM,QAAQ,sFAmCb,CAAA;AAID,OAAO,EAAE,QAAQ,EAAE,CAAA;AAMnB,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,SAAS,CAAA;CAChB;AAED,eAAO,MAAM,eAAe,6FAQ3B,CAAA"}
@@ -1,22 +1,23 @@
1
1
  "use client";
2
- import { jsx as t, jsxs as l } from "react/jsx-runtime";
3
- import * as m from "react";
4
- import { useSortable as x } from "@dnd-kit/sortable";
2
+ import { jsx as r, jsxs as n } from "react/jsx-runtime";
3
+ import * as c from "react";
4
+ import { useComposedRef as x } from "../utils/use-composed-ref.js";
5
+ import { useSortable as g } from "@dnd-kit/sortable";
5
6
  import { CSS as v } from "@dnd-kit/utilities";
6
7
  import { cva as y } from "class-variance-authority";
7
- import { cn as c } from "@devalok/shilp-sutra/ui";
8
+ import { cn as d } from "@devalok/shilp-sutra/ui/lib/utils";
8
9
  import { Badge as N } from "@devalok/shilp-sutra/ui";
9
- import { AvatarGroup as w } from "@devalok/shilp-sutra/composed";
10
- import { IconGripVertical as T, IconCalendar as D } from "@tabler/icons-react";
11
- import { PRIORITY_LABELS as C, PRIORITY_DOT_COLORS as R } from "../tasks/task-constants.js";
12
- function O(e) {
13
- const a = new Date(e), s = /* @__PURE__ */ new Date(), r = a.getTime() - s.getTime(), i = Math.ceil(r / (1e3 * 60 * 60 * 24));
14
- return i < 0 ? { label: "Overdue", className: "text-text-error" } : i === 0 ? { label: "Today", className: "text-text-warning" } : i === 1 ? { label: "Tomorrow", className: "text-text-warning" } : {
10
+ import { AvatarGroup as w } from "@devalok/shilp-sutra/composed/avatar-group";
11
+ import { IconGripVertical as D, IconCalendar as R } from "@tabler/icons-react";
12
+ import { PRIORITY_LABELS as I, PRIORITY_DOT_COLORS as O } from "../tasks/task-constants.js";
13
+ function S(e) {
14
+ const a = new Date(e), s = /* @__PURE__ */ new Date(), o = a.getTime() - s.getTime(), t = Math.ceil(o / (1e3 * 60 * 60 * 24));
15
+ return t < 0 ? { label: "Overdue", className: "text-text-error" } : t === 0 ? { label: "Today", className: "text-text-warning" } : t === 1 ? { label: "Tomorrow", className: "text-text-warning" } : {
15
16
  label: a.toLocaleDateString("en-IN", { month: "short", day: "numeric" }),
16
17
  className: "text-text-tertiary"
17
18
  };
18
19
  }
19
- const I = y(
20
+ const T = y(
20
21
  "group/card relative rounded-ds-lg border border-border/60 bg-layer-01 p-ds-04 shadow-01 transition-[color,background-color,border-color,box-shadow] duration-fast-02 ease-productive-standard hover:shadow-02 hover:border-border cursor-pointer",
21
22
  {
22
23
  variants: {
@@ -36,135 +37,132 @@ const I = y(
36
37
  }
37
38
  }
38
39
  );
39
- function f({
40
+ function m({
40
41
  task: e,
41
42
  isDragging: a,
42
43
  isDragOverlay: s,
43
- dragHandleProps: r,
44
- onClickTask: i
44
+ dragHandleProps: o,
45
+ onClickTask: t
45
46
  }) {
46
- const n = e.dueDate ? O(e.dueDate) : null;
47
- return (
48
- // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
49
- /* @__PURE__ */ l(
50
- "div",
51
- {
52
- className: I({
53
- state: s ? "overlay" : a ? "dragging" : "default",
54
- blocked: e.isBlocked
55
- }),
56
- onClick: () => i == null ? void 0 : i(e.id),
57
- children: [
58
- /* @__PURE__ */ l("div", { className: "flex items-start gap-ds-02b", children: [
59
- /* @__PURE__ */ t(
60
- "button",
61
- {
62
- className: c(
63
- "mt-ds-01 flex-shrink-0 cursor-grab rounded p-ds-01 opacity-0 transition-opacity",
64
- "group-hover/card:opacity-[0.38] hover:!opacity-100",
65
- "active:cursor-grabbing",
66
- s && "opacity-[0.38]"
67
- ),
68
- ...(r == null ? void 0 : r.attributes) ?? {},
69
- ...(r == null ? void 0 : r.listeners) ?? {},
70
- "aria-label": `Drag handle for task: ${e.title}`,
71
- "aria-roledescription": "sortable",
72
- onClick: (o) => o.stopPropagation(),
73
- children: /* @__PURE__ */ t(T, { className: "h-ico-sm w-ico-sm text-icon-secondary" })
74
- }
75
- ),
76
- /* @__PURE__ */ t("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ t("p", { className: "text-ds-md font-medium text-text-primary line-clamp-2", children: e.title }) })
47
+ const l = e.dueDate ? S(e.dueDate) : null;
48
+ return /* @__PURE__ */ n(
49
+ "div",
50
+ {
51
+ role: "button",
52
+ tabIndex: 0,
53
+ className: T({
54
+ state: s ? "overlay" : a ? "dragging" : "default",
55
+ blocked: e.isBlocked
56
+ }),
57
+ onClick: () => t == null ? void 0 : t(e.id),
58
+ onKeyDown: (i) => {
59
+ (i.key === "Enter" || i.key === " ") && (i.preventDefault(), t == null || t(e.id));
60
+ },
61
+ children: [
62
+ /* @__PURE__ */ n("div", { className: "flex items-start gap-ds-02b", children: [
63
+ /* @__PURE__ */ r(
64
+ "button",
65
+ {
66
+ className: d(
67
+ "mt-ds-01 flex-shrink-0 cursor-grab rounded p-ds-01 opacity-0 transition-opacity",
68
+ "group-hover/card:opacity-[0.38] hover:!opacity-100",
69
+ "active:cursor-grabbing",
70
+ s && "opacity-[0.38]"
71
+ ),
72
+ ...(o == null ? void 0 : o.attributes) ?? {},
73
+ ...(o == null ? void 0 : o.listeners) ?? {},
74
+ "aria-label": `Drag handle for task: ${e.title}`,
75
+ "aria-roledescription": "sortable",
76
+ onClick: (i) => i.stopPropagation(),
77
+ children: /* @__PURE__ */ r(D, { className: "h-ico-sm w-ico-sm text-icon-secondary" })
78
+ }
79
+ ),
80
+ /* @__PURE__ */ r("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ r("p", { className: "text-ds-md font-medium text-text-primary line-clamp-2", children: e.title }) })
81
+ ] }),
82
+ /* @__PURE__ */ n("div", { className: "mt-ds-03 flex items-center gap-ds-03", children: [
83
+ /* @__PURE__ */ r(
84
+ "div",
85
+ {
86
+ className: d(
87
+ "h-2 w-2 rounded-ds-full flex-shrink-0",
88
+ O[e.priority]
89
+ ),
90
+ title: I[e.priority]
91
+ }
92
+ ),
93
+ e.labels.length > 0 && /* @__PURE__ */ n("div", { className: "flex items-center gap-ds-02 overflow-hidden", children: [
94
+ e.labels.slice(0, 2).map((i) => /* @__PURE__ */ r(N, { size: "sm", className: "max-w-[80px] truncate", children: i }, i)),
95
+ e.labels.length > 2 && /* @__PURE__ */ n("span", { className: "text-ds-xs text-text-tertiary", children: [
96
+ "+",
97
+ e.labels.length - 2
98
+ ] })
77
99
  ] }),
78
- /* @__PURE__ */ l("div", { className: "mt-ds-03 flex items-center gap-ds-03", children: [
79
- /* @__PURE__ */ t(
80
- "div",
81
- {
82
- className: c(
83
- "h-2 w-2 rounded-ds-full flex-shrink-0",
84
- R[e.priority]
85
- ),
86
- title: C[e.priority]
87
- }
88
- ),
89
- e.labels.length > 0 && /* @__PURE__ */ l("div", { className: "flex items-center gap-ds-02 overflow-hidden", children: [
90
- e.labels.slice(0, 2).map((o) => /* @__PURE__ */ t(N, { size: "sm", className: "max-w-[80px] truncate", children: o }, o)),
91
- e.labels.length > 2 && /* @__PURE__ */ l("span", { className: "text-ds-xs text-text-tertiary", children: [
92
- "+",
93
- e.labels.length - 2
94
- ] })
95
- ] }),
96
- /* @__PURE__ */ t("div", { className: "flex-1" }),
97
- n && /* @__PURE__ */ l(
98
- "div",
99
- {
100
- className: c(
101
- "flex items-center gap-ds-01 text-ds-xs leading-tight",
102
- n.className
103
- ),
104
- children: [
105
- /* @__PURE__ */ t(D, { className: "h-2.5 w-2.5" }),
106
- /* @__PURE__ */ t("span", { children: n.label })
107
- ]
108
- }
109
- ),
110
- e.assignees.length > 0 && /* @__PURE__ */ t(
111
- w,
112
- {
113
- users: e.assignees,
114
- size: "sm",
115
- max: 2,
116
- showTooltip: !1
117
- }
118
- )
119
- ] })
120
- ]
121
- }
122
- )
100
+ /* @__PURE__ */ r("div", { className: "flex-1" }),
101
+ l && /* @__PURE__ */ n(
102
+ "div",
103
+ {
104
+ className: d(
105
+ "flex items-center gap-ds-01 text-ds-xs leading-tight",
106
+ l.className
107
+ ),
108
+ children: [
109
+ /* @__PURE__ */ r(R, { className: "h-2.5 w-2.5" }),
110
+ /* @__PURE__ */ r("span", { children: l.label })
111
+ ]
112
+ }
113
+ ),
114
+ e.assignees.length > 0 && /* @__PURE__ */ r(
115
+ w,
116
+ {
117
+ users: e.assignees,
118
+ size: "sm",
119
+ max: 2,
120
+ showTooltip: !1
121
+ }
122
+ )
123
+ ] })
124
+ ]
125
+ }
123
126
  );
124
127
  }
125
- const S = m.forwardRef(
126
- function({ task: a, onClickTask: s }, r) {
128
+ const C = c.forwardRef(
129
+ function({ task: a, onClickTask: s }, o) {
127
130
  const {
128
- attributes: i,
129
- listeners: n,
130
- setNodeRef: o,
131
- transform: u,
132
- transition: p,
133
- isDragging: h
134
- } = x({
131
+ attributes: t,
132
+ listeners: l,
133
+ setNodeRef: i,
134
+ transform: f,
135
+ transition: u,
136
+ isDragging: p
137
+ } = g({
135
138
  id: a.id,
136
139
  data: {
137
140
  type: "task",
138
141
  task: a
139
142
  }
140
- }), b = m.useCallback(
141
- (d) => {
142
- o(d), typeof r == "function" ? r(d) : r && (r.current = d);
143
- },
144
- [r, o]
145
- ), g = {
146
- transform: v.Transform.toString(u),
147
- transition: p
143
+ }), h = x(i, o), b = {
144
+ transform: v.Transform.toString(f),
145
+ transition: u
148
146
  };
149
- return /* @__PURE__ */ t("div", { ref: b, style: g, children: /* @__PURE__ */ t(
150
- f,
147
+ return /* @__PURE__ */ r("div", { ref: h, style: b, children: /* @__PURE__ */ r(
148
+ m,
151
149
  {
152
150
  task: a,
153
- isDragging: h,
154
- dragHandleProps: { attributes: i, listeners: n },
151
+ isDragging: p,
152
+ dragHandleProps: { attributes: t, listeners: l },
155
153
  onClickTask: s
156
154
  }
157
155
  ) });
158
156
  }
159
157
  );
160
- S.displayName = "TaskCard";
161
- const L = m.forwardRef(
158
+ C.displayName = "TaskCard";
159
+ const L = c.forwardRef(
162
160
  function({ task: a }, s) {
163
- return /* @__PURE__ */ t("div", { ref: s, children: /* @__PURE__ */ t(f, { task: a, isDragOverlay: !0 }) });
161
+ return /* @__PURE__ */ r("div", { ref: s, children: /* @__PURE__ */ r(m, { task: a, isDragOverlay: !0 }) });
164
162
  }
165
163
  );
166
164
  L.displayName = "TaskCardOverlay";
167
165
  export {
168
- S as TaskCard,
166
+ C as TaskCard,
169
167
  L as TaskCardOverlay
170
168
  };
@@ -1 +1 @@
1
- {"version":3,"file":"chat-input.d.ts","sourceRoot":"","sources":["../../src/chat/chat-input.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAK9B,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;IACrB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED,eAAO,MAAM,SAAS,uFAyErB,CAAA"}
1
+ {"version":3,"file":"chat-input.d.ts","sourceRoot":"","sources":["../../src/chat/chat-input.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAK9B,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;IACrB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED,eAAO,MAAM,SAAS,uFA0ErB,CAAA"}
@@ -3,7 +3,7 @@ import { jsxs as c, jsx as t } from "react/jsx-runtime";
3
3
  import * as b from "react";
4
4
  import { useState as y, useRef as g, useCallback as n } from "react";
5
5
  import { IconSquare as N, IconSend as w } from "@tabler/icons-react";
6
- import { Button as m } from "@devalok/shilp-sutra/ui";
6
+ import { Button as m } from "@devalok/shilp-sutra/ui/button";
7
7
  const k = b.forwardRef(
8
8
  function({
9
9
  onSubmit: l,
@@ -36,6 +36,7 @@ const k = b.forwardRef(
36
36
  },
37
37
  onKeyDown: x,
38
38
  placeholder: p,
39
+ "aria-label": "Type a message",
39
40
  disabled: s,
40
41
  rows: 1,
41
42
  className: "text-ds-md no-scrollbar max-h-[160px] min-h-ds-xs flex-1 resize-none bg-transparent text-text-primary placeholder:text-text-placeholder focus:outline-none disabled:opacity-[0.38]"