@gusto/embedded-react-sdk 0.20.0 → 0.22.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 (485) hide show
  1. package/CHANGELOG.md +62 -0
  2. package/README.md +32 -17
  3. package/dist/UNSTABLE_Hooks.d.ts +1 -0
  4. package/dist/UNSTABLE_Hooks.js +9 -0
  5. package/dist/UNSTABLE_Hooks.js.map +1 -0
  6. package/dist/assets/icons/coins-hand.svg.js +10 -0
  7. package/dist/assets/icons/coins-hand.svg.js.map +1 -0
  8. package/dist/assets/icons/icon-file-outline.svg.js +10 -0
  9. package/dist/assets/icons/icon-file-outline.svg.js.map +1 -0
  10. package/dist/assets/icons/icon-receipt-outline.svg.js +10 -0
  11. package/dist/assets/icons/icon-receipt-outline.svg.js.map +1 -0
  12. package/dist/components/Base/Base.d.ts +19 -4
  13. package/dist/components/Base/Base.js +67 -61
  14. package/dist/components/Base/Base.js.map +1 -1
  15. package/dist/components/Base/index.d.ts +1 -1
  16. package/dist/components/Base/useBase.d.ts +1 -1
  17. package/dist/components/Base/useBase.js.map +1 -1
  18. package/dist/components/Base/useBaseSubmit.d.ts +10 -0
  19. package/dist/components/Base/useBaseSubmit.js +33 -0
  20. package/dist/components/Base/useBaseSubmit.js.map +1 -0
  21. package/dist/components/Common/Fields/CheckboxField/CheckboxField.js.map +1 -1
  22. package/dist/components/Common/Fields/CheckboxGroupField/CheckboxGroupField.js.map +1 -1
  23. package/dist/components/Common/Fields/ComboBoxField/ComboBoxField.js.map +1 -1
  24. package/dist/components/Common/Fields/DatePickerField/DatePickerField.js.map +1 -1
  25. package/dist/components/Common/Fields/NumberInputField/NumberInputField.js.map +1 -1
  26. package/dist/components/Common/Fields/RadioGroupField/RadioGroupField.js.map +1 -1
  27. package/dist/components/Common/Fields/SelectField/SelectField.js.map +1 -1
  28. package/dist/components/Common/Fields/SwitchField/SwitchField.js.map +1 -1
  29. package/dist/components/Common/Fields/TextAreaField/TextAreaField.d.ts +5 -0
  30. package/dist/components/Common/Fields/TextAreaField/TextAreaField.js +34 -0
  31. package/dist/components/Common/Fields/TextAreaField/TextAreaField.js.map +1 -0
  32. package/dist/components/Common/Fields/TextAreaField/index.d.ts +3 -0
  33. package/dist/components/Common/Fields/TextInputField/TextInputField.js.map +1 -1
  34. package/dist/components/Common/Fieldset/Fieldset.js.map +1 -1
  35. package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.js +10 -10
  36. package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.js.map +1 -1
  37. package/dist/components/Common/FlowBreadcrumbs/breadcrumbTransitionHelpers.d.ts +1 -0
  38. package/dist/components/Common/FlowBreadcrumbs/breadcrumbTransitionHelpers.js +14 -0
  39. package/dist/components/Common/FlowBreadcrumbs/breadcrumbTransitionHelpers.js.map +1 -0
  40. package/dist/components/Common/FlowBreadcrumbs/index.d.ts +1 -0
  41. package/dist/components/Common/SignatureForm/SignatureForm.js +4 -2
  42. package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
  43. package/dist/components/Common/SignatureForm/SignatureFormActions.js +8 -6
  44. package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
  45. package/dist/components/Common/SignatureForm/SignatureFormFields.js +14 -11
  46. package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
  47. package/dist/components/Common/UI/Alert/Alert.js +23 -22
  48. package/dist/components/Common/UI/Alert/Alert.js.map +1 -1
  49. package/dist/components/Common/UI/Alert/AlertTypes.d.ts +4 -0
  50. package/dist/components/Common/UI/Alert/AlertTypes.js.map +1 -1
  51. package/dist/components/Common/UI/Badge/BadgeTypes.js.map +1 -1
  52. package/dist/components/Common/UI/Banner/BannerTypes.js.map +1 -1
  53. package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js +1 -1
  54. package/dist/components/Common/UI/Button/ButtonTypes.js.map +1 -1
  55. package/dist/components/Common/UI/Checkbox/CheckboxTypes.js.map +1 -1
  56. package/dist/components/Common/UI/CheckboxGroup/CheckboxGroupTypes.js.map +1 -1
  57. package/dist/components/Common/UI/ComboBox/ComboBox.module.scss.js +1 -1
  58. package/dist/components/Common/UI/DatePicker/DatePicker.d.ts +1 -1
  59. package/dist/components/Common/UI/DatePicker/DatePicker.js +38 -37
  60. package/dist/components/Common/UI/DatePicker/DatePicker.js.map +1 -1
  61. package/dist/components/Common/UI/DatePicker/DatePicker.module.scss.js +7 -7
  62. package/dist/components/Common/UI/DatePicker/DatePickerTypes.d.ts +4 -0
  63. package/dist/components/Common/UI/Input/InputTypes.js.map +1 -1
  64. package/dist/components/Common/UI/LoadingSpinner/LoadingSpinnerTypes.js.map +1 -1
  65. package/dist/components/Common/UI/Modal/Modal.module.scss.js +17 -17
  66. package/dist/components/Common/UI/ProgressBar/ProgressBar.js +4 -4
  67. package/dist/components/Common/UI/Radio/RadioTypes.js.map +1 -1
  68. package/dist/components/Common/UI/RadioGroup/RadioGroupTypes.js.map +1 -1
  69. package/dist/components/Common/UI/Select/Select.d.ts +1 -1
  70. package/dist/components/Common/UI/Select/Select.js +27 -26
  71. package/dist/components/Common/UI/Select/Select.js.map +1 -1
  72. package/dist/components/Common/UI/Select/Select.module.scss.js +6 -6
  73. package/dist/components/Common/UI/Select/SelectTypes.d.ts +4 -0
  74. package/dist/components/Common/UI/Switch/SwitchTypes.js.map +1 -1
  75. package/dist/components/Common/UI/Table/Table.module.scss.js +1 -1
  76. package/dist/components/Common/UI/Table/TableTypes.js.map +1 -1
  77. package/dist/components/Common/UI/TextArea/TextArea.d.ts +2 -0
  78. package/dist/components/Common/UI/TextArea/TextArea.js +79 -0
  79. package/dist/components/Common/UI/TextArea/TextArea.js.map +1 -0
  80. package/dist/components/Common/UI/TextArea/TextArea.module.scss.js +12 -0
  81. package/dist/components/Common/UI/TextArea/TextArea.module.scss.js.map +1 -0
  82. package/dist/components/Common/UI/TextArea/TextAreaTypes.d.ts +37 -0
  83. package/dist/components/Common/UI/TextArea/TextAreaTypes.js +9 -0
  84. package/dist/components/Common/UI/TextArea/TextAreaTypes.js.map +1 -0
  85. package/dist/components/Common/UI/TextArea/index.d.ts +4 -0
  86. package/dist/components/Common/UI/TextInput/TextInputTypes.js.map +1 -1
  87. package/dist/components/Company/AssignSignatory/AssignSignatory.js +7 -5
  88. package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
  89. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +5 -2
  90. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
  91. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +4 -2
  92. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
  93. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +8 -6
  94. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
  95. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +14 -13
  96. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
  97. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +3 -4
  98. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  99. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +4 -2
  100. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
  101. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +11 -9
  102. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
  103. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +9 -8
  104. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
  105. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +3 -4
  106. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  107. package/dist/components/Company/AssignSignatory/TitleSelect.js +6 -4
  108. package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
  109. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +5 -6
  110. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  111. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +10 -9
  112. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
  113. package/dist/components/Company/BankAccount/BankAccountForm/Form.js +10 -8
  114. package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
  115. package/dist/components/Company/BankAccount/BankAccountForm/context.js +3 -4
  116. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  117. package/dist/components/Company/BankAccount/BankAccountList/Actions.js +10 -8
  118. package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
  119. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +10 -8
  120. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
  121. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +6 -4
  122. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
  123. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +4 -2
  124. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
  125. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +10 -8
  126. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  127. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +3 -4
  128. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  129. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +9 -7
  130. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  131. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +3 -4
  132. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  133. package/dist/components/Company/FederalTaxes/Actions.js +9 -7
  134. package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
  135. package/dist/components/Company/FederalTaxes/FederalTaxes.js +4 -2
  136. package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
  137. package/dist/components/Company/FederalTaxes/Form.js +4 -4
  138. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +8 -9
  139. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  140. package/dist/components/Company/Industry/Actions.js +9 -7
  141. package/dist/components/Company/Industry/Actions.js.map +1 -1
  142. package/dist/components/Company/Industry/Context.js +6 -7
  143. package/dist/components/Company/Industry/Context.js.map +1 -1
  144. package/dist/components/Company/Industry/Edit.js +7 -4
  145. package/dist/components/Company/Industry/Edit.js.map +1 -1
  146. package/dist/components/Company/Locations/LocationForm/Actions.js +10 -8
  147. package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
  148. package/dist/components/Company/Locations/LocationForm/Form.js +6 -4
  149. package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
  150. package/dist/components/Company/Locations/LocationForm/LocationForm.js +10 -8
  151. package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
  152. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +3 -4
  153. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  154. package/dist/components/Company/Locations/LocationsList/Actions.js +8 -6
  155. package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
  156. package/dist/components/Company/Locations/LocationsList/List.js +16 -15
  157. package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
  158. package/dist/components/Company/Locations/LocationsList/LocationsList.js +3 -2
  159. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  160. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +3 -4
  161. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  162. package/dist/components/Company/OnboardingOverview/Completed.js +11 -10
  163. package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
  164. package/dist/components/Company/OnboardingOverview/MissingRequirements.js +10 -9
  165. package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
  166. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +8 -6
  167. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
  168. package/dist/components/Company/OnboardingOverview/context.js +3 -4
  169. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  170. package/dist/components/Company/PaySchedule/PaySchedule.js +3 -2
  171. package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
  172. package/dist/components/Company/PaySchedule/_parts/Actions.js +11 -9
  173. package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
  174. package/dist/components/Company/PaySchedule/_parts/Head.js +9 -8
  175. package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
  176. package/dist/components/Company/PaySchedule/_parts/List.js +8 -8
  177. package/dist/components/Company/PaySchedule/usePaySchedule.js +5 -6
  178. package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
  179. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +4 -2
  180. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
  181. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +3 -4
  182. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  183. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +4 -2
  184. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
  185. package/dist/components/Company/StateTaxes/StateTaxesList/List.js +4 -2
  186. package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
  187. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +3 -4
  188. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  189. package/dist/components/Contractor/Address/Address.js +5 -3
  190. package/dist/components/Contractor/Address/Address.js.map +1 -1
  191. package/dist/components/Contractor/Address/Form.js +11 -9
  192. package/dist/components/Contractor/Address/Form.js.map +1 -1
  193. package/dist/components/Contractor/Address/useAddress.js +5 -6
  194. package/dist/components/Contractor/Address/useAddress.js.map +1 -1
  195. package/dist/components/Contractor/ContractorList/index.js +4 -4
  196. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +13 -10
  197. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
  198. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +5 -3
  199. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
  200. package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.d.ts +7 -0
  201. package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js +48 -0
  202. package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js.map +1 -0
  203. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.d.ts +14 -0
  204. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +109 -0
  205. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -0
  206. package/dist/components/Contractor/Payments/Detail/DetailPresentation.d.ts +19 -0
  207. package/dist/components/Contractor/Payments/EditPayment/EditPayment.d.ts +7 -0
  208. package/dist/components/Contractor/Payments/EditPayment/EditPayment.js +34 -0
  209. package/dist/components/Contractor/Payments/EditPayment/EditPayment.js.map +1 -0
  210. package/dist/components/Contractor/Payments/EditPayment/EditPaymentPresentation.d.ts +6 -0
  211. package/dist/components/Contractor/Payments/EditPayment/EditPaymentPresentation.js +84 -0
  212. package/dist/components/Contractor/Payments/EditPayment/EditPaymentPresentation.js.map +1 -0
  213. package/dist/components/Contractor/Payments/Overview/Overview.d.ts +7 -0
  214. package/dist/components/Contractor/Payments/Overview/Overview.js +72 -0
  215. package/dist/components/Contractor/Payments/Overview/Overview.js.map +1 -0
  216. package/dist/components/Contractor/Payments/Overview/OverviewPresentation.d.ts +18 -0
  217. package/dist/components/Contractor/Payments/Overview/OverviewPresentation.js +131 -0
  218. package/dist/components/Contractor/Payments/Overview/OverviewPresentation.js.map +1 -0
  219. package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlow.d.ts +2 -0
  220. package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlow.js +26 -0
  221. package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlow.js.map +1 -0
  222. package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.d.ts +15 -0
  223. package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js +30 -0
  224. package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js.map +1 -0
  225. package/dist/components/Contractor/Payments/PaymentFlow/index.d.ts +3 -0
  226. package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.d.ts +8 -0
  227. package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js +158 -0
  228. package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js.map +1 -0
  229. package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.d.ts +7 -0
  230. package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js +29 -0
  231. package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js.map +1 -0
  232. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.d.ts +18 -0
  233. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +108 -0
  234. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -0
  235. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.module.scss.js +10 -0
  236. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.module.scss.js.map +1 -0
  237. package/dist/components/Contractor/Payments/types.d.ts +4 -0
  238. package/dist/components/Contractor/Profile/ContractorProfileForm.js +11 -11
  239. package/dist/components/Contractor/Profile/useContractorProfile.d.ts +26 -26
  240. package/dist/components/Contractor/Profile/useContractorProfile.js +2 -3
  241. package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
  242. package/dist/components/Contractor/Submit/Submit.js +20 -19
  243. package/dist/components/Contractor/Submit/Submit.js.map +1 -1
  244. package/dist/components/Contractor/index.d.ts +1 -0
  245. package/dist/components/Contractor/index.js +4 -2
  246. package/dist/components/Contractor/index.js.map +1 -1
  247. package/dist/components/Employee/Compensation/Actions.js +14 -13
  248. package/dist/components/Employee/Compensation/Actions.js.map +1 -1
  249. package/dist/components/Employee/Compensation/List.js +23 -22
  250. package/dist/components/Employee/Compensation/List.js.map +1 -1
  251. package/dist/components/Employee/Deductions/Deductions.d.ts +1 -1
  252. package/dist/components/Employee/Deductions/Deductions.js +10 -10
  253. package/dist/components/Employee/Deductions/Deductions.js.map +1 -1
  254. package/dist/components/Employee/Deductions/DeductionsComponents.d.ts +2 -0
  255. package/dist/components/Employee/Deductions/DeductionsComponents.js +6 -6
  256. package/dist/components/Employee/Deductions/DeductionsComponents.js.map +1 -1
  257. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +220 -0
  258. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -0
  259. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.module.scss.js +8 -0
  260. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.module.scss.js.map +1 -0
  261. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.d.ts +2 -2
  262. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +163 -0
  263. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -0
  264. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.d.ts +0 -34
  265. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js +121 -125
  266. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js.map +1 -1
  267. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.module.scss.js +14 -0
  268. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.module.scss.js.map +1 -0
  269. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.d.ts +56 -0
  270. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +158 -0
  271. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -0
  272. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +55 -55
  273. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js.map +1 -1
  274. package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.d.ts +6 -0
  275. package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js +54 -0
  276. package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js.map +1 -0
  277. package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.module.scss.js +14 -0
  278. package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.module.scss.js.map +1 -0
  279. package/dist/components/Employee/Deductions/stateMachine.js +49 -29
  280. package/dist/components/Employee/Deductions/stateMachine.js.map +1 -1
  281. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +8 -6
  282. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
  283. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +4 -2
  284. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  285. package/dist/components/Employee/DocumentSigner/DocumentList/List.js +4 -2
  286. package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
  287. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +3 -4
  288. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  289. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +4 -2
  290. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  291. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +3 -4
  292. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  293. package/dist/components/Employee/EmployeeList/Actions.js +8 -6
  294. package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
  295. package/dist/components/Employee/EmployeeList/EmployeeList.js +4 -2
  296. package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
  297. package/dist/components/Employee/EmployeeList/Head.js +6 -5
  298. package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
  299. package/dist/components/Employee/EmployeeList/List.js +14 -14
  300. package/dist/components/Employee/EmployeeList/useEmployeeList.js +3 -4
  301. package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
  302. package/dist/components/Employee/FederalTaxes/Actions.js +9 -7
  303. package/dist/components/Employee/FederalTaxes/Actions.js.map +1 -1
  304. package/dist/components/Employee/FederalTaxes/FederalForm.d.ts +22 -7
  305. package/dist/components/Employee/FederalTaxes/FederalForm.js +85 -29
  306. package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
  307. package/dist/components/Employee/FederalTaxes/FederalTaxes.js +62 -46
  308. package/dist/components/Employee/FederalTaxes/FederalTaxes.js.map +1 -1
  309. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +3 -4
  310. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
  311. package/dist/components/Employee/Landing/Landing.js +3 -2
  312. package/dist/components/Employee/Landing/Landing.js.map +1 -1
  313. package/dist/components/Employee/PaymentMethod/Actions.js +8 -6
  314. package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
  315. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +5 -3
  316. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
  317. package/dist/components/Employee/PaymentMethod/BankAccountsList.js +12 -11
  318. package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
  319. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +8 -6
  320. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
  321. package/dist/components/Employee/PaymentMethod/Split.js +5 -5
  322. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +5 -6
  323. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
  324. package/dist/components/Employee/Profile/Actions.js +9 -7
  325. package/dist/components/Employee/Profile/Actions.js.map +1 -1
  326. package/dist/components/Employee/Profile/AdminPersonalDetails.d.ts +6 -6
  327. package/dist/components/Employee/Profile/AdminPersonalDetails.js +10 -8
  328. package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
  329. package/dist/components/Employee/Profile/HomeAddress.js +9 -8
  330. package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
  331. package/dist/components/Employee/Profile/PersonalDetailsInputs.d.ts +2 -2
  332. package/dist/components/Employee/Profile/PersonalDetailsInputs.js +26 -23
  333. package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
  334. package/dist/components/Employee/Profile/useProfile.js +3 -4
  335. package/dist/components/Employee/Profile/useProfile.js.map +1 -1
  336. package/dist/components/Employee/StateTaxes/Actions.js +10 -8
  337. package/dist/components/Employee/StateTaxes/Actions.js.map +1 -1
  338. package/dist/components/Employee/StateTaxes/useStateTaxes.js +3 -4
  339. package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
  340. package/dist/components/Employee/Taxes/Actions.js +10 -8
  341. package/dist/components/Employee/Taxes/Actions.js.map +1 -1
  342. package/dist/components/Employee/Taxes/FederalForm.d.ts +22 -7
  343. package/dist/components/Employee/Taxes/FederalForm.js +85 -29
  344. package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
  345. package/dist/components/Employee/Taxes/Taxes.js +97 -81
  346. package/dist/components/Employee/Taxes/Taxes.js.map +1 -1
  347. package/dist/components/Employee/Taxes/useTaxes.js +3 -4
  348. package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
  349. package/dist/components/Flow/Flow.js +14 -13
  350. package/dist/components/Flow/Flow.js.map +1 -1
  351. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.d.ts +1 -1
  352. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js +63 -34
  353. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js.map +1 -1
  354. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.module.scss.js +8 -0
  355. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.module.scss.js.map +1 -0
  356. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.d.ts +2 -0
  357. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.js +71 -54
  358. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.js.map +1 -1
  359. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsComponents.d.ts +23 -0
  360. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsComponents.js +27 -15
  361. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsComponents.js.map +1 -1
  362. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.d.ts +25 -2
  363. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +152 -23
  364. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js.map +1 -1
  365. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.module.scss.js +10 -0
  366. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.module.scss.js.map +1 -0
  367. package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.d.ts +9 -1
  368. package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.js +194 -22
  369. package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.js.map +1 -1
  370. package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.module.scss.js +18 -0
  371. package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.module.scss.js.map +1 -0
  372. package/dist/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.d.ts +10 -2
  373. package/dist/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.js +44 -30
  374. package/dist/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.js.map +1 -1
  375. package/dist/components/Payroll/ConfirmWireDetails/index.d.ts +1 -0
  376. package/dist/components/Payroll/ConfirmWireDetails/types.d.ts +5 -0
  377. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +3 -2
  378. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
  379. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +7 -6
  380. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js.map +1 -1
  381. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +15 -15
  382. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
  383. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.d.ts +1 -0
  384. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js.map +1 -1
  385. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js +32 -40
  386. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js.map +1 -1
  387. package/dist/components/Payroll/PayrollHistory/PayrollHistory.d.ts +0 -12
  388. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js +44 -52
  389. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js.map +1 -1
  390. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.d.ts +9 -6
  391. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +104 -101
  392. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
  393. package/dist/components/Payroll/PayrollList/PayrollList.js +58 -59
  394. package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
  395. package/dist/components/Payroll/PayrollList/PayrollListPresentation.d.ts +4 -6
  396. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +77 -69
  397. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
  398. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +127 -103
  399. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
  400. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +254 -185
  401. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
  402. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchThresholdExceeded.js +3 -2
  403. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchThresholdExceeded.js.map +1 -1
  404. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.module.scss.js +1 -1
  405. package/dist/components/Payroll/PayrollStatusBadges/PayrollStatusBadges.d.ts +7 -0
  406. package/dist/components/Payroll/PayrollStatusBadges/PayrollStatusBadges.js +19 -0
  407. package/dist/components/Payroll/PayrollStatusBadges/PayrollStatusBadges.js.map +1 -0
  408. package/dist/components/Payroll/PayrollStatusBadges/PayrollStatusBadges.module.scss.js +10 -0
  409. package/dist/components/Payroll/PayrollStatusBadges/PayrollStatusBadges.module.scss.js.map +1 -0
  410. package/dist/components/Payroll/PayrollStatusBadges/index.d.ts +4 -0
  411. package/dist/components/Payroll/PayrollStatusBadges/payrollStatusConfig.d.ts +33 -0
  412. package/dist/components/Payroll/PayrollStatusBadges/payrollStatusConfig.js +161 -0
  413. package/dist/components/Payroll/PayrollStatusBadges/payrollStatusConfig.js.map +1 -0
  414. package/dist/components/Payroll/PayrollStatusBadges/usePayrollStatusBadges.d.ts +3 -0
  415. package/dist/components/Payroll/PayrollStatusBadges/usePayrollStatusBadges.js +17 -0
  416. package/dist/components/Payroll/PayrollStatusBadges/usePayrollStatusBadges.js.map +1 -0
  417. package/dist/components/Payroll/PayrollStatusBadges/usePayrollStatusBadges.test.d.ts +1 -0
  418. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfiguration.d.ts +6 -0
  419. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfiguration.js +70 -0
  420. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfiguration.js.map +1 -0
  421. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationContext.d.ts +7 -0
  422. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationContext.js +6 -0
  423. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationContext.js.map +1 -0
  424. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationProvider.d.ts +9 -0
  425. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationProvider.js +40 -0
  426. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationProvider.js.map +1 -0
  427. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/index.d.ts +5 -0
  428. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/usePayrollConfiguration.d.ts +2 -0
  429. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/usePayrollConfiguration.js +12 -0
  430. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/usePayrollConfiguration.js.map +1 -0
  431. package/dist/components/Payroll/UNSTABLE_PayrollHooks/index.d.ts +2 -0
  432. package/dist/components/Payroll/helpers.d.ts +0 -5
  433. package/dist/components/Payroll/helpers.js +106 -112
  434. package/dist/components/Payroll/helpers.js.map +1 -1
  435. package/dist/components/Payroll/usePreparedPayrollData.js +5 -6
  436. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  437. package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js +48 -46
  438. package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js.map +1 -1
  439. package/dist/contexts/ComponentAdapter/useComponentContext.d.ts +2 -0
  440. package/dist/contexts/ComponentAdapter/useComponentContext.js +3 -3
  441. package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
  442. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +7 -5
  443. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  444. package/dist/helpers/dateFormatting.d.ts +9 -0
  445. package/dist/helpers/dateFormatting.js +65 -52
  446. package/dist/helpers/dateFormatting.js.map +1 -1
  447. package/dist/i18n/I18n.js +3 -3
  448. package/dist/i18n/I18n.js.map +1 -1
  449. package/dist/i18n/en/Contractor.Payments.CreatePayment.json.js +34 -0
  450. package/dist/i18n/en/Contractor.Payments.CreatePayment.json.js.map +1 -0
  451. package/dist/i18n/en/Contractor.Payments.EditPayment.json.js +36 -0
  452. package/dist/i18n/en/Contractor.Payments.EditPayment.json.js.map +1 -0
  453. package/dist/i18n/en/Contractor.Payments.Overview.json.js +34 -0
  454. package/dist/i18n/en/Contractor.Payments.Overview.json.js.map +1 -0
  455. package/dist/i18n/en/Contractor.Payments.PaymentsList.json.js +34 -0
  456. package/dist/i18n/en/Contractor.Payments.PaymentsList.json.js.map +1 -0
  457. package/dist/i18n/en/ContractorPayment.ContractorPaymentDetail.json.js +24 -0
  458. package/dist/i18n/en/ContractorPayment.ContractorPaymentDetail.json.js.map +1 -0
  459. package/dist/i18n/en/Employee.Deductions.json.js +58 -46
  460. package/dist/i18n/en/Employee.Deductions.json.js.map +1 -1
  461. package/dist/i18n/en/Employee.FederalTaxes.json.js +49 -41
  462. package/dist/i18n/en/Employee.FederalTaxes.json.js.map +1 -1
  463. package/dist/i18n/en/Employee.Taxes.json.js +53 -45
  464. package/dist/i18n/en/Employee.Taxes.json.js.map +1 -1
  465. package/dist/i18n/en/Payroll.Common.json.js +8 -0
  466. package/dist/i18n/en/Payroll.Common.json.js.map +1 -0
  467. package/dist/i18n/en/Payroll.ConfirmWireDetailsForm.json.js +25 -5
  468. package/dist/i18n/en/Payroll.ConfirmWireDetailsForm.json.js.map +1 -1
  469. package/dist/i18n/en/Payroll.PayrollList.json.js +14 -16
  470. package/dist/i18n/en/Payroll.PayrollList.json.js.map +1 -1
  471. package/dist/i18n/en/Payroll.PayrollOverview.json.js +34 -30
  472. package/dist/i18n/en/Payroll.PayrollOverview.json.js.map +1 -1
  473. package/dist/i18n/en/Payroll.WireInstructions.json.js +22 -6
  474. package/dist/i18n/en/Payroll.WireInstructions.json.js.map +1 -1
  475. package/dist/shared/constants.d.ts +18 -0
  476. package/dist/shared/constants.js +66 -55
  477. package/dist/shared/constants.js.map +1 -1
  478. package/dist/style.css +1 -1
  479. package/dist/types/i18next.d.ts +236 -15
  480. package/package.json +19 -15
  481. package/dist/components/Employee/Deductions/DeductionsForm/UNSTABLE_DeductionsForm.d.ts +0 -7
  482. package/dist/components/Employee/Deductions/EmptyState/EmptyState.d.ts +0 -6
  483. package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.d.ts +0 -15
  484. package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.js +0 -49
  485. package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Submit.js","sources":["../../../../src/components/Contractor/Submit/Submit.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useContractorsUpdateOnboardingStatusMutation } from '@gusto/embedded-api/react-query/contractorsUpdateOnboardingStatus'\nimport { useContractorsGetOnboardingStatusSuspense } from '@gusto/embedded-api/react-query/contractorsGetOnboardingStatus'\nimport { useContractorsGetSuspense } from '@gusto/embedded-api/react-query/contractorsGet'\nimport { SubmitDone } from './SubmitDone'\nimport { Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\nimport {\n BaseComponent,\n useBase,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { componentEvents, ContractorOnboardingStatus } from '@/shared/constants'\nimport { firstLastName } from '@/helpers/formattedStrings'\n\nexport interface ContractorSubmitProps\n extends CommonComponentInterface<'Contractor.ContractorList'> {\n contractorId: string\n selfOnboarding?: boolean\n}\n\nexport function ContractorSubmit(props: ContractorSubmitProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nexport const Root = ({ contractorId, selfOnboarding }: ContractorSubmitProps) => {\n useI18n('Contractor.Submit')\n const { Alert, Button, UnorderedList } = useComponentContext()\n const { t } = useTranslation('Contractor.Submit')\n const { onEvent, baseSubmitHandler } = useBase()\n const items = Object.values(t('warningItems', { returnObjects: true }))\n\n const { data } = useContractorsGetOnboardingStatusSuspense({\n contractorUuid: contractorId,\n })\n const onboardingStatus = data.contractorOnboardingStatus?.onboardingStatus\n\n const { mutateAsync } = useContractorsUpdateOnboardingStatusMutation()\n\n const onSubmit = async () => {\n await baseSubmitHandler(null, async () => {\n const response = await mutateAsync({\n request: {\n contractorUuid: contractorId,\n requestBody: { onboardingStatus: ContractorOnboardingStatus.ONBOARDING_COMPLETED },\n },\n })\n onEvent(\n componentEvents.CONTRACTOR_ONBOARDING_STATUS_UPDATED,\n response.contractorOnboardingStatus,\n )\n onEvent(componentEvents.CONTRACTOR_SUBMIT_DONE, { message: t('submitDone.successMessage') })\n })\n }\n const handleInviteContractor = () => {\n onEvent(componentEvents.CONTRACTOR_INVITE_CONTRACTOR, { contractorId })\n onEvent(componentEvents.CONTRACTOR_SUBMIT_DONE, {\n message: t('inviteContractor.successMessage'),\n })\n }\n\n const handleSubmitDone = () => {\n onEvent(componentEvents.CONTRACTOR_SUBMIT_DONE, {\n onboardingStatus,\n message: t('submitDone.successMessage'),\n })\n }\n\n if (onboardingStatus === ContractorOnboardingStatus.ONBOARDING_COMPLETED) {\n return <SubmitDone onDone={handleSubmitDone} />\n }\n if (\n onboardingStatus === ContractorOnboardingStatus.SELF_ONBOARDING_NOT_INVITED &&\n selfOnboarding\n ) {\n return <InviteContractor onSubmit={handleInviteContractor} contractorId={contractorId} />\n }\n\n return (\n <>\n <Alert label={t('title')} status=\"warning\">\n <UnorderedList items={items} />\n </Alert>\n <Flex flexDirection=\"column\" alignItems=\"flex-end\">\n <Button title={t('submitCta')} onClick={onSubmit}>\n {t('submitCta')}\n </Button>\n </Flex>\n </>\n )\n}\n\nconst InviteContractor = ({\n onSubmit,\n contractorId,\n}: {\n onSubmit: () => void\n contractorId: string\n}) => {\n const { t } = useTranslation('Contractor.Submit', { keyPrefix: 'inviteContractor' })\n const { Button, Heading, Text } = useComponentContext()\n\n const { data: contractorData } = useContractorsGetSuspense({ contractorUuid: contractorId })\n const contractor = contractorData.contractor\n\n return (\n <Flex flexDirection=\"column\">\n <Heading as=\"h2\">{t('title')}</Heading>\n <Text>{t('description')}</Text>\n <Flex flexDirection=\"column\">\n <div>\n <Text>\n {firstLastName({\n first_name: contractor?.firstName,\n last_name: contractor?.lastName,\n })}\n </Text>\n <Text>{contractor?.email}</Text>\n </div>\n <div>\n <Text>{t('startDateLabel')}</Text>\n <Text>{contractor?.startDate}</Text>\n </div>\n </Flex>\n <Button title={t('inviteCta')} onClick={onSubmit}>\n {t('inviteCta')}\n </Button>\n </Flex>\n )\n}\n"],"names":["ContractorSubmit","props","jsx","BaseComponent","Root","contractorId","selfOnboarding","useI18n","Alert","Button","UnorderedList","useComponentContext","t","useTranslation","onEvent","baseSubmitHandler","useBase","items","data","useContractorsGetOnboardingStatusSuspense","onboardingStatus","mutateAsync","useContractorsUpdateOnboardingStatusMutation","onSubmit","response","ContractorOnboardingStatus","componentEvents","handleInviteContractor","handleSubmitDone","SubmitDone","InviteContractor","jsx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AAA,CAAE;AAAA,IACxB,gBAAAmB,EAACE,GAAA,EAAK,eAAc,UAClB,UAAA;AAAA,MAAA,gBAAAF,EAAC,OAAA,EACC,UAAA;AAAA,QAAA,gBAAA7B,EAACiC,KACE,UAAAI,EAAc;AAAA,UACb,YAAYD,GAAY;AAAA,UACxB,WAAWA,GAAY;AAAA,QAAA,CACxB,GACH;AAAA,QACA,gBAAApC,EAACiC,GAAA,EAAM,UAAAG,GAAY,MAAA,CAAM;AAAA,MAAA,GAC3B;AAAA,wBACC,OAAA,EACC,UAAA;AAAA,QAAA,gBAAApC,EAACiC,GAAA,EAAM,UAAAvB,EAAE,gBAAgB,EAAA,CAAE;AAAA,QAC3B,gBAAAV,EAACiC,GAAA,EAAM,UAAAG,GAAY,UAAA,CAAU;AAAA,MAAA,EAAA,CAC/B;AAAA,IAAA,GACF;AAAA,IACA,gBAAApC,EAACO,GAAA,EAAO,OAAOG,EAAE,WAAW,GAAG,SAASW,GACrC,UAAAX,EAAE,WAAW,EAAA,CAChB;AAAA,EAAA,GACF;AAEJ;"}
1
+ {"version":3,"file":"Submit.js","sources":["../../../../src/components/Contractor/Submit/Submit.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useContractorsUpdateOnboardingStatusMutation } from '@gusto/embedded-api/react-query/contractorsUpdateOnboardingStatus'\nimport { useContractorsGetOnboardingStatusSuspense } from '@gusto/embedded-api/react-query/contractorsGetOnboardingStatus'\nimport { useContractorsGetSuspense } from '@gusto/embedded-api/react-query/contractorsGet'\nimport { SubmitDone } from './SubmitDone'\nimport { Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\nimport {\n BaseComponent,\n useBase,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { componentEvents, ContractorOnboardingStatus } from '@/shared/constants'\nimport { firstLastName } from '@/helpers/formattedStrings'\n\nexport interface ContractorSubmitProps extends CommonComponentInterface<'Contractor.ContractorList'> {\n contractorId: string\n selfOnboarding?: boolean\n}\n\nexport function ContractorSubmit(props: ContractorSubmitProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nexport const Root = ({ contractorId, selfOnboarding }: ContractorSubmitProps) => {\n useI18n('Contractor.Submit')\n const { Alert, Button, UnorderedList } = useComponentContext()\n const { t } = useTranslation('Contractor.Submit')\n const { onEvent, baseSubmitHandler } = useBase()\n const items = Object.values(t('warningItems', { returnObjects: true }))\n\n const { data } = useContractorsGetOnboardingStatusSuspense({\n contractorUuid: contractorId,\n })\n const onboardingStatus = data.contractorOnboardingStatus?.onboardingStatus\n\n const { mutateAsync } = useContractorsUpdateOnboardingStatusMutation()\n\n const onSubmit = async () => {\n await baseSubmitHandler(null, async () => {\n const response = await mutateAsync({\n request: {\n contractorUuid: contractorId,\n requestBody: { onboardingStatus: ContractorOnboardingStatus.ONBOARDING_COMPLETED },\n },\n })\n onEvent(\n componentEvents.CONTRACTOR_ONBOARDING_STATUS_UPDATED,\n response.contractorOnboardingStatus,\n )\n onEvent(componentEvents.CONTRACTOR_SUBMIT_DONE, { message: t('submitDone.successMessage') })\n })\n }\n const handleInviteContractor = () => {\n onEvent(componentEvents.CONTRACTOR_INVITE_CONTRACTOR, { contractorId })\n onEvent(componentEvents.CONTRACTOR_SUBMIT_DONE, {\n message: t('inviteContractor.successMessage'),\n })\n }\n\n const handleSubmitDone = () => {\n onEvent(componentEvents.CONTRACTOR_SUBMIT_DONE, {\n onboardingStatus,\n message: t('submitDone.successMessage'),\n })\n }\n\n if (onboardingStatus === ContractorOnboardingStatus.ONBOARDING_COMPLETED) {\n return <SubmitDone onDone={handleSubmitDone} />\n }\n if (\n onboardingStatus === ContractorOnboardingStatus.SELF_ONBOARDING_NOT_INVITED &&\n selfOnboarding\n ) {\n return <InviteContractor onSubmit={handleInviteContractor} contractorId={contractorId} />\n }\n\n return (\n <>\n <Alert label={t('title')} status=\"warning\">\n <UnorderedList items={items} />\n </Alert>\n <Flex flexDirection=\"column\" alignItems=\"flex-end\">\n <Button title={t('submitCta')} onClick={onSubmit}>\n {t('submitCta')}\n </Button>\n </Flex>\n </>\n )\n}\n\nconst InviteContractor = ({\n onSubmit,\n contractorId,\n}: {\n onSubmit: () => void\n contractorId: string\n}) => {\n const { t } = useTranslation('Contractor.Submit', { keyPrefix: 'inviteContractor' })\n const { Button, Heading, Text } = useComponentContext()\n\n const { data: contractorData } = useContractorsGetSuspense({ contractorUuid: contractorId })\n const contractor = contractorData.contractor\n\n return (\n <Flex flexDirection=\"column\">\n <Heading as=\"h2\">{t('title')}</Heading>\n <Text>{t('description')}</Text>\n <Flex flexDirection=\"column\">\n <div>\n <Text>\n {firstLastName({\n first_name: contractor?.firstName,\n last_name: contractor?.lastName,\n })}\n </Text>\n <Text>{contractor?.email}</Text>\n </div>\n <div>\n <Text>{t('startDateLabel')}</Text>\n <Text>{contractor?.startDate}</Text>\n </div>\n </Flex>\n <Button title={t('inviteCta')} onClick={onSubmit}>\n {t('inviteCta')}\n </Button>\n </Flex>\n )\n}\n"],"names":["ContractorSubmit","props","jsx","BaseComponent","Root","contractorId","selfOnboarding","useI18n","Alert","Button","UnorderedList","useComponentContext","t","useTranslation","onEvent","baseSubmitHandler","useBase","items","data","useContractorsGetOnboardingStatusSuspense","onboardingStatus","mutateAsync","useContractorsUpdateOnboardingStatusMutation","onSubmit","response","ContractorOnboardingStatus","componentEvents","handleInviteContractor","handleSubmitDone","SubmitDone","InviteContractor","jsxs","Fragment","Flex","Heading","Text","contractorData","useContractorsGetSuspense","contractor","firstLastName"],"mappings":";;;;;;;;;;;;;;;AAsBO,SAASA,EAAiBC,GAAuD;AACtF,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEO,MAAMG,IAAO,CAAC,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,UAAAG,GAAY,MAAA,CAAM;AAAA,MAAA,GAC3B;AAAA,wBACC,OAAA,EACC,UAAA;AAAA,QAAA,gBAAApC,EAACiC,GAAA,EAAM,UAAAvB,EAAE,gBAAgB,EAAA,CAAE;AAAA,QAC3B,gBAAAV,EAACiC,GAAA,EAAM,UAAAG,GAAY,UAAA,CAAU;AAAA,MAAA,EAAA,CAC/B;AAAA,IAAA,GACF;AAAA,IACA,gBAAApC,EAACO,GAAA,EAAO,OAAOG,EAAE,WAAW,GAAG,SAASW,GACrC,UAAAX,EAAE,WAAW,EAAA,CAChB;AAAA,EAAA,GACF;AAEJ;"}
@@ -6,3 +6,4 @@ export { NewHireReport } from './NewHireReport/NewHireReport';
6
6
  export { ContractorSubmit } from './Submit/Submit';
7
7
  export { ContractorProfile } from './Profile';
8
8
  export { OnboardingFlow } from './OnboardingFlow/OnboardingFlow';
9
+ export { PaymentFlow } from './Payments/PaymentFlow';
@@ -4,14 +4,16 @@ import { NewHireReport as p } from "./NewHireReport/NewHireReport.js";
4
4
  import { ContractorSubmit as n } from "./Submit/Submit.js";
5
5
  import { OnboardingFlow as i } from "./OnboardingFlow/OnboardingFlow.js";
6
6
  import { Address as c } from "./Address/Address.js";
7
- import { ContractorProfile as C } from "./Profile/ContractorProfile.js";
7
+ import { ContractorProfile as s } from "./Profile/ContractorProfile.js";
8
+ import { PaymentFlow as C } from "./Payments/PaymentFlow/PaymentFlow.js";
8
9
  export {
9
10
  c as Address,
10
11
  m as ContractorList,
11
- C as ContractorProfile,
12
+ s as ContractorProfile,
12
13
  n as ContractorSubmit,
13
14
  p as NewHireReport,
14
15
  i as OnboardingFlow,
16
+ C as PaymentFlow,
15
17
  t as PaymentMethod
16
18
  };
17
19
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
@@ -1,16 +1,17 @@
1
- import { jsxs as A, jsx as i } from "react/jsx-runtime";
1
+ import { jsxs as A, jsx as e } from "react/jsx-runtime";
2
2
  import { useFormContext as l, useWatch as d } from "react-hook-form";
3
3
  import { useTranslation as T } from "react-i18next";
4
4
  import { useCompensation as O } from "./useCompensation.js";
5
- import "classnames";
6
- import { ActionsLayout as u } from "../../Common/ActionsLayout/ActionsLayout.js";
7
5
  import { FlsaStatus as a } from "../../../shared/constants.js";
8
- import { useComponentContext as C } from "../../../contexts/ComponentAdapter/useComponentContext.js";
9
- const h = () => {
10
- const { isPending: s, mode: t, submitWithEffect: o, handleAdd: D, handleCancelAddJob: m, primaryFlsaStatus: r } = O(), { t: n } = T("Employee.Compensation"), { control: I } = l(), c = d({ control: I, name: "flsaStatus" }), e = C();
11
- return /* @__PURE__ */ A(u, { children: [
12
- r === a.NONEXEMPT && t === "LIST" && /* @__PURE__ */ i(
13
- e.Button,
6
+ import "classnames";
7
+ import { ActionsLayout as p } from "../../Common/ActionsLayout/ActionsLayout.js";
8
+ import { useComponentContext as u } from "../../../contexts/ComponentAdapter/useComponentContext.js";
9
+ import "react";
10
+ const b = () => {
11
+ const { isPending: s, mode: t, submitWithEffect: o, handleAdd: D, handleCancelAddJob: m, primaryFlsaStatus: r } = O(), { t: n } = T("Employee.Compensation"), { control: I } = l(), c = d({ control: I, name: "flsaStatus" }), i = u();
12
+ return /* @__PURE__ */ A(p, { children: [
13
+ r === a.NONEXEMPT && t === "LIST" && /* @__PURE__ */ e(
14
+ i.Button,
14
15
  {
15
16
  variant: "secondary",
16
17
  onClick: () => {
@@ -20,9 +21,9 @@ const h = () => {
20
21
  children: n("addAnotherJobCta")
21
22
  }
22
23
  ),
23
- (r === a.NONEXEMPT && t === "ADD_ADDITIONAL_JOB" || t === "EDIT_ADDITIONAL_JOB") && /* @__PURE__ */ i(e.Button, { variant: "secondary", onClick: m, isDisabled: s, children: n("cancelNewJobCta") }),
24
- /* @__PURE__ */ i(
25
- e.Button,
24
+ (r === a.NONEXEMPT && t === "ADD_ADDITIONAL_JOB" || t === "EDIT_ADDITIONAL_JOB") && /* @__PURE__ */ e(i.Button, { variant: "secondary", onClick: m, isDisabled: s, children: n("cancelNewJobCta") }),
25
+ /* @__PURE__ */ e(
26
+ i.Button,
26
27
  {
27
28
  onClick: () => {
28
29
  t === "LIST" && o("PROCEED"), (t === "ADD_ADDITIONAL_JOB" || t === "EDIT_ADDITIONAL_JOB") && o("LIST"), (t === "ADD_INITIAL_JOB" || t === "EDIT_INITIAL_JOB") && (c === a.NONEXEMPT ? o("LIST") : o("PROCEED"));
@@ -34,6 +35,6 @@ const h = () => {
34
35
  ] });
35
36
  };
36
37
  export {
37
- h as Actions
38
+ b as Actions
38
39
  };
39
40
  //# sourceMappingURL=Actions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Actions.js","sources":["../../../../src/components/Employee/Compensation/Actions.tsx"],"sourcesContent":["import { useFormContext, useWatch } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport { useCompensation, type CompensationInputs } from './useCompensation'\nimport { ActionsLayout } from '@/components/Common'\nimport { FlsaStatus } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { isPending, mode, submitWithEffect, handleAdd, handleCancelAddJob, primaryFlsaStatus } =\n useCompensation()\n const { t } = useTranslation('Employee.Compensation')\n const { control } = useFormContext<CompensationInputs>()\n const watchedFlsaStatus = useWatch({ control, name: 'flsaStatus' })\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n {primaryFlsaStatus === FlsaStatus.NONEXEMPT && mode === 'LIST' && (\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n handleAdd()\n }}\n isDisabled={isPending}\n >\n {t('addAnotherJobCta')}\n </Components.Button>\n )}\n {((primaryFlsaStatus === FlsaStatus.NONEXEMPT && mode === 'ADD_ADDITIONAL_JOB') ||\n mode === 'EDIT_ADDITIONAL_JOB') && (\n <Components.Button variant=\"secondary\" onClick={handleCancelAddJob} isDisabled={isPending}>\n {t('cancelNewJobCta')}\n </Components.Button>\n )}\n <Components.Button\n onClick={() => {\n if (mode === 'LIST') {\n submitWithEffect('PROCEED')\n }\n\n if (mode === 'ADD_ADDITIONAL_JOB' || mode === 'EDIT_ADDITIONAL_JOB') {\n submitWithEffect('LIST')\n }\n\n if (mode === 'ADD_INITIAL_JOB' || mode === 'EDIT_INITIAL_JOB') {\n if (watchedFlsaStatus === FlsaStatus.NONEXEMPT) {\n submitWithEffect('LIST')\n } else {\n submitWithEffect('PROCEED')\n }\n }\n }}\n isLoading={isPending}\n >\n {mode === 'EDIT_ADDITIONAL_JOB' || mode === 'ADD_ADDITIONAL_JOB'\n ? t('saveNewJobCta')\n : t('submitCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","isPending","mode","submitWithEffect","handleAdd","handleCancelAddJob","primaryFlsaStatus","useCompensation","t","useTranslation","control","useFormContext","watchedFlsaStatus","useWatch","Components","useComponentContext","ActionsLayout","FlsaStatus","jsx"],"mappings":";;;;;;;;AAOO,MAAMA,IAAU,MAAM;AAC3B,QAAM,EAAE,WAAAC,GAAW,MAAAC,GAAM,kBAAAC,GAAkB,WAAAC,GAAW,oBAAAC,GAAoB,mBAAAC,EAAA,IACxEC,EAAA,GACI,EAAE,GAAAC,EAAA,IAAMC,EAAe,uBAAuB,GAC9C,EAAE,SAAAC,EAAA,IAAYC,EAAA,GACdC,IAAoBC,EAAS,EAAE,SAAAH,GAAS,MAAM,cAAc,GAC5DI,IAAaC,EAAA;AAEnB,2BACGC,GAAA,EACE,UAAA;AAAA,IAAAV,MAAsBW,EAAW,aAAaf,MAAS,UACtD,gBAAAgB;AAAA,MAACJ,EAAW;AAAA,MAAX;AAAA,QACC,SAAQ;AAAA,QACR,SAAS,MAAM;AACb,UAAAV,EAAA;AAAA,QACF;AAAA,QACA,YAAYH;AAAA,QAEX,YAAE,kBAAkB;AAAA,MAAA;AAAA,IAAA;AAAA,KAGtBK,MAAsBW,EAAW,aAAaf,MAAS,wBACxDA,MAAS,0BACT,gBAAAgB,EAACJ,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAAST,GAAoB,YAAYJ,GAC7E,UAAAO,EAAE,iBAAiB,GACtB;AAAA,IAEF,gBAAAU;AAAA,MAACJ,EAAW;AAAA,MAAX;AAAA,QACC,SAAS,MAAM;AACb,UAAIZ,MAAS,UACXC,EAAiB,SAAS,IAGxBD,MAAS,wBAAwBA,MAAS,0BAC5CC,EAAiB,MAAM,IAGrBD,MAAS,qBAAqBA,MAAS,wBACrCU,MAAsBK,EAAW,YACnCd,EAAiB,MAAM,IAEvBA,EAAiB,SAAS;AAAA,QAGhC;AAAA,QACA,WAAWF;AAAA,QAEV,UACGO,EADHN,MAAS,yBAAyBA,MAAS,uBACtC,kBACA,WADe;AAAA,MACJ;AAAA,IAAA;AAAA,EACnB,GACF;AAEJ;"}
1
+ {"version":3,"file":"Actions.js","sources":["../../../../src/components/Employee/Compensation/Actions.tsx"],"sourcesContent":["import { useFormContext, useWatch } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport { useCompensation, type CompensationInputs } from './useCompensation'\nimport { ActionsLayout } from '@/components/Common'\nimport { FlsaStatus } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { isPending, mode, submitWithEffect, handleAdd, handleCancelAddJob, primaryFlsaStatus } =\n useCompensation()\n const { t } = useTranslation('Employee.Compensation')\n const { control } = useFormContext<CompensationInputs>()\n const watchedFlsaStatus = useWatch({ control, name: 'flsaStatus' })\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n {primaryFlsaStatus === FlsaStatus.NONEXEMPT && mode === 'LIST' && (\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n handleAdd()\n }}\n isDisabled={isPending}\n >\n {t('addAnotherJobCta')}\n </Components.Button>\n )}\n {((primaryFlsaStatus === FlsaStatus.NONEXEMPT && mode === 'ADD_ADDITIONAL_JOB') ||\n mode === 'EDIT_ADDITIONAL_JOB') && (\n <Components.Button variant=\"secondary\" onClick={handleCancelAddJob} isDisabled={isPending}>\n {t('cancelNewJobCta')}\n </Components.Button>\n )}\n <Components.Button\n onClick={() => {\n if (mode === 'LIST') {\n submitWithEffect('PROCEED')\n }\n\n if (mode === 'ADD_ADDITIONAL_JOB' || mode === 'EDIT_ADDITIONAL_JOB') {\n submitWithEffect('LIST')\n }\n\n if (mode === 'ADD_INITIAL_JOB' || mode === 'EDIT_INITIAL_JOB') {\n if (watchedFlsaStatus === FlsaStatus.NONEXEMPT) {\n submitWithEffect('LIST')\n } else {\n submitWithEffect('PROCEED')\n }\n }\n }}\n isLoading={isPending}\n >\n {mode === 'EDIT_ADDITIONAL_JOB' || mode === 'ADD_ADDITIONAL_JOB'\n ? t('saveNewJobCta')\n : t('submitCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","isPending","mode","submitWithEffect","handleAdd","handleCancelAddJob","primaryFlsaStatus","useCompensation","t","useTranslation","control","useFormContext","watchedFlsaStatus","useWatch","Components","useComponentContext","ActionsLayout","FlsaStatus","jsx"],"mappings":";;;;;;;;;AAOO,MAAMA,IAAU,MAAM;AAC3B,QAAM,EAAE,WAAAC,GAAW,MAAAC,GAAM,kBAAAC,GAAkB,WAAAC,GAAW,oBAAAC,GAAoB,mBAAAC,EAAA,IACxEC,EAAA,GACI,EAAE,GAAAC,EAAA,IAAMC,EAAe,uBAAuB,GAC9C,EAAE,SAAAC,EAAA,IAAYC,EAAA,GACdC,IAAoBC,EAAS,EAAE,SAAAH,GAAS,MAAM,cAAc,GAC5DI,IAAaC,EAAA;AAEnB,2BACGC,GAAA,EACE,UAAA;AAAA,IAAAV,MAAsBW,EAAW,aAAaf,MAAS,UACtD,gBAAAgB;AAAA,MAACJ,EAAW;AAAA,MAAX;AAAA,QACC,SAAQ;AAAA,QACR,SAAS,MAAM;AACb,UAAAV,EAAA;AAAA,QACF;AAAA,QACA,YAAYH;AAAA,QAEX,YAAE,kBAAkB;AAAA,MAAA;AAAA,IAAA;AAAA,KAGtBK,MAAsBW,EAAW,aAAaf,MAAS,wBACxDA,MAAS,0BACT,gBAAAgB,EAACJ,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAAST,GAAoB,YAAYJ,GAC7E,UAAAO,EAAE,iBAAiB,GACtB;AAAA,IAEF,gBAAAU;AAAA,MAACJ,EAAW;AAAA,MAAX;AAAA,QACC,SAAS,MAAM;AACb,UAAIZ,MAAS,UACXC,EAAiB,SAAS,IAGxBD,MAAS,wBAAwBA,MAAS,0BAC5CC,EAAiB,MAAM,IAGrBD,MAAS,qBAAqBA,MAAS,wBACrCU,MAAsBK,EAAW,YACnCd,EAAiB,MAAM,IAEvBA,EAAiB,SAAS;AAAA,QAGhC;AAAA,QACA,WAAWF;AAAA,QAEV,UACGO,EADHN,MAAS,yBAAyBA,MAAS,uBACtC,kBACA,WADe;AAAA,MACJ;AAAA,IAAA;AAAA,EACnB,GACF;AAEJ;"}
@@ -3,58 +3,59 @@ import { useTranslation as p } from "react-i18next";
3
3
  import { useCompensation as d } from "./useCompensation.js";
4
4
  import C from "../../../assets/icons/pencil.svg.js";
5
5
  import c from "../../../assets/icons/trashcan.svg.js";
6
+ import "../../../shared/constants.js";
6
7
  import "classnames";
7
8
  import { HamburgerMenu as f } from "../../Common/HamburgerMenu/HamburgerMenu.js";
8
9
  import { useDataView as y } from "../../Common/DataView/useDataView.js";
9
10
  import { DataView as g } from "../../Common/DataView/DataView.js";
10
- const P = () => {
11
- const { employeeJobs: i, mode: o, isPending: r, handleEdit: l, handleDelete: s } = d(), { t } = p("Employee.Compensation"), { ...m } = y({
11
+ const U = () => {
12
+ const { employeeJobs: i, mode: o, isPending: r, handleEdit: l, handleDelete: s } = d(), { t: e } = p("Employee.Compensation"), { ...m } = y({
12
13
  data: i,
13
14
  columns: [
14
15
  {
15
16
  key: "title",
16
- title: t("allCompensations.jobColumn"),
17
- render: (e) => e.title || ""
17
+ title: e("allCompensations.jobColumn"),
18
+ render: (t) => t.title || ""
18
19
  },
19
20
  {
20
21
  key: "flsaStatus",
21
- title: t("allCompensations.typeColumn"),
22
- render: (e) => {
23
- const n = e.compensations?.find(
24
- (u) => u.uuid === e.currentCompensationUuid
22
+ title: e("allCompensations.typeColumn"),
23
+ render: (t) => {
24
+ const n = t.compensations?.find(
25
+ (u) => u.uuid === t.currentCompensationUuid
25
26
  )?.flsaStatus;
26
- return n !== void 0 ? t(`flsaStatusLabels.${n}`) : null;
27
+ return n !== void 0 ? e(`flsaStatusLabels.${n}`) : null;
27
28
  }
28
29
  },
29
30
  {
30
31
  key: "rate",
31
- title: t("allCompensations.amountColumn"),
32
- render: (e) => e.rate?.toString() || ""
32
+ title: e("allCompensations.amountColumn"),
33
+ render: (t) => t.rate?.toString() || ""
33
34
  },
34
35
  {
35
36
  key: "paymentUnit",
36
- title: t("allCompensations.perColumn"),
37
- render: (e) => e.paymentUnit || ""
37
+ title: e("allCompensations.perColumn"),
38
+ render: (t) => t.paymentUnit || ""
38
39
  }
39
40
  ],
40
- itemMenu: (e) => /* @__PURE__ */ a(
41
+ itemMenu: (t) => /* @__PURE__ */ a(
41
42
  f,
42
43
  {
43
- triggerLabel: t("hamburgerTitle"),
44
+ triggerLabel: e("hamburgerTitle"),
44
45
  items: [
45
46
  {
46
- label: t("allCompensations.editCta"),
47
+ label: e("allCompensations.editCta"),
47
48
  icon: /* @__PURE__ */ a(C, { "aria-hidden": !0 }),
48
49
  onClick: () => {
49
- l(e.uuid);
50
+ l(t.uuid);
50
51
  }
51
52
  },
52
- ...e.primary ? [] : [
53
+ ...t.primary ? [] : [
53
54
  {
54
- label: t("allCompensations.deleteCta"),
55
+ label: e("allCompensations.deleteCta"),
55
56
  icon: /* @__PURE__ */ a(c, { "aria-hidden": !0 }),
56
57
  onClick: () => {
57
- s(e.uuid);
58
+ s(t.uuid);
58
59
  }
59
60
  }
60
61
  ]
@@ -64,9 +65,9 @@ const P = () => {
64
65
  )
65
66
  });
66
67
  if (o === "LIST")
67
- return /* @__PURE__ */ a(g, { "data-testid": "data-view", label: t("allCompensations.tableLabel"), ...m });
68
+ return /* @__PURE__ */ a(g, { "data-testid": "data-view", label: e("allCompensations.tableLabel"), ...m });
68
69
  };
69
70
  export {
70
- P as List
71
+ U as List
71
72
  };
72
73
  //# sourceMappingURL=List.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"List.js","sources":["../../../../src/components/Employee/Compensation/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { type Job } from '@gusto/embedded-api/models/components/job'\nimport { useCompensation } from './useCompensation'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport TrashCanSvg from '@/assets/icons/trashcan.svg?react'\nimport { DataView, useDataView } from '@/components/Common'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\n\nexport const List = () => {\n const { employeeJobs, mode, isPending, handleEdit, handleDelete } = useCompensation()\n const { t } = useTranslation('Employee.Compensation')\n\n const { ...dataViewProps } = useDataView({\n data: employeeJobs,\n columns: [\n {\n key: 'title',\n title: t('allCompensations.jobColumn'),\n render: (job: Job) => job.title || '',\n },\n {\n key: 'flsaStatus',\n title: t('allCompensations.typeColumn'),\n render: (job: Job) => {\n const flsaStatus = job.compensations?.find(\n comp => comp.uuid === job.currentCompensationUuid,\n )?.flsaStatus\n return flsaStatus !== undefined ? t(`flsaStatusLabels.${flsaStatus}`) : null\n },\n },\n {\n key: 'rate',\n title: t('allCompensations.amountColumn'),\n render: (job: Job) => job.rate?.toString() || '',\n },\n {\n key: 'paymentUnit',\n title: t('allCompensations.perColumn'),\n render: (job: Job) => job.paymentUnit || '',\n },\n ],\n itemMenu: (job: Job) => (\n <HamburgerMenu\n triggerLabel={t('hamburgerTitle')}\n items={[\n {\n label: t('allCompensations.editCta'),\n icon: <PencilSvg aria-hidden />,\n onClick: () => {\n handleEdit(job.uuid)\n },\n },\n ...(!job.primary\n ? [\n {\n label: t('allCompensations.deleteCta'),\n icon: <TrashCanSvg aria-hidden />,\n onClick: () => {\n handleDelete(job.uuid)\n },\n },\n ]\n : []),\n ]}\n isLoading={isPending}\n />\n ),\n })\n\n if (mode !== 'LIST') {\n return\n }\n\n return (\n <DataView data-testid=\"data-view\" label={t('allCompensations.tableLabel')} {...dataViewProps} />\n )\n}\n"],"names":["List","employeeJobs","mode","isPending","handleEdit","handleDelete","useCompensation","useTranslation","dataViewProps","useDataView","job","flsaStatus","comp","jsx","HamburgerMenu","PencilSvg","TrashCanSvg","DataView"],"mappings":";;;;;;;;;AAQO,MAAMA,IAAO,MAAM;AACxB,QAAM,EAAE,cAAAC,GAAc,MAAAC,GAAM,WAAAC,GAAW,YAAAC,GAAY,cAAAC,EAAA,IAAiBC,EAAA,GAC9D,EAAE,EAAA,IAAMC,EAAe,uBAAuB,GAE9C,EAAE,GAAGC,EAAA,IAAkBC,EAAY;AAAA,IACvC,MAAMR;AAAA,IACN,SAAS;AAAA,MACP;AAAA,QACE,KAAK;AAAA,QACL,OAAO,EAAE,4BAA4B;AAAA,QACrC,QAAQ,CAACS,MAAaA,EAAI,SAAS;AAAA,MAAA;AAAA,MAErC;AAAA,QACE,KAAK;AAAA,QACL,OAAO,EAAE,6BAA6B;AAAA,QACtC,QAAQ,CAACA,MAAa;AACpB,gBAAMC,IAAaD,EAAI,eAAe;AAAA,YACpC,CAAAE,MAAQA,EAAK,SAASF,EAAI;AAAA,UAAA,GACzB;AACH,iBAAOC,MAAe,SAAY,EAAE,oBAAoBA,CAAU,EAAE,IAAI;AAAA,QAC1E;AAAA,MAAA;AAAA,MAEF;AAAA,QACE,KAAK;AAAA,QACL,OAAO,EAAE,+BAA+B;AAAA,QACxC,QAAQ,CAACD,MAAaA,EAAI,MAAM,cAAc;AAAA,MAAA;AAAA,MAEhD;AAAA,QACE,KAAK;AAAA,QACL,OAAO,EAAE,4BAA4B;AAAA,QACrC,QAAQ,CAACA,MAAaA,EAAI,eAAe;AAAA,MAAA;AAAA,IAC3C;AAAA,IAEF,UAAU,CAACA,MACT,gBAAAG;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,cAAc,EAAE,gBAAgB;AAAA,QAChC,OAAO;AAAA,UACL;AAAA,YACE,OAAO,EAAE,0BAA0B;AAAA,YACnC,MAAM,gBAAAD,EAACE,GAAA,EAAU,eAAW,GAAA,CAAC;AAAA,YAC7B,SAAS,MAAM;AACb,cAAAX,EAAWM,EAAI,IAAI;AAAA,YACrB;AAAA,UAAA;AAAA,UAEF,GAAKA,EAAI,UAUL,CAAA,IATA;AAAA,YACE;AAAA,cACE,OAAO,EAAE,4BAA4B;AAAA,cACrC,MAAM,gBAAAG,EAACG,GAAA,EAAY,eAAW,GAAA,CAAC;AAAA,cAC/B,SAAS,MAAM;AACb,gBAAAX,EAAaK,EAAI,IAAI;AAAA,cACvB;AAAA,YAAA;AAAA,UACF;AAAA,QAED;AAAA,QAEP,WAAWP;AAAA,MAAA;AAAA,IAAA;AAAA,EACb,CAEH;AAED,MAAID,MAAS;AAIb,WACE,gBAAAW,EAACI,KAAS,eAAY,aAAY,OAAO,EAAE,6BAA6B,GAAI,GAAGT,GAAe;AAElG;"}
1
+ {"version":3,"file":"List.js","sources":["../../../../src/components/Employee/Compensation/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { type Job } from '@gusto/embedded-api/models/components/job'\nimport { useCompensation } from './useCompensation'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport TrashCanSvg from '@/assets/icons/trashcan.svg?react'\nimport { DataView, useDataView } from '@/components/Common'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\n\nexport const List = () => {\n const { employeeJobs, mode, isPending, handleEdit, handleDelete } = useCompensation()\n const { t } = useTranslation('Employee.Compensation')\n\n const { ...dataViewProps } = useDataView({\n data: employeeJobs,\n columns: [\n {\n key: 'title',\n title: t('allCompensations.jobColumn'),\n render: (job: Job) => job.title || '',\n },\n {\n key: 'flsaStatus',\n title: t('allCompensations.typeColumn'),\n render: (job: Job) => {\n const flsaStatus = job.compensations?.find(\n comp => comp.uuid === job.currentCompensationUuid,\n )?.flsaStatus\n return flsaStatus !== undefined ? t(`flsaStatusLabels.${flsaStatus}`) : null\n },\n },\n {\n key: 'rate',\n title: t('allCompensations.amountColumn'),\n render: (job: Job) => job.rate?.toString() || '',\n },\n {\n key: 'paymentUnit',\n title: t('allCompensations.perColumn'),\n render: (job: Job) => job.paymentUnit || '',\n },\n ],\n itemMenu: (job: Job) => (\n <HamburgerMenu\n triggerLabel={t('hamburgerTitle')}\n items={[\n {\n label: t('allCompensations.editCta'),\n icon: <PencilSvg aria-hidden />,\n onClick: () => {\n handleEdit(job.uuid)\n },\n },\n ...(!job.primary\n ? [\n {\n label: t('allCompensations.deleteCta'),\n icon: <TrashCanSvg aria-hidden />,\n onClick: () => {\n handleDelete(job.uuid)\n },\n },\n ]\n : []),\n ]}\n isLoading={isPending}\n />\n ),\n })\n\n if (mode !== 'LIST') {\n return\n }\n\n return (\n <DataView data-testid=\"data-view\" label={t('allCompensations.tableLabel')} {...dataViewProps} />\n )\n}\n"],"names":["List","employeeJobs","mode","isPending","handleEdit","handleDelete","useCompensation","t","useTranslation","dataViewProps","useDataView","job","flsaStatus","comp","jsx","HamburgerMenu","PencilSvg","TrashCanSvg","DataView"],"mappings":";;;;;;;;;;AAQO,MAAMA,IAAO,MAAM;AACxB,QAAM,EAAE,cAAAC,GAAc,MAAAC,GAAM,WAAAC,GAAW,YAAAC,GAAY,cAAAC,EAAA,IAAiBC,EAAA,GAC9D,EAAE,GAAAC,EAAA,IAAMC,EAAe,uBAAuB,GAE9C,EAAE,GAAGC,EAAA,IAAkBC,EAAY;AAAA,IACvC,MAAMT;AAAA,IACN,SAAS;AAAA,MACP;AAAA,QACE,KAAK;AAAA,QACL,OAAOM,EAAE,4BAA4B;AAAA,QACrC,QAAQ,CAACI,MAAaA,EAAI,SAAS;AAAA,MAAA;AAAA,MAErC;AAAA,QACE,KAAK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 -4,8 +4,8 @@ export interface DeductionsProps extends BaseComponentInterface<'Employee.Deduct
4
4
  }
5
5
  export declare function Deductions(props: DeductionsProps): import("react/jsx-runtime").JSX.Element;
6
6
  export declare namespace Deductions {
7
+ var IncludeDeductions: typeof import("./IncludeDeductions/IncludeDeductions").IncludeDeductions;
7
8
  var DeductionsForm: typeof import("./DeductionsForm/DeductionsForm").DeductionsForm;
8
9
  var DeductionsList: typeof import("./DeductionsList/DeductionsList").DeductionsList;
9
- var IncludeDeductionsForm: typeof import("./IncludeDeductionsForm/IncludeDeductionsForm").IncludeDeductionsForm;
10
10
  }
11
11
  export declare const DeductionsContextual: () => import("react/jsx-runtime").JSX.Element;
@@ -3,11 +3,11 @@ import { useTranslation as l } from "react-i18next";
3
3
  import { createMachine as D } from "robot3";
4
4
  import { useGarnishmentsListSuspense as f } from "@gusto/embedded-api/react-query/garnishmentsList";
5
5
  import { useMemo as d } from "react";
6
- import { DeductionsListContextual as h, IncludeDeductionsFormContextual as F } from "./DeductionsComponents.js";
7
- import { deductionsStateMachine as w } from "./stateMachine.js";
8
- import { DeductionsForm as x } from "./DeductionsForm/DeductionsForm.js";
9
- import { DeductionsList as C } from "./DeductionsList/DeductionsList.js";
10
- import { IncludeDeductionsForm as g } from "./IncludeDeductionsForm/IncludeDeductionsForm.js";
6
+ import { DeductionsListContextual as h, IncludeDeductionsFormContextual as w } from "./DeductionsComponents.js";
7
+ import { deductionsStateMachine as x } from "./stateMachine.js";
8
+ import { DeductionsForm as C } from "./DeductionsForm/DeductionsForm.js";
9
+ import { DeductionsList as F } from "./DeductionsList/DeductionsList.js";
10
+ import { IncludeDeductions as g } from "./IncludeDeductions/IncludeDeductions.js";
11
11
  import { Flow as v } from "../../Flow/Flow.js";
12
12
  import { BaseComponent as L } from "../../Base/Base.js";
13
13
  import "../../Base/useBase.js";
@@ -18,10 +18,10 @@ function M({ employeeId: o, onEvent: i, dictionary: r }) {
18
18
  const { data: a } = f({ employeeId: o }), c = a.garnishmentList.filter((s) => s.active), t = d(
19
19
  () => c.length > 0,
20
20
  [c.length]
21
- ), m = t ? "viewDeductions" : "includeDeductions", u = t ? h : F, p = d(
21
+ ), m = t ? "viewDeductions" : "includeDeductions", u = t ? h : w, p = d(
22
22
  () => D(
23
23
  m,
24
- w,
24
+ x,
25
25
  (s) => ({
26
26
  ...s,
27
27
  component: u,
@@ -49,9 +49,9 @@ const N = () => {
49
49
  );
50
50
  return /* @__PURE__ */ n(e, { employeeId: o, onEvent: i });
51
51
  };
52
- e.DeductionsForm = x;
53
- e.DeductionsList = C;
54
- e.IncludeDeductionsForm = g;
52
+ e.IncludeDeductions = g;
53
+ e.DeductionsForm = C;
54
+ e.DeductionsList = F;
55
55
  export {
56
56
  e as Deductions,
57
57
  N as DeductionsContextual
@@ -1 +1 @@
1
- {"version":3,"file":"Deductions.js","sources":["../../../../src/components/Employee/Deductions/Deductions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { createMachine } from 'robot3'\nimport { useGarnishmentsListSuspense } from '@gusto/embedded-api/react-query/garnishmentsList'\nimport { useMemo } from 'react'\nimport type { OnboardingContextInterface } from '../OnboardingFlow/OnboardingFlowComponents'\nimport {\n IncludeDeductionsFormContextual,\n type DeductionsContextInterface,\n DeductionsListContextual,\n} from './DeductionsComponents'\nimport { deductionsStateMachine } from './stateMachine'\nimport { DeductionsForm } from './DeductionsForm/DeductionsForm'\nimport { DeductionsList } from './DeductionsList/DeductionsList'\nimport { IncludeDeductionsForm } from './IncludeDeductionsForm/IncludeDeductionsForm'\nimport { Flow } from '@/components/Flow/Flow'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentDictionary } from '@/i18n/I18n'\nimport { useFlow } from '@/components/Flow/useFlow'\n\nexport interface DeductionsProps extends BaseComponentInterface<'Employee.Deductions'> {\n employeeId: string\n}\nfunction DeductionsFlow({ employeeId, onEvent, dictionary }: DeductionsProps) {\n useComponentDictionary('Employee.Deductions', dictionary)\n const { data } = useGarnishmentsListSuspense({ employeeId })\n const deductions = data.garnishmentList!\n const activeDeductions = deductions.filter(deduction => deduction.active)\n const hasExistingDeductions = useMemo(\n () => activeDeductions.length > 0,\n [activeDeductions.length],\n )\n\n // Determine initial state based on existing deductions\n const initialState: 'includeDeductions' | 'viewDeductions' = hasExistingDeductions\n ? 'viewDeductions'\n : 'includeDeductions'\n\n const initialComponent: React.ComponentType = hasExistingDeductions\n ? DeductionsListContextual\n : IncludeDeductionsFormContextual\n\n const manageDeductions = useMemo(\n () =>\n createMachine(\n initialState,\n deductionsStateMachine,\n (initialContext: DeductionsContextInterface) => ({\n ...initialContext,\n component: initialComponent,\n employeeId,\n currentDeductionId: null,\n hasExistingDeductions,\n }),\n ),\n [initialState, initialComponent, employeeId, hasExistingDeductions],\n )\n\n return <Flow machine={manageDeductions} onEvent={onEvent} />\n}\n\nexport function Deductions(props: DeductionsProps) {\n return (\n <BaseComponent {...props}>\n <DeductionsFlow {...props} />\n </BaseComponent>\n )\n}\n\nexport const DeductionsContextual = () => {\n const { employeeId, onEvent } = useFlow<OnboardingContextInterface>()\n const { t } = useTranslation('common')\n\n if (!employeeId) {\n throw new Error(\n t('errors.missingParamsOrContext', {\n component: 'Deductions',\n param: 'employeeId',\n provider: 'FlowProvider',\n }),\n )\n }\n return <Deductions employeeId={employeeId} onEvent={onEvent} />\n}\n\nDeductions.DeductionsForm = DeductionsForm\nDeductions.DeductionsList = DeductionsList\nDeductions.IncludeDeductionsForm = IncludeDeductionsForm\n"],"names":["DeductionsFlow","employeeId","onEvent","dictionary","useComponentDictionary","data","useGarnishmentsListSuspense","activeDeductions","deduction","hasExistingDeductions","useMemo","initialState","initialComponent","DeductionsListContextual","IncludeDeductionsFormContextual","manageDeductions","createMachine","deductionsStateMachine","initialContext","jsx","Flow","Deductions","props","BaseComponent","DeductionsContextual","useFlow","t","useTranslation","DeductionsForm","DeductionsList","IncludeDeductionsForm"],"mappings":";;;;;;;;;;;;;;;AAsBA,SAASA,EAAe,EAAE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Q;AAC5BR,EAAW,wBAAwBS;"}
1
+ {"version":3,"file":"Deductions.js","sources":["../../../../src/components/Employee/Deductions/Deductions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { createMachine } from 'robot3'\nimport { useGarnishmentsListSuspense } from '@gusto/embedded-api/react-query/garnishmentsList'\nimport { useMemo } from 'react'\nimport type { OnboardingContextInterface } from '../OnboardingFlow/OnboardingFlowComponents'\nimport {\n IncludeDeductionsFormContextual,\n type DeductionsContextInterface,\n DeductionsListContextual,\n} from './DeductionsComponents'\nimport { deductionsStateMachine } from './stateMachine'\nimport { DeductionsForm } from './DeductionsForm/DeductionsForm'\nimport { DeductionsList } from './DeductionsList/DeductionsList'\nimport { IncludeDeductions } from './IncludeDeductions/IncludeDeductions'\nimport { Flow } from '@/components/Flow/Flow'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentDictionary } from '@/i18n/I18n'\nimport { useFlow } from '@/components/Flow/useFlow'\n\nexport interface DeductionsProps extends BaseComponentInterface<'Employee.Deductions'> {\n employeeId: string\n}\nfunction DeductionsFlow({ employeeId, onEvent, dictionary }: DeductionsProps) {\n useComponentDictionary('Employee.Deductions', dictionary)\n const { data } = useGarnishmentsListSuspense({ employeeId })\n const deductions = data.garnishmentList!\n const activeDeductions = deductions.filter(deduction => deduction.active)\n const hasExistingDeductions = useMemo(\n () => activeDeductions.length > 0,\n [activeDeductions.length],\n )\n\n // Determine initial state based on existing deductions\n const initialState: 'includeDeductions' | 'viewDeductions' = hasExistingDeductions\n ? 'viewDeductions'\n : 'includeDeductions'\n\n const initialComponent: React.ComponentType = hasExistingDeductions\n ? DeductionsListContextual\n : IncludeDeductionsFormContextual\n\n const manageDeductions = useMemo(\n () =>\n createMachine(\n initialState,\n deductionsStateMachine,\n (initialContext: DeductionsContextInterface) => ({\n ...initialContext,\n component: initialComponent,\n employeeId,\n currentDeductionId: null,\n hasExistingDeductions,\n }),\n ),\n [initialState, initialComponent, employeeId, hasExistingDeductions],\n )\n\n return <Flow machine={manageDeductions} onEvent={onEvent} />\n}\n\nexport function Deductions(props: DeductionsProps) {\n return (\n <BaseComponent {...props}>\n <DeductionsFlow {...props} />\n </BaseComponent>\n )\n}\n\nexport const DeductionsContextual = () => {\n const { employeeId, onEvent } = useFlow<OnboardingContextInterface>()\n const { t } = useTranslation('common')\n\n if (!employeeId) {\n throw new Error(\n t('errors.missingParamsOrContext', {\n component: 'Deductions',\n param: 'employeeId',\n provider: 'FlowProvider',\n }),\n )\n }\n return <Deductions employeeId={employeeId} onEvent={onEvent} />\n}\n\nDeductions.IncludeDeductions = IncludeDeductions\nDeductions.DeductionsForm = DeductionsForm\nDeductions.DeductionsList = DeductionsList\n"],"names":["DeductionsFlow","employeeId","onEvent","dictionary","useComponentDictionary","data","useGarnishmentsListSuspense","activeDeductions","deduction","hasExistingDeductions","useMemo","initialState","initialComponent","DeductionsListContextual","IncludeDeductionsFormContextual","manageDeductions","createMachine","deductionsStateMachine","initialContext","jsx","Flow","Deductions","props","BaseComponent","DeductionsContextual","useFlow","t","useTranslation","IncludeDeductions","DeductionsForm","DeductionsList"],"mappings":";;;;;;;;;;;;;;;AAsBA,SAASA,EAAe,EAAE,YAAAC,GAAY,SAAAC,GAAS,YAAAC,KAA+B;AAC5E,EAAAC,EAAuB,uBAAuBD,CAAU;AACxD,QAAM,EAAE,MAAAE,EAAA,IAASC,EAA4B,EAAE,YAAAL,GAAY,GAErDM,IADaF,EAAK,gBACY,OAAO,CAAAG,MAAaA,EAAU,MAAM,GAClEC,IAAwBC;AAAA,IAC5B,MAAMH,EAAiB,SAAS;AAAA,IAChC,CAACA,EAAiB,MAAM;AAAA,EAAA,GAIpBI,IAAuDF,IACzD,mBACA,qBAEEG,IAAwCH,IAC1CI,IACAC,GAEEC,IAAmBL;AAAA,IACvB,MACEM;AAAA,MACEL;AAAA,MACAM;AAAA,MACA,CAACC,OAAgD;AAAA,QAC/C,GAAGA;AAAA,QACH,WAAWN;AAAA,QACX,YAAAX;AAAA,QACA,oBAAoB;AAAA,QACpB,uBAAAQ;AAAA,MAAA;AAAA,IACF;AAAA,IAEJ,CAACE,GAAcC,GAAkBX,GAAYQ,CAAqB;AAAA,EAAA;AAGpE,SAAO,gBAAAU,EAACC,GAAA,EAAK,SAASL,GAAkB,SAAAb,EAAA,CAAkB;AAC5D;AAEO,SAASmB,EAAWC,GAAwB;AACjD,SACE,gBAAAH,EAACI,KAAe,GAAGD,GACjB,4BAACtB,GAAA,EAAgB,GAAGsB,GAAO,EAAA,CAC7B;AAEJ;AAEO,MAAME,IAAuB,MAAM;AACxC,QAAM,EAAE,YAAAvB,GAAY,SAAAC,EAAA,IAAYuB,EAAA,GAC1B,EAAE,GAAAC,EAAA,IAAMC,EAAe,QAAQ;AAErC,MAAI,CAAC1B;AACH,UAAM,IAAI;AAAA,MACRyB,EAAE,iCAAiC;AAAA,QACjC,WAAW;AAAA,QACX,OAAO;AAAA,QACP,UAAU;AAAA,MAAA,CACX;AAAA,IAAA;AAGL,SAAO,gBAAAP,EAACE,GAAA,EAAW,YAAApB,GAAwB,SAAAC,EAAA,CAAkB;AAC/D;AAEAmB,EAAW,oBAAoBO;AAC/BP,EAAW,iBAAiBQ;AAC5BR,EAAW,iBAAiBS;"}
@@ -8,8 +8,10 @@ export type EventPayloads = {
8
8
  [componentEvents.EMPLOYEE_DEDUCTION_CREATED]: Garnishment;
9
9
  [componentEvents.EMPLOYEE_DEDUCTION_UPDATED]: Garnishment;
10
10
  [componentEvents.EMPLOYEE_DEDUCTION_DELETED]: Garnishment;
11
+ [componentEvents.EMPLOYEE_DEDUCTION_DELETED_EMPTY]: undefined;
11
12
  [componentEvents.EMPLOYEE_DEDUCTION_EDIT]: Garnishment;
12
13
  [componentEvents.EMPLOYEE_DEDUCTION_CANCEL]: undefined;
14
+ [componentEvents.EMPLOYEE_DEDUCTION_CANCEL_EMPTY]: undefined;
13
15
  [componentEvents.EMPLOYEE_DEDUCTION_DONE]: undefined;
14
16
  [componentEvents.CANCEL]: undefined;
15
17
  };
@@ -1,21 +1,21 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
- import { IncludeDeductionsForm as m } from "./IncludeDeductionsForm/IncludeDeductionsForm.js";
3
- import { DeductionsList as d } from "./DeductionsList/DeductionsList.js";
4
- import { DeductionsForm as i } from "./DeductionsForm/DeductionsForm.js";
2
+ import { DeductionsList as m } from "./DeductionsList/DeductionsList.js";
3
+ import { DeductionsForm as d } from "./DeductionsForm/DeductionsForm.js";
4
+ import { IncludeDeductions as i } from "./IncludeDeductions/IncludeDeductions.js";
5
5
  import { useFlow as n } from "../../Flow/useFlow.js";
6
6
  import { ensureRequired as r } from "../../../helpers/ensureRequired.js";
7
7
  function D() {
8
8
  const { employeeId: e, onEvent: o } = n();
9
- return /* @__PURE__ */ t(m, { onEvent: o, employeeId: r(e) });
9
+ return /* @__PURE__ */ t(i, { onEvent: o, employeeId: r(e) });
10
10
  }
11
11
  function y() {
12
12
  const { employeeId: e, onEvent: o } = n();
13
- return /* @__PURE__ */ t(d, { onEvent: o, employeeId: r(e) });
13
+ return /* @__PURE__ */ t(m, { onEvent: o, employeeId: r(e) });
14
14
  }
15
15
  function x() {
16
16
  const { employeeId: e, onEvent: o, currentDeductionId: u } = n();
17
17
  return /* @__PURE__ */ t(
18
- i,
18
+ d,
19
19
  {
20
20
  onEvent: o,
21
21
  employeeId: r(e),
@@ -1 +1 @@
1
- {"version":3,"file":"DeductionsComponents.js","sources":["../../../../src/components/Employee/Deductions/DeductionsComponents.tsx"],"sourcesContent":["import type { Garnishment } from '@gusto/embedded-api/models/components/garnishment'\nimport { IncludeDeductionsForm } from './IncludeDeductionsForm/IncludeDeductionsForm'\nimport { DeductionsList } from './DeductionsList/DeductionsList'\nimport { DeductionsForm } from './DeductionsForm/DeductionsForm'\nimport { useFlow, type FlowContextInterface } from '@/components/Flow/useFlow'\nimport type { componentEvents } from '@/shared/constants'\nimport { ensureRequired } from '@/helpers/ensureRequired'\n\nexport type EventPayloads = {\n [componentEvents.EMPLOYEE_DEDUCTION_INCLUDE_YES]: undefined\n [componentEvents.EMPLOYEE_DEDUCTION_INCLUDE_NO]: undefined\n [componentEvents.EMPLOYEE_DEDUCTION_ADD]: undefined\n [componentEvents.EMPLOYEE_DEDUCTION_CREATED]: Garnishment\n [componentEvents.EMPLOYEE_DEDUCTION_UPDATED]: Garnishment\n [componentEvents.EMPLOYEE_DEDUCTION_DELETED]: Garnishment\n [componentEvents.EMPLOYEE_DEDUCTION_EDIT]: Garnishment\n [componentEvents.EMPLOYEE_DEDUCTION_CANCEL]: undefined\n [componentEvents.EMPLOYEE_DEDUCTION_DONE]: undefined\n [componentEvents.CANCEL]: undefined\n}\n\nexport interface DeductionsContextInterface extends FlowContextInterface {\n employeeId: string\n currentDeductionId?: string | null\n hasExistingDeductions?: boolean\n}\n\nexport function IncludeDeductionsFormContextual() {\n const { employeeId, onEvent } = useFlow<DeductionsContextInterface>()\n return <IncludeDeductionsForm onEvent={onEvent} employeeId={ensureRequired(employeeId)} />\n}\n\nexport function DeductionsListContextual() {\n const { employeeId, onEvent } = useFlow<DeductionsContextInterface>()\n return <DeductionsList onEvent={onEvent} employeeId={ensureRequired(employeeId)} />\n}\n\nexport function DeductionFormContextual() {\n const { employeeId, onEvent, currentDeductionId } = useFlow<DeductionsContextInterface>()\n\n return (\n <DeductionsForm\n onEvent={onEvent}\n employeeId={ensureRequired(employeeId)}\n deductionId={currentDeductionId}\n />\n )\n}\n"],"names":["IncludeDeductionsFormContextual","employeeId","onEvent","useFlow","IncludeDeductionsForm","ensureRequired","DeductionsListContextual","DeductionsList","DeductionFormContextual","currentDeductionId","jsx","DeductionsForm"],"mappings":";;;;;;AA2BO,SAASA,IAAkC;AAChD,QAAM,EAAE,YAAAC,GAAY,SAAAC,EAAA,IAAYC,EAAA;AAChC,2BAAQC,GAAA,EAAsB,SAAAF,GAAkB,YAAYG,EAAeJ,CAAU,GAAG;AAC1F;AAEO,SAASK,IAA2B;AACzC,QAAM,EAAE,YAAAL,GAAY,SAAAC,EAAA,IAAYC,EAAA;AAChC,2BAAQI,GAAA,EAAe,SAAAL,GAAkB,YAAYG,EAAeJ,CAAU,GAAG;AACnF;AAEO,SAASO,IAA0B;AACxC,QAAM,EAAE,YAAAP,GAAY,SAAAC,GAAS,oBAAAO,EAAA,IAAuBN,EAAA;AAEpD,SACE,gBAAAO;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,SAAAT;AAAA,MACA,YAAYG,EAAeJ,CAAU;AAAA,MACrC,aAAaQ;AAAA,IAAA;AAAA,EAAA;AAGnB;"}
1
+ {"version":3,"file":"DeductionsComponents.js","sources":["../../../../src/components/Employee/Deductions/DeductionsComponents.tsx"],"sourcesContent":["import type { Garnishment } from '@gusto/embedded-api/models/components/garnishment'\nimport { DeductionsList } from './DeductionsList/DeductionsList'\nimport { DeductionsForm } from './DeductionsForm/DeductionsForm'\nimport { IncludeDeductions } from './IncludeDeductions/IncludeDeductions'\nimport { useFlow, type FlowContextInterface } from '@/components/Flow/useFlow'\nimport type { componentEvents } from '@/shared/constants'\nimport { ensureRequired } from '@/helpers/ensureRequired'\n\nexport type EventPayloads = {\n [componentEvents.EMPLOYEE_DEDUCTION_INCLUDE_YES]: undefined\n [componentEvents.EMPLOYEE_DEDUCTION_INCLUDE_NO]: undefined\n [componentEvents.EMPLOYEE_DEDUCTION_ADD]: undefined\n [componentEvents.EMPLOYEE_DEDUCTION_CREATED]: Garnishment\n [componentEvents.EMPLOYEE_DEDUCTION_UPDATED]: Garnishment\n [componentEvents.EMPLOYEE_DEDUCTION_DELETED]: Garnishment\n [componentEvents.EMPLOYEE_DEDUCTION_DELETED_EMPTY]: undefined\n [componentEvents.EMPLOYEE_DEDUCTION_EDIT]: Garnishment\n [componentEvents.EMPLOYEE_DEDUCTION_CANCEL]: undefined\n [componentEvents.EMPLOYEE_DEDUCTION_CANCEL_EMPTY]: undefined\n [componentEvents.EMPLOYEE_DEDUCTION_DONE]: undefined\n [componentEvents.CANCEL]: undefined\n}\n\nexport interface DeductionsContextInterface extends FlowContextInterface {\n employeeId: string\n currentDeductionId?: string | null\n hasExistingDeductions?: boolean\n}\n\nexport function IncludeDeductionsFormContextual() {\n const { employeeId, onEvent } = useFlow<DeductionsContextInterface>()\n return <IncludeDeductions onEvent={onEvent} employeeId={ensureRequired(employeeId)} />\n}\n\nexport function DeductionsListContextual() {\n const { employeeId, onEvent } = useFlow<DeductionsContextInterface>()\n return <DeductionsList onEvent={onEvent} employeeId={ensureRequired(employeeId)} />\n}\n\nexport function DeductionFormContextual() {\n const { employeeId, onEvent, currentDeductionId } = useFlow<DeductionsContextInterface>()\n\n return (\n <DeductionsForm\n onEvent={onEvent}\n employeeId={ensureRequired(employeeId)}\n deductionId={currentDeductionId}\n />\n )\n}\n"],"names":["IncludeDeductionsFormContextual","employeeId","onEvent","useFlow","IncludeDeductions","ensureRequired","DeductionsListContextual","DeductionsList","DeductionFormContextual","currentDeductionId","jsx","DeductionsForm"],"mappings":";;;;;;AA6BO,SAASA,IAAkC;AAChD,QAAM,EAAE,YAAAC,GAAY,SAAAC,EAAA,IAAYC,EAAA;AAChC,2BAAQC,GAAA,EAAkB,SAAAF,GAAkB,YAAYG,EAAeJ,CAAU,GAAG;AACtF;AAEO,SAASK,IAA2B;AACzC,QAAM,EAAE,YAAAL,GAAY,SAAAC,EAAA,IAAYC,EAAA;AAChC,2BAAQI,GAAA,EAAe,SAAAL,GAAkB,YAAYG,EAAeJ,CAAU,GAAG;AACnF;AAEO,SAASO,IAA0B;AACxC,QAAM,EAAE,YAAAP,GAAY,SAAAC,GAAS,oBAAAO,EAAA,IAAuBN,EAAA;AAEpD,SACE,gBAAAO;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,SAAAT;AAAA,MACA,YAAYG,EAAeJ,CAAU;AAAA,MACrC,aAAaQ;AAAA,IAAA;AAAA,EAAA;AAGnB;"}
@@ -0,0 +1,220 @@
1
+ import { jsx as n, jsxs as c, Fragment as U } from "react/jsx-runtime";
2
+ import { useTranslation as k } from "react-i18next";
3
+ import { useForm as Y, useWatch as B, FormProvider as L } from "react-hook-form";
4
+ import { useMemo as W, useEffect as E } from "react";
5
+ import { z as i } from "zod";
6
+ import { zodResolver as G } from "@hookform/resolvers/zod";
7
+ import { PaymentPeriod as H } from "@gusto/embedded-api/models/components/garnishmentchildsupport";
8
+ import { useGarnishmentsCreateMutation as j } from "@gusto/embedded-api/react-query/garnishmentsCreate";
9
+ import { useGarnishmentsUpdateMutation as K } from "@gusto/embedded-api/react-query/garnishmentsUpdate";
10
+ import V from "./ChildSupportForm.module.scss.js";
11
+ import { useComponentContext as z } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
12
+ import { Form as X } from "../../../Common/Form/Form.js";
13
+ import { Flex as $ } from "../../../Common/Flex/Flex.js";
14
+ import "classnames";
15
+ import { ActionsLayout as J } from "../../../Common/ActionsLayout/ActionsLayout.js";
16
+ import "react-error-boundary";
17
+ import "@gusto/embedded-api/models/errors/apierror";
18
+ import "@gusto/embedded-api/models/errors/sdkvalidationerror";
19
+ import "@tanstack/react-query";
20
+ import { useBase as Q } from "../../../Base/useBase.js";
21
+ import { componentEvents as g } from "../../../../shared/constants.js";
22
+ import "dompurify";
23
+ import { SelectField as d } from "../../../Common/Fields/SelectField/SelectField.js";
24
+ import { TextInputField as Z } from "../../../Common/Fields/TextInputField/TextInputField.js";
25
+ import { NumberInputField as C } from "../../../Common/Fields/NumberInputField/NumberInputField.js";
26
+ const ee = 0, re = 0, te = 100, ne = i.nativeEnum(H), ie = i.object({
27
+ state: i.string(),
28
+ fipsCode: i.string(),
29
+ caseNumber: i.string().nullable(),
30
+ orderNumber: i.string().nullable(),
31
+ remittanceNumber: i.string().nullable(),
32
+ amount: i.number().min(0).transform(String),
33
+ payPeriodMaximum: i.number().min(0).transform((r) => r > 0 ? r.toString() : null).nullable(),
34
+ paymentPeriod: ne
35
+ });
36
+ function Te({
37
+ deduction: r,
38
+ handleStateAgencySelect: M,
39
+ stateAgencies: S,
40
+ counties: D,
41
+ employeeId: A,
42
+ selectedAgency: b
43
+ }) {
44
+ const { onEvent: h, baseSubmitHandler: _ } = Q(), { t: e } = k("Employee.Deductions"), o = z(), y = {
45
+ case_number: {
46
+ name: "caseNumber",
47
+ description: e("caseNumberDescription")
48
+ },
49
+ order_number: {
50
+ name: "orderNumber",
51
+ description: e("orderNumberDescription")
52
+ },
53
+ remittance_number: {
54
+ name: "remittanceNumber",
55
+ description: e("remittanceNumberDescription")
56
+ }
57
+ }, R = b?.requiredAttributes?.map((t) => ({
58
+ name: y[t.key].name,
59
+ label: t.label,
60
+ description: y[t.key].description
61
+ })) || [], { mutateAsync: x, isPending: T } = j(), { mutateAsync: v, isPending: q } = K(), F = T || q, u = W(() => ({
62
+ amount: r?.amount ? Number(r.amount) : 0,
63
+ payPeriodMaximum: r?.payPeriodMaximum ? Number(r.payPeriodMaximum) : null,
64
+ state: r?.childSupport?.state || "",
65
+ fipsCode: r?.childSupport?.fipsCode || "",
66
+ caseNumber: r?.childSupport?.caseNumber || null,
67
+ orderNumber: r?.childSupport?.orderNumber || null,
68
+ remittanceNumber: r?.childSupport?.remittanceNumber || null,
69
+ paymentPeriod: r?.childSupport?.paymentPeriod
70
+ }), [r]), p = Y({
71
+ resolver: G(ie),
72
+ defaultValues: u
73
+ }), { reset: P, setValue: m, control: I } = p, N = B({ control: I, name: "state" });
74
+ E(() => {
75
+ P(u);
76
+ }, [r, u, P]), E(() => {
77
+ m("caseNumber", null), m("orderNumber", null), m("remittanceNumber", null);
78
+ }, [N, m]);
79
+ const w = async (t) => {
80
+ const a = {
81
+ state: t.state,
82
+ paymentPeriod: t.paymentPeriod,
83
+ fipsCode: t.fipsCode,
84
+ caseNumber: t.caseNumber,
85
+ orderNumber: t.orderNumber,
86
+ remittanceNumber: t.remittanceNumber
87
+ };
88
+ await _(t, async (s) => {
89
+ const f = {
90
+ active: !0,
91
+ amount: s.amount,
92
+ description: `Child Support - ${a.caseNumber}`,
93
+ // child support description follows prefix type + case number convention
94
+ courtOrdered: !0,
95
+ garnishmentType: "child_support",
96
+ times: null,
97
+ deductAsPercentage: !0,
98
+ // child support must always deduct as percentage up to a pay period maximum limit and is recurring until cancelled
99
+ payPeriodMaximum: s.payPeriodMaximum,
100
+ recurring: !0,
101
+ childSupport: a
102
+ };
103
+ if (r) {
104
+ const { garnishment: l } = await v({
105
+ request: {
106
+ garnishmentId: r.uuid,
107
+ requestBody: {
108
+ ...f,
109
+ version: r.version
110
+ }
111
+ }
112
+ });
113
+ h(g.EMPLOYEE_DEDUCTION_UPDATED, l);
114
+ } else {
115
+ const { garnishment: l } = await x({
116
+ request: {
117
+ employeeId: A,
118
+ requestBody: f
119
+ }
120
+ });
121
+ h(g.EMPLOYEE_DEDUCTION_CREATED, l);
122
+ }
123
+ });
124
+ }, O = b?.manualPaymentRequired;
125
+ return /* @__PURE__ */ n(L, { ...p, children: /* @__PURE__ */ n(X, { onSubmit: p.handleSubmit(w), children: /* @__PURE__ */ c($, { flexDirection: "column", gap: 32, children: [
126
+ /* @__PURE__ */ n(o.Heading, { as: "h3", children: e("childSupportTitle") }),
127
+ /* @__PURE__ */ n(
128
+ d,
129
+ {
130
+ name: "state",
131
+ label: e("agency"),
132
+ description: e("agencyDescription"),
133
+ options: S,
134
+ onChange: M,
135
+ isRequired: !0
136
+ }
137
+ ),
138
+ N && /* @__PURE__ */ c(U, { children: [
139
+ /* @__PURE__ */ n(
140
+ d,
141
+ {
142
+ name: "fipsCode",
143
+ label: e("county"),
144
+ description: e("countyDescription"),
145
+ options: D,
146
+ isRequired: !0
147
+ }
148
+ ),
149
+ R.map(({ name: t, label: a, description: s }) => /* @__PURE__ */ n(
150
+ Z,
151
+ {
152
+ name: t,
153
+ label: a,
154
+ description: s,
155
+ isRequired: !0
156
+ },
157
+ t
158
+ )),
159
+ /* @__PURE__ */ n(
160
+ C,
161
+ {
162
+ name: "payPeriodMaximum",
163
+ label: e("totalAmountWithheld"),
164
+ description: e("totalAmountWithheldDescription"),
165
+ min: ee,
166
+ adornmentStart: "$",
167
+ isRequired: !0
168
+ }
169
+ ),
170
+ /* @__PURE__ */ n(
171
+ C,
172
+ {
173
+ name: "amount",
174
+ label: e("maxPaycheckPercentage"),
175
+ description: e("maxPaycheckPercentageDescription"),
176
+ isRequired: !0,
177
+ min: re,
178
+ max: te,
179
+ adornmentEnd: "%"
180
+ }
181
+ ),
182
+ /* @__PURE__ */ n(
183
+ d,
184
+ {
185
+ name: "paymentPeriod",
186
+ label: e("per"),
187
+ description: e("perDescription"),
188
+ options: [
189
+ {
190
+ label: e("everyWeek"),
191
+ value: "Every week"
192
+ },
193
+ {
194
+ label: e("everyOtherWeek"),
195
+ value: "Every other week"
196
+ },
197
+ {
198
+ label: e("twicePerMonth"),
199
+ value: "Twice per month"
200
+ },
201
+ {
202
+ label: e("monthly"),
203
+ value: "Monthly"
204
+ }
205
+ ],
206
+ isRequired: !0
207
+ }
208
+ ),
209
+ O && /* @__PURE__ */ c("section", { className: V.manualPaymentReminderBanner, children: [
210
+ /* @__PURE__ */ n(o.Text, { weight: "bold", children: e("manualPaymentRequired") }),
211
+ /* @__PURE__ */ n(o.Text, { children: e("manualPaymentRequiredDescription") })
212
+ ] }),
213
+ /* @__PURE__ */ n(J, { children: /* @__PURE__ */ n(o.Button, { type: "submit", isLoading: F, children: e("saveCta") }) })
214
+ ] })
215
+ ] }) }) });
216
+ }
217
+ export {
218
+ Te as default
219
+ };
220
+ //# sourceMappingURL=ChildSupportForm.js.map