@devalok/shilp-sutra-karm 0.8.1 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/dist/_chunks/chat-panel.js +376 -0
  2. package/dist/_chunks/daily-brief.js +177 -0
  3. package/dist/_chunks/kanban-board.js +597 -0
  4. package/dist/_chunks/project-card.js +121 -0
  5. package/dist/_chunks/render-adjustment-type.js +3596 -0
  6. package/dist/{tasks → _chunks}/task-constants.js +3 -3
  7. package/dist/_chunks/task-detail-panel.js +1305 -0
  8. package/dist/_chunks/use-composed-ref.js +12 -0
  9. package/dist/_chunks/vendor.js +11491 -0
  10. package/dist/admin/index.js +37 -60
  11. package/dist/board/index.js +3 -5
  12. package/dist/chat/index.js +6 -10
  13. package/dist/client/index.js +4 -6
  14. package/dist/dashboard/index.js +3 -4
  15. package/dist/index.js +189 -103
  16. package/dist/tasks/index.js +8 -14
  17. package/package.json +9 -4
  18. package/dist/admin/adjustments/approved-adjustments.js +0 -43
  19. package/dist/admin/break/break-admin-skeleton.js +0 -59
  20. package/dist/admin/break/break-admin.js +0 -373
  21. package/dist/admin/break/break-balance.js +0 -42
  22. package/dist/admin/break/breaks.js +0 -91
  23. package/dist/admin/break/delete-break.js +0 -55
  24. package/dist/admin/break/edit-break-balance.js +0 -113
  25. package/dist/admin/break/edit-break.js +0 -453
  26. package/dist/admin/break/header.js +0 -231
  27. package/dist/admin/break/leave-request.js +0 -162
  28. package/dist/admin/break/use-break-date-picker.js +0 -43
  29. package/dist/admin/dashboard/admin-dashboard.js +0 -337
  30. package/dist/admin/dashboard/associate-detail.js +0 -259
  31. package/dist/admin/dashboard/attendance-overview.js +0 -136
  32. package/dist/admin/dashboard/break-request.js +0 -176
  33. package/dist/admin/dashboard/calendar.js +0 -141
  34. package/dist/admin/dashboard/correction-list.js +0 -102
  35. package/dist/admin/dashboard/dashboard-header.js +0 -155
  36. package/dist/admin/dashboard/dashboard-skeleton.js +0 -109
  37. package/dist/admin/dashboard/leave-requests.js +0 -201
  38. package/dist/admin/dashboard/render-date.js +0 -144
  39. package/dist/admin/dashboard/use-calendar-navigation.js +0 -169
  40. package/dist/admin/dashboard/use-leave-request-interaction.js +0 -34
  41. package/dist/admin/utils/date-range-utils.js +0 -37
  42. package/dist/admin/utils/date-utils.js +0 -119
  43. package/dist/admin/utils/emoji-utils.js +0 -17
  44. package/dist/admin/utils/render-adjustment-type.js +0 -20
  45. package/dist/admin/utils/render-status.js +0 -22
  46. package/dist/board/board-column.js +0 -236
  47. package/dist/board/kanban-board.js +0 -218
  48. package/dist/board/task-card.js +0 -168
  49. package/dist/chat/chat-input.js +0 -54
  50. package/dist/chat/chat-panel.js +0 -151
  51. package/dist/chat/conversation-list.js +0 -99
  52. package/dist/chat/markdown-components.js +0 -35
  53. package/dist/chat/message-list.js +0 -59
  54. package/dist/chat/streaming-text.js +0 -17
  55. package/dist/client/accent-provider.js +0 -22
  56. package/dist/client/client-portal-header.js +0 -48
  57. package/dist/client/project-card.js +0 -60
  58. package/dist/dashboard/attendance-cta.js +0 -115
  59. package/dist/dashboard/daily-brief.js +0 -68
  60. package/dist/page-skeletons.js +0 -130
  61. package/dist/tasks/activity-tab.js +0 -185
  62. package/dist/tasks/conversation-tab.js +0 -138
  63. package/dist/tasks/files-tab.js +0 -186
  64. package/dist/tasks/review-tab.js +0 -170
  65. package/dist/tasks/subtasks-tab.js +0 -154
  66. package/dist/tasks/task-detail-panel.js +0 -210
  67. package/dist/tasks/task-properties.js +0 -324
  68. package/dist/utils/use-composed-ref.js +0 -12
