@burdenoff/microfe-crewfoundry 2026.704.6 → 2026.704.7

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 (148) hide show
  1. package/dist/crewfoundry/CrewFoundryRoutes.js +51 -43
  2. package/dist/crewfoundry/CrewFoundryRoutes.js.map +1 -1
  3. package/dist/crewfoundry/components/forms/formValues.js +5 -2
  4. package/dist/crewfoundry/components/forms/formValues.js.map +1 -1
  5. package/dist/crewfoundry/components/viz/AllocationBar.js +68 -0
  6. package/dist/crewfoundry/components/viz/AllocationBar.js.map +1 -0
  7. package/dist/crewfoundry/components/viz/AreaChart.js +102 -0
  8. package/dist/crewfoundry/components/viz/AreaChart.js.map +1 -0
  9. package/dist/crewfoundry/components/viz/AvatarStack.js +36 -0
  10. package/dist/crewfoundry/components/viz/AvatarStack.js.map +1 -0
  11. package/dist/crewfoundry/components/viz/BarChart.js +83 -0
  12. package/dist/crewfoundry/components/viz/BarChart.js.map +1 -0
  13. package/dist/crewfoundry/components/viz/CertificateCard.js +118 -0
  14. package/dist/crewfoundry/components/viz/CertificateCard.js.map +1 -0
  15. package/dist/crewfoundry/components/viz/DonutChart.js +109 -0
  16. package/dist/crewfoundry/components/viz/DonutChart.js.map +1 -0
  17. package/dist/crewfoundry/components/viz/HBarFunnel.js +54 -0
  18. package/dist/crewfoundry/components/viz/HBarFunnel.js.map +1 -0
  19. package/dist/crewfoundry/components/viz/Heatmap.js +91 -0
  20. package/dist/crewfoundry/components/viz/Heatmap.js.map +1 -0
  21. package/dist/crewfoundry/components/viz/KanbanBoard.js +50 -0
  22. package/dist/crewfoundry/components/viz/KanbanBoard.js.map +1 -0
  23. package/dist/crewfoundry/components/viz/LineChart.js +123 -0
  24. package/dist/crewfoundry/components/viz/LineChart.js.map +1 -0
  25. package/dist/crewfoundry/components/viz/OrgTree.js +83 -0
  26. package/dist/crewfoundry/components/viz/OrgTree.js.map +1 -0
  27. package/dist/crewfoundry/components/viz/PathSteps.js +68 -0
  28. package/dist/crewfoundry/components/viz/PathSteps.js.map +1 -0
  29. package/dist/crewfoundry/components/viz/ProgressRing.js +68 -0
  30. package/dist/crewfoundry/components/viz/ProgressRing.js.map +1 -0
  31. package/dist/crewfoundry/components/viz/RatingStars.js +51 -0
  32. package/dist/crewfoundry/components/viz/RatingStars.js.map +1 -0
  33. package/dist/crewfoundry/components/viz/SegmentedTabs.js +69 -0
  34. package/dist/crewfoundry/components/viz/SegmentedTabs.js.map +1 -0
  35. package/dist/crewfoundry/components/viz/SkillBar.js +3 -0
  36. package/dist/crewfoundry/components/viz/Sparkline.js +74 -0
  37. package/dist/crewfoundry/components/viz/Sparkline.js.map +1 -0
  38. package/dist/crewfoundry/components/viz/StatCard.js +60 -0
  39. package/dist/crewfoundry/components/viz/StatCard.js.map +1 -0
  40. package/dist/crewfoundry/components/viz/StepProgress.js +3 -0
  41. package/dist/crewfoundry/components/viz/Timeline.js +66 -0
  42. package/dist/crewfoundry/components/viz/Timeline.js.map +1 -0
  43. package/dist/crewfoundry/components/viz/index.js +23 -0
  44. package/dist/crewfoundry/components/viz/lib/Avatar.js +30 -0
  45. package/dist/crewfoundry/components/viz/lib/Avatar.js.map +1 -0
  46. package/dist/crewfoundry/components/viz/lib/CartesianFrame.js +119 -0
  47. package/dist/crewfoundry/components/viz/lib/CartesianFrame.js.map +1 -0
  48. package/dist/crewfoundry/components/viz/lib/ResponsiveSvg.js +35 -0
  49. package/dist/crewfoundry/components/viz/lib/ResponsiveSvg.js.map +1 -0
  50. package/dist/crewfoundry/components/viz/lib/format.js +21 -0
  51. package/dist/crewfoundry/components/viz/lib/format.js.map +1 -0
  52. package/dist/crewfoundry/components/viz/lib/geometry.js +69 -0
  53. package/dist/crewfoundry/components/viz/lib/geometry.js.map +1 -0
  54. package/dist/crewfoundry/components/viz/lib/hooks.js +39 -0
  55. package/dist/crewfoundry/components/viz/lib/hooks.js.map +1 -0
  56. package/dist/crewfoundry/components/viz/lib/palette.js +27 -0
  57. package/dist/crewfoundry/components/viz/lib/palette.js.map +1 -0
  58. package/dist/crewfoundry/lib/analytics.js +323 -0
  59. package/dist/crewfoundry/lib/analytics.js.map +1 -0
  60. package/dist/crewfoundry/lib/companyFinance.js +16 -0
  61. package/dist/crewfoundry/lib/companyFinance.js.map +1 -0
  62. package/dist/crewfoundry/pages/AnalyticsAnalyticsPagePage.js +226 -283
  63. package/dist/crewfoundry/pages/AnalyticsAnalyticsPagePage.js.map +1 -1
  64. package/dist/crewfoundry/pages/AnalyticsEmployeeAnalyticsPagePage.js +107 -120
  65. package/dist/crewfoundry/pages/AnalyticsEmployeeAnalyticsPagePage.js.map +1 -1
  66. package/dist/crewfoundry/pages/AnalyticsFinancialAnalyticsPagePage.js +122 -162
  67. package/dist/crewfoundry/pages/AnalyticsFinancialAnalyticsPagePage.js.map +1 -1
  68. package/dist/crewfoundry/pages/AnalyticsHiringAnalyticsPagePage.js +121 -158
  69. package/dist/crewfoundry/pages/AnalyticsHiringAnalyticsPagePage.js.map +1 -1
  70. package/dist/crewfoundry/pages/CommunicationsAnnouncementsPagePage.js +316 -211
  71. package/dist/crewfoundry/pages/CommunicationsAnnouncementsPagePage.js.map +1 -1
  72. package/dist/crewfoundry/pages/CommunicationsMessagesPagePage.js +75 -27
  73. package/dist/crewfoundry/pages/CommunicationsMessagesPagePage.js.map +1 -1
  74. package/dist/crewfoundry/pages/CompanyClientManagementPagePage.js +167 -165
  75. package/dist/crewfoundry/pages/CompanyClientManagementPagePage.js.map +1 -1
  76. package/dist/crewfoundry/pages/CompanyVendorManagementPagePage.js +168 -109
  77. package/dist/crewfoundry/pages/CompanyVendorManagementPagePage.js.map +1 -1
  78. package/dist/crewfoundry/pages/DashboardDashboardPagePage.js +401 -290
  79. package/dist/crewfoundry/pages/DashboardDashboardPagePage.js.map +1 -1
  80. package/dist/crewfoundry/pages/HiringApplicationsPagePage.js +84 -75
  81. package/dist/crewfoundry/pages/HiringApplicationsPagePage.js.map +1 -1
  82. package/dist/crewfoundry/pages/HiringCandidatesPagePage.js +368 -174
  83. package/dist/crewfoundry/pages/HiringCandidatesPagePage.js.map +1 -1
  84. package/dist/crewfoundry/pages/HiringCreateJobPagePage.js +236 -201
  85. package/dist/crewfoundry/pages/HiringCreateJobPagePage.js.map +1 -1
  86. package/dist/crewfoundry/pages/HiringInterviewsPagePage.js +369 -196
  87. package/dist/crewfoundry/pages/HiringInterviewsPagePage.js.map +1 -1
  88. package/dist/crewfoundry/pages/HiringJobDetailsPagePage.js +269 -270
  89. package/dist/crewfoundry/pages/HiringJobDetailsPagePage.js.map +1 -1
  90. package/dist/crewfoundry/pages/HiringJobsPagePage.js +210 -110
  91. package/dist/crewfoundry/pages/HiringJobsPagePage.js.map +1 -1
  92. package/dist/crewfoundry/pages/HrDepartmentsPagePage.js +216 -178
  93. package/dist/crewfoundry/pages/HrDepartmentsPagePage.js.map +1 -1
  94. package/dist/crewfoundry/pages/HrEmployeeProfilePagePage.js +385 -0
  95. package/dist/crewfoundry/pages/HrEmployeeProfilePagePage.js.map +1 -0
  96. package/dist/crewfoundry/pages/HrEmployeesPagePage.js +189 -130
  97. package/dist/crewfoundry/pages/HrEmployeesPagePage.js.map +1 -1
  98. package/dist/crewfoundry/pages/HrLeaveManagementPagePage.js +397 -241
  99. package/dist/crewfoundry/pages/HrLeaveManagementPagePage.js.map +1 -1
  100. package/dist/crewfoundry/pages/HrPayrollPagePage.js +262 -147
  101. package/dist/crewfoundry/pages/HrPayrollPagePage.js.map +1 -1
  102. package/dist/crewfoundry/pages/HrTimeTrackingPagePage.js +345 -167
  103. package/dist/crewfoundry/pages/HrTimeTrackingPagePage.js.map +1 -1
  104. package/dist/crewfoundry/pages/LearningCertificatesPagePage.js +98 -24
  105. package/dist/crewfoundry/pages/LearningCertificatesPagePage.js.map +1 -1
  106. package/dist/crewfoundry/pages/LearningCourseDetailsPagePage.js +1 -1
  107. package/dist/crewfoundry/pages/LearningCourseDetailsPagePage.js.map +1 -1
  108. package/dist/crewfoundry/pages/LearningCourseLearningPagePage.js +289 -108
  109. package/dist/crewfoundry/pages/LearningCourseLearningPagePage.js.map +1 -1
  110. package/dist/crewfoundry/pages/LearningCoursesPagePage.js +221 -114
  111. package/dist/crewfoundry/pages/LearningCoursesPagePage.js.map +1 -1
  112. package/dist/crewfoundry/pages/LearningLearningPathDetailPagePage.js +134 -135
  113. package/dist/crewfoundry/pages/LearningLearningPathDetailPagePage.js.map +1 -1
  114. package/dist/crewfoundry/pages/LearningLearningPathsPagePage.js +148 -97
  115. package/dist/crewfoundry/pages/LearningLearningPathsPagePage.js.map +1 -1
  116. package/dist/crewfoundry/pages/LearningMyLearningPagePage.js +264 -157
  117. package/dist/crewfoundry/pages/LearningMyLearningPagePage.js.map +1 -1
  118. package/dist/crewfoundry/pages/MarketplaceFreelancerProfilePagePage.js +85 -93
  119. package/dist/crewfoundry/pages/MarketplaceFreelancerProfilePagePage.js.map +1 -1
  120. package/dist/crewfoundry/pages/MarketplaceMarketplacePagePage.js +211 -122
  121. package/dist/crewfoundry/pages/MarketplaceMarketplacePagePage.js.map +1 -1
  122. package/dist/crewfoundry/pages/MarketplaceMarketplaceServicesPagePage.js +94 -54
  123. package/dist/crewfoundry/pages/MarketplaceMarketplaceServicesPagePage.js.map +1 -1
  124. package/dist/crewfoundry/pages/MarketplaceServiceDetailsPagePage.js +289 -140
  125. package/dist/crewfoundry/pages/MarketplaceServiceDetailsPagePage.js.map +1 -1
  126. package/dist/crewfoundry/pages/PaymentsInvoicesPagePage.js +169 -79
  127. package/dist/crewfoundry/pages/PaymentsInvoicesPagePage.js.map +1 -1
  128. package/dist/crewfoundry/pages/ProjectsProjectsPagePage.js +296 -125
  129. package/dist/crewfoundry/pages/ProjectsProjectsPagePage.js.map +1 -1
  130. package/dist/crewfoundry/pages/ProjectsResourcingPagePage.js +187 -0
  131. package/dist/crewfoundry/pages/ProjectsResourcingPagePage.js.map +1 -0
  132. package/dist/crewfoundry/pages/TeamsTeamDetailPagePage.js +140 -78
  133. package/dist/crewfoundry/pages/TeamsTeamDetailPagePage.js.map +1 -1
  134. package/dist/crewfoundry/pages/TeamsTeamDirectoryPagePage.js +93 -43
  135. package/dist/crewfoundry/pages/TeamsTeamDirectoryPagePage.js.map +1 -1
  136. package/dist/crewfoundry/pages/TeamsTeamsPagePage.js +250 -98
  137. package/dist/crewfoundry/pages/TeamsTeamsPagePage.js.map +1 -1
  138. package/dist/crewfoundry/store/crewfoundryStore.js +1 -1
  139. package/dist/crewfoundry/store/crewfoundryStore.js.map +1 -1
  140. package/dist/crewfoundry/utils/cn.js +10 -0
  141. package/dist/crewfoundry/utils/cn.js.map +1 -0
  142. package/dist/crewfoundry/utils/courseProgress.js +46 -0
  143. package/dist/crewfoundry/utils/courseProgress.js.map +1 -0
  144. package/dist/node_modules/clsx/dist/clsx.js +18 -0
  145. package/dist/node_modules/clsx/dist/clsx.js.map +1 -0
  146. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +1716 -0
  147. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -0
  148. package/package.json +1 -1
