@gusto/embedded-react-sdk 0.24.1 → 0.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (315) hide show
  1. package/CHANGELOG.md +69 -0
  2. package/dist/assets/icons/slash-circle.svg.js +10 -0
  3. package/dist/assets/icons/slash-circle.svg.js.map +1 -0
  4. package/dist/components/Base/Base.d.ts +1 -1
  5. package/dist/components/Base/Base.js.map +1 -1
  6. package/dist/components/Common/Fields/FileInputField/FileInputField.d.ts +5 -0
  7. package/dist/components/Common/Fields/FileInputField/FileInputField.js +34 -0
  8. package/dist/components/Common/Fields/FileInputField/FileInputField.js.map +1 -0
  9. package/dist/components/Common/Fields/FileInputField/index.d.ts +2 -0
  10. package/dist/components/Common/PaginationControl/PaginationControl.js +41 -40
  11. package/dist/components/Common/PaginationControl/PaginationControl.js.map +1 -1
  12. package/dist/components/Common/PaginationControl/PaginationControlTypes.d.ts +1 -0
  13. package/dist/components/Common/SignatureForm/SignatureForm.js +12 -11
  14. package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
  15. package/dist/components/Common/SignatureForm/SignatureFormActions.js +1 -1
  16. package/dist/components/Common/SignatureForm/SignatureFormFields.js +1 -1
  17. package/dist/components/Common/UI/FileInput/FileInput.d.ts +2 -0
  18. package/dist/components/Common/UI/FileInput/FileInput.js +151 -0
  19. package/dist/components/Common/UI/FileInput/FileInput.js.map +1 -0
  20. package/dist/components/Common/UI/FileInput/FileInput.module.scss.js +34 -0
  21. package/dist/components/Common/UI/FileInput/FileInput.module.scss.js.map +1 -0
  22. package/dist/components/Common/UI/FileInput/FileInputTypes.d.ts +45 -0
  23. package/dist/components/Common/UI/FileInput/FileInputTypes.js +8 -0
  24. package/dist/components/Common/UI/FileInput/FileInputTypes.js.map +1 -0
  25. package/dist/components/Common/UI/FileInput/index.d.ts +4 -0
  26. package/dist/components/Common/UI/TextInput/TextInput.js +27 -23
  27. package/dist/components/Common/UI/TextInput/TextInput.js.map +1 -1
  28. package/dist/components/Common/UI/TextInput/TextInputTypes.d.ts +1 -1
  29. package/dist/components/Common/UI/TextInput/TextInputTypes.js.map +1 -1
  30. package/dist/components/Company/AssignSignatory/AssignSignatory.js +1 -1
  31. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +1 -1
  32. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +4 -3
  33. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  34. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +1 -1
  35. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +4 -3
  36. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  37. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +6 -5
  38. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  39. package/dist/components/Company/BankAccount/BankAccountForm/Form.js +5 -4
  40. package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
  41. package/dist/components/Company/BankAccount/BankAccountForm/context.js +4 -3
  42. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  43. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +5 -4
  44. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
  45. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +2 -2
  46. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +4 -3
  47. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  48. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +2 -2
  49. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +4 -3
  50. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  51. package/dist/components/Company/FederalTaxes/FederalTaxes.js +2 -2
  52. package/dist/components/Company/FederalTaxes/Form.js +3 -2
  53. package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
  54. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +9 -8
  55. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  56. package/dist/components/Company/Industry/Context.js +7 -6
  57. package/dist/components/Company/Industry/Context.js.map +1 -1
  58. package/dist/components/Company/Locations/LocationForm/LocationForm.js +2 -2
  59. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +4 -3
  60. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  61. package/dist/components/Company/Locations/LocationsList/List.js +35 -33
  62. package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
  63. package/dist/components/Company/Locations/LocationsList/LocationsList.js +30 -29
  64. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  65. package/dist/components/Company/Locations/LocationsList/useLocationsList.d.ts +1 -0
  66. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +4 -3
  67. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  68. package/dist/components/Company/OnboardingOverview/Completed.js +3 -2
  69. package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
  70. package/dist/components/Company/OnboardingOverview/MissingRequirements.js +3 -2
  71. package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
  72. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +2 -2
  73. package/dist/components/Company/OnboardingOverview/context.js +4 -3
  74. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  75. package/dist/components/Company/PaySchedule/PaySchedule.js +2 -2
  76. package/dist/components/Company/PaySchedule/_parts/Head.js +9 -8
  77. package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
  78. package/dist/components/Company/PaySchedule/_parts/List.js +12 -11
  79. package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
  80. package/dist/components/Company/PaySchedule/usePaySchedule.js +6 -5
  81. package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
  82. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +4 -3
  83. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  84. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +4 -3
  85. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  86. package/dist/components/Contractor/Address/Address.js +2 -2
  87. package/dist/components/Contractor/Address/useAddress.js +6 -5
  88. package/dist/components/Contractor/Address/useAddress.js.map +1 -1
  89. package/dist/components/Contractor/ContractorList/index.js +31 -30
  90. package/dist/components/Contractor/ContractorList/index.js.map +1 -1
  91. package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js +61 -59
  92. package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js.map +1 -1
  93. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +34 -31
  94. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
  95. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +29 -10
  96. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js.map +1 -1
  97. package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.d.ts +3 -1
  98. package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +33 -31
  99. package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js.map +1 -1
  100. package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.d.ts +2 -0
  101. package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js +25 -19
  102. package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js.map +1 -1
  103. package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.d.ts +1 -0
  104. package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js +86 -56
  105. package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js.map +1 -1
  106. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistory.d.ts +1 -2
  107. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistory.js +46 -21
  108. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistory.js.map +1 -1
  109. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.d.ts +6 -15
  110. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js +116 -99
  111. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map +1 -1
  112. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.module.scss.js +8 -0
  113. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.module.scss.js.map +1 -0
  114. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatement.d.ts +8 -0
  115. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatement.js +51 -0
  116. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatement.js.map +1 -0
  117. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.d.ts +11 -0
  118. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js +157 -0
  119. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js.map +1 -0
  120. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.module.scss.js +22 -0
  121. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.module.scss.js.map +1 -0
  122. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +46 -48
  123. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
  124. package/dist/components/Contractor/Profile/useContractorProfile.js +3 -2
  125. package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
  126. package/dist/components/Contractor/Submit/Submit.js +1 -1
  127. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +4 -3
  128. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
  129. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +4 -3
  130. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
  131. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +4 -3
  132. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -1
  133. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +1 -1
  134. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +1 -1
  135. package/dist/components/Employee/DocumentSigner/DocumentList/List.js +3 -2
  136. package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
  137. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +4 -3
  138. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  139. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +1 -1
  140. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +4 -3
  141. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  142. package/dist/components/Employee/EmployeeList/EmployeeList.js +58 -56
  143. package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
  144. package/dist/components/Employee/EmployeeList/Head.js +3 -2
  145. package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
  146. package/dist/components/Employee/EmployeeList/List.js +34 -32
  147. package/dist/components/Employee/EmployeeList/List.js.map +1 -1
  148. package/dist/components/Employee/EmployeeList/useEmployeeList.d.ts +1 -0
  149. package/dist/components/Employee/EmployeeList/useEmployeeList.js +4 -3
  150. package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
  151. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +4 -3
  152. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
  153. package/dist/components/Employee/Landing/Landing.js +8 -8
  154. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +7 -7
  155. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +6 -5
  156. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
  157. package/dist/components/Employee/Profile/useProfile.js +4 -3
  158. package/dist/components/Employee/Profile/useProfile.js.map +1 -1
  159. package/dist/components/Employee/StateTaxes/useStateTaxes.js +4 -3
  160. package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
  161. package/dist/components/Employee/Taxes/useTaxes.js +4 -3
  162. package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
  163. package/dist/components/Flow/Flow.js +3 -2
  164. package/dist/components/Flow/Flow.js.map +1 -1
  165. package/dist/components/Payroll/InformationRequests/InformationRequestForm/InformationRequestForm.d.ts +15 -0
  166. package/dist/components/Payroll/InformationRequests/InformationRequestForm/InformationRequestForm.js +142 -0
  167. package/dist/components/Payroll/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -0
  168. package/dist/components/Payroll/InformationRequests/InformationRequestForm/InformationRequestForm.module.scss.js +18 -0
  169. package/dist/components/Payroll/InformationRequests/InformationRequestForm/InformationRequestForm.module.scss.js.map +1 -0
  170. package/dist/components/Payroll/InformationRequests/InformationRequestForm/index.d.ts +2 -0
  171. package/dist/components/Payroll/InformationRequests/InformationRequestList/InformationRequestList.d.ts +7 -0
  172. package/dist/components/Payroll/InformationRequests/InformationRequestList/InformationRequestList.js +88 -0
  173. package/dist/components/Payroll/InformationRequests/InformationRequestList/InformationRequestList.js.map +1 -0
  174. package/dist/components/Payroll/InformationRequests/InformationRequestList/index.d.ts +2 -0
  175. package/dist/components/Payroll/InformationRequests/InformationRequests.d.ts +6 -0
  176. package/dist/components/Payroll/InformationRequests/InformationRequests.js +55 -0
  177. package/dist/components/Payroll/InformationRequests/InformationRequests.js.map +1 -0
  178. package/dist/components/Payroll/InformationRequests/InformationRequestsComponents.d.ts +19 -0
  179. package/dist/components/Payroll/InformationRequests/InformationRequestsComponents.js +20 -0
  180. package/dist/components/Payroll/InformationRequests/InformationRequestsComponents.js.map +1 -0
  181. package/dist/components/Payroll/InformationRequests/index.d.ts +3 -0
  182. package/dist/components/Payroll/InformationRequests/informationRequestsStateMachine.d.ts +13 -0
  183. package/dist/components/Payroll/InformationRequests/informationRequestsStateMachine.js +47 -0
  184. package/dist/components/Payroll/InformationRequests/informationRequestsStateMachine.js.map +1 -0
  185. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +7 -6
  186. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
  187. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +3 -2
  188. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js.map +1 -1
  189. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +116 -130
  190. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
  191. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.d.ts +5 -2
  192. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +107 -99
  193. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
  194. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.module.scss.js +2 -4
  195. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.module.scss.js.map +1 -1
  196. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.d.ts +21 -0
  197. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js +105 -0
  198. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js.map +1 -0
  199. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js +41 -37
  200. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js.map +1 -1
  201. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.d.ts +5 -4
  202. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +151 -145
  203. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
  204. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +14 -12
  205. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
  206. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.d.ts +2 -0
  207. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js +174 -106
  208. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js.map +1 -1
  209. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js +28 -28
  210. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js.map +1 -1
  211. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.d.ts +2 -2
  212. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +84 -102
  213. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
  214. package/dist/components/Payroll/PayrollLanding/PayrollLanding.js +24 -20
  215. package/dist/components/Payroll/PayrollLanding/PayrollLanding.js.map +1 -1
  216. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.d.ts +2 -0
  217. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js +51 -46
  218. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js.map +1 -1
  219. package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.d.ts +2 -0
  220. package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.js +111 -45
  221. package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.js.map +1 -1
  222. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +137 -125
  223. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
  224. package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js +8 -4
  225. package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js.map +1 -1
  226. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +117 -110
  227. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
  228. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.d.ts +4 -2
  229. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +282 -278
  230. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
  231. package/dist/components/Payroll/PayrollOverview/PayrollOverviewTypes.d.ts +6 -0
  232. package/dist/components/Payroll/PayrollOverview/PayrollOverviewTypes.js +5 -0
  233. package/dist/components/Payroll/PayrollOverview/PayrollOverviewTypes.js.map +1 -0
  234. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js +3 -2
  235. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js.map +1 -1
  236. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +3 -2
  237. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
  238. package/dist/components/Payroll/RecoveryCases/RecoveryCases.d.ts +6 -0
  239. package/dist/components/Payroll/RecoveryCases/RecoveryCases.js +55 -0
  240. package/dist/components/Payroll/RecoveryCases/RecoveryCases.js.map +1 -0
  241. package/dist/components/Payroll/RecoveryCases/RecoveryCasesComponents.d.ts +19 -0
  242. package/dist/components/Payroll/RecoveryCases/RecoveryCasesComponents.js +19 -0
  243. package/dist/components/Payroll/RecoveryCases/RecoveryCasesComponents.js.map +1 -0
  244. package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.d.ts +7 -0
  245. package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js +73 -0
  246. package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js.map +1 -0
  247. package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.module.scss.js +10 -0
  248. package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.module.scss.js.map +1 -0
  249. package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/index.d.ts +2 -0
  250. package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.d.ts +14 -0
  251. package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js +46 -0
  252. package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js.map +1 -0
  253. package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/index.d.ts +2 -0
  254. package/dist/components/Payroll/RecoveryCases/index.d.ts +3 -0
  255. package/dist/components/Payroll/RecoveryCases/recoveryCasesStateMachine.d.ts +13 -0
  256. package/dist/components/Payroll/RecoveryCases/recoveryCasesStateMachine.js +47 -0
  257. package/dist/components/Payroll/RecoveryCases/recoveryCasesStateMachine.js.map +1 -0
  258. package/dist/components/Payroll/helpers.d.ts +12 -0
  259. package/dist/components/Payroll/helpers.js +129 -117
  260. package/dist/components/Payroll/helpers.js.map +1 -1
  261. package/dist/components/Payroll/index.d.ts +2 -0
  262. package/dist/components/Payroll/index.js +18 -14
  263. package/dist/components/Payroll/index.js.map +1 -1
  264. package/dist/components/Payroll/usePreparedPayrollData.d.ts +4 -1
  265. package/dist/components/Payroll/usePreparedPayrollData.js +43 -31
  266. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  267. package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js +27 -25
  268. package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js.map +1 -1
  269. package/dist/contexts/ComponentAdapter/componentAdapterTypes.d.ts +1 -0
  270. package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.d.ts +5 -0
  271. package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.js +17 -15
  272. package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.js.map +1 -1
  273. package/dist/contexts/ComponentAdapter/useComponentContext.d.ts +2 -0
  274. package/dist/contexts/ComponentAdapter/useComponentContext.js +3 -3
  275. package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
  276. package/dist/helpers/dateFormatting.d.ts +1 -0
  277. package/dist/helpers/dateFormatting.js +1 -0
  278. package/dist/helpers/dateFormatting.js.map +1 -1
  279. package/dist/helpers/formattedStrings.d.ts +1 -0
  280. package/dist/helpers/formattedStrings.js +23 -18
  281. package/dist/helpers/formattedStrings.js.map +1 -1
  282. package/dist/helpers/responsive.js +1 -1
  283. package/dist/helpers/responsive.js.map +1 -1
  284. package/dist/i18n/I18n.js +3 -3
  285. package/dist/i18n/I18n.js.map +1 -1
  286. package/dist/i18n/en/Contractor.Payments.CreatePayment.json.js +36 -32
  287. package/dist/i18n/en/Contractor.Payments.CreatePayment.json.js.map +1 -1
  288. package/dist/i18n/en/Contractor.Payments.PaymentHistory.json.js +11 -11
  289. package/dist/i18n/en/Contractor.Payments.PaymentStatement.json.js +28 -0
  290. package/dist/i18n/en/Contractor.Payments.PaymentStatement.json.js.map +1 -0
  291. package/dist/i18n/en/Contractor.Payments.PaymentsList.json.js +14 -14
  292. package/dist/i18n/en/Payroll.InformationRequestForm.json.js +18 -0
  293. package/dist/i18n/en/Payroll.InformationRequestForm.json.js.map +1 -0
  294. package/dist/i18n/en/Payroll.InformationRequestList.json.js +18 -0
  295. package/dist/i18n/en/Payroll.InformationRequestList.json.js.map +1 -0
  296. package/dist/i18n/en/Payroll.PayrollConfiguration.json.js +27 -21
  297. package/dist/i18n/en/Payroll.PayrollConfiguration.json.js.map +1 -1
  298. package/dist/i18n/en/Payroll.PayrollHistory.json.js +6 -6
  299. package/dist/i18n/en/Payroll.PayrollLanding.json.js +5 -3
  300. package/dist/i18n/en/Payroll.PayrollLanding.json.js.map +1 -1
  301. package/dist/i18n/en/Payroll.PayrollOverview.json.js +32 -28
  302. package/dist/i18n/en/Payroll.PayrollOverview.json.js.map +1 -1
  303. package/dist/i18n/en/Payroll.RecoveryCasesList.json.js +14 -0
  304. package/dist/i18n/en/Payroll.RecoveryCasesList.json.js.map +1 -0
  305. package/dist/i18n/en/Payroll.RecoveryCasesResubmit.json.js +8 -0
  306. package/dist/i18n/en/Payroll.RecoveryCasesResubmit.json.js.map +1 -0
  307. package/dist/i18n/en/common.json.d.ts +5 -0
  308. package/dist/i18n/en/common.json.js +4 -2
  309. package/dist/i18n/en/common.json.js.map +1 -1
  310. package/dist/shared/constants.d.ts +24 -0
  311. package/dist/shared/constants.js +70 -54
  312. package/dist/shared/constants.js.map +1 -1
  313. package/dist/style.css +1 -1
  314. package/dist/types/i18next.d.ts +119 -3
  315. package/package.json +31 -20
