@gusto/embedded-react-sdk 0.10.1 → 0.10.2-rc.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (253) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/components/Base/Base.d.ts +3 -2
  3. package/dist/components/Base/Base.js +57 -50
  4. package/dist/components/Base/Base.js.map +1 -1
  5. package/dist/components/Common/InternalError/InternalError.js.map +1 -1
  6. package/dist/components/Common/SignatureForm/SignatureForm.js +6 -4
  7. package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
  8. package/dist/components/Common/SignatureForm/SignatureFormActions.js +12 -10
  9. package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
  10. package/dist/components/Common/SignatureForm/SignatureFormFields.js +8 -6
  11. package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
  12. package/dist/components/Common/UI/ComboBox/ComboBox.js +31 -33
  13. package/dist/components/Common/UI/ComboBox/ComboBox.js.map +1 -1
  14. package/dist/components/Common/UI/ComboBox/ComboBox.module.scss.js +1 -1
  15. package/dist/components/Common/UI/Text/TextTypes.d.ts +1 -1
  16. package/dist/components/Company/AssignSignatory/AssignSignatory.js +13 -11
  17. package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
  18. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +7 -6
  19. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
  20. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +9 -8
  21. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
  22. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +1 -0
  23. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
  24. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +3 -2
  25. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
  26. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +5 -3
  27. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  28. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +7 -6
  29. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
  30. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +4 -3
  31. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
  32. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +10 -9
  33. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
  34. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +5 -3
  35. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  36. package/dist/components/Company/AssignSignatory/TitleSelect.js +8 -7
  37. package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
  38. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +7 -5
  39. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  40. package/dist/components/Company/BankAccount/BankAccount.d.ts +2 -2
  41. package/dist/components/Company/BankAccount/BankAccount.js +25 -20
  42. package/dist/components/Company/BankAccount/BankAccount.js.map +1 -1
  43. package/dist/components/Company/BankAccount/BankAccountComponents.js +16 -9
  44. package/dist/components/Company/BankAccount/BankAccountComponents.js.map +1 -1
  45. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +23 -8
  46. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
  47. package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.d.ts +1 -0
  48. package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.js +30 -30
  49. package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.js.map +1 -1
  50. package/dist/components/Company/BankAccount/BankAccountForm/Form.js +8 -7
  51. package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
  52. package/dist/components/Company/BankAccount/BankAccountForm/context.d.ts +4 -0
  53. package/dist/components/Company/BankAccount/BankAccountForm/context.js +5 -3
  54. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  55. package/dist/components/Company/BankAccount/BankAccountList/AccountView.js +14 -13
  56. package/dist/components/Company/BankAccount/BankAccountList/AccountView.js.map +1 -1
  57. package/dist/components/Company/BankAccount/BankAccountList/Actions.js +7 -6
  58. package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
  59. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +8 -7
  60. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
  61. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +5 -4
  62. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
  63. package/dist/components/Company/BankAccount/stateMachine.d.ts +1 -1
  64. package/dist/components/Company/BankAccount/stateMachine.js +13 -5
  65. package/dist/components/Company/BankAccount/stateMachine.js.map +1 -1
  66. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +6 -5
  67. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
  68. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +17 -15
  69. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  70. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +5 -3
  71. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  72. package/dist/components/Company/DocumentSigner/DocumentSigner.d.ts +5 -7
  73. package/dist/components/Company/DocumentSigner/DocumentSigner.js +24 -24
  74. package/dist/components/Company/DocumentSigner/DocumentSigner.js.map +1 -1
  75. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +45 -44
  76. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  77. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +5 -3
  78. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  79. package/dist/components/Company/FederalTaxes/Actions.js +7 -6
  80. package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
  81. package/dist/components/Company/FederalTaxes/FederalTaxes.js +17 -15
  82. package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
  83. package/dist/components/Company/FederalTaxes/Form.js +3 -2
  84. package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
  85. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +10 -8
  86. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  87. package/dist/components/Company/Industry/Actions.js +6 -5
  88. package/dist/components/Company/Industry/Actions.js.map +1 -1
  89. package/dist/components/Company/Industry/Context.js +8 -6
  90. package/dist/components/Company/Industry/Context.js.map +1 -1
  91. package/dist/components/Company/Industry/Edit.js +11 -10
  92. package/dist/components/Company/Industry/Edit.js.map +1 -1
  93. package/dist/components/Company/Industry/Industry.js +30 -31
  94. package/dist/components/Company/Industry/Industry.js.map +1 -1
  95. package/dist/components/Company/Locations/LocationForm/Actions.js +3 -2
  96. package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
  97. package/dist/components/Company/Locations/LocationForm/Form.js +5 -4
  98. package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
  99. package/dist/components/Company/Locations/LocationForm/LocationForm.js +36 -37
  100. package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
  101. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +5 -3
  102. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  103. package/dist/components/Company/Locations/LocationsList/Actions.js +3 -2
  104. package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
  105. package/dist/components/Company/Locations/LocationsList/List.js +11 -7
  106. package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
  107. package/dist/components/Company/Locations/LocationsList/LocationsList.js +11 -9
  108. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  109. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +5 -3
  110. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  111. package/dist/components/Company/Locations/stateMachine.js +35 -33
  112. package/dist/components/Company/Locations/stateMachine.js.map +1 -1
  113. package/dist/components/Company/OnboardingOverview/Completed.js +6 -5
  114. package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
  115. package/dist/components/Company/OnboardingOverview/MissingRequirements.js +3 -2
  116. package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
  117. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +4 -2
  118. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
  119. package/dist/components/Company/OnboardingOverview/context.js +5 -3
  120. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  121. package/dist/components/Company/PaySchedule/PaySchedule.js +72 -71
  122. package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
  123. package/dist/components/Company/PaySchedule/_parts/Actions.js +11 -10
  124. package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
  125. package/dist/components/Company/PaySchedule/_parts/Edit.js +9 -8
  126. package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
  127. package/dist/components/Company/PaySchedule/_parts/Head.js +3 -2
  128. package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
  129. package/dist/components/Company/PaySchedule/_parts/List.js +6 -5
  130. package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
  131. package/dist/components/Company/PaySchedule/usePaySchedule.js +7 -5
  132. package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
  133. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +6 -5
  134. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
  135. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +5 -3
  136. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  137. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +7 -6
  138. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
  139. package/dist/components/Company/StateTaxes/StateTaxesList/List.js +6 -5
  140. package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
  141. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +5 -3
  142. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  143. package/dist/components/Contractor/Address/Address.js +39 -38
  144. package/dist/components/Contractor/Address/Address.js.map +1 -1
  145. package/dist/components/Contractor/Address/Form.js +3 -2
  146. package/dist/components/Contractor/Address/Form.js.map +1 -1
  147. package/dist/components/Contractor/Address/useAddress.js +7 -5
  148. package/dist/components/Contractor/Address/useAddress.js.map +1 -1
  149. package/dist/components/Contractor/List/index.js +11 -10
  150. package/dist/components/Contractor/List/index.js.map +1 -1
  151. package/dist/components/Contractor/NewHireReport/NewHireReport.js +52 -52
  152. package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
  153. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +3 -2
  154. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
  155. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +3 -2
  156. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
  157. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +3 -2
  158. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
  159. package/dist/components/Employee/Compensation/Actions.js +5 -4
  160. package/dist/components/Employee/Compensation/Actions.js.map +1 -1
  161. package/dist/components/Employee/Compensation/Compensation.js +123 -132
  162. package/dist/components/Employee/Compensation/Compensation.js.map +1 -1
  163. package/dist/components/Employee/Compensation/Edit.js +3 -2
  164. package/dist/components/Employee/Compensation/Edit.js.map +1 -1
  165. package/dist/components/Employee/Compensation/List.js +6 -5
  166. package/dist/components/Employee/Compensation/List.js.map +1 -1
  167. package/dist/components/Employee/Deductions/Actions.js +9 -8
  168. package/dist/components/Employee/Deductions/Actions.js.map +1 -1
  169. package/dist/components/Employee/Deductions/DeductionForm.js +3 -2
  170. package/dist/components/Employee/Deductions/DeductionForm.js.map +1 -1
  171. package/dist/components/Employee/Deductions/Deductions.js +74 -79
  172. package/dist/components/Employee/Deductions/Deductions.js.map +1 -1
  173. package/dist/components/Employee/Deductions/DeductionsList.js +3 -2
  174. package/dist/components/Employee/Deductions/DeductionsList.js.map +1 -1
  175. package/dist/components/Employee/Deductions/IncludeDeductionsForm.js +3 -2
  176. package/dist/components/Employee/Deductions/IncludeDeductionsForm.js.map +1 -1
  177. package/dist/components/Employee/Deductions/useDeductions.js +7 -5
  178. package/dist/components/Employee/Deductions/useDeductions.js.map +1 -1
  179. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +5 -4
  180. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
  181. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +12 -10
  182. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  183. package/dist/components/Employee/DocumentSigner/DocumentList/List.js +3 -2
  184. package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
  185. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +5 -3
  186. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  187. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +38 -42
  188. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  189. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +5 -3
  190. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  191. package/dist/components/Employee/EmployeeList/Actions.js +5 -4
  192. package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
  193. package/dist/components/Employee/EmployeeList/EmployeeList.js +59 -58
  194. package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
  195. package/dist/components/Employee/EmployeeList/Head.js +3 -2
  196. package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
  197. package/dist/components/Employee/EmployeeList/List.js +3 -2
  198. package/dist/components/Employee/EmployeeList/List.js.map +1 -1
  199. package/dist/components/Employee/EmployeeList/useEmployeeList.js +5 -3
  200. package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
  201. package/dist/components/Employee/Landing/Landing.js +7 -6
  202. package/dist/components/Employee/Landing/Landing.js.map +1 -1
  203. package/dist/components/Employee/PaymentMethod/Actions.js +6 -5
  204. package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
  205. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +3 -2
  206. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
  207. package/dist/components/Employee/PaymentMethod/BankAccountsList.js +3 -2
  208. package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
  209. package/dist/components/Employee/PaymentMethod/PaymentMethod.js +95 -97
  210. package/dist/components/Employee/PaymentMethod/PaymentMethod.js.map +1 -1
  211. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +3 -2
  212. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
  213. package/dist/components/Employee/PaymentMethod/Split.js +3 -2
  214. package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
  215. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +7 -5
  216. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
  217. package/dist/components/Employee/Profile/Actions.js +7 -6
  218. package/dist/components/Employee/Profile/Actions.js.map +1 -1
  219. package/dist/components/Employee/Profile/AdminPersonalDetails.js +10 -9
  220. package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
  221. package/dist/components/Employee/Profile/HomeAddress.js +5 -4
  222. package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
  223. package/dist/components/Employee/Profile/PersonalDetailsInputs.js +9 -8
  224. package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
  225. package/dist/components/Employee/Profile/Profile.js +118 -124
  226. package/dist/components/Employee/Profile/Profile.js.map +1 -1
  227. package/dist/components/Employee/Profile/useProfile.js +5 -3
  228. package/dist/components/Employee/Profile/useProfile.js.map +1 -1
  229. package/dist/components/Employee/Taxes/Actions.js +8 -7
  230. package/dist/components/Employee/Taxes/Actions.js.map +1 -1
  231. package/dist/components/Employee/Taxes/FederalForm.js +7 -6
  232. package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
  233. package/dist/components/Employee/Taxes/Taxes.js +59 -60
  234. package/dist/components/Employee/Taxes/Taxes.js.map +1 -1
  235. package/dist/components/Employee/Taxes/useTaxes.js +5 -3
  236. package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
  237. package/dist/contexts/ApiProvider/ApiProvider.js +16 -14
  238. package/dist/contexts/ApiProvider/ApiProvider.js.map +1 -1
  239. package/dist/contexts/ComponentAdapter/componentAdapterTypes.d.ts +5 -0
  240. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.d.ts +2 -0
  241. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +20 -17
  242. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  243. package/dist/contexts/LoadingIndicatorProvider/LoadingIndicatorProvider.d.ts +7 -0
  244. package/dist/contexts/LoadingIndicatorProvider/LoadingIndicatorProvider.js +10 -0
  245. package/dist/contexts/LoadingIndicatorProvider/LoadingIndicatorProvider.js.map +1 -0
  246. package/dist/contexts/LoadingIndicatorProvider/useLoadingIndicator.d.ts +6 -0
  247. package/dist/contexts/LoadingIndicatorProvider/useLoadingIndicator.js +11 -0
  248. package/dist/contexts/LoadingIndicatorProvider/useLoadingIndicator.js.map +1 -0
  249. package/dist/shared/constants.d.ts +2 -0
  250. package/dist/shared/constants.js +10 -9
  251. package/dist/shared/constants.js.map +1 -1
  252. package/dist/style.css +1 -1
  253. package/package.json +5 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Head.js","sources":["../../../../../src/components/Company/PaySchedule/_parts/Head.tsx"],"sourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport { usePaySchedule } from '../usePaySchedule'\nimport { Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\n// Head slot for PaySchedule component\nexport const Head = () => {\n const { t } = useTranslation('Company.PaySchedule')\n const Components = useComponentContext()\n\n const { mode } = usePaySchedule()\n let headingOutput: React.ReactElement = <></>\n\n switch (mode) {\n case 'LIST_PAY_SCHEDULES':\n headingOutput = (\n <>\n <Components.Heading as=\"h2\">{t('headings.pageTitle')}</Components.Heading>\n <Components.Text>\n <Trans\n i18nKey={'listDescription'}\n t={t}\n components={{\n how_to_choose_schedule: <Components.Link />,\n }}\n />\n </Components.Text>\n <Components.Text>\n <Trans\n i18nKey={'listDescription2'}\n t={t}\n components={{\n payment_law_doc: <Components.Link />,\n }}\n />\n </Components.Text>\n </>\n )\n break\n case 'ADD_PAY_SCHEDULE':\n headingOutput = (\n <Components.Heading as=\"h2\">{t('headings.addPaySchedule')}</Components.Heading>\n )\n break\n case 'EDIT_PAY_SCHEDULE':\n headingOutput = (\n <Components.Heading as=\"h2\">{t('headings.editPaySchedule')}</Components.Heading>\n )\n break\n default:\n }\n\n return (\n <Flex justifyContent=\"space-between\" flexDirection={'column'} gap={4}>\n <header>{headingOutput}</header>\n </Flex>\n )\n}\n"],"names":["Head","useTranslation","Components","useComponentContext","mode","usePaySchedule","headingOutput","jsx","Fragment","jsxs","Trans","Flex"],"mappings":";;;;;AAMO,MAAMA,IAAO,MAAM;AACxB,QAAM,EAAE,EAAA,IAAMC,EAAe,qBAAqB,GAC5CC,IAAaC,EAAoB,GAEjC,EAAE,MAAAC,EAAK,IAAIC,EAAe;AAChC,MAAIC,IAAsC,gBAAAC,EAAAC,GAAA,EAAA;AAE1C,UAAQJ,GAAM;AAAA,IACZ,KAAK;AACH,MAAAE,IAEI,gBAAAG,EAAAD,GAAA,EAAA,UAAA;AAAA,QAAA,gBAAAD,EAACL,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAA,EAAE,oBAAoB,GAAE;AAAA,QACrD,gBAAAK,EAACL,EAAW,MAAX,EACC,UAAA,gBAAAK;AAAA,UAACG;AAAA,UAAA;AAAA,YACC,SAAS;AAAA,YACT;AAAA,YACA,YAAY;AAAA,cACV,wBAAwB,gBAAAH,EAACL,EAAW,MAAX,CAAgB,CAAA;AAAA,YAAA;AAAA,UAC3C;AAAA,QAAA,GAEJ;AAAA,QACA,gBAAAK,EAACL,EAAW,MAAX,EACC,UAAA,gBAAAK;AAAA,UAACG;AAAA,UAAA;AAAA,YACC,SAAS;AAAA,YACT;AAAA,YACA,YAAY;AAAA,cACV,iBAAiB,gBAAAH,EAACL,EAAW,MAAX,CAAgB,CAAA;AAAA,YAAA;AAAA,UACpC;AAAA,QAAA,EAEJ,CAAA;AAAA,MAAA,GACF;AAEF;AAAA,IACF,KAAK;AAED,MAAAI,IAAA,gBAAAC,EAACL,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAA,EAAE,yBAAyB,GAAE;AAE5D;AAAA,IACF,KAAK;AAED,MAAAI,IAAA,gBAAAC,EAACL,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAA,EAAE,0BAA0B,GAAE;AAE7D;AAAA,EACF;AAIA,SAAA,gBAAAK,EAACI,GAAK,EAAA,gBAAe,iBAAgB,eAAe,UAAU,KAAK,GACjE,UAAA,gBAAAJ,EAAC,UAAQ,EAAA,UAAAD,EAAc,CAAA,GACzB;AAEJ;"}
1
+ {"version":3,"file":"Head.js","sources":["../../../../../src/components/Company/PaySchedule/_parts/Head.tsx"],"sourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport { usePaySchedule } from '../usePaySchedule'\nimport { Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\n// Head slot for PaySchedule component\nexport const Head = () => {\n const { t } = useTranslation('Company.PaySchedule')\n const Components = useComponentContext()\n\n const { mode } = usePaySchedule()\n let headingOutput: React.ReactElement = <></>\n\n switch (mode) {\n case 'LIST_PAY_SCHEDULES':\n headingOutput = (\n <>\n <Components.Heading as=\"h2\">{t('headings.pageTitle')}</Components.Heading>\n <Components.Text>\n <Trans\n i18nKey={'listDescription'}\n t={t}\n components={{\n how_to_choose_schedule: <Components.Link />,\n }}\n />\n </Components.Text>\n <Components.Text>\n <Trans\n i18nKey={'listDescription2'}\n t={t}\n components={{\n payment_law_doc: <Components.Link />,\n }}\n />\n </Components.Text>\n </>\n )\n break\n case 'ADD_PAY_SCHEDULE':\n headingOutput = (\n <Components.Heading as=\"h2\">{t('headings.addPaySchedule')}</Components.Heading>\n )\n break\n case 'EDIT_PAY_SCHEDULE':\n headingOutput = (\n <Components.Heading as=\"h2\">{t('headings.editPaySchedule')}</Components.Heading>\n )\n break\n default:\n }\n\n return (\n <Flex justifyContent=\"space-between\" flexDirection={'column'} gap={4}>\n <header>{headingOutput}</header>\n </Flex>\n )\n}\n"],"names":["Head","useTranslation","Components","useComponentContext","mode","usePaySchedule","headingOutput","jsx","Fragment","jsxs","Trans","Flex"],"mappings":";;;;;;AAMO,MAAMA,IAAO,MAAM;AACxB,QAAM,EAAE,EAAA,IAAMC,EAAe,qBAAqB,GAC5CC,IAAaC,EAAoB,GAEjC,EAAE,MAAAC,EAAK,IAAIC,EAAe;AAChC,MAAIC,IAAsC,gBAAAC,EAAAC,GAAA,EAAA;AAE1C,UAAQJ,GAAM;AAAA,IACZ,KAAK;AACH,MAAAE,IAEI,gBAAAG,EAAAD,GAAA,EAAA,UAAA;AAAA,QAAA,gBAAAD,EAACL,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAA,EAAE,oBAAoB,GAAE;AAAA,QACrD,gBAAAK,EAACL,EAAW,MAAX,EACC,UAAA,gBAAAK;AAAA,UAACG;AAAA,UAAA;AAAA,YACC,SAAS;AAAA,YACT;AAAA,YACA,YAAY;AAAA,cACV,wBAAwB,gBAAAH,EAACL,EAAW,MAAX,CAAgB,CAAA;AAAA,YAAA;AAAA,UAC3C;AAAA,QAAA,GAEJ;AAAA,QACA,gBAAAK,EAACL,EAAW,MAAX,EACC,UAAA,gBAAAK;AAAA,UAACG;AAAA,UAAA;AAAA,YACC,SAAS;AAAA,YACT;AAAA,YACA,YAAY;AAAA,cACV,iBAAiB,gBAAAH,EAACL,EAAW,MAAX,CAAgB,CAAA;AAAA,YAAA;AAAA,UACpC;AAAA,QAAA,EAEJ,CAAA;AAAA,MAAA,GACF;AAEF;AAAA,IACF,KAAK;AAED,MAAAI,IAAA,gBAAAC,EAACL,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAA,EAAE,yBAAyB,GAAE;AAE5D;AAAA,IACF,KAAK;AAED,MAAAI,IAAA,gBAAAC,EAACL,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAA,EAAE,0BAA0B,GAAE;AAE7D;AAAA,EACF;AAIA,SAAA,gBAAAK,EAACI,GAAK,EAAA,gBAAe,iBAAgB,eAAe,UAAU,KAAK,GACjE,UAAA,gBAAAJ,EAAC,UAAQ,EAAA,UAAAD,EAAc,CAAA,GACzB;AAEJ;"}
@@ -3,15 +3,16 @@ import { useTranslation as h } from "react-i18next";
3
3
  import { usePaySchedule as y } from "../usePaySchedule.js";