@@ -1,15 +1,19 @@
1
1
  import { useCrewFoundryStore as e } from "../store/crewfoundryStore.js";
2
2
  import { formatEnumLabel as t } from "../utils/formatEnumLabel.js";
3
- import { FormModal as n, useFormModal as r } from "../components/forms/FormModal.js";
4
- import { getNumber as i, getText as a, newClientId as o } from "../components/forms/formValues.js";
5
- import { useMemo as s, useState as c } from "react";
6
- import { CheckCircle as l, Clock as u, DollarSign as d, Download as f, Plus as p, TrendingUp as m } from "lucide-react";
3
+ import { StatCard as n } from "../components/viz/StatCard.js";
4
+ import { AvatarStack as r } from "../components/viz/AvatarStack.js";
5
+ import "../components/viz/index.js";
6
+ import { FormModal as i, useFormModal as a } from "../components/forms/FormModal.js";
7
+ import { ConfirmDialog as o } from "../components/forms/ConfirmDialog.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 { CalendarClock as ee, CheckCircle as f, DollarSign as te, Download as ne, Play as re, Plus as p, Users as m } from "lucide-react";
7
11
  import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
8
- import { Badge as v, Button as y, Card as b, CardContent as x, CardDescription as S, CardHeader as C, CardTitle as w, GlassCard as T, GradientText as E, PagePurpose as D, Pagination as O, ResponsiveTable as k, Separator as A } from "@burdenoff/fe-libs/ui";
9
- import { usePagination as j } from "@burdenoff/fe-libs/shared/hooks";
10
- import { useGlobalUi as M } from "@burdenoff/fe-libs/shared/providers/shell";
12
+ import { Badge as v, Button as y, Card as b, CardContent as x, CardDescription as ie, CardHeader as S, CardTitle as C, GlassCard as w, GradientText as ae, PagePurpose as oe, Pagination as T, ResponsiveTable as E, Separator as se } from "@burdenoff/fe-libs/ui";
13
+ import { usePagination as ce } from "@burdenoff/fe-libs/shared/hooks";
14
+ import { useGlobalUi as le } from "@burdenoff/fe-libs/shared/providers/shell";
11
15
  //#region src/crewfoundry/pages/HrPayrollPagePage.tsx
