@gusto/embedded-react-sdk 0.23.1 → 0.24.1

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 (213) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/dist/components/Common/PayrollLoading/PayrollLoading.d.ts +2 -0
  3. package/dist/components/Common/PayrollLoading/PayrollLoading.js +19 -0
  4. package/dist/components/Common/PayrollLoading/PayrollLoading.js.map +1 -0
  5. package/dist/components/Common/PayrollLoading/PayrollLoadingTypes.d.ts +5 -0
  6. package/dist/components/Common/PayrollLoading/index.d.ts +3 -0
  7. package/dist/components/Common/SignatureForm/SignatureForm.js +11 -12
  8. package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
  9. package/dist/components/Common/SignatureForm/SignatureFormActions.js +1 -1
  10. package/dist/components/Common/SignatureForm/SignatureFormFields.js +2 -2
  11. package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js +1 -1
  12. package/dist/components/Common/UI/ProgressBar/ProgressBar.js +4 -4
  13. package/dist/components/Common/index.d.ts +1 -0
  14. package/dist/components/Company/AssignSignatory/AssignSignatory.js +1 -1
  15. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +1 -1
  16. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +1 -1
  17. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +12 -12
  18. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +3 -4
  19. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  20. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +1 -1
  21. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +1 -1
  22. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +3 -4
  23. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  24. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +5 -6
  25. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  26. package/dist/components/Company/BankAccount/BankAccountForm/Form.js +5 -6
  27. package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
  28. package/dist/components/Company/BankAccount/BankAccountForm/context.js +3 -4
  29. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  30. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +5 -6
  31. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
  32. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +2 -2
  33. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +3 -4
  34. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  35. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +2 -2
  36. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +3 -4
  37. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  38. package/dist/components/Company/FederalTaxes/FederalTaxes.js +2 -2
  39. package/dist/components/Company/FederalTaxes/Form.js +3 -4
  40. package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
  41. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +8 -9
  42. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  43. package/dist/components/Company/Industry/Context.js +6 -7
  44. package/dist/components/Company/Industry/Context.js.map +1 -1
  45. package/dist/components/Company/Locations/LocationForm/Form.js +1 -1
  46. package/dist/components/Company/Locations/LocationForm/LocationForm.js +2 -2
  47. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +3 -4
  48. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  49. package/dist/components/Company/Locations/LocationsList/LocationsList.js +2 -2
  50. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +3 -4
  51. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  52. package/dist/components/Company/OnboardingOverview/Completed.js +2 -3
  53. package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
  54. package/dist/components/Company/OnboardingOverview/MissingRequirements.js +2 -3
  55. package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
  56. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +2 -2
  57. package/dist/components/Company/OnboardingOverview/context.js +3 -4
  58. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  59. package/dist/components/Company/PaySchedule/PaySchedule.js +2 -2
  60. package/dist/components/Company/PaySchedule/_parts/Edit.js +15 -15
  61. package/dist/components/Company/PaySchedule/_parts/Head.js +8 -9
  62. package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
  63. package/dist/components/Company/PaySchedule/_parts/List.js +11 -12
  64. package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
  65. package/dist/components/Company/PaySchedule/usePaySchedule.js +5 -6
  66. package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
  67. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +3 -4
  68. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  69. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +3 -4
  70. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  71. package/dist/components/Contractor/Address/Address.js +2 -2
  72. package/dist/components/Contractor/Address/Form.js +1 -1
  73. package/dist/components/Contractor/Address/useAddress.js +5 -6
  74. package/dist/components/Contractor/Address/useAddress.js.map +1 -1
  75. package/dist/components/Contractor/ContractorList/index.js +17 -17
  76. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +2 -2
  77. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +1 -1
  78. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +13 -14
  79. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
  80. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +10 -10
  81. package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +9 -10
  82. package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js.map +1 -1
  83. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js +2 -3
  84. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map +1 -1
  85. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +12 -13
  86. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
  87. package/dist/components/Contractor/Profile/ContractorProfileForm.js +15 -15
  88. package/dist/components/Contractor/Profile/useContractorProfile.js +2 -3
  89. package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
  90. package/dist/components/Contractor/Submit/Submit.js +1 -1
  91. package/dist/components/Employee/Compensation/Edit.js +14 -14
  92. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +10 -11
  93. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
  94. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +11 -12
  95. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
  96. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +11 -12
  97. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -1
  98. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +1 -1
  99. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +1 -1
  100. package/dist/components/Employee/DocumentSigner/DocumentList/List.js +2 -3
  101. package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
  102. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +3 -4
  103. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  104. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +1 -1
  105. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +3 -4
  106. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  107. package/dist/components/Employee/EmployeeList/EmployeeList.js +3 -4
  108. package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
  109. package/dist/components/Employee/EmployeeList/Head.js +2 -3
  110. package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
  111. package/dist/components/Employee/EmployeeList/useEmployeeList.js +3 -4
  112. package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
  113. package/dist/components/Employee/FederalTaxes/FederalForm.js +9 -7
  114. package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
  115. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +3 -4
  116. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
  117. package/dist/components/Employee/Landing/Landing.js +8 -8
  118. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +7 -7
  119. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +2 -2
  120. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +1 -1
  121. package/dist/components/Employee/PaymentMethod/Split.js +8 -8
  122. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +5 -6
  123. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
  124. package/dist/components/Employee/Profile/AdminPersonalDetails.js +1 -1
  125. package/dist/components/Employee/Profile/HomeAddress.js +1 -1
  126. package/dist/components/Employee/Profile/PersonalDetailsInputs.js +2 -2
  127. package/dist/components/Employee/Profile/useProfile.js +3 -4
  128. package/dist/components/Employee/Profile/useProfile.js.map +1 -1
  129. package/dist/components/Employee/StateTaxes/useStateTaxes.js +3 -4
  130. package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
  131. package/dist/components/Employee/Taxes/FederalForm.js +8 -6
  132. package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
  133. package/dist/components/Employee/Taxes/useTaxes.js +3 -4
  134. package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
  135. package/dist/components/Flow/Flow.js +2 -3
  136. package/dist/components/Flow/Flow.js.map +1 -1
  137. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.d.ts +4 -4
  138. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js +26 -21
  139. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js.map +1 -1
  140. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +9 -9
  141. package/dist/components/Payroll/ConfirmWireDetails/index.d.ts +1 -1
  142. package/dist/components/Payroll/ConfirmWireDetails/types.d.ts +8 -1
  143. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +6 -7
  144. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
  145. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +2 -3
  146. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js.map +1 -1
  147. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.d.ts +2 -1
  148. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +56 -54
  149. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
  150. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.d.ts +2 -1
  151. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +90 -91
  152. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
  153. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.d.ts +2 -1
  154. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js +33 -31
  155. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js.map +1 -1
  156. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.d.ts +2 -1
  157. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +72 -71
  158. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
  159. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +8 -9
  160. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
  161. package/dist/components/Payroll/PayrollFlow/PayrollFlow.d.ts +1 -1
  162. package/dist/components/Payroll/PayrollFlow/PayrollFlow.js +24 -18
  163. package/dist/components/Payroll/PayrollFlow/PayrollFlow.js.map +1 -1
  164. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.d.ts +5 -0
  165. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js +77 -51
  166. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js.map +1 -1
  167. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +17 -18
  168. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
  169. package/dist/components/Payroll/PayrollLanding/PayrollLanding.d.ts +4 -1
  170. package/dist/components/Payroll/PayrollLanding/PayrollLanding.js +29 -21
  171. package/dist/components/Payroll/PayrollLanding/PayrollLanding.js.map +1 -1
  172. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.d.ts +5 -0
  173. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js +36 -26
  174. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js.map +1 -1
  175. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +16 -17
  176. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
  177. package/dist/components/Payroll/PayrollOverview/PayrollOverview.d.ts +4 -1
  178. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +70 -60
  179. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
  180. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.d.ts +2 -1
  181. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +237 -232
  182. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
  183. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js +2 -3
  184. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js.map +1 -1
  185. package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.d.ts +2 -1
  186. package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.js +25 -15
  187. package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.js.map +1 -1
  188. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.d.ts +2 -1
  189. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +152 -138
  190. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
  191. package/dist/components/Payroll/index.d.ts +1 -0
  192. package/dist/components/Payroll/usePreparedPayrollData.js +5 -6
  193. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  194. package/dist/contexts/ApiProvider/ApiProvider.d.ts +3 -1
  195. package/dist/contexts/ApiProvider/ApiProvider.js +26 -18
  196. package/dist/contexts/ApiProvider/ApiProvider.js.map +1 -1
  197. package/dist/contexts/ComponentAdapter/componentAdapterTypes.d.ts +1 -0
  198. package/dist/contexts/ComponentAdapter/useComponentContext.d.ts +2 -0
  199. package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
  200. package/dist/contexts/GustoProvider/GustoProvider.d.ts +2 -0
  201. package/dist/contexts/GustoProvider/GustoProvider.js +12 -11
  202. package/dist/contexts/GustoProvider/GustoProvider.js.map +1 -1
  203. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +24 -14
  204. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  205. package/dist/i18n/en/common.json.d.ts +1 -0
  206. package/dist/i18n/en/common.json.js +1 -1
  207. package/dist/index.d.ts +1 -0
  208. package/dist/shared/constants.d.ts +1 -1
  209. package/dist/shared/constants.js +6 -5
  210. package/dist/shared/constants.js.map +1 -1
  211. package/dist/style.css +1 -1
  212. package/dist/types/i18next.d.ts +1 -0
  213. package/package.json +5 -5
