@gusto/embedded-react-sdk 0.10.1 → 0.10.2-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 (253) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/components/Base/Base.d.ts +3 -2
  3. package/dist/components/Base/Base.js +57 -50
  4. package/dist/components/Base/Base.js.map +1 -1
  5. package/dist/components/Common/InternalError/InternalError.js.map +1 -1
  6. package/dist/components/Common/SignatureForm/SignatureForm.js +6 -4
  7. package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
  8. package/dist/components/Common/SignatureForm/SignatureFormActions.js +12 -10
  9. package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
  10. package/dist/components/Common/SignatureForm/SignatureFormFields.js +8 -6
  11. package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
  12. package/dist/components/Common/UI/ComboBox/ComboBox.js +31 -33
  13. package/dist/components/Common/UI/ComboBox/ComboBox.js.map +1 -1
  14. package/dist/components/Common/UI/ComboBox/ComboBox.module.scss.js +1 -1
  15. package/dist/components/Common/UI/Text/TextTypes.d.ts +1 -1
  16. package/dist/components/Company/AssignSignatory/AssignSignatory.js +13 -11
  17. package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
  18. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +7 -6
  19. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
  20. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +9 -8
  21. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
  22. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +1 -0
  23. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
  24. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +3 -2
  25. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
  26. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +5 -3
  27. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  28. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +7 -6
  29. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
  30. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +4 -3
  31. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
  32. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +10 -9
  33. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
  34. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +5 -3
  35. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  36. package/dist/components/Company/AssignSignatory/TitleSelect.js +8 -7
  37. package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
  38. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +7 -5
  39. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  40. package/dist/components/Company/BankAccount/BankAccount.d.ts +2 -2
  41. package/dist/components/Company/BankAccount/BankAccount.js +25 -20
  42. package/dist/components/Company/BankAccount/BankAccount.js.map +1 -1
  43. package/dist/components/Company/BankAccount/BankAccountComponents.js +16 -9
  44. package/dist/components/Company/BankAccount/BankAccountComponents.js.map +1 -1
  45. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +23 -8
  46. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
  47. package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.d.ts +1 -0
  48. package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.js +30 -30
  49. package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.js.map +1 -1
  50. package/dist/components/Company/BankAccount/BankAccountForm/Form.js +8 -7
  51. package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
  52. package/dist/components/Company/BankAccount/BankAccountForm/context.d.ts +4 -0
  53. package/dist/components/Company/BankAccount/BankAccountForm/context.js +5 -3
  54. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  55. package/dist/components/Company/BankAccount/BankAccountList/AccountView.js +14 -13
  56. package/dist/components/Company/BankAccount/BankAccountList/AccountView.js.map +1 -1
  57. package/dist/components/Company/BankAccount/BankAccountList/Actions.js +7 -6
  58. package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
  59. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +8 -7
  60. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
  61. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +5 -4
  62. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
  63. package/dist/components/Company/BankAccount/stateMachine.d.ts +1 -1
  64. package/dist/components/Company/BankAccount/stateMachine.js +13 -5
  65. package/dist/components/Company/BankAccount/stateMachine.js.map +1 -1
  66. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +6 -5
  67. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
  68. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +17 -15
  69. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  70. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +5 -3
  71. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  72. package/dist/components/Company/DocumentSigner/DocumentSigner.d.ts +5 -7
  73. package/dist/components/Company/DocumentSigner/DocumentSigner.js +24 -24
  74. package/dist/components/Company/DocumentSigner/DocumentSigner.js.map +1 -1
  75. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +45 -44
  76. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  77. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +5 -3
  78. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  79. package/dist/components/Company/FederalTaxes/Actions.js +7 -6
  80. package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
  81. package/dist/components/Company/FederalTaxes/FederalTaxes.js +17 -15
  82. package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
  83. package/dist/components/Company/FederalTaxes/Form.js +3 -2
  84. package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
  85. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +10 -8
  86. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  87. package/dist/components/Company/Industry/Actions.js +6 -5
  88. package/dist/components/Company/Industry/Actions.js.map +1 -1
  89. package/dist/components/Company/Industry/Context.js +8 -6
  90. package/dist/components/Company/Industry/Context.js.map +1 -1
  91. package/dist/components/Company/Industry/Edit.js +11 -10
  92. package/dist/components/Company/Industry/Edit.js.map +1 -1
  93. package/dist/components/Company/Industry/Industry.js +30 -31
  94. package/dist/components/Company/Industry/Industry.js.map +1 -1
  95. package/dist/components/Company/Locations/LocationForm/Actions.js +3 -2
  96. package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
  97. package/dist/components/Company/Locations/LocationForm/Form.js +5 -4
  98. package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
  99. package/dist/components/Company/Locations/LocationForm/LocationForm.js +36 -37
  100. package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
  101. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +5 -3
  102. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  103. package/dist/components/Company/Locations/LocationsList/Actions.js +3 -2
  104. package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
  105. package/dist/components/Company/Locations/LocationsList/List.js +11 -7
  106. package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
  107. package/dist/components/Company/Locations/LocationsList/LocationsList.js +11 -9
  108. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  109. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +5 -3
  110. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  111. package/dist/components/Company/Locations/stateMachine.js +35 -33
  112. package/dist/components/Company/Locations/stateMachine.js.map +1 -1
  113. package/dist/components/Company/OnboardingOverview/Completed.js +6 -5
  114. package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
  115. package/dist/components/Company/OnboardingOverview/MissingRequirements.js +3 -2
  116. package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
  117. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +4 -2
  118. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
  119. package/dist/components/Company/OnboardingOverview/context.js +5 -3
  120. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  121. package/dist/components/Company/PaySchedule/PaySchedule.js +72 -71
  122. package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
  123. package/dist/components/Company/PaySchedule/_parts/Actions.js +11 -10
  124. package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
  125. package/dist/components/Company/PaySchedule/_parts/Edit.js +9 -8
  126. package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
  127. package/dist/components/Company/PaySchedule/_parts/Head.js +3 -2
  128. package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
  129. package/dist/components/Company/PaySchedule/_parts/List.js +6 -5
  130. package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
  131. package/dist/components/Company/PaySchedule/usePaySchedule.js +7 -5
  132. package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
  133. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +6 -5
  134. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
  135. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +5 -3
  136. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  137. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +7 -6
  138. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
  139. package/dist/components/Company/StateTaxes/StateTaxesList/List.js +6 -5
  140. package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
  141. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +5 -3
  142. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  143. package/dist/components/Contractor/Address/Address.js +39 -38
  144. package/dist/components/Contractor/Address/Address.js.map +1 -1
  145. package/dist/components/Contractor/Address/Form.js +3 -2
  146. package/dist/components/Contractor/Address/Form.js.map +1 -1
  147. package/dist/components/Contractor/Address/useAddress.js +7 -5
  148. package/dist/components/Contractor/Address/useAddress.js.map +1 -1
  149. package/dist/components/Contractor/List/index.js +11 -10
  150. package/dist/components/Contractor/List/index.js.map +1 -1
  151. package/dist/components/Contractor/NewHireReport/NewHireReport.js +52 -52
  152. package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
  153. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +3 -2
  154. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
  155. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +3 -2
  156. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
  157. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +3 -2
  158. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
  159. package/dist/components/Employee/Compensation/Actions.js +5 -4
  160. package/dist/components/Employee/Compensation/Actions.js.map +1 -1
  161. package/dist/components/Employee/Compensation/Compensation.js +123 -132
  162. package/dist/components/Employee/Compensation/Compensation.js.map +1 -1
  163. package/dist/components/Employee/Compensation/Edit.js +3 -2
  164. package/dist/components/Employee/Compensation/Edit.js.map +1 -1
  165. package/dist/components/Employee/Compensation/List.js +6 -5
  166. package/dist/components/Employee/Compensation/List.js.map +1 -1
  167. package/dist/components/Employee/Deductions/Actions.js +9 -8
  168. package/dist/components/Employee/Deductions/Actions.js.map +1 -1
  169. package/dist/components/Employee/Deductions/DeductionForm.js +3 -2
  170. package/dist/components/Employee/Deductions/DeductionForm.js.map +1 -1
  171. package/dist/components/Employee/Deductions/Deductions.js +74 -79
  172. package/dist/components/Employee/Deductions/Deductions.js.map +1 -1
  173. package/dist/components/Employee/Deductions/DeductionsList.js +3 -2
  174. package/dist/components/Employee/Deductions/DeductionsList.js.map +1 -1
  175. package/dist/components/Employee/Deductions/IncludeDeductionsForm.js +3 -2
  176. package/dist/components/Employee/Deductions/IncludeDeductionsForm.js.map +1 -1
  177. package/dist/components/Employee/Deductions/useDeductions.js +7 -5
  178. package/dist/components/Employee/Deductions/useDeductions.js.map +1 -1
  179. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +5 -4
  180. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
  181. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +12 -10
  182. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  183. package/dist/components/Employee/DocumentSigner/DocumentList/List.js +3 -2
  184. package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
  185. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +5 -3
  186. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  187. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +38 -42
  188. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  189. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +5 -3
  190. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  191. package/dist/components/Employee/EmployeeList/Actions.js +5 -4
  192. package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
  193. package/dist/components/Employee/EmployeeList/EmployeeList.js +59 -58
  194. package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
  195. package/dist/components/Employee/EmployeeList/Head.js +3 -2
  196. package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
  197. package/dist/components/Employee/EmployeeList/List.js +3 -2
  198. package/dist/components/Employee/EmployeeList/List.js.map +1 -1
  199. package/dist/components/Employee/EmployeeList/useEmployeeList.js +5 -3
  200. package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
  201. package/dist/components/Employee/Landing/Landing.js +7 -6
  202. package/dist/components/Employee/Landing/Landing.js.map +1 -1
  203. package/dist/components/Employee/PaymentMethod/Actions.js +6 -5
  204. package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
  205. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +3 -2
  206. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
  207. package/dist/components/Employee/PaymentMethod/BankAccountsList.js +3 -2
  208. package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
  209. package/dist/components/Employee/PaymentMethod/PaymentMethod.js +95 -97
  210. package/dist/components/Employee/PaymentMethod/PaymentMethod.js.map +1 -1
  211. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +3 -2
  212. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
  213. package/dist/components/Employee/PaymentMethod/Split.js +3 -2
  214. package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
  215. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +7 -5
  216. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
  217. package/dist/components/Employee/Profile/Actions.js +7 -6
  218. package/dist/components/Employee/Profile/Actions.js.map +1 -1
  219. package/dist/components/Employee/Profile/AdminPersonalDetails.js +10 -9
  220. package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
  221. package/dist/components/Employee/Profile/HomeAddress.js +5 -4
  222. package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
  223. package/dist/components/Employee/Profile/PersonalDetailsInputs.js +9 -8
  224. package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
  225. package/dist/components/Employee/Profile/Profile.js +118 -124
  226. package/dist/components/Employee/Profile/Profile.js.map +1 -1
  227. package/dist/components/Employee/Profile/useProfile.js +5 -3
  228. package/dist/components/Employee/Profile/useProfile.js.map +1 -1
  229. package/dist/components/Employee/Taxes/Actions.js +8 -7
  230. package/dist/components/Employee/Taxes/Actions.js.map +1 -1
  231. package/dist/components/Employee/Taxes/FederalForm.js +7 -6
  232. package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
  233. package/dist/components/Employee/Taxes/Taxes.js +59 -60
  234. package/dist/components/Employee/Taxes/Taxes.js.map +1 -1
  235. package/dist/components/Employee/Taxes/useTaxes.js +5 -3
  236. package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
  237. package/dist/contexts/ApiProvider/ApiProvider.js +16 -14
  238. package/dist/contexts/ApiProvider/ApiProvider.js.map +1 -1
  239. package/dist/contexts/ComponentAdapter/componentAdapterTypes.d.ts +5 -0
  240. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.d.ts +2 -0
  241. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +20 -17
  242. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  243. package/dist/contexts/LoadingIndicatorProvider/LoadingIndicatorProvider.d.ts +7 -0
  244. package/dist/contexts/LoadingIndicatorProvider/LoadingIndicatorProvider.js +10 -0
  245. package/dist/contexts/LoadingIndicatorProvider/LoadingIndicatorProvider.js.map +1 -0
  246. package/dist/contexts/LoadingIndicatorProvider/useLoadingIndicator.d.ts +6 -0
  247. package/dist/contexts/LoadingIndicatorProvider/useLoadingIndicator.js +11 -0
  248. package/dist/contexts/LoadingIndicatorProvider/useLoadingIndicator.js.map +1 -0
  249. package/dist/shared/constants.d.ts +2 -0
  250. package/dist/shared/constants.js +10 -9
  251. package/dist/shared/constants.js.map +1 -1
  252. package/dist/style.css +1 -1
  253. package/package.json +5 -1
