@gusto/embedded-react-sdk 0.15.0 → 0.16.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 (311) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/dist/components/Base/Base.js +4 -4
  3. package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.d.ts +2 -0
  4. package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.js +52 -0
  5. package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.js.map +1 -0
  6. package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbsTypes.d.ts +44 -0
  7. package/dist/components/Common/FlowBreadcrumbs/index.d.ts +3 -0
  8. package/dist/components/Common/SignatureForm/SignatureForm.js +11 -14
  9. package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
  10. package/dist/components/Common/SignatureForm/SignatureFormActions.js +7 -9
  11. package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
  12. package/dist/components/Common/SignatureForm/SignatureFormFields.js +12 -15
  13. package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
  14. package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.d.ts +2 -0
  15. package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js +38 -0
  16. package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js.map +1 -0
  17. package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.module.scss.js +16 -0
  18. package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.module.scss.js.map +1 -0
  19. package/dist/components/Common/UI/Breadcrumbs/BreadcrumbsTypes.d.ts +27 -0
  20. package/dist/components/Common/UI/Breadcrumbs/index.d.ts +3 -0
  21. package/dist/components/Common/UI/ProgressBar/ProgressBar.js +4 -4
  22. package/dist/components/Company/AssignSignatory/AssignSignatory.js +6 -8
  23. package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
  24. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +2 -5
  25. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
  26. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +2 -4
  27. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
  28. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +7 -9
  29. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
  30. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +15 -16
  31. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
  32. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +4 -5
  33. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  34. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +2 -4
  35. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
  36. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +10 -12
  37. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
  38. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +9 -10
  39. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
  40. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +4 -5
  41. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  42. package/dist/components/Company/AssignSignatory/TitleSelect.js +3 -5
  43. package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
  44. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +6 -7
  45. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  46. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +9 -10
  47. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
  48. package/dist/components/Company/BankAccount/BankAccountForm/Form.js +8 -11
  49. package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
  50. package/dist/components/Company/BankAccount/BankAccountForm/context.js +4 -5
  51. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  52. package/dist/components/Company/BankAccount/BankAccountList/Actions.js +8 -10
  53. package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
  54. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +8 -10
  55. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
  56. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +4 -7
  57. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
  58. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +2 -4
  59. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
  60. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +9 -11
  61. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  62. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +4 -5
  63. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  64. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +8 -10
  65. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  66. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +4 -5
  67. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  68. package/dist/components/Company/FederalTaxes/Actions.js +7 -9
  69. package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
  70. package/dist/components/Company/FederalTaxes/FederalTaxes.js +3 -5
  71. package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
  72. package/dist/components/Company/FederalTaxes/Form.js +6 -7
  73. package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
  74. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +9 -10
  75. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  76. package/dist/components/Company/Industry/Actions.js +7 -9
  77. package/dist/components/Company/Industry/Actions.js.map +1 -1
  78. package/dist/components/Company/Industry/Context.js +7 -8
  79. package/dist/components/Company/Industry/Context.js.map +1 -1
  80. package/dist/components/Company/Industry/Edit.js +4 -7
  81. package/dist/components/Company/Industry/Edit.js.map +1 -1
  82. package/dist/components/Company/Locations/LocationForm/Actions.js +8 -10
  83. package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
  84. package/dist/components/Company/Locations/LocationForm/Form.js +5 -7
  85. package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
  86. package/dist/components/Company/Locations/LocationForm/LocationForm.js +10 -12
  87. package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
  88. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +4 -5
  89. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  90. package/dist/components/Company/Locations/LocationsList/Actions.js +6 -8
  91. package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
  92. package/dist/components/Company/Locations/LocationsList/List.js +15 -16
  93. package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
  94. package/dist/components/Company/Locations/LocationsList/LocationsList.js +3 -4
  95. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  96. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +4 -5
  97. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  98. package/dist/components/Company/OnboardingFlow/OnboardingFlow.js +10 -10
  99. package/dist/components/Company/OnboardingFlow/OnboardingFlow.js.map +1 -1
  100. package/dist/components/Company/OnboardingFlow/onboardingStateMachine.js +16 -10
  101. package/dist/components/Company/OnboardingFlow/onboardingStateMachine.js.map +1 -1
  102. package/dist/components/Company/OnboardingOverview/Completed.js +10 -12
  103. package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
  104. package/dist/components/Company/OnboardingOverview/MissingRequirements.js +9 -11
  105. package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
  106. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +7 -9
  107. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
  108. package/dist/components/Company/OnboardingOverview/context.js +4 -5
  109. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  110. package/dist/components/Company/PaySchedule/PaySchedule.js +4 -5
  111. package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
  112. package/dist/components/Company/PaySchedule/_parts/Actions.js +9 -11
  113. package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
  114. package/dist/components/Company/PaySchedule/_parts/Edit.js +17 -17
  115. package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
  116. package/dist/components/Company/PaySchedule/_parts/Head.js +9 -11
  117. package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
  118. package/dist/components/Company/PaySchedule/_parts/List.js +17 -18
  119. package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
  120. package/dist/components/Company/PaySchedule/usePaySchedule.js +6 -7
  121. package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
  122. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +2 -4
  123. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
  124. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +4 -5
  125. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  126. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +2 -4
  127. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
  128. package/dist/components/Company/StateTaxes/StateTaxesList/List.js +2 -4
  129. package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
  130. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +4 -5
  131. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  132. package/dist/components/Contractor/Address/Address.js +5 -7
  133. package/dist/components/Contractor/Address/Address.js.map +1 -1
  134. package/dist/components/Contractor/Address/Form.js +7 -9
  135. package/dist/components/Contractor/Address/Form.js.map +1 -1
  136. package/dist/components/Contractor/Address/useAddress.js +6 -7
  137. package/dist/components/Contractor/Address/useAddress.js.map +1 -1
  138. package/dist/components/Contractor/ContractorList/index.js +15 -15
  139. package/dist/components/Contractor/OnboardingFlow/onboardingStateMachine.js +37 -37
  140. package/dist/components/Contractor/OnboardingFlow/onboardingStateMachine.js.map +1 -1
  141. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +10 -13
  142. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
  143. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +2 -4
  144. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
  145. package/dist/components/Contractor/Profile/ContractorProfileForm.js +15 -15
  146. package/dist/components/Contractor/Profile/useContractorProfile.js +3 -4
  147. package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
  148. package/dist/components/Contractor/Submit/Submit.js +20 -21
  149. package/dist/components/Contractor/Submit/Submit.js.map +1 -1
  150. package/dist/components/Employee/Compensation/Actions.js +12 -13
  151. package/dist/components/Employee/Compensation/Actions.js.map +1 -1
  152. package/dist/components/Employee/Compensation/Edit.js +14 -14
  153. package/dist/components/Employee/Compensation/List.js +22 -23
  154. package/dist/components/Employee/Compensation/List.js.map +1 -1
  155. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +10 -11
  156. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
  157. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +32 -33
  158. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
  159. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js +8 -8
  160. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +11 -11
  161. package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.js +22 -23
  162. package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.js.map +1 -1
  163. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +6 -8
  164. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
  165. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +3 -5
  166. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  167. package/dist/components/Employee/DocumentSigner/DocumentList/List.js +2 -5
  168. package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
  169. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +4 -5
  170. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  171. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +3 -5
  172. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  173. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +4 -5
  174. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  175. package/dist/components/Employee/EmployeeList/Actions.js +6 -8
  176. package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
  177. package/dist/components/Employee/EmployeeList/EmployeeList.js +3 -6
  178. package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
  179. package/dist/components/Employee/EmployeeList/Head.js +5 -7
  180. package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
  181. package/dist/components/Employee/EmployeeList/List.js +14 -14
  182. package/dist/components/Employee/EmployeeList/useEmployeeList.js +4 -5
  183. package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
  184. package/dist/components/Employee/FederalTaxes/Actions.js +7 -9
  185. package/dist/components/Employee/FederalTaxes/Actions.js.map +1 -1
  186. package/dist/components/Employee/FederalTaxes/FederalForm.js +11 -13
  187. package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
  188. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +4 -5
  189. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
  190. package/dist/components/Employee/Landing/Landing.js +10 -11
  191. package/dist/components/Employee/Landing/Landing.js.map +1 -1
  192. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +7 -7
  193. package/dist/components/Employee/PaymentMethod/Actions.js +6 -8
  194. package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
  195. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +3 -5
  196. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
  197. package/dist/components/Employee/PaymentMethod/BankAccountsList.js +11 -12
  198. package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
  199. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +2 -4
  200. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
  201. package/dist/components/Employee/PaymentMethod/Split.js +7 -7
  202. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +6 -7
  203. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
  204. package/dist/components/Employee/Profile/Actions.js +7 -9
  205. package/dist/components/Employee/Profile/Actions.js.map +1 -1
  206. package/dist/components/Employee/Profile/AdminPersonalDetails.js +6 -7
  207. package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
  208. package/dist/components/Employee/Profile/HomeAddress.js +5 -6
  209. package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
  210. package/dist/components/Employee/Profile/PersonalDetailsInputs.js +23 -25
  211. package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
  212. package/dist/components/Employee/Profile/useProfile.js +4 -5
  213. package/dist/components/Employee/Profile/useProfile.js.map +1 -1
  214. package/dist/components/Employee/StateTaxes/Actions.js +8 -10
  215. package/dist/components/Employee/StateTaxes/Actions.js.map +1 -1
  216. package/dist/components/Employee/StateTaxes/useStateTaxes.js +4 -5
  217. package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
  218. package/dist/components/Employee/Taxes/Actions.js +8 -10
  219. package/dist/components/Employee/Taxes/Actions.js.map +1 -1
  220. package/dist/components/Employee/Taxes/FederalForm.js +12 -14
  221. package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
  222. package/dist/components/Employee/Taxes/useTaxes.js +4 -5
  223. package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
  224. package/dist/components/Flow/Flow.js +44 -24
  225. package/dist/components/Flow/Flow.js.map +1 -1
  226. package/dist/components/Flow/useFlow.d.ts +10 -1
  227. package/dist/components/Flow/useFlow.js.map +1 -1
  228. package/dist/components/Payroll/PayrollBlocker/PayrollBlocker.d.ts +1 -1
  229. package/dist/components/Payroll/PayrollBlocker/PayrollBlocker.js +16 -16
  230. package/dist/components/Payroll/PayrollBlocker/PayrollBlocker.js.map +1 -1
  231. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +20 -22
  232. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
  233. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +17 -19
  234. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js.map +1 -1
  235. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +38 -34
  236. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
  237. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +14 -14
  238. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
  239. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js +39 -40
  240. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js.map +1 -1
  241. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +27 -27
  242. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +8 -9
  243. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
  244. package/dist/components/Payroll/PayrollFlow/PayrollFlow.d.ts +1 -1
  245. package/dist/components/Payroll/PayrollFlow/PayrollFlow.js +20 -19
  246. package/dist/components/Payroll/PayrollFlow/PayrollFlow.js.map +1 -1
  247. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.d.ts +5 -3
  248. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js +65 -45
  249. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js.map +1 -1
  250. package/dist/components/Payroll/PayrollFlow/index.d.ts +1 -1
  251. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.d.ts +2 -0
  252. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js +233 -96
  253. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js.map +1 -1
  254. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +12 -13
  255. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
  256. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js +8 -9
  257. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js.map +1 -1
  258. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +14 -15
  259. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
  260. package/dist/components/Payroll/PayrollOverview/PayrollOverview.d.ts +1 -2
  261. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +41 -45
  262. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
  263. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.d.ts +1 -2
  264. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +94 -96
  265. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
  266. package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.d.ts +1 -2
  267. package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.js +12 -26
  268. package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.js.map +1 -1
  269. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.d.ts +1 -2
  270. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +40 -45
  271. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
  272. package/dist/components/Payroll/usePreparedPayrollData.js +3 -4
  273. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  274. package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js +41 -39
  275. package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js.map +1 -1
  276. package/dist/contexts/ComponentAdapter/componentAdapterTypes.d.ts +1 -0
  277. package/dist/contexts/ComponentAdapter/useComponentContext.d.ts +2 -0
  278. package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
  279. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +2 -4
  280. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  281. package/dist/helpers/breadcrumbHelpers.d.ts +33 -0
  282. package/dist/helpers/breadcrumbHelpers.js +46 -0
  283. package/dist/helpers/breadcrumbHelpers.js.map +1 -0
  284. package/dist/helpers/breadcrumbHelpers.test.d.ts +1 -0
  285. package/dist/i18n/I18n.d.ts +1 -1
  286. package/dist/i18n/I18n.js +32 -23
  287. package/dist/i18n/I18n.js.map +1 -1
  288. package/dist/i18n/en/Company.PaySchedule.json.js +2 -2
  289. package/dist/i18n/en/Payroll.PayrollBlocker.json.js +28 -0
  290. package/dist/i18n/en/Payroll.PayrollBlocker.json.js.map +1 -0
  291. package/dist/i18n/en/Payroll.PayrollConfiguration.json.js +28 -24
  292. package/dist/i18n/en/Payroll.PayrollConfiguration.json.js.map +1 -1
  293. package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js +28 -26
  294. package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js.map +1 -1
  295. package/dist/i18n/en/Payroll.PayrollFlow.json.js +8 -0
  296. package/dist/i18n/en/Payroll.PayrollFlow.json.js.map +1 -0
  297. package/dist/i18n/en/Payroll.PayrollLanding.json.js +2 -2
  298. package/dist/i18n/en/Payroll.PayrollOverview.json.js +60 -56
  299. package/dist/i18n/en/Payroll.PayrollOverview.json.js.map +1 -1
  300. package/dist/i18n/en/Payroll.PayrollReceipts.json.js +16 -12
  301. package/dist/i18n/en/Payroll.PayrollReceipts.json.js.map +1 -1
  302. package/dist/shared/constants.d.ts +3 -0
  303. package/dist/shared/constants.js +11 -9
  304. package/dist/shared/constants.js.map +1 -1
  305. package/dist/style.css +1 -1
  306. package/dist/types/i18next.d.ts +156 -149
  307. package/package.json +8 -8
  308. package/dist/i18n/en/Payroll.RunPayroll.json.js +0 -8
  309. package/dist/i18n/en/Payroll.RunPayroll.json.js.map +0 -1
  310. package/dist/i18n/en/PayrollBlocker.json.js +0 -24
  311. package/dist/i18n/en/PayrollBlocker.json.js.map +0 -1
