@gusto/embedded-react-sdk 0.17.0 → 0.19.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 (468) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/dist/assets/icons/icon-error-outline.svg.js +10 -0
  3. package/dist/assets/icons/icon-error-outline.svg.js.map +1 -0
  4. package/dist/assets/icons/icon-info-outline.svg.js +10 -0
  5. package/dist/assets/icons/icon-info-outline.svg.js.map +1 -0
  6. package/dist/assets/icons/icon-zap-fast.svg.js +10 -0
  7. package/dist/assets/icons/icon-zap-fast.svg.js.map +1 -0
  8. package/dist/components/Base/Base.js +50 -65
  9. package/dist/components/Base/Base.js.map +1 -1
  10. package/dist/components/Base/useBase.d.ts +2 -5
  11. package/dist/components/Base/useBase.js.map +1 -1
  12. package/dist/components/Common/Fieldset/Fieldset.module.scss.js +1 -1
  13. package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.js +42 -36
  14. package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.js.map +1 -1
  15. package/dist/components/Common/HamburgerMenu/HamburgerMenu.js +1 -1
  16. package/dist/components/Common/HamburgerMenu/HamburgerMenu.js.map +1 -1
  17. package/dist/components/Common/PaginationControl/PaginationControl.js +6 -6
  18. package/dist/components/Common/PaginationControl/PaginationControl.js.map +1 -1
  19. package/dist/components/Common/RequirementsList/RequirementsList.js +19 -13
  20. package/dist/components/Common/RequirementsList/RequirementsList.js.map +1 -1
  21. package/dist/components/Common/RequirementsList/RequirementsList.module.scss.js +1 -1
  22. package/dist/components/Common/SignatureForm/SignatureForm.js +4 -7
  23. package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
  24. package/dist/components/Common/SignatureForm/SignatureFormActions.js +10 -13
  25. package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
  26. package/dist/components/Common/SignatureForm/SignatureFormFields.js +10 -13
  27. package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
  28. package/dist/components/Common/UI/Badge/index.d.ts +2 -0
  29. package/dist/components/Common/UI/Banner/Banner.d.ts +3 -0
  30. package/dist/components/Common/UI/Banner/Banner.js +31 -0
  31. package/dist/components/Common/UI/Banner/Banner.js.map +1 -0
  32. package/dist/components/Common/UI/Banner/Banner.module.scss.js +14 -0
  33. package/dist/components/Common/UI/Banner/Banner.module.scss.js.map +1 -0
  34. package/dist/components/Common/UI/Banner/BannerTypes.d.ts +21 -0
  35. package/dist/components/Common/UI/Banner/BannerTypes.js +7 -0
  36. package/dist/components/Common/UI/Banner/BannerTypes.js.map +1 -0
  37. package/dist/components/Common/UI/Banner/index.d.ts +4 -0
  38. package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js +1 -1
  39. package/dist/components/Common/UI/DatePicker/DatePicker.module.scss.js +8 -8
  40. package/dist/components/Common/UI/Dialog/Dialog.js +50 -76
  41. package/dist/components/Common/UI/Dialog/Dialog.js.map +1 -1
  42. package/dist/components/Common/UI/Dialog/Dialog.module.scss.js +8 -14
  43. package/dist/components/Common/UI/Dialog/Dialog.module.scss.js.map +1 -1
  44. package/dist/components/Common/UI/Link/LinkTypes.d.ts +7 -6
  45. package/dist/components/Common/UI/List/List.module.scss.js +2 -2
  46. package/dist/components/Common/UI/Modal/Modal.d.ts +2 -0
  47. package/dist/components/Common/UI/Modal/Modal.js +90 -0
  48. package/dist/components/Common/UI/Modal/Modal.js.map +1 -0
  49. package/dist/components/Common/UI/Modal/Modal.module.scss.js +26 -0
  50. package/dist/components/Common/UI/Modal/Modal.module.scss.js.map +1 -0
  51. package/dist/components/Common/UI/Modal/ModalTypes.d.ts +34 -0
  52. package/dist/components/Common/UI/Modal/ModalTypes.js +8 -0
  53. package/dist/components/Common/UI/Modal/ModalTypes.js.map +1 -0
  54. package/dist/components/Common/UI/Modal/index.d.ts +3 -0
  55. package/dist/components/Common/UI/ProgressBar/ProgressBar.js +4 -4
  56. package/dist/components/Common/UI/Tabs/Tabs.d.ts +0 -5
  57. package/dist/components/Common/UI/Tabs/Tabs.js +45 -16
  58. package/dist/components/Common/UI/Tabs/Tabs.js.map +1 -1
  59. package/dist/components/Common/UI/Tabs/Tabs.module.scss.js +8 -4
  60. package/dist/components/Common/UI/Tabs/Tabs.module.scss.js.map +1 -1
  61. package/dist/components/Common/UI/Tabs/TabsTypes.d.ts +7 -0
  62. package/dist/components/Common/index.d.ts +0 -1
  63. package/dist/components/Company/AssignSignatory/AssignSignatory.js +6 -8
  64. package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
  65. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +6 -8
  66. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
  67. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +8 -10
  68. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
  69. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +2 -3
  70. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
  71. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +2 -3
  72. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
  73. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +4 -6
  74. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  75. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +6 -8
  76. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
  77. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +5 -6
  78. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
  79. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +9 -10
  80. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
  81. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +4 -6
  82. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  83. package/dist/components/Company/AssignSignatory/TitleSelect.js +7 -8
  84. package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
  85. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +6 -8
  86. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  87. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +8 -9
  88. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
  89. package/dist/components/Company/BankAccount/BankAccountForm/Form.js +9 -11
  90. package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
  91. package/dist/components/Company/BankAccount/BankAccountForm/context.js +4 -6
  92. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  93. package/dist/components/Company/BankAccount/BankAccountList/Actions.js +10 -12
  94. package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
  95. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +11 -13
  96. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
  97. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +4 -6
  98. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
  99. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +5 -7
  100. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
  101. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +11 -13
  102. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  103. package/dist/components/Company/DocumentSigner/DocumentList/ManageSignatories.js +13 -13
  104. package/dist/components/Company/DocumentSigner/DocumentList/ManageSignatories.js.map +1 -1
  105. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +4 -6
  106. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  107. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +6 -8
  108. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  109. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +4 -6
  110. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  111. package/dist/components/Company/FederalTaxes/Actions.js +7 -9
  112. package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
  113. package/dist/components/Company/FederalTaxes/FederalTaxes.js +15 -17
  114. package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
  115. package/dist/components/Company/FederalTaxes/Form.js +29 -31
  116. package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
  117. package/dist/components/Company/FederalTaxes/Head.js +5 -5
  118. package/dist/components/Company/FederalTaxes/Head.js.map +1 -1
  119. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +9 -11
  120. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  121. package/dist/components/Company/Industry/Actions.js +5 -7
  122. package/dist/components/Company/Industry/Actions.js.map +1 -1
  123. package/dist/components/Company/Industry/Context.js +7 -9
  124. package/dist/components/Company/Industry/Context.js.map +1 -1
  125. package/dist/components/Company/Industry/Edit.js +10 -12
  126. package/dist/components/Company/Industry/Edit.js.map +1 -1
  127. package/dist/components/Company/Locations/LocationForm/Actions.js +6 -8
  128. package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
  129. package/dist/components/Company/Locations/LocationForm/Form.js +4 -5
  130. package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
  131. package/dist/components/Company/Locations/LocationForm/LocationForm.js +10 -12
  132. package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
  133. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +4 -6
  134. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  135. package/dist/components/Company/Locations/LocationsList/Actions.js +6 -8
  136. package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
  137. package/dist/components/Company/Locations/LocationsList/List.js +6 -8
  138. package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
  139. package/dist/components/Company/Locations/LocationsList/LocationsList.js +12 -14
  140. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  141. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +4 -6
  142. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  143. package/dist/components/Company/OnboardingOverview/Completed.js +12 -14
  144. package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
  145. package/dist/components/Company/OnboardingOverview/MissingRequirements.js +6 -8
  146. package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
  147. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +2 -4
  148. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
  149. package/dist/components/Company/OnboardingOverview/context.js +4 -6
  150. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  151. package/dist/components/Company/PaySchedule/PaySchedule.js +40 -42
  152. package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
  153. package/dist/components/Company/PaySchedule/_parts/Actions.js +10 -12
  154. package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
  155. package/dist/components/Company/PaySchedule/_parts/Edit.js +35 -37
  156. package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
  157. package/dist/components/Company/PaySchedule/_parts/Head.js +17 -19
  158. package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
  159. package/dist/components/Company/PaySchedule/_parts/List.js +13 -15
  160. package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
  161. package/dist/components/Company/PaySchedule/usePaySchedule.js +6 -8
  162. package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
  163. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +5 -7
  164. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
  165. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +4 -6
  166. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  167. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +6 -8
  168. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
  169. package/dist/components/Company/StateTaxes/StateTaxesList/List.js +5 -7
  170. package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
  171. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +4 -6
  172. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  173. package/dist/components/Contractor/Address/Address.js +4 -6
  174. package/dist/components/Contractor/Address/Address.js.map +1 -1
  175. package/dist/components/Contractor/Address/Form.js +2 -3
  176. package/dist/components/Contractor/Address/Form.js.map +1 -1
  177. package/dist/components/Contractor/Address/useAddress.js +6 -8
  178. package/dist/components/Contractor/Address/useAddress.js.map +1 -1
  179. package/dist/components/Contractor/ContractorList/index.js +54 -55
  180. package/dist/components/Contractor/ContractorList/index.js.map +1 -1
  181. package/dist/components/Contractor/NewHireReport/NewHireReport.js +13 -14
  182. package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
  183. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +4 -6
  184. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
  185. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +2 -3
  186. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
  187. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +2 -3
  188. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
  189. package/dist/components/Contractor/Profile/ContractorProfileForm.js +11 -11
  190. package/dist/components/Contractor/Profile/useContractorProfile.js +3 -4
  191. package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
  192. package/dist/components/Contractor/Submit/Submit.js +9 -10
  193. package/dist/components/Contractor/Submit/Submit.js.map +1 -1
  194. package/dist/components/Contractor/Submit/SubmitDone.js +8 -8
  195. package/dist/components/Contractor/Submit/SubmitDone.js.map +1 -1
  196. package/dist/components/Employee/Compensation/Actions.js +5 -6
  197. package/dist/components/Employee/Compensation/Actions.js.map +1 -1
  198. package/dist/components/Employee/Compensation/Edit.js +23 -22
  199. package/dist/components/Employee/Compensation/Edit.js.map +1 -1
  200. package/dist/components/Employee/Compensation/List.js +23 -25
  201. package/dist/components/Employee/Compensation/List.js.map +1 -1
  202. package/dist/components/Employee/Deductions/DeductionsComponents.js +1 -1
  203. package/dist/components/Employee/Deductions/DeductionsComponents.js.map +1 -1
  204. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.d.ts +7 -7
  205. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.d.ts +2 -2
  206. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js +3 -4
  207. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js.map +1 -1
  208. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +44 -40
  209. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js.map +1 -1
  210. package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.js +3 -4
  211. package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.js.map +1 -1
  212. package/dist/components/Employee/Deductions/useDeductions.d.ts +2 -2
  213. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +6 -8
  214. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
  215. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +9 -11
  216. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  217. package/dist/components/Employee/DocumentSigner/DocumentList/List.js +2 -4
  218. package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
  219. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +4 -6
  220. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  221. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +11 -13
  222. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  223. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +4 -6
  224. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  225. package/dist/components/Employee/EmployeeList/Actions.js +4 -6
  226. package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
  227. package/dist/components/Employee/EmployeeList/EmployeeList.js +3 -4
  228. package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
  229. package/dist/components/Employee/EmployeeList/Head.js +5 -7
  230. package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
  231. package/dist/components/Employee/EmployeeList/List.js +37 -38
  232. package/dist/components/Employee/EmployeeList/List.js.map +1 -1
  233. package/dist/components/Employee/EmployeeList/useEmployeeList.js +4 -6
  234. package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
  235. package/dist/components/Employee/FederalTaxes/Actions.js +6 -8
  236. package/dist/components/Employee/FederalTaxes/Actions.js.map +1 -1
  237. package/dist/components/Employee/FederalTaxes/FederalForm.js +11 -13
  238. package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
  239. package/dist/components/Employee/FederalTaxes/FederalTaxes.js +8 -8
  240. package/dist/components/Employee/FederalTaxes/FederalTaxes.js.map +1 -1
  241. package/dist/components/Employee/FederalTaxes/Head.js +7 -7
  242. package/dist/components/Employee/FederalTaxes/Head.js.map +1 -1
  243. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +4 -6
  244. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
  245. package/dist/components/Employee/Landing/Landing.js +22 -22
  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 +7 -9
  249. package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
  250. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +4 -5
  251. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
  252. package/dist/components/Employee/PaymentMethod/BankAccountsList.js +10 -12
  253. package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
  254. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +6 -7
  255. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
  256. package/dist/components/Employee/PaymentMethod/Split.js +3 -4
  257. package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
  258. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +6 -8
  259. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
  260. package/dist/components/Employee/Profile/Actions.js +7 -9
  261. package/dist/components/Employee/Profile/Actions.js.map +1 -1
  262. package/dist/components/Employee/Profile/AdminPersonalDetails.js +38 -35
  263. package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
  264. package/dist/components/Employee/Profile/HomeAddress.d.ts +52 -0
  265. package/dist/components/Employee/Profile/HomeAddress.js +64 -45
  266. package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
  267. package/dist/components/Employee/Profile/PersonalDetailsInputs.js +20 -21
  268. package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
  269. package/dist/components/Employee/Profile/Profile.js +150 -143
  270. package/dist/components/Employee/Profile/Profile.js.map +1 -1
  271. package/dist/components/Employee/Profile/useProfile.d.ts +1 -0
  272. package/dist/components/Employee/Profile/useProfile.js +4 -6
  273. package/dist/components/Employee/Profile/useProfile.js.map +1 -1
  274. package/dist/components/Employee/StateTaxes/Actions.js +8 -10
  275. package/dist/components/Employee/StateTaxes/Actions.js.map +1 -1
  276. package/dist/components/Employee/StateTaxes/StateTaxes.js +4 -4
  277. package/dist/components/Employee/StateTaxes/StateTaxes.js.map +1 -1
  278. package/dist/components/Employee/StateTaxes/useStateTaxes.js +4 -6
  279. package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
  280. package/dist/components/Employee/Taxes/Actions.js +8 -10
  281. package/dist/components/Employee/Taxes/Actions.js.map +1 -1
  282. package/dist/components/Employee/Taxes/FederalForm.js +9 -11
  283. package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
  284. package/dist/components/Employee/Taxes/FederalHead.js +7 -7
  285. package/dist/components/Employee/Taxes/FederalHead.js.map +1 -1
  286. package/dist/components/Employee/Taxes/Taxes.js +5 -5
  287. package/dist/components/Employee/Taxes/Taxes.js.map +1 -1
  288. package/dist/components/Employee/Taxes/useTaxes.js +4 -6
  289. package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
  290. package/dist/components/Flow/Flow.js +16 -18
  291. package/dist/components/Flow/Flow.js.map +1 -1
  292. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.d.ts +6 -0
  293. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js +57 -0
  294. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js.map +1 -0
  295. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.d.ts +8 -0
  296. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.js +79 -0
  297. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.js.map +1 -0
  298. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/index.d.ts +2 -0
  299. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsComponents.d.ts +7 -0
  300. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsComponents.js +25 -0
  301. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsComponents.js.map +1 -0
  302. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.d.ts +10 -0
  303. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +30 -0
  304. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js.map +1 -0
  305. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/index.d.ts +2 -0
  306. package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.d.ts +10 -0
  307. package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.js +30 -0
  308. package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.js.map +1 -0
  309. package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/index.d.ts +2 -0
  310. package/dist/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.d.ts +13 -0
  311. package/dist/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.js +63 -0
  312. package/dist/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.js.map +1 -0
  313. package/dist/components/Payroll/ConfirmWireDetails/index.d.ts +3 -0
  314. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +9 -11
  315. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
  316. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +6 -7
  317. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js.map +1 -1
  318. package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js +1 -1
  319. package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js.map +1 -1
  320. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +77 -76
  321. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
  322. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +133 -135
  323. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
  324. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.module.scss.js +5 -3
  325. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.module.scss.js.map +1 -1
  326. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js +30 -29
  327. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js.map +1 -1
  328. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +145 -137
  329. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
  330. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +5 -7
  331. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
  332. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.d.ts +3 -1
  333. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js +22 -22
  334. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js.map +1 -1
  335. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js +40 -27
  336. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js.map +1 -1
  337. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js +50 -72
  338. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js.map +1 -1
  339. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +2 -4
  340. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
  341. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.d.ts +1 -1
  342. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js +42 -37
  343. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js.map +1 -1
  344. package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.js +20 -20
  345. package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.js.map +1 -1
  346. package/dist/components/Payroll/PayrollList/PayrollList.js +24 -21
  347. package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
  348. package/dist/components/Payroll/PayrollList/PayrollListPresentation.d.ts +3 -9
  349. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +119 -131
  350. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
  351. package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js +6 -6
  352. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +125 -94
  353. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
  354. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.d.ts +6 -1
  355. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +243 -230
  356. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
  357. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.module.scss.js +8 -0
  358. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.module.scss.js.map +1 -0
  359. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchThresholdExceeded.d.ts +8 -0
  360. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchThresholdExceeded.js +49 -0
  361. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchThresholdExceeded.js.map +1 -0
  362. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/GenericBlocker.d.ts +6 -0
  363. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/GenericBlocker.js +18 -0
  364. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/GenericBlocker.js.map +1 -0
  365. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/index.d.ts +3 -0
  366. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +2 -3
  367. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
  368. package/dist/components/Payroll/index.d.ts +1 -0
  369. package/dist/components/Payroll/index.js +8 -6
  370. package/dist/components/Payroll/index.js.map +1 -1
  371. package/dist/components/Payroll/usePreparedPayrollData.js +8 -10
  372. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  373. package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js +44 -40
  374. package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js.map +1 -1
  375. package/dist/contexts/ComponentAdapter/componentAdapterTypes.d.ts +2 -0
  376. package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.d.ts +5 -0
  377. package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.js +27 -25
  378. package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.js.map +1 -1
  379. package/dist/contexts/ComponentAdapter/useComponentContext.d.ts +4 -0
  380. package/dist/contexts/ComponentAdapter/useComponentContext.js +3 -3
  381. package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
  382. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +5 -8
  383. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  384. package/dist/contexts/ThemeProvider/theme.d.ts +1 -0
  385. package/dist/contexts/ThemeProvider/theme.js +5 -4
  386. package/dist/contexts/ThemeProvider/theme.js.map +1 -1
  387. package/dist/helpers/apiErrorToList.d.ts +7 -0
  388. package/dist/helpers/apiErrorToList.js +23 -0
  389. package/dist/helpers/apiErrorToList.js.map +1 -0
  390. package/dist/helpers/breadcrumbHelpers.js +30 -30
  391. package/dist/helpers/breadcrumbHelpers.js.map +1 -1
  392. package/dist/helpers/dateFormatting.d.ts +15 -7
  393. package/dist/helpers/dateFormatting.js +88 -35
  394. package/dist/helpers/dateFormatting.js.map +1 -1
  395. package/dist/helpers/formattedStrings.js +11 -12
  396. package/dist/helpers/formattedStrings.js.map +1 -1
  397. package/dist/hooks/useAsyncError.js.map +1 -0
  398. package/dist/hooks/useDateFormatter.d.ts +19 -0
  399. package/dist/hooks/useDateFormatter.js +24 -0
  400. package/dist/hooks/useDateFormatter.js.map +1 -0
  401. package/dist/hooks/useMenu.js.map +1 -0
  402. package/dist/{components/Common/hooks → hooks}/useNumberFormatter.js +1 -1
  403. package/dist/hooks/useNumberFormatter.js.map +1 -0
  404. package/dist/hooks/useOverflowDetection/index.d.ts +3 -0
  405. package/dist/hooks/useOverflowDetection/useOverflowDetection.d.ts +7 -0
  406. package/dist/hooks/useOverflowDetection/useOverflowDetection.js +28 -0
  407. package/dist/hooks/useOverflowDetection/useOverflowDetection.js.map +1 -0
  408. package/dist/i18n/I18n.js +1 -1
  409. package/dist/i18n/I18n.js.map +1 -1
  410. package/dist/i18n/en/Company.BankAccount.json.js +1 -1
  411. package/dist/i18n/en/Company.DocumentList.json.js +16 -16
  412. package/dist/i18n/en/Company.FederalTaxes.json.js +22 -22
  413. package/dist/i18n/en/Company.PaySchedule.json.js +9 -9
  414. package/dist/i18n/en/Contractor.ContractorList.json.js +8 -8
  415. package/dist/i18n/en/Contractor.Submit.json.js +6 -6
  416. package/dist/i18n/en/Employee.Compensation.json.js +20 -20
  417. package/dist/i18n/en/Employee.Deductions.json.js +135 -109
  418. package/dist/i18n/en/Employee.Deductions.json.js.map +1 -1
  419. package/dist/i18n/en/Employee.EmployeeList.json.js +6 -6
  420. package/dist/i18n/en/Employee.FederalTaxes.json.js +9 -9
  421. package/dist/i18n/en/Employee.HomeAddress.json.js +3 -3
  422. package/dist/i18n/en/Employee.OnboardingSummary.json.js +1 -1
  423. package/dist/i18n/en/Employee.PaymentMethod.json.js +11 -11
  424. package/dist/i18n/en/Employee.Taxes.json.js +27 -29
  425. package/dist/i18n/en/Employee.Taxes.json.js.map +1 -1
  426. package/dist/i18n/en/Payroll.ConfirmWireDetailsBanner.json.js +14 -0
  427. package/dist/i18n/en/Payroll.ConfirmWireDetailsBanner.json.js.map +1 -0
  428. package/dist/i18n/en/Payroll.ConfirmWireDetailsForm.json.js +10 -0
  429. package/dist/i18n/en/Payroll.ConfirmWireDetailsForm.json.js.map +1 -0
  430. package/dist/i18n/en/Payroll.PayrollBlocker.json.js +3 -3
  431. package/dist/i18n/en/Payroll.PayrollConfiguration.json.js +1 -1
  432. package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js +4 -4
  433. package/dist/i18n/en/Payroll.PayrollList.json.js +7 -7
  434. package/dist/i18n/en/Payroll.PayrollOverview.json.js +37 -35
  435. package/dist/i18n/en/Payroll.PayrollOverview.json.js.map +1 -1
  436. package/dist/i18n/en/Payroll.PayrollReceipts.json.js +7 -7
  437. package/dist/i18n/en/Payroll.WireInstructions.json.js +10 -0
  438. package/dist/i18n/en/Payroll.WireInstructions.json.js.map +1 -0
  439. package/dist/i18n/en/common.json.d.ts +3 -2
  440. package/dist/i18n/en/common.json.js +4 -4
  441. package/dist/shared/constants.d.ts +13 -0
  442. package/dist/shared/constants.js +56 -47
  443. package/dist/shared/constants.js.map +1 -1
  444. package/dist/style.css +1 -1
  445. package/dist/types/i18next.d.ts +129 -99
  446. package/package.json +14 -15
  447. package/dist/components/Common/hooks/useAsyncError.js.map +0 -1
  448. package/dist/components/Common/hooks/useMenu.js.map +0 -1
  449. package/dist/components/Common/hooks/useNumberFormatter.js.map +0 -1
  450. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +0 -221
  451. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +0 -1
  452. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.module.scss.js +0 -8
  453. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.module.scss.js.map +0 -1
  454. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +0 -132
  455. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +0 -1
  456. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.module.scss.js +0 -14
  457. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.module.scss.js.map +0 -1
  458. package/dist/components/Employee/Deductions/DeductionsForm/UNSTABLE_DeductionsForm.js +0 -98
  459. package/dist/components/Employee/Deductions/DeductionsForm/UNSTABLE_DeductionsForm.js.map +0 -1
  460. package/dist/i18n/en/Company.AddBank.json.js +0 -28
  461. package/dist/i18n/en/Company.AddBank.json.js.map +0 -1
  462. package/dist/i18n/en/Payroll.PayrollSchedule.json.js +0 -27
  463. package/dist/i18n/en/Payroll.PayrollSchedule.json.js.map +0 -1
  464. /package/dist/{components/Common/hooks → hooks}/useAsyncError.d.ts +0 -0
  465. /package/dist/{components/Common/hooks → hooks}/useAsyncError.js +0 -0
  466. /package/dist/{components/Common/hooks → hooks}/useMenu.d.ts +0 -0
  467. /package/dist/{components/Common/hooks → hooks}/useMenu.js +0 -0
  468. /package/dist/{components/Common/hooks → hooks}/useNumberFormatter.d.ts +0 -0
