@burdenoff/microfe-crewfoundry 2026.1029.2 → 2026.1030.2

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 (47) hide show
  1. package/dist/crewfoundry/components/EmployeeSkillsPanel.d.ts +12 -0
  2. package/dist/crewfoundry/components/EmployeeSkillsPanel.d.ts.map +1 -0
  3. package/dist/crewfoundry/components/EmployeeSkillsPanel.js +168 -0
  4. package/dist/crewfoundry/components/EmployeeSkillsPanel.js.map +1 -0
  5. package/dist/crewfoundry/lib/useFocusedRecordParam.d.ts +51 -0
  6. package/dist/crewfoundry/lib/useFocusedRecordParam.d.ts.map +1 -0
  7. package/dist/crewfoundry/lib/useFocusedRecordParam.js +38 -0
  8. package/dist/crewfoundry/lib/useFocusedRecordParam.js.map +1 -0
  9. package/dist/crewfoundry/pages/CommunicationsAnnouncementsPagePage.d.ts.map +1 -1
  10. package/dist/crewfoundry/pages/CommunicationsAnnouncementsPagePage.js +119 -112
  11. package/dist/crewfoundry/pages/CommunicationsAnnouncementsPagePage.js.map +1 -1
  12. package/dist/crewfoundry/pages/CompanyClientManagementPagePage.d.ts.map +1 -1
  13. package/dist/crewfoundry/pages/CompanyClientManagementPagePage.js +78 -71
  14. package/dist/crewfoundry/pages/CompanyClientManagementPagePage.js.map +1 -1
  15. package/dist/crewfoundry/pages/CompanyVendorManagementPagePage.d.ts.map +1 -1
  16. package/dist/crewfoundry/pages/CompanyVendorManagementPagePage.js +88 -81
  17. package/dist/crewfoundry/pages/CompanyVendorManagementPagePage.js.map +1 -1
  18. package/dist/crewfoundry/pages/HiringCandidatesPagePage.d.ts.map +1 -1
  19. package/dist/crewfoundry/pages/HiringCandidatesPagePage.js +133 -126
  20. package/dist/crewfoundry/pages/HiringCandidatesPagePage.js.map +1 -1
  21. package/dist/crewfoundry/pages/HiringInterviewsPagePage.d.ts.map +1 -1
  22. package/dist/crewfoundry/pages/HiringInterviewsPagePage.js +150 -143
  23. package/dist/crewfoundry/pages/HiringInterviewsPagePage.js.map +1 -1
  24. package/dist/crewfoundry/pages/HrDepartmentsPagePage.d.ts.map +1 -1
  25. package/dist/crewfoundry/pages/HrDepartmentsPagePage.js +110 -103
  26. package/dist/crewfoundry/pages/HrDepartmentsPagePage.js.map +1 -1
  27. package/dist/crewfoundry/pages/HrEmployeeProfilePagePage.d.ts.map +1 -1
  28. package/dist/crewfoundry/pages/HrEmployeeProfilePagePage.js +124 -134
  29. package/dist/crewfoundry/pages/HrEmployeeProfilePagePage.js.map +1 -1
  30. package/dist/crewfoundry/pages/HrLeaveManagementPagePage.d.ts.map +1 -1
  31. package/dist/crewfoundry/pages/HrLeaveManagementPagePage.js +173 -162
  32. package/dist/crewfoundry/pages/HrLeaveManagementPagePage.js.map +1 -1
  33. package/dist/crewfoundry/pages/HrPayrollPagePage.d.ts.map +1 -1
  34. package/dist/crewfoundry/pages/HrPayrollPagePage.js +169 -158
  35. package/dist/crewfoundry/pages/HrPayrollPagePage.js.map +1 -1
  36. package/dist/crewfoundry/pages/HrTimeTrackingPagePage.d.ts.map +1 -1
  37. package/dist/crewfoundry/pages/HrTimeTrackingPagePage.js +179 -163
  38. package/dist/crewfoundry/pages/HrTimeTrackingPagePage.js.map +1 -1
  39. package/dist/crewfoundry/store/crewfoundryStore.d.ts +22 -0
  40. package/dist/crewfoundry/store/crewfoundryStore.d.ts.map +1 -1
  41. package/dist/crewfoundry/store/crewfoundryStore.js +158 -129
  42. package/dist/crewfoundry/store/crewfoundryStore.js.map +1 -1
  43. package/dist/utils/pageContext.d.ts +43 -4
  44. package/dist/utils/pageContext.d.ts.map +1 -1
  45. package/dist/utils/pageContext.js +10 -3
  46. package/dist/utils/pageContext.js.map +1 -1
  47. package/package.json +3 -2
@@ -5,15 +5,16 @@ import { AvatarStack as r } from "../components/viz/AvatarStack.js";
5
5
  import { SegmentedTabs as i } from "../components/viz/SegmentedTabs.js";
6
6
  import "../components/viz/index.js";
7
7
  import { FormModal as a, useFormModal as o } from "../components/forms/FormModal.js";
