@gusto/embedded-react-sdk 0.20.0 → 0.21.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 (390) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/dist/UNSTABLE_Hooks.d.ts +1 -0
  3. package/dist/UNSTABLE_Hooks.js +9 -0
  4. package/dist/UNSTABLE_Hooks.js.map +1 -0
  5. package/dist/assets/icons/coins-hand.svg.js +10 -0
  6. package/dist/assets/icons/coins-hand.svg.js.map +1 -0
  7. package/dist/components/Base/Base.d.ts +19 -4
  8. package/dist/components/Base/Base.js +67 -61
  9. package/dist/components/Base/Base.js.map +1 -1
  10. package/dist/components/Base/useBase.d.ts +1 -1
  11. package/dist/components/Base/useBase.js.map +1 -1
  12. package/dist/components/Base/useBaseSubmit.d.ts +10 -0
  13. package/dist/components/Base/useBaseSubmit.js +33 -0
  14. package/dist/components/Base/useBaseSubmit.js.map +1 -0
  15. package/dist/components/Common/Fields/TextAreaField/TextAreaField.d.ts +5 -0
  16. package/dist/components/Common/Fields/TextAreaField/TextAreaField.js +34 -0
  17. package/dist/components/Common/Fields/TextAreaField/TextAreaField.js.map +1 -0
  18. package/dist/components/Common/Fields/TextAreaField/index.d.ts +3 -0
  19. package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.js +10 -10
  20. package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.js.map +1 -1
  21. package/dist/components/Common/SignatureForm/SignatureForm.js +14 -11
  22. package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
  23. package/dist/components/Common/SignatureForm/SignatureFormActions.js +9 -7
  24. package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
  25. package/dist/components/Common/SignatureForm/SignatureFormFields.js +15 -12
  26. package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
  27. package/dist/components/Common/UI/Alert/Alert.js +23 -22
  28. package/dist/components/Common/UI/Alert/Alert.js.map +1 -1
  29. package/dist/components/Common/UI/Alert/AlertTypes.d.ts +4 -0
  30. package/dist/components/Common/UI/Alert/AlertTypes.js.map +1 -1
  31. package/dist/components/Common/UI/DatePicker/DatePicker.d.ts +1 -1
  32. package/dist/components/Common/UI/DatePicker/DatePicker.js +38 -37
  33. package/dist/components/Common/UI/DatePicker/DatePicker.js.map +1 -1
  34. package/dist/components/Common/UI/DatePicker/DatePickerTypes.d.ts +4 -0
  35. package/dist/components/Common/UI/Modal/Modal.module.scss.js +17 -17
  36. package/dist/components/Common/UI/Select/Select.d.ts +1 -1
  37. package/dist/components/Common/UI/Select/Select.js +27 -26
  38. package/dist/components/Common/UI/Select/Select.js.map +1 -1
  39. package/dist/components/Common/UI/Select/SelectTypes.d.ts +4 -0
  40. package/dist/components/Common/UI/TextArea/TextArea.d.ts +2 -0
  41. package/dist/components/Common/UI/TextArea/TextArea.js +79 -0
  42. package/dist/components/Common/UI/TextArea/TextArea.js.map +1 -0
  43. package/dist/components/Common/UI/TextArea/TextArea.module.scss.js +12 -0
  44. package/dist/components/Common/UI/TextArea/TextArea.module.scss.js.map +1 -0
  45. package/dist/components/Common/UI/TextArea/TextAreaTypes.d.ts +37 -0
  46. package/dist/components/Common/UI/TextArea/TextAreaTypes.js +9 -0
  47. package/dist/components/Common/UI/TextArea/TextAreaTypes.js.map +1 -0
  48. package/dist/components/Common/UI/TextArea/index.d.ts +4 -0
  49. package/dist/components/Company/AssignSignatory/AssignSignatory.js +8 -6
  50. package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
  51. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +5 -2
  52. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
  53. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +4 -2
  54. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
  55. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +9 -7
  56. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
  57. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +12 -12
  58. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +5 -4
  59. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  60. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +4 -2
  61. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
  62. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +12 -10
  63. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
  64. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +6 -6
  65. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +5 -4
  66. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  67. package/dist/components/Company/AssignSignatory/TitleSelect.js +6 -4
  68. package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
  69. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +7 -6
  70. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  71. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +10 -9
  72. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
  73. package/dist/components/Company/BankAccount/BankAccountForm/Form.js +11 -8
  74. package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
  75. package/dist/components/Company/BankAccount/BankAccountForm/context.js +5 -4
  76. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  77. package/dist/components/Company/BankAccount/BankAccountList/Actions.js +10 -8
  78. package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
  79. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +10 -8
  80. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
  81. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +7 -4
  82. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
  83. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +4 -2
  84. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
  85. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +11 -9
  86. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  87. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +5 -4
  88. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  89. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +10 -8
  90. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  91. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +5 -4
  92. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  93. package/dist/components/Company/FederalTaxes/Actions.js +9 -7
  94. package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
  95. package/dist/components/Company/FederalTaxes/FederalTaxes.js +5 -3
  96. package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
  97. package/dist/components/Company/FederalTaxes/Form.js +7 -6
  98. package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
  99. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +7 -6
  100. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  101. package/dist/components/Company/Industry/Actions.js +9 -7
  102. package/dist/components/Company/Industry/Actions.js.map +1 -1
  103. package/dist/components/Company/Industry/Context.js +8 -7
  104. package/dist/components/Company/Industry/Context.js.map +1 -1
  105. package/dist/components/Company/Industry/Edit.js +7 -4
  106. package/dist/components/Company/Industry/Edit.js.map +1 -1
  107. package/dist/components/Company/Locations/LocationForm/Actions.js +10 -8
  108. package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
  109. package/dist/components/Company/Locations/LocationForm/Form.js +7 -6
  110. package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
  111. package/dist/components/Company/Locations/LocationForm/LocationForm.js +12 -10
  112. package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
  113. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +5 -4
  114. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  115. package/dist/components/Company/Locations/LocationsList/Actions.js +8 -6
  116. package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
  117. package/dist/components/Company/Locations/LocationsList/List.js +16 -15
  118. package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
  119. package/dist/components/Company/Locations/LocationsList/LocationsList.js +4 -3
  120. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  121. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +5 -4
  122. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  123. package/dist/components/Company/OnboardingOverview/Completed.js +12 -10
  124. package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
  125. package/dist/components/Company/OnboardingOverview/MissingRequirements.js +11 -9
  126. package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
  127. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +9 -7
  128. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
  129. package/dist/components/Company/OnboardingOverview/context.js +5 -4
  130. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  131. package/dist/components/Company/PaySchedule/PaySchedule.js +5 -4
  132. package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
  133. package/dist/components/Company/PaySchedule/_parts/Actions.js +11 -9
  134. package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
  135. package/dist/components/Company/PaySchedule/_parts/Edit.js +23 -24
  136. package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
  137. package/dist/components/Company/PaySchedule/_parts/Head.js +13 -11
  138. package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
  139. package/dist/components/Company/PaySchedule/_parts/List.js +18 -17
  140. package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
  141. package/dist/components/Company/PaySchedule/usePaySchedule.js +7 -6
  142. package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
  143. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +4 -2
  144. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
  145. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +5 -4
  146. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  147. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +4 -2
  148. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
  149. package/dist/components/Company/StateTaxes/StateTaxesList/List.js +4 -2
  150. package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
  151. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +5 -4
  152. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  153. package/dist/components/Contractor/Address/Address.js +7 -5
  154. package/dist/components/Contractor/Address/Address.js.map +1 -1
  155. package/dist/components/Contractor/Address/Form.js +8 -7
  156. package/dist/components/Contractor/Address/Form.js.map +1 -1
  157. package/dist/components/Contractor/Address/useAddress.js +7 -6
  158. package/dist/components/Contractor/Address/useAddress.js.map +1 -1
  159. package/dist/components/Contractor/ContractorList/index.js +15 -15
  160. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +13 -10
  161. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
  162. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +5 -3
  163. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
  164. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.d.ts +15 -0
  165. package/dist/components/Contractor/Payments/Detail/DetailPresentation.d.ts +19 -0
  166. package/dist/components/Contractor/Payments/Overview/OverviewPresentation.d.ts +18 -0
  167. package/dist/components/Contractor/Payments/PaymentEdit/PaymentEditPresentation.d.ts +6 -0
  168. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.d.ts +18 -0
  169. package/dist/components/Contractor/Payments/types.d.ts +4 -0
  170. package/dist/components/Contractor/Profile/ContractorProfileForm.js +13 -13
  171. package/dist/components/Contractor/Profile/useContractorProfile.js +1 -1
  172. package/dist/components/Contractor/Submit/Submit.js +21 -20
  173. package/dist/components/Contractor/Submit/Submit.js.map +1 -1
  174. package/dist/components/Employee/Compensation/Actions.js +14 -13
  175. package/dist/components/Employee/Compensation/Actions.js.map +1 -1
  176. package/dist/components/Employee/Compensation/Edit.js +14 -14
  177. package/dist/components/Employee/Compensation/List.js +23 -22
  178. package/dist/components/Employee/Compensation/List.js.map +1 -1
  179. package/dist/components/Employee/Deductions/Deductions.d.ts +1 -1
  180. package/dist/components/Employee/Deductions/Deductions.js +10 -10
  181. package/dist/components/Employee/Deductions/Deductions.js.map +1 -1
  182. package/dist/components/Employee/Deductions/DeductionsComponents.d.ts +2 -0
  183. package/dist/components/Employee/Deductions/DeductionsComponents.js +6 -6
  184. package/dist/components/Employee/Deductions/DeductionsComponents.js.map +1 -1
  185. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +222 -0
  186. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -0
  187. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.module.scss.js +8 -0
  188. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.module.scss.js.map +1 -0
  189. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.d.ts +2 -2
  190. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +165 -0
  191. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -0
  192. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.d.ts +0 -34
  193. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js +90 -127
  194. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js.map +1 -1
  195. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.module.scss.js +14 -0
  196. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.module.scss.js.map +1 -0
  197. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +55 -55
  198. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js.map +1 -1
  199. package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.d.ts +6 -0
  200. package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js +53 -0
  201. package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js.map +1 -0
  202. package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.module.scss.js +14 -0
  203. package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.module.scss.js.map +1 -0
  204. package/dist/components/Employee/Deductions/stateMachine.js +49 -29
  205. package/dist/components/Employee/Deductions/stateMachine.js.map +1 -1
  206. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +8 -6
  207. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
  208. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +5 -3
  209. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  210. package/dist/components/Employee/DocumentSigner/DocumentList/List.js +5 -2
  211. package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
  212. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +5 -4
  213. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  214. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +5 -3
  215. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  216. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +5 -4
  217. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  218. package/dist/components/Employee/EmployeeList/Actions.js +8 -6
  219. package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
  220. package/dist/components/Employee/EmployeeList/EmployeeList.js +6 -3
  221. package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
  222. package/dist/components/Employee/EmployeeList/Head.js +7 -5
  223. package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
  224. package/dist/components/Employee/EmployeeList/List.js +14 -14
  225. package/dist/components/Employee/EmployeeList/useEmployeeList.js +5 -4
  226. package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
  227. package/dist/components/Employee/FederalTaxes/Actions.js +9 -7
  228. package/dist/components/Employee/FederalTaxes/Actions.js.map +1 -1
  229. package/dist/components/Employee/FederalTaxes/FederalForm.js +13 -11
  230. package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
  231. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +5 -4
  232. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
  233. package/dist/components/Employee/Landing/Landing.js +11 -10
  234. package/dist/components/Employee/Landing/Landing.js.map +1 -1
  235. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +7 -7
  236. package/dist/components/Employee/PaymentMethod/Actions.js +8 -6
  237. package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
  238. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +6 -4
  239. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
  240. package/dist/components/Employee/PaymentMethod/BankAccountsList.js +12 -11
  241. package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
  242. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +8 -6
  243. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
  244. package/dist/components/Employee/PaymentMethod/Split.js +8 -8
  245. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +7 -6
  246. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
  247. package/dist/components/Employee/Profile/Actions.js +9 -7
  248. package/dist/components/Employee/Profile/Actions.js.map +1 -1
  249. package/dist/components/Employee/Profile/AdminPersonalDetails.js +10 -8
  250. package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
  251. package/dist/components/Employee/Profile/HomeAddress.js +2 -2
  252. package/dist/components/Employee/Profile/PersonalDetailsInputs.js +26 -24
  253. package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
  254. package/dist/components/Employee/Profile/useProfile.js +5 -4
  255. package/dist/components/Employee/Profile/useProfile.js.map +1 -1
  256. package/dist/components/Employee/StateTaxes/Actions.js +10 -8
  257. package/dist/components/Employee/StateTaxes/Actions.js.map +1 -1
  258. package/dist/components/Employee/StateTaxes/useStateTaxes.js +5 -4
  259. package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
  260. package/dist/components/Employee/Taxes/Actions.js +10 -8
  261. package/dist/components/Employee/Taxes/Actions.js.map +1 -1
  262. package/dist/components/Employee/Taxes/FederalForm.js +14 -12
  263. package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
  264. package/dist/components/Employee/Taxes/useTaxes.js +5 -4
  265. package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
  266. package/dist/components/Flow/Flow.js +23 -21
  267. package/dist/components/Flow/Flow.js.map +1 -1
  268. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.d.ts +1 -1
  269. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js +58 -36
  270. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js.map +1 -1
  271. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.d.ts +2 -0
  272. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.js +71 -54
  273. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.js.map +1 -1
  274. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsComponents.d.ts +23 -0
  275. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsComponents.js +27 -15
  276. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsComponents.js.map +1 -1
  277. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.d.ts +25 -2
  278. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +153 -23
  279. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js.map +1 -1
  280. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.module.scss.js +10 -0
  281. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.module.scss.js.map +1 -0
  282. package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.d.ts +9 -1
  283. package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.js +195 -22
  284. package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.js.map +1 -1
  285. package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.module.scss.js +18 -0
  286. package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.module.scss.js.map +1 -0
  287. package/dist/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.d.ts +10 -2
  288. package/dist/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.js +39 -25
  289. package/dist/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.js.map +1 -1
  290. package/dist/components/Payroll/ConfirmWireDetails/index.d.ts +1 -0
  291. package/dist/components/Payroll/ConfirmWireDetails/types.d.ts +5 -0
  292. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +8 -6
  293. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
  294. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +8 -6
  295. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js.map +1 -1
  296. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +27 -28
  297. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
  298. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +56 -57
  299. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
  300. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +9 -8
  301. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
  302. package/dist/components/Payroll/PayrollHistory/PayrollHistory.d.ts +0 -12
  303. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js +44 -52
  304. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js.map +1 -1
  305. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.d.ts +9 -6
  306. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +96 -93
  307. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
  308. package/dist/components/Payroll/PayrollList/PayrollList.js +58 -59
  309. package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
  310. package/dist/components/Payroll/PayrollList/PayrollListPresentation.d.ts +4 -6
  311. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +81 -72
  312. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
  313. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +8 -8
  314. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchThresholdExceeded.js +4 -2
  315. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchThresholdExceeded.js.map +1 -1
  316. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +3 -2
  317. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
  318. package/dist/components/Payroll/PayrollStatusBadges/PayrollStatusBadges.d.ts +7 -0
  319. package/dist/components/Payroll/PayrollStatusBadges/PayrollStatusBadges.js +19 -0
  320. package/dist/components/Payroll/PayrollStatusBadges/PayrollStatusBadges.js.map +1 -0
  321. package/dist/components/Payroll/PayrollStatusBadges/PayrollStatusBadges.module.scss.js +10 -0
  322. package/dist/components/Payroll/PayrollStatusBadges/PayrollStatusBadges.module.scss.js.map +1 -0
  323. package/dist/components/Payroll/PayrollStatusBadges/index.d.ts +4 -0
  324. package/dist/components/Payroll/PayrollStatusBadges/payrollStatusConfig.d.ts +33 -0
  325. package/dist/components/Payroll/PayrollStatusBadges/payrollStatusConfig.js +161 -0
  326. package/dist/components/Payroll/PayrollStatusBadges/payrollStatusConfig.js.map +1 -0
  327. package/dist/components/Payroll/PayrollStatusBadges/usePayrollStatusBadges.d.ts +3 -0
  328. package/dist/components/Payroll/PayrollStatusBadges/usePayrollStatusBadges.js +17 -0
  329. package/dist/components/Payroll/PayrollStatusBadges/usePayrollStatusBadges.js.map +1 -0
  330. package/dist/components/Payroll/PayrollStatusBadges/usePayrollStatusBadges.test.d.ts +1 -0
  331. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfiguration.d.ts +6 -0
  332. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfiguration.js +70 -0
  333. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfiguration.js.map +1 -0
  334. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationContext.d.ts +7 -0
  335. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationContext.js +6 -0
  336. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationContext.js.map +1 -0
  337. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationProvider.d.ts +9 -0
  338. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationProvider.js +40 -0
  339. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationProvider.js.map +1 -0
  340. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/index.d.ts +5 -0
  341. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/usePayrollConfiguration.d.ts +2 -0
  342. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/usePayrollConfiguration.js +12 -0
  343. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/usePayrollConfiguration.js.map +1 -0
  344. package/dist/components/Payroll/UNSTABLE_PayrollHooks/index.d.ts +2 -0
  345. package/dist/components/Payroll/helpers.d.ts +0 -5
  346. package/dist/components/Payroll/helpers.js +106 -112
  347. package/dist/components/Payroll/helpers.js.map +1 -1
  348. package/dist/components/Payroll/usePreparedPayrollData.js +8 -7
  349. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  350. package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js +48 -46
  351. package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js.map +1 -1
  352. package/dist/contexts/ComponentAdapter/useComponentContext.d.ts +2 -0
  353. package/dist/contexts/ComponentAdapter/useComponentContext.js +3 -3
  354. package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
  355. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +8 -5
  356. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  357. package/dist/helpers/dateFormatting.d.ts +9 -0
  358. package/dist/helpers/dateFormatting.js +65 -52
  359. package/dist/helpers/dateFormatting.js.map +1 -1
  360. package/dist/helpers/formattedStrings.js +12 -11
  361. package/dist/helpers/formattedStrings.js.map +1 -1
  362. package/dist/i18n/I18n.js +10 -10
  363. package/dist/i18n/I18n.js.map +1 -1
  364. package/dist/i18n/en/ContractorPayment.ContractorPaymentCreatePayment.json.js +32 -0
  365. package/dist/i18n/en/ContractorPayment.ContractorPaymentCreatePayment.json.js.map +1 -0
  366. package/dist/i18n/en/ContractorPayment.ContractorPaymentDetail.json.js +24 -0
  367. package/dist/i18n/en/ContractorPayment.ContractorPaymentDetail.json.js.map +1 -0
  368. package/dist/i18n/en/ContractorPayment.ContractorPaymentOverview.json.js +32 -0
  369. package/dist/i18n/en/ContractorPayment.ContractorPaymentOverview.json.js.map +1 -0
  370. package/dist/i18n/en/ContractorPayment.ContractorPaymentPaymentHistory.json.js +32 -0
  371. package/dist/i18n/en/ContractorPayment.ContractorPaymentPaymentHistory.json.js.map +1 -0
  372. package/dist/i18n/en/Payroll.Common.json.js +8 -0
  373. package/dist/i18n/en/Payroll.Common.json.js.map +1 -0
  374. package/dist/i18n/en/Payroll.ConfirmWireDetailsForm.json.js +25 -5
  375. package/dist/i18n/en/Payroll.ConfirmWireDetailsForm.json.js.map +1 -1
  376. package/dist/i18n/en/Payroll.PayrollList.json.js +14 -16
  377. package/dist/i18n/en/Payroll.PayrollList.json.js.map +1 -1
  378. package/dist/i18n/en/Payroll.WireInstructions.json.js +22 -6
  379. package/dist/i18n/en/Payroll.WireInstructions.json.js.map +1 -1
  380. package/dist/shared/constants.d.ts +6 -0
  381. package/dist/shared/constants.js +15 -12
  382. package/dist/shared/constants.js.map +1 -1
  383. package/dist/style.css +1 -1
  384. package/dist/types/i18next.d.ts +183 -8
  385. package/package.json +11 -7
  386. package/dist/components/Employee/Deductions/DeductionsForm/UNSTABLE_DeductionsForm.d.ts +0 -7
  387. package/dist/components/Employee/Deductions/EmptyState/EmptyState.d.ts +0 -6
  388. package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.d.ts +0 -15
  389. package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.js +0 -49
  390. package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.js.map +0 -1
