@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
@@ -4,13 +4,12 @@ import { useTranslation as l } from "react-i18next";
4
4
  import { zipValidation as n, phoneValidation as m } from "../../../../helpers/validations.js";
5
5
  import { Flex as d } from "../../../Common/Flex/Flex.js";
6
6
  import { Grid as p } from "../../../Common/Grid/Grid.js";
7
- import "classnames";
8
7
  import { STATES_ABBR as c } from "../../../../shared/constants.js";
9
8
  import { useMaskedTransform as u, commonMasks as b } from "../../../../helpers/mask.js";
10
9
  import { TextInputField as s } from "../../../Common/Fields/TextInputField/TextInputField.js";
11
10
  import { SelectField as f } from "../../../Common/Fields/SelectField/SelectField.js";
12
11
  import { CheckboxGroupField as g } from "../../../Common/Fields/CheckboxGroupField/CheckboxGroupField.js";
13
- const k = i.object({
12
+ const q = i.object({
14
13
  phoneNumber: m,
15
14
  street1: i.string().min(1),
16
15
  street2: i.string().optional(),
@@ -19,7 +18,7 @@ const k = i.object({
19
18
  zip: n,
20
19
  addressType: i.array(i.enum(["mailingAddress", "filingAddress"])).optional()
21
20
  });
22
- function S() {
21
+ function k() {
23
22
  const { t: e } = l("Company.Locations"), o = u(b.phoneMask);
24
23
  return /* @__PURE__ */ t(d, { flexDirection: "column", gap: 20, children: [
25
24
  /* @__PURE__ */ t(
@@ -105,7 +104,7 @@ function S() {
105
104
  ] });
106
105
  }
107
106
  export {
108
- S as Form,
109
- k as LocationFormSchema
107
+ k as Form,
108
+ q as LocationFormSchema
110
109
  };
111
110
  //# sourceMappingURL=Form.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Form.js","sources":["../../../../../src/components/Company/Locations/LocationForm/Form.tsx"],"sourcesContent":["import { z } from 'zod'\nimport { useTranslation } from 'react-i18next'\nimport { phoneValidation, zipValidation } from '@/helpers/validations'\nimport { CheckboxGroupField, Flex, Grid, SelectField, TextInputField } from '@/components/Common'\nimport { STATES_ABBR } from '@/shared/constants'\nimport { commonMasks, useMaskedTransform } from '@/helpers/mask'\n\nexport const LocationFormSchema = z.object({\n phoneNumber: phoneValidation,\n street1: z.string().min(1),\n street2: z.string().optional(),\n city: z.string().min(1),\n state: z.string().min(1),\n zip: zipValidation,\n addressType: z.array(z.enum(['mailingAddress', 'filingAddress'])).optional(),\n})\n\nexport type LocationFormInputs = z.infer<typeof LocationFormSchema>\n\nexport function Form() {\n const { t } = useTranslation('Company.Locations')\n const transform = useMaskedTransform(commonMasks.phoneMask)\n\n return (\n <Flex flexDirection=\"column\" gap={20}>\n <Grid\n gap={{ base: 20, small: 8 }}\n gridTemplateColumns={{ base: '1fr', small: ['1fr', '1fr'] }}\n >\n <TextInputField\n name=\"street1\"\n isRequired\n label={t('street1Label')}\n errorMessage={t('validations.street1')}\n />\n <TextInputField name=\"street2\" label={t('street2Label')} />\n <TextInputField\n name=\"city\"\n label={t('cityLabel')}\n isRequired\n errorMessage={t('validations.city')}\n />\n <SelectField\n name=\"state\"\n options={STATES_ABBR.map((stateAbbr: (typeof STATES_ABBR)[number]) => ({\n label: t(`statesHash.${stateAbbr}`, { ns: 'common' }),\n value: stateAbbr,\n }))}\n label={t('stateLabel')}\n placeholder={t('statePlaceholder')}\n errorMessage={t('validations.state')}\n isRequired\n />\n <TextInputField\n name=\"zip\"\n isRequired\n label={t('zipLabel')}\n errorMessage={t('validations.zip')}\n />\n <TextInputField\n name=\"phoneNumber\"\n isRequired\n label={t('phoneNumberLabel')}\n errorMessage={t('validations.phone')}\n transform={transform}\n />\n </Grid>\n <CheckboxGroupField\n name=\"addressType\"\n label={t('addressTypeLabel')}\n options={[\n {\n value: 'mailingAddress',\n label: t('mailingAddressLabel'),\n description: t('mailingAddressDescription'),\n },\n {\n value: 'filingAddress',\n label: t('filingAddressLabel'),\n description: t('filingAddressDescription'),\n },\n ]}\n />\n </Flex>\n )\n}\n"],"names":["LocationFormSchema","z","phoneValidation","zipValidation","Form","t","useTranslation","transform","useMaskedTransform","commonMasks","jsxs","Flex","Grid","jsx","TextInputField","SelectField","STATES_ABBR","stateAbbr","CheckboxGroupField"],"mappings":";;;;;;;;;;;;AAOa,MAAAA,IAAqBC,EAAE,OAAO;AAAA,EACzC,aAAaC;AAAA,EACb,SAASD,EAAE,SAAS,IAAI,CAAC;AAAA,EACzB,SAASA,EAAE,OAAO,EAAE,SAAS;AAAA,EAC7B,MAAMA,EAAE,SAAS,IAAI,CAAC;AAAA,EACtB,OAAOA,EAAE,SAAS,IAAI,CAAC;AAAA,EACvB,KAAKE;AAAA,EACL,aAAaF,EAAE,MAAMA,EAAE,KAAK,CAAC,kBAAkB,eAAe,CAAC,CAAC,EAAE,SAAS;AAC7E,CAAC;AAIM,SAASG,IAAO;AACrB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,mBAAmB,GAC1CC,IAAYC,EAAmBC,EAAY,SAAS;AAE1D,SACG,gBAAAC,EAAAC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,IAAA,gBAAAD;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,KAAK,EAAE,MAAM,IAAI,OAAO,EAAE;AAAA,QAC1B,qBAAqB,EAAE,MAAM,OAAO,OAAO,CAAC,OAAO,KAAK,EAAE;AAAA,QAE1D,UAAA;AAAA,UAAA,gBAAAC;AAAA,YAACC;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,YAAU;AAAA,cACV,OAAOT,EAAE,cAAc;AAAA,cACvB,cAAcA,EAAE,qBAAqB;AAAA,YAAA;AAAA,UACvC;AAA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,oBAAoB;AAAA,YAC7B,aAAaA,EAAE,0BAA0B;AAAA,UAAA;AAAA,QAC3C;AAAA,MACF;AAAA,IAAA;AAAA,EACF,GACF;AAEJ;"}
1
+ {"version":3,"file":"Form.js","sources":["../../../../../src/components/Company/Locations/LocationForm/Form.tsx"],"sourcesContent":["import { z } from 'zod'\nimport { useTranslation } from 'react-i18next'\nimport { phoneValidation, zipValidation } from '@/helpers/validations'\nimport { CheckboxGroupField, Flex, Grid, SelectField, TextInputField } from '@/components/Common'\nimport { STATES_ABBR } from '@/shared/constants'\nimport { commonMasks, useMaskedTransform } from '@/helpers/mask'\n\nexport const LocationFormSchema = z.object({\n phoneNumber: phoneValidation,\n street1: z.string().min(1),\n street2: z.string().optional(),\n city: z.string().min(1),\n state: z.string().min(1),\n zip: zipValidation,\n addressType: z.array(z.enum(['mailingAddress', 'filingAddress'])).optional(),\n})\n\nexport type LocationFormInputs = z.infer<typeof LocationFormSchema>\n\nexport function Form() {\n const { t } = useTranslation('Company.Locations')\n const transform = useMaskedTransform(commonMasks.phoneMask)\n\n return (\n <Flex flexDirection=\"column\" gap={20}>\n <Grid\n gap={{ base: 20, small: 8 }}\n gridTemplateColumns={{ base: '1fr', small: ['1fr', '1fr'] }}\n >\n <TextInputField\n name=\"street1\"\n isRequired\n label={t('street1Label')}\n errorMessage={t('validations.street1')}\n />\n <TextInputField name=\"street2\" label={t('street2Label')} />\n <TextInputField\n name=\"city\"\n label={t('cityLabel')}\n isRequired\n errorMessage={t('validations.city')}\n />\n <SelectField\n name=\"state\"\n options={STATES_ABBR.map((stateAbbr: (typeof STATES_ABBR)[number]) => ({\n label: t(`statesHash.${stateAbbr}`, { ns: 'common' }),\n value: stateAbbr,\n }))}\n label={t('stateLabel')}\n placeholder={t('statePlaceholder')}\n errorMessage={t('validations.state')}\n isRequired\n />\n <TextInputField\n name=\"zip\"\n isRequired\n label={t('zipLabel')}\n errorMessage={t('validations.zip')}\n />\n <TextInputField\n name=\"phoneNumber\"\n isRequired\n label={t('phoneNumberLabel')}\n errorMessage={t('validations.phone')}\n transform={transform}\n />\n </Grid>\n <CheckboxGroupField\n name=\"addressType\"\n label={t('addressTypeLabel')}\n options={[\n {\n value: 'mailingAddress',\n label: t('mailingAddressLabel'),\n description: t('mailingAddressDescription'),\n },\n {\n value: 'filingAddress',\n label: t('filingAddressLabel'),\n description: t('filingAddressDescription'),\n },\n ]}\n />\n </Flex>\n )\n}\n"],"names":["LocationFormSchema","z","phoneValidation","zipValidation","Form","t","useTranslation","transform","useMaskedTransform","commonMasks","jsxs","Flex","Grid","jsx","TextInputField","SelectField","STATES_ABBR","stateAbbr","CheckboxGroupField"],"mappings":";;;;;;;;;;;AAOa,MAAAA,IAAqBC,EAAE,OAAO;AAAA,EACzC,aAAaC;AAAA,EACb,SAASD,EAAE,SAAS,IAAI,CAAC;AAAA,EACzB,SAASA,EAAE,OAAO,EAAE,SAAS;AAAA,EAC7B,MAAMA,EAAE,SAAS,IAAI,CAAC;AAAA,EACtB,OAAOA,EAAE,SAAS,IAAI,CAAC;AAAA,EACvB,KAAKE;AAAA,EACL,aAAaF,EAAE,MAAMA,EAAE,KAAK,CAAC,kBAAkB,eAAe,CAAC,CAAC,EAAE,SAAS;AAC7E,CAAC;AAIM,SAASG,IAAO;AACrB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,mBAAmB,GAC1CC,IAAYC,EAAmBC,EAAY,SAAS;AAE1D,SACG,gBAAAC,EAAAC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,IAAA,gBAAAD;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,KAAK,EAAE,MAAM,IAAI,OAAO,EAAE;AAAA,QAC1B,qBAAqB,EAAE,MAAM,OAAO,OAAO,CAAC,OAAO,KAAK,EAAE;AAAA,QAE1D,UAAA;AAAA,UAAA,gBAAAC;AAAA,YAACC;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,YAAU;AAAA,cACV,OAAOT,EAAE,cAA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AAAA,UAC5C;AAAA,UACA;AAAA,YACE,OAAO;AAAA,YACP,OAAOA,EAAE,oBAAoB;AAAA,YAC7B,aAAaA,EAAE,0BAA0B;AAAA,UAAA;AAAA,QAC3C;AAAA,MACF;AAAA,IAAA;AAAA,EACF,GACF;AAEJ;"}
@@ -4,9 +4,4 @@ interface LocationFormProps extends CommonComponentInterface {
4
4
  locationId?: string;
5
5
  }
6
6
  export declare function LocationForm({ companyId, locationId, className, children, ...props }: LocationFormProps & BaseComponentInterface): import("react/jsx-runtime").JSX.Element;
7
- export declare namespace LocationForm {
8
- var Head: typeof import("./Head").Head;
9
- var Form: typeof import("./Form").Form;
10
- var Actions: () => import("react/jsx-runtime").JSX.Element;
11
- }
12
7
  export {};
@@ -1,36 +1,34 @@
1
- import { jsx as o, jsxs as N, Fragment as O } from "react/jsx-runtime";
2
- import { useForm as S, FormProvider as x } from "react-hook-form";
3
- import { zodResolver as R } from "@hookform/resolvers/zod";
4
- import { useLocationsUpdateMutation as q } from "@gusto/embedded-api/react-query/locationsUpdate";
5
- import { useLocationsRetrieveSuspense as B } from "@gusto/embedded-api/react-query/locationsRetrieve";
6
- import { useLocationsCreateMutation as I } from "@gusto/embedded-api/react-query/locationsCreate";
7
- import { Head as f } from "./Head.js";
8
- import { LocationFormSchema as M, Form as l } from "./Form.js";
9
- import { Actions as A } from "./Actions.js";
10
- import { LocationsFormProvider as _ } from "./useLocationForm.js";
11
- import { Form as w } from "../../../Common/Form/Form.js";
12
- import { Flex as z } from "../../../Common/Flex/Flex.js";
13
- import "react-i18next";
14
- import "classnames";
15
- import { BaseComponent as H } from "../../../Base/Base.js";
1
+ import { jsx as o, jsxs as T, Fragment as b } from "react/jsx-runtime";
2
+ import { useForm as D, FormProvider as E } from "react-hook-form";
3
+ import { zodResolver as N } from "@hookform/resolvers/zod";
4
+ import { useLocationsUpdateMutation as O } from "@gusto/embedded-api/react-query/locationsUpdate";
5
+ import { useLocationsRetrieveSuspense as S } from "@gusto/embedded-api/react-query/locationsRetrieve";
6
+ import { useLocationsCreateMutation as x } from "@gusto/embedded-api/react-query/locationsCreate";
7
+ import { Head as R } from "./Head.js";
8
+ import { LocationFormSchema as q, Form as B } from "./Form.js";
9
+ import { Actions as I } from "./Actions.js";
10
+ import { LocationsFormProvider as M } from "./useLocationForm.js";
11
+ import { Form as _ } from "../../../Common/Form/Form.js";
12
+ import { Flex as w } from "../../../Common/Flex/Flex.js";
13
+ import { BaseComponent as z } from "../../../Base/Base.js";
16
14
  import { useBase as U } from "../../../Base/useBase.js";
17
15
  import { useI18n as j } from "../../../../i18n/I18n.js";
18
16
  import { componentEvents as a } from "../../../../shared/constants.js";
19
- function Y(t) {
17
+ function H(t) {
20
18
  const {
21
19
  data: { location: e }
22
- } = B({ locationId: t.locationId });
23
- return /* @__PURE__ */ o(g, { ...t, location: e });
20
+ } = S({ locationId: t.locationId });
21
+ return /* @__PURE__ */ o(p, { ...t, location: e });
24
22
  }
25
- function g({
23
+ function p({
26
24
  companyId: t,
27
25
  location: e,
28
- className: i,
26
+ className: n,
29
27
  children: r
30
28
  }) {
31
29
  j("Company.Locations");
32
- const { onEvent: s, baseSubmitHandler: y } = U(), { mutateAsync: L, isPending: h } = I(), { mutateAsync: v, isPending: C } = q(), F = ["mailingAddress", "filingAddress"], { control: P, ...c } = S({
33
- resolver: R(M),
30
+ const { onEvent: s, baseSubmitHandler: f } = U(), { mutateAsync: l, isPending: A } = x(), { mutateAsync: g, isPending: y } = O(), L = ["mailingAddress", "filingAddress"], { control: h, ...d } = D({
31
+ resolver: N(q),
34
32
  defaultValues: {
35
33
  city: e?.city ?? "",
36
34
  phoneNumber: e?.phoneNumber ?? "",
@@ -38,61 +36,58 @@ function g({
38
36
  street2: e?.street2 ?? "",
39
37
  state: e?.state ?? "",
40
38
  zip: e?.zip ?? "",
41
- addressType: F.filter((n) => e?.[n] ?? !1)
39
+ addressType: L.filter((i) => e?.[i] ?? !1)
42
40
  }
43
- }), T = () => {
41
+ }), v = () => {
44
42
  s(a.CANCEL);
45
- }, b = async (n) => {
46
- await y(n, async (D) => {
47
- const { addressType: u, ...E } = D, p = {
48
- ...E,
49
- mailingAddress: u?.includes("mailingAddress"),
50
- filingAddress: u?.includes("filingAddress")
43
+ }, C = async (i) => {
44
+ await f(i, async (F) => {
45
+ const { addressType: c, ...P } = F, u = {
46
+ ...P,
47
+ mailingAddress: c?.includes("mailingAddress"),
48
+ filingAddress: c?.includes("filingAddress")
51
49
  };
52
50
  if (e && e.version !== void 0) {
53
- const { location: m } = await v({
51
+ const { location: m } = await g({
54
52
  request: {
55
53
  locationId: e.uuid,
56
- requestBody: { ...p, version: e.version }
54
+ requestBody: { ...u, version: e.version }
57
55
  }
58
56
  });
59
57
  s(a.COMPANY_LOCATION_UPDATED, m);
60
58
  } else {
61
- const { location: m } = await L({
59
+ const { location: m } = await l({
62
60
  request: {
63
61
  companyId: t,
64
- requestBody: p
62
+ requestBody: u
65
63
  }
66
64
  });
67
65
  s(a.COMPANY_LOCATION_CREATED, m);
68
66
  }
69
67
  });
70
68
  };
71
- return /* @__PURE__ */ o("section", { className: i, children: /* @__PURE__ */ o(x, { ...c, control: P, children: /* @__PURE__ */ o(w, { onSubmit: c.handleSubmit(b), children: /* @__PURE__ */ o(
72
- _,
69
+ return /* @__PURE__ */ o("section", { className: n, children: /* @__PURE__ */ o(E, { ...d, control: h, children: /* @__PURE__ */ o(_, { onSubmit: d.handleSubmit(C), children: /* @__PURE__ */ o(
70
+ M,
73
71
  {
74
- value: { handleCancel: T, isPending: h || C },
75
- children: /* @__PURE__ */ o(z, { flexDirection: "column", gap: 32, children: r || /* @__PURE__ */ N(O, { children: [
76
- /* @__PURE__ */ o(f, {}),
77
- /* @__PURE__ */ o(l, {}),
78
- /* @__PURE__ */ o(A, {})
72
+ value: { handleCancel: v, isPending: A || y },
73
+ children: /* @__PURE__ */ o(w, { flexDirection: "column", gap: 32, children: r || /* @__PURE__ */ T(b, { children: [
74
+ /* @__PURE__ */ o(R, {}),
75
+ /* @__PURE__ */ o(B, {}),
76
+ /* @__PURE__ */ o(I, {})
79
77
  ] }) })
80
78
  }
81
79
  ) }) }) });
82
80
  }
83
- function d({
81
+ function ne({
84
82
  companyId: t,
85
83
  locationId: e,
86
- className: i,
84
+ className: n,
87
85
  children: r,
88
86
  ...s
89
87
  }) {
90
- return /* @__PURE__ */ o(H, { ...s, children: e ? /* @__PURE__ */ o(Y, { companyId: t, locationId: e, className: i, children: r }) : /* @__PURE__ */ o(g, { companyId: t, className: i, children: r }) });
88
+ return /* @__PURE__ */ o(z, { ...s, children: e ? /* @__PURE__ */ o(H, { companyId: t, locationId: e, className: n, children: r }) : /* @__PURE__ */ o(p, { companyId: t, className: n, children: r }) });
91
89
  }
92
- d.Head = f;
93
- d.Form = l;
94
- d.Actions = A;
95
90
  export {
96
- d as LocationForm
91
+ ne as LocationForm
97
92
  };
98
93
  //# sourceMappingURL=LocationForm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"LocationForm.js","sources":["../../../../../src/components/Company/Locations/LocationForm/LocationForm.tsx"],"sourcesContent":["import { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { useLocationsUpdateMutation } from '@gusto/embedded-api/react-query/locationsUpdate'\nimport { useLocationsRetrieveSuspense } from '@gusto/embedded-api/react-query/locationsRetrieve'\nimport { useLocationsCreateMutation } from '@gusto/embedded-api/react-query/locationsCreate'\nimport { type Location } from '@gusto/embedded-api/models/components/location'\nimport { Head } from './Head'\nimport type { LocationFormInputs } from './Form'\nimport { Form, LocationFormSchema } from './Form'\nimport { Actions } from './Actions'\nimport { LocationsFormProvider } from './useLocationForm'\nimport { Form as HtmlForm } from '@/components/Common/Form'\nimport { Flex } from '@/components/Common'\nimport type { BaseComponentInterface, CommonComponentInterface } from '@/components/Base'\nimport { BaseComponent, useBase } from '@/components/Base'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport type { WithRequired } from '@/types/Helpers'\n\ninterface LocationFormProps extends CommonComponentInterface {\n companyId: string\n locationId?: string\n}\n\n/**Accounting for conditional logic where location data needs to be fetched only if locationId is present */\nfunction RootWithLocation(props: WithRequired<LocationFormProps, 'locationId'>) {\n const {\n data: { location },\n } = useLocationsRetrieveSuspense({ locationId: props.locationId })\n return <Root {...props} location={location} />\n}\n\nfunction Root({\n companyId,\n location,\n className,\n children,\n}: LocationFormProps & { location?: Location }) {\n useI18n('Company.Locations')\n const { onEvent, baseSubmitHandler } = useBase()\n\n const { mutateAsync: createLocation, isPending: isPendingCreate } = useLocationsCreateMutation()\n const { mutateAsync: updateLocation, isPending: isPendingUpdate } = useLocationsUpdateMutation()\n const addressType = ['mailingAddress', 'filingAddress'] as const\n\n const { control, ...methods } = useForm<LocationFormInputs>({\n resolver: zodResolver(LocationFormSchema),\n defaultValues: {\n city: location?.city ?? '',\n phoneNumber: location?.phoneNumber ?? '',\n street1: location?.street1 ?? '',\n street2: location?.street2 ?? '',\n state: location?.state ?? '',\n zip: location?.zip ?? '',\n addressType: addressType.filter(key => location?.[key] ?? false),\n },\n })\n\n const handleCancel = () => {\n onEvent(componentEvents.CANCEL)\n }\n const onSubmit = async (data: LocationFormInputs) => {\n await baseSubmitHandler(data, async innerData => {\n const { addressType, ...payload } = innerData\n\n const requestBody = {\n ...payload,\n mailingAddress: addressType?.includes('mailingAddress'),\n filingAddress: addressType?.includes('filingAddress'),\n }\n\n if (location && location.version !== undefined) {\n // Edit existing location\n const { location: responseData } = await updateLocation({\n request: {\n locationId: location.uuid,\n requestBody: { ...requestBody, version: location.version },\n },\n })\n onEvent(componentEvents.COMPANY_LOCATION_UPDATED, responseData)\n } else {\n // Add new location\n const { location: responseData } = await createLocation({\n request: {\n companyId,\n requestBody,\n },\n })\n onEvent(componentEvents.COMPANY_LOCATION_CREATED, responseData)\n }\n })\n }\n\n return (\n <section className={className}>\n <FormProvider {...methods} control={control}>\n <HtmlForm onSubmit={methods.handleSubmit(onSubmit)}>\n <LocationsFormProvider\n value={{ handleCancel, isPending: isPendingCreate || isPendingUpdate }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <Form />\n <Actions />\n </>\n )}\n </Flex>\n </LocationsFormProvider>\n </HtmlForm>\n </FormProvider>\n </section>\n )\n}\n\nexport function LocationForm({\n companyId,\n locationId,\n className,\n children,\n ...props\n}: LocationFormProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n {locationId ? (\n <RootWithLocation companyId={companyId} locationId={locationId} className={className}>\n {children}\n </RootWithLocation>\n ) : (\n <Root companyId={companyId} className={className}>\n {children}\n </Root>\n )}\n </BaseComponent>\n )\n}\n\nLocationForm.Head = Head\nLocationForm.Form = Form\nLocationForm.Actions = Actions\n"],"names":["RootWithLocation","props","location","useLocationsRetrieveSuspense","jsx","Root","companyId","className","children","useI18n","onEvent","baseSubmitHandler","useBase","createLocation","isPendingCreate","useLocationsCreateMutation","updateLocation","isPendingUpdate","useLocationsUpdateMutation","addressType","control","methods","useForm","zodResolver","LocationFormSchema","key","handleCancel","componentEvents","onSubmit","data","innerData","payload","requestBody","responseData","FormProvider","HtmlForm","LocationsFormProvider","Flex","jsxs","Fragment","Head","Form","Actions","LocationForm","locationId","BaseComponent"],"mappings":";;;;;;;;;;;;;;;;;;AAyBA,SAASA,EAAiBC,GAAsD;AACxE,QAAA;AAAA,IACJ,MAAM,EAAE,UAAAC,EAAS;AAAA,MACfC,EAA6B,EAAE,YAAYF,EAAM,YAAY;AACjE,SAAQ,gBAAAG,EAAAC,GAAA,EAAM,GAAGJ,GAAO,UAAAC,EAAoB,CAAA;AAC9C;AAEA,SAASG,EAAK;AAAA,EACZ,WAAAC;AAAA,EACA,UAAAJ;AAAA,EACA,WAAAK;AAAA,EACA,UAAAC;AACF,GAAgD;AAC9C,EAAAC,EAAQ,mBAAmB;AAC3B,QAAM,EAAE,SAAAC,GAAS,mBAAAC,EAAkB,IAAIC,EAAQ,GAEzC,EAAE,aAAaC,GAAgB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AAA;AAAA,QACF,CACD;AACO,QAAAtB,EAAAiB,EAAgB,0BAA0BM,CAAY;AAAA,MAAA;AAAA,IAChE,CACD;AAAA,EACH;AAEA,SACG,gBAAA7B,EAAA,WAAA,EAAQ,WAAAG,GACP,UAAA,gBAAAH,EAAC8B,KAAc,GAAGb,GAAS,SAAAD,GACzB,UAAA,gBAAAhB,EAAC+B,GAAS,EAAA,UAAUd,EAAQ,aAAaO,CAAQ,GAC/C,UAAA,gBAAAxB;AAAA,IAACgC;AAAA,IAAA;AAAA,MACC,OAAO,EAAE,cAAAV,GAAc,WAAWZ,KAAmBG,EAAgB;AAAA,MAErE,UAAA,gBAAAb,EAACiC,KAAK,eAAc,UAAS,KAAK,IAC/B,UAAA7B,KAIG,gBAAA8B,EAAAC,GAAA,EAAA,UAAA;AAAA,QAAA,gBAAAnC,EAACoC,GAAK,EAAA;AAAA,0BACLC,GAAK,EAAA;AAAA,0BACLC,GAAQ,CAAA,CAAA;AAAA,MAAA,EAAA,CACX,EAEJ,CAAA;AAAA,IAAA;AAAA,EAAA,EAEJ,CAAA,EACF,CAAA,GACF;AAEJ;AAEO,SAASC,EAAa;AAAA,EAC3B,WAAArC;AAAA,EACA,YAAAsC;AAAA,EACA,WAAArC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGP;AACL,GAA+C;AAC7C,2BACG4C,GAAe,EAAA,GAAG5C,GAChB,UAAA2C,sBACE5C,GAAiB,EAAA,WAAAM,GAAsB,YAAAsC,GAAwB,WAAArC,GAC7D,UAAAC,GACH,IAEA,gBAAAJ,EAACC,KAAK,WAAAC,GAAsB,WAAAC,GACzB,UAAAC,EACH,CAAA,GAEJ;AAEJ;AAEAmC,EAAa,OAAOH;AACpBG,EAAa,OAAOF;AACpBE,EAAa,UAAUD;"}
1
+ {"version":3,"file":"LocationForm.js","sources":["../../../../../src/components/Company/Locations/LocationForm/LocationForm.tsx"],"sourcesContent":["import { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { useLocationsUpdateMutation } from '@gusto/embedded-api/react-query/locationsUpdate'\nimport { useLocationsRetrieveSuspense } from '@gusto/embedded-api/react-query/locationsRetrieve'\nimport { useLocationsCreateMutation } from '@gusto/embedded-api/react-query/locationsCreate'\nimport { type Location } from '@gusto/embedded-api/models/components/location'\nimport { Head } from './Head'\nimport type { LocationFormInputs } from './Form'\nimport { Form, LocationFormSchema } from './Form'\nimport { Actions } from './Actions'\nimport { LocationsFormProvider } from './useLocationForm'\nimport { Form as HtmlForm } from '@/components/Common/Form'\nimport { Flex } from '@/components/Common'\nimport type { BaseComponentInterface, CommonComponentInterface } from '@/components/Base'\nimport { BaseComponent, useBase } from '@/components/Base'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport type { WithRequired } from '@/types/Helpers'\n\ninterface LocationFormProps extends CommonComponentInterface {\n companyId: string\n locationId?: string\n}\n\n/**Accounting for conditional logic where location data needs to be fetched only if locationId is present */\nfunction RootWithLocation(props: WithRequired<LocationFormProps, 'locationId'>) {\n const {\n data: { location },\n } = useLocationsRetrieveSuspense({ locationId: props.locationId })\n return <Root {...props} location={location} />\n}\n\nfunction Root({\n companyId,\n location,\n className,\n children,\n}: LocationFormProps & { location?: Location }) {\n useI18n('Company.Locations')\n const { onEvent, baseSubmitHandler } = useBase()\n\n const { mutateAsync: createLocation, isPending: isPendingCreate } = useLocationsCreateMutation()\n const { mutateAsync: updateLocation, isPending: isPendingUpdate } = useLocationsUpdateMutation()\n const addressType = ['mailingAddress', 'filingAddress'] as const\n\n const { control, ...methods } = useForm<LocationFormInputs>({\n resolver: zodResolver(LocationFormSchema),\n defaultValues: {\n city: location?.city ?? '',\n phoneNumber: location?.phoneNumber ?? '',\n street1: location?.street1 ?? '',\n street2: location?.street2 ?? '',\n state: location?.state ?? '',\n zip: location?.zip ?? '',\n addressType: addressType.filter(key => location?.[key] ?? false),\n },\n })\n\n const handleCancel = () => {\n onEvent(componentEvents.CANCEL)\n }\n const onSubmit = async (data: LocationFormInputs) => {\n await baseSubmitHandler(data, async innerData => {\n const { addressType, ...payload } = innerData\n\n const requestBody = {\n ...payload,\n mailingAddress: addressType?.includes('mailingAddress'),\n filingAddress: addressType?.includes('filingAddress'),\n }\n\n if (location && location.version !== undefined) {\n // Edit existing location\n const { location: responseData } = await updateLocation({\n request: {\n locationId: location.uuid,\n requestBody: { ...requestBody, version: location.version },\n },\n })\n onEvent(componentEvents.COMPANY_LOCATION_UPDATED, responseData)\n } else {\n // Add new location\n const { location: responseData } = await createLocation({\n request: {\n companyId,\n requestBody,\n },\n })\n onEvent(componentEvents.COMPANY_LOCATION_CREATED, responseData)\n }\n })\n }\n\n return (\n <section className={className}>\n <FormProvider {...methods} control={control}>\n <HtmlForm onSubmit={methods.handleSubmit(onSubmit)}>\n <LocationsFormProvider\n value={{ handleCancel, isPending: isPendingCreate || isPendingUpdate }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <Form />\n <Actions />\n </>\n )}\n </Flex>\n </LocationsFormProvider>\n </HtmlForm>\n </FormProvider>\n </section>\n )\n}\n\nexport function LocationForm({\n companyId,\n locationId,\n className,\n children,\n ...props\n}: LocationFormProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n {locationId ? (\n <RootWithLocation companyId={companyId} locationId={locationId} className={className}>\n {children}\n </RootWithLocation>\n ) : (\n <Root companyId={companyId} className={className}>\n {children}\n </Root>\n )}\n </BaseComponent>\n )\n}\n"],"names":["RootWithLocation","props","location","useLocationsRetrieveSuspense","jsx","Root","companyId","className","children","useI18n","onEvent","baseSubmitHandler","useBase","createLocation","isPendingCreate","useLocationsCreateMutation","updateLocation","isPendingUpdate","useLocationsUpdateMutation","addressType","control","methods","useForm","zodResolver","LocationFormSchema","key","handleCancel","componentEvents","onSubmit","data","innerData","payload","requestBody","responseData","FormProvider","HtmlForm","LocationsFormProvider","Flex","jsxs","Fragment","Head","Form","Actions","LocationForm","location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AArC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGP;AACL,GAA+C;AAC7C,2BACG4C,GAAe,EAAA,GAAG5C,GAChB,UAAA2C,sBACE5C,GAAiB,EAAA,WAAAM,GAAsB,YAAAsC,GAAwB,WAAArC,GAC7D,UAAAC,GACH,IAEA,gBAAAJ,EAACC,KAAK,WAAAC,GAAsB,WAAAC,GACzB,UAAAC,EACH,CAAA,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 [d, L] = o(
16
16
  "CompanyDocumentFormContext"
@@ -3,7 +3,3 @@ export interface LocationsProps extends BaseComponentInterface<'Company.Location
3
3
  companyId: string;
4
4
  }
5
5
  export declare function Locations({ companyId, onEvent, dictionary }: LocationsProps): import("react/jsx-runtime").JSX.Element;
6
- export declare namespace Locations {
7
- var LocationsList: typeof import("./LocationsList").LocationsList;
8
- var LocationForm: typeof import("./LocationForm/LocationForm").LocationForm;
9
- }
@@ -1,27 +1,23 @@
1
- import { jsx as a } from "react/jsx-runtime";
2
- import { createMachine as c } from "robot3";
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { createMachine as a } from "robot3";
3
3
  import { locationsStateMachine as e } from "./stateMachine.js";
4
- import { LocationsListContextual as s } from "./locationsStateMachine.js";
5
- import { LocationForm as p } from "./LocationForm/LocationForm.js";
6
- import { Flow as L } from "../../Flow/Flow.js";
7
- import { useComponentDictionary as f } from "../../../i18n/I18n.js";
8
- import { LocationsList as u } from "./LocationsList/LocationsList.js";
9
- function o({ companyId: t, onEvent: i, dictionary: n }) {
10
- f("Company.Locations", n);
11
- const m = c(
4
+ import { LocationsListContextual as c } from "./locationsStateMachine.js";
5
+ import { Flow as p } from "../../Flow/Flow.js";
6
+ import { useComponentDictionary as s } from "../../../i18n/I18n.js";
7
+ function C({ companyId: o, onEvent: t, dictionary: n }) {
8
+ s("Company.Locations", n);
9
+ const i = a(
12
10
  "index",
13
11
  e,
14
- (r) => ({
15
- ...r,
16
- component: s,
17
- companyId: t
12
+ (m) => ({
13
+ ...m,
14
+ component: c,
15
+ companyId: o
18
16
  })
19
17
  );
20
- return /* @__PURE__ */ a(L, { machine: m, onEvent: i });
18
+ return /* @__PURE__ */ r(p, { machine: i, onEvent: t });
21
19
  }
22
- o.LocationsList = u;
23
- o.LocationForm = p;
24
20
  export {
25
- o as Locations
21
+ C as Locations
26
22
  };
27
23
  //# sourceMappingURL=Locations.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Locations.js","sources":["../../../../src/components/Company/Locations/Locations.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { type LocationsContextInterface } from './locationsStateMachine'\nimport { locationsStateMachine } from './stateMachine'\nimport { LocationsListContextual } from './locationsStateMachine'\nimport { LocationsList } from './LocationsList'\nimport { LocationForm } from './LocationForm/LocationForm'\nimport { Flow } from '@/components/Flow/Flow'\nimport type { BaseComponentInterface } from '@/components/Base'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\nexport interface LocationsProps extends BaseComponentInterface<'Company.Locations'> {\n companyId: string\n}\n\nexport function Locations({ companyId, onEvent, dictionary }: LocationsProps) {\n useComponentDictionary('Company.Locations', dictionary)\n\n const manageLocations = createMachine(\n 'index',\n locationsStateMachine,\n (initialContext: LocationsContextInterface) => ({\n ...initialContext,\n component: LocationsListContextual,\n companyId,\n }),\n )\n return <Flow machine={manageLocations} onEvent={onEvent} />\n}\n\nLocations.LocationsList = LocationsList\nLocations.LocationForm = LocationForm\n"],"names":["Locations","companyId","onEvent","dictionary","useComponentDictionary","manageLocations","createMachine","locationsStateMachine","initialContext","LocationsListContextual","jsx","Flow","LocationsList","LocationForm"],"mappings":";;;;;;;;AAcO,SAASA,EAAU,EAAE,WAAAC,GAAW,SAAAC,GAAS,YAAAC,KAA8B;AAC5E,EAAAC,EAAuB,qBAAqBD,CAAU;AAEtD,QAAME,IAAkBC;AAAA,IACtB;AAAA,IACAC;AAAA,IACA,CAACC,OAA+C;AAAA,MAC9C,GAAGA;AAAA,MACH,WAAWC;AAAA,MACX,WAAAR;AAAA,IACF;AAAA,EACF;AACA,SAAQ,gBAAAS,EAAAC,GAAA,EAAK,SAASN,GAAiB,SAAAH,EAAkB,CAAA;AAC3D;AAEAF,EAAU,gBAAgBY;AAC1BZ,EAAU,eAAea;"}
1
+ {"version":3,"file":"Locations.js","sources":["../../../../src/components/Company/Locations/Locations.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { type LocationsContextInterface } from './locationsStateMachine'\nimport { locationsStateMachine } from './stateMachine'\nimport { LocationsListContextual } from './locationsStateMachine'\nimport { Flow } from '@/components/Flow/Flow'\nimport type { BaseComponentInterface } from '@/components/Base'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\nexport interface LocationsProps extends BaseComponentInterface<'Company.Locations'> {\n companyId: string\n}\n\nexport function Locations({ companyId, onEvent, dictionary }: LocationsProps) {\n useComponentDictionary('Company.Locations', dictionary)\n\n const manageLocations = createMachine(\n 'index',\n locationsStateMachine,\n (initialContext: LocationsContextInterface) => ({\n ...initialContext,\n component: LocationsListContextual,\n companyId,\n }),\n )\n return <Flow machine={manageLocations} onEvent={onEvent} />\n}\n"],"names":["Locations","companyId","onEvent","dictionary","useComponentDictionary","manageLocations","createMachine","locationsStateMachine","initialContext","LocationsListContextual","jsx","Flow"],"mappings":";;;;;;AAYO,SAASA,EAAU,EAAE,WAAAC,GAAW,SAAAC,GAAS,YAAAC,KAA8B;AAC5E,EAAAC,EAAuB,qBAAqBD,CAAU;AAEtD,QAAME,IAAkBC;AAAA,IACtB;AAAA,IACAC;AAAA,IACA,CAACC,OAA+C;AAAA,MAC9C,GAAGA;AAAA,MACH,WAAWC;AAAA,MACX,WAAAR;AAAA,IACF;AAAA,EACF;AACA,SAAQ,gBAAAS,EAAAC,GAAA,EAAK,SAASN,GAAiB,SAAAH,EAAkB,CAAA;AAC3D;"}
@@ -1,10 +1,9 @@
1
1
  import { jsxs as c, jsx as t } from "react/jsx-runtime";
2
2
  import { useTranslation as s } from "react-i18next";
3
3
  import { useLocationsList as a } from "./useLocationsList.js";
4
- import "classnames";
5
4
  import { ActionsLayout as e } from "../../../Common/ActionsLayout/ActionsLayout.js";
6
5
  import { useComponentContext as m } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
7
- function L() {
6
+ function f() {
8
7
  const { t: o } = s("Company.Locations"), { handleAddLocation: i, handleContinue: r } = a(), n = m();
9
8
  return /* @__PURE__ */ c(e, { children: [
10
9
  /* @__PURE__ */ t(n.Button, { variant: "secondary", onClick: i, children: o("addLocationCta") }),
@@ -12,6 +11,6 @@ function L() {
12
11
  ] });
13
12
  }
14
13
  export {
15
- L as Actions
14
+ f as Actions
16
15
  };
17
16
  //# sourceMappingURL=Actions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/Locations/LocationsList/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useLocationsList } from './useLocationsList'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { t } = useTranslation('Company.Locations')\n const { handleAddLocation, handleContinue } = useLocationsList()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleAddLocation}>\n {t('addLocationCta')}\n </Components.Button>\n <Components.Button onClick={handleContinue}>{t('continueCta')}</Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","t","useTranslation","handleAddLocation","handleContinue","useLocationsList","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;;;;AAKO,SAASA,IAAU;AACxB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,mBAAmB,GAC1C,EAAE,mBAAAC,GAAmB,gBAAAC,EAAe,IAAIC,EAAiB,GACzDC,IAAaC,EAAoB;AAEvC,2BACGC,GACC,EAAA,UAAA;AAAA,IAAC,gBAAAC,EAAAH,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASH,GAC7C,UAAEF,EAAA,gBAAgB,EACrB,CAAA;AAAA,IACA,gBAAAQ,EAACH,EAAW,QAAX,EAAkB,SAASF,GAAiB,UAAAH,EAAE,aAAa,EAAE,CAAA;AAAA,EAAA,GAChE;AAEJ;"}
1
+ {"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/Locations/LocationsList/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useLocationsList } from './useLocationsList'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { t } = useTranslation('Company.Locations')\n const { handleAddLocation, handleContinue } = useLocationsList()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleAddLocation}>\n {t('addLocationCta')}\n </Components.Button>\n <Components.Button onClick={handleContinue}>{t('continueCta')}</Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","t","useTranslation","handleAddLocation","handleContinue","useLocationsList","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;;;AAKO,SAASA,IAAU;AACxB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,mBAAmB,GAC1C,EAAE,mBAAAC,GAAmB,gBAAAC,EAAe,IAAIC,EAAiB,GACzDC,IAAaC,EAAoB;AAEvC,2BACGC,GACC,EAAA,UAAA;AAAA,IAAC,gBAAAC,EAAAH,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASH,GAC7C,UAAEF,EAAA,gBAAgB,EACrB,CAAA;AAAA,IACA,gBAAAQ,EAACH,EAAW,QAAX,EAAkB,SAASF,GAAiB,UAAAH,EAAE,aAAa,EAAE,CAAA;AAAA,EAAA,GAChE;AAEJ;"}
@@ -2,7 +2,6 @@ import { jsx as t, Fragment as r, jsxs as n } from "react/jsx-runtime";
2
2
  import { useTranslation as L } from "react-i18next";
3
3
  import { useLocationsList as C } from "./useLocationsList.js";
4
4
  import P from "../../../../assets/icons/pencil.svg.js";
5
- import "classnames";
6
5
  import { EmptyData as b } from "../../../Common/EmptyData/EmptyData.js";
7
6
  import { useComponentContext as y } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
8
7
  import { HamburgerMenu as x } from "../../../Common/HamburgerMenu/HamburgerMenu.js";
@@ -10,7 +9,7 @@ import { getStreet as T, getCityStateZip as A } from "../../../../helpers/format
10
9
  import { VisuallyHidden as k } from "../../../Common/VisuallyHidden/VisuallyHidden.js";
11
10
  import { useDataView as D } from "../../../Common/DataView/useDataView.js";
12
11
  import { DataView as S } from "../../../Common/DataView/DataView.js";
13
- const Z = () => {
12
+ const N = () => {
14
13
  const a = y(), {
15
14
  locationList: o,
16
15
  handleEditLocation: s,
@@ -77,6 +76,6 @@ const Z = () => {
77
76
  return /* @__PURE__ */ t(S, { label: e("locationListLabel"), ...f });
78
77
  };
79
78
  export {
80
- Z as List
79
+ N as List
81
80
  };
82
81
  //# sourceMappingURL=List.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"List.js","sources":["../../../../../src/components/Company/Locations/LocationsList/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useLocationsList } from './useLocationsList'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport { DataView, EmptyData, useDataView, VisuallyHidden } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\nimport { getCityStateZip, getStreet } from '@/helpers/formattedStrings'\n\n/**List of employees slot for EmployeeList component */\nexport const List = () => {\n const Components = useComponentContext()\n const {\n locationList,\n handleEditLocation,\n currentPage,\n totalPages,\n handleFirstPage,\n handleItemsPerPageChange,\n handleLastPage,\n handleNextPage,\n handlePreviousPage,\n handleAddLocation,\n } = useLocationsList()\n\n const { t } = useTranslation('Company.Locations')\n const { ...dataViewProps } = useDataView({\n data: locationList,\n columns: [\n {\n key: 'name',\n title: t('locationListCol1'),\n render: location => {\n return (\n <>\n <address>\n <Components.Text as=\"span\">{getStreet(location)}</Components.Text>\n <br />\n <Components.Text as=\"span\" size=\"sm\">\n {getCityStateZip(location)}\n </Components.Text>\n </address>\n </>\n )\n },\n },\n {\n key: 'status',\n title: <VisuallyHidden>{t('locationListCol2')}</VisuallyHidden>,\n render: location => {\n return (\n <>\n {location.mailingAddress && (\n <Components.Badge status={'info'}>{t('mailingAddress')}</Components.Badge>\n )}\n {location.filingAddress && (\n <>\n {' '}\n <Components.Badge status={'info'}>{t('filingAddress')}</Components.Badge>\n </>\n )}\n </>\n )\n },\n },\n ],\n itemMenu: location => {\n return (\n <HamburgerMenu\n items={[\n {\n label: t('editCta'),\n onClick: () => {\n handleEditLocation(location.uuid)\n },\n icon: <PencilSvg aria-hidden />,\n 'data-testid': 'edit-location',\n },\n ]}\n data-testid=\"location-hamburger\"\n triggerLabel={t('hamburgerTitle')}\n />\n )\n },\n pagination: {\n handleNextPage,\n handleFirstPage,\n handleLastPage,\n handlePreviousPage,\n handleItemsPerPageChange,\n currentPage,\n totalPages,\n },\n emptyState: () => (\n <EmptyData title={t('emptyTableTitle')} description={t('emptyTableDescription')}>\n <Components.Button variant=\"secondary\" onClick={handleAddLocation}>\n {t('addFirstLocationCta')}\n </Components.Button>\n </EmptyData>\n ),\n })\n return <DataView label={t('locationListLabel')} {...dataViewProps} />\n}\n"],"names":["List","Components","useComponentContext","locationList","handleEditLocation","currentPage","totalPages","handleFirstPage","handleItemsPerPageChange","handleLastPage","handleNextPage","handlePreviousPage","handleAddLocation","useLocationsList","t","useTranslation","dataViewProps","useDataView","location","jsx","Fragment","get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YACD,gBAAAD,EAAClB,EAAW,OAAX,EAAiB,QAAQ,QAAS,UAAAa,EAAE,eAAe,EAAE,CAAA;AAAA,UAAA,EACxD,CAAA;AAAA,QAAA,GAEJ;AAAA,MAEJ;AAAA,IAEJ;AAAA,IACA,UAAU,CAAYI,MAElB,gBAAAC;AAAA,MAACM;AAAA,MAAA;AAAA,QACC,OAAO;AAAA,UACL;AAAA,YACE,OAAOX,EAAE,SAAS;AAAA,YAClB,SAAS,MAAM;AACb,cAAAV,EAAmBc,EAAS,IAAI;AAAA,YAClC;AAAA,YACA,MAAM,gBAAAC,EAACO,GAAU,EAAA,eAAW,GAAC,CAAA;AAAA,YAC7B,eAAe;AAAA,UAAA;AAAA,QAEnB;AAAA,QACA,eAAY;AAAA,QACZ,cAAcZ,EAAE,gBAAgB;AAAA,MAAA;AAAA,IAClC;AAAA,IAGJ,YAAY;AAAA,MACV,gBAAAJ;AAAA,MACA,iBAAAH;AAAA,MACA,gBAAAE;AAAA,MACA,oBAAAE;AAAA,MACA,0BAAAH;AAAA,MACA,aAAAH;AAAA,MACA,YAAAC;AAAA,IACF;AAAA,IACA,YAAY,MACT,gBAAAa,EAAAQ,GAAA,EAAU,OAAOb,EAAE,iBAAiB,GAAG,aAAaA,EAAE,uBAAuB,GAC5E,UAAC,gBAAAK,EAAAlB,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASW,GAC7C,UAAAE,EAAE,qBAAqB,EAC1B,CAAA,EACF,CAAA;AAAA,EAAA,CAEH;AACD,2BAAQc,GAAS,EAAA,OAAOd,EAAE,mBAAmB,GAAI,GAAGE,GAAe;AACrE;"}
1
+ {"version":3,"file":"List.js","sources":["../../../../../src/components/Company/Locations/LocationsList/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useLocationsList } from './useLocationsList'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport { DataView, EmptyData, useDataView, VisuallyHidden } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\nimport { getCityStateZip, getStreet } from '@/helpers/formattedStrings'\n\n/**List of employees slot for EmployeeList component */\nexport const List = () => {\n const Components = useComponentContext()\n const {\n locationList,\n handleEditLocation,\n currentPage,\n totalPages,\n handleFirstPage,\n handleItemsPerPageChange,\n handleLastPage,\n handleNextPage,\n handlePreviousPage,\n handleAddLocation,\n } = useLocationsList()\n\n const { t } = useTranslation('Company.Locations')\n const { ...dataViewProps } = useDataView({\n data: locationList,\n columns: [\n {\n key: 'name',\n title: t('locationListCol1'),\n render: location => {\n return (\n <>\n <address>\n <Components.Text as=\"span\">{getStreet(location)}</Components.Text>\n <br />\n <Components.Text as=\"span\" size=\"sm\">\n {getCityStateZip(location)}\n </Components.Text>\n </address>\n </>\n )\n },\n },\n {\n key: 'status',\n title: <VisuallyHidden>{t('locationListCol2')}</VisuallyHidden>,\n render: location => {\n return (\n <>\n {location.mailingAddress && (\n <Components.Badge status={'info'}>{t('mailingAddress')}</Components.Badge>\n )}\n {location.filingAddress && (\n <>\n {' '}\n <Components.Badge status={'info'}>{t('filingAddress')}</Components.Badge>\n </>\n )}\n </>\n )\n },\n },\n ],\n itemMenu: location => {\n return (\n <HamburgerMenu\n items={[\n {\n label: t('editCta'),\n onClick: () => {\n handleEditLocation(location.uuid)\n },\n icon: <PencilSvg aria-hidden />,\n 'data-testid': 'edit-location',\n },\n ]}\n data-testid=\"location-hamburger\"\n triggerLabel={t('hamburgerTitle')}\n />\n )\n },\n pagination: {\n handleNextPage,\n handleFirstPage,\n handleLastPage,\n handlePreviousPage,\n handleItemsPerPageChange,\n currentPage,\n totalPages,\n },\n emptyState: () => (\n <EmptyData title={t('emptyTableTitle')} description={t('emptyTableDescription')}>\n <Components.Button variant=\"secondary\" onClick={handleAddLocation}>\n {t('addFirstLocationCta')}\n </Components.Button>\n </EmptyData>\n ),\n })\n return <DataView label={t('locationListLabel')} {...dataViewProps} />\n}\n"],"names":["List","Components","useComponentContext","locationList","handleEditLocation","currentPage","totalPages","handleFirstPage","handleItemsPerPageChange","handleLastPage","handleNextPage","handlePreviousPage","handleAddLocation","useLocationsList","t","useTranslation","dataViewProps","useDataView","location","jsx","Fragment","getStreet","getCityStateZip","VisuallyHidden","jsxs","HamburgerMenu","PencilSvg","EmptyData","DataView"],"mappings":";;;;;;;;;;;AASO,MAAMA,IAAO,MAAM;AACxB,QAAMC,IAAaC,EAAoB,GACjC;AAAA,IACJ,cAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,YAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,0BAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,mBAAAC;AAAA,MACEC,EAAiB,GAEf,EAAE,GAAAC,EAAA,IAAMC,EAAe,mBAAmB,GAC1C,EAAE,GAAGC,EAAc,IAAIC,EAAY;AAAA,IACvC,MAAMd;AAAA,IACN,SAAS;AAAA,MACP;AAAA,QACE,KAAK;AAAA,QACL,OAAOW,EAAE,kBAAkB;AAAA,QAC3B,QAAQ,CAAYI,MAEhB,gBAAAC,EAAAC,GAAA,EACE,4BAAC,WACC,EAAA,UAAA;AAAA,UAAA,gBAAAD,EAAClB,EAAW,MAAX,EAAgB,IAAG,QAAQ,UAAAoB,EAAUH,CAAQ,GAAE;AAAA,4BAC/C,MAAG,EAAA;AAAA,UACJ,gBAAAC,EAAClB,EAAW,MAAX,EAAgB,IAAG,QAAO,MAAK,MAC7B,UAAgBqB,EAAAJ,CAAQ,EAC3B,CAAA;AAAA,QAAA,EAAA,CACF,EACF,CAAA;AAAA,MAGN;AAAA,MACA;AAAA,QACE,KAAK;AAAA,QACL,OAAO,gBAAAC,EAACI,GAAgB,EAAA,UAAAT,EAAE,kBAAkB,GAAE;AAAA,QAC9C,QAAQ,CAAYI,MAGb,gBAAAM,EAAAJ,GAAA,EAAA,UAAA;AAAA,UAASF,EAAA,oCACPjB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ationsList(props: LocationsListProps): import("react/jsx-runtime").JSX.Element;
6
- export declare namespace LocationsList {
7
- var Head: typeof import("./Head").Head;
8
- var List: () => import("react/jsx-runtime").JSX.Element;
9
- var Actions: typeof import("./Actions").Actions;
10
- }
11
6
  export {};
@@ -1,31 +1,29 @@
1
- import { jsx as e, jsxs as C, Fragment as A } from "react/jsx-runtime";
2
- import { useLocationsGetSuspense as N } from "@gusto/embedded-api/react-query/locationsGet";
3
- import { useState as d } from "react";
4
- import { Head as l } from "./Head.js";
5
- import { List as h } from "./List.js";
6
- import { Actions as P } from "./Actions.js";
7
- import { LocationsListProvider as O } from "./useLocationsList.js";
8
- import { useI18n as x } from "../../../../i18n/I18n.js";
9
- import { BaseComponent as E } from "../../../Base/Base.js";
10
- import { useBase as I } from "../../../Base/useBase.js";
11
- import { Flex as v } from "../../../Common/Flex/Flex.js";
12
- import "react-i18next";
13
- import "classnames";
14
- import { companyEvents as i } from "../../../../shared/constants.js";
15
- function s(o) {
16
- return /* @__PURE__ */ e(E, { ...o, children: /* @__PURE__ */ e(M, { ...o, children: o.children }) });
1
+ import { jsx as e, jsxs as p, Fragment as u } from "react/jsx-runtime";
2
+ import { useLocationsGetSuspense as L } from "@gusto/embedded-api/react-query/locationsGet";
3
+ import { useState as m } from "react";
4
+ import { Head as f } from "./Head.js";
5
+ import { List as C } from "./List.js";
6
+ import { Actions as A } from "./Actions.js";
7
+ import { LocationsListProvider as N } from "./useLocationsList.js";
8
+ import { useI18n as O } from "../../../../i18n/I18n.js";
9
+ import { BaseComponent as x } from "../../../Base/Base.js";
10
+ import { useBase as E } from "../../../Base/useBase.js";
11
+ import { Flex as I } from "../../../Common/Flex/Flex.js";
12
+ import { companyEvents as s } from "../../../../shared/constants.js";
13
+ function Q(o) {
14
+ return /* @__PURE__ */ e(x, { ...o, children: /* @__PURE__ */ e(v, { ...o, children: o.children }) });
17
15
  }
18
- function M({ companyId: o, className: g, children: c }) {
19
- x("Company.Locations");
20
- const { onEvent: a } = I(), [m, n] = d(1), [p, L] = d(5), {
21
- data: { locationList: u, httpMeta: f }
22
- } = N({ companyId: o, page: m, per: p }), r = Number(f.response.headers.get("x-total-pages") ?? 1);
23
- return /* @__PURE__ */ e("section", { className: g, children: /* @__PURE__ */ e(
24
- O,
16
+ function v({ companyId: o, className: d, children: i }) {
17
+ O("Company.Locations");
18
+ const { onEvent: a } = E(), [c, n] = m(1), [l, h] = m(5), {
19
+ data: { locationList: P, httpMeta: g }
20
+ } = L({ companyId: o, page: c, per: l }), r = Number(g.response.headers.get("x-total-pages") ?? 1);
21
+ return /* @__PURE__ */ e("section", { className: d, children: /* @__PURE__ */ e(
22
+ N,
25
23
  {
26
24
  value: {
27
- locationList: u ?? [],
28
- currentPage: m,
25
+ locationList: P ?? [],
26
+ currentPage: c,
29
27
  totalPages: r,
30
28
  handleFirstPage: () => {
31
29
  n(1);
@@ -40,30 +38,27 @@ function M({ companyId: o, className: g, children: c }) {
40
38
  n(r);
41
39
  },
42
40
  handleItemsPerPageChange: (t) => {
43
- L(t);
41
+ h(t);
44
42
  },
45
43
  handleAddLocation: () => {
46
- a(i.COMPANY_LOCATION_CREATE);
44
+ a(s.COMPANY_LOCATION_CREATE);
47
45
  },
48
46
  handleEditLocation: (t) => {
49
- a(i.COMPANY_LOCATION_EDIT, { uuid: t });
47
+ a(s.COMPANY_LOCATION_EDIT, { uuid: t });
50
48
  },
51
49
  handleContinue: () => {
52
- a(i.COMPANY_LOCATION_DONE);
50
+ a(s.COMPANY_LOCATION_DONE);
53
51
  }
54
52
  },
55
- children: /* @__PURE__ */ e(v, { flexDirection: "column", gap: 32, children: c || /* @__PURE__ */ C(A, { children: [
56
- /* @__PURE__ */ e(l, {}),
57
- /* @__PURE__ */ e(h, {}),
58
- /* @__PURE__ */ e(P, {})
53
+ children: /* @__PURE__ */ e(I, { flexDirection: "column", gap: 32, children: i || /* @__PURE__ */ p(u, { children: [
54
+ /* @__PURE__ */ e(f, {}),
55
+ /* @__PURE__ */ e(C, {}),
56
+ /* @__PURE__ */ e(A, {})
59
57
  ] }) })
60
58
  }
61
59
  ) });
62
60
  }
63
- s.Head = l;
64
- s.List = h;
65
- s.Actions = P;
66
61
  export {
67
- s as LocationsList
62
+ Q as LocationsList
68
63
  };
69
64
  //# sourceMappingURL=LocationsList.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"LocationsList.js","sources":["../../../../../src/components/Company/Locations/LocationsList/LocationsList.tsx"],"sourcesContent":["import { useLocationsGetSuspense } from '@gusto/embedded-api/react-query/locationsGet'\nimport { useState } from 'react'\nimport { Head } from './Head'\nimport { List } from './List'\nimport { Actions } from './Actions'\nimport { LocationsListProvider } from './useLocationsList'\nimport { useI18n } from '@/i18n'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { Flex } from '@/components/Common'\nimport { companyEvents } from '@/shared/constants'\n\ninterface LocationsListProps extends BaseComponentInterface {\n companyId: string\n}\n\nexport function LocationsList(props: LocationsListProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ companyId, className, children }: LocationsListProps) {\n useI18n('Company.Locations')\n const { onEvent } = useBase()\n\n const [currentPage, setCurrentPage] = useState(1)\n const [itemsPerPage, setItemsPerPage] = useState(5)\n\n const {\n data: { locationList, httpMeta },\n } = useLocationsGetSuspense({ companyId, page: currentPage, per: itemsPerPage })\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\n const handleContinue = () => {\n onEvent(companyEvents.COMPANY_LOCATION_DONE)\n }\n const handleAddLocation = () => {\n onEvent(companyEvents.COMPANY_LOCATION_CREATE)\n }\n const handleEditLocation = (uuid: string) => {\n onEvent(companyEvents.COMPANY_LOCATION_EDIT, { uuid })\n }\n\n return (\n <section className={className}>\n <LocationsListProvider\n value={{\n locationList: locationList ?? [],\n currentPage,\n totalPages,\n handleFirstPage,\n handlePreviousPage,\n handleNextPage,\n handleLastPage,\n handleItemsPerPageChange,\n handleAddLocation,\n handleEditLocation,\n handleContinue,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <List />\n <Actions />\n </>\n )}\n </Flex>\n </LocationsListProvider>\n </section>\n )\n}\n\nLocationsList.Head = Head\nLocationsList.List = List\nLocationsList.Actions = Actions\n"],"names":["LocationsList","props","jsx","BaseComponent","Root","companyId","className","children","useI18n","onEvent","useBase","currentPage","setCurrentPage","useState","itemsPerPage","setItemsPerPage","locationList","httpMeta","useLocationsGetSuspense","totalPages","LocationsListProvider","prevPage","newCount","companyEvents","uuid","Flex","jsxs","Fragment","Head","List","Actions"],"mappings":";;;;;;;;;;;;;;AAgBO,SAASA,EAAcC,GAA2B;AAErD,SAAA,gBAAAC,EAACC,GAAe,EAAA,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAMA,EAAA,SAAA,CAAS,EACnC,CAAA;AAEJ;AAEA,SAASG,EAAK,EAAE,WAAAC,GAAW,WAAAC,GAAW,UAAAC,KAAgC;AACpE,EAAAC,EAAQ,mBAAmB;AACrB,QAAA,EAAE,SAAAC,EAAQ,IAAIC,EAAQ,GAEtB,CAACC,GAAaC,CAAc,IAAIC,EAAS,CAAC,GAC1C,CAACC,GAAcC,CAAe,IAAIF,EAAS,CAAC,GAE5C;AAAA,IACJ,MAAM,EAAE,cAAAG,GAAc,UAAAC,EAAS;AAAA,EAAA,IAC7BC,EAAwB,EAAE,WAAAb,GAAW,MAAMM,GAAa,KAAKG,GAAc,GAEzEK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AAEA9B,EAAc,OAAO4B;AACrB5B,EAAc,OAAO6B;AACrB7B,EAAc,UAAU8B;"}
1
+ {"version":3,"file":"LocationsList.js","sources":["../../../../../src/components/Company/Locations/LocationsList/LocationsList.tsx"],"sourcesContent":["import { useLocationsGetSuspense } from '@gusto/embedded-api/react-query/locationsGet'\nimport { useState } from 'react'\nimport { Head } from './Head'\nimport { List } from './List'\nimport { Actions } from './Actions'\nimport { LocationsListProvider } from './useLocationsList'\nimport { useI18n } from '@/i18n'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { Flex } from '@/components/Common'\nimport { companyEvents } from '@/shared/constants'\n\ninterface LocationsListProps extends BaseComponentInterface {\n companyId: string\n}\n\nexport function LocationsList(props: LocationsListProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ companyId, className, children }: LocationsListProps) {\n useI18n('Company.Locations')\n const { onEvent } = useBase()\n\n const [currentPage, setCurrentPage] = useState(1)\n const [itemsPerPage, setItemsPerPage] = useState(5)\n\n const {\n data: { locationList, httpMeta },\n } = useLocationsGetSuspense({ companyId, page: currentPage, per: itemsPerPage })\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\n const handleContinue = () => {\n onEvent(companyEvents.COMPANY_LOCATION_DONE)\n }\n const handleAddLocation = () => {\n onEvent(companyEvents.COMPANY_LOCATION_CREATE)\n }\n const handleEditLocation = (uuid: string) => {\n onEvent(companyEvents.COMPANY_LOCATION_EDIT, { uuid })\n }\n\n return (\n <section className={className}>\n <LocationsListProvider\n value={{\n locationList: locationList ?? [],\n currentPage,\n totalPages,\n handleFirstPage,\n handlePreviousPage,\n handleNextPage,\n handleLastPage,\n handleItemsPerPageChange,\n handleAddLocation,\n handleEditLocation,\n handleContinue,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <List />\n <Actions />\n </>\n )}\n </Flex>\n </LocationsListProvider>\n </section>\n )\n}\n"],"names":["LocationsList","props","jsx","BaseComponent","Root","companyId","className","children","useI18n","onEvent","useBase","currentPage","setCurrentPage","useState","itemsPerPage","setItemsPerPage","locationList","httpMeta","useLocationsGetSuspense","totalPages","LocationsListProvider","prevPage","newCount","companyEvents","uuid","Flex","jsxs","Fragment","Head","List","Actions"],"mappings":";;;;;;;;;;;;AAgBO,SAASA,EAAcC,GAA2B;AAErD,SAAA,gBAAAC,EAACC,GAAe,EAAA,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAMA,EAAA,SAAA,CAAS,EACnC,CAAA;AAEJ;AAEA,SAASG,EAAK,EAAE,WAAAC,GAAW,WAAAC,GAAW,UAAAC,KAAgC;AACpE,EAAAC,EAAQ,mBAAmB;AACrB,QAAA,EAAE,SAAAC,EAAQ,IAAIC,EAAQ,GAEtB,CAACC,GAAaC,CAAc,IAAIC,EAAS,CAAC,GAC1C,CAACC,GAAcC,CAAe,IAAIF,EAAS,CAAC,GAE5C;AAAA,IACJ,MAAM,EAAE,cAAAG,GAAc,UAAAC,EAAS;AAAA,EAAA,IAC7BC,EAAwB,EAAE,WAAAb,GAAW,MAAMM,GAAa,KAAKG,GAAc,GAEzEK,IAAa,OAAOF,EAAS,SAAS,QAAQ,IAAI,eAAe,KAAK,CAAC;AA6B3E,SAAA,gBAAAf,EAAC,aAAQ,WAAAI,GACP,UAAA,gBAAAJ;AAAA,IAACkB;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,cAAcJ,KAAgB,CAAC;AAAA,QAC/B,aAAAL;AAAA,QACA,YAAAQ;AAAA,QACA,iBA9BgB,MAAM;AAC5B,UAAAP,EAAe,CAAC;AAAA,QAClB;AAAA,QA6BQ,oBA5BmB,MAAM;AAC/B,UAAAA,EAAe,OAAY,KAAK,IAAIS,IAAW,GAAG,CAAC,CAAC;AAAA,QACtD;AAAA,QA2BQ,gBA1Be,MAAM;AAC3B,UAAAT,EAAe,OAAY,KAAK,IAAIS,IAAW,GAAGF,CAAU,CAAC;AAAA,QAC/D;AAAA,QAyBQ,gBAxBe,MAAM;AAC3B,UAAAP,EAAeO,CAAU;AAAA,QAC3B;AAAA,QAuBQ,0BArCyB,CAACG,MAAqB;AACrD,UAAAP,EAAgBO,CAAQ;AAAA,QAC1B;AAAA,QAoCQ,mBAnBkB,MAAM;AAC9B,UAAAb,EAAQc,EAAc,uBAAuB;AAAA,QAC/C;AAAA,QAkBQ,oBAjBmB,CAACC,MAAiB;AAC3C,UAAAf,EAAQc,EAAc,uBAAuB,EAAE,MAAAC,EAAA,CAAM;AAAA,QACvD;AAAA,QAgBQ,gBAxBe,MAAM;AAC3B,UAAAf,EAAQc,EAAc,qBAAqB;AAAA,QAC7C;AAAA,MAuBM;AAAA,MAEA,UAAA,gBAAArB,EAACuB,KAAK,eAAc,UAAS,KAAK,IAC/B,UAAAlB,KAIG,gBAAAmB,EAAAC,GAAA,EAAA,UAAA;AAAA,QAAA,gBAAAzB,EAAC0B,GAAK,EAAA;AAAA,0BACLC,GAAK,EAAA;AAAA,0BACLC,GAAQ,CAAA,CAAA;AAAA,MAAA,EAAA,CACX,EAEJ,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 [d, f] = o(
16
16
  "CompanyDocumentListContext"
@@ -1,11 +1,10 @@
1
1
  import { jsxs as i, jsx as o } from "react/jsx-runtime";
2
- import { useTranslation as m } from "react-i18next";
3
- import { useOnboardingOverview as l } from "./context.js";
2
+ import { useTranslation as l } from "react-i18next";
3
+ import { useOnboardingOverview as m } from "./context.js";
4
4
  import { Flex as a } from "../../Common/Flex/Flex.js";
5
- import "classnames";
6
5
  import { useComponentContext as d } from "../../../contexts/ComponentAdapter/useComponentContext.js";
7
- const f = () => {
8
- const e = d(), { onboardingCompleted: t, handleDone: r } = l(), { t: n } = m("Company.OnboardingOverview");
6
+ const u = () => {
7
+ const e = d(), { onboardingCompleted: t, handleDone: r } = m(), { t: n } = l("Company.OnboardingOverview");
9
8
  return t ? /* @__PURE__ */ i(a, { alignItems: "center", flexDirection: "column", gap: 8, children: [
10
9
  /* @__PURE__ */ o(e.Heading, { as: "h2", textAlign: "center", children: n("onboardingCompletedTitle") }),
11
10
  /* @__PURE__ */ o("p", { children: n("onboardingCompletedDescription") }),
@@ -13,6 +12,6 @@ const f = () => {
13
12
  ] }) : null;
14
13
  };
15
14
  export {
16
- f as Completed
15
+ u as Completed
17
16
  };
18
17
  //# sourceMappingURL=Completed.js.map