8
- import { getNumber as s, getText as c, newClientId as l } from "../components/forms/formValues.js";
9
- import { useMemo as u, useState as d } from "react";
10
- import { Calendar as f, CheckCircle as p, ChevronLeft as m, ChevronRight as h, Clock as g, XCircle as _ } from "lucide-react";
11
- import { jsx as v, jsxs as y } from "react/jsx-runtime";
12
- import { Badge as b, Button as x, Card as S, CardContent as C, CardDescription as w, CardHeader as T, CardTitle as E, GradientText as D, PagePurpose as O, Pagination as ee, ResponsiveTable as te } from "@burdenoff/fe-libs/ui";
13
- import { usePagination as k } from "@burdenoff/fe-libs/shared/hooks";
14
- import { useAuth as A, useGlobalUi as j } from "@burdenoff/fe-libs/shared/providers/shell";
8
+ import { FOCUSED_CELL_CLASS as s, pageContaining as c, useFocusedRecordParam as l } from "../lib/useFocusedRecordParam.js";
9
+ import { getNumber as u, getText as d, newClientId as ee } from "../components/forms/formValues.js";
10
+ import { useMemo as f, useState as p } from "react";
11
+ import { Calendar as m, CheckCircle as h, ChevronLeft as g, ChevronRight as _, Clock as v, XCircle as te } from "lucide-react";
12
+ import { jsx as y, jsxs as b } from "react/jsx-runtime";
13
+ import { Badge as x, Button as S, Card as C, CardContent as w, CardDescription as T, CardHeader as E, CardTitle as D, GradientText as ne, PagePurpose as re, Pagination as ie, ResponsiveTable as ae } from "@burdenoff/fe-libs/ui";
14
+ import { usePagination as oe } from "@burdenoff/fe-libs/shared/hooks";
15
+ import { useAuth as se, useGlobalUi as O } from "@burdenoff/fe-libs/shared/providers/shell";
15
16
  //#region src/crewfoundry/pages/HrLeaveManagementPagePage.tsx
