@gusto/embedded-react-sdk 0.55.4 → 0.55.6

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 (354) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/components/Common/DataView/DataTable/DataTable.js +44 -41
  3. package/dist/components/Common/DataView/DataTable/DataTable.js.map +1 -1
  4. package/dist/components/Common/RequirementsList/RequirementsList.js +21 -12
  5. package/dist/components/Common/RequirementsList/RequirementsList.js.map +1 -1
  6. package/dist/components/Common/UI/Table/Table.module.scss.js +1 -1
  7. package/dist/components/Company/PaySchedule/PaySchedule.js +21 -15
  8. package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
  9. package/dist/components/Company/StateTaxes/TaxRateManagement/TaxRateHistorySection.js +1 -0
  10. package/dist/components/Company/StateTaxes/TaxRateManagement/TaxRateHistorySection.js.map +1 -1
  11. package/dist/components/Contractor/Compensation/management/CompensationEditForm.js +20 -17
  12. package/dist/components/Contractor/Compensation/management/CompensationEditForm.js.map +1 -1
  13. package/dist/components/Contractor/Compensation/shared/useContractorPayForm/contractorPaySchema.d.ts +1 -0
  14. package/dist/components/Contractor/Compensation/shared/useContractorPayForm/contractorPaySchema.js +21 -17
  15. package/dist/components/Contractor/Compensation/shared/useContractorPayForm/contractorPaySchema.js.map +1 -1
  16. package/dist/components/Contractor/Compensation/shared/useContractorPayForm/fields.d.ts +7 -1
  17. package/dist/components/Contractor/Compensation/shared/useContractorPayForm/fields.js.map +1 -1
  18. package/dist/components/Contractor/Compensation/shared/useContractorPayForm/index.d.ts +1 -1
  19. package/dist/components/Contractor/ContractorList/management/ManagementContractorListView.js +112 -100
  20. package/dist/components/Contractor/ContractorList/management/ManagementContractorListView.js.map +1 -1
  21. package/dist/components/Contractor/ContractorList/onboarding/ContractorListView.js +46 -40
  22. package/dist/components/Contractor/ContractorList/onboarding/ContractorListView.js.map +1 -1
  23. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js +10 -9
  24. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js.map +1 -1
  25. package/dist/components/Contractor/Profile/onboarding/ContractorProfile.js +22 -19
  26. package/dist/components/Contractor/Profile/onboarding/ContractorProfile.js.map +1 -1
  27. package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/contractorDetailsSchema.d.ts +1 -0
  28. package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/contractorDetailsSchema.js +34 -30
  29. package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/contractorDetailsSchema.js.map +1 -1
  30. package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/fields.d.ts +7 -1
  31. package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/fields.js.map +1 -1
  32. package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/index.d.ts +1 -1
  33. package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/useContractorDetailsForm.js +32 -32
  34. package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/useContractorDetailsForm.js.map +1 -1
  35. package/dist/components/Employee/Compensation/onboarding/JobsList/JobsListPresentation.js +1 -0
  36. package/dist/components/Employee/Compensation/onboarding/JobsList/JobsListPresentation.js.map +1 -1
  37. package/dist/components/Employee/Deductions/management/DeductionsCard/DeductionsCard.js +11 -10
  38. package/dist/components/Employee/Deductions/management/DeductionsCard/DeductionsCard.js.map +1 -1
  39. package/dist/components/Employee/Deductions/onboarding/DeductionsList/DeductionsList.js +7 -6
  40. package/dist/components/Employee/Deductions/onboarding/DeductionsList/DeductionsList.js.map +1 -1
  41. package/dist/components/Employee/PaymentMethod/onboarding/ListView.js +20 -19
  42. package/dist/components/Employee/PaymentMethod/onboarding/ListView.js.map +1 -1
  43. package/dist/components/Employee/Paystubs/management/PaystubsCard/PaystubsCard.js +12 -10
  44. package/dist/components/Employee/Paystubs/management/PaystubsCard/PaystubsCard.js.map +1 -1
  45. package/dist/components/InformationRequests/InformationRequests.js +63 -64
  46. package/dist/components/InformationRequests/InformationRequests.js.map +1 -1
  47. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js +13 -12
  48. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js.map +1 -1
  49. package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTable.module.scss.js +1 -1
  50. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +200 -195
  51. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
  52. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +93 -85
  53. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
  54. package/dist/components/Payroll/PayrollConfiguration/useCalculationPoll.d.ts +50 -0
  55. package/dist/components/Payroll/PayrollConfiguration/useCalculationPoll.js +52 -0
  56. package/dist/components/Payroll/PayrollConfiguration/useCalculationPoll.js.map +1 -0
  57. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js +52 -50
  58. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js.map +1 -1
  59. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +259 -255
  60. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
  61. package/dist/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/fields.d.ts +278 -0
  62. package/dist/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/index.d.ts +1 -0
  63. package/dist/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/payrollEditEmployeeHelpers.d.ts +108 -0
  64. package/dist/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/payrollEditEmployeeHelpers.test.d.ts +1 -0
  65. package/dist/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/payrollEditEmployeeSchema.d.ts +95 -0
  66. package/dist/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/payrollEditEmployeeSchema.test.d.ts +1 -0
  67. package/dist/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/usePayrollEditEmployeeForm.d.ts +126 -0
  68. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +1 -0
  69. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
  70. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +191 -183
  71. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
  72. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +117 -107
  73. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
  74. package/dist/components/Payroll/PayrollOverview/useSubmissionPoll.d.ts +39 -0
  75. package/dist/components/Payroll/PayrollOverview/useSubmissionPoll.js +46 -0
  76. package/dist/components/Payroll/PayrollOverview/useSubmissionPoll.js.map +1 -0
  77. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +40 -34
  78. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
  79. package/dist/components/Payroll/PrintChecks/PrintChecksForm/PrintChecksForm.js +72 -87
  80. package/dist/components/Payroll/PrintChecks/PrintChecksForm/PrintChecksForm.js.map +1 -1
  81. package/dist/components/Payroll/PrintChecks/PrintChecksForm/useGenerationPoll.d.ts +17 -0
  82. package/dist/components/Payroll/PrintChecks/PrintChecksForm/useGenerationPoll.js +55 -0
  83. package/dist/components/Payroll/PrintChecks/PrintChecksForm/useGenerationPoll.js.map +1 -0
  84. package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js +2 -0
  85. package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js.map +1 -1
  86. package/dist/components/Payroll/UNSTABLE_PayrollEditEmployee/UNSTABLE_PayrollEditEmployee.d.ts +13 -0
  87. package/dist/components/Payroll/UNSTABLE_PayrollEditEmployee/UNSTABLE_PayrollEditEmployee.js +58 -0
  88. package/dist/components/Payroll/UNSTABLE_PayrollEditEmployee/UNSTABLE_PayrollEditEmployee.js.map +1 -0
  89. package/dist/components/Payroll/UNSTABLE_PayrollEditEmployee/UNSTABLE_PayrollEditEmployee.module.scss.js +8 -0
  90. package/dist/components/Payroll/UNSTABLE_PayrollEditEmployee/UNSTABLE_PayrollEditEmployee.module.scss.js.map +1 -0
  91. package/dist/components/Payroll/helpers.d.ts +15 -0
  92. package/dist/components/Payroll/helpers.js.map +1 -1
  93. package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTable.js +35 -35
  94. package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTable.js.map +1 -1
  95. package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTable.module.scss.js +4 -4
  96. package/dist/contexts/UnstableFeaturesProvider/useUnstableFeature.d.ts +2 -0
  97. package/dist/contexts/UnstableFeaturesProvider/useUnstableFeature.js.map +1 -1
  98. package/dist/hooks/usePollingTask/usePollingTask.d.ts +101 -0
  99. package/dist/hooks/usePollingTask/usePollingTask.js +50 -0
  100. package/dist/hooks/usePollingTask/usePollingTask.js.map +1 -0
  101. package/dist/hooks/usePollingTask/usePollingTask.test.d.ts +1 -0
  102. package/dist/i18n/I18n.js +147 -30
  103. package/dist/i18n/I18n.js.map +1 -1
  104. package/dist/i18n/en/Contractor.ContractorList.json.js +14 -12
  105. package/dist/i18n/en/Contractor.ContractorList.json.js.map +1 -1
  106. package/dist/i18n/en/Contractor.Management.Compensation.json.js +6 -6
  107. package/dist/i18n/en/Contractor.ManagementContractorList.json.js +8 -8
  108. package/dist/i18n/en/Contractor.Profile.json.js +5 -5
  109. package/dist/i18n/en/Payroll.OffCyclePayPeriodDateForm.json.js +7 -5
  110. package/dist/i18n/en/Payroll.OffCyclePayPeriodDateForm.json.js.map +1 -1
  111. package/dist/i18n/en/Payroll.PayrollHistory.json.js +8 -8
  112. package/dist/i18n/en/Payroll.PayrollOverview.json.js +16 -16
  113. package/dist/i18n/en/Payroll.UNSTABLE_PayrollEditEmployee.json.js +98 -0
  114. package/dist/i18n/en/Payroll.UNSTABLE_PayrollEditEmployee.json.js.map +1 -0
  115. package/dist/i18n/en/common.json.d.ts +1 -0
  116. package/dist/i18n/en/common.json.js +1 -1
  117. package/dist/i18n/es_US/Company.Addresses.json.js +8 -0
  118. package/dist/i18n/es_US/Company.Addresses.json.js.map +1 -0
  119. package/dist/i18n/es_US/Company.AssignSignatory.json.js +22 -0
  120. package/dist/i18n/es_US/Company.AssignSignatory.json.js.map +1 -0
  121. package/dist/i18n/es_US/Company.BankAccount.json.js +20 -0
  122. package/dist/i18n/es_US/Company.BankAccount.json.js.map +1 -0
  123. package/dist/i18n/es_US/Company.DocumentList.json.js +28 -0
  124. package/dist/i18n/es_US/Company.DocumentList.json.js.map +1 -0
  125. package/dist/i18n/es_US/Company.FederalTaxes.json.js +28 -0
  126. package/dist/i18n/es_US/Company.FederalTaxes.json.js.map +1 -0
  127. package/dist/i18n/es_US/Company.Industry.json.js +12 -0
  128. package/dist/i18n/es_US/Company.Industry.json.js.map +1 -0
  129. package/dist/i18n/es_US/Company.Locations.json.js +44 -0
  130. package/dist/i18n/es_US/Company.Locations.json.js.map +1 -0
  131. package/dist/i18n/es_US/Company.OnboardingOverview.json.js +24 -0
  132. package/dist/i18n/es_US/Company.OnboardingOverview.json.js.map +1 -0
  133. package/dist/i18n/es_US/Company.PaySchedule.json.js +36 -0
  134. package/dist/i18n/es_US/Company.PaySchedule.json.js.map +1 -0
  135. package/dist/i18n/es_US/Company.SignatureForm.json.js +20 -0
  136. package/dist/i18n/es_US/Company.SignatureForm.json.js.map +1 -0
  137. package/dist/i18n/es_US/Company.StateTaxes.json.js +12 -0
  138. package/dist/i18n/es_US/Company.StateTaxes.json.js.map +1 -0
  139. package/dist/i18n/es_US/Company.TimeOff.CreateTimeOffPolicy.json.js +18 -0
  140. package/dist/i18n/es_US/Company.TimeOff.CreateTimeOffPolicy.json.js.map +1 -0
  141. package/dist/i18n/es_US/Company.TimeOff.EmployeeTable.json.js +26 -0
  142. package/dist/i18n/es_US/Company.TimeOff.EmployeeTable.json.js.map +1 -0
  143. package/dist/i18n/es_US/Company.TimeOff.HolidayPolicy.json.js +26 -0
  144. package/dist/i18n/es_US/Company.TimeOff.HolidayPolicy.json.js.map +1 -0
  145. package/dist/i18n/es_US/Company.TimeOff.PolicyDetail.json.js +14 -0
  146. package/dist/i18n/es_US/Company.TimeOff.PolicyDetail.json.js.map +1 -0
  147. package/dist/i18n/es_US/Company.TimeOff.SelectEmployees.json.js +22 -0
  148. package/dist/i18n/es_US/Company.TimeOff.SelectEmployees.json.js.map +1 -0
  149. package/dist/i18n/es_US/Company.TimeOff.SelectPolicyType.json.js +26 -0
  150. package/dist/i18n/es_US/Company.TimeOff.SelectPolicyType.json.js.map +1 -0
  151. package/dist/i18n/es_US/Company.TimeOff.TimeOffPolicies.json.js +40 -0
  152. package/dist/i18n/es_US/Company.TimeOff.TimeOffPolicies.json.js.map +1 -0
  153. package/dist/i18n/es_US/Company.TimeOff.TimeOffPolicyDetails.json.js +52 -0
  154. package/dist/i18n/es_US/Company.TimeOff.TimeOffPolicyDetails.json.js.map +1 -0
  155. package/dist/i18n/es_US/Company.TimeOff.TimeOffRequests.json.js +21 -0
  156. package/dist/i18n/es_US/Company.TimeOff.TimeOffRequests.json.js.map +1 -0
  157. package/dist/i18n/es_US/Contractor.Address.json.js +22 -0
  158. package/dist/i18n/es_US/Contractor.Address.json.js.map +1 -0
  159. package/dist/i18n/es_US/Contractor.BankAccountFields.json.js +12 -0
  160. package/dist/i18n/es_US/Contractor.BankAccountFields.json.js.map +1 -0
  161. package/dist/i18n/es_US/Contractor.ContractorList.json.js +24 -0
  162. package/dist/i18n/es_US/Contractor.ContractorList.json.js.map +1 -0
  163. package/dist/i18n/es_US/Contractor.Dashboard.json.js +14 -0
  164. package/dist/i18n/es_US/Contractor.Dashboard.json.js.map +1 -0
  165. package/dist/i18n/es_US/Contractor.DocumentsList.json.js +18 -0
  166. package/dist/i18n/es_US/Contractor.DocumentsList.json.js.map +1 -0
  167. package/dist/i18n/es_US/Contractor.Landing.json.js +18 -0
  168. package/dist/i18n/es_US/Contractor.Landing.json.js.map +1 -0
  169. package/dist/i18n/es_US/Contractor.Management.Address.json.js +14 -0
  170. package/dist/i18n/es_US/Contractor.Management.Address.json.js.map +1 -0
  171. package/dist/i18n/es_US/Contractor.Management.Compensation.json.js +22 -0
  172. package/dist/i18n/es_US/Contractor.Management.Compensation.json.js.map +1 -0
  173. package/dist/i18n/es_US/Contractor.Management.Documents.json.js +16 -0
  174. package/dist/i18n/es_US/Contractor.Management.Documents.json.js.map +1 -0
  175. package/dist/i18n/es_US/Contractor.Management.PaymentMethod.json.js +24 -0
  176. package/dist/i18n/es_US/Contractor.Management.PaymentMethod.json.js.map +1 -0
  177. package/dist/i18n/es_US/Contractor.Management.Profile.json.js +20 -0
  178. package/dist/i18n/es_US/Contractor.Management.Profile.json.js.map +1 -0
  179. package/dist/i18n/es_US/Contractor.ManagementContractorList.json.js +48 -0
  180. package/dist/i18n/es_US/Contractor.ManagementContractorList.json.js.map +1 -0
  181. package/dist/i18n/es_US/Contractor.NewHireReport.json.js +22 -0
  182. package/dist/i18n/es_US/Contractor.NewHireReport.json.js.map +1 -0
  183. package/dist/i18n/es_US/Contractor.OnboardingSummary.json.js +10 -0
  184. package/dist/i18n/es_US/Contractor.OnboardingSummary.json.js.map +1 -0
  185. package/dist/i18n/es_US/Contractor.PaymentMethod.json.js +20 -0
  186. package/dist/i18n/es_US/Contractor.PaymentMethod.json.js.map +1 -0
  187. package/dist/i18n/es_US/Contractor.Payments.CreateHistoricalPayment.json.js +34 -0
  188. package/dist/i18n/es_US/Contractor.Payments.CreateHistoricalPayment.json.js.map +1 -0
  189. package/dist/i18n/es_US/Contractor.Payments.CreatePayment.json.js +42 -0
  190. package/dist/i18n/es_US/Contractor.Payments.CreatePayment.json.js.map +1 -0
  191. package/dist/i18n/es_US/Contractor.Payments.HistoricalPaymentSummary.json.js +42 -0
  192. package/dist/i18n/es_US/Contractor.Payments.HistoricalPaymentSummary.json.js.map +1 -0
  193. package/dist/i18n/es_US/Contractor.Payments.PaymentHistory.json.js +26 -0
  194. package/dist/i18n/es_US/Contractor.Payments.PaymentHistory.json.js.map +1 -0
  195. package/dist/i18n/es_US/Contractor.Payments.PaymentStatement.json.js +22 -0
  196. package/dist/i18n/es_US/Contractor.Payments.PaymentStatement.json.js.map +1 -0
  197. package/dist/i18n/es_US/Contractor.Payments.PaymentSummary.json.js +54 -0
  198. package/dist/i18n/es_US/Contractor.Payments.PaymentSummary.json.js.map +1 -0
  199. package/dist/i18n/es_US/Contractor.Payments.PaymentsList.json.js +32 -0
  200. package/dist/i18n/es_US/Contractor.Payments.PaymentsList.json.js.map +1 -0
  201. package/dist/i18n/es_US/Contractor.Profile.json.js +18 -0
  202. package/dist/i18n/es_US/Contractor.Profile.json.js.map +1 -0
  203. package/dist/i18n/es_US/Contractor.SelectContractors.json.js +18 -0
  204. package/dist/i18n/es_US/Contractor.SelectContractors.json.js.map +1 -0
  205. package/dist/i18n/es_US/Contractor.SignatureForm.json.js +34 -0
  206. package/dist/i18n/es_US/Contractor.SignatureForm.json.js.map +1 -0
  207. package/dist/i18n/es_US/Contractor.Submit.json.js +26 -0
  208. package/dist/i18n/es_US/Contractor.Submit.json.js.map +1 -0
  209. package/dist/i18n/es_US/Employee.BankAccount.json.js +14 -0
  210. package/dist/i18n/es_US/Employee.BankAccount.json.js.map +1 -0
  211. package/dist/i18n/es_US/Employee.BankFormBody.json.js +12 -0
  212. package/dist/i18n/es_US/Employee.BankFormBody.json.js.map +1 -0
  213. package/dist/i18n/es_US/Employee.Compensation.json.js +68 -0
  214. package/dist/i18n/es_US/Employee.Compensation.json.js.map +1 -0
  215. package/dist/i18n/es_US/Employee.Dashboard.json.js +12 -0
  216. package/dist/i18n/es_US/Employee.Dashboard.json.js.map +1 -0
  217. package/dist/i18n/es_US/Employee.Deductions.json.js +142 -0
  218. package/dist/i18n/es_US/Employee.Deductions.json.js.map +1 -0
  219. package/dist/i18n/es_US/Employee.DeductionsForm.json.js +24 -0
  220. package/dist/i18n/es_US/Employee.DeductionsForm.json.js.map +1 -0
  221. package/dist/i18n/es_US/Employee.DocumentManager.json.js +10 -0
  222. package/dist/i18n/es_US/Employee.DocumentManager.json.js.map +1 -0
  223. package/dist/i18n/es_US/Employee.DocumentSigner.json.js +28 -0
  224. package/dist/i18n/es_US/Employee.DocumentSigner.json.js.map +1 -0
  225. package/dist/i18n/es_US/Employee.EmployeeDocuments.json.js +10 -0
  226. package/dist/i18n/es_US/Employee.EmployeeDocuments.json.js.map +1 -0
  227. package/dist/i18n/es_US/Employee.EmployeeList.json.js +30 -0
  228. package/dist/i18n/es_US/Employee.EmployeeList.json.js.map +1 -0
  229. package/dist/i18n/es_US/Employee.EmploymentEligibility.json.js +22 -0
  230. package/dist/i18n/es_US/Employee.EmploymentEligibility.json.js.map +1 -0
  231. package/dist/i18n/es_US/Employee.FederalTaxes.json.js +46 -0
  232. package/dist/i18n/es_US/Employee.FederalTaxes.json.js.map +1 -0
  233. package/dist/i18n/es_US/Employee.FederalTaxesView.json.js +38 -0
  234. package/dist/i18n/es_US/Employee.FederalTaxesView.json.js.map +1 -0
  235. package/dist/i18n/es_US/Employee.HomeAddress.json.js +24 -0
  236. package/dist/i18n/es_US/Employee.HomeAddress.json.js.map +1 -0
  237. package/dist/i18n/es_US/Employee.I9SignatureForm.json.js +64 -0
  238. package/dist/i18n/es_US/Employee.I9SignatureForm.json.js.map +1 -0
  239. package/dist/i18n/es_US/Employee.Landing.json.js +16 -0
  240. package/dist/i18n/es_US/Employee.Landing.json.js.map +1 -0
  241. package/dist/i18n/es_US/Employee.Management.Compensation.json.js +66 -0
  242. package/dist/i18n/es_US/Employee.Management.Compensation.json.js.map +1 -0
  243. package/dist/i18n/es_US/Employee.Management.Deductions.json.js +26 -0
  244. package/dist/i18n/es_US/Employee.Management.Deductions.json.js.map +1 -0
  245. package/dist/i18n/es_US/Employee.Management.Documents.json.js +18 -0
  246. package/dist/i18n/es_US/Employee.Management.Documents.json.js.map +1 -0
  247. package/dist/i18n/es_US/Employee.Management.FederalTaxes.json.js +42 -0
  248. package/dist/i18n/es_US/Employee.Management.FederalTaxes.json.js.map +1 -0
  249. package/dist/i18n/es_US/Employee.Management.HomeAddress.json.js +56 -0
  250. package/dist/i18n/es_US/Employee.Management.HomeAddress.json.js.map +1 -0
  251. package/dist/i18n/es_US/Employee.Management.PaymentMethod.json.js +24 -0
  252. package/dist/i18n/es_US/Employee.Management.PaymentMethod.json.js.map +1 -0
  253. package/dist/i18n/es_US/Employee.Management.PaymentMethodBankForm.json.js +12 -0
  254. package/dist/i18n/es_US/Employee.Management.PaymentMethodBankForm.json.js.map +1 -0
  255. package/dist/i18n/es_US/Employee.Management.PaymentMethodSplitForm.json.js +22 -0
  256. package/dist/i18n/es_US/Employee.Management.PaymentMethodSplitForm.json.js.map +1 -0
  257. package/dist/i18n/es_US/Employee.Management.Paystubs.json.js +28 -0
  258. package/dist/i18n/es_US/Employee.Management.Paystubs.json.js.map +1 -0
  259. package/dist/i18n/es_US/Employee.Management.Profile.json.js +16 -0
  260. package/dist/i18n/es_US/Employee.Management.Profile.json.js.map +1 -0
  261. package/dist/i18n/es_US/Employee.Management.StateTaxes.json.js +16 -0
  262. package/dist/i18n/es_US/Employee.Management.StateTaxes.json.js.map +1 -0
  263. package/dist/i18n/es_US/Employee.Management.WorkAddress.json.js +52 -0
  264. package/dist/i18n/es_US/Employee.Management.WorkAddress.json.js.map +1 -0
  265. package/dist/i18n/es_US/Employee.ManagementEmployeeList.json.js +26 -0
  266. package/dist/i18n/es_US/Employee.ManagementEmployeeList.json.js.map +1 -0
  267. package/dist/i18n/es_US/Employee.OnboardingSummary.json.js +22 -0
  268. package/dist/i18n/es_US/Employee.OnboardingSummary.json.js.map +1 -0
  269. package/dist/i18n/es_US/Employee.PaySchedules.json.js +12 -0
  270. package/dist/i18n/es_US/Employee.PaySchedules.json.js.map +1 -0
  271. package/dist/i18n/es_US/Employee.PaymentMethod.json.js +68 -0
  272. package/dist/i18n/es_US/Employee.PaymentMethod.json.js.map +1 -0
  273. package/dist/i18n/es_US/Employee.Profile.json.js +32 -0
  274. package/dist/i18n/es_US/Employee.Profile.json.js.map +1 -0
  275. package/dist/i18n/es_US/Employee.SplitPaycheck.json.js +26 -0
  276. package/dist/i18n/es_US/Employee.SplitPaycheck.json.js.map +1 -0
  277. package/dist/i18n/es_US/Employee.SplitPaymentsFormBody.json.js +22 -0
  278. package/dist/i18n/es_US/Employee.SplitPaymentsFormBody.json.js.map +1 -0
  279. package/dist/i18n/es_US/Employee.StateTaxes.json.js +14 -0
  280. package/dist/i18n/es_US/Employee.StateTaxes.json.js.map +1 -0
  281. package/dist/i18n/es_US/Employee.StateTaxesView.json.js +12 -0
  282. package/dist/i18n/es_US/Employee.StateTaxesView.json.js.map +1 -0
  283. package/dist/i18n/es_US/Employee.Terminations.TerminateEmployee.json.js +18 -0
  284. package/dist/i18n/es_US/Employee.Terminations.TerminateEmployee.json.js.map +1 -0
  285. package/dist/i18n/es_US/Employee.Terminations.TerminationFlow.json.js +12 -0
  286. package/dist/i18n/es_US/Employee.Terminations.TerminationFlow.json.js.map +1 -0
  287. package/dist/i18n/es_US/Employee.Terminations.TerminationSummary.json.js +20 -0
  288. package/dist/i18n/es_US/Employee.Terminations.TerminationSummary.json.js.map +1 -0
  289. package/dist/i18n/es_US/InformationRequests.InformationRequestForm.json.js +20 -0
  290. package/dist/i18n/es_US/InformationRequests.InformationRequestForm.json.js.map +1 -0
  291. package/dist/i18n/es_US/InformationRequests.InformationRequestList.json.js +18 -0
  292. package/dist/i18n/es_US/InformationRequests.InformationRequestList.json.js.map +1 -0
  293. package/dist/i18n/es_US/InformationRequests.json.js +8 -0
  294. package/dist/i18n/es_US/InformationRequests.json.js.map +1 -0
  295. package/dist/i18n/es_US/Payroll.Common.json.js +8 -0
  296. package/dist/i18n/es_US/Payroll.Common.json.js.map +1 -0
  297. package/dist/i18n/es_US/Payroll.ConfirmWireDetailsBanner.json.js +14 -0
  298. package/dist/i18n/es_US/Payroll.ConfirmWireDetailsBanner.json.js.map +1 -0
  299. package/dist/i18n/es_US/Payroll.ConfirmWireDetailsForm.json.js +26 -0
  300. package/dist/i18n/es_US/Payroll.ConfirmWireDetailsForm.json.js.map +1 -0
  301. package/dist/i18n/es_US/Payroll.Dismissal.json.js +16 -0
  302. package/dist/i18n/es_US/Payroll.Dismissal.json.js.map +1 -0
  303. package/dist/i18n/es_US/Payroll.EmployeeSelection.json.js +8 -0
  304. package/dist/i18n/es_US/Payroll.EmployeeSelection.json.js.map +1 -0
  305. package/dist/i18n/es_US/Payroll.GrossUpModal.json.js +26 -0
  306. package/dist/i18n/es_US/Payroll.GrossUpModal.json.js.map +1 -0
  307. package/dist/i18n/es_US/Payroll.OffCycle.json.js +8 -0
  308. package/dist/i18n/es_US/Payroll.OffCycle.json.js.map +1 -0
  309. package/dist/i18n/es_US/Payroll.OffCycleCreation.json.js +16 -0
  310. package/dist/i18n/es_US/Payroll.OffCycleCreation.json.js.map +1 -0
  311. package/dist/i18n/es_US/Payroll.OffCycleDeductionsSetting.json.js +8 -0
  312. package/dist/i18n/es_US/Payroll.OffCycleDeductionsSetting.json.js.map +1 -0
  313. package/dist/i18n/es_US/Payroll.OffCyclePayPeriodDateForm.json.js +14 -0
  314. package/dist/i18n/es_US/Payroll.OffCyclePayPeriodDateForm.json.js.map +1 -0
  315. package/dist/i18n/es_US/Payroll.OffCycleReasonSelection.json.js +12 -0
  316. package/dist/i18n/es_US/Payroll.OffCycleReasonSelection.json.js.map +1 -0
  317. package/dist/i18n/es_US/Payroll.OffCycleTaxWithholding.json.js +16 -0
  318. package/dist/i18n/es_US/Payroll.OffCycleTaxWithholding.json.js.map +1 -0
  319. package/dist/i18n/es_US/Payroll.PayrollBlocker.json.js +34 -0
  320. package/dist/i18n/es_US/Payroll.PayrollBlocker.json.js.map +1 -0
  321. package/dist/i18n/es_US/Payroll.PayrollConfiguration.json.js +44 -0
  322. package/dist/i18n/es_US/Payroll.PayrollConfiguration.json.js.map +1 -0
  323. package/dist/i18n/es_US/Payroll.PayrollEditEmployee.json.js +66 -0
  324. package/dist/i18n/es_US/Payroll.PayrollEditEmployee.json.js.map +1 -0
  325. package/dist/i18n/es_US/Payroll.PayrollHistory.json.js +22 -0
  326. package/dist/i18n/es_US/Payroll.PayrollHistory.json.js.map +1 -0
  327. package/dist/i18n/es_US/Payroll.PayrollLanding.json.js +16 -0
  328. package/dist/i18n/es_US/Payroll.PayrollLanding.json.js.map +1 -0
  329. package/dist/i18n/es_US/Payroll.PayrollList.json.js +38 -0
  330. package/dist/i18n/es_US/Payroll.PayrollList.json.js.map +1 -0
  331. package/dist/i18n/es_US/Payroll.PayrollOverview.json.js +70 -0
  332. package/dist/i18n/es_US/Payroll.PayrollOverview.json.js.map +1 -0
  333. package/dist/i18n/es_US/Payroll.PayrollReceipts.json.js +20 -0
  334. package/dist/i18n/es_US/Payroll.PayrollReceipts.json.js.map +1 -0
  335. package/dist/i18n/es_US/Payroll.RecoveryCasesList.json.js +20 -0
  336. package/dist/i18n/es_US/Payroll.RecoveryCasesList.json.js.map +1 -0
  337. package/dist/i18n/es_US/Payroll.RecoveryCasesResubmit.json.js +8 -0
  338. package/dist/i18n/es_US/Payroll.RecoveryCasesResubmit.json.js.map +1 -0
  339. package/dist/i18n/es_US/Payroll.Transition.json.js +8 -0
  340. package/dist/i18n/es_US/Payroll.Transition.json.js.map +1 -0
  341. package/dist/i18n/es_US/Payroll.TransitionCreation.json.js +20 -0
  342. package/dist/i18n/es_US/Payroll.TransitionCreation.json.js.map +1 -0
  343. package/dist/i18n/es_US/Payroll.TransitionPayrollAlert.json.js +18 -0
  344. package/dist/i18n/es_US/Payroll.TransitionPayrollAlert.json.js.map +1 -0
  345. package/dist/i18n/es_US/Payroll.WireInstructions.json.js +30 -0
  346. package/dist/i18n/es_US/Payroll.WireInstructions.json.js.map +1 -0
  347. package/dist/i18n/es_US/common.json.js +44 -0
  348. package/dist/i18n/es_US/common.json.js.map +1 -0
  349. package/dist/i18n/types.d.ts +262 -6
  350. package/dist/index.d.ts +2 -2
  351. package/dist/models/external.d.ts +23 -0
  352. package/dist/style.css +1 -1
  353. package/docs/guides/endpoint-inventory.json +5 -0
  354. package/package.json +10 -10
