@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,35 +1,35 @@
1
- import { jsx as a, jsxs as D, Fragment as H } from "react/jsx-runtime";
2
- import { useForm as K, FormProvider as M } from "react-hook-form";
3
- import { zodResolver as w } from "@hookform/resolvers/zod";
4
- import { useTaxRequirementsUpdateStateMutation as z } from "@gusto/embedded-api/react-query/taxRequirementsUpdateState";
5
- import { useTaxRequirementsGetSuspense as G } from "@gusto/embedded-api/react-query/taxRequirementsGet";
1
+ import { jsx as a, jsxs as V, Fragment as O } from "react/jsx-runtime";
2
+ import { useForm as U, FormProvider as B } from "react-hook-form";
3
+ import { zodResolver as D } from "@hookform/resolvers/zod";
4
+ import { useTaxRequirementsUpdateStateMutation as K } from "@gusto/embedded-api/react-query/taxRequirementsUpdateState";
5
+ import { useTaxRequirementsGetSuspense as M } from "@gusto/embedded-api/react-query/taxRequirementsGet";
6
6
  import { z as r } from "zod";
7
- import { useMemo as L } from "react";
8
- import { useTranslation as X } from "react-i18next";
9
- import { Head as k } from "./Head.js";
10
- import { StateTaxesFormProvider as Y } from "./context.js";
11
- import { Form as A } from "./Form.js";
12
- import { Actions as P } from "./Actions.js";
13
- import { BaseComponent as $ } from "../../../Base/Base.js";
14
- import { useI18n as I } from "../../../../i18n/I18n.js";
15
- import { Flex as J } from "../../../Common/Flex/Flex.js";
16
- import { Form as Q } from "../../../Common/Form/Form.js";
17
- import { componentEvents as q } from "../../../../shared/constants.js";
18
- import { useBase as W } from "../../../Base/useBase.js";
19
- function h(i) {
20
- return /* @__PURE__ */ a($, { ...i, children: /* @__PURE__ */ a(Z, { ...i, children: i.children }) });
7
+ import { useMemo as w } from "react";
8
+ import { useTranslation as z } from "react-i18next";
9
+ import { Head as H } from "./Head.js";
10
+ import { StateTaxesFormProvider as G } from "./context.js";
11
+ import { Form as L } from "./Form.js";
12
+ import { Actions as X } from "./Actions.js";
13
+ import { BaseComponent as Y } from "../../../Base/Base.js";
14
+ import { useI18n as $ } from "../../../../i18n/I18n.js";
15
+ import { Flex as I } from "../../../Common/Flex/Flex.js";
16
+ import { Form as J } from "../../../Common/Form/Form.js";
17
+ import { componentEvents as g } from "../../../../shared/constants.js";
18
+ import { useBase as Q } from "../../../Base/useBase.js";
19
+ function Se(i) {
20
+ return /* @__PURE__ */ a(Y, { ...i, children: /* @__PURE__ */ a(W, { ...i, children: i.children }) });
21
21
  }
22
- function Z({ companyId: i, state: y, className: _, children: x }) {
23
- I("Company.StateTaxes");
24
- const { onEvent: F, baseSubmitHandler: j } = W(), { t: o } = X("Company.StateTaxes", { keyPrefix: "form" }), { data: C } = G({ companyUuid: i, state: y }), l = C.taxRequirementsState, { mutateAsync: E, isPending: N } = z(), { dynamicSchema: R, defaultValues: V } = L(() => {
22
+ function W({ companyId: i, state: y, className: q, children: h }) {
23
+ $("Company.StateTaxes");
24
+ const { onEvent: x, baseSubmitHandler: k } = Q(), { t: o } = z("Company.StateTaxes", { keyPrefix: "form" }), { data: P } = M({ companyUuid: i, state: y }), l = P.taxRequirementsState, { mutateAsync: _, isPending: j } = K(), { dynamicSchema: A, defaultValues: C } = w(() => {
25
25
  const f = {}, s = {};
26
26
  return l.requirementSets?.forEach((t) => {
27
27
  if (!t.key) return;
28
28
  const m = t.key, c = {}, p = {};
29
29
  t.requirements?.forEach((e) => {
30
30
  if (!e.key) return;
31
- const g = e.key;
32
- p[g] = e.metadata?.type === "radio" ? e.value ?? void 0 : e.value ? String(e.value) : "";
31
+ const b = e.key;
32
+ p[b] = e.metadata?.type === "radio" ? e.value ?? void 0 : e.value ? String(e.value) : "";
33
33
  let v = r.string({
34
34
  required_error: o("validations.required")
35
35
  }).min(1, o("validations.required"));
@@ -51,18 +51,18 @@ function Z({ companyId: i, state: y, className: _, children: x }) {
51
51
  }
52
52
  e.metadata?.type === "radio" && (v = r.boolean({
53
53
  required_error: o("validations.required")
54
- })), c[g] = v;
54
+ })), c[b] = v;
55
55
  }), Object.keys(c).length > 0 && (f[m] = r.object(c), s[m] = p);
56
56
  }), {
57
57
  dynamicSchema: r.object(f),
58
58
  defaultValues: s
59
59
  };
60
- }, [l, o]), { control: O, ...T } = K({
61
- resolver: w(R),
62
- defaultValues: V
63
- }), U = async (f) => {
64
- await j(f, async (s) => {
65
- const b = l.requirementSets?.filter((t) => t.key && s[t.key]).map((t) => {
60
+ }, [l, o]), { control: E, ...F } = U({
61
+ resolver: D(A),
62
+ defaultValues: C
63
+ }), N = async (f) => {
64
+ await k(f, async (s) => {
65
+ const T = l.requirementSets?.filter((t) => t.key && s[t.key]).map((t) => {
66
66
  const m = t.key, c = s[m];
67
67
  return {
68
68
  state: t.state,
@@ -74,33 +74,30 @@ function Z({ companyId: i, state: y, className: _, children: x }) {
74
74
  }))
75
75
  };
76
76
  });
77
- await E({
77
+ await _({
78
78
  request: {
79
79
  companyUuid: i,
80
- requestBody: { requirementSets: b },
80
+ requestBody: { requirementSets: T },
81
81
  state: y
82
82
  }
83
- }), F(q.COMPANY_STATE_TAX_UPDATED);
83
+ }), x(g.COMPANY_STATE_TAX_UPDATED);
84
84
  });
85
- }, B = () => {
86
- F(q.CANCEL);
85
+ }, R = () => {
86
+ x(g.CANCEL);
87
87
  };
88
- return /* @__PURE__ */ a("section", { className: _, children: /* @__PURE__ */ a(M, { ...T, control: O, children: /* @__PURE__ */ a(Q, { onSubmit: T.handleSubmit(U), children: /* @__PURE__ */ a(
89
- Y,
88
+ return /* @__PURE__ */ a("section", { className: q, children: /* @__PURE__ */ a(B, { ...F, control: E, children: /* @__PURE__ */ a(J, { onSubmit: F.handleSubmit(N), children: /* @__PURE__ */ a(
89
+ G,
90
90
  {
91
- value: { stateTaxRequirements: l, isPending: N, state: y, handleCancel: B },
92
- children: /* @__PURE__ */ a(J, { flexDirection: "column", gap: 32, children: x || /* @__PURE__ */ D(H, { children: [
93
- /* @__PURE__ */ a(k, {}),
94
- /* @__PURE__ */ a(A, {}),
95
- /* @__PURE__ */ a(P, {})
91
+ value: { stateTaxRequirements: l, isPending: j, state: y, handleCancel: R },
92
+ children: /* @__PURE__ */ a(I, { flexDirection: "column", gap: 32, children: h || /* @__PURE__ */ V(O, { children: [
93
+ /* @__PURE__ */ a(H, {}),
94
+ /* @__PURE__ */ a(L, {}),
95
+ /* @__PURE__ */ a(X, {})
96
96
  ] }) })
97
97
  }
98
98
  ) }) }) });
99
99
  }
100
- h.Head = k;
101
- h.Form = A;
102
- h.Actions = P;
103
100
  export {
104
- h as StateTaxesForm
101
+ Se as StateTaxesForm
105
102
  };
106
103
  //# sourceMappingURL=StateTaxesForm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"StateTaxesForm.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.tsx"],"sourcesContent":["import { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { useTaxRequirementsUpdateStateMutation } from '@gusto/embedded-api/react-query/taxRequirementsUpdateState'\nimport { useTaxRequirementsGetSuspense } from '@gusto/embedded-api/react-query/taxRequirementsGet'\nimport { z } from 'zod'\nimport { useMemo } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { Head } from './Head'\nimport { StateTaxesFormProvider } from './context'\nimport { Form } from './Form'\nimport { Actions } from './Actions'\nimport type { BaseComponentInterface, CommonComponentInterface } from '@/components/Base/Base'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { useI18n } from '@/i18n/I18n'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { Form as HtmlForm } from '@/components/Common/Form'\nimport { componentEvents } from '@/shared/constants'\nimport { useBase } from '@/components/Base'\n\ninterface StateTaxesFormProps extends CommonComponentInterface {\n companyId: string\n state: string\n}\n\nexport function StateTaxesForm(props: StateTaxesFormProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ companyId, state, className, children }: StateTaxesFormProps) {\n useI18n('Company.StateTaxes')\n const { onEvent, baseSubmitHandler } = useBase()\n const { t } = useTranslation('Company.StateTaxes', { keyPrefix: 'form' })\n const { data } = useTaxRequirementsGetSuspense({ companyUuid: companyId, state })\n const stateTaxRequirements = data.taxRequirementsState!\n\n const { mutateAsync: updateStateTax, isPending: isPendingUpdate } =\n useTaxRequirementsUpdateStateMutation()\n\n // Schema and default value generation\n const { dynamicSchema, defaultValues } = useMemo(() => {\n const schemaShape: Record<string, z.ZodObject<Record<string, z.ZodTypeAny>>> = {}\n const values: Partial<Record<string, Record<string, string | boolean | number | undefined>>> =\n {}\n\n //Looping through each requirement set\n stateTaxRequirements.requirementSets?.forEach(requirementSet => {\n if (!requirementSet.key) return\n\n const requirementSetKey = requirementSet.key\n const requirementShape: Record<string, z.ZodTypeAny> = {}\n const requirementValues: Record<string, string | boolean | number | undefined> = {}\n\n requirementSet.requirements?.forEach(requirement => {\n if (!requirement.key) return\n\n const requirementKey = requirement.key\n\n // --- Default Value Logic ---\n requirementValues[requirementKey] =\n requirement.metadata?.type === 'radio'\n ? (requirement.value ?? undefined)\n : requirement.value\n ? String(requirement.value)\n : ''\n\n // --- Schema Logic ---\n // Start with a basic string schema\n let fieldSchema: z.ZodTypeAny = z\n .string({\n required_error: t('validations.required'),\n })\n .min(1, t('validations.required'))\n\n const validation = requirement.metadata?.validation\n // Not all requirements have validation\n if (validation) {\n if (requirement.metadata?.type === 'tax_rate') {\n if (validation.type === 'min_max') {\n const min = parseFloat(validation.min as string)\n const max = parseFloat(validation.max as string)\n\n if (!isNaN(min) && !isNaN(max)) {\n fieldSchema = z.preprocess(\n val => Number(val),\n z\n .number()\n .min(min, t('validations.minValue', { min }))\n .max(max, t('validations.maxValue', { max }))\n .transform(num => String(num)),\n )\n }\n } else {\n //Type is one_of\n const oneOfValues = validation.rates as string[]\n fieldSchema = z\n .string({\n required_error: t('validations.required'),\n })\n .min(1, t('validations.required'))\n .refine(val => oneOfValues.includes(val), {\n message: t('validations.oneOf', { values: oneOfValues.join(', ') }),\n })\n }\n }\n }\n if (requirement.metadata?.type === 'radio') {\n fieldSchema = z.boolean({\n required_error: t('validations.required'),\n })\n }\n requirementShape[requirementKey] = fieldSchema\n // --- End Schema Logic ---\n })\n\n if (Object.keys(requirementShape).length > 0) {\n schemaShape[requirementSetKey] = z.object(requirementShape)\n values[requirementSetKey] = requirementValues\n }\n })\n\n const finalSchema = z.object(schemaShape)\n\n // Return both the schema and the default values\n return {\n dynamicSchema: finalSchema,\n defaultValues: values as z.infer<typeof finalSchema>,\n }\n }, [stateTaxRequirements, t])\n\n // Infer the type from the schema\n type InferredFormInputs = z.infer<typeof dynamicSchema>\n\n const { control, ...methods } = useForm<InferredFormInputs>({\n resolver: zodResolver(dynamicSchema),\n defaultValues,\n })\n\n const onSubmit = async (formData: InferredFormInputs) => {\n await baseSubmitHandler(formData, async payload => {\n const requirementSets = stateTaxRequirements.requirementSets\n ?.filter(rs => rs.key && payload[rs.key])\n .map(requirementSet => {\n const requirementSetKey = requirementSet.key as string\n const payloadSet = payload[requirementSetKey] as Record<string, unknown>\n return {\n state: requirementSet.state,\n key: requirementSetKey,\n effectiveFrom: requirementSet.effectiveFrom,\n requirements: Object.entries(payloadSet).map(([key, value]) => ({\n key,\n value: String(value),\n })),\n }\n })\n await updateStateTax({\n request: {\n companyUuid: companyId,\n requestBody: { requirementSets },\n state,\n },\n })\n onEvent(componentEvents.COMPANY_STATE_TAX_UPDATED)\n })\n }\n\n const handleCancel = () => {\n onEvent(componentEvents.CANCEL)\n }\n\n return (\n <section className={className}>\n <FormProvider {...methods} control={control}>\n <HtmlForm onSubmit={methods.handleSubmit(onSubmit)}>\n <StateTaxesFormProvider\n value={{ stateTaxRequirements, isPending: isPendingUpdate, state, handleCancel }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <Form />\n <Actions />\n </>\n )}\n </Flex>\n </StateTaxesFormProvider>\n </HtmlForm>\n </FormProvider>\n </section>\n )\n}\n\nStateTaxesForm.Head = Head\nStateTaxesForm.Form = Form\nStateTaxesForm.Actions = Actions\n"],"names":["StateTaxesForm","props","jsx","BaseComponent","Root","companyId","state","className","children","useI18n","onEvent","baseSubmitHandler","useBase","t","useTranslation","data","useTaxRequirementsGetSuspense","stateTaxRequirements","updateStateTax","isPendingUpdate","useTaxRequirementsUpdateStateMutation","dynamicSchema","defaultValues","useMemo","schemaShape","values","requirementSet","requirementSetKey","requirementShape","requirementValues","requirement","requirementKey","fieldSchema","z","validation","min","max","val","num","oneOfValues","control","methods","useForm","zodResolver","onSubmit","formData","payload","requirementSets","rs","payloadSet","key","value","componentEvents","handleCancel","FormProvider","HtmlForm","StateTaxesFormProvider","Flex","jsxs","Fragment","Head","Form","Actions"],"mappings":";;;;;;;;;;;;;;;;;;AAwBO,SAASA,EAAeC,GAAqD;AAEhF,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,OAAAC,GAAO,WAAAC,GAAW,UAAAC,KAAiC;AAC5E,EAAAC,EAAQ,oBAAoB;AAC5B,QAAM,EAAE,SAAAC,GAAS,mBAAAC,EAAkB,IAAIC,EAAQ,GACzC,EAAE,GAAAC,MAAMC,EAAe,sBAAsB,EAAE,WAAW,QAAQ,GAClE,EAAE,MAAAC,MAASC,EAA8B,EAAE,aAAaX,GAAW,OA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,CAAU,EAAE,IAAI,CAAC,CAACC,GAAKC,CAAK,OAAO;AAAA,YAC9D,KAAAD;AAAA,YACA,OAAO,OAAOC,CAAK;AAAA,UAAA,EACnB;AAAA,QACJ;AAAA,MAAA,CACD;AACH,YAAMjC,EAAe;AAAA,QACnB,SAAS;AAAA,UACP,aAAab;AAAA,UACb,aAAa,EAAE,iBAAA0C,EAAgB;AAAA,UAC/B,OAAAzC;AAAA,QAAA;AAAA,MACF,CACD,GACDI,EAAQ0C,EAAgB,yBAAyB;AAAA,IAAA,CAClD;AAAA,EACH,GAEMC,IAAe,MAAM;AACzB,IAAA3C,EAAQ0C,EAAgB,MAAM;AAAA,EAChC;AAEA,SACG,gBAAAlD,EAAA,WAAA,EAAQ,WAAAK,GACP,UAAA,gBAAAL,EAACoD,KAAc,GAAGb,GAAS,SAAAD,GACzB,UAAA,gBAAAtC,EAACqD,GAAS,EAAA,UAAUd,EAAQ,aAAaG,CAAQ,GAC/C,UAAA,gBAAA1C;AAAA,IAACsD;AAAA,IAAA;AAAA,MACC,OAAO,EAAE,sBAAAvC,GAAsB,WAAWE,GAAiB,OAAAb,GAAO,cAAA+C,EAAa;AAAA,MAE/E,UAAA,gBAAAnD,EAACuD,KAAK,eAAc,UAAS,KAAK,IAC/B,UAAAjD,KAIG,gBAAAkD,EAAAC,GAAA,EAAA,UAAA;AAAA,QAAA,gBAAAzD,EAAC0D,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;AAEA9D,EAAe,OAAO4D;AACtB5D,EAAe,OAAO6D;AACtB7D,EAAe,UAAU8D;"}
1
+ {"version":3,"file":"StateTaxesForm.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.tsx"],"sourcesContent":["import { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { useTaxRequirementsUpdateStateMutation } from '@gusto/embedded-api/react-query/taxRequirementsUpdateState'\nimport { useTaxRequirementsGetSuspense } from '@gusto/embedded-api/react-query/taxRequirementsGet'\nimport { z } from 'zod'\nimport { useMemo } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { Head } from './Head'\nimport { StateTaxesFormProvider } from './context'\nimport { Form } from './Form'\nimport { Actions } from './Actions'\nimport type { BaseComponentInterface, CommonComponentInterface } from '@/components/Base/Base'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { useI18n } from '@/i18n/I18n'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { Form as HtmlForm } from '@/components/Common/Form'\nimport { componentEvents } from '@/shared/constants'\nimport { useBase } from '@/components/Base'\n\ninterface StateTaxesFormProps extends CommonComponentInterface {\n companyId: string\n state: string\n}\n\nexport function StateTaxesForm(props: StateTaxesFormProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ companyId, state, className, children }: StateTaxesFormProps) {\n useI18n('Company.StateTaxes')\n const { onEvent, baseSubmitHandler } = useBase()\n const { t } = useTranslation('Company.StateTaxes', { keyPrefix: 'form' })\n const { data } = useTaxRequirementsGetSuspense({ companyUuid: companyId, state })\n const stateTaxRequirements = data.taxRequirementsState!\n\n const { mutateAsync: updateStateTax, isPending: isPendingUpdate } =\n useTaxRequirementsUpdateStateMutation()\n\n // Schema and default value generation\n const { dynamicSchema, defaultValues } = useMemo(() => {\n const schemaShape: Record<string, z.ZodObject<Record<string, z.ZodTypeAny>>> = {}\n const values: Partial<Record<string, Record<string, string | boolean | number | undefined>>> =\n {}\n\n //Looping through each requirement set\n stateTaxRequirements.requirementSets?.forEach(requirementSet => {\n if (!requirementSet.key) return\n\n const requirementSetKey = requirementSet.key\n const requirementShape: Record<string, z.ZodTypeAny> = {}\n const requirementValues: Record<string, string | boolean | number | undefined> = {}\n\n requirementSet.requirements?.forEach(requirement => {\n if (!requirement.key) return\n\n const requirementKey = requirement.key\n\n // --- Default Value Logic ---\n requirementValues[requirementKey] =\n requirement.metadata?.type === 'radio'\n ? (requirement.value ?? undefined)\n : requirement.value\n ? String(requirement.value)\n : ''\n\n // --- Schema Logic ---\n // Start with a basic string schema\n let fieldSchema: z.ZodTypeAny = z\n .string({\n required_error: t('validations.required'),\n })\n .min(1, t('validations.required'))\n\n const validation = requirement.metadata?.validation\n // Not all requirements have validation\n if (validation) {\n if (requirement.metadata?.type === 'tax_rate') {\n if (validation.type === 'min_max') {\n const min = parseFloat(validation.min as string)\n const max = parseFloat(validation.max as string)\n\n if (!isNaN(min) && !isNaN(max)) {\n fieldSchema = z.preprocess(\n val => Number(val),\n z\n .number()\n .min(min, t('validations.minValue', { min }))\n .max(max, t('validations.maxValue', { max }))\n .transform(num => String(num)),\n )\n }\n } else {\n //Type is one_of\n const oneOfValues = validation.rates as string[]\n fieldSchema = z\n .string({\n required_error: t('validations.required'),\n })\n .min(1, t('validations.required'))\n .refine(val => oneOfValues.includes(val), {\n message: t('validations.oneOf', { values: oneOfValues.join(', ') }),\n })\n }\n }\n }\n if (requirement.metadata?.type === 'radio') {\n fieldSchema = z.boolean({\n required_error: t('validations.required'),\n })\n }\n requirementShape[requirementKey] = fieldSchema\n // --- End Schema Logic ---\n })\n\n if (Object.keys(requirementShape).length > 0) {\n schemaShape[requirementSetKey] = z.object(requirementShape)\n values[requirementSetKey] = requirementValues\n }\n })\n\n const finalSchema = z.object(schemaShape)\n\n // Return both the schema and the default values\n return {\n dynamicSchema: finalSchema,\n defaultValues: values as z.infer<typeof finalSchema>,\n }\n }, [stateTaxRequirements, t])\n\n // Infer the type from the schema\n type InferredFormInputs = z.infer<typeof dynamicSchema>\n\n const { control, ...methods } = useForm<InferredFormInputs>({\n resolver: zodResolver(dynamicSchema),\n defaultValues,\n })\n\n const onSubmit = async (formData: InferredFormInputs) => {\n await baseSubmitHandler(formData, async payload => {\n const requirementSets = stateTaxRequirements.requirementSets\n ?.filter(rs => rs.key && payload[rs.key])\n .map(requirementSet => {\n const requirementSetKey = requirementSet.key as string\n const payloadSet = payload[requirementSetKey] as Record<string, unknown>\n return {\n state: requirementSet.state,\n key: requirementSetKey,\n effectiveFrom: requirementSet.effectiveFrom,\n requirements: Object.entries(payloadSet).map(([key, value]) => ({\n key,\n value: String(value),\n })),\n }\n })\n await updateStateTax({\n request: {\n companyUuid: companyId,\n requestBody: { requirementSets },\n state,\n },\n })\n onEvent(componentEvents.COMPANY_STATE_TAX_UPDATED)\n })\n }\n\n const handleCancel = () => {\n onEvent(componentEvents.CANCEL)\n }\n\n return (\n <section className={className}>\n <FormProvider {...methods} control={control}>\n <HtmlForm onSubmit={methods.handleSubmit(onSubmit)}>\n <StateTaxesFormProvider\n value={{ stateTaxRequirements, isPending: isPendingUpdate, state, handleCancel }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <Form />\n <Actions />\n </>\n )}\n </Flex>\n </StateTaxesFormProvider>\n </HtmlForm>\n </FormProvider>\n </section>\n )\n}\n"],"names":["StateTaxesForm","props","jsx","BaseComponent","Root","companyId","state","className","children","useI18n","onEvent","baseSubmitHandler","useBase","t","useTranslation","data","useTaxRequirementsGetSuspense","stateTaxRequirements","updateStateTax","isPendingUpdate","useTaxRequirementsUpdateStateMutation","dynamicSchema","defaultValues","useMemo","schemaShape","values","requirementSet","requirementSetKey","requirementShape","requirementValues","requirement","requirementKey","fieldSchema","z","validation","min","max","val","num","oneOfValues","control","methods","useForm","zodResolver","onSubmit","formData","payload","requirementSets","rs","payloadSet","key","value","componentEvents","handleCancel","FormProvider","HtmlForm","StateTaxesFormProvider","Flex","jsxs","Fragment","Head","Form","Actions"],"mappings":";;;;;;;;;;;;;;;;;;AAwBO,SAASA,GAAeC,GAAqD;AAEhF,SAAA,gBAAAC,EAACC,GAAe,EAAA,GAAGF,GACjB,UAAA,gBAAA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AAA;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;"}
@@ -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 [c, d] = t("StateTaxesFormContext");
16
16
  export {
@@ -1,14 +1,13 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
2
  import { useTranslation as i } from "react-i18next";
3
3
  import { useStateTaxesList as e } from "./context.js";
4
- import "classnames";
5
- import { ActionsLayout as m } from "../../../Common/ActionsLayout/ActionsLayout.js";
6
- import { useComponentContext as s } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
7
- function l() {
8
- const { t: o } = i("Company.StateTaxes"), n = s(), { handleContinue: r } = e();
9
- return /* @__PURE__ */ t(m, { children: /* @__PURE__ */ t(n.Button, { variant: "primary", onClick: r, children: o("list.continueCta") }) });
4
+ import { ActionsLayout as s } from "../../../Common/ActionsLayout/ActionsLayout.js";
5
+ import { useComponentContext as m } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
6
+ function f() {
7
+ const { t: o } = i("Company.StateTaxes"), n = m(), { handleContinue: r } = e();
8
+ return /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(n.Button, { variant: "primary", onClick: r, children: o("list.continueCta") }) });
10
9
  }
11
10
  export {
12
- l as Actions
11
+ f as Actions
13
12
  };
14
13
  //# sourceMappingURL=Actions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesList/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useStateTaxesList } from './context'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { t } = useTranslation('Company.StateTaxes')\n const Components = useComponentContext()\n const { handleContinue } = useStateTaxesList()\n return (\n <ActionsLayout>\n <Components.Button variant=\"primary\" onClick={handleContinue}>\n {t('list.continueCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","t","useTranslation","Components","useComponentContext","handleContinue","useStateTaxesList","jsx","ActionsLayout"],"mappings":";;;;;;AAKO,SAASA,IAAU;AACxB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,oBAAoB,GAC3CC,IAAaC,EAAoB,GACjC,EAAE,gBAAAC,EAAe,IAAIC,EAAkB;AAC7C,SACG,gBAAAC,EAAAC,GAAA,EACC,UAAC,gBAAAD,EAAAJ,EAAW,QAAX,EAAkB,SAAQ,WAAU,SAASE,GAC3C,UAAEJ,EAAA,kBAAkB,EACvB,CAAA,GACF;AAEJ;"}
1
+ {"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesList/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useStateTaxesList } from './context'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { t } = useTranslation('Company.StateTaxes')\n const Components = useComponentContext()\n const { handleContinue } = useStateTaxesList()\n return (\n <ActionsLayout>\n <Components.Button variant=\"primary\" onClick={handleContinue}>\n {t('list.continueCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","t","useTranslation","Components","useComponentContext","handleContinue","useStateTaxesList","jsx","ActionsLayout"],"mappings":";;;;;AAKO,SAASA,IAAU;AACxB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,oBAAoB,GAC3CC,IAAaC,EAAoB,GACjC,EAAE,gBAAAC,EAAe,IAAIC,EAAkB;AAC7C,SACG,gBAAAC,EAAAC,GAAA,EACC,UAAC,gBAAAD,EAAAJ,EAAW,QAAX,EAAkB,SAAQ,WAAU,SAASE,GAC3C,UAAEJ,EAAA,kBAAkB,EACvB,CAAA,GACF;AAEJ;"}
@@ -1,14 +1,13 @@
1
1
  import { jsx as s, Fragment as p } from "react/jsx-runtime";
2
2
  import { useTranslation as o } from "react-i18next";
3
3
  import { useStateTaxesList as l } from "./context.js";
4
- import "classnames";
5
4
  import { EmptyData as c } from "../../../Common/EmptyData/EmptyData.js";
6
5
  import { useComponentContext as u } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
7
6
  import { useDataView as d } from "../../../Common/DataView/useDataView.js";
8
7
  import { DataView as C } from "../../../Common/DataView/DataView.js";
9
- const k = () => {
10
- const { stateTaxRequirements: r, handleChange: n } = l(), a = u(), { t } = o("Company.StateTaxes", { keyPrefix: "list" }), { t: i } = o("common", { keyPrefix: "statesHash" }), { ...m } = d({
11
- data: r,
8
+ const S = () => {
9
+ const { stateTaxRequirements: n, handleChange: r } = l(), a = u(), { t } = o("Company.StateTaxes", { keyPrefix: "list" }), { t: i } = o("common", { keyPrefix: "statesHash" }), { ...m } = d({
10
+ data: n,
12
11
  columns: [
13
12
  {
14
13
  key: "state",
@@ -26,7 +25,7 @@ const k = () => {
26
25
  {
27
26
  variant: "secondary",
28
27
  onClick: () => {
29
- n(e.state);
28
+ r(e.state);
30
29
  },
31
30
  children: e.setupComplete ? t("editStateTaxCta") : t("continueStateTaxSetupCta")
32
31
  }
@@ -36,6 +35,6 @@ const k = () => {
36
35
  return /* @__PURE__ */ s(C, { label: t("requirementsListLabel"), ...m });
37
36
  };
38
37
  export {
39
- k as List
38
+ S as List
40
39
  };
41
40
  //# sourceMappingURL=List.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"List.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesList/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useStateTaxesList } from './context'\nimport { DataView, EmptyData, useDataView } from '@/components/Common'\nimport type { STATES_ABBR } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const List = () => {\n const { stateTaxRequirements, handleChange } = useStateTaxesList()\n const Components = useComponentContext()\n\n const { t } = useTranslation('Company.StateTaxes', { keyPrefix: 'list' })\n const { t: statesHash } = useTranslation('common', { keyPrefix: 'statesHash' })\n\n const { ...dataViewProps } = useDataView({\n data: stateTaxRequirements,\n columns: [\n {\n key: 'state',\n title: t('requirementsListCol1'),\n render: requirement => {\n return <span>{statesHash(requirement.state as (typeof STATES_ABBR)[number])}</span>\n },\n },\n {\n key: 'status',\n title: t('requirementsListCol2'),\n render: requirement => {\n return (\n <>\n <Components.Badge status={requirement.setupComplete ? 'success' : 'warning'}>\n {requirement.setupComplete ? t('completeBadge') : t('incompleteBadge')}\n </Components.Badge>\n </>\n )\n },\n },\n ],\n itemMenu: requirement => {\n return (\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n handleChange(requirement.state)\n }}\n >\n {requirement.setupComplete ? t('editStateTaxCta') : t('continueStateTaxSetupCta')}\n </Components.Button>\n )\n },\n\n emptyState: () => (\n <EmptyData title={t('emptyTableTitle')} description={t('emptyTableDescription')} />\n ),\n })\n return <DataView label={t('requirementsListLabel')} {...dataViewProps} />\n}\n"],"names":["List","stateTaxRequirements","handleChange","useStateTaxesList","Components","useComponentContext","useTranslation","statesHash","dataViewProps","useDataView","requirement","jsx","EmptyData","DataView"],"mappings":";;;;;;;;AAMO,MAAMA,IAAO,MAAM;AACxB,QAAM,EAAE,sBAAAC,GAAsB,cAAAC,EAAa,IAAIC,EAAkB,GAC3DC,IAAaC,EAAoB,GAEjC,EAAE,MAAMC,EAAe,sBAAsB,EAAE,WAAW,QAAQ,GAClE,EAAE,GAAGC,MAAeD,EAAe,UAAU,EAAE,WAAW,cAAc,GAExE,EAAE,GAAGE,EAAc,IAAIC,EAAY;AAAA,IACvC,MAAMR;AAAA,IACN,SAAS;AAAA,MACP;AAAA,QACE,KAAK;AAAA,QACL,OAAO,EAAE,sBAAsB;AAAA,QAC/B,QAAQ,CAAeS,MACb,gBAAAC,EAAA,QAAA,EAAM,UAAWJ,EAAAG,EAAY,KAAqC,GAAE;AAAA,MAEhF;AAAA,MACA;AAAA,QACE,KAAK;AAAA,QACL,OAAO,EAAE,sBAAsB;AAAA,QAC/B,QAAQ,CAAeA,6BAGjB,UAAC,gBAAAC,EAAAP,EAAW,OAAX,EAAiB,QAAQM,EAAY,gBAAgB,YAAY,WAC/D,UAAAA,EAAY,gBAAgB,EAAE,eAAe,IAAI,EAAE,iBAAiB,EACvE,CAAA,GACF;AAAA,MAEJ;AAAA,IAEJ;AAAA,IACA,UAAU,CAAeA,MAErB,gBAAAC;AAAA,MAACP,EAAW;AAAA,MAAX;AAAA,QACC,SAAQ;AAAA,QACR,SAAS,MAAM;AACb,UAAAF,EAAaQ,EAAY,KAAK;AAAA,QAChC;AAAA,QAEC,YAAY,gBAAgB,EAAE,iBAAiB,IAAI,EAAE,0BAA0B;AAAA,MAAA;AAAA,IAClF;AAAA,IAIJ,YAAY,MACV,gBAAAC,EAACC,GAAU,EAAA,OAAO,EAAE,iBAAiB,GAAG,aAAa,EAAE,uBAAuB,EAAG,CAAA;AAAA,EAAA,CAEpF;AACD,2BAAQC,GAAS,EAAA,OAAO,EAAE,uBAAuB,GAAI,GAAGL,GAAe;AACzE;"}
1
+ {"version":3,"file":"List.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesList/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useStateTaxesList } from './context'\nimport { DataView, EmptyData, useDataView } from '@/components/Common'\nimport type { STATES_ABBR } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const List = () => {\n const { stateTaxRequirements, handleChange } = useStateTaxesList()\n const Components = useComponentContext()\n\n const { t } = useTranslation('Company.StateTaxes', { keyPrefix: 'list' })\n const { t: statesHash } = useTranslation('common', { keyPrefix: 'statesHash' })\n\n const { ...dataViewProps } = useDataView({\n data: stateTaxRequirements,\n columns: [\n {\n key: 'state',\n title: t('requirementsListCol1'),\n render: requirement => {\n return <span>{statesHash(requirement.state as (typeof STATES_ABBR)[number])}</span>\n },\n },\n {\n key: 'status',\n title: t('requirementsListCol2'),\n render: requirement => {\n return (\n <>\n <Components.Badge status={requirement.setupComplete ? 'success' : 'warning'}>\n {requirement.setupComplete ? t('completeBadge') : t('incompleteBadge')}\n </Components.Badge>\n </>\n )\n },\n },\n ],\n itemMenu: requirement => {\n return (\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n handleChange(requirement.state)\n }}\n >\n {requirement.setupComplete ? t('editStateTaxCta') : t('continueStateTaxSetupCta')}\n </Components.Button>\n )\n },\n\n emptyState: () => (\n <EmptyData title={t('emptyTableTitle')} description={t('emptyTableDescription')} />\n ),\n })\n return <DataView label={t('requirementsListLabel')} {...dataViewProps} />\n}\n"],"names":["List","stateTaxRequirements","handleChange","useStateTaxesList","Components","useComponentContext","useTranslation","statesHash","dataViewProps","useDataView","requirement","jsx","EmptyData","DataView"],"mappings":";;;;;;;AAMO,MAAMA,IAAO,MAAM;AACxB,QAAM,EAAE,sBAAAC,GAAsB,cAAAC,EAAa,IAAIC,EAAkB,GAC3DC,IAAaC,EAAoB,GAEjC,EAAE,MAAMC,EAAe,sBAAsB,EAAE,WAAW,QAAQ,GAClE,EAAE,GAAGC,MAAeD,EAAe,UAAU,EAAE,WAAW,cAAc,GAExE,EAAE,GAAGE,EAAc,IAAIC,EAAY;AAAA,IACvC,MAAMR;AAAA,IACN,SAAS;AAAA,MACP;AAAA,QACE,KAAK;AAAA,QACL,OAAO,EAAE,sBAAsB;AAAA,QAC/B,QAAQ,CAAeS,MACb,gBAAAC,EAAA,QAAA,EAAM,UAAWJ,EAAAG,EAAY,KAAqC,GAAE;AAAA,MAEhF;AAAA,MACA;AAAA,QACE,KAAK;AAAA,QACL,OAAO,EAAE,sBAAsB;AAAA,QAC/B,QAAQ,CAAeA,6BAGjB,UAAC,gBAAAC,EAAAP,EAAW,OAAX,EAAiB,QAAQM,EAAY,gBAAgB,YAAY,WAC/D,UAAAA,EAAY,gBAAgB,EAAE,eAAe,IAAI,EAAE,iBAAiB,EACvE,CAAA,GACF;AAAA,MAEJ;AAAA,IAEJ;AAAA,IACA,UAAU,CAAeA,MAErB,gBAAAC;AAAA,MAACP,EAAW;AAAA,MAAX;AAAA,QACC,SAAQ;AAAA,QACR,SAAS,MAAM;AACb,UAAAF,EAAaQ,EAAY,KAAK;AAAA,QAChC;AAAA,QAEC,YAAY,gBAAgB,EAAE,iBAAiB,IAAI,EAAE,0BAA0B;AAAA,MAAA;AAAA,IAClF;AAAA,IAIJ,YAAY,MACV,gBAAAC,EAACC,GAAU,EAAA,OAAO,EAAE,iBAAiB,GAAG,aAAa,EAAE,uBAAuB,EAAG,CAAA;AAAA,EAAA,CAEpF;AACD,2BAAQC,GAAS,EAAA,OAAO,EAAE,uBAAuB,GAAI,GAAGL,GAAe;AACzE;"}
@@ -3,9 +3,4 @@ interface StateTaxesListProps extends BaseComponentInterface {
3
3
  companyId: string;
4
4
  }
5
5
  export declare function StateTaxesList(props: StateTaxesListProps): import("react/jsx-runtime").JSX.Element;
6
- export declare namespace StateTaxesList {
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,45 +1,42 @@
1
- import { jsx as e, jsxs as p, Fragment as u } from "react/jsx-runtime";
2
- import { useTaxRequirementsGetAllSuspense as h } from "@gusto/embedded-api/react-query/taxRequirementsGetAll";
3
- import { Head as s } from "./Head.js";
4
- import { StateTaxesListProvider as T } from "./context.js";
5
- import { Actions as m } from "./Actions.js";
6
- import { List as a } from "./List.js";
7
- import { BaseComponent as x } from "../../../Base/Base.js";
8
- import { useI18n as A } from "../../../../i18n/I18n.js";
9
- import { Flex as C } from "../../../Common/Flex/Flex.js";
10
- import { componentEvents as i } from "../../../../shared/constants.js";
11
- import { useBase as E } from "../../../Base/useBase.js";
12
- function t(n) {
13
- return /* @__PURE__ */ e(x, { ...n, children: /* @__PURE__ */ e(S, { ...n, children: n.children }) });
1
+ import { jsx as e, jsxs as c, Fragment as l } from "react/jsx-runtime";
2
+ import { useTaxRequirementsGetAllSuspense as d } from "@gusto/embedded-api/react-query/taxRequirementsGetAll";
3
+ import { Head as f } from "./Head.js";
4
+ import { StateTaxesListProvider as p } from "./context.js";
5
+ import { Actions as u } from "./Actions.js";
6
+ import { List as h } from "./List.js";
7
+ import { BaseComponent as T } from "../../../Base/Base.js";
8
+ import { useI18n as x } from "../../../../i18n/I18n.js";
9
+ import { Flex as A } from "../../../Common/Flex/Flex.js";
10
+ import { componentEvents as r } from "../../../../shared/constants.js";
11
+ import { useBase as C } from "../../../Base/useBase.js";
12
+ function y(n) {
13
+ return /* @__PURE__ */ e(T, { ...n, children: /* @__PURE__ */ e(E, { ...n, children: n.children }) });
14
14
  }
15
- function S({ className: n, children: o, companyId: c }) {
16
- A("Company.StateTaxes");
17
- const { onEvent: r } = E(), { data: d } = h({ companyUuid: c }), l = d.responseBodies;
15
+ function E({ className: n, children: t, companyId: i }) {
16
+ x("Company.StateTaxes");
17
+ const { onEvent: o } = C(), { data: m } = d({ companyUuid: i }), s = m.responseBodies;
18
18
  return /* @__PURE__ */ e("section", { className: n, children: /* @__PURE__ */ e(
19
- T,
19
+ p,
20
20
  {
21
21
  value: {
22
22
  isPending: !1,
23
- stateTaxRequirements: l,
23
+ stateTaxRequirements: s,
24
24
  handleContinue: () => {
25
- r(i.COMPANY_STATE_TAX_DONE);
25
+ o(r.COMPANY_STATE_TAX_DONE);
26
26
  },
27
- handleChange: (f) => {
28
- r(i.COMPANY_STATE_TAX_EDIT, { state: f });
27
+ handleChange: (a) => {
28
+ o(r.COMPANY_STATE_TAX_EDIT, { state: a });
29
29
  }
30
30
  },
31
- children: /* @__PURE__ */ e(C, { flexDirection: "column", gap: 32, children: o || /* @__PURE__ */ p(u, { children: [
32
- /* @__PURE__ */ e(s, {}),
33
- /* @__PURE__ */ e(a, {}),
34
- /* @__PURE__ */ e(m, {})
31
+ children: /* @__PURE__ */ e(A, { flexDirection: "column", gap: 32, children: t || /* @__PURE__ */ c(l, { children: [
32
+ /* @__PURE__ */ e(f, {}),
33
+ /* @__PURE__ */ e(h, {}),
34
+ /* @__PURE__ */ e(u, {})
35
35
  ] }) })
36
36
  }
37
37
  ) });
38
38
  }
39
- t.Head = s;
40
- t.List = a;
41
- t.Actions = m;
42
39
  export {
43
- t as StateTaxesList
40
+ y as StateTaxesList
44
41
  };
45
42
  //# sourceMappingURL=StateTaxesList.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"StateTaxesList.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesList/StateTaxesList.tsx"],"sourcesContent":["import { useTaxRequirementsGetAllSuspense } from '@gusto/embedded-api/react-query/taxRequirementsGetAll'\nimport { Head } from './Head'\nimport { StateTaxesListProvider } from './context'\nimport { Actions } from './Actions'\nimport { List } from './List'\nimport type { BaseComponentInterface } from '@/components/Base/Base'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { useI18n } from '@/i18n/I18n'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { componentEvents } from '@/shared/constants'\nimport { useBase } from '@/components/Base'\n\ninterface StateTaxesListProps extends BaseComponentInterface {\n companyId: string\n}\n\nexport function StateTaxesList(props: StateTaxesListProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ className, children, companyId }: StateTaxesListProps) {\n useI18n('Company.StateTaxes')\n const { onEvent } = useBase()\n const { data } = useTaxRequirementsGetAllSuspense({ companyUuid: companyId })\n const stateTaxRequirements = data.responseBodies!\n\n const handleContinue = () => {\n onEvent(componentEvents.COMPANY_STATE_TAX_DONE)\n }\n\n const handleChange = (state: string) => {\n onEvent(componentEvents.COMPANY_STATE_TAX_EDIT, { state })\n }\n\n return (\n <section className={className}>\n <StateTaxesListProvider\n value={{\n isPending: false,\n stateTaxRequirements,\n handleContinue,\n handleChange,\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 </StateTaxesListProvider>\n </section>\n )\n}\n\nStateTaxesList.Head = Head\nStateTaxesList.List = List\nStateTaxesList.Actions = Actions\n"],"names":["StateTaxesList","props","jsx","BaseComponent","Root","className","children","companyId","useI18n","onEvent","useBase","data","useTaxRequirementsGetAllSuspense","stateTaxRequirements","StateTaxesListProvider","componentEvents","state","Flex","jsxs","Fragment","Head","List","Actions"],"mappings":";;;;;;;;;;;AAgBO,SAASA,EAAeC,GAA4B;AAEvD,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,UAAAC,GAAU,WAAAC,KAAkC;AACrE,EAAAC,EAAQ,oBAAoB;AACtB,QAAA,EAAE,SAAAC,EAAQ,IAAIC,EAAQ,GACtB,EAAE,MAAAC,EAAK,IAAIC,EAAiC,EAAE,aAAaL,GAAW,GACtEM,IAAuBF,EAAK;AAWhC,SAAA,gBAAAT,EAAC,aAAQ,WAAAG,GACP,UAAA,gBAAAH;AAAA,IAACY;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,WAAW;AAAA,QACX,sBAAAD;AAAA,QACA,gBAde,MAAM;AAC3B,UAAAJ,EAAQM,EAAgB,sBAAsB;AAAA,QAChD;AAAA,QAaQ,cAXa,CAACC,MAAkB;AACtC,UAAAP,EAAQM,EAAgB,wBAAwB,EAAE,OAAAC,EAAA,CAAO;AAAA,QAC3D;AAAA,MAUM;AAAA,MAEA,UAAA,gBAAAd,EAACe,KAAK,eAAc,UAAS,KAAK,IAC/B,UAAAX,KAIG,gBAAAY,EAAAC,GAAA,EAAA,UAAA;AAAA,QAAA,gBAAAjB,EAACkB,GAAK,EAAA;AAAA,0BACLC,GAAK,EAAA;AAAA,0BACLC,GAAQ,CAAA,CAAA;AAAA,MAAA,EAAA,CACX,EAEJ,CAAA;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;AAEAtB,EAAe,OAAOoB;AACtBpB,EAAe,OAAOqB;AACtBrB,EAAe,UAAUsB;"}
1
+ {"version":3,"file":"StateTaxesList.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesList/StateTaxesList.tsx"],"sourcesContent":["import { useTaxRequirementsGetAllSuspense } from '@gusto/embedded-api/react-query/taxRequirementsGetAll'\nimport { Head } from './Head'\nimport { StateTaxesListProvider } from './context'\nimport { Actions } from './Actions'\nimport { List } from './List'\nimport type { BaseComponentInterface } from '@/components/Base/Base'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { useI18n } from '@/i18n/I18n'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { componentEvents } from '@/shared/constants'\nimport { useBase } from '@/components/Base'\n\ninterface StateTaxesListProps extends BaseComponentInterface {\n companyId: string\n}\n\nexport function StateTaxesList(props: StateTaxesListProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ className, children, companyId }: StateTaxesListProps) {\n useI18n('Company.StateTaxes')\n const { onEvent } = useBase()\n const { data } = useTaxRequirementsGetAllSuspense({ companyUuid: companyId })\n const stateTaxRequirements = data.responseBodies!\n\n const handleContinue = () => {\n onEvent(componentEvents.COMPANY_STATE_TAX_DONE)\n }\n\n const handleChange = (state: string) => {\n onEvent(componentEvents.COMPANY_STATE_TAX_EDIT, { state })\n }\n\n return (\n <section className={className}>\n <StateTaxesListProvider\n value={{\n isPending: false,\n stateTaxRequirements,\n handleContinue,\n handleChange,\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 </StateTaxesListProvider>\n </section>\n )\n}\n"],"names":["StateTaxesList","props","jsx","BaseComponent","Root","className","children","companyId","useI18n","onEvent","useBase","data","useTaxRequirementsGetAllSuspense","stateTaxRequirements","StateTaxesListProvider","componentEvents","state","Flex","jsxs","Fragment","Head","List","Actions"],"mappings":";;;;;;;;;;;AAgBO,SAASA,EAAeC,GAA4B;AAEvD,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,UAAAC,GAAU,WAAAC,KAAkC;AACrE,EAAAC,EAAQ,oBAAoB;AACtB,QAAA,EAAE,SAAAC,EAAQ,IAAIC,EAAQ,GACtB,EAAE,MAAAC,EAAK,IAAIC,EAAiC,EAAE,aAAaL,GAAW,GACtEM,IAAuBF,EAAK;AAWhC,SAAA,gBAAAT,EAAC,aAAQ,WAAAG,GACP,UAAA,gBAAAH;AAAA,IAACY;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,WAAW;AAAA,QACX,sBAAAD;AAAA,QACA,gBAde,MAAM;AAC3B,UAAAJ,EAAQM,EAAgB,sBAAsB;AAAA,QAChD;AAAA,QAaQ,cAXa,CAACC,MAAkB;AACtC,UAAAP,EAAQM,EAAgB,wBAAwB,EAAE,OAAAC,EAAA,CAAO;AAAA,QAC3D;AAAA,MAUM;AAAA,MAEA,UAAA,gBAAAd,EAACe,KAAK,eAAc,UAAS,KAAK,IAC/B,UAAAX,KAIG,gBAAAY,EAAAC,GAAA,EAAA,UAAA;AAAA,QAAA,gBAAAjB,EAACkB,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 t } from "../../../Base/createCompoundContext.js";
15
15
  const [c, d] = t("StateTaxesListContext");
16
16
  export {
@@ -0,0 +1,20 @@
1
+ import { componentEvents } from '../../../shared/constants';
2
+ export type StateTaxesState = 'viewStateTaxes' | 'editStateTaxes' | 'done';
3
+ export interface StateTaxesStateData {
4
+ state: StateTaxesState;
5
+ selectedState?: string;
6
+ }
7
+ export type StateTaxesAction = {
8
+ type: typeof componentEvents.COMPANY_STATE_TAX_EDIT;
9
+ payload: {
10
+ state: string;
11
+ };
12
+ } | {
13
+ type: typeof componentEvents.COMPANY_STATE_TAX_UPDATED;
14
+ } | {
15
+ type: typeof componentEvents.COMPANY_STATE_TAX_DONE;
16
+ } | {
17
+ type: typeof componentEvents.CANCEL;
18
+ };
19
+ export declare const initialState: StateTaxesStateData;
20
+ export declare function stateTaxesReducer(state: StateTaxesStateData, action: StateTaxesAction): StateTaxesStateData;
@@ -0,0 +1,40 @@
1
+ import { componentEvents as t } from "../../../shared/constants.js";
2
+ const T = {
3
+ state: "viewStateTaxes",
4
+ selectedState: void 0
5
+ };
6
+ function d(e, a) {
7
+ switch (a.type) {
8
+ case t.COMPANY_STATE_TAX_EDIT:
9
+ return {
10
+ ...e,
11
+ state: "editStateTaxes",
12
+ selectedState: a.payload.state
13
+ };
14
+ case t.COMPANY_STATE_TAX_UPDATED:
15
+ return {
16
+ ...e,
17
+ state: "viewStateTaxes",
18
+ selectedState: void 0
19
+ };
20
+ case t.CANCEL:
21
+ return {
22
+ ...e,
23
+ state: "viewStateTaxes",
24
+ selectedState: void 0
25
+ };
26
+ case t.COMPANY_STATE_TAX_DONE:
27
+ return {
28
+ ...e,
29
+ state: "done",
30
+ selectedState: void 0
31
+ };
32
+ default:
33
+ return e;
34
+ }
35
+ }
36
+ export {
37
+ T as initialState,
38
+ d as stateTaxesReducer
39
+ };
40
+ //# sourceMappingURL=stateTaxesReducer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stateTaxesReducer.js","sources":["../../../../src/components/Company/StateTaxes/stateTaxesReducer.ts"],"sourcesContent":["import { componentEvents } from '@/shared/constants'\n\nexport type StateTaxesState = 'viewStateTaxes' | 'editStateTaxes' | 'done'\n\nexport interface StateTaxesStateData {\n state: StateTaxesState\n selectedState?: string\n}\n\nexport type StateTaxesAction =\n | { type: typeof componentEvents.COMPANY_STATE_TAX_EDIT; payload: { state: string } }\n | { type: typeof componentEvents.COMPANY_STATE_TAX_UPDATED }\n | { type: typeof componentEvents.COMPANY_STATE_TAX_DONE }\n | { type: typeof componentEvents.CANCEL }\n\nexport const initialState: StateTaxesStateData = {\n state: 'viewStateTaxes',\n selectedState: undefined,\n}\n\nexport function stateTaxesReducer(\n state: StateTaxesStateData,\n action: StateTaxesAction,\n): StateTaxesStateData {\n switch (action.type) {\n case componentEvents.COMPANY_STATE_TAX_EDIT:\n return {\n ...state,\n state: 'editStateTaxes',\n selectedState: action.payload.state,\n }\n\n case componentEvents.COMPANY_STATE_TAX_UPDATED:\n return {\n ...state,\n state: 'viewStateTaxes',\n selectedState: undefined,\n }\n\n case componentEvents.CANCEL:\n return {\n ...state,\n state: 'viewStateTaxes',\n selectedState: undefined,\n }\n\n case componentEvents.COMPANY_STATE_TAX_DONE:\n return {\n ...state,\n state: 'done',\n selectedState: undefined,\n }\n\n default:\n return state\n }\n}\n"],"names":["initialState","stateTaxesReducer","state","action","componentEvents"],"mappings":";AAeO,MAAMA,IAAoC;AAAA,EAC/C,OAAO;AAAA,EACP,eAAe;AACjB;AAEgB,SAAAC,EACdC,GACAC,GACqB;AACrB,UAAQA,EAAO,MAAM;AAAA,IACnB,KAAKC,EAAgB;AACZ,aAAA;AAAA,QACL,GAAGF;AAAA,QACH,OAAO;AAAA,QACP,eAAeC,EAAO,QAAQ;AAAA,MAChC;AAAA,IAEF,KAAKC,EAAgB;AACZ,aAAA;AAAA,QACL,GAAGF;AAAA,QACH,OAAO;AAAA,QACP,eAAe;AAAA,MACjB;AAAA,IAEF,KAAKE,EAAgB;AACZ,aAAA;AAAA,QACL,GAAGF;AAAA,QACH,OAAO;AAAA,QACP,eAAe;AAAA,MACjB;AAAA,IAEF,KAAKE,EAAgB;AACZ,aAAA;AAAA,QACL,GAAGF;AAAA,QACH,OAAO;AAAA,QACP,eAAe;AAAA,MACjB;AAAA,IAEF;AACS,aAAAA;AAAA,EAAA;AAEb;"}
@@ -8,9 +8,4 @@ export interface AddressProps extends BaseComponentInterface<'Contractor.Address
8
8
  className?: string;
9
9
  }
10
10
  export declare function Address(props: AddressProps): import("react/jsx-runtime").JSX.Element;
11
- export declare namespace Address {
12
- var Head: typeof import("./Head").Head;
13
- var Form: typeof import("./Form").Form;
14
- var Actions: typeof import("./Actions").Actions;
15
- }
16
11
  export default Address;
@@ -1,38 +1,36 @@
1
- import { jsx as t, jsxs as E, Fragment as P } from "react/jsx-runtime";
2
- import { useContractorsGetSuspense as T } from "@gusto/embedded-api/react-query/contractorsGet";
3
- import { useContractorsGetAddressSuspense as U } from "@gusto/embedded-api/react-query/contractorsGetAddress";
4
- import { useContractorsUpdateAddressMutation as b } from "@gusto/embedded-api/react-query/contractorsUpdateAddress";
5
- import { useForm as x, FormProvider as O } from "react-hook-form";
6
- import { zodResolver as _ } from "@hookform/resolvers/zod";
7
- import { AddressFormSchema as B, AddressProvider as H } from "./useAddress.js";
8
- import { Head as p } from "./Head.js";
9
- import { Form as u } from "./Form.js";
10
- import { Actions as f } from "./Actions.js";
1
+ import { jsx as t, jsxs as F, Fragment as R } from "react/jsx-runtime";
2
+ import { useContractorsGetSuspense as g } from "@gusto/embedded-api/react-query/contractorsGet";
3
+ import { useContractorsGetAddressSuspense as z } from "@gusto/embedded-api/react-query/contractorsGetAddress";
4
+ import { useContractorsUpdateAddressMutation as E } from "@gusto/embedded-api/react-query/contractorsUpdateAddress";
5
+ import { useForm as P, FormProvider as T } from "react-hook-form";
6
+ import { zodResolver as U } from "@hookform/resolvers/zod";
7
+ import { AddressFormSchema as b, AddressProvider as x } from "./useAddress.js";
8
+ import { Head as O } from "./Head.js";
9
+ import { Form as _ } from "./Form.js";
10
+ import { Actions as B } from "./Actions.js";
11
11
  import { Form as N } from "../../Common/Form/Form.js";
12
12
  import { useComponentDictionary as j, useI18n as q } from "../../../i18n/I18n.js";
13
13
  import { Flex as w } from "../../Common/Flex/Flex.js";
14
- import "react-i18next";
15
- import "classnames";
16
14
  import { BaseComponent as G } from "../../Base/Base.js";
17
- import { useBase as M } from "../../Base/useBase.js";
18
- import { contractorEvents as a } from "../../../shared/constants.js";
19
- function n(r) {
20
- return /* @__PURE__ */ t(G, { ...r, children: /* @__PURE__ */ t($, { ...r, children: r.children }) });
15
+ import { useBase as H } from "../../Base/useBase.js";
16
+ import { contractorEvents as d } from "../../../shared/constants.js";
17
+ function st(r) {
18
+ return /* @__PURE__ */ t(G, { ...r, children: /* @__PURE__ */ t(M, { ...r, children: r.children }) });
21
19
  }
22
- function $({ contractorId: r, defaultValues: e, children: i, className: A, dictionary: D }) {
23
- j("Contractor.Address", D), q("Contractor.Address");
24
- const { onEvent: c, baseSubmitHandler: h } = M(), { data: m } = T({ contractorUuid: r }), { data: C } = U({ contractorUuid: r }), { mutateAsync: S, isPending: l } = b(), v = m.contractor, F = m.contractor?.type, o = C.contractorAddress, y = {
20
+ function M({ contractorId: r, defaultValues: e, children: n, className: a, dictionary: p }) {
21
+ j("Contractor.Address", p), q("Contractor.Address");
22
+ const { onEvent: i, baseSubmitHandler: u } = H(), { data: c } = g({ contractorUuid: r }), { data: f } = z({ contractorUuid: r }), { mutateAsync: A, isPending: D } = E(), h = c.contractor, C = c.contractor?.type, o = f.contractorAddress, S = {
25
23
  street1: o?.street1 || e?.street1 || "",
26
24
  street2: o?.street2 || e?.street2 || "",
27
25
  city: o?.city || e?.city || "",
28
26
  state: o?.state || e?.state || "",
29
27
  zip: o?.zip || e?.zip || ""
30
- }, d = x({
31
- resolver: _(B),
32
- defaultValues: y
33
- }), R = async (g) => {
34
- await h(g, async (s) => {
35
- const { contractorAddress: z } = await S({
28
+ }, m = P({
29
+ resolver: U(b),
30
+ defaultValues: S
31
+ }), l = async (v) => {
32
+ await u(v, async (s) => {
33
+ const { contractorAddress: y } = await A({
36
34
  request: {
37
35
  contractorUuid: r,
38
36
  requestBody: {
@@ -45,31 +43,28 @@ function $({ contractorId: r, defaultValues: e, children: i, className: A, dicti
45
43
  }
46
44
  }
47
45
  });
48
- c(a.CONTRACTOR_ADDRESS_UPDATED, z), c(a.CONTRACTOR_ADDRESS_DONE);
46
+ i(d.CONTRACTOR_ADDRESS_UPDATED, y), i(d.CONTRACTOR_ADDRESS_DONE);
49
47
  });
50
48
  };
51
- return /* @__PURE__ */ t("section", { className: A, children: /* @__PURE__ */ t(
52
- H,
49
+ return /* @__PURE__ */ t("section", { className: a, children: /* @__PURE__ */ t(
50
+ x,
53
51
  {
54
52
  value: {
55
- contractor: v,
56
- contractorType: F,
53
+ contractor: h,
54
+ contractorType: C,
57
55
  address: o,
58
- isPending: l
56
+ isPending: D
59
57
  },
60
- children: /* @__PURE__ */ t(O, { ...d, children: /* @__PURE__ */ t(N, { onSubmit: d.handleSubmit(R), children: /* @__PURE__ */ t(w, { flexDirection: "column", gap: 32, children: i || /* @__PURE__ */ E(P, { children: [
61
- /* @__PURE__ */ t(p, {}),
62
- /* @__PURE__ */ t(u, {}),
63
- /* @__PURE__ */ t(f, {})
58
+ children: /* @__PURE__ */ t(T, { ...m, children: /* @__PURE__ */ t(N, { onSubmit: m.handleSubmit(l), children: /* @__PURE__ */ t(w, { flexDirection: "column", gap: 32, children: n || /* @__PURE__ */ F(R, { children: [
59
+ /* @__PURE__ */ t(O, {}),
60
+ /* @__PURE__ */ t(_, {}),
61
+ /* @__PURE__ */ t(B, {})
64
62
  ] }) }) }) })
65
63
  }
66
64
  ) });
67
65
  }
68
- n.Head = p;
69
- n.Form = u;
70
- n.Actions = f;
71
66
  export {
72
- n as Address,
73
- n as default
67
+ st as Address,
68
+ st as default
74
69
  };
75
70
  //# sourceMappingURL=Address.js.map