@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
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsxs as a, jsx as e, Fragment as M } from "react/jsx-runtime";
|
|
3
|
-
import * as C from "react";
|
|
4
|
-
import { Fragment as F } from "react";
|
|
5
|
-
import { DropdownMenu as m, DropdownMenuTrigger as o, DropdownMenuContent as x, DropdownMenuItem as h } from "@devalok/shilp-sutra/ui/dropdown-menu";
|
|
6
|
-
import { Button as j } from "@devalok/shilp-sutra/ui/button";
|
|
7
|
-
import { IconButton as l } from "@devalok/shilp-sutra/ui/icon-button";
|
|
8
|
-
import { IconX as u, IconUser as D, IconChevronDown as p, IconCalendar as Y, IconCalendarEvent as I, IconChevronLeft as N, IconChevronRight as f } from "@tabler/icons-react";
|
|
9
|
-
const b = [
|
|
10
|
-
{ id: 1, name: "January" },
|
|
11
|
-
{ id: 2, name: "February" },
|
|
12
|
-
{ id: 3, name: "March" },
|
|
13
|
-
{ id: 4, name: "April" },
|
|
14
|
-
{ id: 5, name: "May" },
|
|
15
|
-
{ id: 6, name: "June" },
|
|
16
|
-
{ id: 7, name: "July" },
|
|
17
|
-
{ id: 8, name: "August" },
|
|
18
|
-
{ id: 9, name: "September" },
|
|
19
|
-
{ id: 10, name: "October" },
|
|
20
|
-
{ id: 11, name: "November" },
|
|
21
|
-
{ id: 12, name: "December" }
|
|
22
|
-
], S = C.forwardRef(
|
|
23
|
-
function({
|
|
24
|
-
filters: s,
|
|
25
|
-
onFilterChange: w,
|
|
26
|
-
breakBalance: n,
|
|
27
|
-
userImages: c,
|
|
28
|
-
users: r
|
|
29
|
-
}, y) {
|
|
30
|
-
const d = (t) => {
|
|
31
|
-
w(t(s));
|
|
32
|
-
}, g = () => {
|
|
33
|
-
d((t) => ({
|
|
34
|
-
...t,
|
|
35
|
-
currMonth: t.currMonth === 0 ? 11 : t.currMonth - 1
|
|
36
|
-
}));
|
|
37
|
-
}, v = () => {
|
|
38
|
-
d((t) => ({
|
|
39
|
-
...t,
|
|
40
|
-
currMonth: t.currMonth === 11 ? 0 : t.currMonth + 1
|
|
41
|
-
}));
|
|
42
|
-
}, A = () => {
|
|
43
|
-
d((t) => ({
|
|
44
|
-
...t,
|
|
45
|
-
dateFilterStart: new Date(t.currYear, t.currMonth, 1),
|
|
46
|
-
dateFilterEnd: new Date(t.currYear, t.currMonth + 1, 0),
|
|
47
|
-
isOpen: !1
|
|
48
|
-
}));
|
|
49
|
-
};
|
|
50
|
-
return /* @__PURE__ */ a("div", { ref: y, className: "flex min-w-[800px] items-center justify-between bg-field px-ds-06 py-ds-05b max-md:justify-start max-md:gap-ds-05b max-lg:min-w-[100%]", children: [
|
|
51
|
-
/* @__PURE__ */ e("div", { className: "flex flex-col gap-ds-05", children: s.selectedAssociate && /* @__PURE__ */ a(M, { children: [
|
|
52
|
-
/* @__PURE__ */ e("p", { className: "text-ds-sm font-semibold uppercase tracking-wider text-text-tertiary", children: "Break Balance" }),
|
|
53
|
-
/* @__PURE__ */ a("div", { className: "flex items-end", children: [
|
|
54
|
-
/* @__PURE__ */ e("p", { className: "text-ds-5xl font-semibold mr-ds-02 text-interactive", children: (n == null ? void 0 : n.remainingDays) || 0 }),
|
|
55
|
-
/* @__PURE__ */ a("p", { className: "text-ds-2xl translate-y-[-5px] text-text-placeholder", children: [
|
|
56
|
-
"/ ",
|
|
57
|
-
(n == null ? void 0 : n.breakBalance) || 0
|
|
58
|
-
] })
|
|
59
|
-
] })
|
|
60
|
-
] }) }),
|
|
61
|
-
/* @__PURE__ */ a("header", { className: "flex items-center gap-ds-04", children: [
|
|
62
|
-
s.selectedAssociate ? /* @__PURE__ */ a("div", { className: "text-ds-md flex flex-row items-center justify-start gap-ds-02 rounded-ds-md bg-interactive p-ds-02b text-text-on-color", children: [
|
|
63
|
-
/* @__PURE__ */ a("div", { className: "flex items-center justify-start gap-ds-01", children: [
|
|
64
|
-
c[s.selectedAssociate.id] ? /* @__PURE__ */ e(
|
|
65
|
-
"img",
|
|
66
|
-
{
|
|
67
|
-
src: c[s.selectedAssociate.id],
|
|
68
|
-
alt: `${s.selectedAssociate.name}'s avatar`,
|
|
69
|
-
className: "h-ico-md w-ico-md rounded-ds-full"
|
|
70
|
-
}
|
|
71
|
-
) : /* @__PURE__ */ e("div", { className: "flex h-ico-md w-ico-md items-center justify-center rounded-ds-full bg-layer-02", children: /* @__PURE__ */ e("span", { className: "text-interactive", children: s.selectedAssociate.name.charAt(0) }) }),
|
|
72
|
-
/* @__PURE__ */ e("span", { className: "text-ds-md mx-ds-01 text-text-on-color", children: s.selectedAssociate.name })
|
|
73
|
-
] }),
|
|
74
|
-
/* @__PURE__ */ e(
|
|
75
|
-
"button",
|
|
76
|
-
{
|
|
77
|
-
"aria-label": "Clear filter",
|
|
78
|
-
onClick: () => d((t) => ({
|
|
79
|
-
...t,
|
|
80
|
-
selectedAssociate: null
|
|
81
|
-
})),
|
|
82
|
-
className: "border-0 p-0",
|
|
83
|
-
children: /* @__PURE__ */ e(u, { className: "h-ico-sm w-ico-sm text-text-on-color" })
|
|
84
|
-
}
|
|
85
|
-
)
|
|
86
|
-
] }) : /* @__PURE__ */ a(m, { children: [
|
|
87
|
-
/* @__PURE__ */ a(o, { className: "text-ds-md flex flex-row items-center justify-between rounded-ds-md border border-border-subtle bg-layer-01 px-ds-03 py-ds-02b", children: [
|
|
88
|
-
/* @__PURE__ */ a("div", { className: "flex items-center", children: [
|
|
89
|
-
/* @__PURE__ */ e(D, { className: "h-ico-sm w-ico-sm" }),
|
|
90
|
-
/* @__PURE__ */ e("span", { className: "text-ds-md mx-ds-03 text-text-secondary max-lg:mx-0 max-lg:text-ds-sm", children: "Associate" })
|
|
91
|
-
] }),
|
|
92
|
-
/* @__PURE__ */ e(p, { className: "h-ico-sm w-ico-sm" })
|
|
93
|
-
] }),
|
|
94
|
-
/* @__PURE__ */ e(x, { className: "custom-scrollbar max-h-[400px] w-64 overflow-y-auto p-ds-03", children: (r == null ? void 0 : r.length) === 0 ? /* @__PURE__ */ e(h, { disabled: !0, children: "No users available" }) : r == null ? void 0 : r.map((t) => /* @__PURE__ */ e(F, { children: /* @__PURE__ */ a(
|
|
95
|
-
h,
|
|
96
|
-
{
|
|
97
|
-
onSelect: () => d((i) => ({
|
|
98
|
-
...i,
|
|
99
|
-
selectedAssociate: t
|
|
100
|
-
})),
|
|
101
|
-
className: "flex items-center gap-ds-03 p-ds-03",
|
|
102
|
-
children: [
|
|
103
|
-
c[t.id] ? /* @__PURE__ */ e(
|
|
104
|
-
"img",
|
|
105
|
-
{
|
|
106
|
-
src: c[t.id],
|
|
107
|
-
alt: `${t.name}'s avatar`,
|
|
108
|
-
className: "h-ds-xs w-ds-xs rounded-ds-full"
|
|
109
|
-
}
|
|
110
|
-
) : /* @__PURE__ */ e("div", { className: "flex h-ds-xs w-ds-xs items-center justify-center rounded-ds-full bg-layer-03", children: /* @__PURE__ */ e("span", { className: "text-ds-md text-interactive", children: t.name.charAt(0) }) }),
|
|
111
|
-
/* @__PURE__ */ e("span", { className: "text-ds-md text-text-secondary", children: t.name })
|
|
112
|
-
]
|
|
113
|
-
},
|
|
114
|
-
t.id
|
|
115
|
-
) }, t.id)) })
|
|
116
|
-
] }),
|
|
117
|
-
s.dateFilterEnd && /* @__PURE__ */ a("div", { className: "text-ds-md flex items-center justify-between rounded-ds-md bg-interactive px-ds-03 py-ds-02b text-text-on-color", children: [
|
|
118
|
-
/* @__PURE__ */ a("div", { className: "flex items-center", children: [
|
|
119
|
-
/* @__PURE__ */ e(Y, {}),
|
|
120
|
-
/* @__PURE__ */ a("span", { className: "ml-ds-01 mr-ds-02", children: [
|
|
121
|
-
b[new Date(s.dateFilterStart).getMonth()].name,
|
|
122
|
-
","
|
|
123
|
-
] }),
|
|
124
|
-
/* @__PURE__ */ e("span", { className: "mr-ds-02", children: new Date(s.dateFilterStart).getFullYear() })
|
|
125
|
-
] }),
|
|
126
|
-
/* @__PURE__ */ e(
|
|
127
|
-
"button",
|
|
128
|
-
{
|
|
129
|
-
"aria-label": "Clear filter",
|
|
130
|
-
onClick: () => {
|
|
131
|
-
d((t) => ({
|
|
132
|
-
...t,
|
|
133
|
-
dateFilterStart: null,
|
|
134
|
-
dateFilterEnd: null
|
|
135
|
-
}));
|
|
136
|
-
},
|
|
137
|
-
className: "border-0 bg-transparent p-0",
|
|
138
|
-
children: /* @__PURE__ */ e(u, { className: "h-ico-sm w-ico-sm" })
|
|
139
|
-
}
|
|
140
|
-
)
|
|
141
|
-
] }),
|
|
142
|
-
/* @__PURE__ */ a(
|
|
143
|
-
m,
|
|
144
|
-
{
|
|
145
|
-
open: s.isOpen,
|
|
146
|
-
onOpenChange: (t) => {
|
|
147
|
-
d((i) => ({ ...i, isOpen: t }));
|
|
148
|
-
},
|
|
149
|
-
children: [
|
|
150
|
-
/* @__PURE__ */ a(o, { className: "text-ds-md flex items-center justify-between rounded-ds-md border border-border-subtle bg-layer-01 p-ds-02b", children: [
|
|
151
|
-
/* @__PURE__ */ a("div", { className: "flex items-center", children: [
|
|
152
|
-
/* @__PURE__ */ e(I, {}),
|
|
153
|
-
/* @__PURE__ */ e("span", { className: "mx-ds-03 text-text-secondary", children: "Date" })
|
|
154
|
-
] }),
|
|
155
|
-
/* @__PURE__ */ e(p, { className: "h-ico-sm w-ico-sm" })
|
|
156
|
-
] }),
|
|
157
|
-
/* @__PURE__ */ e(x, { className: "mr-32 p-ds-04", children: /* @__PURE__ */ a("div", { className: "flex w-[140px] flex-col items-center justify-start", children: [
|
|
158
|
-
/* @__PURE__ */ a("div", { className: "flex w-full items-center justify-between", children: [
|
|
159
|
-
/* @__PURE__ */ e(
|
|
160
|
-
l,
|
|
161
|
-
{
|
|
162
|
-
size: "sm",
|
|
163
|
-
icon: /* @__PURE__ */ e(N, {}),
|
|
164
|
-
"aria-label": "Previous month",
|
|
165
|
-
onClick: g
|
|
166
|
-
}
|
|
167
|
-
),
|
|
168
|
-
/* @__PURE__ */ e("span", { className: "text-ds-md text-text-secondary", children: b[s.currMonth].name }),
|
|
169
|
-
/* @__PURE__ */ e(
|
|
170
|
-
l,
|
|
171
|
-
{
|
|
172
|
-
size: "sm",
|
|
173
|
-
icon: /* @__PURE__ */ e(f, {}),
|
|
174
|
-
"aria-label": "Next month",
|
|
175
|
-
onClick: v
|
|
176
|
-
}
|
|
177
|
-
)
|
|
178
|
-
] }),
|
|
179
|
-
/* @__PURE__ */ a("div", { className: "mt-ds-04 flex w-full items-center justify-between", children: [
|
|
180
|
-
/* @__PURE__ */ e(
|
|
181
|
-
l,
|
|
182
|
-
{
|
|
183
|
-
size: "sm",
|
|
184
|
-
icon: /* @__PURE__ */ e(N, {}),
|
|
185
|
-
"aria-label": "Previous year",
|
|
186
|
-
onClick: () => {
|
|
187
|
-
d((t) => ({
|
|
188
|
-
...t,
|
|
189
|
-
currYear: t.currYear - 1
|
|
190
|
-
}));
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
),
|
|
194
|
-
/* @__PURE__ */ e("span", { className: "text-ds-md text-text-secondary", children: s.currYear }),
|
|
195
|
-
/* @__PURE__ */ e(
|
|
196
|
-
l,
|
|
197
|
-
{
|
|
198
|
-
size: "sm",
|
|
199
|
-
icon: /* @__PURE__ */ e(f, {}),
|
|
200
|
-
"aria-label": "Next year",
|
|
201
|
-
onClick: () => {
|
|
202
|
-
d((t) => ({
|
|
203
|
-
...t,
|
|
204
|
-
currYear: t.currYear + 1
|
|
205
|
-
}));
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
)
|
|
209
|
-
] }),
|
|
210
|
-
/* @__PURE__ */ e(
|
|
211
|
-
j,
|
|
212
|
-
{
|
|
213
|
-
className: "mt-ds-05",
|
|
214
|
-
variant: "outline",
|
|
215
|
-
fullWidth: !0,
|
|
216
|
-
onClick: A,
|
|
217
|
-
children: "Filter"
|
|
218
|
-
}
|
|
219
|
-
)
|
|
220
|
-
] }) })
|
|
221
|
-
]
|
|
222
|
-
}
|
|
223
|
-
)
|
|
224
|
-
] })
|
|
225
|
-
] });
|
|
226
|
-
}
|
|
227
|
-
);
|
|
228
|
-
S.displayName = "BreakAdminHeader";
|
|
229
|
-
export {
|
|
230
|
-
S as BreakAdminHeader
|
|
231
|
-
};
|
|
@@ -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
|
-
};
|