@@ -5,13 +5,12 @@ import { TaxPayerType as _, FilingForm as y } from "@gusto/embedded-api/models/o
5
5
  import { useFederalTaxes as u } from "./useFederalTaxes.js";
6
6
  import { Flex as b } from "../../Common/Flex/Flex.js";
7
7
  import "classnames";
8
- import "../../../shared/constants.js";
8
+ import { usePlaceholderEin as g, normalizeEin as x } from "../../../helpers/federalEin.js";
9
+ import { useComponentContext as F } from "../../../contexts/ComponentAdapter/useComponentContext.js";
9
10
  import { TextInputField as l } from "../../Common/Fields/TextInputField/TextInputField.js";
10
- import { useComponentContext as g } from "../../../contexts/ComponentAdapter/useComponentContext.js";
11
- import { usePlaceholderEin as x, normalizeEin as F } from "../../../helpers/federalEin.js";
12
11
  import { SelectField as a } from "../../Common/Fields/SelectField/SelectField.js";
13
- function v() {
14
- const { t: e } = c("Company.FederalTaxes"), { federalTaxDetails: s } = u(), i = g(), m = x(s?.hasEin), p = n(
12
+ function R() {
13
+ const { t: e } = c("Company.FederalTaxes"), { federalTaxDetails: s } = u(), i = F(), m = g(s?.hasEin), p = n(
15
14
  () => Object.values(_).map((o) => ({
16
15
  value: o,
17
16
  label: e(`taxPayerType.${o}`)
@@ -48,7 +47,7 @@ function v() {
48
47
  }
49
48
  ),
50
49
  isRequired: !0,
51
- transform: F,
50
+ transform: x,
52
51
  placeholder: m
53
52
  }
54
53
  ),
@@ -101,6 +100,6 @@ function v() {
101
100
  ] });
102
101
  }
103
102
  export {
104
- v as Form
103
+ R as Form
105
104
  };
106
105
  //# sourceMappingURL=Form.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Form.js","sources":["../../../../src/components/Company/FederalTaxes/Form.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { useTranslation, Trans } from 'react-i18next'\nimport {\n TaxPayerType,\n FilingForm,\n} from '@gusto/embedded-api/models/operations/putv1companiescompanyidfederaltaxdetails'\nimport { useFederalTaxes } from './useFederalTaxes'\nimport { TextInputField, SelectField, Flex } from '@/components/Common'\nimport { usePlaceholderEin, normalizeEin } from '@/helpers/federalEin'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Form() {\n const { t } = useTranslation('Company.FederalTaxes')\n const { federalTaxDetails } = useFederalTaxes()\n const Components = useComponentContext()\n\n const placeholderEin = usePlaceholderEin(federalTaxDetails?.hasEin)\n\n const taxPayerTypeOptions = useMemo(\n () =>\n Object.values(TaxPayerType).map(value => ({\n value: value,\n label: t(`taxPayerType.${value}`),\n })),\n [t],\n )\n\n const filingFormOptions = useMemo(\n () =>\n Object.values(FilingForm).map(value => ({\n value: value,\n label: t(`filingForm.${value}`),\n })),\n [t],\n )\n\n return (\n <Flex flexDirection=\"column\" gap={28}>\n <TextInputField\n name=\"federalEin\"\n label={t('federal_ein_label')}\n description={\n <Trans\n t={t}\n i18nKey=\"federal_ein_description\"\n components={{\n applyLink: (\n <Components.Link\n href=\"https://www.irs.gov/businesses/employer-identification-number\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n />\n ),\n }}\n />\n }\n isRequired\n transform={normalizeEin}\n placeholder={placeholderEin}\n />\n <SelectField\n name=\"taxPayerType\"\n label={t('taxpayer_type_label')}\n description={t('taxpayer_type_description')}\n options={taxPayerTypeOptions}\n isRequired\n />\n <SelectField\n name=\"filingForm\"\n label={t('federal_filing_form_label')}\n description={\n <Trans\n t={t}\n i18nKey=\"federal_filing_form_description\"\n components={{\n irsLink: (\n <Components.Link\n href=\"https://www.irs.gov/newsroom/employers-should-you-file-form-944-or-941\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n />\n ),\n }}\n />\n }\n options={filingFormOptions}\n isRequired\n />\n <TextInputField\n name=\"legalName\"\n label={t('legal_entity_name_label')}\n description={t('legal_entity_name_description')}\n isRequired\n errorMessage={t('legal_entity_name_error')}\n />\n </Flex>\n )\n}\n"],"names":["Form","t","useTranslation","federalTaxDetails","useFederalTaxes","Components","useComponentContext","placeholderEin","usePlaceholderEin","taxPayerTypeOptions","useMemo","TaxPayerType","value","filingFormOptions","FilingForm","jsxs","Flex","jsx","TextInputField","Trans","normalizeEin","SelectField"],"mappings":";;;;;;;;;;;;AAWO,SAASA,IAAO;AACrB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,sBAAsB,GAC7C,EAAE,mBAAAC,EAAA,IAAsBC,EAAA,GACxBC,IAAaC,EAAA,GAEbC,IAAiBC,EAAkBL,GAAmB,MAAM,GAE5DM,IAAsBC;AAAA,IAC1B,MACE,OAAO,OAAOC,CAAY,EAAE,IAAI,CAAAC,OAAU;AAAA,MACxC,OAAAA;AAAA,MACA,OAAOX,EAAE,gBAAgBW,CAAK,EAAE;AAAA,IAAA,EAChC;AAAA,IACJ,CAACX,CAAC;AAAA,EAAA,GAGEY,IAAoBH;AAAA,IACxB,MACE,OAAO,OAAOI,CAAU,EAAE,IAAI,CAAAF,OAAU;AAAA,MACtC,OAAAA;AAAA,MACA,OAAOX,EAAE,cAAcW,CA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AAAI;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOjB,EAAE,yBAAyB;AAAA,QAClC,aAAaA,EAAE,+BAA+B;AAAA,QAC9C,YAAU;AAAA,QACV,cAAcA,EAAE,yBAAyB;AAAA,MAAA;AAAA,IAAA;AAAA,EAC3C,GACF;AAEJ;"}
1
+ {"version":3,"file":"Form.js","sources":["../../../../src/components/Company/FederalTaxes/Form.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { useTranslation, Trans } from 'react-i18next'\nimport {\n TaxPayerType,\n FilingForm,\n} from '@gusto/embedded-api/models/operations/putv1companiescompanyidfederaltaxdetails'\nimport { useFederalTaxes } from './useFederalTaxes'\nimport { TextInputField, SelectField, Flex } from '@/components/Common'\nimport { usePlaceholderEin, normalizeEin } from '@/helpers/federalEin'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Form() {\n const { t } = useTranslation('Company.FederalTaxes')\n const { federalTaxDetails } = useFederalTaxes()\n const Components = useComponentContext()\n\n const placeholderEin = usePlaceholderEin(federalTaxDetails?.hasEin)\n\n const taxPayerTypeOptions = useMemo(\n () =>\n Object.values(TaxPayerType).map(value => ({\n value: value,\n label: t(`taxPayerType.${value}`),\n })),\n [t],\n )\n\n const filingFormOptions = useMemo(\n () =>\n Object.values(FilingForm).map(value => ({\n value: value,\n label: t(`filingForm.${value}`),\n })),\n [t],\n )\n\n return (\n <Flex flexDirection=\"column\" gap={28}>\n <TextInputField\n name=\"federalEin\"\n label={t('federal_ein_label')}\n description={\n <Trans\n t={t}\n i18nKey=\"federal_ein_description\"\n components={{\n applyLink: (\n <Components.Link\n href=\"https://www.irs.gov/businesses/employer-identification-number\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n />\n ),\n }}\n />\n }\n isRequired\n transform={normalizeEin}\n placeholder={placeholderEin}\n />\n <SelectField\n name=\"taxPayerType\"\n label={t('taxpayer_type_label')}\n description={t('taxpayer_type_description')}\n options={taxPayerTypeOptions}\n isRequired\n />\n <SelectField\n name=\"filingForm\"\n label={t('federal_filing_form_label')}\n description={\n <Trans\n t={t}\n i18nKey=\"federal_filing_form_description\"\n components={{\n irsLink: (\n <Components.Link\n href=\"https://www.irs.gov/newsroom/employers-should-you-file-form-944-or-941\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n />\n ),\n }}\n />\n }\n options={filingFormOptions}\n isRequired\n />\n <TextInputField\n name=\"legalName\"\n label={t('legal_entity_name_label')}\n description={t('legal_entity_name_description')}\n isRequired\n errorMessage={t('legal_entity_name_error')}\n />\n </Flex>\n )\n}\n"],"names":["Form","t","useTranslation","federalTaxDetails","useFederalTaxes","Components","useComponentContext","placeholderEin","usePlaceholderEin","taxPayerTypeOptions","useMemo","TaxPayerType","value","filingFormOptions","FilingForm","jsxs","Flex","jsx","TextInputField","Trans","normalizeEin","SelectField"],"mappings":";;;;;;;;;;;AAWO,SAASA,IAAO;AACrB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,sBAAsB,GAC7C,EAAE,mBAAAC,EAAA,IAAsBC,EAAA,GACxBC,IAAaC,EAAA,GAEbC,IAAiBC,EAAkBL,GAAmB,MAAM,GAE5DM,IAAsBC;AAAA,IAC1B,MACE,OAAO,OAAOC,CAAY,EAAE,IAAI,CAAAC,OAAU;AAAA,MACxC,OAAAA;AAAA,MACA,OAAOX,EAAE,gBAAgBW,CAAK,EAAE;AAAA,IAAA,EAChC;AAAA,IACJ,CAACX,CAAC;AAAA,EAAA,GAGEY,IAAoBH;AAAA,IACxB,MACE,OAAO,OAAOI,CAAU,EAAE,IAAI,CAAAF,OAAU;AAAA,MACtC,OAAAA;AAAA,MACA,OAAOX,EAAE,cAAcW,CAAK,EAAE;AAAA,IAAA,EAC9B;AAAA,IACJ,CAACX,CAAC;AAAA,EAAA;AAGJ,SACE,gBAAAc,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAAC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B;AAAA,MAAA;AAAA,IAAA;AAAA,EAC3C,GACF;AAEJ;"}
@@ -1,5 +1,5 @@
1
1
  import { z as o } from "zod";
2
- import { FilingForm as r, TaxPayerType as t } from "@gusto/embedded-api/models/operations/putv1companiescompanyidfederaltaxdetails";
2
+ import { FilingForm as r, TaxPayerType as e } from "@gusto/embedded-api/models/operations/putv1companiescompanyidfederaltaxdetails";
3
3
  import "react/jsx-runtime";
4
4
  import "react";
5
5
  import "react-error-boundary";
@@ -11,22 +11,21 @@ import "@tanstack/react-query";
11
11
  import "../../Base/useBase.js";
12
12
  import "../../../shared/constants.js";
13
13
  import "classnames";
14
- import "../../../contexts/ComponentAdapter/useComponentContext.js";
15
14
  import "dompurify";
16
15
  import "../../../contexts/LocaleProvider/useLocale.js";
17
- import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
18
- import { createCompoundContext as e } from "../../Base/createCompoundContext.js";
19
- const j = o.object({
16
+ import "../../../contexts/ComponentAdapter/useComponentContext.js";
17
+ import { createCompoundContext as t } from "../../Base/createCompoundContext.js";
18
+ const b = o.object({
20
19
  federalEin: o.string().optional(),
21
- taxPayerType: o.enum(Object.values(t)).optional(),
20
+ taxPayerType: o.enum(Object.values(e)).optional(),
22
21
  filingForm: o.enum(Object.values(r)).optional(),
23
22
  legalName: o.string().min(1)
24
- }), [v, P] = e(
23
+ }), [j, v] = t(
25
24
  "CompanyFederalTaxesContext"
26
25
  );
27
26
  export {
28
- j as FederalTaxFormSchema,
29
- P as FederalTaxesProvider,
30
- v as useFederalTaxes
27
+ b as FederalTaxFormSchema,
28
+ v as FederalTaxesProvider,
29
+ j as useFederalTaxes
31
30
  };
32
31
  //# sourceMappingURL=useFederalTaxes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useFederalTaxes.js","sources":["../../../../src/components/Company/FederalTaxes/useFederalTaxes.ts"],"sourcesContent":["import { z } from 'zod'\nimport type { FederalTaxDetails } from '@gusto/embedded-api/models/components/federaltaxdetails'\nimport {\n FilingForm,\n TaxPayerType,\n} from '@gusto/embedded-api/models/operations/putv1companiescompanyidfederaltaxdetails'\nimport { createCompoundContext } from '@/components/Base'\nimport type { RequireAtLeastOne } from '@/types/Helpers'\n\nexport const FederalTaxFormSchema = z.object({\n federalEin: z.string().optional(),\n taxPayerType: z.enum(Object.values(TaxPayerType) as [string, ...string[]]).optional(),\n filingForm: z.enum(Object.values(FilingForm) as [string, ...string[]]).optional(),\n legalName: z.string().min(1),\n})\n\nexport type FederalTaxFormInputs = z.input<typeof FederalTaxFormSchema>\n\nexport type FederalTaxesDefaultValues = RequireAtLeastOne<{\n taxPayerType?: FederalTaxFormInputs['taxPayerType']\n filingForm?: FederalTaxFormInputs['filingForm']\n legalName?: FederalTaxFormInputs['legalName']\n}>\n\ntype FederalTaxesContextType = {\n isPending: boolean\n federalTaxDetails?: FederalTaxDetails\n}\n\nconst [useFederalTaxes, FederalTaxesProvider] = createCompoundContext<FederalTaxesContextType>(\n 'CompanyFederalTaxesContext',\n)\n\nexport { useFederalTaxes, FederalTaxesProvider }\n"],"names":["FederalTaxFormSchema","z","TaxPayerType","FilingForm","useFederalTaxes","FederalTaxesProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;;;;AASO,MAAMA,IAAuBC,EAAE,OAAO;AAAA,EAC3C,YAAYA,EAAE,OAAA,EAAS,SAAA;AAAA,EACvB,cAAcA,EAAE,KAAK,OAAO,OAAOC,CAAY,CAA0B,EAAE,SAAA;AAAA,EAC3E,YAAYD,EAAE,KAAK,OAAO,OAAOE,CAAU,CAA0B,EAAE,SAAA;AAAA,EACvE,WAAWF,EAAE,OAAA,EAAS,IAAI,CAAC;AAC7B,CAAC,GAeK,CAACG,GAAiBC,CAAoB,IAAIC;AAAA,EAC9C;AACF;"}
1
+ {"version":3,"file":"useFederalTaxes.js","sources":["../../../../src/components/Company/FederalTaxes/useFederalTaxes.ts"],"sourcesContent":["import { z } from 'zod'\nimport type { FederalTaxDetails } from '@gusto/embedded-api/models/components/federaltaxdetails'\nimport {\n FilingForm,\n TaxPayerType,\n} from '@gusto/embedded-api/models/operations/putv1companiescompanyidfederaltaxdetails'\nimport { createCompoundContext } from '@/components/Base'\nimport type { RequireAtLeastOne } from '@/types/Helpers'\n\nexport const FederalTaxFormSchema = z.object({\n federalEin: z.string().optional(),\n taxPayerType: z.enum(Object.values(TaxPayerType) as [string, ...string[]]).optional(),\n filingForm: z.enum(Object.values(FilingForm) as [string, ...string[]]).optional(),\n legalName: z.string().min(1),\n})\n\nexport type FederalTaxFormInputs = z.input<typeof FederalTaxFormSchema>\n\nexport type FederalTaxesDefaultValues = RequireAtLeastOne<{\n taxPayerType?: FederalTaxFormInputs['taxPayerType']\n filingForm?: FederalTaxFormInputs['filingForm']\n legalName?: FederalTaxFormInputs['legalName']\n}>\n\ntype FederalTaxesContextType = {\n isPending: boolean\n federalTaxDetails?: FederalTaxDetails\n}\n\nconst [useFederalTaxes, FederalTaxesProvider] = createCompoundContext<FederalTaxesContextType>(\n 'CompanyFederalTaxesContext',\n)\n\nexport { useFederalTaxes, FederalTaxesProvider }\n"],"names":["FederalTaxFormSchema","z","TaxPayerType","FilingForm","useFederalTaxes","FederalTaxesProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;;;AASO,MAAMA,IAAuBC,EAAE,OAAO;AAAA,EAC3C,YAAYA,EAAE,OAAA,EAAS,SAAA;AAAA,EACvB,cAAcA,EAAE,KAAK,OAAO,OAAOC,CAAY,CAA0B,EAAE,SAAA;AAAA,EAC3E,YAAYD,EAAE,KAAK,OAAO,OAAOE,CAAU,CAA0B,EAAE,SAAA;AAAA,EACvE,WAAWF,EAAE,OAAA,EAAS,IAAI,CAAC;AAC7B,CAAC,GAeK,CAACG,GAAiBC,CAAoB,IAAIC;AAAA,EAC9C;AACF;"}
@@ -1,16 +1,14 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
2
  import { useTranslation as i } from "react-i18next";
3
- import { useIndustryApiState as m } from "./Context.js";
3
+ import { useIndustryApiState as s } from "./Context.js";
4
4
  import "classnames";
5
- import "../../../shared/constants.js";
6
- import { ActionsLayout as s } from "../../Common/ActionsLayout/ActionsLayout.js";
7
- import { useComponentContext as p } from "../../../contexts/ComponentAdapter/useComponentContext.js";
8
- import "react";
9
- const l = () => {
10
- const { t: o } = i("Company.Industry"), { isPending: n } = m(), r = p();
11
- return /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(r.Button, { type: "submit", isLoading: n, children: o("submitCta") }) });
5
+ import { ActionsLayout as m } from "../../Common/ActionsLayout/ActionsLayout.js";
6
+ import { useComponentContext as e } from "../../../contexts/ComponentAdapter/useComponentContext.js";
7
+ const y = () => {
8
+ const { t: o } = i("Company.Industry"), { isPending: n } = s(), r = e();
9
+ return /* @__PURE__ */ t(m, { children: /* @__PURE__ */ t(r.Button, { type: "submit", isLoading: n, children: o("submitCta") }) });
12
10
  };
13
11
  export {
14
- l as Actions
12
+ y as Actions
15
13
  };
16
14
  //# sourceMappingURL=Actions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Actions.js","sources":["../../../../src/components/Company/Industry/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useIndustryApiState } from './Context'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { t } = useTranslation('Company.Industry')\n const { isPending } = useIndustryApiState()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t('submitCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","t","useTranslation","isPending","useIndustryApiState","Components","useComponentContext","jsx","ActionsLayout"],"mappings":";;;;;;;;AAKO,MAAMA,IAAU,MAAM;AAC3B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,kBAAkB,GACzC,EAAE,WAAAC,EAAA,IAAcC,EAAA,GAChBC,IAAaC,EAAA;AAEnB,SACE,gBAAAC,EAACC,GAAA,EACC,UAAA,gBAAAD,EAACF,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWF,GACzC,UAAAF,EAAE,WAAW,GAChB,GACF;AAEJ;"}
1
+ {"version":3,"file":"Actions.js","sources":["../../../../src/components/Company/Industry/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useIndustryApiState } from './Context'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { t } = useTranslation('Company.Industry')\n const { isPending } = useIndustryApiState()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t('submitCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","t","useTranslation","isPending","useIndustryApiState","Components","useComponentContext","jsx","ActionsLayout"],"mappings":";;;;;;AAKO,MAAMA,IAAU,MAAM;AAC3B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,kBAAkB,GACzC,EAAE,WAAAC,EAAA,IAAcC,EAAA,GAChBC,IAAaC,EAAA;AAEnB,SACE,gBAAAC,EAACC,GAAA,EACC,UAAA,gBAAAD,EAACF,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWF,GACzC,UAAAF,EAAE,WAAW,GAChB,GACF;AAEJ;"}
@@ -9,20 +9,19 @@ import "@tanstack/react-query";
9
9
  import "../../Base/useBase.js";
10
10
  import "../../../shared/constants.js";
11
11
  import "classnames";
12
- import "../../../contexts/ComponentAdapter/useComponentContext.js";
13
12
  import "dompurify";
14
13
  import "../../../contexts/LocaleProvider/useLocale.js";
15
- import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
14
+ import "../../../contexts/ComponentAdapter/useComponentContext.js";
16
15
  import { createCompoundContext as t } from "../../Base/createCompoundContext.js";
17
- const [f, v] = t("IndustryItems", {
16
+ const [P, f] = t("IndustryItems", {
18
17
  items: []
19
- }), [x, C] = t("IndustryApi", {
18
+ }), [v, x] = t("IndustryApi", {
20
19
  isPending: !1
21
20
  });
22
21
  export {
23
- C as IndustryApiStateProvider,
24
- v as IndustryItemsProvider,
25
- x as useIndustryApiState,
26
- f as useIndustryItems
22
+ x as IndustryApiStateProvider,
23
+ f as IndustryItemsProvider,
24
+ v as useIndustryApiState,
25
+ P as useIndustryItems
27
26
  };
28
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;"}
@@ -2,14 +2,11 @@ import { jsx as t } from "react/jsx-runtime";
2
2
  import { useTranslation as e } from "react-i18next";
3
3
  import { useIndustryItems as m } from "./Context.js";
4
4
  import "classnames";
5
- import "../../../shared/constants.js";
6
- import "../../../contexts/ComponentAdapter/useComponentContext.js";
7
- import "react";
8
- import { ComboBoxField as i } from "../../Common/Fields/ComboBoxField/ComboBoxField.js";
9
- const f = () => {
5
+ import { ComboBoxField as s } from "../../Common/Fields/ComboBoxField/ComboBoxField.js";
6
+ const d = () => {
10
7
  const { t: o } = e("Company.Industry"), { items: r } = m();
11
8
  return /* @__PURE__ */ t(
12
- i,
9
+ s,
13
10
  {
14
11
  isRequired: !0,
15
12
  options: r,
@@ -20,6 +17,6 @@ const f = () => {
20
17
  );
21
18
  };
22
19
  export {
23
- f as Edit
20
+ d as Edit
24
21
  };
25
22
  //# 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,19 +1,17 @@
1
- import { jsxs as s, jsx as n } from "react/jsx-runtime";
1
+ import { jsxs as r, 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
4
  import "classnames";
5
- import "../../../../shared/constants.js";
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: [
5
+ import { ActionsLayout as c } from "../../../Common/ActionsLayout/ActionsLayout.js";
6
+ import { useComponentContext as m } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
7
+ const h = () => {
8
+ const { t: o } = a("Company.Locations"), { handleCancel: i, isPending: s } = e(), t = m();
9
+ return /* @__PURE__ */ r(c, { children: [
12
10
  /* @__PURE__ */ n(t.Button, { variant: "secondary", onClick: i, children: o("cancelCta") }),
13
- /* @__PURE__ */ n(t.Button, { type: "submit", isLoading: r, "data-testid": "location-submit", children: o("saveCta") })
11
+ /* @__PURE__ */ n(t.Button, { type: "submit", isLoading: s, "data-testid": "location-submit", children: o("saveCta") })
14
12
  ] });
15
13
  };
16
14
  export {
17
- y as Actions
15
+ h as Actions
18
16
  };
19
17
  //# 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;"}
@@ -5,14 +5,12 @@ import { zipValidation as n, phoneValidation as m } from "../../../../helpers/va
5
5
  import { Flex as d } from "../../../Common/Flex/Flex.js";
6
6
  import { Grid as p } from "../../../Common/Grid/Grid.js";
7
7
  import "classnames";
8
- import { TextInputField as s } from "../../../Common/Fields/TextInputField/TextInputField.js";
9
- import "../../../../contexts/ComponentAdapter/useComponentContext.js";
10
- import "react";
11
8
  import { STATES_ABBR as c } from "../../../../shared/constants.js";
12
9
  import { useMaskedTransform as u, commonMasks as b } from "../../../../helpers/mask.js";
10
+ import { TextInputField as s } from "../../../Common/Fields/TextInputField/TextInputField.js";
13
11
  import { SelectField as f } from "../../../Common/Fields/SelectField/SelectField.js";
14
12
  import { CheckboxGroupField as g } from "../../../Common/Fields/CheckboxGroupField/CheckboxGroupField.js";
15
- const j = i.object({
13
+ const k = i.object({
16
14
  phoneNumber: m,
17
15
  street1: i.string().min(1),
18
16
  street2: i.string().optional(),
@@ -21,7 +19,7 @@ const j = i.object({
21
19
  zip: n,
22
20
  addressType: i.array(i.enum(["mailingAddress", "filingAddress"])).optional()
23
21
  });
24
- function C() {
22
+ function S() {
25
23
  const { t: e } = l("Company.Locations"), o = u(b.phoneMask);
26
24
  return /* @__PURE__ */ t(d, { flexDirection: "column", gap: 20, children: [
27
25
  /* @__PURE__ */ t(
@@ -107,7 +105,7 @@ function C() {
107
105
  ] });
108
106
  }
109
107
  export {
110
- C as Form,
111
- j as LocationFormSchema
108
+ S as Form,
109
+ k as LocationFormSchema
112
110
  };
113
111
  //# 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,cAAcA,EAAE,qBAAqB;AAAA,YAAA;AAAA,UAAA;AAAA,4BAEtCS,GAAA,EAAe,MAAK,WAAU,OAAOT,EAAE,cAAc,GAAG;AAAA,UACzD,gBAAAQ;AAAA,YAACC;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,OAAOT,EAAE,WAAW;AAAA,cACpB,YAAU;AAAA,cACV,cAAcA,EAAE,kBAAkB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ent":["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,cAAcA,EAAE,qBAAqB;AAAA,YAAA;AAAA,UAAA;AAAA,4BAEtCS,GAAA,EAAe,MAAK,WAAU,OAAOT,EAAE,cAAc,GAAG;AAAA,UACzD,gBAAAQ;AAAA,YAACC;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,c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
@@ -10,21 +10,19 @@ 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
13
  import "react-i18next";
16
- import "../../../../contexts/ComponentAdapter/useComponentContext.js";
17
- import "react";
14
+ import "classnames";
18
15
  import { BaseComponent as z } from "../../../Base/Base.js";
19
16
  import { useBase as U } from "../../../Base/useBase.js";
20
17
  import { useI18n as j } from "../../../../i18n/I18n.js";
18
+ import { componentEvents as a } from "../../../../shared/constants.js";
21
19
  function H(t) {
22
20
  const {
23
21
  data: { location: e }
24
22
  } = S({ locationId: t.locationId });
25
- return /* @__PURE__ */ o(u, { ...t, location: e });
23
+ return /* @__PURE__ */ o(p, { ...t, location: e });
26
24
  }
27
- function u({
25
+ function p({
28
26
  companyId: t,
29
27
  location: e,
30
28
  className: i,
@@ -46,7 +44,7 @@ function u({
46
44
  s(a.CANCEL);
47
45
  }, C = async (n) => {
48
46
  await f(n, async (F) => {
49
- const { addressType: c, ...P } = F, p = {
47
+ const { addressType: c, ...P } = F, u = {
50
48
  ...P,
51
49
  mailingAddress: c?.includes("mailingAddress"),
52
50
  filingAddress: c?.includes("filingAddress")
@@ -55,7 +53,7 @@ function u({
55
53
  const { location: m } = await g({
56
54
  request: {
57
55
  locationId: e.uuid,
58
- requestBody: { ...p, version: e.version }
56
+ requestBody: { ...u, version: e.version }
59
57
  }
60
58
  });
61
59
  s(a.COMPANY_LOCATION_UPDATED, m);
@@ -63,7 +61,7 @@ function u({
63
61
  const { location: m } = await l({
64
62
  request: {
65
63
  companyId: t,
66
- requestBody: p
64
+ requestBody: u
67
65
  }
68
66
  });
69
67
  s(a.COMPANY_LOCATION_CREATED, m);
@@ -82,16 +80,16 @@ function u({
82
80
  }
83
81
  ) }) }) });
84
82
  }
85
- function de({
83
+ function me({
86
84
  companyId: t,
87
85
  locationId: e,
88
86
  className: i,
89
87
  children: r,
90
88
  ...s
91
89
  }) {
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 }) });
90
+ return /* @__PURE__ */ o(z, { ...s, children: e ? /* @__PURE__ */ o(H, { companyId: t, locationId: e, className: i, children: r }) : /* @__PURE__ */ o(p, { companyId: t, className: i, children: r }) });
93
91
  }
94
92
  export {
95
- de as LocationForm
93
+ me as LocationForm
96
94
  };
97
95
  //# 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,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gBAAAhB,EAAC+B,GAAA,EAAS,UAAUd,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;"}
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,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import "../../../Base/useBase.js";
10
10
  import "../../../../shared/constants.js";
11
11
  import "classnames";
12
- import "../../../../contexts/ComponentAdapter/useComponentContext.js";
13
12
  import "dompurify";
14
13
  import "../../../../contexts/LocaleProvider/useLocale.js";
15
- import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
14
+ import "../../../../contexts/ComponentAdapter/useComponentContext.js";
16
15
  import { createCompoundContext as o } from "../../../Base/createCompoundContext.js";
17
- const [f, v] = o(
16
+ const [L, f] = o(
18
17
  "CompanyDocumentFormContext"
19
18
  );
20
19
  export {
21
- v as LocationsFormProvider,
22
- f as useLocationsForm
20
+ f as LocationsFormProvider,
21
+ L as useLocationsForm
23
22
  };
24
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,19 +1,17 @@
1
- import { jsxs as c, jsx as n } from "react/jsx-runtime";
1
+ import { jsxs as c, jsx as t } from "react/jsx-runtime";
2
2
  import { useTranslation as s } from "react-i18next";
3
3
  import { useLocationsList as a } from "./useLocationsList.js";
4
4
  import "classnames";
5
- import "../../../../shared/constants.js";
6
5
  import { ActionsLayout as e } from "../../../Common/ActionsLayout/ActionsLayout.js";
7
6
  import { useComponentContext as m } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
8
- import "react";
9
- function x() {
10
- const { t: o } = s("Company.Locations"), { handleAddLocation: i, handleContinue: r } = a(), t = m();
7
+ function L() {
8
+ const { t: o } = s("Company.Locations"), { handleAddLocation: i, handleContinue: r } = a(), n = m();
11
9
  return /* @__PURE__ */ c(e, { children: [
12
- /* @__PURE__ */ n(t.Button, { variant: "secondary", onClick: i, children: o("addLocationCta") }),
13
- /* @__PURE__ */ n(t.Button, { onClick: r, children: o("continueCta") })
10
+ /* @__PURE__ */ t(n.Button, { variant: "secondary", onClick: i, children: o("addLocationCta") }),
11
+ /* @__PURE__ */ t(n.Button, { onClick: r, children: o("continueCta") })
14
12
  ] });
15
13
  }
16
14
  export {
17
- x as Actions
15
+ L as Actions
18
16
  };
19
17
  //# sourceMappingURL=Actions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/Locations/LocationsList/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useLocationsList } from './useLocationsList'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { t } = useTranslation('Company.Locations')\n const { handleAddLocation, handleContinue } = useLocationsList()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleAddLocation}>\n {t('addLocationCta')}\n </Components.Button>\n <Components.Button onClick={handleContinue}>{t('continueCta')}</Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","t","useTranslation","handleAddLocation","handleContinue","useLocationsList","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;;;;;;AAKO,SAASA,IAAU;AACxB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,mBAAmB,GAC1C,EAAE,mBAAAC,GAAmB,gBAAAC,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;"}
@@ -3,24 +3,23 @@ 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
5
  import "classnames";
6
- import "../../../../shared/constants.js";
7
6
  import { EmptyData as b } from "../../../Common/EmptyData/EmptyData.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";
7
+ import { useComponentContext as x } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
8
+ import { getStreet as T, getCityStateZip as v } from "../../../../helpers/formattedStrings.js";
9
+ import { VisuallyHidden as A } from "../../../Common/VisuallyHidden/VisuallyHidden.js";
10
+ import { HamburgerMenu as k } from "../../../Common/HamburgerMenu/HamburgerMenu.js";
12
11
  import { useDataView as D } from "../../../Common/DataView/useDataView.js";
13
12
  import { DataView as S } from "../../../Common/DataView/DataView.js";
14
- const G = () => {
15
- const a = T(), {
13
+ const q = () => {
14
+ const a = x(), {
16
15
  locationList: o,
17
16
  handleEditLocation: s,
18
17
  currentPage: d,
19
18
  totalPages: l,
20
19
  handleFirstPage: m,
21
20
  handleItemsPerPageChange: c,
22
- handleLastPage: p,
23
- handleNextPage: g,
21
+ handleLastPage: g,
22
+ handleNextPage: p,
24
23
  handlePreviousPage: u,
25
24
  handleAddLocation: h,
26
25
  itemsPerPage: f
@@ -31,13 +30,13 @@ const G = () => {
31
30
  key: "name",
32
31
  title: e("locationListCol1"),
33
32
  render: (i) => /* @__PURE__ */ t(r, { children: /* @__PURE__ */ n("address", { children: [
34
- /* @__PURE__ */ t(a.Text, { as: "div", children: v(i) }),
35
- /* @__PURE__ */ t(a.Text, { as: "div", size: "sm", children: A(i) })
33
+ /* @__PURE__ */ t(a.Text, { as: "div", children: T(i) }),
34
+ /* @__PURE__ */ t(a.Text, { as: "div", size: "sm", children: v(i) })
36
35
  ] }) })
37
36
  },
38
37
  {
39
38
  key: "status",
40
- title: /* @__PURE__ */ t(k, { children: e("locationListCol2") }),
39
+ title: /* @__PURE__ */ t(A, { children: e("locationListCol2") }),
41
40
  render: (i) => /* @__PURE__ */ n(r, { children: [
42
41
  i.mailingAddress && /* @__PURE__ */ t(a.Badge, { status: "info", children: e("mailingAddress") }),
43
42
  i.filingAddress && /* @__PURE__ */ n(r, { children: [
@@ -48,7 +47,7 @@ const G = () => {
48
47
  }
49
48
  ],
50
49
  itemMenu: (i) => /* @__PURE__ */ t(
51
- x,
50
+ k,
52
51
  {
53
52
  items: [
54
53
  {
@@ -65,9 +64,9 @@ const G = () => {
65
64
  }
66
65
  ),
67
66
  pagination: {
68
- handleNextPage: g,
67
+ handleNextPage: p,
69
68
  handleFirstPage: m,
70
- handleLastPage: p,
69
+ handleLastPage: g,
71
70
  handlePreviousPage: u,
72
71
  handleItemsPerPageChange: c,
73
72
  currentPage: d,
@@ -79,6 +78,6 @@ const G = () => {
79
78
  return /* @__PURE__ */ t(S, { label: e("locationListLabel"), ...L });
80
79
  };
81
80
  export {
82
- G as List
81
+ q as List
83
82
  };
84
83
  //# sourceMappingURL=List.js.map