@gusto/embedded-react-sdk 0.26.0 → 0.28.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 (379) hide show
  1. package/CHANGELOG.md +103 -0
  2. package/dist/assets/icons/plus-circle.svg.js +5 -5
  3. package/dist/assets/icons/plus-circle.svg.js.map +1 -1
  4. package/dist/components/Base/Base.js +13 -12
  5. package/dist/components/Base/Base.js.map +1 -1
  6. package/dist/components/Common/DataView/DataCards/DataCards.d.ts +4 -2
  7. package/dist/components/Common/DataView/DataCards/DataCards.js +52 -32
  8. package/dist/components/Common/DataView/DataCards/DataCards.js.map +1 -1
  9. package/dist/components/Common/DataView/DataTable/DataTable.d.ts +3 -2
  10. package/dist/components/Common/DataView/DataTable/DataTable.js +68 -53
  11. package/dist/components/Common/DataView/DataTable/DataTable.js.map +1 -1
  12. package/dist/components/Common/DataView/DataView.d.ts +4 -2
  13. package/dist/components/Common/DataView/DataView.js +28 -18
  14. package/dist/components/Common/DataView/DataView.js.map +1 -1
  15. package/dist/components/Common/DataView/useDataView.d.ts +6 -1
  16. package/dist/components/Common/DataView/useDataView.js +34 -19
  17. package/dist/components/Common/DataView/useDataView.js.map +1 -1
  18. package/dist/components/Common/DocumentList/DocumentList.js +23 -23
  19. package/dist/components/Common/DocumentList/DocumentList.js.map +1 -1
  20. package/dist/components/Common/DocumentList/DocumentList.module.scss.js +6 -10
  21. package/dist/components/Common/DocumentList/DocumentList.module.scss.js.map +1 -1
  22. package/dist/components/Common/DocumentViewer/DocumentViewer.module.scss.js +12 -12
  23. package/dist/components/Common/InlineSpinner/InlineSpinner.module.scss.js +1 -1
  24. package/dist/components/Common/InternalError/InternalError.module.scss.js +4 -4
  25. package/dist/components/Common/ReorderableList/ReorderableList.module.scss.js +8 -8
  26. package/dist/components/Common/RequirementsList/RequirementsList.module.scss.js +1 -1
  27. package/dist/components/Common/SignatureForm/SignatureForm.js +12 -10
  28. package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
  29. package/dist/components/Common/SignatureForm/SignatureFormActions.js +3 -2
  30. package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
  31. package/dist/components/Common/SignatureForm/SignatureFormFields.js +7 -6
  32. package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
  33. package/dist/components/Common/UI/Alert/Alert.module.scss.js +9 -9
  34. package/dist/components/Common/UI/Banner/Banner.module.scss.js +1 -1
  35. package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js +1 -1
  36. package/dist/components/Common/UI/Button/Button.module.scss.js +1 -1
  37. package/dist/components/Common/UI/CalendarPreview/CalendarPreview.module.scss.js +4 -4
  38. package/dist/components/Common/UI/Card/Card.d.ts +1 -1
  39. package/dist/components/Common/UI/Card/Card.js +10 -20
  40. package/dist/components/Common/UI/Card/Card.js.map +1 -1
  41. package/dist/components/Common/UI/Card/Card.module.scss.js +1 -1
  42. package/dist/components/Common/UI/Card/CardTypes.d.ts +4 -4
  43. package/dist/components/Common/UI/Checkbox/Checkbox.module.scss.js +1 -1
  44. package/dist/components/Common/UI/ComboBox/ComboBox.module.scss.js +3 -3
  45. package/dist/components/Common/UI/DatePicker/DatePicker.module.scss.js +4 -4
  46. package/dist/components/Common/UI/DescriptionList/DescriptionList.module.scss.js +1 -1
  47. package/dist/components/Common/UI/Dialog/Dialog.module.scss.js +2 -2
  48. package/dist/components/Common/UI/FileInput/FileInput.js +1 -1
  49. package/dist/components/Common/UI/FileInput/FileInput.module.scss.js +26 -26
  50. package/dist/components/Common/UI/Input/Input.module.scss.js +8 -8
  51. package/dist/components/Common/UI/Modal/Modal.module.scss.js +12 -12
  52. package/dist/components/Common/UI/ProgressBar/ProgressBar.js +4 -4
  53. package/dist/components/Common/UI/Radio/Radio.module.scss.js +6 -6
  54. package/dist/components/Common/UI/Select/Select.module.scss.js +4 -4
  55. package/dist/components/Common/UI/Table/Table.js +1 -1
  56. package/dist/components/Common/UI/Table/Table.js.map +1 -1
  57. package/dist/components/Common/UI/Table/Table.module.scss.js +1 -1
  58. package/dist/components/Common/UI/Tabs/Tabs.module.scss.js +1 -1
  59. package/dist/components/Common/UI/Text/Text.module.scss.js +17 -15
  60. package/dist/components/Common/UI/Text/Text.module.scss.js.map +1 -1
  61. package/dist/components/Common/UI/TextArea/TextArea.module.scss.js +4 -4
  62. package/dist/components/Company/AssignSignatory/AssignSignatory.js +3 -2
  63. package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
  64. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +4 -3
  65. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
  66. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +3 -2
  67. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
  68. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +1 -1
  69. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +12 -12
  70. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +4 -3
  71. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  72. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +3 -2
  73. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
  74. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +1 -1
  75. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +1 -1
  76. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +4 -3
  77. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  78. package/dist/components/Company/AssignSignatory/TitleSelect.js +4 -3
  79. package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
  80. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +6 -5
  81. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  82. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +9 -8
  83. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
  84. package/dist/components/Company/BankAccount/BankAccountForm/Form.js +7 -5
  85. package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
  86. package/dist/components/Company/BankAccount/BankAccountForm/context.js +4 -3
  87. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  88. package/dist/components/Company/BankAccount/BankAccountList/Actions.js +3 -2
  89. package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
  90. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +7 -6
  91. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
  92. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +7 -5
  93. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
  94. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +3 -2
  95. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
  96. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +9 -8
  97. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  98. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +4 -3
  99. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  100. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +4 -3
  101. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  102. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +4 -3
  103. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  104. package/dist/components/Company/FederalTaxes/Actions.js +7 -6
  105. package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
  106. package/dist/components/Company/FederalTaxes/FederalTaxes.js +4 -3
  107. package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
  108. package/dist/components/Company/FederalTaxes/Form.js +5 -3
  109. package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
  110. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +6 -5
  111. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  112. package/dist/components/Company/Industry/Actions.js +8 -7
  113. package/dist/components/Company/Industry/Actions.js.map +1 -1
  114. package/dist/components/Company/Industry/Context.js +7 -6
  115. package/dist/components/Company/Industry/Context.js.map +1 -1
  116. package/dist/components/Company/Industry/Edit.js +3 -2
  117. package/dist/components/Company/Industry/Edit.js.map +1 -1
  118. package/dist/components/Company/Locations/LocationForm/Actions.js +7 -6
  119. package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
  120. package/dist/components/Company/Locations/LocationForm/Form.js +1 -1
  121. package/dist/components/Company/Locations/LocationForm/LocationForm.js +4 -3
  122. package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
  123. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +4 -3
  124. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  125. package/dist/components/Company/Locations/LocationsList/Actions.js +3 -2
  126. package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
  127. package/dist/components/Company/Locations/LocationsList/List.js +7 -6
  128. package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
  129. package/dist/components/Company/Locations/LocationsList/LocationsList.js +8 -7
  130. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  131. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +4 -3
  132. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  133. package/dist/components/Company/OnboardingOverview/Completed.js +12 -10
  134. package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
  135. package/dist/components/Company/OnboardingOverview/MissingRequirements.js +8 -6
  136. package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
  137. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +8 -7
  138. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
  139. package/dist/components/Company/OnboardingOverview/context.js +4 -3
  140. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  141. package/dist/components/Company/PaySchedule/PaySchedule.js +4 -3
  142. package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
  143. package/dist/components/Company/PaySchedule/_parts/Actions.js +3 -2
  144. package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
  145. package/dist/components/Company/PaySchedule/_parts/Edit.js +15 -15
  146. package/dist/components/Company/PaySchedule/_parts/Head.js +13 -11
  147. package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
  148. package/dist/components/Company/PaySchedule/_parts/List.js +15 -13
  149. package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
  150. package/dist/components/Company/PaySchedule/usePaySchedule.js +6 -5
  151. package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
  152. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +3 -2
  153. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
  154. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +4 -3
  155. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  156. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +3 -2
  157. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
  158. package/dist/components/Company/StateTaxes/StateTaxesList/List.js +3 -2
  159. package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
  160. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +4 -3
  161. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  162. package/dist/components/Contractor/Address/Address.js +5 -4
  163. package/dist/components/Contractor/Address/Address.js.map +1 -1
  164. package/dist/components/Contractor/Address/Form.js +1 -1
  165. package/dist/components/Contractor/Address/useAddress.js +6 -5
  166. package/dist/components/Contractor/Address/useAddress.js.map +1 -1
  167. package/dist/components/Contractor/ContractorList/index.js +32 -31
  168. package/dist/components/Contractor/ContractorList/index.js.map +1 -1
  169. package/dist/components/Contractor/NewHireReport/NewHireReport.js +14 -13
  170. package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
  171. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +12 -11
  172. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
  173. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +3 -2
  174. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
  175. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +4 -3
  176. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
  177. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +4 -2
  178. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
  179. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +10 -10
  180. package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js +9 -7
  181. package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js.map +1 -1
  182. package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +9 -8
  183. package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js.map +1 -1
  184. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js +11 -9
  185. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map +1 -1
  186. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js +8 -6
  187. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js.map +1 -1
  188. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.module.scss.js +14 -14
  189. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js +4 -2
  190. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js.map +1 -1
  191. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +4 -2
  192. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
  193. package/dist/components/Contractor/Profile/ContractorProfileForm.js +15 -15
  194. package/dist/components/Contractor/Profile/ContractorProfileForm.module.scss.js +1 -1
  195. package/dist/components/Contractor/Profile/useContractorProfile.js +3 -2
  196. package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
  197. package/dist/components/Contractor/Submit/Submit.js +21 -20
  198. package/dist/components/Contractor/Submit/Submit.js.map +1 -1
  199. package/dist/components/Employee/Compensation/Actions.js +13 -12
  200. package/dist/components/Employee/Compensation/Actions.js.map +1 -1
  201. package/dist/components/Employee/Compensation/Edit.js +17 -16
  202. package/dist/components/Employee/Compensation/Edit.js.map +1 -1
  203. package/dist/components/Employee/Compensation/List.js +23 -22
  204. package/dist/components/Employee/Compensation/List.js.map +1 -1
  205. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.d.ts +3 -1
  206. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +145 -137
  207. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
  208. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.d.ts +2 -1
  209. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +106 -101
  210. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
  211. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js +90 -87
  212. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js.map +1 -1
  213. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.d.ts +2 -1
  214. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +110 -104
  215. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -1
  216. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +51 -45
  217. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js.map +1 -1
  218. package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js +31 -30
  219. package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js.map +1 -1
  220. package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.module.scss.js +4 -8
  221. package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.module.scss.js.map +1 -1
  222. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +3 -2
  223. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
  224. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +3 -2
  225. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  226. package/dist/components/Employee/DocumentSigner/DocumentList/List.js +4 -2
  227. package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
  228. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +4 -3
  229. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  230. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +3 -2
  231. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  232. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +4 -3
  233. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  234. package/dist/components/Employee/EmployeeList/Actions.js +7 -6
  235. package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
  236. package/dist/components/Employee/EmployeeList/EmployeeList.js +4 -3
  237. package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
  238. package/dist/components/Employee/EmployeeList/Head.js +7 -5
  239. package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
  240. package/dist/components/Employee/EmployeeList/List.js +3 -2
  241. package/dist/components/Employee/EmployeeList/List.js.map +1 -1
  242. package/dist/components/Employee/EmployeeList/useEmployeeList.js +4 -3
  243. package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
  244. package/dist/components/Employee/FederalTaxes/Actions.js +6 -5
  245. package/dist/components/Employee/FederalTaxes/Actions.js.map +1 -1
  246. package/dist/components/Employee/FederalTaxes/FederalForm.js +12 -11
  247. package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
  248. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +4 -3
  249. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
  250. package/dist/components/Employee/Landing/Landing.js +11 -10
  251. package/dist/components/Employee/Landing/Landing.js.map +1 -1
  252. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +7 -7
  253. package/dist/components/Employee/PaymentMethod/Actions.js +6 -5
  254. package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
  255. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +5 -4
  256. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
  257. package/dist/components/Employee/PaymentMethod/BankAccountsList.js +3 -2
  258. package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
  259. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +7 -6
  260. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
  261. package/dist/components/Employee/PaymentMethod/Split.js +11 -10
  262. package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
  263. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +6 -5
  264. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
  265. package/dist/components/Employee/Profile/Actions.js +6 -5
  266. package/dist/components/Employee/Profile/Actions.js.map +1 -1
  267. package/dist/components/Employee/Profile/AdminPersonalDetails.js +6 -5
  268. package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
  269. package/dist/components/Employee/Profile/AdminPersonalDetails.module.scss.js +1 -1
  270. package/dist/components/Employee/Profile/HomeAddress.js +1 -1
  271. package/dist/components/Employee/Profile/PersonalDetailsInputs.js +2 -2
  272. package/dist/components/Employee/Profile/useProfile.js +4 -3
  273. package/dist/components/Employee/Profile/useProfile.js.map +1 -1
  274. package/dist/components/Employee/StateTaxes/Actions.js +6 -5
  275. package/dist/components/Employee/StateTaxes/Actions.js.map +1 -1
  276. package/dist/components/Employee/StateTaxes/useStateTaxes.js +4 -3
  277. package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
  278. package/dist/components/Employee/Taxes/Actions.js +7 -6
  279. package/dist/components/Employee/Taxes/Actions.js.map +1 -1
  280. package/dist/components/Employee/Taxes/FederalForm.js +14 -13
  281. package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
  282. package/dist/components/Employee/Taxes/useTaxes.js +4 -3
  283. package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
  284. package/dist/components/Flow/Flow.js +9 -7
  285. package/dist/components/Flow/Flow.js.map +1 -1
  286. package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js +17 -16
  287. package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -1
  288. package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.module.scss.js +4 -4
  289. package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js +41 -39
  290. package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js.map +1 -1
  291. package/dist/components/InformationRequests/InformationRequests.d.ts +7 -2
  292. package/dist/components/InformationRequests/InformationRequests.js +78 -45
  293. package/dist/components/InformationRequests/InformationRequests.js.map +1 -1
  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/ConfirmWireDetails/WireInstructions/WireInstructions.module.scss.js +10 -10
  297. package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelection.d.ts +2 -0
  298. package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelection.js +33 -0
  299. package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelection.js.map +1 -0
  300. package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.d.ts +7 -0
  301. package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js +39 -0
  302. package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js.map +1 -0
  303. package/dist/components/Payroll/OffCycleReasonSelection/index.d.ts +5 -0
  304. package/dist/components/Payroll/OffCycleReasonSelection/types.d.ts +15 -0
  305. package/dist/components/Payroll/OffCycleReasonSelection/types.js +14 -0
  306. package/dist/components/Payroll/OffCycleReasonSelection/types.js.map +1 -0
  307. package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateForm.d.ts +2 -0
  308. package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateForm.js +35 -0
  309. package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateForm.js.map +1 -0
  310. package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateFormPresentation.d.ts +2 -0
  311. package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateFormPresentation.js +65 -0
  312. package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateFormPresentation.js.map +1 -0
  313. package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateFormPresentation.module.scss.js +18 -0
  314. package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateFormPresentation.module.scss.js.map +1 -0
  315. package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateFormTypes.d.ts +53 -0
  316. package/dist/components/Payroll/PayPeriodDateForm/index.d.ts +3 -0
  317. package/dist/components/Payroll/PayPeriodDateForm/usePayPeriodDateValidation.d.ts +5 -0
  318. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +4 -2
  319. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
  320. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +19 -18
  321. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js.map +1 -1
  322. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +36 -36
  323. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.module.scss.js +5 -5
  324. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +21 -19
  325. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
  326. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +17 -15
  327. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
  328. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +26 -24
  329. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
  330. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +30 -29
  331. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
  332. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js +4 -2
  333. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js.map +1 -1
  334. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +3 -2
  335. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
  336. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.module.scss.js +18 -18
  337. package/dist/components/Payroll/RecoveryCases/RecoveryCases.d.ts +4 -1
  338. package/dist/components/Payroll/RecoveryCases/RecoveryCases.js +34 -28
  339. package/dist/components/Payroll/RecoveryCases/RecoveryCases.js.map +1 -1
  340. package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js +29 -29
  341. package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js.map +1 -1
  342. package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js +12 -11
  343. package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js.map +1 -1
  344. package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js +4 -2
  345. package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js.map +1 -1
  346. package/dist/components/Payroll/index.d.ts +4 -0
  347. package/dist/components/Payroll/index.js +12 -8
  348. package/dist/components/Payroll/index.js.map +1 -1
  349. package/dist/components/Payroll/usePreparedPayrollData.js +3 -2
  350. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  351. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +3 -2
  352. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  353. package/dist/contexts/ThemeProvider/theme.d.ts +8 -3
  354. package/dist/contexts/ThemeProvider/theme.js +29 -24
  355. package/dist/contexts/ThemeProvider/theme.js.map +1 -1
  356. package/dist/helpers/dateFormatting.d.ts +3 -0
  357. package/dist/helpers/dateFormatting.js.map +1 -1
  358. package/dist/i18n/I18n.js +1 -1
  359. package/dist/i18n/I18n.js.map +1 -1
  360. package/dist/i18n/en/Employee.Deductions.json.js +157 -161
  361. package/dist/i18n/en/Employee.Deductions.json.js.map +1 -1
  362. package/dist/i18n/en/InformationRequests.InformationRequestList.json.js +18 -14
  363. package/dist/i18n/en/InformationRequests.InformationRequestList.json.js.map +1 -1
  364. package/dist/i18n/en/InformationRequests.json.js +8 -0
  365. package/dist/i18n/en/InformationRequests.json.js.map +1 -0
  366. package/dist/i18n/en/Payroll.OffCycleReasonSelection.json.js +12 -0
  367. package/dist/i18n/en/Payroll.OffCycleReasonSelection.json.js.map +1 -0
  368. package/dist/i18n/en/Payroll.PayPeriodDateForm.json.js +32 -0
  369. package/dist/i18n/en/Payroll.PayPeriodDateForm.json.js.map +1 -0
  370. package/dist/shared/constants.d.ts +4 -0
  371. package/dist/shared/constants.js +10 -8
  372. package/dist/shared/constants.js.map +1 -1
  373. package/dist/style.css +1 -1
  374. package/dist/types/i18next.d.ts +52 -3
  375. package/package.json +11 -11
  376. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.module.scss.js +0 -8
  377. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.module.scss.js.map +0 -1
  378. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.module.scss.js +0 -14
  379. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.module.scss.js.map +0 -1