12
- var N = [
16
+ var ue = [
13
17
  {
14
18
  label: "Draft",
15
19
  value: "draft"
@@ -30,18 +34,49 @@ var N = [
30
34
  label: "Failed",
31
35
  value: "failed"
32
36
  }
33
- ];
34
- function P() {
35
- let { payrollRecords: P, employees: F, addPayrollRecord: I, updatePayrollRecord: L } = e(), { showToast: R } = M(), [z, B] = c("January 2026"), V = r(), { page: H, pageSize: U, offset: W, setPage: G } = j({ initialPageSize: 10 }), K = s(() => F.map((e) => ({
37
+ ], D = [
38
+ "January",
39
+ "February",
40
+ "March",
41
+ "April",
42
+ "May",
43
+ "June",
44
+ "July",
45
+ "August",
46
+ "September",
47
+ "October",
48
+ "November",
49
+ "December"
50
+ ], O = [
51
+ "Jan",
52
+ "Feb",
53
+ "Mar",
54
+ "Apr",
55
+ "May",
56
+ "Jun",
57
+ "Jul",
58
+ "Aug",
59
+ "Sep",
60
+ "Oct",
61
+ "Nov",
62
+ "Dec"
63
+ ], de = (e) => {
64
+ let [t, n] = e.split(" "), r = D.findIndex((e) => e.toLowerCase() === t?.toLowerCase()), i = Number(n);
65
+ if (r === -1 || Number.isNaN(i)) return "—";
66
+ let a = (r + 1) % 12, o = r === 11 ? i + 1 : i;
67
+ return `${O[a]} 1, ${o}`;
68
+ };
69
+ function k() {
70
+ let { payrollRecords: D, employees: O, addPayrollRecord: k, updatePayrollRecord: A } = e(), { showToast: j } = le(), M = u(() => [...new Set(D.map((e) => e.period))], [D]), [N, P] = d(""), F = a(), [I, L] = d(!1), [R, z] = d(!1), { page: B, pageSize: V, offset: H, setPage: U } = ce({ initialPageSize: 10 }), W = N || M[0] || "", fe = u(() => new Map(O.map((e) => [e.id, e])), [O]), G = u(() => O.map((e) => ({
36
71
  label: `${e.firstName} ${e.lastName}`,
37
72
  value: e.id
38
- })), [F]), q = s(() => [
73
+ })), [O]), pe = u(() => [
39
74
  {
40
75
  name: "employeeId",
41
76
  label: "Employee",
42
77
  type: "select",
43
78
  required: !0,
44
- options: K,
79
+ options: G,
45
80
  colSpan: 2
46
81
  },
47
82
  {
@@ -84,18 +119,65 @@ function P() {
84
119
  name: "status",
85
120
  label: "Status",
86
121
  type: "select",
87
- options: N
122
+ options: ue
88
123
  }
89
- ], [K]), J = P.filter((e) => e.period === z), Y = J.reduce((e, t) => e + t.grossPay, 0), X = J.reduce((e, t) => e + t.netPay, 0), Z = J.reduce((e, t) => e + t.deductions, 0), Q = J.filter((e) => e.status === "paid").length, $ = J.filter((e) => e.status === "processing").length, ee = J.slice(W, W + U), te = [...new Set(P.map((e) => e.period))], ne = (e) => {
90
- B(e), G(1);
91
- }, re = [
124
+ ], [G]), K = D.filter((e) => e.period === W), q = K.reduce((e, t) => e + t.grossPay, 0), J = K.reduce((e, t) => e + t.netPay, 0), Y = K.reduce((e, t) => e + t.deductions, 0), X = K.filter((e) => e.status === "paid").length, Z = K.length - X, Q = K.length > 0 ? Math.round(X / K.length * 100) : 0, $ = K.length > 0 && Z === 0, me = K.slice(H, H + V), he = (e) => {
125
+ P(e), U(1);
126
+ }, ge = async () => {
127
+ let e = K.filter((e) => e.status !== "paid");
128
+ z(!0);
129
+ let t = 0;
130
+ try {
131
+ for (let n of e) await A(n.id, {
132
+ status: "paid",
133
+ payDate: (/* @__PURE__ */ new Date()).toISOString().slice(0, 10)
134
+ }), t += 1;
135
+ j(`Pay run complete — ${t} record${t === 1 ? "" : "s"} paid`, "success");
136
+ } catch (e) {
137
+ j(e instanceof Error ? e.message : "Payroll run failed partway through", "error");
138
+ } finally {
139
+ z(!1), L(!1);
140
+ }
141
+ }, _e = () => {
142
+ if (K.length === 0) {
143
+ j("No records to export for this period", "info");
144
+ return;
145
+ }
146
+ let e = [
147
+ "Employee",
148
+ "Department",
149
+ "Period",
150
+ "Gross",
151
+ "Deductions",
152
+ "Net",
153
+ "Status"
154
+ ], t = (e) => `"${e.replace(/"/g, "\"\"")}"`, n = K.map((e) => [
155
+ e.employeeName,
156
+ e.department,
157
+ e.period,
158
+ String(e.grossPay),
159
+ String(e.deductions),
160
+ String(e.netPay),
161
+ e.status
162
+ ].map(t).join(",")), r = [e.map(t).join(","), ...n].join("\n"), i = new Blob([r], { type: "text/csv;charset=utf-8;" }), a = URL.createObjectURL(i), o = document.createElement("a");
163
+ o.href = a, o.download = `payroll-${W.replace(/\s+/g, "-").toLowerCase()}.csv`, document.body.appendChild(o), o.click(), document.body.removeChild(o), URL.revokeObjectURL(a), j("Payroll CSV exported", "success");
164
+ }, ve = [
92
165
  {
93
166
  key: "employee",
94
167
  header: "Employee",
95
168
  priority: "primary",
96
- cell: (e) => /* @__PURE__ */ g("span", {
97
- className: "font-medium",
98
- children: e.employeeName
169
+ cell: (e) => /* @__PURE__ */ _("div", {
170
+ className: "flex items-center gap-2.5",
171
+ children: [/* @__PURE__ */ g(r, {
172
+ people: [{
173
+ name: e.employeeName,
174
+ avatarUrl: fe.get(e.employeeId)?.avatar
175
+ }],
176
+ size: 32
177
+ }), /* @__PURE__ */ g("span", {
178
+ className: "font-medium",
179
+ children: e.employeeName
180
+ })]
99
181
  })
100
182
  },
101
183
  {
@@ -154,34 +236,34 @@ function P() {
154
236
  variant: "ghost",
155
237
  size: "sm",
156
238
  className: "h-6 px-2 text-[10px]",
157
- onClick: () => ae(e),
239
+ onClick: () => be(e),
158
240
  children: "Mark paid"
159
241
  })]
160
242
  })
161
243
  }
162
- ], ie = async (e) => {
163
- let t = a(e, "employeeId"), n = F.find((e) => e.id === t), r = i(e, "grossPay"), s = i(e, "deductions"), c = i(e, "netPay");
164
- await I({
165
- id: o(),
244
+ ], ye = async (e) => {
245
+ let t = c(e, "employeeId"), n = O.find((e) => e.id === t), r = s(e, "grossPay"), i = s(e, "deductions"), a = s(e, "netPay");
246
+ await k({
247
+ id: l(),
166
248
  employeeId: t,
167
249
  employeeName: n ? `${n.firstName} ${n.lastName}` : "",
168
250
  department: n?.department ?? "",
169
- period: a(e, "period"),
251
+ period: c(e, "period"),
170
252
  grossPay: r,
171
- deductions: s,
172
- netPay: c > 0 ? c : Math.max(r - s, 0),
173
- status: a(e, "status") || "draft",
174
- payDate: a(e, "payDate"),
175
- paymentMethod: a(e, "paymentMethod")
253
+ deductions: i,
254
+ netPay: a > 0 ? a : Math.max(r - i, 0),
255
+ status: c(e, "status") || "draft",
256
+ payDate: c(e, "payDate"),
257
+ paymentMethod: c(e, "paymentMethod")
176
258
  });
177
- }, ae = async (e) => {
259
+ }, be = async (e) => {
178
260
  try {
179
- await L(e.id, {
261
+ await A(e.id, {
180
262
  status: "paid",
181
263
  payDate: (/* @__PURE__ */ new Date()).toISOString().slice(0, 10)
182
264
  });
183
265
  } catch (e) {
184
- R(e instanceof Error ? e.message : "Unable to update payroll record", "error");
266
+ j(e instanceof Error ? e.message : "Unable to update payroll record", "error");
185
267
  }
186
268
  };
187
269
  return /* @__PURE__ */ _("div", {
@@ -192,148 +274,171 @@ function P() {
192
274
  children: [/* @__PURE__ */ _("div", { children: [
193
275
  /* @__PURE__ */ g("h1", {
194
276
  className: "text-2xl font-semibold",
195
- children: /* @__PURE__ */ g(E, { children: "Payroll Management" })
277
+ children: /* @__PURE__ */ g(ae, { children: "Payroll" })
196
278
  }),
197
279
  /* @__PURE__ */ g("p", {
198
280
  className: "text-sm text-text-secondary",
199
- children: "Process and manage employee payroll"
281
+ children: W ? `${W} pay run` : "Process and manage employee payroll"
200
282
  }),
201
- /* @__PURE__ */ g(D, {
283
+ /* @__PURE__ */ g(oe, {
202
284
  className: "mt-1",
203
285
  children: "Run and review payroll — track salaries, deductions, and pay runs so your team gets paid accurately and on time."
204
286
  })
205
287
  ] }), /* @__PURE__ */ _("div", {
206
288
  className: "flex gap-2",
207
- children: [/* @__PURE__ */ _(y, {
208
- variant: "outline",
209
- size: "sm",
210
- disabled: !0,
211
- "aria-label": "Export payroll (coming soon)",
212
- title: "Payroll export is coming soon",
213
- children: [
214
- /* @__PURE__ */ g(f, { className: "h-4 w-4 mr-1" }),
215
- "Export",
216
- /* @__PURE__ */ g(v, {
217
- variant: "secondary",
218
- className: "ml-1 text-[9px]",
219
- children: "Soon"
220
- })
221
- ]
222
- }), /* @__PURE__ */ _(y, {
223
- size: "sm",
224
- onClick: () => V.openModal(),
225
- children: [/* @__PURE__ */ g(p, { className: "h-4 w-4 mr-1" }), "Add Record"]
226
- })]
289
+ children: [
290
+ /* @__PURE__ */ _(y, {
291
+ variant: "outline",
292
+ size: "sm",
293
+ onClick: _e,
294
+ children: [/* @__PURE__ */ g(ne, { className: "h-4 w-4 mr-1" }), "Export"]
295
+ }),
296
+ /* @__PURE__ */ _(y, {
297
+ variant: "outline",
298
+ size: "sm",
299
+ onClick: () => F.openModal(),
300
+ children: [/* @__PURE__ */ g(p, { className: "h-4 w-4 mr-1" }), "Add Record"]
301
+ }),
302
+ /* @__PURE__ */ _(y, {
303
+ size: "sm",
304
+ onClick: () => L(!0),
305
+ disabled: $ || K.length === 0,
306
+ title: $ ? "All records in this period are paid" : "Advance this period to paid",
307
+ children: [/* @__PURE__ */ g(re, { className: "h-4 w-4 mr-1" }), "Run Payroll"]
308
+ })
309
+ ]
227
310
  })]
228
311
  }),
229
312
  /* @__PURE__ */ _("div", {
230
313
  className: "grid gap-4 md:grid-cols-2 lg:grid-cols-4",
231
314
  children: [
232
- /* @__PURE__ */ _(T, {
233
- treatment: "glass",
234
- glow: !0,
235
- className: "border-border-seam",
236
- children: [/* @__PURE__ */ _(C, {
237
- className: "flex flex-row items-center justify-between space-y-0 pb-2",
238
- children: [/* @__PURE__ */ g(w, {
239
- className: "text-sm font-medium",
240
- children: "Gross Payroll"
241
- }), /* @__PURE__ */ g(d, { className: "h-4 w-4 text-text-secondary" })]
242
- }), /* @__PURE__ */ _(x, { children: [/* @__PURE__ */ _("div", {
243
- className: "text-2xl font-bold tabular-nums",
244
- children: ["$", Y.toLocaleString()]
245
- }), /* @__PURE__ */ g("p", {
246
- className: "text-xs text-text-secondary",
247
- children: z
248
- })] })]
315
+ /* @__PURE__ */ g(n, {
316
+ label: "Total Payroll",
317
+ value: `$${q.toLocaleString()}`,
318
+ icon: /* @__PURE__ */ g(te, { className: "h-4 w-4" })
249
319
  }),
250
- /* @__PURE__ */ _(T, {
251
- treatment: "metric",
252
- className: "border-border-seam",
253
- children: [/* @__PURE__ */ _(C, {
254
- className: "flex flex-row items-center justify-between space-y-0 pb-2",
255
- children: [/* @__PURE__ */ g(w, {
256
- className: "text-sm font-medium",
257
- children: "Net Payroll"
258
- }), /* @__PURE__ */ g(m, { className: "h-4 w-4 text-text-secondary" })]
259
- }), /* @__PURE__ */ _(x, { children: [/* @__PURE__ */ _("div", {
260
- className: "text-2xl font-bold tabular-nums",
261
- children: ["$", X.toLocaleString()]
262
- }), /* @__PURE__ */ g("p", {
263
- className: "text-xs text-text-secondary",
264
- children: "After deductions"
265
- })] })]
320
+ /* @__PURE__ */ g(n, {
321
+ label: "Employees Paid",
322
+ value: X,
323
+ icon: /* @__PURE__ */ g(f, { className: "h-4 w-4" })
266
324
  }),
267
- /* @__PURE__ */ _(T, {
268
- treatment: "metric",
269
- className: "border-border-seam",
270
- children: [/* @__PURE__ */ _(C, {
271
- className: "flex flex-row items-center justify-between space-y-0 pb-2",
272
- children: [/* @__PURE__ */ g(w, {
273
- className: "text-sm font-medium",
274
- children: "Paid"
275
- }), /* @__PURE__ */ g(l, { className: "h-4 w-4 text-status-success-text" })]
276
- }), /* @__PURE__ */ _(x, { children: [/* @__PURE__ */ g("div", {
277
- className: "text-2xl font-bold tabular-nums",
278
- children: Q
279
- }), /* @__PURE__ */ g("p", {
280
- className: "text-xs text-text-secondary",
281
- children: "employees paid"
282
- })] })]
325
+ /* @__PURE__ */ g(n, {
326
+ label: "Pending",
327
+ value: Z,
328
+ icon: /* @__PURE__ */ g(m, { className: "h-4 w-4" })
283
329
  }),
284
- /* @__PURE__ */ _(T, {
285
- treatment: "metric",
286
- className: "border-border-seam",
287
- children: [/* @__PURE__ */ _(C, {
288
- className: "flex flex-row items-center justify-between space-y-0 pb-2",
289
- children: [/* @__PURE__ */ g(w, {
290
- className: "text-sm font-medium",
291
- children: "Processing"
292
- }), /* @__PURE__ */ g(u, { className: "h-4 w-4 text-status-warning-text" })]
293
- }), /* @__PURE__ */ _(x, { children: [/* @__PURE__ */ g("div", {
294
- className: "text-2xl font-bold tabular-nums",
295
- children: $
296
- }), /* @__PURE__ */ g("p", {
297
- className: "text-xs text-text-secondary",
298
- children: "in progress"
299
- })] })]
330
+ /* @__PURE__ */ g(n, {
331
+ label: "Next Run",
332
+ value: W ? de(W) : "—",
333
+ icon: /* @__PURE__ */ g(ee, { className: "h-4 w-4" })
300
334
  })
301
335
  ]
302
336
  }),
303
- /* @__PURE__ */ g("div", {
337
+ K.length > 0 && /* @__PURE__ */ _(w, {
338
+ treatment: "glass",
339
+ glow: !0,
340
+ className: "border-border-seam",
341
+ children: [/* @__PURE__ */ _(S, {
342
+ className: "flex flex-row items-center justify-between space-y-0",
343
+ children: [/* @__PURE__ */ g(C, {
344
+ className: "text-base",
345
+ children: "Current pay run"
346
+ }), /* @__PURE__ */ _(v, {
347
+ variant: $ ? "default" : "secondary",
348
+ className: "flex items-center gap-1",
349
+ children: [/* @__PURE__ */ g(f, { className: "h-3 w-3" }), $ ? "Completed" : "Processing"]
350
+ })]
351
+ }), /* @__PURE__ */ _(x, {
352
+ className: "space-y-4",
353
+ children: [/* @__PURE__ */ _("div", {
354
+ className: "grid gap-4 sm:grid-cols-4",
355
+ children: [
356
+ /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
357
+ className: "text-xs text-text-secondary",
358
+ children: "Period"
359
+ }), /* @__PURE__ */ g("p", {
360
+ className: "text-sm font-semibold",
361
+ children: W
362
+ })] }),
363
+ /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
364
+ className: "text-xs text-text-secondary",
365
+ children: "Gross Total"
366
+ }), /* @__PURE__ */ _("p", {
367
+ className: "text-sm font-semibold tabular-nums",
368
+ children: ["$", q.toLocaleString()]
369
+ })] }),
370
+ /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
371
+ className: "text-xs text-text-secondary",
372
+ children: "Deductions"
373
+ }), /* @__PURE__ */ _("p", {
374
+ className: "text-sm font-semibold tabular-nums text-status-error-text",
375
+ children: ["-$", Y.toLocaleString()]
376
+ })] }),
377
+ /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
378
+ className: "text-xs text-text-secondary",
379
+ children: "Net Total"
380
+ }), /* @__PURE__ */ _("p", {
381
+ className: "text-sm font-semibold tabular-nums",
382
+ children: ["$", J.toLocaleString()]
383
+ })] })
384
+ ]
385
+ }), /* @__PURE__ */ _("div", {
386
+ className: "space-y-1",
387
+ children: [/* @__PURE__ */ _("div", {
388
+ className: "flex items-center justify-between text-xs text-text-secondary",
389
+ children: [/* @__PURE__ */ _("span", { children: [
390
+ X,
391
+ " of ",
392
+ K.length,
393
+ " paid"
394
+ ] }), /* @__PURE__ */ _("span", {
395
+ className: "font-medium text-text-primary tabular-nums",
396
+ children: [Q, "%"]
397
+ })]
398
+ }), /* @__PURE__ */ g("div", {
399
+ className: "h-2 overflow-hidden rounded-full bg-bg-sunken",
400
+ children: /* @__PURE__ */ g("div", {
401
+ className: "h-2 rounded-full bg-status-success-text transition-all duration-500",
402
+ style: { width: `${Q}%` }
403
+ })
404
+ })]
405
+ })]
406
+ })]
407
+ }),
408
+ M.length > 1 && /* @__PURE__ */ g("div", {
304
409
  className: "flex flex-wrap gap-2",
305
- children: te.map((e) => /* @__PURE__ */ g(y, {
306
- variant: z === e ? "default" : "outline",
410
+ children: M.map((e) => /* @__PURE__ */ g(y, {
411
+ variant: W === e ? "default" : "outline",
307
412
  size: "sm",
308
- onClick: () => ne(e),
413
+ onClick: () => he(e),
309
414
  children: e
310
415
  }, e))
311
416
  }),
312
- /* @__PURE__ */ _(b, { children: [/* @__PURE__ */ _(C, { children: [/* @__PURE__ */ g(w, { children: "Payroll Records" }), /* @__PURE__ */ _(S, { children: ["Individual employee payroll details for ", z] })] }), /* @__PURE__ */ _(x, {
417
+ /* @__PURE__ */ _(b, { children: [/* @__PURE__ */ _(S, { children: [/* @__PURE__ */ g(C, { children: "Payroll Records" }), /* @__PURE__ */ _(ie, { children: ["Individual employee payroll details for ", W] })] }), /* @__PURE__ */ _(x, {
313
418
  className: "space-y-4",
314
419
  children: [
315
- /* @__PURE__ */ g(k, {
316
- data: ee,
420
+ /* @__PURE__ */ g(E, {
421
+ data: me,
317
422
  rowKey: (e) => e.id,
318
- columns: re,
423
+ columns: ve,
319
424
  emptyState: /* @__PURE__ */ _("p", {
320
425
  className: "py-6 text-center text-sm text-text-secondary",
321
426
  children: [
322
427
  "No payroll records for ",
323
- z,
428
+ W || "this period",
324
429
  "."
325
430
  ]
326
431
  })
327
432
  }),
328
- J.length > U && /* @__PURE__ */ g(O, {
329
- page: H,
330
- pageSize: U,
331
- totalItems: J.length,
332
- onPageChange: G
433
+ K.length > V && /* @__PURE__ */ g(T, {
434
+ page: B,
435
+ pageSize: V,
436
+ totalItems: K.length,
437
+ onPageChange: U
333
438
  }),
334
- J.length > 0 && /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(A, {}), /* @__PURE__ */ _("div", {
439
+ K.length > 0 && /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(se, {}), /* @__PURE__ */ _("div", {
335
440
  className: "flex flex-wrap items-center justify-between gap-4 text-sm font-semibold",
336
- children: [/* @__PURE__ */ _("span", { children: ["Total for ", z] }), /* @__PURE__ */ _("div", {
441
+ children: [/* @__PURE__ */ _("span", { children: ["Total for ", W] }), /* @__PURE__ */ _("div", {
337
442
  className: "flex flex-wrap gap-x-6 gap-y-1",
338
443
  children: [
339
444
  /* @__PURE__ */ _("span", { children: [
@@ -342,7 +447,7 @@ function P() {
342
447
  children: "Gross "
343
448
  }),
344
449
  "$",
345
- Y.toLocaleString()
450
+ q.toLocaleString()
346
451
  ] }),
347
452
  /* @__PURE__ */ _("span", {
348
453
  className: "text-status-error-text",
@@ -352,7 +457,7 @@ function P() {
352
457
  children: "Deductions "
353
458
  }),
354
459
  "-$",
355
- Z.toLocaleString()
460
+ Y.toLocaleString()
356
461
  ]
357
462
  }),
358
463
  /* @__PURE__ */ _("span", { children: [
@@ -361,26 +466,36 @@ function P() {
361
466
  children: "Net "
362
467
  }),
363
468
  "$",
364
- X.toLocaleString()
469
+ J.toLocaleString()
365
470
  ] })
366
471
  ]
367
472
  })]
368
473
  })] })
369
474
  ]
370
475
  })] }),
371
- /* @__PURE__ */ g(n, {
372
- open: V.open,
373
- onOpenChange: V.onOpenChange,
476
+ /* @__PURE__ */ g(i, {
477
+ open: F.open,
478
+ onOpenChange: F.onOpenChange,
374
479
  title: "Add payroll record",
375
480
  description: "Create a payroll entry for a team member.",
376
- fields: q,
481
+ fields: pe,
377
482
  submitLabel: "Add record",
378
- onSubmit: ie
483
+ onSubmit: ye
484
+ }),
485
+ /* @__PURE__ */ g(o, {
486
+ open: I,
487
+ onOpenChange: (e) => {
488
+ !e && !R && L(!1);
489
+ },
490
+ title: `Run payroll for ${W}?`,
491
+ description: `This marks the ${Z} remaining record${Z === 1 ? "" : "s"} in ${W} as paid. This cannot be undone.`,
492
+ confirmLabel: R ? "Processing…" : "Run payroll",
493
+ onConfirm: ge
379
494
  })
380
495
  ]
381
496
  });
382
497
  }
383
498
  //#endregion
384
- export { P as HrPayrollPagePage };
499
+ export { k as HrPayrollPagePage };
385
500
 
386
501
  //# sourceMappingURL=HrPayrollPagePage.js.map