@gusto/embedded-react-sdk 0.10.7 → 0.11.0-rc.1

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 (289) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/components/Base/Base.js +18 -19
  3. package/dist/components/Base/Base.js.map +1 -1
  4. package/dist/components/Common/HamburgerMenu/HamburgerMenu.js +20 -19
  5. package/dist/components/Common/HamburgerMenu/HamburgerMenu.js.map +1 -1
  6. package/dist/components/Common/ReorderableList/ReorderableItem.js +1 -1
  7. package/dist/components/Common/ReorderableList/ReorderableItem.js.map +1 -1
  8. package/dist/components/Common/SignatureForm/SignatureForm.js +4 -6
  9. package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
  10. package/dist/components/Common/SignatureForm/SignatureFormActions.js +10 -12
  11. package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
  12. package/dist/components/Common/SignatureForm/SignatureFormFields.js +6 -8
  13. package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
  14. package/dist/components/Common/UI/Button/Button.d.ts +1 -1
  15. package/dist/components/Common/UI/Button/Button.js +4 -4
  16. package/dist/components/Common/UI/Button/Button.js.map +1 -1
  17. package/dist/components/Common/UI/Button/ButtonTypes.d.ts +1 -1
  18. package/dist/components/Company/AssignSignatory/AssignSignatory.d.ts +0 -5
  19. package/dist/components/Company/AssignSignatory/AssignSignatory.js +34 -39
  20. package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
  21. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +6 -7
  22. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
  23. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +8 -9
  24. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
  25. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.d.ts +0 -4
  26. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +51 -54
  27. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
  28. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +2 -3
  29. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
  30. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +1 -1
  31. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +6 -7
  32. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
  33. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.d.ts +0 -4
  34. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +40 -43
  35. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
  36. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +9 -10
  37. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
  38. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +1 -1
  39. package/dist/components/Company/AssignSignatory/TitleSelect.js +7 -8
  40. package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
  41. package/dist/components/Company/AssignSignatory/index.d.ts +0 -1
  42. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +1 -1
  43. package/dist/components/Company/BankAccount/BankAccount.d.ts +0 -5
  44. package/dist/components/Company/BankAccount/BankAccount.js +17 -23
  45. package/dist/components/Company/BankAccount/BankAccount.js.map +1 -1
  46. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +2 -3
  47. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
  48. package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.d.ts +0 -5
  49. package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.js +28 -31
  50. package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.js.map +1 -1
  51. package/dist/components/Company/BankAccount/BankAccountForm/Form.js +7 -8
  52. package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
  53. package/dist/components/Company/BankAccount/BankAccountForm/context.js +1 -1
  54. package/dist/components/Company/BankAccount/BankAccountList/Actions.js +6 -7
  55. package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
  56. package/dist/components/Company/BankAccount/BankAccountList/BankAccountList.d.ts +0 -5
  57. package/dist/components/Company/BankAccount/BankAccountList/BankAccountList.js +25 -28
  58. package/dist/components/Company/BankAccount/BankAccountList/BankAccountList.js.map +1 -1
  59. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +7 -8
  60. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
  61. package/dist/components/Company/BankAccount/BankAccountVerify/BankAccountVerify.d.ts +0 -5
  62. package/dist/components/Company/BankAccount/BankAccountVerify/BankAccountVerify.js +33 -36
  63. package/dist/components/Company/BankAccount/BankAccountVerify/BankAccountVerify.js.map +1 -1
  64. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +4 -5
  65. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
  66. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +5 -6
  67. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
  68. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.d.ts +0 -6
  69. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +38 -44
  70. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  71. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +1 -1
  72. package/dist/components/Company/DocumentSigner/DocumentSigner.d.ts +0 -4
  73. package/dist/components/Company/DocumentSigner/DocumentSigner.js +23 -26
  74. package/dist/components/Company/DocumentSigner/DocumentSigner.js.map +1 -1
  75. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.d.ts +0 -6
  76. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +41 -47
  77. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  78. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +1 -1
  79. package/dist/components/Company/FederalTaxes/Actions.js +6 -7
  80. package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
  81. package/dist/components/Company/FederalTaxes/FederalTaxes.js +15 -17
  82. package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
  83. package/dist/components/Company/FederalTaxes/Form.js +2 -3
  84. package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
  85. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +1 -1
  86. package/dist/components/Company/Industry/Actions.js +5 -6
  87. package/dist/components/Company/Industry/Actions.js.map +1 -1
  88. package/dist/components/Company/Industry/Context.js +1 -1
  89. package/dist/components/Company/Industry/Edit.js +10 -11
  90. package/dist/components/Company/Industry/Edit.js.map +1 -1
  91. package/dist/components/Company/Industry/Industry.d.ts +0 -5
  92. package/dist/components/Company/Industry/Industry.js +23 -29
  93. package/dist/components/Company/Industry/Industry.js.map +1 -1
  94. package/dist/components/Company/Locations/LocationForm/Actions.js +2 -3
  95. package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
  96. package/dist/components/Company/Locations/LocationForm/Form.js +4 -5
  97. package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
  98. package/dist/components/Company/Locations/LocationForm/LocationForm.d.ts +0 -5
  99. package/dist/components/Company/Locations/LocationForm/LocationForm.js +43 -48
  100. package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
  101. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +1 -1
  102. package/dist/components/Company/Locations/Locations.d.ts +0 -4
  103. package/dist/components/Company/Locations/Locations.js +14 -18
  104. package/dist/components/Company/Locations/Locations.js.map +1 -1
  105. package/dist/components/Company/Locations/LocationsList/Actions.js +2 -3
  106. package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
  107. package/dist/components/Company/Locations/LocationsList/List.js +2 -3
  108. package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
  109. package/dist/components/Company/Locations/LocationsList/LocationsList.d.ts +0 -5
  110. package/dist/components/Company/Locations/LocationsList/LocationsList.js +32 -37
  111. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  112. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +1 -1
  113. package/dist/components/Company/OnboardingOverview/Completed.js +5 -6
  114. package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
  115. package/dist/components/Company/OnboardingOverview/MissingRequirements.js +2 -3
  116. package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
  117. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +2 -4
  118. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
  119. package/dist/components/Company/OnboardingOverview/context.js +1 -1
  120. package/dist/components/Company/PaySchedule/PaySchedule.d.ts +1 -7
  121. package/dist/components/Company/PaySchedule/PaySchedule.js +72 -78
  122. package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
  123. package/dist/components/Company/PaySchedule/_parts/Actions.js +10 -11
  124. package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
  125. package/dist/components/Company/PaySchedule/_parts/Edit.js +25 -26
  126. package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
  127. package/dist/components/Company/PaySchedule/_parts/Head.js +2 -3
  128. package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
  129. package/dist/components/Company/PaySchedule/_parts/List.js +5 -6
  130. package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
  131. package/dist/components/Company/PaySchedule/usePaySchedule.js +1 -1
  132. package/dist/components/Company/StateTaxes/StateTaxes.d.ts +0 -4
  133. package/dist/components/Company/StateTaxes/StateTaxes.js +39 -22
  134. package/dist/components/Company/StateTaxes/StateTaxes.js.map +1 -1
  135. package/dist/components/Company/StateTaxes/StateTaxesComponents.d.ts +8 -6
  136. package/dist/components/Company/StateTaxes/StateTaxesComponents.js +16 -15
  137. package/dist/components/Company/StateTaxes/StateTaxesComponents.js.map +1 -1
  138. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +5 -6
  139. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
  140. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.d.ts +0 -5
  141. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js +44 -47
  142. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js.map +1 -1
  143. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +1 -1
  144. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +6 -7
  145. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
  146. package/dist/components/Company/StateTaxes/StateTaxesList/List.js +5 -6
  147. package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
  148. package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.d.ts +0 -5
  149. package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js +26 -29
  150. package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js.map +1 -1
  151. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +1 -1
  152. package/dist/components/Company/StateTaxes/stateTaxesReducer.d.ts +20 -0
  153. package/dist/components/Company/StateTaxes/stateTaxesReducer.js +40 -0
  154. package/dist/components/Company/StateTaxes/stateTaxesReducer.js.map +1 -0
  155. package/dist/components/Contractor/Address/Address.d.ts +0 -5
  156. package/dist/components/Contractor/Address/Address.js +35 -40
  157. package/dist/components/Contractor/Address/Address.js.map +1 -1
  158. package/dist/components/Contractor/Address/Form.js +2 -3
  159. package/dist/components/Contractor/Address/Form.js.map +1 -1
  160. package/dist/components/Contractor/Address/useAddress.js +1 -1
  161. package/dist/components/Contractor/List/index.js +2 -3
  162. package/dist/components/Contractor/List/index.js.map +1 -1
  163. package/dist/components/Contractor/NewHireReport/NewHireReport.js +16 -17
  164. package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
  165. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +2 -3
  166. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
  167. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +2 -3
  168. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
  169. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +2 -3
  170. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
  171. package/dist/components/Contractor/Profile/ContractorProfile.d.ts +11 -0
  172. package/dist/components/Contractor/Profile/ContractorProfile.js +24 -0
  173. package/dist/components/Contractor/Profile/ContractorProfile.js.map +1 -0
  174. package/dist/components/Contractor/Profile/ContractorProfileForm.d.ts +5 -0
  175. package/dist/components/Contractor/Profile/ContractorProfileForm.js +140 -0
  176. package/dist/components/Contractor/Profile/ContractorProfileForm.js.map +1 -0
  177. package/dist/components/Contractor/Profile/index.d.ts +3 -0
  178. package/dist/components/Contractor/Profile/useContractorProfile.d.ts +254 -0
  179. package/dist/components/Contractor/Profile/useContractorProfile.js +223 -0
  180. package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -0
  181. package/dist/components/Contractor/Submit/ContractorSubmitWithApi.d.ts +6 -0
  182. package/dist/components/Contractor/Submit/ContractorSubmitWithApi.js +27 -0
  183. package/dist/components/Contractor/Submit/ContractorSubmitWithApi.js.map +1 -0
  184. package/dist/components/Contractor/Submit/SubmitDone.d.ts +5 -0
  185. package/dist/components/Contractor/Submit/SubmitDone.js +18 -0
  186. package/dist/components/Contractor/Submit/SubmitDone.js.map +1 -0
  187. package/dist/components/Contractor/Submit/index.d.ts +6 -0
  188. package/dist/components/Contractor/Submit/index.js +18 -0
  189. package/dist/components/Contractor/Submit/index.js.map +1 -0
  190. package/dist/components/Contractor/Submit/index.module.scss.js +8 -0
  191. package/dist/components/Contractor/Submit/index.module.scss.js.map +1 -0
  192. package/dist/components/Contractor/index.d.ts +2 -0
  193. package/dist/components/Contractor/index.js +10 -6
  194. package/dist/components/Contractor/index.js.map +1 -1
  195. package/dist/components/Employee/Compensation/Actions.js +4 -5
  196. package/dist/components/Employee/Compensation/Actions.js.map +1 -1
  197. package/dist/components/Employee/Compensation/Compensation.d.ts +0 -6
  198. package/dist/components/Employee/Compensation/Compensation.js +97 -102
  199. package/dist/components/Employee/Compensation/Compensation.js.map +1 -1
  200. package/dist/components/Employee/Compensation/Edit.js +2 -3
  201. package/dist/components/Employee/Compensation/Edit.js.map +1 -1
  202. package/dist/components/Employee/Compensation/List.js +5 -6
  203. package/dist/components/Employee/Compensation/List.js.map +1 -1
  204. package/dist/components/Employee/Deductions/Actions.js +8 -9
  205. package/dist/components/Employee/Deductions/Actions.js.map +1 -1
  206. package/dist/components/Employee/Deductions/DeductionForm.js +2 -3
  207. package/dist/components/Employee/Deductions/DeductionForm.js.map +1 -1
  208. package/dist/components/Employee/Deductions/DeductionsList.js +2 -3
  209. package/dist/components/Employee/Deductions/DeductionsList.js.map +1 -1
  210. package/dist/components/Employee/Deductions/IncludeDeductionsForm.js +2 -3
  211. package/dist/components/Employee/Deductions/IncludeDeductionsForm.js.map +1 -1
  212. package/dist/components/Employee/Deductions/useDeductions.js +1 -1
  213. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +4 -5
  214. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
  215. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.d.ts +0 -5
  216. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +25 -30
  217. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  218. package/dist/components/Employee/DocumentSigner/DocumentList/List.js +2 -3
  219. package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
  220. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +1 -1
  221. package/dist/components/Employee/DocumentSigner/DocumentSigner.d.ts +1 -7
  222. package/dist/components/Employee/DocumentSigner/DocumentSigner.js +16 -20
  223. package/dist/components/Employee/DocumentSigner/DocumentSigner.js.map +1 -1
  224. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.d.ts +0 -7
  225. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +40 -46
  226. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  227. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +1 -1
  228. package/dist/components/Employee/EmployeeList/Actions.js +4 -5
  229. package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
  230. package/dist/components/Employee/EmployeeList/EmployeeList.d.ts +0 -5
  231. package/dist/components/Employee/EmployeeList/EmployeeList.js +56 -61
  232. package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
  233. package/dist/components/Employee/EmployeeList/Head.js +2 -3
  234. package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
  235. package/dist/components/Employee/EmployeeList/List.js +2 -3
  236. package/dist/components/Employee/EmployeeList/List.js.map +1 -1
  237. package/dist/components/Employee/EmployeeList/useEmployeeList.js +1 -1
  238. package/dist/components/Employee/Landing/Landing.js +6 -7
  239. package/dist/components/Employee/Landing/Landing.js.map +1 -1
  240. package/dist/components/Employee/PaymentMethod/Actions.js +5 -6
  241. package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
  242. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +2 -3
  243. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
  244. package/dist/components/Employee/PaymentMethod/BankAccountsList.js +2 -3
  245. package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
  246. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +2 -3
  247. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
  248. package/dist/components/Employee/PaymentMethod/Split.js +2 -3
  249. package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
  250. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +1 -1
  251. package/dist/components/Employee/Profile/Actions.js +6 -7
  252. package/dist/components/Employee/Profile/Actions.js.map +1 -1
  253. package/dist/components/Employee/Profile/AdminPersonalDetails.d.ts +3 -3
  254. package/dist/components/Employee/Profile/AdminPersonalDetails.js +9 -10
  255. package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
  256. package/dist/components/Employee/Profile/HomeAddress.js +4 -5
  257. package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
  258. package/dist/components/Employee/Profile/PersonalDetailsInputs.d.ts +2 -2
  259. package/dist/components/Employee/Profile/PersonalDetailsInputs.js +8 -9
  260. package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
  261. package/dist/components/Employee/Profile/Profile.d.ts +0 -8
  262. package/dist/components/Employee/Profile/Profile.js +131 -138
  263. package/dist/components/Employee/Profile/Profile.js.map +1 -1
  264. package/dist/components/Employee/Profile/useProfile.js +1 -1
  265. package/dist/components/Employee/Taxes/Actions.js +7 -8
  266. package/dist/components/Employee/Taxes/Actions.js.map +1 -1
  267. package/dist/components/Employee/Taxes/FederalForm.js +4 -5
  268. package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
  269. package/dist/components/Employee/Taxes/Taxes.d.ts +0 -6
  270. package/dist/components/Employee/Taxes/Taxes.js +76 -81
  271. package/dist/components/Employee/Taxes/Taxes.js.map +1 -1
  272. package/dist/components/Employee/Taxes/useTaxes.js +1 -1
  273. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +2 -3
  274. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  275. package/dist/i18n/I18n.js +1 -1
  276. package/dist/i18n/I18n.js.map +1 -1
  277. package/dist/i18n/en/Contractor.ContractorSubmit.json.js +22 -0
  278. package/dist/i18n/en/Contractor.ContractorSubmit.json.js.map +1 -0
  279. package/dist/i18n/en/Contractor.Profile.json.js +73 -0
  280. package/dist/i18n/en/Contractor.Profile.json.js.map +1 -0
  281. package/dist/shared/constants.d.ts +14 -0
  282. package/dist/shared/constants.js +33 -26
  283. package/dist/shared/constants.js.map +1 -1
  284. package/dist/style.css +1 -1
  285. package/dist/types/i18next.d.ts +77 -1
  286. package/package.json +3 -3
  287. package/dist/components/Company/StateTaxes/stateTaxesStateMachine.d.ts +0 -5
  288. package/dist/components/Company/StateTaxes/stateTaxesStateMachine.js +0 -48
  289. package/dist/components/Company/StateTaxes/stateTaxesStateMachine.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"DocumentList.js","sources":["../../../../../src/components/Employee/DocumentSigner/DocumentList/DocumentList.tsx"],"sourcesContent":["import { useEmployeeFormsListSuspense } from '@gusto/embedded-api/react-query/employeeFormsList'\nimport { type Form } from '@gusto/embedded-api/models/components/form'\nimport { Head } from './Head'\nimport { List } from './List'\nimport { Actions } from './Actions'\nimport { DocumentListProvider } from './useDocumentList'\nimport {\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { Flex } from '@/components/Common'\n\ninterface DocumentListProps extends CommonComponentInterface {\n employeeId: string\n}\n\nexport function DocumentList(props: DocumentListProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nfunction Root({ employeeId, className, children }: DocumentListProps) {\n useI18n('Employee.DocumentSigner')\n const { onEvent } = useBase()\n\n const { data, error: documentListError } = useEmployeeFormsListSuspense({ employeeId })\n const employeeForms = data.formList!\n\n const hasSignedAllForms = employeeForms.every(employeeForm => !employeeForm.requiresSigning)\n\n const handleRequestFormToSign = (data: Form) => {\n onEvent(componentEvents.EMPLOYEE_VIEW_FORM_TO_SIGN, { uuid: data.uuid })\n }\n\n const handleContinue = () => {\n onEvent(componentEvents.EMPLOYEE_FORMS_DONE)\n }\n\n return (\n <section className={className}>\n <DocumentListProvider\n value={{\n employeeForms,\n hasSignedAllForms,\n handleContinue,\n handleRequestFormToSign,\n documentListError,\n }}\n >\n {children ? (\n children\n ) : (\n <Flex flexDirection=\"column\">\n <Head />\n <List />\n <Actions />\n </Flex>\n )}\n </DocumentListProvider>\n </section>\n )\n}\n\nDocumentList.Head = Head\nDocumentList.List = List\nDocumentList.Actions = Actions\n"],"names":["DocumentList","props","jsx","BaseComponent","Root","employeeId","className","children","useI18n","onEvent","useBase","data","documentListError","useEmployeeFormsListSuspense","employeeForms","hasSignedAllForms","employeeForm","DocumentListProvider","componentEvents","jsxs","Flex","Head","List","Actions"],"mappings":";;;;;;;;;;;;;AAoBO,SAASA,EAAaC,GAAmD;AAE5E,SAAA,gBAAAC,EAACC,KAAe,GAAGF,GACjB,4BAACG,GAAM,EAAA,GAAGH,GAAO,EACnB,CAAA;AAEJ;AAEA,SAASG,EAAK,EAAE,YAAAC,GAAY,WAAAC,GAAW,UAAAC,KAA+B;AACpE,EAAAC,EAAQ,yBAAyB;AAC3B,QAAA,EAAE,SAAAC,EAAQ,IAAIC,EAAQ,GAEtB,EAAE,MAAAC,GAAM,OAAOC,MAAsBC,EAA6B,EAAE,YAAAR,GAAY,GAChFS,IAAgBH,EAAK,UAErBI,IAAoBD,EAAc,MAAM,CAAgBE,MAAA,CAACA,EAAa,eAAe;AAWzF,SAAA,gBAAAd,EAAC,aAAQ,WAAAI,GACP,UAAA,gBAAAJ;AAAA,IAACe;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,eAAAH;AAAA,QACA,mBAAAC;AAAA,QACA,gBAVe,MAAM;AAC3B,UAAAN,EAAQS,EAAgB,mBAAmB;AAAA,QAC7C;AAAA,QASQ,yBAfwB,CAACP,MAAe;AAC9C,UAAAF,EAAQS,EAAgB,4BAA4B,EAAE,MAAMP,EAAK,MAAM;AAAA,QACzE;AAAA,QAcQ,mBAAAC;AAAA,MACF;AAAA,MAEC,UACCL,KAEC,gBAAAY,EAAAC,GAAA,EAAK,eAAc,UAClB,UAAA;AAAA,QAAA,gBAAAlB,EAACmB,GAAK,EAAA;AAAA,0BACLC,GAAK,EAAA;AAAA,0BACLC,GAAQ,CAAA,CAAA;AAAA,MAAA,EACX,CAAA;AAAA,IAAA;AAAA,EAAA,GAGN;AAEJ;AAEAvB,EAAa,OAAOqB;AACpBrB,EAAa,OAAOsB;AACpBtB,EAAa,UAAUuB;"}
