@gusto/embedded-react-sdk 0.36.0 → 0.37.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 (448) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/README.md +6 -0
  3. package/dist/UNSTABLE_Hooks.d.ts +1 -1
  4. package/dist/UNSTABLE_Hooks.js +50 -6
  5. package/dist/UNSTABLE_Hooks.js.map +1 -1
  6. package/dist/components/Base/Base.d.ts +8 -9
  7. package/dist/components/Base/Base.js +123 -101
  8. package/dist/components/Base/Base.js.map +1 -1
  9. package/dist/components/Base/index.d.ts +1 -1
  10. package/dist/components/Base/useBase.d.ts +3 -7
  11. package/dist/components/Base/useBase.js.map +1 -1
  12. package/dist/components/Base/useBaseSubmit.d.ts +3 -5
  13. package/dist/components/Base/useBaseSubmit.js +27 -50
  14. package/dist/components/Base/useBaseSubmit.js.map +1 -1
  15. package/dist/components/Common/Fields/CheckboxField/CheckboxField.d.ts +2 -0
  16. package/dist/components/Common/Fields/CheckboxField/CheckboxField.js +17 -16
  17. package/dist/components/Common/Fields/CheckboxField/CheckboxField.js.map +1 -1
  18. package/dist/components/Common/Fields/DatePickerField/DatePickerField.d.ts +5 -3
  19. package/dist/components/Common/Fields/DatePickerField/DatePickerField.js +46 -36
  20. package/dist/components/Common/Fields/DatePickerField/DatePickerField.js.map +1 -1
  21. package/dist/components/Common/Fields/NumberInputField/NumberInputField.d.ts +2 -0
  22. package/dist/components/Common/Fields/NumberInputField/NumberInputField.js +21 -20
  23. package/dist/components/Common/Fields/NumberInputField/NumberInputField.js.map +1 -1
  24. package/dist/components/Common/Fields/RadioGroupField/RadioGroupField.d.ts +3 -1
  25. package/dist/components/Common/Fields/RadioGroupField/RadioGroupField.js +20 -19
  26. package/dist/components/Common/Fields/RadioGroupField/RadioGroupField.js.map +1 -1
  27. package/dist/components/Common/Fields/SelectField/SelectField.d.ts +3 -1
  28. package/dist/components/Common/Fields/SelectField/SelectField.js +19 -18
  29. package/dist/components/Common/Fields/SelectField/SelectField.js.map +1 -1
  30. package/dist/components/Common/Fields/SwitchField/SwitchField.d.ts +2 -0
  31. package/dist/components/Common/Fields/SwitchField/SwitchField.js +19 -18
  32. package/dist/components/Common/Fields/SwitchField/SwitchField.js.map +1 -1
  33. package/dist/components/Common/Fields/TextInputField/TextInputField.d.ts +2 -0
  34. package/dist/components/Common/Fields/TextInputField/TextInputField.js +10 -9
  35. package/dist/components/Common/Fields/TextInputField/TextInputField.js.map +1 -1
  36. package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js +1 -1
  37. package/dist/components/Common/UI/DescriptionList/DescriptionList.module.scss.js +2 -2
  38. package/dist/components/Common/UI/FileInput/FileInput.js +1 -1
  39. package/dist/components/Common/UI/ProgressBar/ProgressBar.js +4 -4
  40. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +8 -7
  41. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  42. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +8 -7
  43. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  44. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +10 -9
  45. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  46. package/dist/components/Company/BankAccount/BankAccountForm/context.js +8 -7
  47. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  48. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +8 -7
  49. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  50. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +8 -7
  51. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  52. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +13 -12
  53. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  54. package/dist/components/Company/Industry/Context.js +11 -10
  55. package/dist/components/Company/Industry/Context.js.map +1 -1
  56. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +8 -7
  57. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  58. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +8 -7
  59. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  60. package/dist/components/Company/OnboardingOverview/context.js +8 -7
  61. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  62. package/dist/components/Company/PaySchedule/PaySchedule.js +60 -60
  63. package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
  64. package/dist/components/Company/PaySchedule/usePaySchedule.js +10 -9
  65. package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
  66. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +8 -7
  67. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  68. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +8 -7
  69. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  70. package/dist/components/Contractor/Address/useAddress.js +10 -9
  71. package/dist/components/Contractor/Address/useAddress.js.map +1 -1
  72. package/dist/components/Contractor/Profile/ContractorProfileForm.js +15 -15
  73. package/dist/components/Contractor/Profile/useContractorProfile.js +41 -38
  74. package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
  75. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +7 -6
  76. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
  77. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +14 -13
  78. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
  79. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +7 -6
  80. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -1
  81. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +8 -7
  82. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  83. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +8 -7
  84. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  85. package/dist/components/Employee/EmployeeList/useEmployeeList.js +8 -7
  86. package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
  87. package/dist/components/Employee/FederalTaxes/FederalTaxes.js +42 -42
  88. package/dist/components/Employee/FederalTaxes/FederalTaxes.js.map +1 -1
  89. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +8 -7
  90. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
  91. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +10 -9
  92. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
  93. package/dist/components/Employee/Profile/HomeAddress.d.ts +3 -3
  94. package/dist/components/Employee/Profile/HomeAddress.js +38 -36
  95. package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
  96. package/dist/components/Employee/Profile/Profile.js +30 -29
  97. package/dist/components/Employee/Profile/Profile.js.map +1 -1
  98. package/dist/components/Employee/Profile/useProfile.js +8 -7
  99. package/dist/components/Employee/Profile/useProfile.js.map +1 -1
  100. package/dist/components/Employee/StateTaxes/StateTaxes.js +50 -50
  101. package/dist/components/Employee/StateTaxes/StateTaxes.js.map +1 -1
  102. package/dist/components/Employee/StateTaxes/useStateTaxes.js +8 -7
  103. package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
  104. package/dist/components/Employee/Taxes/Taxes.js +53 -53
  105. package/dist/components/Employee/Taxes/Taxes.js.map +1 -1
  106. package/dist/components/Employee/Taxes/useTaxes.js +8 -7
  107. package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
  108. package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.d.ts +11 -0
  109. package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.js +123 -0
  110. package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.js.map +1 -0
  111. package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.d.ts +11 -0
  112. package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js +92 -0
  113. package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js.map +1 -0
  114. package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlow.d.ts +2 -0
  115. package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlow.js +30 -0
  116. package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlow.js.map +1 -0
  117. package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.d.ts +23 -0
  118. package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.js +72 -0
  119. package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.js.map +1 -0
  120. package/dist/components/Employee/Terminations/TerminationFlow/index.d.ts +3 -0
  121. package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.d.ts +7 -0
  122. package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.js +165 -0
  123. package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.js.map +1 -0
  124. package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.test.d.ts +1 -0
  125. package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummary.d.ts +9 -0
  126. package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummary.js +86 -0
  127. package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummary.js.map +1 -0
  128. package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.d.ts +20 -0
  129. package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.js +103 -0
  130. package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.js.map +1 -0
  131. package/dist/components/Employee/Terminations/TerminationsData.d.ts +6 -0
  132. package/dist/components/Employee/Terminations/index.d.ts +8 -0
  133. package/dist/components/Employee/Terminations/types.d.ts +1 -0
  134. package/dist/components/Employee/index.d.ts +7 -0
  135. package/dist/components/Employee/index.js +34 -28
  136. package/dist/components/Employee/index.js.map +1 -1
  137. package/dist/components/InformationRequests/InformationRequests.js +31 -31
  138. package/dist/components/InformationRequests/InformationRequests.js.map +1 -1
  139. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js +41 -41
  140. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js.map +1 -1
  141. package/dist/components/Payroll/Dismissal/DismissalFlow.d.ts +2 -0
  142. package/dist/components/Payroll/Dismissal/DismissalFlow.js +32 -0
  143. package/dist/components/Payroll/Dismissal/DismissalFlow.js.map +1 -0
  144. package/dist/components/Payroll/Dismissal/DismissalFlowComponents.d.ts +16 -0
  145. package/dist/components/Payroll/Dismissal/DismissalFlowComponents.js +52 -0
  146. package/dist/components/Payroll/Dismissal/DismissalFlowComponents.js.map +1 -0
  147. package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.d.ts +6 -0
  148. package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.js +69 -0
  149. package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.js.map +1 -0
  150. package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.d.ts +9 -0
  151. package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.js +53 -0
  152. package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.js.map +1 -0
  153. package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/index.d.ts +3 -0
  154. package/dist/components/Payroll/Dismissal/dismissalStateMachine.d.ts +6 -0
  155. package/dist/components/Payroll/Dismissal/dismissalStateMachine.js +51 -0
  156. package/dist/components/Payroll/Dismissal/dismissalStateMachine.js.map +1 -0
  157. package/dist/components/Payroll/Dismissal/dismissalStateMachine.test.d.ts +1 -0
  158. package/dist/components/Payroll/Dismissal/index.d.ts +3 -0
  159. package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +18 -15
  160. package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
  161. package/dist/components/Payroll/OffCycle/OffCycleFlow.d.ts +1 -1
  162. package/dist/components/Payroll/OffCycle/OffCycleFlow.js +19 -18
  163. package/dist/components/Payroll/OffCycle/OffCycleFlow.js.map +1 -1
  164. package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.d.ts +3 -0
  165. package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js +32 -24
  166. package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js.map +1 -1
  167. package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js +45 -45
  168. package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js.map +1 -1
  169. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.d.ts +1 -1
  170. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js +75 -66
  171. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js.map +1 -1
  172. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.module.scss.js +8 -0
  173. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.module.scss.js.map +1 -0
  174. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationTypes.d.ts +0 -1
  175. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.module.scss.js +4 -4
  176. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.js +2 -2
  177. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.js.map +1 -1
  178. package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.d.ts +1 -0
  179. package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.js +1 -0
  180. package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.js.map +1 -1
  181. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +186 -159
  182. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
  183. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.d.ts +3 -3
  184. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +69 -69
  185. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
  186. package/dist/components/Payroll/PayrollConfiguration/grossUpHelpers.d.ts +3 -2
  187. package/dist/components/Payroll/PayrollConfiguration/grossUpHelpers.js +8 -8
  188. package/dist/components/Payroll/PayrollConfiguration/grossUpHelpers.js.map +1 -1
  189. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.d.ts +5 -3
  190. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js +76 -70
  191. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js.map +1 -1
  192. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js +47 -42
  193. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js.map +1 -1
  194. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.d.ts +4 -2
  195. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +235 -196
  196. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
  197. package/dist/components/Payroll/PayrollFlow/OffCycleFlowContextual.d.ts +1 -0
  198. package/dist/components/Payroll/PayrollFlow/OffCycleFlowContextual.js +12 -0
  199. package/dist/components/Payroll/PayrollFlow/OffCycleFlowContextual.js.map +1 -0
  200. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.d.ts +3 -0
  201. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js.map +1 -1
  202. package/dist/components/Payroll/PayrollFlow/TransitionFlowContextual.d.ts +1 -0
  203. package/dist/components/Payroll/PayrollFlow/TransitionFlowContextual.js +21 -0
  204. package/dist/components/Payroll/PayrollFlow/TransitionFlowContextual.js.map +1 -0
  205. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.d.ts +2 -0
  206. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js +95 -64
  207. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js.map +1 -1
  208. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js +53 -47
  209. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js.map +1 -1
  210. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +8 -8
  211. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
  212. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js +25 -23
  213. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js.map +1 -1
  214. package/dist/components/Payroll/PayrollList/PayrollList.js +40 -32
  215. package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
  216. package/dist/components/Payroll/PayrollList/PayrollListPresentation.d.ts +2 -1
  217. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +110 -93
  218. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
  219. package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js +12 -8
  220. package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js.map +1 -1
  221. package/dist/components/Payroll/Transition/TransitionFlow.d.ts +2 -0
  222. package/dist/components/Payroll/Transition/TransitionFlow.js +38 -0
  223. package/dist/components/Payroll/Transition/TransitionFlow.js.map +1 -0
  224. package/dist/components/Payroll/Transition/TransitionFlowComponents.d.ts +19 -0
  225. package/dist/components/Payroll/Transition/TransitionFlowComponents.js +54 -0
  226. package/dist/components/Payroll/Transition/TransitionFlowComponents.js.map +1 -0
  227. package/dist/components/Payroll/Transition/index.d.ts +3 -0
  228. package/dist/components/Payroll/Transition/transitionStateMachine.d.ts +6 -0
  229. package/dist/components/Payroll/Transition/transitionStateMachine.js +58 -0
  230. package/dist/components/Payroll/Transition/transitionStateMachine.js.map +1 -0
  231. package/dist/components/Payroll/Transition/transitionStateMachine.test.d.ts +1 -0
  232. package/dist/components/Payroll/TransitionCreation/TransitionCreation.d.ts +2 -0
  233. package/dist/components/Payroll/TransitionCreation/TransitionCreation.js +92 -0
  234. package/dist/components/Payroll/TransitionCreation/TransitionCreation.js.map +1 -0
  235. package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.d.ts +2 -0
  236. package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.js +111 -0
  237. package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.js.map +1 -0
  238. package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.module.scss.js +8 -0
  239. package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.module.scss.js.map +1 -0
  240. package/dist/components/Payroll/TransitionCreation/TransitionCreationTypes.d.ts +28 -0
  241. package/dist/components/Payroll/TransitionCreation/TransitionCreationTypes.js +21 -0
  242. package/dist/components/Payroll/TransitionCreation/TransitionCreationTypes.js.map +1 -0
  243. package/dist/components/Payroll/TransitionCreation/index.d.ts +3 -0
  244. package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.d.ts +8 -0
  245. package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.js +83 -0
  246. package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.js.map +1 -0
  247. package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.d.ts +16 -0
  248. package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.js +100 -0
  249. package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.js.map +1 -0
  250. package/dist/components/Payroll/TransitionPayrollAlert/index.d.ts +2 -0
  251. package/dist/components/Payroll/helpers.d.ts +2 -1
  252. package/dist/components/Payroll/helpers.js +98 -87
  253. package/dist/components/Payroll/helpers.js.map +1 -1
  254. package/dist/components/Payroll/index.d.ts +6 -0
  255. package/dist/components/Payroll/index.js +32 -26
  256. package/dist/components/Payroll/index.js.map +1 -1
  257. package/dist/components/Payroll/payrollTypes.d.ts +21 -0
  258. package/dist/components/Payroll/payrollTypes.js +27 -0
  259. package/dist/components/Payroll/payrollTypes.js.map +1 -0
  260. package/dist/components/Payroll/usePreparedPayrollData.js +4 -4
  261. package/dist/components/UNSTABLE_Hooks/collectErrors.d.ts +6 -0
  262. package/dist/components/UNSTABLE_Hooks/collectErrors.js +9 -0
  263. package/dist/components/UNSTABLE_Hooks/collectErrors.js.map +1 -0
  264. package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataContext.d.ts +8 -0
  265. package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataContext.js +13 -0
  266. package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataContext.js.map +1 -0
  267. package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataProvider.d.ts +10 -0
  268. package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataProvider.js +13 -0
  269. package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataProvider.js.map +1 -0
  270. package/dist/components/UNSTABLE_Hooks/form/SDKFormProvider.d.ts +23 -0
  271. package/dist/components/UNSTABLE_Hooks/form/SDKFormProvider.js +24 -0
  272. package/dist/components/UNSTABLE_Hooks/form/SDKFormProvider.js.map +1 -0
  273. package/dist/components/UNSTABLE_Hooks/form/composeFormSchema.d.ts +26 -0
  274. package/dist/components/UNSTABLE_Hooks/form/composeFormSchema.js +24 -0
  275. package/dist/components/UNSTABLE_Hooks/form/composeFormSchema.js.map +1 -0
  276. package/dist/components/UNSTABLE_Hooks/form/composeSubmitHandler.d.ts +53 -0
  277. package/dist/components/UNSTABLE_Hooks/form/composeSubmitHandler.js +34 -0
  278. package/dist/components/UNSTABLE_Hooks/form/composeSubmitHandler.js.map +1 -0
  279. package/dist/components/UNSTABLE_Hooks/form/composeSubmitHandler.test.d.ts +1 -0
  280. package/dist/components/UNSTABLE_Hooks/form/deriveFieldsMetadata.d.ts +3 -0
  281. package/dist/components/UNSTABLE_Hooks/form/deriveFieldsMetadata.js +14 -0
  282. package/dist/components/UNSTABLE_Hooks/form/deriveFieldsMetadata.js.map +1 -0
  283. package/dist/components/UNSTABLE_Hooks/form/deriveFieldsMetadata.test.d.ts +1 -0
  284. package/dist/components/UNSTABLE_Hooks/form/fields/CheckboxHookField.d.ts +9 -0
  285. package/dist/components/UNSTABLE_Hooks/form/fields/CheckboxHookField.js +34 -0
  286. package/dist/components/UNSTABLE_Hooks/form/fields/CheckboxHookField.js.map +1 -0
  287. package/dist/components/UNSTABLE_Hooks/form/fields/DatePickerHookField.d.ts +9 -0
  288. package/dist/components/UNSTABLE_Hooks/form/fields/DatePickerHookField.js +29 -0
  289. package/dist/components/UNSTABLE_Hooks/form/fields/DatePickerHookField.js.map +1 -0
  290. package/dist/components/UNSTABLE_Hooks/form/fields/NumberInputHookField.d.ts +12 -0
  291. package/dist/components/UNSTABLE_Hooks/form/fields/NumberInputHookField.js +40 -0
  292. package/dist/components/UNSTABLE_Hooks/form/fields/NumberInputHookField.js.map +1 -0
  293. package/dist/components/UNSTABLE_Hooks/form/fields/RadioGroupHookField.d.ts +10 -0
  294. package/dist/components/UNSTABLE_Hooks/form/fields/RadioGroupHookField.js +40 -0
  295. package/dist/components/UNSTABLE_Hooks/form/fields/RadioGroupHookField.js.map +1 -0
  296. package/dist/components/UNSTABLE_Hooks/form/fields/SelectHookField.d.ts +10 -0
  297. package/dist/components/UNSTABLE_Hooks/form/fields/SelectHookField.js +40 -0
  298. package/dist/components/UNSTABLE_Hooks/form/fields/SelectHookField.js.map +1 -0
  299. package/dist/components/UNSTABLE_Hooks/form/fields/SwitchHookField.d.ts +9 -0
  300. package/dist/components/UNSTABLE_Hooks/form/fields/SwitchHookField.js +34 -0
  301. package/dist/components/UNSTABLE_Hooks/form/fields/SwitchHookField.js.map +1 -0
  302. package/dist/components/UNSTABLE_Hooks/form/fields/TextInputHookField.d.ts +11 -0
  303. package/dist/components/UNSTABLE_Hooks/form/fields/TextInputHookField.js +38 -0
  304. package/dist/components/UNSTABLE_Hooks/form/fields/TextInputHookField.js.map +1 -0
  305. package/dist/components/UNSTABLE_Hooks/form/fields/index.d.ts +15 -0
  306. package/dist/components/UNSTABLE_Hooks/form/getFieldWithOptions.d.ts +2 -0
  307. package/dist/components/UNSTABLE_Hooks/form/getFieldWithOptions.js +8 -0
  308. package/dist/components/UNSTABLE_Hooks/form/getFieldWithOptions.js.map +1 -0
  309. package/dist/components/UNSTABLE_Hooks/form/getFormSubmissionValues.d.ts +18 -0
  310. package/dist/components/UNSTABLE_Hooks/form/getFormSubmissionValues.js +10 -0
  311. package/dist/components/UNSTABLE_Hooks/form/getFormSubmissionValues.js.map +1 -0
  312. package/dist/components/UNSTABLE_Hooks/form/getFormSubmissionValues.test.d.ts +1 -0
  313. package/dist/components/UNSTABLE_Hooks/form/index.d.ts +14 -0
  314. package/dist/components/UNSTABLE_Hooks/form/resolveRequiredFields.d.ts +6 -0
  315. package/dist/components/UNSTABLE_Hooks/form/resolveRequiredFields.js +14 -0
  316. package/dist/components/UNSTABLE_Hooks/form/resolveRequiredFields.js.map +1 -0
  317. package/dist/components/UNSTABLE_Hooks/form/types.d.ts +27 -0
  318. package/dist/components/UNSTABLE_Hooks/form/useFieldErrorMessage.d.ts +2 -0
  319. package/dist/components/UNSTABLE_Hooks/form/useFieldErrorMessage.js +17 -0
  320. package/dist/components/UNSTABLE_Hooks/form/useFieldErrorMessage.js.map +1 -0
  321. package/dist/components/UNSTABLE_Hooks/form/useFieldsMetadata.d.ts +4 -0
  322. package/dist/components/UNSTABLE_Hooks/form/useFieldsMetadata.js +9 -0
  323. package/dist/components/UNSTABLE_Hooks/form/useFieldsMetadata.js.map +1 -0
  324. package/dist/components/UNSTABLE_Hooks/form/withOptions.d.ts +5 -0
  325. package/dist/components/UNSTABLE_Hooks/form/withOptions.js +7 -0
  326. package/dist/components/UNSTABLE_Hooks/form/withOptions.js.map +1 -0
  327. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/CompensationForm.d.ts +5 -0
  328. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/CompensationForm.js +151 -0
  329. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/CompensationForm.js.map +1 -0
  330. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/compensationSchema.d.ts +97 -0
  331. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/compensationSchema.js +121 -0
  332. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/compensationSchema.js.map +1 -0
  333. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/fields.d.ts +34 -0
  334. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/fields.js +50 -0
  335. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/fields.js.map +1 -0
  336. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/index.d.ts +7 -0
  337. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.d.ts +104 -0
  338. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.js +259 -0
  339. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.js.map +1 -0
  340. package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/EmployeeDetailsForm.d.ts +5 -0
  341. package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/EmployeeDetailsForm.js +114 -0
  342. package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/EmployeeDetailsForm.js.map +1 -0
  343. package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/employeeDetailsSchema.d.ts +39 -0
  344. package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/employeeDetailsSchema.js +45 -0
  345. package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/employeeDetailsSchema.js.map +1 -0
  346. package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/fields.d.ts +23 -0
  347. package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/fields.js +46 -0
  348. package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/fields.js.map +1 -0
  349. package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/index.d.ts +7 -0
  350. package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/useEmployeeDetailsForm.d.ts +77 -0
  351. package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/useEmployeeDetailsForm.js +153 -0
  352. package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/useEmployeeDetailsForm.js.map +1 -0
  353. package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/WorkAddressForm.d.ts +5 -0
  354. package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/WorkAddressForm.js +71 -0
  355. package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/WorkAddressForm.js.map +1 -0
  356. package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/fields.d.ts +10 -0
  357. package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/fields.js +14 -0
  358. package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/fields.js.map +1 -0
  359. package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/index.d.ts +7 -0
  360. package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/useWorkAddressForm.d.ts +68 -0
  361. package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/useWorkAddressForm.js +129 -0
  362. package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/useWorkAddressForm.js.map +1 -0
  363. package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/workAddressSchema.d.ts +25 -0
  364. package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/workAddressSchema.js +24 -0
  365. package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/workAddressSchema.js.map +1 -0
  366. package/dist/components/UNSTABLE_Hooks/index.d.ts +9 -0
  367. package/dist/components/UNSTABLE_Hooks/types.d.ts +49 -0
  368. package/dist/components/UNSTABLE_Hooks/useErrorHandling.d.ts +9 -0
  369. package/dist/components/UNSTABLE_Hooks/useErrorHandling.js +12 -0
  370. package/dist/components/UNSTABLE_Hooks/useErrorHandling.js.map +1 -0
  371. package/dist/components/UNSTABLE_Hooks/useErrorHandling.test.d.ts +1 -0
  372. package/dist/contexts/ApiProvider/ApiProvider.js +11 -11
  373. package/dist/contexts/ApiProvider/ApiProvider.js.map +1 -1
  374. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +43 -47
  375. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  376. package/dist/contexts/ObservabilityProvider/index.d.ts +1 -1
  377. package/dist/contexts/ObservabilityProvider/sanitization.d.ts +0 -14
  378. package/dist/contexts/ObservabilityProvider/sanitization.js +51 -51
  379. package/dist/contexts/ObservabilityProvider/sanitization.js.map +1 -1
  380. package/dist/contexts/ObservabilityProvider/useSanitizedObservability.d.ts +0 -3
  381. package/dist/contexts/ObservabilityProvider/useSanitizedObservability.js.map +1 -1
  382. package/dist/helpers/requiredIf.d.ts +13 -0
  383. package/dist/helpers/requiredIf.js +8 -0
  384. package/dist/helpers/requiredIf.js.map +1 -0
  385. package/dist/i18n/I18n.js +13 -13
  386. package/dist/i18n/I18n.js.map +1 -1
  387. package/dist/i18n/en/Employee.Terminations.TerminateEmployee.json.js +18 -0
  388. package/dist/i18n/en/Employee.Terminations.TerminateEmployee.json.js.map +1 -0
  389. package/dist/i18n/en/Employee.Terminations.TerminationFlow.json.js +12 -0
  390. package/dist/i18n/en/Employee.Terminations.TerminationFlow.json.js.map +1 -0
  391. package/dist/i18n/en/Employee.Terminations.TerminationSummary.json.js +20 -0
  392. package/dist/i18n/en/Employee.Terminations.TerminationSummary.json.js.map +1 -0
  393. package/dist/i18n/en/Payroll.Dismissal.json.js +22 -0
  394. package/dist/i18n/en/Payroll.Dismissal.json.js.map +1 -0
  395. package/dist/i18n/en/Payroll.OffCycleCreation.json.js +15 -11
  396. package/dist/i18n/en/Payroll.OffCycleCreation.json.js.map +1 -1
  397. package/dist/i18n/en/Payroll.OffCyclePayPeriodDateForm.json.js +1 -1
  398. package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js +20 -18
  399. package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js.map +1 -1
  400. package/dist/i18n/en/Payroll.PayrollList.json.js +20 -18
  401. package/dist/i18n/en/Payroll.PayrollList.json.js.map +1 -1
  402. package/dist/i18n/en/Payroll.Transition.json.js +8 -0
  403. package/dist/i18n/en/Payroll.Transition.json.js.map +1 -0
  404. package/dist/i18n/en/Payroll.TransitionCreation.json.js +26 -0
  405. package/dist/i18n/en/Payroll.TransitionCreation.json.js.map +1 -0
  406. package/dist/i18n/en/Payroll.TransitionPayrollAlert.json.js +18 -0
  407. package/dist/i18n/en/Payroll.TransitionPayrollAlert.json.js.map +1 -0
  408. package/dist/i18n/en/UNSTABLE.CompensationForm.json.js +58 -0
  409. package/dist/i18n/en/UNSTABLE.CompensationForm.json.js.map +1 -0
  410. package/dist/i18n/en/UNSTABLE.EmployeeDetailsForm.json.js +34 -0
  411. package/dist/i18n/en/UNSTABLE.EmployeeDetailsForm.json.js.map +1 -0
  412. package/dist/i18n/en/UNSTABLE.WorkAddressForm.json.js +24 -0
  413. package/dist/i18n/en/UNSTABLE.WorkAddressForm.json.js.map +1 -0
  414. package/dist/i18n/en/common.json.d.ts +2 -1
  415. package/dist/i18n/en/common.json.js +9 -9
  416. package/dist/index.d.ts +3 -2
  417. package/dist/index.js +14 -13
  418. package/dist/models/WA_RISK_CODES.d.ts +5 -2866
  419. package/dist/models/WA_RISK_CODES.js.map +1 -1
  420. package/dist/shared/constants.d.ts +32 -0
  421. package/dist/shared/constants.js +83 -65
  422. package/dist/shared/constants.js.map +1 -1
  423. package/dist/style.css +1 -1
  424. package/dist/types/i18next.d.ts +279 -1
  425. package/dist/types/observability.d.ts +31 -65
  426. package/dist/types/sdkError.d.ts +97 -0
  427. package/dist/types/sdkError.js +95 -0
  428. package/dist/types/sdkError.js.map +1 -0
  429. package/dist/types/sdkError.test.d.ts +1 -0
  430. package/docs/reference/endpoint-inventory.json +212 -14
  431. package/package.json +16 -16
  432. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfiguration.d.ts +0 -6
  433. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfiguration.js +0 -70
  434. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfiguration.js.map +0 -1
  435. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationContext.d.ts +0 -7
  436. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationContext.js +0 -6
  437. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationContext.js.map +0 -1
  438. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationProvider.d.ts +0 -9
  439. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationProvider.js +0 -40
  440. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationProvider.js.map +0 -1
  441. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/index.d.ts +0 -5
  442. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/usePayrollConfiguration.d.ts +0 -2
  443. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/usePayrollConfiguration.js +0 -12
  444. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/usePayrollConfiguration.js.map +0 -1
  445. package/dist/components/Payroll/UNSTABLE_PayrollHooks/index.d.ts +0 -2
  446. package/dist/contexts/ObservabilityProvider/observabilityUtils.d.ts +0 -5
  447. package/dist/contexts/ObservabilityProvider/observabilityUtils.js +0 -45
  448. package/dist/contexts/ObservabilityProvider/observabilityUtils.js.map +0 -1
