@devalok/shilp-sutra-karm 0.8.1 → 0.9.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 (68) hide show
  1. package/dist/_chunks/chat-panel.js +376 -0
  2. package/dist/_chunks/daily-brief.js +177 -0
  3. package/dist/_chunks/kanban-board.js +597 -0
  4. package/dist/_chunks/project-card.js +121 -0
  5. package/dist/_chunks/render-adjustment-type.js +3596 -0
  6. package/dist/{tasks → _chunks}/task-constants.js +3 -3
  7. package/dist/_chunks/task-detail-panel.js +1305 -0
  8. package/dist/_chunks/use-composed-ref.js +12 -0
  9. package/dist/_chunks/vendor.js +11491 -0
  10. package/dist/admin/index.js +37 -60
  11. package/dist/board/index.js +3 -5
  12. package/dist/chat/index.js +6 -10
  13. package/dist/client/index.js +4 -6
  14. package/dist/dashboard/index.js +3 -4
  15. package/dist/index.js +189 -103
  16. package/dist/tasks/index.js +8 -14
  17. package/package.json +9 -4
  18. package/dist/admin/adjustments/approved-adjustments.js +0 -43
  19. package/dist/admin/break/break-admin-skeleton.js +0 -59
  20. package/dist/admin/break/break-admin.js +0 -373
  21. package/dist/admin/break/break-balance.js +0 -42
  22. package/dist/admin/break/breaks.js +0 -91
  23. package/dist/admin/break/delete-break.js +0 -55
  24. package/dist/admin/break/edit-break-balance.js +0 -113
  25. package/dist/admin/break/edit-break.js +0 -453
  26. package/dist/admin/break/header.js +0 -231
  27. package/dist/admin/break/leave-request.js +0 -162
  28. package/dist/admin/break/use-break-date-picker.js +0 -43
  29. package/dist/admin/dashboard/admin-dashboard.js +0 -337
  30. package/dist/admin/dashboard/associate-detail.js +0 -259
  31. package/dist/admin/dashboard/attendance-overview.js +0 -136
  32. package/dist/admin/dashboard/break-request.js +0 -176
  33. package/dist/admin/dashboard/calendar.js +0 -141
  34. package/dist/admin/dashboard/correction-list.js +0 -102
  35. package/dist/admin/dashboard/dashboard-header.js +0 -155
  36. package/dist/admin/dashboard/dashboard-skeleton.js +0 -109
  37. package/dist/admin/dashboard/leave-requests.js +0 -201
  38. package/dist/admin/dashboard/render-date.js +0 -144
  39. package/dist/admin/dashboard/use-calendar-navigation.js +0 -169
  40. package/dist/admin/dashboard/use-leave-request-interaction.js +0 -34
  41. package/dist/admin/utils/date-range-utils.js +0 -37
  42. package/dist/admin/utils/date-utils.js +0 -119
  43. package/dist/admin/utils/emoji-utils.js +0 -17
  44. package/dist/admin/utils/render-adjustment-type.js +0 -20
  45. package/dist/admin/utils/render-status.js +0 -22
  46. package/dist/board/board-column.js +0 -236
  47. package/dist/board/kanban-board.js +0 -218
  48. package/dist/board/task-card.js +0 -168
  49. package/dist/chat/chat-input.js +0 -54
  50. package/dist/chat/chat-panel.js +0 -151
  51. package/dist/chat/conversation-list.js +0 -99
  52. package/dist/chat/markdown-components.js +0 -35
  53. package/dist/chat/message-list.js +0 -59
  54. package/dist/chat/streaming-text.js +0 -17
  55. package/dist/client/accent-provider.js +0 -22
  56. package/dist/client/client-portal-header.js +0 -48
  57. package/dist/client/project-card.js +0 -60
  58. package/dist/dashboard/attendance-cta.js +0 -115
  59. package/dist/dashboard/daily-brief.js +0 -68
  60. package/dist/page-skeletons.js +0 -130
  61. package/dist/tasks/activity-tab.js +0 -185
  62. package/dist/tasks/conversation-tab.js +0 -138
  63. package/dist/tasks/files-tab.js +0 -186
  64. package/dist/tasks/review-tab.js +0 -170
  65. package/dist/tasks/subtasks-tab.js +0 -154
  66. package/dist/tasks/task-detail-panel.js +0 -210
  67. package/dist/tasks/task-properties.js +0 -324
  68. package/dist/utils/use-composed-ref.js +0 -12
