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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (272) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/components/Base/Base.js +19 -18
  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 +6 -4
  9. package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
  10. package/dist/components/Common/SignatureForm/SignatureFormActions.js +12 -10
  11. package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
  12. package/dist/components/Common/SignatureForm/SignatureFormFields.js +8 -6
  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 +40 -42
  20. package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
  21. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +8 -6
  22. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
  23. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +10 -8
  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 -53
  27. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
  28. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +11 -11
  29. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +1 -1
  30. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +8 -6
  31. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
  32. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.d.ts +0 -4
  33. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +40 -42
  34. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
  35. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +1 -1
  36. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +1 -1
  37. package/dist/components/Company/AssignSignatory/TitleSelect.js +8 -7
  38. package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
  39. package/dist/components/Company/AssignSignatory/index.d.ts +0 -1
  40. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +1 -1
  41. package/dist/components/Company/BankAccount/BankAccount.d.ts +0 -5
  42. package/dist/components/Company/BankAccount/BankAccount.js +17 -23
  43. package/dist/components/Company/BankAccount/BankAccount.js.map +1 -1
  44. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +9 -8
  45. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
  46. package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.d.ts +0 -5
  47. package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.js +28 -31
  48. package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.js.map +1 -1
  49. package/dist/components/Company/BankAccount/BankAccountForm/Form.js +11 -9
  50. package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
  51. package/dist/components/Company/BankAccount/BankAccountForm/context.js +1 -1
  52. package/dist/components/Company/BankAccount/BankAccountList/Actions.js +12 -10
  53. package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
  54. package/dist/components/Company/BankAccount/BankAccountList/BankAccountList.d.ts +0 -5
  55. package/dist/components/Company/BankAccount/BankAccountList/BankAccountList.js +25 -28
  56. package/dist/components/Company/BankAccount/BankAccountList/BankAccountList.js.map +1 -1
  57. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +13 -11
  58. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
  59. package/dist/components/Company/BankAccount/BankAccountVerify/BankAccountVerify.d.ts +0 -5
  60. package/dist/components/Company/BankAccount/BankAccountVerify/BankAccountVerify.js +33 -36
  61. package/dist/components/Company/BankAccount/BankAccountVerify/BankAccountVerify.js.map +1 -1
  62. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +6 -4
  63. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
  64. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +7 -5
  65. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
  66. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.d.ts +0 -6
  67. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +38 -41
  68. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  69. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +1 -1
  70. package/dist/components/Company/DocumentSigner/DocumentSigner.d.ts +0 -4
  71. package/dist/components/Company/DocumentSigner/DocumentSigner.js +23 -26
  72. package/dist/components/Company/DocumentSigner/DocumentSigner.js.map +1 -1
  73. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.d.ts +0 -6
  74. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +41 -44
  75. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  76. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +1 -1
  77. package/dist/components/Company/FederalTaxes/Actions.js +9 -7
  78. package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
  79. package/dist/components/Company/FederalTaxes/FederalTaxes.js +7 -6
  80. package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
  81. package/dist/components/Company/FederalTaxes/Form.js +5 -3
  82. package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
  83. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +1 -1
  84. package/dist/components/Company/Industry/Actions.js +7 -5
  85. package/dist/components/Company/Industry/Actions.js.map +1 -1
  86. package/dist/components/Company/Industry/Context.js +1 -1
  87. package/dist/components/Company/Industry/Edit.js +12 -10
  88. package/dist/components/Company/Industry/Edit.js.map +1 -1
  89. package/dist/components/Company/Industry/Industry.d.ts +0 -5
  90. package/dist/components/Company/Industry/Industry.js +23 -29
  91. package/dist/components/Company/Industry/Industry.js.map +1 -1
  92. package/dist/components/Company/Locations/LocationForm/Actions.js +8 -6
  93. package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
  94. package/dist/components/Company/Locations/LocationForm/Form.js +1 -1
  95. package/dist/components/Company/Locations/LocationForm/LocationForm.d.ts +0 -5
  96. package/dist/components/Company/Locations/LocationForm/LocationForm.js +43 -45
  97. package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
  98. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +1 -1
  99. package/dist/components/Company/Locations/Locations.d.ts +0 -4
  100. package/dist/components/Company/Locations/Locations.js +14 -18
  101. package/dist/components/Company/Locations/Locations.js.map +1 -1
  102. package/dist/components/Company/Locations/LocationsList/Actions.js +8 -6
  103. package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
  104. package/dist/components/Company/Locations/LocationsList/List.js +4 -2
  105. package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
  106. package/dist/components/Company/Locations/LocationsList/LocationsList.d.ts +0 -5
  107. package/dist/components/Company/Locations/LocationsList/LocationsList.js +33 -35
  108. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  109. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +1 -1
  110. package/dist/components/Company/OnboardingOverview/Completed.js +14 -12
  111. package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
  112. package/dist/components/Company/OnboardingOverview/MissingRequirements.js +8 -6
  113. package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
  114. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +3 -2
  115. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
  116. package/dist/components/Company/OnboardingOverview/context.js +1 -1
  117. package/dist/components/Company/PaySchedule/PaySchedule.d.ts +1 -7
  118. package/dist/components/Company/PaySchedule/PaySchedule.js +68 -71
  119. package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
  120. package/dist/components/Company/PaySchedule/_parts/Actions.js +12 -10
  121. package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
  122. package/dist/components/Company/PaySchedule/_parts/Edit.js +15 -15
  123. package/dist/components/Company/PaySchedule/_parts/Head.js +8 -6
  124. package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
  125. package/dist/components/Company/PaySchedule/_parts/List.js +15 -13
  126. package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
  127. package/dist/components/Company/PaySchedule/usePaySchedule.js +1 -1
  128. package/dist/components/Company/StateTaxes/StateTaxes.d.ts +0 -4
  129. package/dist/components/Company/StateTaxes/StateTaxes.js +16 -20
  130. package/dist/components/Company/StateTaxes/StateTaxes.js.map +1 -1
  131. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +7 -5
  132. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
  133. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.d.ts +0 -5
  134. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js +44 -47
  135. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js.map +1 -1
  136. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +1 -1
  137. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +8 -6
  138. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
  139. package/dist/components/Company/StateTaxes/StateTaxesList/List.js +7 -5
  140. package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
  141. package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.d.ts +0 -5
  142. package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js +26 -29
  143. package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js.map +1 -1
  144. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +1 -1
  145. package/dist/components/Contractor/Address/Address.d.ts +0 -5
  146. package/dist/components/Contractor/Address/Address.js +36 -38
  147. package/dist/components/Contractor/Address/Address.js.map +1 -1
  148. package/dist/components/Contractor/Address/Form.js +1 -1
  149. package/dist/components/Contractor/Address/useAddress.js +1 -1
  150. package/dist/components/Contractor/NewHireReport/NewHireReport.js +17 -16
  151. package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
  152. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +7 -5
  153. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
  154. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +3 -2
  155. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
  156. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +3 -2
  157. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
  158. package/dist/components/Contractor/Profile/ContractorProfile.d.ts +11 -0
  159. package/dist/components/Contractor/Profile/ContractorProfile.js +24 -0
  160. package/dist/components/Contractor/Profile/ContractorProfile.js.map +1 -0
  161. package/dist/components/Contractor/Profile/ContractorProfileForm.d.ts +5 -0
  162. package/dist/components/Contractor/Profile/ContractorProfileForm.js +140 -0
  163. package/dist/components/Contractor/Profile/ContractorProfileForm.js.map +1 -0
  164. package/dist/components/Contractor/Profile/index.d.ts +3 -0
  165. package/dist/components/Contractor/Profile/useContractorProfile.d.ts +254 -0
  166. package/dist/components/Contractor/Profile/useContractorProfile.js +223 -0
  167. package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -0
  168. package/dist/components/Contractor/Submit/ContractorSubmitWithApi.d.ts +6 -0
  169. package/dist/components/Contractor/Submit/ContractorSubmitWithApi.js +27 -0
  170. package/dist/components/Contractor/Submit/ContractorSubmitWithApi.js.map +1 -0
  171. package/dist/components/Contractor/Submit/SubmitDone.d.ts +5 -0
  172. package/dist/components/Contractor/Submit/SubmitDone.js +18 -0
  173. package/dist/components/Contractor/Submit/SubmitDone.js.map +1 -0
  174. package/dist/components/Contractor/Submit/index.d.ts +6 -0
  175. package/dist/components/Contractor/Submit/index.js +20 -0
  176. package/dist/components/Contractor/Submit/index.js.map +1 -0
  177. package/dist/components/Contractor/Submit/index.module.scss.js +8 -0
  178. package/dist/components/Contractor/Submit/index.module.scss.js.map +1 -0
  179. package/dist/components/Contractor/index.d.ts +2 -0
  180. package/dist/components/Contractor/index.js +10 -6
  181. package/dist/components/Contractor/index.js.map +1 -1
  182. package/dist/components/Employee/Compensation/Actions.js +6 -5
  183. package/dist/components/Employee/Compensation/Actions.js.map +1 -1
  184. package/dist/components/Employee/Compensation/Compensation.d.ts +0 -6
  185. package/dist/components/Employee/Compensation/Compensation.js +97 -102
  186. package/dist/components/Employee/Compensation/Compensation.js.map +1 -1
  187. package/dist/components/Employee/Compensation/Edit.js +15 -14
  188. package/dist/components/Employee/Compensation/Edit.js.map +1 -1
  189. package/dist/components/Employee/Compensation/List.js +25 -23
  190. package/dist/components/Employee/Compensation/List.js.map +1 -1
  191. package/dist/components/Employee/Deductions/Actions.js +12 -10
  192. package/dist/components/Employee/Deductions/Actions.js.map +1 -1
  193. package/dist/components/Employee/Deductions/DeductionForm.js +12 -10
  194. package/dist/components/Employee/Deductions/DeductionForm.js.map +1 -1
  195. package/dist/components/Employee/Deductions/DeductionsList.js +7 -5
  196. package/dist/components/Employee/Deductions/DeductionsList.js.map +1 -1
  197. package/dist/components/Employee/Deductions/IncludeDeductionsForm.js +12 -10
  198. package/dist/components/Employee/Deductions/IncludeDeductionsForm.js.map +1 -1
  199. package/dist/components/Employee/Deductions/useDeductions.js +1 -1
  200. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +8 -6
  201. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
  202. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.d.ts +0 -5
  203. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +26 -28
  204. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  205. package/dist/components/Employee/DocumentSigner/DocumentList/List.js +4 -2
  206. package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
  207. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +1 -1
  208. package/dist/components/Employee/DocumentSigner/DocumentSigner.d.ts +1 -7
  209. package/dist/components/Employee/DocumentSigner/DocumentSigner.js +16 -20
  210. package/dist/components/Employee/DocumentSigner/DocumentSigner.js.map +1 -1
  211. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.d.ts +0 -7
  212. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +41 -44
  213. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  214. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +1 -1
  215. package/dist/components/Employee/EmployeeList/Actions.js +6 -4
  216. package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
  217. package/dist/components/Employee/EmployeeList/EmployeeList.d.ts +0 -5
  218. package/dist/components/Employee/EmployeeList/EmployeeList.js +57 -59
  219. package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
  220. package/dist/components/Employee/EmployeeList/Head.js +7 -5
  221. package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
  222. package/dist/components/Employee/EmployeeList/List.js +15 -14
  223. package/dist/components/Employee/EmployeeList/List.js.map +1 -1
  224. package/dist/components/Employee/EmployeeList/useEmployeeList.js +1 -1
  225. package/dist/components/Employee/Landing/Landing.js +13 -12
  226. package/dist/components/Employee/Landing/Landing.js.map +1 -1
  227. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +7 -7
  228. package/dist/components/Employee/PaymentMethod/Actions.js +9 -7
  229. package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
  230. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +4 -3
  231. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
  232. package/dist/components/Employee/PaymentMethod/BankAccountsList.js +10 -8
  233. package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
  234. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +3 -2
  235. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
  236. package/dist/components/Employee/PaymentMethod/Split.js +11 -10
  237. package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
  238. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +1 -1
  239. package/dist/components/Employee/Profile/Actions.js +9 -7
  240. package/dist/components/Employee/Profile/Actions.js.map +1 -1
  241. package/dist/components/Employee/Profile/AdminPersonalDetails.d.ts +3 -3
  242. package/dist/components/Employee/Profile/AdminPersonalDetails.js +10 -9
  243. package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
  244. package/dist/components/Employee/Profile/HomeAddress.js +1 -1
  245. package/dist/components/Employee/Profile/PersonalDetailsInputs.d.ts +2 -2
  246. package/dist/components/Employee/Profile/PersonalDetailsInputs.js +2 -2
  247. package/dist/components/Employee/Profile/Profile.d.ts +0 -8
  248. package/dist/components/Employee/Profile/Profile.js +131 -138
  249. package/dist/components/Employee/Profile/Profile.js.map +1 -1
  250. package/dist/components/Employee/Profile/useProfile.js +1 -1
  251. package/dist/components/Employee/Taxes/Actions.js +10 -8
  252. package/dist/components/Employee/Taxes/Actions.js.map +1 -1
  253. package/dist/components/Employee/Taxes/FederalForm.js +12 -10
  254. package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
  255. package/dist/components/Employee/Taxes/Taxes.d.ts +0 -6
  256. package/dist/components/Employee/Taxes/Taxes.js +76 -81
  257. package/dist/components/Employee/Taxes/Taxes.js.map +1 -1
  258. package/dist/components/Employee/Taxes/useTaxes.js +1 -1
  259. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +4 -2
  260. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  261. package/dist/i18n/I18n.js +1 -1
  262. package/dist/i18n/I18n.js.map +1 -1
  263. package/dist/i18n/en/Contractor.ContractorSubmit.json.js +22 -0
  264. package/dist/i18n/en/Contractor.ContractorSubmit.json.js.map +1 -0
  265. package/dist/i18n/en/Contractor.Profile.json.js +73 -0
  266. package/dist/i18n/en/Contractor.Profile.json.js.map +1 -0
  267. package/dist/shared/constants.d.ts +14 -0
  268. package/dist/shared/constants.js +33 -26
  269. package/dist/shared/constants.js.map +1 -1
  270. package/dist/style.css +1 -1
  271. package/dist/types/i18next.d.ts +77 -1
  272. package/package.json +2 -2