16
- var ne = [
17
+ var k = [
17
18
  {
18
19
  label: "Annual",
19
20
  value: "annual"
@@ -38,7 +39,7 @@ var ne = [
38
39
  label: "Unpaid",
39
40
  value: "unpaid"
40
41
  }
41
- ], M = (e) => e.split("_").map((e) => e[0]?.toUpperCase() + e.slice(1)).join(" "), N = {
42
+ ], A = (e) => e.split("_").map((e) => e[0]?.toUpperCase() + e.slice(1)).join(" "), j = {
42
43
  annual: {
43
44
  label: "Annual",
44
45
  dot: "var(--color-status-success-text)",
@@ -69,11 +70,11 @@ var ne = [
69
70
  dot: "var(--color-text-muted)",
70
71
  cell: "bg-bg-sunken"
71
72
  }
72
- }, P = (e) => N[e] ?? {
73
- label: M(e),
73
+ }, M = (e) => j[e] ?? {
74
+ label: A(e),
74
75
  dot: "var(--color-accent-blue)",
75
76
  cell: "bg-bg-sunken"
76
- }, F = [
77
+ }, N = [
77
78
  "January",
78
79
  "February",
79
80
  "March",
@@ -86,7 +87,7 @@ var ne = [
86
87
  "October",
87
88
  "November",
88
89
  "December"
89
- ], I = [
90
+ ], P = [
90
91
  "Su",
91
92
  "Mo",
92
93
  "Tu",
@@ -94,111 +95,111 @@ var ne = [
94
95
  "Th",
95
96
  "Fr",
96
97
  "Sa"
97
- ], L = (e) => `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`, R = (e) => e.slice(0, 10);
98
- function z({ leaveRequests: e, monthCursor: t, onPrev: n, onNext: r }) {
99
- let i = t.getFullYear(), a = t.getMonth(), o = L(/* @__PURE__ */ new Date()), s = u(() => e.filter((e) => e.status === "approved" || e.status === "pending"), [e]), c = new Date(i, a, 1);
98
+ ], F = (e) => `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`, I = (e) => e.slice(0, 10);
99
+ function L({ leaveRequests: e, monthCursor: t, onPrev: n, onNext: r }) {
100
+ let i = t.getFullYear(), a = t.getMonth(), o = F(/* @__PURE__ */ new Date()), s = f(() => e.filter((e) => e.status === "approved" || e.status === "pending"), [e]), c = new Date(i, a, 1);
100
101
  c.setDate(1 - c.getDay());
101
102
  let l = Array.from({ length: 42 }, (e, t) => {
102
103
  let n = new Date(c);
103
104
  n.setDate(c.getDate() + t);
104
- let r = L(n), i = /* @__PURE__ */ new Set();
105
- for (let e of s) R(e.startDate) <= r && r <= R(e.endDate) && i.add(e.type);
105
+ let r = F(n), i = /* @__PURE__ */ new Set();
106
+ for (let e of s) I(e.startDate) <= r && r <= I(e.endDate) && i.add(e.type);
106
107
  return {
107
108
  date: n,
108
109
  dayStr: r,
109
110
  inMonth: n.getMonth() === a,
110
111
  types: [...i]
111
112
  };
112
- }), d = u(() => {
113
+ }), u = f(() => {
113
114
  let e = /* @__PURE__ */ new Set();
114
115
  for (let t of l) t.inMonth && t.types.forEach((t) => e.add(t));
115
116
  return [...e];
116
117
  }, [l]);
117
- return /* @__PURE__ */ y(S, { children: [/* @__PURE__ */ y(T, {
118
+ return /* @__PURE__ */ b(C, { children: [/* @__PURE__ */ b(E, {
118
119
  className: "flex flex-row items-center justify-between space-y-0",
119
- children: [/* @__PURE__ */ y(E, {
120
+ children: [/* @__PURE__ */ b(D, {
120
121
  className: "text-base",
121
122
  children: [
122
- F[a],
123
+ N[a],
123
124
  " ",
124
125
  i
125
126
  ]
126
- }), /* @__PURE__ */ y("div", {
127
+ }), /* @__PURE__ */ b("div", {
127
128
  className: "flex gap-1",
128
- children: [/* @__PURE__ */ v(x, {
129
+ children: [/* @__PURE__ */ y(S, {
129
130
  variant: "outline",
130
131
  size: "sm",
131
132
  className: "h-8 w-8 p-0",
132
133
  "aria-label": "Previous month",
133
134
  onClick: n,
134
- children: /* @__PURE__ */ v(m, { className: "h-4 w-4" })
135
- }), /* @__PURE__ */ v(x, {
135
+ children: /* @__PURE__ */ y(g, { className: "h-4 w-4" })
136
+ }), /* @__PURE__ */ y(S, {
136
137
  variant: "outline",
137
138
  size: "sm",
138
139
  className: "h-8 w-8 p-0",
139
140
  "aria-label": "Next month",
140
141
  onClick: r,
141
- children: /* @__PURE__ */ v(h, { className: "h-4 w-4" })
142
+ children: /* @__PURE__ */ y(_, { className: "h-4 w-4" })
142
143
  })]
143
144
  })]
144
- }), /* @__PURE__ */ y(C, {
145
+ }), /* @__PURE__ */ b(w, {
145
146
  className: "space-y-3",
146
147
  children: [
147
- /* @__PURE__ */ v("div", {
148
+ /* @__PURE__ */ y("div", {
148
149
  className: "grid grid-cols-7 gap-1 text-center text-xs font-medium text-text-secondary",
149
- children: I.map((e) => /* @__PURE__ */ v("div", { children: e }, e))
150
+ children: P.map((e) => /* @__PURE__ */ y("div", { children: e }, e))
150
151
  }),
151
- /* @__PURE__ */ v("div", {
152
+ /* @__PURE__ */ y("div", {
152
153
  className: "grid grid-cols-7 gap-1",
153
154
  children: l.map((e) => {
154
- let t = e.types[0], n = e.inMonth && t ? P(t).cell : "", r = e.dayStr === o;
155
- return /* @__PURE__ */ y("div", {
155
+ let t = e.types[0], n = e.inMonth && t ? M(t).cell : "", r = e.dayStr === o;
156
+ return /* @__PURE__ */ b("div", {
156
157
  className: `relative flex aspect-square flex-col items-center justify-center rounded-md text-xs ${n} ${e.inMonth ? "text-text-primary" : "text-text-muted"} ${r ? "ring-2 ring-action-primary-bg" : ""}`,
157
- title: e.types.length > 0 ? `${e.dayStr}: ${e.types.map((e) => P(e).label).join(", ")}` : e.dayStr,
158
- children: [/* @__PURE__ */ v("span", {
158
+ title: e.types.length > 0 ? `${e.dayStr}: ${e.types.map((e) => M(e).label).join(", ")}` : e.dayStr,
159
+ children: [/* @__PURE__ */ y("span", {
159
160
  className: e.types.length > 0 ? "font-semibold" : "",
160
161
  children: e.date.getDate()
161
- }), e.types.length > 0 && /* @__PURE__ */ v("span", {
162
+ }), e.types.length > 0 && /* @__PURE__ */ y("span", {
162
163
  className: "mt-0.5 flex gap-0.5",
163
- children: e.types.slice(0, 3).map((e) => /* @__PURE__ */ v("span", {
164
+ children: e.types.slice(0, 3).map((e) => /* @__PURE__ */ y("span", {
164
165
  className: "h-1 w-1 rounded-full",
165
- style: { backgroundColor: P(e).dot }
166
+ style: { backgroundColor: M(e).dot }
166
167
  }, e))
167
168
  })]
168
169
  }, e.dayStr);
169
170
  })
170
171
  }),
171
- d.length > 0 && /* @__PURE__ */ v("div", {
172
+ u.length > 0 && /* @__PURE__ */ y("div", {
172
173
  className: "flex flex-wrap gap-3 pt-1 text-xs text-text-secondary",
173
- children: d.map((e) => /* @__PURE__ */ y("span", {
174
+ children: u.map((e) => /* @__PURE__ */ b("span", {
174
175
  className: "flex items-center gap-1.5",
175
- children: [/* @__PURE__ */ v("span", {
176
+ children: [/* @__PURE__ */ y("span", {
176
177
  className: "h-2.5 w-2.5 rounded-full",
177
- style: { backgroundColor: P(e).dot }
178
- }), P(e).label]
178
+ style: { backgroundColor: M(e).dot }
179
+ }), M(e).label]
179
180
  }, e))
180
181
  })
181
182
  ]
182
183
  })] });
183
184
  }
184
- function B() {
185
- let { leaveRequests: m, employees: h, addLeaveRequest: N, updateLeaveRequest: F } = e(), { showToast: I } = j(), { currentUser: L } = A(), B = o(), [V, H] = d("requests"), U = u(() => new Map(h.map((e) => [e.id, e])), [h]), [W, G] = d(() => {
186
- let e = m.filter((e) => e.status === "approved" || e.status === "pending").map((e) => R(e.startDate)).sort(), t = e[e.length - 1];
185
+ function R() {
186
+ let { leaveRequests: g, employees: _, addLeaveRequest: j, updateLeaveRequest: N } = e(), { showToast: P } = O(), { currentUser: F } = se(), R = o(), [z, B] = p("requests"), V = f(() => new Map(_.map((e) => [e.id, e])), [_]), [H, U] = p(() => {
187
+ let e = g.filter((e) => e.status === "approved" || e.status === "pending").map((e) => I(e.startDate)).sort(), t = e[e.length - 1];
187
188
  if (t) {
188
189
  let [e, n] = t.split("-").map(Number);
189
190
  return new Date(e, (n || 1) - 1, 1);
190
191
  }
191
192
  return /* @__PURE__ */ new Date();
192
- }), K = (e) => G((t) => new Date(t.getFullYear(), t.getMonth() + e, 1)), q = L?.name || [L?.firstName, L?.lastName].filter(Boolean).join(" ") || L?.email || "Manager", J = u(() => h.map((e) => ({
193
+ }), W = (e) => U((t) => new Date(t.getFullYear(), t.getMonth() + e, 1)), G = F?.name || [F?.firstName, F?.lastName].filter(Boolean).join(" ") || F?.email || "Manager", K = f(() => _.map((e) => ({
193
194
  label: `${e.firstName} ${e.lastName}`,
194
195
  value: e.id
195
- })), [h]), Y = u(() => [
196
+ })), [_]), ce = f(() => [
196
197
  {
197
198
  name: "employeeId",
198
199
  label: "Employee",
199
200
  type: "select",
200
201
  required: !0,
201
- options: J,
202
+ options: K,
202
203
  colSpan: 2
203
204
  },
204
205
  {
@@ -206,7 +207,7 @@ function B() {
206
207
  label: "Leave type",
207
208
  type: "select",
208
209
  required: !0,
209
- options: ne
210
+ options: k
210
211
  },
211
212
  {
212
213
  name: "days",
@@ -233,7 +234,7 @@ function B() {
233
234
  required: !0,
234
235
  colSpan: 2
235
236
  }
236
- ], [J]), X = m.filter((e) => e.status === "pending").length, re = m.filter((e) => e.status === "approved").length, ie = m.filter((e) => e.status === "approved").reduce((e, t) => e + t.days, 0), ae = u(() => {
237
+ ], [K]), le = g.filter((e) => e.status === "pending").length, ue = g.filter((e) => e.status === "approved").length, de = g.filter((e) => e.status === "approved").reduce((e, t) => e + t.days, 0), fe = f(() => {
237
238
  let e = {
238
239
  annual: 20,
239
240
  sick: 12,
@@ -241,38 +242,47 @@ function B() {
241
242
  maternity: 90,
242
243
  paternity: 30,
243
244
  unpaid: 15
244
- }, t = m.filter((e) => e.status === "approved").reduce((e, t) => (e[t.type] = (e[t.type] || 0) + t.days, e), {});
245
+ }, t = g.filter((e) => e.status === "approved").reduce((e, t) => (e[t.type] = (e[t.type] || 0) + t.days, e), {});
245
246
  return Object.entries(e).map(([e, n]) => {
246
247
  let r = t[e] || 0;
247
248
  return {
248
- type: M(e),
249
+ type: A(e),
249
250
  total: n,
250
251
  used: r,
251
252
  remaining: Math.max(n - r, 0)
252
253
  };
253
254
  });
254
- }, [m]), oe = u(() => {
255
+ }, [g]), q = f(() => {
255
256
  let e = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
256
- return m.filter((t) => t.status === "approved" && t.startDate <= e && t.endDate >= e).length;
257
- }, [m]), Z = u(() => [...m].sort((e, t) => t.startDate.localeCompare(e.startDate)), [m]), Q = k({ initialPageSize: 10 }), se = Z.slice(Q.offset, Q.offset + Q.pageSize), ce = [
257
+ return g.filter((t) => t.status === "approved" && t.startDate <= e && t.endDate >= e).length;
258
+ }, [g]), J = f(() => [...g].sort((e, t) => t.startDate.localeCompare(e.startDate)), [g]), Y = oe({ initialPageSize: 10 }), pe = J.slice(Y.offset, Y.offset + Y.pageSize), [X, Z] = p(null), Q = X && g.some((e) => e.id === X) ? X : null;
259
+ l({
260
+ records: g,
261
+ activeId: Q,
262
+ onRestore: (e) => {
263
+ Z(e.id), B("requests"), Y.setPage(c(J, e.id, Y.pageSize));
264
+ }
265
+ });
266
+ let me = [
258
267
  {
259
268
  key: "employee",
260
269
  header: "Employee",
261
270
  priority: "primary",
262
- cell: (e) => /* @__PURE__ */ y("div", {
263
- className: "flex items-center gap-2.5",
264
- children: [/* @__PURE__ */ v(r, {
271
+ cell: (e) => /* @__PURE__ */ b("div", {
272
+ "aria-current": e.id === Q ? "true" : void 0,
273
+ className: `flex items-center gap-2.5 ${e.id === Q ? s : ""}`,
274
+ children: [/* @__PURE__ */ y(r, {
265
275
  people: [{
266
276
  name: e.employeeName,
267
- avatarUrl: U.get(e.employeeId)?.avatar
277
+ avatarUrl: V.get(e.employeeId)?.avatar
268
278
  }],
269
279
  size: 32
270
- }), /* @__PURE__ */ y("div", {
280
+ }), /* @__PURE__ */ b("div", {
271
281
  className: "min-w-0",
272
- children: [/* @__PURE__ */ v("p", {
282
+ children: [/* @__PURE__ */ y("p", {
273
283
  className: "truncate font-medium",
274
284
  children: e.employeeName
275
- }), /* @__PURE__ */ v("p", {
285
+ }), /* @__PURE__ */ y("p", {
276
286
  className: "truncate text-xs text-text-secondary",
277
287
  children: e.department
278
288
  })]
@@ -282,12 +292,12 @@ function B() {
282
292
  {
283
293
  key: "type",
284
294
  header: "Type",
285
- cell: (e) => /* @__PURE__ */ y("span", {
295
+ cell: (e) => /* @__PURE__ */ b("span", {
286
296
  className: "flex items-center gap-1.5",
287
- children: [/* @__PURE__ */ v("span", {
297
+ children: [/* @__PURE__ */ y("span", {
288
298
  className: "h-2 w-2 rounded-full",
289
- style: { backgroundColor: P(e.type).dot }
290
- }), /* @__PURE__ */ v("span", {
299
+ style: { backgroundColor: M(e.type).dot }
300
+ }), /* @__PURE__ */ y("span", {
291
301
  className: "text-xs",
292
302
  children: t(e.type)
293
303
  })]
@@ -296,7 +306,7 @@ function B() {
296
306
  {
297
307
  key: "period",
298
308
  header: "Dates",
299
- cell: (e) => /* @__PURE__ */ y("span", {
309
+ cell: (e) => /* @__PURE__ */ b("span", {
300
310
  className: "text-xs",
301
311
  children: [
302
312
  e.startDate,
@@ -310,7 +320,7 @@ function B() {
310
320
  header: "Days",
311
321
  headerClassName: "text-right",
312
322
  cellClassName: "md:text-right",
313
- cell: (e) => /* @__PURE__ */ v("span", {
323
+ cell: (e) => /* @__PURE__ */ y("span", {
314
324
  className: "tabular-nums",
315
325
  children: e.days
316
326
  })
@@ -318,79 +328,79 @@ function B() {
318
328
  {
319
329
  key: "status",
320
330
  header: "Status",
321
- cell: (e) => e.status === "pending" ? /* @__PURE__ */ y("div", {
331
+ cell: (e) => e.status === "pending" ? /* @__PURE__ */ b("div", {
322
332
  className: "flex items-center gap-1.5",
323
- children: [/* @__PURE__ */ v(x, {
333
+ children: [/* @__PURE__ */ y(S, {
324
334
  size: "sm",
325
335
  className: "h-7 text-xs",
326
336
  onClick: () => $(e, "approved"),
327
337
  children: "Approve"
328
- }), /* @__PURE__ */ v(x, {
338
+ }), /* @__PURE__ */ y(S, {
329
339
  size: "sm",
330
340
  variant: "outline",
331
341
  className: "h-7 text-xs",
332
342
  onClick: () => $(e, "rejected"),
333
343
  children: "Reject"
334
344
  })]
335
- }) : /* @__PURE__ */ v(b, {
345
+ }) : /* @__PURE__ */ y(x, {
336
346
  variant: e.status === "approved" ? "default" : "destructive",
337
347
  className: "text-[10px]",
338
348
  children: t(e.status)
339
349
  })
340
350
  }
341
- ], le = async (e) => {
342
- let t = c(e, "employeeId"), n = h.find((e) => e.id === t);
343
- await N({
344
- id: l(),
351
+ ], he = async (e) => {
352
+ let t = d(e, "employeeId"), n = _.find((e) => e.id === t);
353
+ await j({
354
+ id: ee(),
345
355
  employeeId: t,
346
356
  employeeName: n ? `${n.firstName} ${n.lastName}` : "",
347
357
  department: n?.department ?? "",
348
- type: c(e, "type"),
349
- startDate: c(e, "startDate"),
350
- endDate: c(e, "endDate"),
351
- days: s(e, "days"),
358
+ type: d(e, "type"),
359
+ startDate: d(e, "startDate"),
360
+ endDate: d(e, "endDate"),
361
+ days: u(e, "days"),
352
362
  status: "pending",
353
- reason: c(e, "reason")
363
+ reason: d(e, "reason")
354
364
  });
355
365
  }, $ = async (e, t) => {
356
366
  try {
357
- await F(e.id, {
367
+ await N(e.id, {
358
368
  status: t,
359
- approverName: q
360
- }), I(`Leave ${t} for ${e.employeeName}`, "success");
369
+ approverName: G
370
+ }), P(`Leave ${t} for ${e.employeeName}`, "success");
361
371
  } catch (e) {
362
- I(e instanceof Error ? e.message : "Unable to update leave request", "error");
372
+ P(e instanceof Error ? e.message : "Unable to update leave request", "error");
363
373
  }
364
374
  };
365
- return /* @__PURE__ */ y("div", {
375
+ return /* @__PURE__ */ b("div", {
366
376
  className: "space-y-6 p-6",
367
377
  children: [
368
- /* @__PURE__ */ y("div", {
378
+ /* @__PURE__ */ b("div", {
369
379
  className: "flex items-center justify-between",
370
- children: [/* @__PURE__ */ y("div", { children: [
371
- /* @__PURE__ */ v("h1", {
380
+ children: [/* @__PURE__ */ b("div", { children: [
381
+ /* @__PURE__ */ y("h1", {
372
382
  className: "text-2xl font-semibold",
373
- children: /* @__PURE__ */ v(D, { children: "Leave Management" })
383
+ children: /* @__PURE__ */ y(ne, { children: "Leave Management" })
374
384
  }),
375
- /* @__PURE__ */ v("p", {
385
+ /* @__PURE__ */ y("p", {
376
386
  className: "text-sm text-text-secondary",
377
387
  children: "Track and manage employee leave requests"
378
388
  }),
379
- /* @__PURE__ */ v(O, {
389
+ /* @__PURE__ */ y(re, {
380
390
  className: "mt-1",
381
391
  children: "Handle time-off in one place — review and approve leave requests and keep an eye on team availability and balances."
382
392
  })
383
- ] }), /* @__PURE__ */ y(x, {
393
+ ] }), /* @__PURE__ */ b(S, {
384
394
  size: "sm",
385
- onClick: () => B.openModal(),
386
- children: [/* @__PURE__ */ v(f, { className: "mr-1 h-4 w-4" }), "Request Leave"]
395
+ onClick: () => R.openModal(),
396
+ children: [/* @__PURE__ */ y(m, { className: "mr-1 h-4 w-4" }), "Request Leave"]
387
397
  })]
388
398
  }),
389
- /* @__PURE__ */ v(i, {
399
+ /* @__PURE__ */ y(i, {
390
400
  "aria-label": "Leave views",
391
401
  variant: "underline",
392
- value: V,
393
- onChange: H,
402
+ value: z,
403
+ onChange: B,
394
404
  tabs: [
395
405
  {
396
406
  id: "requests",
@@ -406,70 +416,71 @@ function B() {
406
416
  }
407
417
  ]
408
418
  }),
409
- V === "requests" && /* @__PURE__ */ y("div", {
419
+ z === "requests" && /* @__PURE__ */ b("div", {
410
420
  className: "space-y-6",
411
- children: [/* @__PURE__ */ y("div", {
421
+ children: [/* @__PURE__ */ b("div", {
412
422
  className: "grid gap-4 md:grid-cols-2 lg:grid-cols-4",
413
423
  children: [
414
- /* @__PURE__ */ v(n, {
424
+ /* @__PURE__ */ y(n, {
415
425
  label: "Pending",
416
- value: X,
417
- icon: /* @__PURE__ */ v(g, { className: "h-4 w-4" })
426
+ value: le,
427
+ icon: /* @__PURE__ */ y(v, { className: "h-4 w-4" })
418
428
  }),
419
- /* @__PURE__ */ v(n, {
429
+ /* @__PURE__ */ y(n, {
420
430
  label: "Approved",
421
- value: re,
422
- icon: /* @__PURE__ */ v(p, { className: "h-4 w-4" })
431
+ value: ue,
432
+ icon: /* @__PURE__ */ y(h, { className: "h-4 w-4" })
423
433
  }),
424
- /* @__PURE__ */ v(n, {
434
+ /* @__PURE__ */ y(n, {
425
435
  label: "Days Used",
426
- value: ie,
427
- icon: /* @__PURE__ */ v(f, { className: "h-4 w-4" })
436
+ value: de,
437
+ icon: /* @__PURE__ */ y(m, { className: "h-4 w-4" })
428
438
  }),
429
- /* @__PURE__ */ v(n, {
439
+ /* @__PURE__ */ y(n, {
430
440
  label: "On Leave Today",
431
- value: oe,
432
- icon: /* @__PURE__ */ v(_, { className: "h-4 w-4" })
441
+ value: q,
442
+ icon: /* @__PURE__ */ y(te, { className: "h-4 w-4" })
433
443
  })
434
444
  ]
435
- }), /* @__PURE__ */ y("div", {
445
+ }), /* @__PURE__ */ b("div", {
436
446
  className: "grid gap-6 xl:grid-cols-[minmax(0,2fr)_minmax(0,1fr)]",
437
- children: [/* @__PURE__ */ y(S, { children: [/* @__PURE__ */ y(T, { children: [/* @__PURE__ */ v(E, { children: "Leave Requests" }), /* @__PURE__ */ v(w, { children: "Approve or reject pending requests inline; full request history below." })] }), /* @__PURE__ */ y(C, {
447
+ children: [/* @__PURE__ */ b(C, { children: [/* @__PURE__ */ b(E, { children: [/* @__PURE__ */ y(D, { children: "Leave Requests" }), /* @__PURE__ */ y(T, { children: "Approve or reject pending requests inline; full request history below." })] }), /* @__PURE__ */ b(w, {
438
448
  className: "space-y-4",
439
- children: [/* @__PURE__ */ v(te, {
440
- data: se,
449
+ children: [/* @__PURE__ */ y(ae, {
450
+ data: pe,
441
451
  rowKey: (e) => e.id,
442
- columns: ce,
443
- emptyState: /* @__PURE__ */ v("p", {
452
+ columns: me,
453
+ onRowClick: (e) => Z(e.id),
454
+ emptyState: /* @__PURE__ */ y("p", {
444
455
  className: "py-6 text-center text-sm text-text-secondary",
445
456
  children: "No leave requests yet."
446
457
  })
447
- }), Z.length > Q.pageSize && /* @__PURE__ */ v(ee, {
448
- page: Q.page,
449
- pageSize: Q.pageSize,
450
- totalItems: Z.length,
451
- onPageChange: Q.setPage
458
+ }), J.length > Y.pageSize && /* @__PURE__ */ y(ie, {
459
+ page: Y.page,
460
+ pageSize: Y.pageSize,
461
+ totalItems: J.length,
462
+ onPageChange: Y.setPage
452
463
  })]
453
- })] }), /* @__PURE__ */ v(z, {
454
- leaveRequests: m,
455
- monthCursor: W,
456
- onPrev: () => K(-1),
457
- onNext: () => K(1)
464
+ })] }), /* @__PURE__ */ y(L, {
465
+ leaveRequests: g,
466
+ monthCursor: H,
467
+ onPrev: () => W(-1),
468
+ onNext: () => W(1)
458
469
  })]
459
470
  })]
460
471
  }),
461
- V === "balances" && /* @__PURE__ */ y(S, { children: [/* @__PURE__ */ y(T, { children: [/* @__PURE__ */ v(E, { children: "Leave Balances" }), /* @__PURE__ */ v(w, { children: "Company-wide leave allocation (default policy) vs. approved days used" })] }), /* @__PURE__ */ v(C, {
472
+ z === "balances" && /* @__PURE__ */ b(C, { children: [/* @__PURE__ */ b(E, { children: [/* @__PURE__ */ y(D, { children: "Leave Balances" }), /* @__PURE__ */ y(T, { children: "Company-wide leave allocation (default policy) vs. approved days used" })] }), /* @__PURE__ */ y(w, {
462
473
  className: "grid gap-x-8 gap-y-5 md:grid-cols-2",
463
- children: ae.map((e) => {
474
+ children: fe.map((e) => {
464
475
  let n = Math.round(e.used / Math.max(e.total, 1) * 100);
465
- return /* @__PURE__ */ y("div", {
476
+ return /* @__PURE__ */ b("div", {
466
477
  className: "space-y-1.5",
467
- children: [/* @__PURE__ */ y("div", {
478
+ children: [/* @__PURE__ */ b("div", {
468
479
  className: "flex justify-between text-sm",
469
- children: [/* @__PURE__ */ v("span", {
480
+ children: [/* @__PURE__ */ y("span", {
470
481
  className: "font-medium",
471
482
  children: t(e.type)
472
- }), /* @__PURE__ */ y("span", {
483
+ }), /* @__PURE__ */ b("span", {
473
484
  className: "text-text-secondary",
474
485
  children: [
475
486
  e.used,
@@ -480,9 +491,9 @@ function B() {
480
491
  " left"
481
492
  ]
482
493
  })]
483
- }), /* @__PURE__ */ v("div", {
494
+ }), /* @__PURE__ */ y("div", {
484
495
  className: "h-2.5 overflow-hidden rounded-full bg-bg-sunken",
485
- children: /* @__PURE__ */ v("div", {
496
+ children: /* @__PURE__ */ y("div", {
486
497
  className: `h-2.5 rounded-full ${n > 80 ? "bg-status-error-text" : n > 50 ? "bg-status-warning-text" : "bg-status-success-text"}`,
487
498
  style: { width: `${n}%` }
488
499
  })
@@ -490,34 +501,34 @@ function B() {
490
501
  }, e.type);
491
502
  })
492
503
  })] }),
493
- V === "calendar" && /* @__PURE__ */ y("div", {
504
+ z === "calendar" && /* @__PURE__ */ b("div", {
494
505
  className: "grid gap-6 lg:grid-cols-[minmax(0,1fr)_minmax(0,1.6fr)]",
495
- children: [/* @__PURE__ */ v(z, {
496
- leaveRequests: m,
497
- monthCursor: W,
498
- onPrev: () => K(-1),
499
- onNext: () => K(1)
500
- }), /* @__PURE__ */ y(S, { children: [/* @__PURE__ */ y(T, { children: [/* @__PURE__ */ v(E, { children: "Scheduled & requested leave" }), /* @__PURE__ */ v(w, { children: "Everyone who is out, most recent first" })] }), /* @__PURE__ */ y(C, {
506
+ children: [/* @__PURE__ */ y(L, {
507
+ leaveRequests: g,
508
+ monthCursor: H,
509
+ onPrev: () => W(-1),
510
+ onNext: () => W(1)
511
+ }), /* @__PURE__ */ b(C, { children: [/* @__PURE__ */ b(E, { children: [/* @__PURE__ */ y(D, { children: "Scheduled & requested leave" }), /* @__PURE__ */ y(T, { children: "Everyone who is out, most recent first" })] }), /* @__PURE__ */ b(w, {
501
512
  className: "space-y-3",
502
- children: [Z.filter((e) => e.status === "approved" || e.status === "pending").slice(0, 8).map((e) => /* @__PURE__ */ y("div", {
513
+ children: [J.filter((e) => e.status === "approved" || e.status === "pending").slice(0, 8).map((e) => /* @__PURE__ */ b("div", {
503
514
  className: "flex items-center justify-between gap-3 rounded-lg border border-border-subtle p-3",
504
- children: [/* @__PURE__ */ y("div", {
515
+ children: [/* @__PURE__ */ b("div", {
505
516
  className: "flex items-center gap-2.5",
506
- children: [/* @__PURE__ */ v(r, {
517
+ children: [/* @__PURE__ */ y(r, {
507
518
  people: [{
508
519
  name: e.employeeName,
509
- avatarUrl: U.get(e.employeeId)?.avatar
520
+ avatarUrl: V.get(e.employeeId)?.avatar
510
521
  }],
511
522
  size: 32
512
- }), /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
523
+ }), /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
513
524
  className: "text-sm font-medium",
514
525
  children: e.employeeName
515
- }), /* @__PURE__ */ y("p", {
526
+ }), /* @__PURE__ */ b("p", {
516
527
  className: "flex items-center gap-1.5 text-xs text-text-secondary",
517
528
  children: [
518
- /* @__PURE__ */ v("span", {
529
+ /* @__PURE__ */ y("span", {
519
530
  className: "h-2 w-2 rounded-full",
520
- style: { backgroundColor: P(e.type).dot }
531
+ style: { backgroundColor: M(e.type).dot }
521
532
  }),
522
533
  t(e.type),
523
534
  " · ",
@@ -525,37 +536,37 @@ function B() {
525
536
  " days"
526
537
  ]
527
538
  })] })]
528
- }), /* @__PURE__ */ y("div", {
539
+ }), /* @__PURE__ */ b("div", {
529
540
  className: "text-right text-xs text-text-secondary",
530
- children: [/* @__PURE__ */ y("p", { children: [
541
+ children: [/* @__PURE__ */ b("p", { children: [
531
542
  e.startDate,
532
543
  " — ",
533
544
  e.endDate
534
- ] }), /* @__PURE__ */ v(b, {
545
+ ] }), /* @__PURE__ */ y(x, {
535
546
  variant: e.status === "approved" ? "default" : "secondary",
536
547
  className: "mt-1 text-[10px]",
537
548
  children: t(e.status)
538
549
  })]
539
550
  })]
540
- }, e.id)), Z.filter((e) => e.status === "approved" || e.status === "pending").length === 0 && /* @__PURE__ */ v("p", {
551
+ }, e.id)), J.filter((e) => e.status === "approved" || e.status === "pending").length === 0 && /* @__PURE__ */ y("p", {
541
552
  className: "py-6 text-center text-sm text-text-secondary",
542
553
  children: "No scheduled or requested leave."
543
554
  })]
544
555
  })] })]
545
556
  }),
546
- /* @__PURE__ */ v(a, {
547
- open: B.open,
548
- onOpenChange: B.onOpenChange,
557
+ /* @__PURE__ */ y(a, {
558
+ open: R.open,
559
+ onOpenChange: R.onOpenChange,
549
560
  title: "Request leave",
550
561
  description: "Submit a new time-off request for review.",
551
- fields: Y,
562
+ fields: ce,
552
563
  submitLabel: "Submit request",
553
- onSubmit: le
564
+ onSubmit: he
554
565
  })
555
566
  ]
556
567
  });
557
568
  }
558
569
  //#endregion
559
- export { B as HrLeaveManagementPagePage };
570
+ export { R as HrLeaveManagementPagePage };
560
571
 
561
572
  //# sourceMappingURL=HrLeaveManagementPagePage.js.map