@@ -1,23 +1,22 @@
1
- import { jsx as n, jsxs as a, Fragment as H } from "react/jsx-runtime";
2
- import { useTranslation as M } from "react-i18next";
3
- import { useState as u } from "react";
4
- import { useGarnishmentsListSuspense as Y } from "@gusto/embedded-api/react-query/garnishmentsList";
5
- import { useGarnishmentsGetChildSupportDataSuspense as B } from "@gusto/embedded-api/react-query/garnishmentsGetChildSupportData";
6
- import c from "./DeductionsForm.module.scss.js";
7
- import U from "./ChildSupportForm.js";
8
- import j from "./GarnishmentForm.js";
1
+ import { jsx as n, jsxs as l, Fragment as E } from "react/jsx-runtime";
2
+ import { useTranslation as q } from "react-i18next";
3
+ import { useState as h } from "react";
4
+ import { useGarnishmentsListSuspense as B } from "@gusto/embedded-api/react-query/garnishmentsList";
5
+ import { useGarnishmentsGetChildSupportDataSuspense as H } from "@gusto/embedded-api/react-query/garnishmentsGetChildSupportData";
6
+ import I from "./ChildSupportForm.js";
7
+ import V from "./GarnishmentForm.js";
9
8
  import k from "./CustomDeductionForm.js";
