@devalok/shilp-sutra-karm 0.8.2 → 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.
- package/dist/_chunks/chat-panel.js +376 -0
- package/dist/_chunks/daily-brief.js +177 -0
- package/dist/_chunks/kanban-board.js +597 -0
- package/dist/_chunks/project-card.js +121 -0
- package/dist/_chunks/render-adjustment-type.js +3596 -0
- package/dist/{tasks → _chunks}/task-constants.js +3 -3
- package/dist/_chunks/task-detail-panel.js +1305 -0
- package/dist/_chunks/use-composed-ref.js +12 -0
- package/dist/_chunks/vendor.js +11491 -0
- package/dist/admin/index.js +37 -60
- package/dist/board/index.js +3 -5
- package/dist/chat/index.js +6 -10
- package/dist/client/index.js +4 -6
- package/dist/dashboard/index.js +3 -4
- package/dist/index.js +189 -103
- package/dist/tasks/index.js +8 -14
- package/package.json +78 -80
- package/dist/admin/adjustments/approved-adjustments.js +0 -43
- package/dist/admin/break/break-admin-skeleton.js +0 -59
- package/dist/admin/break/break-admin.js +0 -373
- package/dist/admin/break/break-balance.js +0 -42
- package/dist/admin/break/breaks.js +0 -91
- package/dist/admin/break/delete-break.js +0 -55
- package/dist/admin/break/edit-break-balance.js +0 -113
- package/dist/admin/break/edit-break.js +0 -453
- package/dist/admin/break/header.js +0 -231
- package/dist/admin/break/leave-request.js +0 -162
- package/dist/admin/break/use-break-date-picker.js +0 -43
- package/dist/admin/dashboard/admin-dashboard.js +0 -337
- package/dist/admin/dashboard/associate-detail.js +0 -259
- package/dist/admin/dashboard/attendance-overview.js +0 -136
- package/dist/admin/dashboard/break-request.js +0 -176
- package/dist/admin/dashboard/calendar.js +0 -141
- package/dist/admin/dashboard/correction-list.js +0 -102
- package/dist/admin/dashboard/dashboard-header.js +0 -155
- package/dist/admin/dashboard/dashboard-skeleton.js +0 -109
- package/dist/admin/dashboard/leave-requests.js +0 -201
- package/dist/admin/dashboard/render-date.js +0 -144
- package/dist/admin/dashboard/use-calendar-navigation.js +0 -169
- package/dist/admin/dashboard/use-leave-request-interaction.js +0 -34
- package/dist/admin/utils/date-range-utils.js +0 -37
- package/dist/admin/utils/date-utils.js +0 -119
- package/dist/admin/utils/emoji-utils.js +0 -17
- package/dist/admin/utils/render-adjustment-type.js +0 -20
- package/dist/admin/utils/render-status.js +0 -22
- package/dist/board/board-column.js +0 -236
- package/dist/board/kanban-board.js +0 -218
- package/dist/board/task-card.js +0 -168
- package/dist/chat/chat-input.js +0 -54
- package/dist/chat/chat-panel.js +0 -151
- package/dist/chat/conversation-list.js +0 -99
- package/dist/chat/markdown-components.js +0 -35
- package/dist/chat/message-list.js +0 -59
- package/dist/chat/streaming-text.js +0 -17
- package/dist/client/accent-provider.js +0 -22
- package/dist/client/client-portal-header.js +0 -48
- package/dist/client/project-card.js +0 -60
- package/dist/dashboard/attendance-cta.js +0 -115
- package/dist/dashboard/daily-brief.js +0 -68
- package/dist/page-skeletons.js +0 -130
- package/dist/tasks/activity-tab.js +0 -185
- package/dist/tasks/conversation-tab.js +0 -138
- package/dist/tasks/files-tab.js +0 -186
- package/dist/tasks/review-tab.js +0 -170
- package/dist/tasks/subtasks-tab.js +0 -154
- package/dist/tasks/task-detail-panel.js +0 -210
- package/dist/tasks/task-properties.js +0 -324
- package/dist/utils/use-composed-ref.js +0 -12
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsxs as a, jsx as t } from "react/jsx-runtime";
|
|
3
|
-
import * as m from "react";
|
|
4
|
-
import { cn as b } from "@devalok/shilp-sutra/ui/lib/utils";
|
|
5
|
-
import { Avatar as C, AvatarImage as T, AvatarFallback as E } from "@devalok/shilp-sutra/ui/avatar";
|
|
6
|
-
import { EmptyState as A } from "@devalok/shilp-sutra/composed/empty-state";
|
|
7
|
-
import { RichTextViewer as I, RichTextEditor as k } from "@devalok/shilp-sutra/composed/rich-text-editor";
|
|
8
|
-
import { IconMessageCircle as R, IconSend as L } from "@tabler/icons-react";
|
|
9
|
-
import { getInitials as M } from "@devalok/shilp-sutra/composed/lib/string-utils";
|
|
10
|
-
function S(r) {
|
|
11
|
-
const s = new Date(r), u = (/* @__PURE__ */ new Date()).getTime() - s.getTime(), o = Math.floor(u / 6e4), n = Math.floor(o / 60), l = Math.floor(n / 24);
|
|
12
|
-
return o < 1 ? "Just now" : o < 60 ? `${o}m ago` : n < 24 ? `${n}h ago` : l < 7 ? `${l}d ago` : s.toLocaleDateString("en-IN", {
|
|
13
|
-
month: "short",
|
|
14
|
-
day: "numeric",
|
|
15
|
-
hour: "numeric",
|
|
16
|
-
minute: "2-digit"
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
function D(r) {
|
|
20
|
-
return r.authorType === "INTERNAL" && r.internalAuthor ? r.internalAuthor : r.authorType === "CLIENT" && r.clientAuthor ? {
|
|
21
|
-
id: r.clientAuthor.id,
|
|
22
|
-
name: r.clientAuthor.name,
|
|
23
|
-
email: r.clientAuthor.email,
|
|
24
|
-
image: null
|
|
25
|
-
} : { id: r.authorId, name: "Unknown", image: null };
|
|
26
|
-
}
|
|
27
|
-
function V(r) {
|
|
28
|
-
return r.replace(/<[^>]*>/g, "");
|
|
29
|
-
}
|
|
30
|
-
const j = m.forwardRef(
|
|
31
|
-
function({
|
|
32
|
-
comments: s,
|
|
33
|
-
taskVisibility: p,
|
|
34
|
-
onPostComment: u,
|
|
35
|
-
className: o,
|
|
36
|
-
clientMode: n = !1,
|
|
37
|
-
richText: l = !1,
|
|
38
|
-
renderEditor: N,
|
|
39
|
-
renderViewer: y
|
|
40
|
-
}, w) {
|
|
41
|
-
const [d, h] = m.useState(""), c = m.useRef(null), x = N ?? (l ? (e) => /* @__PURE__ */ t(
|
|
42
|
-
k,
|
|
43
|
-
{
|
|
44
|
-
content: e.content,
|
|
45
|
-
onChange: e.onChange,
|
|
46
|
-
placeholder: e.placeholder,
|
|
47
|
-
editable: !0,
|
|
48
|
-
className: "min-h-[80px]"
|
|
49
|
-
}
|
|
50
|
-
) : void 0), g = y ?? (l ? (e) => /* @__PURE__ */ t(I, { content: e.content, className: e.className }) : void 0), v = () => {
|
|
51
|
-
const e = d.trim();
|
|
52
|
-
e.replace(/<[^>]*>/g, "").trim() && (u(e, n ? "CLIENT" : "INTERNAL"), h(""));
|
|
53
|
-
};
|
|
54
|
-
return m.useEffect(() => {
|
|
55
|
-
c.current && (c.current.scrollTop = c.current.scrollHeight);
|
|
56
|
-
}, [s.length]), /* @__PURE__ */ a("div", { ref: w, className: b("flex flex-col", o), children: [
|
|
57
|
-
s.length > 0 ? /* @__PURE__ */ t(
|
|
58
|
-
"div",
|
|
59
|
-
{
|
|
60
|
-
ref: c,
|
|
61
|
-
className: "flex-1 space-y-ds-05 overflow-y-auto",
|
|
62
|
-
children: s.map((e) => {
|
|
63
|
-
const i = D(e), f = e.authorType === "CLIENT";
|
|
64
|
-
return /* @__PURE__ */ a("div", { className: "flex gap-ds-03", children: [
|
|
65
|
-
/* @__PURE__ */ a(C, { className: "h-ds-xs-plus w-ds-xs-plus shrink-0 mt-ds-01", children: [
|
|
66
|
-
i.image && /* @__PURE__ */ t(T, { src: i.image, alt: i.name }),
|
|
67
|
-
/* @__PURE__ */ t(
|
|
68
|
-
E,
|
|
69
|
-
{
|
|
70
|
-
className: b(
|
|
71
|
-
"text-ds-xs font-semibold",
|
|
72
|
-
/* avatar initials — below scale, leave as-is */
|
|
73
|
-
f ? "bg-warning-surface text-text-warning" : "bg-layer-03 text-text-on-color"
|
|
74
|
-
),
|
|
75
|
-
children: M(i.name)
|
|
76
|
-
}
|
|
77
|
-
)
|
|
78
|
-
] }),
|
|
79
|
-
/* @__PURE__ */ a("div", { className: "flex-1 min-w-0", children: [
|
|
80
|
-
/* @__PURE__ */ a("div", { className: "flex items-baseline gap-ds-03", children: [
|
|
81
|
-
/* @__PURE__ */ t("span", { className: "text-ds-md font-medium text-text-primary", children: i.name }),
|
|
82
|
-
n ? !f && /* @__PURE__ */ t("span", { className: "rounded bg-layer-03 px-ds-02 py-px text-ds-xs font-semibold uppercase tracking-wider text-text-on-color", children: "Team" }) : f && /* @__PURE__ */ t("span", { className: "rounded bg-warning-surface px-ds-02 py-px text-ds-xs font-semibold uppercase tracking-wider text-text-warning", children: "Client" }),
|
|
83
|
-
/* @__PURE__ */ t("span", { className: "text-ds-sm text-text-placeholder", children: S(e.createdAt) })
|
|
84
|
-
] }),
|
|
85
|
-
/* @__PURE__ */ t("div", { className: "mt-ds-02", children: g ? g({
|
|
86
|
-
content: e.content,
|
|
87
|
-
className: "[&_.ProseMirror]:!min-h-0 [&_.ProseMirror]:!p-0"
|
|
88
|
-
}) : /* @__PURE__ */ t("p", { className: "text-ds-md text-text-secondary whitespace-pre-wrap", children: V(e.content) }) })
|
|
89
|
-
] })
|
|
90
|
-
] }, e.id);
|
|
91
|
-
})
|
|
92
|
-
}
|
|
93
|
-
) : /* @__PURE__ */ t(
|
|
94
|
-
A,
|
|
95
|
-
{
|
|
96
|
-
icon: /* @__PURE__ */ t(R, {}),
|
|
97
|
-
title: "No comments yet",
|
|
98
|
-
description: "Start a conversation about this task",
|
|
99
|
-
compact: !0
|
|
100
|
-
}
|
|
101
|
-
),
|
|
102
|
-
/* @__PURE__ */ a("div", { className: "mt-ds-05 space-y-ds-03", children: [
|
|
103
|
-
p === "EVERYONE" && !n && /* @__PURE__ */ t("p", { className: "text-ds-xs text-text-warning", children: "This task is visible to clients. Comments may be seen by external users." }),
|
|
104
|
-
x ? x({
|
|
105
|
-
content: d,
|
|
106
|
-
onChange: h,
|
|
107
|
-
placeholder: "Write a comment..."
|
|
108
|
-
}) : /* @__PURE__ */ t(
|
|
109
|
-
"textarea",
|
|
110
|
-
{
|
|
111
|
-
value: d,
|
|
112
|
-
onChange: (e) => h(e.target.value),
|
|
113
|
-
placeholder: "Write a comment...",
|
|
114
|
-
rows: 3,
|
|
115
|
-
className: "w-full resize-none rounded-ds-md border border-border bg-transparent px-ds-04 py-ds-03 text-ds-md text-text-primary placeholder:text-text-placeholder outline-none focus:border-border-subtle"
|
|
116
|
-
}
|
|
117
|
-
),
|
|
118
|
-
/* @__PURE__ */ t("div", { className: "flex justify-end", children: /* @__PURE__ */ a(
|
|
119
|
-
"button",
|
|
120
|
-
{
|
|
121
|
-
type: "button",
|
|
122
|
-
onClick: v,
|
|
123
|
-
disabled: !d.replace(/<[^>]*>/g, "").trim(),
|
|
124
|
-
className: "inline-flex items-center gap-ds-02b rounded-ds-lg bg-interactive px-ds-04 py-ds-02b text-ds-sm font-semibold text-text-on-color transition-colors hover:bg-interactive-hover disabled:opacity-[0.38] disabled:cursor-not-allowed",
|
|
125
|
-
children: [
|
|
126
|
-
/* @__PURE__ */ t(L, { className: "h-ico-sm w-ico-sm", stroke: 2 }),
|
|
127
|
-
"Comment"
|
|
128
|
-
]
|
|
129
|
-
}
|
|
130
|
-
) })
|
|
131
|
-
] })
|
|
132
|
-
] });
|
|
133
|
-
}
|
|
134
|
-
);
|
|
135
|
-
j.displayName = "ConversationTab";
|
|
136
|
-
export {
|
|
137
|
-
j as ConversationTab
|
|
138
|
-
};
|
package/dist/tasks/files-tab.js
DELETED
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
3
|
-
import * as d from "react";
|
|
4
|
-
import { cn as h } from "@devalok/shilp-sutra/ui/lib/utils";
|
|
5
|
-
import { Dialog as I, DialogTrigger as C, DialogContent as j, DialogHeader as T, DialogTitle as k, DialogDescription as z, DialogFooter as L, DialogClose as u } from "@devalok/shilp-sutra/ui/dialog";
|
|
6
|
-
import { Button as f } from "@devalok/shilp-sutra/ui/button";
|
|
7
|
-
import { EmptyState as R } from "@devalok/shilp-sutra/composed/empty-state";
|
|
8
|
-
import { IconUpload as S, IconDownload as U, IconTrash as O, IconPaperclip as B, IconFile as x, IconPhoto as P, IconFileText as A, IconFileCode as E, IconFileSpreadsheet as H, IconFileZip as Z } from "@tabler/icons-react";
|
|
9
|
-
function _(n) {
|
|
10
|
-
if (!n) return x;
|
|
11
|
-
const s = n.toLowerCase();
|
|
12
|
-
return ["jpg", "jpeg", "png", "gif", "svg", "webp", "bmp"].includes(s) ? P : ["pdf", "doc", "docx", "txt", "rtf"].includes(s) ? A : ["js", "ts", "jsx", "tsx", "py", "rb", "go", "rs", "html", "css", "json"].includes(s) ? E : ["xls", "xlsx", "csv"].includes(s) ? H : ["zip", "tar", "gz", "rar", "7z"].includes(s) ? Z : x;
|
|
13
|
-
}
|
|
14
|
-
function q(n) {
|
|
15
|
-
return new Date(n).toLocaleDateString("en-IN", {
|
|
16
|
-
month: "short",
|
|
17
|
-
day: "numeric",
|
|
18
|
-
year: "numeric"
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
const G = d.forwardRef(
|
|
22
|
-
function({
|
|
23
|
-
files: s,
|
|
24
|
-
onUpload: c,
|
|
25
|
-
onDelete: g,
|
|
26
|
-
isUploading: m = !1,
|
|
27
|
-
className: v,
|
|
28
|
-
readOnly: p = !1
|
|
29
|
-
}, b) {
|
|
30
|
-
const o = d.useRef(null), [y, a] = d.useState(!1), D = (t) => {
|
|
31
|
-
var i;
|
|
32
|
-
const l = (i = t.target.files) == null ? void 0 : i[0];
|
|
33
|
-
l && c(l), o.current && (o.current.value = "");
|
|
34
|
-
}, N = (t) => {
|
|
35
|
-
var i;
|
|
36
|
-
t.preventDefault(), a(!1);
|
|
37
|
-
const l = (i = t.dataTransfer.files) == null ? void 0 : i[0];
|
|
38
|
-
l && c(l);
|
|
39
|
-
}, w = (t) => {
|
|
40
|
-
t.preventDefault(), a(!0);
|
|
41
|
-
}, F = () => {
|
|
42
|
-
a(!1);
|
|
43
|
-
};
|
|
44
|
-
return /* @__PURE__ */ r("div", { ref: b, className: h("flex flex-col", v), children: [
|
|
45
|
-
!p && /* @__PURE__ */ r(
|
|
46
|
-
"div",
|
|
47
|
-
{
|
|
48
|
-
role: "region",
|
|
49
|
-
"aria-label": "File upload drop zone",
|
|
50
|
-
onDrop: N,
|
|
51
|
-
onDragOver: w,
|
|
52
|
-
onDragLeave: F,
|
|
53
|
-
className: h(
|
|
54
|
-
"rounded-ds-lg border-2 border-dashed transition-colors",
|
|
55
|
-
y ? "border-interactive bg-interactive/5" : "border-border"
|
|
56
|
-
),
|
|
57
|
-
children: [
|
|
58
|
-
/* @__PURE__ */ r("div", { className: "flex flex-col items-center gap-ds-03 py-ds-06", children: [
|
|
59
|
-
/* @__PURE__ */ e("div", { className: "flex h-ds-sm-plus w-ds-sm-plus items-center justify-center rounded-ds-lg bg-layer-02", children: /* @__PURE__ */ e(
|
|
60
|
-
S,
|
|
61
|
-
{
|
|
62
|
-
className: "h-ico-sm w-ico-sm text-text-placeholder",
|
|
63
|
-
stroke: 1.5
|
|
64
|
-
}
|
|
65
|
-
) }),
|
|
66
|
-
/* @__PURE__ */ r("div", { className: "text-center", children: [
|
|
67
|
-
/* @__PURE__ */ e(
|
|
68
|
-
"button",
|
|
69
|
-
{
|
|
70
|
-
type: "button",
|
|
71
|
-
onClick: () => {
|
|
72
|
-
var t;
|
|
73
|
-
return (t = o.current) == null ? void 0 : t.click();
|
|
74
|
-
},
|
|
75
|
-
disabled: m,
|
|
76
|
-
className: "text-ds-md font-medium text-interactive transition-colors hover:underline disabled:opacity-[0.38]",
|
|
77
|
-
children: m ? "Uploading..." : "Click to upload"
|
|
78
|
-
}
|
|
79
|
-
),
|
|
80
|
-
/* @__PURE__ */ r("span", { className: "text-ds-md text-text-placeholder", children: [
|
|
81
|
-
" ",
|
|
82
|
-
"or drag and drop"
|
|
83
|
-
] })
|
|
84
|
-
] })
|
|
85
|
-
] }),
|
|
86
|
-
/* @__PURE__ */ e(
|
|
87
|
-
"input",
|
|
88
|
-
{
|
|
89
|
-
ref: o,
|
|
90
|
-
type: "file",
|
|
91
|
-
onChange: D,
|
|
92
|
-
className: "hidden"
|
|
93
|
-
}
|
|
94
|
-
)
|
|
95
|
-
]
|
|
96
|
-
}
|
|
97
|
-
),
|
|
98
|
-
s.length > 0 ? /* @__PURE__ */ e("div", { className: "mt-ds-05 space-y-ds-02", children: s.map((t) => {
|
|
99
|
-
const l = _(t.fileType);
|
|
100
|
-
return /* @__PURE__ */ r(
|
|
101
|
-
"div",
|
|
102
|
-
{
|
|
103
|
-
className: "group flex items-center gap-ds-04 rounded-ds-lg px-ds-03 py-ds-03 transition-colors hover:bg-field",
|
|
104
|
-
children: [
|
|
105
|
-
/* @__PURE__ */ e("div", { className: "flex h-ds-sm w-ds-sm shrink-0 items-center justify-center rounded-ds-lg bg-layer-02", children: /* @__PURE__ */ e(
|
|
106
|
-
l,
|
|
107
|
-
{
|
|
108
|
-
className: "h-ico-sm w-ico-sm text-text-tertiary",
|
|
109
|
-
stroke: 1.5
|
|
110
|
-
}
|
|
111
|
-
) }),
|
|
112
|
-
/* @__PURE__ */ r("div", { className: "flex-1 min-w-0", children: [
|
|
113
|
-
/* @__PURE__ */ e("p", { className: "truncate text-ds-md font-medium text-text-primary", children: t.title }),
|
|
114
|
-
/* @__PURE__ */ r("p", { className: "text-ds-sm text-text-placeholder", children: [
|
|
115
|
-
q(t.createdAt),
|
|
116
|
-
/* @__PURE__ */ e("span", { className: "mx-ds-02b", children: "by" }),
|
|
117
|
-
t.uploadedBy.name
|
|
118
|
-
] })
|
|
119
|
-
] }),
|
|
120
|
-
/* @__PURE__ */ r("div", { className: "flex items-center gap-ds-02 opacity-0 transition-opacity group-hover:opacity-100", children: [
|
|
121
|
-
t.downloadUrl && /* @__PURE__ */ e(
|
|
122
|
-
"a",
|
|
123
|
-
{
|
|
124
|
-
href: /^https?:\/\//.test(t.downloadUrl) ? t.downloadUrl : "#",
|
|
125
|
-
target: "_blank",
|
|
126
|
-
rel: "noopener noreferrer",
|
|
127
|
-
className: "inline-flex h-ds-xs-plus w-ds-xs-plus items-center justify-center rounded-ds-md transition-colors hover:bg-layer-02",
|
|
128
|
-
title: "Download",
|
|
129
|
-
children: /* @__PURE__ */ e(U, { className: "h-ico-sm w-ico-sm text-text-tertiary" })
|
|
130
|
-
}
|
|
131
|
-
),
|
|
132
|
-
!p && /* @__PURE__ */ r(I, { children: [
|
|
133
|
-
/* @__PURE__ */ e(C, { asChild: !0, children: /* @__PURE__ */ e(
|
|
134
|
-
"button",
|
|
135
|
-
{
|
|
136
|
-
type: "button",
|
|
137
|
-
className: "inline-flex h-ds-xs-plus w-ds-xs-plus items-center justify-center rounded-ds-md transition-colors hover:bg-error-surface",
|
|
138
|
-
title: "Delete",
|
|
139
|
-
children: /* @__PURE__ */ e(O, { className: "h-ico-sm w-ico-sm text-text-error" })
|
|
140
|
-
}
|
|
141
|
-
) }),
|
|
142
|
-
/* @__PURE__ */ r(j, { children: [
|
|
143
|
-
/* @__PURE__ */ r(T, { children: [
|
|
144
|
-
/* @__PURE__ */ e(k, { children: "Delete file?" }),
|
|
145
|
-
/* @__PURE__ */ r(z, { children: [
|
|
146
|
-
'"',
|
|
147
|
-
t.title,
|
|
148
|
-
'" will be permanently deleted. This cannot be undone.'
|
|
149
|
-
] })
|
|
150
|
-
] }),
|
|
151
|
-
/* @__PURE__ */ r(L, { children: [
|
|
152
|
-
/* @__PURE__ */ e(u, { asChild: !0, children: /* @__PURE__ */ e(f, { variant: "outline", size: "sm", children: "Cancel" }) }),
|
|
153
|
-
/* @__PURE__ */ e(u, { asChild: !0, children: /* @__PURE__ */ e(
|
|
154
|
-
f,
|
|
155
|
-
{
|
|
156
|
-
variant: "solid",
|
|
157
|
-
color: "error",
|
|
158
|
-
size: "sm",
|
|
159
|
-
onClick: () => g(t.id),
|
|
160
|
-
children: "Delete"
|
|
161
|
-
}
|
|
162
|
-
) })
|
|
163
|
-
] })
|
|
164
|
-
] })
|
|
165
|
-
] })
|
|
166
|
-
] })
|
|
167
|
-
]
|
|
168
|
-
},
|
|
169
|
-
t.id
|
|
170
|
-
);
|
|
171
|
-
}) }) : /* @__PURE__ */ e("div", { className: "mt-ds-03", children: /* @__PURE__ */ e(
|
|
172
|
-
R,
|
|
173
|
-
{
|
|
174
|
-
icon: /* @__PURE__ */ e(B, {}),
|
|
175
|
-
title: "No files attached",
|
|
176
|
-
description: "Upload files to share with your team",
|
|
177
|
-
compact: !0
|
|
178
|
-
}
|
|
179
|
-
) })
|
|
180
|
-
] });
|
|
181
|
-
}
|
|
182
|
-
);
|
|
183
|
-
G.displayName = "FilesTab";
|
|
184
|
-
export {
|
|
185
|
-
G as FilesTab
|
|
186
|
-
};
|
package/dist/tasks/review-tab.js
DELETED
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsxs as a, jsx as t } from "react/jsx-runtime";
|
|
3
|
-
import * as d from "react";
|
|
4
|
-
import { cn as p } from "@devalok/shilp-sutra/ui/lib/utils";
|
|
5
|
-
import { Avatar as R, AvatarImage as v, AvatarFallback as k } from "@devalok/shilp-sutra/ui/avatar";
|
|
6
|
-
import { Badge as I } from "@devalok/shilp-sutra/ui/badge";
|
|
7
|
-
import { EmptyState as S } from "@devalok/shilp-sutra/composed/empty-state";
|
|
8
|
-
import { MemberPicker as A } from "@devalok/shilp-sutra/composed/member-picker";
|
|
9
|
-
import { IconCheck as C, IconMessage as P, IconX as D, IconGitPullRequest as T, IconPlus as M } from "@tabler/icons-react";
|
|
10
|
-
import { getInitials as q } from "@devalok/shilp-sutra/composed/lib/string-utils";
|
|
11
|
-
import { REVIEW_STATUS_MAP as O } from "./task-constants.js";
|
|
12
|
-
function _(l) {
|
|
13
|
-
return new Date(l).toLocaleDateString("en-IN", {
|
|
14
|
-
month: "short",
|
|
15
|
-
day: "numeric",
|
|
16
|
-
hour: "numeric",
|
|
17
|
-
minute: "2-digit"
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
const G = [
|
|
21
|
-
{ status: "APPROVED", label: "Approve", icon: C },
|
|
22
|
-
{ status: "CHANGES_REQUESTED", label: "Request Changes", icon: P },
|
|
23
|
-
{ status: "REJECTED", label: "Reject", icon: D }
|
|
24
|
-
], j = d.forwardRef(
|
|
25
|
-
function({
|
|
26
|
-
reviews: i,
|
|
27
|
-
members: m,
|
|
28
|
-
onRequestReview: b,
|
|
29
|
-
onUpdateStatus: h,
|
|
30
|
-
className: f
|
|
31
|
-
}, N) {
|
|
32
|
-
const [u, x] = d.useState({}), [g, n] = d.useState(null), y = d.useMemo(
|
|
33
|
-
() => m.map((e) => ({ id: e.id, name: e.name, avatar: e.image ?? void 0 })),
|
|
34
|
-
[m]
|
|
35
|
-
), E = (e, r) => {
|
|
36
|
-
h(e, r, u[e]), x((o) => {
|
|
37
|
-
const s = { ...o };
|
|
38
|
-
return delete s[e], s;
|
|
39
|
-
}), n(null);
|
|
40
|
-
};
|
|
41
|
-
return /* @__PURE__ */ a("div", { ref: N, className: p("flex flex-col", f), children: [
|
|
42
|
-
i.length > 0 ? /* @__PURE__ */ t("div", { className: "space-y-ds-04", children: i.map((e) => {
|
|
43
|
-
const r = O[e.status], o = g === e.id;
|
|
44
|
-
return /* @__PURE__ */ a(
|
|
45
|
-
"div",
|
|
46
|
-
{
|
|
47
|
-
className: "rounded-ds-lg border border-border bg-layer-01 shadow-01 p-ds-04",
|
|
48
|
-
children: [
|
|
49
|
-
/* @__PURE__ */ a("div", { className: "flex items-center gap-ds-03", children: [
|
|
50
|
-
/* @__PURE__ */ a(R, { className: "h-ds-xs w-ds-xs shrink-0", children: [
|
|
51
|
-
e.reviewer.image && /* @__PURE__ */ t(
|
|
52
|
-
v,
|
|
53
|
-
{
|
|
54
|
-
src: e.reviewer.image,
|
|
55
|
-
alt: e.reviewer.name
|
|
56
|
-
}
|
|
57
|
-
),
|
|
58
|
-
/* @__PURE__ */ t(k, { className: "bg-layer-03 text-ds-xs font-semibold text-text-on-color", children: q(e.reviewer.name) })
|
|
59
|
-
] }),
|
|
60
|
-
/* @__PURE__ */ a("div", { className: "flex-1 min-w-0", children: [
|
|
61
|
-
/* @__PURE__ */ t("span", { className: "text-ds-md font-medium text-text-primary", children: e.reviewer.name }),
|
|
62
|
-
/* @__PURE__ */ a("span", { className: "ml-ds-03 text-ds-sm text-text-placeholder", children: [
|
|
63
|
-
"requested by ",
|
|
64
|
-
e.requestedBy.name
|
|
65
|
-
] })
|
|
66
|
-
] }),
|
|
67
|
-
/* @__PURE__ */ t(
|
|
68
|
-
I,
|
|
69
|
-
{
|
|
70
|
-
color: r.color,
|
|
71
|
-
children: r.label
|
|
72
|
-
}
|
|
73
|
-
)
|
|
74
|
-
] }),
|
|
75
|
-
e.feedback && /* @__PURE__ */ t("div", { className: "mt-ds-03 rounded-ds-md bg-layer-02 px-ds-04 py-ds-03", children: /* @__PURE__ */ t("p", { className: "text-ds-sm text-text-secondary", children: e.feedback }) }),
|
|
76
|
-
e.status === "PENDING" && /* @__PURE__ */ t("div", { className: "mt-ds-03", children: o ? /* @__PURE__ */ a("div", { className: "space-y-ds-03", children: [
|
|
77
|
-
/* @__PURE__ */ t(
|
|
78
|
-
"textarea",
|
|
79
|
-
{
|
|
80
|
-
value: u[e.id] || "",
|
|
81
|
-
onChange: (s) => x((c) => ({
|
|
82
|
-
...c,
|
|
83
|
-
[e.id]: s.target.value
|
|
84
|
-
})),
|
|
85
|
-
placeholder: "Add feedback (optional)...",
|
|
86
|
-
rows: 2,
|
|
87
|
-
className: "w-full resize-none rounded-ds-md border border-border bg-transparent px-ds-03 py-ds-03 text-ds-sm text-text-primary placeholder:text-text-placeholder outline-none focus:border-border-subtle"
|
|
88
|
-
}
|
|
89
|
-
),
|
|
90
|
-
/* @__PURE__ */ a("div", { className: "flex items-center gap-ds-02b", children: [
|
|
91
|
-
G.map((s) => {
|
|
92
|
-
const c = s.icon;
|
|
93
|
-
return /* @__PURE__ */ a(
|
|
94
|
-
"button",
|
|
95
|
-
{
|
|
96
|
-
type: "button",
|
|
97
|
-
onClick: () => E(e.id, s.status),
|
|
98
|
-
className: p(
|
|
99
|
-
"inline-flex items-center gap-ds-02 rounded-ds-md px-ds-03 py-ds-02 text-ds-sm font-semibold transition-colors",
|
|
100
|
-
s.status === "APPROVED" && "bg-success-surface text-text-success hover:opacity-[0.9]",
|
|
101
|
-
s.status === "CHANGES_REQUESTED" && "bg-warning-surface text-text-warning hover:opacity-[0.9]",
|
|
102
|
-
s.status === "REJECTED" && "bg-error-surface text-text-error hover:opacity-[0.9]"
|
|
103
|
-
),
|
|
104
|
-
children: [
|
|
105
|
-
/* @__PURE__ */ t(c, { className: "h-3 w-3", stroke: 2 }),
|
|
106
|
-
s.label
|
|
107
|
-
]
|
|
108
|
-
},
|
|
109
|
-
s.status
|
|
110
|
-
);
|
|
111
|
-
}),
|
|
112
|
-
/* @__PURE__ */ t(
|
|
113
|
-
"button",
|
|
114
|
-
{
|
|
115
|
-
type: "button",
|
|
116
|
-
onClick: () => n(null),
|
|
117
|
-
className: "ml-auto text-ds-sm text-text-placeholder hover:text-text-secondary",
|
|
118
|
-
children: "Cancel"
|
|
119
|
-
}
|
|
120
|
-
)
|
|
121
|
-
] })
|
|
122
|
-
] }) : /* @__PURE__ */ t(
|
|
123
|
-
"button",
|
|
124
|
-
{
|
|
125
|
-
type: "button",
|
|
126
|
-
onClick: () => n(e.id),
|
|
127
|
-
className: "text-ds-sm font-medium text-interactive transition-colors hover:underline",
|
|
128
|
-
children: "Respond"
|
|
129
|
-
}
|
|
130
|
-
) }),
|
|
131
|
-
/* @__PURE__ */ t("p", { className: "mt-ds-03 text-ds-xs text-text-placeholder", children: _(e.createdAt) })
|
|
132
|
-
]
|
|
133
|
-
},
|
|
134
|
-
e.id
|
|
135
|
-
);
|
|
136
|
-
}) }) : /* @__PURE__ */ t(
|
|
137
|
-
S,
|
|
138
|
-
{
|
|
139
|
-
icon: /* @__PURE__ */ t(T, {}),
|
|
140
|
-
title: "No reviews yet",
|
|
141
|
-
description: "Request a review from a team member",
|
|
142
|
-
compact: !0
|
|
143
|
-
}
|
|
144
|
-
),
|
|
145
|
-
/* @__PURE__ */ t(
|
|
146
|
-
A,
|
|
147
|
-
{
|
|
148
|
-
members: y,
|
|
149
|
-
selectedIds: [],
|
|
150
|
-
onSelect: (e) => b(e),
|
|
151
|
-
children: /* @__PURE__ */ a(
|
|
152
|
-
"button",
|
|
153
|
-
{
|
|
154
|
-
type: "button",
|
|
155
|
-
className: "mt-ds-04 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",
|
|
156
|
-
children: [
|
|
157
|
-
/* @__PURE__ */ t(M, { className: "h-ico-sm w-ico-sm", stroke: 1.5 }),
|
|
158
|
-
"Request Review"
|
|
159
|
-
]
|
|
160
|
-
}
|
|
161
|
-
)
|
|
162
|
-
}
|
|
163
|
-
)
|
|
164
|
-
] });
|
|
165
|
-
}
|
|
166
|
-
);
|
|
167
|
-
j.displayName = "ReviewTab";
|
|
168
|
-
export {
|
|
169
|
-
j as ReviewTab
|
|
170
|
-
};
|
|
@@ -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
|
-
};
|