@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,5 +1,5 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import { useState as m, useMemo as S } from "react";
1
+ import { jsx as c } from "react/jsx-runtime";
2
+ import { useState as u, useMemo as S } from "react";
3
3
  import { usePayrollsListSuspense as f } from "@gusto/embedded-api/react-query/payrollsList";
4
4
  import { usePayrollsCancelMutation as I } from "@gusto/embedded-api/react-query/payrollsCancel";
5
5
  import { useWireInRequestsListSuspense as L } from "@gusto/embedded-api/react-query/wireInRequestsList";
@@ -7,10 +7,10 @@ import { ProcessingStatuses as M } from "@gusto/embedded-api/models/operations/g
7
7
  import { PayrollHistoryPresentation as V } from "./PayrollHistoryPresentation.js";
8
8
  import { BaseComponent as _ } from "../../Base/Base.js";
9
9
  import { useBase as E } from "../../Base/useBase.js";
10
- import { componentEvents as l } from "../../../shared/constants.js";
10
+ import { componentEvents as i } from "../../../shared/constants.js";
11
11
  import { useComponentDictionary as F, useI18n as A } from "../../../i18n/I18n.js";
12
12
  function K(e) {
13
- return /* @__PURE__ */ r(_, { ...e, children: /* @__PURE__ */ r(O, { ...e, children: e.children }) });
13
+ return /* @__PURE__ */ c(_, { ...e, children: /* @__PURE__ */ c(O, { ...e, children: e.children }) });
14
14
  }