1
+ {"version":3,"file":"DocumentList.js","sources":["../../../../../src/components/Employee/DocumentSigner/DocumentList/DocumentList.tsx"],"sourcesContent":["import { useEmployeeFormsListSuspense } from '@gusto/embedded-api/react-query/employeeFormsList'\nimport { type Form } from '@gusto/embedded-api/models/components/form'\nimport { Head } from './Head'\nimport { List } from './List'\nimport { Actions } from './Actions'\nimport { DocumentListProvider } from './useDocumentList'\nimport {\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { Flex } from '@/components/Common'\n\ninterface DocumentListProps extends CommonComponentInterface {\n employeeId: string\n}\n\nexport function DocumentList(props: DocumentListProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nfunction Root({ employeeId, className, children }: DocumentListProps) {\n useI18n('Employee.DocumentSigner')\n const { onEvent } = useBase()\n\n const { data, error: documentListError } = useEmployeeFormsListSuspense({ employeeId })\n const employeeForms = data.formList!\n\n const hasSignedAllForms = employeeForms.every(employeeForm => !employeeForm.requiresSigning)\n\n const handleRequestFormToSign = (data: Form) => {\n onEvent(componentEvents.EMPLOYEE_VIEW_FORM_TO_SIGN, { uuid: data.uuid })\n }\n\n const handleContinue = () => {\n onEvent(componentEvents.EMPLOYEE_FORMS_DONE)\n }\n\n return (\n <section className={className}>\n <DocumentListProvider\n value={{\n employeeForms,\n hasSignedAllForms,\n handleContinue,\n handleRequestFormToSign,\n documentListError,\n }}\n >\n {children ? (\n children\n ) : (\n <Flex flexDirection=\"column\">\n <Head />\n <List />\n <Actions />\n </Flex>\n )}\n </DocumentListProvider>\n </section>\n )\n}\n"],"names":["DocumentList","props","jsx","BaseComponent","Root","employeeId","className","children","useI18n","onEvent","useBase","data","documentListError","useEmployeeFormsListSuspense","employeeForms","hasSignedAllForms","employeeForm","DocumentListProvider","componentEvents","jsxs","Flex","Head","List","Actions"],"mappings":";;;;;;;;;;;AAoBO,SAASA,EAAaC,GAAmD;AAE5E,SAAA,gBAAAC,EAACC,KAAe,GAAGF,GACjB,4BAACG,GAAM,EAAA,GAAGH,GAAO,EACnB,CAAA;AAEJ;AAEA,SAASG,EAAK,EAAE,YAAAC,GAAY,WAAAC,GAAW,UAAAC,KAA+B;AACpE,EAAAC,EAAQ,yBAAyB;AAC3B,QAAA,EAAE,SAAAC,EAAQ,IAAIC,EAAQ,GAEtB,EAAE,MAAAC,GAAM,OAAOC,MAAsBC,EAA6B,EAAE,YAAAR,GAAY,GAChFS,IAAgBH,EAAK,UAErBI,IAAoBD,EAAc,MAAM,CAAgBE,MAAA,CAACA,EAAa,eAAe;AAWzF,SAAA,gBAAAd,EAAC,aAAQ,WAAAI,GACP,UAAA,gBAAAJ;AAAA,IAACe;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,eAAAH;AAAA,QACA,mBAAAC;AAAA,QACA,gBAVe,MAAM;AAC3B,UAAAN,EAAQS,EAAgB,mBAAmB;AAAA,QAC7C;AAAA,QASQ,yBAfwB,CAACP,MAAe;AAC9C,UAAAF,EAAQS,EAAgB,4BAA4B,EAAE,MAAMP,EAAK,MAAM;AAAA,QACzE;AAAA,QAcQ,mBAAAC;AAAA,MACF;AAAA,MAEC,UACCL,KAEC,gBAAAY,EAAAC,GAAA,EAAK,eAAc,UAClB,UAAA;AAAA,QAAA,gBAAAlB,EAACmB,GAAK,EAAA;AAAA,0BACLC,GAAK,EAAA;AAAA,0BACLC,GAAQ,CAAA,CAAA;AAAA,MAAA,EACX,CAAA;AAAA,IAAA;AAAA,EAAA,GAGN;AAEJ;"}
@@ -2,9 +2,8 @@ import { jsx as o } from "react/jsx-runtime";
2
2
  import { useTranslation as m } from "react-i18next";
