@gusto/embedded-react-sdk 0.19.0 → 0.21.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 (405) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/dist/UNSTABLE_Hooks.d.ts +1 -0
  3. package/dist/UNSTABLE_Hooks.js +9 -0
  4. package/dist/UNSTABLE_Hooks.js.map +1 -0
  5. package/dist/assets/icons/coins-hand.svg.js +10 -0
  6. package/dist/assets/icons/coins-hand.svg.js.map +1 -0
  7. package/dist/components/Base/Base.d.ts +19 -4
  8. package/dist/components/Base/Base.js +68 -61
  9. package/dist/components/Base/Base.js.map +1 -1
  10. package/dist/components/Base/useBase.d.ts +1 -1
  11. package/dist/components/Base/useBase.js.map +1 -1
  12. package/dist/components/Base/useBaseSubmit.d.ts +10 -0
  13. package/dist/components/Base/useBaseSubmit.js +33 -0
  14. package/dist/components/Base/useBaseSubmit.js.map +1 -0
  15. package/dist/components/Common/Fields/TextAreaField/TextAreaField.d.ts +5 -0
  16. package/dist/components/Common/Fields/TextAreaField/TextAreaField.js +34 -0
  17. package/dist/components/Common/Fields/TextAreaField/TextAreaField.js.map +1 -0
  18. package/dist/components/Common/Fields/TextAreaField/index.d.ts +3 -0
  19. package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.js +10 -10
  20. package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.js.map +1 -1
  21. package/dist/components/Common/SignatureForm/SignatureForm.js +15 -10
  22. package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
  23. package/dist/components/Common/SignatureForm/SignatureFormActions.js +14 -10
  24. package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
  25. package/dist/components/Common/SignatureForm/SignatureFormFields.js +19 -14
  26. package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
  27. package/dist/components/Common/UI/Alert/Alert.js +23 -22
  28. package/dist/components/Common/UI/Alert/Alert.js.map +1 -1
  29. package/dist/components/Common/UI/Alert/AlertTypes.d.ts +4 -0
  30. package/dist/components/Common/UI/Alert/AlertTypes.js.map +1 -1
  31. package/dist/components/Common/UI/DatePicker/DatePicker.d.ts +1 -1
  32. package/dist/components/Common/UI/DatePicker/DatePicker.js +38 -37
  33. package/dist/components/Common/UI/DatePicker/DatePicker.js.map +1 -1
  34. package/dist/components/Common/UI/DatePicker/DatePickerTypes.d.ts +4 -0
  35. package/dist/components/Common/UI/Modal/Modal.module.scss.js +17 -17
  36. package/dist/components/Common/UI/Select/Select.d.ts +1 -1
  37. package/dist/components/Common/UI/Select/Select.js +27 -26
  38. package/dist/components/Common/UI/Select/Select.js.map +1 -1
  39. package/dist/components/Common/UI/Select/SelectTypes.d.ts +4 -0
  40. package/dist/components/Common/UI/TextArea/TextArea.d.ts +2 -0
  41. package/dist/components/Common/UI/TextArea/TextArea.js +79 -0
  42. package/dist/components/Common/UI/TextArea/TextArea.js.map +1 -0
  43. package/dist/components/Common/UI/TextArea/TextArea.module.scss.js +12 -0
  44. package/dist/components/Common/UI/TextArea/TextArea.module.scss.js.map +1 -0
  45. package/dist/components/Common/UI/TextArea/TextAreaTypes.d.ts +37 -0
  46. package/dist/components/Common/UI/TextArea/TextAreaTypes.js +9 -0
  47. package/dist/components/Common/UI/TextArea/TextAreaTypes.js.map +1 -0
  48. package/dist/components/Common/UI/TextArea/index.d.ts +4 -0
  49. package/dist/components/Company/AssignSignatory/AssignSignatory.js +11 -7
  50. package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
  51. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +10 -6
  52. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
  53. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +11 -8
  54. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
  55. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +9 -6
  56. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
  57. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +14 -13
  58. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
  59. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +6 -4
  60. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  61. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +9 -6
  62. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
  63. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +13 -10
  64. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
  65. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +14 -13
  66. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
  67. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +6 -4
  68. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  69. package/dist/components/Company/AssignSignatory/TitleSelect.js +10 -7
  70. package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
  71. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +8 -6
  72. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  73. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +11 -9
  74. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
  75. package/dist/components/Company/BankAccount/BankAccountForm/Form.js +13 -9
  76. package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
  77. package/dist/components/Company/BankAccount/BankAccountForm/context.js +6 -4
  78. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  79. package/dist/components/Company/BankAccount/BankAccountList/Actions.js +13 -10
  80. package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
  81. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +15 -12
  82. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
  83. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +8 -4
  84. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
  85. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +8 -5
  86. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
  87. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +15 -11
  88. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  89. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +6 -4
  90. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  91. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +15 -11
  92. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  93. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +6 -4
  94. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  95. package/dist/components/Company/FederalTaxes/Actions.js +11 -8
  96. package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
  97. package/dist/components/Company/FederalTaxes/FederalTaxes.js +19 -15
  98. package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
  99. package/dist/components/Company/FederalTaxes/Form.js +8 -6
  100. package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
  101. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +11 -9
  102. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  103. package/dist/components/Company/Industry/Actions.js +11 -8
  104. package/dist/components/Company/Industry/Actions.js.map +1 -1
  105. package/dist/components/Company/Industry/Context.js +9 -7
  106. package/dist/components/Company/Industry/Context.js.map +1 -1
  107. package/dist/components/Company/Industry/Edit.js +14 -10
  108. package/dist/components/Company/Industry/Edit.js.map +1 -1
  109. package/dist/components/Company/Locations/LocationForm/Actions.js +11 -8
  110. package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
  111. package/dist/components/Company/Locations/LocationForm/Form.js +7 -5
  112. package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
  113. package/dist/components/Company/Locations/LocationForm/LocationForm.js +19 -15
  114. package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
  115. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +6 -4
  116. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  117. package/dist/components/Company/Locations/LocationsList/Actions.js +9 -6
  118. package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
  119. package/dist/components/Company/Locations/LocationsList/List.js +17 -15
  120. package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
  121. package/dist/components/Company/Locations/LocationsList/LocationsList.js +15 -12
  122. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  123. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +6 -4
  124. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  125. package/dist/components/Company/OnboardingOverview/Completed.js +15 -12
  126. package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
  127. package/dist/components/Company/OnboardingOverview/MissingRequirements.js +12 -9
  128. package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
  129. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +10 -6
  130. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
  131. package/dist/components/Company/OnboardingOverview/context.js +6 -4
  132. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  133. package/dist/components/Company/PaySchedule/PaySchedule.js +36 -33
  134. package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
  135. package/dist/components/Company/PaySchedule/_parts/Actions.js +13 -10
  136. package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
  137. package/dist/components/Company/PaySchedule/_parts/Edit.js +15 -15
  138. package/dist/components/Company/PaySchedule/_parts/Head.js +14 -11
  139. package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
  140. package/dist/components/Company/PaySchedule/_parts/List.js +21 -19
  141. package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
  142. package/dist/components/Company/PaySchedule/usePaySchedule.js +8 -6
  143. package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
  144. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +8 -5
  145. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
  146. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +6 -4
  147. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  148. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +9 -6
  149. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
  150. package/dist/components/Company/StateTaxes/StateTaxesList/List.js +8 -5
  151. package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
  152. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +6 -4
  153. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  154. package/dist/components/Contractor/Address/Address.js +8 -4
  155. package/dist/components/Contractor/Address/Address.js.map +1 -1
  156. package/dist/components/Contractor/Address/Form.js +8 -6
  157. package/dist/components/Contractor/Address/Form.js.map +1 -1
  158. package/dist/components/Contractor/Address/useAddress.js +8 -6
  159. package/dist/components/Contractor/Address/useAddress.js.map +1 -1
  160. package/dist/components/Contractor/ContractorList/index.js +29 -28
  161. package/dist/components/Contractor/ContractorList/index.js.map +1 -1
  162. package/dist/components/Contractor/NewHireReport/NewHireReport.js +14 -13
  163. package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
  164. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +14 -10
  165. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
  166. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +3 -2
  167. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
  168. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +5 -2
  169. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
  170. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.d.ts +15 -0
  171. package/dist/components/Contractor/Payments/Detail/DetailPresentation.d.ts +19 -0
  172. package/dist/components/Contractor/Payments/Overview/OverviewPresentation.d.ts +18 -0
  173. package/dist/components/Contractor/Payments/PaymentEdit/PaymentEditPresentation.d.ts +6 -0
  174. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.d.ts +18 -0
  175. package/dist/components/Contractor/Payments/types.d.ts +4 -0
  176. package/dist/components/Contractor/Profile/ContractorProfileForm.js +13 -13
  177. package/dist/components/Contractor/Profile/useContractorProfile.js +4 -3
  178. package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
  179. package/dist/components/Contractor/Submit/Submit.js +22 -20
  180. package/dist/components/Contractor/Submit/Submit.js.map +1 -1
  181. package/dist/components/Employee/Compensation/Actions.js +14 -12
  182. package/dist/components/Employee/Compensation/Actions.js.map +1 -1
  183. package/dist/components/Employee/Compensation/Edit.js +17 -16
  184. package/dist/components/Employee/Compensation/Edit.js.map +1 -1
  185. package/dist/components/Employee/Compensation/List.js +25 -23
  186. package/dist/components/Employee/Compensation/List.js.map +1 -1
  187. package/dist/components/Employee/Deductions/Deductions.d.ts +1 -1
  188. package/dist/components/Employee/Deductions/Deductions.js +10 -10
  189. package/dist/components/Employee/Deductions/Deductions.js.map +1 -1
  190. package/dist/components/Employee/Deductions/DeductionsComponents.d.ts +2 -0
  191. package/dist/components/Employee/Deductions/DeductionsComponents.js +6 -6
  192. package/dist/components/Employee/Deductions/DeductionsComponents.js.map +1 -1
  193. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +222 -0
  194. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -0
  195. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.module.scss.js +8 -0
  196. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.module.scss.js.map +1 -0
  197. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.d.ts +2 -2
  198. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +165 -0
  199. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -0
  200. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.d.ts +0 -34
  201. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js +90 -126
  202. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js.map +1 -1
  203. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.module.scss.js +14 -0
  204. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.module.scss.js.map +1 -0
  205. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +56 -55
  206. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js.map +1 -1
  207. package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.d.ts +6 -0
  208. package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js +53 -0
  209. package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js.map +1 -0
  210. package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.module.scss.js +14 -0
  211. package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.module.scss.js.map +1 -0
  212. package/dist/components/Employee/Deductions/stateMachine.js +49 -29
  213. package/dist/components/Employee/Deductions/stateMachine.js.map +1 -1
  214. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +9 -6
  215. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
  216. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +13 -9
  217. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  218. package/dist/components/Employee/DocumentSigner/DocumentList/List.js +6 -2
  219. package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
  220. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +6 -4
  221. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  222. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +15 -11
  223. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  224. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +6 -4
  225. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  226. package/dist/components/Employee/EmployeeList/Actions.js +9 -6
  227. package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
  228. package/dist/components/Employee/EmployeeList/EmployeeList.js +6 -3
  229. package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
  230. package/dist/components/Employee/EmployeeList/Head.js +8 -5
  231. package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
  232. package/dist/components/Employee/EmployeeList/List.js +17 -16
  233. package/dist/components/Employee/EmployeeList/List.js.map +1 -1
  234. package/dist/components/Employee/EmployeeList/useEmployeeList.js +6 -4
  235. package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
  236. package/dist/components/Employee/FederalTaxes/Actions.js +10 -7
  237. package/dist/components/Employee/FederalTaxes/Actions.js.map +1 -1
  238. package/dist/components/Employee/FederalTaxes/FederalForm.js +14 -11
  239. package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
  240. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +6 -4
  241. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
  242. package/dist/components/Employee/Landing/Landing.js +15 -13
  243. package/dist/components/Employee/Landing/Landing.js.map +1 -1
  244. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +7 -7
  245. package/dist/components/Employee/PaymentMethod/Actions.js +11 -8
  246. package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
  247. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +8 -5
  248. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
  249. package/dist/components/Employee/PaymentMethod/BankAccountsList.js +13 -11
  250. package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
  251. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +10 -7
  252. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
  253. package/dist/components/Employee/PaymentMethod/Split.js +10 -9
  254. package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
  255. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +8 -6
  256. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
  257. package/dist/components/Employee/Profile/Actions.js +11 -8
  258. package/dist/components/Employee/Profile/Actions.js.map +1 -1
  259. package/dist/components/Employee/Profile/AdminPersonalDetails.js +11 -8
  260. package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
  261. package/dist/components/Employee/Profile/HomeAddress.js +8 -7
  262. package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
  263. package/dist/components/Employee/Profile/PersonalDetailsInputs.js +31 -28
  264. package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
  265. package/dist/components/Employee/Profile/useProfile.js +6 -4
  266. package/dist/components/Employee/Profile/useProfile.js.map +1 -1
  267. package/dist/components/Employee/StateTaxes/Actions.js +11 -8
  268. package/dist/components/Employee/StateTaxes/Actions.js.map +1 -1
  269. package/dist/components/Employee/StateTaxes/useStateTaxes.js +6 -4
  270. package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
  271. package/dist/components/Employee/Taxes/Actions.js +11 -8
  272. package/dist/components/Employee/Taxes/Actions.js.map +1 -1
  273. package/dist/components/Employee/Taxes/FederalForm.js +15 -12
  274. package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
  275. package/dist/components/Employee/Taxes/useTaxes.js +6 -4
  276. package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
  277. package/dist/components/Flow/Flow.js +30 -27
  278. package/dist/components/Flow/Flow.js.map +1 -1
  279. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.d.ts +1 -1
  280. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js +58 -36
  281. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js.map +1 -1
  282. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.d.ts +2 -0
  283. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.js +71 -54
  284. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.js.map +1 -1
  285. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsComponents.d.ts +23 -0
  286. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsComponents.js +27 -15
  287. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsComponents.js.map +1 -1
  288. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.d.ts +25 -2
  289. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +153 -23
  290. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js.map +1 -1
  291. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.module.scss.js +10 -0
  292. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.module.scss.js.map +1 -0
  293. package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.d.ts +9 -1
  294. package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.js +195 -22
  295. package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.js.map +1 -1
  296. package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.module.scss.js +18 -0
  297. package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.module.scss.js.map +1 -0
  298. package/dist/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.d.ts +10 -2
  299. package/dist/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.js +39 -25
  300. package/dist/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.js.map +1 -1
  301. package/dist/components/Payroll/ConfirmWireDetails/index.d.ts +1 -0
  302. package/dist/components/Payroll/ConfirmWireDetails/types.d.ts +5 -0
  303. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +16 -13
  304. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
  305. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +8 -6
  306. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js.map +1 -1
  307. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +15 -15
  308. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
  309. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +27 -27
  310. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +13 -11
  311. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
  312. package/dist/components/Payroll/PayrollHistory/PayrollHistory.d.ts +0 -12
  313. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js +44 -52
  314. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js.map +1 -1
  315. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.d.ts +9 -6
  316. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +97 -93
  317. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
  318. package/dist/components/Payroll/PayrollList/PayrollList.js +58 -59
  319. package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
  320. package/dist/components/Payroll/PayrollList/PayrollListPresentation.d.ts +4 -6
  321. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +82 -72
  322. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
  323. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +3 -2
  324. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
  325. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +11 -10
  326. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
  327. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchThresholdExceeded.js +8 -5
  328. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchThresholdExceeded.js.map +1 -1
  329. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +3 -2
  330. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
  331. package/dist/components/Payroll/PayrollStatusBadges/PayrollStatusBadges.d.ts +7 -0
  332. package/dist/components/Payroll/PayrollStatusBadges/PayrollStatusBadges.js +19 -0
  333. package/dist/components/Payroll/PayrollStatusBadges/PayrollStatusBadges.js.map +1 -0
  334. package/dist/components/Payroll/PayrollStatusBadges/PayrollStatusBadges.module.scss.js +10 -0
  335. package/dist/components/Payroll/PayrollStatusBadges/PayrollStatusBadges.module.scss.js.map +1 -0
  336. package/dist/components/Payroll/PayrollStatusBadges/index.d.ts +4 -0
  337. package/dist/components/Payroll/PayrollStatusBadges/payrollStatusConfig.d.ts +33 -0
  338. package/dist/components/Payroll/PayrollStatusBadges/payrollStatusConfig.js +161 -0
  339. package/dist/components/Payroll/PayrollStatusBadges/payrollStatusConfig.js.map +1 -0
  340. package/dist/components/Payroll/PayrollStatusBadges/usePayrollStatusBadges.d.ts +3 -0
  341. package/dist/components/Payroll/PayrollStatusBadges/usePayrollStatusBadges.js +17 -0
  342. package/dist/components/Payroll/PayrollStatusBadges/usePayrollStatusBadges.js.map +1 -0
  343. package/dist/components/Payroll/PayrollStatusBadges/usePayrollStatusBadges.test.d.ts +1 -0
  344. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfiguration.d.ts +6 -0
  345. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfiguration.js +70 -0
  346. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfiguration.js.map +1 -0
  347. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationContext.d.ts +7 -0
  348. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationContext.js +6 -0
  349. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationContext.js.map +1 -0
  350. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationProvider.d.ts +9 -0
  351. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationProvider.js +40 -0
  352. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationProvider.js.map +1 -0
  353. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/index.d.ts +5 -0
  354. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/usePayrollConfiguration.d.ts +2 -0
  355. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/usePayrollConfiguration.js +12 -0
  356. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/usePayrollConfiguration.js.map +1 -0
  357. package/dist/components/Payroll/UNSTABLE_PayrollHooks/index.d.ts +2 -0
  358. package/dist/components/Payroll/helpers.d.ts +0 -5
  359. package/dist/components/Payroll/helpers.js +106 -112
  360. package/dist/components/Payroll/helpers.js.map +1 -1
  361. package/dist/components/Payroll/usePreparedPayrollData.js +10 -8
  362. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  363. package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js +48 -46
  364. package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js.map +1 -1
  365. package/dist/contexts/ComponentAdapter/useComponentContext.d.ts +2 -0
  366. package/dist/contexts/ComponentAdapter/useComponentContext.js +3 -3
  367. package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
  368. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +9 -5
  369. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  370. package/dist/helpers/dateFormatting.d.ts +9 -0
  371. package/dist/helpers/dateFormatting.js +65 -52
  372. package/dist/helpers/dateFormatting.js.map +1 -1
  373. package/dist/helpers/formattedStrings.js +12 -11
  374. package/dist/helpers/formattedStrings.js.map +1 -1
  375. package/dist/helpers/validations.js +1 -1
  376. package/dist/helpers/validations.js.map +1 -1
  377. package/dist/i18n/I18n.js +10 -10
  378. package/dist/i18n/I18n.js.map +1 -1
  379. package/dist/i18n/en/ContractorPayment.ContractorPaymentCreatePayment.json.js +32 -0
  380. package/dist/i18n/en/ContractorPayment.ContractorPaymentCreatePayment.json.js.map +1 -0
  381. package/dist/i18n/en/ContractorPayment.ContractorPaymentDetail.json.js +24 -0
  382. package/dist/i18n/en/ContractorPayment.ContractorPaymentDetail.json.js.map +1 -0
  383. package/dist/i18n/en/ContractorPayment.ContractorPaymentOverview.json.js +32 -0
  384. package/dist/i18n/en/ContractorPayment.ContractorPaymentOverview.json.js.map +1 -0
  385. package/dist/i18n/en/ContractorPayment.ContractorPaymentPaymentHistory.json.js +32 -0
  386. package/dist/i18n/en/ContractorPayment.ContractorPaymentPaymentHistory.json.js.map +1 -0
  387. package/dist/i18n/en/Payroll.Common.json.js +8 -0
  388. package/dist/i18n/en/Payroll.Common.json.js.map +1 -0
  389. package/dist/i18n/en/Payroll.ConfirmWireDetailsForm.json.js +25 -5
  390. package/dist/i18n/en/Payroll.ConfirmWireDetailsForm.json.js.map +1 -1
  391. package/dist/i18n/en/Payroll.PayrollList.json.js +14 -16
  392. package/dist/i18n/en/Payroll.PayrollList.json.js.map +1 -1
  393. package/dist/i18n/en/Payroll.WireInstructions.json.js +22 -6
  394. package/dist/i18n/en/Payroll.WireInstructions.json.js.map +1 -1
  395. package/dist/shared/constants.d.ts +6 -0
  396. package/dist/shared/constants.js +15 -12
  397. package/dist/shared/constants.js.map +1 -1
  398. package/dist/style.css +1 -1
  399. package/dist/types/i18next.d.ts +183 -8
  400. package/package.json +13 -9
  401. package/dist/components/Employee/Deductions/DeductionsForm/UNSTABLE_DeductionsForm.d.ts +0 -7
  402. package/dist/components/Employee/Deductions/EmptyState/EmptyState.d.ts +0 -6
  403. package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.d.ts +0 -15
  404. package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.js +0 -48
  405. package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.js.map +0 -1