@@ -1,75 +1,79 @@
1
- import { jsx as e, jsxs as m } from "react/jsx-runtime";
2
- import { useRef as P } from "react";
3
- import { useTranslation as R } from "react-i18next";
4
- import d from "classnames";
1
+ import { jsx as e, jsxs as c } from "react/jsx-runtime";
2
+ import { useRef as I } from "react";
3
+ import { useTranslation as z } from "react-i18next";
4
+ import p from "classnames";
5
5
  import i from "./PayrollReceiptsPresentation.module.scss.js";
6
- import { Flex as a } from "../../Common/Flex/Flex.js";
7
- import "../../../shared/constants.js";
8
- import { useComponentContext as L } from "../../../contexts/ComponentAdapter/useComponentContext.js";
9
- import { formatNumberAsCurrency as r } from "../../../helpers/formattedStrings.js";
10
- import { useI18n as I } from "../../../i18n/I18n.js";
11
- import { useContainerBreakpoints as S } from "../../../hooks/useContainerBreakpoints/useContainerBreakpoints.js";
12
- import z from "../../../assets/icons/receipt-check.svg.js";
13
- import { DataTable as b } from "../../Common/DataView/DataTable/DataTable.js";
14
- import { DataView as h } from "../../Common/DataView/DataView.js";
15
- const Q = ({ receiptData: n }) => {
16
- const { Heading: p, Text: o } = L();
17
- I("Payroll.PayrollReceipts");
18
- const { t } = R("Payroll.PayrollReceipts"), u = P(null), c = !S({ ref: u }).includes("small"), y = (l) => `${l.employeeFirstName || ""} ${l.employeeLastName || ""}`.trim(), g = () => (n.employeeCompensations || []).reduce(
19
- (l, s) => l + parseFloat(s.childSupportGarnishment || "0"),
6
+ import { Flex as m } from "../../Common/Flex/Flex.js";
7
+ import { useComponentContext as M } from "../../../contexts/ComponentAdapter/useComponentContext.js";
8
+ import { formatNumberAsCurrency as a } from "../../../helpers/formattedStrings.js";
9
+ import { useI18n as $ } from "../../../i18n/I18n.js";
10
+ import { useContainerBreakpoints as A } from "../../../hooks/useContainerBreakpoints/useContainerBreakpoints.js";
11
+ import B from "../../../assets/icons/receipt-check.svg.js";
12
+ import { DataTable as y } from "../../Common/DataView/DataTable/DataTable.js";
13
+ import { DataView as f } from "../../Common/DataView/DataView.js";
14
+ const Y = ({
15
+ receiptData: o,
16
+ withReimbursements: u = !0
17
+ }) => {
18
+ const { Heading: b, Text: t } = M();
19
+ $("Payroll.PayrollReceipts");
20
+ const { t: l } = z("Payroll.PayrollReceipts"), h = I(null), d = !A({ ref: h }).includes("small"), g = (n) => `${n.employeeFirstName || ""} ${n.employeeLastName || ""}`.trim(), x = () => (o.employeeCompensations || []).reduce(
21
+ (n, s) => n + parseFloat(s.childSupportGarnishment || "0"),
20
22
  0
21
- ), f = () => (n.employeeCompensations || []).reduce(
22
- (l, s) => l + parseFloat(s.totalReimbursement || "0"),
23
+ ), k = () => (o.employeeCompensations || []).reduce(
24
+ (n, s) => n + parseFloat(s.totalReimbursement || "0"),
23
25
  0
24
- ), x = () => (n.employeeCompensations || []).reduce(
25
- (l, s) => l + parseFloat(s.netPay || "0"),
26
+ ), w = () => (o.employeeCompensations || []).reduce(
27
+ (n, s) => n + parseFloat(s.netPay || "0"),
26
28
  0
27
- ), w = () => (n.employeeCompensations || []).reduce(
28
- (l, s) => l + parseFloat(s.totalTax || "0"),
29
+ ), F = () => (o.employeeCompensations || []).reduce(
30
+ (n, s) => n + parseFloat(s.totalTax || "0"),
29
31
  0
30
- ), k = [
32
+ ), v = [
31
33
  {
32
- label: t("breakdown.directDeposits"),
33
- amount: parseFloat(n.totals?.netPayDebit || "0")
34
- },
35
- {
36
- label: t("breakdown.reimbursements"),
37
- amount: parseFloat(n.totals?.reimbursementDebit || "0")
34
+ label: l("breakdown.directDeposits"),
35
+ amount: parseFloat(o.totals?.netPayDebit || "0")
38
36
  },
37
+ ...u ? [
38
+ {
39
+ label: l("breakdown.reimbursements"),
40
+ amount: parseFloat(o.totals?.reimbursementDebit || "0")
41
+ }
42
+ ] : [],
39
43
  {
40
- label: t("breakdown.garnishments"),
41
- amount: parseFloat(n.totals?.childSupportDebit || "0")
44
+ label: l("breakdown.garnishments"),
45
+ amount: parseFloat(o.totals?.childSupportDebit || "0")
42
46
  },
43
- { label: t("breakdown.taxes"), amount: parseFloat(n.totals?.taxDebit || "0") }
44
- ], F = [
47
+ { label: l("breakdown.taxes"), amount: parseFloat(o.totals?.taxDebit || "0") }
48
+ ], N = [
45
49
  {
46
- label: t("receipt.receiptId"),
47
- value: n.payrollUuid || ""
50
+ label: l("receipt.receiptId"),
51
+ value: o.payrollUuid || ""
48
52
  },
49
53
  {
50
- label: t("receipt.from"),
51
- value: n.nameOfSender || ""
54
+ label: l("receipt.from"),
55
+ value: o.nameOfSender || ""
52
56
  },
53
57
  {
54
- label: t("receipt.to"),
55
- value: n.nameOfRecipient || "Payroll Recipients"
58
+ label: l("receipt.to"),
59
+ value: o.nameOfRecipient || "Payroll Recipients"
56
60
  },
57
61
  {
58
- label: t("receipt.debitDate"),
59
- value: n.debitDate || ""
62
+ label: l("receipt.debitDate"),
63
+ value: o.debitDate || ""
60
64
  }
61
- ], v = () => /* @__PURE__ */ e("div", { className: d(i.receiptHeader, c && i.receiptHeaderMobile), children: /* @__PURE__ */ m(a, { flexDirection: "column", gap: 24, children: [
62
- /* @__PURE__ */ m(a, { flexDirection: "column", alignItems: "center", gap: 16, children: [
63
- /* @__PURE__ */ e("div", { className: i.receiptIcon, children: /* @__PURE__ */ e(z, { className: i.checkmarkIcon }) }),
64
- /* @__PURE__ */ m(a, { flexDirection: "column", alignItems: "center", gap: 8, children: [
65
- /* @__PURE__ */ e(o, { size: "sm", variant: "supporting", children: t("receipt.totalLabel") }),
66
- /* @__PURE__ */ e(p, { as: "h1", styledAs: "h2", className: i.totalAmount, children: r(parseFloat(n.totals?.companyDebit || "0")) })
65
+ ], C = () => /* @__PURE__ */ e("div", { className: p(i.receiptHeader, d && i.receiptHeaderMobile), children: /* @__PURE__ */ c(m, { flexDirection: "column", gap: 24, children: [
66
+ /* @__PURE__ */ c(m, { flexDirection: "column", alignItems: "center", gap: 16, children: [
67
+ /* @__PURE__ */ e("div", { className: i.receiptIcon, children: /* @__PURE__ */ e(B, { className: i.checkmarkIcon }) }),
68
+ /* @__PURE__ */ c(m, { flexDirection: "column", alignItems: "center", gap: 8, children: [
69
+ /* @__PURE__ */ e(t, { size: "sm", variant: "supporting", children: l("receipt.totalLabel") }),
70
+ /* @__PURE__ */ e(b, { as: "h1", styledAs: "h2", className: i.totalAmount, children: a(parseFloat(o.totals?.companyDebit || "0")) })
67
71
  ] })
68
72
  ] }),
69
73
  /* @__PURE__ */ e("div", { className: i.receiptDetailsTable, children: /* @__PURE__ */ e(
70
- h,
74
+ f,
71
75
  {
72
- label: t("receipt.detailsLabel"),
76
+ label: l("receipt.detailsLabel"),
73
77
  variant: "minimal",
74
78
  breakAt: "small",
75
79
  breakpoints: {
@@ -79,142 +83,152 @@ const Q = ({ receiptData: n }) => {
79
83
  columns: [
80
84
  {
81
85
  title: "",
82
- render: (l) => /* @__PURE__ */ e(o, { size: "sm", variant: "supporting", children: l.label })
86
+ render: (n) => /* @__PURE__ */ e(t, { size: "sm", variant: "supporting", children: n.label })
83
87
  },
84
88
  {
85
89
  title: "",
86
- render: (l) => /* @__PURE__ */ e(o, { size: "sm", children: l.value })
90
+ render: (n) => /* @__PURE__ */ e(t, { size: "sm", children: n.value })
87
91
  }
88
92
  ],
89
- data: F
93
+ data: N
90
94
  }
91
95
  ) }),
92
- /* @__PURE__ */ m(a, { flexDirection: "column", alignItems: "center", gap: 12, children: [
96
+ /* @__PURE__ */ c(m, { flexDirection: "column", alignItems: "center", gap: 12, children: [
93
97
  /* @__PURE__ */ e(
94
- o,
98
+ t,
95
99
  {
96
100
  size: "sm",
97
101
  variant: "supporting",
98
- className: d(i.disclaimer, c && i.textMobile),
99
- children: n.recipientNotice
102
+ className: p(i.disclaimer, d && i.textMobile),
103
+ children: o.recipientNotice
100
104
  }
101
105
  ),
102
106
  /* @__PURE__ */ e(
103
- o,
107
+ t,
104
108
  {
105
109
  size: "sm",
106
110
  variant: "supporting",
107
- className: d(i.companyInfo, c && i.textMobile),
108
- children: n.license
111
+ className: p(i.companyInfo, d && i.textMobile),
112
+ children: o.license
109
113
  }
110
114
  ),
111
115
  /* @__PURE__ */ e(
112
- o,
116
+ t,
113
117
  {
114
118
  size: "sm",
115
119
  variant: "supporting",
116
- className: d(i.address, c && i.textMobile),
117
- children: n.licensee && `${n.licensee.address || ""}, ${n.licensee.city || ""}, ${n.licensee.state || ""} ${n.licensee.postalCode || ""}`
120
+ className: p(i.address, d && i.textMobile),
121
+ children: o.licensee && `${o.licensee.address || ""}, ${o.licensee.city || ""}, ${o.licensee.state || ""} ${o.licensee.postalCode || ""}`
118
122
  }
119
123
  )
120
124
  ] })
121
- ] }) }), N = () => /* @__PURE__ */ e(a, { flexDirection: "column", gap: 16, children: /* @__PURE__ */ e(
122
- b,
125
+ ] }) }), P = () => /* @__PURE__ */ e(m, { flexDirection: "column", gap: 16, children: /* @__PURE__ */ e(
126
+ y,
123
127
  {
124
- label: t("sections.debitedLabel"),
128
+ label: l("sections.debitedLabel"),
125
129
  columns: [
126
130
  {
127
- title: t("sections.debitedLabel"),
128
- render: (l) => /* @__PURE__ */ e(o, { children: l.label })
131
+ title: l("sections.debitedLabel"),
132
+ render: (n) => /* @__PURE__ */ e(t, { children: n.label })
129
133
  },
130
134
  {
131
- title: t("breakdown.amount"),
132
- render: (l) => /* @__PURE__ */ e(o, { children: r(l.amount) })
135
+ title: l("breakdown.amount"),
136
+ render: (n) => /* @__PURE__ */ e(t, { children: a(n.amount) })
133
137
  }
134
138
  ],
135
- data: k,
139
+ data: v,
136
140
  footer: () => ({
137
- "column-0": /* @__PURE__ */ e(o, { weight: "semibold", children: t("breakdown.totals") }),
138
- "column-1": /* @__PURE__ */ e(o, { weight: "semibold", children: r(parseFloat(n.totals?.companyDebit || "0")) })
141
+ "column-0": /* @__PURE__ */ e(t, { weight: "semibold", children: l("breakdown.totals") }),
142
+ "column-1": /* @__PURE__ */ e(t, { weight: "semibold", children: a(parseFloat(o.totals?.companyDebit || "0")) })
139
143
  })
140
144
  }
141
- ) }), C = () => /* @__PURE__ */ e(a, { flexDirection: "column", gap: 16, children: /* @__PURE__ */ e(
142
- b,
145
+ ) }), T = () => /* @__PURE__ */ e(m, { flexDirection: "column", gap: 16, children: /* @__PURE__ */ e(
146
+ y,
143
147
  {
144
- label: t("sections.taxLabel"),
148
+ label: l("sections.taxLabel"),
145
149
  columns: [
146
150
  {
147
- title: t("sections.taxLabel"),
148
- render: (l) => /* @__PURE__ */ e(o, { children: l.name })
151
+ title: l("sections.taxLabel"),
152
+ render: (n) => /* @__PURE__ */ e(t, { children: n.name })
149
153
  },
150
154
  {
151
- title: t("tax.amount"),
152
- render: (l) => /* @__PURE__ */ e(o, { children: r(parseFloat(l.amount || "0")) })
155
+ title: l("tax.amount"),
156
+ render: (n) => /* @__PURE__ */ e(t, { children: a(parseFloat(n.amount || "0")) })
153
157
  }
154
158
  ],
155
- data: n.taxes || [],
159
+ data: o.taxes || [],
156
160
  footer: () => ({
157
- "column-0": /* @__PURE__ */ e(o, { weight: "semibold", children: t("breakdown.totals") }),
158
- "column-1": /* @__PURE__ */ e(o, { weight: "semibold", children: r(parseFloat(n.totals?.taxDebit || "0")) })
161
+ "column-0": /* @__PURE__ */ e(t, { weight: "semibold", children: l("breakdown.totals") }),
162
+ "column-1": /* @__PURE__ */ e(t, { weight: "semibold", children: a(parseFloat(o.totals?.taxDebit || "0")) })
159
163
  })
160
164
  }
161
- ) }), T = () => /* @__PURE__ */ m(a, { flexDirection: "column", gap: 16, children: [
162
- c && /* @__PURE__ */ e(p, { as: "h2", children: t("sections.employeesLabel") }),
163
- /* @__PURE__ */ e(
164
- h,
165
- {
166
- label: t("sections.employeesLabel"),
167
- columns: [
168
- {
169
- title: t("employee.name"),
170
- render: (l) => /* @__PURE__ */ e(o, { children: y(l) })
171
- },
172
- {
173
- title: t("employee.paymentMethod"),
174
- render: (l) => /* @__PURE__ */ e(o, { children: l.paymentMethod || "N/A" })
175
- },
176
- {
177
- title: t("employee.childSupport"),
178
- render: (l) => /* @__PURE__ */ e(o, { children: r(parseFloat(l.childSupportGarnishment || "0")) })
179
- },
180
- {
181
- title: t("employee.reimbursement"),
182
- render: (l) => /* @__PURE__ */ e(o, { children: r(parseFloat(l.totalReimbursement || "0")) })
183
- },
184
- {
185
- title: t("employee.totalTaxes"),
186
- render: (l) => /* @__PURE__ */ e(o, { children: r(parseFloat(l.totalTax || "0")) })
187
- },
188
- {
189
- title: t("employee.netPay"),
190
- render: (l) => /* @__PURE__ */ e(o, { children: r(parseFloat(l.netPay || "0")) })
191
- }
192
- ],
193
- data: n.employeeCompensations || [],
194
- footer: () => ({
195
- "column-0": /* @__PURE__ */ m(a, { flexDirection: "column", gap: 4, children: [
196
- /* @__PURE__ */ e(o, { weight: "semibold", children: t("breakdown.totals") }),
197
- /* @__PURE__ */ e(o, { size: "sm", variant: "supporting", children: t("employee.totalEmployees", {
198
- count: n.employeeCompensations?.length || 0
199
- }) })
200
- ] }),
201
- "column-1": /* @__PURE__ */ e(o, { children: " " }),
202
- "column-2": /* @__PURE__ */ e(o, { weight: "semibold", children: r(g()) }),
203
- "column-3": /* @__PURE__ */ e(o, { weight: "semibold", children: r(f()) }),
204
- "column-4": /* @__PURE__ */ e(o, { weight: "semibold", children: r(w()) }),
205
- "column-5": /* @__PURE__ */ e(o, { weight: "semibold", children: r(x()) })
206
- })
207
- }
208
- )
209
- ] });
210
- return /* @__PURE__ */ e("div", { className: i.container, ref: u, children: /* @__PURE__ */ m(a, { flexDirection: "column", gap: 24, children: [
211
- v(),
212
- N(),
165
+ ) }), R = () => {
166
+ const s = [
167
+ /* @__PURE__ */ c(m, { flexDirection: "column", gap: 4, children: [
168
+ /* @__PURE__ */ e(t, { weight: "semibold", children: l("breakdown.totals") }),
169
+ /* @__PURE__ */ e(t, { size: "sm", variant: "supporting", children: l("employee.totalEmployees", {
170
+ count: o.employeeCompensations?.length || 0
171
+ }) })
172
+ ] }, "totals"),
173
+ /* @__PURE__ */ e(t, { children: " " }, "spacer"),
174
+ /* @__PURE__ */ e(t, { weight: "semibold", children: a(x()) }, "childSupport"),
175
+ ...u ? [
176
+ /* @__PURE__ */ e(t, { weight: "semibold", children: a(k()) }, "reimbursements")
177
+ ] : [],
178
+ /* @__PURE__ */ e(t, { weight: "semibold", children: a(F()) }, "taxes"),
179
+ /* @__PURE__ */ e(t, { weight: "semibold", children: a(w()) }, "netPay")
180
+ ].reduce(
181
+ (r, L, S) => (r[`column-${S}`] = L, r),
182
+ {}
183
+ );
184
+ return /* @__PURE__ */ c(m, { flexDirection: "column", gap: 16, children: [
185
+ d && /* @__PURE__ */ e(b, { as: "h2", children: l("sections.employeesLabel") }),
186
+ /* @__PURE__ */ e(
187
+ f,
188
+ {
189
+ label: l("sections.employeesLabel"),
190
+ columns: [
191
+ {
192
+ title: l("employee.name"),
193
+ render: (r) => /* @__PURE__ */ e(t, { children: g(r) })
194
+ },
195
+ {
196
+ title: l("employee.paymentMethod"),
197
+ render: (r) => /* @__PURE__ */ e(t, { children: r.paymentMethod || "N/A" })
198
+ },
199
+ {
200
+ title: l("employee.childSupport"),
201
+ render: (r) => /* @__PURE__ */ e(t, { children: a(parseFloat(r.childSupportGarnishment || "0")) })
202
+ },
203
+ ...u ? [
204
+ {
205
+ title: l("employee.reimbursement"),
206
+ render: (r) => /* @__PURE__ */ e(t, { children: a(parseFloat(r.totalReimbursement || "0")) })
207
+ }
208
+ ] : [],
209
+ {
210
+ title: l("employee.totalTaxes"),
211
+ render: (r) => /* @__PURE__ */ e(t, { children: a(parseFloat(r.totalTax || "0")) })
212
+ },
213
+ {
214
+ title: l("employee.netPay"),
215
+ render: (r) => /* @__PURE__ */ e(t, { children: a(parseFloat(r.netPay || "0")) })
216
+ }
217
+ ],
218
+ data: o.employeeCompensations || [],
219
+ footer: () => s
220
+ }
221
+ )
222
+ ] });
223
+ };
224
+ return /* @__PURE__ */ e("div", { className: i.container, ref: h, children: /* @__PURE__ */ c(m, { flexDirection: "column", gap: 24, children: [
213
225
  C(),
214
- T()
226
+ P(),
227
+ T(),
228
+ R()
215
229
  ] }) });
216
230
  };
217
231
  export {
218
- Q as PayrollReceiptsPresentation
232
+ Y as PayrollReceiptsPresentation
219
233
  };
220
234
  //# sourceMappingURL=PayrollReceiptsPresentation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PayrollReceiptsPresentation.js","sources":["../../../../src/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.tsx"],"sourcesContent":["import { useRef } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport classNames from 'classnames'\nimport type {\n PayrollReceipt,\n Taxes as TaxBreakdownItem,\n PayrollReceiptEmployeeCompensations as EmployeeBreakdownItem,\n} from '@gusto/embedded-api/models/components/payrollreceipt'\nimport styles from './PayrollReceiptsPresentation.module.scss'\nimport { DataView, DataTable, Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { formatNumberAsCurrency } from '@/helpers/formattedStrings'\nimport { useI18n } from '@/i18n'\nimport { useContainerBreakpoints } from '@/hooks/useContainerBreakpoints/useContainerBreakpoints'\nimport ReceiptCheck from '@/assets/icons/receipt-check.svg?react'\n\ninterface PayrollReceiptsPresentationProps {\n receiptData: PayrollReceipt\n}\n\nexport const PayrollReceiptsPresentation = ({ receiptData }: PayrollReceiptsPresentationProps) => {\n const { Heading, Text } = useComponentContext()\n useI18n('Payroll.PayrollReceipts')\n const { t } = useTranslation('Payroll.PayrollReceipts')\n\n const containerRef = useRef<HTMLDivElement>(null)\n const breakpoints = useContainerBreakpoints({ ref: containerRef })\n const isMobile = !breakpoints.includes('small')\n\n // Helper to get employee full name\n const getEmployeeFullName = (emp: EmployeeBreakdownItem) =>\n `${emp.employeeFirstName || ''} ${emp.employeeLastName || ''}`.trim()\n\n const getTotalChildSupport = () =>\n (receiptData.employeeCompensations || []).reduce(\n (sum, emp) => sum + parseFloat(emp.childSupportGarnishment || '0'),\n 0,\n )\n\n const getTotalReimbursements = () =>\n (receiptData.employeeCompensations || []).reduce(\n (sum, emp) => sum + parseFloat(emp.totalReimbursement || '0'),\n 0,\n )\n\n const getTotalNetPay = () =>\n (receiptData.employeeCompensations || []).reduce(\n (sum, emp) => sum + parseFloat(emp.netPay || '0'),\n 0,\n )\n\n const getTotalTaxes = () =>\n (receiptData.employeeCompensations || []).reduce(\n (sum, emp) => sum + parseFloat(emp.totalTax || '0'),\n 0,\n )\n\n const breakdownData = [\n {\n label: t('breakdown.directDeposits'),\n amount: parseFloat(receiptData.totals?.netPayDebit || '0'),\n },\n {\n label: t('breakdown.reimbursements'),\n amount: parseFloat(receiptData.totals?.reimbursementDebit || '0'),\n },\n {\n label: t('breakdown.garnishments'),\n amount: parseFloat(receiptData.totals?.childSupportDebit || '0'),\n },\n { label: t('breakdown.taxes'), amount: parseFloat(receiptData.totals?.taxDebit || '0') },\n ]\n\n const receiptDetailsConfig = [\n {\n label: t('receipt.receiptId'),\n value: receiptData.payrollUuid || '',\n },\n {\n label: t('receipt.from'),\n value: receiptData.nameOfSender || '',\n },\n {\n label: t('receipt.to'),\n value: receiptData.nameOfRecipient || 'Payroll Recipients',\n },\n {\n label: t('receipt.debitDate'),\n value: receiptData.debitDate || '',\n },\n ]\n\n const renderReceiptHeader = () => (\n <div className={classNames(styles.receiptHeader, isMobile && styles.receiptHeaderMobile)}>\n <Flex flexDirection=\"column\" gap={24}>\n <Flex flexDirection=\"column\" alignItems=\"center\" gap={16}>\n <div className={styles.receiptIcon}>\n <ReceiptCheck className={styles.checkmarkIcon} />\n </div>\n\n <Flex flexDirection=\"column\" alignItems=\"center\" gap={8}>\n <Text size=\"sm\" variant=\"supporting\">\n {t('receipt.totalLabel')}\n </Text>\n <Heading as=\"h1\" styledAs=\"h2\" className={styles.totalAmount}>\n {formatNumberAsCurrency(parseFloat(receiptData.totals?.companyDebit || '0'))}\n </Heading>\n </Flex>\n </Flex>\n\n <div className={styles.receiptDetailsTable}>\n <DataView\n label={t('receipt.detailsLabel')}\n variant=\"minimal\"\n breakAt=\"small\"\n breakpoints={{\n base: '0rem',\n small: '22rem',\n }}\n columns={[\n {\n title: '',\n render: (item: { label: string; value: string }) => (\n <Text size=\"sm\" variant=\"supporting\">\n {item.label}\n </Text>\n ),\n },\n {\n title: '',\n render: (item: { label: string; value: string }) => (\n <Text size=\"sm\">{item.value}</Text>\n ),\n },\n ]}\n data={receiptDetailsConfig}\n />\n </div>\n\n <Flex flexDirection=\"column\" alignItems=\"center\" gap={12}>\n <Text\n size=\"sm\"\n variant=\"supporting\"\n className={classNames(styles.disclaimer, isMobile && styles.textMobile)}\n >\n {receiptData.recipientNotice}\n </Text>\n\n <Text\n size=\"sm\"\n variant=\"supporting\"\n className={classNames(styles.companyInfo, isMobile && styles.textMobile)}\n >\n {receiptData.license}\n </Text>\n\n <Text\n size=\"sm\"\n variant=\"supporting\"\n className={classNames(styles.address, isMobile && styles.textMobile)}\n >\n {receiptData.licensee &&\n `${receiptData.licensee.address || ''}, ${receiptData.licensee.city || ''}, ${receiptData.licensee.state || ''} ${receiptData.licensee.postalCode || ''}`}\n </Text>\n </Flex>\n </Flex>\n </div>\n )\n\n const renderBreakdownSection = () => (\n <Flex flexDirection=\"column\" gap={16}>\n <DataTable\n label={t('sections.debitedLabel')}\n columns={[\n {\n title: t('sections.debitedLabel'),\n render: (item: { label: string; amount: number }) => <Text>{item.label}</Text>,\n },\n {\n title: t('breakdown.amount'),\n render: (item: { label: string; amount: number }) => (\n <Text>{formatNumberAsCurrency(item.amount)}</Text>\n ),\n },\n ]}\n data={breakdownData}\n footer={() => ({\n 'column-0': <Text weight=\"semibold\">{t('breakdown.totals')}</Text>,\n 'column-1': (\n <Text weight=\"semibold\">\n {formatNumberAsCurrency(parseFloat(receiptData.totals?.companyDebit || '0'))}\n </Text>\n ),\n })}\n />\n </Flex>\n )\n\n const renderTaxBreakdown = () => (\n <Flex flexDirection=\"column\" gap={16}>\n <DataTable\n label={t('sections.taxLabel')}\n columns={[\n {\n title: t('sections.taxLabel'),\n render: (tax: TaxBreakdownItem) => <Text>{tax.name}</Text>,\n },\n {\n title: t('tax.amount'),\n render: (tax: TaxBreakdownItem) => (\n <Text>{formatNumberAsCurrency(parseFloat(tax.amount || '0'))}</Text>\n ),\n },\n ]}\n data={receiptData.taxes || []}\n footer={() => ({\n 'column-0': <Text weight=\"semibold\">{t('breakdown.totals')}</Text>,\n 'column-1': (\n <Text weight=\"semibold\">\n {formatNumberAsCurrency(parseFloat(receiptData.totals?.taxDebit || '0'))}\n </Text>\n ),\n })}\n />\n </Flex>\n )\n\n const renderEmployeeBreakdown = () => (\n <Flex flexDirection=\"column\" gap={16}>\n {isMobile && <Heading as=\"h2\">{t('sections.employeesLabel')}</Heading>}\n <DataView\n label={t('sections.employeesLabel')}\n columns={[\n {\n title: t('employee.name'),\n render: (employee: EmployeeBreakdownItem) => (\n <Text>{getEmployeeFullName(employee)}</Text>\n ),\n },\n {\n title: t('employee.paymentMethod'),\n render: (employee: EmployeeBreakdownItem) => (\n <Text>{employee.paymentMethod || 'N/A'}</Text>\n ),\n },\n {\n title: t('employee.childSupport'),\n render: (employee: EmployeeBreakdownItem) => (\n <Text>\n {formatNumberAsCurrency(parseFloat(employee.childSupportGarnishment || '0'))}\n </Text>\n ),\n },\n {\n title: t('employee.reimbursement'),\n render: (employee: EmployeeBreakdownItem) => (\n <Text>{formatNumberAsCurrency(parseFloat(employee.totalReimbursement || '0'))}</Text>\n ),\n },\n {\n title: t('employee.totalTaxes'),\n render: (employee: EmployeeBreakdownItem) => (\n <Text>{formatNumberAsCurrency(parseFloat(employee.totalTax || '0'))}</Text>\n ),\n },\n {\n title: t('employee.netPay'),\n render: (employee: EmployeeBreakdownItem) => (\n <Text>{formatNumberAsCurrency(parseFloat(employee.netPay || '0'))}</Text>\n ),\n },\n ]}\n data={receiptData.employeeCompensations || []}\n footer={() => ({\n 'column-0': (\n <Flex flexDirection=\"column\" gap={4}>\n <Text weight=\"semibold\">{t('breakdown.totals')}</Text>\n <Text size=\"sm\" variant=\"supporting\">\n {t('employee.totalEmployees', {\n count: receiptData.employeeCompensations?.length || 0,\n })}\n </Text>\n </Flex>\n ),\n 'column-1': <Text>{'\\u00A0'}</Text>,\n 'column-2': (\n <Text weight=\"semibold\">{formatNumberAsCurrency(getTotalChildSupport())}</Text>\n ),\n 'column-3': (\n <Text weight=\"semibold\">{formatNumberAsCurrency(getTotalReimbursements())}</Text>\n ),\n 'column-4': <Text weight=\"semibold\">{formatNumberAsCurrency(getTotalTaxes())}</Text>,\n 'column-5': <Text weight=\"semibold\">{formatNumberAsCurrency(getTotalNetPay())}</Text>,\n })}\n />\n </Flex>\n )\n\n return (\n <div className={styles.container} ref={containerRef}>\n <Flex flexDirection=\"column\" gap={24}>\n {renderReceiptHeader()}\n {renderBreakdownSection()}\n {renderTaxBreakdown()}\n {renderEmployeeBreakdown()}\n </Flex>\n </div>\n )\n}\n"],"names":["PayrollReceiptsPresentation","receiptData","Heading","Text","useComponentContext","useI18n","useTranslation","containerRef","useRef","isMobile","useContainerBreakpoints","getEmployeeFullName","emp","getTotalChildSupport","sum","getTotalReimbursements","getTotalNetPay","getTotalTaxes","breakdownData","receiptDetailsConfig","renderReceiptHeader","jsx","classNames","styles","jsxs","Flex","ReceiptCheck","formatNumberAsCurrency","DataView","item","renderBreakdownSection","DataTable","renderTaxBreakdown","tax","renderEmployeeBreakdown","employee"],"mappings":";;;;;;;;;;;;;;AAoBO,MAAMA,IAA8B,CAAC,EAAE,aAAAC,QAAoD;AAChG,QAAM,EAAE,SAAAC,GAAS,MAAAC,EAAA,IAASC,EAAA;AAC1B,EAAAC,EAAQ,yBAAyB;AACjC,QAAM,EAAE,EAAA,IAAMC,EAAe,yBAAyB,GAEhDC,IAAeC,EAAuB,IAAI,GAE1CC,IAAW,CADGC,EAAwB,EAAE,KAAKH,GAAc,EACnC,SAAS,OAAO,GAGxCI,IAAsB,CAACC,MAC3B,GAAGA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ACF;AAEJ;"}
1
+ {"version":3,"file":"PayrollReceiptsPresentation.js","sources":["../../../../src/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.tsx"],"sourcesContent":["import { useRef } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport classNames from 'classnames'\nimport type {\n PayrollReceipt,\n Taxes as TaxBreakdownItem,\n PayrollReceiptEmployeeCompensations as EmployeeBreakdownItem,\n} from '@gusto/embedded-api/models/components/payrollreceipt'\nimport styles from './PayrollReceiptsPresentation.module.scss'\nimport { DataView, DataTable, Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { formatNumberAsCurrency } from '@/helpers/formattedStrings'\nimport { useI18n } from '@/i18n'\nimport { useContainerBreakpoints } from '@/hooks/useContainerBreakpoints/useContainerBreakpoints'\nimport ReceiptCheck from '@/assets/icons/receipt-check.svg?react'\n\ninterface PayrollReceiptsPresentationProps {\n receiptData: PayrollReceipt\n withReimbursements?: boolean\n}\n\nexport const PayrollReceiptsPresentation = ({\n receiptData,\n withReimbursements = true,\n}: PayrollReceiptsPresentationProps) => {\n const { Heading, Text } = useComponentContext()\n useI18n('Payroll.PayrollReceipts')\n const { t } = useTranslation('Payroll.PayrollReceipts')\n\n const containerRef = useRef<HTMLDivElement>(null)\n const breakpoints = useContainerBreakpoints({ ref: containerRef })\n const isMobile = !breakpoints.includes('small')\n\n // Helper to get employee full name\n const getEmployeeFullName = (emp: EmployeeBreakdownItem) =>\n `${emp.employeeFirstName || ''} ${emp.employeeLastName || ''}`.trim()\n\n const getTotalChildSupport = () =>\n (receiptData.employeeCompensations || []).reduce(\n (sum, emp) => sum + parseFloat(emp.childSupportGarnishment || '0'),\n 0,\n )\n\n const getTotalReimbursements = () =>\n (receiptData.employeeCompensations || []).reduce(\n (sum, emp) => sum + parseFloat(emp.totalReimbursement || '0'),\n 0,\n )\n\n const getTotalNetPay = () =>\n (receiptData.employeeCompensations || []).reduce(\n (sum, emp) => sum + parseFloat(emp.netPay || '0'),\n 0,\n )\n\n const getTotalTaxes = () =>\n (receiptData.employeeCompensations || []).reduce(\n (sum, emp) => sum + parseFloat(emp.totalTax || '0'),\n 0,\n )\n\n const breakdownData = [\n {\n label: t('breakdown.directDeposits'),\n amount: parseFloat(receiptData.totals?.netPayDebit || '0'),\n },\n ...(withReimbursements\n ? [\n {\n label: t('breakdown.reimbursements'),\n amount: parseFloat(receiptData.totals?.reimbursementDebit || '0'),\n },\n ]\n : []),\n {\n label: t('breakdown.garnishments'),\n amount: parseFloat(receiptData.totals?.childSupportDebit || '0'),\n },\n { label: t('breakdown.taxes'), amount: parseFloat(receiptData.totals?.taxDebit || '0') },\n ]\n\n const receiptDetailsConfig = [\n {\n label: t('receipt.receiptId'),\n value: receiptData.payrollUuid || '',\n },\n {\n label: t('receipt.from'),\n value: receiptData.nameOfSender || '',\n },\n {\n label: t('receipt.to'),\n value: receiptData.nameOfRecipient || 'Payroll Recipients',\n },\n {\n label: t('receipt.debitDate'),\n value: receiptData.debitDate || '',\n },\n ]\n\n const renderReceiptHeader = () => (\n <div className={classNames(styles.receiptHeader, isMobile && styles.receiptHeaderMobile)}>\n <Flex flexDirection=\"column\" gap={24}>\n <Flex flexDirection=\"column\" alignItems=\"center\" gap={16}>\n <div className={styles.receiptIcon}>\n <ReceiptCheck className={styles.checkmarkIcon} />\n </div>\n\n <Flex flexDirection=\"column\" alignItems=\"center\" gap={8}>\n <Text size=\"sm\" variant=\"supporting\">\n {t('receipt.totalLabel')}\n </Text>\n <Heading as=\"h1\" styledAs=\"h2\" className={styles.totalAmount}>\n {formatNumberAsCurrency(parseFloat(receiptData.totals?.companyDebit || '0'))}\n </Heading>\n </Flex>\n </Flex>\n\n <div className={styles.receiptDetailsTable}>\n <DataView\n label={t('receipt.detailsLabel')}\n variant=\"minimal\"\n breakAt=\"small\"\n breakpoints={{\n base: '0rem',\n small: '22rem',\n }}\n columns={[\n {\n title: '',\n render: (item: { label: string; value: string }) => (\n <Text size=\"sm\" variant=\"supporting\">\n {item.label}\n </Text>\n ),\n },\n {\n title: '',\n render: (item: { label: string; value: string }) => (\n <Text size=\"sm\">{item.value}</Text>\n ),\n },\n ]}\n data={receiptDetailsConfig}\n />\n </div>\n\n <Flex flexDirection=\"column\" alignItems=\"center\" gap={12}>\n <Text\n size=\"sm\"\n variant=\"supporting\"\n className={classNames(styles.disclaimer, isMobile && styles.textMobile)}\n >\n {receiptData.recipientNotice}\n </Text>\n\n <Text\n size=\"sm\"\n variant=\"supporting\"\n className={classNames(styles.companyInfo, isMobile && styles.textMobile)}\n >\n {receiptData.license}\n </Text>\n\n <Text\n size=\"sm\"\n variant=\"supporting\"\n className={classNames(styles.address, isMobile && styles.textMobile)}\n >\n {receiptData.licensee &&\n `${receiptData.licensee.address || ''}, ${receiptData.licensee.city || ''}, ${receiptData.licensee.state || ''} ${receiptData.licensee.postalCode || ''}`}\n </Text>\n </Flex>\n </Flex>\n </div>\n )\n\n const renderBreakdownSection = () => (\n <Flex flexDirection=\"column\" gap={16}>\n <DataTable\n label={t('sections.debitedLabel')}\n columns={[\n {\n title: t('sections.debitedLabel'),\n render: (item: { label: string; amount: number }) => <Text>{item.label}</Text>,\n },\n {\n title: t('breakdown.amount'),\n render: (item: { label: string; amount: number }) => (\n <Text>{formatNumberAsCurrency(item.amount)}</Text>\n ),\n },\n ]}\n data={breakdownData}\n footer={() => ({\n 'column-0': <Text weight=\"semibold\">{t('breakdown.totals')}</Text>,\n 'column-1': (\n <Text weight=\"semibold\">\n {formatNumberAsCurrency(parseFloat(receiptData.totals?.companyDebit || '0'))}\n </Text>\n ),\n })}\n />\n </Flex>\n )\n\n const renderTaxBreakdown = () => (\n <Flex flexDirection=\"column\" gap={16}>\n <DataTable\n label={t('sections.taxLabel')}\n columns={[\n {\n title: t('sections.taxLabel'),\n render: (tax: TaxBreakdownItem) => <Text>{tax.name}</Text>,\n },\n {\n title: t('tax.amount'),\n render: (tax: TaxBreakdownItem) => (\n <Text>{formatNumberAsCurrency(parseFloat(tax.amount || '0'))}</Text>\n ),\n },\n ]}\n data={receiptData.taxes || []}\n footer={() => ({\n 'column-0': <Text weight=\"semibold\">{t('breakdown.totals')}</Text>,\n 'column-1': (\n <Text weight=\"semibold\">\n {formatNumberAsCurrency(parseFloat(receiptData.totals?.taxDebit || '0'))}\n </Text>\n ),\n })}\n />\n </Flex>\n )\n\n const renderEmployeeBreakdown = () => {\n const footerValues = [\n <Flex flexDirection=\"column\" gap={4} key=\"totals\">\n <Text weight=\"semibold\">{t('breakdown.totals')}</Text>\n <Text size=\"sm\" variant=\"supporting\">\n {t('employee.totalEmployees', {\n count: receiptData.employeeCompensations?.length || 0,\n })}\n </Text>\n </Flex>,\n <Text key=\"spacer\">{'\\u00A0'}</Text>,\n <Text weight=\"semibold\" key=\"childSupport\">\n {formatNumberAsCurrency(getTotalChildSupport())}\n </Text>,\n ...(withReimbursements\n ? [\n <Text weight=\"semibold\" key=\"reimbursements\">\n {formatNumberAsCurrency(getTotalReimbursements())}\n </Text>,\n ]\n : []),\n <Text weight=\"semibold\" key=\"taxes\">\n {formatNumberAsCurrency(getTotalTaxes())}\n </Text>,\n <Text weight=\"semibold\" key=\"netPay\">\n {formatNumberAsCurrency(getTotalNetPay())}\n </Text>,\n ]\n\n const footerContent = footerValues.reduce<Record<string, React.ReactNode>>(\n (acc, value, index) => {\n acc[`column-${index}`] = value\n return acc\n },\n {},\n )\n\n return (\n <Flex flexDirection=\"column\" gap={16}>\n {isMobile && <Heading as=\"h2\">{t('sections.employeesLabel')}</Heading>}\n <DataView\n label={t('sections.employeesLabel')}\n columns={[\n {\n title: t('employee.name'),\n render: (employee: EmployeeBreakdownItem) => (\n <Text>{getEmployeeFullName(employee)}</Text>\n ),\n },\n {\n title: t('employee.paymentMethod'),\n render: (employee: EmployeeBreakdownItem) => (\n <Text>{employee.paymentMethod || 'N/A'}</Text>\n ),\n },\n {\n title: t('employee.childSupport'),\n render: (employee: EmployeeBreakdownItem) => (\n <Text>\n {formatNumberAsCurrency(parseFloat(employee.childSupportGarnishment || '0'))}\n </Text>\n ),\n },\n ...(withReimbursements\n ? [\n {\n title: t('employee.reimbursement'),\n render: (employee: EmployeeBreakdownItem) => (\n <Text>\n {formatNumberAsCurrency(parseFloat(employee.totalReimbursement || '0'))}\n </Text>\n ),\n },\n ]\n : []),\n {\n title: t('employee.totalTaxes'),\n render: (employee: EmployeeBreakdownItem) => (\n <Text>{formatNumberAsCurrency(parseFloat(employee.totalTax || '0'))}</Text>\n ),\n },\n {\n title: t('employee.netPay'),\n render: (employee: EmployeeBreakdownItem) => (\n <Text>{formatNumberAsCurrency(parseFloat(employee.netPay || '0'))}</Text>\n ),\n },\n ]}\n data={receiptData.employeeCompensations || []}\n footer={() => footerContent}\n />\n </Flex>\n )\n }\n\n return (\n <div className={styles.container} ref={containerRef}>\n <Flex flexDirection=\"column\" gap={24}>\n {renderReceiptHeader()}\n {renderBreakdownSection()}\n {renderTaxBreakdown()}\n {renderEmployeeBreakdown()}\n </Flex>\n </div>\n )\n}\n"],"names":["PayrollReceiptsPresentation","receiptData","withReimbursements","Heading","Text","useComponentContext","useI18n","t","useTranslation","containerRef","useRef","isMobile","useContainerBreakpoints","getEmployeeFullName","emp","getTotalChildSupport","sum","getTotalReimbursements","getTotalNetPay","getTotalTaxes","breakdownData","receiptDetailsConfig","renderReceiptHeader","jsx","classNames","styles","jsxs","Flex","ReceiptCheck","formatNumberAsCurrency","DataView","item","renderBreakdownSection","DataTable","renderTaxBreakdown","tax","renderEmployeeBreakdown","footerContent","acc","value","index","employee"],"mappings":";;;;;;;;;;;;;AAqBO,MAAMA,IAA8B,CAAC;AAAA,EAC1C,aAAAC;AAAA,EACA,oBAAAC,IAAqB;AACvB,MAAwC;AACtC,QAAM,EAAE,SAAAC,GAAS,MAAAC,EAAA,IAASC,EAAA;AAC1B,EAAAC,EAAQ,yBAAyB;AACjC,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,yBAAyB,GAEhDC,IAAeC,EAAuB,IAAI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yB,EAAuB,WAAWY,EAAS,UAAU,GAAG,CAAC,EAAA,CAAE;AAAA,YAAA;AAAA,UAEtE;AAAA,UAEF,MAAMxC,EAAY,yBAAyB,CAAA;AAAA,UAC3C,QAAQ,MAAMoC;AAAA,QAAA;AAAA,MAAA;AAAA,IAChB,GACF;AAAA,EAEJ;AAEA,SACE,gBAAAd,EAAC,OAAA,EAAI,WAAWE,EAAO,WAAW,KAAKhB,GACrC,UAAA,gBAAAiB,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAC/B,UAAA;AAAA,IAAAL,EAAA;AAAA,IACAU,EAAA;AAAA,IACAE,EAAA;AAAA,IACAE,EAAA;AAAA,EAAwB,EAAA,CAC3B,EAAA,CACF;AAEJ;"}
@@ -8,4 +8,5 @@ export { PayrollOverview } from './PayrollOverview/PayrollOverview';
8
8
  export { PayrollFlow } from './PayrollFlow/PayrollFlow';
9
9
  export { PayrollReceipts } from './PayrollReceipts/PayrollReceipts';
10
10
  export { ConfirmWireDetails } from './ConfirmWireDetails/ConfirmWireDetails';
11
+ export type { ConfirmWireDetailsProps, ConfirmWireDetailsComponentType } from './ConfirmWireDetails';
11
12
  export { PayrollBlocker, type ApiPayrollBlocker } from './PayrollBlocker';
@@ -1,4 +1,4 @@
1
- import { useState as m, useCallback as y, useEffect as S } from "react";
1
+ import { useState as y, useCallback as m, useEffect as S } from "react";
2
2
  import { usePayrollsPrepareMutation as h } from "@gusto/embedded-api/react-query/payrollsPrepare";
3
3
  import { usePaySchedulesGet as f } from "@gusto/embedded-api/react-query/paySchedulesGet";
4
4
  import "react/jsx-runtime";
@@ -11,15 +11,14 @@ import { useBase as b } from "../Base/useBase.js";
11
11
  import "../../shared/constants.js";
12
12
  import "classnames";
13
13
  import "../../contexts/ComponentAdapter/useComponentContext.js";
14
- import "../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
15
14
  import "dompurify";
16
- const M = ({
15
+ const H = ({
17
16
  companyId: e,
18
17
  payrollId: t,
19
18
  employeeUuids: o,
20
19
  sortBy: s
21
20
  }) => {
22
- const { mutateAsync: i, isPending: l } = h(), [r, d] = m(), { baseSubmitHandler: p } = b(), { data: u, isLoading: n } = f(
21
+ const { mutateAsync: i, isPending: l } = h(), [r, d] = y(), { baseSubmitHandler: p } = b(), { data: u, isLoading: n } = f(
23
22
  {
24
23
  companyId: e,
25
24
  payScheduleId: r?.payPeriod?.payScheduleUuid || ""
@@ -27,7 +26,7 @@ const M = ({
27
26
  {
28
27
  enabled: !!r?.payPeriod?.payScheduleUuid
29
28
  }
30
- ), a = y(async () => {
29
+ ), a = m(async () => {
31
30
  await p(null, async () => {
32
31
  const P = await i({
33
32
  request: {
@@ -54,6 +53,6 @@ const M = ({
54
53
  };
55
54
  };
56
55
  export {
57
- M as usePreparedPayrollData
56
+ H as usePreparedPayrollData
58
57
  };
59
58
  //# sourceMappingURL=usePreparedPayrollData.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"usePreparedPayrollData.js","sources":["../../../src/components/Payroll/usePreparedPayrollData.ts"],"sourcesContent":["import { useState, useEffect, useCallback } from 'react'\nimport { usePayrollsPrepareMutation } from '@gusto/embedded-api/react-query/payrollsPrepare'\nimport { usePaySchedulesGet } from '@gusto/embedded-api/react-query/paySchedulesGet'\nimport type { PayrollPrepared } from '@gusto/embedded-api/models/components/payrollprepared'\nimport type { PayScheduleObject } from '@gusto/embedded-api/models/components/payscheduleobject'\nimport type { PayrollPrepareSortBy } from '@gusto/embedded-api/models/components/payrollpreparesortby'\nimport { useBase } from '../Base'\n\ninterface UsePreparedPayrollDataParams {\n companyId: string\n payrollId: string\n employeeUuids?: string[]\n sortBy?: PayrollPrepareSortBy\n}\n\ninterface UsePreparedPayrollDataReturn {\n handlePreparePayroll: () => Promise<void>\n preparedPayroll: PayrollPrepared | undefined\n paySchedule: PayScheduleObject | undefined\n isLoading: boolean\n}\n\nexport const usePreparedPayrollData = ({\n companyId,\n payrollId,\n employeeUuids,\n sortBy,\n}: UsePreparedPayrollDataParams): UsePreparedPayrollDataReturn => {\n const { mutateAsync: preparePayroll, isPending: isPreparePayrollPending } =\n usePayrollsPrepareMutation()\n const [preparedPayroll, setPreparedPayroll] = useState<PayrollPrepared | undefined>()\n const { baseSubmitHandler } = useBase()\n\n const { data: payScheduleData, isLoading: isPayScheduleLoading } = usePaySchedulesGet(\n {\n companyId,\n payScheduleId: preparedPayroll?.payPeriod?.payScheduleUuid || '',\n },\n {\n enabled: !!preparedPayroll?.payPeriod?.payScheduleUuid,\n },\n )\n\n const handlePreparePayroll = useCallback(async () => {\n await baseSubmitHandler(null, async () => {\n const result = await preparePayroll({\n request: {\n companyId,\n payrollId,\n sortBy,\n requestBody: {\n employeeUuids,\n },\n },\n })\n setPreparedPayroll(result.payrollPrepared)\n })\n }, [companyId, payrollId, preparePayroll, employeeUuids, baseSubmitHandler])\n\n useEffect(() => {\n void handlePreparePayroll()\n }, [handlePreparePayroll])\n\n const isLoading = isPreparePayrollPending || isPayScheduleLoading\n\n return {\n handlePreparePayroll,\n preparedPayroll,\n paySchedule: payScheduleData?.payScheduleObject,\n isLoading,\n }\n}\n"],"names":["usePreparedPayrollData","companyId","payrollId","employeeUuids","sortBy","preparePayroll","isPreparePayrollPending","usePayrollsPrepareMutation","preparedPayroll","setPreparedPayroll","useState","baseSubmitHandler","useBase","payScheduleData","isPayScheduleLoading","usePaySchedulesGet","handlePreparePayroll","useCallback","result","useEffect","isLoading"],"mappings":";;;;;;;;;;;;;;;AAsBO,MAAMA,IAAyB,CAAC;AAAA,EACrC,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,eAAAC;AAAA,EACA,QAAAC;AACF,MAAkE;AAChE,QAAM,EAAE,aAAaC,GAAgB,WAAWC,EAAA,IAC9CC,EAAA,GACI,CAACC,GAAiBC,CAAkB,IAAIC,EAAA,GACxC,EAAE,mBAAAC,EAAA,IAAsBC,EAAA,GAExB,EAAE,MAAMC,GAAiB,WAAWC,MAAyBC;AAAA,IACjE;AAAA,MACE,WAAAd;AAAA,MACA,eAAeO,GAAiB,WAAW,mBAAmB;AAAA,IAAA;AAAA,IAEhE;AAAA,MACE,SAAS,CAAC,CAACA,GAAiB,WAAW;AAAA,IAAA;AAAA,EACzC,GAGIQ,IAAuBC,EAAY,YAAY;AACnD,UAAMN,EAAkB,MAAM,YAAY;AACxC,YAAMO,IAAS,MAAMb,EAAe;AAAA,QAClC,SAAS;AAAA,UACP,WAAAJ;AAAA,UACA,WAAAC;AAAA,UACA,QAAAE;AAAA,UACA,aAAa;AAAA,YACX,eAAAD;AAAA,UAAA;AAAA,QACF;AAAA,MACF,CACD;AACD,MAAAM,EAAmBS,EAAO,eAAe;AAAA,IAC3C,CAAC;AAAA,EACH,GAAG,CAACjB,GAAWC,GAAWG,GAAgBF,GAAeQ,CAAiB,CAAC;AAE3E,EAAAQ,EAAU,MAAM;AACd,IAAKH,EAAA;AAAA,EACP,GAAG,CAACA,CAAoB,CAAC;AAEzB,QAAMI,IAAYd,KAA2BQ;AAE7C,SAAO;AAAA,IACL,sBAAAE;AAAA,IACA,iBAAAR;AAAA,IACA,aAAaK,GAAiB;AAAA,IAC9B,WAAAO;AAAA,EAAA;AAEJ;"}
1
+ {"version":3,"file":"usePreparedPayrollData.js","sources":["../../../src/components/Payroll/usePreparedPayrollData.ts"],"sourcesContent":["import { useState, useEffect, useCallback } from 'react'\nimport { usePayrollsPrepareMutation } from '@gusto/embedded-api/react-query/payrollsPrepare'\nimport { usePaySchedulesGet } from '@gusto/embedded-api/react-query/paySchedulesGet'\nimport type { PayrollPrepared } from '@gusto/embedded-api/models/components/payrollprepared'\nimport type { PayScheduleObject } from '@gusto/embedded-api/models/components/payscheduleobject'\nimport type { PayrollPrepareSortBy } from '@gusto/embedded-api/models/components/payrollpreparesortby'\nimport { useBase } from '../Base'\n\ninterface UsePreparedPayrollDataParams {\n companyId: string\n payrollId: string\n employeeUuids?: string[]\n sortBy?: PayrollPrepareSortBy\n}\n\ninterface UsePreparedPayrollDataReturn {\n handlePreparePayroll: () => Promise<void>\n preparedPayroll: PayrollPrepared | undefined\n paySchedule: PayScheduleObject | undefined\n isLoading: boolean\n}\n\nexport const usePreparedPayrollData = ({\n companyId,\n payrollId,\n employeeUuids,\n sortBy,\n}: UsePreparedPayrollDataParams): UsePreparedPayrollDataReturn => {\n const { mutateAsync: preparePayroll, isPending: isPreparePayrollPending } =\n usePayrollsPrepareMutation()\n const [preparedPayroll, setPreparedPayroll] = useState<PayrollPrepared | undefined>()\n const { baseSubmitHandler } = useBase()\n\n const { data: payScheduleData, isLoading: isPayScheduleLoading } = usePaySchedulesGet(\n {\n companyId,\n payScheduleId: preparedPayroll?.payPeriod?.payScheduleUuid || '',\n },\n {\n enabled: !!preparedPayroll?.payPeriod?.payScheduleUuid,\n },\n )\n\n const handlePreparePayroll = useCallback(async () => {\n await baseSubmitHandler(null, async () => {\n const result = await preparePayroll({\n request: {\n companyId,\n payrollId,\n sortBy,\n requestBody: {\n employeeUuids,\n },\n },\n })\n setPreparedPayroll(result.payrollPrepared)\n })\n }, [companyId, payrollId, preparePayroll, employeeUuids, baseSubmitHandler])\n\n useEffect(() => {\n void handlePreparePayroll()\n }, [handlePreparePayroll])\n\n const isLoading = isPreparePayrollPending || isPayScheduleLoading\n\n return {\n handlePreparePayroll,\n preparedPayroll,\n paySchedule: payScheduleData?.payScheduleObject,\n isLoading,\n }\n}\n"],"names":["usePreparedPayrollData","companyId","payrollId","employeeUuids","sortBy","preparePayroll","isPreparePayrollPending","usePayrollsPrepareMutation","preparedPayroll","setPreparedPayroll","useState","baseSubmitHandler","useBase","payScheduleData","isPayScheduleLoading","usePaySchedulesGet","handlePreparePayroll","useCallback","result","useEffect","isLoading"],"mappings":";;;;;;;;;;;;;;AAsBO,MAAMA,IAAyB,CAAC;AAAA,EACrC,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,eAAAC;AAAA,EACA,QAAAC;AACF,MAAkE;AAChE,QAAM,EAAE,aAAaC,GAAgB,WAAWC,EAAA,IAC9CC,EAAA,GACI,CAACC,GAAiBC,CAAkB,IAAIC,EAAA,GACxC,EAAE,mBAAAC,EAAA,IAAsBC,EAAA,GAExB,EAAE,MAAMC,GAAiB,WAAWC,MAAyBC;AAAA,IACjE;AAAA,MACE,WAAAd;AAAA,MACA,eAAeO,GAAiB,WAAW,mBAAmB;AAAA,IAAA;AAAA,IAEhE;AAAA,MACE,SAAS,CAAC,CAACA,GAAiB,WAAW;AAAA,IAAA;AAAA,EACzC,GAGIQ,IAAuBC,EAAY,YAAY;AACnD,UAAMN,EAAkB,MAAM,YAAY;AACxC,YAAMO,IAAS,MAAMb,EAAe;AAAA,QAClC,SAAS;AAAA,UACP,WAAAJ;AAAA,UACA,WAAAC;AAAA,UACA,QAAAE;AAAA,UACA,aAAa;AAAA,YACX,eAAAD;AAAA,UAAA;AAAA,QACF;AAAA,MACF,CACD;AACD,MAAAM,EAAmBS,EAAO,eAAe;AAAA,IAC3C,CAAC;AAAA,EACH,GAAG,CAACjB,GAAWC,GAAWG,GAAgBF,GAAeQ,CAAiB,CAAC;AAE3E,EAAAQ,EAAU,MAAM;AACd,IAAKH,EAAA;AAAA,EACP,GAAG,CAACA,CAAoB,CAAC;AAEzB,QAAMI,IAAYd,KAA2BQ;AAE7C,SAAO;AAAA,IACL,sBAAAE;AAAA,IACA,iBAAAR;AAAA,IACA,aAAaK,GAAiB;AAAA,IAC9B,WAAAO;AAAA,EAAA;AAEJ;"}
@@ -1,8 +1,10 @@
1
+ import { QueryClient } from '@tanstack/react-query';
1
2
  import { SDKHooks } from '../../types/hooks';
2
3
  export interface ApiProviderProps {
3
4
  url: string;
4
5
  headers?: HeadersInit;
5
6
  hooks?: SDKHooks;
6
7
  children: React.ReactNode;
8
+ queryClient?: QueryClient;
7
9
  }
8
- export declare function ApiProvider({ url, headers, hooks, children }: ApiProviderProps): import("react/jsx-runtime").JSX.Element;
10
+ export declare function ApiProvider({ url, headers, hooks, children, queryClient: queryClientFromProps, }: ApiProviderProps): import("react/jsx-runtime").JSX.Element;
@@ -1,18 +1,24 @@
1
- import { jsx as c } from "react/jsx-runtime";
2
- import { QueryClient as p, QueryClientProvider as E } from "@tanstack/react-query";
3
- import { GustoEmbeddedProvider as H } from "@gusto/embedded-api/react-query/_context";
4
- import { GustoEmbeddedCore as b } from "@gusto/embedded-api/core";
5
- import { SDKHooks as R } from "@gusto/embedded-api/hooks/hooks";
6
- import { useMemo as a } from "react";
7
- function Q({ url: i, headers: s, hooks: e, children: u }) {
8
- const d = a(() => {
9
- const r = new b({
10
- serverURL: i
11
- }), o = r._options.hooks || new R();
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import { QueryClient as E, QueryClientProvider as H } from "@tanstack/react-query";
3
+ import { GustoEmbeddedProvider as b } from "@gusto/embedded-api/react-query/_context";
4
+ import { GustoEmbeddedCore as R } from "@gusto/embedded-api/core";
5
+ import { SDKHooks as g } from "@gusto/embedded-api/hooks/hooks";
6
+ import { useMemo as u } from "react";
7
+ function x({
8
+ url: f,
9
+ headers: s,
10
+ hooks: e,
11
+ children: d,
12
+ queryClient: i
13
+ }) {
14
+ const m = u(() => {
15
+ const r = new R({
16
+ serverURL: f
17
+ }), o = r._options.hooks || new g();
12
18
  if (s) {
13
19
  const t = {
14
- beforeRequest: (g, n) => (new Headers(s).forEach((f, l) => {
15
- f && n.headers.set(l, f);
20
+ beforeRequest: (q, n) => (new Headers(s).forEach((c, p) => {
21
+ c && n.headers.set(p, c);
16
22
  }), n)
17
23
  };
18
24
  o.registerBeforeRequestHook(t);
@@ -26,15 +32,17 @@ function Q({ url: i, headers: s, hooks: e, children: u }) {
26
32
  }), e?.afterError && e.afterError.forEach((t) => {
27
33
  o.registerAfterErrorHook(t);
28
34
  }), r._options.hooks || (r._options.hooks = o), r;
29
- }, [i, s, e]), m = a(() => {
30
- const r = new p(), o = async () => {
35
+ }, [f, s, e]), l = u(() => {
36
+ if (i)
37
+ return i;
38
+ const r = new E(), o = async () => {
31
39
  await r.invalidateQueries();
32
40
  };
33
41
  return r.setQueryDefaults(["@gusto/embedded-api"], { retry: !1 }), r.setMutationDefaults(["@gusto/embedded-api"], { onSettled: o, retry: !1 }), r;
34
- }, []);
35
- return /* @__PURE__ */ c(E, { client: m, children: /* @__PURE__ */ c(H, { client: d, children: u }) });
42
+ }, [i]);
43
+ return /* @__PURE__ */ a(H, { client: l, children: /* @__PURE__ */ a(b, { client: m, children: d }) });
36
44
  }
37
45
  export {
38
- Q as ApiProvider
46
+ x as ApiProvider
39
47
  };
40
48
  //# sourceMappingURL=ApiProvider.js.map