@@ -1,36 +1,36 @@
1
- import { jsx as o, jsxs as O, Fragment as S } from "react/jsx-runtime";
2
- import { useForm as q, FormProvider as x } from "react-hook-form";
1
+ import { jsx as o, jsxs as N, Fragment as O } from "react/jsx-runtime";
2
+ import { useForm as S, FormProvider as x } from "react-hook-form";
3
3
  import { zodResolver as R } from "@hookform/resolvers/zod";
4
- import { useLocationsUpdateMutation as w } from "@gusto/embedded-api/react-query/locationsUpdate";
4
+ import { useLocationsUpdateMutation as q } from "@gusto/embedded-api/react-query/locationsUpdate";
5
5
  import { useLocationsRetrieveSuspense as B } from "@gusto/embedded-api/react-query/locationsRetrieve";
6
- import { invalidateAllLocationsGet as I } from "@gusto/embedded-api/react-query/locationsGet";
7
- import { useLocationsCreateMutation as M } from "@gusto/embedded-api/react-query/locationsCreate";
8
- import { useQueryClient as _ } from "@tanstack/react-query";
6
+ import { useLocationsCreateMutation as I } from "@gusto/embedded-api/react-query/locationsCreate";
9
7
  import { Head as f } from "./Head.js";
10
- import { LocationFormSchema as z, Form as l } from "./Form.js";
8
+ import { LocationFormSchema as M, Form as l } from "./Form.js";
11
9
  import { Actions as A } from "./Actions.js";
12
- import { LocationsFormProvider as H } from "./useLocationForm.js";
13
- import { Form as U } from "../../../Common/Form/Form.js";
14
- import { Flex as j } from "../../../Common/Flex/Flex.js";
15
- import { BaseComponent as Y } from "../../../Base/Base.js";
16
- import { useBase as G } from "../../../Base/useBase.js";
17
- import { useI18n as Q } from "../../../../i18n/I18n.js";
10
+ import { LocationsFormProvider as _ } from "./useLocationForm.js";
11
+ import { Form as w } from "../../../Common/Form/Form.js";
12
+ import { Flex as z } from "../../../Common/Flex/Flex.js";
13
+ import "react-i18next";
14
+ import "classnames";
15
+ import { BaseComponent as H } from "../../../Base/Base.js";
16
+ import { useBase as U } from "../../../Base/useBase.js";
17
+ import { useI18n as j } from "../../../../i18n/I18n.js";
18
18
  import { componentEvents as a } from "../../../../shared/constants.js";