3
3
  import { useDocumentList as s } from "./useDocumentList.js";
4
4
  import { Flex as l } from "../../../Common/Flex/Flex.js";
5
- import "classnames";
6
5
  import { DocumentList as u } from "../../../Common/DocumentList/DocumentList.js";
7
- function b() {
6
+ function L() {
8
7
  const { employeeForms: i, handleRequestFormToSign: n, documentListError: r } = s(), { t: e } = m("Employee.DocumentSigner");
9
8
  return /* @__PURE__ */ o("section", { style: { width: "100%" }, children: /* @__PURE__ */ o(l, { flexDirection: "column", gap: 32, children: /* @__PURE__ */ o(
10
9
  u,
@@ -33,6 +32,6 @@ function b() {
33
32
  ) }) });
34
33
  }
35
34
  export {
36
- b as List
35
+ L as List
37
36
  };
38
37
  //# sourceMappingURL=List.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"List.js","sources":["../../../../../src/components/Employee/DocumentSigner/DocumentList/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useDocumentList } from './useDocumentList'\nimport { Flex, DocumentList as SharedDocumentList } from '@/components/Common'\n\nexport function List() {\n const { employeeForms, handleRequestFormToSign, documentListError } = useDocumentList()\n const { t } = useTranslation('Employee.DocumentSigner')\n\n return (\n <section style={{ width: '100%' }}>\n <Flex flexDirection=\"column\" gap={32}>\n <SharedDocumentList\n forms={employeeForms.map(form => ({\n uuid: form.uuid,\n title: form.title,\n description: form.description,\n requires_signing: form.requiresSigning,\n }))}\n onRequestSign={handleRequestFormToSign}\n withError={!!documentListError}\n label={t('documentListLabel')}\n columnLabels={{\n form: t('formColumnLabel'),\n action: t('actionColumnLabel'),\n }}\n statusLabels={{\n signCta: t('signDocumentCta'),\n notSigned: t('notSigned'),\n complete: t('signDocumentComplete'),\n }}\n emptyStateLabel={t('emptyTableTitle')}\n errorLabel={t('documentListError')}\n />\n </Flex>\n </section>\n )\n}\n"],"names":["List","employeeForms","handleRequestFormToSign","documentListError","useDocumentList","t","useTranslation","jsx","Flex","SharedDocumentList","form"],"mappings":";;;;;;AAIO,SAASA,IAAO;AACrB,QAAM,EAAE,eAAAC,GAAe,yBAAAC,GAAyB,mBAAAC,EAAA,IAAsBC,EAAgB,GAChF,EAAE,GAAAC,EAAA,IAAMC,EAAe,yBAAyB;AAEtD,SACG,gBAAAC,EAAA,WAAA,EAAQ,OAAO,EAAE,OAAO,UACvB,UAAA,gBAAAA,EAACC,GAAK,EAAA,eAAc,UAAS,KAAK,IAChC,UAAA,gBAAAD;AAAA,IAACE;AAAAA,IAAA;AAAA,MACC,OAAOR,EAAc,IAAI,CAASS,OAAA;AAAA,QAChC,MAAMA,EAAK;AAAA,QACX,OAAOA,EAAK;AAAA,QACZ,aAAaA,EAAK;AAAA,QAClB,kBAAkBA,EAAK;AAAA,MAAA,EACvB;AAAA,MACF,eAAeR;AAAA,MACf,WAAW,CAAC,CAACC;AAAA,MACb,OAAOE,EAAE,mBAAmB;AAAA,MAC5B,cAAc;AAAA,QACZ,MAAMA,EAAE,iBAAiB;AAAA,QACzB,QAAQA,EAAE,mBAAmB;AAAA,MAC/B;AAAA,MACA,cAAc;AAAA,QACZ,SAASA,EAAE,iBAAiB;AAAA,QAC5B,WAAWA,EAAE,WAAW;AAAA,QACxB,UAAUA,EAAE,sBAAsB;AAAA,MACpC;AAAA,MACA,iBAAiBA,EAAE,iBAAiB;AAAA,MACpC,YAAYA,EAAE,mBAAmB;AAAA,IAAA;AAAA,KAErC,EACF,CAAA;AAEJ;"}
1
+ {"version":3,"file":"List.js","sources":["../../../../../src/components/Employee/DocumentSigner/DocumentList/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useDocumentList } from './useDocumentList'\nimport { Flex, DocumentList as SharedDocumentList } from '@/components/Common'\n\nexport function List() {\n const { employeeForms, handleRequestFormToSign, documentListError } = useDocumentList()\n const { t } = useTranslation('Employee.DocumentSigner')\n\n return (\n <section style={{ width: '100%' }}>\n <Flex flexDirection=\"column\" gap={32}>\n <SharedDocumentList\n forms={employeeForms.map(form => ({\n uuid: form.uuid,\n title: form.title,\n description: form.description,\n requires_signing: form.requiresSigning,\n }))}\n onRequestSign={handleRequestFormToSign}\n withError={!!documentListError}\n label={t('documentListLabel')}\n columnLabels={{\n form: t('formColumnLabel'),\n action: t('actionColumnLabel'),\n }}\n statusLabels={{\n signCta: t('signDocumentCta'),\n notSigned: t('notSigned'),\n complete: t('signDocumentComplete'),\n }}\n emptyStateLabel={t('emptyTableTitle')}\n errorLabel={t('documentListError')}\n />\n </Flex>\n </section>\n )\n}\n"],"names":["List","employeeForms","handleRequestFormToSign","documentListError","useDocumentList","t","useTranslation","jsx","Flex","SharedDocumentList","form"],"mappings":";;;;;AAIO,SAASA,IAAO;AACrB,QAAM,EAAE,eAAAC,GAAe,yBAAAC,GAAyB,mBAAAC,EAAA,IAAsBC,EAAgB,GAChF,EAAE,GAAAC,EAAA,IAAMC,EAAe,yBAAyB;AAEtD,SACG,gBAAAC,EAAA,WAAA,EAAQ,OAAO,EAAE,OAAO,UACvB,UAAA,gBAAAA,EAACC,GAAK,EAAA,eAAc,UAAS,KAAK,IAChC,UAAA,gBAAAD;AAAA,IAACE;AAAAA,IAAA;AAAA,MACC,OAAOR,EAAc,IAAI,CAASS,OAAA;AAAA,QAChC,MAAMA,EAAK;AAAA,QACX,OAAOA,EAAK;AAAA,QACZ,aAAaA,EAAK;AAAA,QAClB,kBAAkBA,EAAK;AAAA,MAAA,EACvB;AAAA,MACF,eAAeR;AAAA,MACf,WAAW,CAAC,CAACC;AAAA,MACb,OAAOE,EAAE,mBAAmB;AAAA,MAC5B,cAAc;AAAA,QACZ,MAAMA,EAAE,iBAAiB;AAAA,QACzB,QAAQA,EAAE,mBAAmB;AAAA,MAC/B;AAAA,MACA,cAAc;AAAA,QACZ,SAASA,EAAE,iBAAiB;AAAA,QAC5B,WAAWA,EAAE,WAAW;AAAA,QACxB,UAAUA,EAAE,sBAAsB;AAAA,MACpC;AAAA,MACA,iBAAiBA,EAAE,iBAAiB;AAAA,MACpC,YAAYA,EAAE,mBAAmB;AAAA,IAAA;AAAA,KAErC,EACF,CAAA;AAEJ;"}
@@ -8,9 +8,9 @@ import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
8
8
  import "@tanstack/react-query";
9
9
  import "../../../Base/useBase.js";
10
10
  import "../../../../shared/constants.js";
11
- import "classnames";
12
11
  import "dompurify";
13
12
  import "../../../../contexts/ComponentAdapter/useComponentContext.js";
13
+ import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
14
14
  import { createCompoundContext as t } from "../../../Base/createCompoundContext.js";
15
15
  const [d, a] = t("DocumentListContext");
16
16
  export {
@@ -1,11 +1,5 @@
1
- import { DocumentList } from './DocumentList/DocumentList';
2
- import { SignatureForm } from './SignatureForm/SignatureForm';
3
1
  import { BaseComponentInterface } from '../../Base';
4
2
  export interface DocumentSignerProps extends BaseComponentInterface<'Employee.DocumentSigner'> {
5
3
  employeeId: string;
6
4
  }
7
- export declare const DocumentSigner: {
8
- ({ employeeId, onEvent, dictionary }: DocumentSignerProps): import("react/jsx-runtime").JSX.Element;
9
- DocumentList: typeof DocumentList;
10
- SignatureForm: typeof SignatureForm;
11
- };
5
+ export declare const DocumentSigner: ({ employeeId, onEvent, dictionary }: DocumentSignerProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,27 +1,23 @@
1
- import { jsx as i } from "react/jsx-runtime";
2
- import { createMachine as c } from "robot3";
3
- import { DocumentListContextual as p } from "./documentSignerStateMachine.js";
4
- import { documentSignerMachine as u } from "./stateMachine.js";
5
- import { DocumentList as a } from "./DocumentList/DocumentList.js";
6
- import { SignatureForm as f } from "./SignatureForm/SignatureForm.js";
7
- import { Flow as s } from "../../Flow/Flow.js";
8
- import { useComponentDictionary as g } from "../../../i18n/I18n.js";
9
- const o = ({ employeeId: t, onEvent: m, dictionary: r }) => {
10
- g("Employee.DocumentSigner", r);
11
- const e = c(
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { createMachine as i } from "robot3";
3
+ import { DocumentListContextual as c } from "./documentSignerStateMachine.js";
4
+ import { documentSignerMachine as p } from "./stateMachine.js";
5
+ import { Flow as u } from "../../Flow/Flow.js";
6
+ import { useComponentDictionary as a } from "../../../i18n/I18n.js";
7
+ const d = ({ employeeId: o, onEvent: e, dictionary: n }) => {
8
+ a("Employee.DocumentSigner", n);
9
+ const t = i(
12
10
  "index",
13
- u,
14
- (n) => ({
15
- ...n,
16
- component: p,
17
- employeeId: t
11
+ p,
12
+ (m) => ({
13
+ ...m,
14
+ component: c,
15
+ employeeId: o
18
16
  })
19
17
  );
20
- return /* @__PURE__ */ i(s, { machine: e, onEvent: m });
18
+ return /* @__PURE__ */ r(u, { machine: t, onEvent: e });
21
19
  };
22
- o.DocumentList = a;
23
- o.SignatureForm = f;
24
20
  export {
25
- o as DocumentSigner
21
+ d as DocumentSigner
26
22
  };
27
23
  //# sourceMappingURL=DocumentSigner.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DocumentSigner.js","sources":["../../../../src/components/Employee/DocumentSigner/DocumentSigner.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport {\n DocumentListContextual,\n type DocumentSignerContextInterface,\n} from './documentSignerStateMachine'\nimport { documentSignerMachine } from './stateMachine'\nimport { DocumentList } from './DocumentList/DocumentList'\nimport { SignatureForm } from './SignatureForm/SignatureForm'\nimport { Flow } from '@/components/Flow/Flow'\nimport type { BaseComponentInterface } from '@/components/Base'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\nexport interface DocumentSignerProps extends BaseComponentInterface<'Employee.DocumentSigner'> {\n employeeId: string\n}\n\nexport const DocumentSigner = ({ employeeId, onEvent, dictionary }: DocumentSignerProps) => {\n useComponentDictionary('Employee.DocumentSigner', dictionary)\n\n const documentSigner = createMachine(\n 'index',\n documentSignerMachine,\n (initialContext: DocumentSignerContextInterface) => ({\n ...initialContext,\n component: DocumentListContextual,\n employeeId,\n }),\n )\n return <Flow machine={documentSigner} onEvent={onEvent} />\n}\n\nDocumentSigner.DocumentList = DocumentList\nDocumentSigner.SignatureForm = SignatureForm\n"],"names":["DocumentSigner","employeeId","onEvent","dictionary","useComponentDictionary","documentSigner","createMachine","documentSignerMachine","initialContext","DocumentListContextual","jsx","Flow","DocumentList","SignatureForm"],"mappings":";;;;;;;;AAgBO,MAAMA,IAAiB,CAAC,EAAE,YAAAC,GAAY,SAAAC,GAAS,YAAAC,QAAsC;AAC1F,EAAAC,EAAuB,2BAA2BD,CAAU;AAE5D,QAAME,IAAiBC;AAAA,IACrB;AAAA,IACAC;AAAA,IACA,CAACC,OAAoD;AAAA,MACnD,GAAGA;AAAA,MACH,WAAWC;AAAA,MACX,YAAAR;AAAA,IACF;AAAA,EACF;AACA,SAAQ,gBAAAS,EAAAC,GAAA,EAAK,SAASN,GAAgB,SAAAH,EAAkB,CAAA;AAC1D;AAEAF,EAAe,eAAeY;AAC9BZ,EAAe,gBAAgBa;"}
1
+ {"version":3,"file":"DocumentSigner.js","sources":["../../../../src/components/Employee/DocumentSigner/DocumentSigner.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport {\n DocumentListContextual,\n type DocumentSignerContextInterface,\n} from './documentSignerStateMachine'\nimport { documentSignerMachine } from './stateMachine'\nimport { Flow } from '@/components/Flow/Flow'\nimport type { BaseComponentInterface } from '@/components/Base'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\nexport interface DocumentSignerProps extends BaseComponentInterface<'Employee.DocumentSigner'> {\n employeeId: string\n}\n\nexport const DocumentSigner = ({ employeeId, onEvent, dictionary }: DocumentSignerProps) => {\n useComponentDictionary('Employee.DocumentSigner', dictionary)\n\n const documentSigner = createMachine(\n 'index',\n documentSignerMachine,\n (initialContext: DocumentSignerContextInterface) => ({\n ...initialContext,\n component: DocumentListContextual,\n employeeId,\n }),\n )\n return <Flow machine={documentSigner} onEvent={onEvent} />\n}\n"],"names":["DocumentSigner","employeeId","onEvent","dictionary","useComponentDictionary","documentSigner","createMachine","documentSignerMachine","initialContext","DocumentListContextual","jsx","Flow"],"mappings":";;;;;;AAcO,MAAMA,IAAiB,CAAC,EAAE,YAAAC,GAAY,SAAAC,GAAS,YAAAC,QAAsC;AAC1F,EAAAC,EAAuB,2BAA2BD,CAAU;AAE5D,QAAME,IAAiBC;AAAA,IACrB;AAAA,IACAC;AAAA,IACA,CAACC,OAAoD;AAAA,MACnD,GAAGA;AAAA,MACH,WAAWC;AAAA,MACX,YAAAR;AAAA,IACF;AAAA,EACF;AACA,SAAQ,gBAAAS,EAAAC,GAAA,EAAK,SAASN,GAAgB,SAAAH,EAAkB,CAAA;AAC1D;"}
@@ -1,14 +1,7 @@
1
- import { Form as FormComponent } from './Form';
2
1
  import { BaseComponentInterface, CommonComponentInterface } from '../../../Base/Base';
3
2
  interface SignatureFormProps extends CommonComponentInterface {
4
3
  employeeId: string;
5
4
  formId: string;
6
5
  }
7
6
  export declare function SignatureForm(props: SignatureFormProps & BaseComponentInterface): import("react/jsx-runtime").JSX.Element;
8
- export declare namespace SignatureForm {
9
- var Head: typeof import("./Head").Head;
10
- var Preview: typeof import("./Preview").Preview;
11
- var Form: typeof FormComponent;
12
- var Actions: typeof import("./Actions").Actions;
13
- }
14
7
  export {};
@@ -1,69 +1,63 @@
1
- import { jsx as o, jsxs as x, Fragment as b } from "react/jsx-runtime";
2
- import { useEmployeeFormsGetPdfSuspense as y } from "@gusto/embedded-api/react-query/employeeFormsGetPdf";
3
- import { useEmployeeFormsSignMutation as B } from "@gusto/embedded-api/react-query/employeeFormsSign";
4
- import { useEmployeeFormsGetSuspense as w } from "@gusto/embedded-api/react-query/employeeFormsGet";
5
- import { Form as u } from "./Form.js";
6
- import { Head as a } from "./Head.js";
7
- import { Actions as c } from "./Actions.js";
8
- import { Preview as f } from "./Preview.js";
9
- import { SignatureFormProvider as A } from "./useSignatureForm.js";
10
- import { BaseComponent as C } from "../../../Base/Base.js";
11
- import { useBase as G } from "../../../Base/useBase.js";
12
- import { useI18n as H } from "../../../../i18n/I18n.js";
13
- import { componentEvents as s } from "../../../../shared/constants.js";
1
+ import { jsx as o, jsxs as F, Fragment as E } from "react/jsx-runtime";
2
+ import { useEmployeeFormsGetPdfSuspense as h } from "@gusto/embedded-api/react-query/employeeFormsGetPdf";
3
+ import { useEmployeeFormsSignMutation as P } from "@gusto/embedded-api/react-query/employeeFormsSign";
4
+ import { useEmployeeFormsGetSuspense as x } from "@gusto/embedded-api/react-query/employeeFormsGet";
5
+ import { Form as b } from "./Form.js";
6
+ import { Head as v } from "./Head.js";
7
+ import { Actions as y } from "./Actions.js";
8
+ import { Preview as B } from "./Preview.js";
9
+ import { SignatureFormProvider as w } from "./useSignatureForm.js";
10
+ import { BaseComponent as A } from "../../../Base/Base.js";
11
+ import { useBase as C } from "../../../Base/useBase.js";
12
+ import { useI18n as G } from "../../../../i18n/I18n.js";
13
+ import { componentEvents as i } from "../../../../shared/constants.js";
14
14
  import { Flex as M } from "../../../Common/Flex/Flex.js";
15
- import "react-i18next";
16
- import "classnames";
17
15
  import { SignatureForm as R } from "../../../Common/SignatureForm/SignatureForm.js";
18
- function t(r) {
19
- return /* @__PURE__ */ o(C, { ...r, children: /* @__PURE__ */ o(j, { ...r }) });
16
+ function V(r) {
17
+ return /* @__PURE__ */ o(A, { ...r, children: /* @__PURE__ */ o(j, { ...r }) });
20
18
  }
21
- function j({ employeeId: r, formId: d, className: p, children: n }) {
22
- H("Employee.DocumentSigner");
23
- const { onEvent: m, baseSubmitHandler: l } = G(), { data: g } = w({ employeeId: r, formId: d }), e = g.form, {
24
- data: { formPdf: F }
25
- } = y({ employeeId: r, formId: e.uuid }), S = F.documentUrl, { mutateAsync: E, isPending: h } = B();
26
- return /* @__PURE__ */ o("section", { className: p, children: /* @__PURE__ */ o(
27
- A,
19
+ function j({ employeeId: r, formId: s, className: u, children: e }) {
20
+ G("Employee.DocumentSigner");
21
+ const { onEvent: t, baseSubmitHandler: a } = C(), { data: c } = x({ employeeId: r, formId: s }), n = c.form, {
22
+ data: { formPdf: f }
23
+ } = h({ employeeId: r, formId: n.uuid }), d = f.documentUrl, { mutateAsync: p, isPending: l } = P();
24
+ return /* @__PURE__ */ o("section", { className: u, children: /* @__PURE__ */ o(
25
+ w,
28
26
  {
29
27
  value: {
30
- pdfUrl: S,
28
+ pdfUrl: d,
31
29
  handleBack: () => {
32
- m(s.CANCEL);
30
+ t(i.CANCEL);
33
31
  },
34
- form: e,
35
- isPending: h
32
+ form: n,
33
+ isPending: l
36
34
  },
37
- children: /* @__PURE__ */ o(R, { onSubmit: async (P) => {
38
- await l(P, async (i) => {
39
- if (e.uuid) {
40
- const { form: v } = await E({
35
+ children: /* @__PURE__ */ o(R, { onSubmit: async (g) => {
36
+ await a(g, async (m) => {
37
+ if (n.uuid) {
38
+ const { form: S } = await p({
41
39
  request: {
42
40
  employeeId: r,
43
- formId: e.uuid,
41
+ formId: n.uuid,
44
42
  requestBody: {
45
- signatureText: i.signature,
46
- agree: i.confirmSignature
43
+ signatureText: m.signature,
44
+ agree: m.confirmSignature
47
45
  }
48
46
  }
49
47
  });
50
- m(s.EMPLOYEE_SIGN_FORM, v);
48
+ t(i.EMPLOYEE_SIGN_FORM, S);
51
49
  }
52
50
  });
53
- }, children: /* @__PURE__ */ o(M, { flexDirection: "column", children: n || /* @__PURE__ */ x(b, { children: [
54
- /* @__PURE__ */ o(a, {}),
55
- /* @__PURE__ */ o(f, {}),
56
- /* @__PURE__ */ o(u, {}),
57
- /* @__PURE__ */ o(c, {})
51
+ }, children: /* @__PURE__ */ o(M, { flexDirection: "column", children: e || /* @__PURE__ */ F(E, { children: [
52
+ /* @__PURE__ */ o(v, {}),
53
+ /* @__PURE__ */ o(B, {}),
54
+ /* @__PURE__ */ o(b, {}),
55
+ /* @__PURE__ */ o(y, {})
58
56
  ] }) }) })
59
57
  }
60
58
  ) });
61
59
  }
62
- t.Head = a;
63
- t.Preview = f;
64
- t.Form = u;
65
- t.Actions = c;
66
60
  export {
67
- t as SignatureForm
61
+ V as SignatureForm
68
62
  };
69
63
  //# sourceMappingURL=SignatureForm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SignatureForm.js","sources":["../../../../../src/components/Employee/DocumentSigner/SignatureForm/SignatureForm.tsx"],"sourcesContent":["import { useEmployeeFormsGetPdfSuspense } from '@gusto/embedded-api/react-query/employeeFormsGetPdf'\nimport { useEmployeeFormsSignMutation } from '@gusto/embedded-api/react-query/employeeFormsSign'\nimport { useEmployeeFormsGetSuspense } from '@gusto/embedded-api/react-query/employeeFormsGet'\nimport { Form as FormComponent } from './Form'\nimport { Head } from './Head'\nimport { Actions } from './Actions'\nimport { Preview } from './Preview'\nimport { SignatureFormProvider } from './useSignatureForm'\nimport {\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { Flex } from '@/components/Common'\nimport type { SignatureFormInputs } from '@/components/Common/SignatureForm'\nimport { SignatureForm as SharedSignatureForm } from '@/components/Common/SignatureForm'\n\ninterface SignatureFormProps extends CommonComponentInterface {\n employeeId: string\n formId: string\n}\n\nexport function SignatureForm(props: SignatureFormProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nfunction Root({ employeeId, formId, className, children }: SignatureFormProps) {\n useI18n('Employee.DocumentSigner')\n const { onEvent, baseSubmitHandler } = useBase()\n\n const { data } = useEmployeeFormsGetSuspense({ employeeId, formId })\n const form = data.form!\n\n const {\n data: { formPdf },\n } = useEmployeeFormsGetPdfSuspense({ employeeId, formId: form.uuid })\n const pdfUrl = formPdf!.documentUrl\n\n const { mutateAsync: signForm, isPending: isSignFormPending } = useEmployeeFormsSignMutation()\n\n const handleBack = () => {\n onEvent(componentEvents.CANCEL)\n }\n\n const handleSubmit = async (data: SignatureFormInputs) => {\n await baseSubmitHandler(data, async payload => {\n if (form.uuid) {\n const { form: signFormResult } = await signForm({\n request: {\n employeeId,\n formId: form.uuid,\n requestBody: {\n signatureText: payload.signature,\n agree: payload.confirmSignature,\n },\n },\n })\n onEvent(componentEvents.EMPLOYEE_SIGN_FORM, signFormResult)\n }\n })\n }\n\n return (\n <section className={className}>\n <SignatureFormProvider\n value={{\n pdfUrl,\n handleBack,\n form,\n isPending: isSignFormPending,\n }}\n >\n <SharedSignatureForm onSubmit={handleSubmit}>\n <Flex flexDirection=\"column\">\n {children ? (\n children\n ) : (\n <>\n <Head />\n <Preview />\n <FormComponent />\n <Actions />\n </>\n )}\n </Flex>\n </SharedSignatureForm>\n </SignatureFormProvider>\n </section>\n )\n}\n\nSignatureForm.Head = Head\nSignatureForm.Preview = Preview\nSignatureForm.Form = FormComponent\nSignatureForm.Actions = Actions\n"],"names":["SignatureForm","props","jsx","BaseComponent","Root","employeeId","formId","className","children","useI18n","onEvent","baseSubmitHandler","useBase","data","useEmployeeFormsGetSuspense","form","formPdf","useEmployeeFormsGetPdfSuspense","pdfUrl","signForm","isSignFormPending","useEmployeeFormsSignMutation","SignatureFormProvider","componentEvents","SharedSignatureForm","payload","signFormResult","Flex","jsxs","Fragment","Head","Preview","FormComponent","Actions"],"mappings":";;;;;;;;;;;;;;;;;AAyBO,SAASA,EAAcC,GAAoD;AAE9E,SAAA,gBAAAC,EAACC,KAAe,GAAGF,GACjB,4BAACG,GAAM,EAAA,GAAGH,GAAO,EACnB,CAAA;AAEJ;AAEA,SAASG,EAAK,EAAE,YAAAC,GAAY,QAAAC,GAAQ,WAAAC,GAAW,UAAAC,KAAgC;AAC7E,EAAAC,EAAQ,yBAAyB;AACjC,QAAM,EAAE,SAAAC,GAAS,mBAAAC,EAAkB,IAAIC,EAAQ,GAEzC,EAAE,MAAAC,EAAK,IAAIC,EAA4B,EAAE,YAAAT,GAAY,QAAAC,GAAQ,GAC7DS,IAAOF,EAAK,MAEZ;AAAA,IACJ,MAAM,EAAE,SAAAG,EAAQ;AAAA,EAAA,IACdC,EAA+B,EAAE,YAAAZ,GAAY,QAAQU,EAAK,MAAM,GAC9DG,IAASF,EAAS,aAElB,EAAE,aAAaG,GAAU,WAAWC,EAAA,IAAsBC,EAA6B;AAyB3F,SAAA,gBAAAnB,EAAC,aAAQ,WAAAK,GACP,UAAA,gBAAAL;AAAA,IAACoB;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,QAAAJ;AAAA,QACA,YA3BW,MAAM;AACvB,UAAAR,EAAQa,EAAgB,MAAM;AAAA,QAChC;AAAA,QA0BQ,MAAAR;AAAA,QACA,WAAWK;AAAA,MACb;AAAA,MAEA,UAAA,gBAAAlB,EAACsB,GAAoB,EAAA,UA5BN,OAAOX,MAA8B;AAClD,cAAAF,EAAkBE,GAAM,OAAMY,MAAW;AAC7C,cAAIV,EAAK,MAAM;AACb,kBAAM,EAAE,MAAMW,EAAe,IAAI,MAAMP,EAAS;AAAA,cAC9C,SAAS;AAAA,gBACP,YAAAd;AAAA,gBACA,QAAQU,EAAK;AAAA,gBACb,aAAa;AAAA,kBACX,eAAeU,EAAQ;AAAA,kBACvB,OAAOA,EAAQ;AAAA,gBAAA;AAAA,cACjB;AAAA,YACF,CACD;AACO,YAAAf,EAAAa,EAAgB,oBAAoBG,CAAc;AAAA,UAAA;AAAA,QAC5D,CACD;AAAA,MACH,GAaQ,UAAA,gBAAAxB,EAACyB,KAAK,eAAc,UACjB,UACCnB,KAGE,gBAAAoB,EAAAC,GAAA,EAAA,UAAA;AAAA,QAAA,gBAAA3B,EAAC4B,GAAK,EAAA;AAAA,0BACLC,GAAQ,EAAA;AAAA,0BACRC,GAAc,EAAA;AAAA,0BACdC,GAAQ,CAAA,CAAA;AAAA,MAAA,EACX,CAAA,EAEJ,CAAA,EACF,CAAA;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;AAEAjC,EAAc,OAAO8B;AACrB9B,EAAc,UAAU+B;AACxB/B,EAAc,OAAOgC;AACrBhC,EAAc,UAAUiC;"}
1
+ {"version":3,"file":"SignatureForm.js","sources":["../../../../../src/components/Employee/DocumentSigner/SignatureForm/SignatureForm.tsx"],"sourcesContent":["import { useEmployeeFormsGetPdfSuspense } from '@gusto/embedded-api/react-query/employeeFormsGetPdf'\nimport { useEmployeeFormsSignMutation } from '@gusto/embedded-api/react-query/employeeFormsSign'\nimport { useEmployeeFormsGetSuspense } from '@gusto/embedded-api/react-query/employeeFormsGet'\nimport { Form as FormComponent } from './Form'\nimport { Head } from './Head'\nimport { Actions } from './Actions'\nimport { Preview } from './Preview'\nimport { SignatureFormProvider } from './useSignatureForm'\nimport {\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { Flex } from '@/components/Common'\nimport type { SignatureFormInputs } from '@/components/Common/SignatureForm'\nimport { SignatureForm as SharedSignatureForm } from '@/components/Common/SignatureForm'\n\ninterface SignatureFormProps extends CommonComponentInterface {\n employeeId: string\n formId: string\n}\n\nexport function SignatureForm(props: SignatureFormProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nfunction Root({ employeeId, formId, className, children }: SignatureFormProps) {\n useI18n('Employee.DocumentSigner')\n const { onEvent, baseSubmitHandler } = useBase()\n\n const { data } = useEmployeeFormsGetSuspense({ employeeId, formId })\n const form = data.form!\n\n const {\n data: { formPdf },\n } = useEmployeeFormsGetPdfSuspense({ employeeId, formId: form.uuid })\n const pdfUrl = formPdf!.documentUrl\n\n const { mutateAsync: signForm, isPending: isSignFormPending } = useEmployeeFormsSignMutation()\n\n const handleBack = () => {\n onEvent(componentEvents.CANCEL)\n }\n\n const handleSubmit = async (data: SignatureFormInputs) => {\n await baseSubmitHandler(data, async payload => {\n if (form.uuid) {\n const { form: signFormResult } = await signForm({\n request: {\n employeeId,\n formId: form.uuid,\n requestBody: {\n signatureText: payload.signature,\n agree: payload.confirmSignature,\n },\n },\n })\n onEvent(componentEvents.EMPLOYEE_SIGN_FORM, signFormResult)\n }\n })\n }\n\n return (\n <section className={className}>\n <SignatureFormProvider\n value={{\n pdfUrl,\n handleBack,\n form,\n isPending: isSignFormPending,\n }}\n >\n <SharedSignatureForm onSubmit={handleSubmit}>\n <Flex flexDirection=\"column\">\n {children ? (\n children\n ) : (\n <>\n <Head />\n <Preview />\n <FormComponent />\n <Actions />\n </>\n )}\n </Flex>\n </SharedSignatureForm>\n </SignatureFormProvider>\n </section>\n )\n}\n"],"names":["SignatureForm","props","jsx","BaseComponent","Root","employeeId","formId","className","children","useI18n","onEvent","baseSubmitHandler","useBase","data","useEmployeeFormsGetSuspense","form","formPdf","useEmployeeFormsGetPdfSuspense","pdfUrl","signForm","isSignFormPending","useEmployeeFormsSignMutation","SignatureFormProvider","componentEvents","SharedSignatureForm","payload","signFormResult","Flex","jsxs","Fragment","Head","Preview","FormComponent","Actions"],"mappings":";;;;;;;;;;;;;;;AAyBO,SAASA,EAAcC,GAAoD;AAE9E,SAAA,gBAAAC,EAACC,KAAe,GAAGF,GACjB,4BAACG,GAAM,EAAA,GAAGH,GAAO,EACnB,CAAA;AAEJ;AAEA,SAASG,EAAK,EAAE,YAAAC,GAAY,QAAAC,GAAQ,WAAAC,GAAW,UAAAC,KAAgC;AAC7E,EAAAC,EAAQ,yBAAyB;AACjC,QAAM,EAAE,SAAAC,GAAS,mBAAAC,EAAkB,IAAIC,EAAQ,GAEzC,EAAE,MAAAC,EAAK,IAAIC,EAA4B,EAAE,YAAAT,GAAY,QAAAC,GAAQ,GAC7DS,IAAOF,EAAK,MAEZ;AAAA,IACJ,MAAM,EAAE,SAAAG,EAAQ;AAAA,EAAA,IACdC,EAA+B,EAAE,YAAAZ,GAAY,QAAQU,EAAK,MAAM,GAC9DG,IAASF,EAAS,aAElB,EAAE,aAAaG,GAAU,WAAWC,EAAA,IAAsBC,EAA6B;AAyB3F,SAAA,gBAAAnB,EAAC,aAAQ,WAAAK,GACP,UAAA,gBAAAL;AAAA,IAACoB;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,QAAAJ;AAAA,QACA,YA3BW,MAAM;AACvB,UAAAR,EAAQa,EAAgB,MAAM;AAAA,QAChC;AAAA,QA0BQ,MAAAR;AAAA,QACA,WAAWK;AAAA,MACb;AAAA,MAEA,UAAA,gBAAAlB,EAACsB,GAAoB,EAAA,UA5BN,OAAOX,MAA8B;AAClD,cAAAF,EAAkBE,GAAM,OAAMY,MAAW;AAC7C,cAAIV,EAAK,MAAM;AACb,kBAAM,EAAE,MAAMW,EAAe,IAAI,MAAMP,EAAS;AAAA,cAC9C,SAAS;AAAA,gBACP,YAAAd;AAAA,gBACA,QAAQU,EAAK;AAAA,gBACb,aAAa;AAAA,kBACX,eAAeU,EAAQ;AAAA,kBACvB,OAAOA,EAAQ;AAAA,gBAAA;AAAA,cACjB;AAAA,YACF,CACD;AACO,YAAAf,EAAAa,EAAgB,oBAAoBG,CAAc;AAAA,UAAA;AAAA,QAC5D,CACD;AAAA,MACH,GAaQ,UAAA,gBAAAxB,EAACyB,KAAK,eAAc,UACjB,UACCnB,KAGE,gBAAAoB,EAAAC,GAAA,EAAA,UAAA;AAAA,QAAA,gBAAA3B,EAAC4B,GAAK,EAAA;AAAA,0BACLC,GAAQ,EAAA;AAAA,0BACRC,GAAc,EAAA;AAAA,0BACdC,GAAQ,CAAA,CAAA;AAAA,MAAA,EACX,CAAA,EAEJ,CAAA,EACF,CAAA;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
@@ -8,9 +8,9 @@ import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
8
8
  import "@tanstack/react-query";
9
9
  import "../../../Base/useBase.js";
10
10
  import "../../../../shared/constants.js";
11
- import "classnames";
12
11
  import "dompurify";
13
12
  import "../../../../contexts/ComponentAdapter/useComponentContext.js";
13
+ import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
14
14
  import { createCompoundContext as o } from "../../../Base/createCompoundContext.js";
15
15
  const [c, d] = o("SignatureFormContext");
16
16
  export {
@@ -1,14 +1,13 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
2
  import { useTranslation as r } from "react-i18next";
3
3
  import { useEmployeeList as m } from "./useEmployeeList.js";
4
- import "classnames";
5
4
  import { ActionsLayout as s } from "../../Common/ActionsLayout/ActionsLayout.js";
6
- import { useComponentContext as p } from "../../../contexts/ComponentAdapter/useComponentContext.js";
7
- function C() {
8
- const { t } = r("Employee.EmployeeList"), { handleSkip: n, employees: e } = m(), i = p();
5
+ import { useComponentContext as l } from "../../../contexts/ComponentAdapter/useComponentContext.js";
6
+ function y() {
7
+ const { t } = r("Employee.EmployeeList"), { handleSkip: n, employees: e } = m(), i = l();
9
8
  return e.length === 0 ? null : /* @__PURE__ */ o(s, { children: /* @__PURE__ */ o(i.Button, { onClick: n, isLoading: !1, children: t("continueCta") }) });
10
9
  }
11
10
  export {
12
- C as Actions
11
+ y as Actions
13
12
  };
14
13
  //# sourceMappingURL=Actions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Actions.js","sources":["../../../../src/components/Employee/EmployeeList/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useEmployeeList } from './useEmployeeList'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { t } = useTranslation('Employee.EmployeeList')\n const { handleSkip, employees } = useEmployeeList()\n const Components = useComponentContext()\n\n if (employees.length === 0) {\n return null\n }\n\n return (\n <ActionsLayout>\n <Components.Button onClick={handleSkip} isLoading={false}>\n {t('continueCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","useTranslation","handleSkip","employees","useEmployeeList","Components","useComponentContext","jsx","ActionsLayout"],"mappings":";;;;;;AAKO,SAASA,IAAU;AACxB,QAAM,EAAE,EAAA,IAAMC,EAAe,uBAAuB,GAC9C,EAAE,YAAAC,GAAY,WAAAC,EAAU,IAAIC,EAAgB,GAC5CC,IAAaC,EAAoB;AAEnC,SAAAH,EAAU,WAAW,IAChB,OAIN,gBAAAI,EAAAC,GAAA,EACC,UAAC,gBAAAD,EAAAF,EAAW,QAAX,EAAkB,SAASH,GAAY,WAAW,IAChD,UAAE,EAAA,aAAa,EAClB,CAAA,GACF;AAEJ;"}
1
+ {"version":3,"file":"Actions.js","sources":["../../../../src/components/Employee/EmployeeList/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useEmployeeList } from './useEmployeeList'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { t } = useTranslation('Employee.EmployeeList')\n const { handleSkip, employees } = useEmployeeList()\n const Components = useComponentContext()\n\n if (employees.length === 0) {\n return null\n }\n\n return (\n <ActionsLayout>\n <Components.Button onClick={handleSkip} isLoading={false}>\n {t('continueCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","useTranslation","handleSkip","employees","useEmployeeList","Components","useComponentContext","jsx","ActionsLayout"],"mappings":";;;;;AAKO,SAASA,IAAU;AACxB,QAAM,EAAE,EAAA,IAAMC,EAAe,uBAAuB,GAC9C,EAAE,YAAAC,GAAY,WAAAC,EAAU,IAAIC,EAAgB,GAC5CC,IAAaC,EAAoB;AAEnC,SAAAH,EAAU,WAAW,IAChB,OAIN,gBAAAI,EAAAC,GAAA,EACC,UAAC,gBAAAD,EAAAF,EAAW,QAAX,EAAkB,SAASH,GAAY,WAAW,IAChD,UAAE,EAAA,aAAa,EAClB,CAAA,GACF;AAEJ;"}
@@ -3,11 +3,6 @@ interface EmployeeListProps extends CommonComponentInterface<'Employee.EmployeeL
3
3
  companyId: string;
4
4
  }
5
5
  export declare function EmployeeList(props: EmployeeListProps & BaseComponentInterface): import("react/jsx-runtime").JSX.Element;
6
- export declare namespace EmployeeList {
7
- var Head: () => import("react/jsx-runtime").JSX.Element;
8
- var List: () => import("react/jsx-runtime").JSX.Element;
9
- var Actions: typeof import("./Actions").Actions;
10
- }
11
6
  /**
12
7
  * Wrapper used inside Flows -> exposes flow context for required parameters
13
8
  */
@@ -1,42 +1,40 @@
1
- import { jsx as o, jsxs as Y } from "react/jsx-runtime";
2
- import { useState as y } from "react";
3
- import { useEmployeesListSuspense as F } from "@gusto/embedded-api/react-query/employeesList";
4
- import { useEmployeesDeleteMutation as U } from "@gusto/embedded-api/react-query/employeesDelete";
5
- import { useEmployeesUpdateOnboardingStatusMutation as W } from "@gusto/embedded-api/react-query/employeesUpdateOnboardingStatus";
6
- import { EmployeeListProvider as q } from "./useEmployeeList.js";
7
- import { Actions as h } from "./Actions.js";
8
- import { BaseComponent as H } from "../../Base/Base.js";
9
- import { useBase as j } from "../../Base/useBase.js";
10
- import { Flex as k } from "../../Common/Flex/Flex.js";
11
- import "react-i18next";
12
- import "classnames";
13
- import { useI18n as V, useComponentDictionary as z } from "../../../i18n/I18n.js";
1
+ import { jsx as o, jsxs as B } from "react/jsx-runtime";
2
+ import { useState as d } from "react";
3
+ import { useEmployeesListSuspense as C } from "@gusto/embedded-api/react-query/employeesList";
4
+ import { useEmployeesDeleteMutation as v } from "@gusto/embedded-api/react-query/employeesDelete";
5
+ import { useEmployeesUpdateOnboardingStatusMutation as G } from "@gusto/embedded-api/react-query/employeesUpdateOnboardingStatus";
6
+ import { EmployeeListProvider as Y } from "./useEmployeeList.js";
7
+ import { Actions as F } from "./Actions.js";
8
+ import { BaseComponent as U } from "../../Base/Base.js";
9
+ import { useBase as W } from "../../Base/useBase.js";
10
+ import { Flex as q } from "../../Common/Flex/Flex.js";
11
+ import { useI18n as j, useComponentDictionary as k } from "../../../i18n/I18n.js";
14
12
  import { componentEvents as s, EmployeeOnboardingStatus as l } from "../../../shared/constants.js";
15
- import { Head as P } from "./Head.js";
16
- import { List as O } from "./List.js";
17
- import { useFlow as J } from "../../Flow/useFlow.js";
18
- function m(n) {
19
- return /* @__PURE__ */ o(H, { ...n, children: /* @__PURE__ */ o(K, { ...n, children: n.children }) });
13
+ import { Head as H } from "./Head.js";
14
+ import { List as V } from "./List.js";
15
+ import { useFlow as z } from "../../Flow/useFlow.js";
16
+ function J(n) {
17
+ return /* @__PURE__ */ o(U, { ...n, children: /* @__PURE__ */ o(K, { ...n, children: n.children }) });
20
18
  }
21
- function K({ companyId: n, className: E, children: p, dictionary: g }) {
22
- V("Employee.EmployeeList"), z("Employee.EmployeeList", g);
23
- const { onEvent: a, baseSubmitHandler: r } = j(), [d, i] = y(1), [A, I] = y(5), { data: N } = F({ companyId: n, page: d, per: A }), { httpMeta: D, showEmployees: L } = N, f = L, { mutateAsync: _ } = U(), { mutateAsync: M } = W(), c = Number(D.response.headers.get("x-total-pages") ?? 1), S = (e) => {
24
- I(e);
25
- }, w = () => {
19
+ function K({ companyId: n, className: m, children: c, dictionary: y }) {
20
+ j("Employee.EmployeeList"), k("Employee.EmployeeList", y);
21
+ const { onEvent: a, baseSubmitHandler: r } = W(), [p, i] = d(1), [h, P] = d(5), { data: O } = C({ companyId: n, page: p, per: h }), { httpMeta: g, showEmployees: I } = O, N = I, { mutateAsync: A } = v(), { mutateAsync: D } = G(), E = Number(g.response.headers.get("x-total-pages") ?? 1), f = (e) => {
22
+ P(e);
23
+ }, L = () => {
26
24
  i(1);
27
- }, b = () => {
25
+ }, _ = () => {
28
26
  i((e) => Math.max(e - 1, 1));
29
- }, R = () => {
30
- i((e) => Math.min(e + 1, c));
31
- }, T = () => {
32
- i(c);
33
- }, x = async (e) => {
27
+ }, M = () => {
28
+ i((e) => Math.min(e + 1, E));
29
+ }, S = () => {
30
+ i(E);
31
+ }, w = async (e) => {
34
32
  await r(e, async (t) => {
35
- await _({
33
+ await A({
36
34
  request: { employeeId: t }
37
35
  }), a(s.EMPLOYEE_DELETED, { employeeId: t });
38
36
  });
39
- }, B = async (e) => {
37
+ }, b = async (e) => {
40
38
  await r(e, async (t) => {
41
39
  await u({
42
40
  employeeId: t,
@@ -46,7 +44,7 @@ function K({ companyId: n, className: E, children: p, dictionary: g }) {
46
44
  onboardingStatus: l.SELF_ONBOARDING_AWAITING_ADMIN_REVIEW
47
45
  });
48
46
  });
49
- }, C = async (e) => {
47
+ }, R = async (e) => {
50
48
  await r(e, async (t) => {
51
49
  await u({
52
50
  employeeId: t,
@@ -54,15 +52,15 @@ function K({ companyId: n, className: E, children: p, dictionary: g }) {
54
52
  });
55
53
  });
56
54
  }, u = async (e) => {
57
- await r(e, async ({ employeeId: t, status: v }) => {
58
- const { employeeOnboardingStatus: G } = await M({
59
- request: { employeeId: t, requestBody: { onboardingStatus: v } }
55
+ await r(e, async ({ employeeId: t, status: T }) => {
56
+ const { employeeOnboardingStatus: x } = await D({
57
+ request: { employeeId: t, requestBody: { onboardingStatus: T } }
60
58
  });
61
- a(s.EMPLOYEE_ONBOARDING_STATUS_UPDATED, G);
59
+ a(s.EMPLOYEE_ONBOARDING_STATUS_UPDATED, x);
62
60
  });
63
61
  };
64
- return /* @__PURE__ */ o("section", { className: E, children: /* @__PURE__ */ o(
65
- q,
62
+ return /* @__PURE__ */ o("section", { className: m, children: /* @__PURE__ */ o(
63
+ Y,
66
64
  {
67
65
  value: {
68
66
  handleEdit: (e, t) => {
@@ -71,38 +69,35 @@ function K({ companyId: n, className: E, children: p, dictionary: g }) {
71
69
  handleNew: () => {
72
70
  a(s.EMPLOYEE_CREATE);
73
71
  },
74
- handleReview: B,
75
- handleDelete: x,
76
- employees: f,
77
- currentPage: d,
78
- totalPages: c,
79
- handleFirstPage: w,
80
- handlePreviousPage: b,
81
- handleNextPage: R,
82
- handleLastPage: T,
83
- handleCancelSelfOnboarding: C,
84
- handleItemsPerPageChange: S,
72
+ handleReview: b,
73
+ handleDelete: w,
74
+ employees: N,
75
+ currentPage: p,
76
+ totalPages: E,
77
+ handleFirstPage: L,
78
+ handlePreviousPage: _,
79
+ handleNextPage: M,
80
+ handleLastPage: S,
81
+ handleCancelSelfOnboarding: R,
82
+ handleItemsPerPageChange: f,
85
83
  handleSkip: () => {
86
84
  a(s.EMPLOYEE_ONBOARDING_DONE);
87
85
  }
88
86
  },
89
- children: p || /* @__PURE__ */ Y(k, { flexDirection: "column", children: [
90
- /* @__PURE__ */ o(P, {}),
91
- /* @__PURE__ */ o(O, {}),
92
- /* @__PURE__ */ o(h, {})
87
+ children: c || /* @__PURE__ */ B(q, { flexDirection: "column", children: [
88
+ /* @__PURE__ */ o(H, {}),
89
+ /* @__PURE__ */ o(V, {}),
90
+ /* @__PURE__ */ o(F, {})
93
91
  ] })
94
92
  }
95
93
  ) });
96
94
  }
97
- m.Head = P;
98
- m.List = O;
99
- m.Actions = h;
100
- const he = () => {
101
- const { companyId: n, onEvent: E } = J();
102
- return /* @__PURE__ */ o(m, { companyId: n, onEvent: E });
95
+ const de = () => {
96
+ const { companyId: n, onEvent: m } = z();
97
+ return /* @__PURE__ */ o(J, { companyId: n, onEvent: m });
103
98
  };
104
99
  export {
105
- m as EmployeeList,
106
- he as EmployeeListContextual
100
+ J as EmployeeList,
101
+ de as EmployeeListContextual
107
102
  };
108
103
  //# sourceMappingURL=EmployeeList.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"EmployeeList.js","sources":["../../../../src/components/Employee/EmployeeList/EmployeeList.tsx"],"sourcesContent":["import { useState } from 'react'\nimport { useEmployeesListSuspense } from '@gusto/embedded-api/react-query/employeesList'\nimport type { OnboardingStatus } from '@gusto/embedded-api/models/operations/putv1employeesemployeeidonboardingstatus'\nimport { useEmployeesDeleteMutation } from '@gusto/embedded-api/react-query/employeesDelete'\nimport { useEmployeesUpdateOnboardingStatusMutation } from '@gusto/embedded-api/react-query/employeesUpdateOnboardingStatus'\nimport type { OnboardingContextInterface } from '../OnboardingFlow/OnboardingFlow'\nimport { EmployeeListProvider } from './useEmployeeList'\nimport { Actions } from './Actions'\nimport {\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { Flex } from '@/components/Common'\nimport { useI18n, useComponentDictionary } from '@/i18n'\nimport { componentEvents, EmployeeOnboardingStatus } from '@/shared/constants'\nimport { Head } from '@/components/Employee/EmployeeList/Head'\nimport { List } from '@/components/Employee/EmployeeList/List'\nimport { useFlow } from '@/components/Flow/useFlow'\n\n//Interface for component specific props\ninterface EmployeeListProps extends CommonComponentInterface<'Employee.EmployeeList'> {\n companyId: string\n}\n\nexport function EmployeeList(props: EmployeeListProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\nfunction Root({ companyId, className, children, dictionary }: EmployeeListProps) {\n //Using i18n hook to directly load necessary namespace\n useI18n('Employee.EmployeeList')\n useComponentDictionary('Employee.EmployeeList', dictionary)\n //Getting props from base context\n const { onEvent, baseSubmitHandler } = useBase()\n const [currentPage, setCurrentPage] = useState(1)\n const [itemsPerPage, setItemsPerPage] = useState(5)\n\n const { data } = useEmployeesListSuspense({ companyId, page: currentPage, per: itemsPerPage })\n const { httpMeta, showEmployees: employeeList } = data\n const employees = employeeList!\n\n const { mutateAsync: deleteEmployeeMutation } = useEmployeesDeleteMutation()\n const { mutateAsync: updateEmployeeOnboardingStatusMutation } =\n useEmployeesUpdateOnboardingStatusMutation()\n\n const totalPages = Number(httpMeta.response.headers.get('x-total-pages') ?? 1)\n\n const handleItemsPerPageChange = (newCount: number) => {\n setItemsPerPage(newCount)\n }\n const handleFirstPage = () => {\n setCurrentPage(1)\n }\n const handlePreviousPage = () => {\n setCurrentPage(prevPage => Math.max(prevPage - 1, 1))\n }\n const handleNextPage = () => {\n setCurrentPage(prevPage => Math.min(prevPage + 1, totalPages))\n }\n const handleLastPage = () => {\n setCurrentPage(totalPages)\n }\n const handleDelete = async (uuid: string) => {\n await baseSubmitHandler(uuid, async payload => {\n await deleteEmployeeMutation({\n request: { employeeId: payload },\n })\n\n onEvent(componentEvents.EMPLOYEE_DELETED, { employeeId: payload })\n })\n }\n /**Set onboarding status to self_onboarding_awaiting_admin_review and proceed to edit */\n const handleReview = async (data: string) => {\n await baseSubmitHandler(data, async employeeId => {\n await updateOnboardingStatus({\n employeeId,\n status: EmployeeOnboardingStatus.SELF_ONBOARDING_AWAITING_ADMIN_REVIEW,\n })\n onEvent(componentEvents.EMPLOYEE_UPDATE, {\n employeeId,\n onboardingStatus: EmployeeOnboardingStatus.SELF_ONBOARDING_AWAITING_ADMIN_REVIEW,\n })\n })\n }\n /**Update employee onboarding status reverting it back to admin_onboarding_incomplete */\n const handleCancelSelfOnboarding = async (data: string) => {\n await baseSubmitHandler(data, async employeeId => {\n await updateOnboardingStatus({\n employeeId,\n status: EmployeeOnboardingStatus.ADMIN_ONBOARDING_INCOMPLETE,\n })\n })\n }\n const updateOnboardingStatus = async (data: { employeeId: string; status: OnboardingStatus }) => {\n await baseSubmitHandler(data, async ({ employeeId, status }) => {\n const { employeeOnboardingStatus: responseData } =\n await updateEmployeeOnboardingStatusMutation({\n request: { employeeId, requestBody: { onboardingStatus: status } },\n })\n onEvent(componentEvents.EMPLOYEE_ONBOARDING_STATUS_UPDATED, responseData)\n })\n }\n const handleNew = () => {\n onEvent(componentEvents.EMPLOYEE_CREATE)\n }\n const handleSkip = () => {\n onEvent(componentEvents.EMPLOYEE_ONBOARDING_DONE)\n }\n\n const handleEdit = (uuid: string, onboardingStatus?: OnboardingStatus) => {\n onEvent(componentEvents.EMPLOYEE_UPDATE, { employeeId: uuid, onboardingStatus })\n }\n return (\n <section className={className}>\n <EmployeeListProvider\n value={{\n handleEdit,\n handleNew,\n handleReview,\n handleDelete,\n employees,\n currentPage,\n totalPages,\n handleFirstPage,\n handlePreviousPage,\n handleNextPage,\n handleLastPage,\n handleCancelSelfOnboarding,\n handleItemsPerPageChange,\n handleSkip,\n }}\n >\n {children ? (\n children\n ) : (\n <Flex flexDirection=\"column\">\n <Head />\n <List />\n <Actions />\n </Flex>\n )}\n </EmployeeListProvider>\n </section>\n )\n}\n\nEmployeeList.Head = Head\nEmployeeList.List = List\nEmployeeList.Actions = Actions\n\n/**\n * Wrapper used inside Flows -> exposes flow context for required parameters\n */\nexport const EmployeeListContextual = () => {\n const { companyId, onEvent } = useFlow<OnboardingContextInterface>()\n return <EmployeeList companyId={companyId} onEvent={onEvent} />\n}\n"],"names":["EmployeeList","props","jsx","BaseComponent","Root","companyId","className","children","dictionary","useI18n","useComponentDictionary","onEvent","baseSubmitHandler","useBase","currentPage","setCurrentPage","useState","itemsPerPage","setItemsPerPage","data","useEmployeesListSuspense","httpMeta","employeeList","employees","deleteEmployeeMutation","useEmployeesDeleteMutation","updateEmployeeOnboardingStatusMutation","useEmployeesUpdateOnboardingStatusMutation","totalPages","handleItemsPerPageChange","newCount","handleFirstPage","handlePreviousPage","prevPage","handleNextPage","handleLastPage","handleDelete","uuid","payload","componentEvents","handleReview","employeeId","updateOnboardingStatus","EmployeeOnboardingStatus","handleCancelSelfOnboarding","status","responseData","EmployeeListProvider","onboardingStatus","jsxs","Flex","Head","List","Actions","EmployeeListContextual","useFlow"],"mappings":"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"}
1
+ {"version":3,"file":"EmployeeList.js","sources":["../../../../src/components/Employee/EmployeeList/EmployeeList.tsx"],"sourcesContent":["import { useState } from 'react'\nimport { useEmployeesListSuspense } from '@gusto/embedded-api/react-query/employeesList'\nimport type { OnboardingStatus } from '@gusto/embedded-api/models/operations/putv1employeesemployeeidonboardingstatus'\nimport { useEmployeesDeleteMutation } from '@gusto/embedded-api/react-query/employeesDelete'\nimport { useEmployeesUpdateOnboardingStatusMutation } from '@gusto/embedded-api/react-query/employeesUpdateOnboardingStatus'\nimport type { OnboardingContextInterface } from '../OnboardingFlow/OnboardingFlow'\nimport { EmployeeListProvider } from './useEmployeeList'\nimport { Actions } from './Actions'\nimport {\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { Flex } from '@/components/Common'\nimport { useI18n, useComponentDictionary } from '@/i18n'\nimport { componentEvents, EmployeeOnboardingStatus } from '@/shared/constants'\nimport { Head } from '@/components/Employee/EmployeeList/Head'\nimport { List } from '@/components/Employee/EmployeeList/List'\nimport { useFlow } from '@/components/Flow/useFlow'\n\n//Interface for component specific props\ninterface EmployeeListProps extends CommonComponentInterface<'Employee.EmployeeList'> {\n companyId: string\n}\n\nexport function EmployeeList(props: EmployeeListProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\nfunction Root({ companyId, className, children, dictionary }: EmployeeListProps) {\n //Using i18n hook to directly load necessary namespace\n useI18n('Employee.EmployeeList')\n useComponentDictionary('Employee.EmployeeList', dictionary)\n //Getting props from base context\n const { onEvent, baseSubmitHandler } = useBase()\n const [currentPage, setCurrentPage] = useState(1)\n const [itemsPerPage, setItemsPerPage] = useState(5)\n\n const { data } = useEmployeesListSuspense({ companyId, page: currentPage, per: itemsPerPage })\n const { httpMeta, showEmployees: employeeList } = data\n const employees = employeeList!\n\n const { mutateAsync: deleteEmployeeMutation } = useEmployeesDeleteMutation()\n const { mutateAsync: updateEmployeeOnboardingStatusMutation } =\n useEmployeesUpdateOnboardingStatusMutation()\n\n const totalPages = Number(httpMeta.response.headers.get('x-total-pages') ?? 1)\n\n const handleItemsPerPageChange = (newCount: number) => {\n setItemsPerPage(newCount)\n }\n const handleFirstPage = () => {\n setCurrentPage(1)\n }\n const handlePreviousPage = () => {\n setCurrentPage(prevPage => Math.max(prevPage - 1, 1))\n }\n const handleNextPage = () => {\n setCurrentPage(prevPage => Math.min(prevPage + 1, totalPages))\n }\n const handleLastPage = () => {\n setCurrentPage(totalPages)\n }\n const handleDelete = async (uuid: string) => {\n await baseSubmitHandler(uuid, async payload => {\n await deleteEmployeeMutation({\n request: { employeeId: payload },\n })\n\n onEvent(componentEvents.EMPLOYEE_DELETED, { employeeId: payload })\n })\n }\n /**Set onboarding status to self_onboarding_awaiting_admin_review and proceed to edit */\n const handleReview = async (data: string) => {\n await baseSubmitHandler(data, async employeeId => {\n await updateOnboardingStatus({\n employeeId,\n status: EmployeeOnboardingStatus.SELF_ONBOARDING_AWAITING_ADMIN_REVIEW,\n })\n onEvent(componentEvents.EMPLOYEE_UPDATE, {\n employeeId,\n onboardingStatus: EmployeeOnboardingStatus.SELF_ONBOARDING_AWAITING_ADMIN_REVIEW,\n })\n })\n }\n /**Update employee onboarding status reverting it back to admin_onboarding_incomplete */\n const handleCancelSelfOnboarding = async (data: string) => {\n await baseSubmitHandler(data, async employeeId => {\n await updateOnboardingStatus({\n employeeId,\n status: EmployeeOnboardingStatus.ADMIN_ONBOARDING_INCOMPLETE,\n })\n })\n }\n const updateOnboardingStatus = async (data: { employeeId: string; status: OnboardingStatus }) => {\n await baseSubmitHandler(data, async ({ employeeId, status }) => {\n const { employeeOnboardingStatus: responseData } =\n await updateEmployeeOnboardingStatusMutation({\n request: { employeeId, requestBody: { onboardingStatus: status } },\n })\n onEvent(componentEvents.EMPLOYEE_ONBOARDING_STATUS_UPDATED, responseData)\n })\n }\n const handleNew = () => {\n onEvent(componentEvents.EMPLOYEE_CREATE)\n }\n const handleSkip = () => {\n onEvent(componentEvents.EMPLOYEE_ONBOARDING_DONE)\n }\n\n const handleEdit = (uuid: string, onboardingStatus?: OnboardingStatus) => {\n onEvent(componentEvents.EMPLOYEE_UPDATE, { employeeId: uuid, onboardingStatus })\n }\n return (\n <section className={className}>\n <EmployeeListProvider\n value={{\n handleEdit,\n handleNew,\n handleReview,\n handleDelete,\n employees,\n currentPage,\n totalPages,\n handleFirstPage,\n handlePreviousPage,\n handleNextPage,\n handleLastPage,\n handleCancelSelfOnboarding,\n handleItemsPerPageChange,\n handleSkip,\n }}\n >\n {children ? (\n children\n ) : (\n <Flex flexDirection=\"column\">\n <Head />\n <List />\n <Actions />\n </Flex>\n )}\n </EmployeeListProvider>\n </section>\n )\n}\n\n/**\n * Wrapper used inside Flows -> exposes flow context for required parameters\n */\nexport const EmployeeListContextual = () => {\n const { companyId, onEvent } = useFlow<OnboardingContextInterface>()\n return <EmployeeList companyId={companyId} onEvent={onEvent} />\n}\n"],"names":["EmployeeList","props","jsx","BaseComponent","Root","companyId","className","children","dictionary","useI18n","useComponentDictionary","onEvent","baseSubmitHandler","useBase","currentPage","setCurrentPage","useState","itemsPerPage","setItemsPerPage","data","useEmployeesListSuspense","httpMeta","employeeList","employees","deleteEmployeeMutation","useEmployeesDeleteMutation","updateEmployeeOnboardingStatusMutation","useEmployeesUpdateOnboardingStatusMutation","totalPages","handleItemsPerPageChange","newCount","handleFirstPage","handlePreviousPage","prevPage","handleNextPage","handleLastPage","handleDelete","uuid","payload","componentEvents","handleReview","employeeId","updateOnboardingStatus","EmployeeOnboardingStatus","handleCancelSelfOnboarding","status","responseData","EmployeeListProvider","onboardingStatus","jsxs","Flex","Head","List","Actions","EmployeeListContextual","useFlow"],"mappings":"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"}
@@ -1,13 +1,12 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
2
  import { useTranslation as n } from "react-i18next";
3
3
  import { Flex as r } from "../../Common/Flex/Flex.js";
4
- import "classnames";
5
4
  import { useComponentContext as m } from "../../../contexts/ComponentAdapter/useComponentContext.js";
6
- const c = () => {
5
+ const a = () => {
7
6
  const { t } = n("Employee.EmployeeList"), o = m();
8
7
  return /* @__PURE__ */ e(r, { justifyContent: "space-between", alignItems: "center", children: /* @__PURE__ */ e(o.Heading, { as: "h2", children: t("title") }) });
9
8
  };
10
9
  export {
11
- c as Head
10
+ a as Head
12
11
  };
13
12
  //# sourceMappingURL=Head.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Head.js","sources":["../../../../src/components/Employee/EmployeeList/Head.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\n// Head slot for EmployeeList component\nexport const Head = () => {\n const { t } = useTranslation('Employee.EmployeeList')\n const Components = useComponentContext()\n\n return (\n <Flex justifyContent=\"space-between\" alignItems=\"center\">\n <Components.Heading as=\"h2\">{t('title')}</Components.Heading>\n </Flex>\n )\n}\n"],"names":["Head","useTranslation","Components","useComponentContext","jsx","Flex"],"mappings":";;;;;AAKO,MAAMA,IAAO,MAAM;AACxB,QAAM,EAAE,EAAA,IAAMC,EAAe,uBAAuB,GAC9CC,IAAaC,EAAoB;AAEvC,SACG,gBAAAC,EAAAC,GAAA,EAAK,gBAAe,iBAAgB,YAAW,UAC9C,UAAA,gBAAAD,EAACF,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAE,EAAA,OAAO,EAAE,CAAA,GAC1C;AAEJ;"}
1
+ {"version":3,"file":"Head.js","sources":["../../../../src/components/Employee/EmployeeList/Head.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\n// Head slot for EmployeeList component\nexport const Head = () => {\n const { t } = useTranslation('Employee.EmployeeList')\n const Components = useComponentContext()\n\n return (\n <Flex justifyContent=\"space-between\" alignItems=\"center\">\n <Components.Heading as=\"h2\">{t('title')}</Components.Heading>\n </Flex>\n )\n}\n"],"names":["Head","useTranslation","Components","useComponentContext","jsx","Flex"],"mappings":";;;;AAKO,MAAMA,IAAO,MAAM;AACxB,QAAM,EAAE,EAAA,IAAMC,EAAe,uBAAuB,GAC9CC,IAAaC,EAAoB;AAEvC,SACG,gBAAAC,EAAAC,GAAA,EAAK,gBAAe,iBAAgB,YAAW,UAC9C,UAAA,gBAAAD,EAACF,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAE,EAAA,OAAO,EAAE,CAAA,GAC1C;AAEJ;"}