15
15
  const H = (e) => {
16
16
  const t = /* @__PURE__ */ new Date(), o = /* @__PURE__ */ new Date();
@@ -31,50 +31,50 @@ const H = (e) => {
31
31
  };
32
32
  }, O = ({ onEvent: e, companyId: t, dictionary: o }) => {
33
33
  F("Payroll.PayrollHistory", o), A("Payroll.PayrollHistory");
34
- const [n, u] = m("3months"), [y, s] = m(null), { baseSubmitHandler: p } = E(), i = S(() => H(n), [n]), { data: d } = f({
34
+ const [l, y] = u("3months"), [p, r] = u(null), { baseSubmitHandler: d } = E(), m = S(() => H(l), [l]), { data: D } = f({
35
35
  companyId: t,
36
36
  processingStatuses: [M.Processed],
37
- startDate: i.startDate,
38
- endDate: i.endDate,
37
+ startDate: m.startDate,
38
+ endDate: m.endDate,
39
39
  include: ["totals"]
40
- }), { data: D } = L({
40
+ }), { data: P } = L({
41
41
  companyUuid: t
42
- }), P = D.wireInRequestList ?? [], { mutateAsync: g, isPending: h } = I(), R = d.payrollList || [];
43
- return /* @__PURE__ */ r(
42
+ }), g = P.wireInRequestList ?? [], { mutateAsync: h, isPending: R } = I(), w = D.payrollList || [];
43
+ return /* @__PURE__ */ c(
44
44
  V,
45
45
  {
46
- payrollHistory: R,
47
- wireInRequests: P,
48
- selectedTimeFilter: n,
49
- onTimeFilterChange: u,
50
- onViewSummary: (a) => {
51
- e(l.RUN_PAYROLL_SUMMARY_VIEWED, { payrollId: a });
46
+ payrollHistory: w,
47
+ wireInRequests: g,
48
+ selectedTimeFilter: l,
49
+ onTimeFilterChange: y,
50
+ onViewSummary: (a, s, n) => {
51
+ e(i.RUN_PAYROLL_SUMMARY_VIEWED, { payrollId: a, startDate: s, endDate: n });
52
52
  },
53
- onViewReceipt: (a) => {
54
- e(l.RUN_PAYROLL_RECEIPT_VIEWED, { payrollId: a });
53
+ onViewReceipt: (a, s, n) => {
54
+ e(i.RUN_PAYROLL_RECEIPT_VIEWED, { payrollId: a, startDate: s, endDate: n });
55
55
  },
56
56
  onCancelPayroll: async (a) => {
57
- const w = a.payrollUuid || a.uuid;
57
+ const s = a.payrollUuid || a.uuid;
58
58
  try {
59
- await p(w, async (c) => {
60
- const C = await g({
59
+ await d(s, async (n) => {
60
+ const C = await h({
61
61
  request: {
62
62
  companyId: t,
63
- payrollId: c
63
+ payrollId: n
64
64
  }
65
65
  });
66
- e(l.RUN_PAYROLL_CANCELLED, { payrollId: c, result: C });
66
+ e(i.RUN_PAYROLL_CANCELLED, { payrollId: n, result: C });
67
67
  });
68
68
  } finally {
69
- s(null);
69
+ r(null);
70
70
  }
71
71
  },
72
- cancelDialogItem: y,
73
- onCancelDialogOpen: s,
72
+ cancelDialogItem: p,
73
+ onCancelDialogOpen: r,
74
74
  onCancelDialogClose: () => {
75
- s(null);
75
+ r(null);
76
76
  },
77
- isLoading: h
77
+ isLoading: R
78
78
  }
79
79
  );
80
80
  };
@@ -1 +1 @@
1
- {"version":3,"file":"PayrollHistory.js","sources":["../../../../src/components/Payroll/PayrollHistory/PayrollHistory.tsx"],"sourcesContent":["import { useState, useMemo } from 'react'\nimport { usePayrollsListSuspense } from '@gusto/embedded-api/react-query/payrollsList'\nimport { usePayrollsCancelMutation } from '@gusto/embedded-api/react-query/payrollsCancel'\nimport { useWireInRequestsListSuspense } from '@gusto/embedded-api/react-query/wireInRequestsList'\nimport { ProcessingStatuses } from '@gusto/embedded-api/models/operations/getv1companiescompanyidpayrolls'\nimport type { Payroll } from '@gusto/embedded-api/models/components/payroll'\nimport { PayrollHistoryPresentation } from './PayrollHistoryPresentation'\nimport type { BaseComponentInterface } from '@/components/Base/Base'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { componentEvents } from '@/shared/constants'\nimport { useComponentDictionary, useI18n } from '@/i18n'\n\nexport type TimeFilterOption = '3months' | '6months' | 'year'\n\nexport interface PayrollHistoryProps extends BaseComponentInterface<'Payroll.PayrollHistory'> {\n companyId: string\n}\n\nexport function PayrollHistory(props: PayrollHistoryProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nconst getDateRangeForFilter = (\n filter: TimeFilterOption,\n): { startDate: string; endDate: string } => {\n const now = new Date()\n const startDate = new Date()\n\n switch (filter) {\n case '3months':\n startDate.setMonth(now.getMonth() - 3)\n break\n case '6months':\n startDate.setMonth(now.getMonth() - 6)\n break\n case 'year':\n startDate.setFullYear(now.getFullYear() - 1)\n break\n }\n\n return {\n startDate: startDate.toISOString().split('T')[0] || '',\n endDate: now.toISOString().split('T')[0] || '',\n }\n}\n\nexport const Root = ({ onEvent, companyId, dictionary }: PayrollHistoryProps) => {\n useComponentDictionary('Payroll.PayrollHistory', dictionary)\n useI18n('Payroll.PayrollHistory')\n\n const [selectedTimeFilter, setSelectedTimeFilter] = useState<TimeFilterOption>('3months')\n const [cancelDialogItem, setCancelDialogItem] = useState<Payroll | null>(null)\n const { baseSubmitHandler } = useBase()\n\n const dateRange = useMemo(() => getDateRangeForFilter(selectedTimeFilter), [selectedTimeFilter])\n\n const { data: payrollsData } = usePayrollsListSuspense({\n companyId,\n processingStatuses: [ProcessingStatuses.Processed],\n startDate: dateRange.startDate,\n endDate: dateRange.endDate,\n include: ['totals'],\n })\n\n const { data: wireInRequestsData } = useWireInRequestsListSuspense({\n companyUuid: companyId,\n })\n\n const wireInRequests = wireInRequestsData.wireInRequestList ?? []\n\n const { mutateAsync: cancelPayroll, isPending: isCancelling } = usePayrollsCancelMutation()\n\n const payrollHistory = payrollsData.payrollList || []\n\n const handleViewSummary = (payrollId: string) => {\n onEvent(componentEvents.RUN_PAYROLL_SUMMARY_VIEWED, { payrollId })\n }\n\n const handleViewReceipt = (payrollId: string) => {\n onEvent(componentEvents.RUN_PAYROLL_RECEIPT_VIEWED, { payrollId })\n }\n\n const handleCancelPayroll = async (item: Payroll) => {\n const payrollId = item.payrollUuid || item.uuid!\n try {\n await baseSubmitHandler(payrollId, async id => {\n const result = await cancelPayroll({\n request: {\n companyId,\n payrollId: id,\n },\n })\n\n onEvent(componentEvents.RUN_PAYROLL_CANCELLED, { payrollId: id, result })\n })\n } finally {\n setCancelDialogItem(null)\n }\n }\n\n return (\n <PayrollHistoryPresentation\n payrollHistory={payrollHistory}\n wireInRequests={wireInRequests}\n selectedTimeFilter={selectedTimeFilter}\n onTimeFilterChange={setSelectedTimeFilter}\n onViewSummary={handleViewSummary}\n onViewReceipt={handleViewReceipt}\n onCancelPayroll={handleCancelPayroll}\n cancelDialogItem={cancelDialogItem}\n onCancelDialogOpen={setCancelDialogItem}\n onCancelDialogClose={() => {\n setCancelDialogItem(null)\n }}\n isLoading={isCancelling}\n />\n )\n}\n"],"names":["PayrollHistory","props","jsx","BaseComponent","Root","getDateRangeForFilter","filter","now","startDate","onEvent","companyId","dictionary","useComponentDictionary","useI18n","selectedTimeFilter","setSelectedTimeFilter","useState","cancelDialogItem","setCancelDialogItem","baseSubmitHandler","useBase","dateRange","useMemo","payrollsData","usePayrollsListSuspense","ProcessingStatuses","wireInRequestsData","useWireInRequestsListSuspense","wireInRequests","cancelPayroll","isCancelling","usePayrollsCancelMutation","payrollHistory","PayrollHistoryPresentation","payrollId","componentEvents","item","id","result"],"mappings":";;;;;;;;;;;AAmBO,SAASA,EAAeC,GAA4B;AACzD,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,MAAMI,IAAwB,CAC5BC,MAC2C;AAC3C,QAAMC,wBAAU,KAAA,GACVC,wBAAgB,KAAA;AAEtB,UAAQF,GAAA;AAAA,IACN,KAAK;AACH,MAAAE,EAAU,SAASD,EAAI,SAAA,IAAa,CAAC;AACrC;AAAA,IACF,KAAK;AACH,MAAAC,EAAU,SAASD,EAAI,SAAA,IAAa,CAAC;AACrC;AAAA,IACF,KAAK;AACH,MAAAC,EAAU,YAAYD,EAAI,YAAA,IAAgB,CAAC;AAC3C;AAAA,EAAA;AAGJ,SAAO;AAAA,IACL,WAAWC,EAAU,YAAA,EAAc,MAAM,GAAG,EAAE,CAAC,KAAK;AAAA,IACpD,SAASD,EAAI,YAAA,EAAc,MAAM,GAAG,EAAE,CAAC,KAAK;AAAA,EAAA;AAEhD,GAEaH,IAAO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AMC,IAAS,MAAMT,EAAc;AAAA,cACjC,SAAS;AAAA,gBACP,WAAAnB;AAAA,gBACA,WAAW2B;AAAA,cAAA;AAAA,YACb,CACD;AAED,YAAA5B,EAAQ0B,EAAgB,uBAAuB,EAAE,WAAWE,GAAI,QAAAC,GAAQ;AAAA,UAC1E,CAAC;AAAA,QACH,UAAA;AACE,UAAApB,EAAoB,IAAI;AAAA,QAC1B;AAAA,MACF;AAAA,MAWI,kBAAAD;AAAA,MACA,oBAAoBC;AAAA,MACpB,qBAAqB,MAAM;AACzB,QAAAA,EAAoB,IAAI;AAAA,MAC1B;AAAA,MACA,WAAWY;AAAA,IAAA;AAAA,EAAA;AAGjB;"}
1
+ {"version":3,"file":"PayrollHistory.js","sources":["../../../../src/components/Payroll/PayrollHistory/PayrollHistory.tsx"],"sourcesContent":["import { useState, useMemo } from 'react'\nimport { usePayrollsListSuspense } from '@gusto/embedded-api/react-query/payrollsList'\nimport { usePayrollsCancelMutation } from '@gusto/embedded-api/react-query/payrollsCancel'\nimport { useWireInRequestsListSuspense } from '@gusto/embedded-api/react-query/wireInRequestsList'\nimport { ProcessingStatuses } from '@gusto/embedded-api/models/operations/getv1companiescompanyidpayrolls'\nimport type { Payroll } from '@gusto/embedded-api/models/components/payroll'\nimport { PayrollHistoryPresentation } from './PayrollHistoryPresentation'\nimport type { BaseComponentInterface } from '@/components/Base/Base'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { componentEvents } from '@/shared/constants'\nimport { useComponentDictionary, useI18n } from '@/i18n'\n\nexport type TimeFilterOption = '3months' | '6months' | 'year'\n\nexport interface PayrollHistoryProps extends BaseComponentInterface<'Payroll.PayrollHistory'> {\n companyId: string\n}\n\nexport function PayrollHistory(props: PayrollHistoryProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nconst getDateRangeForFilter = (\n filter: TimeFilterOption,\n): { startDate: string; endDate: string } => {\n const now = new Date()\n const startDate = new Date()\n\n switch (filter) {\n case '3months':\n startDate.setMonth(now.getMonth() - 3)\n break\n case '6months':\n startDate.setMonth(now.getMonth() - 6)\n break\n case 'year':\n startDate.setFullYear(now.getFullYear() - 1)\n break\n }\n\n return {\n startDate: startDate.toISOString().split('T')[0] || '',\n endDate: now.toISOString().split('T')[0] || '',\n }\n}\n\nexport const Root = ({ onEvent, companyId, dictionary }: PayrollHistoryProps) => {\n useComponentDictionary('Payroll.PayrollHistory', dictionary)\n useI18n('Payroll.PayrollHistory')\n\n const [selectedTimeFilter, setSelectedTimeFilter] = useState<TimeFilterOption>('3months')\n const [cancelDialogItem, setCancelDialogItem] = useState<Payroll | null>(null)\n const { baseSubmitHandler } = useBase()\n\n const dateRange = useMemo(() => getDateRangeForFilter(selectedTimeFilter), [selectedTimeFilter])\n\n const { data: payrollsData } = usePayrollsListSuspense({\n companyId,\n processingStatuses: [ProcessingStatuses.Processed],\n startDate: dateRange.startDate,\n endDate: dateRange.endDate,\n include: ['totals'],\n })\n\n const { data: wireInRequestsData } = useWireInRequestsListSuspense({\n companyUuid: companyId,\n })\n\n const wireInRequests = wireInRequestsData.wireInRequestList ?? []\n\n const { mutateAsync: cancelPayroll, isPending: isCancelling } = usePayrollsCancelMutation()\n\n const payrollHistory = payrollsData.payrollList || []\n\n const handleViewSummary = (payrollId: string, startDate?: string, endDate?: string) => {\n onEvent(componentEvents.RUN_PAYROLL_SUMMARY_VIEWED, { payrollId, startDate, endDate })\n }\n\n const handleViewReceipt = (payrollId: string, startDate?: string, endDate?: string) => {\n onEvent(componentEvents.RUN_PAYROLL_RECEIPT_VIEWED, { payrollId, startDate, endDate })\n }\n\n const handleCancelPayroll = async (item: Payroll) => {\n const payrollId = item.payrollUuid || item.uuid!\n try {\n await baseSubmitHandler(payrollId, async id => {\n const result = await cancelPayroll({\n request: {\n companyId,\n payrollId: id,\n },\n })\n\n onEvent(componentEvents.RUN_PAYROLL_CANCELLED, { payrollId: id, result })\n })\n } finally {\n setCancelDialogItem(null)\n }\n }\n\n return (\n <PayrollHistoryPresentation\n payrollHistory={payrollHistory}\n wireInRequests={wireInRequests}\n selectedTimeFilter={selectedTimeFilter}\n onTimeFilterChange={setSelectedTimeFilter}\n onViewSummary={handleViewSummary}\n onViewReceipt={handleViewReceipt}\n onCancelPayroll={handleCancelPayroll}\n cancelDialogItem={cancelDialogItem}\n onCancelDialogOpen={setCancelDialogItem}\n onCancelDialogClose={() => {\n setCancelDialogItem(null)\n }}\n isLoading={isCancelling}\n />\n )\n}\n"],"names":["PayrollHistory","props","jsx","BaseComponent","Root","getDateRangeForFilter","filter","now","startDate","onEvent","companyId","dictionary","useComponentDictionary","useI18n","selectedTimeFilter","setSelectedTimeFilter","useState","cancelDialogItem","setCancelDialogItem","baseSubmitHandler","useBase","dateRange","useMemo","payrollsData","usePayrollsListSuspense","ProcessingStatuses","wireInRequestsData","useWireInRequestsListSuspense","wireInRequests","cancelPayroll","isCancelling","usePayrollsCancelMutation","payrollHistory","PayrollHistoryPresentation","payrollId","endDate","componentEvents","item","id","result"],"mappings":";;;;;;;;;;;AAmBO,SAASA,EAAeC,GAA4B;AACzD,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,MAAMI,IAAwB,CAC5BC,MAC2C;AAC3C,QAAMC,wBAAU,KAAA,GACVC,wBAAgB,KAAA;AAEtB,UAAQF,GAAA;AAAA,IACN,KAAK;AACH,MAAAE,EAAU,SAASD,EAAI,SAAA,IAAa,CAAC;AACrC;AAAA,IACF,KAAK;AACH,MAAAC,EAAU,SAASD,EAAI,SAAA,IAAa,CAAC;AACrC;AAAA,IACF,KAAK;AACH,MAAAC,EAAU,YAAYD,EAAI,YAAA,IAAgB,CAAC;AAC3C;AAAA,EAAA;AAGJ,SAAO;AAAA,IACL,WAAWC,EAAU,YAAA,EAAc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BAA4B,EAAE,WAAAF,GAAW,WAAA1B,GAAW,SAAA2B,GAAS;AAAA,MACvF;AAAA,MA4BI,iBA1BwB,OAAOE,MAAkB;AACnD,cAAMH,IAAYG,EAAK,eAAeA,EAAK;AAC3C,YAAI;AACF,gBAAMlB,EAAkBe,GAAW,OAAMI,MAAM;AAC7C,kBAAMC,IAAS,MAAMV,EAAc;AAAA,cACjC,SAAS;AAAA,gBACP,WAAAnB;AAAA,gBACA,WAAW4B;AAAA,cAAA;AAAA,YACb,CACD;AAED,YAAA7B,EAAQ2B,EAAgB,uBAAuB,EAAE,WAAWE,GAAI,QAAAC,GAAQ;AAAA,UAC1E,CAAC;AAAA,QACH,UAAA;AACE,UAAArB,EAAoB,IAAI;AAAA,QAC1B;AAAA,MACF;AAAA,MAWI,kBAAAD;AAAA,MACA,oBAAoBC;AAAA,MACpB,qBAAqB,MAAM;AACzB,QAAAA,EAAoB,IAAI;AAAA,MAC1B;AAAA,MACA,WAAWY;AAAA,IAAA;AAAA,EAAA;AAGjB;"}
@@ -6,8 +6,8 @@ interface PayrollHistoryPresentationProps {
6
6
  wireInRequests: WireInRequest[];
7
7
  selectedTimeFilter: TimeFilterOption;
8
8
  onTimeFilterChange: (value: TimeFilterOption) => void;
9
- onViewSummary: (payrollId: string) => void;
10
- onViewReceipt: (payrollId: string) => void;
9
+ onViewSummary: (payrollId: string, startDate?: string, endDate?: string) => void;
10
+ onViewReceipt: (payrollId: string, startDate?: string, endDate?: string) => void;
11
11
  onCancelPayroll: (item: Payroll) => void;
12
12
  cancelDialogItem: Payroll | null;
13
13
  onCancelDialogOpen: (item: Payroll) => void;
@@ -1,123 +1,105 @@
1
- import { jsxs as d, jsx as r } from "react/jsx-runtime";
1
+ import { jsxs as s, jsx as r } from "react/jsx-runtime";
2
2
  import { useTranslation as U } from "react-i18next";
3
- import { getPayrollType as I, calculateTotalPayroll as L } from "../helpers.js";
3
+ import { getPayrollType as L, calculateTotalPayroll as N, canCancelPayroll as O } from "../helpers.js";
4
4
  import j from "./PayrollHistoryPresentation.module.scss.js";
5
- import { Flex as c } from "../../Common/Flex/Flex.js";
5
+ import { Flex as l } from "../../Common/Flex/Flex.js";
6
6
  import "classnames";
7
- import { HamburgerMenu as V } from "../../Common/HamburgerMenu/HamburgerMenu.js";
8
- import { useComponentContext as Y } from "../../../contexts/ComponentAdapter/useComponentContext.js";
7
+ import "../../../shared/constants.js";
8
+ import { HamburgerMenu as M } from "../../Common/HamburgerMenu/HamburgerMenu.js";
9
+ import { useComponentContext as V } from "../../../contexts/ComponentAdapter/useComponentContext.js";
9
10
  import { formatNumberAsCurrency as q } from "../../../helpers/formattedStrings.js";
10
- import { useI18n as Z } from "../../../i18n/I18n.js";
11
- import { useDateFormatter as $ } from "../../../hooks/useDateFormatter.js";
12
- import B from "../../../assets/icons/trashcan.svg.js";
13
- import W from "../../../assets/icons/icon-file-outline.svg.js";
14
- import _ from "../../../assets/icons/icon-receipt-outline.svg.js";
15
- import { PayrollStatusBadges as z } from "../PayrollStatusBadges/PayrollStatusBadges.js";
16
- import { DataView as E } from "../../Common/DataView/DataView.js";
11
+ import { useI18n as I } from "../../../i18n/I18n.js";
12
+ import { useDateFormatter as Y } from "../../../hooks/useDateFormatter.js";
13
+ import Z from "../../../assets/icons/trashcan.svg.js";
14
+ import $ from "../../../assets/icons/icon-file-outline.svg.js";
15
+ import B from "../../../assets/icons/icon-receipt-outline.svg.js";
16
+ import { PayrollStatusBadges as W } from "../PayrollStatusBadges/PayrollStatusBadges.js";
17
+ import { DataView as _ } from "../../Common/DataView/DataView.js";
17
18
  const de = ({
18
- payrollHistory: y,
19
- wireInRequests: g,
20
- selectedTimeFilter: P,
21
- onTimeFilterChange: S,
22
- onViewSummary: w,
23
- onViewReceipt: b,
24
- onCancelPayroll: C,
25
- cancelDialogItem: a,
26
- onCancelDialogOpen: F,
27
- onCancelDialogClose: T,
28
- isLoading: v = !1
19
+ payrollHistory: c,
20
+ wireInRequests: p,
21
+ selectedTimeFilter: y,
22
+ onTimeFilterChange: h,
23
+ onViewSummary: f,
24
+ onViewReceipt: P,
25
+ onCancelPayroll: D,
26
+ cancelDialogItem: o,
27
+ onCancelDialogOpen: g,
28
+ onCancelDialogClose: b,
29
+ isLoading: C = !1
29
30
  }) => {
30
- const { Heading: f, Text: l, Select: x, Dialog: k } = Y();
31
- Z("Payroll.PayrollHistory");
32
- const { t } = U("Payroll.PayrollHistory"), u = $(), A = [
31
+ const { Heading: d, Text: i, Select: F, Dialog: S } = V();
32
+ I("Payroll.PayrollHistory");
33
+ const { t } = U("Payroll.PayrollHistory"), m = Y(), w = [
33
34
  { value: "3months", label: t("timeFilter.options.3months") },
34
35
  { value: "6months", label: t("timeFilter.options.6months") },
35
36
  { value: "year", label: t("timeFilter.options.year") }
36
- ], H = (e) => {
37
- if (e.payrollStatusMeta?.cancellable === !1)
38
- return !1;
39
- if (e.processed && e.payrollDeadline) {
40
- const o = /* @__PURE__ */ new Date(), n = new Date(e.payrollDeadline), i = h(o), s = new Date(o.getTime() + i * 60 * 60 * 1e3), m = new Date(
41
- n.getTime() + h(n) * 60 * 60 * 1e3
42
- );
43
- if (s.toDateString() === m.toDateString()) {
44
- const p = new Date(m);
45
- if (p.setHours(15, 30, 0, 0), s > p)
46
- return !1;
47
- }
48
- }
49
- return !0;
50
- }, h = (e) => {
51
- const o = e.getFullYear(), n = new Date(o, 2, 1);
52
- n.setDate(1 + (7 - n.getDay()) + 7);
53
- const i = new Date(o, 10, 1);
54
- return i.setDate(1 + (7 - i.getDay()) % 7), e >= n && e < i ? -7 : -8;
55
- }, O = (e) => {
56
- const o = e.payrollDeadline;
57
- if (!o) return "";
58
- const n = new Date(o), i = "America/New_York", s = new Intl.DateTimeFormat("en-US", {
37
+ ], v = (e) => {
38
+ const n = e.payrollDeadline;
39
+ if (!n) return "";
40
+ const a = new Date(n), u = "America/New_York", T = new Intl.DateTimeFormat("en-US", {
59
41
  weekday: "short",
60
42
  month: "short",
61
43
  day: "numeric",
62
- timeZone: i
63
- }), m = new Intl.DateTimeFormat("en-US", {
44
+ timeZone: u
45
+ }), R = new Intl.DateTimeFormat("en-US", {
64
46
  hour: "numeric",
65
47
  minute: "2-digit",
66
48
  timeZoneName: "short",
67
- timeZone: i
68
- }), D = s.format(n);
69
- return `${m.format(n)} on ${D}`;
70
- }, R = (e) => {
71
- F(e);
72
- }, M = () => {
73
- a && C(a);
74
- }, N = (e) => {
75
- const o = e.payrollUuid || e.uuid, n = [
49
+ timeZone: u
50
+ }), H = T.format(a);
51
+ return `${R.format(a)} on ${H}`;
52
+ }, x = (e) => {
53
+ g(e);
54
+ }, k = () => {
55
+ o && D(o);
56
+ }, A = (e) => {
57
+ const n = e.payrollUuid || e.uuid, a = [
76
58
  {
77
59
  label: t("menu.viewSummary"),
78
- icon: /* @__PURE__ */ r(W, { "aria-hidden": !0 }),
60
+ icon: /* @__PURE__ */ r($, { "aria-hidden": !0 }),
79
61
  onClick: () => {
80
- w(o);
62
+ f(n, e.payPeriod?.startDate, e.payPeriod?.endDate);
81
63
  }
82
64
  },
83
65
  {
84
66
  label: t("menu.viewReceipt"),
85
- icon: /* @__PURE__ */ r(_, { "aria-hidden": !0 }),
67
+ icon: /* @__PURE__ */ r(B, { "aria-hidden": !0 }),
86
68
  onClick: () => {
87
- b(o);
69
+ P(n, e.payPeriod?.startDate, e.payPeriod?.endDate);
88
70
  }
89
71
  }
90
72
  ];
91
- return H(e) && n.push({
73
+ return O(e) && a.push({
92
74
  label: t("menu.cancelPayroll"),
93
- icon: /* @__PURE__ */ r(B, { "aria-hidden": !0 }),
75
+ icon: /* @__PURE__ */ r(Z, { "aria-hidden": !0 }),
94
76
  onClick: () => {
95
- R(e);
77
+ x(e);
96
78
  },
97
79
  "data-destructive": "true"
98
- }), n;
80
+ }), a;
99
81
  };
100
- return y.length === 0 ? /* @__PURE__ */ d(c, { flexDirection: "column", alignItems: "center", gap: 24, children: [
101
- /* @__PURE__ */ r(f, { as: "h3", children: t("emptyState.title") }),
102
- /* @__PURE__ */ r(l, { children: t("emptyState.description") })
103
- ] }) : /* @__PURE__ */ d(c, { flexDirection: "column", gap: 16, children: [
104
- /* @__PURE__ */ d(
105
- c,
82
+ return c.length === 0 ? /* @__PURE__ */ s(l, { flexDirection: "column", alignItems: "center", gap: 24, children: [
83
+ /* @__PURE__ */ r(d, { as: "h3", children: t("emptyState.title") }),
84
+ /* @__PURE__ */ r(i, { children: t("emptyState.description") })
85
+ ] }) : /* @__PURE__ */ s(l, { flexDirection: "column", gap: 16, children: [
86
+ /* @__PURE__ */ s(
87
+ l,
106
88
  {
107
89
  flexDirection: { base: "column", medium: "row" },
108
90
  justifyContent: "space-between",
109
91
  alignItems: "flex-start",
110
92
  gap: { base: 12, medium: 24 },
111
93
  children: [
112
- /* @__PURE__ */ r(c, { children: /* @__PURE__ */ r(f, { as: "h2", children: t("title") }) }),
94
+ /* @__PURE__ */ r(l, { children: /* @__PURE__ */ r(d, { as: "h2", children: t("title") }) }),
113
95
  /* @__PURE__ */ r("div", { className: j.timeFilterContainer, children: /* @__PURE__ */ r(
114
- x,
96
+ F,
115
97
  {
116
- value: P,
98
+ value: y,
117
99
  onChange: (e) => {
118
- S(e);
100
+ h(e);
119
101
  },
120
- options: A,
102
+ options: w,
121
103
  label: t("timeFilter.placeholder"),
122
104
  shouldVisuallyHideLabel: !0,
123
105
  isRequired: !0
@@ -127,63 +109,63 @@ const de = ({
127
109
  }
128
110
  ),
129
111
  /* @__PURE__ */ r(
130
- E,
112
+ _,
131
113
  {
132
114
  label: t("dataView.label"),
133
115
  columns: [
134
116
  {
135
117
  title: t("columns.payPeriod"),
136
- render: (e) => /* @__PURE__ */ r(l, { children: u.formatPayPeriodRange(
118
+ render: (e) => /* @__PURE__ */ r(i, { children: m.formatPayPeriodRange(
137
119
  e.payPeriod?.startDate,
138
120
  e.payPeriod?.endDate
139
121
  ) })
140
122
  },
141
123
  {
142
124
  title: t("columns.type"),
143
- render: (e) => /* @__PURE__ */ r(l, { children: I(e) })
125
+ render: (e) => /* @__PURE__ */ r(i, { children: L(e) })
144
126
  },
145
127
  {
146
128
  title: t("columns.payDate"),
147
- render: (e) => /* @__PURE__ */ r(l, { children: u.formatShortWithYear(e.checkDate) })
129
+ render: (e) => /* @__PURE__ */ r(i, { children: m.formatShortWithYear(e.checkDate) })
148
130
  },
149
131
  {
150
132
  title: t("columns.status"),
151
133
  render: (e) => {
152
- const o = g.find(
153
- (n) => n.paymentUuid === e.payrollUuid
134
+ const n = p.find(
135
+ (a) => a.paymentUuid === e.payrollUuid
154
136
  );
155
- return /* @__PURE__ */ r(z, { payroll: e, wireInRequest: o });
137
+ return /* @__PURE__ */ r(W, { payroll: e, wireInRequest: n });
156
138
  }
157
139
  },
158
140
  {
159
141
  title: t("columns.totalPayroll"),
160
- render: (e) => /* @__PURE__ */ r(l, { weight: "semibold", children: q(L(e)) })
142
+ render: (e) => /* @__PURE__ */ r(i, { weight: "semibold", children: q(N(e)) })
161
143
  }
162
144
  ],
163
- data: y,
164
- itemMenu: (e) => /* @__PURE__ */ r(V, { items: N(e) })
145
+ data: c,
146
+ itemMenu: (e) => /* @__PURE__ */ r(M, { items: A(e) })
165
147
  }
166
148
  ),
167
149
  /* @__PURE__ */ r(
168
- k,
150
+ S,
169
151
  {
170
- isOpen: !!a,
171
- onClose: T,
172
- onPrimaryActionClick: M,
152
+ isOpen: !!o,
153
+ onClose: b,
154
+ onPrimaryActionClick: k,
173
155
  isDestructive: !0,
174
- isPrimaryActionLoading: v,
156
+ isPrimaryActionLoading: C,
175
157
  primaryActionLabel: t("cancelDialog.primaryAction"),
176
158
  closeActionLabel: t("cancelDialog.secondaryAction"),
177
- title: a ? t("cancelDialog.title", {
178
- payPeriod: u.formatPayPeriodRange(
179
- a.payPeriod?.startDate,
180
- a.payPeriod?.endDate
159
+ title: o ? t("cancelDialog.title", {
160
+ payPeriod: m.formatPayPeriodRange(
161
+ o.payPeriod?.startDate,
162
+ o.payPeriod?.endDate
181
163
  )
182
164
  }) : "",
183
- children: a && /* @__PURE__ */ d(c, { flexDirection: "column", gap: 16, children: [
184
- /* @__PURE__ */ r(l, { children: t("cancelDialog.body") }),
185
- a.payrollDeadline && /* @__PURE__ */ r(l, { children: t("cancelDialog.deadline", {
186
- deadline: O(a)
165
+ children: o && /* @__PURE__ */ s(l, { flexDirection: "column", gap: 16, children: [
166
+ /* @__PURE__ */ r(i, { children: t("cancelDialog.body") }),
167
+ o.payrollDeadline && /* @__PURE__ */ r(i, { children: t("cancelDialog.deadline", {
168
+ deadline: v(o)
187
169
  }) })
188
170
  ] })
189
171
  }
@@ -1 +1 @@
1
- {"version":3,"file":"PayrollHistoryPresentation.js","sources":["../../../../src/components/Payroll/PayrollHistory/PayrollHistoryPresentation.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type { Payroll } from '@gusto/embedded-api/models/components/payroll'\nimport type { WireInRequest } from '@gusto/embedded-api/models/components/wireinrequest'\nimport { PayrollStatusBadges } from '../PayrollStatusBadges'\nimport { getPayrollType, calculateTotalPayroll } from '../helpers'\nimport type { TimeFilterOption } from './PayrollHistory'\nimport styles from './PayrollHistoryPresentation.module.scss'\nimport type { MenuItem } from '@/components/Common/UI/Menu/MenuTypes'\nimport { DataView, Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\nimport { formatNumberAsCurrency } from '@/helpers/formattedStrings'\nimport { useI18n } from '@/i18n'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\nimport TrashcanIcon from '@/assets/icons/trashcan.svg?react'\nimport FileIcon from '@/assets/icons/icon-file-outline.svg?react'\nimport ReceiptIcon from '@/assets/icons/icon-receipt-outline.svg?react'\n\ninterface PayrollHistoryPresentationProps {\n payrollHistory: Payroll[]\n wireInRequests: WireInRequest[]\n selectedTimeFilter: TimeFilterOption\n onTimeFilterChange: (value: TimeFilterOption) => void\n onViewSummary: (payrollId: string) => void\n onViewReceipt: (payrollId: string) => void\n onCancelPayroll: (item: Payroll) => void\n cancelDialogItem: Payroll | null\n onCancelDialogOpen: (item: Payroll) => void\n onCancelDialogClose: () => void\n isLoading?: boolean\n}\n\nexport const PayrollHistoryPresentation = ({\n payrollHistory,\n wireInRequests,\n selectedTimeFilter,\n onTimeFilterChange,\n onViewSummary,\n onViewReceipt,\n onCancelPayroll,\n cancelDialogItem,\n onCancelDialogOpen,\n onCancelDialogClose,\n isLoading = false,\n}: PayrollHistoryPresentationProps) => {\n const { Heading, Text, Select, Dialog } = useComponentContext()\n useI18n('Payroll.PayrollHistory')\n const { t } = useTranslation('Payroll.PayrollHistory')\n const dateFormatter = useDateFormatter()\n\n const timeFilterOptions = [\n { value: '3months', label: t('timeFilter.options.3months') },\n { value: '6months', label: t('timeFilter.options.6months') },\n { value: 'year', label: t('timeFilter.options.year') },\n ]\n\n const canCancelPayroll = (item: Payroll) => {\n if (item.payrollStatusMeta?.cancellable === false) {\n return false\n }\n\n if (item.processed && item.payrollDeadline) {\n const now = new Date()\n const deadline = new Date(item.payrollDeadline)\n\n const ptOffset = getPacificTimeOffset(now)\n const nowInPT = new Date(now.getTime() + ptOffset * 60 * 60 * 1000)\n const deadlineInPT = new Date(\n deadline.getTime() + getPacificTimeOffset(deadline) * 60 * 60 * 1000,\n )\n\n const isSameDay = nowInPT.toDateString() === deadlineInPT.toDateString()\n if (isSameDay) {\n const cutoffTime = new Date(deadlineInPT)\n cutoffTime.setHours(15, 30, 0, 0)\n\n if (nowInPT > cutoffTime) {\n return false\n }\n }\n }\n\n return true\n }\n\n const getPacificTimeOffset = (date: Date): number => {\n const year = date.getFullYear()\n\n const secondSundayMarch = new Date(year, 2, 1)\n secondSundayMarch.setDate(1 + (7 - secondSundayMarch.getDay()) + 7)\n\n const firstSundayNovember = new Date(year, 10, 1)\n firstSundayNovember.setDate(1 + ((7 - firstSundayNovember.getDay()) % 7))\n\n const isDST = date >= secondSundayMarch && date < firstSundayNovember\n return isDST ? -7 : -8\n }\n\n const formatDeadlineForDialog = (item: Payroll): string => {\n const deadline = item.payrollDeadline\n if (!deadline) return ''\n\n const deadlineDate = new Date(deadline)\n const timeZone = 'America/New_York'\n\n const formatter = new Intl.DateTimeFormat('en-US', {\n weekday: 'short',\n month: 'short',\n day: 'numeric',\n timeZone,\n })\n\n const timeFormatter = new Intl.DateTimeFormat('en-US', {\n hour: 'numeric',\n minute: '2-digit',\n timeZoneName: 'short',\n timeZone,\n })\n\n const dateStr = formatter.format(deadlineDate)\n const timeStr = timeFormatter.format(deadlineDate)\n\n return `${timeStr} on ${dateStr}`\n }\n\n const handleCancelClick = (item: Payroll) => {\n onCancelDialogOpen(item)\n }\n\n const handleConfirmCancel = () => {\n if (cancelDialogItem) {\n onCancelPayroll(cancelDialogItem)\n }\n }\n\n const getMenuItems = (item: Payroll): MenuItem[] => {\n const payrollId = item.payrollUuid || item.uuid!\n const items: MenuItem[] = [\n {\n label: t('menu.viewSummary'),\n icon: <FileIcon aria-hidden />,\n onClick: () => {\n onViewSummary(payrollId)\n },\n },\n {\n label: t('menu.viewReceipt'),\n icon: <ReceiptIcon aria-hidden />,\n onClick: () => {\n onViewReceipt(payrollId)\n },\n },\n ]\n\n if (canCancelPayroll(item)) {\n items.push({\n label: t('menu.cancelPayroll'),\n icon: <TrashcanIcon aria-hidden />,\n onClick: () => {\n handleCancelClick(item)\n },\n 'data-destructive': 'true',\n })\n }\n\n return items\n }\n\n if (payrollHistory.length === 0) {\n return (\n <Flex flexDirection=\"column\" alignItems=\"center\" gap={24}>\n <Heading as=\"h3\">{t('emptyState.title')}</Heading>\n <Text>{t('emptyState.description')}</Text>\n </Flex>\n )\n }\n\n return (\n <Flex flexDirection=\"column\" gap={16}>\n <Flex\n flexDirection={{ base: 'column', medium: 'row' }}\n justifyContent=\"space-between\"\n alignItems=\"flex-start\"\n gap={{ base: 12, medium: 24 }}\n >\n <Flex>\n <Heading as=\"h2\">{t('title')}</Heading>\n </Flex>\n <div className={styles.timeFilterContainer}>\n <Select\n value={selectedTimeFilter}\n onChange={(value: string) => {\n onTimeFilterChange(value as TimeFilterOption)\n }}\n options={timeFilterOptions}\n label={t('timeFilter.placeholder')}\n shouldVisuallyHideLabel\n isRequired\n />\n </div>\n </Flex>\n\n <DataView\n label={t('dataView.label')}\n columns={[\n {\n title: t('columns.payPeriod'),\n render: (item: Payroll) => (\n <Text>\n {dateFormatter.formatPayPeriodRange(\n item.payPeriod?.startDate,\n item.payPeriod?.endDate,\n )}\n </Text>\n ),\n },\n {\n title: t('columns.type'),\n render: (item: Payroll) => <Text>{getPayrollType(item)}</Text>,\n },\n {\n title: t('columns.payDate'),\n render: (item: Payroll) => (\n <Text>{dateFormatter.formatShortWithYear(item.checkDate)}</Text>\n ),\n },\n {\n title: t('columns.status'),\n render: (item: Payroll) => {\n const wireInRequest = wireInRequests.find(\n wire => wire.paymentUuid === item.payrollUuid,\n )\n return <PayrollStatusBadges payroll={item} wireInRequest={wireInRequest} />\n },\n },\n {\n title: t('columns.totalPayroll'),\n render: (item: Payroll) => (\n <Text weight=\"semibold\">{formatNumberAsCurrency(calculateTotalPayroll(item))}</Text>\n ),\n },\n ]}\n data={payrollHistory}\n itemMenu={(item: Payroll) => <HamburgerMenu items={getMenuItems(item)} />}\n />\n\n <Dialog\n isOpen={!!cancelDialogItem}\n onClose={onCancelDialogClose}\n onPrimaryActionClick={handleConfirmCancel}\n isDestructive\n isPrimaryActionLoading={isLoading}\n primaryActionLabel={t('cancelDialog.primaryAction')}\n closeActionLabel={t('cancelDialog.secondaryAction')}\n title={\n cancelDialogItem\n ? t('cancelDialog.title', {\n payPeriod: dateFormatter.formatPayPeriodRange(\n cancelDialogItem.payPeriod?.startDate,\n cancelDialogItem.payPeriod?.endDate,\n ),\n })\n : ''\n }\n >\n {cancelDialogItem && (\n <Flex flexDirection=\"column\" gap={16}>\n <Text>{t('cancelDialog.body')}</Text>\n {cancelDialogItem.payrollDeadline && (\n <Text>\n {t('cancelDialog.deadline', {\n deadline: formatDeadlineForDialog(cancelDialogItem),\n })}\n </Text>\n )}\n </Flex>\n )}\n </Dialog>\n </Flex>\n )\n}\n"],"names":["PayrollHistoryPresentation","payrollHistory","wireInRequests","selectedTimeFilter","onTimeFilterChange","onViewSummary","onViewReceipt","onCancelPayroll","cancelDialogItem","onCancelDialogOpen","onCancelDialogClose","isLoading","Heading","Text","Select","Dialog","useComponentContext","useI18n","useTranslation","dateFormatter","useDateFormatter","timeFilterOptions","canCancelPayroll","item","now","deadline","ptOffset","getPacificTimeOffset","nowInPT","deadlineInPT","cutoffTime","date","year","secondSundayMarch","firstSundayNovember","formatDeadlineForDialog","deadlineDate","timeZone","formatter","timeFormatter","dateStr","handleCancelClick","handleConfirmCancel","getMenuItems","payrollId","items","jsx","FileIcon","ReceiptIcon","TrashcanIcon","Flex","jsxs","styles","value","DataView","getPayrollType","wireInRequest","wire","PayrollStatusBadges","formatNumberAsCurrency","calculateTotalPayroll","HamburgerMenu"],"mappings":";;;;;;;;;;;;;;;;AAgCO,MAAMA,KAA6B,CAAC;AAAA,EACzC,gBAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,eAAAC;AAAA,EACA,eAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,qBAAAC;AAAA,EACA,WAAAC,IAAY;AACd,MAAuC;AACrC,QAAM,EAAE,SAAAC,GAAS,MAAAC,GAAM,QAAAC,GAAQ,QAAAC,EAAA,IAAWC,EAAA;AAC1C,EAAAC,EAAQ,wBAAwB;AAChC,QAAM,EAAE,EAAA,IAAMC,EAAe,wBAAwB,GAC/CC,IAAgBC,EAAA,GAEhBC,IAAoB;AAAA,IACxB,EAAE,OAAO,WAAW,OAAO,EAAE,4BAA4B,EAAA;AAAA,IACzD,EAAE,OAAO,WAAW,OAAO,EAAE,4BAA4B,EAAA;AAAA,IACzD,EAAE,OAAO,QAAQ,OAAO,EAAE,yBAAyB,EAAA;AAAA,E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C,UAAA;AAAA,UAAA,gBAAAJ,EAACjC,GAAA,EAAM,UAAA,EAAE,mBAAmB,EAAA,CAAE;AAAA,UAC7BL,EAAiB,mBAChB,gBAAAsC,EAACjC,GAAA,EACE,YAAE,yBAAyB;AAAA,YAC1B,UAAUsB,EAAwB3B,CAAgB;AAAA,UAAA,CACnD,EAAA,CACH;AAAA,QAAA,EAAA,CAEJ;AAAA,MAAA;AAAA,IAAA;AAAA,EAEJ,GACF;AAEJ;"}
1
+ {"version":3,"file":"PayrollHistoryPresentation.js","sources":["../../../../src/components/Payroll/PayrollHistory/PayrollHistoryPresentation.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type { Payroll } from '@gusto/embedded-api/models/components/payroll'\nimport type { WireInRequest } from '@gusto/embedded-api/models/components/wireinrequest'\nimport { PayrollStatusBadges } from '../PayrollStatusBadges'\nimport { getPayrollType, calculateTotalPayroll, canCancelPayroll } from '../helpers'\nimport type { TimeFilterOption } from './PayrollHistory'\nimport styles from './PayrollHistoryPresentation.module.scss'\nimport type { MenuItem } from '@/components/Common/UI/Menu/MenuTypes'\nimport { DataView, Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\nimport { formatNumberAsCurrency } from '@/helpers/formattedStrings'\nimport { useI18n } from '@/i18n'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\nimport TrashcanIcon from '@/assets/icons/trashcan.svg?react'\nimport FileIcon from '@/assets/icons/icon-file-outline.svg?react'\nimport ReceiptIcon from '@/assets/icons/icon-receipt-outline.svg?react'\n\ninterface PayrollHistoryPresentationProps {\n payrollHistory: Payroll[]\n wireInRequests: WireInRequest[]\n selectedTimeFilter: TimeFilterOption\n onTimeFilterChange: (value: TimeFilterOption) => void\n onViewSummary: (payrollId: string, startDate?: string, endDate?: string) => void\n onViewReceipt: (payrollId: string, startDate?: string, endDate?: string) => void\n onCancelPayroll: (item: Payroll) => void\n cancelDialogItem: Payroll | null\n onCancelDialogOpen: (item: Payroll) => void\n onCancelDialogClose: () => void\n isLoading?: boolean\n}\n\nexport const PayrollHistoryPresentation = ({\n payrollHistory,\n wireInRequests,\n selectedTimeFilter,\n onTimeFilterChange,\n onViewSummary,\n onViewReceipt,\n onCancelPayroll,\n cancelDialogItem,\n onCancelDialogOpen,\n onCancelDialogClose,\n isLoading = false,\n}: PayrollHistoryPresentationProps) => {\n const { Heading, Text, Select, Dialog } = useComponentContext()\n useI18n('Payroll.PayrollHistory')\n const { t } = useTranslation('Payroll.PayrollHistory')\n const dateFormatter = useDateFormatter()\n\n const timeFilterOptions = [\n { value: '3months', label: t('timeFilter.options.3months') },\n { value: '6months', label: t('timeFilter.options.6months') },\n { value: 'year', label: t('timeFilter.options.year') },\n ]\n\n const formatDeadlineForDialog = (item: Payroll): string => {\n const deadline = item.payrollDeadline\n if (!deadline) return ''\n\n const deadlineDate = new Date(deadline)\n const timeZone = 'America/New_York'\n\n const formatter = new Intl.DateTimeFormat('en-US', {\n weekday: 'short',\n month: 'short',\n day: 'numeric',\n timeZone,\n })\n\n const timeFormatter = new Intl.DateTimeFormat('en-US', {\n hour: 'numeric',\n minute: '2-digit',\n timeZoneName: 'short',\n timeZone,\n })\n\n const dateStr = formatter.format(deadlineDate)\n const timeStr = timeFormatter.format(deadlineDate)\n\n return `${timeStr} on ${dateStr}`\n }\n\n const handleCancelClick = (item: Payroll) => {\n onCancelDialogOpen(item)\n }\n\n const handleConfirmCancel = () => {\n if (cancelDialogItem) {\n onCancelPayroll(cancelDialogItem)\n }\n }\n\n const getMenuItems = (item: Payroll): MenuItem[] => {\n const payrollId = item.payrollUuid || item.uuid!\n const items: MenuItem[] = [\n {\n label: t('menu.viewSummary'),\n icon: <FileIcon aria-hidden />,\n onClick: () => {\n onViewSummary(payrollId, item.payPeriod?.startDate, item.payPeriod?.endDate)\n },\n },\n {\n label: t('menu.viewReceipt'),\n icon: <ReceiptIcon aria-hidden />,\n onClick: () => {\n onViewReceipt(payrollId, item.payPeriod?.startDate, item.payPeriod?.endDate)\n },\n },\n ]\n\n if (canCancelPayroll(item)) {\n items.push({\n label: t('menu.cancelPayroll'),\n icon: <TrashcanIcon aria-hidden />,\n onClick: () => {\n handleCancelClick(item)\n },\n 'data-destructive': 'true',\n })\n }\n\n return items\n }\n\n if (payrollHistory.length === 0) {\n return (\n <Flex flexDirection=\"column\" alignItems=\"center\" gap={24}>\n <Heading as=\"h3\">{t('emptyState.title')}</Heading>\n <Text>{t('emptyState.description')}</Text>\n </Flex>\n )\n }\n\n return (\n <Flex flexDirection=\"column\" gap={16}>\n <Flex\n flexDirection={{ base: 'column', medium: 'row' }}\n justifyContent=\"space-between\"\n alignItems=\"flex-start\"\n gap={{ base: 12, medium: 24 }}\n >\n <Flex>\n <Heading as=\"h2\">{t('title')}</Heading>\n </Flex>\n <div className={styles.timeFilterContainer}>\n <Select\n value={selectedTimeFilter}\n onChange={(value: string) => {\n onTimeFilterChange(value as TimeFilterOption)\n }}\n options={timeFilterOptions}\n label={t('timeFilter.placeholder')}\n shouldVisuallyHideLabel\n isRequired\n />\n </div>\n </Flex>\n\n <DataView\n label={t('dataView.label')}\n columns={[\n {\n title: t('columns.payPeriod'),\n render: (item: Payroll) => (\n <Text>\n {dateFormatter.formatPayPeriodRange(\n item.payPeriod?.startDate,\n item.payPeriod?.endDate,\n )}\n </Text>\n ),\n },\n {\n title: t('columns.type'),\n render: (item: Payroll) => <Text>{getPayrollType(item)}</Text>,\n },\n {\n title: t('columns.payDate'),\n render: (item: Payroll) => (\n <Text>{dateFormatter.formatShortWithYear(item.checkDate)}</Text>\n ),\n },\n {\n title: t('columns.status'),\n render: (item: Payroll) => {\n const wireInRequest = wireInRequests.find(\n wire => wire.paymentUuid === item.payrollUuid,\n )\n return <PayrollStatusBadges payroll={item} wireInRequest={wireInRequest} />\n },\n },\n {\n title: t('columns.totalPayroll'),\n render: (item: Payroll) => (\n <Text weight=\"semibold\">{formatNumberAsCurrency(calculateTotalPayroll(item))}</Text>\n ),\n },\n ]}\n data={payrollHistory}\n itemMenu={(item: Payroll) => <HamburgerMenu items={getMenuItems(item)} />}\n />\n\n <Dialog\n isOpen={!!cancelDialogItem}\n onClose={onCancelDialogClose}\n onPrimaryActionClick={handleConfirmCancel}\n isDestructive\n isPrimaryActionLoading={isLoading}\n primaryActionLabel={t('cancelDialog.primaryAction')}\n closeActionLabel={t('cancelDialog.secondaryAction')}\n title={\n cancelDialogItem\n ? t('cancelDialog.title', {\n payPeriod: dateFormatter.formatPayPeriodRange(\n cancelDialogItem.payPeriod?.startDate,\n cancelDialogItem.payPeriod?.endDate,\n ),\n })\n : ''\n }\n >\n {cancelDialogItem && (\n <Flex flexDirection=\"column\" gap={16}>\n <Text>{t('cancelDialog.body')}</Text>\n {cancelDialogItem.payrollDeadline && (\n <Text>\n {t('cancelDialog.deadline', {\n deadline: formatDeadlineForDialog(cancelDialogItem),\n })}\n </Text>\n )}\n </Flex>\n )}\n </Dialog>\n </Flex>\n )\n}\n"],"names":["PayrollHistoryPresentation","payrollHistory","wireInRequests","selectedTimeFilter","onTimeFilterChange","onViewSummary","onViewReceipt","onCancelPayroll","cancelDialogItem","onCancelDialogOpen","onCancelDialogClose","isLoading","Heading","Text","Select","Dialog","useComponentContext","useI18n","useTranslation","dateFormatter","useDateFormatter","timeFilterOptions","formatDeadlineForDialog","item","deadline","deadlineDate","timeZone","formatter","timeFormatter","dateStr","handleCancelClick","handleConfirmCancel","getMenuItems","payrollId","items","jsx","FileIcon","ReceiptIcon","canCancelPayroll","TrashcanIcon","Flex","jsxs","styles","value","DataView","getPayrollType","wireInRequest","wire","PayrollStatusBadges","formatNumberAsCurrency","calculateTotalPayroll","HamburgerMenu"],"mappings":";;;;;;;;;;;;;;;;;AAgCO,MAAMA,KAA6B,CAAC;AAAA,EACzC,gBAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,eAAAC;AAAA,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AAAY,EAACa,GAAA,EAAoB,SAASzB,GAAM,eAAAuB,EAAA,CAA8B;AAAA,YAC3E;AAAA,UAAA;AAAA,UAEF;AAAA,YACE,OAAO,EAAE,sBAAsB;AAAA,YAC/B,QAAQ,CAACvB,MACP,gBAAAY,EAACtB,GAAA,EAAK,QAAO,YAAY,UAAAoC,EAAuBC,EAAsB3B,CAAI,CAAC,EAAA,CAAE;AAAA,UAAA;AAAA,QAEjF;AAAA,QAEF,MAAMtB;AAAA,QACN,UAAU,CAACsB,MAAkB,gBAAAY,EAACgB,KAAc,OAAOnB,EAAaT,CAAI,EAAA,CAAG;AAAA,MAAA;AAAA,IAAA;AAAA,IAGzE,gBAAAY;AAAA,MAACpB;AAAA,MAAA;AAAA,QACC,QAAQ,CAAC,CAACP;AAAA,QACV,SAASE;AAAA,QACT,sBAAsBqB;AAAA,QACtB,eAAa;AAAA,QACb,wBAAwBpB;AAAA,QACxB,oBAAoB,EAAE,4BAA4B;AAAA,QAClD,kBAAkB,EAAE,8BAA8B;AAAA,QAClD,OACEH,IACI,EAAE,sBAAsB;AAAA,UACtB,WAAWW,EAAc;AAAA,YACvBX,EAAiB,WAAW;AAAA,YAC5BA,EAAiB,WAAW;AAAA,UAAA;AAAA,QAC9B,CACD,IACD;AAAA,QAGL,eACC,gBAAAiC,EAACD,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,UAAA,gBAAAL,EAACtB,GAAA,EAAM,UAAA,EAAE,mBAAmB,EAAA,CAAE;AAAA,UAC7BL,EAAiB,mBAChB,gBAAA2B,EAACtB,GAAA,EACE,YAAE,yBAAyB;AAAA,YAC1B,UAAUS,EAAwBd,CAAgB;AAAA,UAAA,CACnD,EAAA,CACH;AAAA,QAAA,EAAA,CAEJ;AAAA,MAAA;AAAA,IAAA;AAAA,EAEJ,GACF;AAEJ;"}
@@ -1,41 +1,45 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import { useMemo as e } from "react";
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { useMemo as i } from "react";
3
3
  import { createMachine as c } from "robot3";
4
- import { payrollLandingMachine as p } from "./payrollLandingStateMachine.js";
5
- import { PayrollLandingTabsContextual as f } from "./PayrollLandingFlowComponents.js";
6
- import { Flow as u } from "../../Flow/Flow.js";
7
- import { BaseComponent as y } from "../../Base/Base.js";
8
- import { useComponentDictionary as d } from "../../../i18n/I18n.js";
9
- function T(o) {
10
- return /* @__PURE__ */ r(y, { ...o, children: /* @__PURE__ */ r(g, { ...o }) });
4
+ import { payrollLandingMachine as u, payrollLandingBreadcrumbNodes as d } from "./payrollLandingStateMachine.js";
5
+ import { PayrollLandingTabsContextual as p } from "./PayrollLandingFlowComponents.js";
6
+ import { Flow as f } from "../../Flow/Flow.js";
7
+ import { BaseComponent as s } from "../../Base/Base.js";
8
+ import { useComponentDictionary as b } from "../../../i18n/I18n.js";
9
+ import { buildBreadcrumbs as y } from "../../../helpers/breadcrumbHelpers.js";
10
+ function w(r) {
11
+ return /* @__PURE__ */ o(s, { ...r, children: /* @__PURE__ */ o(g, { ...r }) });
11
12
  }
12
13
  function g({
13
- companyId: o,
14
- onEvent: t,
14
+ companyId: r,
15
+ onEvent: e,
15
16
  dictionary: l,
16
17
  withReimbursements: n = !0,
17
18
  ConfirmWireDetailsComponent: a
18
19
  }) {
19
- d("Payroll.PayrollLanding", l);
20
- const i = e(
20
+ b("Payroll.PayrollLanding", l);
21
+ const t = i(
21
22
  () => c(
22
23
  "tabs",
23
- p,
24
+ u,
24
25
  (m) => ({
25
26
  ...m,
26
- component: f,
27
- companyId: o,
27
+ component: p,
28
+ companyId: r,
28
29
  selectedTab: "run-payroll",
29
30
  withReimbursements: n,
30
- ConfirmWireDetailsComponent: a
31
+ ConfirmWireDetailsComponent: a,
32
+ breadcrumbs: y(d),
33
+ currentBreadcrumbId: "tabs",
34
+ progressBarType: null
31
35
  })
32
36
  ),
33
- [o, n, a]
37
+ [r, n, a]
34
38
  );
35
- return /* @__PURE__ */ r(u, { onEvent: t, machine: i });
39
+ return /* @__PURE__ */ o(f, { onEvent: e, machine: t });
36
40
  }
37
41
  export {
38
- T as PayrollLanding,
42
+ w as PayrollLanding,
39
43
  g as PayrollLandingFlow
40
44
  };
41
45
  //# sourceMappingURL=PayrollLanding.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PayrollLanding.js","sources":["../../../../src/components/Payroll/PayrollLanding/PayrollLanding.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { createMachine } from 'robot3'\nimport type { ConfirmWireDetailsComponentType } from '../ConfirmWireDetails/ConfirmWireDetails'\nimport { payrollLandingMachine } from './payrollLandingStateMachine'\nimport {\n PayrollLandingTabsContextual,\n type PayrollLandingFlowContextInterface,\n type PayrollLandingFlowProps,\n} from './PayrollLandingFlowComponents'\nimport { Flow } from '@/components/Flow/Flow'\nimport type { BaseComponentInterface } from '@/components/Base/Base'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { useComponentDictionary } from '@/i18n'\n\ninterface PayrollLandingProps extends BaseComponentInterface<'Payroll.PayrollLanding'> {\n companyId: string\n withReimbursements?: boolean\n ConfirmWireDetailsComponent?: ConfirmWireDetailsComponentType\n}\n\nexport function PayrollLanding(props: PayrollLandingProps) {\n return (\n <BaseComponent {...props}>\n <PayrollLandingFlow {...props} />\n </BaseComponent>\n )\n}\n\nexport function PayrollLandingFlow({\n companyId,\n onEvent,\n dictionary,\n withReimbursements = true,\n ConfirmWireDetailsComponent,\n}: PayrollLandingFlowProps) {\n useComponentDictionary('Payroll.PayrollLanding', dictionary)\n\n const machine = useMemo(\n () =>\n createMachine(\n 'tabs',\n payrollLandingMachine,\n (initialContext: PayrollLandingFlowContextInterface) => ({\n ...initialContext,\n component: PayrollLandingTabsContextual,\n companyId,\n selectedTab: 'run-payroll',\n withReimbursements,\n ConfirmWireDetailsComponent,\n }),\n ),\n [companyId, withReimbursements, ConfirmWireDetailsComponent],\n )\n\n return <Flow onEvent={onEvent} machine={machine} />\n}\n"],"names":["PayrollLanding","props","jsx","BaseComponent","PayrollLandingFlow","companyId","onEvent","dictionary","withReimbursements","ConfirmWireDetailsComponent","useComponentDictionary","machine","useMemo","createMachine","payrollLandingMachine","initialContext","PayrollLandingTabsContextual","Flow"],"mappings":";;;;;;;;AAoBO,SAASA,EAAeC,GAA4B;AACzD,SACE,gBAAAC,EAACC,KAAe,GAAGF,GACjB,4BAACG,GAAA,EAAoB,GAAGH,GAAO,EAAA,CACjC;AAEJ;AAEO,SAASG,EAAmB;AAAA,EACjC,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,YAAAC;AAAA,EACA,oBAAAC,IAAqB;AAAA,EACrB,6BAAAC;AACF,GAA4B;AAC1B,EAAAC,EAAuB,0BAA0BH,CAAU;AAE3D,QAAMI,IAAUC;AAAA,IACd,MACEC;AAAA,MACE;AAAA,MACAC;AAAA,MACA,CAACC,OAAwD;AAAA,QACvD,GAAGA;AAAA,QACH,WAAWC;AAAA,QACX,WAAAX;AAAA,QACA,aAAa;AAAA,QACb,oBAAAG;AAAA,QACA,6BAAAC;AAAA,MAAA;AAAA,IACF;AAAA,IAEJ,CAACJ,GAAWG,GAAoBC,CAA2B;AAAA,EAAA;AAG7D,SAAO,gBAAAP,EAACe,GAAA,EAAK,SAAAX,GAAkB,SAAAK,EAAA,CAAkB;AACnD;"}
1
+ {"version":3,"file":"PayrollLanding.js","sources":["../../../../src/components/Payroll/PayrollLanding/PayrollLanding.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { createMachine } from 'robot3'\nimport type { ConfirmWireDetailsComponentType } from '../ConfirmWireDetails/ConfirmWireDetails'\nimport { payrollLandingMachine, payrollLandingBreadcrumbNodes } from './payrollLandingStateMachine'\nimport {\n PayrollLandingTabsContextual,\n type PayrollLandingFlowContextInterface,\n type PayrollLandingFlowProps,\n} from './PayrollLandingFlowComponents'\nimport { Flow } from '@/components/Flow/Flow'\nimport type { BaseComponentInterface } from '@/components/Base/Base'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { useComponentDictionary } from '@/i18n'\nimport { buildBreadcrumbs } from '@/helpers/breadcrumbHelpers'\n\ninterface PayrollLandingProps extends BaseComponentInterface<'Payroll.PayrollLanding'> {\n companyId: string\n withReimbursements?: boolean\n ConfirmWireDetailsComponent?: ConfirmWireDetailsComponentType\n}\n\nexport function PayrollLanding(props: PayrollLandingProps) {\n return (\n <BaseComponent {...props}>\n <PayrollLandingFlow {...props} />\n </BaseComponent>\n )\n}\n\nexport function PayrollLandingFlow({\n companyId,\n onEvent,\n dictionary,\n withReimbursements = true,\n ConfirmWireDetailsComponent,\n}: PayrollLandingFlowProps) {\n useComponentDictionary('Payroll.PayrollLanding', dictionary)\n\n const machine = useMemo(\n () =>\n createMachine(\n 'tabs',\n payrollLandingMachine,\n (initialContext: PayrollLandingFlowContextInterface) => ({\n ...initialContext,\n component: PayrollLandingTabsContextual,\n companyId,\n selectedTab: 'run-payroll',\n withReimbursements,\n ConfirmWireDetailsComponent,\n breadcrumbs: buildBreadcrumbs(payrollLandingBreadcrumbNodes),\n currentBreadcrumbId: 'tabs',\n progressBarType: null,\n }),\n ),\n [companyId, withReimbursements, ConfirmWireDetailsComponent],\n )\n\n return <Flow onEvent={onEvent} machine={machine} />\n}\n"],"names":["PayrollLanding","props","jsx","BaseComponent","PayrollLandingFlow","companyId","onEvent","dictionary","withReimbursements","ConfirmWireDetailsComponent","useComponentDictionary","machine","useMemo","createMachine","payrollLandingMachine","initialContext","PayrollLandingTabsContextual","buildBreadcrumbs","payrollLandingBreadcrumbNodes","Flow"],"mappings":";;;;;;;;;AAqBO,SAASA,EAAeC,GAA4B;AACzD,SACE,gBAAAC,EAACC,KAAe,GAAGF,GACjB,4BAACG,GAAA,EAAoB,GAAGH,GAAO,EAAA,CACjC;AAEJ;AAEO,SAASG,EAAmB;AAAA,EACjC,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,YAAAC;AAAA,EACA,oBAAAC,IAAqB;AAAA,EACrB,6BAAAC;AACF,GAA4B;AAC1B,EAAAC,EAAuB,0BAA0BH,CAAU;AAE3D,QAAMI,IAAUC;AAAA,IACd,MACEC;AAAA,MACE;AAAA,MACAC;AAAA,MACA,CAACC,OAAwD;AAAA,QACvD,GAAGA;AAAA,QACH,WAAWC;AAAA,QACX,WAAAX;AAAA,QACA,aAAa;AAAA,QACb,oBAAAG;AAAA,QACA,6BAAAC;AAAA,QACA,aAAaQ,EAAiBC,CAA6B;AAAA,QAC3D,qBAAqB;AAAA,QACrB,iBAAiB;AAAA,MAAA;AAAA,IACnB;AAAA,IAEJ,CAACb,GAAWG,GAAoBC,CAA2B;AAAA,EAAA;AAG7D,SAAO,gBAAAP,EAACiB,GAAA,EAAK,SAAAb,GAAkB,SAAAK,EAAA,CAAkB;AACnD;"}
@@ -14,6 +14,8 @@ export interface PayrollLandingFlowContextInterface extends FlowContextInterface
14
14
  selectedTab?: string;
15
15
  withReimbursements: boolean;
16
16
  ConfirmWireDetailsComponent?: ConfirmWireDetailsComponentType;
17
+ startDate?: string;
18
+ endDate?: string;
17
19
  }
18
20
  export declare function PayrollLandingTabsContextual(): import("react/jsx-runtime").JSX.Element;
19
21
  export declare function PayrollLandingReceiptsContextual(): import("react/jsx-runtime").JSX.Element;