@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.
- 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 +9 -4
- 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
|
@@ -0,0 +1,376 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as e, jsxs as t, Fragment as $ } from "react/jsx-runtime";
|
|
3
|
+
import * as y from "react";
|
|
4
|
+
import { useRef as M, useEffect as F, useState as D, useCallback as C } from "react";
|
|
5
|
+
import { Sheet as G, SheetContent as V, SheetTitle as _ } from "@devalok/shilp-sutra/ui/sheet";
|
|
6
|
+
import { u as q } from "./use-composed-ref.js";
|
|
7
|
+
import { M as T } from "./vendor.js";
|
|
8
|
+
import { IconRobot as g, IconAlertCircle as J, IconUser as X, IconSquare as Y, IconSend as Q, IconMessagePlus as R, IconMessage as S, IconArchive as W, IconTrash as Z, IconChevronDown as O, IconHistory as ee, IconX as se } from "@tabler/icons-react";
|
|
9
|
+
import { Button as I } from "@devalok/shilp-sutra/ui/button";
|
|
10
|
+
import { cn as L } from "@devalok/shilp-sutra/ui/lib/utils";
|
|
11
|
+
import { DropdownMenu as te, DropdownMenuTrigger as ae, DropdownMenuContent as re, DropdownMenuItem as le } from "@devalok/shilp-sutra/ui";
|
|
12
|
+
const H = {
|
|
13
|
+
p: ({ children: s }) => /* @__PURE__ */ e("p", { className: "mb-ds-03 last:mb-0", children: s }),
|
|
14
|
+
code: ({
|
|
15
|
+
children: s,
|
|
16
|
+
className: a
|
|
17
|
+
}) => (a == null ? void 0 : a.includes("language-")) ? /* @__PURE__ */ e("code", { className: a, children: s }) : /* @__PURE__ */ e("code", { className: "rounded bg-field px-ds-02 py-ds-01 text-ds-md", children: s }),
|
|
18
|
+
pre: ({ children: s }) => /* @__PURE__ */ e("pre", { className: "mb-ds-03 overflow-x-auto rounded-ds-lg bg-field p-ds-04 text-ds-md", children: s }),
|
|
19
|
+
ul: ({ children: s }) => /* @__PURE__ */ e("ul", { className: "mb-ds-03 list-disc pl-ds-05", children: s }),
|
|
20
|
+
ol: ({ children: s }) => /* @__PURE__ */ e("ol", { className: "mb-ds-03 list-decimal pl-ds-05", children: s }),
|
|
21
|
+
li: ({ children: s }) => /* @__PURE__ */ e("li", { className: "mb-ds-02", children: s }),
|
|
22
|
+
strong: ({ children: s }) => /* @__PURE__ */ e("strong", { className: "font-semibold", children: s }),
|
|
23
|
+
a: ({
|
|
24
|
+
href: s,
|
|
25
|
+
children: a,
|
|
26
|
+
...d
|
|
27
|
+
}) => {
|
|
28
|
+
const l = s && /^(https?:\/\/|mailto:)/i.test(s) ? s : "#";
|
|
29
|
+
return /* @__PURE__ */ e(
|
|
30
|
+
"a",
|
|
31
|
+
{
|
|
32
|
+
href: l,
|
|
33
|
+
target: "_blank",
|
|
34
|
+
rel: "noopener noreferrer",
|
|
35
|
+
className: "text-interactive underline hover:text-interactive-hover",
|
|
36
|
+
...d,
|
|
37
|
+
children: a
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
}, P = y.forwardRef(
|
|
42
|
+
function({ text: a }, d) {
|
|
43
|
+
return /* @__PURE__ */ t("div", { ref: d, "aria-live": "polite", children: [
|
|
44
|
+
/* @__PURE__ */ e(T, { components: H, children: a }),
|
|
45
|
+
/* @__PURE__ */ e("span", { className: "inline-block h-4 w-2 animate-pulse bg-text-secondary ml-ds-01" })
|
|
46
|
+
] });
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
P.displayName = "StreamingText";
|
|
50
|
+
const A = y.forwardRef(
|
|
51
|
+
function({
|
|
52
|
+
messages: a,
|
|
53
|
+
isStreaming: d = !1,
|
|
54
|
+
streamingText: l = "",
|
|
55
|
+
isLoadingMessages: m = !1,
|
|
56
|
+
emptyTitle: c = "Karm AI",
|
|
57
|
+
emptyDescription: x = "Ask me about tasks, projects, attendance, or anything else."
|
|
58
|
+
}, o) {
|
|
59
|
+
const h = M(null), i = q(h, o);
|
|
60
|
+
return F(() => {
|
|
61
|
+
const r = h.current;
|
|
62
|
+
r && (r.scrollTop = r.scrollHeight);
|
|
63
|
+
}, [a, l]), m ? /* @__PURE__ */ e("div", { ref: o, className: "flex flex-1 items-center justify-center", children: /* @__PURE__ */ t("div", { className: "flex flex-col items-center gap-ds-03", children: [
|
|
64
|
+
/* @__PURE__ */ e("div", { className: "h-ds-xs w-ds-xs animate-spin rounded-ds-full border-2 border-text-secondary border-t-transparent" }),
|
|
65
|
+
/* @__PURE__ */ e("p", { className: "text-ds-sm text-text-placeholder", children: "Loading messages..." })
|
|
66
|
+
] }) }) : a.length === 0 && !d ? /* @__PURE__ */ e("div", { ref: o, className: "flex flex-1 items-center justify-center p-ds-06", children: /* @__PURE__ */ t("div", { className: "flex flex-col items-center gap-ds-04 text-center", children: [
|
|
67
|
+
/* @__PURE__ */ e("div", { className: "flex h-ds-lg w-ds-lg items-center justify-center rounded-ds-full bg-field", children: /* @__PURE__ */ e(g, { className: "h-ico-lg w-ico-lg text-text-secondary" }) }),
|
|
68
|
+
/* @__PURE__ */ e("h3", { className: "text-ds-base text-text-primary", children: c }),
|
|
69
|
+
/* @__PURE__ */ e("p", { className: "text-ds-sm max-w-[280px] text-text-placeholder", children: x })
|
|
70
|
+
] }) }) : /* @__PURE__ */ e("div", { ref: i, className: "no-scrollbar flex-1 overflow-y-auto p-ds-05", children: /* @__PURE__ */ t("div", { className: "flex flex-col gap-ds-05", role: "log", "aria-label": "Chat messages", children: [
|
|
71
|
+
a.map((r) => r.role === "SYSTEM" ? /* @__PURE__ */ e("div", { className: "flex justify-center", children: /* @__PURE__ */ t("div", { className: "flex items-center gap-ds-03 rounded-ds-lg bg-error-surface px-ds-04 py-ds-03", children: [
|
|
72
|
+
/* @__PURE__ */ e(J, { className: "h-ico-sm w-ico-sm shrink-0 text-text-error" }),
|
|
73
|
+
/* @__PURE__ */ e("p", { className: "text-ds-sm text-text-error", children: r.content })
|
|
74
|
+
] }) }, r.id) : r.role === "USER" ? /* @__PURE__ */ e("div", { className: "flex justify-end", children: /* @__PURE__ */ t("div", { className: "flex max-w-[85%] items-start gap-ds-03", children: [
|
|
75
|
+
/* @__PURE__ */ e("div", { className: "rounded-ds-2xl rounded-br-ds-sm bg-interactive px-ds-04 py-ds-03 text-text-on-color", children: /* @__PURE__ */ e("p", { className: "text-ds-md whitespace-pre-wrap", children: r.content }) }),
|
|
76
|
+
/* @__PURE__ */ e("div", { className: "flex h-ds-xs-plus w-ds-xs-plus shrink-0 items-center justify-center rounded-ds-full bg-field", children: /* @__PURE__ */ e(X, { className: "h-ico-sm w-ico-sm text-text-secondary" }) })
|
|
77
|
+
] }) }, r.id) : /* @__PURE__ */ e("div", { className: "flex justify-start", children: /* @__PURE__ */ t("div", { className: "flex max-w-[85%] items-start gap-ds-03", children: [
|
|
78
|
+
/* @__PURE__ */ e("div", { className: "flex h-ds-xs-plus w-ds-xs-plus shrink-0 items-center justify-center rounded-ds-full bg-field", children: /* @__PURE__ */ e(g, { className: "h-ico-sm w-ico-sm text-text-secondary" }) }),
|
|
79
|
+
/* @__PURE__ */ e("div", { className: "rounded-ds-2xl rounded-bl-ds-sm bg-field px-ds-04 py-ds-03", children: /* @__PURE__ */ e("div", { className: "text-ds-md text-text-primary", children: /* @__PURE__ */ e(T, { components: H, children: r.content }) }) })
|
|
80
|
+
] }) }, r.id)),
|
|
81
|
+
d && l && /* @__PURE__ */ e("div", { className: "flex justify-start", children: /* @__PURE__ */ t("div", { className: "flex max-w-[85%] items-start gap-ds-03", children: [
|
|
82
|
+
/* @__PURE__ */ e("div", { className: "flex h-ds-xs-plus w-ds-xs-plus shrink-0 items-center justify-center rounded-ds-full bg-field", children: /* @__PURE__ */ e(g, { className: "h-ico-sm w-ico-sm text-text-secondary" }) }),
|
|
83
|
+
/* @__PURE__ */ e("div", { className: "rounded-ds-2xl rounded-bl-ds-sm bg-field px-ds-04 py-ds-03", children: /* @__PURE__ */ e("div", { className: "text-ds-md text-text-primary", children: /* @__PURE__ */ e(P, { text: l }) }) })
|
|
84
|
+
] }) }),
|
|
85
|
+
d && !l && /* @__PURE__ */ e("div", { className: "flex justify-start", children: /* @__PURE__ */ t("div", { className: "flex max-w-[85%] items-start gap-ds-03", children: [
|
|
86
|
+
/* @__PURE__ */ e("div", { className: "flex h-ds-xs-plus w-ds-xs-plus shrink-0 items-center justify-center rounded-ds-full bg-field", children: /* @__PURE__ */ e(g, { className: "h-ico-sm w-ico-sm text-text-secondary" }) }),
|
|
87
|
+
/* @__PURE__ */ e("div", { className: "rounded-ds-2xl rounded-bl-ds-sm bg-field px-ds-04 py-ds-03", children: /* @__PURE__ */ t("div", { className: "flex items-center gap-ds-02b py-ds-02", children: [
|
|
88
|
+
/* @__PURE__ */ e("div", { className: "h-2 w-2 animate-bounce rounded-ds-full bg-text-placeholder [animation-delay:0ms]" }),
|
|
89
|
+
/* @__PURE__ */ e("div", { className: "h-2 w-2 animate-bounce rounded-ds-full bg-text-placeholder [animation-delay:150ms]" }),
|
|
90
|
+
/* @__PURE__ */ e("div", { className: "h-2 w-2 animate-bounce rounded-ds-full bg-text-placeholder [animation-delay:300ms]" })
|
|
91
|
+
] }) })
|
|
92
|
+
] }) })
|
|
93
|
+
] }) });
|
|
94
|
+
}
|
|
95
|
+
);
|
|
96
|
+
A.displayName = "MessageList";
|
|
97
|
+
const E = y.forwardRef(
|
|
98
|
+
function({
|
|
99
|
+
onSubmit: a,
|
|
100
|
+
onCancel: d,
|
|
101
|
+
isStreaming: l = !1,
|
|
102
|
+
placeholder: m = "Ask Karm AI...",
|
|
103
|
+
disclaimer: c = "AI responses may be inaccurate. Verify important information."
|
|
104
|
+
}, x) {
|
|
105
|
+
const [o, h] = D(""), i = M(null), r = C(() => {
|
|
106
|
+
const n = i.current;
|
|
107
|
+
n && (n.style.height = "auto", n.style.height = Math.min(n.scrollHeight, 160) + "px");
|
|
108
|
+
}, []), b = C(() => {
|
|
109
|
+
const n = o.trim();
|
|
110
|
+
!n || l || (h(""), i.current && (i.current.style.height = "auto"), a(n));
|
|
111
|
+
}, [o, l, a]), v = C(
|
|
112
|
+
(n) => {
|
|
113
|
+
n.key === "Enter" && !n.shiftKey && (n.preventDefault(), b());
|
|
114
|
+
},
|
|
115
|
+
[b]
|
|
116
|
+
);
|
|
117
|
+
return /* @__PURE__ */ t("div", { ref: x, className: "border-t border-border bg-layer-01 p-ds-04", children: [
|
|
118
|
+
/* @__PURE__ */ t("div", { className: "flex items-end gap-ds-03 rounded-ds-xl border border-border bg-field px-ds-04 py-ds-03", children: [
|
|
119
|
+
/* @__PURE__ */ e(
|
|
120
|
+
"textarea",
|
|
121
|
+
{
|
|
122
|
+
ref: i,
|
|
123
|
+
value: o,
|
|
124
|
+
onChange: (n) => {
|
|
125
|
+
h(n.target.value), r();
|
|
126
|
+
},
|
|
127
|
+
onKeyDown: v,
|
|
128
|
+
placeholder: m,
|
|
129
|
+
"aria-label": "Type a message",
|
|
130
|
+
disabled: l,
|
|
131
|
+
rows: 1,
|
|
132
|
+
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]"
|
|
133
|
+
}
|
|
134
|
+
),
|
|
135
|
+
l ? /* @__PURE__ */ e(I, { variant: "solid", color: "error", size: "icon-sm", className: "h-ds-sm w-ds-sm shrink-0 rounded-ds-lg", onClick: d, "aria-label": "Stop generating", children: /* @__PURE__ */ e(Y, { className: "h-ico-sm w-ico-sm" }) }) : /* @__PURE__ */ e(I, { size: "icon-sm", className: "h-ds-sm w-ds-sm shrink-0 rounded-ds-lg", onClick: b, disabled: !o.trim(), "aria-label": "Send message", children: /* @__PURE__ */ e(Q, { className: "h-ico-sm w-ico-sm" }) })
|
|
136
|
+
] }),
|
|
137
|
+
c && /* @__PURE__ */ e("p", { className: "text-ds-sm mt-ds-02b text-center text-text-placeholder", children: c })
|
|
138
|
+
] });
|
|
139
|
+
}
|
|
140
|
+
);
|
|
141
|
+
E.displayName = "ChatInput";
|
|
142
|
+
function de(s) {
|
|
143
|
+
const a = new Date(s), l = (/* @__PURE__ */ new Date()).getTime() - a.getTime(), m = Math.floor(l / 6e4);
|
|
144
|
+
if (m < 1) return "Just now";
|
|
145
|
+
if (m < 60) return `${m}m ago`;
|
|
146
|
+
const c = Math.floor(m / 60);
|
|
147
|
+
if (c < 24) return `${c}h ago`;
|
|
148
|
+
const x = Math.floor(c / 24);
|
|
149
|
+
return x < 7 ? `${x}d ago` : a.toLocaleDateString("en-IN", {
|
|
150
|
+
day: "numeric",
|
|
151
|
+
month: "short"
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
const K = y.forwardRef(
|
|
155
|
+
function({
|
|
156
|
+
conversations: a,
|
|
157
|
+
activeConversationId: d,
|
|
158
|
+
isLoading: l = !1,
|
|
159
|
+
onSelect: m,
|
|
160
|
+
onNewChat: c,
|
|
161
|
+
onArchive: x,
|
|
162
|
+
onDelete: o
|
|
163
|
+
}, h) {
|
|
164
|
+
return /* @__PURE__ */ t("div", { ref: h, className: "flex flex-1 flex-col overflow-hidden", children: [
|
|
165
|
+
/* @__PURE__ */ t("div", { className: "flex items-center justify-between border-b border-border px-ds-05 py-ds-04", children: [
|
|
166
|
+
/* @__PURE__ */ e("h3", { className: "text-ds-md font-semibold text-text-primary", children: "Conversations" }),
|
|
167
|
+
/* @__PURE__ */ t(
|
|
168
|
+
"button",
|
|
169
|
+
{
|
|
170
|
+
onClick: c,
|
|
171
|
+
className: "flex items-center gap-ds-02b rounded-ds-lg px-ds-03 py-ds-02b text-text-secondary transition-colors hover:bg-layer-02",
|
|
172
|
+
children: [
|
|
173
|
+
/* @__PURE__ */ e(R, { className: "h-ico-sm w-ico-sm" }),
|
|
174
|
+
/* @__PURE__ */ e("span", { className: "text-ds-sm", children: "New Chat" })
|
|
175
|
+
]
|
|
176
|
+
}
|
|
177
|
+
)
|
|
178
|
+
] }),
|
|
179
|
+
/* @__PURE__ */ e("div", { className: "no-scrollbar flex-1 overflow-y-auto", children: l ? /* @__PURE__ */ e("div", { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ e("div", { className: "h-ico-md w-ico-md animate-spin rounded-ds-full border-2 border-text-secondary border-t-transparent" }) }) : a.length === 0 ? /* @__PURE__ */ t("div", { className: "flex flex-col items-center justify-center gap-ds-03 py-12", children: [
|
|
180
|
+
/* @__PURE__ */ e(S, { className: "h-ds-sm w-ds-sm text-text-placeholder" }),
|
|
181
|
+
/* @__PURE__ */ e("p", { className: "text-ds-md text-text-placeholder", children: "No conversations yet" })
|
|
182
|
+
] }) : /* @__PURE__ */ e("div", { className: "flex flex-col", children: a.map((i) => /* @__PURE__ */ t(
|
|
183
|
+
"div",
|
|
184
|
+
{
|
|
185
|
+
className: L(
|
|
186
|
+
"group flex items-center gap-ds-04 border-b border-border-subtle px-ds-05 py-ds-04 transition-colors hover:bg-layer-02",
|
|
187
|
+
d === i.id && "bg-layer-02"
|
|
188
|
+
),
|
|
189
|
+
children: [
|
|
190
|
+
/* @__PURE__ */ t(
|
|
191
|
+
"button",
|
|
192
|
+
{
|
|
193
|
+
onClick: () => m(i.id),
|
|
194
|
+
className: "flex min-w-0 flex-1 flex-col gap-ds-01 text-left",
|
|
195
|
+
children: [
|
|
196
|
+
/* @__PURE__ */ e("p", { className: "text-ds-md truncate text-text-primary", children: i.title || "Untitled conversation" }),
|
|
197
|
+
/* @__PURE__ */ e("p", { className: "text-ds-sm text-text-placeholder", children: de(i.updatedAt) })
|
|
198
|
+
]
|
|
199
|
+
}
|
|
200
|
+
),
|
|
201
|
+
/* @__PURE__ */ t("div", { className: "flex shrink-0 items-center gap-ds-02 opacity-0 transition-opacity group-hover:opacity-100", children: [
|
|
202
|
+
x && /* @__PURE__ */ e(
|
|
203
|
+
"button",
|
|
204
|
+
{
|
|
205
|
+
onClick: (r) => {
|
|
206
|
+
r.stopPropagation(), x(i.id);
|
|
207
|
+
},
|
|
208
|
+
className: "flex h-ds-xs-plus w-ds-xs-plus items-center justify-center rounded-ds-md text-text-placeholder transition-colors hover:bg-field hover:text-text-secondary",
|
|
209
|
+
"aria-label": "Archive conversation",
|
|
210
|
+
children: /* @__PURE__ */ e(W, { className: "h-ico-sm w-ico-sm" })
|
|
211
|
+
}
|
|
212
|
+
),
|
|
213
|
+
o && /* @__PURE__ */ e(
|
|
214
|
+
"button",
|
|
215
|
+
{
|
|
216
|
+
onClick: (r) => {
|
|
217
|
+
r.stopPropagation(), o(i.id);
|
|
218
|
+
},
|
|
219
|
+
className: "flex h-ds-xs-plus w-ds-xs-plus items-center justify-center rounded-ds-md text-text-placeholder transition-colors hover:bg-error-surface hover:text-text-error",
|
|
220
|
+
"aria-label": "Delete conversation",
|
|
221
|
+
children: /* @__PURE__ */ e(Z, { className: "h-ico-sm w-ico-sm" })
|
|
222
|
+
}
|
|
223
|
+
)
|
|
224
|
+
] })
|
|
225
|
+
]
|
|
226
|
+
},
|
|
227
|
+
i.id
|
|
228
|
+
)) }) })
|
|
229
|
+
] });
|
|
230
|
+
}
|
|
231
|
+
);
|
|
232
|
+
K.displayName = "ConversationList";
|
|
233
|
+
const ie = [
|
|
234
|
+
{ id: "devadoot", name: "Devadoot", desc: "General Assistant" },
|
|
235
|
+
{ id: "prahari", name: "Prahari", desc: "Attendance & Time" },
|
|
236
|
+
{ id: "sutradhar", name: "Sutradhar", desc: "Tasks & Projects" },
|
|
237
|
+
{ id: "sahayak", name: "Sahayak", desc: "Team Helper" },
|
|
238
|
+
{ id: "vidwan", name: "Vidwan", desc: "Knowledge Expert" },
|
|
239
|
+
{ id: "sanchalak", name: "Sanchalak", desc: "Manager Advisor" },
|
|
240
|
+
{ id: "dwar-palak", name: "Dwar-Palak", desc: "Access Control" }
|
|
241
|
+
], ne = y.forwardRef(
|
|
242
|
+
function({
|
|
243
|
+
isOpen: a,
|
|
244
|
+
onOpenChange: d,
|
|
245
|
+
messages: l,
|
|
246
|
+
conversations: m,
|
|
247
|
+
agents: c = ie,
|
|
248
|
+
selectedAgentId: x = "devadoot",
|
|
249
|
+
activeConversationId: o,
|
|
250
|
+
isStreaming: h = !1,
|
|
251
|
+
streamingText: i = "",
|
|
252
|
+
isLoadingMessages: r = !1,
|
|
253
|
+
isLoadingConversations: b = !1,
|
|
254
|
+
onSendMessage: v,
|
|
255
|
+
onCancelStream: n,
|
|
256
|
+
onSelectAgent: w,
|
|
257
|
+
onStartNewChat: p,
|
|
258
|
+
onSelectConversation: k,
|
|
259
|
+
onArchiveConversation: U,
|
|
260
|
+
onDeleteConversation: z
|
|
261
|
+
}, B) {
|
|
262
|
+
const [j, N] = D(!1), u = c.find((f) => f.id === x) ?? c[0];
|
|
263
|
+
return /* @__PURE__ */ e(G, { open: a, onOpenChange: d, children: /* @__PURE__ */ t(
|
|
264
|
+
V,
|
|
265
|
+
{
|
|
266
|
+
ref: B,
|
|
267
|
+
side: "right",
|
|
268
|
+
className: "flex w-full flex-col gap-0 border-l border-border bg-layer-01 p-0 sm:max-w-[480px] [&>button]:hidden",
|
|
269
|
+
children: [
|
|
270
|
+
/* @__PURE__ */ e(_, { className: "sr-only", children: "AI Chat" }),
|
|
271
|
+
/* @__PURE__ */ t("div", { className: "flex items-center gap-ds-03 border-b border-border px-ds-05 py-ds-04", children: [
|
|
272
|
+
/* @__PURE__ */ e("div", { className: "flex-1", children: /* @__PURE__ */ t(te, { children: [
|
|
273
|
+
/* @__PURE__ */ e(ae, { asChild: !0, children: /* @__PURE__ */ t(
|
|
274
|
+
"button",
|
|
275
|
+
{
|
|
276
|
+
className: "flex items-center gap-ds-02b rounded-ds-lg px-ds-03 py-ds-02b transition-colors hover:bg-layer-02",
|
|
277
|
+
children: [
|
|
278
|
+
/* @__PURE__ */ e("span", { className: "text-ds-base text-text-primary", children: u == null ? void 0 : u.name }),
|
|
279
|
+
/* @__PURE__ */ e("span", { className: "text-ds-sm text-text-placeholder", children: u == null ? void 0 : u.desc }),
|
|
280
|
+
/* @__PURE__ */ e(O, { className: "h-ico-sm w-ico-sm text-text-placeholder" })
|
|
281
|
+
]
|
|
282
|
+
}
|
|
283
|
+
) }),
|
|
284
|
+
/* @__PURE__ */ e(re, { align: "start", className: "w-64", children: c.map((f) => /* @__PURE__ */ e(
|
|
285
|
+
le,
|
|
286
|
+
{
|
|
287
|
+
onClick: () => w == null ? void 0 : w(f.id),
|
|
288
|
+
className: x === f.id ? "bg-layer-02" : "",
|
|
289
|
+
children: /* @__PURE__ */ t("div", { className: "flex flex-col", children: [
|
|
290
|
+
/* @__PURE__ */ e("span", { className: "text-ds-md text-text-primary", children: f.name }),
|
|
291
|
+
/* @__PURE__ */ e("span", { className: "text-ds-sm text-text-placeholder", children: f.desc })
|
|
292
|
+
] })
|
|
293
|
+
},
|
|
294
|
+
f.id
|
|
295
|
+
)) })
|
|
296
|
+
] }) }),
|
|
297
|
+
/* @__PURE__ */ e(
|
|
298
|
+
"button",
|
|
299
|
+
{
|
|
300
|
+
onClick: () => {
|
|
301
|
+
p == null || p(), N(!1);
|
|
302
|
+
},
|
|
303
|
+
className: "flex h-ds-sm w-ds-sm items-center justify-center rounded-ds-lg text-text-secondary transition-colors hover:bg-layer-02",
|
|
304
|
+
"aria-label": "New chat",
|
|
305
|
+
children: /* @__PURE__ */ e(R, { className: "h-ico-sm w-ico-sm" })
|
|
306
|
+
}
|
|
307
|
+
),
|
|
308
|
+
/* @__PURE__ */ e(
|
|
309
|
+
"button",
|
|
310
|
+
{
|
|
311
|
+
onClick: () => N(!j),
|
|
312
|
+
className: L(
|
|
313
|
+
"flex h-ds-sm w-ds-sm items-center justify-center rounded-ds-lg transition-colors hover:bg-layer-02",
|
|
314
|
+
j ? "bg-layer-02 text-text-primary" : "text-text-secondary"
|
|
315
|
+
),
|
|
316
|
+
"aria-label": "Conversation history",
|
|
317
|
+
children: /* @__PURE__ */ e(ee, { className: "h-ico-sm w-ico-sm" })
|
|
318
|
+
}
|
|
319
|
+
),
|
|
320
|
+
/* @__PURE__ */ e(
|
|
321
|
+
"button",
|
|
322
|
+
{
|
|
323
|
+
onClick: () => d(!1),
|
|
324
|
+
className: "flex h-ds-sm w-ds-sm items-center justify-center rounded-ds-lg text-text-secondary transition-colors hover:bg-layer-02",
|
|
325
|
+
"aria-label": "Close chat",
|
|
326
|
+
children: /* @__PURE__ */ e(se, { className: "h-ico-sm w-ico-sm" })
|
|
327
|
+
}
|
|
328
|
+
)
|
|
329
|
+
] }),
|
|
330
|
+
j ? /* @__PURE__ */ e(
|
|
331
|
+
K,
|
|
332
|
+
{
|
|
333
|
+
conversations: m,
|
|
334
|
+
activeConversationId: o,
|
|
335
|
+
isLoading: b,
|
|
336
|
+
onSelect: (f) => {
|
|
337
|
+
k == null || k(f), N(!1);
|
|
338
|
+
},
|
|
339
|
+
onNewChat: () => {
|
|
340
|
+
p == null || p(), N(!1);
|
|
341
|
+
},
|
|
342
|
+
onArchive: U,
|
|
343
|
+
onDelete: z
|
|
344
|
+
}
|
|
345
|
+
) : /* @__PURE__ */ t($, { children: [
|
|
346
|
+
/* @__PURE__ */ e(
|
|
347
|
+
A,
|
|
348
|
+
{
|
|
349
|
+
messages: l,
|
|
350
|
+
isStreaming: h,
|
|
351
|
+
streamingText: i,
|
|
352
|
+
isLoadingMessages: r
|
|
353
|
+
}
|
|
354
|
+
),
|
|
355
|
+
/* @__PURE__ */ e(
|
|
356
|
+
E,
|
|
357
|
+
{
|
|
358
|
+
onSubmit: v,
|
|
359
|
+
onCancel: n,
|
|
360
|
+
isStreaming: h
|
|
361
|
+
}
|
|
362
|
+
)
|
|
363
|
+
] })
|
|
364
|
+
]
|
|
365
|
+
}
|
|
366
|
+
) });
|
|
367
|
+
}
|
|
368
|
+
);
|
|
369
|
+
ne.displayName = "ChatPanel";
|
|
370
|
+
export {
|
|
371
|
+
E as C,
|
|
372
|
+
A as M,
|
|
373
|
+
P as S,
|
|
374
|
+
ne as a,
|
|
375
|
+
K as b
|
|
376
|
+
};
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as e, jsxs as s } from "react/jsx-runtime";
|
|
3
|
+
import * as y from "react";
|
|
4
|
+
import { useState as w } from "react";
|
|
5
|
+
import { IconCheck as k, IconCoffee as A, IconClock as C, IconArrowRight as D, IconSparkles as I, IconChevronDown as _, IconChevronUp as R } from "@tabler/icons-react";
|
|
6
|
+
import { cn as p } from "@devalok/shilp-sutra/ui/lib/utils";
|
|
7
|
+
import { M as j } from "./vendor.js";
|
|
8
|
+
function M() {
|
|
9
|
+
const l = (/* @__PURE__ */ new Date()).getHours();
|
|
10
|
+
return l < 12 ? "Good morning" : l < 17 ? "Good afternoon" : "Good evening";
|
|
11
|
+
}
|
|
12
|
+
function T() {
|
|
13
|
+
return (/* @__PURE__ */ new Date()).toLocaleDateString("en-IN", {
|
|
14
|
+
weekday: "long",
|
|
15
|
+
day: "numeric",
|
|
16
|
+
month: "long",
|
|
17
|
+
year: "numeric",
|
|
18
|
+
timeZone: "Asia/Kolkata"
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
function B(l) {
|
|
22
|
+
return new Date(l).toLocaleTimeString("en-IN", {
|
|
23
|
+
hour: "2-digit",
|
|
24
|
+
minute: "2-digit",
|
|
25
|
+
hour12: !0,
|
|
26
|
+
timeZone: "Asia/Kolkata"
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
const O = y.forwardRef(
|
|
30
|
+
function({
|
|
31
|
+
userName: a,
|
|
32
|
+
attendance: t,
|
|
33
|
+
canMarkAttendance: o,
|
|
34
|
+
onMarkAttendance: c,
|
|
35
|
+
isSubmitting: d = !1,
|
|
36
|
+
formatTime: h = B
|
|
37
|
+
}, r) {
|
|
38
|
+
var u, g;
|
|
39
|
+
const i = ((u = t == null ? void 0 : t.attendance) == null ? void 0 : u.status) ?? "Not_Marked", N = i === "PRESENT" || d, f = i === "BREAK", b = (g = t == null ? void 0 : t.attendance) == null ? void 0 : g.timeIn, n = M(), m = (a == null ? void 0 : a.split(" ")[0]) || "there", x = T();
|
|
40
|
+
return N && !f ? /* @__PURE__ */ e("div", { ref: r, className: "relative overflow-hidden rounded-ds-2xl border border-border bg-layer-01 shadow-01", children: /* @__PURE__ */ s("div", { className: "flex items-center justify-between px-ds-06 py-ds-05b sm:px-ds-07", children: [
|
|
41
|
+
/* @__PURE__ */ s("div", { className: "flex flex-col gap-ds-02", children: [
|
|
42
|
+
/* @__PURE__ */ s("h2", { className: "text-ds-2xl text-text-primary", children: [
|
|
43
|
+
n,
|
|
44
|
+
",",
|
|
45
|
+
" ",
|
|
46
|
+
/* @__PURE__ */ e("span", { className: "font-semibold italic text-interactive", children: m })
|
|
47
|
+
] }),
|
|
48
|
+
/* @__PURE__ */ e("p", { className: "text-ds-md text-text-tertiary", children: x })
|
|
49
|
+
] }),
|
|
50
|
+
/* @__PURE__ */ s("div", { className: "flex items-center gap-ds-03 rounded-ds-xl bg-success-surface px-ds-05 py-ds-03", children: [
|
|
51
|
+
/* @__PURE__ */ e("div", { className: "flex h-ico-md w-ico-md items-center justify-center rounded-ds-full bg-text-success", children: /* @__PURE__ */ e(k, { className: "h-ico-sm w-ico-sm text-text-on-color" }) }),
|
|
52
|
+
/* @__PURE__ */ s("span", { className: "text-ds-md font-semibold text-text-success", children: [
|
|
53
|
+
"Marked at",
|
|
54
|
+
" ",
|
|
55
|
+
b ? h(b) : "--:--"
|
|
56
|
+
] })
|
|
57
|
+
] })
|
|
58
|
+
] }) }) : f ? /* @__PURE__ */ e("div", { ref: r, className: "relative overflow-hidden rounded-ds-2xl border border-border bg-layer-01 shadow-01", children: /* @__PURE__ */ s("div", { className: "flex items-center justify-between px-ds-06 py-ds-05b sm:px-ds-07", children: [
|
|
59
|
+
/* @__PURE__ */ s("div", { className: "flex flex-col gap-ds-02", children: [
|
|
60
|
+
/* @__PURE__ */ s("h2", { className: "text-ds-2xl text-text-primary", children: [
|
|
61
|
+
n,
|
|
62
|
+
",",
|
|
63
|
+
" ",
|
|
64
|
+
/* @__PURE__ */ e("span", { className: "font-semibold italic text-interactive", children: m })
|
|
65
|
+
] }),
|
|
66
|
+
/* @__PURE__ */ e("p", { className: "text-ds-md text-text-tertiary", children: x })
|
|
67
|
+
] }),
|
|
68
|
+
/* @__PURE__ */ s("div", { className: "flex items-center gap-ds-03 rounded-ds-xl bg-warning-surface px-ds-05 py-ds-03", children: [
|
|
69
|
+
/* @__PURE__ */ e(A, { className: "h-ico-sm w-ico-sm text-text-warning" }),
|
|
70
|
+
/* @__PURE__ */ s("span", { className: "text-ds-md font-semibold text-text-warning", children: [
|
|
71
|
+
"On break",
|
|
72
|
+
t != null && t.breakReason ? ` — ${t.breakReason}` : ""
|
|
73
|
+
] })
|
|
74
|
+
] })
|
|
75
|
+
] }) }) : o ? /* @__PURE__ */ e("div", { ref: r, className: "relative overflow-hidden rounded-ds-2xl border border-border bg-gradient-to-br from-interactive-subtle via-background to-success-surface", children: /* @__PURE__ */ s("div", { className: "flex items-center justify-between px-ds-06 py-ds-07 sm:px-ds-07 sm:py-ds-08", children: [
|
|
76
|
+
/* @__PURE__ */ s("div", { className: "flex flex-col gap-ds-02b", children: [
|
|
77
|
+
/* @__PURE__ */ s("h2", { className: "text-ds-3xl text-text-primary", children: [
|
|
78
|
+
n,
|
|
79
|
+
",",
|
|
80
|
+
" ",
|
|
81
|
+
/* @__PURE__ */ e("span", { className: "font-semibold italic text-interactive", children: m })
|
|
82
|
+
] }),
|
|
83
|
+
/* @__PURE__ */ e("div", { className: "flex items-center gap-ds-03", children: /* @__PURE__ */ e("p", { className: "text-ds-base text-text-tertiary", children: x }) })
|
|
84
|
+
] }),
|
|
85
|
+
/* @__PURE__ */ s(
|
|
86
|
+
"button",
|
|
87
|
+
{
|
|
88
|
+
type: "button",
|
|
89
|
+
onClick: c,
|
|
90
|
+
disabled: d,
|
|
91
|
+
className: "flex items-center gap-ds-03 rounded-ds-xl bg-interactive px-ds-06 py-ds-04 font-semibold text-text-on-color shadow-02 transition-all duration-moderate-01 ease-expressive-standard hover:-translate-y-0.5 hover:shadow-03 active:translate-y-0 active:scale-[0.98] disabled:opacity-[0.38]",
|
|
92
|
+
children: [
|
|
93
|
+
d ? "Marking..." : "Mark Attendance",
|
|
94
|
+
!d && /* @__PURE__ */ e(D, { className: "h-ico-sm w-ico-sm" })
|
|
95
|
+
]
|
|
96
|
+
}
|
|
97
|
+
)
|
|
98
|
+
] }) }) : /* @__PURE__ */ e("div", { ref: r, className: "relative overflow-hidden rounded-ds-2xl border border-border bg-layer-01 shadow-01", children: /* @__PURE__ */ s("div", { className: "flex items-center justify-between px-ds-06 py-ds-06 sm:px-ds-07 sm:py-ds-07", children: [
|
|
99
|
+
/* @__PURE__ */ s("div", { className: "flex flex-col gap-ds-02b", children: [
|
|
100
|
+
/* @__PURE__ */ s("h2", { className: "text-ds-3xl text-text-primary", children: [
|
|
101
|
+
n,
|
|
102
|
+
",",
|
|
103
|
+
" ",
|
|
104
|
+
/* @__PURE__ */ e("span", { className: "font-semibold italic text-interactive", children: m })
|
|
105
|
+
] }),
|
|
106
|
+
/* @__PURE__ */ e("p", { className: "text-ds-base text-text-tertiary", children: x })
|
|
107
|
+
] }),
|
|
108
|
+
/* @__PURE__ */ s("div", { className: "flex items-center gap-ds-03 rounded-ds-xl bg-layer-02 px-ds-05 py-ds-03", children: [
|
|
109
|
+
/* @__PURE__ */ e(C, { className: "h-ico-sm w-ico-sm text-text-placeholder" }),
|
|
110
|
+
/* @__PURE__ */ e("span", { className: "text-ds-md text-text-placeholder", children: "Attendance window closed" })
|
|
111
|
+
] })
|
|
112
|
+
] }) });
|
|
113
|
+
}
|
|
114
|
+
);
|
|
115
|
+
O.displayName = "AttendanceCTA";
|
|
116
|
+
const v = [
|
|
117
|
+
"bg-category-amber",
|
|
118
|
+
"bg-category-teal",
|
|
119
|
+
"bg-category-cyan",
|
|
120
|
+
"bg-interactive",
|
|
121
|
+
"bg-accent"
|
|
122
|
+
], G = y.forwardRef(
|
|
123
|
+
function({
|
|
124
|
+
data: a,
|
|
125
|
+
loading: t = !1,
|
|
126
|
+
className: o
|
|
127
|
+
}, c) {
|
|
128
|
+
const [d, h] = w(!1);
|
|
129
|
+
return t ? /* @__PURE__ */ s("div", { ref: c, className: p("flex flex-col gap-ds-04 rounded-ds-2xl border border-border bg-layer-01 shadow-01 p-ds-05b", o), children: [
|
|
130
|
+
/* @__PURE__ */ s("div", { className: "flex items-center gap-ds-03", children: [
|
|
131
|
+
/* @__PURE__ */ e("div", { className: "h-ico-sm w-ico-sm animate-pulse rounded bg-layer-02" }),
|
|
132
|
+
/* @__PURE__ */ e("div", { className: "h-4 w-24 animate-pulse rounded bg-layer-02" })
|
|
133
|
+
] }),
|
|
134
|
+
[1, 2, 3].map((r) => /* @__PURE__ */ s("div", { className: "flex items-start gap-ds-04", children: [
|
|
135
|
+
/* @__PURE__ */ e("div", { className: "mt-ds-02b h-2 w-2 shrink-0 animate-pulse rounded-ds-full bg-layer-02" }),
|
|
136
|
+
/* @__PURE__ */ e(
|
|
137
|
+
"div",
|
|
138
|
+
{
|
|
139
|
+
className: "h-4 animate-pulse rounded bg-layer-02",
|
|
140
|
+
style: { width: `${60 + r * 10}%` }
|
|
141
|
+
}
|
|
142
|
+
)
|
|
143
|
+
] }, r))
|
|
144
|
+
] }) : !a || a.brief.length === 0 ? null : /* @__PURE__ */ s("div", { ref: c, className: p("flex flex-col rounded-ds-2xl border border-border bg-layer-01 shadow-01", o), children: [
|
|
145
|
+
/* @__PURE__ */ s(
|
|
146
|
+
"button",
|
|
147
|
+
{
|
|
148
|
+
type: "button",
|
|
149
|
+
"aria-label": "Toggle brief",
|
|
150
|
+
onClick: () => h(!d),
|
|
151
|
+
className: "flex items-center justify-between px-ds-05b py-ds-05 transition-colors hover:bg-layer-02",
|
|
152
|
+
children: [
|
|
153
|
+
/* @__PURE__ */ s("div", { className: "flex items-center gap-ds-03", children: [
|
|
154
|
+
/* @__PURE__ */ e(I, { className: "h-ico-sm w-ico-sm text-interactive" }),
|
|
155
|
+
/* @__PURE__ */ e("span", { className: "text-ds-base font-semibold text-text-primary", children: "Morning Brief" })
|
|
156
|
+
] }),
|
|
157
|
+
d ? /* @__PURE__ */ e(_, { className: "h-ico-sm w-ico-sm text-text-placeholder" }) : /* @__PURE__ */ e(R, { className: "h-ico-sm w-ico-sm text-text-placeholder" })
|
|
158
|
+
]
|
|
159
|
+
}
|
|
160
|
+
),
|
|
161
|
+
!d && /* @__PURE__ */ e("div", { className: "flex flex-col gap-ds-03 border-t border-border px-ds-05b pb-ds-05b pt-ds-05", children: a.brief.map((r, i) => /* @__PURE__ */ s("div", { className: "flex items-start gap-ds-04", children: [
|
|
162
|
+
/* @__PURE__ */ e(
|
|
163
|
+
"div",
|
|
164
|
+
{
|
|
165
|
+
className: p("mt-ds-02b h-2 w-2 shrink-0 rounded-ds-full", v[i % v.length])
|
|
166
|
+
}
|
|
167
|
+
),
|
|
168
|
+
/* @__PURE__ */ e("div", { className: "text-ds-md text-text-secondary [&_p]:mb-0 [&_strong]:font-semibold [&_code]:rounded [&_code]:bg-field [&_code]:px-1 [&_code]:py-ds-01 [&_code]:text-ds-sm [&_a]:text-interactive [&_a]:underline", children: /* @__PURE__ */ e(j, { children: r }) })
|
|
169
|
+
] }, i)) })
|
|
170
|
+
] });
|
|
171
|
+
}
|
|
172
|
+
);
|
|
173
|
+
G.displayName = "DailyBrief";
|
|
174
|
+
export {
|
|
175
|
+
O as A,
|
|
176
|
+
G as D
|
|
177
|
+
};
|