4
4
  import o from "./List.module.scss.js";
5
5
  import { Flex as s } from "../../../Common/Flex/Flex.js";
6
+ import "classnames";
6
7
  import f from "../../../../assets/icons/pencil.svg.js";
7
8
  import { useComponentContext as S } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
8
9
  import { HamburgerMenu as v } from "../../../Common/HamburgerMenu/HamburgerMenu.js";
9
10
  import { VisuallyHidden as g } from "../../../Common/VisuallyHidden/VisuallyHidden.js";
10
11
  import { useDataView as L } from "../../../Common/DataView/useDataView.js";
11
12
  import { DataView as C } from "../../../Common/DataView/DataView.js";
12
- const H = () => {
13
- const { t: n } = h("Company.PaySchedule"), r = S(), { paySchedules: c, mode: m, handleEdit: l } = y(), { ...d } = L({
14
- data: c || [],
13
+ const B = () => {
14
+ const { t: n } = h("Company.PaySchedule"), r = S(), { paySchedules: m, mode: c, handleEdit: l } = y(), { ...d } = L({
15
+ data: m || [],
15
16
  columns: [
16
17
  {
17
18
  title: n("payScheduleList.name"),
@@ -49,9 +50,9 @@ const H = () => {
49
50
  }
50
51
  )
51
52
  });
52
- return m !== "LIST_PAY_SCHEDULES" ? null : /* @__PURE__ */ e(C, { label: "test", ...d });
53
+ return c !== "LIST_PAY_SCHEDULES" ? null : /* @__PURE__ */ e(C, { label: "test", ...d });
53
54
  };
54
55
  export {
55
- H as List
56
+ B as List
56
57
  };
57
58
  //# sourceMappingURL=List.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"List.js","sources":["../../../../../src/components/Company/PaySchedule/_parts/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { usePaySchedule } from '../usePaySchedule'\nimport styles from './List.module.scss'\nimport { useDataView, DataView, Flex, VisuallyHidden } from '@/components/Common'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\n\nexport const List = () => {\n const { t } = useTranslation('Company.PaySchedule')\n const Components = useComponentContext()\n const { paySchedules, mode, handleEdit } = usePaySchedule()\n\n const { ...dataViewProps } = useDataView({\n data: paySchedules || [],\n columns: [\n {\n title: t('payScheduleList.name'),\n key: 'customName',\n render: schedule => {\n const hasName = !!schedule.name\n let displayName = hasName ? schedule.name : schedule.customName\n if (displayName && displayName.length > 1) {\n displayName = displayName.charAt(0).toUpperCase() + displayName.slice(1)\n } else {\n displayName = schedule.customName\n }\n const displayFrequency = schedule.customName\n return (\n <Flex flexDirection={'column'} gap={0}>\n <div className={styles.content}>\n <div>{displayName}</div>\n {hasName && <div>{displayFrequency}</div>}\n </div>\n </Flex>\n )\n },\n },\n {\n title: <VisuallyHidden>{t('payScheduleList.active')}</VisuallyHidden>,\n key: 'active',\n render: schedule => (\n <Flex alignItems={'center'} justifyContent={'center'}>\n <div className={styles.content}>\n {schedule.active ? (\n <Components.Badge status=\"success\">{t('payScheduleList.active')}</Components.Badge>\n ) : (\n <Components.Badge status=\"info\">{t('payScheduleList.inactive')}</Components.Badge>\n )}\n </div>\n </Flex>\n ),\n },\n ],\n itemMenu: schedule => {\n return (\n <HamburgerMenu\n triggerLabel=\"Actions\"\n items={[\n {\n label: t('payScheduleList.edit'),\n onClick: () => {\n handleEdit(schedule)\n },\n icon: <PencilSvg aria-hidden />,\n },\n ]}\n />\n )\n },\n })\n\n if (mode !== 'LIST_PAY_SCHEDULES') {\n return null\n }\n\n return <DataView label=\"test\" {...dataViewProps} />\n}\n"],"names":["List","t","useTranslation","Components","useComponentContext","paySchedules","mode","handleEdit","usePaySchedule","dataViewProps","useDataView","schedule","hasName","displayName","displayFrequency","jsx","Flex","jsxs","styles","VisuallyHidden","HamburgerMenu","PencilSvg","DataView"],"mappings":";;;;;;;;;;;AAQO,MAAMA,IAAO,MAAM;AACxB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5CC,IAAaC,EAAoB,GACjC,EAAE,cAAAC,GAAc,MAAAC,GAAM,YAAAC,EAAA,IAAeC,EAAe,GAEpD,EAAE,GAAGC,EAAc,IAAIC,EAAY;AAAA,IACvC,MAAML,KAAgB,CAAC;AAAA,IACvB,SAAS;AAAA,MACP;AAAA,QACE,OAAOJ,EAAE,sBAAsB;AAAA,QAC/B,KAAK;AAAA,QACL,QAAQ,CAAYU,MAAA;AACZ,gBAAAC,IAAU,CAAC,CAACD,EAAS;AAC3B,cAAIE,IAAcD,IAAUD,EAAS,OAAOA,EAAS;AACjD,UAAAE,KAAeA,EAAY,SAAS,IACxBA,IAAAA,EAAY,OAAO,CAAC,EAAE,gBAAgBA,EAAY,MAAM,CAAC,IAEvEA,IAAcF,EAAS;AAEzB,gBAAMG,IAAmBH,EAAS;AAEhC,iBAAA,gBAAAI,EAACC,GAAK,EAAA,eAAe,UAAU,KAAK,GAClC,UAAC,gBAAAC,EAAA,OAAA,EAAI,WAAWC,EAAO,SACrB,UAAA;AAAA,YAAA,gBAAAH,EAAC,SAAK,UAAYF,EAAA,CAAA;AAAA,YACjBD,KAAY,gBAAAG,EAAA,OAAA,EAAK,UAAiBD,EAAA,CAAA;AAAA,UAAA,EAAA,CACrC,EACF,CAAA;AAAA,QAAA;AAAA,MAGN;AAAA,MACA;AAAA,QACE,OAAO,gBAAAC,EAACI,GAAgB,EAAA,UAAAlB,EAAE,wBAAwB,GAAE;AAAA,QACpD,KAAK;AAAA,QACL,QAAQ,CAAAU,MACL,gBAAAI,EAAAC,GAAA,EAAK,YAAY,UAAU,gBAAgB,UAC1C,UAAA,gBAAAD,EAAC,SAAI,WAAWG,EAAO,SACpB,UAAAP,EAAS,SACP,gBAAAI,EAAAZ,EAAW,OAAX,EAAiB,QAAO,WAAW,UAAAF,EAAE,wBAAwB,EAAE,CAAA,IAE/D,gBAAAc,EAAAZ,EAAW,OAAX,EAAiB,QAAO,QAAQ,UAAAF,EAAE,0BAA0B,GAAE,GAEnE,EACF,CAAA;AAAA,MAAA;AAAA,IAGN;AAAA,IACA,UAAU,CAAYU,MAElB,gBAAAI;AAAA,MAACK;AAAA,MAAA;AAAA,QACC,cAAa;AAAA,QACb,OAAO;AAAA,UACL;AAAA,YACE,OAAOnB,EAAE,sBAAsB;AAAA,YAC/B,SAAS,MAAM;AACb,cAAAM,EAAWI,CAAQ;AAAA,YACrB;AAAA,YACA,MAAM,gBAAAI,EAACM,GAAU,EAAA,eAAW,GAAC,CAAA;AAAA,UAAA;AAAA,QAC/B;AAAA,MACF;AAAA,IACF;AAAA,EAEJ,CACD;AAED,SAAIf,MAAS,uBACJ,OAGD,gBAAAS,EAAAO,GAAA,EAAS,OAAM,QAAQ,GAAGb,GAAe;AACnD;"}
1
+ {"version":3,"file":"List.js","sources":["../../../../../src/components/Company/PaySchedule/_parts/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { usePaySchedule } from '../usePaySchedule'\nimport styles from './List.module.scss'\nimport { useDataView, DataView, Flex, VisuallyHidden } from '@/components/Common'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\n\nexport const List = () => {\n const { t } = useTranslation('Company.PaySchedule')\n const Components = useComponentContext()\n const { paySchedules, mode, handleEdit } = usePaySchedule()\n\n const { ...dataViewProps } = useDataView({\n data: paySchedules || [],\n columns: [\n {\n title: t('payScheduleList.name'),\n key: 'customName',\n render: schedule => {\n const hasName = !!schedule.name\n let displayName = hasName ? schedule.name : schedule.customName\n if (displayName && displayName.length > 1) {\n displayName = displayName.charAt(0).toUpperCase() + displayName.slice(1)\n } else {\n displayName = schedule.customName\n }\n const displayFrequency = schedule.customName\n return (\n <Flex flexDirection={'column'} gap={0}>\n <div className={styles.content}>\n <div>{displayName}</div>\n {hasName && <div>{displayFrequency}</div>}\n </div>\n </Flex>\n )\n },\n },\n {\n title: <VisuallyHidden>{t('payScheduleList.active')}</VisuallyHidden>,\n key: 'active',\n render: schedule => (\n <Flex alignItems={'center'} justifyContent={'center'}>\n <div className={styles.content}>\n {schedule.active ? (\n <Components.Badge status=\"success\">{t('payScheduleList.active')}</Components.Badge>\n ) : (\n <Components.Badge status=\"info\">{t('payScheduleList.inactive')}</Components.Badge>\n )}\n </div>\n </Flex>\n ),\n },\n ],\n itemMenu: schedule => {\n return (\n <HamburgerMenu\n triggerLabel=\"Actions\"\n items={[\n {\n label: t('payScheduleList.edit'),\n onClick: () => {\n handleEdit(schedule)\n },\n icon: <PencilSvg aria-hidden />,\n },\n ]}\n />\n )\n },\n })\n\n if (mode !== 'LIST_PAY_SCHEDULES') {\n return null\n }\n\n return <DataView label=\"test\" {...dataViewProps} />\n}\n"],"names":["List","t","useTranslation","Components","useComponentContext","paySchedules","mode","handleEdit","usePaySchedule","dataViewProps","useDataView","schedule","hasName","displayName","displayFrequency","jsx","Flex","jsxs","styles","VisuallyHidden","HamburgerMenu","PencilSvg","DataView"],"mappings":";;;;;;;;;;;;AAQO,MAAMA,IAAO,MAAM;AACxB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5CC,IAAaC,EAAoB,GACjC,EAAE,cAAAC,GAAc,MAAAC,GAAM,YAAAC,EAAA,IAAeC,EAAe,GAEpD,EAAE,GAAGC,EAAc,IAAIC,EAAY;AAAA,IACvC,MAAML,KAAgB,CAAC;AAAA,IACvB,SAAS;AAAA,MACP;AAAA,QACE,OAAOJ,EAAE,sBAAsB;AAAA,QAC/B,KAAK;AAAA,QACL,QAAQ,CAAYU,MAAA;AACZ,gBAAAC,IAAU,CAAC,CAACD,EAAS;AAC3B,cAAIE,IAAcD,IAAUD,EAAS,OAAOA,EAAS;AACjD,UAAAE,KAAeA,EAAY,SAAS,IACxBA,IAAAA,EAAY,OAAO,CAAC,EAAE,gBAAgBA,EAAY,MAAM,CAAC,IAEvEA,IAAcF,EAAS;AAEzB,gBAAMG,IAAmBH,EAAS;AAEhC,iBAAA,gBAAAI,EAACC,GAAK,EAAA,eAAe,UAAU,KAAK,GAClC,UAAC,gBAAAC,EAAA,OAAA,EAAI,WAAWC,EAAO,SACrB,UAAA;AAAA,YAAA,gBAAAH,EAAC,SAAK,UAAYF,EAAA,CAAA;AAAA,YACjBD,KAAY,gBAAAG,EAAA,OAAA,EAAK,UAAiBD,EAAA,CAAA;AAAA,UAAA,EAAA,CACrC,EACF,CAAA;AAAA,QAAA;AAAA,MAGN;AAAA,MACA;AAAA,QACE,OAAO,gBAAAC,EAACI,GAAgB,EAAA,UAAAlB,EAAE,wBAAwB,GAAE;AAAA,QACpD,KAAK;AAAA,QACL,QAAQ,CAAAU,MACL,gBAAAI,EAAAC,GAAA,EAAK,YAAY,UAAU,gBAAgB,UAC1C,UAAA,gBAAAD,EAAC,SAAI,WAAWG,EAAO,SACpB,UAAAP,EAAS,SACP,gBAAAI,EAAAZ,EAAW,OAAX,EAAiB,QAAO,WAAW,UAAAF,EAAE,wBAAwB,EAAE,CAAA,IAE/D,gBAAAc,EAAAZ,EAAW,OAAX,EAAiB,QAAO,QAAQ,UAAAF,EAAE,0BAA0B,GAAE,GAEnE,EACF,CAAA;AAAA,MAAA;AAAA,IAGN;AAAA,IACA,UAAU,CAAYU,MAElB,gBAAAI;AAAA,MAACK;AAAA,MAAA;AAAA,QACC,cAAa;AAAA,QACb,OAAO;AAAA,UACL;AAAA,YACE,OAAOnB,EAAE,sBAAsB;AAAA,YAC/B,SAAS,MAAM;AACb,cAAAM,EAAWI,CAAQ;AAAA,YACrB;AAAA,YACA,MAAM,gBAAAI,EAACM,GAAU,EAAA,eAAW,GAAC,CAAA;AAAA,UAAA;AAAA,QAC/B;AAAA,MACF;AAAA,IACF;AAAA,EAEJ,CACD;AAED,SAAIf,MAAS,uBACJ,OAGD,gBAAAS,EAAAO,GAAA,EAAS,OAAM,QAAQ,GAAGb,GAAe;AACnD;"}
@@ -6,12 +6,14 @@ import "react-i18next";
6
6
  import "@gusto/embedded-api/models/errors/apierror";
7
7
  import "@gusto/embedded-api/models/errors/sdkvalidationerror";
8
8
  import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
9
+ import "@tanstack/react-query";
9
10
  import "../../Base/useBase.js";
10
11
  import "../../../shared/constants.js";
12
+ import "classnames";
11
13
  import "dompurify";
12
14
  import "../../../contexts/ComponentAdapter/useComponentContext.js";
13
15
  import { createCompoundContext as e } from "../../Base/createCompoundContext.js";
14
- const P = o.object({
16
+ const w = o.object({
15
17
  frequency: o.enum(["Every week", "Every other week", "Twice per month", "Monthly"]),
16
18
  anchorPayDate: o.date().optional(),
17
19
  anchorEndOfPayPeriod: o.date().optional(),
@@ -20,10 +22,10 @@ const P = o.object({
20
22
  customName: o.string().optional(),
21
23
  customTwicePerMonth: o.string().optional(),
22
24
  payPeriodPreviewRange: o.number().optional()
23
- }), [s, w] = e("PayScheduleContext");
25
+ }), [x, S] = e("PayScheduleContext");
24
26
  export {
25
- w as PayScheduleProvider,
26
- P as PayScheduleSchema,
27
- s as usePaySchedule
27
+ S as PayScheduleProvider,
28
+ w as PayScheduleSchema,
29
+ x as usePaySchedule
28
30
  };
29
31
  //# sourceMappingURL=usePaySchedule.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"usePaySchedule.js","sources":["../../../../src/components/Company/PaySchedule/usePaySchedule.ts"],"sourcesContent":["import type { PayScheduleCreateUpdate } from '@gusto/embedded-api/models/components/payschedulecreateupdate'\nimport type { PayScheduleList } from '@gusto/embedded-api/models/components/payschedulelist'\nimport type { PayScheduleObject as PayScheduleType } from '@gusto/embedded-api/models/components/payscheduleobject'\nimport type { PayPeriods } from '@gusto/embedded-api/models/operations/getv1companiescompanyidpayschedulespreview'\nimport { z } from 'zod'\nimport type { RequireAtLeastOne } from '@/types/Helpers'\nimport { createCompoundContext } from '@/components/Base'\n\nexport type MODE =\n | 'LIST_PAY_SCHEDULES'\n | 'ADD_PAY_SCHEDULE'\n | 'EDIT_PAY_SCHEDULE'\n | 'PREVIEW_PAY_SCHEDULE'\n\ntype PayScheduleContextType = {\n companyId: string\n handleAdd: () => void\n handleEdit: (schedule: PayScheduleType) => void\n handleCancel: () => void\n handleContinue: () => void\n mode: MODE\n paySchedules: PayScheduleList[] | undefined | null\n currentPaySchedule: PayScheduleType | undefined | null\n payPeriodPreview?: PayPeriods[]\n payPreviewLoading?: boolean\n}\n\nexport const PayScheduleSchema = z.object({\n frequency: z.enum(['Every week', 'Every other week', 'Twice per month', 'Monthly']),\n anchorPayDate: z.date().optional(),\n anchorEndOfPayPeriod: z.date().optional(),\n day1: z.number().min(1).max(31).optional(),\n day2: z.number().min(1).max(31).optional(),\n customName: z.string().optional(),\n customTwicePerMonth: z.string().optional(),\n payPeriodPreviewRange: z.number().optional(),\n})\n\nexport type PayScheduleInputs = z.input<typeof PayScheduleSchema>\nexport type PayScheduleOutputs = z.output<typeof PayScheduleSchema>\n\nexport type PayScheduleDefaultValues = RequireAtLeastOne<\n Partial<\n Pick<\n PayScheduleCreateUpdate,\n 'anchorPayDate' | 'anchorEndOfPayPeriod' | 'day1' | 'day2' | 'customName' | 'frequency'\n >\n >\n>\n\nconst [usePaySchedule, PayScheduleProvider] =\n createCompoundContext<PayScheduleContextType>('PayScheduleContext')\nexport { usePaySchedule, PayScheduleProvider }\n"],"names":["PayScheduleSchema","z","usePaySchedule","PayScheduleProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;AA2Ba,MAAAA,IAAoBC,EAAE,OAAO;AAAA,EACxC,WAAWA,EAAE,KAAK,CAAC,cAAc,oBAAoB,mBAAmB,SAAS,CAAC;AAAA,EAClF,eAAeA,EAAE,KAAK,EAAE,SAAS;AAAA,EACjC,sBAAsBA,EAAE,KAAK,EAAE,SAAS;AAAA,EACxC,MAAMA,EAAE,OAAA,EAAS,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,SAAS;AAAA,EACzC,MAAMA,EAAE,OAAA,EAAS,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,SAAS;AAAA,EACzC,YAAYA,EAAE,OAAO,EAAE,SAAS;AAAA,EAChC,qBAAqBA,EAAE,OAAO,EAAE,SAAS;AAAA,EACzC,uBAAuBA,EAAE,OAAO,EAAE,SAAS;AAC7C,CAAC,GAcK,CAACC,GAAgBC,CAAmB,IACxCC,EAA8C,oBAAoB;"}
1
+ {"version":3,"file":"usePaySchedule.js","sources":["../../../../src/components/Company/PaySchedule/usePaySchedule.ts"],"sourcesContent":["import type { PayScheduleCreateUpdate } from '@gusto/embedded-api/models/components/payschedulecreateupdate'\nimport type { PayScheduleList } from '@gusto/embedded-api/models/components/payschedulelist'\nimport type { PayScheduleObject as PayScheduleType } from '@gusto/embedded-api/models/components/payscheduleobject'\nimport type { PayPeriods } from '@gusto/embedded-api/models/operations/getv1companiescompanyidpayschedulespreview'\nimport { z } from 'zod'\nimport type { RequireAtLeastOne } from '@/types/Helpers'\nimport { createCompoundContext } from '@/components/Base'\n\nexport type MODE =\n | 'LIST_PAY_SCHEDULES'\n | 'ADD_PAY_SCHEDULE'\n | 'EDIT_PAY_SCHEDULE'\n | 'PREVIEW_PAY_SCHEDULE'\n\ntype PayScheduleContextType = {\n companyId: string\n handleAdd: () => void\n handleEdit: (schedule: PayScheduleType) => void\n handleCancel: () => void\n handleContinue: () => void\n mode: MODE\n paySchedules: PayScheduleList[] | undefined | null\n currentPaySchedule: PayScheduleType | undefined | null\n payPeriodPreview?: PayPeriods[]\n payPreviewLoading?: boolean\n}\n\nexport const PayScheduleSchema = z.object({\n frequency: z.enum(['Every week', 'Every other week', 'Twice per month', 'Monthly']),\n anchorPayDate: z.date().optional(),\n anchorEndOfPayPeriod: z.date().optional(),\n day1: z.number().min(1).max(31).optional(),\n day2: z.number().min(1).max(31).optional(),\n customName: z.string().optional(),\n customTwicePerMonth: z.string().optional(),\n payPeriodPreviewRange: z.number().optional(),\n})\n\nexport type PayScheduleInputs = z.input<typeof PayScheduleSchema>\nexport type PayScheduleOutputs = z.output<typeof PayScheduleSchema>\n\nexport type PayScheduleDefaultValues = RequireAtLeastOne<\n Partial<\n Pick<\n PayScheduleCreateUpdate,\n 'anchorPayDate' | 'anchorEndOfPayPeriod' | 'day1' | 'day2' | 'customName' | 'frequency'\n >\n >\n>\n\nconst [usePaySchedule, PayScheduleProvider] =\n createCompoundContext<PayScheduleContextType>('PayScheduleContext')\nexport { usePaySchedule, PayScheduleProvider }\n"],"names":["PayScheduleSchema","z","usePaySchedule","PayScheduleProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;AA2Ba,MAAAA,IAAoBC,EAAE,OAAO;AAAA,EACxC,WAAWA,EAAE,KAAK,CAAC,cAAc,oBAAoB,mBAAmB,SAAS,CAAC;AAAA,EAClF,eAAeA,EAAE,KAAK,EAAE,SAAS;AAAA,EACjC,sBAAsBA,EAAE,KAAK,EAAE,SAAS;AAAA,EACxC,MAAMA,EAAE,OAAA,EAAS,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,SAAS;AAAA,EACzC,MAAMA,EAAE,OAAA,EAAS,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,SAAS;AAAA,EACzC,YAAYA,EAAE,OAAO,EAAE,SAAS;AAAA,EAChC,qBAAqBA,EAAE,OAAO,EAAE,SAAS;AAAA,EACzC,uBAAuBA,EAAE,OAAO,EAAE,SAAS;AAC7C,CAAC,GAcK,CAACC,GAAgBC,CAAmB,IACxCC,EAA8C,oBAAoB;"}
@@ -1,16 +1,17 @@
1
1
  import { jsxs as i, jsx as n } from "react/jsx-runtime";
2
2
  import { useTranslation as a } from "react-i18next";
3
3
  import { useStateTaxesForm as s } from "./context.js";
4
+ import "classnames";
4
5
  import { ActionsLayout as m } from "../../../Common/ActionsLayout/ActionsLayout.js";
5
6
  import { useComponentContext as c } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
6
- function d() {
7
- const { t } = a("Company.StateTaxes", { keyPrefix: "form" }), { handleCancel: e, isPending: r } = s(), o = c();
7
+ function x() {
8
+ const { t } = a("Company.StateTaxes", { keyPrefix: "form" }), { handleCancel: r, isPending: e } = s(), o = c();
8
9
  return /* @__PURE__ */ i(m, { children: [
9
- /* @__PURE__ */ n(o.Button, { variant: "secondary", onClick: e, children: t("cancelCta") }),
10
- /* @__PURE__ */ n(o.Button, { variant: "primary", type: "submit", isDisabled: r, children: t("saveCta") })
10
+ /* @__PURE__ */ n(o.Button, { variant: "secondary", onClick: r, children: t("cancelCta") }),
11
+ /* @__PURE__ */ n(o.Button, { variant: "primary", type: "submit", isDisabled: e, children: t("saveCta") })
11
12
  ] });
12
13
  }
13
14
  export {
14
- d as Actions
15
+ x as Actions
15
16
  };
16
17
  //# sourceMappingURL=Actions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesForm/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useStateTaxesForm } from './context'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { t } = useTranslation('Company.StateTaxes', { keyPrefix: 'form' })\n const { handleCancel, isPending } = useStateTaxesForm()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleCancel}>\n {t('cancelCta')}\n </Components.Button>\n <Components.Button variant=\"primary\" type=\"submit\" isDisabled={isPending}>\n {t('saveCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","useTranslation","handleCancel","isPending","useStateTaxesForm","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;;;AAKO,SAASA,IAAU;AAClB,QAAA,EAAE,MAAMC,EAAe,sBAAsB,EAAE,WAAW,QAAQ,GAClE,EAAE,cAAAC,GAAc,WAAAC,EAAU,IAAIC,EAAkB,GAChDC,IAAaC,EAAoB;AAEvC,2BACGC,GACC,EAAA,UAAA;AAAA,IAAC,gBAAAC,EAAAH,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASH,GAC7C,UAAE,EAAA,WAAW,EAChB,CAAA;AAAA,IACC,gBAAAM,EAAAH,EAAW,QAAX,EAAkB,SAAQ,WAAU,MAAK,UAAS,YAAYF,GAC5D,UAAE,EAAA,SAAS,EACd,CAAA;AAAA,EAAA,GACF;AAEJ;"}
1
+ {"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesForm/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useStateTaxesForm } from './context'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { t } = useTranslation('Company.StateTaxes', { keyPrefix: 'form' })\n const { handleCancel, isPending } = useStateTaxesForm()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleCancel}>\n {t('cancelCta')}\n </Components.Button>\n <Components.Button variant=\"primary\" type=\"submit\" isDisabled={isPending}>\n {t('saveCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","useTranslation","handleCancel","isPending","useStateTaxesForm","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;;;;AAKO,SAASA,IAAU;AAClB,QAAA,EAAE,MAAMC,EAAe,sBAAsB,EAAE,WAAW,QAAQ,GAClE,EAAE,cAAAC,GAAc,WAAAC,EAAU,IAAIC,EAAkB,GAChDC,IAAaC,EAAoB;AAEvC,2BACGC,GACC,EAAA,UAAA;AAAA,IAAC,gBAAAC,EAAAH,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASH,GAC7C,UAAE,EAAA,WAAW,EAChB,CAAA;AAAA,IACC,gBAAAM,EAAAH,EAAW,QAAX,EAAkB,SAAQ,WAAU,MAAK,UAAS,YAAYF,GAC5D,UAAE,EAAA,SAAS,EACd,CAAA;AAAA,EAAA,GACF;AAEJ;"}
@@ -5,14 +5,16 @@ import "react-i18next";
5
5
  import "@gusto/embedded-api/models/errors/apierror";
6
6
  import "@gusto/embedded-api/models/errors/sdkvalidationerror";
7
7
  import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
8
+ import "@tanstack/react-query";
8
9
  import "../../../Base/useBase.js";
9
10
  import "../../../../shared/constants.js";
11
+ import "classnames";
10
12
  import "dompurify";
11
13
  import "../../../../contexts/ComponentAdapter/useComponentContext.js";
12
14
  import { createCompoundContext as t } from "../../../Base/createCompoundContext.js";
13
- const [S, T] = t("StateTaxesFormContext");
15
+ const [c, d] = t("StateTaxesFormContext");
14
16
  export {
15
- T as StateTaxesFormProvider,
16
- S as useStateTaxesForm
17
+ d as StateTaxesFormProvider,
18
+ c as useStateTaxesForm
17
19
  };
18
20
  //# sourceMappingURL=context.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesForm/context.ts"],"sourcesContent":["import type { TaxRequirementsState } from '@gusto/embedded-api/models/components/taxrequirementsstate'\nimport { createCompoundContext } from '@/components/Base'\n\ninterface StateTaxFormContext {\n isPending: boolean\n state: string\n stateTaxRequirements: TaxRequirementsState\n handleCancel: () => void\n}\n\nconst [useStateTaxesForm, StateTaxesFormProvider] =\n createCompoundContext<StateTaxFormContext>('StateTaxesFormContext')\n\nexport { useStateTaxesForm, StateTaxesFormProvider }\n"],"names":["useStateTaxesForm","StateTaxesFormProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;AAUA,MAAM,CAACA,GAAmBC,CAAsB,IAC9CC,EAA2C,uBAAuB;"}
1
+ {"version":3,"file":"context.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesForm/context.ts"],"sourcesContent":["import type { TaxRequirementsState } from '@gusto/embedded-api/models/components/taxrequirementsstate'\nimport { createCompoundContext } from '@/components/Base'\n\ninterface StateTaxFormContext {\n isPending: boolean\n state: string\n stateTaxRequirements: TaxRequirementsState\n handleCancel: () => void\n}\n\nconst [useStateTaxesForm, StateTaxesFormProvider] =\n createCompoundContext<StateTaxFormContext>('StateTaxesFormContext')\n\nexport { useStateTaxesForm, StateTaxesFormProvider }\n"],"names":["useStateTaxesForm","StateTaxesFormProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;AAUA,MAAM,CAACA,GAAmBC,CAAsB,IAC9CC,EAA2C,uBAAuB;"}
@@ -1,13 +1,14 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
2
  import { useTranslation as i } from "react-i18next";
3
3
  import { useStateTaxesList as e } from "./context.js";
4
- import { ActionsLayout as s } from "../../../Common/ActionsLayout/ActionsLayout.js";
5
- import { useComponentContext as m } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
6
- function f() {
7
- const { t: o } = i("Company.StateTaxes"), n = m(), { handleContinue: r } = e();
8
- return /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(n.Button, { variant: "primary", onClick: r, children: o("list.continueCta") }) });
4
+ import "classnames";
5
+ import { ActionsLayout as m } from "../../../Common/ActionsLayout/ActionsLayout.js";
6
+ import { useComponentContext as s } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
7
+ function l() {
8
+ const { t: o } = i("Company.StateTaxes"), n = s(), { handleContinue: r } = e();
9
+ return /* @__PURE__ */ t(m, { children: /* @__PURE__ */ t(n.Button, { variant: "primary", onClick: r, children: o("list.continueCta") }) });
9
10
  }
10
11
  export {
11
- f as Actions
12
+ l as Actions
12
13
  };
13
14
  //# sourceMappingURL=Actions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesList/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useStateTaxesList } from './context'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { t } = useTranslation('Company.StateTaxes')\n const Components = useComponentContext()\n const { handleContinue } = useStateTaxesList()\n return (\n <ActionsLayout>\n <Components.Button variant=\"primary\" onClick={handleContinue}>\n {t('list.continueCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","t","useTranslation","Components","useComponentContext","handleContinue","useStateTaxesList","jsx","ActionsLayout"],"mappings":";;;;;AAKO,SAASA,IAAU;AACxB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,oBAAoB,GAC3CC,IAAaC,EAAoB,GACjC,EAAE,gBAAAC,EAAe,IAAIC,EAAkB;AAC7C,SACG,gBAAAC,EAAAC,GAAA,EACC,UAAC,gBAAAD,EAAAJ,EAAW,QAAX,EAAkB,SAAQ,WAAU,SAASE,GAC3C,UAAEJ,EAAA,kBAAkB,EACvB,CAAA,GACF;AAEJ;"}
1
+ {"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesList/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useStateTaxesList } from './context'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { t } = useTranslation('Company.StateTaxes')\n const Components = useComponentContext()\n const { handleContinue } = useStateTaxesList()\n return (\n <ActionsLayout>\n <Components.Button variant=\"primary\" onClick={handleContinue}>\n {t('list.continueCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","t","useTranslation","Components","useComponentContext","handleContinue","useStateTaxesList","jsx","ActionsLayout"],"mappings":";;;;;;AAKO,SAASA,IAAU;AACxB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,oBAAoB,GAC3CC,IAAaC,EAAoB,GACjC,EAAE,gBAAAC,EAAe,IAAIC,EAAkB;AAC7C,SACG,gBAAAC,EAAAC,GAAA,EACC,UAAC,gBAAAD,EAAAJ,EAAW,QAAX,EAAkB,SAAQ,WAAU,SAASE,GAC3C,UAAEJ,EAAA,kBAAkB,EACvB,CAAA,GACF;AAEJ;"}
@@ -1,13 +1,14 @@
1
1
  import { jsx as s, Fragment as p } from "react/jsx-runtime";
2
2
  import { useTranslation as o } from "react-i18next";
3
3
  import { useStateTaxesList as l } from "./context.js";
4
+ import "classnames";
4
5
  import { EmptyData as c } from "../../../Common/EmptyData/EmptyData.js";
5
6
  import { useComponentContext as u } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
6
7
  import { useDataView as d } from "../../../Common/DataView/useDataView.js";
7
8
  import { DataView as C } from "../../../Common/DataView/DataView.js";
8
- const S = () => {
9
- const { stateTaxRequirements: n, handleChange: r } = l(), a = u(), { t } = o("Company.StateTaxes", { keyPrefix: "list" }), { t: i } = o("common", { keyPrefix: "statesHash" }), { ...m } = d({
10
- data: n,
9
+ const k = () => {
10
+ const { stateTaxRequirements: r, handleChange: n } = l(), a = u(), { t } = o("Company.StateTaxes", { keyPrefix: "list" }), { t: i } = o("common", { keyPrefix: "statesHash" }), { ...m } = d({
11
+ data: r,
11
12
  columns: [
12
13
  {
13
14
  key: "state",
@@ -25,7 +26,7 @@ const S = () => {
25
26
  {
26
27
  variant: "secondary",
27
28
  onClick: () => {
28
- r(e.state);
29
+ n(e.state);
29
30
  },
30
31
  children: e.setupComplete ? t("editStateTaxCta") : t("continueStateTaxSetupCta")
31
32
  }
@@ -35,6 +36,6 @@ const S = () => {
35
36
  return /* @__PURE__ */ s(C, { label: t("requirementsListLabel"), ...m });
36
37
  };
37
38
  export {
38
- S as List
39
+ k as List
39
40
  };
40
41
  //# sourceMappingURL=List.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"List.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesList/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useStateTaxesList } from './context'\nimport { DataView, EmptyData, useDataView } from '@/components/Common'\nimport type { STATES_ABBR } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const List = () => {\n const { stateTaxRequirements, handleChange } = useStateTaxesList()\n const Components = useComponentContext()\n\n const { t } = useTranslation('Company.StateTaxes', { keyPrefix: 'list' })\n const { t: statesHash } = useTranslation('common', { keyPrefix: 'statesHash' })\n\n const { ...dataViewProps } = useDataView({\n data: stateTaxRequirements,\n columns: [\n {\n key: 'state',\n title: t('requirementsListCol1'),\n render: requirement => {\n return <span>{statesHash(requirement.state as (typeof STATES_ABBR)[number])}</span>\n },\n },\n {\n key: 'status',\n title: t('requirementsListCol2'),\n render: requirement => {\n return (\n <>\n <Components.Badge status={requirement.setupComplete ? 'success' : 'warning'}>\n {requirement.setupComplete ? t('completeBadge') : t('incompleteBadge')}\n </Components.Badge>\n </>\n )\n },\n },\n ],\n itemMenu: requirement => {\n return (\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n handleChange(requirement.state)\n }}\n >\n {requirement.setupComplete ? t('editStateTaxCta') : t('continueStateTaxSetupCta')}\n </Components.Button>\n )\n },\n\n emptyState: () => (\n <EmptyData title={t('emptyTableTitle')} description={t('emptyTableDescription')} />\n ),\n })\n return <DataView label={t('requirementsListLabel')} {...dataViewProps} />\n}\n"],"names":["List","stateTaxRequirements","handleChange","useStateTaxesList","Components","useComponentContext","useTranslation","statesHash","dataViewProps","useDataView","requirement","jsx","EmptyData","DataView"],"mappings":";;;;;;;AAMO,MAAMA,IAAO,MAAM;AACxB,QAAM,EAAE,sBAAAC,GAAsB,cAAAC,EAAa,IAAIC,EAAkB,GAC3DC,IAAaC,EAAoB,GAEjC,EAAE,MAAMC,EAAe,sBAAsB,EAAE,WAAW,QAAQ,GAClE,EAAE,GAAGC,MAAeD,EAAe,UAAU,EAAE,WAAW,cAAc,GAExE,EAAE,GAAGE,EAAc,IAAIC,EAAY;AAAA,IACvC,MAAMR;AAAA,IACN,SAAS;AAAA,MACP;AAAA,QACE,KAAK;AAAA,QACL,OAAO,EAAE,sBAAsB;AAAA,QAC/B,QAAQ,CAAeS,MACb,gBAAAC,EAAA,QAAA,EAAM,UAAWJ,EAAAG,EAAY,KAAqC,GAAE;AAAA,MAEhF;AAAA,MACA;AAAA,QACE,KAAK;AAAA,QACL,OAAO,EAAE,sBAAsB;AAAA,QAC/B,QAAQ,CAAeA,6BAGjB,UAAC,gBAAAC,EAAAP,EAAW,OAAX,EAAiB,QAAQM,EAAY,gBAAgB,YAAY,WAC/D,UAAAA,EAAY,gBAAgB,EAAE,eAAe,IAAI,EAAE,iBAAiB,EACvE,CAAA,GACF;AAAA,MAEJ;AAAA,IAEJ;AAAA,IACA,UAAU,CAAeA,MAErB,gBAAAC;AAAA,MAACP,EAAW;AAAA,MAAX;AAAA,QACC,SAAQ;AAAA,QACR,SAAS,MAAM;AACb,UAAAF,EAAaQ,EAAY,KAAK;AAAA,QAChC;AAAA,QAEC,YAAY,gBAAgB,EAAE,iBAAiB,IAAI,EAAE,0BAA0B;AAAA,MAAA;AAAA,IAClF;AAAA,IAIJ,YAAY,MACV,gBAAAC,EAACC,GAAU,EAAA,OAAO,EAAE,iBAAiB,GAAG,aAAa,EAAE,uBAAuB,EAAG,CAAA;AAAA,EAAA,CAEpF;AACD,2BAAQC,GAAS,EAAA,OAAO,EAAE,uBAAuB,GAAI,GAAGL,GAAe;AACzE;"}
1
+ {"version":3,"file":"List.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesList/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useStateTaxesList } from './context'\nimport { DataView, EmptyData, useDataView } from '@/components/Common'\nimport type { STATES_ABBR } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const List = () => {\n const { stateTaxRequirements, handleChange } = useStateTaxesList()\n const Components = useComponentContext()\n\n const { t } = useTranslation('Company.StateTaxes', { keyPrefix: 'list' })\n const { t: statesHash } = useTranslation('common', { keyPrefix: 'statesHash' })\n\n const { ...dataViewProps } = useDataView({\n data: stateTaxRequirements,\n columns: [\n {\n key: 'state',\n title: t('requirementsListCol1'),\n render: requirement => {\n return <span>{statesHash(requirement.state as (typeof STATES_ABBR)[number])}</span>\n },\n },\n {\n key: 'status',\n title: t('requirementsListCol2'),\n render: requirement => {\n return (\n <>\n <Components.Badge status={requirement.setupComplete ? 'success' : 'warning'}>\n {requirement.setupComplete ? t('completeBadge') : t('incompleteBadge')}\n </Components.Badge>\n </>\n )\n },\n },\n ],\n itemMenu: requirement => {\n return (\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n handleChange(requirement.state)\n }}\n >\n {requirement.setupComplete ? t('editStateTaxCta') : t('continueStateTaxSetupCta')}\n </Components.Button>\n )\n },\n\n emptyState: () => (\n <EmptyData title={t('emptyTableTitle')} description={t('emptyTableDescription')} />\n ),\n })\n return <DataView label={t('requirementsListLabel')} {...dataViewProps} />\n}\n"],"names":["List","stateTaxRequirements","handleChange","useStateTaxesList","Components","useComponentContext","useTranslation","statesHash","dataViewProps","useDataView","requirement","jsx","EmptyData","DataView"],"mappings":";;;;;;;;AAMO,MAAMA,IAAO,MAAM;AACxB,QAAM,EAAE,sBAAAC,GAAsB,cAAAC,EAAa,IAAIC,EAAkB,GAC3DC,IAAaC,EAAoB,GAEjC,EAAE,MAAMC,EAAe,sBAAsB,EAAE,WAAW,QAAQ,GAClE,EAAE,GAAGC,MAAeD,EAAe,UAAU,EAAE,WAAW,cAAc,GAExE,EAAE,GAAGE,EAAc,IAAIC,EAAY;AAAA,IACvC,MAAMR;AAAA,IACN,SAAS;AAAA,MACP;AAAA,QACE,KAAK;AAAA,QACL,OAAO,EAAE,sBAAsB;AAAA,QAC/B,QAAQ,CAAeS,MACb,gBAAAC,EAAA,QAAA,EAAM,UAAWJ,EAAAG,EAAY,KAAqC,GAAE;AAAA,MAEhF;AAAA,MACA;AAAA,QACE,KAAK;AAAA,QACL,OAAO,EAAE,sBAAsB;AAAA,QAC/B,QAAQ,CAAeA,6BAGjB,UAAC,gBAAAC,EAAAP,EAAW,OAAX,EAAiB,QAAQM,EAAY,gBAAgB,YAAY,WAC/D,UAAAA,EAAY,gBAAgB,EAAE,eAAe,IAAI,EAAE,iBAAiB,EACvE,CAAA,GACF;AAAA,MAEJ;AAAA,IAEJ;AAAA,IACA,UAAU,CAAeA,MAErB,gBAAAC;AAAA,MAACP,EAAW;AAAA,MAAX;AAAA,QACC,SAAQ;AAAA,QACR,SAAS,MAAM;AACb,UAAAF,EAAaQ,EAAY,KAAK;AAAA,QAChC;AAAA,QAEC,YAAY,gBAAgB,EAAE,iBAAiB,IAAI,EAAE,0BAA0B;AAAA,MAAA;AAAA,IAClF;AAAA,IAIJ,YAAY,MACV,gBAAAC,EAACC,GAAU,EAAA,OAAO,EAAE,iBAAiB,GAAG,aAAa,EAAE,uBAAuB,EAAG,CAAA;AAAA,EAAA,CAEpF;AACD,2BAAQC,GAAS,EAAA,OAAO,EAAE,uBAAuB,GAAI,GAAGL,GAAe;AACzE;"}
@@ -5,14 +5,16 @@ import "react-i18next";
5
5
  import "@gusto/embedded-api/models/errors/apierror";
6
6
  import "@gusto/embedded-api/models/errors/sdkvalidationerror";
7
7
  import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
8
+ import "@tanstack/react-query";
8
9
  import "../../../Base/useBase.js";
9
10
  import "../../../../shared/constants.js";
11
+ import "classnames";
10
12
  import "dompurify";
11
13
  import "../../../../contexts/ComponentAdapter/useComponentContext.js";
12
14
  import { createCompoundContext as t } from "../../../Base/createCompoundContext.js";
13
- const [S, T] = t("StateTaxesListContext");
15
+ const [c, d] = t("StateTaxesListContext");
14
16
  export {
15
- T as StateTaxesListProvider,
16
- S as useStateTaxesList
17
+ d as StateTaxesListProvider,
18
+ c as useStateTaxesList
17
19
  };
18
20
  //# sourceMappingURL=context.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesList/context.ts"],"sourcesContent":["import type { ResponseBody } from '@gusto/embedded-api/models/operations/getv1companiescompanyuuidtaxrequirements'\nimport { createCompoundContext } from '@/components/Base'\n\ntype StateTaxesListContextType = {\n isPending: boolean\n stateTaxRequirements: ResponseBody[]\n handleContinue: () => void\n handleChange: (state: string) => void\n}\n\nconst [useStateTaxesList, StateTaxesListProvider] =\n createCompoundContext<StateTaxesListContextType>('StateTaxesListContext')\n\nexport { useStateTaxesList, StateTaxesListProvider }\n"],"names":["useStateTaxesList","StateTaxesListProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;AAUA,MAAM,CAACA,GAAmBC,CAAsB,IAC9CC,EAAiD,uBAAuB;"}
1
+ {"version":3,"file":"context.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesList/context.ts"],"sourcesContent":["import type { ResponseBody } from '@gusto/embedded-api/models/operations/getv1companiescompanyuuidtaxrequirements'\nimport { createCompoundContext } from '@/components/Base'\n\ntype StateTaxesListContextType = {\n isPending: boolean\n stateTaxRequirements: ResponseBody[]\n handleContinue: () => void\n handleChange: (state: string) => void\n}\n\nconst [useStateTaxesList, StateTaxesListProvider] =\n createCompoundContext<StateTaxesListContextType>('StateTaxesListContext')\n\nexport { useStateTaxesList, StateTaxesListProvider }\n"],"names":["useStateTaxesList","StateTaxesListProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;AAUA,MAAM,CAACA,GAAmBC,CAAsB,IAC9CC,EAAiD,uBAAuB;"}
@@ -1,41 +1,42 @@
1
- import { jsx as t, jsxs as P, Fragment as T } from "react/jsx-runtime";
2
- import { useContractorsGetSuspense as U } from "@gusto/embedded-api/react-query/contractorsGet";
3
- import { useContractorsGetAddressSuspense as b, invalidateContractorsGetAddress as x } from "@gusto/embedded-api/react-query/contractorsGetAddress";
4
- import { useContractorsUpdateAddressMutation as O } from "@gusto/embedded-api/react-query/contractorsUpdateAddress";
5
- import { useQueryClient as _ } from "@tanstack/react-query";
6
- import { useForm as q, FormProvider as w } from "react-hook-form";
7
- import { zodResolver as B } from "@hookform/resolvers/zod";
8
- import { AddressFormSchema as G, AddressProvider as H } from "./useAddress.js";
9
- import { Head as u } from "./Head.js";
10
- import { Form as p } from "./Form.js";
1
+ import { jsx as t, jsxs as E, Fragment as P } from "react/jsx-runtime";
2
+ import { useContractorsGetSuspense as T } from "@gusto/embedded-api/react-query/contractorsGet";
3
+ import { useContractorsGetAddressSuspense as U } from "@gusto/embedded-api/react-query/contractorsGetAddress";
4
+ import { useContractorsUpdateAddressMutation as b } from "@gusto/embedded-api/react-query/contractorsUpdateAddress";
5
+ import { useForm as x, FormProvider as O } from "react-hook-form";
6
+ import { zodResolver as _ } from "@hookform/resolvers/zod";
7
+ import { AddressFormSchema as B, AddressProvider as H } from "./useAddress.js";
8
+ import { Head as p } from "./Head.js";
9
+ import { Form as u } from "./Form.js";
11
10
  import { Actions as f } from "./Actions.js";
12
11
  import { Form as N } from "../../Common/Form/Form.js";
13
- import { useComponentDictionary as j, useI18n as M } from "../../../i18n/I18n.js";
14
- import { Flex as Q } from "../../Common/Flex/Flex.js";
15
- import { BaseComponent as $ } from "../../Base/Base.js";
16
- import { useBase as k } from "../../Base/useBase.js";
12
+ import { useComponentDictionary as j, useI18n as q } from "../../../i18n/I18n.js";
13
+ import { Flex as w } from "../../Common/Flex/Flex.js";
14
+ import "react-i18next";
15
+ import "classnames";
16
+ import { BaseComponent as G } from "../../Base/Base.js";
17
+ import { useBase as M } from "../../Base/useBase.js";
17
18
  import { contractorEvents as a } from "../../../shared/constants.js";
18
19
  function n(r) {
19
- return /* @__PURE__ */ t($, { ...r, children: /* @__PURE__ */ t(J, { ...r, children: r.children }) });
20
+ return /* @__PURE__ */ t(G, { ...r, children: /* @__PURE__ */ t($, { ...r, children: r.children }) });
20
21
  }
21
- function J({ contractorId: r, defaultValues: o, children: i, className: A, dictionary: C }) {
22
- j("Contractor.Address", C), M("Contractor.Address");
23
- const l = _(), { onEvent: c, baseSubmitHandler: D } = k(), { data: m } = U({ contractorUuid: r }), { data: h } = b({ contractorUuid: r }), { mutateAsync: S, isPending: v } = O(), y = m.contractor, F = m.contractor?.type, e = h.contractorAddress, R = {
24
- street1: e?.street1 || o?.street1 || "",
25
- street2: e?.street2 || o?.street2 || "",
26
- city: e?.city || o?.city || "",
27
- state: e?.state || o?.state || "",
28
- zip: e?.zip || o?.zip || ""
29
- }, d = q({
30
- resolver: B(G),
31
- defaultValues: R
32
- }), g = async (z) => {
33
- await D(z, async (s) => {
34
- const { contractorAddress: E } = await S({
22
+ function $({ contractorId: r, defaultValues: e, children: i, className: A, dictionary: D }) {
23
+ j("Contractor.Address", D), q("Contractor.Address");
24
+ const { onEvent: c, baseSubmitHandler: h } = M(), { data: m } = T({ contractorUuid: r }), { data: C } = U({ contractorUuid: r }), { mutateAsync: S, isPending: l } = b(), v = m.contractor, F = m.contractor?.type, o = C.contractorAddress, y = {
25
+ street1: o?.street1 || e?.street1 || "",
26
+ street2: o?.street2 || e?.street2 || "",
27
+ city: o?.city || e?.city || "",
28
+ state: o?.state || e?.state || "",
29
+ zip: o?.zip || e?.zip || ""
30
+ }, d = x({
31
+ resolver: _(B),
32
+ defaultValues: y
33
+ }), R = async (g) => {
34
+ await h(g, async (s) => {
35
+ const { contractorAddress: z } = await S({
35
36
  request: {
36
37
  contractorUuid: r,
37
38
  requestBody: {
38
- version: e?.version,
39
+ version: o?.version,
39
40
  street1: s.street1,
40
41
  street2: s.street2,
41
42
  city: s.city,
@@ -44,28 +45,28 @@ function J({ contractorId: r, defaultValues: o, children: i, className: A, dicti
44
45
  }
45
46
  }
46
47
  });
47
- await x(l, [r]), c(a.CONTRACTOR_ADDRESS_UPDATED, E), c(a.CONTRACTOR_ADDRESS_DONE);
48
+ c(a.CONTRACTOR_ADDRESS_UPDATED, z), c(a.CONTRACTOR_ADDRESS_DONE);
48
49
  });
49
50
  };
50
51
  return /* @__PURE__ */ t("section", { className: A, children: /* @__PURE__ */ t(
51
52
  H,
52
53
  {
53
54
  value: {
54
- contractor: y,
55
+ contractor: v,
55
56
  contractorType: F,
56
- address: e,
57
- isPending: v
57
+ address: o,
58
+ isPending: l
58
59
  },
59
- children: /* @__PURE__ */ t(w, { ...d, children: /* @__PURE__ */ t(N, { onSubmit: d.handleSubmit(g), children: /* @__PURE__ */ t(Q, { flexDirection: "column", gap: 32, children: i || /* @__PURE__ */ P(T, { children: [
60
- /* @__PURE__ */ t(u, {}),
60
+ children: /* @__PURE__ */ t(O, { ...d, children: /* @__PURE__ */ t(N, { onSubmit: d.handleSubmit(R), children: /* @__PURE__ */ t(w, { flexDirection: "column", gap: 32, children: i || /* @__PURE__ */ E(P, { children: [
61
61
  /* @__PURE__ */ t(p, {}),
62
+ /* @__PURE__ */ t(u, {}),
62
63
  /* @__PURE__ */ t(f, {})
63
64
  ] }) }) }) })
64
65
  }
65
66
  ) });
66
67
  }
67
- n.Head = u;
68
- n.Form = p;
68
+ n.Head = p;
69
+ n.Form = u;
69
70
  n.Actions = f;
70
71
  export {
71
72
  n as Address,
@@ -1 +1 @@
1
- {"version":3,"file":"Address.js","sources":["../../../../src/components/Contractor/Address/Address.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { useContractorsGetSuspense } from '@gusto/embedded-api/react-query/contractorsGet'\nimport {\n useContractorsGetAddressSuspense,\n invalidateContractorsGetAddress,\n} from '@gusto/embedded-api/react-query/contractorsGetAddress'\nimport { useContractorsUpdateAddressMutation } from '@gusto/embedded-api/react-query/contractorsUpdateAddress'\nimport { useQueryClient } from '@tanstack/react-query'\nimport { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { AddressFormSchema, AddressProvider } from './useAddress'\nimport { Head } from './Head'\nimport { Form } from './Form'\nimport { Actions } from './Actions'\nimport type { AddressDefaultValues, AddressFormValues } from './useAddress'\nimport { Form as HtmlForm } from '@/components/Common/Form/Form'\nimport { useI18n, useComponentDictionary } from '@/i18n'\nimport { Flex } from '@/components/Common'\nimport type { BaseComponentInterface } from '@/components/Base/Base'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { contractorEvents } from '@/shared/constants'\n\nexport interface AddressProps extends BaseComponentInterface<'Contractor.Address'> {\n contractorId: string\n defaultValues?: AddressDefaultValues\n children?: ReactNode\n className?: string\n}\n\nexport function Address(props: AddressProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ contractorId, defaultValues, children, className, dictionary }: AddressProps) {\n useComponentDictionary('Contractor.Address', dictionary)\n useI18n('Contractor.Address')\n const queryClient = useQueryClient()\n\n const { onEvent, baseSubmitHandler } = useBase()\n\n const { data: contractorData } = useContractorsGetSuspense({ contractorUuid: contractorId })\n const { data: addressData } = useContractorsGetAddressSuspense({ contractorUuid: contractorId })\n\n const { mutateAsync: updateAddress, isPending: isUpdatingAddressPending } =\n useContractorsUpdateAddressMutation()\n\n const contractor = contractorData.contractor\n const contractorType = contractorData.contractor?.type\n const address = addressData.contractorAddress\n\n const formDefaultValues = {\n street1: address?.street1 || defaultValues?.street1 || '',\n street2: address?.street2 || defaultValues?.street2 || '',\n city: address?.city || defaultValues?.city || '',\n state: address?.state || defaultValues?.state || '',\n zip: address?.zip || defaultValues?.zip || '',\n }\n\n const formMethods = useForm<AddressFormValues>({\n resolver: zodResolver(AddressFormSchema),\n defaultValues: formDefaultValues,\n })\n\n const onSubmit = async (data: AddressFormValues) => {\n await baseSubmitHandler(data, async payload => {\n const { contractorAddress } = await updateAddress({\n request: {\n contractorUuid: contractorId,\n requestBody: {\n version: address?.version as string,\n street1: payload.street1,\n street2: payload.street2,\n city: payload.city,\n state: payload.state,\n zip: payload.zip,\n },\n },\n })\n\n await invalidateContractorsGetAddress(queryClient, [contractorId])\n\n onEvent(contractorEvents.CONTRACTOR_ADDRESS_UPDATED, contractorAddress)\n onEvent(contractorEvents.CONTRACTOR_ADDRESS_DONE)\n })\n }\n\n return (\n <section className={className}>\n <AddressProvider\n value={{\n contractor,\n contractorType,\n address,\n isPending: isUpdatingAddressPending,\n }}\n >\n <FormProvider {...formMethods}>\n <HtmlForm onSubmit={formMethods.handleSubmit(onSubmit)}>\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <Form />\n <Actions />\n </>\n )}\n </Flex>\n </HtmlForm>\n </FormProvider>\n </AddressProvider>\n </section>\n )\n}\n\nAddress.Head = Head\nAddress.Form = Form\nAddress.Actions = Actions\n\nexport default Address\n"],"names":["Address","props","jsx","BaseComponent","Root","contractorId","defaultValues","children","className","dictionary","useComponentDictionary","useI18n","queryClient","useQueryClient","onEvent","baseSubmitHandler","useBase","contractorData","useContractorsGetSuspense","addressData","useContractorsGetAddressSuspense","updateAddress","isUpdatingAddressPending","useContractorsUpdateAddressMutation","contractor","contractorType","address","formDefaultValues","formMethods","useForm","zodResolver","AddressFormSchema","onSubmit","data","payload","contractorAddress","invalidateContractorsGetAddress","contractorEvents","AddressProvider","FormProvider","HtmlForm","Flex","jsxs","Fragment","Head","Form","Actions"],"mappings":";;;;;;;;;;;;;;;;;AA8BO,SAASA,EAAQC,GAAqB;AAEzC,SAAA,gBAAAC,EAACC,GAAe,EAAA,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAMA,EAAA,SAAA,CAAS,EACnC,CAAA;AAEJ;AAEA,SAASG,EAAK,EAAE,cAAAC,GAAc,eAAAC,GAAe,UAAAC,GAAU,WAAAC,GAAW,YAAAC,KAA4B;AAC5F,EAAAC,EAAuB,sBAAsBD,CAAU,GACvDE,EAAQ,oBAAoB;AAC5B,QAAMC,IAAcC,EAAe,GAE7B,EAAE,SAAAC,GAAS,mBAAAC,EAAkB,IAAIC,EAAQ,GAEzC,EAAE,MAAMC,EAAe,IAAIC,EAA0B,EAAE,gBAAgBb,GAAc,GACrF,EAAE,MAAMc,EAAY,IAAIC,EAAiC,EAAE,gBAAgBf,GAAc,GAEzF,EAAE,aAAagB,GAAe,WAAWC,EAAA,IAC7CC,EAAoC,GAEhCC,IAAaP,EAAe,YAC5BQ,IAAiBR,EAAe,YAAY,MAC5CS,IAAUP,EAAY,mBAEtBQ,IAAoB;AAAA,IACxB,SAASD,GAAS,WAAWpB,GAAe,WAAW;AAAA,IACvD,SAASoB,GAAS,WAAWpB,GAAe,WAAW;AAAA,IACvD,MAAMoB,GAAS,QAAQpB,GAAe,QAAQ;AAAA,IAC9C,OAAOoB,GAAS,SAASpB,GAAe,SAAS;AAAA,IACjD,KAAKoB,GAAS,OAAOpB,GAAe,OAAO;AAAA,EAC7C,GAEMsB,IAAcC,EAA2B;AAAA,IAC7C,UAAUC,EAAYC,CAAiB;AAAA,IACvC,eAAeJ;AAAA,EAAA,CAChB,GAEKK,IAAW,OAAOC,MAA4B;AAC5C,UAAAlB,EAAkBkB,GAAM,OAAMC,MAAW;AAC7C,YAAM,EAAE,mBAAAC,MAAsB,MAAMd,EAAc;AAAA,QAChD,SAAS;AAAA,UACP,gBAAgBhB;AAAA,UAChB,aAAa;AAAA,YACX,SAASqB,GAAS;AAAA,YAClB,SAASQ,EAAQ;AAAA,YACjB,SAASA,EAAQ;AAAA,YACjB,MAAMA,EAAQ;AAAA,YACd,OAAOA,EAAQ;AAAA,YACf,KAAKA,EAAQ;AAAA,UAAA;AAAA,QACf;AAAA,MACF,CACD;AAED,YAAME,EAAgCxB,GAAa,CAACP,CAAY,CAAC,GAEzDS,EAAAuB,EAAiB,4BAA4BF,CAAiB,GACtErB,EAAQuB,EAAiB,uBAAuB;AAAA,IAAA,CACjD;AAAA,EACH;AAGE,SAAA,gBAAAnC,EAAC,aAAQ,WAAAM,GACP,UAAA,gBAAAN;AAAA,IAACoC;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,YAAAd;AAAA,QACA,gBAAAC;AAAA,QACA,SAAAC;AAAA,QACA,WAAWJ;AAAA,MACb;AAAA,MAEA,4BAACiB,GAAc,EAAA,GAAGX,GAChB,UAAC,gBAAA1B,EAAAsC,GAAA,EAAS,UAAUZ,EAAY,aAAaI,CAAQ,GACnD,UAAA,gBAAA9B,EAACuC,KAAK,eAAc,UAAS,KAAK,IAC/B,UAAAlC,KAIG,gBAAAmC,EAAAC,GAAA,EAAA,UAAA;AAAA,QAAA,gBAAAzC,EAAC0C,GAAK,EAAA;AAAA,0BACLC,GAAK,EAAA;AAAA,0BACLC,GAAQ,CAAA,CAAA;AAAA,MAAA,GACX,EAAA,CAEJ,GACF,EACF,CAAA;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;AAEA9C,EAAQ,OAAO4C;AACf5C,EAAQ,OAAO6C;AACf7C,EAAQ,UAAU8C;"}
1
+ {"version":3,"file":"Address.js","sources":["../../../../src/components/Contractor/Address/Address.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { useContractorsGetSuspense } from '@gusto/embedded-api/react-query/contractorsGet'\nimport { useContractorsGetAddressSuspense } from '@gusto/embedded-api/react-query/contractorsGetAddress'\nimport { useContractorsUpdateAddressMutation } from '@gusto/embedded-api/react-query/contractorsUpdateAddress'\nimport { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { AddressFormSchema, AddressProvider } from './useAddress'\nimport { Head } from './Head'\nimport { Form } from './Form'\nimport { Actions } from './Actions'\nimport type { AddressDefaultValues, AddressFormValues } from './useAddress'\nimport { Form as HtmlForm } from '@/components/Common/Form/Form'\nimport { useI18n, useComponentDictionary } from '@/i18n'\nimport { Flex } from '@/components/Common'\nimport type { BaseComponentInterface } from '@/components/Base/Base'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { contractorEvents } from '@/shared/constants'\n\nexport interface AddressProps extends BaseComponentInterface<'Contractor.Address'> {\n contractorId: string\n defaultValues?: AddressDefaultValues\n children?: ReactNode\n className?: string\n}\n\nexport function Address(props: AddressProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ contractorId, defaultValues, children, className, dictionary }: AddressProps) {\n useComponentDictionary('Contractor.Address', dictionary)\n useI18n('Contractor.Address')\n\n const { onEvent, baseSubmitHandler } = useBase()\n\n const { data: contractorData } = useContractorsGetSuspense({ contractorUuid: contractorId })\n const { data: addressData } = useContractorsGetAddressSuspense({ contractorUuid: contractorId })\n\n const { mutateAsync: updateAddress, isPending: isUpdatingAddressPending } =\n useContractorsUpdateAddressMutation()\n\n const contractor = contractorData.contractor\n const contractorType = contractorData.contractor?.type\n const address = addressData.contractorAddress\n\n const formDefaultValues = {\n street1: address?.street1 || defaultValues?.street1 || '',\n street2: address?.street2 || defaultValues?.street2 || '',\n city: address?.city || defaultValues?.city || '',\n state: address?.state || defaultValues?.state || '',\n zip: address?.zip || defaultValues?.zip || '',\n }\n\n const formMethods = useForm<AddressFormValues>({\n resolver: zodResolver(AddressFormSchema),\n defaultValues: formDefaultValues,\n })\n\n const onSubmit = async (data: AddressFormValues) => {\n await baseSubmitHandler(data, async payload => {\n const { contractorAddress } = await updateAddress({\n request: {\n contractorUuid: contractorId,\n requestBody: {\n version: address?.version as string,\n street1: payload.street1,\n street2: payload.street2,\n city: payload.city,\n state: payload.state,\n zip: payload.zip,\n },\n },\n })\n\n onEvent(contractorEvents.CONTRACTOR_ADDRESS_UPDATED, contractorAddress)\n onEvent(contractorEvents.CONTRACTOR_ADDRESS_DONE)\n })\n }\n\n return (\n <section className={className}>\n <AddressProvider\n value={{\n contractor,\n contractorType,\n address,\n isPending: isUpdatingAddressPending,\n }}\n >\n <FormProvider {...formMethods}>\n <HtmlForm onSubmit={formMethods.handleSubmit(onSubmit)}>\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <Form />\n <Actions />\n </>\n )}\n </Flex>\n </HtmlForm>\n </FormProvider>\n </AddressProvider>\n </section>\n )\n}\n\nAddress.Head = Head\nAddress.Form = Form\nAddress.Actions = Actions\n\nexport default Address\n"],"names":["Address","props","jsx","BaseComponent","Root","contractorId","defaultValues","children","className","dictionary","useComponentDictionary","useI18n","onEvent","baseSubmitHandler","useBase","contractorData","useContractorsGetSuspense","addressData","useContractorsGetAddressSuspense","updateAddress","isUpdatingAddressPending","useContractorsUpdateAddressMutation","contractor","contractorType","address","formDefaultValues","formMethods","useForm","zodResolver","AddressFormSchema","onSubmit","data","payload","contractorAddress","contractorEvents","AddressProvider","FormProvider","HtmlForm","Flex","jsxs","Fragment","Head","Form","Actions"],"mappings":";;;;;;;;;;;;;;;;;;AA0BO,SAASA,EAAQC,GAAqB;AAEzC,SAAA,gBAAAC,EAACC,GAAe,EAAA,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAMA,EAAA,SAAA,CAAS,EACnC,CAAA;AAEJ;AAEA,SAASG,EAAK,EAAE,cAAAC,GAAc,eAAAC,GAAe,UAAAC,GAAU,WAAAC,GAAW,YAAAC,KAA4B;AAC5F,EAAAC,EAAuB,sBAAsBD,CAAU,GACvDE,EAAQ,oBAAoB;AAE5B,QAAM,EAAE,SAAAC,GAAS,mBAAAC,EAAkB,IAAIC,EAAQ,GAEzC,EAAE,MAAMC,EAAe,IAAIC,EAA0B,EAAE,gBAAgBX,GAAc,GACrF,EAAE,MAAMY,EAAY,IAAIC,EAAiC,EAAE,gBAAgBb,GAAc,GAEzF,EAAE,aAAac,GAAe,WAAWC,EAAA,IAC7CC,EAAoC,GAEhCC,IAAaP,EAAe,YAC5BQ,IAAiBR,EAAe,YAAY,MAC5CS,IAAUP,EAAY,mBAEtBQ,IAAoB;AAAA,IACxB,SAASD,GAAS,WAAWlB,GAAe,WAAW;AAAA,IACvD,SAASkB,GAAS,WAAWlB,GAAe,WAAW;AAAA,IACvD,MAAMkB,GAAS,QAAQlB,GAAe,QAAQ;AAAA,IAC9C,OAAOkB,GAAS,SAASlB,GAAe,SAAS;AAAA,IACjD,KAAKkB,GAAS,OAAOlB,GAAe,OAAO;AAAA,EAC7C,GAEMoB,IAAcC,EAA2B;AAAA,IAC7C,UAAUC,EAAYC,CAAiB;AAAA,IACvC,eAAeJ;AAAA,EAAA,CAChB,GAEKK,IAAW,OAAOC,MAA4B;AAC5C,UAAAlB,EAAkBkB,GAAM,OAAMC,MAAW;AAC7C,YAAM,EAAE,mBAAAC,MAAsB,MAAMd,EAAc;AAAA,QAChD,SAAS;AAAA,UACP,gBAAgBd;AAAA,UAChB,aAAa;AAAA,YACX,SAASmB,GAAS;AAAA,YAClB,SAASQ,EAAQ;AAAA,YACjB,SAASA,EAAQ;AAAA,YACjB,MAAMA,EAAQ;AAAA,YACd,OAAOA,EAAQ;AAAA,YACf,KAAKA,EAAQ;AAAA,UAAA;AAAA,QACf;AAAA,MACF,CACD;AAEO,MAAApB,EAAAsB,EAAiB,4BAA4BD,CAAiB,GACtErB,EAAQsB,EAAiB,uBAAuB;AAAA,IAAA,CACjD;AAAA,EACH;AAGE,SAAA,gBAAAhC,EAAC,aAAQ,WAAAM,GACP,UAAA,gBAAAN;AAAA,IAACiC;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,YAAAb;AAAA,QACA,gBAAAC;AAAA,QACA,SAAAC;AAAA,QACA,WAAWJ;AAAA,MACb;AAAA,MAEA,4BAACgB,GAAc,EAAA,GAAGV,GAChB,UAAC,gBAAAxB,EAAAmC,GAAA,EAAS,UAAUX,EAAY,aAAaI,CAAQ,GACnD,UAAA,gBAAA5B,EAACoC,KAAK,eAAc,UAAS,KAAK,IAC/B,UAAA/B,KAIG,gBAAAgC,EAAAC,GAAA,EAAA,UAAA;AAAA,QAAA,gBAAAtC,EAACuC,GAAK,EAAA;AAAA,0BACLC,GAAK,EAAA;AAAA,0BACLC,GAAQ,CAAA,CAAA;AAAA,MAAA,GACX,EAAA,CAEJ,GACF,EACF,CAAA;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;AAEA3C,EAAQ,OAAOyC;AACfzC,EAAQ,OAAO0C;AACf1C,EAAQ,UAAU2C;"}
@@ -1,10 +1,11 @@
1
1
  import { jsxs as s, jsx as r } from "react/jsx-runtime";
2
2
  import { useTranslation as i } from "react-i18next";
3
3
  import { Grid as o } from "../../Common/Grid/Grid.js";
4
+ import "classnames";
4
5
  import { STATES_ABBR as l } from "../../../shared/constants.js";
5
6
  import { TextInputField as t } from "../../Common/Fields/TextInputField/TextInputField.js";
6
7
  import { SelectField as m } from "../../Common/Fields/SelectField/SelectField.js";
7
- function g() {
8
+ function v() {
8
9
  const { t: e } = i("Contractor.Address");
9
10
  return /* @__PURE__ */ s(o, { gridTemplateColumns: { base: "1fr", small: ["1fr", "1fr"] }, gap: 20, children: [
10
11
  /* @__PURE__ */ r(
@@ -44,6 +45,6 @@ function g() {
44
45
  ] });
45
46
  }
46
47
  export {
47
- g as Form
48
+ v as Form
48
49
  };
49
50
  //# sourceMappingURL=Form.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Form.js","sources":["../../../../src/components/Contractor/Address/Form.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { TextInputField, SelectField, Grid } from '@/components/Common'\nimport { STATES_ABBR } from '@/shared/constants'\n\nexport function Form() {\n const { t } = useTranslation('Contractor.Address')\n\n return (\n <Grid gridTemplateColumns={{ base: '1fr', small: ['1fr', '1fr'] }} gap={20}>\n <TextInputField\n name=\"street1\"\n label={t('street1')}\n isRequired\n errorMessage={t('validations.street1')}\n />\n <TextInputField name=\"street2\" label={t('street2')} />\n <TextInputField\n name=\"city\"\n label={t('city')}\n isRequired\n errorMessage={t('validations.city')}\n />\n <SelectField\n name=\"state\"\n options={STATES_ABBR.map(stateAbbr => ({\n label: t(`statesHash.${stateAbbr}`, { ns: 'common', defaultValue: stateAbbr }),\n value: stateAbbr,\n }))}\n label={t('state')}\n placeholder={t('statePlaceholder')}\n errorMessage={t('validations.state')}\n isRequired\n />\n <TextInputField name=\"zip\" label={t('zip')} isRequired errorMessage={t('validations.zip')} />\n </Grid>\n )\n}\n"],"names":["Form","t","useTranslation","jsxs","Grid","jsx","TextInputField","SelectField","STATES_ABBR","stateAbbr"],"mappings":";;;;;;AAIO,SAASA,IAAO;AACrB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,oBAAoB;AAEjD,SACG,gBAAAC,EAAAC,GAAA,EAAK,qBAAqB,EAAE,MAAM,OAAO,OAAO,CAAC,OAAO,KAAK,EAAE,GAAG,KAAK,IACtE,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOL,EAAE,SAAS;AAAA,QAClB,YAAU;AAAA,QACV,cAAcA,EAAE,qBAAqB;AAAA,MAAA;AAAA,IACvC;AAAA,sBACCK,GAAe,EAAA,MAAK,WAAU,OAAOL,EAAE,SAAS,GAAG;AAAA,IACpD,gBAAAI;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOL,EAAE,MAAM;AAAA,QACf,YAAU;AAAA,QACV,cAAcA,EAAE,kBAAkB;AAAA,MAAA;AAAA,IACpC;AAAA,IACA,gBAAAI;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,SAASC,EAAY,IAAI,CAAcC,OAAA;AAAA,UACrC,OAAOR,EAAE,cAAcQ,CAAS,IAAI,EAAE,IAAI,UAAU,cAAcA,GAAW;AAAA,UAC7E,OAAOA;AAAA,QAAA,EACP;AAAA,QACF,OAAOR,EAAE,OAAO;AAAA,QAChB,aAAaA,EAAE,kBAAkB;AAAA,QACjC,cAAcA,EAAE,mBAAmB;AAAA,QACnC,YAAU;AAAA,MAAA;AAAA,IACZ;AAAA,IACC,gBAAAI,EAAAC,GAAA,EAAe,MAAK,OAAM,OAAOL,EAAE,KAAK,GAAG,YAAU,IAAC,cAAcA,EAAE,iBAAiB,EAAG,CAAA;AAAA,EAAA,GAC7F;AAEJ;"}
1
+ {"version":3,"file":"Form.js","sources":["../../../../src/components/Contractor/Address/Form.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { TextInputField, SelectField, Grid } from '@/components/Common'\nimport { STATES_ABBR } from '@/shared/constants'\n\nexport function Form() {\n const { t } = useTranslation('Contractor.Address')\n\n return (\n <Grid gridTemplateColumns={{ base: '1fr', small: ['1fr', '1fr'] }} gap={20}>\n <TextInputField\n name=\"street1\"\n label={t('street1')}\n isRequired\n errorMessage={t('validations.street1')}\n />\n <TextInputField name=\"street2\" label={t('street2')} />\n <TextInputField\n name=\"city\"\n label={t('city')}\n isRequired\n errorMessage={t('validations.city')}\n />\n <SelectField\n name=\"state\"\n options={STATES_ABBR.map(stateAbbr => ({\n label: t(`statesHash.${stateAbbr}`, { ns: 'common', defaultValue: stateAbbr }),\n value: stateAbbr,\n }))}\n label={t('state')}\n placeholder={t('statePlaceholder')}\n errorMessage={t('validations.state')}\n isRequired\n />\n <TextInputField name=\"zip\" label={t('zip')} isRequired errorMessage={t('validations.zip')} />\n </Grid>\n )\n}\n"],"names":["Form","t","useTranslation","jsxs","Grid","jsx","TextInputField","SelectField","STATES_ABBR","stateAbbr"],"mappings":";;;;;;;AAIO,SAASA,IAAO;AACrB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,oBAAoB;AAEjD,SACG,gBAAAC,EAAAC,GAAA,EAAK,qBAAqB,EAAE,MAAM,OAAO,OAAO,CAAC,OAAO,KAAK,EAAE,GAAG,KAAK,IACtE,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOL,EAAE,SAAS;AAAA,QAClB,YAAU;AAAA,QACV,cAAcA,EAAE,qBAAqB;AAAA,MAAA;AAAA,IACvC;AAAA,sBACCK,GAAe,EAAA,MAAK,WAAU,OAAOL,EAAE,SAAS,GAAG;AAAA,IACpD,gBAAAI;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOL,EAAE,MAAM;AAAA,QACf,YAAU;AAAA,QACV,cAAcA,EAAE,kBAAkB;AAAA,MAAA;AAAA,IACpC;AAAA,IACA,gBAAAI;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,SAASC,EAAY,IAAI,CAAcC,OAAA;AAAA,UACrC,OAAOR,EAAE,cAAcQ,CAAS,IAAI,EAAE,IAAI,UAAU,cAAcA,GAAW;AAAA,UAC7E,OAAOA;AAAA,QAAA,EACP;AAAA,QACF,OAAOR,EAAE,OAAO;AAAA,QAChB,aAAaA,EAAE,kBAAkB;AAAA,QACjC,cAAcA,EAAE,mBAAmB;AAAA,QACnC,YAAU;AAAA,MAAA;AAAA,IACZ;AAAA,IACC,gBAAAI,EAAAC,GAAA,EAAe,MAAK,OAAM,OAAOL,EAAE,KAAK,GAAG,YAAU,IAAC,cAAcA,EAAE,iBAAiB,EAAG,CAAA;AAAA,EAAA,GAC7F;AAEJ;"}
@@ -6,23 +6,25 @@ import "react-i18next";
6
6
  import "@gusto/embedded-api/models/errors/apierror";
7
7
  import "@gusto/embedded-api/models/errors/sdkvalidationerror";
8
8
  import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
9
+ import "@tanstack/react-query";
9
10
  import "../../Base/useBase.js";
10
11
  import "../../../shared/constants.js";
12
+ import "classnames";
11
13
  import "dompurify";
12
14
  import "../../../contexts/ComponentAdapter/useComponentContext.js";
13
15
  import { createCompoundContext as r } from "../../Base/createCompoundContext.js";
14
- const x = t.object({
16
+ const u = t.object({
15
17
  street1: t.string().min(1),
16
18
  street2: t.string().optional(),
17
19
  city: t.string().min(1),
18
20
  state: t.string().min(1),
19
21
  zip: t.string().min(1)
20
- }), [f, u] = r(
22
+ }), [z, b] = r(
21
23
  "ContractorAddressContext"
22
24
  );
23
25
  export {
24
- x as AddressFormSchema,
25
- u as AddressProvider,
26
- f as useAddress
26
+ u as AddressFormSchema,
27
+ b as AddressProvider,
28
+ z as useAddress
27
29
  };
28
30
  //# sourceMappingURL=useAddress.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useAddress.js","sources":["../../../../src/components/Contractor/Address/useAddress.ts"],"sourcesContent":["import type { Contractor, ContractorType } from '@gusto/embedded-api/models/components/contractor'\nimport type { ContractorAddress } from '@gusto/embedded-api/models/components/contractoraddress'\nimport { z } from 'zod'\nimport { createCompoundContext } from '@/components/Base'\nimport type { RequireAtLeastOne } from '@/types/Helpers'\n\nexport interface AddressContextType {\n contractor?: Contractor\n contractorType?: ContractorType\n address?: ContractorAddress\n isPending: boolean\n}\n\nexport type AddressDefaultValues = RequireAtLeastOne<\n Pick<ContractorAddress, 'street1' | 'street2' | 'city' | 'state' | 'zip'>\n>\n\nexport const AddressFormSchema = z.object({\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: z.string().min(1),\n})\n\nexport type AddressFormValues = z.infer<typeof AddressFormSchema>\n\nconst [useAddress, AddressProvider] = createCompoundContext<AddressContextType>(\n 'ContractorAddressContext',\n)\n\nexport { useAddress, AddressProvider }\n"],"names":["AddressFormSchema","z","useAddress","AddressProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;AAiBa,MAAAA,IAAoBC,EAAE,OAAO;AAAA,EACxC,SAASA,EAAE,SAAS,IAAI,CAAC;AAAA,EACzB,SAASA,EAAE,OAAO,EAAE,SAAS;AAAA,EAC7B,MAAMA,EAAE,SAAS,IAAI,CAAC;AAAA,EACtB,OAAOA,EAAE,SAAS,IAAI,CAAC;AAAA,EACvB,KAAKA,EAAE,OAAO,EAAE,IAAI,CAAC;AACvB,CAAC,GAIK,CAACC,GAAYC,CAAe,IAAIC;AAAA,EACpC;AACF;"}
1
+ {"version":3,"file":"useAddress.js","sources":["../../../../src/components/Contractor/Address/useAddress.ts"],"sourcesContent":["import type { Contractor, ContractorType } from '@gusto/embedded-api/models/components/contractor'\nimport type { ContractorAddress } from '@gusto/embedded-api/models/components/contractoraddress'\nimport { z } from 'zod'\nimport { createCompoundContext } from '@/components/Base'\nimport type { RequireAtLeastOne } from '@/types/Helpers'\n\nexport interface AddressContextType {\n contractor?: Contractor\n contractorType?: ContractorType\n address?: ContractorAddress\n isPending: boolean\n}\n\nexport type AddressDefaultValues = RequireAtLeastOne<\n Pick<ContractorAddress, 'street1' | 'street2' | 'city' | 'state' | 'zip'>\n>\n\nexport const AddressFormSchema = z.object({\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: z.string().min(1),\n})\n\nexport type AddressFormValues = z.infer<typeof AddressFormSchema>\n\nconst [useAddress, AddressProvider] = createCompoundContext<AddressContextType>(\n 'ContractorAddressContext',\n)\n\nexport { useAddress, AddressProvider }\n"],"names":["AddressFormSchema","z","useAddress","AddressProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;AAiBa,MAAAA,IAAoBC,EAAE,OAAO;AAAA,EACxC,SAASA,EAAE,SAAS,IAAI,CAAC;AAAA,EACzB,SAASA,EAAE,OAAO,EAAE,SAAS;AAAA,EAC7B,MAAMA,EAAE,SAAS,IAAI,CAAC;AAAA,EACtB,OAAOA,EAAE,SAAS,IAAI,CAAC;AAAA,EACvB,KAAKA,EAAE,OAAO,EAAE,IAAI,CAAC;AACvB,CAAC,GAIK,CAACC,GAAYC,CAAe,IAAIC;AAAA,EACpC;AACF;"}