@gusto/embedded-react-sdk 0.31.1 → 0.32.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 (415) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/dist/assets/icons/icon-arrow-right.svg.js +10 -0
  3. package/dist/assets/icons/icon-arrow-right.svg.js.map +1 -0
  4. package/dist/components/Base/Base.js +46 -45
  5. package/dist/components/Base/Base.js.map +1 -1
  6. package/dist/components/Base/useBase.d.ts +2 -3
  7. package/dist/components/Base/useBase.js.map +1 -1
  8. package/dist/components/Base/useBaseSubmit.js +32 -19
  9. package/dist/components/Base/useBaseSubmit.js.map +1 -1
  10. package/dist/components/Common/DataView/DataView.js +1 -1
  11. package/dist/components/Common/DocumentList/DocumentList.js +1 -1
  12. package/dist/components/Common/DocumentViewer/DocumentViewer.js +1 -1
  13. package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.js +1 -1
  14. package/dist/components/Common/RequirementsList/RequirementsList.js +1 -1
  15. package/dist/components/Common/RequirementsList/RequirementsList.js.map +1 -1
  16. package/dist/components/Common/RequirementsList/RequirementsList.module.scss.js +1 -1
  17. package/dist/components/Common/SignatureForm/SignatureForm.js +12 -10
  18. package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
  19. package/dist/components/Common/SignatureForm/SignatureFormActions.js +3 -2
  20. package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
  21. package/dist/components/Common/SignatureForm/SignatureFormFields.js +7 -6
  22. package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
  23. package/dist/components/Common/UI/Box/Box.d.ts +2 -0
  24. package/dist/components/Common/UI/Box/Box.js +13 -0
  25. package/dist/components/Common/UI/Box/Box.js.map +1 -0
  26. package/dist/components/Common/UI/Box/Box.module.scss.js +12 -0
  27. package/dist/components/Common/UI/Box/Box.module.scss.js.map +1 -0
  28. package/dist/components/Common/UI/Box/BoxTypes.d.ts +15 -0
  29. package/dist/components/Common/UI/Box/index.d.ts +2 -0
  30. package/dist/components/Common/UI/Dialog/Dialog.js +1 -1
  31. package/dist/components/Common/UI/Input/InputTypes.d.ts +1 -1
  32. package/dist/components/Common/UI/Input/InputTypes.js.map +1 -1
  33. package/dist/components/Common/UI/List/List.module.scss.js +1 -1
  34. package/dist/components/Common/UI/Modal/Modal.js +1 -1
  35. package/dist/components/Common/UI/Tabs/Tabs.js +1 -1
  36. package/dist/components/Common/UI/TextInput/TextInput.js +30 -28
  37. package/dist/components/Common/UI/TextInput/TextInput.js.map +1 -1
  38. package/dist/components/Common/UI/TextInput/TextInputTypes.d.ts +1 -1
  39. package/dist/components/Common/UI/TextInput/TextInputTypes.js.map +1 -1
  40. package/dist/components/Company/AssignSignatory/AssignSignatory.js +3 -2
  41. package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
  42. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +4 -3
  43. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
  44. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +3 -2
  45. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
  46. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +1 -1
  47. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +12 -12
  48. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +5 -4
  49. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  50. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +3 -2
  51. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
  52. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +1 -1
  53. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +1 -1
  54. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +5 -4
  55. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  56. package/dist/components/Company/AssignSignatory/TitleSelect.js +5 -5
  57. package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
  58. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +7 -6
  59. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  60. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +9 -8
  61. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
  62. package/dist/components/Company/BankAccount/BankAccountForm/Form.js +7 -5
  63. package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
  64. package/dist/components/Company/BankAccount/BankAccountForm/context.js +5 -4
  65. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  66. package/dist/components/Company/BankAccount/BankAccountList/Actions.js +3 -2
  67. package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
  68. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +7 -6
  69. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
  70. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +7 -5
  71. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
  72. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +3 -2
  73. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
  74. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +9 -8
  75. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  76. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +5 -4
  77. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  78. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +4 -3
  79. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  80. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +5 -4
  81. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  82. package/dist/components/Company/FederalTaxes/Actions.js +7 -6
  83. package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
  84. package/dist/components/Company/FederalTaxes/FederalTaxes.js +4 -3
  85. package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
  86. package/dist/components/Company/FederalTaxes/Form.js +5 -3
  87. package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
  88. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +7 -6
  89. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  90. package/dist/components/Company/Industry/Actions.js +8 -7
  91. package/dist/components/Company/Industry/Actions.js.map +1 -1
  92. package/dist/components/Company/Industry/Context.js +8 -7
  93. package/dist/components/Company/Industry/Context.js.map +1 -1
  94. package/dist/components/Company/Industry/Edit.js +3 -2
  95. package/dist/components/Company/Industry/Edit.js.map +1 -1
  96. package/dist/components/Company/Locations/LocationForm/Actions.js +7 -6
  97. package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
  98. package/dist/components/Company/Locations/LocationForm/Form.js +1 -1
  99. package/dist/components/Company/Locations/LocationForm/LocationForm.js +4 -3
  100. package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
  101. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +5 -4
  102. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  103. package/dist/components/Company/Locations/LocationsList/Actions.js +3 -2
  104. package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
  105. package/dist/components/Company/Locations/LocationsList/List.js +7 -6
  106. package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
  107. package/dist/components/Company/Locations/LocationsList/LocationsList.js +4 -3
  108. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  109. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +5 -4
  110. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  111. package/dist/components/Company/OnboardingOverview/Completed.js +12 -10
  112. package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
  113. package/dist/components/Company/OnboardingOverview/MissingRequirements.js +39 -26
  114. package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
  115. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +8 -7
  116. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
  117. package/dist/components/Company/OnboardingOverview/context.js +5 -4
  118. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  119. package/dist/components/Company/PaySchedule/PaySchedule.js +25 -22
  120. package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
  121. package/dist/components/Company/PaySchedule/_parts/Actions.js +3 -2
  122. package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
  123. package/dist/components/Company/PaySchedule/_parts/Edit.js +15 -15
  124. package/dist/components/Company/PaySchedule/_parts/Head.js +13 -11
  125. package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
  126. package/dist/components/Company/PaySchedule/_parts/List.js +15 -13
  127. package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
  128. package/dist/components/Company/PaySchedule/usePaySchedule.js +7 -6
  129. package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
  130. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +3 -2
  131. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
  132. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +5 -4
  133. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  134. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +3 -2
  135. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
  136. package/dist/components/Company/StateTaxes/StateTaxesList/List.js +3 -2
  137. package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
  138. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +5 -4
  139. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  140. package/dist/components/Company/index.js +20 -20
  141. package/dist/components/Contractor/Address/Address.js +7 -7
  142. package/dist/components/Contractor/Address/Address.js.map +1 -1
  143. package/dist/components/Contractor/Address/Form.js +1 -1
  144. package/dist/components/Contractor/Address/useAddress.js +7 -6
  145. package/dist/components/Contractor/Address/useAddress.js.map +1 -1
  146. package/dist/components/Contractor/ContractorList/index.js +32 -31
  147. package/dist/components/Contractor/ContractorList/index.js.map +1 -1
  148. package/dist/components/Contractor/NewHireReport/NewHireReport.js +14 -13
  149. package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
  150. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +12 -11
  151. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
  152. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +3 -2
  153. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
  154. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +4 -3
  155. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
  156. package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js +135 -108
  157. package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js.map +1 -1
  158. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +4 -2
  159. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
  160. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentFormSchema.d.ts +84 -0
  161. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentFormSchema.js +23 -0
  162. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentFormSchema.js.map +1 -0
  163. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.d.ts +3 -31
  164. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +63 -69
  165. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js.map +1 -1
  166. package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.d.ts +2 -1
  167. package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js +29 -29
  168. package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js.map +1 -1
  169. package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.d.ts +2 -1
  170. package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +32 -29
  171. package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js.map +1 -1
  172. package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js +0 -1
  173. package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js.map +1 -1
  174. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js +4 -2
  175. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map +1 -1
  176. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js +8 -6
  177. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js.map +1 -1
  178. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js +4 -2
  179. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js.map +1 -1
  180. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +28 -27
  181. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
  182. package/dist/components/Contractor/Profile/ContractorProfileForm.js +15 -15
  183. package/dist/components/Contractor/Profile/useContractorProfile.js +4 -3
  184. package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
  185. package/dist/components/Contractor/Submit/Submit.js +21 -20
  186. package/dist/components/Contractor/Submit/Submit.js.map +1 -1
  187. package/dist/components/Employee/Compensation/Actions.js +13 -12
  188. package/dist/components/Employee/Compensation/Actions.js.map +1 -1
  189. package/dist/components/Employee/Compensation/Edit.js +17 -16
  190. package/dist/components/Employee/Compensation/Edit.js.map +1 -1
  191. package/dist/components/Employee/Compensation/List.js +23 -22
  192. package/dist/components/Employee/Compensation/List.js.map +1 -1
  193. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +12 -11
  194. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
  195. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +13 -12
  196. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
  197. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +13 -12
  198. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -1
  199. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +8 -7
  200. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js.map +1 -1
  201. package/dist/components/Employee/Deductions/stateMachine.js +1 -1
  202. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +9 -8
  203. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
  204. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +24 -22
  205. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  206. package/dist/components/Employee/DocumentSigner/DocumentList/List.js +4 -2
  207. package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
  208. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.d.ts +1 -0
  209. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +5 -4
  210. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  211. package/dist/components/Employee/DocumentSigner/DocumentSigner.js +9 -9
  212. package/dist/components/Employee/DocumentSigner/DocumentSigner.js.map +1 -1
  213. package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js +49 -43
  214. package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js.map +1 -1
  215. package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.js +150 -111
  216. package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.js.map +1 -1
  217. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +3 -2
  218. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  219. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +5 -4
  220. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  221. package/dist/components/Employee/DocumentSigner/documentSignerStateMachine.d.ts +1 -0
  222. package/dist/components/Employee/DocumentSigner/documentSignerStateMachine.js.map +1 -1
  223. package/dist/components/Employee/DocumentSigner/stateMachine.js +34 -22
  224. package/dist/components/Employee/DocumentSigner/stateMachine.js.map +1 -1
  225. package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.js +4 -2
  226. package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.js.map +1 -1
  227. package/dist/components/Employee/EmployeeList/Actions.js +7 -6
  228. package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
  229. package/dist/components/Employee/EmployeeList/EmployeeList.js +4 -3
  230. package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
  231. package/dist/components/Employee/EmployeeList/Head.js +7 -5
  232. package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
  233. package/dist/components/Employee/EmployeeList/List.js +3 -2
  234. package/dist/components/Employee/EmployeeList/List.js.map +1 -1
  235. package/dist/components/Employee/EmployeeList/useEmployeeList.js +5 -4
  236. package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
  237. package/dist/components/Employee/FederalTaxes/Actions.js +6 -5
  238. package/dist/components/Employee/FederalTaxes/Actions.js.map +1 -1
  239. package/dist/components/Employee/FederalTaxes/FederalForm.js +12 -11
  240. package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
  241. package/dist/components/Employee/FederalTaxes/FederalTaxes.js +16 -15
  242. package/dist/components/Employee/FederalTaxes/FederalTaxes.js.map +1 -1
  243. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +5 -4
  244. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
  245. package/dist/components/Employee/Landing/Landing.js +50 -44
  246. package/dist/components/Employee/Landing/Landing.js.map +1 -1
  247. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +7 -7
  248. package/dist/components/Employee/PaymentMethod/Actions.js +6 -5
  249. package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
  250. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +5 -4
  251. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
  252. package/dist/components/Employee/PaymentMethod/BankAccountsList.js +3 -2
  253. package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
  254. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +7 -6
  255. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
  256. package/dist/components/Employee/PaymentMethod/Split.js +11 -10
  257. package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
  258. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +7 -6
  259. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
  260. package/dist/components/Employee/Profile/Actions.js +6 -5
  261. package/dist/components/Employee/Profile/Actions.js.map +1 -1
  262. package/dist/components/Employee/Profile/AdminPersonalDetails.js +9 -8
  263. package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
  264. package/dist/components/Employee/Profile/HomeAddress.js +1 -1
  265. package/dist/components/Employee/Profile/PersonalDetailsInputs.js +2 -2
  266. package/dist/components/Employee/Profile/useProfile.js +5 -4
  267. package/dist/components/Employee/Profile/useProfile.js.map +1 -1
  268. package/dist/components/Employee/StateTaxes/Actions.js +6 -5
  269. package/dist/components/Employee/StateTaxes/Actions.js.map +1 -1
  270. package/dist/components/Employee/StateTaxes/StateTaxes.js +29 -29
  271. package/dist/components/Employee/StateTaxes/StateTaxes.js.map +1 -1
  272. package/dist/components/Employee/StateTaxes/useStateTaxes.js +5 -4
  273. package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
  274. package/dist/components/Employee/Taxes/Actions.js +7 -6
  275. package/dist/components/Employee/Taxes/Actions.js.map +1 -1
  276. package/dist/components/Employee/Taxes/FederalForm.js +14 -13
  277. package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
  278. package/dist/components/Employee/Taxes/Taxes.js +19 -19
  279. package/dist/components/Employee/Taxes/Taxes.js.map +1 -1
  280. package/dist/components/Employee/Taxes/useTaxes.js +5 -4
  281. package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
  282. package/dist/components/Employee/index.js +22 -22
  283. package/dist/components/Flow/Flow.js +9 -7
  284. package/dist/components/Flow/Flow.js.map +1 -1
  285. package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js +17 -16
  286. package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -1
  287. package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.d.ts +0 -1
  288. package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js +32 -37
  289. package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js.map +1 -1
  290. package/dist/components/InformationRequests/InformationRequests.d.ts +1 -2
  291. package/dist/components/InformationRequests/InformationRequests.js +36 -43
  292. package/dist/components/InformationRequests/InformationRequests.js.map +1 -1
  293. package/dist/components/InformationRequests/index.js +4 -4
  294. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +10 -9
  295. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js.map +1 -1
  296. package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js +23 -21
  297. package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js.map +1 -1
  298. package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.d.ts +2 -0
  299. package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js +79 -0
  300. package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js.map +1 -0
  301. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.d.ts +2 -0
  302. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js +47 -0
  303. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js.map +1 -0
  304. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationTypes.d.ts +14 -0
  305. package/dist/components/Payroll/OffCycleCreation/index.d.ts +3 -0
  306. package/dist/components/Payroll/OffCycleDeductionsSetting/OffCycleDeductionsSetting.d.ts +2 -0
  307. package/dist/components/Payroll/OffCycleDeductionsSetting/OffCycleDeductionsSetting.js +44 -0
  308. package/dist/components/Payroll/OffCycleDeductionsSetting/OffCycleDeductionsSetting.js.map +1 -0
  309. package/dist/components/Payroll/OffCycleDeductionsSetting/index.d.ts +3 -0
  310. package/dist/components/Payroll/OffCycleDeductionsSetting/types.d.ts +10 -0
  311. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.d.ts +1 -2
  312. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js +37 -0
  313. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js.map +1 -0
  314. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.module.scss.js +12 -0
  315. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.module.scss.js.map +1 -0
  316. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.d.ts +0 -4
  317. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.js +48 -0
  318. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.js.map +1 -0
  319. package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.js +18 -0
  320. package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.js.map +1 -0
  321. package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelection.js +26 -27
  322. package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelection.js.map +1 -1
  323. package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.d.ts +3 -3
  324. package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js +17 -16
  325. package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js.map +1 -1
  326. package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.d.ts +2 -0
  327. package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModalTypes.d.ts +8 -0
  328. package/dist/components/Payroll/OffCycleTaxWithholdingModal/index.d.ts +3 -0
  329. package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTable.d.ts +2 -0
  330. package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes.d.ts +17 -0
  331. package/dist/components/Payroll/OffCycleTaxWithholdingTable/index.d.ts +3 -0
  332. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.d.ts +3 -8
  333. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +38 -35
  334. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
  335. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +25 -33
  336. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js.map +1 -1
  337. package/dist/components/Payroll/PayrollBlocker/payrollHelpers.d.ts +2 -0
  338. package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js +21 -19
  339. package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js.map +1 -1
  340. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +26 -26
  341. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
  342. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +36 -36
  343. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +21 -19
  344. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
  345. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +17 -15
  346. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
  347. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js +32 -32
  348. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js.map +1 -1
  349. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +20 -18
  350. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
  351. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +70 -67
  352. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
  353. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.d.ts +2 -1
  354. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +38 -36
  355. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
  356. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.d.ts +2 -1
  357. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js +20 -20
  358. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js.map +1 -1
  359. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +4 -3
  360. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
  361. package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js +4 -3
  362. package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js.map +1 -1
  363. package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js +12 -11
  364. package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js.map +1 -1
  365. package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js +5 -3
  366. package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js.map +1 -1
  367. package/dist/components/Payroll/index.d.ts +4 -0
  368. package/dist/components/Payroll/index.js +22 -18
  369. package/dist/components/Payroll/index.js.map +1 -1
  370. package/dist/components/Payroll/usePreparedPayrollData.js +4 -3
  371. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  372. package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js +48 -46
  373. package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js.map +1 -1
  374. package/dist/contexts/ComponentAdapter/componentAdapterTypes.d.ts +1 -0
  375. package/dist/contexts/ComponentAdapter/useComponentContext.d.ts +2 -0
  376. package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
  377. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +3 -2
  378. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  379. package/dist/contexts/ThemeProvider/theme.d.ts +1 -0
  380. package/dist/contexts/ThemeProvider/theme.js +1 -0
  381. package/dist/contexts/ThemeProvider/theme.js.map +1 -1
  382. package/dist/helpers/apiErrorToList.js +14 -8
  383. package/dist/helpers/apiErrorToList.js.map +1 -1
  384. package/dist/helpers/dateFormatting.js +61 -45
  385. package/dist/helpers/dateFormatting.js.map +1 -1
  386. package/dist/helpers/formattedStrings.d.ts +1 -0
  387. package/dist/helpers/formattedStrings.js +21 -20
  388. package/dist/helpers/formattedStrings.js.map +1 -1
  389. package/dist/hooks/useOverflowDetection/useOverflowDetection.js +5 -6
  390. package/dist/i18n/I18n.js +7 -7
  391. package/dist/i18n/I18n.js.map +1 -1
  392. package/dist/i18n/en/Contractor.Payments.CreatePayment.json.js +12 -12
  393. package/dist/i18n/en/Employee.EmployeeDocuments.json.js +1 -1
  394. package/dist/i18n/en/Employee.I9SignatureForm.json.js +83 -65
  395. package/dist/i18n/en/Employee.I9SignatureForm.json.js.map +1 -1
  396. package/dist/i18n/en/Employee.Landing.json.js +7 -9
  397. package/dist/i18n/en/Employee.Landing.json.js.map +1 -1
  398. package/dist/i18n/en/Payroll.OffCycleCreation.json.js +14 -0
  399. package/dist/i18n/en/Payroll.OffCycleCreation.json.js.map +1 -0
  400. package/dist/i18n/en/Payroll.OffCycleDeductionsSetting.json.js +12 -0
  401. package/dist/i18n/en/Payroll.OffCycleDeductionsSetting.json.js.map +1 -0
  402. package/dist/i18n/en/Payroll.OffCycleTaxWithholding.json.js +18 -0
  403. package/dist/i18n/en/Payroll.OffCycleTaxWithholding.json.js.map +1 -0
  404. package/dist/i18n/en/Payroll.PayrollBlocker.json.js +21 -19
  405. package/dist/i18n/en/Payroll.PayrollBlocker.json.js.map +1 -1
  406. package/dist/i18n/en/Payroll.PayrollOverview.json.js +1 -1
  407. package/dist/shared/constants.d.ts +4 -0
  408. package/dist/shared/constants.js +6 -4
  409. package/dist/shared/constants.js.map +1 -1
  410. package/dist/style.css +1 -1
  411. package/dist/types/i18next.d.ts +76 -2
  412. package/docs/reference/endpoint-inventory.json +1706 -0
  413. package/package.json +27 -11
  414. package/dist/components/Employee/Landing/Landing.module.scss.js +0 -8
  415. package/dist/components/Employee/Landing/Landing.module.scss.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"FederalForm.js","sources":["../../../../src/components/Employee/FederalTaxes/FederalForm.tsx"],"sourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport { useFormContext } from 'react-hook-form'\nimport { z } from 'zod'\nimport { SelectField, RadioGroupField, NumberInputField, TextInputField } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nconst Rev2020Schema = z.object({\n w4DataType: z.literal('rev_2020_w4'),\n filingStatus: z.string().min(1),\n twoJobs: z.string().min(1),\n dependentsAmount: z.number().transform(String),\n otherIncome: z.number().transform(String),\n deductions: z.number().transform(String),\n extraWithholding: z.number().transform(String),\n})\n\nconst Pre2020Schema = z.object({\n w4DataType: z.literal('pre_2020_w4'),\n filingStatus: z.string().min(1),\n federalWithholdingAllowance: z.number().int(),\n additionalWithholding: z.string(),\n})\n\nexport const FederalFormSchema = z.discriminatedUnion('w4DataType', [Rev2020Schema, Pre2020Schema])\n\nexport type FederalFormInputs = z.input<typeof FederalFormSchema>\nexport type FederalFormPayload = z.output<typeof FederalFormSchema>\n\nexport function FederalForm() {\n const { watch } = useFormContext<FederalFormInputs>()\n const w4DataType = watch('w4DataType')\n\n if (w4DataType === 'rev_2020_w4') {\n return <Rev2020Form />\n }\n\n return <Pre2020Form />\n}\n\nfunction Rev2020Form() {\n const { t } = useTranslation('Employee.FederalTaxes')\n const Components = useComponentContext()\n\n const filingStatusOptions = [\n { value: 'Single', label: t('filingStatusSingle') },\n { value: 'Married', label: t('filingStatusMarried') },\n { value: 'Head of Household', label: t('filingStatusHeadOfHousehold') },\n { value: 'Exempt from withholding', label: t('filingStatusExemptFromWithholding') },\n ]\n\n return (\n <>\n <SelectField\n name=\"filingStatus\"\n label={t('federalFilingStatus1c')}\n placeholder={t('federalFilingStatusPlaceholder')}\n description={t('selectWithholdingDescription')}\n options={filingStatusOptions}\n isRequired\n errorMessage={t('validations.federalFilingStatus')}\n />\n <RadioGroupField\n name=\"twoJobs\"\n isRequired\n label={t('multipleJobs2c')}\n errorMessage={t('validations.federalTwoJobs')}\n description={\n <Trans\n i18nKey={'includesSpouseExplanation'}\n t={t}\n components={{\n IrsLink: <Components.Link />,\n }}\n />\n }\n options={[\n { value: 'true', label: t('twoJobYesLabel') },\n { value: 'false', label: t('twoJobNoLabel') },\n ]}\n />\n <NumberInputField\n name=\"dependentsAmount\"\n isRequired\n label={t('dependentsTotalIfApplicable')}\n format=\"currency\"\n min={0}\n errorMessage={t('fieldIsRequired')}\n />\n <NumberInputField\n name=\"otherIncome\"\n isRequired\n label={t('otherIncome')}\n format=\"currency\"\n min={0}\n errorMessage={t('fieldIsRequired')}\n />\n <NumberInputField\n name=\"deductions\"\n isRequired\n label={t('deductions')}\n format=\"currency\"\n min={0}\n errorMessage={t('fieldIsRequired')}\n />\n <NumberInputField\n name=\"extraWithholding\"\n isRequired\n label={t('extraWithholding')}\n format=\"currency\"\n min={0}\n errorMessage={t('fieldIsRequired')}\n />\n </>\n )\n}\n\nfunction Pre2020Form() {\n const { t } = useTranslation('Employee.FederalTaxes')\n\n const filingStatusOptions = [\n { value: 'Single', label: t('filingStatusSingle') },\n { value: 'Married', label: t('filingStatusMarried') },\n { value: 'Head of Household', label: t('filingStatusHeadOfHousehold') },\n { value: 'Exempt from withholding', label: t('filingStatusExemptFromWithholding') },\n { value: 'Married, but withhold as Single', label: t('filingStatusMarriedWithholdAsSingle') },\n ]\n\n return (\n <>\n <NumberInputField\n name=\"federalWithholdingAllowance\"\n isRequired\n label={t('federalWithholdingAllowance')}\n min={0}\n maximumFractionDigits={0}\n errorMessage={t('fieldIsRequired')}\n />\n <SelectField\n name=\"filingStatus\"\n label={t('filingStatus')}\n placeholder={t('federalFilingStatusPlaceholder')}\n description={t('selectWithholdingDescription')}\n options={filingStatusOptions}\n isRequired\n errorMessage={t('validations.federalFilingStatus')}\n />\n <TextInputField\n name=\"additionalWithholding\"\n label={t('additionalWithholding')}\n type=\"number\"\n errorMessage={t('fieldIsRequired')}\n />\n </>\n )\n}\n"],"names":["Rev2020Schema","z","Pre2020Schema","FederalFormSchema","FederalForm","watch","useFormContext","Rev2020Form","Pre2020Form","t","useTranslation","Components","useComponentContext","filingStatusOptions","jsxs","Fragment","jsx","SelectField","RadioGroupField","Tr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AAA;AAAA,IAAA;AAAA,IAEnD,gBAAAO;AAAA,MAACK;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOZ,EAAE,uBAAuB;AAAA,QAChC,MAAK;AAAA,QACL,cAAcA,EAAE,iBAAiB;AAAA,MAAA;AAAA,IAAA;AAAA,EACnC,GACF;AAEJ;"}