19
- function V(t) {
19
+ function Y(t) {
20
20
  const {
21
21
  data: { location: e }
22
22
  } = B({ locationId: t.locationId });
23
- return /* @__PURE__ */ o(y, { ...t, location: e });
23
+ return /* @__PURE__ */ o(g, { ...t, location: e });
24
24
  }
25
- function y({
25
+ function g({
26
26
  companyId: t,
27
27
  location: e,
28
- className: s,
28
+ className: i,
29
29
  children: r
30
30
  }) {
31
- Q("Company.Locations");
32
- const { onEvent: i, baseSubmitHandler: C } = G(), { mutateAsync: L, isPending: g } = M(), { mutateAsync: v, isPending: h } = w(), F = _(), P = ["mailingAddress", "filingAddress"], { control: T, ...c } = q({
33
- resolver: R(z),
31
+ j("Company.Locations");
32
+ const { onEvent: s, baseSubmitHandler: y } = U(), { mutateAsync: L, isPending: h } = I(), { mutateAsync: v, isPending: C } = q(), F = ["mailingAddress", "filingAddress"], { control: P, ...c } = S({
33
+ resolver: R(M),
34
34
  defaultValues: {
35
35
  city: e?.city ?? "",
36
36
  phoneNumber: e?.phoneNumber ?? "",
@@ -38,14 +38,14 @@ function y({
38
38
  street2: e?.street2 ?? "",
39
39
  state: e?.state ?? "",
40
40
  zip: e?.zip ?? "",
41
- addressType: P.filter((n) => e?.[n] ?? !1)
41
+ addressType: F.filter((n) => e?.[n] ?? !1)
42
42
  }
43
- }), b = () => {
44
- i(a.CANCEL);
45
- }, D = async (n) => {
46
- await C(n, async (E) => {
47
- const { addressType: u, ...N } = E, p = {
48
- ...N,
43
+ }), T = () => {
44
+ s(a.CANCEL);
45
+ }, b = async (n) => {
46
+ await y(n, async (D) => {
47
+ const { addressType: u, ...E } = D, p = {
48
+ ...E,
49
49
  mailingAddress: u?.includes("mailingAddress"),
50
50
  filingAddress: u?.includes("filingAddress")
51
51
  };
@@ -56,7 +56,7 @@ function y({
56
56
  requestBody: { ...p, version: e.version }
57
57
  }
58
58
  });
59
- i(a.COMPANY_LOCATION_UPDATED, m);
59
+ s(a.COMPANY_LOCATION_UPDATED, m);
60
60
  } else {
61
61
  const { location: m } = await L({
62
62
  request: {
@@ -64,16 +64,15 @@ function y({
64
64
  requestBody: p
65
65
  }
66
66
  });
67
- i(a.COMPANY_LOCATION_CREATED, m);
67
+ s(a.COMPANY_LOCATION_CREATED, m);
68
68
  }
69
- await I(F);
70
69
  });
71
70
  };
72
- return /* @__PURE__ */ o("section", { className: s, children: /* @__PURE__ */ o(x, { ...c, control: T, children: /* @__PURE__ */ o(U, { onSubmit: c.handleSubmit(D), children: /* @__PURE__ */ o(
73
- H,
71
+ return /* @__PURE__ */ o("section", { className: i, children: /* @__PURE__ */ o(x, { ...c, control: P, children: /* @__PURE__ */ o(w, { onSubmit: c.handleSubmit(b), children: /* @__PURE__ */ o(
72
+ _,
74
73
  {
75
- value: { handleCancel: b, isPending: g || h },
76
- children: /* @__PURE__ */ o(j, { flexDirection: "column", gap: 32, children: r || /* @__PURE__ */ O(S, { children: [
74
+ value: { handleCancel: T, isPending: h || C },
75
+ children: /* @__PURE__ */ o(z, { flexDirection: "column", gap: 32, children: r || /* @__PURE__ */ N(O, { children: [
77
76
  /* @__PURE__ */ o(f, {}),
78
77
  /* @__PURE__ */ o(l, {}),
79
78
  /* @__PURE__ */ o(A, {})
@@ -84,11 +83,11 @@ function y({
84
83
  function d({
85
84
  companyId: t,
86
85
  locationId: e,
87
- className: s,
86
+ className: i,
88
87
  children: r,
89
- ...i
88
+ ...s
90
89
  }) {
91
- return /* @__PURE__ */ o(Y, { ...i, children: e ? /* @__PURE__ */ o(V, { companyId: t, locationId: e, className: s, children: r }) : /* @__PURE__ */ o(y, { companyId: t, className: s, children: r }) });
90
+ return /* @__PURE__ */ o(H, { ...s, children: e ? /* @__PURE__ */ o(Y, { companyId: t, locationId: e, className: i, children: r }) : /* @__PURE__ */ o(g, { companyId: t, className: i, children: r }) });
92
91
  }
93
92
  d.Head = f;
94
93
  d.Form = l;
@@ -1 +1 @@
1
- {"version":3,"file":"LocationForm.js","sources":["../../../../../src/components/Company/Locations/LocationForm/LocationForm.tsx"],"sourcesContent":["import { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { useLocationsUpdateMutation } from '@gusto/embedded-api/react-query/locationsUpdate'\nimport { useLocationsRetrieveSuspense } from '@gusto/embedded-api/react-query/locationsRetrieve'\nimport { invalidateAllLocationsGet } from '@gusto/embedded-api/react-query/locationsGet'\nimport { useLocationsCreateMutation } from '@gusto/embedded-api/react-query/locationsCreate'\nimport { type Location } from '@gusto/embedded-api/models/components/location'\nimport { useQueryClient } from '@tanstack/react-query'\nimport { Head } from './Head'\nimport type { LocationFormInputs } from './Form'\nimport { Form, LocationFormSchema } from './Form'\nimport { Actions } from './Actions'\nimport { LocationsFormProvider } from './useLocationForm'\nimport { Form as HtmlForm } from '@/components/Common/Form'\nimport { Flex } from '@/components/Common'\nimport type { BaseComponentInterface, CommonComponentInterface } from '@/components/Base'\nimport { BaseComponent, useBase } from '@/components/Base'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport type { WithRequired } from '@/types/Helpers'\n\ninterface LocationFormProps extends CommonComponentInterface {\n companyId: string\n locationId?: string\n}\n\n/**Accounting for conditional logic where location data needs to be fetched only if locationId is present */\nfunction RootWithLocation(props: WithRequired<LocationFormProps, 'locationId'>) {\n const {\n data: { location },\n } = useLocationsRetrieveSuspense({ locationId: props.locationId })\n return <Root {...props} location={location} />\n}\n\nfunction Root({\n companyId,\n location,\n className,\n children,\n}: LocationFormProps & { location?: Location }) {\n useI18n('Company.Locations')\n const { onEvent, baseSubmitHandler } = useBase()\n\n const { mutateAsync: createLocation, isPending: isPendingCreate } = useLocationsCreateMutation()\n const { mutateAsync: updateLocation, isPending: isPendingUpdate } = useLocationsUpdateMutation()\n const queryClient = useQueryClient()\n const addressType = ['mailingAddress', 'filingAddress'] as const\n\n const { control, ...methods } = useForm<LocationFormInputs>({\n resolver: zodResolver(LocationFormSchema),\n defaultValues: {\n city: location?.city ?? '',\n phoneNumber: location?.phoneNumber ?? '',\n street1: location?.street1 ?? '',\n street2: location?.street2 ?? '',\n state: location?.state ?? '',\n zip: location?.zip ?? '',\n addressType: addressType.filter(key => location?.[key] ?? false),\n },\n })\n\n const handleCancel = () => {\n onEvent(componentEvents.CANCEL)\n }\n const onSubmit = async (data: LocationFormInputs) => {\n await baseSubmitHandler(data, async innerData => {\n const { addressType, ...payload } = innerData\n\n const requestBody = {\n ...payload,\n mailingAddress: addressType?.includes('mailingAddress'),\n filingAddress: addressType?.includes('filingAddress'),\n }\n\n if (location && location.version !== undefined) {\n // Edit existing location\n const { location: responseData } = await updateLocation({\n request: {\n locationId: location.uuid,\n requestBody: { ...requestBody, version: location.version },\n },\n })\n onEvent(componentEvents.COMPANY_LOCATION_UPDATED, responseData)\n } else {\n // Add new location\n const { location: responseData } = await createLocation({\n request: {\n companyId,\n requestBody,\n },\n })\n onEvent(componentEvents.COMPANY_LOCATION_CREATED, responseData)\n }\n\n // Invalidate cache after mutation\n await invalidateAllLocationsGet(queryClient)\n })\n }\n\n return (\n <section className={className}>\n <FormProvider {...methods} control={control}>\n <HtmlForm onSubmit={methods.handleSubmit(onSubmit)}>\n <LocationsFormProvider\n value={{ handleCancel, isPending: isPendingCreate || isPendingUpdate }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <Form />\n <Actions />\n </>\n )}\n </Flex>\n </LocationsFormProvider>\n </HtmlForm>\n </FormProvider>\n </section>\n )\n}\n\nexport function LocationForm({\n companyId,\n locationId,\n className,\n children,\n ...props\n}: LocationFormProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n {locationId ? (\n <RootWithLocation companyId={companyId} locationId={locationId} className={className}>\n {children}\n </RootWithLocation>\n ) : (\n <Root companyId={companyId} className={className}>\n {children}\n </Root>\n )}\n </BaseComponent>\n )\n}\n\nLocationForm.Head = Head\nLocationForm.Form = Form\nLocationForm.Actions = Actions\n"],"names":["RootWithLocation","props","location","useLocationsRetrieveSuspense","jsx","Root","companyId","className","children","useI18n","onEvent","baseSubmitHandler","useBase","createLocation","isPendingCreate","useLocationsCreateMutation","updateLocation","isPendingUpdate","useLocationsUpdateMutation","queryClient","useQueryClient","addressType","control","methods","useForm","zodResolver","LocationFormSchema","key","handleCancel","componentEvents","onSubmit","data","innerData","payload","requestBody","responseData","invalidateAllLocationsGet","FormProvider","HtmlForm","LocationsFormProvider","Flex","jsxs","Fragment","Head","Form","Actions","LocationForm","locationId","BaseComponent"],"mappings":";;;;;;;;;;;;;;;;;;AA2BA,SAASA,EAAiBC,GAAsD;AACxE,QAAA;AAAA,IACJ,MAAM,EAAE,UAAAC,EAAS;AAAA,MACfC,EAA6B,EAAE,YAAYF,EAAM,YAAY;AACjE,SAAQ,gBAAAG,EAAAC,GAAA,EAAM,GAAGJ,GAAO,UAAAC,EAAoB,CAAA;AAC9C;AAEA,SAASG,EAAK;AAAA,EACZ,WAAAC;AAAA,EACA,UAAAJ;AAAA,EACA,WAAAK;AAAA,EACA,UAAAC;AACF,GAAgD;AAC9C,EAAAC,EAAQ,mBAAmB;AAC3B,QAAM,EAAE,SAAAC,GAAS,mBAAAC,EAAkB,IAAIC,EAAQ,GAEzC,EAAE,aAAaC,GAAgB,WAAWC,EAAA,IAAoBC,EAA2B,GACzF,EAAE,aAAaC,GAAgB,WAAWC,EAAA,IAAoBC,EAA2B,GACzFC,IAAcC,EAAe,GAC7BC,IAAc,CAAC,kBAAkB,eAAe,GAEhD,EAAE,SAAAC,GAAS,GAAGC,EAAA,IAAYC,EAA4B;AAAA,IAC1D,UAAUC,EAAYC,CAAkB;AAAA,IACxC,eAAe;AAAA,MACb,MAAMxB,GAAU,QAAQ;AAAA,MACxB,aAAaA,GAAU,eAAe;AAAA,MACtC,SAASA,GAAU,WAAW;AAAA,MAC9B,SAASA,GAAU,WAAW;AAAA,MAC9B,OAAOA,GAAU,SAAS;AAAA,MAC1B,KAAKA,GAAU,OAAO;AAAA,MACtB,a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AAAb,EAACoC,KAAK,eAAc,UAAS,KAAK,IAC/B,UAAAhC,KAIG,gBAAAiC,EAAAC,GAAA,EAAA,UAAA;AAAA,QAAA,gBAAAtC,EAACuC,GAAK,EAAA;AAAA,0BACLC,GAAK,EAAA;AAAA,0BACLC,GAAQ,CAAA,CAAA;AAAA,MAAA,EAAA,CACX,EAEJ,CAAA;AAAA,IAAA;AAAA,EAAA,EAEJ,CAAA,EACF,CAAA,GACF;AAEJ;AAEO,SAASC,EAAa;AAAA,EAC3B,WAAAxC;AAAA,EACA,YAAAyC;AAAA,EACA,WAAAxC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGP;AACL,GAA+C;AAC7C,2BACG+C,GAAe,EAAA,GAAG/C,GAChB,UAAA8C,sBACE/C,GAAiB,EAAA,WAAAM,GAAsB,YAAAyC,GAAwB,WAAAxC,GAC7D,UAAAC,GACH,IAEA,gBAAAJ,EAACC,KAAK,WAAAC,GAAsB,WAAAC,GACzB,UAAAC,EACH,CAAA,GAEJ;AAEJ;AAEAsC,EAAa,OAAOH;AACpBG,EAAa,OAAOF;AACpBE,EAAa,UAAUD;"}
1
+ {"version":3,"file":"LocationForm.js","sources":["../../../../../src/components/Company/Locations/LocationForm/LocationForm.tsx"],"sourcesContent":["import { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { useLocationsUpdateMutation } from '@gusto/embedded-api/react-query/locationsUpdate'\nimport { useLocationsRetrieveSuspense } from '@gusto/embedded-api/react-query/locationsRetrieve'\nimport { useLocationsCreateMutation } from '@gusto/embedded-api/react-query/locationsCreate'\nimport { type Location } from '@gusto/embedded-api/models/components/location'\nimport { Head } from './Head'\nimport type { LocationFormInputs } from './Form'\nimport { Form, LocationFormSchema } from './Form'\nimport { Actions } from './Actions'\nimport { LocationsFormProvider } from './useLocationForm'\nimport { Form as HtmlForm } from '@/components/Common/Form'\nimport { Flex } from '@/components/Common'\nimport type { BaseComponentInterface, CommonComponentInterface } from '@/components/Base'\nimport { BaseComponent, useBase } from '@/components/Base'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport type { WithRequired } from '@/types/Helpers'\n\ninterface LocationFormProps extends CommonComponentInterface {\n companyId: string\n locationId?: string\n}\n\n/**Accounting for conditional logic where location data needs to be fetched only if locationId is present */\nfunction RootWithLocation(props: WithRequired<LocationFormProps, 'locationId'>) {\n const {\n data: { location },\n } = useLocationsRetrieveSuspense({ locationId: props.locationId })\n return <Root {...props} location={location} />\n}\n\nfunction Root({\n companyId,\n location,\n className,\n children,\n}: LocationFormProps & { location?: Location }) {\n useI18n('Company.Locations')\n const { onEvent, baseSubmitHandler } = useBase()\n\n const { mutateAsync: createLocation, isPending: isPendingCreate } = useLocationsCreateMutation()\n const { mutateAsync: updateLocation, isPending: isPendingUpdate } = useLocationsUpdateMutation()\n const addressType = ['mailingAddress', 'filingAddress'] as const\n\n const { control, ...methods } = useForm<LocationFormInputs>({\n resolver: zodResolver(LocationFormSchema),\n defaultValues: {\n city: location?.city ?? '',\n phoneNumber: location?.phoneNumber ?? '',\n street1: location?.street1 ?? '',\n street2: location?.street2 ?? '',\n state: location?.state ?? '',\n zip: location?.zip ?? '',\n addressType: addressType.filter(key => location?.[key] ?? false),\n },\n })\n\n const handleCancel = () => {\n onEvent(componentEvents.CANCEL)\n }\n const onSubmit = async (data: LocationFormInputs) => {\n await baseSubmitHandler(data, async innerData => {\n const { addressType, ...payload } = innerData\n\n const requestBody = {\n ...payload,\n mailingAddress: addressType?.includes('mailingAddress'),\n filingAddress: addressType?.includes('filingAddress'),\n }\n\n if (location && location.version !== undefined) {\n // Edit existing location\n const { location: responseData } = await updateLocation({\n request: {\n locationId: location.uuid,\n requestBody: { ...requestBody, version: location.version },\n },\n })\n onEvent(componentEvents.COMPANY_LOCATION_UPDATED, responseData)\n } else {\n // Add new location\n const { location: responseData } = await createLocation({\n request: {\n companyId,\n requestBody,\n },\n })\n onEvent(componentEvents.COMPANY_LOCATION_CREATED, responseData)\n }\n })\n }\n\n return (\n <section className={className}>\n <FormProvider {...methods} control={control}>\n <HtmlForm onSubmit={methods.handleSubmit(onSubmit)}>\n <LocationsFormProvider\n value={{ handleCancel, isPending: isPendingCreate || isPendingUpdate }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <Form />\n <Actions />\n </>\n )}\n </Flex>\n </LocationsFormProvider>\n </HtmlForm>\n </FormProvider>\n </section>\n )\n}\n\nexport function LocationForm({\n companyId,\n locationId,\n className,\n children,\n ...props\n}: LocationFormProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n {locationId ? (\n <RootWithLocation companyId={companyId} locationId={locationId} className={className}>\n {children}\n </RootWithLocation>\n ) : (\n <Root companyId={companyId} className={className}>\n {children}\n </Root>\n )}\n </BaseComponent>\n )\n}\n\nLocationForm.Head = Head\nLocationForm.Form = Form\nLocationForm.Actions = Actions\n"],"names":["RootWithLocation","props","location","useLocationsRetrieveSuspense","jsx","Root","companyId","className","children","useI18n","onEvent","baseSubmitHandler","useBase","createLocation","isPendingCreate","useLocationsCreateMutation","updateLocation","isPendingUpdate","useLocationsUpdateMutation","addressType","control","methods","useForm","zodResolver","LocationFormSchema","key","handleCancel","componentEvents","onSubmit","data","innerData","payload","requestBody","responseData","FormProvider","HtmlForm","LocationsFormProvider","Flex","jsxs","Fragment","Head","Form","Actions","LocationForm","locationId","BaseComponent"],"mappings":";;;;;;;;;;;;;;;;;;AAyBA,SAASA,EAAiBC,GAAsD;AACxE,QAAA;AAAA,IACJ,MAAM,EAAE,UAAAC,EAAS;AAAA,MACfC,EAA6B,EAAE,YAAYF,EAAM,YAAY;AACjE,SAAQ,gBAAAG,EAAAC,GAAA,EAAM,GAAGJ,GAAO,UAAAC,EAAoB,CAAA;AAC9C;AAEA,SAASG,EAAK;AAAA,EACZ,WAAAC;AAAA,EACA,UAAAJ;AAAA,EACA,WAAAK;AAAA,EACA,UAAAC;AACF,GAAgD;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,18 @@ import "react-i18next";
5
5
  import "@gusto/embedded-api/models/errors/apierror";
6
6
  import "@gusto/embedded-api/models/errors/sdkvalidationerror";
7
7
  import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
8
+ import "@tanstack/react-query";
8
9
  import "../../../Base/useBase.js";
9
10
  import "../../../../shared/constants.js";
11
+ import "classnames";
10
12
  import "dompurify";
11
13
  import "../../../../contexts/ComponentAdapter/useComponentContext.js";
12
14
  import { createCompoundContext as o } from "../../../Base/createCompoundContext.js";
13
- const [x, F] = o(
15
+ const [d, L] = o(
14
16
  "CompanyDocumentFormContext"
15
17
  );
16
18
  export {
17
- F as LocationsFormProvider,
18
- x as useLocationsForm
19
+ L as LocationsFormProvider,
20
+ d as useLocationsForm
19
21
  };
20
22
  //# sourceMappingURL=useLocationForm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useLocationForm.js","sources":["../../../../../src/components/Company/Locations/LocationForm/useLocationForm.ts"],"sourcesContent":["import { createCompoundContext } from '@/components/Base'\n\ntype LocationsFormContextType = {\n isPending: boolean\n handleCancel: () => void\n}\n\nconst [useLocationsForm, LocationsFormProvider] = createCompoundContext<LocationsFormContextType>(\n 'CompanyDocumentFormContext',\n)\n\nexport { useLocationsForm, LocationsFormProvider }\n"],"names":["useLocationsForm","LocationsFormProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;AAOM,MAAA,CAACA,GAAkBC,CAAqB,IAAIC;AAAA,EAChD;AACF;"}
1
+ {"version":3,"file":"useLocationForm.js","sources":["../../../../../src/components/Company/Locations/LocationForm/useLocationForm.ts"],"sourcesContent":["import { createCompoundContext } from '@/components/Base'\n\ntype LocationsFormContextType = {\n isPending: boolean\n handleCancel: () => void\n}\n\nconst [useLocationsForm, LocationsFormProvider] = createCompoundContext<LocationsFormContextType>(\n 'CompanyDocumentFormContext',\n)\n\nexport { useLocationsForm, LocationsFormProvider }\n"],"names":["useLocationsForm","LocationsFormProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;AAOM,MAAA,CAACA,GAAkBC,CAAqB,IAAIC;AAAA,EAChD;AACF;"}
@@ -1,9 +1,10 @@
1
1
  import { jsxs as c, jsx as t } from "react/jsx-runtime";
2
2
  import { useTranslation as s } from "react-i18next";
3
3
  import { useLocationsList as a } from "./useLocationsList.js";
4
+ import "classnames";
4
5
  import { ActionsLayout as e } from "../../../Common/ActionsLayout/ActionsLayout.js";
5
6
  import { useComponentContext as m } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
6
- function f() {
7
+ function L() {
7
8
  const { t: o } = s("Company.Locations"), { handleAddLocation: i, handleContinue: r } = a(), n = m();
8
9
  return /* @__PURE__ */ c(e, { children: [
9
10
  /* @__PURE__ */ t(n.Button, { variant: "secondary", onClick: i, children: o("addLocationCta") }),
@@ -11,6 +12,6 @@ function f() {
11
12
  ] });
12
13
  }
13
14
  export {
14
- f as Actions
15
+ L as Actions
15
16
  };
16
17
  //# sourceMappingURL=Actions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/Locations/LocationsList/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useLocationsList } from './useLocationsList'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { t } = useTranslation('Company.Locations')\n const { handleAddLocation, handleContinue } = useLocationsList()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleAddLocation}>\n {t('addLocationCta')}\n </Components.Button>\n <Components.Button onClick={handleContinue}>{t('continueCta')}</Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","t","useTranslation","handleAddLocation","handleContinue","useLocationsList","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;;;AAKO,SAASA,IAAU;AACxB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,mBAAmB,GAC1C,EAAE,mBAAAC,GAAmB,gBAAAC,EAAe,IAAIC,EAAiB,GACzDC,IAAaC,EAAoB;AAEvC,2BACGC,GACC,EAAA,UAAA;AAAA,IAAC,gBAAAC,EAAAH,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASH,GAC7C,UAAEF,EAAA,gBAAgB,EACrB,CAAA;AAAA,IACA,gBAAAQ,EAACH,EAAW,QAAX,EAAkB,SAASF,GAAiB,UAAAH,EAAE,aAAa,EAAE,CAAA;AAAA,EAAA,GAChE;AAEJ;"}
1
+ {"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/Locations/LocationsList/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useLocationsList } from './useLocationsList'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { t } = useTranslation('Company.Locations')\n const { handleAddLocation, handleContinue } = useLocationsList()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleAddLocation}>\n {t('addLocationCta')}\n </Components.Button>\n <Components.Button onClick={handleContinue}>{t('continueCta')}</Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","t","useTranslation","handleAddLocation","handleContinue","useLocationsList","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;;;;AAKO,SAASA,IAAU;AACxB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,mBAAmB,GAC1C,EAAE,mBAAAC,GAAmB,gBAAAC,EAAe,IAAIC,EAAiB,GACzDC,IAAaC,EAAoB;AAEvC,2BACGC,GACC,EAAA,UAAA;AAAA,IAAC,gBAAAC,EAAAH,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASH,GAC7C,UAAEF,EAAA,gBAAgB,EACrB,CAAA;AAAA,IACA,gBAAAQ,EAACH,EAAW,QAAX,EAAkB,SAASF,GAAiB,UAAAH,EAAE,aAAa,EAAE,CAAA;AAAA,EAAA,GAChE;AAEJ;"}
@@ -2,6 +2,7 @@ import { jsx as t, Fragment as r, jsxs as n } from "react/jsx-runtime";
2
2
  import { useTranslation as L } from "react-i18next";
3
3
  import { useLocationsList as C } from "./useLocationsList.js";
4
4
  import P from "../../../../assets/icons/pencil.svg.js";
5
+ import "classnames";
5
6
  import { EmptyData as b } from "../../../Common/EmptyData/EmptyData.js";
6
7
  import { useComponentContext as y } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
7
8
  import { HamburgerMenu as x } from "../../../Common/HamburgerMenu/HamburgerMenu.js";
@@ -9,7 +10,7 @@ import { getStreet as A, getCityStateZip as T } from "../../../../helpers/format
9
10
  import { VisuallyHidden as k } from "../../../Common/VisuallyHidden/VisuallyHidden.js";
10
11
  import { useDataView as D } from "../../../Common/DataView/useDataView.js";
11
12
  import { DataView as S } from "../../../Common/DataView/DataView.js";
12
- const Z = () => {
13
+ const q = () => {
13
14
  const a = y(), {
14
15
  locationList: o,
15
16
  handleEditLocation: s,
@@ -17,8 +18,8 @@ const Z = () => {
17
18
  totalPages: l,
18
19
  handleFirstPage: m,
19
20
  handleItemsPerPageChange: c,
20
- handleLastPage: g,
21
- handleNextPage: p,
21
+ handleLastPage: p,
22
+ handleNextPage: g,
22
23
  handlePreviousPage: u,
23
24
  handleAddLocation: h
24
25
  } = C(), { t: e } = L("Company.Locations"), { ...f } = D({
@@ -38,7 +39,10 @@ const Z = () => {
38
39
  title: /* @__PURE__ */ t(k, { children: e("locationListCol2") }),
39
40
  render: (i) => /* @__PURE__ */ n(r, { children: [
40
41
  i.mailingAddress && /* @__PURE__ */ t(a.Badge, { status: "info", children: e("mailingAddress") }),
41
- i.filingAddress && /* @__PURE__ */ t(a.Badge, { status: "info", children: e("filingAddress") })
42
+ i.filingAddress && /* @__PURE__ */ n(r, { children: [
43
+ " ",
44
+ /* @__PURE__ */ t(a.Badge, { status: "info", children: e("filingAddress") })
45
+ ] })
42
46
  ] })
43
47
  }
44
48
  ],
@@ -60,9 +64,9 @@ const Z = () => {
60
64
  }
61
65
  ),
62
66
  pagination: {
63
- handleNextPage: p,
67
+ handleNextPage: g,
64
68
  handleFirstPage: m,
65
- handleLastPage: g,
69
+ handleLastPage: p,
66
70
  handlePreviousPage: u,
67
71
  handleItemsPerPageChange: c,
68
72
  currentPage: d,
@@ -73,6 +77,6 @@ const Z = () => {
73
77
  return /* @__PURE__ */ t(S, { label: e("locationListLabel"), ...f });
74
78
  };
75
79
  export {
76
- Z as List
80
+ q as List
77
81
  };
78
82
  //# sourceMappingURL=List.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"List.js","sources":["../../../../../src/components/Company/Locations/LocationsList/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useLocationsList } from './useLocationsList'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport { DataView, EmptyData, useDataView, VisuallyHidden } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\nimport { getCityStateZip, getStreet } from '@/helpers/formattedStrings'\n\n/**List of employees slot for EmployeeList component */\nexport const List = () => {\n const Components = useComponentContext()\n const {\n locationList,\n handleEditLocation,\n currentPage,\n totalPages,\n handleFirstPage,\n handleItemsPerPageChange,\n handleLastPage,\n handleNextPage,\n handlePreviousPage,\n handleAddLocation,\n } = useLocationsList()\n\n const { t } = useTranslation('Company.Locations')\n const { ...dataViewProps } = useDataView({\n data: locationList,\n columns: [\n {\n key: 'name',\n title: t('locationListCol1'),\n render: location => {\n return (\n <>\n <address>\n {getStreet(location)}\n <br />\n <small>{getCityStateZip(location)}</small>\n </address>\n </>\n )\n },\n },\n {\n key: 'status',\n title: <VisuallyHidden>{t('locationListCol2')}</VisuallyHidden>,\n render: location => {\n return (\n <>\n {location.mailingAddress && (\n <Components.Badge status={'info'}>{t('mailingAddress')}</Components.Badge>\n )}\n {location.filingAddress && (\n <Components.Badge status={'info'}>{t('filingAddress')}</Components.Badge>\n )}\n </>\n )\n },\n },\n ],\n itemMenu: location => {\n return (\n <HamburgerMenu\n items={[\n {\n label: t('editCta'),\n onClick: () => {\n handleEditLocation(location.uuid)\n },\n icon: <PencilSvg aria-hidden />,\n 'data-testid': 'edit-location',\n },\n ]}\n data-testid=\"location-hamburger\"\n triggerLabel={t('hamburgerTitle')}\n />\n )\n },\n pagination: {\n handleNextPage,\n handleFirstPage,\n handleLastPage,\n handlePreviousPage,\n handleItemsPerPageChange,\n currentPage,\n totalPages,\n },\n emptyState: () => (\n <EmptyData title={t('emptyTableTitle')} description={t('emptyTableDescription')}>\n <Components.Button variant=\"secondary\" onClick={handleAddLocation}>\n {t('addFirstLicationCta')}\n </Components.Button>\n </EmptyData>\n ),\n })\n return <DataView label={t('locationListLabel')} {...dataViewProps} />\n}\n"],"names":["List","Components","useComponentContext","locationList","handleEditLocation","currentPage","totalPages","handleFirstPage","handleItemsPerPageChange","handleLastPage","handleNextPage","handlePreviousPage","handleAddLocation","useLocationsList","t","useTranslation","dataViewProps","useDataView","location","jsx","Fragment","getStreet","getCityStateZip","VisuallyHidden","jsxs","HamburgerMenu","PencilSvg","EmptyData","DataView"],"mappings":";;;;;;;;;;;AASO,MAAMA,IAAO,MAAM;AACxB,QAAMC,IAAaC,EAAoB,GACjC;AAAA,IACJ,cAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,YAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,0BAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,mBAAAC;AAAA,MACEC,EAAiB,GAEf,EAAE,GAAAC,EAAA,IAAMC,EAAe,mBAAmB,GAC1C,EAAE,GAAGC,EAAc,IAAIC,EAAY;AAAA,IACvC,MAAMd;AAAA,IACN,SAAS;AAAA,MACP;AAAA,QACE,KAAK;AAAA,QACL,OAAOW,EAAE,kBAAkB;AAAA,QAC3B,QAAQ,CAAYI,MAEhB,gBAAAC,EAAAC,GAAA,EACE,4BAAC,WACE,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AC5E,UAAC,gBAAAK,EAAAlB,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASW,GAC7C,UAAAE,EAAE,qBAAqB,EAC1B,CAAA,EACF,CAAA;AAAA,EAAA,CAEH;AACD,2BAAQc,GAAS,EAAA,OAAOd,EAAE,mBAAmB,GAAI,GAAGE,GAAe;AACrE;"}
1
+ {"version":3,"file":"List.js","sources":["../../../../../src/components/Company/Locations/LocationsList/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useLocationsList } from './useLocationsList'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport { DataView, EmptyData, useDataView, VisuallyHidden } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\nimport { getCityStateZip, getStreet } from '@/helpers/formattedStrings'\n\n/**List of employees slot for EmployeeList component */\nexport const List = () => {\n const Components = useComponentContext()\n const {\n locationList,\n handleEditLocation,\n currentPage,\n totalPages,\n handleFirstPage,\n handleItemsPerPageChange,\n handleLastPage,\n handleNextPage,\n handlePreviousPage,\n handleAddLocation,\n } = useLocationsList()\n\n const { t } = useTranslation('Company.Locations')\n const { ...dataViewProps } = useDataView({\n data: locationList,\n columns: [\n {\n key: 'name',\n title: t('locationListCol1'),\n render: location => {\n return (\n <>\n <address>\n {getStreet(location)}\n <br />\n <small>{getCityStateZip(location)}</small>\n </address>\n </>\n )\n },\n },\n {\n key: 'status',\n title: <VisuallyHidden>{t('locationListCol2')}</VisuallyHidden>,\n render: location => {\n return (\n <>\n {location.mailingAddress && (\n <Components.Badge status={'info'}>{t('mailingAddress')}</Components.Badge>\n )}\n {location.filingAddress && (\n <>\n {' '}\n <Components.Badge status={'info'}>{t('filingAddress')}</Components.Badge>\n </>\n )}\n </>\n )\n },\n },\n ],\n itemMenu: location => {\n return (\n <HamburgerMenu\n items={[\n {\n label: t('editCta'),\n onClick: () => {\n handleEditLocation(location.uuid)\n },\n icon: <PencilSvg aria-hidden />,\n 'data-testid': 'edit-location',\n },\n ]}\n data-testid=\"location-hamburger\"\n triggerLabel={t('hamburgerTitle')}\n />\n )\n },\n pagination: {\n handleNextPage,\n handleFirstPage,\n handleLastPage,\n handlePreviousPage,\n handleItemsPerPageChange,\n currentPage,\n totalPages,\n },\n emptyState: () => (\n <EmptyData title={t('emptyTableTitle')} description={t('emptyTableDescription')}>\n <Components.Button variant=\"secondary\" onClick={handleAddLocation}>\n {t('addFirstLicationCta')}\n </Components.Button>\n </EmptyData>\n ),\n })\n return <DataView label={t('locationListLabel')} {...dataViewProps} />\n}\n"],"names":["List","Components","useComponentContext","locationList","handleEditLocation","currentPage","totalPages","handleFirstPage","handleItemsPerPageChange","handleLastPage","handleNextPage","handlePreviousPage","handleAddLocation","useLocationsList","t","useTranslation","dataViewProps","useDataView","location","jsx","Fragment","getStreet","getCityStateZip","VisuallyHidden","jsxs","HamburgerMenu","PencilSvg","EmptyData","DataView"],"mappings":";;;;;;;;;;;;AASO,MAAMA,IAAO,MAAM;AACxB,QAAMC,IAAaC,EAAoB,GACjC;AAAA,IACJ,cAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,YAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,0BAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,mBAAAC;AAAA,MACEC,EAAiB,GAEf,EAAE,GAAAC,EAAA,IAAMC,EAAe,mBAAmB,GAC1C,EAAE,GAAGC,EAAc,IAAIC,EAAY;AAAA,IACvC,MAAMd;AAAA,IACN,SAAS;AAAA,MACP;AAAA,QACE,KAAK;AAAA,QACL,OAAOW,EAAE,kBAAkB;AAAA,QAC3B,QAAQ,CAAYI,MAEhB,gBAAAC,EAAAC,GAAA,EACE,4BAAC,WACE,EAAA,UAAA;AAAA,UAAAC,EAAUH,CAAQ;AAAA,4BAClB,MAAG,EAAA;AAAA,UACH,gBAAAC,EAAA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UAAC,gBAAAK,EAAAlB,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASW,GAC7C,UAAAE,EAAE,qBAAqB,EAC1B,CAAA,EACF,CAAA;AAAA,EAAA,CAEH;AACD,2BAAQc,GAAS,EAAA,OAAOd,EAAE,mBAAmB,GAAI,GAAGE,GAAe;AACrE;"}
@@ -9,8 +9,10 @@ import { useI18n as x } from "../../../../i18n/I18n.js";
9
9
  import { BaseComponent as E } from "../../../Base/Base.js";
10
10
  import { useBase as I } from "../../../Base/useBase.js";
11
11
  import { Flex as v } from "../../../Common/Flex/Flex.js";
12
- import { companyEvents as s } from "../../../../shared/constants.js";
13
- function i(o) {
12
+ import "react-i18next";
13
+ import "classnames";
14
+ import { companyEvents as i } from "../../../../shared/constants.js";
15
+ function s(o) {
14
16
  return /* @__PURE__ */ e(E, { ...o, children: /* @__PURE__ */ e(M, { ...o, children: o.children }) });
15
17
  }
16
18
  function M({ companyId: o, className: g, children: c }) {
@@ -41,13 +43,13 @@ function M({ companyId: o, className: g, children: c }) {
41
43
  L(t);
42
44
  },
43
45
  handleAddLocation: () => {
44
- a(s.COMPANY_LOCATION_CREATE);
46
+ a(i.COMPANY_LOCATION_CREATE);
45
47
  },
46
48
  handleEditLocation: (t) => {
47
- a(s.COMPANY_LOCATION_EDIT, { uuid: t });
49
+ a(i.COMPANY_LOCATION_EDIT, { uuid: t });
48
50
  },
49
51
  handleContinue: () => {
50
- a(s.COMPANY_LOCATION_DONE);
52
+ a(i.COMPANY_LOCATION_DONE);
51
53
  }
52
54
  },
53
55
  children: /* @__PURE__ */ e(v, { flexDirection: "column", gap: 32, children: c || /* @__PURE__ */ C(A, { children: [
@@ -58,10 +60,10 @@ function M({ companyId: o, className: g, children: c }) {
58
60
  }
59
61
  ) });
60
62
  }
61
- i.Head = l;
62
- i.List = h;
63
- i.Actions = P;
63
+ s.Head = l;
64
+ s.List = h;
65
+ s.Actions = P;
64
66
  export {
65
- i as LocationsList
67
+ s as LocationsList
66
68
  };
67
69
  //# sourceMappingURL=LocationsList.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"LocationsList.js","sources":["../../../../../src/components/Company/Locations/LocationsList/LocationsList.tsx"],"sourcesContent":["import { useLocationsGetSuspense } from '@gusto/embedded-api/react-query/locationsGet'\nimport { useState } from 'react'\nimport { Head } from './Head'\nimport { List } from './List'\nimport { Actions } from './Actions'\nimport { LocationsListProvider } from './useLocationsList'\nimport { useI18n } from '@/i18n'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { Flex } from '@/components/Common'\nimport { companyEvents } from '@/shared/constants'\n\ninterface LocationsListProps extends BaseComponentInterface {\n companyId: string\n}\n\nexport function LocationsList(props: LocationsListProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ companyId, className, children }: LocationsListProps) {\n useI18n('Company.Locations')\n const { onEvent } = useBase()\n\n const [currentPage, setCurrentPage] = useState(1)\n const [itemsPerPage, setItemsPerPage] = useState(5)\n\n const {\n data: { locationList, httpMeta },\n } = useLocationsGetSuspense({ companyId, page: currentPage, per: itemsPerPage })\n\n const totalPages = Number(httpMeta.response.headers.get('x-total-pages') ?? 1)\n\n const handleItemsPerPageChange = (newCount: number) => {\n setItemsPerPage(newCount)\n }\n const handleFirstPage = () => {\n setCurrentPage(1)\n }\n const handlePreviousPage = () => {\n setCurrentPage(prevPage => Math.max(prevPage - 1, 1))\n }\n const handleNextPage = () => {\n setCurrentPage(prevPage => Math.min(prevPage + 1, totalPages))\n }\n const handleLastPage = () => {\n setCurrentPage(totalPages)\n }\n\n const handleContinue = () => {\n onEvent(companyEvents.COMPANY_LOCATION_DONE)\n }\n const handleAddLocation = () => {\n onEvent(companyEvents.COMPANY_LOCATION_CREATE)\n }\n const handleEditLocation = (uuid: string) => {\n onEvent(companyEvents.COMPANY_LOCATION_EDIT, { uuid })\n }\n\n return (\n <section className={className}>\n <LocationsListProvider\n value={{\n locationList: locationList ?? [],\n currentPage,\n totalPages,\n handleFirstPage,\n handlePreviousPage,\n handleNextPage,\n handleLastPage,\n handleItemsPerPageChange,\n handleAddLocation,\n handleEditLocation,\n handleContinue,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <List />\n <Actions />\n </>\n )}\n </Flex>\n </LocationsListProvider>\n </section>\n )\n}\n\nLocationsList.Head = Head\nLocationsList.List = List\nLocationsList.Actions = Actions\n"],"names":["LocationsList","props","jsx","BaseComponent","Root","companyId","className","children","useI18n","onEvent","useBase","currentPage","setCurrentPage","useState","itemsPerPage","setItemsPerPage","locationList","httpMeta","useLocationsGetSuspense","totalPages","LocationsListProvider","prevPage","newCount","companyEvents","uuid","Flex","jsxs","Fragment","Head","List","Actions"],"mappings":";;;;;;;;;;;;AAgBO,SAASA,EAAcC,GAA2B;AAErD,SAAA,gBAAAC,EAACC,GAAe,EAAA,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAMA,EAAA,SAAA,CAAS,EACnC,CAAA;AAEJ;AAEA,SAASG,EAAK,EAAE,WAAAC,GAAW,WAAAC,GAAW,UAAAC,KAAgC;AACpE,EAAAC,EAAQ,mBAAmB;AACrB,QAAA,EAAE,SAAAC,EAAQ,IAAIC,EAAQ,GAEtB,CAACC,GAAaC,CAAc,IAAIC,EAAS,CAAC,GAC1C,CAACC,GAAcC,CAAe,IAAIF,EAAS,CAAC,GAE5C;AAAA,IACJ,MAAM,EAAE,cAAAG,GAAc,UAAAC,EAAS;AAAA,EAAA,IAC7BC,EAAwB,EAAE,WAAAb,GAAW,MAAMM,GAAa,KAAKG,GAAc,GAEzEK,IAAa,OAAOF,EAAS,SAAS,QAAQ,IAAI,eAAe,KAAK,CAAC;AA6B3E,SAAA,gBAAAf,EAAC,aAAQ,WAAAI,GACP,UAAA,gBAAAJ;AAAA,IAACkB;AAAA,IAAA;AAAA,MACC,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LocationsGetSuspense } from '@gusto/embedded-api/react-query/locationsGet'\nimport { useState } from 'react'\nimport { Head } from './Head'\nimport { List } from './List'\nimport { Actions } from './Actions'\nimport { LocationsListProvider } from './useLocationsList'\nimport { useI18n } from '@/i18n'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { Flex } from '@/components/Common'\nimport { companyEvents } from '@/shared/constants'\n\ninterface LocationsListProps extends BaseComponentInterface {\n companyId: string\n}\n\nexport function LocationsList(props: LocationsListProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ companyId, className, children }: LocationsListProps) {\n useI18n('Company.Locations')\n const { onEvent } = useBase()\n\n const [currentPage, setCurrentPage] = useState(1)\n const [itemsPerPage, setItemsPerPage] = useState(5)\n\n const {\n data: { locationList, httpMeta },\n } = useLocationsGetSuspense({ companyId, page: currentPage, per: itemsPerPage })\n\n const totalPages = Number(httpMeta.response.headers.get('x-total-pages') ?? 1)\n\n const handleItemsPerPageChange = (newCount: number) => {\n setItemsPerPage(newCount)\n }\n const handleFirstPage = () => {\n setCurrentPage(1)\n }\n const handlePreviousPage = () => {\n setCurrentPage(prevPage => Math.max(prevPage - 1, 1))\n }\n const handleNextPage = () => {\n setCurrentPage(prevPage => Math.min(prevPage + 1, totalPages))\n }\n const handleLastPage = () => {\n setCurrentPage(totalPages)\n }\n\n const handleContinue = () => {\n onEvent(companyEvents.COMPANY_LOCATION_DONE)\n }\n const handleAddLocation = () => {\n onEvent(companyEvents.COMPANY_LOCATION_CREATE)\n }\n const handleEditLocation = (uuid: string) => {\n onEvent(companyEvents.COMPANY_LOCATION_EDIT, { uuid })\n }\n\n return (\n <section className={className}>\n <LocationsListProvider\n value={{\n locationList: locationList ?? [],\n currentPage,\n totalPages,\n handleFirstPage,\n handlePreviousPage,\n handleNextPage,\n handleLastPage,\n handleItemsPerPageChange,\n handleAddLocation,\n handleEditLocation,\n handleContinue,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <List />\n <Actions />\n </>\n )}\n </Flex>\n </LocationsListProvider>\n </section>\n )\n}\n\nLocationsList.Head = Head\nLocationsList.List = List\nLocationsList.Actions = Actions\n"],"names":["LocationsList","props","jsx","BaseComponent","Root","companyId","className","children","useI18n","onEvent","useBase","currentPage","setCurrentPage","useState","itemsPerPage","setItemsPerPage","locationList","httpMeta","useLocationsGetSuspense","totalPages","LocationsListProvider","prevPage","newCount","companyEvents","uuid","Flex","jsxs","Fragment","Head","List","Actions"],"mappings":";;;;;;;;;;;;;;AAgBO,SAASA,EAAcC,GAA2B;AAErD,SAAA,gBAAAC,EAACC,GAAe,EAAA,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAMA,EAAA,SAAA,CAAS,EACnC,CAAA;AAEJ;AAEA,SAASG,EAAK,EAAE,WAAAC,GAAW,WAAAC,GAAW,UAAAC,KAAgC;AACpE,EAAAC,EAAQ,mBAAmB;AACrB,QAAA,EAAE,SAAAC,EAAQ,IAAIC,EAAQ,GAEtB,CAACC,GAAaC,CAAc,IAAIC,EAAS,CAAC,GAC1C,CAACC,GAAcC,CAAe,IAAIF,EAAS,CAAC,GAE5C;AAAA,IACJ,MAAM,EAAE,cAAAG,GAAc,UAAAC,EAAS;AAAA,EAAA,IAC7BC,EAAwB,EAAE,WAAAb,GAAW,MAAMM,GAAa,KAAKG,GAAc,GAEzEK,IAAa,OAAOF,EAAS,SAAS,QAAQ,IAAI,eAAe,KAAK,CAAC;AA6B3E,SAAA,gBAAAf,EAAC,aAAQ,WAAAI,GACP,UAAA,gBAAAJ;AAAA,IAACkB;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,cAAcJ,KAAgB,CAAC;AAAA,QAC/B,aAAAL;AAAA,QACA,YAAAQ;AAAA,QACA,iBA9BgB,MAAM;AAC5B,UAAAP,EAAe,CAAC;AAAA,QAClB;AAAA,QA6BQ,oBA5BmB,MAAM;AAC/B,UAAAA,EAAe,OAAY,KAAK,IAAIS,IAAW,GAAG,CAAC,CAAC;AAAA,QACtD;AAAA,QA2BQ,gBA1Be,MAAM;AAC3B,UAAAT,EAAe,OAAY,KAAK,IAAIS,IAAW,GAAGF,CAAU,CAAC;AAAA,QAC/D;AAAA,QAyBQ,gBAxBe,MAAM;AAC3B,UAAAP,EAAeO,CAAU;AAAA,QAC3B;AAAA,QAuBQ,0BArCyB,CAACG,MAAqB;AACrD,UAAAP,EAAgBO,CAAQ;AAAA,QAC1B;AAAA,QAoCQ,mBAnBkB,MAAM;AAC9B,UAAAb,EAAQc,EAAc,uBAAuB;AAAA,QAC/C;AAAA,QAkBQ,oBAjBmB,CAACC,MAAiB;AAC3C,UAAAf,EAAQc,EAAc,uBAAuB,EAAE,MAAAC,EAAA,CAAM;AAAA,QACvD;AAAA,QAgBQ,gBAxBe,MAAM;AAC3B,UAAAf,EAAQc,EAAc,qBAAqB;AAAA,QAC7C;AAAA,MAuBM;AAAA,MAEA,UAAA,gBAAArB,EAACuB,KAAK,eAAc,UAAS,KAAK,IAC/B,UAAAlB,KAIG,gBAAAmB,EAAAC,GAAA,EAAA,UAAA;AAAA,QAAA,gBAAAzB,EAAC0B,GAAK,EAAA;AAAA,0BACLC,GAAK,EAAA;AAAA,0BACLC,GAAQ,CAAA,CAAA;AAAA,MAAA,EAAA,CACX,EAEJ,CAAA;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;AAEA9B,EAAc,OAAO4B;AACrB5B,EAAc,OAAO6B;AACrB7B,EAAc,UAAU8B;"}
@@ -5,16 +5,18 @@ import "react-i18next";
5
5
  import "@gusto/embedded-api/models/errors/apierror";
6
6
  import "@gusto/embedded-api/models/errors/sdkvalidationerror";
7
7
  import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
8
+ import "@tanstack/react-query";
8
9
  import "../../../Base/useBase.js";
9
10
  import "../../../../shared/constants.js";
11
+ import "classnames";
10
12
  import "dompurify";
11
13
  import "../../../../contexts/ComponentAdapter/useComponentContext.js";
12
14
  import { createCompoundContext as o } from "../../../Base/createCompoundContext.js";
13
- const [u, x] = o(
15
+ const [d, f] = o(
14
16
  "CompanyDocumentListContext"
15
17
  );
16
18
  export {
17
- x as LocationsListProvider,
18
- u as useLocationsList
19
+ f as LocationsListProvider,
20
+ d as useLocationsList
19
21
  };
20
22
  //# sourceMappingURL=useLocationsList.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useLocationsList.js","sources":["../../../../../src/components/Company/Locations/LocationsList/useLocationsList.ts"],"sourcesContent":["import { type Location } from '@gusto/embedded-api/models/components/location'\nimport { createCompoundContext } from '@/components/Base'\n\ntype LocationsListContextType = {\n locationList: Location[]\n totalPages: number\n currentPage: number\n handleItemsPerPageChange: (n: number) => void\n handleFirstPage: () => void\n handlePreviousPage: () => void\n handleNextPage: () => void\n handleLastPage: () => void\n handleEditLocation: (uuid: string) => void\n handleAddLocation: () => void\n handleContinue: () => void\n}\n\nconst [useLocationsList, LocationsListProvider] = createCompoundContext<LocationsListContextType>(\n 'CompanyDocumentListContext',\n)\n\nexport { useLocationsList, LocationsListProvider }\n"],"names":["useLocationsList","LocationsListProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;AAiBM,MAAA,CAACA,GAAkBC,CAAqB,IAAIC;AAAA,EAChD;AACF;"}
1
+ {"version":3,"file":"useLocationsList.js","sources":["../../../../../src/components/Company/Locations/LocationsList/useLocationsList.ts"],"sourcesContent":["import { type Location } from '@gusto/embedded-api/models/components/location'\nimport { createCompoundContext } from '@/components/Base'\n\ntype LocationsListContextType = {\n locationList: Location[]\n totalPages: number\n currentPage: number\n handleItemsPerPageChange: (n: number) => void\n handleFirstPage: () => void\n handlePreviousPage: () => void\n handleNextPage: () => void\n handleLastPage: () => void\n handleEditLocation: (uuid: string) => void\n handleAddLocation: () => void\n handleContinue: () => void\n}\n\nconst [useLocationsList, LocationsListProvider] = createCompoundContext<LocationsListContextType>(\n 'CompanyDocumentListContext',\n)\n\nexport { useLocationsList, LocationsListProvider }\n"],"names":["useLocationsList","LocationsListProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;AAiBM,MAAA,CAACA,GAAkBC,CAAqB,IAAIC;AAAA,EAChD;AACF;"}
@@ -1,61 +1,63 @@
1
- import { state as c, transition as n, reduce as t } from "robot3";
2
- import { LocationsListContextual as a, LocationFormContextual as e } from "./locationsStateMachine.js";
3
- import { companyEvents as i, componentEvents as A } from "../../../shared/constants.js";
4
- const d = n(
5
- A.CANCEL,
1
+ import { state as c, transition as i, reduce as A } from "robot3";
2
+ import { LocationsListContextual as C, LocationFormContextual as O } from "./locationsStateMachine.js";
3
+ import { companyEvents as n, componentEvents as d } from "../../../shared/constants.js";
4
+ const e = (o, t, N, T) => {
5
+ console.log(`[Locations State Machine] ${o} -> ${t} (${N})`, T);
6
+ }, a = (o, t) => {
7
+ console.log(`[Locations State Machine] Event: ${o}`, t);
8
+ }, E = i(
9
+ d.CANCEL,
6
10
  "index",
7
- t((o) => ({
11
+ A((o) => (e("current", "index", d.CANCEL), {
8
12
  ...o,
9
- component: a,
13
+ component: C,
10
14
  locationId: void 0
11
15
  }))
12
- ), O = {
16
+ ), L = {
13
17
  index: c(
14
- n(
15
- i.COMPANY_LOCATION_EDIT,
18
+ i(
19
+ n.COMPANY_LOCATION_EDIT,
16
20
  "locationEdit",
17
- t(
18
- (o, m) => ({
21
+ A(
22
+ (o, t) => (a(n.COMPANY_LOCATION_EDIT, t.payload), e("index", "locationEdit", n.COMPANY_LOCATION_EDIT, t.payload), {
19
23
  ...o,
20
- component: e,
21
- locationId: m.payload.uuid
24
+ component: O,
25
+ locationId: t.payload.uuid
22
26
  })
23
27
  )
24
28
  ),
25
- n(
26
- i.COMPANY_LOCATION_CREATE,
29
+ i(
30
+ n.COMPANY_LOCATION_CREATE,
27
31
  "locationAdd",
28
- t(
29
- (o) => ({
30
- ...o,
31
- component: e
32
- })
33
- )
32
+ A((o) => (a(n.COMPANY_LOCATION_CREATE), e("index", "locationAdd", n.COMPANY_LOCATION_CREATE), {
33
+ ...o,
34
+ component: O
35
+ }))
34
36
  )
35
37
  ),
36
38
  locationAdd: c(
37
- n(
38
- i.COMPANY_LOCATION_CREATED,
39
+ i(
40
+ n.COMPANY_LOCATION_CREATED,
39
41
  "index",
40
- t((o) => ({ ...o, component: a }))
42
+ A((o) => (a(n.COMPANY_LOCATION_CREATED), e("locationAdd", "index", n.COMPANY_LOCATION_CREATED), { ...o, component: C }))
41
43
  ),
42
- d
44
+ E
43
45
  ),
44
46
  locationEdit: c(
45
- n(
46
- i.COMPANY_LOCATION_UPDATED,
47
+ i(
48
+ n.COMPANY_LOCATION_UPDATED,
47
49
  "index",
48
- t((o) => ({
50
+ A((o) => (a(n.COMPANY_LOCATION_UPDATED), e("locationEdit", "index", n.COMPANY_LOCATION_UPDATED), {
49
51
  ...o,
50
- component: a,
52
+ component: C,
51
53
  locationId: void 0
52
54
  }))
53
55
  ),
54
- d
56
+ E
55
57
  )
56
58
  };
57
59
  export {
58
- d as cancelTransition,
59
- O as locationsStateMachine
60
+ E as cancelTransition,
61
+ L as locationsStateMachine
60
62
  };
61
63
  //# sourceMappingURL=stateMachine.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"stateMachine.js","sources":["../../../../src/components/Company/Locations/stateMachine.ts"],"sourcesContent":["import { state, transition, reduce } from 'robot3'\nimport type { LocationsContextInterface, EventPayloads } from './locationsStateMachine'\nimport { LocationFormContextual, LocationsListContextual } from './locationsStateMachine'\nimport { companyEvents, componentEvents } from '@/shared/constants'\nimport type { MachineEventType } from '@/types/Helpers'\n\nexport const cancelTransition = transition(\n componentEvents.CANCEL,\n 'index',\n reduce((ctx: LocationsContextInterface) => ({\n ...ctx,\n component: LocationsListContextual,\n locationId: undefined,\n })),\n)\n\nexport const locationsStateMachine = {\n index: state(\n transition(\n companyEvents.COMPANY_LOCATION_EDIT,\n 'locationEdit',\n reduce(\n (\n ctx: LocationsContextInterface,\n ev: MachineEventType<EventPayloads, typeof companyEvents.COMPANY_LOCATION_EDIT>,\n ): LocationsContextInterface => ({\n ...ctx,\n component: LocationFormContextual,\n locationId: ev.payload.uuid,\n }),\n ),\n ),\n transition(\n companyEvents.COMPANY_LOCATION_CREATE,\n 'locationAdd',\n reduce(\n (ctx: LocationsContextInterface): LocationsContextInterface => ({\n ...ctx,\n component: LocationFormContextual,\n }),\n ),\n ),\n ),\n locationAdd: state(\n transition(\n companyEvents.COMPANY_LOCATION_CREATED,\n 'index',\n reduce((ctx: LocationsContextInterface) => ({ ...ctx, component: LocationsListContextual })),\n ),\n cancelTransition,\n ),\n locationEdit: state(\n transition(\n companyEvents.COMPANY_LOCATION_UPDATED,\n 'index',\n reduce((ctx: LocationsContextInterface) => ({\n ...ctx,\n component: LocationsListContextual,\n locationId: undefined,\n })),\n ),\n cancelTransition,\n ),\n}\n"],"names":["cancelTransition","transition","componentEvents","reduce","ctx","LocationsListContextual","locationsStateMachine","state","companyEvents","ev","LocationFormContextual"],"mappings":";;;AAMO,MAAMA,IAAmBC;AAAA,EAC9BC,EAAgB;AAAA,EAChB;AAAA,EACAC,EAAO,CAACC,OAAoC;AAAA,IAC1C,GAAGA;AAAA,IACH,WAAWC;AAAA,IACX,YAAY;AAAA,EAAA,EACZ;AACJ,GAEaC,IAAwB;AAAA,EACnC,OAAOC;AAAA,IACLN;AAAA,MACEO,EAAc;AAAA,MACd;AAAA,MACAL;AAAA,QACE,CACEC,GACAK,OAC+B;AAAA,UAC/B,GAAGL;AAAA,UACH,WAAWM;AAAA,UACX,YAAYD,EAAG,QAAQ;AAAA,QACzB;AAAA,MAAA;AAAA,IAEJ;AAAA,IACAR;AAAA,MACEO,EAAc;AAAA,MACd;AAAA,MACAL;AAAA,QACE,CAACC,OAA+D;AAAA,UAC9D,GAAGA;AAAA,UACH,WAAWM;AAAA,QACb;AAAA,MAAA;AAAA,IACF;AAAA,EAEJ;AAAA,EACA,aAAaH;AAAA,IACXN;AAAA,MACEO,EAAc;AAAA,MACd;AAAA,MACAL,EAAO,CAACC,OAAoC,EAAE,GAAGA,GAAK,WAAWC,IAA0B;AAAA,IAC7F;AAAA,IACAL;AAAA,EACF;AAAA,EACA,cAAcO;AAAA,IACZN;AAAA,MACEO,EAAc;AAAA,MACd;AAAA,MACAL,EAAO,CAACC,OAAoC;AAAA,QAC1C,GAAGA;AAAA,QACH,WAAWC;AAAA,QACX,YAAY;AAAA,MAAA,EACZ;AAAA,IACJ;AAAA,IACAL;AAAA,EAAA;AAEJ;"}
1
+ {"version":3,"file":"stateMachine.js","sources":["../../../../src/components/Company/Locations/stateMachine.ts"],"sourcesContent":["import { state, transition, reduce } from 'robot3'\nimport type { LocationsContextInterface, EventPayloads } from './locationsStateMachine'\nimport { LocationFormContextual, LocationsListContextual } from './locationsStateMachine'\nimport { companyEvents, componentEvents } from '@/shared/constants'\nimport type { MachineEventType } from '@/types/Helpers'\n\n// Helper function to log state transitions\nconst logTransition = (fromState: string, toState: string, event: string, payload?: unknown) => {\n // eslint-disable-next-line no-console\n console.log(`[Locations State Machine] ${fromState} -> ${toState} (${event})`, payload)\n}\n\n// Helper function to log event received\nconst logEvent = (event: string, payload?: unknown) => {\n // eslint-disable-next-line no-console\n console.log(`[Locations State Machine] Event: ${event}`, payload)\n}\n\nexport const cancelTransition = transition(\n componentEvents.CANCEL,\n 'index',\n reduce((ctx: LocationsContextInterface) => {\n logTransition('current', 'index', componentEvents.CANCEL)\n return {\n ...ctx,\n component: LocationsListContextual,\n locationId: undefined,\n }\n }),\n)\n\nexport const locationsStateMachine = {\n index: state(\n transition(\n companyEvents.COMPANY_LOCATION_EDIT,\n 'locationEdit',\n reduce(\n (\n ctx: LocationsContextInterface,\n ev: MachineEventType<EventPayloads, typeof companyEvents.COMPANY_LOCATION_EDIT>,\n ): LocationsContextInterface => {\n logEvent(companyEvents.COMPANY_LOCATION_EDIT, ev.payload)\n logTransition('index', 'locationEdit', companyEvents.COMPANY_LOCATION_EDIT, ev.payload)\n return {\n ...ctx,\n component: LocationFormContextual,\n locationId: ev.payload.uuid,\n }\n },\n ),\n ),\n transition(\n companyEvents.COMPANY_LOCATION_CREATE,\n 'locationAdd',\n reduce((ctx: LocationsContextInterface): LocationsContextInterface => {\n logEvent(companyEvents.COMPANY_LOCATION_CREATE)\n logTransition('index', 'locationAdd', companyEvents.COMPANY_LOCATION_CREATE)\n return {\n ...ctx,\n component: LocationFormContextual,\n }\n }),\n ),\n ),\n locationAdd: state(\n transition(\n companyEvents.COMPANY_LOCATION_CREATED,\n 'index',\n reduce((ctx: LocationsContextInterface) => {\n logEvent(companyEvents.COMPANY_LOCATION_CREATED)\n logTransition('locationAdd', 'index', companyEvents.COMPANY_LOCATION_CREATED)\n return { ...ctx, component: LocationsListContextual }\n }),\n ),\n cancelTransition,\n ),\n locationEdit: state(\n transition(\n companyEvents.COMPANY_LOCATION_UPDATED,\n 'index',\n reduce((ctx: LocationsContextInterface) => {\n logEvent(companyEvents.COMPANY_LOCATION_UPDATED)\n logTransition('locationEdit', 'index', companyEvents.COMPANY_LOCATION_UPDATED)\n return {\n ...ctx,\n component: LocationsListContextual,\n locationId: undefined,\n }\n }),\n ),\n cancelTransition,\n ),\n}\n"],"names":["logTransition","fromState","toState","event","payload","logEvent","cancelTransition","transition","componentEvents","reduce","ctx","LocationsListContextual","locationsStateMachine","state","companyEvents","ev","LocationFormContextual"],"mappings":";;;AAOA,MAAMA,IAAgB,CAACC,GAAmBC,GAAiBC,GAAeC,MAAsB;AAEtF,UAAA,IAAI,6BAA6BH,CAAS,OAAOC,CAAO,KAAKC,CAAK,KAAKC,CAAO;AACxF,GAGMC,IAAW,CAACF,GAAeC,MAAsB;AAErD,UAAQ,IAAI,oCAAoCD,CAAK,IAAIC,CAAO;AAClE,GAEaE,IAAmBC;AAAA,EAC9BC,EAAgB;AAAA,EAChB;AAAA,EACAC,EAAO,CAACC,OACQV,EAAA,WAAW,SAASQ,EAAgB,MAAM,GACjD;AAAA,IACL,GAAGE;AAAA,IACH,WAAWC;AAAA,IACX,YAAY;AAAA,EACd,EACD;AACH,GAEaC,IAAwB;AAAA,EACnC,OAAOC;AAAA,IACLN;AAAA,MACEO,EAAc;AAAA,MACd;AAAA,MACAL;AAAA,QACE,CACEC,GACAK,OAESV,EAAAS,EAAc,uBAAuBC,EAAG,OAAO,GACxDf,EAAc,SAAS,gBAAgBc,EAAc,uBAAuBC,EAAG,OAAO,GAC/E;AAAA,UACL,GAAGL;AAAA,UACH,WAAWM;AAAA,UACX,YAAYD,EAAG,QAAQ;AAAA,QACzB;AAAA,MACF;AAAA,IAEJ;AAAA,IACAR;AAAA,MACEO,EAAc;AAAA,MACd;AAAA,MACAL,EAAO,CAACC,OACNL,EAASS,EAAc,uBAAuB,GAChCd,EAAA,SAAS,eAAec,EAAc,uBAAuB,GACpE;AAAA,QACL,GAAGJ;AAAA,QACH,WAAWM;AAAA,MACb,EACD;AAAA,IAAA;AAAA,EAEL;AAAA,EACA,aAAaH;AAAA,IACXN;AAAA,MACEO,EAAc;AAAA,MACd;AAAA,MACAL,EAAO,CAACC,OACNL,EAASS,EAAc,wBAAwB,GACjCd,EAAA,eAAe,SAASc,EAAc,wBAAwB,GACrE,EAAE,GAAGJ,GAAK,WAAWC,EAAwB,EACrD;AAAA,IACH;AAAA,IACAL;AAAA,EACF;AAAA,EACA,cAAcO;AAAA,IACZN;AAAA,MACEO,EAAc;AAAA,MACd;AAAA,MACAL,EAAO,CAACC,OACNL,EAASS,EAAc,wBAAwB,GACjCd,EAAA,gBAAgB,SAASc,EAAc,wBAAwB,GACtE;AAAA,QACL,GAAGJ;AAAA,QACH,WAAWC;AAAA,QACX,YAAY;AAAA,MACd,EACD;AAAA,IACH;AAAA,IACAL;AAAA,EAAA;AAEJ;"}
@@ -1,10 +1,11 @@
1
1
  import { jsxs as i, jsx as o } from "react/jsx-runtime";
2
- import { useTranslation as l } from "react-i18next";
3
- import { useOnboardingOverview as m } from "./context.js";
2
+ import { useTranslation as m } from "react-i18next";
3
+ import { useOnboardingOverview as l } from "./context.js";
4
4
  import { Flex as a } from "../../Common/Flex/Flex.js";
5
+ import "classnames";
5
6
  import { useComponentContext as d } from "../../../contexts/ComponentAdapter/useComponentContext.js";
6
- const u = () => {
7
- const e = d(), { onboardingCompleted: t, handleDone: r } = m(), { t: n } = l("Company.OnboardingOverview");
7
+ const f = () => {
8
+ const e = d(), { onboardingCompleted: t, handleDone: r } = l(), { t: n } = m("Company.OnboardingOverview");
8
9
  return t ? /* @__PURE__ */ i(a, { alignItems: "center", flexDirection: "column", gap: 8, children: [
9
10
  /* @__PURE__ */ o(e.Heading, { as: "h2", textAlign: "center", children: n("onboardingCompletedTitle") }),
10
11
  /* @__PURE__ */ o("p", { children: n("onboardingCompletedDescription") }),
@@ -12,6 +13,6 @@ const u = () => {
12
13
  ] }) : null;
13
14
  };
14
15
  export {
15
- u as Completed
16
+ f as Completed
16
17
  };
17
18
  //# sourceMappingURL=Completed.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Completed.js","sources":["../../../../src/components/Company/OnboardingOverview/Completed.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useOnboardingOverview } from './context'\nimport { Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Completed = () => {\n const Components = useComponentContext()\n const { onboardingCompleted, handleDone } = useOnboardingOverview()\n const { t } = useTranslation('Company.OnboardingOverview')\n if (!onboardingCompleted) {\n return null\n }\n return (\n <Flex alignItems=\"center\" flexDirection=\"column\" gap={8}>\n <Components.Heading as=\"h2\" textAlign=\"center\">\n {t('onboardingCompletedTitle')}\n </Components.Heading>\n <p>{t('onboardingCompletedDescription')}</p>\n <Components.Button variant=\"secondary\" onClick={handleDone}>\n {t('onboardingCompletedCta')}\n </Components.Button>\n </Flex>\n )\n}\n"],"names":["Completed","Components","useComponentContext","onboardingCompleted","handleDone","useOnboardingOverview","t","useTranslation","Flex","jsx"],"mappings":";;;;;AAKO,MAAMA,IAAY,MAAM;AAC7B,QAAMC,IAAaC,EAAoB,GACjC,EAAE,qBAAAC,GAAqB,YAAAC,EAAW,IAAIC,EAAsB,GAC5D,EAAE,GAAAC,EAAA,IAAMC,EAAe,4BAA4B;AACzD,SAAKJ,sBAIFK,GAAK,EAAA,YAAW,UAAS,eAAc,UAAS,KAAK,GACpD,UAAA;AAAA,IAAC,gBAAAC,EAAAR,EAAW,SAAX,EAAmB,IAAG,MAAK,WAAU,UACnC,UAAEK,EAAA,0BAA0B,EAC/B,CAAA;AAAA,IACC,gBAAAG,EAAA,KAAA,EAAG,UAAEH,EAAA,gCAAgC,EAAE,CAAA;AAAA,IACxC,gBAAAG,EAACR,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASG,GAC7C,UAAEE,EAAA,wBAAwB,EAC7B,CAAA;AAAA,EAAA,GACF,IAXO;AAaX;"}
1
+ {"version":3,"file":"Completed.js","sources":["../../../../src/components/Company/OnboardingOverview/Completed.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useOnboardingOverview } from './context'\nimport { Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Completed = () => {\n const Components = useComponentContext()\n const { onboardingCompleted, handleDone } = useOnboardingOverview()\n const { t } = useTranslation('Company.OnboardingOverview')\n if (!onboardingCompleted) {\n return null\n }\n return (\n <Flex alignItems=\"center\" flexDirection=\"column\" gap={8}>\n <Components.Heading as=\"h2\" textAlign=\"center\">\n {t('onboardingCompletedTitle')}\n </Components.Heading>\n <p>{t('onboardingCompletedDescription')}</p>\n <Components.Button variant=\"secondary\" onClick={handleDone}>\n {t('onboardingCompletedCta')}\n </Components.Button>\n </Flex>\n )\n}\n"],"names":["Completed","Components","useComponentContext","onboardingCompleted","handleDone","useOnboardingOverview","t","useTranslation","Flex","jsx"],"mappings":";;;;;;AAKO,MAAMA,IAAY,MAAM;AAC7B,QAAMC,IAAaC,EAAoB,GACjC,EAAE,qBAAAC,GAAqB,YAAAC,EAAW,IAAIC,EAAsB,GAC5D,EAAE,GAAAC,EAAA,IAAMC,EAAe,4BAA4B;AACzD,SAAKJ,sBAIFK,GAAK,EAAA,YAAW,UAAS,eAAc,UAAS,KAAK,GACpD,UAAA;AAAA,IAAC,gBAAAC,EAAAR,EAAW,SAAX,EAAmB,IAAG,MAAK,WAAU,UACnC,UAAEK,EAAA,0BAA0B,EAC/B,CAAA;AAAA,IACC,gBAAAG,EAAA,KAAA,EAAG,UAAEH,EAAA,gCAAgC,EAAE,CAAA;AAAA,IACxC,gBAAAG,EAACR,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASG,GAC7C,UAAEE,EAAA,wBAAwB,EAC7B,CAAA;AAAA,EAAA,GACF,IAXO;AAaX;"}
@@ -2,10 +2,11 @@ import { jsxs as l, jsx as t } from "react/jsx-runtime";
2
2
  import { useTranslation as p } from "react-i18next";
3
3
  import { useOnboardingOverview as a } from "./context.js";
4
4
  import { Flex as c } from "../../Common/Flex/Flex.js";
5
+ import "classnames";
5
6
  import { ActionsLayout as u } from "../../Common/ActionsLayout/ActionsLayout.js";
6
7
  import { RequirementsList as d } from "../../Common/RequirementsList/RequirementsList.js";
7
8
  import { useComponentContext as g } from "../../../contexts/ComponentAdapter/useComponentContext.js";
8
- const S = () => {
9
+ const b = () => {
9
10
  const r = g(), { onboardingSteps: n, onboardingCompleted: s, handleContinue: m } = a(), { t: e } = p("Company.OnboardingOverview");
10
11
  if (s)
11
12
  return null;
@@ -27,6 +28,6 @@ const S = () => {
27
28
  ] });
28
29
  };
29
30
  export {
30
- S as MissingRequirements
31
+ b as MissingRequirements
31
32
  };
32
33
  //# sourceMappingURL=MissingRequirements.js.map