@@ -1,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
- };
@@ -1,259 +0,0 @@
1
- "use client";
2
- import { jsxs as l, jsx as i, Fragment as y } from "react/jsx-runtime";
3
- import * as H from "react";
4
- import { useState as E } from "react";
5
- import { Dialog as q, DialogTrigger as z, DialogContent as G, DialogHeader as $, DialogFooter as V, DialogClose as W } from "@devalok/shilp-sutra/ui/dialog";
6
- import { Button as _ } from "@devalok/shilp-sutra/ui/button";
7
- import { IconButton as L } from "@devalok/shilp-sutra/ui/icon-button";
8
- import { cn as O } from "@devalok/shilp-sutra/ui/lib/utils";
9
- import { isSameDay as Y } from "../utils/date-utils.js";
10
- import { BreakRequestCard as R } from "./break-request.js";
11
- import { isBefore as F, startOfDay as J, format as Q } from "date-fns";
12
- import { IconPencil as X, IconSend as Z, IconGripVertical as T, IconSquareCheck as e, IconSquare as A, IconPlus as U } from "@tabler/icons-react";
13
- function ii({
14
- selectedUserAttendance: s
15
- }) {
16
- const m = (s == null ? void 0 : s.status) || "ABSENT", o = m === "Not_Marked" ? "ABSENT" : m, r = o.charAt(0).toUpperCase() + o.slice(1).toLowerCase(), u = s != null && s.timeIn ? new Date(s.timeIn).toLocaleTimeString() : null;
17
- return /* @__PURE__ */ l("div", { className: "flex w-full flex-col items-center justify-center px-ds-05 py-ds-07 sm:px-ds-05 sm:py-ds-06 md:px-ds-06 md:py-ds-05 md:pr-0", children: [
18
- /* @__PURE__ */ i("p", { className: "text-ds-sm font-semibold uppercase tracking-wider mb-ds-06 text-text-tertiary", children: "Attendance status" }),
19
- /* @__PURE__ */ l("div", { className: "mb-ds-04 flex w-full items-center justify-center gap-ds-03 rounded-ds-3xl border border-border-subtle px-ds-05 py-ds-04 text-center", children: [
20
- /* @__PURE__ */ i("span", { className: "font-semibold text-interactive", children: r }),
21
- r === "Absent" && /* @__PURE__ */ i("div", { className: "w-px h-5 opacity-[0.5] bg-border-strong" }),
22
- !u && m !== "HOLIDAY" && m !== "WEEKEND" && /* @__PURE__ */ i("span", { className: "text-ds-md text-text-tertiary", children: "Not marked" }),
23
- !!u && m === "ABSENT" && /* @__PURE__ */ i("span", { className: "text-ds-md text-text-tertiary", children: "Removed" })
24
- ] }),
25
- u && /* @__PURE__ */ l("p", { className: "text-ds-md m-0 text-center text-text-disabled", children: [
26
- "Marked at ",
27
- u
28
- ] })
29
- ] });
30
- }
31
- function ri({
32
- selectedAssociate: s,
33
- selectedDate: m,
34
- selectedUserAttendance: o,
35
- onUpdateAttendanceStatus: r
36
- }) {
37
- return /* @__PURE__ */ l(G, { className: "sm:max-w-md", children: [
38
- /* @__PURE__ */ i($, { children: /* @__PURE__ */ l("div", { className: "text-ds-md text-text-tertiary", children: [
39
- "Edit attendance of",
40
- " ",
41
- /* @__PURE__ */ i("span", { className: "text-ds-md font-semibold text-interactive", children: s.name })
42
- ] }) }),
43
- /* @__PURE__ */ l("div", { className: "flex flex-col items-center justify-start", children: [
44
- /* @__PURE__ */ i("div", { className: "text-ds-lg mb-ds-05 text-interactive", children: Q(new Date(m), "dd MMMM ''yy") }),
45
- /* @__PURE__ */ i("div", { className: "mb-ds-04 flex w-full items-center justify-center gap-ds-03 rounded-ds-3xl border border-border-subtle px-ds-05 py-ds-04 text-center font-semibold text-interactive", children: (o == null ? void 0 : o.status) === "PRESENT" ? "PRESENT " : "ABSENT" })
46
- ] }),
47
- /* @__PURE__ */ i(V, { className: "sm:justify-start", children: /* @__PURE__ */ i(W, { asChild: !0, children: /* @__PURE__ */ i(
48
- _,
49
- {
50
- variant: "solid",
51
- fullWidth: !0,
52
- onClick: () => {
53
- const u = (o == null ? void 0 : o.status) !== "PRESENT";
54
- r == null || r({
55
- userId: s.id,
56
- date: m,
57
- isPresent: u
58
- });
59
- },
60
- children: `Mark as ${(o == null ? void 0 : o.status) === "PRESENT" ? "absent" : "present"}`
61
- }
62
- ) }) })
63
- ] });
64
- }
65
- const ai = H.forwardRef(
66
- function({
67
- selectedAssociate: m,
68
- selectedDate: o,
69
- selectedUserAttendance: r,
70
- userTasks: u,
71
- selectedBreakRequest: v,
72
- isFutureDate: n,
73
- assetsBaseUrl: w,
74
- onUpdateAttendanceStatus: x,
75
- onToggleTaskStatus: h,
76
- onAddTask: d,
77
- onReorderTasks: g,
78
- onCancelBreak: D,
79
- onRefreshSelectedUserAttendance: c,
80
- onRefreshAttendanceData: I
81
- }, j) {
82
- const [b, M] = E(""), [p, C] = E(null), [B, N] = E(null), P = async (a) => {
83
- a.preventDefault(), !(!b.trim() || !m) && (await (d == null ? void 0 : d(b, m.id)), M(""));
84
- }, S = (a, t) => {
85
- C(t), a.target.classList.add("dragging");
86
- }, k = async (a, t) => {
87
- if (a.preventDefault(), p !== null && p !== t) {
88
- const f = u[p], K = u[t];
89
- await (g == null ? void 0 : g(f.id, K.id));
90
- }
91
- C(null), N(null);
92
- };
93
- return /* @__PURE__ */ l("div", { ref: j, className: "relative flex items-center justify-between md:items-stretch", children: [
94
- !n && (r == null ? void 0 : r.status) !== "BREAK" && /* @__PURE__ */ l(q, { children: [
95
- /* @__PURE__ */ i(z, { asChild: !0, children: /* @__PURE__ */ i(
96
- L,
97
- {
98
- icon: /* @__PURE__ */ i(X, {}),
99
- size: "sm",
100
- "aria-label": "Edit",
101
- className: "absolute right-2 top-2"
102
- }
103
- ) }),
104
- /* @__PURE__ */ i(
105
- ri,
106
- {
107
- selectedAssociate: m,
108
- selectedDate: o,
109
- selectedUserAttendance: r,
110
- onUpdateAttendanceStatus: x
111
- }
112
- )
113
- ] }),
114
- n ? /* @__PURE__ */ i(y, { children: (r == null ? void 0 : r.status) === "BREAK" ? /* @__PURE__ */ i(
115
- R,
116
- {
117
- selectedDate: o,
118
- userId: m.id,
119
- breakRequest: v,
120
- assetsBaseUrl: w,
121
- onCancelBreak: D,
122
- onRefreshAttendance: c,
123
- onRefreshGroupedAttendance: I
124
- }
125
- ) : /* @__PURE__ */ i("div", { className: "min-h-28" }) }) : (r == null ? void 0 : r.status) === "BREAK" ? /* @__PURE__ */ i(
126
- R,
127
- {
128
- selectedDate: o,
129
- userId: m.id,
130
- breakRequest: v,
131
- assetsBaseUrl: w,
132
- onCancelBreak: D,
133
- onRefreshAttendance: c,
134
- onRefreshGroupedAttendance: I
135
- }
136
- ) : (r == null ? void 0 : r.status) === "ABSENT" || (r == null ? void 0 : r.status) === "Not_Marked" && F(
137
- new Date(o),
138
- J(/* @__PURE__ */ new Date())
139
- ) ? /* @__PURE__ */ l("div", { className: "flex w-full flex-col items-center justify-center p-ds-06", children: [
140
- /* @__PURE__ */ i("p", { className: "text-ds-sm font-semibold uppercase tracking-wider mb-ds-05 text-text-tertiary", children: "COMMENT" }),
141
- /* @__PURE__ */ l("div", { className: "flex w-full items-center justify-between rounded-ds-lg border border-border bg-layer-01 px-ds-05 max-md:h-ds-lg", children: [
142
- /* @__PURE__ */ i(
143
- "input",
144
- {
145
- className: "text-ds-md flex-1 border-none py-ds-03 text-text-primary outline-none",
146
- defaultValue: "Don't miss next time :)"
147
- }
148
- ),
149
- /* @__PURE__ */ i(
150
- L,
151
- {
152
- icon: /* @__PURE__ */ i(Z, {}),
153
- size: "sm",
154
- "aria-label": "Update status",
155
- onClick: () => {
156
- const a = (r == null ? void 0 : r.status) !== "PRESENT";
157
- x == null || x({
158
- userId: m.id,
159
- date: o,
160
- isPresent: a
161
- });
162
- }
163
- }
164
- )
165
- ] })
166
- ] }) : /* @__PURE__ */ l("div", { className: "mb-auto flex w-full flex-col md:pr-ds-06", children: [
167
- /* @__PURE__ */ i("p", { className: "text-ds-sm font-semibold uppercase tracking-wider mb-ds-06 text-interactive", children: "Tasks for the day" }),
168
- u && /* @__PURE__ */ l(y, { children: [
169
- /* @__PURE__ */ i("div", { className: "no-scrollbar mb-ds-03 flex max-h-[250px] flex-col gap-ds-03 overflow-y-auto", children: u.map((a, t) => (
170
- // eslint-disable-next-line jsx-a11y/no-static-element-interactions
171
- /* @__PURE__ */ l(
172
- "div",
173
- {
174
- className: O("task-item mb-ds-03 flex items-center gap-ds-02", p === t ? "dragging" : ""),
175
- draggable: !0,
176
- onDragStart: (f) => S(f, t),
177
- onDragOver: (f) => f.preventDefault(),
178
- onDrop: (f) => k(f, t),
179
- onDragEnter: () => N(t),
180
- onDragLeave: () => N(null),
181
- onDragEnd: (f) => {
182
- f.target instanceof HTMLElement && f.target.classList.remove("dragging");
183
- },
184
- children: [
185
- B === t && /* @__PURE__ */ i("div", { className: "drop-indicator" }),
186
- a.status === "COMPLETED" ? /* @__PURE__ */ i(T, { className: "" }) : /* @__PURE__ */ i(T, {}),
187
- /* @__PURE__ */ i(
188
- "button",
189
- {
190
- type: "button",
191
- onClick: () => {
192
- h == null || h(
193
- a.id,
194
- a.status === "COMPLETED" ? "TODO" : "COMPLETED"
195
- );
196
- },
197
- "aria-label": a.status === "COMPLETED" ? `Mark "${a.title}" as incomplete` : `Mark "${a.title}" as complete`,
198
- className: "cursor-pointer",
199
- children: a.status === "COMPLETED" ? /* @__PURE__ */ i(e, { className: "text-interactive-hover" }) : /* @__PURE__ */ i(A, {})
200
- }
201
- ),
202
- /* @__PURE__ */ i(
203
- "p",
204
- {
205
- className: O("text-ds-md flex-1 overflow-hidden hyphens-auto break-all pr-ds-05 break-words min-w-0", a.status === "COMPLETED" ? "text-text-disabled line-through" : "text-text-secondary"),
206
- children: a.title
207
- }
208
- )
209
- ]
210
- },
211
- a.id
212
- )
213
- )) }),
214
- Y(new Date(o), /* @__PURE__ */ new Date()) && /* @__PURE__ */ l(
215
- "form",
216
- {
217
- className: "flex items-center gap-ds-02 pb-ds-05",
218
- onSubmit: P,
219
- children: [
220
- /* @__PURE__ */ i("div", { className: "w-ds-06" }),
221
- /* @__PURE__ */ i("button", { type: "submit", className: "appearance-none", children: /* @__PURE__ */ i(U, {}) }),
222
- /* @__PURE__ */ i(
223
- "textarea",
224
- {
225
- className: "text-ds-md flex w-full resize-none items-center border-none bg-transparent !leading-6 text-text-secondary outline-none placeholder:leading-6",
226
- placeholder: "Add a task",
227
- value: b,
228
- onChange: (a) => M(a.target.value),
229
- onKeyDown: (a) => {
230
- a.key === "Enter" && !a.shiftKey && (a.preventDefault(), P(a));
231
- },
232
- rows: 1,
233
- style: {
234
- minHeight: "24px",
235
- height: "auto",
236
- overflow: "hidden"
237
- },
238
- onInput: (a) => {
239
- const t = a.target;
240
- t.style.height = "auto", t.style.height = t.scrollHeight + "px";
241
- }
242
- }
243
- )
244
- ]
245
- }
246
- )
247
- ] })
248
- ] }),
249
- !n && (r == null ? void 0 : r.status) !== "BREAK" && /* @__PURE__ */ l(y, { children: [
250
- /* @__PURE__ */ i("div", { className: "block h-full w-[2px] bg-border-subtle" }),
251
- /* @__PURE__ */ i(ii, { selectedUserAttendance: r })
252
- ] })
253
- ] });
254
- }
255
- );
256
- ai.displayName = "AssociateDetail";
257
- export {
258
- ai as AssociateDetail
259
- };