@@ -1,8 +1,7 @@
1
1
  import { BaseComponentInterface } from '../../../Base';
2
2
  interface PaymentHistoryProps extends BaseComponentInterface<'Contractor.Payments.PaymentHistory'> {
3
- companyId: string;
4
3
  paymentId: string;
5
4
  }
6
5
  export declare function PaymentHistory(props: PaymentHistoryProps): import("react/jsx-runtime").JSX.Element;
7
- export declare const Root: ({ companyId, paymentId, dictionary, onEvent }: PaymentHistoryProps) => import("react/jsx-runtime").JSX.Element;
6
+ export declare const Root: ({ paymentId, dictionary, onEvent }: PaymentHistoryProps) => import("react/jsx-runtime").JSX.Element;
8
7
  export {};
@@ -1,26 +1,51 @@
1
- import { jsx as t, Fragment as e } from "react/jsx-runtime";
2
- import { PaymentHistoryPresentation as r } from "./PaymentHistoryPresentation.js";
3
- import { useComponentDictionary as m } from "../../../../i18n/I18n.js";
4
- import { BaseComponent as a } from "../../../Base/Base.js";
5
- import "../../../Base/useBase.js";
6
- function l(n) {
7
- return /* @__PURE__ */ t(a, { ...n, children: /* @__PURE__ */ t(i, { ...n, children: n.children }) });
1
+ import { jsx as n, Fragment as f } from "react/jsx-runtime";
2
+ import { useContractorPaymentGroupsGetSuspense as G } from "@gusto/embedded-api/react-query/contractorPaymentGroupsGet";
3
+ import { useContractorsListSuspense as T } from "@gusto/embedded-api/react-query/contractorsList";
4
+ import { useContractorPaymentsDeleteMutation as h } from "@gusto/embedded-api/react-query/contractorPaymentsDelete";
5
+ import { useTranslation as A } from "react-i18next";
6
+ import { PaymentHistoryPresentation as w } from "./PaymentHistoryPresentation.js";
7
+ import { useComponentDictionary as E } from "../../../../i18n/I18n.js";
8
+ import { BaseComponent as N } from "../../../Base/Base.js";
9
+ import { useBase as R } from "../../../Base/useBase.js";
10
+ import { componentEvents as m } from "../../../../shared/constants.js";
11
+ function b(t) {
12
+ return /* @__PURE__ */ n(N, { ...t, children: /* @__PURE__ */ n(H, { ...t, children: t.children }) });
8
13
  }
9
- const i = ({ companyId: n, paymentId: y, dictionary: o, onEvent: c }) => (m("Contractor.Payments.PaymentHistory", o), /* @__PURE__ */ t(e, { children: /* @__PURE__ */ t(
10
- r,
11
- {
12
- date: "2025-12-17",
13
- payments: [],
14
- onBack: () => {
15
- },
16
- onViewPayment: () => {
17
- },
18
- onCancelPayment: () => {
14
+ const H = ({ paymentId: t, dictionary: s, onEvent: e }) => {
15
+ E("Contractor.Payments.PaymentHistory", s);
16
+ const { t: i } = A("Contractor.Payments.PaymentHistory"), { baseSubmitHandler: y } = R(), { data: r } = G({
17
+ contractorPaymentGroupUuid: t
18
+ });
19
+ if (!r.contractorPaymentGroup)
20
+ throw new Error(i("errors.paymentGroupNotFound"));
21
+ const a = r.contractorPaymentGroup.companyUuid, { data: u } = T({ companyUuid: a }), c = u.contractorList || [], { mutateAsync: p, isPending: P } = h(), d = (o) => {
22
+ e(m.CONTRACTOR_PAYMENT_VIEW_DETAILS, {
23
+ contractor: c.find((l) => l.uuid === o),
24
+ paymentGroupId: t
25
+ });
26
+ }, C = async (o) => {
27
+ await y(o, async () => {
28
+ await p({
29
+ request: {
30
+ contractorPaymentId: o,
31
+ companyId: a
32
+ }
33
+ });
34
+ }), e(m.CONTRACTOR_PAYMENT_CANCEL, { paymentId: o });
35
+ };
36
+ return /* @__PURE__ */ n(f, { children: /* @__PURE__ */ n(
37
+ w,
38
+ {
39
+ paymentGroup: r.contractorPaymentGroup,
40
+ contractors: c,
41
+ isCancelling: P,
42
+ onViewPayment: d,
43
+ onCancelPayment: C
19
44
  }
20
- }
21
- ) }));
45
+ ) });
46
+ };
22
47
  export {
23
- l as PaymentHistory,
24
- i as Root
48
+ b as PaymentHistory,
49
+ H as Root
25
50
  };
26
51
  //# sourceMappingURL=PaymentHistory.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PaymentHistory.js","sources":["../../../../../src/components/Contractor/Payments/PaymentHistory/PaymentHistory.tsx"],"sourcesContent":["import { PaymentHistoryPresentation } from './PaymentHistoryPresentation'\nimport { useComponentDictionary } from '@/i18n'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\n\ninterface PaymentHistoryProps extends BaseComponentInterface<'Contractor.Payments.PaymentHistory'> {\n companyId: string\n paymentId: string\n}\n\nexport function PaymentHistory(props: PaymentHistoryProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nexport const Root = ({ companyId, paymentId, dictionary, onEvent }: PaymentHistoryProps) => {\n useComponentDictionary('Contractor.Payments.PaymentHistory', dictionary)\n\n return (\n <>\n <PaymentHistoryPresentation\n date={'2025-12-17'}\n payments={[]}\n onBack={() => {}}\n onViewPayment={() => {}}\n onCancelPayment={() => {}}\n />\n </>\n )\n}\n"],"names":["PaymentHistory","props","jsx","BaseComponent","Root","companyId","paymentId","dictionary","onEvent","useComponentDictionary","Fragment","PaymentHistoryPresentation"],"mappings":";;;;;AASO,SAASA,EAAeC,GAA4B;AACzD,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEO,MAAMG,IAAO,CAAC,EAAE,WAAAC,GAAW,WAAAC,GAAW,YAAAC,GAAY,SAAAC,SACvDC,EAAuB,sCAAsCF,CAAU,GAGrE,gBAAAL,EAAAQ,GAAA,EACE,UAAA,gBAAAR;AAAA,EAACS;AAAA,EAAA;AAAA,IACC,MAAM;AAAA,IACN,UAAU,CAAA;AAAA,IACV,QAAQ,MAAM;AAAA,IAAC;AAAA,IACf,eAAe,MAAM;AAAA,IAAC;AAAA,IACtB,iBAAiB,MAAM;AAAA,IAAC;AAAA,EAAA;AAAA,GAE5B;"}
1
+ {"version":3,"file":"PaymentHistory.js","sources":["../../../../../src/components/Contractor/Payments/PaymentHistory/PaymentHistory.tsx"],"sourcesContent":["import { useContractorPaymentGroupsGetSuspense } from '@gusto/embedded-api/react-query/contractorPaymentGroupsGet'\nimport { useContractorsListSuspense } from '@gusto/embedded-api/react-query/contractorsList'\nimport { useContractorPaymentsDeleteMutation } from '@gusto/embedded-api/react-query/contractorPaymentsDelete'\nimport { useTranslation } from 'react-i18next'\nimport { PaymentHistoryPresentation } from './PaymentHistoryPresentation'\nimport { useComponentDictionary } from '@/i18n'\nimport { BaseComponent, useBase, type BaseComponentInterface } from '@/components/Base'\nimport { componentEvents } from '@/shared/constants'\n\ninterface PaymentHistoryProps extends BaseComponentInterface<'Contractor.Payments.PaymentHistory'> {\n paymentId: string\n}\n\nexport function PaymentHistory(props: PaymentHistoryProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nexport const Root = ({ paymentId, dictionary, onEvent }: PaymentHistoryProps) => {\n useComponentDictionary('Contractor.Payments.PaymentHistory', dictionary)\n const { t } = useTranslation('Contractor.Payments.PaymentHistory')\n const { baseSubmitHandler } = useBase()\n\n const { data: paymentGroupResponse } = useContractorPaymentGroupsGetSuspense({\n contractorPaymentGroupUuid: paymentId,\n })\n if (!paymentGroupResponse.contractorPaymentGroup) {\n throw new Error(t('errors.paymentGroupNotFound'))\n }\n\n const companyId = paymentGroupResponse.contractorPaymentGroup.companyUuid!\n\n const { data: contractorList } = useContractorsListSuspense({ companyUuid: companyId })\n const contractors = contractorList.contractorList || []\n\n const { mutateAsync: cancelPayment, isPending: isCancelling } =\n useContractorPaymentsDeleteMutation()\n\n const handleViewPayment = (contractorUuid: string) => {\n onEvent(componentEvents.CONTRACTOR_PAYMENT_VIEW_DETAILS, {\n contractor: contractors.find(c => c.uuid === contractorUuid),\n paymentGroupId: paymentId,\n })\n }\n\n const handleCancelPayment = async (paymentId: string) => {\n await baseSubmitHandler(paymentId, async () => {\n await cancelPayment({\n request: {\n contractorPaymentId: paymentId,\n companyId,\n },\n })\n })\n\n onEvent(componentEvents.CONTRACTOR_PAYMENT_CANCEL, { paymentId })\n }\n\n return (\n <>\n <PaymentHistoryPresentation\n paymentGroup={paymentGroupResponse.contractorPaymentGroup}\n contractors={contractors}\n isCancelling={isCancelling}\n onViewPayment={handleViewPayment}\n onCancelPayment={handleCancelPayment}\n />\n </>\n )\n}\n"],"names":["PaymentHistory","props","jsx","BaseComponent","Root","paymentId","dictionary","onEvent","useComponentDictionary","t","useTranslation","baseSubmitHandler","useBase","paymentGroupResponse","useContractorPaymentGroupsGetSuspense","companyId","contractorList","useContractorsListSuspense","contractors","cancelPayment","isCancelling","useContractorPaymentsDeleteMutation","handleViewPayment","contractorUuid","componentEvents","c","handleCancelPayment","Fragment","PaymentHistoryPresentation"],"mappings":";;;;;;;;;;AAaO,SAASA,EAAeC,GAA4B;AACzD,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEO,MAAMG,IAAO,CAAC,EAAE,WAAAC,GAAW,YAAAC,GAAY,SAAAC,QAAmC;AAC/E,EAAAC,EAAuB,sCAAsCF,CAAU;AACvE,QAAM,EAAE,GAAAG,EAAA,IAAMC,EAAe,oCAAoC,GAC3D,EAAE,mBAAAC,EAAA,IAAsBC,EAAA,GAExB,EAAE,MAAMC,EAAA,IAAyBC,EAAsC;AAAA,IAC3E,4BAA4BT;AAAA,EAAA,CAC7B;AACD,MAAI,CAACQ,EAAqB;AACxB,UAAM,IAAI,MAAMJ,EAAE,6BAA6B,CAAC;AAGlD,QAAMM,IAAYF,EAAqB,uBAAuB,aAExD,EAAE,MAAMG,EAAA,IAAmBC,EAA2B,EAAE,aAAaF,GAAW,GAChFG,IAAcF,EAAe,kBAAkB,CAAA,GAE/C,EAAE,aAAaG,GAAe,WAAWC,EAAA,IAC7CC,EAAA,GAEIC,IAAoB,CAACC,MAA2B;AACpD,IAAAhB,EAAQiB,EAAgB,iCAAiC;AAAA,MACvD,YAAYN,EAAY,KAAK,CAAAO,MAAKA,EAAE,SAASF,CAAc;AAAA,MAC3D,gBAAgBlB;AAAA,IAAA,CACjB;AAAA,EACH,GAEMqB,IAAsB,OAAOrB,MAAsB;AACvD,UAAMM,EAAkBN,GAAW,YAAY;AAC7C,YAAMc,EAAc;AAAA,QAClB,SAAS;AAAA,UACP,qBAAqBd;AAAAA,UACrB,WAAAU;AAAA,QAAA;AAAA,MACF,CACD;AAAA,IACH,CAAC,GAEDR,EAAQiB,EAAgB,2BAA2B,EAAE,WAAAnB,GAAW;AAAA,EAClE;AAEA,SACE,gBAAAH,EAAAyB,GAAA,EACE,UAAA,gBAAAzB;AAAA,IAAC0B;AAAA,IAAA;AAAA,MACC,cAAcf,EAAqB;AAAA,MACnC,aAAAK;AAAA,MACA,cAAAE;AAAA,MACA,eAAeE;AAAA,MACf,iBAAiBI;AAAA,IAAA;AAAA,EAAA,GAErB;AAEJ;"}
@@ -1,20 +1,11 @@
1
- interface PaymentData {
2
- id: string;
3
- name: string;
4
- wageType: string;
5
- paymentMethod: string;
6
- hours: number;
7
- wage: string;
8
- bonus: number;
9
- reimbursement: number;
10
- total: number;
11
- }
1
+ import { ContractorPaymentGroup } from '@gusto/embedded-api/models/components/contractorpaymentgroup';
2
+ import { Contractor } from '@gusto/embedded-api/models/components/contractor';
12
3
  interface PaymentHistoryPresentationProps {
13
- date: string;
14
- payments: PaymentData[];
15
- onBack: () => void;
4
+ paymentGroup: ContractorPaymentGroup;
5
+ contractors: Contractor[];
16
6
  onViewPayment: (paymentId: string) => void;
17
7
  onCancelPayment: (paymentId: string) => void;
8
+ isCancelling: boolean;
18
9
  }
19
- export declare const PaymentHistoryPresentation: ({ date, payments, onBack, onViewPayment, onCancelPayment, }: PaymentHistoryPresentationProps) => import("react/jsx-runtime").JSX.Element;
10
+ export declare const PaymentHistoryPresentation: ({ paymentGroup, contractors, onViewPayment, onCancelPayment, isCancelling, }: PaymentHistoryPresentationProps) => import("react/jsx-runtime").JSX.Element;
20
11
  export {};
@@ -1,113 +1,130 @@
1
- import { jsxs as i, jsx as r, Fragment as y } from "react/jsx-runtime";
2
- import { useTranslation as f } from "react-i18next";
3
- import { Flex as o } from "../../../Common/Flex/Flex.js";
1
+ import { jsxs as l, jsx as t, Fragment as D } from "react/jsx-runtime";
2
+ import { useTranslation as N, Trans as x } from "react-i18next";
3
+ import { getContractorDisplayName as C } from "../CreatePayment/helpers.js";
4
+ import h from "./PaymentHistoryPresentation.module.scss.js";
5
+ import { Flex as m } from "../../../Common/Flex/Flex.js";
4
6
  import "classnames";
5
- import { EmptyData as H } from "../../../Common/EmptyData/EmptyData.js";
6
- import { ActionsLayout as g } from "../../../Common/ActionsLayout/ActionsLayout.js";
7
- import { HamburgerMenu as C } from "../../../Common/HamburgerMenu/HamburgerMenu.js";
8
- import { useComponentContext as x } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
9
- import { useI18n as D } from "../../../../i18n/I18n.js";
10
- import { formatNumberAsCurrency as c } from "../../../../helpers/formattedStrings.js";
11
- import { useLocale as P } from "../../../../contexts/LocaleProvider/useLocale.js";
7
+ import "../../../../shared/constants.js";
8
+ import { EmptyData as P } from "../../../Common/EmptyData/EmptyData.js";
9
+ import { HamburgerMenu as F } from "../../../Common/HamburgerMenu/HamburgerMenu.js";
10
+ import { useComponentContext as v } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
11
+ import { useI18n as S } from "../../../../i18n/I18n.js";
12
12
  import { formatHoursDisplay as k } from "../../../Payroll/helpers.js";
13
- import { DataView as v } from "../../../Common/DataView/DataView.js";
14
- const z = ({
15
- date: u,
16
- payments: m,
17
- onBack: s,
18
- onViewPayment: d,
19
- onCancelPayment: b
13
+ import w from "../../../../hooks/useNumberFormatter.js";
14
+ import { useDateFormatter as L } from "../../../../hooks/useDateFormatter.js";
15
+ import M from "../../../../assets/icons/eye.svg.js";
16
+ import T from "../../../../assets/icons/slash-circle.svg.js";
17
+ import { DataView as j } from "../../../Common/DataView/DataView.js";
18
+ const $ = ({
19
+ paymentGroup: s,
20
+ contractors: b,
21
+ onViewPayment: c,
22
+ onCancelPayment: f,
23
+ isCancelling: y
20
24
  }) => {
21
- const { Button: a, Text: n, Heading: p } = x();
22
- D("Contractor.Payments.PaymentHistory");
23
- const { t: e } = f("Contractor.Payments.PaymentHistory"), { locale: l } = P();
24
- return /* @__PURE__ */ i(o, { flexDirection: "column", gap: 32, children: [
25
- /* @__PURE__ */ i(o, { flexDirection: "column", gap: 8, children: [
26
- /* @__PURE__ */ r(p, { as: "h1", children: e("title") }),
27
- /* @__PURE__ */ r(n, { children: e("subtitle", { date: u }) })
25
+ const { Button: g, Text: n, Heading: d } = v();
26
+ S("Contractor.Payments.PaymentHistory");
27
+ const { t: r } = N("Contractor.Payments.PaymentHistory"), o = w("currency"), { formatLongWithYear: H } = L(), p = s.contractorPayments || [];
28
+ return /* @__PURE__ */ l(m, { flexDirection: "column", gap: 32, children: [
29
+ /* @__PURE__ */ l(m, { flexDirection: "column", gap: 8, children: [
30
+ /* @__PURE__ */ t(d, { as: "h2", children: r("title") }),
31
+ /* @__PURE__ */ t(n, { children: /* @__PURE__ */ t(
32
+ x,
33
+ {
34
+ i18nKey: "subtitle",
35
+ t: r,
36
+ values: { date: H(s.debitDate) },
37
+ components: {
38
+ strong: /* @__PURE__ */ t(n, { weight: "bold", as: "span" })
39
+ }
40
+ }
41
+ ) })
28
42
  ] }),
29
- /* @__PURE__ */ i(o, { flexDirection: "column", gap: 16, children: [
30
- /* @__PURE__ */ r(p, { as: "h2", children: e("paymentsSection") }),
31
- m.length === 0 ? /* @__PURE__ */ r(H, { title: e("noPaymentsFound"), description: e("noPaymentsDescription"), children: /* @__PURE__ */ r(g, { justifyContent: "center", children: /* @__PURE__ */ r(a, { variant: "primary", onClick: s, children: e("backButton") }) }) }) : /* @__PURE__ */ i(y, { children: [
32
- /* @__PURE__ */ r(
33
- v,
34
- {
35
- columns: [
36
- {
37
- title: e("tableHeaders.contractor"),
38
- render: ({ name: t, id: h }) => /* @__PURE__ */ r(
39
- a,
40
- {
41
- variant: "tertiary",
42
- onClick: () => {
43
- d(h);
44
- },
45
- children: t
46
- }
47
- )
48
- },
49
- {
50
- title: e("tableHeaders.wageType"),
51
- render: ({ wageType: t }) => /* @__PURE__ */ r(n, { children: t })
52
- },
53
- {
54
- title: e("tableHeaders.paymentMethod"),
55
- render: ({ paymentMethod: t }) => /* @__PURE__ */ r(n, { children: t })
56
- },
57
- {
58
- title: e("tableHeaders.hours"),
59
- render: ({ hours: t }) => /* @__PURE__ */ r(n, { children: t ? k(t) : "" })
60
- },
43
+ /* @__PURE__ */ l(m, { flexDirection: "column", gap: 16, children: [
44
+ /* @__PURE__ */ t(d, { as: "h2", children: r("paymentsSection") }),
45
+ p.length === 0 ? /* @__PURE__ */ t(P, { title: r("noPaymentsFound"), description: r("noPaymentsDescription") }) : /* @__PURE__ */ t(D, { children: /* @__PURE__ */ t(
46
+ j,
47
+ {
48
+ columns: [
49
+ {
50
+ title: r("tableHeaders.contractor"),
51
+ render: ({ contractorUuid: e }) => /* @__PURE__ */ t(
52
+ g,
53
+ {
54
+ variant: "tertiary",
55
+ onClick: () => {
56
+ c(e);
57
+ },
58
+ children: C(
59
+ b.find((i) => i.uuid === e)
60
+ )
61
+ }
62
+ )
63
+ },
64
+ {
65
+ title: r("tableHeaders.wageType"),
66
+ render: ({ wageType: e }) => /* @__PURE__ */ t(n, { children: e })
67
+ },
68
+ {
69
+ title: r("tableHeaders.paymentMethod"),
70
+ render: ({ paymentMethod: e }) => /* @__PURE__ */ t(n, { children: e })
71
+ },
72
+ {
73
+ title: r("tableHeaders.hours"),
74
+ render: ({ hours: e }) => /* @__PURE__ */ t(n, { children: e ? k(Number(e)) : "–" })
75
+ },
76
+ {
77
+ title: r("tableHeaders.wage"),
78
+ render: ({ wage: e }) => /* @__PURE__ */ t(n, { children: e || "–" })
79
+ },
80
+ {
81
+ title: r("tableHeaders.bonus"),
82
+ render: ({ bonus: e }) => /* @__PURE__ */ t(n, { children: e ? o(Number(e)) : "–" })
83
+ },
84
+ {
85
+ title: r("tableHeaders.reimbursements"),
86
+ render: ({ reimbursement: e }) => /* @__PURE__ */ t(n, { children: e ? o(Number(e)) : "–" })
87
+ },
88
+ {
89
+ title: r("tableHeaders.total"),
90
+ render: ({ wageTotal: e, reimbursement: i, bonus: a }) => /* @__PURE__ */ t(n, { children: e ? o(
91
+ Number(e) + Number(i) + Number(a)
92
+ ) : "–" })
93
+ }
94
+ ],
95
+ itemMenu: ({ contractorUuid: e, mayCancel: i, uuid: a }) => {
96
+ const u = [
61
97
  {
62
- title: e("tableHeaders.wage"),
63
- render: ({ wage: t }) => /* @__PURE__ */ r(n, { children: t || "–" })
64
- },
65
- {
66
- title: e("tableHeaders.bonus"),
67
- render: ({ bonus: t }) => /* @__PURE__ */ r(n, { children: t ? c(t, l) : "–" })
68
- },
69
- {
70
- title: e("tableHeaders.reimbursements"),
71
- render: ({ reimbursement: t }) => /* @__PURE__ */ r(n, { children: c(t, l) })
72
- },
73
- {
74
- title: e("tableHeaders.total"),
75
- render: ({ total: t }) => /* @__PURE__ */ r(n, { children: c(t, l) })
98
+ label: r("actions.view"),
99
+ onClick: () => {
100
+ c(e);
101
+ },
102
+ icon: /* @__PURE__ */ t("span", { className: h.icon, children: /* @__PURE__ */ t(M, { "aria-hidden": !0 }) })
103
+ }
104
+ ];
105
+ return i && u.push({
106
+ label: r("actions.cancel"),
107
+ onClick: () => {
108
+ f(a);
76
109
  },
110
+ icon: /* @__PURE__ */ t("span", { className: h.icon, children: /* @__PURE__ */ t(T, { "aria-hidden": !0 }) })
111
+ }), /* @__PURE__ */ t(
112
+ F,
77
113
  {
78
- title: e("tableHeaders.action"),
79
- render: ({ id: t, name: h }) => /* @__PURE__ */ r(
80
- C,
81
- {
82
- items: [
83
- {
84
- label: e("actions.view"),
85
- onClick: () => {
86
- d(t);
87
- }
88
- },
89
- {
90
- label: e("actions.cancel"),
91
- onClick: () => {
92
- b(t);
93
- }
94
- }
95
- ],
96
- triggerLabel: e("tableHeaders.action")
97
- }
98
- )
114
+ items: u,
115
+ triggerLabel: r("tableHeaders.action"),
116
+ isLoading: y
99
117
  }
100
- ],
101
- data: m,
102
- label: e("title")
103
- }
104
- ),
105
- /* @__PURE__ */ r(o, { children: /* @__PURE__ */ r(a, { onClick: s, variant: "secondary", children: e("backButton") }) })
106
- ] })
118
+ );
119
+ },
120
+ data: p,
121
+ label: r("title")
122
+ }
123
+ ) })
107
124
  ] })
108
125
  ] });
109
126
  };
110
127
  export {
111
- z as PaymentHistoryPresentation
128
+ $ as PaymentHistoryPresentation
112
129
  };
113
130
  //# sourceMappingURL=PaymentHistoryPresentation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PaymentHistoryPresentation.js","sources":["../../../../../src/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { DataView, Flex, EmptyData, ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\nimport { useI18n } from '@/i18n'\nimport { formatNumberAsCurrency } from '@/helpers/formattedStrings'\nimport { useLocale } from '@/contexts/LocaleProvider/useLocale'\nimport { formatHoursDisplay } from '@/components/Payroll/helpers'\n\ninterface PaymentData {\n id: string\n name: string\n wageType: string\n paymentMethod: string\n hours: number\n wage: string\n bonus: number\n reimbursement: number\n total: number\n}\n\ninterface PaymentHistoryPresentationProps {\n date: string\n payments: PaymentData[]\n onBack: () => void\n onViewPayment: (paymentId: string) => void\n onCancelPayment: (paymentId: string) => void\n}\n\nexport const PaymentHistoryPresentation = ({\n date,\n payments,\n onBack,\n onViewPayment,\n onCancelPayment,\n}: PaymentHistoryPresentationProps) => {\n const { Button, Text, Heading } = useComponentContext()\n useI18n('Contractor.Payments.PaymentHistory')\n const { t } = useTranslation('Contractor.Payments.PaymentHistory')\n const { locale } = useLocale()\n\n return (\n <Flex flexDirection=\"column\" gap={32}>\n <Flex flexDirection=\"column\" gap={8}>\n <Heading as=\"h1\">{t('title')}</Heading>\n <Text>{t('subtitle', { date })}</Text>\n </Flex>\n\n <Flex flexDirection=\"column\" gap={16}>\n <Heading as=\"h2\">{t('paymentsSection')}</Heading>\n\n {payments.length === 0 ? (\n <EmptyData title={t('noPaymentsFound')} description={t('noPaymentsDescription')}>\n <ActionsLayout justifyContent=\"center\">\n <Button variant=\"primary\" onClick={onBack}>\n {t('backButton')}\n </Button>\n </ActionsLayout>\n </EmptyData>\n ) : (\n <>\n <DataView\n columns={[\n {\n title: t('tableHeaders.contractor'),\n render: ({ name, id }) => (\n <Button\n variant=\"tertiary\"\n onClick={() => {\n onViewPayment(id)\n }}\n >\n {name}\n </Button>\n ),\n },\n {\n title: t('tableHeaders.wageType'),\n render: ({ wageType }) => <Text>{wageType}</Text>,\n },\n {\n title: t('tableHeaders.paymentMethod'),\n render: ({ paymentMethod }) => <Text>{paymentMethod}</Text>,\n },\n {\n title: t('tableHeaders.hours'),\n render: ({ hours }) => <Text>{hours ? formatHoursDisplay(hours) : '–'}</Text>,\n },\n {\n title: t('tableHeaders.wage'),\n render: ({ wage }) => <Text>{wage || '–'}</Text>,\n },\n {\n title: t('tableHeaders.bonus'),\n render: ({ bonus }) => (\n <Text>{bonus ? formatNumberAsCurrency(bonus, locale) : '–'}</Text>\n ),\n },\n {\n title: t('tableHeaders.reimbursements'),\n render: ({ reimbursement }) => (\n <Text>{formatNumberAsCurrency(reimbursement, locale)}</Text>\n ),\n },\n {\n title: t('tableHeaders.total'),\n render: ({ total }) => <Text>{formatNumberAsCurrency(total, locale)}</Text>,\n },\n {\n title: t('tableHeaders.action'),\n render: ({ id, name }) => (\n <HamburgerMenu\n items={[\n {\n label: t('actions.view'),\n onClick: () => {\n onViewPayment(id)\n },\n },\n {\n label: t('actions.cancel'),\n onClick: () => {\n onCancelPayment(id)\n },\n },\n ]}\n triggerLabel={t('tableHeaders.action')}\n />\n ),\n },\n ]}\n data={payments}\n label={t('title')}\n />\n\n <Flex>\n <Button onClick={onBack} variant=\"secondary\">\n {t('backButton')}\n </Button>\n </Flex>\n </>\n )}\n </Flex>\n </Flex>\n )\n}\n"],"names":["PaymentHistoryPresentation","date","payments","onBack","onViewPayment","onCancelPayment","Button","Text","Heading","useComponentContext","useI18n","t","useTranslation","locale","useLocale","jsxs","Flex","jsx","EmptyData","ActionsLayout","Fragment","DataView","name","id","wageType","paymentMethod","hours","formatHoursDisplay","wage","bonus","formatNumberAsCurrency","reimbursement","total","HamburgerMenu"],"mappings":";;;;;;;;;;;;;AA6BO,MAAMA,IAA6B,CAAC;AAAA,EACzC,MAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,eAAAC;AAAA,EACA,iBAAAC;AACF,MAAuC;AACrC,QAAM,EAAE,QAAAC,GAAQ,MAAAC,GAAM,SAAAC,EAAA,IAAYC,EAAA;AAClC,EAAAC,EAAQ,oCAAoC;AAC5C,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,oCAAoC,GAC3D,EAAE,QAAAC,EAAA,IAAWC,EAAA;AAEnB,SACE,gBAAAC,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,IAAA,gBAAAD,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,GAChC,UAAA;AAAA,MAAA,gBAAAC,EAACT,GAAA,EAAQ,IAAG,MAAM,UAAAG,EAAE,OAAO,GAAE;AAAA,wBAC5BJ,GAAA,EAAM,UAAAI,EAAE,YAAY,EAAE,MAAAV,EAAA,CAAM,EAAA,CAAE;AAAA,IAA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AAA,YAEJ;AAAA,YAEF,MAAMT;AAAA,YACN,OAAOS,EAAE,OAAO;AAAA,UAAA;AAAA,QAAA;AAAA,QAGlB,gBAAAM,EAACD,GAAA,EACC,UAAA,gBAAAC,EAACX,GAAA,EAAO,SAASH,GAAQ,SAAQ,aAC9B,UAAAQ,EAAE,YAAY,EAAA,CACjB,EAAA,CACF;AAAA,MAAA,EAAA,CACF;AAAA,IAAA,EAAA,CAEJ;AAAA,EAAA,GACF;AAEJ;"}
1
+ {"version":3,"file":"PaymentHistoryPresentation.js","sources":["../../../../../src/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.tsx"],"sourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport type { ContractorPaymentGroup } from '@gusto/embedded-api/models/components/contractorpaymentgroup'\nimport type { Contractor } from '@gusto/embedded-api/models/components/contractor'\nimport { getContractorDisplayName } from '../CreatePayment/helpers'\nimport styles from './PaymentHistoryPresentation.module.scss'\nimport { DataView, Flex, EmptyData } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\nimport { useI18n } from '@/i18n'\nimport { formatHoursDisplay } from '@/components/Payroll/helpers'\nimport useNumberFormatter from '@/hooks/useNumberFormatter'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\nimport EyeIcon from '@/assets/icons/eye.svg?react'\nimport CancelIcon from '@/assets/icons/slash-circle.svg?react'\n\ninterface PaymentHistoryPresentationProps {\n paymentGroup: ContractorPaymentGroup\n contractors: Contractor[]\n onViewPayment: (paymentId: string) => void\n onCancelPayment: (paymentId: string) => void\n isCancelling: boolean\n}\n\nexport const PaymentHistoryPresentation = ({\n paymentGroup,\n contractors,\n onViewPayment,\n onCancelPayment,\n isCancelling,\n}: PaymentHistoryPresentationProps) => {\n const { Button, Text, Heading } = useComponentContext()\n useI18n('Contractor.Payments.PaymentHistory')\n const { t } = useTranslation('Contractor.Payments.PaymentHistory')\n const currencyFormatter = useNumberFormatter('currency')\n const { formatLongWithYear } = useDateFormatter()\n\n const payments = paymentGroup.contractorPayments || []\n\n return (\n <Flex flexDirection=\"column\" gap={32}>\n <Flex flexDirection=\"column\" gap={8}>\n <Heading as=\"h2\">{t('title')}</Heading>\n <Text>\n <Trans\n i18nKey={'subtitle'}\n t={t}\n values={{ date: formatLongWithYear(paymentGroup.debitDate) }}\n components={{\n strong: <Text weight=\"bold\" as=\"span\" />,\n }}\n />\n </Text>\n </Flex>\n\n <Flex flexDirection=\"column\" gap={16}>\n <Heading as=\"h2\">{t('paymentsSection')}</Heading>\n\n {payments.length === 0 ? (\n <EmptyData title={t('noPaymentsFound')} description={t('noPaymentsDescription')} />\n ) : (\n <>\n <DataView\n columns={[\n {\n title: t('tableHeaders.contractor'),\n render: ({ contractorUuid }) => (\n <Button\n variant=\"tertiary\"\n onClick={() => {\n onViewPayment(contractorUuid!)\n }}\n >\n {getContractorDisplayName(\n contractors.find(contractor => contractor.uuid === contractorUuid),\n )}\n </Button>\n ),\n },\n {\n title: t('tableHeaders.wageType'),\n render: ({ wageType }) => <Text>{wageType}</Text>,\n },\n {\n title: t('tableHeaders.paymentMethod'),\n render: ({ paymentMethod }) => <Text>{paymentMethod}</Text>,\n },\n {\n title: t('tableHeaders.hours'),\n render: ({ hours }) => (\n <Text>{hours ? formatHoursDisplay(Number(hours)) : '–'}</Text>\n ),\n },\n {\n title: t('tableHeaders.wage'),\n render: ({ wage }) => <Text>{wage || '–'}</Text>,\n },\n {\n title: t('tableHeaders.bonus'),\n render: ({ bonus }) => (\n <Text>{bonus ? currencyFormatter(Number(bonus)) : '–'}</Text>\n ),\n },\n {\n title: t('tableHeaders.reimbursements'),\n render: ({ reimbursement }) => (\n <Text>{reimbursement ? currencyFormatter(Number(reimbursement)) : '–'}</Text>\n ),\n },\n {\n title: t('tableHeaders.total'),\n render: ({ wageTotal, reimbursement, bonus }) => (\n <Text>\n {wageTotal\n ? currencyFormatter(\n Number(wageTotal) + Number(reimbursement) + Number(bonus),\n )\n : '–'}\n </Text>\n ),\n },\n ]}\n itemMenu={({ contractorUuid, mayCancel, uuid }) => {\n const items = [\n {\n label: t('actions.view'),\n onClick: () => {\n onViewPayment(contractorUuid!)\n },\n icon: (\n <span className={styles.icon}>\n <EyeIcon aria-hidden />\n </span>\n ),\n },\n ]\n if (mayCancel) {\n items.push({\n label: t('actions.cancel'),\n onClick: () => {\n onCancelPayment(uuid!)\n },\n icon: (\n <span className={styles.icon}>\n <CancelIcon aria-hidden />\n </span>\n ),\n })\n }\n return (\n <HamburgerMenu\n items={items}\n triggerLabel={t('tableHeaders.action')}\n isLoading={isCancelling}\n />\n )\n }}\n data={payments}\n label={t('title')}\n />\n </>\n )}\n </Flex>\n </Flex>\n )\n}\n"],"names":["PaymentHistoryPresentation","paymentGroup","contractors","onViewPayment","onCancelPayment","isCancelling","Button","Text","Heading","useComponentContext","useI18n","t","useTranslation","currencyFormatter","useNumberFormatter","formatLongWithYear","useDateFormatter","payments","jsxs","Flex","jsx","Trans","EmptyData","Fragment","DataView","contractorUuid","getContractorDisplayName","contractor","wageType","paymentMethod","hours","formatHoursDisplay","wage","bonus","reimbursement","wageTotal","mayCancel","uuid","items","styles","EyeIcon","CancelIcon","HamburgerMenu"],"mappings":";;;;;;;;;;;;;;;;;AAuBO,MAAMA,IAA6B,CAAC;AAAA,EACzC,cAAAC;AAAA,EACA,aAAAC;AAAA,EACA,eAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,cAAAC;AACF,MAAuC;AACrC,QAAM,EAAE,QAAAC,GAAQ,MAAAC,GAAM,SAAAC,EAAA,IAAYC,EAAA;AAClC,EAAAC,EAAQ,oCAAoC;AAC5C,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,oCAAoC,GAC3DC,IAAoBC,EAAmB,UAAU,GACjD,EAAE,oBAAAC,EAAA,IAAuBC,EAAA,GAEzBC,IAAWhB,EAAa,sBAAsB,CAAA;AAEpD,SACE,gBAAAiB,EAACC,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A,IAE1D,IAAA,CACN;AAAA,YAAA;AAAA,UAEJ;AAAA,UAEF,UAAU,CAAC,EAAE,gBAAAR,GAAgB,WAAAW,GAAW,MAAAC,QAAW;AACjD,kBAAMC,IAAQ;AAAA,cACZ;AAAA,gBACE,OAAO3B,EAAE,cAAc;AAAA,gBACvB,SAAS,MAAM;AACb,kBAAAR,EAAcsB,CAAe;AAAA,gBAC/B;AAAA,gBACA,MACE,gBAAAL,EAAC,QAAA,EAAK,WAAWmB,EAAO,MACtB,UAAA,gBAAAnB,EAACoB,GAAA,EAAQ,eAAW,GAAA,CAAC,EAAA,CACvB;AAAA,cAAA;AAAA,YAEJ;AAEF,mBAAIJ,KACFE,EAAM,KAAK;AAAA,cACT,OAAO3B,EAAE,gBAAgB;AAAA,cACzB,SAAS,MAAM;AACb,gBAAAP,EAAgBiC,CAAK;AAAA,cACvB;AAAA,cACA,MACE,gBAAAjB,EAAC,QAAA,EAAK,WAAWmB,EAAO,MACtB,UAAA,gBAAAnB,EAACqB,GAAA,EAAW,eAAW,GAAA,CAAC,EAAA,CAC1B;AAAA,YAAA,CAEH,GAGD,gBAAArB;AAAA,cAACsB;AAAA,cAAA;AAAA,gBACC,OAAAJ;AAAA,gBACA,cAAc3B,EAAE,qBAAqB;AAAA,gBACrC,WAAWN;AAAA,cAAA;AAAA,YAAA;AAAA,UAGjB;AAAA,UACA,MAAMY;AAAA,UACN,OAAON,EAAE,OAAO;AAAA,QAAA;AAAA,MAAA,EAClB,CACF;AAAA,IAAA,EAAA,CAEJ;AAAA,EAAA,GACF;AAEJ;"}
@@ -0,0 +1,8 @@
1
+ const o = "_icon_1h0yv_1", c = {
2
+ icon: o
3
+ };
4
+ export {
5
+ c as default,
6
+ o as icon
7
+ };
8
+ //# sourceMappingURL=PaymentHistoryPresentation.module.scss.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PaymentHistoryPresentation.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
@@ -0,0 +1,8 @@
1
+ import { BaseComponentInterface } from '../../../Base';
2
+ interface PaymentStatementProps extends BaseComponentInterface<'Contractor.Payments.PaymentStatement'> {
3
+ paymentGroupId: string;
4
+ contractorUuid: string;
5
+ }
6
+ export declare function PaymentStatement(props: PaymentStatementProps): import("react/jsx-runtime").JSX.Element;
7
+ export declare const Root: ({ paymentGroupId, contractorUuid, dictionary }: PaymentStatementProps) => import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,51 @@
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import { useContractorPaymentGroupsGetSuspense as f } from "@gusto/embedded-api/react-query/contractorPaymentGroupsGet";
3
+ import { useContractorsListSuspense as d } from "@gusto/embedded-api/react-query/contractorsList";
4
+ import { useContractorPaymentsGetReceipt as P } from "@gusto/embedded-api/react-query/contractorPaymentsGetReceipt";
5
+ import { APIError as h } from "@gusto/embedded-api/models/errors/apierror";
6
+ import { useTranslation as G } from "react-i18next";
7
+ import { PaymentStatementPresentation as w } from "./PaymentStatementPresentation.js";
8
+ import { useComponentDictionary as C } from "../../../../i18n/I18n.js";
9
+ import { BaseComponent as l } from "../../../Base/Base.js";
10
+ import "../../../Base/useBase.js";
11
+ function j(o) {
12
+ return /* @__PURE__ */ a(l, { ...o, children: /* @__PURE__ */ a(R, { ...o, children: o.children }) });
13
+ }
14
+ const R = ({ paymentGroupId: o, contractorUuid: c, dictionary: s }) => {
15
+ C("Contractor.Payments.PaymentStatement", s);
16
+ const { t: n } = G("Contractor.Payments.PaymentStatement"), { data: r } = f({
17
+ contractorPaymentGroupUuid: o
18
+ });
19
+ if (!r.contractorPaymentGroup)
20
+ throw new Error(n("errors.paymentGroupNotFound"));
21
+ const i = r.contractorPaymentGroup.companyUuid, { data: p } = d({ companyUuid: i }), u = p.contractorList || [], e = r.contractorPaymentGroup.contractorPayments?.find(
22
+ (t) => t.contractorUuid === c
23
+ );
24
+ if (!e)
25
+ throw new Error(n("errors.paymentNotFound"));
26
+ const { data: y } = P(
27
+ {
28
+ contractorPaymentUuid: e.uuid
29
+ },
30
+ {
31
+ retry: !1,
32
+ throwOnError: (t) => !(t instanceof h && t.httpMeta.response.status === 404)
33
+ }
34
+ ), m = u.find((t) => t.uuid === c);
35
+ if (!m)
36
+ throw new Error(n("errors.contractorNotFound"));
37
+ return /* @__PURE__ */ a(
38
+ w,
39
+ {
40
+ payment: e,
41
+ contractor: m,
42
+ paymentReceipt: y?.contractorPaymentReceipt,
43
+ checkDate: r.contractorPaymentGroup.checkDate || ""
44
+ }
45
+ );
46
+ };
47
+ export {
48
+ j as PaymentStatement,
49
+ R as Root
50
+ };
51
+ //# sourceMappingURL=PaymentStatement.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PaymentStatement.js","sources":["../../../../../src/components/Contractor/Payments/PaymentStatement/PaymentStatement.tsx"],"sourcesContent":["import { useContractorPaymentGroupsGetSuspense } from '@gusto/embedded-api/react-query/contractorPaymentGroupsGet'\nimport { useContractorsListSuspense } from '@gusto/embedded-api/react-query/contractorsList'\nimport { useContractorPaymentsGetReceipt } from '@gusto/embedded-api/react-query/contractorPaymentsGetReceipt'\nimport { APIError } from '@gusto/embedded-api/models/errors/apierror'\nimport { useTranslation } from 'react-i18next'\nimport { PaymentStatementPresentation } from './PaymentStatementPresentation'\nimport { useComponentDictionary } from '@/i18n'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\n\ninterface PaymentStatementProps extends BaseComponentInterface<'Contractor.Payments.PaymentStatement'> {\n paymentGroupId: string\n contractorUuid: string\n}\n\nexport function PaymentStatement(props: PaymentStatementProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nexport const Root = ({ paymentGroupId, contractorUuid, dictionary }: PaymentStatementProps) => {\n useComponentDictionary('Contractor.Payments.PaymentStatement', dictionary)\n const { t } = useTranslation('Contractor.Payments.PaymentStatement')\n // Fetching entire payment\n const { data: paymentGroupResponse } = useContractorPaymentGroupsGetSuspense({\n contractorPaymentGroupUuid: paymentGroupId,\n })\n\n if (!paymentGroupResponse.contractorPaymentGroup) {\n throw new Error(t('errors.paymentGroupNotFound'))\n }\n\n const companyId = paymentGroupResponse.contractorPaymentGroup.companyUuid!\n // Fetching all contractors for the company\n const { data: contractorList } = useContractorsListSuspense({ companyUuid: companyId })\n const contractors = contractorList.contractorList || []\n // Locating the payment for the selectedcontractor\n const payment = paymentGroupResponse.contractorPaymentGroup.contractorPayments?.find(\n p => p.contractorUuid === contractorUuid,\n )\n\n if (!payment) {\n throw new Error(t('errors.paymentNotFound'))\n }\n // Attempting to fetch the payment receipt\n // Note: 404 is expected for receipts that aren't available (e.g., non-direct deposit or not yet funded)\n const { data: paymentResponse } = useContractorPaymentsGetReceipt(\n {\n contractorPaymentUuid: payment.uuid!,\n },\n {\n retry: false,\n throwOnError: (error: Error) => {\n // Ignore 404 errors (receipt not available), but throw other errors\n if (error instanceof APIError && error.httpMeta.response.status === 404) {\n return false\n }\n return true\n },\n },\n )\n const contractor = contractors.find(c => c.uuid === contractorUuid)\n if (!contractor) {\n throw new Error(t('errors.contractorNotFound'))\n }\n\n return (\n <PaymentStatementPresentation\n payment={payment}\n contractor={contractor}\n paymentReceipt={paymentResponse?.contractorPaymentReceipt}\n checkDate={paymentGroupResponse.contractorPaymentGroup.checkDate || ''}\n />\n )\n}\n"],"names":["PaymentStatement","props","jsx","BaseComponent","Root","paymentGroupId","contractorUuid","dictionary","useComponentDictionary","t","useTranslation","paymentGroupResponse","useContractorPaymentGroupsGetSuspense","companyId","contractorList","useContractorsListSuspense","contractors","payment","p","paymentResponse","useContractorPaymentsGetReceipt","error","APIError","contractor","c","PaymentStatementPresentation"],"mappings":";;;;;;;;;;AAcO,SAASA,EAAiBC,GAA8B;AAC7D,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEO,MAAMG,IAAO,CAAC,EAAE,gBAAAC,GAAgB,gBAAAC,GAAgB,YAAAC,QAAwC;AAC7F,EAAAC,EAAuB,wCAAwCD,CAAU;AACzE,QAAM,EAAE,GAAAE,EAAA,IAAMC,EAAe,sCAAsC,GAE7D,EAAE,MAAMC,EAAA,IAAyBC,EAAsC;AAAA,IAC3E,4BAA4BP;AAAA,EAAA,CAC7B;AAED,MAAI,CAACM,EAAqB;AACxB,UAAM,IAAI,MAAMF,EAAE,6BAA6B,CAAC;AAGlD,QAAMI,IAAYF,EAAqB,uBAAuB,aAExD,EAAE,MAAMG,EAAA,IAAmBC,EAA2B,EAAE,aAAaF,GAAW,GAChFG,IAAcF,EAAe,kBAAkB,CAAA,GAE/CG,IAAUN,EAAqB,uBAAuB,oBAAoB;AAAA,IAC9E,CAAAO,MAAKA,EAAE,mBAAmBZ;AAAA,EAAA;AAG5B,MAAI,CAACW;AACH,UAAM,IAAI,MAAMR,EAAE,wBAAwB,CAAC;AAI7C,QAAM,EAAE,MAAMU,EAAA,IAAoBC;AAAA,IAChC;AAAA,MACE,uBAAuBH,EAAQ;AAAA,IAAA;AAAA,IAEjC;AAAA,MACE,OAAO;AAAA,MACP,cAAc,CAACI,MAET,EAAAA,aAAiBC,KAAYD,EAAM,SAAS,SAAS,WAAW;AAAA,IAItE;AAAA,EACF,GAEIE,IAAaP,EAAY,KAAK,CAAAQ,MAAKA,EAAE,SAASlB,CAAc;AAClE,MAAI,CAACiB;AACH,UAAM,IAAI,MAAMd,EAAE,2BAA2B,CAAC;AAGhD,SACE,gBAAAP;AAAA,IAACuB;AAAA,IAAA;AAAA,MACC,SAAAR;AAAA,MACA,YAAAM;AAAA,MACA,gBAAgBJ,GAAiB;AAAA,MACjC,WAAWR,EAAqB,uBAAuB,aAAa;AAAA,IAAA;AAAA,EAAA;AAG1E;"}
@@ -0,0 +1,11 @@
1
+ import { ContractorPaymentForGroup } from '@gusto/embedded-api/models/components/contractorpaymentforgroup';
2
+ import { Contractor } from '@gusto/embedded-api/models/components/contractor';
3
+ import { ContractorPaymentReceipt } from '@gusto/embedded-api/models/components/contractorpaymentreceipt';
4
+ interface PaymentStatementPresentationProps {
5
+ payment: ContractorPaymentForGroup;
6
+ contractor: Contractor;
7
+ paymentReceipt?: ContractorPaymentReceipt;
8
+ checkDate: string;
9
+ }
10
+ export declare const PaymentStatementPresentation: ({ payment, contractor, checkDate, paymentReceipt, }: PaymentStatementPresentationProps) => import("react/jsx-runtime").JSX.Element;
11
+ export {};