@@ -2,22 +2,23 @@ import "react/jsx-runtime";
2
2
  import "react";
3
3
  import "react-error-boundary";
4
4
  import "react-i18next";
5
- import "@gusto/embedded-api/models/errors/gustoembeddederror";
6
- import "@gusto/embedded-api/models/errors/sdkvalidationerror";
7
5
  import "@tanstack/react-query";
8
6
  import "../../../Base/useBase.js";
7
+ import "@gusto/embedded-api/models/errors/apierror";
8
+ import "@gusto/embedded-api/models/errors/gustoembeddederror";
9
+ import "@gusto/embedded-api/models/errors/sdkvalidationerror";
10
+ import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
11
+ import "@gusto/embedded-api/models/errors/httpclienterrors";
9
12
  import "../../../../shared/constants.js";
10
13
  import "classnames";
11
14
  import "../../../../contexts/ComponentAdapter/useComponentContext.js";
12
15
  import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
13
- import "dompurify";
14
- import "../../../../contexts/LocaleProvider/useLocale.js";
15
16
  import { createCompoundContext as o } from "../../../Base/createCompoundContext.js";
16
- const [f, v] = o(
17
+ const [v, y] = o(
17
18
  "CompanyDocumentListContext"
18
19
  );
19
20
  export {
20
- v as LocationsListProvider,
21
- f as useLocationsList
21
+ y as LocationsListProvider,
22
+ v as useLocationsList
22
23
  };
23
24
  //# sourceMappingURL=useLocationsList.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useLocationsList.js","sources":["../../../../../src/components/Company/Locations/LocationsList/useLocationsList.ts"],"sourcesContent":["import { type Location } from '@gusto/embedded-api/models/components/location'\nimport { createCompoundContext } from '@/components/Base'\nimport type { PaginationItemsPerPage } from '@/components/Common/PaginationControl/PaginationControlTypes'\n\ntype LocationsListContextType = {\n locationList: Location[]\n totalPages: number\n totalCount: number\n currentPage: number\n itemsPerPage: PaginationItemsPerPage\n handleItemsPerPageChange: (n: PaginationItemsPerPage) => void\n handleFirstPage: () => void\n handlePreviousPage: () => void\n handleNextPage: () => void\n handleLastPage: () => void\n handleEditLocation: (uuid: string) => void\n handleAddLocation: () => void\n handleContinue: () => void\n}\n\nconst [useLocationsList, LocationsListProvider] = createCompoundContext<LocationsListContextType>(\n 'CompanyDocumentListContext',\n)\n\nexport { useLocationsList, LocationsListProvider }\n"],"names":["useLocationsList","LocationsListProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;AAoBA,MAAM,CAACA,GAAkBC,CAAqB,IAAIC;AAAA,EAChD;AACF;"}
1
+ {"version":3,"file":"useLocationsList.js","sources":["../../../../../src/components/Company/Locations/LocationsList/useLocationsList.ts"],"sourcesContent":["import { type Location } from '@gusto/embedded-api/models/components/location'\nimport { createCompoundContext } from '@/components/Base'\nimport type { PaginationItemsPerPage } from '@/components/Common/PaginationControl/PaginationControlTypes'\n\ntype LocationsListContextType = {\n locationList: Location[]\n totalPages: number\n totalCount: number\n currentPage: number\n itemsPerPage: PaginationItemsPerPage\n handleItemsPerPageChange: (n: PaginationItemsPerPage) => void\n handleFirstPage: () => void\n handlePreviousPage: () => void\n handleNextPage: () => void\n handleLastPage: () => void\n handleEditLocation: (uuid: string) => void\n handleAddLocation: () => void\n handleContinue: () => void\n}\n\nconst [useLocationsList, LocationsListProvider] = createCompoundContext<LocationsListContextType>(\n 'CompanyDocumentListContext',\n)\n\nexport { useLocationsList, LocationsListProvider }\n"],"names":["useLocationsList","LocationsListProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;;AAoBA,MAAM,CAACA,GAAkBC,CAAqB,IAAIC;AAAA,EAChD;AACF;"}
@@ -2,20 +2,21 @@ import "react/jsx-runtime";
2
2
  import "react";
3
3
  import "react-error-boundary";
4
4
  import "react-i18next";
5
- import "@gusto/embedded-api/models/errors/gustoembeddederror";
6
- import "@gusto/embedded-api/models/errors/sdkvalidationerror";
7
5
  import "@tanstack/react-query";
8
6
  import "../../Base/useBase.js";
7
+ import "@gusto/embedded-api/models/errors/apierror";
8
+ import "@gusto/embedded-api/models/errors/gustoembeddederror";
9
+ import "@gusto/embedded-api/models/errors/sdkvalidationerror";
10
+ import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
11
+ import "@gusto/embedded-api/models/errors/httpclienterrors";
9
12
  import "../../../shared/constants.js";
10
13
  import "classnames";
11
14
  import "../../../contexts/ComponentAdapter/useComponentContext.js";
12
15
  import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
13
- import "dompurify";
14
- import "../../../contexts/LocaleProvider/useLocale.js";
15
16
  import { createCompoundContext as o } from "../../Base/createCompoundContext.js";
16
- const [C, c] = o("OnboardingOverviewContext");
17
+ const [c, s] = o("OnboardingOverviewContext");
17
18
  export {
18
- c as OnboardingOverviewProvider,
19
- C as useOnboardingOverview
19
+ s as OnboardingOverviewProvider,
20
+ c as useOnboardingOverview
20
21
  };
21
22
  //# sourceMappingURL=context.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","sources":["../../../../src/components/Company/OnboardingOverview/context.ts"],"sourcesContent":["import type { OnboardingStep } from '@gusto/embedded-api/models/components/companyonboardingstatus'\nimport { createCompoundContext } from '@/components/Base'\n\ntype OnboardingOverviewContextType = {\n onboardingCompleted?: boolean\n onboardingSteps?: OnboardingStep[]\n handleDone: () => void\n handleContinue: () => void\n}\n\nconst [useOnboardingOverview, OnboardingOverviewProvider] =\n createCompoundContext<OnboardingOverviewContextType>('OnboardingOverviewContext')\n\nexport { useOnboardingOverview, OnboardingOverviewProvider }\n"],"names":["useOnboardingOverview","OnboardingOverviewProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;AAUA,MAAM,CAACA,GAAuBC,CAA0B,IACtDC,EAAqD,2BAA2B;"}
1
+ {"version":3,"file":"context.js","sources":["../../../../src/components/Company/OnboardingOverview/context.ts"],"sourcesContent":["import type { OnboardingStep } from '@gusto/embedded-api/models/components/companyonboardingstatus'\nimport { createCompoundContext } from '@/components/Base'\n\ntype OnboardingOverviewContextType = {\n onboardingCompleted?: boolean\n onboardingSteps?: OnboardingStep[]\n handleDone: () => void\n handleContinue: () => void\n}\n\nconst [useOnboardingOverview, OnboardingOverviewProvider] =\n createCompoundContext<OnboardingOverviewContextType>('OnboardingOverviewContext')\n\nexport { useOnboardingOverview, OnboardingOverviewProvider }\n"],"names":["useOnboardingOverview","OnboardingOverviewProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;;AAUA,MAAM,CAACA,GAAuBC,CAA0B,IACtDC,EAAqD,2BAA2B;"}
@@ -1,38 +1,38 @@
1
- import { jsx as a, jsxs as I } from "react/jsx-runtime";
2
- import { useForm as j, FormProvider as k } from "react-hook-form";
3
- import { zodResolver as z } from "@hookform/resolvers/zod";
1
+ import { jsx as a, jsxs as j } from "react/jsx-runtime";
2
+ import { useForm as k, FormProvider as z } from "react-hook-form";
3
+ import { zodResolver as G } from "@hookform/resolvers/zod";
4
4
  import { useState as A, useEffect as _ } from "react";
5
- import { usePaySchedulesGetPreview as G } from "@gusto/embedded-api/react-query/paySchedulesGetPreview";
6
- import { usePaySchedulesUpdateMutation as K } from "@gusto/embedded-api/react-query/paySchedulesUpdate";
7
- import { usePaySchedulesGetAllSuspense as J } from "@gusto/embedded-api/react-query/paySchedulesGetAll";
8
- import { usePaySchedulesCreateMutation as Q } from "@gusto/embedded-api/react-query/paySchedulesCreate";
9
- import { PayScheduleSchema as W, PayScheduleProvider as X } from "./usePaySchedule.js";
10
- import { Form as Z } from "../../Common/Form/Form.js";
11
- import { BaseComponent as $ } from "../../Base/Base.js";
12
- import { useBase as V } from "../../Base/useBase.js";
13
- import { Flex as ee } from "../../Common/Flex/Flex.js";
5
+ import { usePaySchedulesGetPreview as K } from "@gusto/embedded-api/react-query/paySchedulesGetPreview";
6
+ import { usePaySchedulesUpdateMutation as J } from "@gusto/embedded-api/react-query/paySchedulesUpdate";
7
+ import { usePaySchedulesGetAllSuspense as Q } from "@gusto/embedded-api/react-query/paySchedulesGetAll";
8
+ import { usePaySchedulesCreateMutation as W } from "@gusto/embedded-api/react-query/paySchedulesCreate";
9
+ import { PayScheduleSchema as X, PayScheduleProvider as Z } from "./usePaySchedule.js";
10
+ import { Form as $ } from "../../Common/Form/Form.js";
11
+ import { BaseComponent as V } from "../../Base/Base.js";
12
+ import { useBase as ee } from "../../Base/useBase.js";
13
+ import { Flex as oe } from "../../Common/Flex/Flex.js";
14
14
  import "classnames";
15
15
  import { componentEvents as S } from "../../../shared/constants.js";
16
16
  import "react-i18next";
17
17
  import "../../../contexts/ComponentAdapter/useComponentContext.js";
18
- import { useI18n as oe, useComponentDictionary as re } from "../../../i18n/I18n.js";
18
+ import { useI18n as re, useComponentDictionary as te } from "../../../i18n/I18n.js";
19
19
  import { formatDateToStringDate as l } from "../../../helpers/dateFormatting.js";
20
- import { normalizeErrorKeyForForm as te } from "../../../helpers/formattedStrings.js";
21
- import { Head as ae } from "./_parts/Head.js";
22
- import { List as ne } from "./_parts/List.js";
23
- import { Edit as ce } from "./_parts/Edit.js";
24
- import { Actions as ie } from "./_parts/Actions.js";
25
- const Me = ({
20
+ import { normalizeErrorKeyForForm as ae } from "../../../helpers/formattedStrings.js";
21
+ import { Head as ne } from "./_parts/Head.js";
22
+ import { List as ce } from "./_parts/List.js";
23
+ import { Edit as ie } from "./_parts/Edit.js";
24
+ import { Actions as de } from "./_parts/Actions.js";
25
+ const Ne = ({
26
26
  companyId: n,
27
27
  defaultValues: s,
28
28
  dictionary: t,
29
29
  ...m
30
- }) => (oe("Company.PaySchedule"), re("Company.PaySchedule", t), /* @__PURE__ */ a($, { ...m, children: /* @__PURE__ */ a(de, { companyId: n, defaultValues: s, children: m.children }) })), de = ({ companyId: n, children: s, defaultValues: t }) => {
31
- const { baseSubmitHandler: m, onEvent: u, fieldErrors: h, setError: C } = V(), { data: p } = J({
30
+ }) => (re("Company.PaySchedule"), te("Company.PaySchedule", t), /* @__PURE__ */ a(V, { ...m, children: /* @__PURE__ */ a(se, { companyId: n, defaultValues: s, children: m.children }) })), se = ({ companyId: n, children: s, defaultValues: t }) => {
31
+ const { baseSubmitHandler: m, onEvent: h, error: C, setError: w } = ee(), { data: p } = Q({
32
32
  companyId: n
33
33
  }), [i, y] = A(
34
34
  p.payScheduleList?.length === 0 ? "ADD_PAY_SCHEDULE" : "LIST_PAY_SCHEDULES"
35
- ), [f, w] = A(null), L = {
35
+ ), [f, L] = A(null), q = {
36
36
  frequency: t?.frequency ?? "Every week",
37
37
  anchorPayDate: t?.anchorPayDate ? new Date(t.anchorPayDate) : void 0,
38
38
  anchorEndOfPayPeriod: t?.anchorEndOfPayPeriod ? new Date(t.anchorEndOfPayPeriod) : void 0,
@@ -40,22 +40,22 @@ const Me = ({
40
40
  day2: t?.day2 ?? void 0,
41
41
  customName: t?.customName ?? "",
42
42
  customTwicePerMonth: "false"
43
- }, q = Q(), T = K(), E = j({
44
- resolver: z(W),
45
- defaultValues: L
46
- }), { watch: O, setValue: D, reset: d, clearErrors: H, setError: v } = E;
43
+ }, T = W(), O = J(), E = k({
44
+ resolver: G(X),
45
+ defaultValues: q
46
+ }), { watch: H, setValue: D, reset: d, clearErrors: U, setError: v } = E, P = C?.fieldErrors;
47
47
  _(() => {
48
- h && h.forEach((o) => {
49
- const r = te(o.errorKey);
48
+ P && P.length > 0 && P.forEach((o) => {
49
+ const r = ae(o.field);
50
50
  v(r, { message: o.message });
51
51
  });
52
- }, [v, h]);
53
- const e = O(), U = e.anchorPayDate && l(e.anchorPayDate) || "", Y = e.anchorEndOfPayPeriod && l(e.anchorEndOfPayPeriod) || "", { data: M, isLoading: N } = G(
52
+ }, [v, P]);
53
+ const e = H(), Y = e.anchorPayDate && l(e.anchorPayDate) || "", M = e.anchorEndOfPayPeriod && l(e.anchorEndOfPayPeriod) || "", { data: N, isLoading: b } = K(
54
54
  {
55
55
  companyId: n,
56
56
  frequency: e.frequency,
57
- anchorPayDate: U,
58
- anchorEndOfPayPeriod: Y,
57
+ anchorPayDate: Y,
58
+ anchorEndOfPayPeriod: M,
59
59
  day1: e.day1 ?? void 0,
60
60
  day2: e.day2 ?? void 0
61
61
  },
@@ -66,11 +66,11 @@ const Me = ({
66
66
  _(() => {
67
67
  e.frequency === "Twice per month" && e.day1 === 15 && e.day2 === 31 && e.customTwicePerMonth === void 0 ? D("customTwicePerMonth", "1st15th") : e.frequency === "Twice per month" && e.customTwicePerMonth === void 0 && D("customTwicePerMonth", "custom");
68
68
  }, [e.frequency, e.day1, e.day2, D, e.customTwicePerMonth]);
69
- const b = () => {
69
+ const g = () => {
70
70
  y("ADD_PAY_SCHEDULE"), d({});
71
- }, g = () => {
72
- y("LIST_PAY_SCHEDULES"), d({}), H(), C(null);
73
- }, B = (o) => {
71
+ }, B = () => {
72
+ y("LIST_PAY_SCHEDULES"), d({}), U(), w(null);
73
+ }, F = (o) => {
74
74
  d({
75
75
  frequency: o.frequency,
76
76
  anchorPayDate: o.anchorPayDate ? new Date(o.anchorPayDate) : void 0,
@@ -78,36 +78,36 @@ const Me = ({
78
78
  day1: o.day1 ?? void 0,
79
79
  day2: o.day2 ?? void 0,
80
80
  customName: o.customName ?? ""
81
- }), w(o), y("EDIT_PAY_SCHEDULE");
82
- }, F = () => {
83
- u(S.PAY_SCHEDULE_DONE);
84
- }, x = async (o) => {
81
+ }), L(o), y("EDIT_PAY_SCHEDULE");
82
+ }, x = () => {
83
+ h(S.PAY_SCHEDULE_DONE);
84
+ }, R = async (o) => {
85
85
  await m(o, async (r) => {
86
- const P = (c) => c && l(c) || "";
86
+ const u = (c) => c && l(c) || "";
87
87
  if (i === "ADD_PAY_SCHEDULE") {
88
- const c = await q.mutateAsync({
88
+ const c = await T.mutateAsync({
89
89
  request: {
90
90
  companyId: n,
91
91
  requestBody: {
92
92
  frequency: r.frequency,
93
- anchorPayDate: P(r.anchorPayDate),
94
- anchorEndOfPayPeriod: P(r.anchorEndOfPayPeriod),
93
+ anchorPayDate: u(r.anchorPayDate),
94
+ anchorEndOfPayPeriod: u(r.anchorEndOfPayPeriod),
95
95
  customName: r.customName,
96
96
  day1: r.day1,
97
97
  day2: r.day2
98
98
  }
99
99
  }
100
100
  });
101
- u(S.PAY_SCHEDULE_CREATED, c), d();
101
+ h(S.PAY_SCHEDULE_CREATED, c), d();
102
102
  } else if (i === "EDIT_PAY_SCHEDULE") {
103
- const c = f?.version, R = await T.mutateAsync({
103
+ const c = f?.version, I = await O.mutateAsync({
104
104
  request: {
105
105
  payScheduleId: f?.uuid,
106
106
  companyId: n,
107
107
  requestBody: {
108
108
  frequency: r.frequency,
109
- anchorPayDate: P(r.anchorPayDate),
110
- anchorEndOfPayPeriod: P(r.anchorEndOfPayPeriod),
109
+ anchorPayDate: u(r.anchorPayDate),
110
+ anchorEndOfPayPeriod: u(r.anchorEndOfPayPeriod),
111
111
  customName: r.customName,
112
112
  day1: r.day1,
113
113
  day2: r.day2,
@@ -115,36 +115,36 @@ const Me = ({
115
115
  }
116
116
  }
117
117
  });
118
- u(S.PAY_SCHEDULE_UPDATED, R), d();
118
+ h(S.PAY_SCHEDULE_UPDATED, I), d();
119
119
  }
120
120
  y("LIST_PAY_SCHEDULES");
121
121
  });
122
122
  };
123
123
  return /* @__PURE__ */ a(
124
- X,
124
+ Z,
125
125
  {
126
126
  value: {
127
127
  companyId: n,
128
- handleAdd: b,
129
- handleEdit: B,
130
- handleCancel: g,
131
- handleContinue: F,
128
+ handleAdd: g,
129
+ handleEdit: F,
130
+ handleCancel: B,
131
+ handleContinue: x,
132
132
  mode: i,
133
133
  paySchedules: p.payScheduleList,
134
- payPeriodPreview: M?.object?.payPeriods,
135
- payPreviewLoading: N,
134
+ payPeriodPreview: N?.object?.payPeriods,
135
+ payPreviewLoading: b,
136
136
  currentPaySchedule: f
137
137
  },
138
- children: /* @__PURE__ */ a("span", { "data-testid": "pay-schedule-edit-form", children: /* @__PURE__ */ a(k, { ...E, children: /* @__PURE__ */ a(Z, { onSubmit: E.handleSubmit(x), children: s || /* @__PURE__ */ I(ee, { flexDirection: "column", children: [
139
- /* @__PURE__ */ a(ae, {}),
138
+ children: /* @__PURE__ */ a("span", { "data-testid": "pay-schedule-edit-form", children: /* @__PURE__ */ a(z, { ...E, children: /* @__PURE__ */ a($, { onSubmit: E.handleSubmit(R), children: s || /* @__PURE__ */ j(oe, { flexDirection: "column", children: [
140
139
  /* @__PURE__ */ a(ne, {}),
141
140
  /* @__PURE__ */ a(ce, {}),
142
- /* @__PURE__ */ a(ie, {})
141
+ /* @__PURE__ */ a(ie, {}),
142
+ /* @__PURE__ */ a(de, {})
143
143
  ] }) }) }) })
144
144
  }
145
145
  );
146
146
  };
147
147
  export {
148
- Me as PaySchedule
148
+ Ne as PaySchedule
149
149
  };
150
150
  //# sourceMappingURL=PaySchedule.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PaySchedule.js","sources":["../../../../src/components/Company/PaySchedule/PaySchedule.tsx"],"sourcesContent":["import type { SubmitHandler } from 'react-hook-form'\nimport { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { useEffect, useState } from 'react'\nimport { usePaySchedulesGetPreview } from '@gusto/embedded-api/react-query/paySchedulesGetPreview'\nimport { usePaySchedulesUpdateMutation } from '@gusto/embedded-api/react-query/paySchedulesUpdate'\nimport { usePaySchedulesGetAllSuspense } from '@gusto/embedded-api/react-query/paySchedulesGetAll'\nimport { usePaySchedulesCreateMutation } from '@gusto/embedded-api/react-query/paySchedulesCreate'\nimport type { PayScheduleObject as PayScheduleType } from '@gusto/embedded-api/models/components/payscheduleobject'\nimport type { Frequency } from '@gusto/embedded-api/models/operations/postv1companiescompanyidpayschedules'\nimport type { MODE, PayScheduleInputs, PayScheduleOutputs } from './usePaySchedule'\nimport {\n PayScheduleProvider,\n PayScheduleSchema,\n type PayScheduleDefaultValues,\n} from './usePaySchedule'\nimport { Actions, Edit, Head, List } from './_parts'\nimport { Form } from '@/components/Common/Form'\nimport type { BaseComponentInterface, CommonComponentInterface } from '@/components/Base'\nimport { BaseComponent, useBase } from '@/components/Base'\nimport { Flex } from '@/components/Common'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { formatDateToStringDate } from '@/helpers/dateFormatting'\nimport { normalizeErrorKeyForForm } from '@/helpers/formattedStrings'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\ninterface PayScheduleProps extends CommonComponentInterface<'Company.PaySchedule'> {\n companyId: string\n defaultValues?: PayScheduleDefaultValues\n}\n\nexport const PaySchedule = ({\n companyId,\n defaultValues,\n dictionary,\n ...props\n}: PayScheduleProps & BaseComponentInterface) => {\n useI18n('Company.PaySchedule')\n useComponentDictionary('Company.PaySchedule', dictionary)\n return (\n <BaseComponent {...props}>\n <Root companyId={companyId} defaultValues={defaultValues}>\n {props.children}\n </Root>\n </BaseComponent>\n )\n}\n\nconst Root = ({ companyId, children, defaultValues }: PayScheduleProps) => {\n const { baseSubmitHandler, onEvent, fieldErrors, setError: setBaseError } = useBase()\n\n const { data: paySchedules } = usePaySchedulesGetAllSuspense({\n companyId,\n })\n\n const [mode, setMode] = useState<MODE>(\n paySchedules.payScheduleList?.length === 0 ? 'ADD_PAY_SCHEDULE' : 'LIST_PAY_SCHEDULES',\n )\n const [currentPaySchedule, setCurrentPaySchedule] = useState<PayScheduleType | null>(null)\n const transformedDefaultValues: PayScheduleInputs = {\n frequency: defaultValues?.frequency ?? 'Every week',\n anchorPayDate: defaultValues?.anchorPayDate ? new Date(defaultValues.anchorPayDate) : undefined,\n anchorEndOfPayPeriod: defaultValues?.anchorEndOfPayPeriod\n ? new Date(defaultValues.anchorEndOfPayPeriod)\n : undefined,\n day1: defaultValues?.day1 ?? undefined,\n day2: defaultValues?.day2 ?? undefined,\n customName: defaultValues?.customName ?? '',\n customTwicePerMonth: 'false',\n }\n\n const createPayScheduleMutation = usePaySchedulesCreateMutation()\n const updatePayScheduleMutation = usePaySchedulesUpdateMutation()\n\n const formMethods = useForm<PayScheduleInputs, unknown, PayScheduleOutputs>({\n resolver: zodResolver(PayScheduleSchema),\n defaultValues: transformedDefaultValues,\n })\n const { watch, setValue, reset, clearErrors, setError } = formMethods\n\n useEffect(() => {\n if (fieldErrors) {\n fieldErrors.forEach(error => {\n const key = normalizeErrorKeyForForm(error.errorKey)\n setError(key as keyof PayScheduleInputs, { message: error.message })\n })\n }\n }, [setError, fieldErrors])\n\n const allValues = watch()\n\n const formattedAnchorPayDate = allValues.anchorPayDate\n ? formatDateToStringDate(allValues.anchorPayDate) || ''\n : ''\n const formattedAnchorEndOfPayPeriod = allValues.anchorEndOfPayPeriod\n ? formatDateToStringDate(allValues.anchorEndOfPayPeriod) || ''\n : ''\n\n const { data: payPreviewData, isLoading } = usePaySchedulesGetPreview(\n {\n companyId,\n frequency: allValues.frequency,\n anchorPayDate: formattedAnchorPayDate,\n anchorEndOfPayPeriod: formattedAnchorEndOfPayPeriod,\n day1: allValues.day1 ?? undefined,\n day2: allValues.day2 ?? undefined,\n },\n {\n enabled: Boolean(\n allValues.anchorPayDate &&\n allValues.anchorEndOfPayPeriod &&\n (mode === 'ADD_PAY_SCHEDULE' || mode === 'EDIT_PAY_SCHEDULE'),\n ),\n },\n )\n\n // Set the custom_twice_per_month value based on the frequency and day_1 and day_2 values as it is not set by the API call\n useEffect(() => {\n if (\n allValues.frequency === 'Twice per month' &&\n allValues.day1 === 15 &&\n allValues.day2 === 31 &&\n allValues.customTwicePerMonth === undefined\n ) {\n setValue('customTwicePerMonth', `1st15th`)\n } else if (\n allValues.frequency === 'Twice per month' &&\n allValues.customTwicePerMonth === undefined\n ) {\n setValue('customTwicePerMonth', `custom`)\n }\n }, [allValues.frequency, allValues.day1, allValues.day2, setValue, allValues.customTwicePerMonth])\n\n const handleAdd = () => {\n setMode('ADD_PAY_SCHEDULE')\n reset({})\n }\n const handleCancel = () => {\n setMode('LIST_PAY_SCHEDULES')\n reset({})\n clearErrors()\n setBaseError(null)\n }\n const handleEdit = (schedule: PayScheduleType) => {\n reset({\n frequency: schedule.frequency as Frequency,\n anchorPayDate: schedule.anchorPayDate ? new Date(schedule.anchorPayDate) : undefined,\n anchorEndOfPayPeriod: schedule.anchorEndOfPayPeriod\n ? new Date(schedule.anchorEndOfPayPeriod)\n : undefined,\n day1: schedule.day1 ?? undefined,\n day2: schedule.day2 ?? undefined,\n customName: schedule.customName ?? '',\n })\n setCurrentPaySchedule(schedule)\n setMode('EDIT_PAY_SCHEDULE')\n }\n const handleContinue = () => {\n onEvent(componentEvents.PAY_SCHEDULE_DONE)\n }\n const onSubmit: SubmitHandler<PayScheduleOutputs> = async data => {\n await baseSubmitHandler(data, async payload => {\n const formatPayloadDate = (date: Date | undefined): string => {\n return date ? formatDateToStringDate(date) || '' : ''\n }\n\n if (mode === 'ADD_PAY_SCHEDULE') {\n const createPayScheduleResponse = await createPayScheduleMutation.mutateAsync({\n request: {\n companyId,\n requestBody: {\n frequency: payload.frequency,\n anchorPayDate: formatPayloadDate(payload.anchorPayDate),\n anchorEndOfPayPeriod: formatPayloadDate(payload.anchorEndOfPayPeriod),\n customName: payload.customName,\n day1: payload.day1,\n day2: payload.day2,\n },\n },\n })\n onEvent(componentEvents.PAY_SCHEDULE_CREATED, createPayScheduleResponse)\n reset()\n } else if (mode === 'EDIT_PAY_SCHEDULE') {\n const version = currentPaySchedule?.version\n const updatePayScheduleResponse = await updatePayScheduleMutation.mutateAsync({\n request: {\n payScheduleId: currentPaySchedule?.uuid as string,\n companyId,\n requestBody: {\n frequency: payload.frequency,\n anchorPayDate: formatPayloadDate(payload.anchorPayDate),\n anchorEndOfPayPeriod: formatPayloadDate(payload.anchorEndOfPayPeriod),\n customName: payload.customName,\n day1: payload.day1,\n day2: payload.day2,\n version: version as string,\n },\n },\n })\n onEvent(componentEvents.PAY_SCHEDULE_UPDATED, updatePayScheduleResponse)\n reset()\n }\n setMode('LIST_PAY_SCHEDULES')\n })\n }\n\n return (\n <PayScheduleProvider\n value={{\n companyId,\n handleAdd,\n handleEdit,\n handleCancel,\n handleContinue,\n mode,\n paySchedules: paySchedules.payScheduleList,\n payPeriodPreview: payPreviewData?.object?.payPeriods,\n payPreviewLoading: isLoading,\n currentPaySchedule,\n }}\n >\n <span data-testid=\"pay-schedule-edit-form\">\n <FormProvider {...formMethods}>\n <Form onSubmit={formMethods.handleSubmit(onSubmit)}>\n {children ? (\n children\n ) : (\n <Flex flexDirection=\"column\">\n <Head />\n <List />\n <Edit />\n <Actions />\n </Flex>\n )}\n </Form>\n </FormProvider>\n </span>\n </PayScheduleProvider>\n )\n}\n"],"names":["PaySchedule","companyId","defaultValues","dictionary","props","useI18n","useComponentDictionary","jsx","BaseComponent","Root","children","baseSubmitHandler","onEvent","fieldErrors","setBaseError","useBase","paySchedules","usePaySchedulesGetAllSuspense","mode","setMode","useState","currentPaySchedule","setCurrentPaySchedule","transformedDefaultValues","createPayScheduleMutation","usePaySchedulesCreateMutation","updatePayScheduleMutation","usePaySchedulesUpdateMutation","formMethods","useForm","zodResolver","PayScheduleSchema","watch","setValue","reset","clearErrors","setError","useEffect","error","key","normalizeErrorKeyForForm","allValues","formattedAnchorPayDate","formatDateToStringDate","formattedAnchorEndOfPayPeriod","payPreviewData","isLoading","usePaySchedulesGetPreview","handleAdd","handleCancel","handleEdit","schedule","handleContinue","componentEvents","onSubmit","data","payload","formatPayloadDate","date","createPayScheduleResponse","version","updatePayScheduleResponse","PayScheduleProvider","FormProvider","Form","jsxs","Flex","Head","List","Edit","Actions"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAgCO,MAAMA,KAAc,CAAC;AAAA,EAC1B,WAAAC;AAAA,EACA,eAAAC;AAAA,EACA,YAAAC;AAAA,EACA,GAAGC;AACL,OACEC,GAAQ,qBAAqB,GAC7BC,GAAuB,uBAAuBH,CAAU,GA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,UACF;AAAA,QACF,CACD;AACD,QAAAhD,EAAQyC,EAAgB,sBAAsBQ,CAAyB,GACvE3B,EAAA;AAAA,MACF;AACA,MAAAf,EAAQ,oBAAoB;AAAA,IAC9B,CAAC;AAAA,EACH;AAEA,SACE,gBAAAZ;AAAA,IAACuD;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,WAAA7D;AAAA,QACA,WAAA+C;AAAA,QACA,YAAAE;AAAA,QACA,cAAAD;AAAA,QACA,gBAAAG;AAAA,QACA,MAAAlC;AAAA,QACA,cAAcF,EAAa;AAAA,QAC3B,kBAAkB6B,GAAgB,QAAQ;AAAA,QAC1C,mBAAmBC;AAAA,QACnB,oBAAAzB;AAAA,MAAA;AAAA,MAGF,UAAA,gBAAAd,EAAC,UAAK,eAAY,0BAChB,4BAACwD,GAAA,EAAc,GAAGnC,GAChB,UAAA,gBAAArB,EAACyD,GAAA,EAAK,UAAUpC,EAAY,aAAa0B,CAAQ,GAC9C,UAAA5C,KAGC,gBAAAuD,EAACC,IAAA,EAAK,eAAc,UAClB,UAAA;AAAA,QAAA,gBAAA3D,EAAC4D,IAAA,EAAK;AAAA,0BACLC,IAAA,EAAK;AAAA,0BACLC,IAAA,EAAK;AAAA,0BACLC,IAAA,CAAA,CAAQ;AAAA,MAAA,GACX,EAAA,CAEJ,GACF,EAAA,CACF;AAAA,IAAA;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"PaySchedule.js","sources":["../../../../src/components/Company/PaySchedule/PaySchedule.tsx"],"sourcesContent":["import type { SubmitHandler } from 'react-hook-form'\nimport { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { useEffect, useState } from 'react'\nimport { usePaySchedulesGetPreview } from '@gusto/embedded-api/react-query/paySchedulesGetPreview'\nimport { usePaySchedulesUpdateMutation } from '@gusto/embedded-api/react-query/paySchedulesUpdate'\nimport { usePaySchedulesGetAllSuspense } from '@gusto/embedded-api/react-query/paySchedulesGetAll'\nimport { usePaySchedulesCreateMutation } from '@gusto/embedded-api/react-query/paySchedulesCreate'\nimport type { PayScheduleObject as PayScheduleType } from '@gusto/embedded-api/models/components/payscheduleobject'\nimport type { Frequency } from '@gusto/embedded-api/models/operations/postv1companiescompanyidpayschedules'\nimport type { MODE, PayScheduleInputs, PayScheduleOutputs } from './usePaySchedule'\nimport {\n PayScheduleProvider,\n PayScheduleSchema,\n type PayScheduleDefaultValues,\n} from './usePaySchedule'\nimport { Actions, Edit, Head, List } from './_parts'\nimport { Form } from '@/components/Common/Form'\nimport type { BaseComponentInterface, CommonComponentInterface } from '@/components/Base'\nimport { BaseComponent, useBase } from '@/components/Base'\nimport { Flex } from '@/components/Common'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { formatDateToStringDate } from '@/helpers/dateFormatting'\nimport { normalizeErrorKeyForForm } from '@/helpers/formattedStrings'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\ninterface PayScheduleProps extends CommonComponentInterface<'Company.PaySchedule'> {\n companyId: string\n defaultValues?: PayScheduleDefaultValues\n}\n\nexport const PaySchedule = ({\n companyId,\n defaultValues,\n dictionary,\n ...props\n}: PayScheduleProps & BaseComponentInterface) => {\n useI18n('Company.PaySchedule')\n useComponentDictionary('Company.PaySchedule', dictionary)\n return (\n <BaseComponent {...props}>\n <Root companyId={companyId} defaultValues={defaultValues}>\n {props.children}\n </Root>\n </BaseComponent>\n )\n}\n\nconst Root = ({ companyId, children, defaultValues }: PayScheduleProps) => {\n const { baseSubmitHandler, onEvent, error, setError: setBaseError } = useBase()\n\n const { data: paySchedules } = usePaySchedulesGetAllSuspense({\n companyId,\n })\n\n const [mode, setMode] = useState<MODE>(\n paySchedules.payScheduleList?.length === 0 ? 'ADD_PAY_SCHEDULE' : 'LIST_PAY_SCHEDULES',\n )\n const [currentPaySchedule, setCurrentPaySchedule] = useState<PayScheduleType | null>(null)\n const transformedDefaultValues: PayScheduleInputs = {\n frequency: defaultValues?.frequency ?? 'Every week',\n anchorPayDate: defaultValues?.anchorPayDate ? new Date(defaultValues.anchorPayDate) : undefined,\n anchorEndOfPayPeriod: defaultValues?.anchorEndOfPayPeriod\n ? new Date(defaultValues.anchorEndOfPayPeriod)\n : undefined,\n day1: defaultValues?.day1 ?? undefined,\n day2: defaultValues?.day2 ?? undefined,\n customName: defaultValues?.customName ?? '',\n customTwicePerMonth: 'false',\n }\n\n const createPayScheduleMutation = usePaySchedulesCreateMutation()\n const updatePayScheduleMutation = usePaySchedulesUpdateMutation()\n\n const formMethods = useForm<PayScheduleInputs, unknown, PayScheduleOutputs>({\n resolver: zodResolver(PayScheduleSchema),\n defaultValues: transformedDefaultValues,\n })\n const { watch, setValue, reset, clearErrors, setError } = formMethods\n\n const fieldErrors = error?.fieldErrors\n useEffect(() => {\n if (fieldErrors && fieldErrors.length > 0) {\n fieldErrors.forEach(fieldError => {\n const key = normalizeErrorKeyForForm(fieldError.field)\n setError(key as keyof PayScheduleInputs, { message: fieldError.message })\n })\n }\n }, [setError, fieldErrors])\n\n const allValues = watch()\n\n const formattedAnchorPayDate = allValues.anchorPayDate\n ? formatDateToStringDate(allValues.anchorPayDate) || ''\n : ''\n const formattedAnchorEndOfPayPeriod = allValues.anchorEndOfPayPeriod\n ? formatDateToStringDate(allValues.anchorEndOfPayPeriod) || ''\n : ''\n\n const { data: payPreviewData, isLoading } = usePaySchedulesGetPreview(\n {\n companyId,\n frequency: allValues.frequency,\n anchorPayDate: formattedAnchorPayDate,\n anchorEndOfPayPeriod: formattedAnchorEndOfPayPeriod,\n day1: allValues.day1 ?? undefined,\n day2: allValues.day2 ?? undefined,\n },\n {\n enabled: Boolean(\n allValues.anchorPayDate &&\n allValues.anchorEndOfPayPeriod &&\n (mode === 'ADD_PAY_SCHEDULE' || mode === 'EDIT_PAY_SCHEDULE'),\n ),\n },\n )\n\n // Set the custom_twice_per_month value based on the frequency and day_1 and day_2 values as it is not set by the API call\n useEffect(() => {\n if (\n allValues.frequency === 'Twice per month' &&\n allValues.day1 === 15 &&\n allValues.day2 === 31 &&\n allValues.customTwicePerMonth === undefined\n ) {\n setValue('customTwicePerMonth', `1st15th`)\n } else if (\n allValues.frequency === 'Twice per month' &&\n allValues.customTwicePerMonth === undefined\n ) {\n setValue('customTwicePerMonth', `custom`)\n }\n }, [allValues.frequency, allValues.day1, allValues.day2, setValue, allValues.customTwicePerMonth])\n\n const handleAdd = () => {\n setMode('ADD_PAY_SCHEDULE')\n reset({})\n }\n const handleCancel = () => {\n setMode('LIST_PAY_SCHEDULES')\n reset({})\n clearErrors()\n setBaseError(null)\n }\n const handleEdit = (schedule: PayScheduleType) => {\n reset({\n frequency: schedule.frequency as Frequency,\n anchorPayDate: schedule.anchorPayDate ? new Date(schedule.anchorPayDate) : undefined,\n anchorEndOfPayPeriod: schedule.anchorEndOfPayPeriod\n ? new Date(schedule.anchorEndOfPayPeriod)\n : undefined,\n day1: schedule.day1 ?? undefined,\n day2: schedule.day2 ?? undefined,\n customName: schedule.customName ?? '',\n })\n setCurrentPaySchedule(schedule)\n setMode('EDIT_PAY_SCHEDULE')\n }\n const handleContinue = () => {\n onEvent(componentEvents.PAY_SCHEDULE_DONE)\n }\n const onSubmit: SubmitHandler<PayScheduleOutputs> = async data => {\n await baseSubmitHandler(data, async payload => {\n const formatPayloadDate = (date: Date | undefined): string => {\n return date ? formatDateToStringDate(date) || '' : ''\n }\n\n if (mode === 'ADD_PAY_SCHEDULE') {\n const createPayScheduleResponse = await createPayScheduleMutation.mutateAsync({\n request: {\n companyId,\n requestBody: {\n frequency: payload.frequency,\n anchorPayDate: formatPayloadDate(payload.anchorPayDate),\n anchorEndOfPayPeriod: formatPayloadDate(payload.anchorEndOfPayPeriod),\n customName: payload.customName,\n day1: payload.day1,\n day2: payload.day2,\n },\n },\n })\n onEvent(componentEvents.PAY_SCHEDULE_CREATED, createPayScheduleResponse)\n reset()\n } else if (mode === 'EDIT_PAY_SCHEDULE') {\n const version = currentPaySchedule?.version\n const updatePayScheduleResponse = await updatePayScheduleMutation.mutateAsync({\n request: {\n payScheduleId: currentPaySchedule?.uuid as string,\n companyId,\n requestBody: {\n frequency: payload.frequency,\n anchorPayDate: formatPayloadDate(payload.anchorPayDate),\n anchorEndOfPayPeriod: formatPayloadDate(payload.anchorEndOfPayPeriod),\n customName: payload.customName,\n day1: payload.day1,\n day2: payload.day2,\n version: version as string,\n },\n },\n })\n onEvent(componentEvents.PAY_SCHEDULE_UPDATED, updatePayScheduleResponse)\n reset()\n }\n setMode('LIST_PAY_SCHEDULES')\n })\n }\n\n return (\n <PayScheduleProvider\n value={{\n companyId,\n handleAdd,\n handleEdit,\n handleCancel,\n handleContinue,\n mode,\n paySchedules: paySchedules.payScheduleList,\n payPeriodPreview: payPreviewData?.object?.payPeriods,\n payPreviewLoading: isLoading,\n currentPaySchedule,\n }}\n >\n <span data-testid=\"pay-schedule-edit-form\">\n <FormProvider {...formMethods}>\n <Form onSubmit={formMethods.handleSubmit(onSubmit)}>\n {children ? (\n children\n ) : (\n <Flex flexDirection=\"column\">\n <Head />\n <List />\n <Edit />\n <Actions />\n </Flex>\n )}\n </Form>\n </FormProvider>\n </span>\n </PayScheduleProvider>\n )\n}\n"],"names":["PaySchedule","companyId","defaultValues","dictionary","props","useI18n","useComponentDictionary","jsx","BaseComponent","Root","children","baseSubmitHandler","onEvent","error","setBaseError","useBase","paySchedules","usePaySchedulesGetAllSuspense","mode","setMode","useState","currentPaySchedule","setCurrentPaySchedule","transformedDefaultValues","createPayScheduleMutation","usePaySchedulesCreateMutation","updatePayScheduleMutation","usePaySchedulesUpdateMutation","formMethods","useForm","zodResolver","PayScheduleSchema","watch","setValue","reset","clearErrors","setError","fieldErrors","useEffect","fieldError","key","normalizeErrorKeyForForm","allValues","formattedAnchorPayDate","formatDateToStringDate","formattedAnchorEndOfPayPeriod","payPreviewData","isLoading","usePaySchedulesGetPreview","handleAdd","handleCancel","handleEdit","schedule","handleContinue","componentEvents","onSubmit","data","payload","formatPayloadDate","date","createPayScheduleResponse","version","updatePayScheduleResponse","PayScheduleProvider","FormProvider","Form","jsxs","Flex","Head","List","Edit","Actions"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAgCO,MAAMA,KAAc,CAAC;AAAA,EAC1B,WAAAC;AAAA,EACA,eAAAC;AAAA,EACA,YAAAC;AAAA,EACA,GAAGC;AACL,OACEC,GAAQ,qBAAqB,GAC7BC,GAAuB,uBAAuBH,CAAU,GAEtD,gBAAAI,EAACC,GAAA,EAAe,GAAGJ,GACjB,UAAA,gBAAAG,EAACE,MAAK,WAAAR,GAAsB,eAAAC,GACzB,UAAAE,EAAM,SAAA,CACT,EAAA,CACF,IAIEK,KAAO,CAAC,EAAE,WAAAR,GAAW,UAAAS,GAAU,eAAAR,QAAsC;AACzE,QAAM,EAAE,mBAAAS,GAAmB,SAAAC,GAAS,OAAAC,GAAO,UAAUC,EAAA,IAAiBC,GAAA,GAEhE,EAAE,MAAMC,EAAA,IAAiBC,EAA8B;AAAA,IAC3D,WAAAhB;AAAA,EAAA,CACD,GAEK,CAACiB,GAAMC,CAAO,IAAIC;AAAA,IACtBJ,EAAa,iBAAiB,WAAW,IAAI,qBAAqB;AAAA,EAAA,GAE9D,CAACK,GAAoBC,CAAqB,IAAIF,EAAiC,IAAI,GACnFG,IAA8C;AAAA,IAClD,WAAWrB,GAAe,aAAa;AAAA,IACvC,eAAeA,GAAe,gBAAgB,IAAI,KAAKA,EAAc,aAAa,IAAI;AAAA,IACtF,sBAAsBA,GAAe,uBACjC,IAAI,KAAKA,EAAc,oBAAoB,IAC3C;AAAA,IACJ,MAAMA,GAAe,QAAQ;AAAA,IAC7B,MAAMA,GAAe,QAAQ;AAAA,IAC7B,YAAYA,GAAe,cAAc;AAAA,IACzC,qBAAqB;AAAA,EAAA,GAGjBsB,IAA4BC,EAAA,GAC5BC,IAA4BC,EAAA,GAE5BC,IAAcC,EAAwD;AAAA,IAC1E,UAAUC,EAAYC,CAAiB;AAAA,IACvC,eAAeR;AAAA,EAAA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import "react-error-boundary";
5
5
  import "react-i18next";
6
- import "@gusto/embedded-api/models/errors/gustoembeddederror";
7
- import "@gusto/embedded-api/models/errors/sdkvalidationerror";
8
6
  import "@tanstack/react-query";
9
7
  import "../../Base/useBase.js";
8
+ import "@gusto/embedded-api/models/errors/apierror";
9
+ import "@gusto/embedded-api/models/errors/gustoembeddederror";
10
+ import "@gusto/embedded-api/models/errors/sdkvalidationerror";
11
+ import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
12
+ import "@gusto/embedded-api/models/errors/httpclienterrors";
10
13
  import "../../../shared/constants.js";
11
14
  import "classnames";
12
15
  import "../../../contexts/ComponentAdapter/useComponentContext.js";
13
16
  import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
14
- import "dompurify";
15
- import "../../../contexts/LocaleProvider/useLocale.js";
16
17
  import { createCompoundContext as t } from "../../Base/createCompoundContext.js";
17
- const S = o.object({
18
+ const f = o.object({
18
19
  frequency: o.enum(["Every week", "Every other week", "Twice per month", "Monthly"]),
19
20
  anchorPayDate: o.date().optional(),
20
21
  anchorEndOfPayPeriod: o.date().optional(),
@@ -22,10 +23,10 @@ const S = o.object({
22
23
  day2: o.number().min(1).max(31).optional(),
23
24
  customName: o.string().optional(),
24
25
  customTwicePerMonth: o.string().optional()
25
- }), [f, w] = t("PayScheduleContext");
26
+ }), [w, b] = t("PayScheduleContext");
26
27
  export {
27
- w as PayScheduleProvider,
28
- S as PayScheduleSchema,
29
- f as usePaySchedule
28
+ b as PayScheduleProvider,
29
+ f as PayScheduleSchema,
30
+ w as usePaySchedule
30
31
  };
31
32
  //# 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})\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":";;;;;;;;;;;;;;;;AA2BO,MAAMA,IAAoBC,EAAE,OAAO;AAAA,EACxC,WAAWA,EAAE,KAAK,CAAC,cAAc,oBAAoB,mBAAmB,SAAS,CAAC;AAAA,EAClF,eAAeA,EAAE,KAAA,EAAO,SAAA;AAAA,EACxB,sBAAsBA,EAAE,KAAA,EAAO,SAAA;AAAA,EAC/B,MAAMA,EAAE,OAAA,EAAS,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,SAAA;AAAA,EAChC,MAAMA,EAAE,OAAA,EAAS,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,SAAA;AAAA,EAChC,YAAYA,EAAE,OAAA,EAAS,SAAA;AAAA,EACvB,qBAAqBA,EAAE,OAAA,EAAS,SAAA;AAClC,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})\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":";;;;;;;;;;;;;;;;;AA2BO,MAAMA,IAAoBC,EAAE,OAAO;AAAA,EACxC,WAAWA,EAAE,KAAK,CAAC,cAAc,oBAAoB,mBAAmB,SAAS,CAAC;AAAA,EAClF,eAAeA,EAAE,KAAA,EAAO,SAAA;AAAA,EACxB,sBAAsBA,EAAE,KAAA,EAAO,SAAA;AAAA,EAC/B,MAAMA,EAAE,OAAA,EAAS,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,SAAA;AAAA,EAChC,MAAMA,EAAE,OAAA,EAAS,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,SAAA;AAAA,EAChC,YAAYA,EAAE,OAAA,EAAS,SAAA;AAAA,EACvB,qBAAqBA,EAAE,OAAA,EAAS,SAAA;AAClC,CAAC,GAcK,CAACC,GAAgBC,CAAmB,IACxCC,EAA8C,oBAAoB;"}
@@ -2,20 +2,21 @@ import "react/jsx-runtime";
2
2
  import "react";
3
3
  import "react-error-boundary";
4
4
  import "react-i18next";
5
- import "@gusto/embedded-api/models/errors/gustoembeddederror";
6
- import "@gusto/embedded-api/models/errors/sdkvalidationerror";
7
5
  import "@tanstack/react-query";
8
6
  import "../../../Base/useBase.js";
7
+ import "@gusto/embedded-api/models/errors/apierror";
8
+ import "@gusto/embedded-api/models/errors/gustoembeddederror";
9
+ import "@gusto/embedded-api/models/errors/sdkvalidationerror";
10
+ import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
11
+ import "@gusto/embedded-api/models/errors/httpclienterrors";
9
12
  import "../../../../shared/constants.js";
10
13
  import "classnames";
11
14
  import "../../../../contexts/ComponentAdapter/useComponentContext.js";
12
15
  import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
13
- import "dompurify";
14
- import "../../../../contexts/LocaleProvider/useLocale.js";
15
16
  import { createCompoundContext as t } from "../../../Base/createCompoundContext.js";
16
- const [d, u] = t("StateTaxesFormContext");
17
+ const [u, f] = t("StateTaxesFormContext");
17
18
  export {
18
- u as StateTaxesFormProvider,
19
- d as useStateTaxesForm
19
+ f as StateTaxesFormProvider,
20
+ u as useStateTaxesForm
20
21
  };
21
22
  //# 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;"}
@@ -2,20 +2,21 @@ import "react/jsx-runtime";
2
2
  import "react";
3
3
  import "react-error-boundary";
4
4
  import "react-i18next";
5
- import "@gusto/embedded-api/models/errors/gustoembeddederror";
6
- import "@gusto/embedded-api/models/errors/sdkvalidationerror";
7
5
  import "@tanstack/react-query";
8
6
  import "../../../Base/useBase.js";
7
+ import "@gusto/embedded-api/models/errors/apierror";
8
+ import "@gusto/embedded-api/models/errors/gustoembeddederror";
9
+ import "@gusto/embedded-api/models/errors/sdkvalidationerror";
10
+ import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
11
+ import "@gusto/embedded-api/models/errors/httpclienterrors";
9
12
  import "../../../../shared/constants.js";
10
13
  import "classnames";
11
14
  import "../../../../contexts/ComponentAdapter/useComponentContext.js";
12
15
  import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
13
- import "dompurify";
14
- import "../../../../contexts/LocaleProvider/useLocale.js";
15
16
  import { createCompoundContext as t } from "../../../Base/createCompoundContext.js";
16
- const [d, u] = t("StateTaxesListContext");
17
+ const [u, f] = t("StateTaxesListContext");
17
18
  export {
18
- u as StateTaxesListProvider,
19
- d as useStateTaxesList
19
+ f as StateTaxesListProvider,
20
+ u as useStateTaxesList
20
21
  };
21
22
  //# 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;"}
@@ -3,29 +3,30 @@ import "react/jsx-runtime";
3
3
  import "react";
4
4
  import "react-error-boundary";
5
5
  import "react-i18next";
6
- import "@gusto/embedded-api/models/errors/gustoembeddederror";
7
- import "@gusto/embedded-api/models/errors/sdkvalidationerror";
8
6
  import "@tanstack/react-query";
9
7
  import "../../Base/useBase.js";
8
+ import "@gusto/embedded-api/models/errors/apierror";
9
+ import "@gusto/embedded-api/models/errors/gustoembeddederror";
10
+ import "@gusto/embedded-api/models/errors/sdkvalidationerror";
11
+ import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
12
+ import "@gusto/embedded-api/models/errors/httpclienterrors";
10
13
  import "../../../shared/constants.js";
11
14
  import "classnames";
12
15
  import "../../../contexts/ComponentAdapter/useComponentContext.js";
13
16
  import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
14
- import "dompurify";
15
- import "../../../contexts/LocaleProvider/useLocale.js";
16
17
  import { createCompoundContext as r } from "../../Base/createCompoundContext.js";
17
- const z = t.object({
18
+ const b = t.object({
18
19
  street1: t.string().min(1),
19
20
  street2: t.string().optional(),
20
21
  city: t.string().min(1),
21
22
  state: t.string().min(1),
22
23
  zip: t.string().min(1)
23
- }), [b, h] = r(
24
+ }), [h, j] = r(
24
25
  "ContractorAddressContext"
25
26
  );
26
27
  export {
27
- z as AddressFormSchema,
28
- h as AddressProvider,
29
- b as useAddress
28
+ b as AddressFormSchema,
29
+ j as AddressProvider,
30
+ h as useAddress
30
31
  };
31
32
  //# 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":";;;;;;;;;;;;;;;;AAiBO,MAAMA,IAAoBC,EAAE,OAAO;AAAA,EACxC,SAASA,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,KAAKA,EAAE,OAAA,EAAS,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":";;;;;;;;;;;;;;;;;AAiBO,MAAMA,IAAoBC,EAAE,OAAO;AAAA,EACxC,SAASA,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,KAAKA,EAAE,OAAA,EAAS,IAAI,CAAC;AACvB,CAAC,GAIK,CAACC,GAAYC,CAAe,IAAIC;AAAA,EACpC;AACF;"}