10
- import { BaseComponent as I } from "../../../Base/Base.js";
11
- import { useBase as V } from "../../../Base/useBase.js";
12
- import { Grid as q } from "../../../Common/Grid/Grid.js";
13
- import { useComponentDictionary as w, useI18n as z } from "../../../../i18n/I18n.js";
14
- import { componentEvents as C } from "../../../../shared/constants.js";
15
- import { useComponentContext as J } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
16
- import K from "../../../../assets/icons/caret-left.svg.js";
17
- function ue(s) {
18
- return /* @__PURE__ */ n(I, { ...s, children: /* @__PURE__ */ n(Q, { ...s, children: s.children }) });
9
+ import { BaseComponent as w } from "../../../Base/Base.js";
10
+ import { useBase as z } from "../../../Base/useBase.js";
11
+ import { Grid as J } from "../../../Common/Grid/Grid.js";
12
+ import { useComponentDictionary as K, useI18n as Q } from "../../../../i18n/I18n.js";
13
+ import { componentEvents as y } from "../../../../shared/constants.js";
14
+ import { useComponentContext as W } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
15
+ import { Flex as x } from "../../../Common/Flex/Flex.js";
16
+ function pe(i) {
17
+ return /* @__PURE__ */ n(w, { ...i, children: /* @__PURE__ */ n(X, { ...i, children: i.children }) });
19
18
  }
20
- const S = [
19
+ const G = [
21
20
  "child_support",
22
21
  "federal_tax_lien",
23
22
  "state_tax_lien",
@@ -26,17 +25,17 @@ const S = [
26
25
  "federal_loan",
27
26
  "other_garnishment"
28
27
  ];
29
- function Q({ className: s, employeeId: r, deductionId: p, dictionary: y }) {
30
- const { onEvent: h } = V(), { t } = M("Employee.Deductions"), i = J();
31
- w("Employee.Deductions", y), z("Employee.Deductions");
32
- const { data: g } = Y({ employeeId: r }), { data: d } = B({}), o = p ? g.garnishmentList?.find((e) => e.uuid === p) ?? null : null, E = t(o ? "editDeductionTitle" : "addDeductionTitle"), l = o?.garnishmentType, L = d.childSupportData?.agencies?.map((e) => ({
28
+ function X({ className: i, employeeId: s, deductionId: g, dictionary: L }) {
29
+ const { onEvent: f } = z(), { t } = q("Employee.Deductions"), a = W();
30
+ K("Employee.Deductions", L), Q("Employee.Deductions");
31
+ const { data: _ } = B({ employeeId: s }), { data: c } = H({}), o = g ? _.garnishmentList?.find((e) => e.uuid === g) ?? null : null, b = t(o ? "editDeductionTitle" : "addDeductionTitle"), r = o?.garnishmentType, v = c.childSupportData?.agencies?.map((e) => ({
33
32
  label: e.name,
34
33
  value: e.state
35
- })) || [], [f, b] = u(
36
- l && S.includes(l) || !o
37
- ), [m, x] = u(
38
- l || "child_support"
39
- ), T = {
34
+ })) || [], [D, A] = h(
35
+ r && G.includes(r) || !o
36
+ ), [d, F] = h(
37
+ r || "child_support"
38
+ ), C = {
40
39
  child_support: t("childSupportTitle"),
41
40
  federal_tax_lien: t("federalTaxLien"),
42
41
  state_tax_lien: t("stateTaxLien"),
@@ -44,88 +43,92 @@ function Q({ className: s, employeeId: r, deductionId: p, dictionary: y }) {
44
43
  creditor_garnishment: t("creditorGarnishment"),
45
44
  federal_loan: t("federalLoan"),
46
45
  other_garnishment: t("otherGarnishment")
47
- }, D = T[m], G = S.map((e) => ({
46
+ }, T = C[d], O = G.map((e) => ({
48
47
  value: e,
49
- label: T[e]
50
- })), v = o ? l ? "garnishment" : "custom" : "garnishment", [_, N] = u(o?.childSupport?.state || ""), P = (e) => {
51
- N(e);
52
- }, A = d.childSupportData?.agencies?.find((e) => e.state === _)?.fipsCodes?.map((e) => ({
48
+ label: C[e]
49
+ })), P = o ? r ? "garnishment" : "custom" : "garnishment", [S, R] = h(o?.childSupport?.state || ""), N = (e) => {
50
+ R(e);
51
+ }, m = c.childSupportData?.agencies?.find(
52
+ (e) => e.state === S
53
+ )?.fipsCodes, M = (m ?? []).filter((e) => typeof e.code == "string").map((e) => ({
53
54
  label: e.county?.length ? e.county : t("allCounties"),
54
- value: e.code
55
- })) || [], O = d.childSupportData?.agencies?.find(
56
- (e) => e.state === _
57
- ), R = () => {
58
- g.garnishmentList?.some((e) => e.active) ? h(C.EMPLOYEE_DEDUCTION_CANCEL) : h(C.EMPLOYEE_DEDUCTION_CANCEL_EMPTY);
59
- }, F = (e) => {
60
- b(e === "garnishment");
55
+ value: e.code ?? ""
56
+ })), u = m?.length === 1 ? m[0] : void 0, Y = u && !u.county?.length ? u.code : null, U = c.childSupportData?.agencies?.find(
57
+ (e) => e.state === S
58
+ ), p = () => {
59
+ _.garnishmentList?.some((e) => e.active) ? f(y.EMPLOYEE_DEDUCTION_CANCEL) : f(y.EMPLOYEE_DEDUCTION_CANCEL_EMPTY);
60
+ }, j = (e) => {
61
+ A(e === "garnishment");
61
62
  };
62
- return /* @__PURE__ */ a("section", { className: s, children: [
63
- /* @__PURE__ */ a(i.Button, { variant: "secondary", onClick: R, children: [
64
- /* @__PURE__ */ n(K, { className: c.leftCaretIcon }),
65
- t("backToDeductionsCta")
63
+ return /* @__PURE__ */ n("section", { className: i, children: /* @__PURE__ */ l(J, { gap: 32, children: [
64
+ /* @__PURE__ */ l(x, { flexDirection: "column", gap: 2, children: [
65
+ /* @__PURE__ */ n(a.Heading, { as: "h2", children: b }),
66
+ /* @__PURE__ */ n(a.Text, { variant: "supporting", children: t("externalPostTaxDeductionsDescription") })
66
67
  ] }),
67
- /* @__PURE__ */ a(q, { gap: 16, className: c.formHeadingContainer, children: [
68
- /* @__PURE__ */ n(i.Heading, { as: "h2", children: E }),
69
- /* @__PURE__ */ a("section", { children: [
70
- /* @__PURE__ */ n(i.Heading, { as: "h3", children: t("externalPostTaxDeductions") }),
71
- /* @__PURE__ */ n(i.Text, { variant: "supporting", children: t("externalPostTaxDeductionsDescription") })
72
- ] }),
73
- /* @__PURE__ */ n(
74
- i.RadioGroup,
75
- {
76
- label: t("deductionTypeLabel"),
77
- description: t("deductionTypeRadioLabel"),
78
- options: [
79
- { value: "garnishment", label: t("garnishmentOption") },
80
- { value: "custom", label: t("customDeductionOption") }
81
- ],
82
- defaultValue: v,
83
- onChange: F,
84
- isRequired: !0,
85
- isDisabled: !!o,
86
- className: c.deductionTypeRadioGroup
87
- }
88
- ),
89
- f && /* @__PURE__ */ a("section", { children: [
90
- /* @__PURE__ */ n(i.Text, { weight: "bold", className: c.garnishmentTypeLabel, children: t("garnishmentType") }),
68
+ !o && /* @__PURE__ */ l(E, { children: [
69
+ /* @__PURE__ */ l(x, { flexDirection: "column", gap: 20, children: [
91
70
  /* @__PURE__ */ n(
92
- i.Select,
71
+ a.RadioGroup,
72
+ {
73
+ label: t("deductionTypeLabel"),
74
+ description: t("deductionTypeRadioLabel"),
75
+ options: [
76
+ { value: "garnishment", label: t("garnishmentOption") },
77
+ { value: "custom", label: t("customDeductionOption") }
78
+ ],
79
+ defaultValue: P,
80
+ onChange: j,
81
+ isRequired: !0
82
+ }
83
+ ),
84
+ D && /* @__PURE__ */ n(
85
+ a.Select,
93
86
  {
94
87
  label: t("garnishmentType"),
95
- options: G,
96
- placeholder: D,
97
- shouldVisuallyHideLabel: !0,
88
+ options: O,
89
+ placeholder: T,
98
90
  onChange: (e) => {
99
- x(e);
91
+ F(e);
100
92
  },
101
- isDisabled: !!o
93
+ isDisabled: !!o,
94
+ isRequired: !0
102
95
  }
103
96
  )
104
97
  ] }),
105
98
  /* @__PURE__ */ n("hr", {})
106
99
  ] }),
107
- f ? /* @__PURE__ */ n(H, { children: m === "child_support" ? /* @__PURE__ */ n(
108
- U,
100
+ D ? /* @__PURE__ */ n(E, { children: d === "child_support" ? /* @__PURE__ */ n(
101
+ I,
109
102
  {
110
103
  deduction: o,
111
- employeeId: r,
112
- handleStateAgencySelect: P,
113
- stateAgencies: L,
114
- counties: A,
115
- selectedAgency: O
104
+ employeeId: s,
105
+ handleStateAgencySelect: N,
106
+ stateAgencies: v,
107
+ counties: M,
108
+ singleAllCountiesFipsCode: Y,
109
+ selectedAgency: U,
110
+ onCancel: p
116
111
  }
117
112
  ) : /* @__PURE__ */ n(
118
- j,
113
+ V,
114
+ {
115
+ deduction: o,
116
+ employeeId: s,
117
+ selectedGarnishmentType: d,
118
+ selectedGarnishmentTitle: T,
119
+ onCancel: p
120
+ }
121
+ ) }) : /* @__PURE__ */ n(
122
+ k,
119
123
  {
120
124
  deduction: o,
121
- employeeId: r,
122
- selectedGarnishmentType: m,
123
- selectedGarnishmentTitle: D
125
+ employeeId: s,
126
+ onCancel: p
124
127
  }
125
- ) }) : /* @__PURE__ */ n(k, { deduction: o, employeeId: r })
126
- ] });
128
+ )
129
+ ] }) });
127
130
  }
128
131
  export {
129
- ue as DeductionsForm
132
+ pe as DeductionsForm
130
133
  };
131
134
  //# sourceMappingURL=DeductionsForm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DeductionsForm.js","sources":["../../../../../src/components/Employee/Deductions/DeductionsForm/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 type { GarnishmentType } from '@gusto/embedded-api/models/operations/postv1employeesemployeeidgarnishments'\nimport styles from './DeductionsForm.module.scss'\nimport ChildSupportForm from './ChildSupportForm'\nimport GarnishmentForm from './GarnishmentForm'\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'\n\ninterface DeductionsFormProps extends CommonComponentInterface<'Employee.Deductions'> {\n employeeId: string\n deductionId?: string | null\n}\n\nexport function DeductionsForm(props: DeductionsFormProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\n// deductions can be either garnishment (court-ordered) or a custom deduction\nconst SUPPORTED_GARNISHMENT_TYPES: GarnishmentType[] = [\n 'child_support',\n 'federal_tax_lien',\n 'state_tax_lien',\n 'student_loan',\n 'creditor_garnishment',\n 'federal_loan',\n 'other_garnishment',\n]\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 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 [selectedGarnishment, setSelectedGarnishment] = useState<GarnishmentType>(\n deductionType || 'child_support',\n )\n const garnishmentLabels: Record<string, string> = {\n child_support: t('childSupportTitle'),\n federal_tax_lien: t('federalTaxLien'),\n state_tax_lien: t('stateTaxLien'),\n student_loan: t('studentLoan'),\n creditor_garnishment: t('creditorGarnishment'),\n federal_loan: t('federalLoan'),\n other_garnishment: t('otherGarnishment'),\n }\n const garnishmentPlaceholder = garnishmentLabels[selectedGarnishment]\n const garnishmentOptions = SUPPORTED_GARNISHMENT_TYPES.map(garnishment => ({\n value: garnishment,\n label: garnishmentLabels[garnishment] as string,\n }))\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 // if any active garnishments return to list view, else return to empty state view\n if (data.garnishmentList?.some(g => g.active)) {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_CANCEL)\n } else {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_CANCEL_EMPTY)\n }\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.Heading as=\"h3\">{t('externalPostTaxDeductions')}</Components.Heading>\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 <Components.Select\n label={t('garnishmentType')}\n options={garnishmentOptions}\n placeholder={garnishmentPlaceholder}\n shouldVisuallyHideLabel\n onChange={value => {\n setSelectedGarnishment(value as GarnishmentType)\n }}\n isDisabled={!!deduction} // API does not allow to change/edit an existing deduction type\n />\n </section>\n )}\n <hr />\n </Grid>\n\n {isGarnishment ? (\n <>\n {selectedGarnishment === 'child_support' ? (\n <ChildSupportForm\n deduction={deduction}\n employeeId={employeeId}\n handleStateAgencySelect={handleStateAgencySelect}\n stateAgencies={stateAgencies}\n counties={counties}\n selectedAgency={selectedAgency}\n />\n ) : (\n <GarnishmentForm\n deduction={deduction}\n employeeId={employeeId}\n selectedGarnishmentType={selectedGarnishment}\n selectedGarnishmentTitle={garnishmentPlaceholder!}\n />\n )}\n </>\n ) : (\n <CustomDeductionForm deduction={deduction} employeeId={employeeId} />\n )}\n </section>\n )\n}\n"],"names":["DeductionsForm","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","selectedGarnishment","setSelectedGarnishment","garnishmentLabels","garnishmentPlaceholder","garnishmentOptions","garnishment","defaultDeductionTypeSelection","stateAgency","setStateAgency","handleStateAgencySelect","counties","agency","fipsCode","selectedAgency","handleCancel","componentEvents","handleSelectDeductionType","selection","jsxs","CaretLeft","styles","Grid","value","Fragment","ChildSupportForm","GarnishmentForm","CustomDeductionForm"],"mappings":";;;;;;;;;;;;;;;;AA2BO,SAASA,GAAeC,GAAqD;AAClF,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAGA,MAAMI,IAAiD;AAAA,EACrD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,SAASD,EAAK,EAAE,WAAAE,GAAW,YAAAC,GAAY,aAAAC,GAAa,YAAAC,KAAmC;AACrF,QAAM,EAAE,SAAAC,EAAA,IAAYC,EAAA,GACd,EAAE,EAAA,IAAMC,EAAe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,gBAAA/B,EAACsD,GAAA,EAAoB,WAAAnC,GAAsB,YAAAd,EAAA,CAAwB;AAAA,EAAA,GAEvE;AAEJ;"}
1
+ {"version":3,"file":"DeductionsForm.js","sources":["../../../../../src/components/Employee/Deductions/DeductionsForm/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 type { GarnishmentType } from '@gusto/embedded-api/models/operations/postv1employeesemployeeidgarnishments'\nimport ChildSupportForm from './ChildSupportForm'\nimport GarnishmentForm from './GarnishmentForm'\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 { Flex } from '@/components/Common/Flex/Flex'\n\ninterface DeductionsFormProps extends CommonComponentInterface<'Employee.Deductions'> {\n employeeId: string\n deductionId?: string | null\n}\n\nexport function DeductionsForm(props: DeductionsFormProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\n// deductions can be either garnishment (court-ordered) or a custom deduction\nconst SUPPORTED_GARNISHMENT_TYPES: GarnishmentType[] = [\n 'child_support',\n 'federal_tax_lien',\n 'state_tax_lien',\n 'student_loan',\n 'creditor_garnishment',\n 'federal_loan',\n 'other_garnishment',\n]\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 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 [selectedGarnishment, setSelectedGarnishment] = useState<GarnishmentType>(\n deductionType || 'child_support',\n )\n const garnishmentLabels: Record<string, string> = {\n child_support: t('childSupportTitle'),\n federal_tax_lien: t('federalTaxLien'),\n state_tax_lien: t('stateTaxLien'),\n student_loan: t('studentLoan'),\n creditor_garnishment: t('creditorGarnishment'),\n federal_loan: t('federalLoan'),\n other_garnishment: t('otherGarnishment'),\n }\n const garnishmentPlaceholder = garnishmentLabels[selectedGarnishment]\n const garnishmentOptions = SUPPORTED_GARNISHMENT_TYPES.map(garnishment => ({\n value: garnishment,\n label: garnishmentLabels[garnishment] as string,\n }))\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 selectedAgencyFipsCodes = childSupportData.childSupportData?.agencies?.find(\n agency => agency.state === stateAgency,\n )?.fipsCodes\n const counties = (selectedAgencyFipsCodes ?? [])\n .filter(fipsCode => typeof fipsCode.code === 'string')\n .map(fipsCode => ({\n label: fipsCode.county?.length ? fipsCode.county : t('allCounties'),\n value: fipsCode.code ?? '',\n }))\n const singleFipsCode =\n selectedAgencyFipsCodes?.length === 1 ? selectedAgencyFipsCodes[0] : undefined\n const singleAllCountiesFipsCode =\n singleFipsCode && !singleFipsCode.county?.length ? singleFipsCode.code : null\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 // if any active garnishments return to list view, else return to empty state view\n if (data.garnishmentList?.some(g => g.active)) {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_CANCEL)\n } else {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_CANCEL_EMPTY)\n }\n }\n\n const handleSelectDeductionType = (selection: string) => {\n setIsGarnishment(selection === 'garnishment')\n }\n\n return (\n <section className={className}>\n <Grid gap={32}>\n <Flex flexDirection=\"column\" gap={2}>\n <Components.Heading as=\"h2\">{title}</Components.Heading>\n <Components.Text variant=\"supporting\">\n {t('externalPostTaxDeductionsDescription')}\n </Components.Text>\n </Flex>\n\n {!deduction && (\n <>\n <Flex flexDirection=\"column\" gap={20}>\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 />\n\n {isGarnishment && (\n <Components.Select\n label={t('garnishmentType')}\n options={garnishmentOptions}\n placeholder={garnishmentPlaceholder}\n onChange={value => {\n setSelectedGarnishment(value as GarnishmentType)\n }}\n isDisabled={!!deduction} // API does not allow to change/edit an existing deduction type\n isRequired\n />\n )}\n </Flex>\n\n <hr />\n </>\n )}\n\n {isGarnishment ? (\n <>\n {selectedGarnishment === 'child_support' ? (\n <ChildSupportForm\n deduction={deduction}\n employeeId={employeeId}\n handleStateAgencySelect={handleStateAgencySelect}\n stateAgencies={stateAgencies}\n counties={counties}\n singleAllCountiesFipsCode={singleAllCountiesFipsCode}\n selectedAgency={selectedAgency}\n onCancel={handleCancel}\n />\n ) : (\n <GarnishmentForm\n deduction={deduction}\n employeeId={employeeId}\n selectedGarnishmentType={selectedGarnishment}\n selectedGarnishmentTitle={garnishmentPlaceholder!}\n onCancel={handleCancel}\n />\n )}\n </>\n ) : (\n <CustomDeductionForm\n deduction={deduction}\n employeeId={employeeId}\n onCancel={handleCancel}\n />\n )}\n </Grid>\n </section>\n )\n}\n"],"names":["DeductionsForm","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","selectedGarnishment","setSelectedGarnishment","garnishmentLabels","garnishmentPlaceholder","garnishmentOptions","garnishment","defaultDeductionTypeSelection","stateAgency","setStateAgency","handleStateAgencySelect","selectedAgencyFipsCodes","agency","counties","fipsCode","singleFipsCode","singleAllCountiesFipsCode","selectedAgency","handleCancel","componentEvents","handleSelectDeductionType","selection","jsxs","Grid","Flex","Fragment","value","ChildSupportForm","GarnishmentForm","CustomDeductionForm"],"mappings":";;;;;;;;;;;;;;;AA0BO,SAASA,GAAeC,GAAqD;AAClF,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAGA,MAAMI,IAAiD;AAAA,EACrD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,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ACzB,0BAA0BG;AAAA,QAC1B,UAAUc;AAAA,MAAA;AAAA,IAAA,GAGhB,IAEA,gBAAA7C;AAAA,MAACwD;AAAA,MAAA;AAAA,QACC,WAAArC;AAAA,QACA,YAAAd;AAAA,QACA,UAAUwC;AAAA,MAAA;AAAA,IAAA;AAAA,EACZ,EAAA,CAEJ,EAAA,CACF;AAEJ;"}
@@ -51,6 +51,7 @@ interface GarnishmentFormProps extends CommonComponentInterface<'Employee.Deduct
51
51
  deduction?: Garnishment | null;
52
52
  selectedGarnishmentType: GarnishmentType;
53
53
  selectedGarnishmentTitle: string;
54
+ onCancel: () => void;
54
55
  }
55
- declare function GarnishmentForm({ deduction, employeeId, selectedGarnishmentType, selectedGarnishmentTitle, }: GarnishmentFormProps): import("react/jsx-runtime").JSX.Element;
56
+ declare function GarnishmentForm({ deduction, employeeId, selectedGarnishmentType, selectedGarnishmentTitle, onCancel, }: GarnishmentFormProps): import("react/jsx-runtime").JSX.Element;
56
57
  export default GarnishmentForm;
@@ -1,29 +1,30 @@
1
- import { jsx as t, jsxs as l, Fragment as b } from "react/jsx-runtime";
2
- import { useTranslation as F } from "react-i18next";
3
- import { useForm as R, useWatch as g, FormProvider as S } from "react-hook-form";
4
- import { useMemo as N } from "react";
1
+ import { jsx as t, jsxs as o, Fragment as S } from "react/jsx-runtime";
2
+ import { useTranslation as L } from "react-i18next";
3
+ import { useForm as N, useWatch as g, FormProvider as V } from "react-hook-form";
4
+ import { useMemo as w } from "react";
5
5
  import { z as r } from "zod";
6
- import { zodResolver as I } from "@hookform/resolvers/zod";
7
- import { GarnishmentType as U } from "@gusto/embedded-api/models/operations/postv1employeesemployeeidgarnishments";
8
- import { useGarnishmentsCreateMutation as V } from "@gusto/embedded-api/react-query/garnishmentsCreate";
9
- import { useGarnishmentsUpdateMutation as _ } from "@gusto/embedded-api/react-query/garnishmentsUpdate";
10
- import { useComponentContext as w } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
11
- import { Form as B } from "../../../Common/Form/Form.js";
12
- import { Flex as G } from "../../../Common/Flex/Flex.js";
13
- import { ActionsLayout as j } from "../../../Common/ActionsLayout/ActionsLayout.js";
6
+ import { zodResolver as B } from "@hookform/resolvers/zod";
7
+ import { GarnishmentType as G } from "@gusto/embedded-api/models/operations/postv1employeesemployeeidgarnishments";
8
+ import { useGarnishmentsCreateMutation as I } from "@gusto/embedded-api/react-query/garnishmentsCreate";
9
+ import { useGarnishmentsUpdateMutation as U } from "@gusto/embedded-api/react-query/garnishmentsUpdate";
10
+ import { useComponentContext as _ } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
11
+ import { Form as j } from "../../../Common/Form/Form.js";
12
+ import { Flex as m } from "../../../Common/Flex/Flex.js";
13
+ import "classnames";
14
+ import { componentEvents as b } from "../../../../shared/constants.js";
15
+ import { RadioGroupField as f } from "../../../Common/Fields/RadioGroupField/RadioGroupField.js";
16
+ import { TextInputField as $ } from "../../../Common/Fields/TextInputField/TextInputField.js";
17
+ import { ActionsLayout as z } from "../../../Common/ActionsLayout/ActionsLayout.js";
18
+ import { NumberInputField as c } from "../../../Common/Fields/NumberInputField/NumberInputField.js";
14
19
  import "react-error-boundary";
15
20
  import "@gusto/embedded-api/models/errors/apierror";
16
21
  import "@gusto/embedded-api/models/errors/sdkvalidationerror";
17
22
  import "@tanstack/react-query";
18
- import { useBase as Y } from "../../../Base/useBase.js";
19
- import { componentEvents as c } from "../../../../shared/constants.js";
23
+ import { useBase as H } from "../../../Base/useBase.js";
20
24
  import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
21
25
  import "dompurify";
22
26
  import "../../../../contexts/LocaleProvider/useLocale.js";
23
- import { TextInputField as $ } from "../../../Common/Fields/TextInputField/TextInputField.js";
24
- import { RadioGroupField as f } from "../../../Common/Fields/RadioGroupField/RadioGroupField.js";
25
- import { NumberInputField as p } from "../../../Common/Fields/NumberInputField/NumberInputField.js";
26
- const z = r.object({
27
+ const Y = r.object({
27
28
  active: r.boolean(),
28
29
  amount: r.number().min(0).transform(String),
29
30
  description: r.string().min(1),
@@ -33,15 +34,16 @@ const z = r.object({
33
34
  annualMaximum: r.number().min(0).transform((e) => e > 0 ? e.toString() : null).nullable(),
34
35
  totalAmount: r.number().min(0).transform((e) => e > 0 ? e.toString() : null).nullable(),
35
36
  deductAsPercentage: r.boolean(),
36
- garnishmentType: r.nativeEnum(U)
37
+ garnishmentType: r.nativeEnum(G)
37
38
  });
38
- function he({
39
+ function De({
39
40
  deduction: e,
40
41
  employeeId: h,
41
42
  selectedGarnishmentType: A,
42
- selectedGarnishmentTitle: D
43
+ selectedGarnishmentTitle: D,
44
+ onCancel: y
43
45
  }) {
44
- const { onEvent: a, baseSubmitHandler: E } = Y(), { t: n } = F("Employee.Deductions"), m = w(), { mutateAsync: y, isPending: P } = V(), { mutateAsync: x, isPending: C } = _(), T = P || C, M = N(() => ({
46
+ const { onEvent: p, baseSubmitHandler: x } = H(), { t: n } = L("Employee.Deductions"), u = _(), { mutateAsync: P, isPending: E } = I(), { mutateAsync: v, isPending: T } = U(), M = E || T, C = w(() => ({
45
47
  amount: e?.amount ? Number(e.amount) : 0,
46
48
  description: e?.description ?? "",
47
49
  times: e?.times ?? null,
@@ -52,108 +54,112 @@ function he({
52
54
  active: !0,
53
55
  courtOrdered: !0,
54
56
  garnishmentType: e?.garnishmentType ?? A
55
- }), [e]), u = R({
56
- resolver: I(z),
57
- defaultValues: M
58
- }), { control: d } = u, v = g({ control: d, name: "recurring" }), o = g({ control: d, name: "deductAsPercentage" }), O = async (q) => {
59
- await E(q, async (i) => {
57
+ }), [e]), s = N({
58
+ resolver: B(Y),
59
+ defaultValues: C
60
+ }), { control: d } = s, q = g({ control: d, name: "recurring" }), i = g({ control: d, name: "deductAsPercentage" }), F = async (R) => {
61
+ await x(R, async (a) => {
60
62
  if (e) {
61
- const { garnishment: s } = await x({
63
+ const { garnishment: l } = await v({
62
64
  request: {
63
65
  garnishmentId: e.uuid,
64
66
  requestBody: {
65
- ...i,
67
+ ...a,
66
68
  version: e.version,
67
- times: i.recurring ? null : 1
69
+ times: a.recurring ? null : 1
68
70
  }
69
71
  }
70
72
  });
71
- a(c.EMPLOYEE_DEDUCTION_UPDATED, s);
73
+ p(b.EMPLOYEE_DEDUCTION_UPDATED, l);
72
74
  } else {
73
- const { garnishment: s } = await y({
75
+ const { garnishment: l } = await P({
74
76
  request: {
75
77
  employeeId: h,
76
- requestBody: { ...i, times: i.recurring ? null : 1 }
78
+ requestBody: { ...a, times: a.recurring ? null : 1 }
77
79
  }
78
80
  });
79
- a(c.EMPLOYEE_DEDUCTION_CREATED, s);
81
+ p(b.EMPLOYEE_DEDUCTION_CREATED, l);
80
82
  }
81
83
  });
82
- }, L = () => {
83
- a(c.EMPLOYEE_DEDUCTION_CANCEL);
84
+ }, O = () => {
85
+ y();
84
86
  };
85
- return /* @__PURE__ */ t(S, { ...u, children: /* @__PURE__ */ t(B, { onSubmit: u.handleSubmit(O), children: /* @__PURE__ */ t(G, { flexDirection: "column", gap: 32, children: /* @__PURE__ */ l(b, { children: [
86
- /* @__PURE__ */ t(m.Heading, { as: "h3", children: D }),
87
- /* @__PURE__ */ t($, { name: "description", label: n("descriptionLabelV2"), isRequired: !0 }),
88
- /* @__PURE__ */ t(
89
- f,
90
- {
91
- name: "recurring",
92
- label: n("frequencyLabel"),
93
- isRequired: !0,
94
- options: [
95
- { value: !0, label: n("frequencyRecurringOptionV2") },
96
- { value: !1, label: n("frequencyOneTimeOptionV2") }
97
- ]
98
- }
99
- ),
100
- /* @__PURE__ */ t(
101
- f,
102
- {
103
- name: "deductAsPercentage",
104
- label: n("deductionTypeLabelV2"),
105
- isRequired: !0,
106
- options: [
107
- { value: !0, label: n("deductionTypePercentageOptionV2") },
108
- { value: !1, label: n("deductionTypeFixedAmountOption") }
109
- ]
110
- }
111
- ),
112
- /* @__PURE__ */ t(
113
- p,
114
- {
115
- name: "amount",
116
- adornmentStart: !o && "$",
117
- adornmentEnd: o && "%",
118
- label: n("deductionAmountLabel"),
119
- isRequired: !0,
120
- min: 0,
121
- format: o ? "percent" : "currency",
122
- description: n(o ? "deductionAmountDescriptionPercentage" : "deductionAmountDescriptionFixed")
123
- }
124
- ),
125
- v && /* @__PURE__ */ l(b, { children: [
126
- /* @__PURE__ */ t(
127
- p,
128
- {
129
- name: "totalAmount",
130
- adornmentStart: "$",
131
- format: "currency",
132
- label: n("totalAmountLabel"),
133
- description: n("totalAmountDescription"),
134
- min: 0
135
- }
136
- ),
137
- /* @__PURE__ */ t(
138
- p,
139
- {
140
- name: "annualMaximum",
141
- adornmentStart: "$",
142
- format: "currency",
143
- label: n("annualMaxLabel"),
144
- min: 0,
145
- description: n("annualMaxDescription")
146
- }
147
- )
87
+ return /* @__PURE__ */ t(V, { ...s, children: /* @__PURE__ */ t(j, { onSubmit: s.handleSubmit(F), children: /* @__PURE__ */ t(m, { flexDirection: "column", gap: 32, children: /* @__PURE__ */ o(S, { children: [
88
+ /* @__PURE__ */ t(u.Heading, { as: "h3", children: D }),
89
+ /* @__PURE__ */ o(m, { flexDirection: "column", gap: 20, children: [
90
+ /* @__PURE__ */ o(m, { flexDirection: "column", gap: 20, children: [
91
+ /* @__PURE__ */ t($, { name: "description", label: n("descriptionLabelV2"), isRequired: !0 }),
92
+ /* @__PURE__ */ t(
93
+ f,
94
+ {
95
+ name: "recurring",
96
+ label: n("frequencyLabel"),
97
+ isRequired: !0,
98
+ options: [
99
+ { value: !0, label: n("frequencyRecurringOptionV2") },
100
+ { value: !1, label: n("frequencyOneTimeOptionV2") }
101
+ ]
102
+ }
103
+ ),
104
+ /* @__PURE__ */ t(
105
+ f,
106
+ {
107
+ name: "deductAsPercentage",
108
+ label: n("deductionTypeLabelV2"),
109
+ isRequired: !0,
110
+ options: [
111
+ { value: !0, label: n("deductionTypePercentageOptionV2") },
112
+ { value: !1, label: n("deductionTypeFixedAmountOption") }
113
+ ]
114
+ }
115
+ ),
116
+ /* @__PURE__ */ t(
117
+ c,
118
+ {
119
+ name: "amount",
120
+ adornmentStart: !i && "$",
121
+ adornmentEnd: i && "%",
122
+ label: n("deductionAmountLabel"),
123
+ isRequired: !0,
124
+ min: 0,
125
+ format: i ? "percent" : "currency",
126
+ description: n(i ? "deductionAmountDescriptionPercentage" : "deductionAmountDescriptionFixed")
127
+ }
128
+ )
129
+ ] }),
130
+ q && /* @__PURE__ */ o(m, { flexDirection: "column", gap: 20, children: [
131
+ /* @__PURE__ */ t(
132
+ c,
133
+ {
134
+ name: "totalAmount",
135
+ adornmentStart: "$",
136
+ format: "currency",
137
+ label: n("totalAmountLabel"),
138
+ description: n("totalAmountDescription"),
139
+ min: 0
140
+ }
141
+ ),
142
+ /* @__PURE__ */ t(
143
+ c,
144
+ {
145
+ name: "annualMaximum",
146
+ adornmentStart: "$",
147
+ format: "currency",
148
+ label: n("annualMaxLabel"),
149
+ min: 0,
150
+ description: n("annualMaxDescription")
151
+ }
152
+ )
153
+ ] })
148
154
  ] }),
149
- /* @__PURE__ */ l(j, { children: [
150
- /* @__PURE__ */ t(m.Button, { variant: "secondary", onClick: L, children: n("cancelCta") }),
151
- /* @__PURE__ */ t(m.Button, { type: "submit", isLoading: T, children: n(e ? "continueCta" : "addDeductionCta") })
155
+ /* @__PURE__ */ o(z, { children: [
156
+ /* @__PURE__ */ t(u.Button, { variant: "secondary", onClick: O, children: n("cancelCta") }),
157
+ /* @__PURE__ */ t(u.Button, { type: "submit", isLoading: M, children: n("saveCta") })
152
158
  ] })
153
159
  ] }) }) }) });
154
160
  }
155
161
  export {
156
- z as DeductionSchema,
157
- he as default
162
+ Y as DeductionSchema,
163
+ De as default
158
164
  };
159
165
  //# sourceMappingURL=GarnishmentForm.js.map