@@ -1,154 +0,0 @@
1
- "use client";
2
- import { jsxs as r, jsx as t } from "react/jsx-runtime";
3
- import * as l from "react";
4
- import { cn as a } from "@devalok/shilp-sutra/ui/lib/utils";
5
- import { Avatar as D, AvatarImage as E, AvatarFallback as P } from "@devalok/shilp-sutra/ui/avatar";
6
- import { Progress as K } from "@devalok/shilp-sutra/ui";
7
- import { EmptyState as j } from "@devalok/shilp-sutra/composed/empty-state";
8
- import { IconSquareCheck as q, IconSquare as B, IconListCheck as L, IconPlus as O } from "@tabler/icons-react";
9
- import { getInitials as S } from "@devalok/shilp-sutra/composed/lib/string-utils";
10
- import { PRIORITY_DOT_COLORS as _ } from "./task-constants.js";
11
- const C = l.forwardRef(
12
- function({
13
- subtasks: d,
14
- terminalColumnId: g,
15
- onCreateSubtask: w,
16
- onToggleSubtask: I,
17
- onClickSubtask: s,
18
- className: T,
19
- readOnly: f = !1
20
- }, A) {
21
- const [c, h] = l.useState(""), [m, x] = l.useState(!1), u = l.useRef(null), v = d.filter(
22
- (e) => {
23
- var o;
24
- return ((o = e.column) == null ? void 0 : o.isTerminal) || e.columnId === g;
25
- }
26
- ).length, p = d.length, y = () => {
27
- const e = c.trim();
28
- e && (w(e), h(""));
29
- }, R = (e) => {
30
- e.key === "Enter" && (e.preventDefault(), y()), e.key === "Escape" && (x(!1), h(""));
31
- };
32
- return l.useEffect(() => {
33
- m && u.current && u.current.focus();
34
- }, [m]), /* @__PURE__ */ r("div", { ref: A, className: a("flex flex-col", T), children: [
35
- p > 0 && /* @__PURE__ */ r("div", { className: "mb-ds-05 flex items-center gap-ds-04", children: [
36
- /* @__PURE__ */ t(K, { value: p > 0 ? v / p * 100 : 0, className: "h-ds-02b" }),
37
- /* @__PURE__ */ r("span", { className: "shrink-0 text-ds-sm font-medium text-text-placeholder", children: [
38
- v,
39
- "/",
40
- p
41
- ] })
42
- ] }),
43
- d.length > 0 ? /* @__PURE__ */ t("div", { className: "space-y-ds-01", children: d.map((e) => {
44
- var N, b;
45
- const o = ((N = e.column) == null ? void 0 : N.isTerminal) || e.columnId === g, i = (b = e.assignees[0]) == null ? void 0 : b.user;
46
- return /* @__PURE__ */ r(
47
- "div",
48
- {
49
- role: "button",
50
- tabIndex: 0,
51
- className: a(
52
- "group flex items-center gap-ds-03 rounded-ds-lg px-ds-03 py-ds-02b transition-colors",
53
- "hover:bg-field cursor-pointer"
54
- ),
55
- onClick: () => s == null ? void 0 : s(e.id),
56
- onKeyDown: (n) => {
57
- (n.key === "Enter" || n.key === " ") && (n.preventDefault(), s == null || s(e.id));
58
- },
59
- children: [
60
- /* @__PURE__ */ t(
61
- "button",
62
- {
63
- type: "button",
64
- onClick: (n) => {
65
- n.stopPropagation(), f || I(e.id, !o);
66
- },
67
- className: a(
68
- "shrink-0 rounded p-ds-01 transition-colors",
69
- f ? "cursor-default" : "hover:bg-layer-02"
70
- ),
71
- children: o ? /* @__PURE__ */ t(q, { className: "h-ico-sm w-ico-sm text-interactive", stroke: 1.5 }) : /* @__PURE__ */ t(B, { className: "h-ico-sm w-ico-sm text-text-placeholder", stroke: 1.5 })
72
- }
73
- ),
74
- /* @__PURE__ */ t(
75
- "div",
76
- {
77
- className: a(
78
- "h-2 w-2 shrink-0 rounded-ds-full",
79
- _[e.priority]
80
- )
81
- }
82
- ),
83
- /* @__PURE__ */ t(
84
- "span",
85
- {
86
- className: a(
87
- "flex-1 truncate text-ds-md",
88
- o ? "text-text-placeholder line-through" : "text-text-primary"
89
- ),
90
- children: e.title
91
- }
92
- ),
93
- i && /* @__PURE__ */ r(D, { className: "h-ico-md w-ico-md shrink-0", children: [
94
- i.image && /* @__PURE__ */ t(E, { src: i.image, alt: i.name }),
95
- /* @__PURE__ */ t(P, { className: "bg-layer-03 text-ds-xs font-semibold text-text-on-color", children: S(i.name) })
96
- ] })
97
- ]
98
- },
99
- e.id
100
- );
101
- }) }) : !m && /* @__PURE__ */ t(
102
- j,
103
- {
104
- icon: /* @__PURE__ */ t(L, {}),
105
- title: "No subtasks",
106
- description: "Break this task into smaller pieces",
107
- compact: !0
108
- }
109
- ),
110
- !f && (m ? /* @__PURE__ */ r("div", { className: "mt-ds-03 flex items-center gap-ds-03 rounded-ds-lg border border-border bg-layer-01 shadow-01 px-ds-04 py-ds-03", children: [
111
- /* @__PURE__ */ t(
112
- "input",
113
- {
114
- ref: u,
115
- type: "text",
116
- value: c,
117
- onChange: (e) => h(e.target.value),
118
- onKeyDown: R,
119
- onBlur: () => {
120
- c.trim() || x(!1);
121
- },
122
- placeholder: "Subtask title...",
123
- className: "flex-1 bg-transparent text-ds-md text-text-primary placeholder:text-text-placeholder outline-none"
124
- }
125
- ),
126
- /* @__PURE__ */ t(
127
- "button",
128
- {
129
- type: "button",
130
- onClick: y,
131
- disabled: !c.trim(),
132
- className: "inline-flex h-6 items-center gap-ds-02 rounded-ds-md bg-interactive px-ds-03 text-ds-sm font-semibold text-text-on-color transition-colors hover:bg-interactive-hover disabled:opacity-[0.38]",
133
- children: "Add"
134
- }
135
- )
136
- ] }) : /* @__PURE__ */ r(
137
- "button",
138
- {
139
- type: "button",
140
- onClick: () => x(!0),
141
- className: "mt-ds-03 inline-flex items-center gap-ds-02b rounded-ds-lg px-ds-03 py-ds-02b text-ds-md text-text-placeholder transition-colors hover:bg-field hover:text-text-secondary",
142
- children: [
143
- /* @__PURE__ */ t(O, { className: "h-ico-sm w-ico-sm", stroke: 1.5 }),
144
- "Add subtask"
145
- ]
146
- }
147
- ))
148
- ] });
149
- }
150
- );
151
- C.displayName = "SubtasksTab";
152
- export {
153
- C as SubtasksTab
154
- };
@@ -1,210 +0,0 @@
1
- "use client";
2
- import { jsx as r, jsxs as a, Fragment as ie } from "react/jsx-runtime";
3
- import * as c from "react";
4
- import { cn as _ } from "@devalok/shilp-sutra/ui/lib/utils";
5
- import { Sheet as re, SheetContent as se, SheetTitle as le } from "@devalok/shilp-sutra/ui/sheet";
6
- import { VisuallyHidden as ae } from "@devalok/shilp-sutra/ui/visually-hidden";
7
- import { Skeleton as t } from "@devalok/shilp-sutra/ui/skeleton";
8
- import { Tabs as ce, TabsList as te, TabsTrigger as de } from "@devalok/shilp-sutra/ui";
9
- import { TaskProperties as fe } from "./task-properties.js";
10
- import { SubtasksTab as me } from "./subtasks-tab.js";
11
- import { ReviewTab as ne } from "./review-tab.js";
12
- import { ConversationTab as oe } from "./conversation-tab.js";
13
- import { FilesTab as be } from "./files-tab.js";
14
- import { ActivityTab as pe } from "./activity-tab.js";
15
- import { IconListCheck as he, IconGitPullRequest as ue, IconMessageCircle as ve, IconPaperclip as xe, IconActivity as ye } from "@tabler/icons-react";
16
- const z = [
17
- { id: "subtasks", label: "Subtasks", icon: he },
18
- { id: "review", label: "Review", icon: ue },
19
- { id: "conversation", label: "Conversation", icon: ve },
20
- { id: "files", label: "Files", icon: xe },
21
- { id: "activity", label: "Activity", icon: ye }
22
- ];
23
- function Ne() {
24
- return /* @__PURE__ */ a("div", { className: "space-y-ds-06 p-ds-06", children: [
25
- /* @__PURE__ */ r(t, { className: "h-ds-xs-plus w-3/4 bg-field" }),
26
- /* @__PURE__ */ r("div", { className: "space-y-ds-04", children: Array.from({ length: 6 }).map((V, i) => /* @__PURE__ */ a("div", { className: "flex items-center gap-ds-04", children: [
27
- /* @__PURE__ */ r(t, { className: "h-[16px] w-[120px] bg-field" }),
28
- /* @__PURE__ */ r(t, { className: "h-[16px] flex-1 bg-field" })
29
- ] }, i)) }),
30
- /* @__PURE__ */ r("div", { className: "flex gap-ds-05 border-b border-border pb-ds-03", children: Array.from({ length: 5 }).map((V, i) => /* @__PURE__ */ r(t, { className: "h-[12px] w-[64px] bg-field" }, i)) }),
31
- /* @__PURE__ */ a("div", { className: "space-y-ds-04", children: [
32
- /* @__PURE__ */ r(t, { className: "h-ds-md w-full bg-field" }),
33
- /* @__PURE__ */ r(t, { className: "h-ds-md w-full bg-field" }),
34
- /* @__PURE__ */ r(t, { className: "h-ds-md w-4/5 bg-field" })
35
- ] })
36
- ] });
37
- }
38
- const Te = c.forwardRef(function({
39
- task: i,
40
- loading: G = !1,
41
- open: b,
42
- onOpenChange: H,
43
- columns: f,
44
- members: j,
45
- activities: J = [],
46
- enrichedComments: P,
47
- clientMode: s = !1,
48
- clientEditableFields: A = ["priority", "dueDate"],
49
- onTitleUpdate: p,
50
- onPropertyUpdate: h,
51
- onAssign: u,
52
- onUnassign: v,
53
- onCreateSubtask: x,
54
- onToggleSubtask: y,
55
- onRequestReview: N,
56
- onUpdateReviewStatus: T,
57
- onPostComment: w,
58
- onUploadFile: g,
59
- onDeleteFile: I,
60
- onTabChange: D,
61
- renderEditor: Q,
62
- renderViewer: W,
63
- renderPriorityIndicator: X,
64
- renderDatePicker: Y,
65
- isUploading: Z = !1
66
- }, $) {
67
- var C, K, L;
68
- const [d, B] = c.useState(s ? "conversation" : "subtasks"), [E, m] = c.useState(!1), [O, n] = c.useState(""), o = c.useRef(null);
69
- c.useEffect(() => {
70
- i && (n(i.title), m(!1));
71
- }, [i == null ? void 0 : i.id]), c.useEffect(() => {
72
- b && B(s ? "conversation" : "subtasks");
73
- }, [b, s]);
74
- const q = (e) => {
75
- B(e), D == null || D(e);
76
- }, S = () => {
77
- m(!1);
78
- const e = O.trim();
79
- e && e !== (i == null ? void 0 : i.title) ? p == null || p(e) : i && n(i.title);
80
- }, R = (e) => {
81
- e.key === "Enter" && (e.preventDefault(), S()), e.key === "Escape" && (m(!1), i && n(i.title));
82
- };
83
- c.useEffect(() => {
84
- E && o.current && (o.current.focus(), o.current.select());
85
- }, [E]);
86
- const F = (C = f.find((e) => e.isTerminal)) == null ? void 0 : C.id, k = ((K = f.find((e) => e.isDefault)) == null ? void 0 : K.id) || ((L = f[0]) == null ? void 0 : L.id) || "", M = s ? z.filter((e) => e.id === "conversation") : z, U = P || (i == null ? void 0 : i.comments) || [];
87
- return /* @__PURE__ */ r(re, { open: b, onOpenChange: H, children: /* @__PURE__ */ a(
88
- se,
89
- {
90
- ref: $,
91
- side: "right",
92
- className: _(
93
- /* intentional: task detail side panel takes 40% of screen, min 380px for form usability */
94
- "w-full sm:max-w-none sm:w-[40%] min-w-[380px] p-0",
95
- "flex flex-col overflow-hidden",
96
- "border-l border-border bg-layer-01"
97
- ),
98
- children: [
99
- /* @__PURE__ */ r(ae, { children: /* @__PURE__ */ r(le, { children: (i == null ? void 0 : i.title) || "Task Details" }) }),
100
- G || !i ? /* @__PURE__ */ r(Ne, {}) : /* @__PURE__ */ a(ie, { children: [
101
- /* @__PURE__ */ a("div", { className: "shrink-0 border-b border-border px-ds-06 pb-ds-05 pt-ds-06", children: [
102
- !s && E ? /* @__PURE__ */ r(
103
- "input",
104
- {
105
- ref: o,
106
- type: "text",
107
- value: O,
108
- onChange: (e) => n(e.target.value),
109
- onBlur: S,
110
- onKeyDown: R,
111
- className: "w-full bg-transparent text-ds-lg font-semibold text-text-primary outline-none"
112
- }
113
- ) : (
114
- // eslint-disable-next-line jsx-a11y/click-events-have-key-events
115
- /* @__PURE__ */ r(
116
- "h2",
117
- {
118
- onClick: s ? void 0 : () => m(!0),
119
- className: _(
120
- "text-ds-lg font-semibold text-text-primary",
121
- !s && "cursor-text hover:text-interactive transition-colors"
122
- ),
123
- children: i.title
124
- }
125
- )
126
- ),
127
- i.parentTaskId && /* @__PURE__ */ r("p", { className: "mt-ds-02 text-ds-sm text-text-placeholder", children: "Subtask" })
128
- ] }),
129
- /* @__PURE__ */ a("div", { className: "flex-1 overflow-y-auto", children: [
130
- /* @__PURE__ */ r("div", { className: "border-b border-border px-ds-06 py-ds-05", children: /* @__PURE__ */ r(
131
- fe,
132
- {
133
- task: i,
134
- columns: f,
135
- members: j,
136
- onUpdate: (e, l) => {
137
- s && !A.includes(e) || h == null || h(e, l);
138
- },
139
- onAssign: (e) => u == null ? void 0 : u(e),
140
- onUnassign: (e) => v == null ? void 0 : v(e),
141
- readOnly: s,
142
- editableFields: s ? A : void 0,
143
- renderPriorityIndicator: X,
144
- renderDatePicker: Y
145
- }
146
- ) }),
147
- /* @__PURE__ */ r("div", { className: "sticky top-0 z-raised bg-layer-01 px-ds-06", children: /* @__PURE__ */ r(ce, { value: d, onValueChange: q, children: /* @__PURE__ */ r(te, { variant: "line", children: M.map((e) => /* @__PURE__ */ a(de, { value: e.id, children: [
148
- /* @__PURE__ */ r(e.icon, { className: "h-ico-sm w-ico-sm", stroke: 1.5 }),
149
- e.label
150
- ] }, e.id)) }) }) }),
151
- /* @__PURE__ */ a("div", { className: "px-ds-06 py-ds-05", children: [
152
- d === "subtasks" && /* @__PURE__ */ r(
153
- me,
154
- {
155
- subtasks: i.subtasks ?? [],
156
- terminalColumnId: F,
157
- projectId: i.projectId,
158
- parentTaskId: i.id,
159
- defaultColumnId: k,
160
- onCreateSubtask: s ? () => {
161
- } : (e) => x == null ? void 0 : x(e),
162
- onToggleSubtask: s ? () => {
163
- } : (e, l) => y == null ? void 0 : y(e, l),
164
- readOnly: s
165
- }
166
- ),
167
- d === "review" && !s && /* @__PURE__ */ r(
168
- ne,
169
- {
170
- reviews: i.reviewRequests,
171
- members: j,
172
- onRequestReview: (e) => N == null ? void 0 : N(e),
173
- onUpdateStatus: (e, l, ee) => T == null ? void 0 : T(e, l, ee)
174
- }
175
- ),
176
- d === "conversation" && /* @__PURE__ */ r(
177
- oe,
178
- {
179
- comments: U,
180
- taskVisibility: i.visibility,
181
- onPostComment: (e, l) => w == null ? void 0 : w(e, l),
182
- clientMode: s,
183
- renderEditor: Q,
184
- renderViewer: W
185
- }
186
- ),
187
- d === "files" && /* @__PURE__ */ r(
188
- be,
189
- {
190
- files: i.files ?? [],
191
- onUpload: s ? () => {
192
- } : (e, l) => g == null ? void 0 : g(e, l),
193
- onDelete: s ? () => {
194
- } : (e) => I == null ? void 0 : I(e),
195
- isUploading: Z,
196
- readOnly: s
197
- }
198
- ),
199
- d === "activity" && /* @__PURE__ */ r(pe, { activities: J })
200
- ] })
201
- ] })
202
- ] })
203
- ]
204
- }
205
- ) });
206
- });
207
- Te.displayName = "TaskDetailPanel";
208
- export {
209
- Te as TaskDetailPanel
210
- };