@@ -1 +1 @@
1
- {"version":3,"file":"PayrollEditEmployeePresentation.js","sources":["../../../../src/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.tsx"],"sourcesContent":["import { FormProvider, useFieldArray, useForm, useWatch } from 'react-hook-form'\nimport { useMemo, useRef, useState } from 'react'\nimport type { Employee } from '@gusto/embedded-api/models/components/employee'\nimport type {\n FixedCompensations,\n PayrollEmployeeCompensationsType,\n PayrollEmployeeCompensationsTypePaidTimeOff,\n Reimbursements as Reimbursement,\n} from '@gusto/embedded-api/models/components/payrollemployeecompensationstype'\nimport { PayrollEmployeeCompensationsTypePaymentMethod } from '@gusto/embedded-api/models/components/payrollemployeecompensationstype'\nimport type { PayrollFixedCompensationTypesType } from '@gusto/embedded-api/models/components/payrollfixedcompensationtypestype'\nimport type { PayScheduleShow as PayScheduleObject } from '@gusto/embedded-api/models/components/payscheduleshow'\nimport { useTranslation } from 'react-i18next'\nimport { z } from 'zod'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport styles from './PayrollEditEmployeePresentation.module.scss'\nimport { TimeOffField, PayoutTimeOffField } from './TimeOffField'\nimport {\n Flex,\n Grid,\n TextInputField,\n RadioGroupField,\n DataView,\n useDataView,\n EmptyData,\n} from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\nimport { Form } from '@/components/Common/Form'\nimport { formatNumberAsCurrency, firstLastName } from '@/helpers/formattedStrings'\nimport { getAdditionalEarningsCompensations, calculateGrossPay } from '@/components/Payroll/helpers'\nimport { PayrollCategory, isOffCyclePayroll } from '@/components/Payroll/payrollTypes'\nimport {\n COMPENSATION_NAME_DOUBLE_OVERTIME,\n COMPENSATION_NAME_OVERTIME,\n COMPENSATION_NAME_REGULAR_HOURS,\n HOURS_COMPENSATION_NAMES,\n EXCLUDED_ADDITIONAL_EARNINGS,\n COMPENSATION_NAME_REIMBURSEMENT,\n COMPENSATION_NAME_BONUS,\n COMPENSATION_NAME_PAYCHECK_TIPS,\n COMPENSATION_NAME_CORRECTION_PAYMENT,\n COMPENSATION_NAME_COMMISSION,\n COMPENSATION_NAME_CASH_TIPS,\n} from '@/shared/constants'\nimport useContainerBreakpoints from '@/hooks/useContainerBreakpoints/useContainerBreakpoints'\nimport PlusCircleIcon from '@/assets/icons/plus-circle.svg?react'\nimport TrashCanSvg from '@/assets/icons/trashcan.svg?react'\n\ninterface PayrollEditEmployeeProps {\n onSave: (updatedCompensation: PayrollEmployeeCompensationsType) => void\n onCancel: () => void\n employee: Employee\n employeeCompensation?: PayrollEmployeeCompensationsType\n isPending?: boolean\n fixedCompensationTypes: PayrollFixedCompensationTypesType[]\n payPeriodStartDate?: string\n paySchedule?: PayScheduleObject\n payrollCategory?: PayrollCategory\n withReimbursements?: boolean\n hasDirectDepositSetup?: boolean\n}\n\nconst ReimbursementFormSchema = z.object({\n uuid: z.string().nullable().optional(),\n description: z.string(),\n amount: z.string(),\n recurring: z.boolean().optional(),\n})\n\nconst DraftReimbursementSchema = z.object({\n description: z.string(),\n amount: z.string().refine(\n val => {\n const num = parseFloat(val)\n return !Number.isNaN(num) && num > 0\n },\n { message: 'validations.reimbursementAmount' },\n ),\n})\n\n// A native `min={0}` only constrains the stepper: it does not stop a typed \"-50\", and the\n// SDK's <form> is noValidate so the browser never enforces it either. Negative amounts\n// therefore reached the platform and came back only as a submit-time error (SDK-1285).\n// Applied via z.record below, this covers every additional earning -- correction payment\n// included -- because they all share the fixedCompensations record.\nconst nonNegativeAmountSchema = z\n .string()\n .optional()\n .refine(val => !val || parseFloat(val) >= 0, { message: 'validations.negativeAmount' })\n\nconst PayrollEditEmployeeFormSchema = z.object({\n hourlyCompensations: z.record(z.string(), z.record(z.string(), z.string().optional())),\n timeOffCompensations: z.record(z.string(), z.string().optional()),\n finalPayoutCompensations: z.record(z.string(), z.string().optional()),\n fixedCompensations: z.record(z.string(), nonNegativeAmountSchema),\n reimbursements: z.array(ReimbursementFormSchema),\n paymentMethod: z.enum(PayrollEmployeeCompensationsTypePaymentMethod).optional(),\n})\n\n/** @internal */\nexport type PayrollEditEmployeeFormValues = z.infer<typeof PayrollEditEmployeeFormSchema>\n\nconst buildCompensationFromFormData = (\n formData: PayrollEditEmployeeFormValues,\n employeeCompensation: PayrollEmployeeCompensationsType | undefined,\n timeOff: PayrollEmployeeCompensationsTypePaidTimeOff[],\n primaryJobUuid?: string,\n payrollCategory: PayrollCategory = PayrollCategory.Regular,\n): PayrollEmployeeCompensationsType => {\n const updatedCompensation = {\n ...employeeCompensation,\n paymentMethod: formData.paymentMethod,\n }\n\n updatedCompensation.hourlyCompensations = employeeCompensation?.hourlyCompensations?.map(\n compensation => {\n const hours =\n compensation.jobUuid && compensation.name\n ? formData.hourlyCompensations[compensation.jobUuid]?.[compensation.name]\n : undefined\n return hours\n ? {\n ...compensation,\n hours,\n }\n : compensation\n },\n )\n\n updatedCompensation.paidTimeOff = timeOff.map(timeOffEntry => {\n const isDismissal = payrollCategory === PayrollCategory.Dismissal\n const { finalPayoutUnusedHoursInput: _, ...timeOffWithoutPayout } = timeOffEntry\n\n if (isDismissal) {\n const finalPayout =\n formData.finalPayoutCompensations[timeOffEntry.name!] ??\n timeOffEntry.finalPayoutUnusedHoursInput\n return {\n ...timeOffEntry,\n hours: formData.timeOffCompensations[timeOffEntry.name!] || '0',\n ...(finalPayout != null ? { finalPayoutUnusedHoursInput: finalPayout || '0' } : {}),\n }\n }\n\n return {\n ...timeOffWithoutPayout,\n hours: formData.timeOffCompensations[timeOffEntry.name!] || '0',\n }\n })\n\n // Off-cycle payrolls today use the legacy single Reimbursement field in fixed_compensations\n // because the backend feature flag `emb_off_cycle_disable_named_reimbursements` (default: true,\n // expected removal 2026-09-01) rejects named entries in the itemized `reimbursements[]` array.\n // TODO(post-2026-09-01): once that flag is removed, unify on the itemized path for all categories.\n const usesItemizedReimbursements = !isOffCyclePayroll(payrollCategory)\n\n const updatedFixedCompensations: FixedCompensations[] = []\n\n Object.entries(formData.fixedCompensations).forEach(([fixedCompensationName, formAmount]) => {\n const isReimbursementEntry =\n fixedCompensationName.toLowerCase() === COMPENSATION_NAME_REIMBURSEMENT.toLowerCase()\n\n // Regular payrolls write reimbursements via the itemized array; never let the legacy\n // fixed_compensations entry slip through (the backend rejects it on v2025-11-15+).\n if (isReimbursementEntry && usesItemizedReimbursements) {\n return\n }\n\n const existingFixedCompensation = employeeCompensation?.fixedCompensations?.find(\n fixedCompensation =>\n fixedCompensation.name?.toLowerCase() === fixedCompensationName.toLowerCase(),\n )\n\n if (formAmount !== undefined && formAmount !== '') {\n if (existingFixedCompensation) {\n updatedFixedCompensations.push({\n name: existingFixedCompensation.name,\n jobUuid: existingFixedCompensation.jobUuid,\n amount: formAmount,\n })\n } else if (parseFloat(formAmount) !== 0) {\n updatedFixedCompensations.push({\n name: fixedCompensationName,\n jobUuid: primaryJobUuid,\n amount: formAmount,\n })\n }\n }\n })\n\n updatedCompensation.fixedCompensations = updatedFixedCompensations\n\n if (usesItemizedReimbursements) {\n updatedCompensation.reimbursements = formData.reimbursements.map(reimbursement => ({\n amount: reimbursement.amount,\n description:\n reimbursement.description.trim() === '' ? null : reimbursement.description.trim(),\n uuid: reimbursement.uuid ?? null,\n recurring: reimbursement.recurring,\n }))\n } else {\n // Off-cycle: ensure no itemized array leaks through. The container also strips this defensively.\n updatedCompensation.reimbursements = []\n }\n\n return updatedCompensation\n}\n\n/** @internal */\nexport const PayrollEditEmployeePresentation = ({\n onSave,\n onCancel,\n employee,\n employeeCompensation,\n isPending = false,\n fixedCompensationTypes,\n payPeriodStartDate,\n paySchedule,\n payrollCategory = PayrollCategory.Regular,\n withReimbursements = true,\n hasDirectDepositSetup = true,\n}: PayrollEditEmployeeProps) => {\n const { Button, ButtonIcon, Heading, Text } = useComponentContext()\n\n const { t } = useTranslation('Payroll.PayrollEditEmployee')\n useI18n('Payroll.PayrollEditEmployee')\n\n const primaryJob = employee.jobs?.find(job => job.primary)\n const primaryJobHasHourlyCompensations = employeeCompensation?.hourlyCompensations?.some(\n c => c.jobUuid === primaryJob?.uuid,\n )\n const hourlyJobs = primaryJob && primaryJobHasHourlyCompensations ? [primaryJob] : []\n\n const containerRef = useRef<HTMLDivElement>(null)\n const breakpoints = useContainerBreakpoints({\n ref: containerRef,\n })\n const isSmallOrGreater = breakpoints.includes('small')\n\n employeeCompensation?.hourlyCompensations?.forEach(compensation => {\n const job = employee.jobs?.find(job => job.uuid === compensation.jobUuid)\n if (job && !hourlyJobs.find(hourlyJob => hourlyJob.uuid === job.uuid)) {\n hourlyJobs.push(job)\n }\n })\n\n const timeOff = (employeeCompensation?.paidTimeOff || []).filter(entry => entry.name)\n\n const additionalEarnings = getAdditionalEarningsCompensations({\n flsaStatus: primaryJob?.compensations?.[0]?.flsaStatus,\n existingFixedCompensations: employeeCompensation?.fixedCompensations || [],\n primaryJobUuid: primaryJob?.uuid,\n fixedCompensationTypes,\n excludedTypes: EXCLUDED_ADDITIONAL_EARNINGS,\n })\n\n // Off-cycle payrolls use the legacy single Reimbursement field in fixed_compensations because\n // the backend `emb_off_cycle_disable_named_reimbursements` flag (default: true, expected\n // removal 2026-09-01) rejects named entries in the itemized `reimbursements[]` array.\n // TODO(post-2026-09-01): unify on the itemized path once that flag is removed.\n const usesItemizedReimbursements = !isOffCyclePayroll(payrollCategory)\n\n const initialReimbursements: Reimbursement[] = useMemo(\n () =>\n withReimbursements && usesItemizedReimbursements\n ? (employeeCompensation?.reimbursements ?? [])\n : [],\n [withReimbursements, usesItemizedReimbursements, employeeCompensation?.reimbursements],\n )\n\n const existingReimbursementFixedCompensation = useMemo(\n () =>\n employeeCompensation?.fixedCompensations?.find(\n comp => comp.name?.toLowerCase() === COMPENSATION_NAME_REIMBURSEMENT.toLowerCase(),\n ),\n [employeeCompensation?.fixedCompensations],\n )\n\n const showLegacyReimbursementField =\n withReimbursements && !usesItemizedReimbursements && Boolean(primaryJob?.uuid)\n\n const findMatchingCompensation = (jobUuid: string, compensationName: string) => {\n return employeeCompensation?.hourlyCompensations?.find(\n compensation =>\n compensation.jobUuid === jobUuid &&\n compensation.name?.toLowerCase() === compensationName.toLowerCase(),\n )\n }\n\n const getCompensationLabel = (compensationName?: string) => {\n switch (compensationName) {\n case COMPENSATION_NAME_REGULAR_HOURS:\n return t('compensationNames.regularHours')\n case COMPENSATION_NAME_OVERTIME:\n return t('compensationNames.overtime')\n case COMPENSATION_NAME_DOUBLE_OVERTIME:\n return t('compensationNames.doubleOvertime')\n default:\n return compensationName\n }\n }\n\n const getFixedCompensationLabel = (compensationName?: string) => {\n switch (compensationName) {\n case COMPENSATION_NAME_BONUS:\n return t('fixedCompensationNames.bonus')\n case COMPENSATION_NAME_PAYCHECK_TIPS:\n return t('fixedCompensationNames.paycheckTips')\n case COMPENSATION_NAME_CORRECTION_PAYMENT:\n return t('fixedCompensationNames.correctionPayment')\n case COMPENSATION_NAME_COMMISSION:\n return t('fixedCompensationNames.commission')\n case COMPENSATION_NAME_CASH_TIPS:\n return t('fixedCompensationNames.cashTips')\n case COMPENSATION_NAME_REIMBURSEMENT:\n return t('fixedCompensationNames.reimbursement')\n default:\n return compensationName\n }\n }\n\n const defaultValues = {\n hourlyCompensations: (() => {\n const hourlyCompensations: PayrollEditEmployeeFormValues['hourlyCompensations'] = {}\n\n hourlyJobs.forEach(hourlyJob => {\n HOURS_COMPENSATION_NAMES.forEach(compensationName => {\n const matchingCompensation = findMatchingCompensation(hourlyJob.uuid, compensationName)\n if (matchingCompensation) {\n if (!hourlyCompensations[hourlyJob.uuid]) {\n hourlyCompensations[hourlyJob.uuid] = {}\n }\n hourlyCompensations[hourlyJob.uuid]![matchingCompensation.name!] =\n matchingCompensation.hours ? parseFloat(matchingCompensation.hours).toString() : ''\n }\n })\n })\n\n return hourlyCompensations\n })(),\n\n timeOffCompensations: (() => {\n const timeOffCompensations: PayrollEditEmployeeFormValues['timeOffCompensations'] = {}\n\n timeOff.forEach(timeOffCompensation => {\n timeOffCompensations[timeOffCompensation.name!] = timeOffCompensation.hours\n ? parseFloat(timeOffCompensation.hours).toString()\n : ''\n })\n\n return timeOffCompensations\n })(),\n\n finalPayoutCompensations: (() => {\n const finalPayoutCompensations: PayrollEditEmployeeFormValues['finalPayoutCompensations'] = {}\n\n timeOff.forEach(timeOffCompensation => {\n finalPayoutCompensations[timeOffCompensation.name!] =\n timeOffCompensation.finalPayoutUnusedHoursInput ?? '0'\n })\n\n return finalPayoutCompensations\n })(),\n\n fixedCompensations: (() => {\n const fixedCompensations: PayrollEditEmployeeFormValues['fixedCompensations'] = {}\n\n additionalEarnings.forEach(fixedComp => {\n fixedCompensations[fixedComp.name!] = fixedComp.amount ?? ''\n })\n\n if (showLegacyReimbursementField) {\n fixedCompensations[COMPENSATION_NAME_REIMBURSEMENT] =\n existingReimbursementFixedCompensation?.amount ?? '0.00'\n }\n\n return fixedCompensations\n })(),\n\n reimbursements: initialReimbursements.map(reimbursement => ({\n uuid: reimbursement.uuid ?? null,\n description: reimbursement.description ?? '',\n amount: reimbursement.amount,\n recurring: reimbursement.recurring ?? false,\n })),\n\n paymentMethod:\n employeeCompensation?.paymentMethod ||\n PayrollEmployeeCompensationsTypePaymentMethod.DirectDeposit,\n }\n\n const formHandlers = useForm<PayrollEditEmployeeFormValues>({\n resolver: zodResolver(PayrollEditEmployeeFormSchema),\n defaultValues,\n })\n\n const {\n fields: reimbursementFields,\n append: appendReimbursement,\n remove: removeReimbursement,\n update: updateReimbursement,\n } = useFieldArray({\n control: formHandlers.control,\n name: 'reimbursements',\n })\n\n const handleRemoveReimbursement = (index: number) => {\n const field = reimbursementFields[index]\n if (!field) return\n\n if (field.uuid) {\n updateReimbursement(index, { ...field, amount: '0' })\n } else {\n removeReimbursement(index)\n }\n }\n\n type VisibleReimbursementRow = (typeof reimbursementFields)[number] & {\n originalIndex: number\n }\n\n const visibleReimbursementRows: VisibleReimbursementRow[] = reimbursementFields\n .map((field, originalIndex) => ({ ...field, originalIndex }))\n .filter(row => parseFloat(row.amount || '0') !== 0)\n\n const [isAddingReimbursement, setIsAddingReimbursement] = useState(false)\n\n type DraftReimbursementValues = z.infer<typeof DraftReimbursementSchema>\n\n const draftForm = useForm<DraftReimbursementValues>({\n resolver: zodResolver(DraftReimbursementSchema),\n defaultValues: { description: '', amount: '' },\n })\n\n const resetReimbursementDraft = () => {\n setIsAddingReimbursement(false)\n draftForm.reset()\n }\n\n const onDraftReimbursementValid = (data: DraftReimbursementValues) => {\n const parsedAmount = parseFloat(data.amount)\n appendReimbursement({\n uuid: null,\n description: data.description.trim(),\n amount: parsedAmount.toFixed(2),\n recurring: false,\n })\n resetReimbursementDraft()\n }\n\n const reimbursementDataViewProps = useDataView<VisibleReimbursementRow>({\n data: visibleReimbursementRows,\n columns: [\n {\n key: 'description',\n title: t('reimbursementDescriptionColumn'),\n render: row => row.description.trim() || t('reimbursementUnnamedFallback'),\n },\n {\n key: 'amount',\n title: t('reimbursementAmountColumn'),\n render: row => formatNumberAsCurrency(parseFloat(row.amount || '0')),\n },\n {\n key: 'recurring',\n title: t('reimbursementTypeColumn'),\n render: row =>\n row.recurring ? t('reimbursementTypeRecurring') : t('reimbursementTypeOneTime'),\n },\n ],\n itemMenu: row => {\n if (row.recurring) return null\n const displayDescription = row.description.trim() || t('reimbursementUnnamedFallback')\n return (\n <ButtonIcon\n variant=\"tertiary\"\n onClick={() => {\n handleRemoveReimbursement(row.originalIndex)\n }}\n aria-label={t('removeReimbursementLabel', { description: displayDescription })}\n >\n <TrashCanSvg aria-hidden />\n </ButtonIcon>\n )\n },\n emptyState: () => (\n <EmptyData title={t('reimbursementEmptyTitle')}>\n <Button\n variant=\"secondary\"\n onClick={() => {\n setIsAddingReimbursement(true)\n }}\n icon={<PlusCircleIcon aria-hidden />}\n >\n {t('addReimbursementCta')}\n </Button>\n </EmptyData>\n ),\n })\n\n const watchedFormData = useWatch({\n control: formHandlers.control,\n })\n\n const currentGrossPay = useMemo(() => {\n try {\n const hourlyCompensations: Record<string, Record<string, string | undefined>> = {}\n if (watchedFormData.hourlyCompensations) {\n Object.entries(watchedFormData.hourlyCompensations).forEach(([jobId, compensations]) => {\n if (compensations) {\n hourlyCompensations[jobId] = compensations\n }\n })\n }\n\n const reimbursementsWithDefaults: PayrollEditEmployeeFormValues['reimbursements'] = (\n watchedFormData.reimbursements ?? []\n ).map(reimbursement => ({\n uuid: reimbursement.uuid ?? null,\n description: reimbursement.description ?? '',\n amount: reimbursement.amount ?? '0',\n recurring: reimbursement.recurring,\n }))\n\n const formDataWithDefaults: PayrollEditEmployeeFormValues = {\n hourlyCompensations,\n timeOffCompensations: watchedFormData.timeOffCompensations || {},\n finalPayoutCompensations: watchedFormData.finalPayoutCompensations || {},\n fixedCompensations: watchedFormData.fixedCompensations || {},\n reimbursements: reimbursementsWithDefaults,\n paymentMethod: watchedFormData.paymentMethod,\n }\n\n const updatedCompensation = buildCompensationFromFormData(\n formDataWithDefaults,\n employeeCompensation,\n (employeeCompensation?.paidTimeOff || []).filter(entry => entry.name),\n primaryJob?.uuid,\n payrollCategory,\n )\n\n return calculateGrossPay(\n updatedCompensation,\n employee,\n payPeriodStartDate,\n paySchedule,\n payrollCategory,\n )\n } catch {\n return employeeCompensation\n ? calculateGrossPay(\n employeeCompensation,\n employee,\n payPeriodStartDate,\n paySchedule,\n payrollCategory,\n )\n : 0\n }\n }, [\n watchedFormData,\n employeeCompensation,\n primaryJob?.uuid,\n employee,\n payPeriodStartDate,\n paySchedule,\n payrollCategory,\n ])\n\n const employeeName = firstLastName({\n first_name: employee.firstName,\n last_name: employee.lastName,\n })\n\n const onSubmit = (data: PayrollEditEmployeeFormValues) => {\n const updatedCompensation = buildCompensationFromFormData(\n data,\n employeeCompensation,\n timeOff,\n primaryJob?.uuid,\n payrollCategory,\n )\n onSave(updatedCompensation)\n }\n\n const formattedCurrentGrossPay = formatNumberAsCurrency(currentGrossPay || 0)\n\n const actions = (\n <Flex\n flexDirection={isSmallOrGreater ? 'row' : 'column'}\n justifyContent={isSmallOrGreater ? 'flex-end' : 'normal'}\n alignItems={isSmallOrGreater ? 'flex-start' : 'stretch'}\n gap={12}\n >\n <Button variant=\"secondary\" onClick={onCancel} title={t('cancelCta')}>\n {t('cancelCta')}\n </Button>\n <Button\n onClick={formHandlers.handleSubmit(onSubmit)}\n title={t('saveCta')}\n isLoading={isPending}\n >\n {t('saveCta')}\n </Button>\n </Flex>\n )\n\n return (\n <div ref={containerRef} className={styles.container}>\n <div\n className={`${styles.headerSection} ${!isSmallOrGreater ? styles.headerSectionSticky : ''}`}\n >\n <Flex justifyContent=\"space-between\">\n <Flex flexDirection=\"column\" gap={isSmallOrGreater ? 8 : 2}>\n <Heading as=\"h1\" styledAs={isSmallOrGreater ? 'h2' : 'h4'}>\n {t('pageTitle', { employeeName })}\n </Heading>\n {isSmallOrGreater ? (\n <Flex flexDirection=\"column\" gap={6}>\n <Heading as=\"h2\" styledAs=\"h3\">\n {formattedCurrentGrossPay}\n </Heading>\n <Text className={styles.grossPayLabel}>{t('grossPayLabel')}</Text>\n </Flex>\n ) : (\n <Heading as=\"h2\" styledAs=\"h6\" className={styles.grossPayLabel}>\n {t('grossPayLabelMobile', { grossPay: formattedCurrentGrossPay })}\n </Heading>\n )}\n </Flex>\n {isSmallOrGreater && actions}\n </Flex>\n </div>\n <FormProvider {...formHandlers}>\n <Form>\n {hourlyJobs.length > 0 && (\n <div className={styles.fieldGroup}>\n <Heading as=\"h3\">{t('regularHoursTitle')}</Heading>\n {hourlyJobs.map(hourlyJob => (\n <Flex key={hourlyJob.uuid} flexDirection=\"column\" gap={8}>\n {hourlyJobs.length > 1 && <Heading as=\"h4\">{hourlyJob.title}</Heading>}\n <Grid gridTemplateColumns={{ base: '1fr', small: [320, 320] }} gap={20}>\n {HOURS_COMPENSATION_NAMES.map(compensationName => {\n const employeeHourlyCompensation = findMatchingCompensation(\n hourlyJob.uuid,\n compensationName,\n )\n if (employeeHourlyCompensation) {\n return (\n <TextInputField\n key={compensationName}\n type=\"number\"\n min={0}\n adornmentEnd={t('hoursUnit')}\n isRequired\n label={getCompensationLabel(compensationName)}\n name={`hourlyCompensations.${hourlyJob.uuid}.${employeeHourlyCompensation.name}`}\n />\n )\n }\n })}\n </Grid>\n </Flex>\n ))}\n </div>\n )}\n {timeOff.length > 0 && (\n <div className={styles.fieldGroup}>\n <Heading as=\"h3\" styledAs=\"h4\">\n {payrollCategory === PayrollCategory.Dismissal\n ? t('timeOffTitleDismissal')\n : t('timeOffTitle')}\n </Heading>\n <Grid gridTemplateColumns={{ base: '1fr', small: [320, 320] }} gap={20}>\n {timeOff.map(timeOffEntry => (\n <TimeOffField\n key={timeOffEntry.name}\n timeOff={timeOffEntry}\n employee={employee}\n />\n ))}\n </Grid>\n </div>\n )}\n {payrollCategory === PayrollCategory.Dismissal && timeOff.length > 0 && (\n <div className={styles.fieldGroup}>\n <Flex flexDirection=\"column\" gap={4}>\n <Heading as=\"h3\" styledAs=\"h4\">\n {t('finalPayoutTitle')}\n </Heading>\n <Text variant=\"supporting\">{t('finalPayoutDescription')}</Text>\n </Flex>\n <Grid gridTemplateColumns={{ base: '1fr', small: [320, 320] }} gap={20}>\n {timeOff.map(timeOffEntry => (\n <PayoutTimeOffField\n key={`payout-${timeOffEntry.name}`}\n timeOff={timeOffEntry}\n employee={employee}\n />\n ))}\n </Grid>\n </div>\n )}\n {additionalEarnings.length > 0 && (\n <div className={styles.fieldGroup}>\n <Heading as=\"h3\" styledAs=\"h4\">\n {t('additionalEarningsTitle')}\n </Heading>\n <Grid\n gridTemplateColumns={{ base: '1fr', small: [320, 320], large: [320, 320, 320] }}\n gap={20}\n >\n {additionalEarnings.map(fixedCompensation => (\n <TextInputField\n key={fixedCompensation.name}\n type=\"number\"\n min={0}\n adornmentStart=\"$\"\n isRequired\n label={getFixedCompensationLabel(fixedCompensation.name)}\n name={`fixedCompensations.${fixedCompensation.name}`}\n // useField only surfaces this once react-hook-form has flagged the\n // field, and the schema's only rule here is the negative-amount check.\n errorMessage={t('validations.negativeAmount')}\n />\n ))}\n </Grid>\n </div>\n )}\n {showLegacyReimbursementField && (\n <div className={styles.fieldGroup}>\n <Heading as=\"h3\" styledAs=\"h4\">\n {t('reimbursementTitle')}\n </Heading>\n <Grid gridTemplateColumns={{ base: '1fr', small: [320, 320] }} gap={20}>\n <TextInputField\n type=\"number\"\n min={0}\n adornmentStart=\"$\"\n isRequired\n label={getFixedCompensationLabel(COMPENSATION_NAME_REIMBURSEMENT)}\n name={`fixedCompensations.${COMPENSATION_NAME_REIMBURSEMENT}`}\n errorMessage={t('validations.negativeAmount')}\n />\n </Grid>\n </div>\n )}\n {withReimbursements && usesItemizedReimbursements && (\n <div className={styles.fieldGroup}>\n <Heading as=\"h3\" styledAs=\"h4\">\n {t('reimbursementTitle')}\n </Heading>\n {!(visibleReimbursementRows.length === 0 && isAddingReimbursement) && (\n <DataView label={t('reimbursementsTableLabel')} {...reimbursementDataViewProps} />\n )}\n {isAddingReimbursement ? (\n <FormProvider {...draftForm}>\n <Flex flexDirection=\"column\" gap={12}>\n <Grid gridTemplateColumns={{ base: '1fr', small: [320, 320] }} gap={20}>\n <TextInputField\n name=\"description\"\n label={t('reimbursementDescriptionLabel')}\n placeholder={t('reimbursementDescriptionPlaceholder')}\n />\n <TextInputField\n name=\"amount\"\n type=\"number\"\n min={0}\n adornmentStart=\"$\"\n isRequired\n label={t('reimbursementAmountLabel')}\n errorMessage={t('validations.reimbursementAmount')}\n />\n </Grid>\n <Flex gap={12}>\n <Button onClick={draftForm.handleSubmit(onDraftReimbursementValid)}>\n {t('saveReimbursementCta')}\n </Button>\n <Button variant=\"secondary\" onClick={resetReimbursementDraft}>\n {t('cancelReimbursementCta')}\n </Button>\n </Flex>\n </Flex>\n </FormProvider>\n ) : (\n visibleReimbursementRows.length > 0 && (\n <div>\n <Button\n variant=\"secondary\"\n onClick={() => {\n setIsAddingReimbursement(true)\n }}\n title={t('addReimbursementLink')}\n icon={<PlusCircleIcon aria-hidden />}\n >\n {t('addReimbursementLink')}\n </Button>\n </div>\n )\n )}\n </div>\n )}\n {hasDirectDepositSetup && (\n <div className={styles.fieldGroup}>\n <Heading as=\"h3\" styledAs=\"h4\">\n {t('paymentMethodTitle')}\n </Heading>\n <RadioGroupField\n name=\"paymentMethod\"\n isRequired\n label={t('paymentMethodLabel')}\n description={t('paymentMethodDescription')}\n options={[\n {\n value: PayrollEmployeeCompensationsTypePaymentMethod.DirectDeposit,\n label: t('paymentMethodOptions.directDeposit'),\n },\n {\n value: PayrollEmployeeCompensationsTypePaymentMethod.Check,\n label: t('paymentMethodOptions.check'),\n },\n ]}\n />\n </div>\n )}\n </Form>\n {!isSmallOrGreater && actions}\n </FormProvider>\n </div>\n )\n}\n"],"names":["ReimbursementFormSchema","z","DraftReimbursementSchema","val","num","nonNegativeAmountSchema","PayrollEditEmployeeFormSchema","PayrollEmployeeCompensationsTypePaymentMethod","buildCompensationFromFormData","formData","employeeCompensation","timeOff","primaryJobUuid","payrollCategory","PayrollCategory","updatedCompensation","compensation","hours","timeOffEntry","isDismissal","_","timeOffWithoutPayout","finalPayout","usesItemizedReimbursements","isOffCyclePayroll","updatedFixedCompensations","fixedCompensationName","formAmount","COMPENSATION_NAME_REIMBURSEMENT","existingFixedCompensation","fixedCompensation","reimbursement","PayrollEditEmployeePresentation","onSave","onCancel","employee","isPending","fixedCompensationTypes","payPeriodStartDate","paySchedule","withReimbursements","hasDirectDepositSetup","Button","ButtonIcon","Heading","Text","useComponentContext","t","useTranslation","useI18n","primaryJob","job","primaryJobHasHourlyCompensations","c","hourlyJobs","containerRef","useRef","isSmallOrGreater","useContainerBreakpoints","hourlyJob","entry","additionalEarnings","getAdditionalEarningsCompensations","EXCLUDED_ADDITIONAL_EARNINGS","initialReimbursements","useMemo","existingReimbursementFixedCompensation","comp","showLegacyReimbursementField","findMatchingCompensation","jobUuid","compensationName","getCompensationLabel","COMPENSATION_NAME_REGULAR_HOURS","COMPENSATION_NAME_OVERTIME","COMPENSATION_NAME_DOUBLE_OVERTIME","getFixedCompensationLabel","COMPENSATION_NAME_BONUS","COMPENSATION_NAME_PAYCHECK_TIPS","COMPENSATION_NAME_CORRECTION_PAYMENT","COMPENSATION_NAME_COMMISSION","COMPENSATION_NAME_CASH_TIPS","defaultValues","hourlyCompensations","HOURS_COMPENSATION_NAMES","matchingCompensation","timeOffCompensations","timeOffCompensation","finalPayoutCompensations","fixedCompensations","fixedComp","formHandlers","useForm","zodResolver","reimbursementFields","appendReimbursement","removeReimbursement","updateReimbursement","useFieldArray","handleRemoveReimbursement","index","field","visibleReimbursementRows","originalIndex","row","isAddingReimbursement","setIsAddingReimbursement","useState","draftForm","resetReimbursementDraft","onDraftReimbursementValid","data","parsedAmount","reimbursementDataViewProps","useDataView","formatNumberAsCurrency","displayDescription","jsx","TrashCanSvg","EmptyData","PlusCircleIcon","watchedFormData","useWatch","currentGrossPay","jobId","compensations","reimbursementsWithDefaults","formDataWithDefaults","calculateGrossPay","employeeName","firstLastName","onSubmit","formattedCurrentGrossPay","actions","jsxs","Flex","styles","FormProvider","Form","Grid","employeeHourlyCompensation","TextInputField","TimeOffField","PayoutTimeOffField","DataView","RadioGroupField"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA+DA,MAAMA,KAA0BC,EAAE,OAAO;AAAA,EACvC,MAAMA,EAAE,OAAA,EAAS,SAAA,EAAW,SAAA;AAAA,EAC5B,aAAaA,EAAE,OAAA;AAAA,EACf,QAAQA,EAAE,OAAA;AAAA,EACV,WAAWA,EAAE,QAAA,EAAU,SAAA;AACzB,CAAC,GAEKC,KAA2BD,EAAE,OAAO;AAAA,EACxC,aAAaA,EAAE,OAAA;AAAA,EACf,Q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AaA,EAAE,0BAA0B;AAAA,cACzC,SAAS;AAAA,gBACP;AAAA,kBACE,OAAOxC,EAA8C;AAAA,kBACrD,OAAOwC,EAAE,oCAAoC;AAAA,gBAAA;AAAA,gBAE/C;AAAA,kBACE,OAAOxC,EAA8C;AAAA,kBACrD,OAAOwC,EAAE,4BAA4B;AAAA,gBAAA;AAAA,cACvC;AAAA,YACF;AAAA,UAAA;AAAA,QACF,EAAA,CACF;AAAA,MAAA,GAEJ;AAAA,MACC,CAACU,KAAoB4E;AAAA,IAAA,EAAA,CACxB;AAAA,EAAA,GACF;AAEJ;"}
1
+ {"version":3,"file":"PayrollEditEmployeePresentation.js","sources":["../../../../src/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.tsx"],"sourcesContent":["import { FormProvider, useFieldArray, useForm, useWatch } from 'react-hook-form'\nimport { useMemo, useRef, useState } from 'react'\nimport type { Employee } from '@gusto/embedded-api/models/components/employee'\nimport type {\n FixedCompensations,\n PayrollEmployeeCompensationsType,\n PayrollEmployeeCompensationsTypePaidTimeOff,\n Reimbursements as Reimbursement,\n} from '@gusto/embedded-api/models/components/payrollemployeecompensationstype'\nimport { PayrollEmployeeCompensationsTypePaymentMethod } from '@gusto/embedded-api/models/components/payrollemployeecompensationstype'\nimport type { PayrollFixedCompensationTypesType } from '@gusto/embedded-api/models/components/payrollfixedcompensationtypestype'\nimport type { PayScheduleShow as PayScheduleObject } from '@gusto/embedded-api/models/components/payscheduleshow'\nimport { useTranslation } from 'react-i18next'\nimport { z } from 'zod'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport styles from './PayrollEditEmployeePresentation.module.scss'\nimport { TimeOffField, PayoutTimeOffField } from './TimeOffField'\nimport {\n Flex,\n Grid,\n TextInputField,\n RadioGroupField,\n DataView,\n useDataView,\n EmptyData,\n} from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\nimport { Form } from '@/components/Common/Form'\nimport { formatNumberAsCurrency, firstLastName } from '@/helpers/formattedStrings'\nimport { getAdditionalEarningsCompensations, calculateGrossPay } from '@/components/Payroll/helpers'\nimport { PayrollCategory, isOffCyclePayroll } from '@/components/Payroll/payrollTypes'\nimport {\n COMPENSATION_NAME_DOUBLE_OVERTIME,\n COMPENSATION_NAME_OVERTIME,\n COMPENSATION_NAME_REGULAR_HOURS,\n HOURS_COMPENSATION_NAMES,\n EXCLUDED_ADDITIONAL_EARNINGS,\n COMPENSATION_NAME_REIMBURSEMENT,\n COMPENSATION_NAME_BONUS,\n COMPENSATION_NAME_PAYCHECK_TIPS,\n COMPENSATION_NAME_CORRECTION_PAYMENT,\n COMPENSATION_NAME_COMMISSION,\n COMPENSATION_NAME_CASH_TIPS,\n} from '@/shared/constants'\nimport useContainerBreakpoints from '@/hooks/useContainerBreakpoints/useContainerBreakpoints'\nimport PlusCircleIcon from '@/assets/icons/plus-circle.svg?react'\nimport TrashCanSvg from '@/assets/icons/trashcan.svg?react'\n\ninterface PayrollEditEmployeeProps {\n onSave: (updatedCompensation: PayrollEmployeeCompensationsType) => void\n onCancel: () => void\n employee: Employee\n employeeCompensation?: PayrollEmployeeCompensationsType\n isPending?: boolean\n fixedCompensationTypes: PayrollFixedCompensationTypesType[]\n payPeriodStartDate?: string\n paySchedule?: PayScheduleObject\n payrollCategory?: PayrollCategory\n withReimbursements?: boolean\n hasDirectDepositSetup?: boolean\n}\n\nconst ReimbursementFormSchema = z.object({\n uuid: z.string().nullable().optional(),\n description: z.string(),\n amount: z.string(),\n recurring: z.boolean().optional(),\n})\n\nconst DraftReimbursementSchema = z.object({\n description: z.string(),\n amount: z.string().refine(\n val => {\n const num = parseFloat(val)\n return !Number.isNaN(num) && num > 0\n },\n { message: 'validations.reimbursementAmount' },\n ),\n})\n\n// A native `min={0}` only constrains the stepper: it does not stop a typed \"-50\", and the\n// SDK's <form> is noValidate so the browser never enforces it either. Negative amounts\n// therefore reached the platform and came back only as a submit-time error (SDK-1285).\n// Applied via z.record below, this covers every additional earning -- correction payment\n// included -- because they all share the fixedCompensations record.\nconst nonNegativeAmountSchema = z\n .string()\n .optional()\n .refine(val => !val || parseFloat(val) >= 0, { message: 'validations.negativeAmount' })\n\nconst PayrollEditEmployeeFormSchema = z.object({\n hourlyCompensations: z.record(z.string(), z.record(z.string(), z.string().optional())),\n timeOffCompensations: z.record(z.string(), z.string().optional()),\n finalPayoutCompensations: z.record(z.string(), z.string().optional()),\n fixedCompensations: z.record(z.string(), nonNegativeAmountSchema),\n reimbursements: z.array(ReimbursementFormSchema),\n paymentMethod: z.enum(PayrollEmployeeCompensationsTypePaymentMethod).optional(),\n})\n\n/** @internal */\nexport type PayrollEditEmployeeFormValues = z.infer<typeof PayrollEditEmployeeFormSchema>\n\nconst buildCompensationFromFormData = (\n formData: PayrollEditEmployeeFormValues,\n employeeCompensation: PayrollEmployeeCompensationsType | undefined,\n timeOff: PayrollEmployeeCompensationsTypePaidTimeOff[],\n primaryJobUuid?: string,\n payrollCategory: PayrollCategory = PayrollCategory.Regular,\n): PayrollEmployeeCompensationsType => {\n const updatedCompensation = {\n ...employeeCompensation,\n paymentMethod: formData.paymentMethod,\n }\n\n updatedCompensation.hourlyCompensations = employeeCompensation?.hourlyCompensations?.map(\n compensation => {\n const hours =\n compensation.jobUuid && compensation.name\n ? formData.hourlyCompensations[compensation.jobUuid]?.[compensation.name]\n : undefined\n return hours\n ? {\n ...compensation,\n hours,\n }\n : compensation\n },\n )\n\n updatedCompensation.paidTimeOff = timeOff.map(timeOffEntry => {\n const isDismissal = payrollCategory === PayrollCategory.Dismissal\n const { finalPayoutUnusedHoursInput: _, ...timeOffWithoutPayout } = timeOffEntry\n\n if (isDismissal) {\n const finalPayout =\n formData.finalPayoutCompensations[timeOffEntry.name!] ??\n timeOffEntry.finalPayoutUnusedHoursInput\n return {\n ...timeOffEntry,\n hours: formData.timeOffCompensations[timeOffEntry.name!] || '0',\n ...(finalPayout != null ? { finalPayoutUnusedHoursInput: finalPayout || '0' } : {}),\n }\n }\n\n return {\n ...timeOffWithoutPayout,\n hours: formData.timeOffCompensations[timeOffEntry.name!] || '0',\n }\n })\n\n // Off-cycle payrolls today use the legacy single Reimbursement field in fixed_compensations\n // because the backend feature flag `emb_off_cycle_disable_named_reimbursements` (default: true,\n // expected removal 2026-09-01) rejects named entries in the itemized `reimbursements[]` array.\n // TODO(post-2026-09-01): once that flag is removed, unify on the itemized path for all categories.\n const usesItemizedReimbursements = !isOffCyclePayroll(payrollCategory)\n\n const updatedFixedCompensations: FixedCompensations[] = []\n\n Object.entries(formData.fixedCompensations).forEach(([fixedCompensationName, formAmount]) => {\n const isReimbursementEntry =\n fixedCompensationName.toLowerCase() === COMPENSATION_NAME_REIMBURSEMENT.toLowerCase()\n\n // Regular payrolls write reimbursements via the itemized array; never let the legacy\n // fixed_compensations entry slip through (the backend rejects it on v2025-11-15+).\n if (isReimbursementEntry && usesItemizedReimbursements) {\n return\n }\n\n const existingFixedCompensation = employeeCompensation?.fixedCompensations?.find(\n fixedCompensation =>\n fixedCompensation.name?.toLowerCase() === fixedCompensationName.toLowerCase(),\n )\n\n // Clearing the field means \"no additional earning\". For an entry that already has a\n // saved amount we have to send an explicit 0: omitting it leaves the previously saved\n // value in place server-side, so the box looked empty while the old amount survived\n // the save (SDK-1284). This makes clearing behave exactly like typing 0. An entry with\n // no saved compensation stays omitted -- there is nothing to zero out.\n const resolvedAmount = formAmount === '' && existingFixedCompensation ? '0' : formAmount\n\n if (resolvedAmount !== undefined && resolvedAmount !== '') {\n if (existingFixedCompensation) {\n updatedFixedCompensations.push({\n name: existingFixedCompensation.name,\n jobUuid: existingFixedCompensation.jobUuid,\n amount: resolvedAmount,\n })\n } else if (parseFloat(resolvedAmount) !== 0) {\n updatedFixedCompensations.push({\n name: fixedCompensationName,\n jobUuid: primaryJobUuid,\n amount: resolvedAmount,\n })\n }\n }\n })\n\n updatedCompensation.fixedCompensations = updatedFixedCompensations\n\n if (usesItemizedReimbursements) {\n updatedCompensation.reimbursements = formData.reimbursements.map(reimbursement => ({\n amount: reimbursement.amount,\n description:\n reimbursement.description.trim() === '' ? null : reimbursement.description.trim(),\n uuid: reimbursement.uuid ?? null,\n recurring: reimbursement.recurring,\n }))\n } else {\n // Off-cycle: ensure no itemized array leaks through. The container also strips this defensively.\n updatedCompensation.reimbursements = []\n }\n\n return updatedCompensation\n}\n\n/** @internal */\nexport const PayrollEditEmployeePresentation = ({\n onSave,\n onCancel,\n employee,\n employeeCompensation,\n isPending = false,\n fixedCompensationTypes,\n payPeriodStartDate,\n paySchedule,\n payrollCategory = PayrollCategory.Regular,\n withReimbursements = true,\n hasDirectDepositSetup = true,\n}: PayrollEditEmployeeProps) => {\n const { Button, ButtonIcon, Heading, Text } = useComponentContext()\n\n const { t } = useTranslation('Payroll.PayrollEditEmployee')\n useI18n('Payroll.PayrollEditEmployee')\n\n const primaryJob = employee.jobs?.find(job => job.primary)\n const primaryJobHasHourlyCompensations = employeeCompensation?.hourlyCompensations?.some(\n c => c.jobUuid === primaryJob?.uuid,\n )\n const hourlyJobs = primaryJob && primaryJobHasHourlyCompensations ? [primaryJob] : []\n\n const containerRef = useRef<HTMLDivElement>(null)\n const breakpoints = useContainerBreakpoints({\n ref: containerRef,\n })\n const isSmallOrGreater = breakpoints.includes('small')\n\n employeeCompensation?.hourlyCompensations?.forEach(compensation => {\n const job = employee.jobs?.find(job => job.uuid === compensation.jobUuid)\n if (job && !hourlyJobs.find(hourlyJob => hourlyJob.uuid === job.uuid)) {\n hourlyJobs.push(job)\n }\n })\n\n const timeOff = (employeeCompensation?.paidTimeOff || []).filter(entry => entry.name)\n\n const additionalEarnings = getAdditionalEarningsCompensations({\n flsaStatus: primaryJob?.compensations?.[0]?.flsaStatus,\n existingFixedCompensations: employeeCompensation?.fixedCompensations || [],\n primaryJobUuid: primaryJob?.uuid,\n fixedCompensationTypes,\n excludedTypes: EXCLUDED_ADDITIONAL_EARNINGS,\n })\n\n // Off-cycle payrolls use the legacy single Reimbursement field in fixed_compensations because\n // the backend `emb_off_cycle_disable_named_reimbursements` flag (default: true, expected\n // removal 2026-09-01) rejects named entries in the itemized `reimbursements[]` array.\n // TODO(post-2026-09-01): unify on the itemized path once that flag is removed.\n const usesItemizedReimbursements = !isOffCyclePayroll(payrollCategory)\n\n const initialReimbursements: Reimbursement[] = useMemo(\n () =>\n withReimbursements && usesItemizedReimbursements\n ? (employeeCompensation?.reimbursements ?? [])\n : [],\n [withReimbursements, usesItemizedReimbursements, employeeCompensation?.reimbursements],\n )\n\n const existingReimbursementFixedCompensation = useMemo(\n () =>\n employeeCompensation?.fixedCompensations?.find(\n comp => comp.name?.toLowerCase() === COMPENSATION_NAME_REIMBURSEMENT.toLowerCase(),\n ),\n [employeeCompensation?.fixedCompensations],\n )\n\n const showLegacyReimbursementField =\n withReimbursements && !usesItemizedReimbursements && Boolean(primaryJob?.uuid)\n\n const findMatchingCompensation = (jobUuid: string, compensationName: string) => {\n return employeeCompensation?.hourlyCompensations?.find(\n compensation =>\n compensation.jobUuid === jobUuid &&\n compensation.name?.toLowerCase() === compensationName.toLowerCase(),\n )\n }\n\n const getCompensationLabel = (compensationName?: string) => {\n switch (compensationName) {\n case COMPENSATION_NAME_REGULAR_HOURS:\n return t('compensationNames.regularHours')\n case COMPENSATION_NAME_OVERTIME:\n return t('compensationNames.overtime')\n case COMPENSATION_NAME_DOUBLE_OVERTIME:\n return t('compensationNames.doubleOvertime')\n default:\n return compensationName\n }\n }\n\n const getFixedCompensationLabel = (compensationName?: string) => {\n switch (compensationName) {\n case COMPENSATION_NAME_BONUS:\n return t('fixedCompensationNames.bonus')\n case COMPENSATION_NAME_PAYCHECK_TIPS:\n return t('fixedCompensationNames.paycheckTips')\n case COMPENSATION_NAME_CORRECTION_PAYMENT:\n return t('fixedCompensationNames.correctionPayment')\n case COMPENSATION_NAME_COMMISSION:\n return t('fixedCompensationNames.commission')\n case COMPENSATION_NAME_CASH_TIPS:\n return t('fixedCompensationNames.cashTips')\n case COMPENSATION_NAME_REIMBURSEMENT:\n return t('fixedCompensationNames.reimbursement')\n default:\n return compensationName\n }\n }\n\n const resolveDefaultPaymentMethod = () => {\n const preparedPaymentMethod = employeeCompensation?.paymentMethod\n\n if (!preparedPaymentMethod) {\n return hasDirectDepositSetup\n ? PayrollEmployeeCompensationsTypePaymentMethod.DirectDeposit\n : PayrollEmployeeCompensationsTypePaymentMethod.Check\n }\n\n if (\n !hasDirectDepositSetup &&\n preparedPaymentMethod === PayrollEmployeeCompensationsTypePaymentMethod.DirectDeposit\n ) {\n return PayrollEmployeeCompensationsTypePaymentMethod.Check\n }\n\n return preparedPaymentMethod\n }\n\n const defaultValues = {\n hourlyCompensations: (() => {\n const hourlyCompensations: PayrollEditEmployeeFormValues['hourlyCompensations'] = {}\n\n hourlyJobs.forEach(hourlyJob => {\n HOURS_COMPENSATION_NAMES.forEach(compensationName => {\n const matchingCompensation = findMatchingCompensation(hourlyJob.uuid, compensationName)\n if (matchingCompensation) {\n if (!hourlyCompensations[hourlyJob.uuid]) {\n hourlyCompensations[hourlyJob.uuid] = {}\n }\n hourlyCompensations[hourlyJob.uuid]![matchingCompensation.name!] =\n matchingCompensation.hours ? parseFloat(matchingCompensation.hours).toString() : ''\n }\n })\n })\n\n return hourlyCompensations\n })(),\n\n timeOffCompensations: (() => {\n const timeOffCompensations: PayrollEditEmployeeFormValues['timeOffCompensations'] = {}\n\n timeOff.forEach(timeOffCompensation => {\n timeOffCompensations[timeOffCompensation.name!] = timeOffCompensation.hours\n ? parseFloat(timeOffCompensation.hours).toString()\n : ''\n })\n\n return timeOffCompensations\n })(),\n\n finalPayoutCompensations: (() => {\n const finalPayoutCompensations: PayrollEditEmployeeFormValues['finalPayoutCompensations'] = {}\n\n timeOff.forEach(timeOffCompensation => {\n finalPayoutCompensations[timeOffCompensation.name!] =\n timeOffCompensation.finalPayoutUnusedHoursInput ?? '0'\n })\n\n return finalPayoutCompensations\n })(),\n\n fixedCompensations: (() => {\n const fixedCompensations: PayrollEditEmployeeFormValues['fixedCompensations'] = {}\n\n additionalEarnings.forEach(fixedComp => {\n fixedCompensations[fixedComp.name!] = fixedComp.amount ?? ''\n })\n\n if (showLegacyReimbursementField) {\n fixedCompensations[COMPENSATION_NAME_REIMBURSEMENT] =\n existingReimbursementFixedCompensation?.amount ?? '0.00'\n }\n\n return fixedCompensations\n })(),\n\n reimbursements: initialReimbursements.map(reimbursement => ({\n uuid: reimbursement.uuid ?? null,\n description: reimbursement.description ?? '',\n amount: reimbursement.amount,\n recurring: reimbursement.recurring ?? false,\n })),\n\n paymentMethod: resolveDefaultPaymentMethod(),\n }\n\n const formHandlers = useForm<PayrollEditEmployeeFormValues>({\n resolver: zodResolver(PayrollEditEmployeeFormSchema),\n defaultValues,\n })\n\n const {\n fields: reimbursementFields,\n append: appendReimbursement,\n remove: removeReimbursement,\n update: updateReimbursement,\n } = useFieldArray({\n control: formHandlers.control,\n name: 'reimbursements',\n })\n\n const handleRemoveReimbursement = (index: number) => {\n const field = reimbursementFields[index]\n if (!field) return\n\n if (field.uuid) {\n updateReimbursement(index, { ...field, amount: '0' })\n } else {\n removeReimbursement(index)\n }\n }\n\n type VisibleReimbursementRow = (typeof reimbursementFields)[number] & {\n originalIndex: number\n }\n\n const visibleReimbursementRows: VisibleReimbursementRow[] = reimbursementFields\n .map((field, originalIndex) => ({ ...field, originalIndex }))\n .filter(row => parseFloat(row.amount || '0') !== 0)\n\n const [isAddingReimbursement, setIsAddingReimbursement] = useState(false)\n\n type DraftReimbursementValues = z.infer<typeof DraftReimbursementSchema>\n\n const draftForm = useForm<DraftReimbursementValues>({\n resolver: zodResolver(DraftReimbursementSchema),\n defaultValues: { description: '', amount: '' },\n })\n\n const resetReimbursementDraft = () => {\n setIsAddingReimbursement(false)\n draftForm.reset()\n }\n\n const onDraftReimbursementValid = (data: DraftReimbursementValues) => {\n const parsedAmount = parseFloat(data.amount)\n appendReimbursement({\n uuid: null,\n description: data.description.trim(),\n amount: parsedAmount.toFixed(2),\n recurring: false,\n })\n resetReimbursementDraft()\n }\n\n const reimbursementDataViewProps = useDataView<VisibleReimbursementRow>({\n data: visibleReimbursementRows,\n columns: [\n {\n key: 'description',\n title: t('reimbursementDescriptionColumn'),\n render: row => row.description.trim() || t('reimbursementUnnamedFallback'),\n },\n {\n key: 'amount',\n title: t('reimbursementAmountColumn'),\n justify: 'end',\n render: row => formatNumberAsCurrency(parseFloat(row.amount || '0')),\n },\n {\n key: 'recurring',\n title: t('reimbursementTypeColumn'),\n render: row =>\n row.recurring ? t('reimbursementTypeRecurring') : t('reimbursementTypeOneTime'),\n },\n ],\n itemMenu: row => {\n if (row.recurring) return null\n const displayDescription = row.description.trim() || t('reimbursementUnnamedFallback')\n return (\n <ButtonIcon\n variant=\"tertiary\"\n onClick={() => {\n handleRemoveReimbursement(row.originalIndex)\n }}\n aria-label={t('removeReimbursementLabel', { description: displayDescription })}\n >\n <TrashCanSvg aria-hidden />\n </ButtonIcon>\n )\n },\n emptyState: () => (\n <EmptyData title={t('reimbursementEmptyTitle')}>\n <Button\n variant=\"secondary\"\n onClick={() => {\n setIsAddingReimbursement(true)\n }}\n icon={<PlusCircleIcon aria-hidden />}\n >\n {t('addReimbursementCta')}\n </Button>\n </EmptyData>\n ),\n })\n\n const watchedFormData = useWatch({\n control: formHandlers.control,\n })\n\n const currentGrossPay = useMemo(() => {\n try {\n const hourlyCompensations: Record<string, Record<string, string | undefined>> = {}\n if (watchedFormData.hourlyCompensations) {\n Object.entries(watchedFormData.hourlyCompensations).forEach(([jobId, compensations]) => {\n if (compensations) {\n hourlyCompensations[jobId] = compensations\n }\n })\n }\n\n const reimbursementsWithDefaults: PayrollEditEmployeeFormValues['reimbursements'] = (\n watchedFormData.reimbursements ?? []\n ).map(reimbursement => ({\n uuid: reimbursement.uuid ?? null,\n description: reimbursement.description ?? '',\n amount: reimbursement.amount ?? '0',\n recurring: reimbursement.recurring,\n }))\n\n const formDataWithDefaults: PayrollEditEmployeeFormValues = {\n hourlyCompensations,\n timeOffCompensations: watchedFormData.timeOffCompensations || {},\n finalPayoutCompensations: watchedFormData.finalPayoutCompensations || {},\n fixedCompensations: watchedFormData.fixedCompensations || {},\n reimbursements: reimbursementsWithDefaults,\n paymentMethod: watchedFormData.paymentMethod,\n }\n\n const updatedCompensation = buildCompensationFromFormData(\n formDataWithDefaults,\n employeeCompensation,\n (employeeCompensation?.paidTimeOff || []).filter(entry => entry.name),\n primaryJob?.uuid,\n payrollCategory,\n )\n\n return calculateGrossPay(\n updatedCompensation,\n employee,\n payPeriodStartDate,\n paySchedule,\n payrollCategory,\n )\n } catch {\n return employeeCompensation\n ? calculateGrossPay(\n employeeCompensation,\n employee,\n payPeriodStartDate,\n paySchedule,\n payrollCategory,\n )\n : 0\n }\n }, [\n watchedFormData,\n employeeCompensation,\n primaryJob?.uuid,\n employee,\n payPeriodStartDate,\n paySchedule,\n payrollCategory,\n ])\n\n const employeeName = firstLastName({\n first_name: employee.firstName,\n last_name: employee.lastName,\n })\n\n const onSubmit = (data: PayrollEditEmployeeFormValues) => {\n const updatedCompensation = buildCompensationFromFormData(\n data,\n employeeCompensation,\n timeOff,\n primaryJob?.uuid,\n payrollCategory,\n )\n onSave(updatedCompensation)\n }\n\n const formattedCurrentGrossPay = formatNumberAsCurrency(currentGrossPay || 0)\n\n const actions = (\n <Flex\n flexDirection={isSmallOrGreater ? 'row' : 'column'}\n justifyContent={isSmallOrGreater ? 'flex-end' : 'normal'}\n alignItems={isSmallOrGreater ? 'flex-start' : 'stretch'}\n gap={12}\n >\n <Button variant=\"secondary\" onClick={onCancel} title={t('cancelCta')}>\n {t('cancelCta')}\n </Button>\n <Button\n onClick={formHandlers.handleSubmit(onSubmit)}\n title={t('saveCta')}\n isLoading={isPending}\n >\n {t('saveCta')}\n </Button>\n </Flex>\n )\n\n return (\n <div ref={containerRef} className={styles.container}>\n <div\n className={`${styles.headerSection} ${!isSmallOrGreater ? styles.headerSectionSticky : ''}`}\n >\n <Flex justifyContent=\"space-between\">\n <Flex flexDirection=\"column\" gap={isSmallOrGreater ? 8 : 2}>\n <Heading as=\"h1\" styledAs={isSmallOrGreater ? 'h2' : 'h4'}>\n {t('pageTitle', { employeeName })}\n </Heading>\n {isSmallOrGreater ? (\n <Flex flexDirection=\"column\" gap={6}>\n <Heading as=\"h2\" styledAs=\"h3\">\n {formattedCurrentGrossPay}\n </Heading>\n <Text className={styles.grossPayLabel}>{t('grossPayLabel')}</Text>\n </Flex>\n ) : (\n <Heading as=\"h2\" styledAs=\"h6\" className={styles.grossPayLabel}>\n {t('grossPayLabelMobile', { grossPay: formattedCurrentGrossPay })}\n </Heading>\n )}\n </Flex>\n {isSmallOrGreater && actions}\n </Flex>\n </div>\n <FormProvider {...formHandlers}>\n <Form>\n {hourlyJobs.length > 0 && (\n <div className={styles.fieldGroup}>\n <Heading as=\"h3\">{t('regularHoursTitle')}</Heading>\n {hourlyJobs.map(hourlyJob => (\n <Flex key={hourlyJob.uuid} flexDirection=\"column\" gap={8}>\n {hourlyJobs.length > 1 && <Heading as=\"h4\">{hourlyJob.title}</Heading>}\n <Grid gridTemplateColumns={{ base: '1fr', small: [320, 320] }} gap={20}>\n {HOURS_COMPENSATION_NAMES.map(compensationName => {\n const employeeHourlyCompensation = findMatchingCompensation(\n hourlyJob.uuid,\n compensationName,\n )\n if (employeeHourlyCompensation) {\n return (\n <TextInputField\n key={compensationName}\n type=\"number\"\n min={0}\n adornmentEnd={t('hoursUnit')}\n isRequired\n label={getCompensationLabel(compensationName)}\n name={`hourlyCompensations.${hourlyJob.uuid}.${employeeHourlyCompensation.name}`}\n />\n )\n }\n })}\n </Grid>\n </Flex>\n ))}\n </div>\n )}\n {timeOff.length > 0 && (\n <div className={styles.fieldGroup}>\n <Heading as=\"h3\" styledAs=\"h4\">\n {payrollCategory === PayrollCategory.Dismissal\n ? t('timeOffTitleDismissal')\n : t('timeOffTitle')}\n </Heading>\n <Grid gridTemplateColumns={{ base: '1fr', small: [320, 320] }} gap={20}>\n {timeOff.map(timeOffEntry => (\n <TimeOffField\n key={timeOffEntry.name}\n timeOff={timeOffEntry}\n employee={employee}\n />\n ))}\n </Grid>\n </div>\n )}\n {payrollCategory === PayrollCategory.Dismissal && timeOff.length > 0 && (\n <div className={styles.fieldGroup}>\n <Flex flexDirection=\"column\" gap={4}>\n <Heading as=\"h3\" styledAs=\"h4\">\n {t('finalPayoutTitle')}\n </Heading>\n <Text variant=\"supporting\">{t('finalPayoutDescription')}</Text>\n </Flex>\n <Grid gridTemplateColumns={{ base: '1fr', small: [320, 320] }} gap={20}>\n {timeOff.map(timeOffEntry => (\n <PayoutTimeOffField\n key={`payout-${timeOffEntry.name}`}\n timeOff={timeOffEntry}\n employee={employee}\n />\n ))}\n </Grid>\n </div>\n )}\n {additionalEarnings.length > 0 && (\n <div className={styles.fieldGroup}>\n <Heading as=\"h3\" styledAs=\"h4\">\n {t('additionalEarningsTitle')}\n </Heading>\n <Grid\n gridTemplateColumns={{ base: '1fr', small: [320, 320], large: [320, 320, 320] }}\n gap={20}\n >\n {additionalEarnings.map(fixedCompensation => (\n <TextInputField\n key={fixedCompensation.name}\n type=\"number\"\n min={0}\n adornmentStart=\"$\"\n isRequired\n label={getFixedCompensationLabel(fixedCompensation.name)}\n name={`fixedCompensations.${fixedCompensation.name}`}\n // useField only surfaces this once react-hook-form has flagged the\n // field, and the schema's only rule here is the negative-amount check.\n errorMessage={t('validations.negativeAmount')}\n />\n ))}\n </Grid>\n </div>\n )}\n {showLegacyReimbursementField && (\n <div className={styles.fieldGroup}>\n <Heading as=\"h3\" styledAs=\"h4\">\n {t('reimbursementTitle')}\n </Heading>\n <Grid gridTemplateColumns={{ base: '1fr', small: [320, 320] }} gap={20}>\n <TextInputField\n type=\"number\"\n min={0}\n adornmentStart=\"$\"\n isRequired\n label={getFixedCompensationLabel(COMPENSATION_NAME_REIMBURSEMENT)}\n name={`fixedCompensations.${COMPENSATION_NAME_REIMBURSEMENT}`}\n errorMessage={t('validations.negativeAmount')}\n />\n </Grid>\n </div>\n )}\n {withReimbursements && usesItemizedReimbursements && (\n <div className={styles.fieldGroup}>\n <Heading as=\"h3\" styledAs=\"h4\">\n {t('reimbursementTitle')}\n </Heading>\n {!(visibleReimbursementRows.length === 0 && isAddingReimbursement) && (\n <DataView label={t('reimbursementsTableLabel')} {...reimbursementDataViewProps} />\n )}\n {isAddingReimbursement ? (\n <FormProvider {...draftForm}>\n <Flex flexDirection=\"column\" gap={12}>\n <Grid gridTemplateColumns={{ base: '1fr', small: [320, 320] }} gap={20}>\n <TextInputField\n name=\"description\"\n label={t('reimbursementDescriptionLabel')}\n placeholder={t('reimbursementDescriptionPlaceholder')}\n />\n <TextInputField\n name=\"amount\"\n type=\"number\"\n min={0}\n adornmentStart=\"$\"\n isRequired\n label={t('reimbursementAmountLabel')}\n errorMessage={t('validations.reimbursementAmount')}\n />\n </Grid>\n <Flex gap={12}>\n <Button onClick={draftForm.handleSubmit(onDraftReimbursementValid)}>\n {t('saveReimbursementCta')}\n </Button>\n <Button variant=\"secondary\" onClick={resetReimbursementDraft}>\n {t('cancelReimbursementCta')}\n </Button>\n </Flex>\n </Flex>\n </FormProvider>\n ) : (\n visibleReimbursementRows.length > 0 && (\n <div>\n <Button\n variant=\"secondary\"\n onClick={() => {\n setIsAddingReimbursement(true)\n }}\n title={t('addReimbursementLink')}\n icon={<PlusCircleIcon aria-hidden />}\n >\n {t('addReimbursementLink')}\n </Button>\n </div>\n )\n )}\n </div>\n )}\n {hasDirectDepositSetup && (\n <div className={styles.fieldGroup}>\n <Heading as=\"h3\" styledAs=\"h4\">\n {t('paymentMethodTitle')}\n </Heading>\n <RadioGroupField\n name=\"paymentMethod\"\n isRequired\n label={t('paymentMethodLabel')}\n description={t('paymentMethodDescription')}\n options={[\n {\n value: PayrollEmployeeCompensationsTypePaymentMethod.DirectDeposit,\n label: t('paymentMethodOptions.directDeposit'),\n },\n {\n value: PayrollEmployeeCompensationsTypePaymentMethod.Check,\n label: t('paymentMethodOptions.check'),\n },\n ]}\n />\n </div>\n )}\n </Form>\n {!isSmallOrGreater && actions}\n </FormProvider>\n </div>\n )\n}\n"],"names":["ReimbursementFormSchema","z","DraftReimbursementSchema","val","num","nonNegativeAmountSchema","PayrollEditEmployeeFormSchema","PayrollEmployeeCompensationsTypePaymentMethod","buildCompensationFromFormData","formData","employeeCompensation","timeOff","primaryJobUuid","payrollCategory","PayrollCategory","updatedCompensation","compensation","hours","timeOffEntry","isDismissal","_","timeOffWithoutPayout","finalPayout","usesItemizedReimbursements","isOffCyclePayroll","updatedFixedCompensations","fixedCompensationName","formAmount","COMPENSATION_NAME_REIMBURSEMENT","existingFixedCompensation","fixedCompensation","resolvedAmount","reimbursement","PayrollEditEmployeePresentation","onSave","onCancel","employee","isPending","fixedCompensationTypes","payPeriodStartDate","paySchedule","withReimbursements","hasDirectDepositSetup","Button","ButtonIcon","Heading","Text","useComponentContext","t","useTranslation","useI18n","primaryJob","job","primaryJobHasHourlyCompensations","c","hourlyJobs","containerRef","useRef","isSmallOrGreater","useContainerBreakpoints","hourlyJob","entry","additionalEarnings","getAdditionalEarningsCompensations","EXCLUDED_ADDITIONAL_EARNINGS","initialReimbursements","useMemo","existingReimbursementFixedCompensation","comp","showLegacyReimbursementField","findMatchingCompensation","jobUuid","compensationName","getCompensationLabel","COMPENSATION_NAME_REGULAR_HOURS","COMPENSATION_NAME_OVERTIME","COMPENSATION_NAME_DOUBLE_OVERTIME","getFixedCompensationLabel","COMPENSATION_NAME_BONUS","COMPENSATION_NAME_PAYCHECK_TIPS","COMPENSATION_NAME_CORRECTION_PAYMENT","COMPENSATION_NAME_COMMISSION","COMPENSATION_NAME_CASH_TIPS","resolveDefaultPaymentMethod","preparedPaymentMethod","defaultValues","hourlyCompensations","HOURS_COMPENSATION_NAMES","matchingCompensation","timeOffCompensations","timeOffCompensation","finalPayoutCompensations","fixedCompensations","fixedComp","formHandlers","useForm","zodResolver","reimbursementFields","appendReimbursement","removeReimbursement","updateReimbursement","useFieldArray","handleRemoveReimbursement","index","field","visibleReimbursementRows","originalIndex","row","isAddingReimbursement","setIsAddingReimbursement","useState","draftForm","resetReimbursementDraft","onDraftReimbursementValid","data","parsedAmount","reimbursementDataViewProps","useDataView","formatNumberAsCurrency","displayDescription","jsx","TrashCanSvg","EmptyData","PlusCircleIcon","watchedFormData","useWatch","currentGrossPay","jobId","compensations","reimbursementsWithDefaults","formDataWithDefaults","calculateGrossPay","employeeName","firstLastName","onSubmit","formattedCurrentGrossPay","actions","jsxs","Flex","styles","FormProvider","Form","Grid","employeeHourlyCompensation","TextInputField","TimeOffField","PayoutTimeOffField","DataView","RadioGroupField"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA+DA,MAAMA,KAA0BC,EAAE,OAAO;AAAA,EACvC,MAAMA,EAAE,OAAA,EAAS,SAAA,EAAW,SAAA;AAAA,EAC5B,aAAaA,EAAE,OAAA;AAAA,EACf,QAAQA,EAAE,OAAA;AAAA,EACV,WAAWA,EAAE,QAAA,EAAU,SAAA;AACzB,CAAC,GAEKC,KAA2BD,EAAE,OAAO;AAAA,EACxC,aAAaA,EAAE,OAAA;AAAA,EACf,QAAQA,EAAE,OAAA,EAAS;AAAA,IACjB,CAAAE,MAAO;AACL,YAAMC,IAAM,WAAWD,CAAG;AAC1B,aAAO,CAAC,OAAO,MAAMC,CAAG,KAAKA,IAAM;AAAA,IACrC;AAAA,IACA,EAAE,SAAS,kCAAA;AAAA,EAAkC;AAEjD,CAAC,GAOKC,KAA0BJ,EAC7B,OAAA,EACA,SAAA,EACA,OAAO,CAAAE,MAAO,CAACA,KAAO,WAAWA,CAAG,KAAK,GAAG,EAAE,SAAS,8BAA8B,GAElFG,KAAgCL,EAAE,OAAO;AAAA,EAC7C,qBAAqBA,EAAE,OAAOA,EAAE,OAAA,GAAUA,EAAE,OAAOA,EAAE,OAAA,GAAUA,EAAE,OAAA,EAAS,SAAA,CAAU,CAAC;AAAA,EACrF,sBAAsBA,EAAE,OAAOA,EAAE,OAAA,GAAUA,EAAE,SAAS,UAAU;AAAA,EAChE,0BA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B8E;AAAA,IAAA,EAAA,CACxB;AAAA,EAAA,GACF;AAEJ;"}
@@ -0,0 +1,278 @@
1
+ import { ComponentType } from 'react';
2
+ import { PayrollEmployeeCompensationsType } from '@gusto/embedded-api/models/components/payrollemployeecompensationstype';
3
+ import { PayrollUpdatePaymentMethod } from '@gusto/embedded-api/models/components/payrollupdate';
4
+ import { NormalizedWorkweek } from './payrollEditEmployeeHelpers';
5
+ import { RadioGroupHookFieldProps } from '../../../../../partner-hook-utils/form/fields/RadioGroupHookField';
6
+ import { HookFieldProps } from '../../../../../partner-hook-utils/types';
7
+ import { TextInputProps } from '../../../../Common/UI/TextInput/TextInputTypes';
8
+ import { PayrollCategory } from '../../../payrollTypes';
9
+ /**
10
+ * Presentation props accepted by a bound numeric field in the payroll editor.
11
+ *
12
+ * @remarks
13
+ * The hook binds the react-hook-form `name` and forces `type="number"`
14
+ * internally; the UI supplies copy and layout props (label, adornments,
15
+ * `shouldVisuallyHideLabel`, required state).
16
+ *
17
+ * @public
18
+ */
19
+ export type PayrollEditEmployeeFieldProps = Omit<TextInputProps, 'name' | 'value' | 'onChange' | 'isInvalid' | 'type' | 'min'>;
20
+ /**
21
+ * A numeric field component pre-bound by the hook to a specific form path.
22
+ *
23
+ * @public
24
+ */
25
+ export type PayrollEditEmployeeFieldComponent = ComponentType<PayrollEditEmployeeFieldProps>;
26
+ /**
27
+ * Presentation props accepted by the bound payment-method field.
28
+ *
29
+ * @remarks
30
+ * The hook binds the `name` and publishes the option values on
31
+ * `fieldsMetadata.paymentMethod`; the UI passes `getOptionLabel` to translate
32
+ * each {@link PayrollUpdatePaymentMethod} value, rather than passing `options`.
33
+ *
34
+ * @public
35
+ */
36
+ export type PayrollEditEmployeePaymentMethodFieldProps = HookFieldProps<RadioGroupHookFieldProps<never, PayrollUpdatePaymentMethod>>;
37
+ /**
38
+ * The payment-method radio field component pre-bound by the hook.
39
+ *
40
+ * @public
41
+ */
42
+ export type PayrollEditEmployeePaymentMethodField = ComponentType<PayrollEditEmployeePaymentMethodFieldProps>;
43
+ /**
44
+ * One hours input within the hours section.
45
+ *
46
+ * @remarks
47
+ * `key` is an opaque, stable React key. `jobUuid`, `name`, and (when the pay
48
+ * period is multi-workweek) `workweekStart` are reach-in handles the UI uses to
49
+ * group and label entries. When the section is a flat array, `workweekStart` is
50
+ * omitted (single-workweek degenerate case); when it is a `Record` keyed by
51
+ * workweek start, each entry carries its `workweekStart`.
52
+ *
53
+ * @public
54
+ */
55
+ export interface HourEntry {
56
+ /** Opaque, stable React key. */
57
+ key: string;
58
+ /** The job this hours line belongs to. */
59
+ jobUuid: string;
60
+ /** The compensation name (e.g. the API hours-compensation name). */
61
+ name: string;
62
+ /** The workweek start date (`YYYY-MM-DD`) when the section is workweek-keyed. */
63
+ workweekStart?: string;
64
+ /** Field component pre-bound to this entry's form path. */
65
+ Field: PayrollEditEmployeeFieldComponent;
66
+ }
67
+ /**
68
+ * One earning input, used by the additional-earnings section.
69
+ *
70
+ * @remarks
71
+ * Same shape as {@link HourEntry}. Whether an earning feeds the overtime
72
+ * (regular rate of pay) calculation is decided by the hook, which sorts it into
73
+ * the workweek-breakdown additional-earnings section or the flat other
74
+ * section. The UI just renders whichever section an entry appears in.
75
+ *
76
+ * @public
77
+ */
78
+ export type EarningEntry = HourEntry;
79
+ /**
80
+ * One time-off or final-payout input.
81
+ *
82
+ * @remarks
83
+ * Time off is never workweek-breakdown, so this section is always a flat array.
84
+ *
85
+ * @public
86
+ */
87
+ export interface TimeOffEntry {
88
+ /** Opaque, stable React key. */
89
+ key: string;
90
+ /** The time-off policy compensation name. */
91
+ name: string;
92
+ /** Field component pre-bound to this entry's form path. */
93
+ Field: PayrollEditEmployeeFieldComponent;
94
+ }
95
+ /**
96
+ * One entry in the flat `other` section.
97
+ *
98
+ * @remarks
99
+ * Intentionally opaque: `other` collects earnings that are not overtime-affecting
100
+ * and whose input type the partner does not need to reason about. Render each
101
+ * entry's `Field` keyed by `key`; use `id` as a reach-in handle for labeling.
102
+ *
103
+ * @public
104
+ */
105
+ export interface OtherEntry {
106
+ /** Opaque, stable React key. */
107
+ key: string;
108
+ /** Reach-in handle identifying the underlying earning (its compensation name). */
109
+ id: string;
110
+ /** Field component pre-bound to this entry's form path. */
111
+ Field: PayrollEditEmployeeFieldComponent;
112
+ }
113
+ /**
114
+ * Per-job hours and additional-earnings sections.
115
+ *
116
+ * @remarks
117
+ * An employee can hold multiple jobs, each with its own hourly and additional
118
+ * earnings lines. Each section is either a flat `Entry[]` (single-workweek, or an
119
+ * overtime-ineligible employee) OR a `Record<workweekStart, Entry[]>`
120
+ * (multi-workweek and overtime-eligible). The value type is the signal — array is
121
+ * flat, object is split by workweek; use {@link isSplitByWorkweek} to
122
+ * discriminate. `title` is the job's display title (entity data, not copy) for
123
+ * rendering a per-job heading.
124
+ *
125
+ * @public
126
+ */
127
+ export interface JobFields {
128
+ /** The job identifier. */
129
+ jobUuid: string;
130
+ /** The job's display title, when available, for a per-job heading. */
131
+ title?: string;
132
+ /** Hours inputs for this job. */
133
+ hours: HourEntry[] | Record<string, HourEntry[]>;
134
+ /** Overtime-affecting earnings for this job. */
135
+ additionalEarnings: EarningEntry[] | Record<string, EarningEntry[]>;
136
+ }
137
+ /**
138
+ * Presentation props accepted by a bound reimbursement description (text) field.
139
+ *
140
+ * @remarks
141
+ * The hook binds the react-hook-form `name` internally; the UI supplies copy and
142
+ * layout props (label, placeholder, `shouldVisuallyHideLabel`).
143
+ *
144
+ * @public
145
+ */
146
+ export type ReimbursementDescriptionFieldProps = Omit<TextInputProps, 'name' | 'value' | 'onChange' | 'isInvalid' | 'type'>;
147
+ /**
148
+ * The draft "add reimbursement" field group exposed on
149
+ * `form.Fields.reimbursementDraft`.
150
+ *
151
+ * @remarks
152
+ * A single in-progress row the UI reveals when the user starts adding a
153
+ * reimbursement. `Description` and `Amount` bind to `reimbursementDraft.description`
154
+ * / `reimbursementDraft.amount`. The UI shows them while `form.reimbursementDraft.isAdding`
155
+ * is `true`, then calls `actions.saveReimbursement` (commits to the list) or
156
+ * `actions.cancelReimbursement` (discards). Committed rows are rendered from
157
+ * `data.reimbursements`, not from bound fields.
158
+ *
159
+ * @public
160
+ */
161
+ export interface ReimbursementDraftFields {
162
+ /** Description field pre-bound to the draft's form path. */
163
+ Description: ComponentType<ReimbursementDescriptionFieldProps>;
164
+ /** Amount field pre-bound to the draft's form path. */
165
+ Amount: PayrollEditEmployeeFieldComponent;
166
+ }
167
+ /**
168
+ * A committed reimbursement row for display in the consumer's table.
169
+ *
170
+ * @remarks
171
+ * Exposed on `data.reimbursements`, seeded from the employee's existing
172
+ * reimbursements and appended to as the user saves drafts. Display-only: the UI
173
+ * renders `description`, `amount`, and the recurring/one-time `type`, plus a
174
+ * remove control wired to `actions.removeReimbursement(index)`. `index` is the
175
+ * row's position in the underlying form array (the removal handle); `uuid` is
176
+ * present for rows that already exist server-side.
177
+ *
178
+ * @public
179
+ */
180
+ export interface ReimbursementRow {
181
+ /** Opaque, stable React key. */
182
+ key: string;
183
+ /** The row's index in the reimbursements form array; pass to `removeReimbursement`. */
184
+ index: number;
185
+ /** The reimbursement's server UUID, when it already exists. */
186
+ uuid?: string;
187
+ /** The reimbursement description (may be blank; the UI supplies a fallback). */
188
+ description: string;
189
+ /** The reimbursement amount as a decimal string. */
190
+ amount: string;
191
+ /** Whether this reimbursement recurs. Recurring rows are managed outside payroll. */
192
+ recurring: boolean;
193
+ }
194
+ /**
195
+ * The render-ready field collections exposed on `form.Fields`.
196
+ *
197
+ * @remarks
198
+ * Job-scoped inputs (hours, additional earnings) are grouped under `jobs`, one
199
+ * entry per job, so multi-job employees render correctly. Employee-scoped
200
+ * sections (other earnings, time off, final payout, payment method,
201
+ * reimbursements) stay top-level.
202
+ *
203
+ * @public
204
+ */
205
+ export interface PayrollEditEmployeeFields {
206
+ /** Per-job hours and additional-earnings sections; one entry per job. */
207
+ jobs: JobFields[];
208
+ /** Non-overtime earnings (e.g. tips), always flat; opaque render entries. */
209
+ other: OtherEntry[];
210
+ /** Time-off inputs (never workweek-breakdown). */
211
+ timeOff: TimeOffEntry[];
212
+ /** Final-payout inputs, present only for dismissal payrolls. */
213
+ finalPayout?: TimeOffEntry[];
214
+ /** Payment-method selector, present only when the employee has direct deposit set up. */
215
+ paymentMethod?: PayrollEditEmployeePaymentMethodField;
216
+ /**
217
+ * The draft "add reimbursement" field group, present only for itemized
218
+ * (non-off-cycle) payrolls. Render while `form.reimbursementDraft.isAdding` is
219
+ * `true`; committed rows come from `data.reimbursements`.
220
+ */
221
+ reimbursementDraft?: ReimbursementDraftFields;
222
+ }
223
+ /**
224
+ * Discriminates a workweek-breakdown section: `false` for the flat
225
+ * (single-workweek) `Entry[]` form, `true` for the workweek-keyed
226
+ * `Record<workweekStart, Entry[]>` form.
227
+ *
228
+ * @typeParam TEntry - The section's entry type.
229
+ * @param section - A `form.Fields` section that may be flat or workweek-keyed.
230
+ * @returns `true` when the section is keyed by workweek start date.
231
+ * @public
232
+ */
233
+ export declare function isSplitByWorkweek<TEntry>(section: TEntry[] | Record<string, TEntry[]>): section is Record<string, TEntry[]>;
234
+ /**
235
+ * Builds the draft "add reimbursement" field group, binding its Description and
236
+ * Amount fields to the `reimbursementDraft` form path.
237
+ *
238
+ * @returns The pre-bound draft field group for `form.Fields.reimbursementDraft`.
239
+ * @internal
240
+ */
241
+ export declare function createReimbursementDraftFields(): ReimbursementDraftFields;
242
+ /** @internal */
243
+ export interface CreatePayrollEditEmployeeFieldsOptions {
244
+ employeeCompensation: PayrollEmployeeCompensationsType | undefined;
245
+ /**
246
+ * Fixed compensations to render, already merged with blank placeholders for
247
+ * every company earning type (see `resolveEditableFixedCompensations`).
248
+ */
249
+ fixedCompensations: NonNullable<PayrollEmployeeCompensationsType['fixedCompensations']>;
250
+ workweeks: NormalizedWorkweek[];
251
+ payrollCategory: PayrollCategory;
252
+ hasDirectDepositSetup: boolean;
253
+ /** Names of earning types included in the regular-rate-of-pay overtime calculation. */
254
+ overtimeEarningNames: Set<string>;
255
+ /** Whether the employee is overtime-eligible (nonexempt family). Gates per-workweek splitting. */
256
+ isOvertimeEligible: boolean;
257
+ /** Job title lookup by job UUID, for per-job section headings. */
258
+ jobTitlesByUuid: Map<string, string>;
259
+ }
260
+ /**
261
+ * Builds the render-ready {@link PayrollEditEmployeeFields} from the prepared
262
+ * compensation.
263
+ *
264
+ * @remarks
265
+ * Hours and overtime-affecting earnings are grouped per job into `jobs` (a job
266
+ * appears if it has hourly lines or overtime-affecting earnings). Fixed
267
+ * compensations are split by whether their earning type is included in the
268
+ * regular-rate-of-pay overtime calculation (`overtimeEarningNames`): included
269
+ * earnings become each job's additional earnings, the rest become the flat,
270
+ * employee-level `other` section. Time off comes from the paid-time-off list,
271
+ * final payout is added only for dismissal payrolls, and the payment-method
272
+ * selector appears only when direct deposit is set up.
273
+ *
274
+ * @param options - The prepared compensation, normalized workweeks, payroll category, direct-deposit flag, overtime earning names, eligibility, and job titles.
275
+ * @returns The populated field collections.
276
+ * @internal
277
+ */
278
+ export declare function createPayrollEditEmployeeFields({ employeeCompensation, fixedCompensations, workweeks, payrollCategory, hasDirectDepositSetup, overtimeEarningNames, isOvertimeEligible, jobTitlesByUuid, }: CreatePayrollEditEmployeeFieldsOptions): PayrollEditEmployeeFields;
@@ -0,0 +1 @@
1
+ export { usePayrollEditEmployeeForm, type UsePayrollEditEmployeeFormProps, type UsePayrollEditEmployeeFormResult, type UsePayrollEditEmployeeFormReady, } from './usePayrollEditEmployeeForm';