1
+ {"version":3,"file":"FederalForm.js","sources":["../../../../src/components/Employee/FederalTaxes/FederalForm.tsx"],"sourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport { useFormContext } from 'react-hook-form'\nimport { z } from 'zod'\nimport { SelectField, RadioGroupField, NumberInputField, TextInputField } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nconst Rev2020Schema = z.object({\n w4DataType: z.literal('rev_2020_w4'),\n filingStatus: z.string().min(1),\n twoJobs: z.string().min(1),\n dependentsAmount: z.number().transform(String),\n otherIncome: z.number().transform(String),\n deductions: z.number().transform(String),\n extraWithholding: z.number().transform(String),\n})\n\nconst Pre2020Schema = z.object({\n w4DataType: z.literal('pre_2020_w4'),\n filingStatus: z.string().min(1),\n federalWithholdingAllowance: z.number().int(),\n additionalWithholding: z.string(),\n})\n\nexport const FederalFormSchema = z.discriminatedUnion('w4DataType', [Rev2020Schema, Pre2020Schema])\n\nexport type FederalFormInputs = z.input<typeof FederalFormSchema>\nexport type FederalFormPayload = z.output<typeof FederalFormSchema>\n\nexport function FederalForm() {\n const { watch } = useFormContext<FederalFormInputs>()\n const w4DataType = watch('w4DataType')\n\n if (w4DataType === 'rev_2020_w4') {\n return <Rev2020Form />\n }\n\n return <Pre2020Form />\n}\n\nfunction Rev2020Form() {\n const { t } = useTranslation('Employee.FederalTaxes')\n const Components = useComponentContext()\n\n const filingStatusOptions = [\n { value: 'Single', label: t('filingStatusSingle') },\n { value: 'Married', label: t('filingStatusMarried') },\n { value: 'Head of Household', label: t('filingStatusHeadOfHousehold') },\n { value: 'Exempt from withholding', label: t('filingStatusExemptFromWithholding') },\n ]\n\n return (\n <>\n <SelectField\n name=\"filingStatus\"\n label={t('federalFilingStatus1c')}\n placeholder={t('federalFilingStatusPlaceholder')}\n description={t('selectWithholdingDescription')}\n options={filingStatusOptions}\n isRequired\n errorMessage={t('validations.federalFilingStatus')}\n />\n <RadioGroupField\n name=\"twoJobs\"\n isRequired\n label={t('multipleJobs2c')}\n errorMessage={t('validations.federalTwoJobs')}\n description={\n <Trans\n i18nKey={'includesSpouseExplanation'}\n t={t}\n components={{\n IrsLink: <Components.Link />,\n }}\n />\n }\n options={[\n { value: 'true', label: t('twoJobYesLabel') },\n { value: 'false', label: t('twoJobNoLabel') },\n ]}\n />\n <NumberInputField\n name=\"dependentsAmount\"\n isRequired\n label={t('dependentsTotalIfApplicable')}\n format=\"currency\"\n min={0}\n errorMessage={t('fieldIsRequired')}\n />\n <NumberInputField\n name=\"otherIncome\"\n isRequired\n label={t('otherIncome')}\n format=\"currency\"\n min={0}\n errorMessage={t('fieldIsRequired')}\n />\n <NumberInputField\n name=\"deductions\"\n isRequired\n label={t('deductions')}\n format=\"currency\"\n min={0}\n errorMessage={t('fieldIsRequired')}\n />\n <NumberInputField\n name=\"extraWithholding\"\n isRequired\n label={t('extraWithholding')}\n format=\"currency\"\n min={0}\n errorMessage={t('fieldIsRequired')}\n />\n </>\n )\n}\n\nfunction Pre2020Form() {\n const { t } = useTranslation('Employee.FederalTaxes')\n\n const filingStatusOptions = [\n { value: 'Single', label: t('filingStatusSingle') },\n { value: 'Married', label: t('filingStatusMarried') },\n { value: 'Head of Household', label: t('filingStatusHeadOfHousehold') },\n { value: 'Exempt from withholding', label: t('filingStatusExemptFromWithholding') },\n { value: 'Married, but withhold as Single', label: t('filingStatusMarriedWithholdAsSingle') },\n ]\n\n return (\n <>\n <NumberInputField\n name=\"federalWithholdingAllowance\"\n isRequired\n label={t('federalWithholdingAllowance')}\n min={0}\n maximumFractionDigits={0}\n errorMessage={t('fieldIsRequired')}\n />\n <SelectField\n name=\"filingStatus\"\n label={t('filingStatus')}\n placeholder={t('federalFilingStatusPlaceholder')}\n description={t('selectWithholdingDescription')}\n options={filingStatusOptions}\n isRequired\n errorMessage={t('validations.federalFilingStatus')}\n />\n <TextInputField\n name=\"additionalWithholding\"\n label={t('additionalWithholding')}\n type=\"number\"\n errorMessage={t('fieldIsRequired')}\n />\n </>\n )\n}\n"],"names":["Rev2020Schema","z","Pre2020Schema","FederalFormSchema","FederalForm","watch","useFormContext","Rev2020Form","Pre2020Form","t","useTranslation","Components","useComponentContext","filingStatusOptions","jsxs","Fragment","jsx","SelectField","RadioGroupField","Trans","NumberInputField","TextInputField"],"mappings":";;;;;;;;;;;;AAMA,MAAMA,IAAgBC,EAAE,OAAO;AAAA,EAC7B,YAAYA,EAAE,QAAQ,aAAa;AAAA,EACnC,cAAcA,EAAE,SAAS,IAAI,CAAC;AAAA,EAC9B,SAASA,EAAE,SAAS,IAAI,CAAC;AAAA,EACzB,kBAAkBA,EAAE,SAAS,UAAU,MAAM;AAAA,EAC7C,aAAaA,EAAE,SAAS,UAAU,MAAM;AAAA,EACxC,YAAYA,EAAE,SAAS,UAAU,MAAM;AAAA,EACvC,kBAAkBA,EAAE,OAAA,EAAS,UAAU,MAAM;AAC/C,CAAC,GAEKC,IAAgBD,EAAE,OAAO;AAAA,EAC7B,YAAYA,EAAE,QAAQ,aAAa;AAAA,EACnC,cAAcA,EAAE,SAAS,IAAI,CAAC;AAAA,EAC9B,6BAA6BA,EAAE,OAAA,EAAS,IAAA;AAAA,EACxC,uBAAuBA,EAAE,OAAA;AAC3B,CAAC,GAEYE,IAAoBF,EAAE,mBAAmB,cAAc,CAACD,GAAeE,CAAa,CAAC;AAK3F,SAASE,IAAc;AAC5B,QAAM,EAAE,OAAAC,EAAA,IAAUC,EAAA;AAGlB,SAFmBD,EAAM,YAAY,MAElB,kCACTE,GAAA,EAAY,sBAGdC,GAAA,EAAY;AACtB;AAEA,SAASD,IAAc;AACrB,QAAM,EAAE,GAAAE,EAAA,IAA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YAAU;AAAA,QACV,OAAOX,EAAE,6BAA6B;AAAA,QACtC,KAAK;AAAA,QACL,uBAAuB;AAAA,QACvB,cAAcA,EAAE,iBAAiB;AAAA,MAAA;AAAA,IAAA;AAAA,IAEnC,gBAAAO;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOR,EAAE,cAAc;AAAA,QACvB,aAAaA,EAAE,gCAAgC;AAAA,QAC/C,aAAaA,EAAE,8BAA8B;AAAA,QAC7C,SAASI;AAAA,QACT,YAAU;AAAA,QACV,cAAcJ,EAAE,iCAAiC;AAAA,MAAA;AAAA,IAAA;AAAA,IAEnD,gBAAAO;AAAA,MAACK;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOZ,EAAE,uBAAuB;AAAA,QAChC,MAAK;AAAA,QACL,cAAcA,EAAE,iBAAiB;AAAA,MAAA;AAAA,IAAA;AAAA,EACnC,GACF;AAEJ;"}
@@ -1,6 +1,6 @@
1
1
  import { jsx as o, jsxs as S, Fragment as v } from "react/jsx-runtime";