@@ -1,135 +1,98 @@
1
- import { jsx as n, jsxs as d, Fragment as E } from "react/jsx-runtime";
2
- import { useTranslation as N } from "react-i18next";
3
- import { useMemo as B, useEffect as U } from "react";
4
- import { z as i } from "zod";
5
- import { useForm as _, useWatch as I, FormProvider as w } from "react-hook-form";
6
- import { zodResolver as G } from "@hookform/resolvers/zod";
7
- import { useGarnishmentsCreateMutation as j } from "@gusto/embedded-api/react-query/garnishmentsCreate";
8
- import { useGarnishmentsUpdateMutation as Y } from "@gusto/embedded-api/react-query/garnishmentsUpdate";
9
- import { useGarnishmentsListSuspense as k } from "@gusto/embedded-api/react-query/garnishmentsList";
10
- import { BaseComponent as z } from "../../../Base/Base.js";
11
- import { useBase as H } from "../../../Base/useBase.js";
12
- import { Form as V } from "../../../Common/Form/Form.js";
13
- import { Flex as W } from "../../../Common/Flex/Flex.js";
14
- import "classnames";
15
- import { ActionsLayout as J } from "../../../Common/ActionsLayout/ActionsLayout.js";
16
- import { useComponentDictionary as K, useI18n as Q } from "../../../../i18n/I18n.js";
17
- import { componentEvents as p } from "../../../../shared/constants.js";
18
- import { useComponentContext as X } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
19
- import { TextInputField as Z } from "../../../Common/Fields/TextInputField/TextInputField.js";
20
- import { RadioGroupField as x } from "../../../Common/Fields/RadioGroupField/RadioGroupField.js";
21
- import { NumberInputField as f } from "../../../Common/Fields/NumberInputField/NumberInputField.js";
22
- import { CheckboxField as $ } from "../../../Common/Fields/CheckboxField/CheckboxField.js";
23
- const ee = i.object({
24
- active: i.boolean(),
25
- amount: i.number().min(0).transform(String),
26
- description: i.string().min(1),
27
- courtOrdered: i.boolean(),
28
- times: i.number().nullable(),
29
- recurring: i.string().transform((t) => t === "true"),
30
- annualMaximum: i.number().min(0).transform((t) => t > 0 ? t.toString() : null).nullable(),
31
- payPeriodMaximum: i.number().min(0).transform((t) => t > 0 ? t.toString() : null).nullable(),
32
- deductAsPercentage: i.string().transform((t) => t === "true")
33
- });
34
- function Me(t) {
35
- return /* @__PURE__ */ n(z, { ...t, children: /* @__PURE__ */ n(ne, { ...t, children: t.children }) });
1
+ import { jsx as n, jsxs as a } from "react/jsx-runtime";
2
+ import { useTranslation as A } from "react-i18next";
3
+ import { useState as D } from "react";
4
+ import { useGarnishmentsListSuspense as P } from "@gusto/embedded-api/react-query/garnishmentsList";
5
+ import { useGarnishmentsGetChildSupportDataSuspense as _ } from "@gusto/embedded-api/react-query/garnishmentsGetChildSupportData";
6
+ import c from "./DeductionsForm.module.scss.js";
7
+ import O from "./ChildSupportForm.js";
8
+ import R from "./CustomDeductionForm.js";
9
+ import { BaseComponent as H } from "../../../Base/Base.js";
10
+ import { useBase as M } from "../../../Base/useBase.js";
11
+ import { Grid as Y } from "../../../Common/Grid/Grid.js";
12
+ import { useComponentDictionary as B, useI18n as F } from "../../../../i18n/I18n.js";
13
+ import { componentEvents as f } from "../../../../shared/constants.js";
14
+ import { useComponentContext as I } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
15
+ import U from "../../../../assets/icons/caret-left.svg.js";
16
+ function ie(s) {
17
+ return /* @__PURE__ */ n(H, { ...s, children: /* @__PURE__ */ n(k, { ...s, children: s.children }) });
36
18
  }
37
- function ne({ className: t, children: b, employeeId: g, deductionId: h, dictionary: y }) {
38
- const { onEvent: u, baseSubmitHandler: P } = H(), { t: r } = N("Employee.Deductions"), m = X();
39
- K("Employee.Deductions", y), Q("Employee.Deductions");
40
- const { data: C } = k({ employeeId: g }), e = h ? C.garnishmentList?.find((c) => c.uuid === h) ?? null : null, { mutateAsync: M, isPending: O } = j(), { mutateAsync: L, isPending: T } = Y(), a = B(() => ({
41
- amount: e?.amount ? Number(e.amount) : 0,
42
- description: e?.description ?? "",
43
- times: e?.times ?? null,
44
- recurring: e?.recurring?.toString() ?? "true",
45
- annualMaximum: e?.annualMaximum ? Number(e.annualMaximum) : null,
46
- payPeriodMaximum: e?.payPeriodMaximum ? Number(e.payPeriodMaximum) : null,
47
- deductAsPercentage: e?.deductAsPercentage?.toString() ?? "true",
48
- active: !0,
49
- courtOrdered: e?.courtOrdered ?? !1
50
- }), [e]), s = _({
51
- resolver: G(ee),
52
- defaultValues: a
53
- }), { reset: D, control: v } = s;
54
- U(() => {
55
- D(a);
56
- }, [e, a, D]);
57
- const A = I({ control: v, name: "recurring" }), F = O || T, R = async (c) => {
58
- await P(c, async (o) => {
59
- if (e) {
60
- const { garnishment: l } = await L({
61
- request: {
62
- garnishmentId: e.uuid,
63
- requestBody: {
64
- ...o,
65
- version: e.version,
66
- times: o.recurring ? null : 1
67
- }
68
- }
69
- });
70
- u(p.EMPLOYEE_DEDUCTION_UPDATED, l);
71
- } else {
72
- const { garnishment: l } = await M({
73
- request: {
74
- employeeId: g,
75
- requestBody: { ...o, times: o.recurring ? null : 1 }
19
+ const j = ["child_support"];
20
+ function k({ className: s, employeeId: r, deductionId: u, dictionary: T }) {
21
+ const { onEvent: m } = M(), { t } = A("Employee.Deductions"), i = I();
22
+ B("Employee.Deductions", T), F("Employee.Deductions");
23
+ const { data: p } = P({ employeeId: r }), { data: l } = _({}), o = u ? p.garnishmentList?.find((e) => e.uuid === u) ?? null : null, y = t(o ? "editDeductionTitle" : "addDeductionTitle"), d = o?.garnishmentType, C = l.childSupportData?.agencies?.map((e) => ({
24
+ label: e.name,
25
+ value: e.state
26
+ })) || [], [h, S] = D(
27
+ d && j.includes(d) || !o
28
+ ), E = o ? d ? "garnishment" : "custom" : "garnishment", [g, b] = D(o?.childSupport?.state || ""), L = (e) => {
29
+ b(e);
30
+ }, v = l.childSupportData?.agencies?.find((e) => e.state === g)?.fipsCodes?.map((e) => ({
31
+ label: e.county?.length ? e.county : t("allCounties"),
32
+ value: e.code
33
+ })) || [], x = l.childSupportData?.agencies?.find(
34
+ (e) => e.state === g
35
+ ), N = () => {
36
+ p.garnishmentList?.some((e) => e.active) ? m(f.EMPLOYEE_DEDUCTION_CANCEL) : m(f.EMPLOYEE_DEDUCTION_CANCEL_EMPTY);
37
+ }, G = (e) => {
38
+ S(e === "garnishment");
39
+ };
40
+ return /* @__PURE__ */ a("section", { className: s, children: [
41
+ /* @__PURE__ */ a(i.Button, { variant: "secondary", onClick: N, children: [
42
+ /* @__PURE__ */ n(U, { className: c.leftCaretIcon }),
43
+ t("backToDeductionsCta")
44
+ ] }),
45
+ /* @__PURE__ */ a(Y, { gap: 16, className: c.formHeadingContainer, children: [
46
+ /* @__PURE__ */ n(i.Heading, { as: "h2", children: y }),
47
+ /* @__PURE__ */ a("section", { children: [
48
+ /* @__PURE__ */ n(i.Heading, { as: "h3", 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: E,
61
+ onChange: G,
62
+ isRequired: !0,
63
+ isDisabled: !!o,
64
+ className: c.deductionTypeRadioGroup
65
+ }
66
+ ),
67
+ h && /* @__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
76
77
  }
77
- });
78
- u(p.EMPLOYEE_DEDUCTION_CREATED, l);
79
- }
80
- });
81
- }, q = () => {
82
- u(p.EMPLOYEE_DEDUCTION_CANCEL);
83
- }, S = r(e ? "editDeductionTitle" : "addDeductionTitle");
84
- return /* @__PURE__ */ n("section", { className: t, children: /* @__PURE__ */ n(w, { ...s, children: /* @__PURE__ */ n(V, { onSubmit: s.handleSubmit(R), children: /* @__PURE__ */ n(W, { flexDirection: "column", gap: 32, children: b || /* @__PURE__ */ d(E, { children: [
85
- /* @__PURE__ */ n(m.Heading, { as: "h2", children: S }),
86
- /* @__PURE__ */ n(Z, { name: "description", label: r("descriptionLabel"), isRequired: !0 }),
87
- /* @__PURE__ */ n(
88
- x,
89
- {
90
- name: "deductAsPercentage",
91
- label: r("deductionTypeLabel"),
92
- isRequired: !0,
93
- options: [
94
- { value: "true", label: r("deductionTypePercentageOption") },
95
- { value: "false", label: r("deductionTypeFixedAmountOption") }
96
- ]
97
- }
98
- ),
99
- /* @__PURE__ */ n(
100
- f,
101
- {
102
- name: "amount",
103
- label: r("deductionAmountLabel"),
104
- isRequired: !0,
105
- min: 0
106
- }
107
- ),
108
- /* @__PURE__ */ n(
109
- x,
78
+ )
79
+ ] }),
80
+ /* @__PURE__ */ n("hr", {})
81
+ ] }),
82
+ h ? /* @__PURE__ */ n(
83
+ O,
110
84
  {
111
- name: "recurring",
112
- label: r("frequencyLabel"),
113
- isRequired: !0,
114
- options: [
115
- { value: "true", label: r("frequencyRecurringOption") },
116
- { value: "false", label: r("frequencyOneTimeOption") }
117
- ]
85
+ deduction: o,
86
+ employeeId: r,
87
+ handleStateAgencySelect: L,
88
+ stateAgencies: C,
89
+ counties: v,
90
+ selectedAgency: x
118
91
  }
119
- ),
120
- A === "true" && /* @__PURE__ */ d(E, { children: [
121
- /* @__PURE__ */ n(f, { name: "annualMaximum", label: r("annualMaxLabel"), min: 0 }),
122
- /* @__PURE__ */ n(f, { name: "payPeriodMaximum", label: "Pay period maximum", min: 0 })
123
- ] }),
124
- /* @__PURE__ */ n($, { name: "courtOrdered", label: r("courtOrderedLabel") }),
125
- /* @__PURE__ */ d(J, { children: [
126
- /* @__PURE__ */ n(m.Button, { variant: "secondary", onClick: q, children: r("cancelCta") }),
127
- /* @__PURE__ */ n(m.Button, { type: "submit", isLoading: F, children: r(e ? "continueCta" : "addDeductionCta") })
128
- ] })
129
- ] }) }) }) }) });
92
+ ) : /* @__PURE__ */ n(R, { deduction: o, employeeId: r })
93
+ ] });
130
94
  }
131
95
  export {
132
- ee as DeductionSchema,
133
- Me as DeductionsForm
96
+ ie as DeductionsForm
134
97
  };
135
98
  //# 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 { useEffect, useMemo } from 'react'\nimport { z } from 'zod'\nimport { FormProvider, useForm, useWatch, type SubmitHandler } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { useGarnishmentsCreateMutation } from '@gusto/embedded-api/react-query/garnishmentsCreate'\nimport { useGarnishmentsUpdateMutation } from '@gusto/embedded-api/react-query/garnishmentsUpdate'\nimport { useGarnishmentsListSuspense } from '@gusto/embedded-api/react-query/garnishmentsList'\nimport {\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n useBase,\n} from '@/components/Base'\nimport { Form } from '@/components/Common/Form'\nimport { ActionsLayout } from '@/components/Common'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport {\n CheckboxField,\n NumberInputField,\n RadioGroupField,\n TextInputField,\n} from '@/components/Common'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary } from '@/i18n/I18n'\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 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\nfunction Root({ className, children, employeeId, deductionId, dictionary }: DeductionsFormProps) {\n const { onEvent, baseSubmitHandler } = 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 const deduction = deductionId\n ? (data.garnishmentList?.find(g => g.uuid === deductionId) ?? null)\n : null\n\n const { mutateAsync: createDeduction, isPending: isPendingCreate } =\n useGarnishmentsCreateMutation()\n const { mutateAsync: updateDeduction, isPending: isPendingUpdate } =\n useGarnishmentsUpdateMutation()\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\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 isPending = isPendingCreate || isPendingUpdate\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 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 const title = !deduction ? t('addDeductionTitle') : t('editDeductionTitle')\n\n return (\n <section className={className}>\n <FormProvider {...formMethods}>\n <Form onSubmit={formMethods.handleSubmit(onSubmit)}>\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Components.Heading as=\"h2\">{title}</Components.Heading>\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\n name=\"amount\"\n label={t('deductionAmountLabel')}\n isRequired\n min={0}\n />\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 name=\"courtOrdered\" label={t('courtOrderedLabel')} />\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 )}\n </Flex>\n </Form>\n </FormProvider>\n </section>\n )\n}\n"],"names":["DeductionSchema","z","val","DeductionsForm","props","jsx","BaseComponent","Root","className","children","employeeId","deductionId","dictionary","onEvent","baseSubmitHandler","useBase","t","useTranslation","Components","useComponentContext","useComponentDictionary","useI18n","data","useGarnishmentsListSuspense","deduction","g","createDeduction","isPendingCreate","useGarnishmentsCreateMutation","updateDeduction","isPendingUpdate","useGarnishmentsUpdateMutation","defaultValues","useMemo","formMethods","useForm","zodResolver","resetForm","control","useEffect","watchedRecurring","useWatch","isPending","onSubmit","payload","updateDeductionResponse","componentEvents","createDeductionResponse","handleCancel","title","FormProvider","Form","Flex","jsxs","Fragment","TextInputField","RadioGroupField","NumberInputField","CheckboxField","ActionsLayout"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA4BO,MAAMA,KAAkBC,EAAE,OAAO;AAAA,EACtC,QAAQA,EAAE,QAAA;AAAA,EACV,QAAQA,EAAE,OAAA,EAAS,IAAI,CAAC,EAAE,UAAU,MAAM;AAAA,EAC1C,aAAaA,EAAE,SAAS,IAAI,CAAC;AAAA,EAC7B,cAAcA,EAAE,QAAA;AAAA,EAChB,OAAOA,EAAE,OAAA,EAAS,SAAA;AAAA,EAClB,WAAWA,EAAE,OAAA,EAAS,UAAU,CAAAC,MAAOA,MAAQ,MAAM;AAAA,EACrD,eAAeD,EACZ,OAAA,EACA,IAAI,CAAC,EACL,UAAU,CAAAC,MAAQA,IAAM,IAAIA,EAAI,SAAA,IAAa,IAAK,EAClD,SAAA;AAAA,EACH,k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GAAA,EAAiB,MAAK,iBAAgB,OAAOzC,EAAE,gBAAgB,GAAG,KAAK,GAAG;AAAA,wBAC1EyC,GAAA,EAAiB,MAAK,oBAAmB,OAAM,sBAAqB,KAAK,EAAA,CAAG;AAAA,IAAA,GAC/E;AAAA,sBAEDC,GAAA,EAAc,MAAK,gBAAe,OAAO1C,EAAE,mBAAmB,GAAG;AAAA,sBACjE2C,GAAA,EACC,UAAA;AAAA,MAAA,gBAAAtD,EAACa,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAAS8B,GAC7C,UAAAhC,EAAE,WAAW,EAAA,CAChB;AAAA,MACA,gBAAAX,EAACa,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWwB,GACzC,UAAoC1B,EAAnCQ,IAAqC,gBAAvB,iBAAoC,EAAA,CACtD;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,EAAA,CACF,EAAA,CAEJ,GACF,EAAA,CACF,EAAA,CACF;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 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 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 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 // 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 {/* 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":["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","defaultDeductionTypeSelection","stateAgency","setStateAgency","handleStateAgencySelect","counties","agency","fipsCode","selectedAgency","handleCancel","componentEvents","handleSelectDeductionType","selection","jsxs","CaretLeft","styles","Grid","ChildSupportForm","CustomDeductionForm"],"mappings":";;;;;;;;;;;;;;;AAwBO,SAASA,GAAeC,GAAqD;AAClF,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,IAAMC,EAAe,qBAAqB,GAC5CC,IAAaC,EAAA;AAEnB,EAAAC,EAAuB,uBAAuBN,CAAU,GACxDO,EAAQ,qBAAqB;AAG7B,QAAM,EAAE,MAAAC,EAAA,IAASC,EAA4B,EAAE,YAAAX,GAAY,GAGrD,EAAE,MAAMY,MAAqBC,EAA2C,CAAA,CAAE,GAK1EC,IAAYb,IACbS,EAAK,iBAAiB,KAAK,OAAKK,EAAE,SAASd,CAAW,KAAK,OAC5D,MACEe,IAA8C,EAArCF,IAAuC,uBAAzB,mBAA6C,GACpEG,IAAgBH,GA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A,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;"}
@@ -0,0 +1,14 @@
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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeductionsForm.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
@@ -1,50 +1,50 @@
1
- import { jsx as n, jsxs as m, Fragment as P } from "react/jsx-runtime";
2
- import { useTranslation as A } from "react-i18next";
3
- import { useGarnishmentsListSuspense as O } from "@gusto/embedded-api/react-query/garnishmentsList";
1
+ import { jsx as n, jsxs as l, Fragment as A } from "react/jsx-runtime";
2
+ import { useTranslation as M } from "react-i18next";
3
+ import { useGarnishmentsListSuspense as N } from "@gusto/embedded-api/react-query/garnishmentsList";
4
4
  import { useGarnishmentsUpdateMutation as w } from "@gusto/embedded-api/react-query/garnishmentsUpdate";
5
- import { BaseComponent as N } from "../../../Base/Base.js";
6
- import { useBase as _ } from "../../../Base/useBase.js";
7
- import { Flex as k } from "../../../Common/Flex/Flex.js";
5
+ import { BaseComponent as I } from "../../../Base/Base.js";
6
+ import { useBase as k } from "../../../Base/useBase.js";
7
+ import { Flex as U } from "../../../Common/Flex/Flex.js";
8
8
  import "classnames";
9
- import { ActionsLayout as I } from "../../../Common/ActionsLayout/ActionsLayout.js";
10
- import u from "../../../../hooks/useNumberFormatter.js";
11
- import M from "../../../../assets/icons/pencil.svg.js";
12
- import U from "../../../../assets/icons/trashcan.svg.js";
13
- import { useComponentDictionary as B, useI18n as S } from "../../../../i18n/I18n.js";
14
- import { componentEvents as c } from "../../../../shared/constants.js";
15
- import { useComponentContext as V } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
16
- import { HamburgerMenu as Y } from "../../../Common/HamburgerMenu/HamburgerMenu.js";
17
- import { useDataView as q } from "../../../Common/DataView/useDataView.js";
18
- import { DataView as F } from "../../../Common/DataView/DataView.js";
19
- function se(r) {
20
- return /* @__PURE__ */ n(N, { ...r, children: /* @__PURE__ */ n(H, { ...r, children: r.children }) });
9
+ import { componentEvents as a } from "../../../../shared/constants.js";
10
+ import { ActionsLayout as Y } from "../../../Common/ActionsLayout/ActionsLayout.js";
11
+ import { HamburgerMenu as B } from "../../../Common/HamburgerMenu/HamburgerMenu.js";
12
+ import E from "../../../../hooks/useNumberFormatter.js";
13
+ import S from "../../../../assets/icons/pencil.svg.js";
14
+ import V from "../../../../assets/icons/trashcan.svg.js";
15
+ import { useComponentDictionary as q, useI18n as F } from "../../../../i18n/I18n.js";
16
+ import { useComponentContext as H } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
17
+ import { useDataView as j } from "../../../Common/DataView/useDataView.js";
18
+ import { DataView as G } from "../../../Common/DataView/DataView.js";
19
+ function me(r) {
20
+ return /* @__PURE__ */ n(I, { ...r, children: /* @__PURE__ */ n(R, { ...r, children: r.children }) });
21
21
  }
22
- function H({ className: r, children: s, employeeId: d, dictionary: l }) {
23
- const { onEvent: a, baseSubmitHandler: p } = _(), { t } = A("Employee.Deductions"), i = V(), D = u("currency"), h = u("percent");
24
- B("Employee.Deductions", l), S("Employee.Deductions");
25
- const { data: E } = O({ employeeId: d }), f = E.garnishmentList.filter((e) => e.active), { mutateAsync: g, isPending: C } = w(), y = async (e) => {
26
- await p(e, async (o) => {
27
- const { garnishment: x } = await g({
22
+ function R({ className: r, children: s, employeeId: D, dictionary: p }) {
23
+ const { onEvent: o, baseSubmitHandler: f } = k(), { t } = M("Employee.Deductions"), c = H(), h = E("currency"), g = E("percent");
24
+ q("Employee.Deductions", p), F("Employee.Deductions");
25
+ const { data: C } = N({ employeeId: D }), u = C.garnishmentList, T = u.filter((e) => e.active), { mutateAsync: v, isPending: y } = w(), b = async (e) => {
26
+ await f(e, async (i) => {
27
+ const { garnishment: m } = await v({
28
28
  request: {
29
- garnishmentId: o.uuid,
29
+ garnishmentId: i.uuid,
30
30
  requestBody: {
31
- ...o,
32
- totalAmount: o.totalAmount ?? void 0,
31
+ ...i,
32
+ totalAmount: i.totalAmount ?? void 0,
33
33
  active: !1,
34
- version: o.version
34
+ version: i.version
35
35
  }
36
36
  }
37
- });
38
- a(c.EMPLOYEE_DEDUCTION_DELETED, x);
37
+ }), d = u.filter((x) => x.active);
38
+ d.length === 1 && d[0]?.uuid === m?.uuid ? o(a.EMPLOYEE_DEDUCTION_DELETED_EMPTY) : o(a.EMPLOYEE_DEDUCTION_DELETED, m);
39
39
  });
40
- }, T = (e) => {
41
- a(c.EMPLOYEE_DEDUCTION_EDIT, e);
42
- }, b = () => {
43
- a(c.EMPLOYEE_DEDUCTION_ADD);
44
- }, v = () => {
45
- a(c.EMPLOYEE_DEDUCTION_DONE);
46
- }, { ...L } = q({
47
- data: f,
40
+ }, L = (e) => {
41
+ o(a.EMPLOYEE_DEDUCTION_EDIT, e);
42
+ }, P = () => {
43
+ o(a.EMPLOYEE_DEDUCTION_ADD);
44
+ }, O = () => {
45
+ o(a.EMPLOYEE_DEDUCTION_DONE);
46
+ }, { ..._ } = j({
47
+ data: T,
48
48
  columns: [
49
49
  {
50
50
  key: "description",
@@ -59,46 +59,46 @@ function H({ className: r, children: s, employeeId: d, dictionary: l }) {
59
59
  key: "amount",
60
60
  title: t("withheldColumn"),
61
61
  render: (e) => {
62
- const o = e.deductAsPercentage ? h(Number(e.amount)) : D(Number(e.amount));
63
- return e.recurring ? t("recurringAmount", { value: o }) : o;
62
+ const i = e.deductAsPercentage ? g(Number(e.amount)) : h(Number(e.amount));
63
+ return e.recurring ? t("recurringAmount", { value: i }) : i;
64
64
  }
65
65
  }
66
66
  ],
67
67
  itemMenu: (e) => /* @__PURE__ */ n(
68
- Y,
68
+ B,
69
69
  {
70
- isLoading: C,
70
+ isLoading: y,
71
71
  items: [
72
72
  {
73
73
  label: t("editCta"),
74
74
  onClick: () => {
75
- T(e);
75
+ L(e);
76
76
  },
77
- icon: /* @__PURE__ */ n(M, { "aria-hidden": !0 })
77
+ icon: /* @__PURE__ */ n(S, { "aria-hidden": !0 })
78
78
  },
79
79
  {
80
80
  label: t("deleteCta"),
81
81
  onClick: async () => {
82
- await y(e);
82
+ await b(e);
83
83
  },
84
- icon: /* @__PURE__ */ n(U, { "aria-hidden": !0 })
84
+ icon: /* @__PURE__ */ n(V, { "aria-hidden": !0 })
85
85
  }
86
86
  ]
87
87
  }
88
88
  )
89
89
  });
90
- return /* @__PURE__ */ n("section", { className: r, children: /* @__PURE__ */ n(k, { flexDirection: "column", gap: 32, children: s || /* @__PURE__ */ m(P, { children: [
91
- /* @__PURE__ */ n(i.Heading, { as: "h2", children: t("pageTitle") }),
92
- /* @__PURE__ */ n(i.Text, { variant: "supporting", children: t("includeDeductionsDescriptionV2") }),
93
- /* @__PURE__ */ n(i.Text, { weight: "bold", size: "lg", children: t("includeDeductionsSubtitle") }),
94
- /* @__PURE__ */ n(F, { label: t("deductionsTableLabel"), ...L }),
95
- /* @__PURE__ */ m(I, { children: [
96
- /* @__PURE__ */ n(i.Button, { variant: "secondary", onClick: b, children: t("addDeductionCta") }),
97
- /* @__PURE__ */ n(i.Button, { onClick: v, children: t("continueCta") })
90
+ return /* @__PURE__ */ n("section", { className: r, children: /* @__PURE__ */ n(U, { flexDirection: "column", gap: 32, children: s || /* @__PURE__ */ l(A, { children: [
91
+ /* @__PURE__ */ n(c.Heading, { as: "h2", children: t("pageTitle") }),
92
+ /* @__PURE__ */ n(c.Text, { variant: "supporting", children: t("includeDeductionsDescriptionV2") }),
93
+ /* @__PURE__ */ n(c.Text, { weight: "bold", size: "lg", children: t("includeDeductionsSubtitle") }),
94
+ /* @__PURE__ */ n(G, { label: t("deductionsTableLabel"), ..._ }),
95
+ /* @__PURE__ */ l(Y, { children: [
96
+ /* @__PURE__ */ n(c.Button, { variant: "secondary", onClick: P, children: t("addDeductionCta") }),
97
+ /* @__PURE__ */ n(c.Button, { onClick: O, children: t("continueCta") })
98
98
  ] })
99
99
  ] }) }) });
100
100
  }
101
101
  export {
102
- se as DeductionsList
102
+ me as DeductionsList
103
103
  };
104
104
  //# sourceMappingURL=DeductionsList.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DeductionsList.js","sources":["../../../../../src/components/Employee/Deductions/DeductionsList/DeductionsList.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useGarnishmentsListSuspense } from '@gusto/embedded-api/react-query/garnishmentsList'\nimport { useGarnishmentsUpdateMutation } from '@gusto/embedded-api/react-query/garnishmentsUpdate'\nimport { type Garnishment } from '@gusto/embedded-api/models/components/garnishment'\nimport {\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n useBase,\n} from '@/components/Base'\nimport { useDataView, DataView } from '@/components/Common'\nimport { ActionsLayout } from '@/components/Common'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport useNumberFormatter from '@/hooks/useNumberFormatter'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport TrashCanSvg from '@/assets/icons/trashcan.svg?react'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\ninterface DeductionsListProps extends CommonComponentInterface<'Employee.Deductions'> {\n employeeId: string\n}\n\nexport function DeductionsList(props: DeductionsListProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ className, children, employeeId, dictionary }: DeductionsListProps) {\n const { onEvent, baseSubmitHandler } = useBase()\n const { t } = useTranslation('Employee.Deductions')\n const Components = useComponentContext()\n const formatCurrency = useNumberFormatter('currency')\n const formatPercent = useNumberFormatter('percent')\n\n useComponentDictionary('Employee.Deductions', dictionary)\n useI18n('Employee.Deductions')\n\n const { data } = useGarnishmentsListSuspense({ employeeId })\n const deductions = data.garnishmentList!\n const activeDeductions = deductions.filter(deduction => deduction.active)\n\n const { mutateAsync: updateDeduction, isPending: isPendingUpdate } =\n useGarnishmentsUpdateMutation()\n\n const handleDelete = async (deduction: Garnishment) => {\n await baseSubmitHandler(deduction, async payload => {\n const { garnishment } = await updateDeduction({\n request: {\n garnishmentId: payload.uuid,\n requestBody: {\n ...payload,\n totalAmount: payload.totalAmount ?? undefined,\n active: false,\n version: payload.version as string,\n },\n },\n })\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_DELETED, garnishment)\n })\n }\n\n const handleEdit = (deduction: Garnishment) => {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_EDIT, deduction)\n }\n\n const handleAdd = () => {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_ADD)\n }\n\n const handleContinue = () => {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_DONE)\n }\n\n const { ...dataViewProps } = useDataView({\n data: activeDeductions,\n columns: [\n {\n key: 'description',\n title: t('nameColumn'),\n },\n {\n key: 'recurring',\n title: t('frequencyColumn'),\n render: deduction => {\n return deduction.recurring ? t('recurringText') : t('nonRecurringText')\n },\n },\n {\n key: 'amount',\n title: t('withheldColumn'),\n render: deduction => {\n const formattedAmount = deduction.deductAsPercentage\n ? formatPercent(Number(deduction.amount))\n : formatCurrency(Number(deduction.amount))\n return deduction.recurring\n ? t('recurringAmount', { value: formattedAmount })\n : formattedAmount\n },\n },\n ],\n itemMenu: deduction => {\n return (\n <HamburgerMenu\n isLoading={isPendingUpdate}\n items={[\n {\n label: t('editCta'),\n onClick: () => {\n handleEdit(deduction)\n },\n icon: <PencilSvg aria-hidden />,\n },\n {\n label: t('deleteCta'),\n onClick: async () => {\n await handleDelete(deduction)\n },\n icon: <TrashCanSvg aria-hidden />,\n },\n ]}\n />\n )\n },\n })\n\n return (\n <section className={className}>\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Components.Heading as=\"h2\">{t('pageTitle')}</Components.Heading>\n <Components.Text variant=\"supporting\">\n {t('includeDeductionsDescriptionV2')}\n </Components.Text>\n <Components.Text weight=\"bold\" size=\"lg\">\n {t('includeDeductionsSubtitle')}\n </Components.Text>\n <DataView label={t('deductionsTableLabel')} {...dataViewProps} />\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleAdd}>\n {t('addDeductionCta')}\n </Components.Button>\n <Components.Button onClick={handleContinue}>{t('continueCta')}</Components.Button>\n </ActionsLayout>\n </>\n )}\n </Flex>\n </section>\n )\n}\n"],"names":["DeductionsList","props","jsx","BaseComponent","Root","className","children","employeeId","dictionary","onEvent","baseSubmitHandler","useBase","useTranslation","Components","useComponentContext","formatCurrency","useNumberFormatter","formatPercent","useComponentDictionary","useI18n","data","useGarnishmentsListSuspense","activeDeductions","deduction","updateDeduction","isPendingUpdate","useGarnishmentsUpdateMutation","handleDelete","payload","garnishment","componentEvents","handleEdit","handleAdd","handleContinue","dataViewProps","useDataView","formattedAmount","HamburgerMenu","PencilSvg","TrashCanSvg","Flex","jsxs","Fragment","DataView","ActionsLayout"],"mappings":";;;;;;;;;;;;;;;;;;AA0BO,SAASA,GAAeC,GAAqD;AAClF,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,C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AA,EAAE,WAAW,GAAE;AAAA,IAC5C,gBAAAX,EAACW,EAAW,MAAX,EAAgB,SAAQ,cACtB,UAAA,EAAE,gCAAgC,GACrC;AAAA,IACA,gBAAAX,EAACW,EAAW,MAAX,EAAgB,QAAO,QAAO,MAAK,MACjC,UAAA,EAAE,2BAA2B,EAAA,CAChC;AAAA,sBACC8B,GAAA,EAAS,OAAO,EAAE,sBAAsB,GAAI,GAAGT,GAAe;AAAA,sBAC9DU,GAAA,EACC,UAAA;AAAA,MAAA,gBAAA1C,EAACW,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASmB,GAC7C,UAAA,EAAE,iBAAiB,EAAA,CACtB;AAAA,MACA,gBAAA9B,EAACW,EAAW,QAAX,EAAkB,SAASoB,GAAiB,UAAA,EAAE,aAAa,EAAA,CAAE;AAAA,IAAA,EAAA,CAChE;AAAA,EAAA,EAAA,CACF,GAEJ,GACF;AAEJ;"}
1
+ {"version":3,"file":"DeductionsList.js","sources":["../../../../../src/components/Employee/Deductions/DeductionsList/DeductionsList.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useGarnishmentsListSuspense } from '@gusto/embedded-api/react-query/garnishmentsList'\nimport { useGarnishmentsUpdateMutation } from '@gusto/embedded-api/react-query/garnishmentsUpdate'\nimport { type Garnishment } from '@gusto/embedded-api/models/components/garnishment'\nimport {\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n useBase,\n} from '@/components/Base'\nimport { useDataView, DataView } from '@/components/Common'\nimport { ActionsLayout } from '@/components/Common'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport useNumberFormatter from '@/hooks/useNumberFormatter'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport TrashCanSvg from '@/assets/icons/trashcan.svg?react'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\ninterface DeductionsListProps extends CommonComponentInterface<'Employee.Deductions'> {\n employeeId: string\n}\n\nexport function DeductionsList(props: DeductionsListProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ className, children, employeeId, dictionary }: DeductionsListProps) {\n const { onEvent, baseSubmitHandler } = useBase()\n const { t } = useTranslation('Employee.Deductions')\n const Components = useComponentContext()\n const formatCurrency = useNumberFormatter('currency')\n const formatPercent = useNumberFormatter('percent')\n\n useComponentDictionary('Employee.Deductions', dictionary)\n useI18n('Employee.Deductions')\n\n const { data } = useGarnishmentsListSuspense({ employeeId })\n const deductions = data.garnishmentList!\n const activeDeductions = deductions.filter(deduction => deduction.active)\n\n const { mutateAsync: updateDeduction, isPending: isPendingUpdate } =\n useGarnishmentsUpdateMutation()\n\n const handleDelete = async (deduction: Garnishment) => {\n await baseSubmitHandler(deduction, async payload => {\n const { garnishment } = await updateDeduction({\n request: {\n garnishmentId: payload.uuid,\n requestBody: {\n ...payload,\n totalAmount: payload.totalAmount ?? undefined,\n active: false,\n version: payload.version as string,\n },\n },\n })\n\n // if soft deleted deduction was the last active, then return to empty view\n // else if any other active deductions return to list view\n const remainingActiveDeductions = deductions.filter(d => d.active)\n\n if (\n remainingActiveDeductions.length === 1 &&\n remainingActiveDeductions[0]?.uuid === garnishment?.uuid\n ) {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_DELETED_EMPTY)\n } else {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_DELETED, garnishment)\n }\n })\n }\n\n const handleEdit = (deduction: Garnishment) => {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_EDIT, deduction)\n }\n\n const handleAdd = () => {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_ADD)\n }\n\n const handleContinue = () => {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_DONE)\n }\n\n const { ...dataViewProps } = useDataView({\n data: activeDeductions,\n columns: [\n {\n key: 'description',\n title: t('nameColumn'),\n },\n {\n key: 'recurring',\n title: t('frequencyColumn'),\n render: deduction => {\n return deduction.recurring ? t('recurringText') : t('nonRecurringText')\n },\n },\n {\n key: 'amount',\n title: t('withheldColumn'),\n render: deduction => {\n const formattedAmount = deduction.deductAsPercentage\n ? formatPercent(Number(deduction.amount))\n : formatCurrency(Number(deduction.amount))\n return deduction.recurring\n ? t('recurringAmount', { value: formattedAmount })\n : formattedAmount\n },\n },\n ],\n itemMenu: deduction => {\n return (\n <HamburgerMenu\n isLoading={isPendingUpdate}\n items={[\n {\n label: t('editCta'),\n onClick: () => {\n handleEdit(deduction)\n },\n icon: <PencilSvg aria-hidden />,\n },\n {\n label: t('deleteCta'),\n onClick: async () => {\n await handleDelete(deduction)\n },\n icon: <TrashCanSvg aria-hidden />,\n },\n ]}\n />\n )\n },\n })\n\n return (\n <section className={className}>\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Components.Heading as=\"h2\">{t('pageTitle')}</Components.Heading>\n <Components.Text variant=\"supporting\">\n {t('includeDeductionsDescriptionV2')}\n </Components.Text>\n <Components.Text weight=\"bold\" size=\"lg\">\n {t('includeDeductionsSubtitle')}\n </Components.Text>\n <DataView label={t('deductionsTableLabel')} {...dataViewProps} />\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleAdd}>\n {t('addDeductionCta')}\n </Components.Button>\n <Components.Button onClick={handleContinue}>{t('continueCta')}</Components.Button>\n </ActionsLayout>\n </>\n )}\n </Flex>\n </section>\n )\n}\n"],"names":["DeductionsList","props","jsx","BaseComponent","Root","className","children","employeeId","dictionary","onEvent","baseSubmitHandler","useBase","useTranslation","Components","useComponentContext","formatCurrency","useNumberFormatter","formatPercent","useComponentDictionary","useI18n","data","useGarnishmentsListSuspense","deductions","activeDeductions","deduction","updateDeduction","isPendingUpdate","useGarnishmentsUpdateMutation","handleDelete","payload","garnishment","remainingActiveDeductions","d","componentEvents","handleEdit","handleAdd","handleContinue","dataViewProps","useDataView","formattedAmount","HamburgerMenu","PencilSvg","TrashCanSvg","Flex","jsxs","Fragment","DataView","ActionsLayout"],"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;AAEA,SAASG,EAAK,EAAE,WAAAC,GAAW,UAAAC,GAAU,YAAAC,GAAY,YAAAC,KAAmC;AAClF,QAAM,EAAE,SAAAC,GAAS,mBAAAC,EAAA,IAAsBC,EAAA,GACjC,EAAE,EAAA,IAAMC,EAAe,qBAAqB,GAC5CC,IAAaC,EAAA,GACbC,IAAiBC,EAAmB,UAAU,GAC9CC,IAAgBD,EAAmB,SAAS;AAElD,EAAAE,EAAuB,uBAAuBV,CAAU,GACxDW,EAAQ,qBAAqB;AAE7B,QAAM,EAAE,MAAAC,EAAA,IAASC,EAA4B,EAAE,YAAAd,GAAY,GACrDe,IAAaF,EAAK,iBAClBG,IAAmBD,EAAW,OAAO,CAAAE,MAAaA,EAAU,MAAM,GAElE,EAAE,aAAaC,GAAiB,WAAWC,EAAA,IAC/CC,EAAA,GAEIC,IAAe,OAAOJ,MAA2B;AACrD,UAAMd,EAAkBc,GAAW,OAAMK,MAAW;AAClD,YAAM,EAAE,aAAAC,MAAgB,MAAML,EAAgB;AAAA,QAC5C,SAAS;AAAA,UACP,eAAeI,EAAQ;AAAA,UACvB,aAAa;AAAA,YACX,GAAGA;AAAA,YACH,aAAaA,EAAQ,eAAe;AAAA,YACpC,QAAQ;AAAA,YACR,SAASA,EAAQ;AAAA,UAAA;AAAA,QACnB;AAAA,MACF,CACD,GAIKE,IAA4BT,EAAW,OAAO,CAAAU,MAAKA,EAAE,MAAM;AAEjE,MACED,EAA0B,WAAW,KACrCA,EAA0B,CA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UAAA;AAAA,UAE/B;AAAA,YACE,OAAO,EAAE,WAAW;AAAA,YACpB,SAAS,YAAY;AACnB,oBAAMb,EAAaJ,CAAS;AAAA,YAC9B;AAAA,YACA,MAAM,gBAAAtB,EAACwC,GAAA,EAAY,eAAW,GAAA,CAAC;AAAA,UAAA;AAAA,QACjC;AAAA,MACF;AAAA,IAAA;AAAA,EAGN,CACD;AAED,SACE,gBAAAxC,EAAC,WAAA,EAAQ,WAAAG,GACP,UAAA,gBAAAH,EAACyC,GAAA,EAAK,eAAc,UAAS,KAAK,IAC/B,UAAArC,KAGC,gBAAAsC,EAAAC,GAAA,EACE,UAAA;AAAA,IAAA,gBAAA3C,EAACW,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAA,EAAE,WAAW,GAAE;AAAA,IAC5C,gBAAAX,EAACW,EAAW,MAAX,EAAgB,SAAQ,cACtB,UAAA,EAAE,gCAAgC,GACrC;AAAA,IACA,gBAAAX,EAACW,EAAW,MAAX,EAAgB,QAAO,QAAO,MAAK,MACjC,UAAA,EAAE,2BAA2B,EAAA,CAChC;AAAA,sBACCiC,GAAA,EAAS,OAAO,EAAE,sBAAsB,GAAI,GAAGT,GAAe;AAAA,sBAC9DU,GAAA,EACC,UAAA;AAAA,MAAA,gBAAA7C,EAACW,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASsB,GAC7C,UAAA,EAAE,iBAAiB,EAAA,CACtB;AAAA,MACA,gBAAAjC,EAACW,EAAW,QAAX,EAAkB,SAASuB,GAAiB,UAAA,EAAE,aAAa,EAAA,CAAE;AAAA,IAAA,EAAA,CAChE;AAAA,EAAA,EAAA,CACF,GAEJ,GACF;AAEJ;"}
@@ -0,0 +1,6 @@
1
+ import { BaseComponentInterface, CommonComponentInterface } from '../../../Base';
2
+ interface IncludeDeductionsProps extends CommonComponentInterface<'Employee.Deductions'> {
3
+ employeeId: string;
4
+ }
5
+ export declare function IncludeDeductions(props: IncludeDeductionsProps & BaseComponentInterface): import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -0,0 +1,53 @@
1
+ import { jsx as t, jsxs as r } from "react/jsx-runtime";
2
+ import { useTranslation as u } from "react-i18next";
3
+ import i from "./IncludeDeductions.module.scss.js";
4
+ import { BaseComponent as a } from "../../../Base/Base.js";
5
+ import { useBase as p } from "../../../Base/useBase.js";
6
+ import { Grid as h } from "../../../Common/Grid/Grid.js";
7
+ import { Flex as C } from "../../../Common/Flex/Flex.js";
8
+ import { ActionsLayout as f } from "../../../Common/ActionsLayout/ActionsLayout.js";
9
+ import { useComponentContext as D } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
10
+ import "react";
11
+ import { useComponentDictionary as E, useI18n as g } from "../../../../i18n/I18n.js";
12
+ import { componentEvents as s } from "../../../../shared/constants.js";
13
+ import y from "../../../../assets/icons/coins-hand.svg.js";
14
+ import x from "../../../../assets/icons/plus-circle.svg.js";
15
+ function Y(o) {
16
+ return /* @__PURE__ */ t(a, { ...o, children: /* @__PURE__ */ t(I, { ...o, children: o.children }) });
17
+ }
18
+ function I({ className: o, dictionary: l }) {
19
+ const { onEvent: c } = p(), { t: n } = u("Employee.Deductions"), e = D();
20
+ E("Employee.Deductions", l), g("Employee.Deductions");
21
+ const d = () => {
22
+ c(s.EMPLOYEE_DEDUCTION_INCLUDE_YES);
23
+ }, m = () => {
24
+ c(s.EMPLOYEE_DEDUCTION_INCLUDE_NO);
25
+ };
26
+ return /* @__PURE__ */ t("section", { className: o, children: /* @__PURE__ */ r(h, { gridTemplateColumns: "1fr", children: [
27
+ /* @__PURE__ */ t(e.Heading, { as: "h2", children: n("pageTitle") }),
28
+ /* @__PURE__ */ t(e.Text, { variant: "supporting", children: n("includeDeductionsDescriptionV2") }),
29
+ /* @__PURE__ */ t(e.Text, { weight: "bold", size: "lg", children: n("includeDeductionsSubtitle") }),
30
+ /* @__PURE__ */ t("section", { className: i.emptyStateContainer, children: /* @__PURE__ */ r(C, { flexDirection: "column", gap: 16, justifyContent: "center", alignItems: "center", children: [
31
+ /* @__PURE__ */ t("section", { className: i.coinHandsIconContainer, children: /* @__PURE__ */ t(y, { width: 36, height: 36 }) }),
32
+ /* @__PURE__ */ t(e.Text, { weight: "bold", children: n("includeDeductionsEmptyState") }),
33
+ /* @__PURE__ */ r(
34
+ e.Button,
35
+ {
36
+ type: "button",
37
+ variant: "secondary",
38
+ onClick: d,
39
+ className: i.addDeductionButton,
40
+ children: [
41
+ /* @__PURE__ */ t(x, { width: 24, height: 24, className: i.plusCircleIcon }),
42
+ n("addDeductionButtonCta")
43
+ ]
44
+ }
45
+ )
46
+ ] }) }),
47
+ /* @__PURE__ */ t(f, { children: /* @__PURE__ */ t(e.Button, { type: "button", onClick: m, children: n("continueCta") }) })
48
+ ] }) });
49
+ }
50
+ export {
51
+ Y as IncludeDeductions
52
+ };
53
+ //# sourceMappingURL=IncludeDeductions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IncludeDeductions.js","sources":["../../../../../src/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport styles from './IncludeDeductions.module.scss'\nimport {\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n useBase,\n} from '@/components/Base'\nimport { Grid } from '@/components/Common/Grid/Grid'\nimport { ActionsLayout, Flex } from '@/components/Common'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary } from '@/i18n/I18n'\nimport CoinsHandsIcon from '@/assets/icons/coins-hand.svg?react'\nimport PlusCircleIcon from '@/assets/icons/plus-circle.svg?react'\n\ninterface IncludeDeductionsProps extends CommonComponentInterface<'Employee.Deductions'> {\n employeeId: string\n}\n\nexport function IncludeDeductions(props: IncludeDeductionsProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ className, dictionary }: IncludeDeductionsProps) {\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 const handleAdd = () => {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_INCLUDE_YES)\n }\n\n const handleContinue = () => {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_INCLUDE_NO)\n }\n\n return (\n <section className={className}>\n <Grid gridTemplateColumns=\"1fr\">\n <Components.Heading as=\"h2\">{t('pageTitle')}</Components.Heading>\n <Components.Text variant=\"supporting\">\n {t('includeDeductionsDescriptionV2')}\n </Components.Text>\n <Components.Text weight=\"bold\" size=\"lg\">\n {t('includeDeductionsSubtitle')}\n </Components.Text>\n <section className={styles.emptyStateContainer}>\n <Flex flexDirection=\"column\" gap={16} justifyContent=\"center\" alignItems=\"center\">\n <section className={styles.coinHandsIconContainer}>\n <CoinsHandsIcon width={36} height={36} />\n </section>\n <Components.Text weight=\"bold\">{t('includeDeductionsEmptyState')}</Components.Text>\n <Components.Button\n type=\"button\"\n variant=\"secondary\"\n onClick={handleAdd}\n className={styles.addDeductionButton}\n >\n <PlusCircleIcon width={24} height={24} className={styles.plusCircleIcon} />\n {t('addDeductionButtonCta')}\n </Components.Button>\n </Flex>\n </section>\n <ActionsLayout>\n <Components.Button type=\"button\" onClick={handleContinue}>\n {t('continueCta')}\n </Components.Button>\n </ActionsLayout>\n </Grid>\n </section>\n )\n}\n"],"names":["IncludeDeductions","props","jsx","BaseComponent","Root","className","dictionary","onEvent","useBase","t","useTranslation","Components","useComponentContext","useComponentDictionary","useI18n","handleAdd","componentEvents","handleContinue","jsxs","Grid","styles","Flex","CoinsHandsIcon","PlusCircleIcon","ActionsLayout"],"mappings":";;;;;;;;;;;;;;AAqBO,SAASA,EAAkBC,GAAwD;AACxF,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UA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AAA,UACR,SAASI;AAAA,UACT,WAAWK,EAAO;AAAA,UAElB,UAAA;AAAA,YAAA,gBAAAlB,EAACqB,KAAe,OAAO,IAAI,QAAQ,IAAI,WAAWH,EAAO,gBAAgB;AAAA,YACxEX,EAAE,uBAAuB;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAC5B,EAAA,CACF,EAAA,CACF;AAAA,IACA,gBAAAP,EAACsB,GAAA,EACC,UAAA,gBAAAtB,EAACS,EAAW,QAAX,EAAkB,MAAK,UAAS,SAASM,GACvC,UAAAR,EAAE,aAAa,GAClB,EAAA,CACF;AAAA,EAAA,EAAA,CACF,EAAA,CACF;AAEJ;"}
@@ -0,0 +1,14 @@
1
+ const n = "_emptyStateContainer_1iboq_1", t = "_coinHandsIconContainer_1iboq_11", o = "_plusCircleIcon_1iboq_17", e = "_addDeductionButton_1iboq_21", c = {
2
+ emptyStateContainer: n,
3
+ coinHandsIconContainer: t,
4
+ plusCircleIcon: o,
5
+ addDeductionButton: e
6
+ };
7
+ export {
8
+ e as addDeductionButton,
9
+ t as coinHandsIconContainer,
10
+ c as default,
11
+ n as emptyStateContainer,
12
+ o as plusCircleIcon
13
+ };
14
+ //# sourceMappingURL=IncludeDeductions.module.scss.js.map