@@ -1,221 +0,0 @@
1
- import { jsx as n, jsxs as c, Fragment as O } from "react/jsx-runtime";
2
- import { useTranslation as U } from "react-i18next";
3
- import { useForm as k, useWatch as Y, FormProvider as B } from "react-hook-form";
4
- import { useMemo as L, useEffect as E } from "react";
5
- import { z as o } from "zod";
6
- import { zodResolver as W } from "@hookform/resolvers/zod";
7
- import { PaymentPeriod as G } from "@gusto/embedded-api/models/components/garnishmentchildsupport";
8
- import { useGarnishmentsCreateMutation as j } from "@gusto/embedded-api/react-query/garnishmentsCreate";
9
- import { useGarnishmentsUpdateMutation as K } from "@gusto/embedded-api/react-query/garnishmentsUpdate";
10
- import V from "./ChildSupportForm.module.scss.js";
11
- import { useComponentContext as z } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
12
- import { Form as X } from "../../../Common/Form/Form.js";
13
- import { Flex as $ } from "../../../Common/Flex/Flex.js";
14
- import "classnames";
15
- import { componentEvents as C } from "../../../../shared/constants.js";
16
- import { ActionsLayout as J } from "../../../Common/ActionsLayout/ActionsLayout.js";
17
- import "react-error-boundary";
18
- import "@gusto/embedded-api/models/errors/apierror";
19
- import "@gusto/embedded-api/models/errors/sdkvalidationerror";
20
- import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
21
- import "@tanstack/react-query";
22
- import { useBase as Q } from "../../../Base/useBase.js";
23
- import "dompurify";
24
- import "../../../../contexts/LocaleProvider/useLocale.js";
25
- import { SelectField as d } from "../../../Common/Fields/SelectField/SelectField.js";
26
- import { TextInputField as Z } from "../../../Common/Fields/TextInputField/TextInputField.js";
27
- import { NumberInputField as g } from "../../../Common/Fields/NumberInputField/NumberInputField.js";
28
- const ee = 0, re = 0, te = 100, ne = o.nativeEnum(G), oe = o.object({
29
- state: o.string(),
30
- fipsCode: o.string(),
31
- caseNumber: o.string().nullable(),
32
- orderNumber: o.string().nullable(),
33
- remittanceNumber: o.string().nullable(),
34
- amount: o.number().min(0).transform(String),
35
- payPeriodMaximum: o.number().min(0).transform((r) => r > 0 ? r.toString() : null).nullable(),
36
- paymentPeriod: ne
37
- });
38
- function De({
39
- deduction: r,
40
- handleStateAgencySelect: M,
41
- stateAgencies: S,
42
- counties: x,
43
- employeeId: T,
44
- selectedAgency: b
45
- }) {
46
- const { onEvent: h, baseSubmitHandler: A } = Q(), { t: e } = U("Employee.Deductions"), u = z(), y = {
47
- case_number: {
48
- name: "caseNumber",
49
- description: e("caseNumberHelperText")
50
- },
51
- order_number: {
52
- name: "orderNumber",
53
- description: e("orderNumberHelperText")
54
- },
55
- remittance_number: {
56
- name: "remittanceNumber",
57
- description: e("remittanceNumberHelperText")
58
- }
59
- }, _ = b?.requiredAttributes?.map((t) => ({
60
- name: y[t.key].name,
61
- label: t.label,
62
- description: y[t.key].description
63
- })) || [], { mutateAsync: R, isPending: v } = j(), { mutateAsync: q, isPending: D } = K(), F = v || D, s = L(() => ({
64
- amount: r?.amount ? Number(r.amount) : 0,
65
- payPeriodMaximum: r?.payPeriodMaximum ? Number(r.payPeriodMaximum) : null,
66
- state: r?.childSupport?.state || "",
67
- fipsCode: r?.childSupport?.fipsCode || "",
68
- caseNumber: r?.childSupport?.caseNumber || null,
69
- orderNumber: r?.childSupport?.orderNumber || null,
70
- remittanceNumber: r?.childSupport?.remittanceNumber || null,
71
- paymentPeriod: r?.childSupport?.paymentPeriod
72
- }), [r]), l = k({
73
- resolver: W(oe),
74
- defaultValues: s
75
- }), { reset: P, setValue: i, control: I } = l, N = Y({ control: I, name: "state" });
76
- E(() => {
77
- P(s);
78
- }, [r, s, P]), E(() => {
79
- i("caseNumber", null), i("orderNumber", null), i("remittanceNumber", null);
80
- }, [N, i]);
81
- const H = async (t) => {
82
- const m = {
83
- state: t.state,
84
- paymentPeriod: t.paymentPeriod,
85
- fipsCode: t.fipsCode,
86
- caseNumber: t.caseNumber,
87
- orderNumber: t.orderNumber,
88
- remittanceNumber: t.remittanceNumber
89
- };
90
- await A(t, async (a) => {
91
- const f = {
92
- active: !0,
93
- amount: a.amount,
94
- description: `Child Support - ${m.caseNumber}`,
95
- // child support description follows prefix type + case number convention
96
- courtOrdered: !0,
97
- garnishmentType: "child_support",
98
- times: null,
99
- deductAsPercentage: !0,
100
- // child support must always deduct as percentage up to a pay period maximum limit and is recurring until cancelled
101
- payPeriodMaximum: a.payPeriodMaximum,
102
- recurring: !0,
103
- childSupport: m
104
- };
105
- if (r) {
106
- const { garnishment: p } = await q({
107
- request: {
108
- garnishmentId: r.uuid,
109
- requestBody: {
110
- ...f,
111
- version: r.version
112
- }
113
- }
114
- });
115
- h(C.EMPLOYEE_DEDUCTION_UPDATED, p);
116
- } else {
117
- const { garnishment: p } = await R({
118
- request: {
119
- employeeId: T,
120
- requestBody: f
121
- }
122
- });
123
- h(C.EMPLOYEE_DEDUCTION_CREATED, p);
124
- }
125
- });
126
- }, w = b?.manualPaymentRequired;
127
- return /* @__PURE__ */ n(B, { ...l, children: /* @__PURE__ */ n(X, { onSubmit: l.handleSubmit(H), children: /* @__PURE__ */ c($, { flexDirection: "column", gap: 32, children: [
128
- /* @__PURE__ */ n(
129
- d,
130
- {
131
- name: "state",
132
- label: e("agency"),
133
- description: e("agencyHelperText"),
134
- options: S,
135
- onChange: M,
136
- isRequired: !0
137
- }
138
- ),
139
- N && /* @__PURE__ */ c(O, { children: [
140
- /* @__PURE__ */ n(
141
- d,
142
- {
143
- name: "fipsCode",
144
- label: e("county"),
145
- description: e("countyHelperText"),
146
- options: x,
147
- isRequired: !0
148
- }
149
- ),
150
- _.map(({ name: t, label: m, description: a }) => /* @__PURE__ */ n(
151
- Z,
152
- {
153
- name: t,
154
- label: m,
155
- description: a,
156
- isRequired: !0
157
- },
158
- t
159
- )),
160
- /* @__PURE__ */ n(
161
- g,
162
- {
163
- name: "payPeriodMaximum",
164
- label: e("totalAmountWithheld"),
165
- description: e("totalAmountWithheldHelperText"),
166
- min: ee,
167
- adornmentStart: "$",
168
- isRequired: !0
169
- }
170
- ),
171
- /* @__PURE__ */ n(
172
- g,
173
- {
174
- name: "amount",
175
- label: e("maxPaycheckPercentage"),
176
- description: e("maxPaycheckPercentageHelperText"),
177
- isRequired: !0,
178
- min: re,
179
- max: te,
180
- adornmentStart: "%"
181
- }
182
- ),
183
- /* @__PURE__ */ n(
184
- d,
185
- {
186
- name: "paymentPeriod",
187
- label: e("per"),
188
- description: e("perHelperText"),
189
- options: [
190
- {
191
- label: e("everyWeek"),
192
- value: "Every week"
193
- },
194
- {
195
- label: e("everyOtherWeek"),
196
- value: "Every other week"
197
- },
198
- {
199
- label: e("twicePerMonth"),
200
- value: "Twice per month"
201
- },
202
- {
203
- label: e("monthly"),
204
- value: "Monthly"
205
- }
206
- ],
207
- isRequired: !0
208
- }
209
- ),
210
- w && /* @__PURE__ */ c("section", { className: V.manualPaymentReminderBanner, children: [
211
- /* @__PURE__ */ n(u.Text, { weight: "bold", children: e("manualPaymentRequired") }),
212
- /* @__PURE__ */ n(u.Text, { children: e("manualPaymentRequiredDescription") })
213
- ] }),
214
- /* @__PURE__ */ n(J, { children: /* @__PURE__ */ n(u.Button, { type: "submit", isLoading: F, children: e("saveCta") }) })
215
- ] })
216
- ] }) }) });
217
- }
218
- export {
219
- De as default
220
- };
221
- //# sourceMappingURL=ChildSupportForm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ChildSupportForm.js","sources":["../../../../../src/components/Employee/Deductions/DeductionsForm/ChildSupportForm.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { FormProvider, useForm, useWatch, type SubmitHandler } from 'react-hook-form'\nimport { useEffect, useMemo } from 'react'\nimport { z } from 'zod'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { PaymentPeriod } from '@gusto/embedded-api/models/components/garnishmentchildsupport'\nimport type { GarnishmentType } from '@gusto/embedded-api/models/operations/postv1employeesemployeeidgarnishments'\nimport { type Garnishment } from '@gusto/embedded-api/models/components/garnishment'\nimport { useGarnishmentsCreateMutation } from '@gusto/embedded-api/react-query/garnishmentsCreate'\nimport { useGarnishmentsUpdateMutation } from '@gusto/embedded-api/react-query/garnishmentsUpdate'\nimport { type Agencies } from '@gusto/embedded-api/models/components/childsupportdata'\nimport styles from './ChildSupportForm.module.scss'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { Form } from '@/components/Common/Form'\nimport { ActionsLayout } from '@/components/Common'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { NumberInputField, TextInputField, SelectField } from '@/components/Common'\nimport { type CommonComponentInterface, useBase } from '@/components/Base'\nimport { componentEvents } from '@/shared/constants'\n\nconst MINIMUM_PAY_PERIOD_AMOUNT = 0\nconst MINIMUM_PAYCHECK_PERCENTAGE = 0\nconst MAXIMUM_PAYCHECK_PERCENTAGE = 100\n\nconst ChildSupportPaymentPeriodSchema = z.nativeEnum(PaymentPeriod)\nconst ChildSupportSchema = z.object({\n state: z.string(),\n fipsCode: z.string(),\n caseNumber: z.string().nullable(),\n orderNumber: z.string().nullable(),\n remittanceNumber: z.string().nullable(),\n amount: z.number().min(0).transform(String),\n payPeriodMaximum: z\n .number()\n .min(0)\n .transform(val => (val > 0 ? val.toString() : null))\n .nullable(),\n paymentPeriod: ChildSupportPaymentPeriodSchema,\n})\n\nexport type ChildSupportInputs = z.input<typeof ChildSupportSchema>\nexport type ChildSupportPayload = z.output<typeof ChildSupportSchema>\n\ninterface ChildSupportFormProps extends CommonComponentInterface<'Employee.Deductions'> {\n employeeId: string\n deduction?: Garnishment | null\n handleStateAgencySelect: (stateAgency: string) => void\n stateAgencies: { label: string; value: string }[]\n counties: { label: string; value: string }[]\n selectedAgency?: Agencies\n}\n\nfunction ChildSupportForm({\n deduction,\n handleStateAgencySelect,\n stateAgencies,\n counties,\n employeeId,\n selectedAgency,\n}: ChildSupportFormProps) {\n const { onEvent, baseSubmitHandler } = useBase()\n const { t } = useTranslation('Employee.Deductions')\n const Components = useComponentContext()\n\n const ATTR_KEY_TO_TEXT_FIELD_NAME_MAPPER = {\n case_number: {\n name: 'caseNumber',\n description: t('caseNumberHelperText'),\n },\n order_number: {\n name: 'orderNumber',\n description: t('orderNumberHelperText'),\n },\n remittance_number: {\n name: 'remittanceNumber',\n description: t('remittanceNumberHelperText'),\n },\n }\n const requiredSelectedAgencyAttributes =\n selectedAgency?.requiredAttributes?.map(attr => {\n return {\n name: ATTR_KEY_TO_TEXT_FIELD_NAME_MAPPER[attr.key!].name,\n label: attr.label as string,\n description: ATTR_KEY_TO_TEXT_FIELD_NAME_MAPPER[attr.key!].description,\n }\n }) || []\n\n const { mutateAsync: createDeduction, isPending: isPendingCreate } =\n useGarnishmentsCreateMutation()\n const { mutateAsync: updateDeduction, isPending: isPendingUpdate } =\n useGarnishmentsUpdateMutation()\n const isPending = isPendingCreate || isPendingUpdate\n\n const defaultChildSupportValues: ChildSupportInputs = useMemo(() => {\n return {\n amount: deduction?.amount ? Number(deduction.amount) : 0,\n payPeriodMaximum: deduction?.payPeriodMaximum ? Number(deduction.payPeriodMaximum) : null,\n state: deduction?.childSupport?.state || '',\n fipsCode: deduction?.childSupport?.fipsCode || '',\n caseNumber: deduction?.childSupport?.caseNumber || null,\n orderNumber: deduction?.childSupport?.orderNumber || null,\n remittanceNumber: deduction?.childSupport?.remittanceNumber || null,\n paymentPeriod: deduction?.childSupport?.paymentPeriod as PaymentPeriod,\n }\n }, [deduction])\n\n const childSupportFormMethods = useForm<ChildSupportInputs, unknown, ChildSupportPayload>({\n resolver: zodResolver(ChildSupportSchema),\n defaultValues: defaultChildSupportValues,\n })\n const { reset: resetChildSupportForm, setValue, control } = childSupportFormMethods\n const watchedStateAgency = useWatch({ control, name: 'state' })\n\n useEffect(() => {\n resetChildSupportForm(defaultChildSupportValues)\n }, [deduction, defaultChildSupportValues, resetChildSupportForm])\n\n // if in edit mode and user elects to change state agency, reset the required attribute values\n // as new selected agency might require different payload inputs, e.g. OH requires case number + order number\n useEffect(() => {\n setValue('caseNumber', null)\n setValue('orderNumber', null)\n setValue('remittanceNumber', null)\n }, [watchedStateAgency, setValue])\n\n const onChildSupportSubmit: SubmitHandler<ChildSupportPayload> = async data => {\n const childSupport = {\n state: data.state,\n paymentPeriod: data.paymentPeriod,\n fipsCode: data.fipsCode,\n caseNumber: data.caseNumber,\n orderNumber: data.orderNumber,\n remittanceNumber: data.remittanceNumber,\n }\n\n await baseSubmitHandler(data, async payload => {\n const requestBody = {\n active: true,\n amount: payload.amount,\n description: `Child Support - ${childSupport.caseNumber}`, // child support description follows prefix type + case number convention\n courtOrdered: true,\n garnishmentType: 'child_support' as GarnishmentType,\n times: null,\n deductAsPercentage: true, // child support must always deduct as percentage up to a pay period maximum limit and is recurring until cancelled\n payPeriodMaximum: payload.payPeriodMaximum,\n recurring: true,\n childSupport,\n }\n\n if (!deduction) {\n const { garnishment: createDeductionResponse } = await createDeduction({\n request: {\n employeeId,\n requestBody,\n },\n })\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_CREATED, createDeductionResponse)\n } else {\n const { garnishment: updateDeductionResponse } = await updateDeduction({\n request: {\n garnishmentId: deduction.uuid,\n requestBody: {\n ...requestBody,\n version: deduction.version as string,\n },\n },\n })\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_UPDATED, updateDeductionResponse)\n }\n })\n }\n\n const isManualPaymentRequired = selectedAgency?.manualPaymentRequired\n\n return (\n <FormProvider {...childSupportFormMethods}>\n <Form onSubmit={childSupportFormMethods.handleSubmit(onChildSupportSubmit)}>\n <Flex flexDirection=\"column\" gap={32}>\n <SelectField\n name=\"state\"\n label={t('agency')}\n description={t('agencyHelperText')}\n options={stateAgencies}\n onChange={handleStateAgencySelect}\n isRequired\n />\n {watchedStateAgency && (\n <>\n <SelectField\n name=\"fipsCode\"\n label={t('county')}\n description={t('countyHelperText')}\n options={counties}\n isRequired\n />\n {/* render required inputs for respective agency, e.g. OH requires case number + order number */}\n {requiredSelectedAgencyAttributes.map(({ name, label, description }) => (\n <TextInputField\n key={name}\n name={name}\n label={label}\n description={description}\n isRequired\n />\n ))}\n <NumberInputField\n name=\"payPeriodMaximum\"\n label={t('totalAmountWithheld')}\n description={t('totalAmountWithheldHelperText')}\n min={MINIMUM_PAY_PERIOD_AMOUNT}\n adornmentStart=\"$\"\n isRequired\n />\n <NumberInputField\n name=\"amount\"\n label={t('maxPaycheckPercentage')}\n description={t('maxPaycheckPercentageHelperText')}\n isRequired\n min={MINIMUM_PAYCHECK_PERCENTAGE}\n max={MAXIMUM_PAYCHECK_PERCENTAGE}\n adornmentStart=\"%\"\n />\n <SelectField\n name=\"paymentPeriod\"\n label={t('per')}\n description={t('perHelperText')}\n options={[\n {\n label: t('everyWeek'),\n value: 'Every week',\n },\n {\n label: t('everyOtherWeek'),\n value: 'Every other week',\n },\n {\n label: t('twicePerMonth'),\n value: 'Twice per month',\n },\n {\n label: t('monthly'),\n value: 'Monthly',\n },\n ]}\n isRequired\n />\n {isManualPaymentRequired && (\n <section className={styles.manualPaymentReminderBanner}>\n <Components.Text weight=\"bold\">{t('manualPaymentRequired')}</Components.Text>\n <Components.Text>{t('manualPaymentRequiredDescription')}</Components.Text>\n </section>\n )}\n <ActionsLayout>\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t('saveCta')}\n </Components.Button>\n </ActionsLayout>\n </>\n )}\n </Flex>\n </Form>\n </FormProvider>\n )\n}\n\nexport default ChildSupportForm\n"],"names":["MINIMUM_PAY_PERIOD_AMOUNT","MINIMUM_PAYCHECK_PERCENTAGE","MAXIMUM_PAYCHECK_PERCENTAGE","ChildSupportPaymentPeriodSchema","z","PaymentPeriod","ChildSupportSchema","val","ChildSupportForm","deduction","handleStateAgencySelect","stateAgencies","counties","employeeId","selectedAgency","onEvent","baseSubmitHandler","useBase","t","useTranslation","Components","useComponentContext","ATTR_KEY_TO_TEXT_FIELD_NAME_MAPPER","requiredSelectedAgencyAttributes","attr","createDeduction","isPendingCreate","useGarnishmentsCreateMutation","updateDeduction","isPendingUpdate","useGarnishmentsUpdateMutation","isPending","defaultChildSupportValues","useMemo","childSupportFormMethods","useForm","zodResolver","resetChildSupportForm","setValue","control","watchedStateAgency","useWatch","useEffect","onChildSupportSubmit","data","childSupport","payload","requestBody","updateDeductionResponse","componentEvents","createDeductionResponse","isManualPaymentRequired","FormProvider","jsx","Form","jsxs","Flex","SelectField","Fragment","name","label","description","TextInputField","NumberInputField","styles","ActionsLayout"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,MAAMA,KAA4B,GAC5BC,KAA8B,GAC9BC,KAA8B,KAE9BC,KAAkCC,EAAE,WAAWC,CAAa,GAC5DC,KAAqBF,EAAE,OAAO;AAAA,EAClC,OAAOA,EAAE,OAAA;AAAA,EACT,UAAUA,EAAE,OAAA;AAAA,EACZ,YAAYA,EAAE,OAAA,EAAS,SAAA;AAAA,EACvB,aAAaA,EAAE,OAAA,EAAS,SAAA;AAAA,EACxB,kBAAkBA,EAAE,OAAA,EAAS,SAAA;AAAA,EAC7B,QAAQA,EAAE,OAAA,EAAS,IAAI,CAAC,EAAE,UAAU,MAAM;AAAA,EAC1C,kBAAkBA,EACf,OAAA,EACA,IAAI,CAAC,EACL,UAAU,CAAAG,MAAQA,IAAM,IAAIA,EAAI,SAAA,IAAa,IAAK,EAClD,SAAA;AAAA,EACH,eAAeJ;AACjB,CAAC;AAcD,SAASK,GAAiB;AAAA,EACxB,WAAAC;AAAA,EACA,yBAAAC;AAAA,EACA,eAAAC;AAAA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,GACF,GACF;AAEJ;"}
@@ -1,8 +0,0 @@
1
- const n = "_manualPaymentReminderBanner_12gkb_1", e = {
2
- manualPaymentReminderBanner: n
3
- };
4
- export {
5
- e as default,
6
- n as manualPaymentReminderBanner
7
- };
8
- //# sourceMappingURL=ChildSupportForm.module.scss.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ChildSupportForm.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
@@ -1,132 +0,0 @@
1
- import { jsx as n, jsxs as s, Fragment as b } from "react/jsx-runtime";
2
- import { useTranslation as F } from "react-i18next";
3
- import { useForm as L, useWatch as q, FormProvider as R } from "react-hook-form";
4
- import { useMemo as T, useEffect as S } from "react";
5
- import { z as t } from "zod";
6
- import { zodResolver as N } from "@hookform/resolvers/zod";
7
- import { useGarnishmentsCreateMutation as I } from "@gusto/embedded-api/react-query/garnishmentsCreate";
8
- import { useGarnishmentsUpdateMutation as U } from "@gusto/embedded-api/react-query/garnishmentsUpdate";
9
- import { useComponentContext as _ } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
10
- import { Form as B } from "../../../Common/Form/Form.js";
11
- import { Flex as w } from "../../../Common/Flex/Flex.js";
12
- import "classnames";
13
- import { componentEvents as l } from "../../../../shared/constants.js";
14
- import { ActionsLayout as j } from "../../../Common/ActionsLayout/ActionsLayout.js";
15
- import "react-error-boundary";
16
- import "@gusto/embedded-api/models/errors/apierror";
17
- import "@gusto/embedded-api/models/errors/sdkvalidationerror";
18
- import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
19
- import "@tanstack/react-query";
20
- import { useBase as G } from "../../../Base/useBase.js";
21
- import "dompurify";
22
- import "../../../../contexts/LocaleProvider/useLocale.js";
23
- import { TextInputField as Y } from "../../../Common/Fields/TextInputField/TextInputField.js";
24
- import { RadioGroupField as f } from "../../../Common/Fields/RadioGroupField/RadioGroupField.js";
25
- import { NumberInputField as c } from "../../../Common/Fields/NumberInputField/NumberInputField.js";
26
- import { CheckboxField as k } from "../../../Common/Fields/CheckboxField/CheckboxField.js";
27
- const z = t.object({
28
- active: t.boolean(),
29
- amount: t.number().min(0).transform(String),
30
- description: t.string().min(1),
31
- courtOrdered: t.boolean(),
32
- times: t.number().nullable(),
33
- recurring: t.string().transform((e) => e === "true"),
34
- annualMaximum: t.number().min(0).transform((e) => e > 0 ? e.toString() : null).nullable(),
35
- payPeriodMaximum: t.number().min(0).transform((e) => e > 0 ? e.toString() : null).nullable(),
36
- deductAsPercentage: t.string().transform((e) => e === "true")
37
- });
38
- function xe({ deduction: e, employeeId: g }) {
39
- const { onEvent: o, baseSubmitHandler: x } = G(), { t: r } = F("Employee.Deductions"), p = _(), { mutateAsync: P, isPending: h } = I(), { mutateAsync: E, isPending: y } = U(), D = h || y, m = T(() => ({
40
- amount: e?.amount ? Number(e.amount) : 0,
41
- description: e?.description ?? "",
42
- times: e?.times ?? null,
43
- recurring: e?.recurring?.toString() ?? "true",
44
- annualMaximum: e?.annualMaximum ? Number(e.annualMaximum) : null,
45
- payPeriodMaximum: e?.payPeriodMaximum ? Number(e.payPeriodMaximum) : null,
46
- deductAsPercentage: e?.deductAsPercentage?.toString() ?? "true",
47
- active: !0,
48
- courtOrdered: e?.courtOrdered ?? !1
49
- }), [e]), a = L({
50
- resolver: N(z),
51
- defaultValues: m
52
- }), { reset: d, control: C } = a;
53
- S(() => {
54
- d(m);
55
- }, [e, m, d]);
56
- const M = q({ control: C, name: "recurring" }), O = async (A) => {
57
- await x(A, async (i) => {
58
- if (e) {
59
- const { garnishment: u } = await E({
60
- request: {
61
- garnishmentId: e.uuid,
62
- requestBody: {
63
- ...i,
64
- version: e.version,
65
- times: i.recurring ? null : 1
66
- }
67
- }
68
- });
69
- o(l.EMPLOYEE_DEDUCTION_UPDATED, u);
70
- } else {
71
- const { garnishment: u } = await P({
72
- request: {
73
- employeeId: g,
74
- requestBody: { ...i, times: i.recurring ? null : 1 }
75
- }
76
- });
77
- o(l.EMPLOYEE_DEDUCTION_CREATED, u);
78
- }
79
- });
80
- }, v = () => {
81
- o(l.EMPLOYEE_DEDUCTION_CANCEL);
82
- };
83
- return /* @__PURE__ */ n(R, { ...a, children: /* @__PURE__ */ n(B, { onSubmit: a.handleSubmit(O), children: /* @__PURE__ */ n(w, { flexDirection: "column", gap: 32, children: /* @__PURE__ */ s(b, { children: [
84
- /* @__PURE__ */ n(Y, { name: "description", label: r("descriptionLabel"), isRequired: !0 }),
85
- /* @__PURE__ */ n(
86
- f,
87
- {
88
- name: "deductAsPercentage",
89
- label: r("deductionTypeLabel"),
90
- isRequired: !0,
91
- options: [
92
- { value: "true", label: r("deductionTypePercentageOption") },
93
- { value: "false", label: r("deductionTypeFixedAmountOption") }
94
- ]
95
- }
96
- ),
97
- /* @__PURE__ */ n(c, { name: "amount", label: r("deductionAmountLabel"), isRequired: !0, min: 0 }),
98
- /* @__PURE__ */ n(
99
- f,
100
- {
101
- name: "recurring",
102
- label: r("frequencyLabel"),
103
- isRequired: !0,
104
- options: [
105
- { value: "true", label: r("frequencyRecurringOption") },
106
- { value: "false", label: r("frequencyOneTimeOption") }
107
- ]
108
- }
109
- ),
110
- M === "true" && /* @__PURE__ */ s(b, { children: [
111
- /* @__PURE__ */ n(c, { name: "annualMaximum", label: r("annualMaxLabel"), min: 0 }),
112
- /* @__PURE__ */ n(c, { name: "payPeriodMaximum", label: "Pay period maximum", min: 0 })
113
- ] }),
114
- /* @__PURE__ */ n(
115
- k,
116
- {
117
- name: "courtOrdered",
118
- label: r("courtOrderedLabel"),
119
- isDisabled: !!e
120
- }
121
- ),
122
- /* @__PURE__ */ s(j, { children: [
123
- /* @__PURE__ */ n(p.Button, { variant: "secondary", onClick: v, children: r("cancelCta") }),
124
- /* @__PURE__ */ n(p.Button, { type: "submit", isLoading: D, children: r(e ? "continueCta" : "addDeductionCta") })
125
- ] })
126
- ] }) }) }) });
127
- }
128
- export {
129
- z as DeductionSchema,
130
- xe as default
131
- };
132
- //# sourceMappingURL=CustomDeductionForm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CustomDeductionForm.js","sources":["../../../../../src/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { FormProvider, useForm, useWatch, type SubmitHandler } from 'react-hook-form'\nimport { useEffect, useMemo } from 'react'\nimport { z } from 'zod'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { type Garnishment } from '@gusto/embedded-api/models/components/garnishment'\nimport { useGarnishmentsCreateMutation } from '@gusto/embedded-api/react-query/garnishmentsCreate'\nimport { useGarnishmentsUpdateMutation } from '@gusto/embedded-api/react-query/garnishmentsUpdate'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { Form } from '@/components/Common/Form'\nimport { ActionsLayout } from '@/components/Common'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport {\n NumberInputField,\n TextInputField,\n RadioGroupField,\n CheckboxField,\n} from '@/components/Common'\nimport { type CommonComponentInterface, useBase } from '@/components/Base'\nimport { componentEvents } from '@/shared/constants'\n\nexport const DeductionSchema = z.object({\n active: z.boolean(),\n amount: z.number().min(0).transform(String),\n description: z.string().min(1),\n courtOrdered: z.boolean(),\n times: z.number().nullable(),\n recurring: z.string().transform(val => val === 'true'),\n annualMaximum: z\n .number()\n .min(0)\n .transform(val => (val > 0 ? val.toString() : null))\n .nullable(),\n payPeriodMaximum: z\n .number()\n .min(0)\n .transform(val => (val > 0 ? val.toString() : null))\n .nullable(),\n deductAsPercentage: z.string().transform(val => val === 'true'),\n})\n\nexport type DeductionInputs = z.input<typeof DeductionSchema>\nexport type DeductionPayload = z.output<typeof DeductionSchema>\n\ninterface ChildSupportFormProps extends CommonComponentInterface<'Employee.Deductions'> {\n employeeId: string\n deduction?: Garnishment | null\n}\n\nfunction CustomDeductionForm({ deduction, employeeId }: ChildSupportFormProps) {\n const { onEvent, baseSubmitHandler } = useBase()\n const { t } = useTranslation('Employee.Deductions')\n const Components = useComponentContext()\n\n const { mutateAsync: createDeduction, isPending: isPendingCreate } =\n useGarnishmentsCreateMutation()\n const { mutateAsync: updateDeduction, isPending: isPendingUpdate } =\n useGarnishmentsUpdateMutation()\n const isPending = isPendingCreate || isPendingUpdate\n\n const defaultValues: DeductionInputs = useMemo(() => {\n return {\n amount: deduction?.amount ? Number(deduction.amount) : 0,\n description: deduction?.description ?? '',\n times: deduction?.times ?? null,\n recurring: deduction?.recurring?.toString() ?? 'true',\n annualMaximum: deduction?.annualMaximum ? Number(deduction.annualMaximum) : null,\n payPeriodMaximum: deduction?.payPeriodMaximum ? Number(deduction.payPeriodMaximum) : null,\n deductAsPercentage: deduction?.deductAsPercentage?.toString() ?? 'true',\n active: true,\n courtOrdered: deduction?.courtOrdered ?? false,\n } as DeductionInputs\n }, [deduction])\n\n const formMethods = useForm<DeductionInputs, unknown, DeductionPayload>({\n resolver: zodResolver(DeductionSchema),\n defaultValues,\n })\n const { reset: resetForm, control } = formMethods\n\n useEffect(() => {\n resetForm(defaultValues)\n }, [deduction, defaultValues, resetForm])\n\n const watchedRecurring = useWatch({ control, name: 'recurring' })\n\n const onSubmit: SubmitHandler<DeductionPayload> = async data => {\n await baseSubmitHandler(data, async payload => {\n if (!deduction) {\n const { garnishment: createDeductionResponse } = await createDeduction({\n request: {\n employeeId: employeeId,\n requestBody: { ...payload, times: payload.recurring ? null : 1 },\n },\n })\n\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_CREATED, createDeductionResponse)\n } else {\n const { garnishment: updateDeductionResponse } = await updateDeduction({\n request: {\n garnishmentId: deduction.uuid,\n requestBody: {\n ...payload,\n version: deduction.version as string,\n times: payload.recurring ? null : 1,\n },\n },\n })\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_UPDATED, updateDeductionResponse)\n }\n })\n }\n\n const handleCancel = () => {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_CANCEL)\n }\n\n return (\n <FormProvider {...formMethods}>\n <Form onSubmit={formMethods.handleSubmit(onSubmit)}>\n <Flex flexDirection=\"column\" gap={32}>\n <>\n <TextInputField name=\"description\" label={t('descriptionLabel')} isRequired />\n <RadioGroupField\n name=\"deductAsPercentage\"\n label={t('deductionTypeLabel')}\n isRequired\n options={[\n { value: 'true', label: t('deductionTypePercentageOption') },\n { value: 'false', label: t('deductionTypeFixedAmountOption') },\n ]}\n />\n <NumberInputField name=\"amount\" label={t('deductionAmountLabel')} isRequired min={0} />\n <RadioGroupField\n name=\"recurring\"\n label={t('frequencyLabel')}\n isRequired\n options={[\n { value: 'true', label: t('frequencyRecurringOption') },\n { value: 'false', label: t('frequencyOneTimeOption') },\n ]}\n />\n {watchedRecurring === 'true' && (\n <>\n <NumberInputField name=\"annualMaximum\" label={t('annualMaxLabel')} min={0} />\n <NumberInputField name=\"payPeriodMaximum\" label=\"Pay period maximum\" min={0} />\n </>\n )}\n <CheckboxField\n name=\"courtOrdered\"\n label={t('courtOrderedLabel')}\n isDisabled={!!deduction}\n />\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleCancel}>\n {t('cancelCta')}\n </Components.Button>\n <Components.Button type=\"submit\" isLoading={isPending}>\n {!deduction ? t('addDeductionCta') : t('continueCta')}\n </Components.Button>\n </ActionsLayout>\n </>\n </Flex>\n </Form>\n </FormProvider>\n )\n}\n\nexport default CustomDeductionForm\n"],"names":["DeductionSchema","z","val","CustomDeductionForm","deduction","employeeId","onEvent","baseSubmitHandler","useBase","t","useTranslation","Components","useComponentContext","createDeduction","isPendingCreate","useGarnishmentsCreateMutation","updateDeduction","isPendingUpdate","useGarnishmentsUpdateMutation","isPending","defaultValues","useMemo","formMethods","useForm","zodResolver","resetForm","control","useEffect","watchedRecurring","useWatch","onSubmit","data","payload","updateDeductionResponse","componentEvents","createDeductionResponse","handleCancel","FormProvider","jsx","Form","Flex","jsxs","Fragment","TextInputField","RadioGroupField","NumberInputField","CheckboxField","ActionsLayout"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAqBO,MAAMA,IAAkBC,EAAE,O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AACQ;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOrC,EAAE,mBAAmB;AAAA,QAC5B,YAAY,CAAC,CAACL;AAAA,MAAA;AAAA,IAAA;AAAA,sBAEf2C,GAAA,EACC,UAAA;AAAA,MAAA,gBAAAT,EAAC3B,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASyB,GAC7C,UAAA3B,EAAE,WAAW,EAAA,CAChB;AAAA,MACA,gBAAA6B,EAAC3B,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWQ,GACzC,UAAoCV,EAAnCL,IAAqC,gBAAvB,iBAAoC,EAAA,CACtD;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GACF,EAAA,CACF,GACF,GACF;AAEJ;"}
@@ -1,14 +0,0 @@
1
- const e = "_leftCaretIcon_cfkf8_6", n = "_formHeadingContainer_cfkf8_10", o = "_deductionTypeRadioGroup_cfkf8_14", t = "_garnishmentTypeLabel_cfkf8_18", a = {
2
- leftCaretIcon: e,
3
- formHeadingContainer: n,
4
- deductionTypeRadioGroup: o,
5
- garnishmentTypeLabel: t
6
- };
7
- export {
8
- o as deductionTypeRadioGroup,
9
- a as default,
10
- n as formHeadingContainer,
11
- t as garnishmentTypeLabel,
12
- e as leftCaretIcon
13
- };
14
- //# sourceMappingURL=DeductionsForm.module.scss.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DeductionsForm.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
@@ -1,98 +0,0 @@
1
- import { jsx as n, jsxs as a } from "react/jsx-runtime";
2
- import { useTranslation as N } from "react-i18next";
3
- import { useState as h } from "react";
4
- import { useGarnishmentsListSuspense as A } from "@gusto/embedded-api/react-query/garnishmentsList";
5
- import { useGarnishmentsGetChildSupportDataSuspense as R } from "@gusto/embedded-api/react-query/garnishmentsGetChildSupportData";
6
- import c from "./DeductionsForm.module.scss.js";
7
- import P from "./ChildSupportForm.js";
8
- import O from "./CustomDeductionForm.js";
9
- import { BaseComponent as _ } from "../../../Base/Base.js";
10
- import { useBase as B } from "../../../Base/useBase.js";
11
- import { Grid as H } from "../../../Common/Grid/Grid.js";
12
- import { useComponentDictionary as F, useI18n as U } from "../../../../i18n/I18n.js";
13
- import { componentEvents as j } from "../../../../shared/constants.js";
14
- import { useComponentContext as k } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
15
- import w from "../../../../assets/icons/caret-left.svg.js";
16
- function ie(s) {
17
- return /* @__PURE__ */ n(_, { ...s, children: /* @__PURE__ */ n(M, { ...s, children: s.children }) });
18
- }
19
- const I = ["child_support"];
20
- function M({ className: s, employeeId: r, deductionId: u, dictionary: g }) {
21
- const { onEvent: D } = B(), { t } = N("Employee.Deductions"), i = k();
22
- F("Employee.Deductions", g), U("Employee.Deductions");
23
- const { data: f } = A({ employeeId: r }), { data: l } = R({}), o = u ? f.garnishmentList?.find((e) => e.uuid === u) ?? null : null, T = t(o ? "editDeductionTitle" : "addDeductionTitle"), d = o?.garnishmentType, S = l.childSupportData?.agencies?.map((e) => ({
24
- label: e.name,
25
- value: e.state
26
- })) || [], [m, y] = h(
27
- d && I.includes(d) || !o
28
- ), C = o ? d ? "garnishment" : "custom" : "garnishment", [p, b] = h(o?.childSupport?.state || ""), E = (e) => {
29
- b(e);
30
- }, x = l.childSupportData?.agencies?.find((e) => e.state === p)?.fipsCodes?.map((e) => ({
31
- label: e.county?.length ? e.county : t("allCounties"),
32
- value: e.code
33
- })) || [], L = l.childSupportData?.agencies?.find(
34
- (e) => e.state === p
35
- ), v = () => {
36
- D(j.EMPLOYEE_DEDUCTION_CANCEL);
37
- }, G = (e) => {
38
- y(e === "garnishment");
39
- };
40
- return /* @__PURE__ */ a("section", { className: s, children: [
41
- /* @__PURE__ */ a(i.Button, { variant: "secondary", onClick: v, children: [
42
- /* @__PURE__ */ n(w, { className: c.leftCaretIcon }),
43
- t("backToDeductionsCta")
44
- ] }),
45
- /* @__PURE__ */ a(H, { gap: 16, className: c.formHeadingContainer, children: [
46
- /* @__PURE__ */ n(i.Heading, { as: "h2", children: T }),
47
- /* @__PURE__ */ a("section", { children: [
48
- /* @__PURE__ */ n(i.Text, { weight: "bold", children: t("externalPostTaxDeductions") }),
49
- /* @__PURE__ */ n(i.Text, { variant: "supporting", children: t("externalPostTaxDeductionsDescription") })
50
- ] }),
51
- /* @__PURE__ */ n(
52
- i.RadioGroup,
53
- {
54
- label: t("deductionTypeLabel"),
55
- description: t("deductionTypeRadioLabel"),
56
- options: [
57
- { value: "garnishment", label: t("garnishmentOption") },
58
- { value: "custom", label: t("customDeductionOption") }
59
- ],
60
- defaultValue: C,
61
- onChange: G,
62
- isRequired: !0,
63
- isDisabled: !!o,
64
- className: c.deductionTypeRadioGroup
65
- }
66
- ),
67
- m && /* @__PURE__ */ a("section", { children: [
68
- /* @__PURE__ */ n(i.Text, { weight: "bold", className: c.garnishmentTypeLabel, children: t("garnishmentType") }),
69
- /* @__PURE__ */ n(
70
- i.Select,
71
- {
72
- label: t("garnishmentType"),
73
- options: [],
74
- placeholder: t("childSupport"),
75
- shouldVisuallyHideLabel: !0,
76
- isDisabled: !0
77
- }
78
- )
79
- ] }),
80
- /* @__PURE__ */ n("hr", {})
81
- ] }),
82
- m ? /* @__PURE__ */ n(
83
- P,
84
- {
85
- deduction: o,
86
- employeeId: r,
87
- handleStateAgencySelect: E,
88
- stateAgencies: S,
89
- counties: x,
90
- selectedAgency: L
91
- }
92
- ) : /* @__PURE__ */ n(O, { deduction: o, employeeId: r })
93
- ] });
94
- }
95
- export {
96
- ie as UNSTABLEDeductionsForm
97
- };
98
- //# sourceMappingURL=UNSTABLE_DeductionsForm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"UNSTABLE_DeductionsForm.js","sources":["../../../../../src/components/Employee/Deductions/DeductionsForm/UNSTABLE_DeductionsForm.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useState } from 'react'\nimport { useGarnishmentsListSuspense } from '@gusto/embedded-api/react-query/garnishmentsList'\nimport { useGarnishmentsGetChildSupportDataSuspense } from '@gusto/embedded-api/react-query/garnishmentsGetChildSupportData'\nimport styles from './DeductionsForm.module.scss'\nimport ChildSupportForm from './ChildSupportForm'\nimport CustomDeductionForm from './CustomDeductionForm'\nimport {\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n useBase,\n} from '@/components/Base'\nimport { Grid } from '@/components/Common/Grid/Grid'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary } from '@/i18n/I18n'\nimport CaretLeft from '@/assets/icons/caret-left.svg?react'\ninterface DeductionsFormProps extends CommonComponentInterface<'Employee.Deductions'> {\n employeeId: string\n deductionId?: string | null\n}\n\nexport function UNSTABLEDeductionsForm(props: DeductionsFormProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\n// deductions can be either custom or a garnishment\n// we currently only support child support garnishment type\nconst SUPPORTED_GARNISHMENT_TYPES = ['child_support']\n\nfunction Root({ className, employeeId, deductionId, dictionary }: DeductionsFormProps) {\n const { onEvent } = useBase()\n const { t } = useTranslation('Employee.Deductions')\n const Components = useComponentContext()\n\n useComponentDictionary('Employee.Deductions', dictionary)\n useI18n('Employee.Deductions')\n\n // Fetch all garnishments to find the specific one by ID\n const { data } = useGarnishmentsListSuspense({ employeeId })\n\n // Fetch child support garnishment metadata\n const { data: childSupportData } = useGarnishmentsGetChildSupportDataSuspense({})\n\n // find existing deduction to determine if in ADD or EDIT mode\n // if deduction exists we are editing, else we are adding\n // edit deductions cannot change the record type, it can only update the existing entries of the record\n const deduction = deductionId\n ? (data.garnishmentList?.find(g => g.uuid === deductionId) ?? null)\n : null\n const title = !deduction ? t('addDeductionTitle') : t('editDeductionTitle')\n const deductionType = deduction?.garnishmentType\n const stateAgencies =\n childSupportData.childSupportData?.agencies?.map(a => ({\n label: a.name as string,\n value: a.state as string,\n })) || []\n\n // if deduction exists check if it has a type, else if does not exist default to garnishment\n const [isGarnishment, setIsGarnishment] = useState<boolean>(\n (deductionType && SUPPORTED_GARNISHMENT_TYPES.includes(deductionType)) || !deduction,\n )\n const defaultDeductionTypeSelection = deduction\n ? deductionType\n ? 'garnishment'\n : 'custom'\n : 'garnishment'\n\n // filter out specific fipsCodes/counties as mapped to selected state agency\n // some states only have 1 fips code/county to cover the entire state,\n // but the API will return a null label so we need to provide a default label\n const [stateAgency, setStateAgency] = useState<string>(deduction?.childSupport?.state || '')\n const handleStateAgencySelect = (stateAgency: string) => {\n setStateAgency(stateAgency)\n }\n const counties =\n childSupportData.childSupportData?.agencies\n ?.find(agency => agency.state === stateAgency)\n ?.fipsCodes?.map(fipsCode => ({\n label: fipsCode.county?.length ? fipsCode.county : t('allCounties'),\n value: fipsCode.code as string,\n })) || []\n\n // get a reference to the currently selected agency to determine which required fields to display/include in submission\n const selectedAgency = childSupportData.childSupportData?.agencies?.find(\n agency => agency.state === stateAgency,\n )\n\n const handleCancel = () => {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_CANCEL)\n }\n\n const handleSelectDeductionType = (selection: string) => {\n setIsGarnishment(selection === 'garnishment')\n }\n\n return (\n <section className={className}>\n <Components.Button variant=\"secondary\" onClick={handleCancel}>\n <CaretLeft className={styles.leftCaretIcon} />\n {t('backToDeductionsCta')}\n </Components.Button>\n <Grid gap={16} className={styles.formHeadingContainer}>\n <Components.Heading as=\"h2\">{title}</Components.Heading>\n <section>\n <Components.Text weight=\"bold\">{t('externalPostTaxDeductions')}</Components.Text>\n <Components.Text variant=\"supporting\">\n {t('externalPostTaxDeductionsDescription')}\n </Components.Text>\n </section>\n <Components.RadioGroup\n label={t('deductionTypeLabel')}\n description={t('deductionTypeRadioLabel')}\n options={[\n { value: 'garnishment', label: t('garnishmentOption') },\n { value: 'custom', label: t('customDeductionOption') },\n ]}\n defaultValue={defaultDeductionTypeSelection}\n onChange={handleSelectDeductionType}\n isRequired\n isDisabled={!!deduction}\n className={styles.deductionTypeRadioGroup}\n />\n {isGarnishment && (\n <section>\n <Components.Text weight=\"bold\" className={styles.garnishmentTypeLabel}>\n {t('garnishmentType')}\n </Components.Text>\n {/* we currently only support child support garnishment type */}\n <Components.Select\n label={t('garnishmentType')}\n options={[]}\n placeholder={t('childSupport')}\n shouldVisuallyHideLabel\n isDisabled\n />\n </section>\n )}\n <hr />\n </Grid>\n\n {isGarnishment ? (\n <ChildSupportForm\n deduction={deduction}\n employeeId={employeeId}\n handleStateAgencySelect={handleStateAgencySelect}\n stateAgencies={stateAgencies}\n counties={counties}\n selectedAgency={selectedAgency}\n />\n ) : (\n <CustomDeductionForm deduction={deduction} employeeId={employeeId} />\n )}\n </section>\n )\n}\n"],"names":["UNSTABLEDeductionsForm","props","jsx","BaseComponent","Root","SUPPORTED_GARNISHMENT_TYPES","className","employeeId","deductionId","dictionary","onEvent","useBase","useTranslation","Components","useComponentContext","useComponentDictionary","useI18n","data","useGarnishmentsListSuspense","childSupportData","useGarnishmentsGetChildSupportDataSuspense","deduction","g","title","deductionType","stateAgencies","a","isGarnishment","setIsGarnishment","useState","defaultDeductionTypeSelection","stateAgency","setStateAgency","handleStateAgencySelect","counties","agency","fipsCode","selectedAgency","handleCancel","componentEvents","handleSelectDeductionType","selection","jsxs","CaretLeft","styles","Grid","ChildSupportForm","CustomDeductionForm"],"mappings":";;;;;;;;;;;;;;;AAwBO,SAASA,GAAuBC,GAAqD;AAC1F,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAIA,MAAMI,IAA8B,CAAC,eAAe;AAEpD,SAASD,EAAK,EAAE,WAAAE,GAAW,YAAAC,GAAY,aAAAC,GAAa,YAAAC,KAAmC;AACrF,QAAM,EAAE,SAAAC,EAAA,IAAYC,EAAA,GACd,EAAE,EAAA,IAA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AAiB;AAAA,YAC1B,SAAS,CAAA;AAAA,YACT,aAAa,EAAE,cAAc;AAAA,YAC7B,yBAAuB;AAAA,YACvB,YAAU;AAAA,UAAA;AAAA,QAAA;AAAA,MACZ,GACF;AAAA,wBAED,MAAA,CAAA,CAAG;AAAA,IAAA,GACN;AAAA,IAECc,IACC,gBAAAzB;AAAA,MAAC4C;AAAA,MAAA;AAAA,QACC,WAAAzB;AAAA,QACA,YAAAd;AAAA,QACA,yBAAA0B;AAAA,QACA,eAAAR;AAAA,QACA,UAAAS;AAAA,QACA,gBAAAG;AAAA,MAAA;AAAA,IAAA,IAGF,gBAAAnC,EAAC6C,GAAA,EAAoB,WAAA1B,GAAsB,YAAAd,EAAA,CAAwB;AAAA,EAAA,GAEvE;AAEJ;"}
@@ -1,28 +0,0 @@
1
- const n = "Company Bank Account", t = "We'll use your checking account info to debit for wages and taxes. Your account must be linked to a checking bank account. Credit payments, credit cards, and savings accounts are not accepted.", c = "How would you like to enter your bank account information?", o = "Enter bank account information manually", a = "Verify bank account with Plaid", e = "Routing number (9 digits)", i = "Account number", u = "What type of account is this?", s = "Checking", r = "Savings", l = "Save and continue", d = {
2
- title: n,
3
- intro: t,
4
- entry_selection_question: c,
5
- manual_entry: o,
6
- plaid_entry: a,
7
- routing_number_label: e,
8
- account_number_label: i,
9
- account_type_label: u,
10
- account_type_checking: s,
11
- account_type_savings: r,
12
- submit: l
13
- };
14
- export {
15
- i as account_number_label,
16
- s as account_type_checking,
17
- u as account_type_label,
18
- r as account_type_savings,
19
- d as default,
20
- c as entry_selection_question,
21
- t as intro,
22
- o as manual_entry,
23
- a as plaid_entry,
24
- e as routing_number_label,
25
- l as submit,
26
- n as title
27
- };
28
- //# sourceMappingURL=Company.AddBank.json.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Company.AddBank.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;"}
@@ -1,27 +0,0 @@
1
- const e = "Set up pay schedule", a = "Pick what frequency you'd like to run payroll. If you need help, you can <2>read more about how to choose a pay schedule</2>.", o = "Why do we need to ask for this? We need to know when to pay your employees. <2>Some states have laws around when you must pay your employees</2>. Please choose pay schedules that are legal for your employees.", t = "When selecting your pay date, please account for the 2 days it will take to process payroll.", y = "Pay Frequency", l = {
2
- pageTitle: e,
3
- helpOne: a,
4
- helpTwo: o,
5
- helpThree: t,
6
- payFrequency: y,
7
- "payFrequency.weekly": "Every week",
8
- "payFrequency.biweekly": "Every other week",
9
- "payFrequency.semimonthly": "Twice per month: 15th and last day of the month",
10
- "payFrequency.semimonthly_custom": "Twice per month: Custom",
11
- "payFrequency.monthly": "Monthly: last day of the month",
12
- "day_1.label": "First pay day of month",
13
- "day_2.label": "Second pay date",
14
- "anchor_pay_date.label": "First pay period end date",
15
- "deadline_to_run_payroll.label": "Deadline to run payroll",
16
- "anchor_end_of_pay_period.label": "First pay period end date",
17
- "anchor_end_of_pay_period.help": "The last date of the first pay period to help calculate future pay periods. This can be the same date as the first pay date."
18
- };
19
- export {
20
- l as default,
21
- a as helpOne,
22
- t as helpThree,
23
- o as helpTwo,
24
- e as pageTitle,
25
- y as payFrequency
26
- };
27
- //# sourceMappingURL=Payroll.PayrollSchedule.json.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Payroll.PayrollSchedule.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;"}