2
- import { zodResolver as A } from "@hookform/resolvers/zod";
3
- import { useForm as y, FormProvider as D } from "react-hook-form";
2
+ import { zodResolver as y } from "@hookform/resolvers/zod";
3
+ import { useForm as A, FormProvider as D } from "react-hook-form";
4
4
  import { useEffect as _ } from "react";
5
5
  import { useEmployeeTaxSetupGetFederalTaxesSuspense as b } from "@gusto/embedded-api/react-query/employeeTaxSetupGetFederalTaxes";
6
6
  import { useEmployeeTaxSetupUpdateFederalTaxesMutation as W } from "@gusto/embedded-api/react-query/employeeTaxSetupUpdateFederalTaxes";
@@ -11,9 +11,10 @@ import { FederalTaxesProvider as J } from "./useFederalTaxes.js";
11
11
  import { BaseComponent as L } from "../../Base/Base.js";
12
12
  import { useBase as M } from "../../Base/useBase.js";
13
13
  import { useI18n as U, useComponentDictionary as B } from "../../../i18n/I18n.js";
14
+ import { normalizeErrorKeyForForm as q } from "../../../helpers/formattedStrings.js";
14
15
  import { componentEvents as u } from "../../../shared/constants.js";
15
- import { Form as q } from "../../Common/Form/Form.js";
16
- function ne(r) {
16
+ import { Form as z } from "../../Common/Form/Form.js";
17
+ function se(r) {
17
18
  return /* @__PURE__ */ o(L, { ...r, children: /* @__PURE__ */ o(C, { ...r }) });
18
19
  }
19
20
  const C = (r) => {
@@ -21,7 +22,7 @@ const C = (r) => {
21
22
  U("Employee.FederalTaxes"), B("Employee.FederalTaxes", h);
22
23
  const { data: p } = b({
23
24
  employeeUuid: s
24
- }), e = p.employeeFederalTax, { mutateAsync: g, isPending: E } = W(), T = e.w4DataType === "rev_2020_w4" ? {
25
+ }), e = p.employeeFederalTax, { mutateAsync: E, isPending: g } = W(), T = e.w4DataType === "rev_2020_w4" ? {
25
26
  w4DataType: "rev_2020_w4",
26
27
  filingStatus: e.filingStatus ?? "",
27
28
  twoJobs: e.twoJobs ? "true" : "false",
@@ -34,24 +35,24 @@ const C = (r) => {
34
35
  filingStatus: e.filingStatus ?? "",
35
36
  federalWithholdingAllowance: e.federalWithholdingAllowance ?? 0,
36
37
  additionalWithholding: e.additionalWithholding
37
- }, d = y({
38
- resolver: A(I),
38
+ }, d = A({
39
+ resolver: y(I),
39
40
  defaultValues: T
40
41
  }), { handleSubmit: w, setError: l } = d;
41
42
  return _(() => {
42
43
  n && n.length > 0 && n.forEach((i) => {
43
- const t = i.errorKey.replace(".value", "");
44
+ const t = q(i.errorKey);
44
45
  l(t, { type: "custom", message: i.message });
45
46
  });
46
47
  }, [n, l]), /* @__PURE__ */ o("section", { className: c, children: /* @__PURE__ */ o(
47
48
  J,
48
49
  {
49
50
  value: {
50
- isPending: E
51
+ isPending: g
51
52
  },
52
- children: /* @__PURE__ */ o(D, { ...d, children: /* @__PURE__ */ o(q, { onSubmit: w(async (i) => {
53
+ children: /* @__PURE__ */ o(D, { ...d, children: /* @__PURE__ */ o(z, { onSubmit: w(async (i) => {
53
54
  await f(i, async (t) => {
54
- const x = t.w4DataType === "rev_2020_w4" ? {
55
+ const F = t.w4DataType === "rev_2020_w4" ? {
55
56
  filingStatus: t.filingStatus,
56
57
  twoJobs: t.twoJobs === "true",
57
58
  dependentsAmount: t.dependentsAmount,
@@ -66,13 +67,13 @@ const C = (r) => {
66
67
  additionalWithholding: t.additionalWithholding,
67
68
  w4DataType: t.w4DataType,
68
69
  version: e.version
69
- }, F = await g({
70
+ }, x = await E({
70
71
  request: {
71
72
  employeeUuid: s,
72
- requestBody: x
73
+ requestBody: F
73
74
  }
74
75
  });
75
- m(u.EMPLOYEE_FEDERAL_TAXES_UPDATED, F), m(u.EMPLOYEE_FEDERAL_TAXES_DONE);
76
+ m(u.EMPLOYEE_FEDERAL_TAXES_UPDATED, x), m(u.EMPLOYEE_FEDERAL_TAXES_DONE);
76
77
  });
77
78
  }), children: a || /* @__PURE__ */ S(v, { children: [
78
79
  /* @__PURE__ */ o(N, {}),
@@ -83,6 +84,6 @@ const C = (r) => {
83
84
  ) });
84
85
  };
85
86
  export {
86
- ne as FederalTaxes
87
+ se as FederalTaxes
87
88
  };
88
89
  //# sourceMappingURL=FederalTaxes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FederalTaxes.js","sources":["../../../../src/components/Employee/FederalTaxes/FederalTaxes.tsx"],"sourcesContent":["import { zodResolver } from '@hookform/resolvers/zod'\nimport { FormProvider, useForm, type SubmitHandler } from 'react-hook-form'\nimport { useEffect } from 'react'\nimport { useEmployeeTaxSetupGetFederalTaxesSuspense } from '@gusto/embedded-api/react-query/employeeTaxSetupGetFederalTaxes'\nimport { useEmployeeTaxSetupUpdateFederalTaxesMutation } from '@gusto/embedded-api/react-query/employeeTaxSetupUpdateFederalTaxes'\nimport { FederalForm } from './FederalForm'\nimport { FederalFormSchema, type FederalFormInputs, type FederalFormPayload } from './FederalForm'\nimport { Head } from './Head'\nimport { Actions } from './Actions'\nimport { FederalTaxesProvider } from './useFederalTaxes'\nimport {\n useBase,\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { Form } from '@/components/Common/Form'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\ninterface FederalTaxesProps extends CommonComponentInterface<'Employee.FederalTaxes'> {\n employeeId: string\n}\n\nexport function FederalTaxes(props: FederalTaxesProps & BaseComponentInterface) {\n return (\n <BaseComponent<'Employee.FederalTaxes'> {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nconst Root = (props: FederalTaxesProps) => {\n const { employeeId, className, children, dictionary } = props\n const { onEvent, fieldErrors, baseSubmitHandler } = useBase()\n useI18n('Employee.FederalTaxes')\n useComponentDictionary('Employee.FederalTaxes', dictionary)\n\n const { data: fedData } = useEmployeeTaxSetupGetFederalTaxesSuspense({\n employeeUuid: employeeId,\n })\n const employeeFederalTax = fedData.employeeFederalTax!\n\n const { mutateAsync: updateFederalTaxes, isPending } =\n useEmployeeTaxSetupUpdateFederalTaxesMutation()\n\n const isRev2020 = employeeFederalTax.w4DataType === 'rev_2020_w4'\n\n const defaultValues: FederalFormInputs = isRev2020\n ? {\n w4DataType: 'rev_2020_w4',\n filingStatus: employeeFederalTax.filingStatus ?? '',\n twoJobs: employeeFederalTax.twoJobs ? 'true' : 'false',\n deductions: employeeFederalTax.deductions ? Number(employeeFederalTax.deductions) : 0,\n dependentsAmount: employeeFederalTax.dependentsAmount\n ? Number(employeeFederalTax.dependentsAmount)\n : 0,\n otherIncome: employeeFederalTax.otherIncome ? Number(employeeFederalTax.otherIncome) : 0,\n extraWithholding: employeeFederalTax.extraWithholding\n ? Number(employeeFederalTax.extraWithholding)\n : 0,\n }\n : {\n w4DataType: 'pre_2020_w4',\n filingStatus: employeeFederalTax.filingStatus ?? '',\n federalWithholdingAllowance: employeeFederalTax.federalWithholdingAllowance ?? 0,\n additionalWithholding: employeeFederalTax.additionalWithholding,\n }\n\n const formMethods = useForm<FederalFormInputs, unknown, FederalFormPayload>({\n resolver: zodResolver(FederalFormSchema),\n defaultValues,\n })\n const { handleSubmit, setError: _setError } = formMethods\n\n useEffect(() => {\n if (fieldErrors && fieldErrors.length > 0) {\n fieldErrors.forEach(msgObject => {\n const key = msgObject.errorKey.replace('.value', '')\n _setError(key as keyof FederalFormInputs, { type: 'custom', message: msgObject.message })\n })\n }\n }, [fieldErrors, _setError])\n\n const onSubmit: SubmitHandler<FederalFormPayload> = async data => {\n await baseSubmitHandler(data, async payload => {\n const requestBody =\n payload.w4DataType === 'rev_2020_w4'\n ? {\n filingStatus: payload.filingStatus,\n twoJobs: payload.twoJobs === 'true',\n dependentsAmount: payload.dependentsAmount,\n otherIncome: payload.otherIncome,\n deductions: payload.deductions,\n extraWithholding: payload.extraWithholding,\n w4DataType: payload.w4DataType,\n version: employeeFederalTax.version,\n }\n : {\n filingStatus: payload.filingStatus,\n federalWithholdingAllowance: payload.federalWithholdingAllowance,\n additionalWithholding: payload.additionalWithholding,\n w4DataType: payload.w4DataType,\n version: employeeFederalTax.version,\n }\n\n const federalTaxesResponse = await updateFederalTaxes({\n request: {\n employeeUuid: employeeId,\n requestBody,\n },\n })\n onEvent(componentEvents.EMPLOYEE_FEDERAL_TAXES_UPDATED, federalTaxesResponse)\n onEvent(componentEvents.EMPLOYEE_FEDERAL_TAXES_DONE)\n })\n }\n\n return (\n <section className={className}>\n <FederalTaxesProvider\n value={{\n isPending,\n }}\n >\n <FormProvider {...formMethods}>\n <Form onSubmit={handleSubmit(onSubmit)}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <FederalForm />\n <Actions />\n </>\n )}\n </Form>\n </FormProvider>\n </FederalTaxesProvider>\n </section>\n )\n}\n"],"names":["FederalTaxes","props","jsx","BaseComponent","Root","employeeId","className","children","dictionary","onEvent","fieldErrors","baseSubmitHandler","useBase","useI18n","useComponentDictionary","fedData","useEmployeeTaxSetupGetFederalTaxesSuspense","employeeFederalTax","updateFederalTaxes","isPending","useEmployeeTaxSetupUpdateFederalTaxesMutation","defaultValues","formMethods","useForm","zodResolver","FederalFormSchema","handleSubmit","_setError","useEffect","msgObject","key","FederalTaxesProvider","FormProvider","Form","data","payload","requestBody","federalTaxesResponse","componentEvents","jsxs","Fragment","Head","FederalForm","Actions"],"mappings":";;;;;;;;;;;;;;;AAyBO,SAASA,GAAaC,GAAmD;AAC9E,SACE,gBAAAC,EAACC,KAAwC,GAAGF,GAC1C,4BAACG,GAAA,EAAM,GAAGH,GAAO,EAAA,CACnB;AAEJ;AAEA,MAAMG,IAAO,CAACH,MAA6B;AACzC,QAAM,EAAE,YAAAI,GAAY,WAAAC,GAAW,UAAAC,GAAU,YAAAC,MAAeP,GAClD,EAAE,SAAAQ,GAAS,aAAAC,GAAa,mBAAAC,EAAA,IAAsBC,EAAA;AACpD,EAAAC,EAAQ,uBAAuB,GAC/BC,EAAuB,yBAAyBN,CAAU;AAE1D,QAAM,EAAE,MAAMO,EAAA,IAAYC,EAA2C;AAAA,IACnE,cAAcX;AAAA,EAAA,CACf,GACKY,IAAqBF,EAAQ,oBAE7B,EAAE,aAAaG,GAAoB,WAAAC,EAAA,IACvCC,EAAA,GAIIC,IAFYJ,EAAmB,eAAe,gBAGhD;AAAA,IACE,YAAY;AAAA,IACZ,cAAcA,EAAmB,gBAAgB;AAAA,IACjD,SAASA,EAAmB,UAAU,SAAS;AAAA,IAC/C,YAAYA,EAAmB,aAAa,OAAOA,EAAmB,UAAU,IAAI;AAAA,IACpF,kBAAkBA,EAAmB,mBACjC,OAAOA,EAAmB,gBAAgB,IAC1C;AAAA,IACJ,aAAaA,EAAmB,cAAc,OAAOA,EAAmB,WAAW,IAAI;AAAA,IACvF,kBAAkBA,EAAmB,mBACjC,OAAOA,EAAmB,gBAAgB,IAC1C;AAAA,EAAA,IAEN;AAAA,IACE,YAAY;AAAA,IACZ,cAAcA,EAAmB,gBAAgB;AAAA,IACjD,6BAA6BA,EAAmB,+BAA+B;AAAA,IAC/E,uBAAuBA,EAAmB;AAAA,EAAA,GAG1CK,IAAcC,EAAwD;AAAA,IAC1E,UAAUC,E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AA3B,EAAQ6B,EAAgB,gCAAgCD,CAAoB,GAC5E5B,EAAQ6B,EAAgB,2BAA2B;AAAA,QACrD,CAAC;AAAA,MACH,CAU6C,GAClC,UAAA/B,KAGC,gBAAAgC,EAAAC,GAAA,EACE,UAAA;AAAA,QAAA,gBAAAtC,EAACuC,GAAA,EAAK;AAAA,0BACLC,GAAA,EAAY;AAAA,0BACZC,GAAA,CAAA,CAAQ;AAAA,MAAA,EAAA,CACX,GAEJ,EAAA,CACF;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
1
+ {"version":3,"file":"FederalTaxes.js","sources":["../../../../src/components/Employee/FederalTaxes/FederalTaxes.tsx"],"sourcesContent":["import { zodResolver } from '@hookform/resolvers/zod'\nimport { FormProvider, useForm, type SubmitHandler } from 'react-hook-form'\nimport { useEffect } from 'react'\nimport { useEmployeeTaxSetupGetFederalTaxesSuspense } from '@gusto/embedded-api/react-query/employeeTaxSetupGetFederalTaxes'\nimport { useEmployeeTaxSetupUpdateFederalTaxesMutation } from '@gusto/embedded-api/react-query/employeeTaxSetupUpdateFederalTaxes'\nimport { FederalForm } from './FederalForm'\nimport { FederalFormSchema, type FederalFormInputs, type FederalFormPayload } from './FederalForm'\nimport { Head } from './Head'\nimport { Actions } from './Actions'\nimport { FederalTaxesProvider } from './useFederalTaxes'\nimport {\n useBase,\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { useI18n } from '@/i18n'\nimport { normalizeErrorKeyForForm } from '@/helpers/formattedStrings'\nimport { componentEvents } from '@/shared/constants'\nimport { Form } from '@/components/Common/Form'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\ninterface FederalTaxesProps extends CommonComponentInterface<'Employee.FederalTaxes'> {\n employeeId: string\n}\n\nexport function FederalTaxes(props: FederalTaxesProps & BaseComponentInterface) {\n return (\n <BaseComponent<'Employee.FederalTaxes'> {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nconst Root = (props: FederalTaxesProps) => {\n const { employeeId, className, children, dictionary } = props\n const { onEvent, fieldErrors, baseSubmitHandler } = useBase()\n useI18n('Employee.FederalTaxes')\n useComponentDictionary('Employee.FederalTaxes', dictionary)\n\n const { data: fedData } = useEmployeeTaxSetupGetFederalTaxesSuspense({\n employeeUuid: employeeId,\n })\n const employeeFederalTax = fedData.employeeFederalTax!\n\n const { mutateAsync: updateFederalTaxes, isPending } =\n useEmployeeTaxSetupUpdateFederalTaxesMutation()\n\n const isRev2020 = employeeFederalTax.w4DataType === 'rev_2020_w4'\n\n const defaultValues: FederalFormInputs = isRev2020\n ? {\n w4DataType: 'rev_2020_w4',\n filingStatus: employeeFederalTax.filingStatus ?? '',\n twoJobs: employeeFederalTax.twoJobs ? 'true' : 'false',\n deductions: employeeFederalTax.deductions ? Number(employeeFederalTax.deductions) : 0,\n dependentsAmount: employeeFederalTax.dependentsAmount\n ? Number(employeeFederalTax.dependentsAmount)\n : 0,\n otherIncome: employeeFederalTax.otherIncome ? Number(employeeFederalTax.otherIncome) : 0,\n extraWithholding: employeeFederalTax.extraWithholding\n ? Number(employeeFederalTax.extraWithholding)\n : 0,\n }\n : {\n w4DataType: 'pre_2020_w4',\n filingStatus: employeeFederalTax.filingStatus ?? '',\n federalWithholdingAllowance: employeeFederalTax.federalWithholdingAllowance ?? 0,\n additionalWithholding: employeeFederalTax.additionalWithholding,\n }\n\n const formMethods = useForm<FederalFormInputs, unknown, FederalFormPayload>({\n resolver: zodResolver(FederalFormSchema),\n defaultValues,\n })\n const { handleSubmit, setError: _setError } = formMethods\n\n useEffect(() => {\n if (fieldErrors && fieldErrors.length > 0) {\n fieldErrors.forEach(msgObject => {\n const key = normalizeErrorKeyForForm(msgObject.errorKey)\n _setError(key as keyof FederalFormInputs, { type: 'custom', message: msgObject.message })\n })\n }\n }, [fieldErrors, _setError])\n\n const onSubmit: SubmitHandler<FederalFormPayload> = async data => {\n await baseSubmitHandler(data, async payload => {\n const requestBody =\n payload.w4DataType === 'rev_2020_w4'\n ? {\n filingStatus: payload.filingStatus,\n twoJobs: payload.twoJobs === 'true',\n dependentsAmount: payload.dependentsAmount,\n otherIncome: payload.otherIncome,\n deductions: payload.deductions,\n extraWithholding: payload.extraWithholding,\n w4DataType: payload.w4DataType,\n version: employeeFederalTax.version,\n }\n : {\n filingStatus: payload.filingStatus,\n federalWithholdingAllowance: payload.federalWithholdingAllowance,\n additionalWithholding: payload.additionalWithholding,\n w4DataType: payload.w4DataType,\n version: employeeFederalTax.version,\n }\n\n const federalTaxesResponse = await updateFederalTaxes({\n request: {\n employeeUuid: employeeId,\n requestBody,\n },\n })\n onEvent(componentEvents.EMPLOYEE_FEDERAL_TAXES_UPDATED, federalTaxesResponse)\n onEvent(componentEvents.EMPLOYEE_FEDERAL_TAXES_DONE)\n })\n }\n\n return (\n <section className={className}>\n <FederalTaxesProvider\n value={{\n isPending,\n }}\n >\n <FormProvider {...formMethods}>\n <Form onSubmit={handleSubmit(onSubmit)}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <FederalForm />\n <Actions />\n </>\n )}\n </Form>\n </FormProvider>\n </FederalTaxesProvider>\n </section>\n )\n}\n"],"names":["FederalTaxes","props","jsx","BaseComponent","Root","employeeId","className","children","dictionary","onEvent","fieldErrors","baseSubmitHandler","useBase","useI18n","useComponentDictionary","fedData","useEmployeeTaxSetupGetFederalTaxesSuspense","employeeFederalTax","updateFederalTaxes","isPending","useEmployeeTaxSetupUpdateFederalTaxesMutation","defaultValues","formMethods","useForm","zodResolver","FederalFormSchema","handleSubmit","_setError","useEffect","msgObject","key","normalizeErrorKeyForForm","FederalTaxesProvider","FormProvider","Form","data","payload","requestBody","federalTaxesResponse","componentEvents","jsxs","Fragment","Head","FederalForm","Actions"],"mappings":";;;;;;;;;;;;;;;;AA0BO,SAASA,GAAaC,GAAmD;AAC9E,SACE,gBAAAC,EAACC,KAAwC,GAAGF,GAC1C,4BAACG,GAAA,EAAM,GAAGH,GAAO,EAAA,CACnB;AAEJ;AAEA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X,GAEJ,EAAA,CACF;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
@@ -2,19 +2,20 @@ import "react/jsx-runtime";
2
2
  import "react";
3
3
  import "react-error-boundary";
4
4
  import "react-i18next";
5
- import "@gusto/embedded-api/models/errors/apierror";
5
+ import "@gusto/embedded-api/models/errors/gustoembeddederror";
6
6
  import "@gusto/embedded-api/models/errors/sdkvalidationerror";
7
7
  import "@tanstack/react-query";
8
8
  import "../../Base/useBase.js";
9
9
  import "../../../shared/constants.js";
10
+ import "classnames";
10
11
  import "../../../contexts/ComponentAdapter/useComponentContext.js";
11
12
  import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
12
13
  import "dompurify";
13
14
  import "../../../contexts/LocaleProvider/useLocale.js";
14
15
  import { createCompoundContext as o } from "../../Base/createCompoundContext.js";
15
- const [T, c] = o("FederalTaxesContext");
16
+ const [c, u] = o("FederalTaxesContext");
16
17
  export {
17
- c as FederalTaxesProvider,
18
- T as useFederalTaxes
18
+ u as FederalTaxesProvider,
19
+ c as useFederalTaxes
19
20
  };
20
21
  //# sourceMappingURL=useFederalTaxes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useFederalTaxes.js","sources":["../../../../src/components/Employee/FederalTaxes/useFederalTaxes.ts"],"sourcesContent":["import { createCompoundContext } from '@/components/Base'\n\ntype FederalTaxesContextType = {\n isPending: boolean\n}\n\nconst [useFederalTaxes, FederalTaxesProvider] =\n createCompoundContext<FederalTaxesContextType>('FederalTaxesContext')\nexport { useFederalTaxes, FederalTaxesProvider }\n"],"names":["useFederalTaxes","FederalTaxesProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;AAMA,MAAM,CAACA,GAAiBC,CAAoB,IAC1CC,EAA+C,qBAAqB;"}
1
+ {"version":3,"file":"useFederalTaxes.js","sources":["../../../../src/components/Employee/FederalTaxes/useFederalTaxes.ts"],"sourcesContent":["import { createCompoundContext } from '@/components/Base'\n\ntype FederalTaxesContextType = {\n isPending: boolean\n}\n\nconst [useFederalTaxes, FederalTaxesProvider] =\n createCompoundContext<FederalTaxesContextType>('FederalTaxesContext')\nexport { useFederalTaxes, FederalTaxesProvider }\n"],"names":["useFederalTaxes","FederalTaxesProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;AAMA,MAAM,CAACA,GAAiBC,CAAoB,IAC1CC,EAA+C,qBAAqB;"}
@@ -1,60 +1,66 @@
1
1
  import { jsx as e, jsxs as i } from "react/jsx-runtime";
2
2
  import { useTranslation as h } from "react-i18next";
3
- import { useEmployeesGetSuspense as y } from "@gusto/embedded-api/react-query/employeesGet";
4
- import { useCompaniesGetSuspense as x } from "@gusto/embedded-api/react-query/companiesGet";
5
- import m from "dompurify";
3
+ import { useEmployeesGetSuspense as g } from "@gusto/embedded-api/react-query/employeesGet";
4
+ import { useCompaniesGetSuspense as y } from "@gusto/embedded-api/react-query/companiesGet";
5
+ import s from "dompurify";
6
6
  import { useMemo as c } from "react";
7
- import l from "./Landing.module.scss.js";
8
- import { BaseComponent as C } from "../../Base/Base.js";
7
+ import { BaseComponent as x } from "../../Base/Base.js";
9
8
  import { useBase as E } from "../../Base/useBase.js";
10
9
  import { Flex as r } from "../../Common/Flex/Flex.js";
11
- import { ActionsLayout as D } from "../../Common/ActionsLayout/ActionsLayout.js";
12
- import { useComponentContext as N } from "../../../contexts/ComponentAdapter/useComponentContext.js";
13
- import { useI18n as I, useComponentDictionary as L } from "../../../i18n/I18n.js";
14
- import { componentEvents as S } from "../../../shared/constants.js";
15
- function P(t) {
16
- return I("Employee.Landing"), L("Employee.Landing", t.dictionary), /* @__PURE__ */ e(C, { ...t, children: /* @__PURE__ */ e(T, { ...t, children: t.children }) });
10
+ import "classnames";
11
+ import { componentEvents as C } from "../../../shared/constants.js";
12
+ import { ActionsLayout as L } from "../../Common/ActionsLayout/ActionsLayout.js";
13
+ import { useComponentContext as S } from "../../../contexts/ComponentAdapter/useComponentContext.js";
14
+ import { useI18n as D, useComponentDictionary as I } from "../../../i18n/I18n.js";
15
+ import N from "../../../assets/icons/icon-arrow-right.svg.js";
16
+ function w(o) {
17
+ return D("Employee.Landing"), I("Employee.Landing", o.dictionary), /* @__PURE__ */ e(x, { ...o, children: /* @__PURE__ */ e(v, { ...o, children: o.children }) });
17
18
  }
18
- const T = ({ employeeId: t, companyId: p, className: d }) => {
19
- const { onEvent: f } = E(), o = N(), {
20
- data: { employee: s }
21
- } = y({ employeeId: t }), u = c(() => m.sanitize(s.firstName), [s]), {
22
- data: { company: a }
23
- } = x({ companyId: p }), g = c(() => m.sanitize(a?.name ?? ""), [a]), { t: n } = h("Employee.Landing");
24
- return /* @__PURE__ */ e("section", { className: d, children: /* @__PURE__ */ i(r, { alignItems: "center", flexDirection: "column", gap: 32, children: [
25
- /* @__PURE__ */ i(r, { alignItems: "center", flexDirection: "column", gap: 8, children: [
26
- /* @__PURE__ */ e(o.Heading, { as: "h2", textAlign: "center", children: n("landingSubtitle", {
27
- firstName: u,
28
- companyName: g,
29
- interpolation: { escapeValue: !1 }
30
- }) }),
31
- /* @__PURE__ */ e(o.Text, { className: l.description, children: n("landingDescription") })
32
- ] }),
33
- /* @__PURE__ */ i(r, { flexDirection: "column", gap: 8, children: [
34
- /* @__PURE__ */ e(o.Heading, { as: "h3", children: n("stepsSubtitle") }),
35
- /* @__PURE__ */ e(
36
- o.UnorderedList,
37
- {
38
- items: [n("steps.personalInfo"), n("steps.taxInfo"), n("steps.bankInfo")]
39
- }
40
- )
41
- ] }),
42
- /* @__PURE__ */ i(r, { flexDirection: "column", alignItems: "center", gap: 8, children: [
43
- /* @__PURE__ */ e(D, { justifyContent: "center", children: /* @__PURE__ */ e(
44
- o.Button,
19
+ const v = ({ employeeId: o, companyId: p, className: l }) => {
20
+ const { onEvent: d } = E(), t = S(), {
21
+ data: { employee: a }
22
+ } = g({ employeeId: o }), f = c(() => s.sanitize(a.firstName), [a]), {
23
+ data: { company: m }
24
+ } = y({ companyId: p }), u = c(() => s.sanitize(m?.name ?? ""), [m]), { t: n } = h("Employee.Landing");
25
+ return /* @__PURE__ */ e("section", { className: l, children: /* @__PURE__ */ e(
26
+ t.Box,
27
+ {
28
+ footer: /* @__PURE__ */ e(L, { children: /* @__PURE__ */ i(
29
+ t.Button,
45
30
  {
46
31
  variant: "secondary",
47
32
  onClick: () => {
48
- f(S.EMPLOYEE_SELF_ONBOARDING_START);
33
+ d(C.EMPLOYEE_SELF_ONBOARDING_START);
49
34
  },
50
- children: n("getStartedCta")
35
+ children: [
36
+ n("getStartedCta"),
37
+ /* @__PURE__ */ e(N, { "aria-hidden": !0 })
38
+ ]
51
39
  }
52
40
  ) }),
53
- /* @__PURE__ */ e(o.Text, { className: l.description, children: n("getStartedDescription") })
54
- ] })
55
- ] }) });
41
+ children: /* @__PURE__ */ i(r, { alignItems: "center", flexDirection: "column", gap: 32, children: [
42
+ /* @__PURE__ */ i(r, { flexDirection: "column", gap: 4, children: [
43
+ /* @__PURE__ */ e(t.Heading, { as: "h2", children: n("landingSubtitle", {
44
+ firstName: f,
45
+ companyName: u,
46
+ interpolation: { escapeValue: !1 }
47
+ }) }),
48
+ /* @__PURE__ */ e(t.Text, { variant: "supporting", children: n("landingDescription") })
49
+ ] }),
50
+ /* @__PURE__ */ i(r, { flexDirection: "column", gap: 8, children: [
51
+ /* @__PURE__ */ e(t.Heading, { as: "h3", children: n("stepsSubtitle") }),
52
+ /* @__PURE__ */ e(
53
+ t.UnorderedList,
54
+ {
55
+ items: [n("steps.personalInfo"), n("steps.taxInfo"), n("steps.bankInfo")]
56
+ }
57
+ )
58
+ ] })
59
+ ] })
60
+ }
61
+ ) });
56
62
  };
57
63
  export {
58
- P as Landing
64
+ w as Landing
59
65
  };
60
66
  //# sourceMappingURL=Landing.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Landing.js","sources":["../../../../src/components/Employee/Landing/Landing.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useEmployeesGetSuspense } from '@gusto/embedded-api/react-query/employeesGet'\nimport { useCompaniesGetSuspense } from '@gusto/embedded-api/react-query/companiesGet'\nimport DOMPurify from 'dompurify'\nimport { useMemo } from 'react'\nimport styles from './Landing.module.scss'\nimport {\n BaseComponent,\n useBase,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { Flex, ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\ninterface SummaryProps extends CommonComponentInterface<'Employee.Landing'> {\n employeeId: string\n companyId: string\n}\n\nexport function Landing(props: SummaryProps & BaseComponentInterface) {\n useI18n('Employee.Landing')\n useComponentDictionary('Employee.Landing', props.dictionary)\n\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nconst Root = ({ employeeId, companyId, className }: SummaryProps) => {\n const { onEvent } = useBase()\n const Components = useComponentContext()\n\n const {\n data: { employee },\n } = useEmployeesGetSuspense({ employeeId })\n const sanitizedFirstName = useMemo(() => DOMPurify.sanitize(employee!.firstName), [employee])\n\n const {\n data: { company },\n } = useCompaniesGetSuspense({ companyId })\n const sanitizedCompanyName = useMemo(() => DOMPurify.sanitize(company?.name ?? ''), [company])\n\n const { t } = useTranslation('Employee.Landing')\n\n return (\n <section className={className}>\n <Flex alignItems=\"center\" flexDirection=\"column\" gap={32}>\n <Flex alignItems=\"center\" flexDirection=\"column\" gap={8}>\n <Components.Heading as=\"h2\" textAlign=\"center\">\n {t('landingSubtitle', {\n firstName: sanitizedFirstName,\n companyName: sanitizedCompanyName,\n interpolation: { escapeValue: false },\n })}\n </Components.Heading>\n <Components.Text className={styles.description}>\n {t('landingDescription')}\n </Components.Text>\n </Flex>\n <Flex flexDirection=\"column\" gap={8}>\n <Components.Heading as=\"h3\">{t('stepsSubtitle')}</Components.Heading>\n <Components.UnorderedList\n items={[t('steps.personalInfo'), t('steps.taxInfo'), t('steps.bankInfo')]}\n />\n </Flex>\n <Flex flexDirection=\"column\" alignItems=\"center\" gap={8}>\n <ActionsLayout justifyContent=\"center\">\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n onEvent(componentEvents.EMPLOYEE_SELF_ONBOARDING_START)\n }}\n >\n {t('getStartedCta')}\n </Components.Button>\n </ActionsLayout>\n <Components.Text className={styles.description}>\n {t('getStartedDescription')}\n </Components.Text>\n </Flex>\n </Flex>\n </section>\n )\n}\n"],"names":["Landing","props","useI18n","useComponentDictionary","jsx","BaseComponent","Root","employeeId","companyId","className","onEvent","useBase","Components","useComponentContext","employee","useEmployeesGetSuspense","sanitizedFirstName","useMemo","DOMPurify","company","useCompaniesGetSuspense","sanitizedCompanyName","t","useTranslation","jsxs","Flex","styles","ActionsLayout","componentEvents"],"mappings":";;;;;;;;;;;;;;AAuBO,SAASA,EAAQC,GAA8C;AACpE,SAAAC,EAAQ,kBAAkB,GAC1BC,EAAuB,oBAAoBF,EAAM,UAAU,GAGzD,gBAAAG,EAACC,GAAA,EAAe,GAAGJ,GACjB,UAAA,gBAAAG,EAACE,KAAM,GAAGL,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,MAAMK,IAAO,CAAC,EAAE,YAAAC,GAAY,WAAAC,GAAW,WAAAC,QAA8B;AACnE,QAAM,EAAE,SAAAC,EAAA,IAAYC,EAAA,GACdC,IAAaC,EAAA,GAEb;AAAA,IACJ,MAAM,EAAE,UAAAC,EAAA;AAAA,EAAS,IACfC,EAAwB,EAAE,YAAAR,GAAY,GACpCS,IAAqBC,EAAQ,MAAMC,EAAU,SAASJ,EAAU,SAAS,GAAG,CAACA,CAAQ,CAAC,GAEtF;AAAA,IACJ,MAAM,EAAE,SAAAK,EAAA;AAAA,EAAQ,IACdC,EAAwB,EAAE,WAAAZ,GAAW,GACnCa,IAAuBJ,EAAQ,MAAMC,EAAU,SAASC,GAAS,QAAQ,EAAE,GAAG,CAACA,CAAO,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MAAX,EAAgB,WAAWc,EAAO,aAChC,UAAAJ,EAAE,uBAAuB,EAAA,CAC5B;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,EAAA,CACF,EAAA,CACF;AAEJ;"}
1
+ {"version":3,"file":"Landing.js","sources":["../../../../src/components/Employee/Landing/Landing.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useEmployeesGetSuspense } from '@gusto/embedded-api/react-query/employeesGet'\nimport { useCompaniesGetSuspense } from '@gusto/embedded-api/react-query/companiesGet'\nimport DOMPurify from 'dompurify'\nimport { useMemo } from 'react'\nimport {\n BaseComponent,\n useBase,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { Flex, ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { useComponentDictionary } from '@/i18n/I18n'\nimport ArrowRightIcon from '@/assets/icons/icon-arrow-right.svg?react'\n\ninterface SummaryProps extends CommonComponentInterface<'Employee.Landing'> {\n employeeId: string\n companyId: string\n}\n\nexport function Landing(props: SummaryProps & BaseComponentInterface) {\n useI18n('Employee.Landing')\n useComponentDictionary('Employee.Landing', props.dictionary)\n\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nconst Root = ({ employeeId, companyId, className }: SummaryProps) => {\n const { onEvent } = useBase()\n const Components = useComponentContext()\n\n const {\n data: { employee },\n } = useEmployeesGetSuspense({ employeeId })\n const sanitizedFirstName = useMemo(() => DOMPurify.sanitize(employee!.firstName), [employee])\n\n const {\n data: { company },\n } = useCompaniesGetSuspense({ companyId })\n const sanitizedCompanyName = useMemo(() => DOMPurify.sanitize(company?.name ?? ''), [company])\n\n const { t } = useTranslation('Employee.Landing')\n\n return (\n <section className={className}>\n <Components.Box\n footer={\n <ActionsLayout>\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n onEvent(componentEvents.EMPLOYEE_SELF_ONBOARDING_START)\n }}\n >\n {t('getStartedCta')}\n <ArrowRightIcon aria-hidden />\n </Components.Button>\n </ActionsLayout>\n }\n >\n <Flex alignItems=\"center\" flexDirection=\"column\" gap={32}>\n <Flex flexDirection=\"column\" gap={4}>\n <Components.Heading as=\"h2\">\n {t('landingSubtitle', {\n firstName: sanitizedFirstName,\n companyName: sanitizedCompanyName,\n interpolation: { escapeValue: false },\n })}\n </Components.Heading>\n <Components.Text variant=\"supporting\">{t('landingDescription')}</Components.Text>\n </Flex>\n <Flex flexDirection=\"column\" gap={8}>\n <Components.Heading as=\"h3\">{t('stepsSubtitle')}</Components.Heading>\n <Components.UnorderedList\n items={[t('steps.personalInfo'), t('steps.taxInfo'), t('steps.bankInfo')]}\n />\n </Flex>\n </Flex>\n </Components.Box>\n </section>\n )\n}\n"],"names":["Landing","props","useI18n","useComponentDictionary","jsx","BaseComponent","Root","employeeId","companyId","className","onEvent","useBase","Components","useComponentContext","employee","useEmployeesGetSuspense","sanitizedFirstName","useMemo","DOMPurify","company","useCompaniesGetSuspense","sanitizedCompanyName","t","useTranslation","ActionsLayout","jsxs","componentEvents","ArrowRightIcon","Flex"],"mappings":";;;;;;;;;;;;;;;AAuBO,SAASA,EAAQC,GAA8C;AACpE,SAAAC,EAAQ,kBAAkB,GAC1BC,EAAuB,oBAAoBF,EAAM,UAAU,GAGzD,gBAAAG,EAACC,GAAA,EAAe,GAAGJ,GACjB,UAAA,gBAAAG,EAACE,KAAM,GAAGL,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,MAAMK,IAAO,CAAC,EAAE,YAAAC,GAAY,WAAAC,GAAW,WAAAC,QAA8B;AACnE,QAAM,EAAE,SAAAC,EAAA,IAAYC,EAAA,GACdC,IAAaC,EAAA,GAEb;AAAA,IACJ,MAAM,EAAE,UAAAC,EAAA;AAAA,EAAS,IACfC,EAAwB,EAAE,YAAAR,GAAY,GACpCS,IAAqB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B,IAAG,MAAM,UAAAU,EAAE,eAAe,GAAE;AAAA,UAChD,gBAAAlB;AAAA,YAACQ,EAAW;AAAA,YAAX;AAAA,cACC,OAAO,CAACU,EAAE,oBAAoB,GAAGA,EAAE,eAAe,GAAGA,EAAE,gBAAgB,CAAC;AAAA,YAAA;AAAA,UAAA;AAAA,QAC1E,EAAA,CACF;AAAA,MAAA,EAAA,CACF;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
@@ -9,10 +9,10 @@ import r from "./OnboardingSummary.module.scss.js";
9
9
  import { BaseComponent as P } from "../../Base/Base.js";
10
10
  import { useBase as R } from "../../Base/useBase.js";
11
11
  import { Flex as d } from "../../Common/Flex/Flex.js";
12
- import { ActionsLayout as E } from "../../Common/ActionsLayout/ActionsLayout.js";
12
+ import { componentEvents as E, EmployeeOnboardingStatus as N } from "../../../shared/constants.js";
13
+ import { ActionsLayout as O } from "../../Common/ActionsLayout/ActionsLayout.js";
13
14
  import { useComponentContext as T } from "../../../contexts/ComponentAdapter/useComponentContext.js";
14
15
  import { useI18n as _, useComponentDictionary as w } from "../../../i18n/I18n.js";
15
- import { componentEvents as N, EmployeeOnboardingStatus as O } from "../../../shared/constants.js";
16
16
  import F from "../../../assets/icons/success_check.svg.js";
17
17
  import G from "../../../assets/icons/unchecked_circular.svg.js";
18
18
  import { useFlow as M } from "../../Flow/useFlow.js";
@@ -22,7 +22,7 @@ function j(n) {
22
22
  const k = ({ employeeId: n, className: c, isAdmin: m = !1 }) => {
23
23
  const { onEvent: a } = R(), { t } = b("Employee.OnboardingSummary"), o = T(), {
24
24
  data: { employee: x }
25
- } = B({ employeeId: n }), { firstName: u, lastName: p } = x, { data: C } = L({ employeeId: n }), { onboardingStatus: h, onboardingSteps: l } = C.employeeOnboardingStatus, I = l?.length && l.findIndex((i) => i.required && !i.completed) > -1, f = h === O.ONBOARDING_COMPLETED || !I && h === O.SELF_ONBOARDING_PENDING_INVITE, D = S(() => y.sanitize(u), [u]), v = S(() => y.sanitize(p), [p]);
25
+ } = B({ employeeId: n }), { firstName: u, lastName: p } = x, { data: C } = L({ employeeId: n }), { onboardingStatus: h, onboardingSteps: l } = C.employeeOnboardingStatus, I = l?.length && l.findIndex((i) => i.required && !i.completed) > -1, f = h === N.ONBOARDING_COMPLETED || !I && h === N.SELF_ONBOARDING_PENDING_INVITE, D = S(() => y.sanitize(u), [u]), v = S(() => y.sanitize(p), [p]);
26
26
  return /* @__PURE__ */ e("section", { className: c, children: /* @__PURE__ */ s(d, { flexDirection: "column", gap: 32, children: [
27
27
  /* @__PURE__ */ e(d, { alignItems: "center", flexDirection: "column", gap: 8, children: m ? f ? /* @__PURE__ */ s(g, { children: [
28
28
  /* @__PURE__ */ e(o.Heading, { as: "h2", textAlign: "center", children: t("onboardedAdminSubtitle", {
@@ -47,23 +47,23 @@ const k = ({ employeeId: n, className: c, isAdmin: m = !1 }) => {
47
47
  ] }) : /* @__PURE__ */ s(g, { children: [
48
48
  /* @__PURE__ */ e(o.Heading, { as: "h2", textAlign: "center", children: t("onboardedSelfSubtitle") }),
49
49
  /* @__PURE__ */ e(o.Text, { className: r.description, children: t("onboardedSelfDescription") }),
50
- /* @__PURE__ */ e(E, { justifyContent: f ? "center" : "start", children: /* @__PURE__ */ e(
50
+ /* @__PURE__ */ e(O, { justifyContent: f ? "center" : "start", children: /* @__PURE__ */ e(
51
51
  o.Button,
52
52
  {
53
53
  variant: "secondary",
54
54
  onClick: () => {
55
- a(N.EMPLOYEE_ONBOARDING_DONE);
55
+ a(E.EMPLOYEE_ONBOARDING_DONE);
56
56
  },
57
57
  children: t("doneCta")
58
58
  }
59
59
  ) })
60
60
  ] }) }),
61
- m && /* @__PURE__ */ e(E, { justifyContent: "center", children: /* @__PURE__ */ e(
61
+ m && /* @__PURE__ */ e(O, { justifyContent: "center", children: /* @__PURE__ */ e(
62
62
  o.Button,
63
63
  {
64
64
  variant: "secondary",
65
65
  onClick: () => {
66
- a(N.EMPLOYEES_LIST);
66
+ a(E.EMPLOYEES_LIST);
67
67
  },
68
68
  children: t("doneCta")
69
69
  }
@@ -2,19 +2,20 @@ import { jsxs as d, jsx as e } from "react/jsx-runtime";
2
2
  import { useTranslation as m } from "react-i18next";
3
3
  import { usePaymentMethod as l } from "./usePaymentMethod.js";
4
4
  import "../../../shared/constants.js";
5
+ import "classnames";
5
6
  import { ActionsLayout as p } from "../../Common/ActionsLayout/ActionsLayout.js";
6
7
  import { useComponentContext as u } from "../../../contexts/ComponentAdapter/useComponentContext.js";
7
8
  import "react";
8
- const P = () => {
9
- const { handleAdd: i, handleCancel: a, isPending: r, bankAccounts: s, handleSplit: c, mode: t } = l(), { t: n } = m("Employee.PaymentMethod"), o = u();
9
+ const S = () => {
10
+ const { handleAdd: i, handleCancel: r, isPending: a, bankAccounts: s, handleSplit: c, mode: t } = l(), { t: n } = m("Employee.PaymentMethod"), o = u();
10
11
  return /* @__PURE__ */ d(p, { children: [
11
- (t === "ADD" || t === "SPLIT") && /* @__PURE__ */ e(o.Button, { variant: "secondary", type: "button", onClick: a, children: n("cancelAddCta") }),
12
+ (t === "ADD" || t === "SPLIT") && /* @__PURE__ */ e(o.Button, { variant: "secondary", type: "button", onClick: r, children: n("cancelAddCta") }),
12
13
  t === "LIST" && s.length > 1 && /* @__PURE__ */ e(o.Button, { variant: "secondary", type: "button", onClick: c, children: n("splitCta") }),
13
14
  t === "LIST" && /* @__PURE__ */ e(o.Button, { variant: "secondary", type: "button", onClick: i, children: n("addAnotherCta") }),
14
- /* @__PURE__ */ e(o.Button, { type: "submit", isLoading: r, children: n(t === "ADD" || t === "SPLIT" ? "saveCta" : "submitCta") })
15
+ /* @__PURE__ */ e(o.Button, { type: "submit", isLoading: a, children: n(t === "ADD" || t === "SPLIT" ? "saveCta" : "submitCta") })
15
16
  ] });
16
17
  };
17
18
  export {
18
- P as Actions
19
+ S as Actions
19
20
  };
20
21
  //# sourceMappingURL=Actions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Actions.js","sources":["../../../../src/components/Employee/PaymentMethod/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { usePaymentMethod } from './usePaymentMethod'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { handleAdd, handleCancel, isPending, bankAccounts, handleSplit, mode } = usePaymentMethod()\n const { t } = useTranslation('Employee.PaymentMethod')\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n {(mode === 'ADD' || mode === 'SPLIT') && (\n <Components.Button variant=\"secondary\" type=\"button\" onClick={handleCancel}>\n {t('cancelAddCta')}\n </Components.Button>\n )}\n {mode === 'LIST' && bankAccounts.length > 1 && (\n <Components.Button variant=\"secondary\" type=\"button\" onClick={handleSplit}>\n {t('splitCta')}\n </Components.Button>\n )}\n {mode === 'LIST' && (\n <Components.Button variant=\"secondary\" type=\"button\" onClick={handleAdd}>\n {t('addAnotherCta')}\n </Components.Button>\n )}\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t(mode === 'ADD' || mode === 'SPLIT' ? 'saveCta' : 'submitCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","handleAdd","handleCancel","isPending","bankAccounts","handleSplit","mode","usePaymentMethod","t","useTranslation","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;;;;;AAKO,MAAMA,IAAU,MAAM;AAC3B,QAAM,EAAE,WAAAC,GAAW,cAAAC,GAAc,WAAAC,GAAW,cAAAC,GAAc,aAAAC,GAAa,MAAAC,EAAA,IAASC,EAAA,GAC1E,EAAE,GAAAC,EAAA,IAAMC,EAAe,wBAAwB,GAC/CC,IAAaC,EAAA;AAEnB,2BACGC,GAAA,EACG,UAAA;AAAA,KAAAN,MAAS,SAASA,MAAS,YAC3B,gBAAAO,EAACH,EAAW,QAAX,EAAkB,SAAQ,aAAY,MAAK,UAAS,SAASR,GAC3D,UAAAM,EAAE,cAAc,GACnB;AAAA,IAEDF,MAAS,UAAUF,EAAa,SAAS,uBACvCM,EAAW,QAAX,EAAkB,SAAQ,aAAY,MAAK,UAAS,SAASL,GAC3D,UAAAG,EAAE,UAAU,GACf;AAAA,IAEDF,MAAS,UACR,gBAAAO,EAACH,EAAW,QAAX,EAAkB,SAAQ,aAAY,MAAK,UAAS,SAAST,GAC3D,UAAAO,EAAE,eAAe,GACpB;AAAA,IAEF,gBAAAK,EAACH,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWP,GACzC,UAAAK,EAAEF,MAAS,SAASA,MAAS,UAAU,YAAY,WAAW,EAAA,CACjE;AAAA,EAAA,GACF;AAEJ;"}
1
+ {"version":3,"file":"Actions.js","sources":["../../../../src/components/Employee/PaymentMethod/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { usePaymentMethod } from './usePaymentMethod'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { handleAdd, handleCancel, isPending, bankAccounts, handleSplit, mode } = usePaymentMethod()\n const { t } = useTranslation('Employee.PaymentMethod')\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n {(mode === 'ADD' || mode === 'SPLIT') && (\n <Components.Button variant=\"secondary\" type=\"button\" onClick={handleCancel}>\n {t('cancelAddCta')}\n </Components.Button>\n )}\n {mode === 'LIST' && bankAccounts.length > 1 && (\n <Components.Button variant=\"secondary\" type=\"button\" onClick={handleSplit}>\n {t('splitCta')}\n </Components.Button>\n )}\n {mode === 'LIST' && (\n <Components.Button variant=\"secondary\" type=\"button\" onClick={handleAdd}>\n {t('addAnotherCta')}\n </Components.Button>\n )}\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t(mode === 'ADD' || mode === 'SPLIT' ? 'saveCta' : 'submitCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","handleAdd","handleCancel","isPending","bankAccounts","handleSplit","mode","usePaymentMethod","t","useTranslation","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;;;;;;AAKO,MAAMA,IAAU,MAAM;AAC3B,QAAM,EAAE,WAAAC,GAAW,cAAAC,GAAc,WAAAC,GAAW,cAAAC,GAAc,aAAAC,GAAa,MAAAC,EAAA,IAASC,EAAA,GAC1E,EAAE,GAAAC,EAAA,IAAMC,EAAe,wBAAwB,GAC/CC,IAAaC,EAAA;AAEnB,2BACGC,GAAA,EACG,UAAA;AAAA,KAAAN,MAAS,SAASA,MAAS,YAC3B,gBAAAO,EAACH,EAAW,QAAX,EAAkB,SAAQ,aAAY,MAAK,UAAS,SAASR,GAC3D,UAAAM,EAAE,cAAc,GACnB;AAAA,IAEDF,MAAS,UAAUF,EAAa,SAAS,uBACvCM,EAAW,QAAX,EAAkB,SAAQ,aAAY,MAAK,UAAS,SAASL,GAC3D,UAAAG,EAAE,UAAU,GACf;AAAA,IAEDF,MAAS,UACR,gBAAAO,EAACH,EAAW,QAAX,EAAkB,SAAQ,aAAY,MAAK,UAAS,SAAST,GAC3D,UAAAO,EAAE,eAAe,GACpB;AAAA,IAEF,gBAAAK,EAACH,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWP,GACzC,UAAAK,EAAEF,MAAS,SAASA,MAAS,UAAU,YAAY,WAAW,EAAA,CACjE;AAAA,EAAA,GACF;AAEJ;"}
@@ -3,11 +3,12 @@ import { useFormContext as m } from "react-hook-form";
3
3
  import { useTranslation as s } from "react-i18next";
4
4
  import { usePaymentMethod as c } from "./usePaymentMethod.js";
5
5
  import { PAYMENT_METHODS as l } from "../../../shared/constants.js";
6
+ import "classnames";
7
+ import { RadioGroupField as p } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
8
+ import { TextInputField as o } from "../../Common/Fields/TextInputField/TextInputField.js";
6
9
  import "../../../contexts/ComponentAdapter/useComponentContext.js";
7
10
  import "react";
8
- import { TextInputField as o } from "../../Common/Fields/TextInputField/TextInputField.js";
9
- import { RadioGroupField as p } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
10
- const M = () => {
11
+ const k = () => {
11
12
  const { mode: t, watchedType: a } = c(), { t: e } = s("Employee.PaymentMethod"), { setValue: n } = m();
12
13
  if (!(t !== "ADD" && t !== "INITIAL" || a === l.check))
13
14
  return n("hasBankPayload", !0), /* @__PURE__ */ i(u, { children: [
@@ -54,6 +55,6 @@ const M = () => {
54
55
  ] });
55
56
  };
56
57
  export {
57
- M as BankAccountForm
58
+ k as BankAccountForm
58
59
  };
59
60
  //# sourceMappingURL=BankAccountEdit.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BankAccountEdit.js","sources":["../../../../src/components/Employee/PaymentMethod/BankAccountEdit.tsx"],"sourcesContent":["import { useFormContext } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport type { BankAccountInputs } from './BankAccount'\nimport { usePaymentMethod } from './usePaymentMethod'\nimport { RadioGroupField, TextInputField } from '@/components/Common'\nimport { PAYMENT_METHODS } from '@/shared/constants'\n\nexport const BankAccountForm = () => {\n const { mode, watchedType } = usePaymentMethod()\n const { t } = useTranslation('Employee.PaymentMethod')\n const { setValue } = useFormContext<BankAccountInputs>()\n\n if ((mode !== 'ADD' && mode !== 'INITIAL') || watchedType === PAYMENT_METHODS.check) {\n return\n }\n //Used by form schema to determine variant\n setValue('hasBankPayload', true)\n\n return (\n <>\n <TextInputField\n name=\"name\"\n isRequired\n label={t('nameLabel')}\n errorMessage={t('validations.accountName')}\n />\n\n <TextInputField\n name=\"routingNumber\"\n label={t('routingNumberLabel')}\n isRequired\n description={t('routingNumberDescription')}\n errorMessage={t('validations.routingNumber')}\n />\n\n <TextInputField\n name=\"accountNumber\"\n label={t('accountNumberLabel')}\n errorMessage={t('validations.accountNumber')}\n isRequired\n />\n\n <RadioGroupField\n name=\"accountType\"\n isRequired\n label={t('accountTypeLabel')}\n options={[\n { value: 'Checking', label: t('accountTypeChecking') },\n { value: 'Savings', label: t('accountTypeSavings') },\n ]}\n />\n </>\n )\n}\n"],"names":["BankAccountForm","mode","watchedType","usePaymentMethod","t","useTranslation","setValue","useFormContext","PAYMENT_METHODS","jsxs","Fragment","jsx","TextInputField","RadioGroupField"],"mappings":";;;;;;;;;AAOO,MAAMA,IAAkB,MAAM;AACnC,QAAM,EAAE,MAAAC,GAAM,aAAAC,EAAA,IAAgBC,EAAA,GACxB,EAAE,GAAAC,EAAA,IAAMC,EAAe,wBAAwB,GAC/C,EAAE,UAAAC,EAAA,IAAaC,EAAA;AAErB,MAAK,EAAAN,MAAS,SAASA,MAAS,aAAcC,MAAgBM,EAAgB;AAI9E,WAAAF,EAAS,kBAAkB,EAAI,GAG7B,gBAAAG,EAAAC,GAAA,EACE,UAAA;AAAA,MAAA,gBAAAC;AAAA,QAACC;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,YAAU;AAAA,UACV,OAAOR,EAAE,WAAW;AAAA,UACpB,cAAcA,EAAE,yBAAyB;AAAA,QAAA;AAAA,MAAA;AAAA,MAG3C,gBAAAO;AAAA,QAACC;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,OAAOR,EAAE,oBAAoB;AAAA,UAC7B,YAAU;AAAA,UACV,aAAaA,EAAE,0BAA0B;AAAA,UACzC,cAAcA,EAAE,2BAA2B;AAAA,QAAA;AAAA,MAAA;AAAA,MAG7C,gBAAAO;AAAA,QAACC;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,OAAOR,EAAE,oBAAoB;AAAA,UAC7B,cAAcA,EAAE,2BAA2B;AAAA,UAC3C,YAAU;AAAA,QAAA;AAAA,MAAA;AAAA,MAGZ,gBAAAO;AAAA,QAACE;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,YAAU;AAAA,UACV,OAAOT,EAAE,kBAAkB;AAAA,UAC3B,SAAS;AAAA,YACP,EAAE,OAAO,YAAY,OAAOA,EAAE,qBAAqB,EAAA;AAAA,YACnD,EAAE,OAAO,WAAW,OAAOA,EAAE,oBAAoB,EAAA;AAAA,UAAE;AAAA,QACrD;AAAA,MAAA;AAAA,IACF,GACF;AAEJ;"}
1
+ {"version":3,"file":"BankAccountEdit.js","sources":["../../../../src/components/Employee/PaymentMethod/BankAccountEdit.tsx"],"sourcesContent":["import { useFormContext } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport type { BankAccountInputs } from './BankAccount'\nimport { usePaymentMethod } from './usePaymentMethod'\nimport { RadioGroupField, TextInputField } from '@/components/Common'\nimport { PAYMENT_METHODS } from '@/shared/constants'\n\nexport const BankAccountForm = () => {\n const { mode, watchedType } = usePaymentMethod()\n const { t } = useTranslation('Employee.PaymentMethod')\n const { setValue } = useFormContext<BankAccountInputs>()\n\n if ((mode !== 'ADD' && mode !== 'INITIAL') || watchedType === PAYMENT_METHODS.check) {\n return\n }\n //Used by form schema to determine variant\n setValue('hasBankPayload', true)\n\n return (\n <>\n <TextInputField\n name=\"name\"\n isRequired\n label={t('nameLabel')}\n errorMessage={t('validations.accountName')}\n />\n\n <TextInputField\n name=\"routingNumber\"\n label={t('routingNumberLabel')}\n isRequired\n description={t('routingNumberDescription')}\n errorMessage={t('validations.routingNumber')}\n />\n\n <TextInputField\n name=\"accountNumber\"\n label={t('accountNumberLabel')}\n errorMessage={t('validations.accountNumber')}\n isRequired\n />\n\n <RadioGroupField\n name=\"accountType\"\n isRequired\n label={t('accountTypeLabel')}\n options={[\n { value: 'Checking', label: t('accountTypeChecking') },\n { value: 'Savings', label: t('accountTypeSavings') },\n ]}\n />\n </>\n )\n}\n"],"names":["BankAccountForm","mode","watchedType","usePaymentMethod","t","useTranslation","setValue","useFormContext","PAYMENT_METHODS","jsxs","Fragment","jsx","TextInputField","RadioGroupField"],"mappings":";;;;;;;;;;AAOO,MAAMA,IAAkB,MAAM;AACnC,QAAM,EAAE,MAAAC,GAAM,aAAAC,EAAA,IAAgBC,EAAA,GACxB,EAAE,GAAAC,EAAA,IAAMC,EAAe,wBAAwB,GAC/C,EAAE,UAAAC,EAAA,IAAaC,EAAA;AAErB,MAAK,EAAAN,MAAS,SAASA,MAAS,aAAcC,MAAgBM,EAAgB;AAI9E,WAAAF,EAAS,kBAAkB,EAAI,GAG7B,gBAAAG,EAAAC,GAAA,EACE,UAAA;AAAA,MAAA,gBAAAC;AAAA,QAACC;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,YAAU;AAAA,UACV,OAAOR,EAAE,WAAW;AAAA,UACpB,cAAcA,EAAE,yBAAyB;AAAA,QAAA;AAAA,MAAA;AAAA,MAG3C,gBAAAO;AAAA,QAACC;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,OAAOR,EAAE,oBAAoB;AAAA,UAC7B,YAAU;AAAA,UACV,aAAaA,EAAE,0BAA0B;AAAA,UACzC,cAAcA,EAAE,2BAA2B;AAAA,QAAA;AAAA,MAAA;AAAA,MAG7C,gBAAAO;AAAA,QAACC;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,OAAOR,EAAE,oBAAoB;AAAA,UAC7B,cAAcA,EAAE,2BAA2B;AAAA,UAC3C,YAAU;AAAA,QAAA;AAAA,MAAA;AAAA,MAGZ,gBAAAO;AAAA,QAACE;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,YAAU;AAAA,UACV,OAAOT,EAAE,kBAAkB;AAAA,UAC3B,SAAS;AAAA,YACP,EAAE,OAAO,YAAY,OAAOA,EAAE,qBAAqB,EAAA;AAAA,YACnD,EAAE,OAAO,WAAW,OAAOA,EAAE,oBAAoB,EAAA;AAAA,UAAE;AAAA,QACrD;AAAA,MAAA;AAAA,IACF,GACF;AAEJ;"}
@@ -3,12 +3,13 @@ import { useTranslation as d } from "react-i18next";
3
3
  import { usePaymentMethod as f } from "./usePaymentMethod.js";
4
4
  import y from "../../../assets/icons/trashcan.svg.js";
5
5
  import { SPLIT_BY as b } from "../../../shared/constants.js";
6
+ import "classnames";
6
7
  import { HamburgerMenu as k } from "../../Common/HamburgerMenu/HamburgerMenu.js";
7
8
  import g from "../../../hooks/useNumberFormatter.js";
8
9
  import { centsToDollars as A } from "../../../helpers/currencyHelpers.js";
9
10
  import { useDataView as T } from "../../Common/DataView/useDataView.js";
10
11
  import { DataView as h } from "../../Common/DataView/DataView.js";
11
- function x() {
12
+ function I() {
12
13
  const { bankAccounts: i, paymentMethod: e, mode: m, handleDelete: u, isPending: a } = f(), { t } = d("Employee.PaymentMethod"), l = g(e.splitBy === "Amount" ? "currency" : "percent"), { ...s } = T({
13
14
  data: i,
14
15
  columns: [
@@ -45,6 +46,6 @@ function x() {
45
46
  return /* @__PURE__ */ n(h, { label: t("bankAccountsListLabel"), ...s });
46
47
  }
47
48
  export {
48
- x as BankAccountsList
49
+ I as BankAccountsList
49
50
  };
50
51
  //# sourceMappingURL=BankAccountsList.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BankAccountsList.js","sources":["../../../../src/components/Employee/PaymentMethod/BankAccountsList.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { usePaymentMethod } from './usePaymentMethod'\nimport TrashCanSvg from '@/assets/icons/trashcan.svg?react'\nimport { DataView, useDataView } from '@/components/Common'\nimport useNumberFormatter from '@/hooks/useNumberFormatter'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\nimport { SPLIT_BY } from '@/shared/constants'\nimport { centsToDollars } from '@/helpers/currencyHelpers'\n\nexport function BankAccountsList() {\n const { bankAccounts, paymentMethod, mode, handleDelete, isPending } = usePaymentMethod()\n const { t } = useTranslation('Employee.PaymentMethod')\n const format = useNumberFormatter(paymentMethod.splitBy === 'Amount' ? 'currency' : 'percent')\n\n const { ...dataViewProps } = useDataView({\n data: bankAccounts,\n columns: [\n { key: 'name', title: t('nicknameColumn') },\n { key: 'routingNumber', title: t('routingNumberColumn') },\n { key: 'accountType', title: t('accountTypeColumn') },\n {\n key: 'splitAmount',\n title: t('allocationColumn'),\n render: bankAccount => {\n const splitAmount =\n paymentMethod.splits?.find(split => split.uuid === bankAccount.uuid)?.splitAmount ?? 0\n const displayValue =\n paymentMethod.splitBy === SPLIT_BY.amount\n ? (centsToDollars(splitAmount) ?? 0)\n : splitAmount\n return format(displayValue)\n },\n },\n ],\n itemMenu: bankAccount => {\n return (\n <HamburgerMenu\n items={[\n {\n label: t('deleteBankAccountCta'),\n onClick: () => {\n handleDelete(bankAccount.uuid)\n },\n icon: <TrashCanSvg aria-hidden />,\n },\n ]}\n triggerLabel={t('hamburgerTitle')}\n isLoading={isPending}\n />\n )\n },\n })\n\n if (mode !== 'LIST') return\n\n return <DataView label={t('bankAccountsListLabel')} {...dataViewProps} />\n}\n"],"names":["BankAccountsList","bankAccounts","paymentMethod","mode","handleDelete","isPending","usePaymentMethod","useTranslation","format","useNumberFormatter","dataViewProps","useDataView","bankAccount","splitAmount","split","displayValue","SPLIT_BY","centsToDollars","jsx","HamburgerMenu","TrashCanSvg","DataView"],"mappings":";;;;;;;;;;AASO,SAASA,IAAmB;AACjC,QAAM,EAAE,cAAAC,GAAc,eAAAC,GAAe,MAAAC,GAAM,cAAAC,GAAc,WAAAC,EAAA,IAAcC,EAAA,GACjE,EAAE,EAAA,IAAMC,EAAe,wBAAwB,GAC/CC,IAASC,EAAmBP,EAAc,YAAY,WAAW,aAAa,SAAS,GAEvF,EAAE,GAAGQ,EAAA,IAAkBC,EAAY;AAAA,IACvC,MAAMV;AAAA,IACN,SAAS;AAAA,MACP,EAAE,KAAK,QAAQ,OAAO,EAAE,gBAAgB,EAAA;AAAA,MACxC,EAAE,KAAK,iBAAiB,OAAO,EAAE,qBAAqB,EAAA;AAAA,MACtD,EAAE,KAAK,eAAe,OAAO,EAAE,mBAAmB,EAAA;AAAA,MAClD;AAAA,QACE,KAAK;AAAA,QACL,OAAO,EAAE,kBAAkB;AAAA,QAC3B,QAAQ,CAAAW,MAAe;AACrB,gBAAMC,IACJX,EAAc,QAAQ,KAAK,CAAAY,MAASA,EAAM,SAASF,EAAY,IAAI,GAAG,eAAe,GACjFG,IACJb,EAAc,YAAYc,EAAS,SAC9BC,EAAeJ,CAAW,KAAK,IAChCA;AACN,iBAAOL,EAAOO,CAAY;AAAA,QAC5B;AAAA,MAAA;AAAA,IACF;AAAA,IAEF,UAAU,CAAAH,MAEN,gBAAAM;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,OAAO;AAAA,UACL;AAAA,YACE,OAAO,EAAE,sBAAsB;AAAA,YAC/B,SAAS,MAAM;AACb,cAAAf,EAAaQ,EAAY,IAAI;AAAA,YAC/B;AAAA,YACA,MAAM,gBAAAM,EAACE,GAAA,EAAY,eAAW,GAAA,CAAC;AAAA,UAAA;AAAA,QACjC;AAAA,QAEF,cAAc,EAAE,gBAAgB;AAAA,QAChC,WAAWf;AAAA,MAAA;AAAA,IAAA;AAAA,EAGjB,CACD;AAED,MAAIF,MAAS;AAEb,6BAAQkB,GAAA,EAAS,OAAO,EAAE,uBAAuB,GAAI,GAAGX,GAAe;AACzE;"}
1
+ {"version":3,"file":"BankAccountsList.js","sources":["../../../../src/components/Employee/PaymentMethod/BankAccountsList.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { usePaymentMethod } from './usePaymentMethod'\nimport TrashCanSvg from '@/assets/icons/trashcan.svg?react'\nimport { DataView, useDataView } from '@/components/Common'\nimport useNumberFormatter from '@/hooks/useNumberFormatter'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\nimport { SPLIT_BY } from '@/shared/constants'\nimport { centsToDollars } from '@/helpers/currencyHelpers'\n\nexport function BankAccountsList() {\n const { bankAccounts, paymentMethod, mode, handleDelete, isPending } = usePaymentMethod()\n const { t } = useTranslation('Employee.PaymentMethod')\n const format = useNumberFormatter(paymentMethod.splitBy === 'Amount' ? 'currency' : 'percent')\n\n const { ...dataViewProps } = useDataView({\n data: bankAccounts,\n columns: [\n { key: 'name', title: t('nicknameColumn') },\n { key: 'routingNumber', title: t('routingNumberColumn') },\n { key: 'accountType', title: t('accountTypeColumn') },\n {\n key: 'splitAmount',\n title: t('allocationColumn'),\n render: bankAccount => {\n const splitAmount =\n paymentMethod.splits?.find(split => split.uuid === bankAccount.uuid)?.splitAmount ?? 0\n const displayValue =\n paymentMethod.splitBy === SPLIT_BY.amount\n ? (centsToDollars(splitAmount) ?? 0)\n : splitAmount\n return format(displayValue)\n },\n },\n ],\n itemMenu: bankAccount => {\n return (\n <HamburgerMenu\n items={[\n {\n label: t('deleteBankAccountCta'),\n onClick: () => {\n handleDelete(bankAccount.uuid)\n },\n icon: <TrashCanSvg aria-hidden />,\n },\n ]}\n triggerLabel={t('hamburgerTitle')}\n isLoading={isPending}\n />\n )\n },\n })\n\n if (mode !== 'LIST') return\n\n return <DataView label={t('bankAccountsListLabel')} {...dataViewProps} />\n}\n"],"names":["BankAccountsList","bankAccounts","paymentMethod","mode","handleDelete","isPending","usePaymentMethod","useTranslation","format","useNumberFormatter","dataViewProps","useDataView","bankAccount","splitAmount","split","displayValue","SPLIT_BY","centsToDollars","jsx","HamburgerMenu","TrashCanSvg","DataView"],"mappings":";;;;;;;;;;;AASO,SAASA,IAAmB;AACjC,QAAM,EAAE,cAAAC,GAAc,eAAAC,GAAe,MAAAC,GAAM,cAAAC,GAAc,WAAAC,EAAA,IAAcC,EAAA,GACjE,EAAE,EAAA,IAAMC,EAAe,wBAAwB,GAC/CC,IAASC,EAAmBP,EAAc,YAAY,WAAW,aAAa,SAAS,GAEvF,EAAE,GAAGQ,EAAA,IAAkBC,EAAY;AAAA,IACvC,MAAMV;AAAA,IACN,SAAS;AAAA,MACP,EAAE,KAAK,QAAQ,OAAO,EAAE,gBAAgB,EAAA;AAAA,MACxC,EAAE,KAAK,iBAAiB,OAAO,EAAE,qBAAqB,EAAA;AAAA,MACtD,EAAE,KAAK,eAAe,OAAO,EAAE,mBAAmB,EAAA;AAAA,MAClD;AAAA,QACE,KAAK;AAAA,QACL,OAAO,EAAE,kBAAkB;AAAA,QAC3B,QAAQ,CAAAW,MAAe;AACrB,gBAAMC,IACJX,EAAc,QAAQ,KAAK,CAAAY,MAASA,EAAM,SAASF,EAAY,IAAI,GAAG,eAAe,GACjFG,IACJb,EAAc,YAAYc,EAAS,SAC9BC,EAAeJ,CAAW,KAAK,IAChCA;AACN,iBAAOL,EAAOO,CAAY;AAAA,QAC5B;AAAA,MAAA;AAAA,IACF;AAAA,IAEF,UAAU,CAAAH,MAEN,gBAAAM;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,OAAO;AAAA,UACL;AAAA,YACE,OAAO,EAAE,sBAAsB;AAAA,YAC/B,SAAS,MAAM;AACb,cAAAf,EAAaQ,EAAY,IAAI;AAAA,YAC/B;AAAA,YACA,MAAM,gBAAAM,EAACE,GAAA,EAAY,eAAW,GAAA,CAAC;AAAA,UAAA;AAAA,QACjC;AAAA,QAEF,cAAc,EAAE,gBAAgB;AAAA,QAChC,WAAWf;AAAA,MAAA;AAAA,IAAA;AAAA,EAGjB,CACD;AAED,MAAIF,MAAS;AAEb,6BAAQkB,GAAA,EAAS,OAAO,EAAE,uBAAuB,GAAI,GAAGX,GAAe;AACzE;"}
@@ -1,16 +1,17 @@
1
1
  import { jsx as p } from "react/jsx-runtime";
2
- import { useTranslation as c } from "react-i18next";
2
+ import { useTranslation as m } from "react-i18next";
3
3
  import { z as o } from "zod";
4
- import { usePaymentMethod as m } from "./usePaymentMethod.js";
4
+ import { usePaymentMethod as c } from "./usePaymentMethod.js";
5
5
  import { PAYMENT_METHODS as r } from "../../../shared/constants.js";
6
+ import "classnames";
7
+ import { RadioGroupField as n } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
6
8
  import "../../../contexts/ComponentAdapter/useComponentContext.js";
7
9
  import "react";
8
- import { RadioGroupField as n } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
9
10
  o.object({
10
11
  type: o.enum(["Check", "Direct Deposit"])
11
12
  });
12
- function h() {
13
- const { mode: t, isAdmin: i } = m(), { t: e } = c("Employee.PaymentMethod");
13
+ function b() {
14
+ const { mode: t, isAdmin: i } = c(), { t: e } = m("Employee.PaymentMethod");
14
15
  if (!(t !== "INITIAL" && t !== "LIST"))
15
16
  return /* @__PURE__ */ p(
16
17
  n,
@@ -34,6 +35,6 @@ function h() {
34
35
  );
35
36
  }
36
37
  export {
37
- h as PaymentTypeForm
38
+ b as PaymentTypeForm
38
39
  };
39
40
  //# sourceMappingURL=PaymentTypeForm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PaymentTypeForm.js","sources":["../../../../src/components/Employee/PaymentMethod/PaymentTypeForm.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { z } from 'zod'\nimport { usePaymentMethod } from './usePaymentMethod'\nimport { RadioGroupField } from '@/components/Common'\nimport { PAYMENT_METHODS } from '@/shared/constants'\n\nexport const PaymentTypeSchema = z.object({\n type: z.enum(['Check', 'Direct Deposit']),\n})\nexport type PaymentTypeInputs = z.input<typeof PaymentTypeSchema>\nexport type PaymentTypePayload = z.output<typeof PaymentTypeSchema>\n\nexport function PaymentTypeForm() {\n const { mode, isAdmin } = usePaymentMethod()\n const { t } = useTranslation('Employee.PaymentMethod')\n if (mode !== 'INITIAL' && mode !== 'LIST') return\n return (\n <RadioGroupField\n name=\"type\"\n label={t('paymentFieldsetLegend')}\n shouldVisuallyHideLabel\n options={[\n {\n value: PAYMENT_METHODS.directDeposit,\n label: t('directDepositLabel'),\n description: isAdmin ? t('directDepositDescription') : t('directDepositDescriptionSelf'),\n },\n {\n value: PAYMENT_METHODS.check,\n label: t('checkLabel'),\n description: isAdmin ? t('checkDescription') : t('checkDescriptionSelf'),\n },\n ]}\n />\n )\n}\n"],"names":["z","PaymentTypeForm","mode","isAdmin","usePaymentMethod","t","useTranslation","jsx","RadioGroupField","PAYMENT_METHODS"],"mappings":";;;;;;;;AAMiCA,EAAE,OAAO;AAAA,EACxC,MAAMA,EAAE,KAAK,CAAC,SAAS,gBAAgB,CAAC;AAC1C,CAAC;AAIM,SAASC,IAAkB;AAChC,QAAM,EAAE,MAAAC,GAAM,SAAAC,EAAA,IAAYC,EAAA,GACpB,EAAE,GAAAC,EAAA,IAAMC,EAAe,wBAAwB;AACrD,MAAI,EAAAJ,MAAS,aAAaA,MAAS;AACnC,WACE,gBAAAK;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOH,EAAE,uBAAuB;AAAA,QAChC,yBAAuB;AAAA,QACvB,SAAS;AAAA,UACP;AAAA,YACE,OAAOI,EAAgB;AAAA,YACvB,OAAOJ,EAAE,oBAAoB;AAAA,YAC7B,aAAuBA,EAAVF,IAAY,6BAAgC,8BAAN;AAAA,UAAoC;AAAA,UAEzF;AAAA,YACE,OAAOM,EAAgB;AAAA,YACvB,OAAOJ,EAAE,YAAY;AAAA,YACrB,aAAuBA,EAAVF,IAAY,qBAAwB,sBAAN;AAAA,UAA4B;AAAA,QACzE;AAAA,MACF;AAAA,IAAA;AAGN;"}
1
+ {"version":3,"file":"PaymentTypeForm.js","sources":["../../../../src/components/Employee/PaymentMethod/PaymentTypeForm.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { z } from 'zod'\nimport { usePaymentMethod } from './usePaymentMethod'\nimport { RadioGroupField } from '@/components/Common'\nimport { PAYMENT_METHODS } from '@/shared/constants'\n\nexport const PaymentTypeSchema = z.object({\n type: z.enum(['Check', 'Direct Deposit']),\n})\nexport type PaymentTypeInputs = z.input<typeof PaymentTypeSchema>\nexport type PaymentTypePayload = z.output<typeof PaymentTypeSchema>\n\nexport function PaymentTypeForm() {\n const { mode, isAdmin } = usePaymentMethod()\n const { t } = useTranslation('Employee.PaymentMethod')\n if (mode !== 'INITIAL' && mode !== 'LIST') return\n return (\n <RadioGroupField\n name=\"type\"\n label={t('paymentFieldsetLegend')}\n shouldVisuallyHideLabel\n options={[\n {\n value: PAYMENT_METHODS.directDeposit,\n label: t('directDepositLabel'),\n description: isAdmin ? t('directDepositDescription') : t('directDepositDescriptionSelf'),\n },\n {\n value: PAYMENT_METHODS.check,\n label: t('checkLabel'),\n description: isAdmin ? t('checkDescription') : t('checkDescriptionSelf'),\n },\n ]}\n />\n )\n}\n"],"names":["z","PaymentTypeForm","mode","isAdmin","usePaymentMethod","t","useTranslation","jsx","RadioGroupField","PAYMENT_METHODS"],"mappings":";;;;;;;;;AAMiCA,EAAE,OAAO;AAAA,EACxC,MAAMA,EAAE,KAAK,CAAC,SAAS,gBAAgB,CAAC;AAC1C,CAAC;AAIM,SAASC,IAAkB;AAChC,QAAM,EAAE,MAAAC,GAAM,SAAAC,EAAA,IAAYC,EAAA,GACpB,EAAE,GAAAC,EAAA,IAAMC,EAAe,wBAAwB;AACrD,MAAI,EAAAJ,MAAS,aAAaA,MAAS;AACnC,WACE,gBAAAK;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOH,EAAE,uBAAuB;AAAA,QAChC,yBAAuB;AAAA,QACvB,SAAS;AAAA,UACP;AAAA,YACE,OAAOI,EAAgB;AAAA,YACvB,OAAOJ,EAAE,oBAAoB;AAAA,YAC7B,aAAuBA,EAAVF,IAAY,6BAAgC,8BAAN;AAAA,UAAoC;AAAA,UAEzF;AAAA,YACE,OAAOM,EAAgB;AAAA,YACvB,OAAOJ,EAAE,YAAY;AAAA,YACrB,aAAuBA,EAAVF,IAAY,qBAAwB,sBAAN;AAAA,UAA4B;AAAA,QACzE;AAAA,MACF;AAAA,IAAA;AAGN;"}