@@ -1,36 +1,38 @@
1
- import { jsx as e, jsxs as p } from "react/jsx-runtime";
1
+ import { jsx as e, jsxs as u } from "react/jsx-runtime";
2
2
  import { useTranslation as h } from "react-i18next";
3
3
  import { usePaySchedule as y } from "../usePaySchedule.js";
4
4
  import o from "./List.module.scss.js";
5
5
  import { Flex as s } from "../../../Common/Flex/Flex.js";
6
+ import "classnames";
7
+ import "../../../../shared/constants.js";
6
8
  import f from "../../../../assets/icons/pencil.svg.js";
7
9
  import { useComponentContext as S } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
8
10
  import { HamburgerMenu as v } from "../../../Common/HamburgerMenu/HamburgerMenu.js";
9
11
  import { VisuallyHidden as g } from "../../../Common/VisuallyHidden/VisuallyHidden.js";
10
12
  import { useDataView as L } from "../../../Common/DataView/useDataView.js";
11
13
  import { DataView as C } from "../../../Common/DataView/DataView.js";
12
- const H = () => {
13
- const { t: n } = h("Company.PaySchedule"), r = S(), { paySchedules: c, mode: m, handleEdit: l } = y(), { ...d } = L({
14
- data: c || [],
14
+ const F = () => {
15
+ const { t: r } = h("Company.PaySchedule"), n = S(), { paySchedules: m, mode: c, handleEdit: l } = y(), { ...d } = L({
16
+ data: m || [],
15
17
  columns: [
16
18
  {
17
- title: n("payScheduleList.name"),
19
+ title: r("payScheduleList.name"),
18
20
  key: "customName",
19
21
  render: (t) => {
20
22
  const a = !!t.name;
21
23
  let i = a ? t.name : t.customName;
22
24
  i && i.length > 1 ? i = i.charAt(0).toUpperCase() + i.slice(1) : i = t.customName;
23
- const u = t.customName;
24
- return /* @__PURE__ */ e(s, { flexDirection: "column", gap: 0, children: /* @__PURE__ */ p("div", { className: o.content, children: [
25
+ const p = t.customName;
26
+ return /* @__PURE__ */ e(s, { flexDirection: "column", gap: 0, children: /* @__PURE__ */ u("div", { className: o.content, children: [
25
27
  /* @__PURE__ */ e("div", { children: i }),
26
- a && /* @__PURE__ */ e("div", { children: u })
28
+ a && /* @__PURE__ */ e("div", { children: p })
27
29
  ] }) });
28
30
  }
29
31
  },
30
32
  {
31
- title: /* @__PURE__ */ e(g, { children: n("payScheduleList.active") }),
33
+ title: /* @__PURE__ */ e(g, { children: r("payScheduleList.active") }),
32
34
  key: "active",
33
- render: (t) => /* @__PURE__ */ e(s, { alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ e("div", { className: o.content, children: t.active ? /* @__PURE__ */ e(r.Badge, { status: "success", children: n("payScheduleList.active") }) : /* @__PURE__ */ e(r.Badge, { status: "info", children: n("payScheduleList.inactive") }) }) })
35
+ render: (t) => /* @__PURE__ */ e(s, { alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ e("div", { className: o.content, children: t.active ? /* @__PURE__ */ e(n.Badge, { status: "success", children: r("payScheduleList.active") }) : /* @__PURE__ */ e(n.Badge, { status: "info", children: r("payScheduleList.inactive") }) }) })
34
36
  }
35
37
  ],
36
38
  itemMenu: (t) => /* @__PURE__ */ e(
@@ -39,7 +41,7 @@ const H = () => {
39
41
  triggerLabel: "Actions",
40
42
  items: [
41
43
  {
42
- label: n("payScheduleList.edit"),
44
+ label: r("payScheduleList.edit"),
43
45
  onClick: () => {
44
46
  l(t);
45
47
  },
@@ -49,9 +51,9 @@ const H = () => {
49
51
  }
50
52
  )
51
53
  });
52
- return m !== "LIST_PAY_SCHEDULES" ? null : /* @__PURE__ */ e(C, { label: "test", ...d });
54
+ return c !== "LIST_PAY_SCHEDULES" ? null : /* @__PURE__ */ e(C, { label: "test", ...d });
53
55
  };
54
56
  export {
55
- H as List
57
+ F as List
56
58
  };
57
59
  //# sourceMappingURL=List.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"List.js","sources":["../../../../../src/components/Company/PaySchedule/_parts/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { usePaySchedule } from '../usePaySchedule'\nimport styles from './List.module.scss'\nimport { useDataView, DataView, Flex, VisuallyHidden } from '@/components/Common'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\n\nexport const List = () => {\n const { t } = useTranslation('Company.PaySchedule')\n const Components = useComponentContext()\n const { paySchedules, mode, handleEdit } = usePaySchedule()\n\n const { ...dataViewProps } = useDataView({\n data: paySchedules || [],\n columns: [\n {\n title: t('payScheduleList.name'),\n key: 'customName',\n render: schedule => {\n const hasName = !!schedule.name\n let displayName = hasName ? schedule.name : schedule.customName\n if (displayName && displayName.length > 1) {\n displayName = displayName.charAt(0).toUpperCase() + displayName.slice(1)\n } else {\n displayName = schedule.customName\n }\n const displayFrequency = schedule.customName\n return (\n <Flex flexDirection={'column'} gap={0}>\n <div className={styles.content}>\n <div>{displayName}</div>\n {hasName && <div>{displayFrequency}</div>}\n </div>\n </Flex>\n )\n },\n },\n {\n title: <VisuallyHidden>{t('payScheduleList.active')}</VisuallyHidden>,\n key: 'active',\n render: schedule => (\n <Flex alignItems={'center'} justifyContent={'center'}>\n <div className={styles.content}>\n {schedule.active ? (\n <Components.Badge status=\"success\">{t('payScheduleList.active')}</Components.Badge>\n ) : (\n <Components.Badge status=\"info\">{t('payScheduleList.inactive')}</Components.Badge>\n )}\n </div>\n </Flex>\n ),\n },\n ],\n itemMenu: schedule => {\n return (\n <HamburgerMenu\n triggerLabel=\"Actions\"\n items={[\n {\n label: t('payScheduleList.edit'),\n onClick: () => {\n handleEdit(schedule)\n },\n icon: <PencilSvg aria-hidden />,\n },\n ]}\n />\n )\n },\n })\n\n if (mode !== 'LIST_PAY_SCHEDULES') {\n return null\n }\n\n return <DataView label=\"test\" {...dataViewProps} />\n}\n"],"names":["List","t","useTranslation","Components","useComponentContext","paySchedules","mode","handleEdit","usePaySchedule","dataViewProps","useDataView","schedule","hasName","displayName","displayFrequency","jsx","Flex","jsxs","styles","VisuallyHidden","HamburgerMenu","PencilSvg","DataView"],"mappings":";;;;;;;;;;;AAQO,MAAMA,IAAO,MAAM;AACxB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5CC,IAAaC,EAAoB,GACjC,EAAE,cAAAC,GAAc,MAAAC,GAAM,YAAAC,EAAA,IAAeC,EAAe,GAEpD,EAAE,GAAGC,EAAc,IAAIC,EAAY;AAAA,IACvC,MAAML,KAAgB,CAAC;AAAA,IACvB,SAAS;AAAA,MACP;AAAA,QACE,OAAOJ,EAAE,sBAAsB;AAAA,QAC/B,KAAK;AAAA,QACL,QAAQ,CAAYU,MAAA;AACZ,gBAAAC,IAAU,CAAC,CAACD,EAAS;AAC3B,cAAIE,IAAcD,IAAUD,EAAS,OAAOA,EAAS;AACjD,UAAAE,KA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AIf,MAAS,uBACJ,OAGD,gBAAAS,EAAAO,GAAA,EAAS,OAAM,QAAQ,GAAGb,GAAe;AACnD;"}
1
+ {"version":3,"file":"List.js","sources":["../../../../../src/components/Company/PaySchedule/_parts/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { usePaySchedule } from '../usePaySchedule'\nimport styles from './List.module.scss'\nimport { useDataView, DataView, Flex, VisuallyHidden } from '@/components/Common'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\n\nexport const List = () => {\n const { t } = useTranslation('Company.PaySchedule')\n const Components = useComponentContext()\n const { paySchedules, mode, handleEdit } = usePaySchedule()\n\n const { ...dataViewProps } = useDataView({\n data: paySchedules || [],\n columns: [\n {\n title: t('payScheduleList.name'),\n key: 'customName',\n render: schedule => {\n const hasName = !!schedule.name\n let displayName = hasName ? schedule.name : schedule.customName\n if (displayName && displayName.length > 1) {\n displayName = displayName.charAt(0).toUpperCase() + displayName.slice(1)\n } else {\n displayName = schedule.customName\n }\n const displayFrequency = schedule.customName\n return (\n <Flex flexDirection={'column'} gap={0}>\n <div className={styles.content}>\n <div>{displayName}</div>\n {hasName && <div>{displayFrequency}</div>}\n </div>\n </Flex>\n )\n },\n },\n {\n title: <VisuallyHidden>{t('payScheduleList.active')}</VisuallyHidden>,\n key: 'active',\n render: schedule => (\n <Flex alignItems={'center'} justifyContent={'center'}>\n <div className={styles.content}>\n {schedule.active ? (\n <Components.Badge status=\"success\">{t('payScheduleList.active')}</Components.Badge>\n ) : (\n <Components.Badge status=\"info\">{t('payScheduleList.inactive')}</Components.Badge>\n )}\n </div>\n </Flex>\n ),\n },\n ],\n itemMenu: schedule => {\n return (\n <HamburgerMenu\n triggerLabel=\"Actions\"\n items={[\n {\n label: t('payScheduleList.edit'),\n onClick: () => {\n handleEdit(schedule)\n },\n icon: <PencilSvg aria-hidden />,\n },\n ]}\n />\n )\n },\n })\n\n if (mode !== 'LIST_PAY_SCHEDULES') {\n return null\n }\n\n return <DataView label=\"test\" {...dataViewProps} />\n}\n"],"names":["List","t","useTranslation","Components","useComponentContext","paySchedules","mode","handleEdit","usePaySchedule","dataViewProps","useDataView","schedule","hasName","displayName","displayFrequency","jsx","Flex","jsxs","styles","VisuallyHidden","HamburgerMenu","PencilSvg","DataView"],"mappings":";;;;;;;;;;;;;AAQO,MAAMA,IAAO,MAAM;AACxB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5CC,IAAaC,EAAoB,GACjC,EAAE,cAAAC,GAAc,MAAAC,GAAM,YAAAC,EAAA,IAAeC,EAAe,GAEpD,EAAE,GAAGC,EAAc,IAAIC,EAAY;AAAA,IACvC,MAAML,KAAgB,CAAC;AAAA,IACvB,SAAS;AAAA,MACP;AAAA,QACE,OAAOJ,EAAE,sBAAsB;AAAA,QAC/B,KAAK;AAAA,QACL,QAAQ,CAAYU,MAAA;AACZ,gBAAAC,IAAU,CAAC,CAACD,EAAS;AAC3B,cAAIE,IAAcD,IAAUD,EAAS,OAAOA,EAAS;AACjD,UAAAE,KAAeA,EAAY,SAAS,IACxBA,IAAAA,EAAY,OAAO,CAAC,EAAE,gBAAgBA,EAAY,MAAM,CAAC,IAEvEA,IAAcF,EAAS;AAEzB,gBAAMG,IAAmBH,EAAS;AAEhC,iBAAA,gBAAAI,EAACC,GAAK,EAAA,eAAe,UAAU,KAAK,GAClC,UAAC,gBAAAC,EAAA,OAAA,EAAI,WAAWC,EAAO,SACrB,UAAA;AAAA,YAAA,gBAAAH,EAAC,SAAK,UAAYF,EAAA,CAAA;AAAA,YACjBD,KAAY,gBAAAG,EAAA,OAAA,EAAK,UAAiBD,EAAA,CAAA;AAAA,UAAA,EAAA,CACrC,EACF,CAAA;AAAA,QAAA;AAAA,MAGN;AAAA,MACA;AAAA,QACE,OAAO,gBAAAC,EAACI,GAAgB,EAAA,UAAAlB,EAAE,wBAAwB,GAAE;AAAA,QACpD,KAAK;AAAA,QACL,QAAQ,CAAAU,MACL,gBAAAI,EAAAC,GAAA,EAAK,YAAY,UAAU,gBAAgB,UAC1C,UAAA,gBAAAD,EAAC,SAAI,WAAWG,EAAO,SACpB,UAAAP,EAAS,SACP,gBAAAI,EAAAZ,EAAW,OAAX,EAAiB,QAAO,WAAW,UAAAF,EAAE,wBAAwB,EAAE,CAAA,IAE/D,gBAAAc,EAAAZ,EAAW,OAAX,EAAiB,QAAO,QAAQ,UAAAF,EAAE,0BAA0B,GAAE,GAEnE,EACF,CAAA;AAAA,MAAA;AAAA,IAGN;AAAA,IACA,UAAU,CAAYU,MAElB,gBAAAI;AAAA,MAACK;AAAA,MAAA;AAAA,QACC,cAAa;AAAA,QACb,OAAO;AAAA,UACL;AAAA,YACE,OAAOnB,EAAE,sBAAsB;AAAA,YAC/B,SAAS,MAAM;AACb,cAAAM,EAAWI,CAAQ;AAAA,YACrB;AAAA,YACA,MAAM,gBAAAI,EAACM,GAAU,EAAA,eAAW,GAAC,CAAA;AAAA,UAAA;AAAA,QAC/B;AAAA,MACF;AAAA,IACF;AAAA,EAEJ,CACD;AAED,SAAIf,MAAS,uBACJ,OAGD,gBAAAS,EAAAO,GAAA,EAAS,OAAM,QAAQ,GAAGb,GAAe;AACnD;"}
@@ -9,9 +9,9 @@ import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
9
9
  import "@tanstack/react-query";
10
10
  import "../../Base/useBase.js";
11
11
  import "../../../shared/constants.js";
12
+ import "classnames";
12
13
  import "dompurify";
13
14
  import "../../../contexts/ComponentAdapter/useComponentContext.js";
14
- import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
15
15
  import { createCompoundContext as e } from "../../Base/createCompoundContext.js";
16
16
  const w = o.object({
17
17
  frequency: o.enum(["Every week", "Every other week", "Twice per month", "Monthly"]),
@@ -3,7 +3,3 @@ export interface StateTaxesProps extends BaseComponentInterface<'Company.StateTa
3
3
  companyId: string;
4
4
  }
5
5
  export declare function StateTaxes({ companyId, onEvent, dictionary }: StateTaxesProps): import("react/jsx-runtime").JSX.Element;
6
- export declare namespace StateTaxes {
7
- var StateTaxesList: typeof import("./StateTaxesList/StateTaxesList").StateTaxesList;
8
- var StateTaxesForm: typeof import("./StateTaxesForm/StateTaxesForm").StateTaxesForm;
9
- }
@@ -1,27 +1,23 @@
1
- import { jsx as i } from "react/jsx-runtime";
2
- import { createMachine as s } from "robot3";
3
- import { stateTaxesStateMachine as n } from "./stateTaxesStateMachine.js";
4
- import { StateTaxesListContextual as x } from "./StateTaxesComponents.js";
5
- import { StateTaxesList as p } from "./StateTaxesList/StateTaxesList.js";
6
- import { StateTaxesForm as S } from "./StateTaxesForm/StateTaxesForm.js";
7
- import { Flow as T } from "../../Flow/Flow.js";
8
- import { useComponentDictionary as f } from "../../../i18n/I18n.js";
9
- function t({ companyId: e, onEvent: a, dictionary: o }) {
10
- f("Company.StateTaxes", o);
11
- const m = s(
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { createMachine as n } from "robot3";
3
+ import { stateTaxesStateMachine as i } from "./stateTaxesStateMachine.js";
4
+ import { StateTaxesListContextual as s } from "./StateTaxesComponents.js";
5
+ import { Flow as p } from "../../Flow/Flow.js";
6
+ import { useComponentDictionary as x } from "../../../i18n/I18n.js";
7
+ function C({ companyId: t, onEvent: e, dictionary: o }) {
8
+ x("Company.StateTaxes", o);
9
+ const a = n(
12
10
  "viewStateTaxes",
13
- n,
14
- (r) => ({
15
- ...r,
16
- component: x,
17
- companyId: e
11
+ i,
12
+ (m) => ({
13
+ ...m,
14
+ component: s,
15
+ companyId: t
18
16
  })
19
17
  );
20
- return /* @__PURE__ */ i(T, { machine: m, onEvent: a });
18
+ return /* @__PURE__ */ r(p, { machine: a, onEvent: e });
21
19
  }
22
- t.StateTaxesList = p;
23
- t.StateTaxesForm = S;
24
20
  export {
25
- t as StateTaxes
21
+ C as StateTaxes
26
22
  };
27
23
  //# sourceMappingURL=StateTaxes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"StateTaxes.js","sources":["../../../../src/components/Company/StateTaxes/StateTaxes.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { stateTaxesStateMachine } from './stateTaxesStateMachine'\nimport type { StateTaxesContextInterface } from './StateTaxesComponents'\nimport { StateTaxesListContextual } from './StateTaxesComponents'\nimport { StateTaxesList } from './StateTaxesList/StateTaxesList'\nimport { StateTaxesForm } from './StateTaxesForm/StateTaxesForm'\nimport { Flow } from '@/components/Flow/Flow'\nimport type { BaseComponentInterface } from '@/components/Base'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\nexport interface StateTaxesProps extends BaseComponentInterface<'Company.StateTaxes'> {\n companyId: string\n}\n\nexport function StateTaxes({ companyId, onEvent, dictionary }: StateTaxesProps) {\n useComponentDictionary('Company.StateTaxes', dictionary)\n const manageStateTaxes = createMachine(\n 'viewStateTaxes',\n stateTaxesStateMachine,\n (initialContext: StateTaxesContextInterface) => ({\n ...initialContext,\n component: StateTaxesListContextual,\n companyId,\n }),\n )\n return <Flow machine={manageStateTaxes} onEvent={onEvent} />\n}\n\nStateTaxes.StateTaxesList = StateTaxesList\nStateTaxes.StateTaxesForm = StateTaxesForm\n"],"names":["StateTaxes","companyId","onEvent","dictionary","useComponentDictionary","manageStateTaxes","createMachine","stateTaxesStateMachine","initialContext","StateTaxesListContextual","jsx","Flow","StateTaxesList","StateTaxesForm"],"mappings":";;;;;;;;AAcO,SAASA,EAAW,EAAE,WAAAC,GAAW,SAAAC,GAAS,YAAAC,KAA+B;AAC9E,EAAAC,EAAuB,sBAAsBD,CAAU;AACvD,QAAME,IAAmBC;AAAA,IACvB;AAAA,IACAC;AAAA,IACA,CAACC,OAAgD;AAAA,MAC/C,GAAGA;AAAA,MACH,WAAWC;AAAA,MACX,WAAAR;AAAA,IACF;AAAA,EACF;AACA,SAAQ,gBAAAS,EAAAC,GAAA,EAAK,SAASN,GAAkB,SAAAH,EAAkB,CAAA;AAC5D;AAEAF,EAAW,iBAAiBY;AAC5BZ,EAAW,iBAAiBa;"}
1
+ {"version":3,"file":"StateTaxes.js","sources":["../../../../src/components/Company/StateTaxes/StateTaxes.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { stateTaxesStateMachine } from './stateTaxesStateMachine'\nimport type { StateTaxesContextInterface } from './StateTaxesComponents'\nimport { StateTaxesListContextual } from './StateTaxesComponents'\nimport { Flow } from '@/components/Flow/Flow'\nimport type { BaseComponentInterface } from '@/components/Base'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\nexport interface StateTaxesProps extends BaseComponentInterface<'Company.StateTaxes'> {\n companyId: string\n}\n\nexport function StateTaxes({ companyId, onEvent, dictionary }: StateTaxesProps) {\n useComponentDictionary('Company.StateTaxes', dictionary)\n const manageStateTaxes = createMachine(\n 'viewStateTaxes',\n stateTaxesStateMachine,\n (initialContext: StateTaxesContextInterface) => ({\n ...initialContext,\n component: StateTaxesListContextual,\n companyId,\n }),\n )\n return <Flow machine={manageStateTaxes} onEvent={onEvent} />\n}\n"],"names":["StateTaxes","companyId","onEvent","dictionary","useComponentDictionary","manageStateTaxes","createMachine","stateTaxesStateMachine","initialContext","StateTaxesListContextual","jsx","Flow"],"mappings":";;;;;;AAYO,SAASA,EAAW,EAAE,WAAAC,GAAW,SAAAC,GAAS,YAAAC,KAA+B;AAC9E,EAAAC,EAAuB,sBAAsBD,CAAU;AACvD,QAAME,IAAmBC;AAAA,IACvB;AAAA,IACAC;AAAA,IACA,CAACC,OAAgD;AAAA,MAC/C,GAAGA;AAAA,MACH,WAAWC;AAAA,MACX,WAAAR;AAAA,IACF;AAAA,EACF;AACA,SAAQ,gBAAAS,EAAAC,GAAA,EAAK,SAASN,GAAkB,SAAAH,EAAkB,CAAA;AAC5D;"}
@@ -1,16 +1,18 @@
1
1
  import { jsxs as i, jsx as n } from "react/jsx-runtime";
2
2
  import { useTranslation as a } from "react-i18next";
3
3
  import { useStateTaxesForm as s } from "./context.js";
4
+ import "classnames";
5
+ import "../../../../shared/constants.js";
4
6
  import { ActionsLayout as m } from "../../../Common/ActionsLayout/ActionsLayout.js";
5
7
  import { useComponentContext as c } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
6
- function d() {
7
- const { t } = a("Company.StateTaxes", { keyPrefix: "form" }), { handleCancel: e, isPending: r } = s(), o = c();
8
+ function y() {
9
+ const { t } = a("Company.StateTaxes", { keyPrefix: "form" }), { handleCancel: r, isPending: e } = s(), o = c();
8
10
  return /* @__PURE__ */ i(m, { children: [
9
- /* @__PURE__ */ n(o.Button, { variant: "secondary", onClick: e, children: t("cancelCta") }),
10
- /* @__PURE__ */ n(o.Button, { variant: "primary", type: "submit", isDisabled: r, children: t("saveCta") })
11
+ /* @__PURE__ */ n(o.Button, { variant: "secondary", onClick: r, children: t("cancelCta") }),
12
+ /* @__PURE__ */ n(o.Button, { variant: "primary", type: "submit", isDisabled: e, children: t("saveCta") })
11
13
  ] });
12
14
  }
13
15
  export {
14
- d as Actions
16
+ y as Actions
15
17
  };
16
18
  //# sourceMappingURL=Actions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesForm/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useStateTaxesForm } from './context'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { t } = useTranslation('Company.StateTaxes', { keyPrefix: 'form' })\n const { handleCancel, isPending } = useStateTaxesForm()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleCancel}>\n {t('cancelCta')}\n </Components.Button>\n <Components.Button variant=\"primary\" type=\"submit\" isDisabled={isPending}>\n {t('saveCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","useTranslation","handleCancel","isPending","useStateTaxesForm","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;;;AAKO,SAASA,IAAU;AAClB,QAAA,EAAE,MAAMC,EAAe,sBAAsB,EAAE,WAAW,QAAQ,GAClE,EAAE,cAAAC,GAAc,WAAAC,EAAU,IAAIC,EAAkB,GAChDC,IAAaC,EAAoB;AAEvC,2BACGC,GACC,EAAA,UAAA;AAAA,IAAC,gBAAAC,EAAAH,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASH,GAC7C,UAAE,EAAA,WAAW,EAChB,CAAA;AAAA,IACC,gBAAAM,EAAAH,EAAW,QAAX,EAAkB,SAAQ,WAAU,MAAK,UAAS,YAAYF,GAC5D,UAAE,EAAA,SAAS,EACd,CAAA;AAAA,EAAA,GACF;AAEJ;"}
1
+ {"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesForm/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useStateTaxesForm } from './context'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { t } = useTranslation('Company.StateTaxes', { keyPrefix: 'form' })\n const { handleCancel, isPending } = useStateTaxesForm()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleCancel}>\n {t('cancelCta')}\n </Components.Button>\n <Components.Button variant=\"primary\" type=\"submit\" isDisabled={isPending}>\n {t('saveCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","useTranslation","handleCancel","isPending","useStateTaxesForm","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;;;;;AAKO,SAASA,IAAU;AAClB,QAAA,EAAE,MAAMC,EAAe,sBAAsB,EAAE,WAAW,QAAQ,GAClE,EAAE,cAAAC,GAAc,WAAAC,EAAU,IAAIC,EAAkB,GAChDC,IAAaC,EAAoB;AAEvC,2BACGC,GACC,EAAA,UAAA;AAAA,IAAC,gBAAAC,EAAAH,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASH,GAC7C,UAAE,EAAA,WAAW,EAChB,CAAA;AAAA,IACC,gBAAAM,EAAAH,EAAW,QAAX,EAAkB,SAAQ,WAAU,MAAK,UAAS,YAAYF,GAC5D,UAAE,EAAA,SAAS,EACd,CAAA;AAAA,EAAA,GACF;AAEJ;"}
@@ -4,9 +4,4 @@ interface StateTaxesFormProps extends CommonComponentInterface {
4
4
  state: string;
5
5
  }
6
6
  export declare function StateTaxesForm(props: StateTaxesFormProps & BaseComponentInterface): import("react/jsx-runtime").JSX.Element;
7
- export declare namespace StateTaxesForm {
8
- var Head: typeof import("./Head").Head;
9
- var Form: typeof import("./Form").Form;
10
- var Actions: typeof import("./Actions").Actions;
11
- }
12
7
  export {};
@@ -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,EA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/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,G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BAAAkD,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;"}
@@ -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";
11
12
  import "dompurify";
12
13
  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,13 +1,15 @@
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 { 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") }) });
4
+ import "classnames";
5
+ import "../../../../shared/constants.js";
6
+ import { ActionsLayout as m } from "../../../Common/ActionsLayout/ActionsLayout.js";
7
+ import { useComponentContext as s } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
8
+ function x() {
9
+ const { t: o } = i("Company.StateTaxes"), n = s(), { handleContinue: r } = e();
10
+ return /* @__PURE__ */ t(m, { children: /* @__PURE__ */ t(n.Button, { variant: "primary", onClick: r, children: o("list.continueCta") }) });
9
11
  }
10
12
  export {
11
- f as Actions
13
+ x as Actions
12
14
  };
13
15
  //# 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,13 +1,15 @@
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
+ import "../../../../shared/constants.js";
4
6
  import { EmptyData as c } from "../../../Common/EmptyData/EmptyData.js";
5
7
  import { useComponentContext as u } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
6
8
  import { useDataView as d } from "../../../Common/DataView/useDataView.js";
7
9
  import { DataView as C } from "../../../Common/DataView/DataView.js";
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,
10
+ const b = () => {
11
+ const { stateTaxRequirements: r, handleChange: n } = l(), a = u(), { t } = o("Company.StateTaxes", { keyPrefix: "list" }), { t: i } = o("common", { keyPrefix: "statesHash" }), { ...m } = d({
12
+ data: r,
11
13
  columns: [
12
14
  {
13
15
  key: "state",
@@ -25,7 +27,7 @@ const S = () => {
25
27
  {
26
28
  variant: "secondary",
27
29
  onClick: () => {
28
- r(e.state);
30
+ n(e.state);
29
31
  },
30
32
  children: e.setupComplete ? t("editStateTaxCta") : t("continueStateTaxSetupCta")
31
33
  }
@@ -35,6 +37,6 @@ const S = () => {
35
37
  return /* @__PURE__ */ s(C, { label: t("requirementsListLabel"), ...m });
36
38
  };
37
39
  export {
38
- S as List
40
+ b as List
39
41
  };
40
42
  //# 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