@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,162 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsxs as r, Fragment as p, jsx as e } from "react/jsx-runtime";
|
|
3
|
-
import * as S from "react";
|
|
4
|
-
import { useState as O } from "react";
|
|
5
|
-
import { Dialog as W, DialogContent as Y, DialogHeader as B, DialogTitle as E, DialogDescription as H } from "@devalok/shilp-sutra/ui/dialog";
|
|
6
|
-
import { Textarea as V } from "@devalok/shilp-sutra/ui/textarea";
|
|
7
|
-
import { formatDateWithWeekday as h } from "../utils/date-utils.js";
|
|
8
|
-
import { Avatar as X, AvatarImage as G, AvatarFallback as J } from "@devalok/shilp-sutra/ui/avatar";
|
|
9
|
-
import { Button as x } from "@devalok/shilp-sutra/ui/button";
|
|
10
|
-
import { isSameDay as K } from "date-fns";
|
|
11
|
-
import { Tooltip as s, TooltipTrigger as d, TooltipContent as n } from "@devalok/shilp-sutra/ui/tooltip";
|
|
12
|
-
import { IconX as M, IconCheck as P } from "@tabler/icons-react";
|
|
13
|
-
const Q = S.forwardRef(function({
|
|
14
|
-
request: a,
|
|
15
|
-
userImages: R,
|
|
16
|
-
handleRejectRequest: f,
|
|
17
|
-
handleApproveRequest: b,
|
|
18
|
-
commentBoxOpen: z,
|
|
19
|
-
onCommentBoxClose: A,
|
|
20
|
-
clickedAction: o,
|
|
21
|
-
userId: t
|
|
22
|
-
}, F) {
|
|
23
|
-
var N, y, w, u, D, C, k, j, T;
|
|
24
|
-
const [c, g] = O(""), m = new Date(a.startDate), v = new Date(a.endDate), L = K(m, v);
|
|
25
|
-
return /* @__PURE__ */ r(p, { children: [
|
|
26
|
-
/* @__PURE__ */ r(
|
|
27
|
-
"div",
|
|
28
|
-
{
|
|
29
|
-
ref: F,
|
|
30
|
-
className: "flex justify-between border-b border-border px-ds-03 py-ds-04 last:border-b-0",
|
|
31
|
-
children: [
|
|
32
|
-
/* @__PURE__ */ r("div", { className: "flex w-full items-center gap-ds-04", children: [
|
|
33
|
-
/* @__PURE__ */ r(X, { className: "h-ds-md w-ds-md", children: [
|
|
34
|
-
/* @__PURE__ */ e(G, { src: R[((N = a.user) == null ? void 0 : N.id) || ""], alt: ((y = a.user) == null ? void 0 : y.name) || "" }),
|
|
35
|
-
/* @__PURE__ */ e(J, { children: (((w = a.user) == null ? void 0 : w.name) || "?")[0] })
|
|
36
|
-
] }),
|
|
37
|
-
/* @__PURE__ */ r("div", { className: "flex w-auto max-w-[75%] flex-col items-start gap-ds-02b", children: [
|
|
38
|
-
/* @__PURE__ */ e("div", { className: "flex flex-row gap-ds-02b", children: /* @__PURE__ */ r("div", { className: "flex items-center gap-ds-03", children: [
|
|
39
|
-
/* @__PURE__ */ e("p", { className: "text-ds-sm text-text-secondary", children: (u = a.user) == null ? void 0 : u.name }),
|
|
40
|
-
a.correction && /* @__PURE__ */ r(p, { children: [
|
|
41
|
-
/* @__PURE__ */ e("div", { className: "block h-3 w-[1px] bg-border-subtle" }),
|
|
42
|
-
" ",
|
|
43
|
-
/* @__PURE__ */ e("p", { className: "text-ds-sm text-interactive", children: "Attendance Corrections" }),
|
|
44
|
-
" "
|
|
45
|
-
] })
|
|
46
|
-
] }) }),
|
|
47
|
-
/* @__PURE__ */ e("div", { className: "flex w-full flex-wrap items-center gap-ds-04", children: L ? /* @__PURE__ */ r("div", { className: "flex w-full flex-wrap items-center gap-ds-03", children: [
|
|
48
|
-
/* @__PURE__ */ r(s, { children: [
|
|
49
|
-
/* @__PURE__ */ e(d, { asChild: !0, children: /* @__PURE__ */ e("p", { className: "text-ds-base font-semibold line-clamp-2 cursor-default text-text-primary", children: a.reason }) }),
|
|
50
|
-
/* @__PURE__ */ e(n, { children: a.reason })
|
|
51
|
-
] }),
|
|
52
|
-
/* @__PURE__ */ r("p", { className: "text-ds-base text-text-tertiary", children: [
|
|
53
|
-
"• ",
|
|
54
|
-
h(m)
|
|
55
|
-
] })
|
|
56
|
-
] }) : /* @__PURE__ */ r(p, { children: [
|
|
57
|
-
/* @__PURE__ */ r(s, { children: [
|
|
58
|
-
/* @__PURE__ */ e(d, { asChild: !0, children: /* @__PURE__ */ e("p", { className: "text-ds-base font-semibold line-clamp-2 cursor-default text-text-primary", children: a.reason }) }),
|
|
59
|
-
/* @__PURE__ */ e(n, { children: a.reason })
|
|
60
|
-
] }),
|
|
61
|
-
/* @__PURE__ */ r("p", { className: "text-ds-base text-text-tertiary", children: [
|
|
62
|
-
h(m),
|
|
63
|
-
" to",
|
|
64
|
-
" ",
|
|
65
|
-
h(v),
|
|
66
|
-
",",
|
|
67
|
-
/* @__PURE__ */ r("span", { className: "text-interactive-hover", children: [
|
|
68
|
-
" ",
|
|
69
|
-
a.numberOfDays,
|
|
70
|
-
" days"
|
|
71
|
-
] })
|
|
72
|
-
] })
|
|
73
|
-
] }) })
|
|
74
|
-
] })
|
|
75
|
-
] }),
|
|
76
|
-
/* @__PURE__ */ r("div", { className: "flex items-center gap-ds-04", children: [
|
|
77
|
-
/* @__PURE__ */ r(s, { delayDuration: 0, children: [
|
|
78
|
-
/* @__PURE__ */ e(d, { asChild: !0, children: /* @__PURE__ */ e(
|
|
79
|
-
x,
|
|
80
|
-
{
|
|
81
|
-
variant: "ghost",
|
|
82
|
-
size: "icon-sm",
|
|
83
|
-
onClick: (l) => {
|
|
84
|
-
var i;
|
|
85
|
-
return ((i = a.user) == null ? void 0 : i.id) !== t && f(l, a.id);
|
|
86
|
-
},
|
|
87
|
-
disabled: ((D = a.user) == null ? void 0 : D.id) === t,
|
|
88
|
-
"aria-label": "Reject break request",
|
|
89
|
-
children: /* @__PURE__ */ e(M, { className: "h-ico-lg w-ico-lg" })
|
|
90
|
-
}
|
|
91
|
-
) }),
|
|
92
|
-
((C = a.user) == null ? void 0 : C.id) === t && /* @__PURE__ */ e(n, { children: /* @__PURE__ */ e("p", { children: "You cannot approve/reject your own break request" }) })
|
|
93
|
-
] }),
|
|
94
|
-
/* @__PURE__ */ r(s, { delayDuration: 0, children: [
|
|
95
|
-
/* @__PURE__ */ e(d, { asChild: !0, children: /* @__PURE__ */ e(
|
|
96
|
-
x,
|
|
97
|
-
{
|
|
98
|
-
variant: "ghost",
|
|
99
|
-
size: "icon-sm",
|
|
100
|
-
onClick: (l) => {
|
|
101
|
-
var i;
|
|
102
|
-
return ((i = a.user) == null ? void 0 : i.id) !== t && b(l, a.id);
|
|
103
|
-
},
|
|
104
|
-
disabled: ((k = a.user) == null ? void 0 : k.id) === t,
|
|
105
|
-
"aria-label": "Approve break request",
|
|
106
|
-
children: /* @__PURE__ */ e(P, { className: "h-ico-lg w-ico-lg" })
|
|
107
|
-
}
|
|
108
|
-
) }),
|
|
109
|
-
((j = a.user) == null ? void 0 : j.id) === t && /* @__PURE__ */ e(n, { children: /* @__PURE__ */ e("p", { children: "You cannot approve/reject your own break request" }) })
|
|
110
|
-
] })
|
|
111
|
-
] })
|
|
112
|
-
]
|
|
113
|
-
},
|
|
114
|
-
a.id
|
|
115
|
-
),
|
|
116
|
-
/* @__PURE__ */ e(
|
|
117
|
-
W,
|
|
118
|
-
{
|
|
119
|
-
open: z,
|
|
120
|
-
onOpenChange: () => {
|
|
121
|
-
A(), g("");
|
|
122
|
-
},
|
|
123
|
-
children: /* @__PURE__ */ r(Y, { children: [
|
|
124
|
-
/* @__PURE__ */ r(B, { children: [
|
|
125
|
-
/* @__PURE__ */ e(E, { className: "text-ds-xl", children: (T = a.user) == null ? void 0 : T.name }),
|
|
126
|
-
/* @__PURE__ */ e(H, { className: "text-ds-lg", children: a.reason })
|
|
127
|
-
] }),
|
|
128
|
-
/* @__PURE__ */ r("div", { className: "flex flex-col", children: [
|
|
129
|
-
/* @__PURE__ */ r("div", { className: "text-ds-md flex flex-col items-start justify-center gap-ds-03 rounded-ds-lg border border-border-subtle bg-layer-01 shadow-01 px-ds-05 pb-ds-01 pt-ds-03 text-text-primary", children: [
|
|
130
|
-
/* @__PURE__ */ e("label", { className: "text-ds-xs font-semibold uppercase tracking-wider text-text-helper", htmlFor: "comment", children: "Comment" }),
|
|
131
|
-
/* @__PURE__ */ e(
|
|
132
|
-
V,
|
|
133
|
-
{
|
|
134
|
-
id: "comment",
|
|
135
|
-
defaultValue: c,
|
|
136
|
-
onChange: (l) => g(l.target.value),
|
|
137
|
-
placeholder: "Enjoy your break",
|
|
138
|
-
className: "resize-none border-none px-0 shadow-none placeholder:font-accent"
|
|
139
|
-
}
|
|
140
|
-
)
|
|
141
|
-
] }),
|
|
142
|
-
/* @__PURE__ */ e(
|
|
143
|
-
x,
|
|
144
|
-
{
|
|
145
|
-
className: "mt-ds-06",
|
|
146
|
-
variant: "solid",
|
|
147
|
-
onClick: () => {
|
|
148
|
-
o === "approve" ? b(void 0, a.id, c) : o === "reject" && f(void 0, a.id, c);
|
|
149
|
-
},
|
|
150
|
-
children: o === "approve" ? "Approve" : "Reject"
|
|
151
|
-
}
|
|
152
|
-
)
|
|
153
|
-
] })
|
|
154
|
-
] })
|
|
155
|
-
}
|
|
156
|
-
)
|
|
157
|
-
] });
|
|
158
|
-
});
|
|
159
|
-
Q.displayName = "LeaveRequest";
|
|
160
|
-
export {
|
|
161
|
-
Q as LeaveRequest
|
|
162
|
-
};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { useState as t, useCallback as w } from "react";
|
|
3
|
-
function m() {
|
|
4
|
-
const [i, u] = t(!1), [M, D] = t(null), [s, a] = t((/* @__PURE__ */ new Date()).getMonth()), [o, c] = t((/* @__PURE__ */ new Date()).getFullYear()), [S, d] = t(
|
|
5
|
-
null
|
|
6
|
-
), [f, h] = t(null), C = w(
|
|
7
|
-
(g) => {
|
|
8
|
-
const e = s, n = o;
|
|
9
|
-
if (g === "next") {
|
|
10
|
-
const l = e === 11 ? 0 : e + 1, r = e === 11 ? n + 1 : n;
|
|
11
|
-
a(l), c(r);
|
|
12
|
-
} else {
|
|
13
|
-
const l = e === 0 ? 11 : e - 1, r = e === 0 ? n - 1 : n;
|
|
14
|
-
a(l), c(r);
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
[s, o]
|
|
18
|
-
), Y = w(() => {
|
|
19
|
-
u(!1), D(null), d(null), h(null);
|
|
20
|
-
}, []);
|
|
21
|
-
return {
|
|
22
|
-
// State
|
|
23
|
-
showCalendar: i,
|
|
24
|
-
activeDate: M,
|
|
25
|
-
currentMonth: s,
|
|
26
|
-
currentYear: o,
|
|
27
|
-
selectedStartDate: S,
|
|
28
|
-
selectedEndDate: f,
|
|
29
|
-
// Setters (for cases needing direct access)
|
|
30
|
-
setShowCalendar: u,
|
|
31
|
-
setActiveDate: D,
|
|
32
|
-
setCurrentMonth: a,
|
|
33
|
-
setCurrentYear: c,
|
|
34
|
-
setSelectedStartDate: d,
|
|
35
|
-
setSelectedEndDate: h,
|
|
36
|
-
// Helpers
|
|
37
|
-
navigateMonth: C,
|
|
38
|
-
resetDates: Y
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
export {
|
|
42
|
-
m as useBreakDatePicker
|
|
43
|
-
};
|
|
@@ -1,337 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as r, jsxs as p } from "react/jsx-runtime";
|
|
3
|
-
import A, { useState as F, useCallback as E, useMemo as H, useEffect as T, createContext as I, useContext as P } from "react";
|
|
4
|
-
import { cva as C } from "class-variance-authority";
|
|
5
|
-
import { cn as N } from "@devalok/shilp-sutra/ui/lib/utils";
|
|
6
|
-
import { DashboardSkeleton as _ } from "./dashboard-skeleton.js";
|
|
7
|
-
import { DashboardHeader as B } from "./dashboard-header.js";
|
|
8
|
-
import { RenderDate as V } from "./render-date.js";
|
|
9
|
-
import { AttendanceOverview as z } from "./attendance-overview.js";
|
|
10
|
-
import { AssociateDetail as G } from "./associate-detail.js";
|
|
11
|
-
import { CorrectionList as K } from "./correction-list.js";
|
|
12
|
-
import { LeaveRequests as W } from "./leave-requests.js";
|
|
13
|
-
import { useCalendarNavigation as Y } from "./use-calendar-navigation.js";
|
|
14
|
-
import { format as w } from "date-fns";
|
|
15
|
-
const q = I(
|
|
16
|
-
null
|
|
17
|
-
);
|
|
18
|
-
function R() {
|
|
19
|
-
const x = P(q);
|
|
20
|
-
if (!x)
|
|
21
|
-
throw new Error(
|
|
22
|
-
"AdminDashboard compound components must be used within <AdminDashboard.Root>"
|
|
23
|
-
);
|
|
24
|
-
return x;
|
|
25
|
-
}
|
|
26
|
-
const g = A.forwardRef(function({
|
|
27
|
-
currentUserId: s,
|
|
28
|
-
currentUserRole: a,
|
|
29
|
-
currentUser: n,
|
|
30
|
-
assetsBaseUrl: l = "",
|
|
31
|
-
userImages: d = {},
|
|
32
|
-
isLoading: m = !1,
|
|
33
|
-
onAssociateChange: e,
|
|
34
|
-
children: u
|
|
35
|
-
}, h) {
|
|
36
|
-
const b = Y(), [i, c] = F("leaveRequest"), [f, o] = F(
|
|
37
|
-
null
|
|
38
|
-
), y = E(
|
|
39
|
-
(t) => {
|
|
40
|
-
o(t), e == null || e(t);
|
|
41
|
-
},
|
|
42
|
-
[e]
|
|
43
|
-
), D = H(
|
|
44
|
-
() => ({
|
|
45
|
-
currentUserId: s,
|
|
46
|
-
currentUserRole: a,
|
|
47
|
-
currentUser: n,
|
|
48
|
-
assetsBaseUrl: l,
|
|
49
|
-
userImages: d,
|
|
50
|
-
cal: b,
|
|
51
|
-
activeTab: i,
|
|
52
|
-
setActiveTab: c,
|
|
53
|
-
selectedAssociate: f,
|
|
54
|
-
setSelectedAssociate: y
|
|
55
|
-
}),
|
|
56
|
-
[
|
|
57
|
-
s,
|
|
58
|
-
a,
|
|
59
|
-
n,
|
|
60
|
-
l,
|
|
61
|
-
d,
|
|
62
|
-
b,
|
|
63
|
-
i,
|
|
64
|
-
f,
|
|
65
|
-
y
|
|
66
|
-
]
|
|
67
|
-
);
|
|
68
|
-
return m ? /* @__PURE__ */ r(_, {}) : /* @__PURE__ */ r(q.Provider, { value: D, children: /* @__PURE__ */ r(
|
|
69
|
-
"div",
|
|
70
|
-
{
|
|
71
|
-
ref: h,
|
|
72
|
-
className: "flex w-full max-w-layout flex-col items-center justify-center max-md:h-[100%] max-md:justify-start",
|
|
73
|
-
children: /* @__PURE__ */ r("div", { className: "z-raised flex w-full flex-col items-start justify-start rounded-ds-lg border border-border bg-layer-02 p-ds-05 shadow-05 max-md:flex-1 max-md:min-h-0 max-md:overflow-y-auto max-md:border-0 max-md:px-ds-05 max-md:pb-0 max-md:pt-ds-06", children: u })
|
|
74
|
-
}
|
|
75
|
-
) });
|
|
76
|
-
});
|
|
77
|
-
g.displayName = "AdminDashboard.Root";
|
|
78
|
-
const M = A.forwardRef(function({
|
|
79
|
-
dateAttendanceMap: s = null,
|
|
80
|
-
onDateChange: a,
|
|
81
|
-
onTimeFrameChange: n,
|
|
82
|
-
users: l = [],
|
|
83
|
-
selectedUserAttendance: d = null
|
|
84
|
-
}, m) {
|
|
85
|
-
const { cal: e, selectedAssociate: u, setSelectedAssociate: h, userImages: b, setActiveTab: i } = R(), c = () => {
|
|
86
|
-
e.goToday(), i("leaveRequest");
|
|
87
|
-
}, f = (t) => {
|
|
88
|
-
e.navigateDate(t), i("leaveRequest");
|
|
89
|
-
}, o = (t) => {
|
|
90
|
-
e.selectMonth(t), i("leaveRequest");
|
|
91
|
-
}, y = (t) => {
|
|
92
|
-
const v = e.days[t].fullDate;
|
|
93
|
-
e.selectDate(t, v), a == null || a(w(v, "yyyy-MM-dd'T'HH:mm:ssxxx"));
|
|
94
|
-
}, D = (t, v) => {
|
|
95
|
-
e.activeTimeFrame === "weekly" ? (y(t), i("leaveRequest")) : (e.selectDayMonthly(v), i("leaveRequest"), a == null || a(w(v, "yyyy-MM-dd'T'HH:mm:ssxxx")));
|
|
96
|
-
};
|
|
97
|
-
return T(() => {
|
|
98
|
-
n == null || n(e.activeTimeFrame);
|
|
99
|
-
}, [e.activeTimeFrame]), T(() => {
|
|
100
|
-
a == null || a(e.selectedDate);
|
|
101
|
-
}, [e.selectedDate]), /* @__PURE__ */ p("div", { ref: m, children: [
|
|
102
|
-
/* @__PURE__ */ r(
|
|
103
|
-
B,
|
|
104
|
-
{
|
|
105
|
-
selectedMonth: e.selectedMonth,
|
|
106
|
-
yearsList: e.getYearsList(),
|
|
107
|
-
isTodaySelected: e.isTodaySelected(),
|
|
108
|
-
selectedAssociate: u,
|
|
109
|
-
users: l,
|
|
110
|
-
userImages: b,
|
|
111
|
-
activeTimeFrame: e.activeTimeFrame,
|
|
112
|
-
onMonthSelection: o,
|
|
113
|
-
onTodayClick: c,
|
|
114
|
-
onSelectAssociate: h,
|
|
115
|
-
onTimeFrameChange: (t) => e.setActiveTimeFrame(t),
|
|
116
|
-
onDateChange: f
|
|
117
|
-
}
|
|
118
|
-
),
|
|
119
|
-
/* @__PURE__ */ p(
|
|
120
|
-
"div",
|
|
121
|
-
{
|
|
122
|
-
className: N(
|
|
123
|
-
"calendar",
|
|
124
|
-
e.activeTimeFrame === "weekly" ? "flex" : "grid grid-cols-7 gap-0",
|
|
125
|
-
"w-full items-center"
|
|
126
|
-
),
|
|
127
|
-
children: [
|
|
128
|
-
e.activeTimeFrame === "monthly" && ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"].map((t) => /* @__PURE__ */ r("div", { className: "pb-ds-03 pt-ds-05 text-center", children: /* @__PURE__ */ r("span", { className: "text-ds-sm font-semibold uppercase tracking-wider text-text-tertiary", children: t }) }, t)),
|
|
129
|
-
e.days.map((t, v) => /* @__PURE__ */ p(
|
|
130
|
-
"button",
|
|
131
|
-
{
|
|
132
|
-
type: "button",
|
|
133
|
-
tabIndex: t.isPadding ? -1 : 0,
|
|
134
|
-
"aria-label": t.isPadding ? void 0 : w(t.fullDate, "MMMM d, yyyy"),
|
|
135
|
-
className: N(
|
|
136
|
-
e.activeTimeFrame === "weekly" ? "w-full rounded-t-ds-lg pb-ds-04 pt-ds-05 max-md:rounded-ds-lg" : "pb-0 pt-0",
|
|
137
|
-
"flex cursor-pointer flex-col items-center text-center",
|
|
138
|
-
e.activeTimeFrame === "weekly" && e.activeIndex === v ? (d == null ? void 0 : d.status) === "BREAK" ? "bg-layer-accent-subtle" : "bg-layer-02" : "",
|
|
139
|
-
t.isPadding && "opacity-[0.5]"
|
|
140
|
-
),
|
|
141
|
-
onClick: () => D(v, t.fullDate),
|
|
142
|
-
children: [
|
|
143
|
-
e.activeTimeFrame === "weekly" && /* @__PURE__ */ r("span", { className: "text-ds-sm font-semibold uppercase tracking-wider mb-ds-03 text-text-tertiary", children: t.day }),
|
|
144
|
-
/* @__PURE__ */ r(
|
|
145
|
-
V,
|
|
146
|
-
{
|
|
147
|
-
day: t,
|
|
148
|
-
isAdmin: !0,
|
|
149
|
-
selectedDate: e.selectedDate,
|
|
150
|
-
dateAttendanceMap: u ? s : null,
|
|
151
|
-
activeTimeFrame: e.activeTimeFrame
|
|
152
|
-
}
|
|
153
|
-
)
|
|
154
|
-
]
|
|
155
|
-
},
|
|
156
|
-
v
|
|
157
|
-
))
|
|
158
|
-
]
|
|
159
|
-
}
|
|
160
|
-
)
|
|
161
|
-
] });
|
|
162
|
-
});
|
|
163
|
-
M.displayName = "AdminDashboard.Calendar";
|
|
164
|
-
const S = A.forwardRef(function({ groupedAttendance: s = null, users: a = [] }, n) {
|
|
165
|
-
const { cal: l, selectedAssociate: d, userImages: m } = R();
|
|
166
|
-
return d ? null : /* @__PURE__ */ r("div", { ref: n, children: /* @__PURE__ */ r(
|
|
167
|
-
z,
|
|
168
|
-
{
|
|
169
|
-
isFutureDate: l.isFutureDate,
|
|
170
|
-
users: a,
|
|
171
|
-
groupedAttendance: s,
|
|
172
|
-
userImages: m,
|
|
173
|
-
selectedDate: l.selectedDate
|
|
174
|
-
}
|
|
175
|
-
) });
|
|
176
|
-
});
|
|
177
|
-
S.displayName = "AdminDashboard.AttendanceOverview";
|
|
178
|
-
const L = A.forwardRef(function({
|
|
179
|
-
attendance: s = null,
|
|
180
|
-
tasks: a = [],
|
|
181
|
-
breakRequest: n = null,
|
|
182
|
-
onUpdateAttendanceStatus: l,
|
|
183
|
-
onToggleTaskStatus: d,
|
|
184
|
-
onAddTask: m,
|
|
185
|
-
onReorderTasks: e,
|
|
186
|
-
onCancelBreak: u,
|
|
187
|
-
onRefreshSelectedUserAttendance: h,
|
|
188
|
-
onRefreshAttendanceData: b
|
|
189
|
-
}, i) {
|
|
190
|
-
const { cal: c, selectedAssociate: f, assetsBaseUrl: o } = R();
|
|
191
|
-
return f ? /* @__PURE__ */ r("div", { ref: i, children: /* @__PURE__ */ r(
|
|
192
|
-
G,
|
|
193
|
-
{
|
|
194
|
-
selectedAssociate: f,
|
|
195
|
-
selectedDate: c.selectedDate,
|
|
196
|
-
selectedUserAttendance: s,
|
|
197
|
-
userTasks: a,
|
|
198
|
-
selectedBreakRequest: n,
|
|
199
|
-
isFutureDate: c.isFutureDate,
|
|
200
|
-
assetsBaseUrl: o,
|
|
201
|
-
onUpdateAttendanceStatus: l,
|
|
202
|
-
onToggleTaskStatus: d,
|
|
203
|
-
onAddTask: m,
|
|
204
|
-
onReorderTasks: e,
|
|
205
|
-
onCancelBreak: u,
|
|
206
|
-
onRefreshSelectedUserAttendance: h,
|
|
207
|
-
onRefreshAttendanceData: b
|
|
208
|
-
}
|
|
209
|
-
) }) : null;
|
|
210
|
-
});
|
|
211
|
-
L.displayName = "AdminDashboard.AssociateDetail";
|
|
212
|
-
const k = C(
|
|
213
|
-
"text-ds-sm font-semibold uppercase tracking-wider cursor-pointer px-ds-03 py-ds-04",
|
|
214
|
-
{
|
|
215
|
-
variants: {
|
|
216
|
-
active: {
|
|
217
|
-
true: "border-b-[1px] border-b-interactive-hover text-text-primary",
|
|
218
|
-
false: "text-text-tertiary"
|
|
219
|
-
}
|
|
220
|
-
},
|
|
221
|
-
defaultVariants: {
|
|
222
|
-
active: !1
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
), O = A.forwardRef(function({
|
|
226
|
-
requests: s = [],
|
|
227
|
-
corrections: a = [],
|
|
228
|
-
onApproveBreak: n,
|
|
229
|
-
onRejectBreak: l,
|
|
230
|
-
onApproveCorrection: d,
|
|
231
|
-
onRejectCorrection: m
|
|
232
|
-
}, e) {
|
|
233
|
-
const { currentUserId: u, userImages: h, cal: b, activeTab: i, setActiveTab: c, assetsBaseUrl: f } = R(), o = a.filter(
|
|
234
|
-
(D) => D.correctionStatus === "PENDING"
|
|
235
|
-
);
|
|
236
|
-
T(() => {
|
|
237
|
-
s.length > 0 ? c("leaveRequest") : o.length > 0 && c("attendanceRequest");
|
|
238
|
-
}, [s.length, o.length, c]);
|
|
239
|
-
const y = (D) => {
|
|
240
|
-
c(D);
|
|
241
|
-
};
|
|
242
|
-
return o.length === 0 && s.length === 0 ? null : /* @__PURE__ */ r("div", { ref: e, className: "w-full p-0 md:p-ds-06", children: /* @__PURE__ */ p("div", { className: "max-md:pt-[16px] flex flex-col items-start overflow-hidden rounded-ds-lg border-0 border-border-subtle bg-layer-01 shadow-01 pt-ds-03 md:border max-md:pb-0", children: [
|
|
243
|
-
/* @__PURE__ */ p("div", { className: "flex w-full items-start border-b-[1px] border-b-border px-ds-06 md:border-b max-md:border-0 max-md:px-0", children: [
|
|
244
|
-
s.length > 0 && /* @__PURE__ */ p(
|
|
245
|
-
"button",
|
|
246
|
-
{
|
|
247
|
-
type: "button",
|
|
248
|
-
onClick: () => y("leaveRequest"),
|
|
249
|
-
"aria-current": i === "leaveRequest" ? "true" : void 0,
|
|
250
|
-
className: k({ active: i === "leaveRequest" }),
|
|
251
|
-
children: [
|
|
252
|
-
/* @__PURE__ */ r("span", { className: "hidden sm:inline", children: "break " }),
|
|
253
|
-
"Requests",
|
|
254
|
-
/* @__PURE__ */ p("span", { className: "text-interactive-hover", children: [
|
|
255
|
-
"(",
|
|
256
|
-
s.length,
|
|
257
|
-
")"
|
|
258
|
-
] })
|
|
259
|
-
]
|
|
260
|
-
}
|
|
261
|
-
),
|
|
262
|
-
o.length > 0 && /* @__PURE__ */ p(
|
|
263
|
-
"button",
|
|
264
|
-
{
|
|
265
|
-
type: "button",
|
|
266
|
-
onClick: () => y("attendanceRequest"),
|
|
267
|
-
"aria-current": i === "attendanceRequest" ? "true" : void 0,
|
|
268
|
-
className: k({ active: i === "attendanceRequest" }),
|
|
269
|
-
children: [
|
|
270
|
-
"Attendance Correction",
|
|
271
|
-
" ",
|
|
272
|
-
/* @__PURE__ */ p("span", { className: "text-interactive-hover", children: [
|
|
273
|
-
"(",
|
|
274
|
-
o.length,
|
|
275
|
-
")"
|
|
276
|
-
] })
|
|
277
|
-
]
|
|
278
|
-
}
|
|
279
|
-
)
|
|
280
|
-
] }),
|
|
281
|
-
i === "attendanceRequest" && o.length > 0 && /* @__PURE__ */ r(
|
|
282
|
-
K,
|
|
283
|
-
{
|
|
284
|
-
corrections: o,
|
|
285
|
-
currentUserId: u,
|
|
286
|
-
userImages: h,
|
|
287
|
-
assetsBaseUrl: f,
|
|
288
|
-
activeTimeFrame: b.activeTimeFrame,
|
|
289
|
-
onApproveCorrection: d,
|
|
290
|
-
onRejectCorrection: m
|
|
291
|
-
}
|
|
292
|
-
),
|
|
293
|
-
i === "leaveRequest" && s.length > 0 && /* @__PURE__ */ r(
|
|
294
|
-
W,
|
|
295
|
-
{
|
|
296
|
-
requests: s,
|
|
297
|
-
currentUserId: u,
|
|
298
|
-
userImages: h,
|
|
299
|
-
activeTimeFrame: b.activeTimeFrame,
|
|
300
|
-
onApproveBreak: n,
|
|
301
|
-
onRejectBreak: l
|
|
302
|
-
}
|
|
303
|
-
)
|
|
304
|
-
] }) });
|
|
305
|
-
});
|
|
306
|
-
O.displayName = "AdminDashboard.LeaveRequests";
|
|
307
|
-
const j = A.forwardRef(function({ children: s }, a) {
|
|
308
|
-
const { cal: n } = R(), l = n.isFirstDate(), d = n.isLastDate();
|
|
309
|
-
return /* @__PURE__ */ r(
|
|
310
|
-
"div",
|
|
311
|
-
{
|
|
312
|
-
ref: a,
|
|
313
|
-
className: N(
|
|
314
|
-
"flex w-full flex-col rounded-ds-lg bg-layer-02 md:p-ds-06 max-md:bg-transparent",
|
|
315
|
-
{
|
|
316
|
-
"rounded-ds-lg": !l && !d,
|
|
317
|
-
"rounded-ds-lg rounded-tl-none": l && !d,
|
|
318
|
-
"rounded-b-ds-lg rounded-tr-none": !l && d,
|
|
319
|
-
"rounded-ds-none": l && d
|
|
320
|
-
}
|
|
321
|
-
),
|
|
322
|
-
children: s
|
|
323
|
-
}
|
|
324
|
-
);
|
|
325
|
-
});
|
|
326
|
-
j.displayName = "AdminDashboard.Content";
|
|
327
|
-
const le = Object.assign(g, {
|
|
328
|
-
Root: g,
|
|
329
|
-
Calendar: M,
|
|
330
|
-
AttendanceOverview: S,
|
|
331
|
-
AssociateDetail: L,
|
|
332
|
-
LeaveRequests: O,
|
|
333
|
-
Content: j
|
|
334
|
-
});
|
|
335
|
-
export {
|
|
336
|
-
le as AdminDashboard
|
|
337
|
-
};
|