@@ -4,22 +4,24 @@ import "react-error-boundary";
4
4
  import "react-i18next";
5
5
  import "@gusto/embedded-api/models/errors/apierror";
6
6
  import "@gusto/embedded-api/models/errors/sdkvalidationerror";
7
- import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
8
7
  import "@tanstack/react-query";
9
8
  import "../../Base/useBase.js";
10
9
  import "../../../shared/constants.js";
10
+ import "classnames";
11
11
  import "../../../contexts/ComponentAdapter/useComponentContext.js";
12
+ import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
12
13
  import "dompurify";
14
+ import "../../../contexts/LocaleProvider/useLocale.js";
13
15
  import { createCompoundContext as t } from "../../Base/createCompoundContext.js";
14
- const [c, A] = t("IndustryItems", {
16
+ const [P, f] = t("IndustryItems", {
15
17
  items: []
16
- }), [P, f] = t("IndustryApi", {
18
+ }), [v, x] = t("IndustryApi", {
17
19
  isPending: !1
18
20
  });
19
21
  export {
20
- f as IndustryApiStateProvider,
21
- A as IndustryItemsProvider,
22
- P as useIndustryApiState,
23
- c as useIndustryItems
22
+ x as IndustryApiStateProvider,
23
+ f as IndustryItemsProvider,
24
+ v as useIndustryApiState,
25
+ P as useIndustryItems
24
26
  };
25
27
  //# sourceMappingURL=Context.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Context.js","sources":["../../../../src/components/Company/Industry/Context.ts"],"sourcesContent":["import { createCompoundContext } from '@/components/Base'\nimport type { ComboBoxOption } from '@/components/Common/UI/ComboBox/ComboBoxTypes'\n\nconst [useIndustryItems, IndustryItemsProvider] = createCompoundContext('IndustryItems', {\n items: [] as ComboBoxOption[],\n})\n\nconst [useIndustryApiState, IndustryApiStateProvider] = createCompoundContext('IndustryApi', {\n isPending: false,\n})\n\nexport { IndustryApiStateProvider, IndustryItemsProvider, useIndustryItems, useIndustryApiState }\n"],"names":["useIndustryItems","IndustryItemsProvider","createCompoundContext","useIndustryApiState","IndustryApiStateProvider"],"mappings":";;;;;;;;;;;;;AAGA,MAAM,CAACA,GAAkBC,CAAqB,IAAIC,EAAsB,iBAAiB;AAAA,EACvF,OAAO,CAAA;AACT,CAAC,GAEK,CAACC,GAAqBC,CAAwB,IAAIF,EAAsB,eAAe;AAAA,EAC3F,WAAW;AACb,CAAC;"}
1
+ {"version":3,"file":"Context.js","sources":["../../../../src/components/Company/Industry/Context.ts"],"sourcesContent":["import { createCompoundContext } from '@/components/Base'\nimport type { ComboBoxOption } from '@/components/Common/UI/ComboBox/ComboBoxTypes'\n\nconst [useIndustryItems, IndustryItemsProvider] = createCompoundContext('IndustryItems', {\n items: [] as ComboBoxOption[],\n})\n\nconst [useIndustryApiState, IndustryApiStateProvider] = createCompoundContext('IndustryApi', {\n isPending: false,\n})\n\nexport { IndustryApiStateProvider, IndustryItemsProvider, useIndustryItems, useIndustryApiState }\n"],"names":["useIndustryItems","IndustryItemsProvider","createCompoundContext","useIndustryApiState","IndustryApiStateProvider"],"mappings":";;;;;;;;;;;;;;;AAGA,MAAM,CAACA,GAAkBC,CAAqB,IAAIC,EAAsB,iBAAiB;AAAA,EACvF,OAAO,CAAA;AACT,CAAC,GAEK,CAACC,GAAqBC,CAAwB,IAAIF,EAAsB,eAAe;AAAA,EAC3F,WAAW;AACb,CAAC;"}
@@ -1,14 +1,18 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import { useTranslation as t } from "react-i18next";
3
- import { useIndustryItems as s } from "./Context.js";
4
- import { ComboBoxField as m } from "../../Common/Fields/ComboBoxField/ComboBoxField.js";
5
- const p = () => {
6
- const { t: o } = t("Company.Industry"), { items: e } = s();
7
- return /* @__PURE__ */ r(
8
- m,
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { useTranslation as e } from "react-i18next";
3
+ import { useIndustryItems as m } from "./Context.js";
4
+ import "../../../shared/constants.js";
5
+ import "classnames";
6
+ import "../../../contexts/ComponentAdapter/useComponentContext.js";
7
+ import "react";
8
+ import { ComboBoxField as i } from "../../Common/Fields/ComboBoxField/ComboBoxField.js";
9
+ const f = () => {
10
+ const { t: o } = e("Company.Industry"), { items: r } = m();
11
+ return /* @__PURE__ */ t(
12
+ i,
9
13
  {
10
14
  isRequired: !0,
11
- options: e,
15
+ options: r,
12
16
  label: o("label"),
13
17
  name: "naics_code",
14
18
  placeholder: o("placeholder")
@@ -16,6 +20,6 @@ const p = () => {
16
20
  );
17
21
  };
18
22
  export {
19
- p as Edit
23
+ f as Edit
20
24
  };
21
25
  //# sourceMappingURL=Edit.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Edit.js","sources":["../../../../src/components/Company/Industry/Edit.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useIndustryItems } from './Context'\nimport { ComboBoxField } from '@/components/Common'\n\nexport interface IndustryFormFields {\n naics_code: string\n}\n\nexport const Edit = () => {\n const { t } = useTranslation('Company.Industry')\n const { items } = useIndustryItems()\n\n return (\n <ComboBoxField\n isRequired\n options={items}\n label={t('label')}\n name=\"naics_code\"\n placeholder={t('placeholder')}\n />\n )\n}\n"],"names":["Edit","t","useTranslation","items","useIndustryItems","jsx","ComboBoxField"],"mappings":";;;;AAQO,MAAMA,IAAO,MAAM;AACxB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,kBAAkB,GACzC,EAAE,OAAAC,EAAA,IAAUC,EAAA;AAElB,SACE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,YAAU;AAAA,MACV,SAASH;AAAA,MACT,OAAOF,EAAE,OAAO;AAAA,MAChB,MAAK;AAAA,MACL,aAAaA,EAAE,aAAa;AAAA,IAAA;AAAA,EAAA;AAGlC;"}
1
+ {"version":3,"file":"Edit.js","sources":["../../../../src/components/Company/Industry/Edit.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useIndustryItems } from './Context'\nimport { ComboBoxField } from '@/components/Common'\n\nexport interface IndustryFormFields {\n naics_code: string\n}\n\nexport const Edit = () => {\n const { t } = useTranslation('Company.Industry')\n const { items } = useIndustryItems()\n\n return (\n <ComboBoxField\n isRequired\n options={items}\n label={t('label')}\n name=\"naics_code\"\n placeholder={t('placeholder')}\n />\n )\n}\n"],"names":["Edit","t","useTranslation","items","useIndustryItems","jsx","ComboBoxField"],"mappings":";;;;;;;;AAQO,MAAMA,IAAO,MAAM;AACxB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,kBAAkB,GACzC,EAAE,OAAAC,EAAA,IAAUC,EAAA;AAElB,SACE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,YAAU;AAAA,MACV,SAASH;AAAA,MACT,OAAOF,EAAE,OAAO;AAAA,MAChB,MAAK;AAAA,MACL,aAAaA,EAAE,aAAa;AAAA,IAAA;AAAA,EAAA;AAGlC;"}
@@ -1,16 +1,19 @@
1
- import { jsxs as r, jsx as n } from "react/jsx-runtime";
1
+ import { jsxs as s, jsx as n } from "react/jsx-runtime";
2
2
  import { useTranslation as a } from "react-i18next";
3
3
  import { useLocationsForm as e } from "./useLocationForm.js";
4
- import { ActionsLayout as c } from "../../../Common/ActionsLayout/ActionsLayout.js";
5
- import { useComponentContext as m } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
6
- const f = () => {
7
- const { t: o } = a("Company.Locations"), { handleCancel: i, isPending: s } = e(), t = m();
8
- return /* @__PURE__ */ r(c, { children: [
4
+ import "../../../../shared/constants.js";
5
+ import "classnames";
6
+ import { ActionsLayout as m } from "../../../Common/ActionsLayout/ActionsLayout.js";
7
+ import { useComponentContext as c } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
8
+ import "react";
9
+ const y = () => {
10
+ const { t: o } = a("Company.Locations"), { handleCancel: i, isPending: r } = e(), t = c();
11
+ return /* @__PURE__ */ s(m, { children: [
9
12
  /* @__PURE__ */ n(t.Button, { variant: "secondary", onClick: i, children: o("cancelCta") }),
10
- /* @__PURE__ */ n(t.Button, { type: "submit", isLoading: s, "data-testid": "location-submit", children: o("saveCta") })
13
+ /* @__PURE__ */ n(t.Button, { type: "submit", isLoading: r, "data-testid": "location-submit", children: o("saveCta") })
11
14
  ] });
12
15
  };
13
16
  export {
14
- f as Actions
17
+ y as Actions
15
18
  };
16
19
  //# sourceMappingURL=Actions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/Locations/LocationForm/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useLocationsForm } from './useLocationForm'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { t } = useTranslation('Company.Locations')\n const { handleCancel, isPending } = useLocationsForm()\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 type=\"submit\" isLoading={isPending} data-testid=\"location-submit\">\n {t('saveCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","t","useTranslation","handleCancel","isPending","useLocationsForm","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;;;AAKO,MAAMA,IAAU,MAAM;AAC3B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,mBAAmB,GAC1C,EAAE,cAAAC,GAAc,WAAAC,EAAA,IAAcC,EAAA,GAC9BC,IAAaC,EAAA;AAEnB,2BACGC,GAAA,EACC,UAAA;AAAA,IAAA,gBAAAC,EAACH,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASH,GAC7C,UAAAF,EAAE,WAAW,EAAA,CAChB;AAAA,IACA,gBAAAQ,EAACH,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWF,GAAW,eAAY,mBAChE,UAAAH,EAAE,SAAS,EAAA,CACd;AAAA,EAAA,GACF;AAEJ;"}
1
+ {"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/Locations/LocationForm/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useLocationsForm } from './useLocationForm'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { t } = useTranslation('Company.Locations')\n const { handleCancel, isPending } = useLocationsForm()\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 type=\"submit\" isLoading={isPending} data-testid=\"location-submit\">\n {t('saveCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","t","useTranslation","handleCancel","isPending","useLocationsForm","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;;;;;;AAKO,MAAMA,IAAU,MAAM;AAC3B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,mBAAmB,GAC1C,EAAE,cAAAC,GAAc,WAAAC,EAAA,IAAcC,EAAA,GAC9BC,IAAaC,EAAA;AAEnB,2BACGC,GAAA,EACC,UAAA;AAAA,IAAA,gBAAAC,EAACH,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASH,GAC7C,UAAAF,EAAE,WAAW,EAAA,CAChB;AAAA,IACA,gBAAAQ,EAACH,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWF,GAAW,eAAY,mBAChE,UAAAH,EAAE,SAAS,EAAA,CACd;AAAA,EAAA,GACF;AAEJ;"}
@@ -4,12 +4,14 @@ import { useTranslation as l } from "react-i18next";
4
4
  import { zipValidation as n, phoneValidation as m } from "../../../../helpers/validations.js";
5
5
  import { Flex as d } from "../../../Common/Flex/Flex.js";
6
6
  import { Grid as p } from "../../../Common/Grid/Grid.js";
7
+ import { TextInputField as s } from "../../../Common/Fields/TextInputField/TextInputField.js";
8
+ import "../../../../contexts/ComponentAdapter/useComponentContext.js";
9
+ import "react";
7
10
  import { STATES_ABBR as c } from "../../../../shared/constants.js";
8
11
  import { useMaskedTransform as u, commonMasks as b } from "../../../../helpers/mask.js";
9
- import { TextInputField as s } from "../../../Common/Fields/TextInputField/TextInputField.js";
10
12
  import { SelectField as f } from "../../../Common/Fields/SelectField/SelectField.js";
11
13
  import { CheckboxGroupField as g } from "../../../Common/Fields/CheckboxGroupField/CheckboxGroupField.js";
12
- const q = i.object({
14
+ const S = i.object({
13
15
  phoneNumber: m,
14
16
  street1: i.string().min(1),
15
17
  street2: i.string().optional(),
@@ -18,7 +20,7 @@ const q = i.object({
18
20
  zip: n,
19
21
  addressType: i.array(i.enum(["mailingAddress", "filingAddress"])).optional()
20
22
  });
21
- function k() {
23
+ function j() {
22
24
  const { t: e } = l("Company.Locations"), o = u(b.phoneMask);
23
25
  return /* @__PURE__ */ t(d, { flexDirection: "column", gap: 20, children: [
24
26
  /* @__PURE__ */ t(
@@ -104,7 +106,7 @@ function k() {
104
106
  ] });
105
107
  }
106
108
  export {
107
- k as Form,
108
- q as LocationFormSchema
109
+ j as Form,
110
+ S as LocationFormSchema
109
111
  };
110
112
  //# sourceMappingURL=Form.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Form.js","sources":["../../../../../src/components/Company/Locations/LocationForm/Form.tsx"],"sourcesContent":["import { z } from 'zod'\nimport { useTranslation } from 'react-i18next'\nimport { phoneValidation, zipValidation } from '@/helpers/validations'\nimport { CheckboxGroupField, Flex, Grid, SelectField, TextInputField } from '@/components/Common'\nimport { STATES_ABBR } from '@/shared/constants'\nimport { commonMasks, useMaskedTransform } from '@/helpers/mask'\n\nexport const LocationFormSchema = z.object({\n phoneNumber: phoneValidation,\n street1: z.string().min(1),\n street2: z.string().optional(),\n city: z.string().min(1),\n state: z.string().min(1),\n zip: zipValidation,\n addressType: z.array(z.enum(['mailingAddress', 'filingAddress'])).optional(),\n})\n\nexport type LocationFormInputs = z.infer<typeof LocationFormSchema>\n\nexport function Form() {\n const { t } = useTranslation('Company.Locations')\n const transform = useMaskedTransform(commonMasks.phoneMask)\n\n return (\n <Flex flexDirection=\"column\" gap={20}>\n <Grid\n gap={{ base: 20, small: 8 }}\n gridTemplateColumns={{ base: '1fr', small: ['1fr', '1fr'] }}\n >\n <TextInputField\n name=\"street1\"\n isRequired\n label={t('street1Label')}\n errorMessage={t('validations.street1')}\n />\n <TextInputField name=\"street2\" label={t('street2Label')} />\n <TextInputField\n name=\"city\"\n label={t('cityLabel')}\n isRequired\n errorMessage={t('validations.city')}\n />\n <SelectField\n name=\"state\"\n options={STATES_ABBR.map((stateAbbr: (typeof STATES_ABBR)[number]) => ({\n label: t(`statesHash.${stateAbbr}`, { ns: 'common' }),\n value: stateAbbr,\n }))}\n label={t('stateLabel')}\n placeholder={t('statePlaceholder')}\n errorMessage={t('validations.state')}\n isRequired\n />\n <TextInputField\n name=\"zip\"\n isRequired\n label={t('zipLabel')}\n errorMessage={t('validations.zip')}\n />\n <TextInputField\n name=\"phoneNumber\"\n isRequired\n label={t('phoneNumberLabel')}\n errorMessage={t('validations.phone')}\n transform={transform}\n />\n </Grid>\n <CheckboxGroupField\n name=\"addressType\"\n label={t('addressTypeLabel')}\n options={[\n {\n value: 'mailingAddress',\n label: t('mailingAddressLabel'),\n description: t('mailingAddressDescription'),\n },\n {\n value: 'filingAddress',\n label: t('filingAddressLabel'),\n description: t('filingAddressDescription'),\n },\n ]}\n />\n </Flex>\n )\n}\n"],"names":["LocationFormSchema","z","phoneValidation","zipValidation","Form","t","useTranslation","transform","useMaskedTransform","commonMasks","jsxs","Flex","Grid","jsx","TextInputField","SelectField","STATES_ABBR","stateAbbr","CheckboxGroupField"],"mappings":";;;;;;;;;;;AAOO,MAAMA,IAAqBC,EAAE,OAAO;AAAA,EACzC,aAAaC;AAAA,EACb,SAASD,EAAE,SAAS,IAAI,CAAC;AAAA,EACzB,SAASA,EAAE,OAAA,EAAS,SAAA;AAAA,EACpB,MAAMA,EAAE,SAAS,IAAI,CAAC;AAAA,EACtB,OAAOA,EAAE,SAAS,IAAI,CAAC;AAAA,EACvB,KAAKE;AAAA,EACL,aAAaF,EAAE,MAAMA,EAAE,KAAK,CAAC,kBAAkB,eAAe,CAAC,CAAC,EAAE,SAAA;AACpE,CAAC;AAIM,SAASG,IAAO;AACrB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,mBAAmB,GAC1CC,IAAYC,EAAmBC,EAAY,SAAS;AAE1D,SACE,gBAAAC,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,IAAA,gBAAAD;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,KAAK,EAAE,MAAM,IAAI,OAAO,EAAA;AAAA,QACxB,qBAAqB,EAAE,MAAM,OAAO,OAAO,CAAC,OAAO,KAAK,EAAA;AAAA,QAExD,UAAA;AAAA,UAAA,gBAAAC;AAAA,YAACC;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,YAAU;AAAA,cACV,OAAOT,EAAE,cAAc;AAAA,cACvB,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AA,UAAA;AAAA,UAE5C;AAAA,YACE,OAAO;AAAA,YACP,OAAOA,EAAE,oBAAoB;AAAA,YAC7B,aAAaA,EAAE,0BAA0B;AAAA,UAAA;AAAA,QAC3C;AAAA,MACF;AAAA,IAAA;AAAA,EACF,GACF;AAEJ;"}
1
+ {"version":3,"file":"Form.js","sources":["../../../../../src/components/Company/Locations/LocationForm/Form.tsx"],"sourcesContent":["import { z } from 'zod'\nimport { useTranslation } from 'react-i18next'\nimport { phoneValidation, zipValidation } from '@/helpers/validations'\nimport { CheckboxGroupField, Flex, Grid, SelectField, TextInputField } from '@/components/Common'\nimport { STATES_ABBR } from '@/shared/constants'\nimport { commonMasks, useMaskedTransform } from '@/helpers/mask'\n\nexport const LocationFormSchema = z.object({\n phoneNumber: phoneValidation,\n street1: z.string().min(1),\n street2: z.string().optional(),\n city: z.string().min(1),\n state: z.string().min(1),\n zip: zipValidation,\n addressType: z.array(z.enum(['mailingAddress', 'filingAddress'])).optional(),\n})\n\nexport type LocationFormInputs = z.infer<typeof LocationFormSchema>\n\nexport function Form() {\n const { t } = useTranslation('Company.Locations')\n const transform = useMaskedTransform(commonMasks.phoneMask)\n\n return (\n <Flex flexDirection=\"column\" gap={20}>\n <Grid\n gap={{ base: 20, small: 8 }}\n gridTemplateColumns={{ base: '1fr', small: ['1fr', '1fr'] }}\n >\n <TextInputField\n name=\"street1\"\n isRequired\n label={t('street1Label')}\n errorMessage={t('validations.street1')}\n />\n <TextInputField name=\"street2\" label={t('street2Label')} />\n <TextInputField\n name=\"city\"\n label={t('cityLabel')}\n isRequired\n errorMessage={t('validations.city')}\n />\n <SelectField\n name=\"state\"\n options={STATES_ABBR.map((stateAbbr: (typeof STATES_ABBR)[number]) => ({\n label: t(`statesHash.${stateAbbr}`, { ns: 'common' }),\n value: stateAbbr,\n }))}\n label={t('stateLabel')}\n placeholder={t('statePlaceholder')}\n errorMessage={t('validations.state')}\n isRequired\n />\n <TextInputField\n name=\"zip\"\n isRequired\n label={t('zipLabel')}\n errorMessage={t('validations.zip')}\n />\n <TextInputField\n name=\"phoneNumber\"\n isRequired\n label={t('phoneNumberLabel')}\n errorMessage={t('validations.phone')}\n transform={transform}\n />\n </Grid>\n <CheckboxGroupField\n name=\"addressType\"\n label={t('addressTypeLabel')}\n options={[\n {\n value: 'mailingAddress',\n label: t('mailingAddressLabel'),\n description: t('mailingAddressDescription'),\n },\n {\n value: 'filingAddress',\n label: t('filingAddressLabel'),\n description: t('filingAddressDescription'),\n },\n ]}\n />\n </Flex>\n )\n}\n"],"names":["LocationFormSchema","z","phoneValidation","zipValidation","Form","t","useTranslation","transform","useMaskedTransform","commonMasks","jsxs","Flex","Grid","jsx","TextInputField","SelectField","STATES_ABBR","stateAbbr","CheckboxGroupField"],"mappings":";;;;;;;;;;;;;AAOO,MAAMA,IAAqBC,EAAE,OAAO;AAAA,EACzC,aAAaC;AAAA,EACb,SAASD,EAAE,SAAS,IAAI,CAAC;AAAA,EACzB,SAASA,EAAE,OAAA,EAAS,SAAA;AAAA,EACpB,MAAMA,EAAE,SAAS,IAAI,CAAC;AAAA,EACtB,OAAOA,EAAE,SAAS,IAAI,CAAC;AAAA,EACvB,KAAKE;AAAA,EACL,aAAaF,EAAE,MAAMA,EAAE,KAAK,CAAC,kBAAkB,eAAe,CAAC,CAAC,EAAE,SAAA;AACpE,CAAC;AAIM,SAASG,IAAO;AACrB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,mBAAmB,GAC1CC,IAAYC,EAAmBC,EAAY,SAAS;AAE1D,SACE,gBAAAC,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,IAAA,gBAAAD;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,KAAK,EAAE,MAAM,IAAI,OAAO,EAAA;AAAA,QACxB,qBAAqB,EAAE,MAAM,OAAO,OAAO,CAAC,OAAO,KAAK,EAAA;AAAA,QAExD,UAAA;AAAA,UAAA,gBAAAC;AAAA,YAACC;AAAA,YAAA;AA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AO;AAAA,YACP,OAAOA,EAAE,qBAAqB;AAAA,YAC9B,aAAaA,EAAE,2BAA2B;AAAA,UAAA;AAAA,UAE5C;AAAA,YACE,OAAO;AAAA,YACP,OAAOA,EAAE,oBAAoB;AAAA,YAC7B,aAAaA,EAAE,0BAA0B;AAAA,UAAA;AAAA,QAC3C;AAAA,MACF;AAAA,IAAA;AAAA,EACF,GACF;AAEJ;"}
@@ -10,20 +10,24 @@ import { Actions as I } from "./Actions.js";
10
10
  import { LocationsFormProvider as M } from "./useLocationForm.js";
11
11
  import { Form as _ } from "../../../Common/Form/Form.js";
12
12
  import { Flex as w } from "../../../Common/Flex/Flex.js";
13
+ import "classnames";
14
+ import { componentEvents as a } from "../../../../shared/constants.js";
15
+ import "react-i18next";
16
+ import "../../../../contexts/ComponentAdapter/useComponentContext.js";
17
+ import "react";
13
18
  import { BaseComponent as z } from "../../../Base/Base.js";
14
19
  import { useBase as U } from "../../../Base/useBase.js";
15
20
  import { useI18n as j } from "../../../../i18n/I18n.js";
16
- import { componentEvents as a } from "../../../../shared/constants.js";
17
21
  function H(t) {
18
22
  const {
19
23
  data: { location: e }
20
24
  } = S({ locationId: t.locationId });
21
- return /* @__PURE__ */ o(p, { ...t, location: e });
25
+ return /* @__PURE__ */ o(u, { ...t, location: e });
22
26
  }
23
- function p({
27
+ function u({
24
28
  companyId: t,
25
29
  location: e,
26
- className: n,
30
+ className: i,
27
31
  children: r
28
32
  }) {
29
33
  j("Company.Locations");
@@ -36,13 +40,13 @@ function p({
36
40
  street2: e?.street2 ?? "",
37
41
  state: e?.state ?? "",
38
42
  zip: e?.zip ?? "",
39
- addressType: L.filter((i) => e?.[i] ?? !1)
43
+ addressType: L.filter((n) => e?.[n] ?? !1)
40
44
  }
41
45
  }), v = () => {
42
46
  s(a.CANCEL);
43
- }, C = async (i) => {
44
- await f(i, async (F) => {
45
- const { addressType: c, ...P } = F, u = {
47
+ }, C = async (n) => {
48
+ await f(n, async (F) => {
49
+ const { addressType: c, ...P } = F, p = {
46
50
  ...P,
47
51
  mailingAddress: c?.includes("mailingAddress"),
48
52
  filingAddress: c?.includes("filingAddress")
@@ -51,7 +55,7 @@ function p({
51
55
  const { location: m } = await g({
52
56
  request: {
53
57
  locationId: e.uuid,
54
- requestBody: { ...u, version: e.version }
58
+ requestBody: { ...p, version: e.version }
55
59
  }
56
60
  });
57
61
  s(a.COMPANY_LOCATION_UPDATED, m);
@@ -59,14 +63,14 @@ function p({
59
63
  const { location: m } = await l({
60
64
  request: {
61
65
  companyId: t,
62
- requestBody: u
66
+ requestBody: p
63
67
  }
64
68
  });
65
69
  s(a.COMPANY_LOCATION_CREATED, m);
66
70
  }
67
71
  });
68
72
  };
69
- return /* @__PURE__ */ o("section", { className: n, children: /* @__PURE__ */ o(E, { ...d, control: h, children: /* @__PURE__ */ o(_, { onSubmit: d.handleSubmit(C), children: /* @__PURE__ */ o(
73
+ return /* @__PURE__ */ o("section", { className: i, children: /* @__PURE__ */ o(E, { ...d, control: h, children: /* @__PURE__ */ o(_, { onSubmit: d.handleSubmit(C), children: /* @__PURE__ */ o(
70
74
  M,
71
75
  {
72
76
  value: { handleCancel: v, isPending: A || y },
@@ -78,16 +82,16 @@ function p({
78
82
  }
79
83
  ) }) }) });
80
84
  }
81
- function ne({
85
+ function de({
82
86
  companyId: t,
83
87
  locationId: e,
84
- className: n,
88
+ className: i,
85
89
  children: r,
86
90
  ...s
87
91
  }) {
88
- return /* @__PURE__ */ o(z, { ...s, children: e ? /* @__PURE__ */ o(H, { companyId: t, locationId: e, className: n, children: r }) : /* @__PURE__ */ o(p, { companyId: t, className: n, children: r }) });
92
+ return /* @__PURE__ */ o(z, { ...s, children: e ? /* @__PURE__ */ o(H, { companyId: t, locationId: e, className: i, children: r }) : /* @__PURE__ */ o(u, { companyId: t, className: i, children: r }) });
89
93
  }
90
94
  export {
91
- ne as LocationForm
95
+ de as LocationForm
92
96
  };
93
97
  //# sourceMappingURL=LocationForm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"LocationForm.js","sources":["../../../../../src/components/Company/Locations/LocationForm/LocationForm.tsx"],"sourcesContent":["import { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { useLocationsUpdateMutation } from '@gusto/embedded-api/react-query/locationsUpdate'\nimport { useLocationsRetrieveSuspense } from '@gusto/embedded-api/react-query/locationsRetrieve'\nimport { useLocationsCreateMutation } from '@gusto/embedded-api/react-query/locationsCreate'\nimport { type Location } from '@gusto/embedded-api/models/components/location'\nimport { Head } from './Head'\nimport type { LocationFormInputs } from './Form'\nimport { Form, LocationFormSchema } from './Form'\nimport { Actions } from './Actions'\nimport { LocationsFormProvider } from './useLocationForm'\nimport { Form as HtmlForm } from '@/components/Common/Form'\nimport { Flex } from '@/components/Common'\nimport type { BaseComponentInterface, CommonComponentInterface } from '@/components/Base'\nimport { BaseComponent, useBase } from '@/components/Base'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport type { WithRequired } from '@/types/Helpers'\n\ninterface LocationFormProps extends CommonComponentInterface {\n companyId: string\n locationId?: string\n}\n\n/**Accounting for conditional logic where location data needs to be fetched only if locationId is present */\nfunction RootWithLocation(props: WithRequired<LocationFormProps, 'locationId'>) {\n const {\n data: { location },\n } = useLocationsRetrieveSuspense({ locationId: props.locationId })\n return <Root {...props} location={location} />\n}\n\nfunction Root({\n companyId,\n location,\n className,\n children,\n}: LocationFormProps & { location?: Location }) {\n useI18n('Company.Locations')\n const { onEvent, baseSubmitHandler } = useBase()\n\n const { mutateAsync: createLocation, isPending: isPendingCreate } = useLocationsCreateMutation()\n const { mutateAsync: updateLocation, isPending: isPendingUpdate } = useLocationsUpdateMutation()\n const addressType = ['mailingAddress', 'filingAddress'] as const\n\n const { control, ...methods } = useForm<LocationFormInputs>({\n resolver: zodResolver(LocationFormSchema),\n defaultValues: {\n city: location?.city ?? '',\n phoneNumber: location?.phoneNumber ?? '',\n street1: location?.street1 ?? '',\n street2: location?.street2 ?? '',\n state: location?.state ?? '',\n zip: location?.zip ?? '',\n addressType: addressType.filter(key => location?.[key] ?? false),\n },\n })\n\n const handleCancel = () => {\n onEvent(componentEvents.CANCEL)\n }\n const onSubmit = async (data: LocationFormInputs) => {\n await baseSubmitHandler(data, async innerData => {\n const { addressType, ...payload } = innerData\n\n const requestBody = {\n ...payload,\n mailingAddress: addressType?.includes('mailingAddress'),\n filingAddress: addressType?.includes('filingAddress'),\n }\n\n if (location && location.version !== undefined) {\n // Edit existing location\n const { location: responseData } = await updateLocation({\n request: {\n locationId: location.uuid,\n requestBody: { ...requestBody, version: location.version },\n },\n })\n onEvent(componentEvents.COMPANY_LOCATION_UPDATED, responseData)\n } else {\n // Add new location\n const { location: responseData } = await createLocation({\n request: {\n companyId,\n requestBody,\n },\n })\n onEvent(componentEvents.COMPANY_LOCATION_CREATED, responseData)\n }\n })\n }\n\n return (\n <section className={className}>\n <FormProvider {...methods} control={control}>\n <HtmlForm onSubmit={methods.handleSubmit(onSubmit)}>\n <LocationsFormProvider\n value={{ handleCancel, isPending: isPendingCreate || isPendingUpdate }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <Form />\n <Actions />\n </>\n )}\n </Flex>\n </LocationsFormProvider>\n </HtmlForm>\n </FormProvider>\n </section>\n )\n}\n\nexport function LocationForm({\n companyId,\n locationId,\n className,\n children,\n ...props\n}: LocationFormProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n {locationId ? (\n <RootWithLocation companyId={companyId} locationId={locationId} className={className}>\n {children}\n </RootWithLocation>\n ) : (\n <Root companyId={companyId} className={className}>\n {children}\n </Root>\n )}\n </BaseComponent>\n )\n}\n"],"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;AAC9E,QAAM;AAAA,IACJ,MAAM,EAAE,UAAAC,EAAA;AAAA,EAAS,IACfC,EAA6B,EAAE,YAAYF,EAAM,YAAY;AACjE,SAAO,gBAAAG,EAACC,GAAA,EAAM,GAAGJ,GAAO,UAAAC,EAAA,CAAoB;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,EAAA,IAAsBC,EAAA,GAEjC,EAAE,aAAaC,GAAgB,WAAWC,EAAA,IAAoBC,EAAA,GAC9D,EAAE,aAAaC,GAAgB,WAAWC,EAAA,IAAoBC,EAAA,GAC9DC,IAAc,CAAC,kBAAkB,eAAe,GAEhD,EAAE,SAAAC,GAAS,GAAGC,EAAA,IAAYC,EAA4B;AAAA,IAC1D,UAAUC,EAAYC,CAAkB;AAAA,IACxC,eAAe;AAAA,MACb,MAAMtB,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,aAAaiB,EAAY,OAAO,OAAOjB,IAAWuB,CAAG,KAAK,EAAK;AAAA,IAAA;AAAA,EACjE,CACD,GAEKC,IAAe,MAAM;AACzB,IAAAhB,EAAQiB,EAAgB,MAAM;AAAA,EAChC,GACMC,IAAW,OAAOC,MAA6B;AACnD,UAAMlB,EAAkBkB,GAAM,OA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;AAAA,EAAA,EACF,CACF,GACF,GACF;AAEJ;AAEO,SAASC,GAAa;AAAA,EAC3B,WAAArC;AAAA,EACA,YAAAsC;AAAA,EACA,WAAArC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGP;AACL,GAA+C;AAC7C,2BACG4C,GAAA,EAAe,GAAG5C,GAChB,UAAA2C,sBACE5C,GAAA,EAAiB,WAAAM,GAAsB,YAAAsC,GAAwB,WAAArC,GAC7D,UAAAC,GACH,IAEA,gBAAAJ,EAACC,KAAK,WAAAC,GAAsB,WAAAC,GACzB,UAAAC,GACH,GAEJ;AAEJ;"}
1
+ {"version":3,"file":"LocationForm.js","sources":["../../../../../src/components/Company/Locations/LocationForm/LocationForm.tsx"],"sourcesContent":["import { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { useLocationsUpdateMutation } from '@gusto/embedded-api/react-query/locationsUpdate'\nimport { useLocationsRetrieveSuspense } from '@gusto/embedded-api/react-query/locationsRetrieve'\nimport { useLocationsCreateMutation } from '@gusto/embedded-api/react-query/locationsCreate'\nimport { type Location } from '@gusto/embedded-api/models/components/location'\nimport { Head } from './Head'\nimport type { LocationFormInputs } from './Form'\nimport { Form, LocationFormSchema } from './Form'\nimport { Actions } from './Actions'\nimport { LocationsFormProvider } from './useLocationForm'\nimport { Form as HtmlForm } from '@/components/Common/Form'\nimport { Flex } from '@/components/Common'\nimport type { BaseComponentInterface, CommonComponentInterface } from '@/components/Base'\nimport { BaseComponent, useBase } from '@/components/Base'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport type { WithRequired } from '@/types/Helpers'\n\ninterface LocationFormProps extends CommonComponentInterface {\n companyId: string\n locationId?: string\n}\n\n/**Accounting for conditional logic where location data needs to be fetched only if locationId is present */\nfunction RootWithLocation(props: WithRequired<LocationFormProps, 'locationId'>) {\n const {\n data: { location },\n } = useLocationsRetrieveSuspense({ locationId: props.locationId })\n return <Root {...props} location={location} />\n}\n\nfunction Root({\n companyId,\n location,\n className,\n children,\n}: LocationFormProps & { location?: Location }) {\n useI18n('Company.Locations')\n const { onEvent, baseSubmitHandler } = useBase()\n\n const { mutateAsync: createLocation, isPending: isPendingCreate } = useLocationsCreateMutation()\n const { mutateAsync: updateLocation, isPending: isPendingUpdate } = useLocationsUpdateMutation()\n const addressType = ['mailingAddress', 'filingAddress'] as const\n\n const { control, ...methods } = useForm<LocationFormInputs>({\n resolver: zodResolver(LocationFormSchema),\n defaultValues: {\n city: location?.city ?? '',\n phoneNumber: location?.phoneNumber ?? '',\n street1: location?.street1 ?? '',\n street2: location?.street2 ?? '',\n state: location?.state ?? '',\n zip: location?.zip ?? '',\n addressType: addressType.filter(key => location?.[key] ?? false),\n },\n })\n\n const handleCancel = () => {\n onEvent(componentEvents.CANCEL)\n }\n const onSubmit = async (data: LocationFormInputs) => {\n await baseSubmitHandler(data, async innerData => {\n const { addressType, ...payload } = innerData\n\n const requestBody = {\n ...payload,\n mailingAddress: addressType?.includes('mailingAddress'),\n filingAddress: addressType?.includes('filingAddress'),\n }\n\n if (location && location.version !== undefined) {\n // Edit existing location\n const { location: responseData } = await updateLocation({\n request: {\n locationId: location.uuid,\n requestBody: { ...requestBody, version: location.version },\n },\n })\n onEvent(componentEvents.COMPANY_LOCATION_UPDATED, responseData)\n } else {\n // Add new location\n const { location: responseData } = await createLocation({\n request: {\n companyId,\n requestBody,\n },\n })\n onEvent(componentEvents.COMPANY_LOCATION_CREATED, responseData)\n }\n })\n }\n\n return (\n <section className={className}>\n <FormProvider {...methods} control={control}>\n <HtmlForm onSubmit={methods.handleSubmit(onSubmit)}>\n <LocationsFormProvider\n value={{ handleCancel, isPending: isPendingCreate || isPendingUpdate }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <Form />\n <Actions />\n </>\n )}\n </Flex>\n </LocationsFormProvider>\n </HtmlForm>\n </FormProvider>\n </section>\n )\n}\n\nexport function LocationForm({\n companyId,\n locationId,\n className,\n children,\n ...props\n}: LocationFormProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n {locationId ? (\n <RootWithLocation companyId={companyId} locationId={locationId} className={className}>\n {children}\n </RootWithLocation>\n ) : (\n <Root companyId={companyId} className={className}>\n {children}\n </Root>\n )}\n </BaseComponent>\n )\n}\n"],"names":["RootWithLocation","props","location","useLocationsRetrieveSuspense","jsx","Root","companyId","className","children","useI18n","onEvent","baseSubmitHandler","useBase","createLocation","isPendingCreate","useLocationsCreateMutation","updateLocation","isPendingUpdate","useLocationsUpdateMutation","addressType","control","methods","useForm","zodResolver","LocationFormSchema","key","handleCancel","componentEvents","onSubmit","data","innerData","payload","requestBody","responseData","FormProvider","HtmlForm","LocationsFormProvider","Flex","jsxs","Fragment","Head","Form","Actions","LocationForm","locationId","BaseComponent"],"mappings":";;;;;;;;;;;;;;;;;;;;AAyBA,SAASA,EAAiBC,GAAsD;AAC9E,QAAM;AAAA,IACJ,MAAM,EAAE,UAAAC,EAAA;AAAA,EAAS,IACfC,EAA6B,EAAE,YAAYF,EAAM,YAAY;AACjE,SAAO,gBAAAG,EAACC,GAAA,EAAM,GAAGJ,GAAO,UAAAC,EAAA,CAAoB;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,EAAA,IAAsBC,EAAA,GAEjC,EAAE,aAAaC,GAAgB,WAAWC,EAAA,IAAoBC,EAAA,GAC9D,EAAE,aAAaC,GAAgB,WAAWC,EAAA,IAAoBC,EAAA,GAC9DC,IAAc,CAAC,kBAAkB,eAAe,GAEhD,EAAE,SAAAC,GAAS,GAAGC,EAAA,IAAYC,EAA4B;AAAA,IAC1D,UAAUC,EAAYC,CAAkB;AAAA,IACxC,eAAe;AAAA,MACb,MAAMtB,GA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Ud,EAAQ,aAAaO,CAAQ,GAC/C,UAAA,gBAAAxB;AAAA,IAACgC;AAAA,IAAA;AAAA,MACC,OAAO,EAAE,cAAAV,GAAc,WAAWZ,KAAmBG,EAAA;AAAA,MAErD,UAAA,gBAAAb,EAACiC,KAAK,eAAc,UAAS,KAAK,IAC/B,UAAA7B,KAGC,gBAAA8B,EAAAC,GAAA,EACE,UAAA;AAAA,QAAA,gBAAAnC,EAACoC,GAAA,EAAK;AAAA,0BACLC,GAAA,EAAK;AAAA,0BACLC,GAAA,CAAA,CAAQ;AAAA,MAAA,EAAA,CACX,EAAA,CAEJ;AAAA,IAAA;AAAA,EAAA,EACF,CACF,GACF,GACF;AAEJ;AAEO,SAASC,GAAa;AAAA,EAC3B,WAAArC;AAAA,EACA,YAAAsC;AAAA,EACA,WAAArC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGP;AACL,GAA+C;AAC7C,2BACG4C,GAAA,EAAe,GAAG5C,GAChB,UAAA2C,sBACE5C,GAAA,EAAiB,WAAAM,GAAsB,YAAAsC,GAAwB,WAAArC,GAC7D,UAAAC,GACH,IAEA,gBAAAJ,EAACC,KAAK,WAAAC,GAAsB,WAAAC,GACzB,UAAAC,GACH,GAEJ;AAEJ;"}
@@ -4,18 +4,20 @@ import "react-error-boundary";
4
4
  import "react-i18next";
5
5
  import "@gusto/embedded-api/models/errors/apierror";
6
6
  import "@gusto/embedded-api/models/errors/sdkvalidationerror";
7
- import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
8
7
  import "@tanstack/react-query";
9
8
  import "../../../Base/useBase.js";
10
9
  import "../../../../shared/constants.js";
10
+ import "classnames";
11
11
  import "../../../../contexts/ComponentAdapter/useComponentContext.js";
12
+ import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
12
13
  import "dompurify";
14
+ import "../../../../contexts/LocaleProvider/useLocale.js";
13
15
  import { createCompoundContext as o } from "../../../Base/createCompoundContext.js";
14
- const [F, d] = o(
16
+ const [L, f] = o(
15
17
  "CompanyDocumentFormContext"
16
18
  );
17
19
  export {
18
- d as LocationsFormProvider,
19
- F as useLocationsForm
20
+ f as LocationsFormProvider,
21
+ L as useLocationsForm
20
22
  };
21
23
  //# 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":";;;;;;;;;;;;;AAOA,MAAM,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":";;;;;;;;;;;;;;;AAOA,MAAM,CAACA,GAAkBC,CAAqB,IAAIC;AAAA,EAChD;AACF;"}
@@ -1,16 +1,19 @@
1
- import { jsxs as c, jsx as t } from "react/jsx-runtime";
1
+ import { jsxs as c, jsx as n } from "react/jsx-runtime";
2
2
  import { useTranslation as s } from "react-i18next";
3
3
  import { useLocationsList as a } from "./useLocationsList.js";
4
+ import "../../../../shared/constants.js";
5
+ import "classnames";
4
6
  import { ActionsLayout as e } from "../../../Common/ActionsLayout/ActionsLayout.js";
5
7
  import { useComponentContext as m } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
6
- function f() {
7
- const { t: o } = s("Company.Locations"), { handleAddLocation: i, handleContinue: r } = a(), n = m();
8
+ import "react";
9
+ function x() {
10
+ const { t: o } = s("Company.Locations"), { handleAddLocation: i, handleContinue: r } = a(), t = m();
8
11
  return /* @__PURE__ */ c(e, { children: [
9
- /* @__PURE__ */ t(n.Button, { variant: "secondary", onClick: i, children: o("addLocationCta") }),
10
- /* @__PURE__ */ t(n.Button, { onClick: r, children: o("continueCta") })
12
+ /* @__PURE__ */ n(t.Button, { variant: "secondary", onClick: i, children: o("addLocationCta") }),
13
+ /* @__PURE__ */ n(t.Button, { onClick: r, children: o("continueCta") })
11
14
  ] });
12
15
  }
13
16
  export {
14
- f as Actions
17
+ x as Actions
15
18
  };
16
19
  //# 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,EAAA,IAAmBC,EAAA,GACxCC,IAAaC,EAAA;AAEnB,2BACGC,GAAA,EACC,UAAA;AAAA,IAAA,gBAAAC,EAACH,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASH,GAC7C,UAAAF,EAAE,gBAAgB,EAAA,CACrB;AAAA,IACA,gBAAAQ,EAACH,EAAW,QAAX,EAAkB,SAASF,GAAiB,UAAAH,EAAE,aAAa,EAAA,CAAE;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,EAAA,IAAmBC,EAAA,GACxCC,IAAaC,EAAA;AAEnB,2BACGC,GAAA,EACC,UAAA;AAAA,IAAA,gBAAAC,EAACH,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASH,GAC7C,UAAAF,EAAE,gBAAgB,EAAA,CACrB;AAAA,IACA,gBAAAQ,EAACH,EAAW,QAAX,EAAkB,SAASF,GAAiB,UAAAH,EAAE,aAAa,EAAA,CAAE;AAAA,EAAA,GAChE;AAEJ;"}
@@ -2,23 +2,25 @@ import { jsx as t, Fragment as r, jsxs as n } from "react/jsx-runtime";
2
2
  import { useTranslation as P } from "react-i18next";
3
3
  import { useLocationsList as C } from "./useLocationsList.js";
4
4
  import y from "../../../../assets/icons/pencil.svg.js";
5
+ import "../../../../shared/constants.js";
6
+ import "classnames";
5
7
  import { EmptyData as b } from "../../../Common/EmptyData/EmptyData.js";
6
- import { useComponentContext as x } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
7
- import { getStreet as T, getCityStateZip as v } from "../../../../helpers/formattedStrings.js";
8
- import { VisuallyHidden as A } from "../../../Common/VisuallyHidden/VisuallyHidden.js";
9
- import { HamburgerMenu as k } from "../../../Common/HamburgerMenu/HamburgerMenu.js";
8
+ import { HamburgerMenu as x } from "../../../Common/HamburgerMenu/HamburgerMenu.js";
9
+ import { useComponentContext as T } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
10
+ import { getStreet as v, getCityStateZip as A } from "../../../../helpers/formattedStrings.js";
11
+ import { VisuallyHidden as k } from "../../../Common/VisuallyHidden/VisuallyHidden.js";
10
12
  import { useDataView as D } from "../../../Common/DataView/useDataView.js";
11
13
  import { DataView as S } from "../../../Common/DataView/DataView.js";
12
- const Z = () => {
13
- const a = x(), {
14
+ const G = () => {
15
+ const a = T(), {
14
16
  locationList: o,
15
17
  handleEditLocation: s,
16
18
  currentPage: d,
17
19
  totalPages: l,
18
20
  handleFirstPage: m,
19
21
  handleItemsPerPageChange: c,
20
- handleLastPage: g,
21
- handleNextPage: p,
22
+ handleLastPage: p,
23
+ handleNextPage: g,
22
24
  handlePreviousPage: u,
23
25
  handleAddLocation: h,
24
26
  itemsPerPage: f
@@ -29,13 +31,13 @@ const Z = () => {
29
31
  key: "name",
30
32
  title: e("locationListCol1"),
31
33
  render: (i) => /* @__PURE__ */ t(r, { children: /* @__PURE__ */ n("address", { children: [
32
- /* @__PURE__ */ t(a.Text, { as: "div", children: T(i) }),
33
- /* @__PURE__ */ t(a.Text, { as: "div", size: "sm", children: v(i) })
34
+ /* @__PURE__ */ t(a.Text, { as: "div", children: v(i) }),
35
+ /* @__PURE__ */ t(a.Text, { as: "div", size: "sm", children: A(i) })
34
36
  ] }) })
35
37
  },
36
38
  {
37
39
  key: "status",
38
- title: /* @__PURE__ */ t(A, { children: e("locationListCol2") }),
40
+ title: /* @__PURE__ */ t(k, { children: e("locationListCol2") }),
39
41
  render: (i) => /* @__PURE__ */ n(r, { children: [
40
42
  i.mailingAddress && /* @__PURE__ */ t(a.Badge, { status: "info", children: e("mailingAddress") }),
41
43
  i.filingAddress && /* @__PURE__ */ n(r, { children: [
@@ -46,7 +48,7 @@ const Z = () => {
46
48
  }
47
49
  ],
48
50
  itemMenu: (i) => /* @__PURE__ */ t(
49
- k,
51
+ x,
50
52
  {
51
53
  items: [
52
54
  {
@@ -63,9 +65,9 @@ const Z = () => {
63
65
  }
64
66
  ),
65
67
  pagination: {
66
- handleNextPage: p,
68
+ handleNextPage: g,
67
69
  handleFirstPage: m,
68
- handleLastPage: g,
70
+ handleLastPage: p,
69
71
  handlePreviousPage: u,
70
72
  handleItemsPerPageChange: c,
71
73
  currentPage: d,
@@ -77,6 +79,6 @@ const Z = () => {
77
79
  return /* @__PURE__ */ t(S, { label: e("locationListLabel"), ...L });
78
80
  };
79
81
  export {
80
- Z as List
82
+ G as List
81
83
  };
82
84
  //# 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 itemsPerPage,\n } = useLocationsList()\n\n const { t } = useTranslation('Company.Locations')\n const { ...dataViewProps } = useDataView({\n data: locationList,\n columns: [\n {\n key: 'name',\n title: t('locationListCol1'),\n render: location => {\n return (\n <>\n <address>\n <Components.Text as=\"div\">{getStreet(location)}</Components.Text>\n <Components.Text as=\"div\" size=\"sm\">\n {getCityStateZip(location)}\n </Components.Text>\n </address>\n </>\n )\n },\n },\n {\n key: 'status',\n title: <VisuallyHidden>{t('locationListCol2')}</VisuallyHidden>,\n render: location => {\n return (\n <>\n {location.mailingAddress && (\n <Components.Badge status={'info'}>{t('mailingAddress')}</Components.Badge>\n )}\n {location.filingAddress && (\n <>\n {' '}\n <Components.Badge status={'info'}>{t('filingAddress')}</Components.Badge>\n </>\n )}\n </>\n )\n },\n },\n ],\n itemMenu: location => {\n return (\n <HamburgerMenu\n items={[\n {\n label: t('editCta'),\n onClick: () => {\n handleEditLocation(location.uuid)\n },\n icon: <PencilSvg aria-hidden />,\n 'data-testid': 'edit-location',\n },\n ]}\n data-testid=\"location-hamburger\"\n triggerLabel={t('hamburgerTitle')}\n />\n )\n },\n pagination: {\n handleNextPage,\n handleFirstPage,\n handleLastPage,\n handlePreviousPage,\n handleItemsPerPageChange,\n currentPage,\n totalPages,\n itemsPerPage,\n },\n emptyState: () => (\n <EmptyData title={t('emptyTableTitle')} description={t('emptyTableDescription')}>\n <Components.Button variant=\"secondary\" onClick={handleAddLocation}>\n {t('addFirstLocationCta')}\n </Components.Button>\n </EmptyData>\n ),\n })\n return <DataView label={t('locationListLabel')} {...dataViewProps} />\n}\n"],"names":["List","Components","useComponentContext","locationList","handleEditLocation","currentPage","totalPages","handleFirstPage","handleItemsPerPageChange","handleLastPage","handleNextPage","handlePreviousPage","handleAddLocation","itemsPerPage","useLocationsList","t","useTranslation","dataViewProps","useDataView","location","jsx","Fragment","getStreet","getCityStateZip","VisuallyHidden","jsxs","HamburgerMenu","PencilSvg","EmptyData","DataView"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AAe,EAAA,CAAE;AAAA,UAAA,EAAA,CACxD;AAAA,QAAA,GAEJ;AAAA,MAEJ;AAAA,IACF;AAAA,IAEF,UAAU,CAAAI,MAEN,gBAAAC;AAAA,MAACM;AAAA,MAAA;AAAA,QACC,OAAO;AAAA,UACL;AAAA,YACE,OAAOX,EAAE,SAAS;AAAA,YAClB,SAAS,MAAM;AACb,cAAAX,EAAmBe,EAAS,IAAI;AAAA,YAClC;AAAA,YACA,MAAM,gBAAAC,EAACO,GAAA,EAAU,eAAW,GAAA,CAAC;AAAA,YAC7B,eAAe;AAAA,UAAA;AAAA,QACjB;AAAA,QAEF,eAAY;AAAA,QACZ,cAAcZ,EAAE,gBAAgB;AAAA,MAAA;AAAA,IAAA;AAAA,IAItC,YAAY;AAAA,MACV,gBAAAL;AAAA,MACA,iBAAAH;AAAA,MACA,gBAAAE;AAAA,MACA,oBAAAE;AAAA,MACA,0BAAAH;AAAA,MACA,aAAAH;AAAA,MACA,YAAAC;AAAA,MACA,cAAAO;AAAA,IAAA;AAAA,IAEF,YAAY,MACV,gBAAAO,EAACQ,GAAA,EAAU,OAAOb,EAAE,iBAAiB,GAAG,aAAaA,EAAE,uBAAuB,GAC5E,UAAA,gBAAAK,EAACnB,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASW,GAC7C,UAAAG,EAAE,qBAAqB,EAAA,CAC1B,EAAA,CACF;AAAA,EAAA,CAEH;AACD,2BAAQc,GAAA,EAAS,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 itemsPerPage,\n } = useLocationsList()\n\n const { t } = useTranslation('Company.Locations')\n const { ...dataViewProps } = useDataView({\n data: locationList,\n columns: [\n {\n key: 'name',\n title: t('locationListCol1'),\n render: location => {\n return (\n <>\n <address>\n <Components.Text as=\"div\">{getStreet(location)}</Components.Text>\n <Components.Text as=\"div\" size=\"sm\">\n {getCityStateZip(location)}\n </Components.Text>\n </address>\n </>\n )\n },\n },\n {\n key: 'status',\n title: <VisuallyHidden>{t('locationListCol2')}</VisuallyHidden>,\n render: location => {\n return (\n <>\n {location.mailingAddress && (\n <Components.Badge status={'info'}>{t('mailingAddress')}</Components.Badge>\n )}\n {location.filingAddress && (\n <>\n {' '}\n <Components.Badge status={'info'}>{t('filingAddress')}</Components.Badge>\n </>\n )}\n </>\n )\n },\n },\n ],\n itemMenu: location => {\n return (\n <HamburgerMenu\n items={[\n {\n label: t('editCta'),\n onClick: () => {\n handleEditLocation(location.uuid)\n },\n icon: <PencilSvg aria-hidden />,\n 'data-testid': 'edit-location',\n },\n ]}\n data-testid=\"location-hamburger\"\n triggerLabel={t('hamburgerTitle')}\n />\n )\n },\n pagination: {\n handleNextPage,\n handleFirstPage,\n handleLastPage,\n handlePreviousPage,\n handleItemsPerPageChange,\n currentPage,\n totalPages,\n itemsPerPage,\n },\n emptyState: () => (\n <EmptyData title={t('emptyTableTitle')} description={t('emptyTableDescription')}>\n <Components.Button variant=\"secondary\" onClick={handleAddLocation}>\n {t('addFirstLocationCta')}\n </Components.Button>\n </EmptyData>\n ),\n })\n return <DataView label={t('locationListLabel')} {...dataViewProps} />\n}\n"],"names":["List","Components","useComponentContext","locationList","handleEditLocation","currentPage","totalPages","handleFirstPage","handleItemsPerPageChange","handleLastPage","handleNextPage","handlePreviousPage","handleAddLocation","itemsPerPage","useLocationsList","t","useTranslation","dataViewProps","useDataView","location","jsx","Fragment","getStreet","getCityStateZip","VisuallyHidden","jsxs","HamburgerMenu","PencilSvg","EmptyData","DataView"],"mappings":";;;;;;;;;;;;;AASO,MAAMA,IAAO,MAAM;AACxB,QAAMC,IAAaC,EAAA,GACb;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,IACA,cAAAC;AAAA,EAAA,IACEC,EAAA,GAEE,EAAE,GAAAC,EAAA,IAAMC,EAAe,mBAAmB,GAC1C,EAAE,GAAGC,EAAA,IAAkBC,EAAY;AAAA,IACvC,MAAMf;AAAA,IACN,SAAS;AAAA,MACP;AAAA,QACE,KAAK;AAAA,QACL,OAAOY,EAAE,kBAAkB;AAAA,QAC3B,QAAQ,CAAAI,MAEJ,gBAAAC,EAAAC,GAAA,EACE,4BAAC,WAAA,EACC,UAAA;AAAA,UAAA,gBAAAD,EAACnB,EAAW,MAAX,EAAgB,IAAG,OAAO,UAAAqB,EAAUH,CAAQ,GAAE;AAAA,UAC/C,gBAAAC,EAACnB,EAAW,MAAX,EAAgB,IAAG,OAAM,MAAK,MAC5B,UAAAsB,EAAgBJ,CAAQ,EAAA,CAC3B;AAAA,QAAA,EAAA,CACF,EAAA,CACF;AAAA,MAEJ;AAAA,MAEF;AAAA,QACE,KAAK;AAAA,QACL,OAAO,gBAAAC,EAACI,GAAA,EAAgB,UAAAT,EAAE,kBAAkB,GAAE;AAAA,QAC9C,QAAQ,CAAAI,MAEJ,gBAAAM,EAAAJ,GAAA,EACG,UAAA;AAAA,UAAAF,EAAS,oCACPlB,EAAW,OAAX,EAAiB,QAA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{ useBase as E } from "../../../Base/useBase.js";
11
11
  import { Flex as I } from "../../../Common/Flex/Flex.js";
12
- import { companyEvents as s } from "../../../../shared/constants.js";
13
- function Q(o) {
12
+ import "classnames";
13
+ import { companyEvents as i } from "../../../../shared/constants.js";
14
+ import "react-i18next";
15
+ import "../../../../contexts/ComponentAdapter/useComponentContext.js";
16
+ function W(o) {
14
17
  return /* @__PURE__ */ e(x, { ...o, children: /* @__PURE__ */ e(v, { ...o, children: o.children }) });
15
18
  }
16
- function v({ companyId: o, className: l, children: i }) {
19
+ function v({ companyId: o, className: l, children: s }) {
17
20
  O("Company.Locations");
18
- const { onEvent: a } = E(), [c, n] = d(1), [m, h] = d(5), {
21
+ const { onEvent: a } = E(), [m, n] = d(1), [c, h] = d(5), {
19
22
  data: { locationList: P, httpMeta: g }
20
- } = L({ companyId: o, page: c, per: m }), r = Number(g.response.headers.get("x-total-pages") ?? 1);
23
+ } = L({ companyId: o, page: m, per: c }), r = Number(g.response.headers.get("x-total-pages") ?? 1);
21
24
  return /* @__PURE__ */ e("section", { className: l, children: /* @__PURE__ */ e(
22
25
  N,
23
26
  {
24
27
  value: {
25
28
  locationList: P ?? [],
26
- currentPage: c,
29
+ currentPage: m,
27
30
  totalPages: r,
28
31
  handleFirstPage: () => {
29
32
  n(1);
@@ -41,17 +44,17 @@ function v({ companyId: o, className: l, children: i }) {
41
44
  h(t);
42
45
  },
43
46
  handleAddLocation: () => {
44
- a(s.COMPANY_LOCATION_CREATE);
47
+ a(i.COMPANY_LOCATION_CREATE);
45
48
  },
46
49
  handleEditLocation: (t) => {
47
- a(s.COMPANY_LOCATION_EDIT, { uuid: t });
50
+ a(i.COMPANY_LOCATION_EDIT, { uuid: t });
48
51
  },
49
52
  handleContinue: () => {
50
- a(s.COMPANY_LOCATION_DONE);
53
+ a(i.COMPANY_LOCATION_DONE);
51
54
  },
52
- itemsPerPage: m
55
+ itemsPerPage: c
53
56
  },
54
- children: /* @__PURE__ */ e(I, { flexDirection: "column", gap: 32, children: i || /* @__PURE__ */ p(u, { children: [
57
+ children: /* @__PURE__ */ e(I, { flexDirection: "column", gap: 32, children: s || /* @__PURE__ */ p(u, { children: [
55
58
  /* @__PURE__ */ e(f, {}),
56
59
  /* @__PURE__ */ e(C, {}),
57
60
  /* @__PURE__ */ e(A, {})
@@ -60,6 +63,6 @@ function v({ companyId: o, className: l, children: i }) {
60
63
  ) });
61
64
  }
62
65
  export {
63
- Q as LocationsList
66
+ W as LocationsList
64
67
  };
65
68
  //# 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'\nimport type { PaginationItemsPerPage } from '@/components/Common/PaginationControl/PaginationControlTypes'\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<PaginationItemsPerPage>(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: PaginationItemsPerPage) => {\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 itemsPerPage,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <List />\n <Actions />\n </>\n )}\n </Flex>\n </LocationsListProvider>\n </section>\n )\n}\n"],"names":["LocationsList","props","jsx","BaseComponent","Root","companyId","className","children","useI18n","onEvent","useBase","currentPage","setCurrentPage","useState","itemsPerPage","setItemsPerPage","locationList","httpMeta","useLocationsGetSuspense","totalPages","LocationsListProvider","prevPage","newCount","companyEvents","uuid","Flex","jsxs","Fragment","Head","List","Actions"],"mappings":";;;;;;;;;;;;AAiBO,SAASA,EAAcC,GAA2B;AACvD,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,SAASG,EAAK,EAAE,WAAAC,GAAW,WAAAC,GAAW,UAAAC,KAAgC;AACpE,EAAAC,EAAQ,mBAAmB;AAC3B,QAAM,EAAE,SAAAC,EAAA,IAAYC,EAAA,GAEd,CAACC,GAAaC,CAAc,IAAIC,EAAS,CAAC,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AAmB,EAAAC,GAAA,EACE,UAAA;AAAA,QAAA,gBAAAzB,EAAC0B,GAAA,EAAK;AAAA,0BACLC,GAAA,EAAK;AAAA,0BACLC,GAAA,CAAA,CAAQ;AAAA,MAAA,EAAA,CACX,EAAA,CAEJ;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
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'\nimport type { PaginationItemsPerPage } from '@/components/Common/PaginationControl/PaginationControlTypes'\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<PaginationItemsPerPage>(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: PaginationItemsPerPage) => {\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 itemsPerPage,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <List />\n <Actions />\n </>\n )}\n </Flex>\n </LocationsListProvider>\n </section>\n )\n}\n"],"names":["LocationsList","props","jsx","BaseComponent","Root","companyId","className","children","useI18n","onEvent","useBase","currentPage","setCurrentPage","useState","itemsPerPage","setItemsPerPage","locationList","httpMeta","useLocationsGetSuspense","totalPages","LocationsListProvider","prevPage","newCount","companyEvents","uuid","Flex","jsxs","Fragment","Head","List","Actions"],"mappings":";;;;;;;;;;;;;;;AAiBO,SAASA,EAAcC,GAA2B;AACvD,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,SAASG,EAAK,EAAE,WAAAC,GAAW,WAAAC,GAAW,UAAAC,KAAgC;AACpE,EAAAC,EAAQ,mBAAmB;AAC3B,QAAM,EAAE,SAAAC,EAAA,IAAYC,EAAA,GAEd,CAACC,GAAaC,CAAc,IAAIC,EAAS,CAAC,GAC1C,CAACC,GAAcC,CAAe,IAAIF,EAAiC,CAAC,GAEpE;AAAA,IACJ,MAAM,EAAE,cAAAG,GAAc,UAAAC,EAAA;AAAA,EAAS,IAC7BC,EAAwB,EA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