@gusto/embedded-react-sdk 0.36.0 → 0.37.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (344) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/UNSTABLE_Hooks.d.ts +1 -1
  3. package/dist/UNSTABLE_Hooks.js +6 -6
  4. package/dist/components/Base/Base.d.ts +8 -10
  5. package/dist/components/Base/Base.js +121 -100
  6. package/dist/components/Base/Base.js.map +1 -1
  7. package/dist/components/Base/index.d.ts +1 -1
  8. package/dist/components/Base/useBase.d.ts +3 -7
  9. package/dist/components/Base/useBase.js.map +1 -1
  10. package/dist/components/Base/useBaseSubmit.d.ts +3 -5
  11. package/dist/components/Base/useBaseSubmit.js +27 -50
  12. package/dist/components/Base/useBaseSubmit.js.map +1 -1
  13. package/dist/components/Common/SignatureForm/SignatureFormActions.js +1 -1
  14. package/dist/components/Common/SignatureForm/SignatureFormFields.js +1 -1
  15. package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js +1 -1
  16. package/dist/components/Common/UI/DescriptionList/DescriptionList.module.scss.js +2 -2
  17. package/dist/components/Common/UI/FileInput/FileInput.js +1 -1
  18. package/dist/components/Common/UI/ProgressBar/ProgressBar.js +4 -4
  19. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +6 -5
  20. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
  21. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +6 -8
  22. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  23. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +5 -4
  24. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
  25. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +6 -8
  26. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  27. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +8 -10
  28. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  29. package/dist/components/Company/BankAccount/BankAccountForm/context.js +6 -8
  30. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  31. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +6 -8
  32. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  33. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +6 -8
  34. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  35. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +11 -13
  36. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  37. package/dist/components/Company/Industry/Context.js +9 -11
  38. package/dist/components/Company/Industry/Context.js.map +1 -1
  39. package/dist/components/Company/Locations/LocationForm/Form.js +5 -4
  40. package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
  41. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +6 -8
  42. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  43. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +6 -8
  44. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  45. package/dist/components/Company/OnboardingOverview/context.js +6 -8
  46. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  47. package/dist/components/Company/PaySchedule/PaySchedule.js +60 -60
  48. package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
  49. package/dist/components/Company/PaySchedule/_parts/Edit.js +10 -9
  50. package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
  51. package/dist/components/Company/PaySchedule/usePaySchedule.js +8 -10
  52. package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
  53. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +6 -8
  54. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  55. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +6 -8
  56. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  57. package/dist/components/Contractor/Address/Form.js +7 -6
  58. package/dist/components/Contractor/Address/Form.js.map +1 -1
  59. package/dist/components/Contractor/Address/useAddress.js +8 -10
  60. package/dist/components/Contractor/Address/useAddress.js.map +1 -1
  61. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +3 -2
  62. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js.map +1 -1
  63. package/dist/components/Contractor/Profile/ContractorProfileForm.js +15 -15
  64. package/dist/components/Contractor/Profile/useContractorProfile.js +26 -28
  65. package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
  66. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +13 -15
  67. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
  68. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +5 -7
  69. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
  70. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +5 -7
  71. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -1
  72. package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js +3 -2
  73. package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js.map +1 -1
  74. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +6 -8
  75. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  76. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +6 -8
  77. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  78. package/dist/components/Employee/EmployeeList/useEmployeeList.js +6 -8
  79. package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
  80. package/dist/components/Employee/FederalTaxes/FederalTaxes.js +42 -42
  81. package/dist/components/Employee/FederalTaxes/FederalTaxes.js.map +1 -1
  82. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +6 -8
  83. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
  84. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +8 -10
  85. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
  86. package/dist/components/Employee/Profile/HomeAddress.js +9 -8
  87. package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
  88. package/dist/components/Employee/Profile/PersonalDetailsInputs.js +15 -14
  89. package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
  90. package/dist/components/Employee/Profile/Profile.js +30 -29
  91. package/dist/components/Employee/Profile/Profile.js.map +1 -1
  92. package/dist/components/Employee/Profile/useProfile.js +6 -8
  93. package/dist/components/Employee/Profile/useProfile.js.map +1 -1
  94. package/dist/components/Employee/StateTaxes/StateTaxes.js +50 -50
  95. package/dist/components/Employee/StateTaxes/StateTaxes.js.map +1 -1
  96. package/dist/components/Employee/StateTaxes/useStateTaxes.js +6 -8
  97. package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
  98. package/dist/components/Employee/Taxes/Taxes.js +53 -53
  99. package/dist/components/Employee/Taxes/Taxes.js.map +1 -1
  100. package/dist/components/Employee/Taxes/useTaxes.js +6 -8
  101. package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
  102. package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.d.ts +11 -0
  103. package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.js +123 -0
  104. package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.js.map +1 -0
  105. package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.d.ts +11 -0
  106. package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js +92 -0
  107. package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js.map +1 -0
  108. package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlow.d.ts +2 -0
  109. package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlow.js +30 -0
  110. package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlow.js.map +1 -0
  111. package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.d.ts +23 -0
  112. package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.js +72 -0
  113. package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.js.map +1 -0
  114. package/dist/components/Employee/Terminations/TerminationFlow/index.d.ts +3 -0
  115. package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.d.ts +7 -0
  116. package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.js +165 -0
  117. package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.js.map +1 -0
  118. package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.test.d.ts +1 -0
  119. package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummary.d.ts +9 -0
  120. package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummary.js +86 -0
  121. package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummary.js.map +1 -0
  122. package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.d.ts +20 -0
  123. package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.js +103 -0
  124. package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.js.map +1 -0
  125. package/dist/components/Employee/Terminations/TerminationsData.d.ts +6 -0
  126. package/dist/components/Employee/Terminations/index.d.ts +8 -0
  127. package/dist/components/Employee/Terminations/types.d.ts +1 -0
  128. package/dist/components/Employee/index.d.ts +7 -0
  129. package/dist/components/Employee/index.js +34 -28
  130. package/dist/components/Employee/index.js.map +1 -1
  131. package/dist/components/InformationRequests/InformationRequests.js +31 -31
  132. package/dist/components/InformationRequests/InformationRequests.js.map +1 -1
  133. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js +41 -41
  134. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js.map +1 -1
  135. package/dist/components/Payroll/Dismissal/DismissalFlow.d.ts +2 -0
  136. package/dist/components/Payroll/Dismissal/DismissalFlow.js +32 -0
  137. package/dist/components/Payroll/Dismissal/DismissalFlow.js.map +1 -0
  138. package/dist/components/Payroll/Dismissal/DismissalFlowComponents.d.ts +16 -0
  139. package/dist/components/Payroll/Dismissal/DismissalFlowComponents.js +52 -0
  140. package/dist/components/Payroll/Dismissal/DismissalFlowComponents.js.map +1 -0
  141. package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.d.ts +6 -0
  142. package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.js +69 -0
  143. package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.js.map +1 -0
  144. package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.d.ts +9 -0
  145. package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.js +53 -0
  146. package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.js.map +1 -0
  147. package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/index.d.ts +3 -0
  148. package/dist/components/Payroll/Dismissal/dismissalStateMachine.d.ts +6 -0
  149. package/dist/components/Payroll/Dismissal/dismissalStateMachine.js +51 -0
  150. package/dist/components/Payroll/Dismissal/dismissalStateMachine.js.map +1 -0
  151. package/dist/components/Payroll/Dismissal/dismissalStateMachine.test.d.ts +1 -0
  152. package/dist/components/Payroll/Dismissal/index.d.ts +3 -0
  153. package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +3 -3
  154. package/dist/components/Payroll/OffCycle/OffCycleFlow.d.ts +1 -1
  155. package/dist/components/Payroll/OffCycle/OffCycleFlow.js +19 -18
  156. package/dist/components/Payroll/OffCycle/OffCycleFlow.js.map +1 -1
  157. package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.d.ts +3 -0
  158. package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js +32 -24
  159. package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js.map +1 -1
  160. package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js +45 -45
  161. package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js.map +1 -1
  162. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.d.ts +1 -1
  163. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js +75 -66
  164. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js.map +1 -1
  165. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.module.scss.js +8 -0
  166. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.module.scss.js.map +1 -0
  167. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationTypes.d.ts +0 -1
  168. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.module.scss.js +4 -4
  169. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.js +2 -2
  170. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.js.map +1 -1
  171. package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.d.ts +1 -0
  172. package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.js +1 -0
  173. package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.js.map +1 -1
  174. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +186 -159
  175. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
  176. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.d.ts +3 -3
  177. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +71 -70
  178. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
  179. package/dist/components/Payroll/PayrollConfiguration/grossUpHelpers.d.ts +3 -2
  180. package/dist/components/Payroll/PayrollConfiguration/grossUpHelpers.js +8 -8
  181. package/dist/components/Payroll/PayrollConfiguration/grossUpHelpers.js.map +1 -1
  182. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.d.ts +5 -3
  183. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js +76 -70
  184. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js.map +1 -1
  185. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js +47 -42
  186. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js.map +1 -1
  187. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.d.ts +4 -2
  188. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +225 -194
  189. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
  190. package/dist/components/Payroll/PayrollFlow/OffCycleFlowContextual.d.ts +1 -0
  191. package/dist/components/Payroll/PayrollFlow/OffCycleFlowContextual.js +12 -0
  192. package/dist/components/Payroll/PayrollFlow/OffCycleFlowContextual.js.map +1 -0
  193. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.d.ts +3 -0
  194. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js.map +1 -1
  195. package/dist/components/Payroll/PayrollFlow/TransitionFlowContextual.d.ts +1 -0
  196. package/dist/components/Payroll/PayrollFlow/TransitionFlowContextual.js +21 -0
  197. package/dist/components/Payroll/PayrollFlow/TransitionFlowContextual.js.map +1 -0
  198. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.d.ts +2 -0
  199. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js +95 -64
  200. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js.map +1 -1
  201. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js +53 -47
  202. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js.map +1 -1
  203. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +8 -8
  204. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
  205. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js +25 -23
  206. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js.map +1 -1
  207. package/dist/components/Payroll/PayrollList/PayrollList.js +40 -32
  208. package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
  209. package/dist/components/Payroll/PayrollList/PayrollListPresentation.d.ts +2 -1
  210. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +110 -93
  211. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
  212. package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js +12 -8
  213. package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js.map +1 -1
  214. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +3 -2
  215. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
  216. package/dist/components/Payroll/Transition/TransitionFlow.d.ts +2 -0
  217. package/dist/components/Payroll/Transition/TransitionFlow.js +38 -0
  218. package/dist/components/Payroll/Transition/TransitionFlow.js.map +1 -0
  219. package/dist/components/Payroll/Transition/TransitionFlowComponents.d.ts +19 -0
  220. package/dist/components/Payroll/Transition/TransitionFlowComponents.js +54 -0
  221. package/dist/components/Payroll/Transition/TransitionFlowComponents.js.map +1 -0
  222. package/dist/components/Payroll/Transition/index.d.ts +3 -0
  223. package/dist/components/Payroll/Transition/transitionStateMachine.d.ts +6 -0
  224. package/dist/components/Payroll/Transition/transitionStateMachine.js +58 -0
  225. package/dist/components/Payroll/Transition/transitionStateMachine.js.map +1 -0
  226. package/dist/components/Payroll/Transition/transitionStateMachine.test.d.ts +1 -0
  227. package/dist/components/Payroll/TransitionCreation/TransitionCreation.d.ts +2 -0
  228. package/dist/components/Payroll/TransitionCreation/TransitionCreation.js +92 -0
  229. package/dist/components/Payroll/TransitionCreation/TransitionCreation.js.map +1 -0
  230. package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.d.ts +2 -0
  231. package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.js +111 -0
  232. package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.js.map +1 -0
  233. package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.module.scss.js +8 -0
  234. package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.module.scss.js.map +1 -0
  235. package/dist/components/Payroll/TransitionCreation/TransitionCreationTypes.d.ts +28 -0
  236. package/dist/components/Payroll/TransitionCreation/TransitionCreationTypes.js +21 -0
  237. package/dist/components/Payroll/TransitionCreation/TransitionCreationTypes.js.map +1 -0
  238. package/dist/components/Payroll/TransitionCreation/index.d.ts +3 -0
  239. package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.d.ts +8 -0
  240. package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.js +83 -0
  241. package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.js.map +1 -0
  242. package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.d.ts +16 -0
  243. package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.js +100 -0
  244. package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.js.map +1 -0
  245. package/dist/components/Payroll/TransitionPayrollAlert/index.d.ts +2 -0
  246. package/dist/components/Payroll/helpers.d.ts +2 -1
  247. package/dist/components/Payroll/helpers.js +98 -87
  248. package/dist/components/Payroll/helpers.js.map +1 -1
  249. package/dist/components/Payroll/index.d.ts +6 -0
  250. package/dist/components/Payroll/index.js +32 -26
  251. package/dist/components/Payroll/index.js.map +1 -1
  252. package/dist/components/Payroll/payrollTypes.d.ts +21 -0
  253. package/dist/components/Payroll/payrollTypes.js +27 -0
  254. package/dist/components/Payroll/payrollTypes.js.map +1 -0
  255. package/dist/components/Payroll/usePreparedPayrollData.js +5 -7
  256. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  257. package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataContext.d.ts +8 -0
  258. package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataContext.js +13 -0
  259. package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataContext.js.map +1 -0
  260. package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataProvider.d.ts +10 -0
  261. package/dist/components/UNSTABLE_Hooks/form/SDKFormProvider.d.ts +18 -0
  262. package/dist/components/UNSTABLE_Hooks/form/deriveFieldsMetadata.d.ts +3 -0
  263. package/dist/components/UNSTABLE_Hooks/form/deriveFieldsMetadata.test.d.ts +1 -0
  264. package/dist/components/UNSTABLE_Hooks/form/index.d.ts +9 -0
  265. package/dist/components/UNSTABLE_Hooks/form/types.d.ts +15 -0
  266. package/dist/components/UNSTABLE_Hooks/form/useFieldErrorMessage.d.ts +1 -0
  267. package/dist/components/UNSTABLE_Hooks/form/useFieldErrorMessage.js +15 -0
  268. package/dist/components/UNSTABLE_Hooks/form/useFieldErrorMessage.js.map +1 -0
  269. package/dist/components/UNSTABLE_Hooks/form/useFieldsMetadata.d.ts +4 -0
  270. package/dist/components/UNSTABLE_Hooks/form/useFieldsMetadata.js +9 -0
  271. package/dist/components/UNSTABLE_Hooks/form/useFieldsMetadata.js.map +1 -0
  272. package/dist/components/UNSTABLE_Hooks/form/withOptions.d.ts +5 -0
  273. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/index.d.ts +3 -0
  274. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.d.ts +16 -0
  275. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.js +7 -0
  276. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.js.map +1 -0
  277. package/dist/components/UNSTABLE_Hooks/index.d.ts +5 -0
  278. package/dist/components/UNSTABLE_Hooks/types.d.ts +46 -0
  279. package/dist/contexts/ApiProvider/ApiProvider.js +11 -11
  280. package/dist/contexts/ApiProvider/ApiProvider.js.map +1 -1
  281. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +43 -47
  282. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  283. package/dist/contexts/ObservabilityProvider/index.d.ts +1 -1
  284. package/dist/contexts/ObservabilityProvider/sanitization.d.ts +0 -14
  285. package/dist/contexts/ObservabilityProvider/sanitization.js +51 -51
  286. package/dist/contexts/ObservabilityProvider/sanitization.js.map +1 -1
  287. package/dist/contexts/ObservabilityProvider/useSanitizedObservability.d.ts +0 -3
  288. package/dist/contexts/ObservabilityProvider/useSanitizedObservability.js.map +1 -1
  289. package/dist/i18n/I18n.js +11 -11
  290. package/dist/i18n/I18n.js.map +1 -1
  291. package/dist/i18n/en/Employee.Terminations.TerminateEmployee.json.js +18 -0
  292. package/dist/i18n/en/Employee.Terminations.TerminateEmployee.json.js.map +1 -0
  293. package/dist/i18n/en/Employee.Terminations.TerminationFlow.json.js +12 -0
  294. package/dist/i18n/en/Employee.Terminations.TerminationFlow.json.js.map +1 -0
  295. package/dist/i18n/en/Employee.Terminations.TerminationSummary.json.js +20 -0
  296. package/dist/i18n/en/Employee.Terminations.TerminationSummary.json.js.map +1 -0
  297. package/dist/i18n/en/Payroll.Dismissal.json.js +22 -0
  298. package/dist/i18n/en/Payroll.Dismissal.json.js.map +1 -0
  299. package/dist/i18n/en/Payroll.OffCycleCreation.json.js +15 -11
  300. package/dist/i18n/en/Payroll.OffCycleCreation.json.js.map +1 -1
  301. package/dist/i18n/en/Payroll.OffCyclePayPeriodDateForm.json.js +1 -1
  302. package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js +20 -18
  303. package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js.map +1 -1
  304. package/dist/i18n/en/Payroll.PayrollList.json.js +20 -18
  305. package/dist/i18n/en/Payroll.PayrollList.json.js.map +1 -1
  306. package/dist/i18n/en/Payroll.Transition.json.js +8 -0
  307. package/dist/i18n/en/Payroll.Transition.json.js.map +1 -0
  308. package/dist/i18n/en/Payroll.TransitionCreation.json.js +26 -0
  309. package/dist/i18n/en/Payroll.TransitionCreation.json.js.map +1 -0
  310. package/dist/i18n/en/Payroll.TransitionPayrollAlert.json.js +18 -0
  311. package/dist/i18n/en/Payroll.TransitionPayrollAlert.json.js.map +1 -0
  312. package/dist/i18n/en/common.json.d.ts +2 -1
  313. package/dist/i18n/en/common.json.js +9 -9
  314. package/dist/index.d.ts +3 -2
  315. package/dist/index.js +14 -13
  316. package/dist/shared/constants.d.ts +32 -0
  317. package/dist/shared/constants.js +83 -65
  318. package/dist/shared/constants.js.map +1 -1
  319. package/dist/style.css +1 -1
  320. package/dist/types/i18next.d.ts +163 -1
  321. package/dist/types/observability.d.ts +31 -65
  322. package/dist/types/sdkError.d.ts +91 -0
  323. package/dist/types/sdkError.js +95 -0
  324. package/dist/types/sdkError.js.map +1 -0
  325. package/dist/types/sdkError.test.d.ts +1 -0
  326. package/docs/reference/endpoint-inventory.json +120 -14
  327. package/package.json +13 -13
  328. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfiguration.d.ts +0 -6
  329. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfiguration.js +0 -70
  330. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfiguration.js.map +0 -1
  331. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationContext.d.ts +0 -7
  332. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationContext.js +0 -6
  333. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationContext.js.map +0 -1
  334. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationProvider.d.ts +0 -9
  335. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationProvider.js +0 -40
  336. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationProvider.js.map +0 -1
  337. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/index.d.ts +0 -5
  338. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/usePayrollConfiguration.d.ts +0 -2
  339. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/usePayrollConfiguration.js +0 -12
  340. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/usePayrollConfiguration.js.map +0 -1
  341. package/dist/components/Payroll/UNSTABLE_PayrollHooks/index.d.ts +0 -2
  342. package/dist/contexts/ObservabilityProvider/observabilityUtils.d.ts +0 -5
  343. package/dist/contexts/ObservabilityProvider/observabilityUtils.js +0 -45
  344. package/dist/contexts/ObservabilityProvider/observabilityUtils.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DismissalPayPeriodSelection.js","sources":["../../../../../src/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.tsx"],"sourcesContent":["import { useMemo, useState } from 'react'\nimport { usePaySchedulesGetUnprocessedTerminationPeriodsSuspense } from '@gusto/embedded-api/react-query/paySchedulesGetUnprocessedTerminationPeriods'\nimport { usePayrollsCreateOffCycleMutation } from '@gusto/embedded-api/react-query/payrollsCreateOffCycle'\nimport type { UnprocessedTerminationPayPeriod } from '@gusto/embedded-api/models/components/unprocessedterminationpayperiod'\nimport { OffCycleReason } from '@gusto/embedded-api/models/operations/postv1companiescompanyidpayrolls'\nimport { RFCDate } from '@gusto/embedded-api/types/rfcdate'\nimport { useTranslation } from 'react-i18next'\nimport { DismissalPayPeriodSelectionPresentation } from './DismissalPayPeriodSelectionPresentation'\nimport { BaseComponent } from '@/components/Base/Base'\nimport type { BaseComponentInterface } from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { componentEvents } from '@/shared/constants'\nimport { SDKInternalError } from '@/types/sdkError'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { addBusinessDays, formatPayPeriodRange } from '@/helpers/dateFormatting'\nimport { ACH_LEAD_TIME_BUSINESS_DAYS } from '@/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation'\nimport type { SelectOption } from '@/components/Common/UI/Select/SelectTypes'\n\nexport interface DismissalPayPeriodSelectionProps extends BaseComponentInterface<'Payroll.Dismissal'> {\n companyId: string\n employeeId: string\n}\n\nexport function DismissalPayPeriodSelection(props: DismissalPayPeriodSelectionProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\ntype RequiredPayPeriod = UnprocessedTerminationPayPeriod &\n Required<Pick<UnprocessedTerminationPayPeriod, 'startDate' | 'endDate' | 'employeeUuid'>>\n\nconst payPeriodKey = (period: RequiredPayPeriod) => `${period.startDate}__${period.endDate}`\n\nfunction Root({ companyId, employeeId, dictionary }: DismissalPayPeriodSelectionProps) {\n useComponentDictionary('Payroll.Dismissal', dictionary)\n useI18n('Payroll.Dismissal')\n const { t } = useTranslation('Payroll.Dismissal')\n const { onEvent, baseSubmitHandler } = useBase()\n\n const { data } = usePaySchedulesGetUnprocessedTerminationPeriodsSuspense({ companyId })\n const { mutateAsync: createOffCyclePayroll, isPending } = usePayrollsCreateOffCycleMutation()\n\n const employeePayPeriods: RequiredPayPeriod[] = useMemo(() => {\n const allPeriods = data.unprocessedTerminationPayPeriodList ?? []\n return allPeriods\n .filter(period => period.employeeUuid === employeeId)\n .filter(\n (period): period is RequiredPayPeriod =>\n Boolean(period.startDate) && Boolean(period.endDate) && Boolean(period.employeeUuid),\n )\n }, [data, employeeId])\n\n const payPeriodOptions: SelectOption[] = useMemo(() => {\n return employeePayPeriods.map(period => {\n const dateRange = formatPayPeriodRange(period.startDate, period.endDate)\n const label = period.employeeName ? `${dateRange} (${period.employeeName})` : dateRange\n return {\n value: payPeriodKey(period),\n label,\n }\n })\n }, [employeePayPeriods])\n\n const initialSelection = payPeriodOptions.length === 1 ? payPeriodOptions[0]!.value : undefined\n const [selectedPeriodKey, setSelectedPeriodKey] = useState<string | undefined>(initialSelection)\n\n const handleSubmit = async () => {\n await baseSubmitHandler({ selectedPeriodKey }, async () => {\n if (selectedPeriodKey === undefined) {\n throw new SDKInternalError(t('errors.noPayPeriodSelected'))\n }\n\n const period = employeePayPeriods.find(p => payPeriodKey(p) === selectedPeriodKey)\n if (!period) {\n throw new SDKInternalError(t('errors.invalidPayPeriod'))\n }\n\n const checkDate = period.checkDate\n ? new RFCDate(period.checkDate)\n : new RFCDate(addBusinessDays(new Date(), ACH_LEAD_TIME_BUSINESS_DAYS))\n\n const response = await createOffCyclePayroll({\n request: {\n companyId,\n requestBody: {\n offCycle: true,\n offCycleReason: OffCycleReason.DismissedEmployee,\n startDate: new RFCDate(period.startDate),\n endDate: new RFCDate(period.endDate),\n employeeUuids: [employeeId],\n checkDate,\n },\n },\n })\n\n const payrollUuid =\n response.payrollUnprocessed?.payrollUuid ?? response.payrollUnprocessed?.uuid\n\n if (!payrollUuid) {\n throw new SDKInternalError(t('errors.missingPayrollId'))\n }\n\n onEvent(componentEvents.DISMISSAL_PAY_PERIOD_SELECTED, { payrollUuid })\n })\n }\n\n return (\n <DismissalPayPeriodSelectionPresentation\n payPeriodOptions={payPeriodOptions}\n selectedPeriodKey={selectedPeriodKey}\n onSelectPeriod={setSelectedPeriodKey}\n onSubmit={handleSubmit}\n isPending={isPending}\n />\n )\n}\n"],"names":["DismissalPayPeriodSelection","props","jsx","BaseComponent","Root","payPeriodKey","period","companyId","employeeId","dictionary","useComponentDictionary","useI18n","t","useTranslation","onEvent","baseSubmitHandler","useBase","data","usePaySchedulesGetUnprocessedTerminationPeriodsSuspense","createOffCyclePayroll","isPending","usePayrollsCreateOffCycleMutation","employeePayPeriods","useMemo","payPeriodOptions","dateRange","formatPayPeriodRange","label","initialSelection","selectedPeriodKey","setSelectedPeriodKey","useState","DismissalPayPeriodSelectionPresentation","SDKInternalError","p","checkDate","RFCDate","addBusinessDays","ACH_LEAD_TIME_BUSINESS_DAYS","response","OffCycleReason","payrollUuid","componentEvents"],"mappings":";;;;;;;;;;;;;;;AAuBO,SAASA,GAA4BC,GAAyC;AACnF,SACE,gBAAAC,EAACC,KAAe,GAAGF,GACjB,4BAACG,GAAA,EAAM,GAAGH,GAAO,EAAA,CACnB;AAEJ;AAKA,MAAMI,IAAe,CAACC,MAA8B,GAAGA,EAAO,SAAS,KAAKA,EAAO,OAAO;AAE1F,SAASF,EAAK,EAAE,WAAAG,GAAW,YAAAC,GAAY,YAAAC,KAAgD;AACrF,EAAAC,EAAuB,qBAAqBD,CAAU,GACtDE,EAAQ,mBAAmB;AAC3B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,mBAAmB,GAC1C,EAAE,SAAAC,GAAS,mBAAAC,EAAA,IAAsBC,EAAA,GAEjC,EAAE,MAAAC,EAAA,IAASC,EAAwD,EAAE,WAAAX,GAAW,GAChF,EAAE,aAAaY,GAAuB,WAAAC,EAAA,IAAcC,EAAA,GAEpDC,IAA0CC,EAAQ,OACnCN,EAAK,uCAAuC,CAAA,GAE5D,OAAO,CAAAX,MAAUA,EAAO,iBAAiBE,CAAU,EACnD;AAAA,IACC,CAACF,MACC,EAAQA,EAAO,aAAc,EAAQA,EAAO,WAAY,EAAQA,EAAO;AAAA,EAAY,GAExF,CAACW,GAAMT,CAAU,CAAC,GAEfgB,IAAmCD,EAAQ,MACxCD,EAAmB,IAAI,CAAAhB,MAAU;AACtC,UAAMmB,IAAYC,EAAqBpB,EAAO,WAAWA,EAAO,OAAO,GACjEqB,IAAQrB,EAAO,eAAe,GAAGmB,CAAS,KAAKnB,EAAO,YAAY,MAAMmB;AAC9E,WAAO;AAAA,MACL,OAAOpB,EAAaC,CAAM;AAAA,MAC1B,OAAAqB;AAAA,IAAA;AAAA,EAEJ,CAAC,GACA,CAACL,CAAkB,CAAC,GAEjBM,IAAmBJ,EAAiB,WAAW,IAAIA,EAAiB,CAAC,EAAG,QAAQ,QAChF,CAACK,GAAmBC,CAAoB,IAAIC,EAA6BH,CAAgB;AA0C/F,SACE,gBAAA1B;AAAA,IAAC8B;AAAA,IAAA;AAAA,MACC,kBAAAR;AAAA,MACA,mBAAAK;AAAA,MACA,gBAAgBC;AAAA,MAChB,UA7CiB,YAAY;AAC/B,cAAMf,EAAkB,EAAE,mBAAAc,EAAA,GAAqB,YAAY;AACzD,cAAIA,MAAsB;AACxB,kBAAM,IAAII,EAAiBrB,EAAE,4BAA4B,CAAC;AAG5D,gBAAMN,IAASgB,EAAmB,KAAK,OAAKjB,EAAa6B,CAAC,MAAML,CAAiB;AACjF,cAAI,CAACvB;AACH,kBAAM,IAAI2B,EAAiBrB,EAAE,yBAAyB,CAAC;AAGzD,gBAAMuB,IAAY7B,EAAO,YACrB,IAAI8B,EAAQ9B,EAAO,SAAS,IAC5B,IAAI8B,EAAQC,EAAgB,oBAAI,KAAA,GAAQC,CAA2B,CAAC,GAElEC,IAAW,MAAMpB,EAAsB;AAAA,YAC3C,SAAS;AAAA,cACP,WAAAZ;AAAA,cACA,aAAa;AAAA,gBACX,UAAU;AAAA,gBACV,gBAAgBiC,EAAe;AAAA,gBAC/B,WAAW,IAAIJ,EAAQ9B,EAAO,SAAS;AAAA,gBACvC,SAAS,IAAI8B,EAAQ9B,EAAO,OAAO;AAAA,gBACnC,eAAe,CAACE,CAAU;AAAA,gBAC1B,WAAA2B;AAAA,cAAA;AAAA,YACF;AAAA,UACF,CACD,GAEKM,IACJF,EAAS,oBAAoB,eAAeA,EAAS,oBAAoB;AAE3E,cAAI,CAACE;AACH,kBAAM,IAAIR,EAAiBrB,EAAE,yBAAyB,CAAC;AAGzD,UAAAE,EAAQ4B,EAAgB,+BAA+B,EAAE,aAAAD,EAAA,CAAa;AAAA,QACxE,CAAC;AAAA,MACH;AAAA,MAQI,WAAArB;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -0,0 +1,9 @@
1
+ import { SelectOption } from '../../../Common/UI/Select/SelectTypes';
2
+ export interface DismissalPayPeriodSelectionPresentationProps {
3
+ payPeriodOptions: SelectOption[];
4
+ selectedPeriodKey: string | undefined;
5
+ onSelectPeriod: (value: string) => void;
6
+ onSubmit: () => void;
7
+ isPending: boolean;
8
+ }
9
+ export declare function DismissalPayPeriodSelectionPresentation({ payPeriodOptions, selectedPeriodKey, onSelectPeriod, onSubmit, isPending, }: DismissalPayPeriodSelectionPresentationProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,53 @@
1
+ import { jsxs as t, jsx as e } from "react/jsx-runtime";
2
+ import { useTranslation as d } from "react-i18next";
3
+ import { Flex as o } from "../../../Common/Flex/Flex.js";
4
+ import "classnames";
5
+ import "../../../../shared/constants.js";
6
+ import { ActionsLayout as f } from "../../../Common/ActionsLayout/ActionsLayout.js";
7
+ import { useComponentContext as g } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
8
+ import "react";
9
+ import { useI18n as x } from "../../../../i18n/I18n.js";
10
+ function A({
11
+ payPeriodOptions: r,
12
+ selectedPeriodKey: n,
13
+ onSelectPeriod: s,
14
+ onSubmit: c,
15
+ isPending: l
16
+ }) {
17
+ x("Payroll.Dismissal");
18
+ const { t: i } = d("Payroll.Dismissal"), { Heading: a, Text: m, Select: p, Button: u, Alert: h } = g();
19
+ return r.length === 0 ? /* @__PURE__ */ t(o, { flexDirection: "column", gap: 24, children: [
20
+ /* @__PURE__ */ e(o, { flexDirection: "column", gap: 4, children: /* @__PURE__ */ e(a, { as: "h2", children: i("pageTitle") }) }),
21
+ /* @__PURE__ */ e(h, { status: "info", label: i("emptyState") })
22
+ ] }) : /* @__PURE__ */ t(o, { flexDirection: "column", gap: 24, children: [
23
+ /* @__PURE__ */ t(o, { flexDirection: "column", gap: 4, children: [
24
+ /* @__PURE__ */ e(a, { as: "h2", children: i("pageTitle") }),
25
+ /* @__PURE__ */ e(m, { variant: "supporting", children: i("pageDescription") })
26
+ ] }),
27
+ /* @__PURE__ */ e(
28
+ p,
29
+ {
30
+ label: i("selectLabel"),
31
+ options: r,
32
+ value: n,
33
+ onChange: s,
34
+ placeholder: i("selectPlaceholder"),
35
+ isRequired: !0
36
+ }
37
+ ),
38
+ /* @__PURE__ */ e(f, { children: /* @__PURE__ */ e(
39
+ u,
40
+ {
41
+ variant: "primary",
42
+ onClick: c,
43
+ isLoading: l,
44
+ isDisabled: l || n === void 0,
45
+ children: i("continueCta")
46
+ }
47
+ ) })
48
+ ] });
49
+ }
50
+ export {
51
+ A as DismissalPayPeriodSelectionPresentation
52
+ };
53
+ //# sourceMappingURL=DismissalPayPeriodSelectionPresentation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DismissalPayPeriodSelectionPresentation.js","sources":["../../../../../src/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { Flex, ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\nimport type { SelectOption } from '@/components/Common/UI/Select/SelectTypes'\n\nexport interface DismissalPayPeriodSelectionPresentationProps {\n payPeriodOptions: SelectOption[]\n selectedPeriodKey: string | undefined\n onSelectPeriod: (value: string) => void\n onSubmit: () => void\n isPending: boolean\n}\n\nexport function DismissalPayPeriodSelectionPresentation({\n payPeriodOptions,\n selectedPeriodKey,\n onSelectPeriod,\n onSubmit,\n isPending,\n}: DismissalPayPeriodSelectionPresentationProps) {\n useI18n('Payroll.Dismissal')\n const { t } = useTranslation('Payroll.Dismissal')\n const { Heading, Text, Select, Button, Alert } = useComponentContext()\n\n const hasNoPayPeriods = payPeriodOptions.length === 0\n\n if (hasNoPayPeriods) {\n return (\n <Flex flexDirection=\"column\" gap={24}>\n <Flex flexDirection=\"column\" gap={4}>\n <Heading as=\"h2\">{t('pageTitle')}</Heading>\n </Flex>\n <Alert status=\"info\" label={t('emptyState')} />\n </Flex>\n )\n }\n\n return (\n <Flex flexDirection=\"column\" gap={24}>\n <Flex flexDirection=\"column\" gap={4}>\n <Heading as=\"h2\">{t('pageTitle')}</Heading>\n <Text variant=\"supporting\">{t('pageDescription')}</Text>\n </Flex>\n\n <Select\n label={t('selectLabel')}\n options={payPeriodOptions}\n value={selectedPeriodKey}\n onChange={onSelectPeriod}\n placeholder={t('selectPlaceholder')}\n isRequired\n />\n\n <ActionsLayout>\n <Button\n variant=\"primary\"\n onClick={onSubmit}\n isLoading={isPending}\n isDisabled={isPending || selectedPeriodKey === undefined}\n >\n {t('continueCta')}\n </Button>\n </ActionsLayout>\n </Flex>\n )\n}\n"],"names":["DismissalPayPeriodSelectionPresentation","payPeriodOptions","selectedPeriodKey","onSelectPeriod","onSubmit","isPending","useI18n","t","useTranslation","Heading","Text","Select","Button","Alert","useComponentContext","jsxs","Flex","jsx","ActionsLayout"],"mappings":";;;;;;;;;AAcO,SAASA,EAAwC;AAAA,EACtD,kBAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AACF,GAAiD;AAC/C,EAAAC,EAAQ,mBAAmB;AAC3B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,mBAAmB,GAC1C,EAAE,SAAAC,GAAS,MAAAC,GAAM,QAAAC,GAAQ,QAAAC,GAAQ,OAAAC,EAAA,IAAUC,EAAA;AAIjD,SAFwBb,EAAiB,WAAW,IAIhD,gBAAAc,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,IAAA,gBAAAC,EAACD,GAAA,EAAK,eAAc,UAAS,KAAK,GAChC,UAAA,gBAAAC,EAACR,GAAA,EAAQ,IAAG,MAAM,UAAAF,EAAE,WAAW,EAAA,CAAE,GACnC;AAAA,sBACCM,GAAA,EAAM,QAAO,QAAO,OAAON,EAAE,YAAY,EAAA,CAAG;AAAA,EAAA,GAC/C,IAKF,gBAAAQ,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,IAAA,gBAAAD,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,GAChC,UAAA;AAAA,MAAA,gBAAAC,EAACR,GAAA,EAAQ,IAAG,MAAM,UAAAF,EAAE,WAAW,GAAE;AAAA,wBAChCG,GAAA,EAAK,SAAQ,cAAc,UAAAH,EAAE,iBAAiB,EAAA,CAAE;AAAA,IAAA,GACnD;AAAA,IAEA,gBAAAU;AAAA,MAACN;AAAA,MAAA;AAAA,QACC,OAAOJ,EAAE,aAAa;AAAA,QACtB,SAASN;AAAA,QACT,OAAOC;AAAA,QACP,UAAUC;AAAA,QACV,aAAaI,EAAE,mBAAmB;AAAA,QAClC,YAAU;AAAA,MAAA;AAAA,IAAA;AAAA,sBAGXW,GAAA,EACC,UAAA,gBAAAD;AAAA,MAACL;AAAA,MAAA;AAAA,QACC,SAAQ;AAAA,QACR,SAASR;AAAA,QACT,WAAWC;AAAA,QACX,YAAYA,KAAaH,MAAsB;AAAA,QAE9C,YAAE,aAAa;AAAA,MAAA;AAAA,IAAA,EAClB,CACF;AAAA,EAAA,GACF;AAEJ;"}
@@ -0,0 +1,3 @@
1
+ import "./types/i18next.d.ts"
2
+ export { DismissalPayPeriodSelection } from './DismissalPayPeriodSelection';
3
+ export type { DismissalPayPeriodSelectionProps } from './DismissalPayPeriodSelection';
@@ -0,0 +1,6 @@
1
+ import { BreadcrumbNodes } from '../../Common/FlowBreadcrumbs/FlowBreadcrumbsTypes';
2
+ export declare const dismissalBreadcrumbsNodes: BreadcrumbNodes;
3
+ export declare const dismissalMachine: {
4
+ payPeriodSelection: import('robot3').MachineState<any>;
5
+ execution: import('robot3').MachineState<any>;
6
+ };
@@ -0,0 +1,51 @@
1
+ import { state as i, transition as r, reduce as a, guard as l } from "robot3";
2
+ import { DismissalExecutionContextual as c, DismissalPayPeriodSelectionContextual as s } from "./DismissalFlowComponents.js";
3
+ import { componentEvents as t } from "../../../shared/constants.js";
4
+ function n(e) {
5
+ return {
6
+ ...e,
7
+ component: s,
8
+ payrollUuid: void 0,
9
+ currentBreadcrumbId: "payPeriodSelection",
10
+ progressBarType: "breadcrumbs"
11
+ };
12
+ }
13
+ const y = {
14
+ payPeriodSelection: {
15
+ parent: null,
16
+ item: {
17
+ id: "payPeriodSelection",
18
+ label: "breadcrumbLabel",
19
+ namespace: "Payroll.Dismissal",
20
+ onNavigate: n
21
+ }
22
+ }
23
+ }, d = r(
24
+ t.BREADCRUMB_NAVIGATE,
25
+ "payPeriodSelection",
26
+ l(
27
+ (e, o) => o.payload.key === "payPeriodSelection"
28
+ ),
29
+ a(n)
30
+ ), P = {
31
+ payPeriodSelection: i(
32
+ r(
33
+ t.DISMISSAL_PAY_PERIOD_SELECTED,
34
+ "execution",
35
+ a(
36
+ (e, o) => ({
37
+ ...e,
38
+ payrollUuid: o.payload?.payrollUuid,
39
+ component: c,
40
+ progressBarType: null
41
+ })
42
+ )
43
+ )
44
+ ),
45
+ execution: i(d)
46
+ };
47
+ export {
48
+ y as dismissalBreadcrumbsNodes,
49
+ P as dismissalMachine
50
+ };
51
+ //# sourceMappingURL=dismissalStateMachine.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dismissalStateMachine.js","sources":["../../../../src/components/Payroll/Dismissal/dismissalStateMachine.ts"],"sourcesContent":["import { state, transition, reduce, guard } from 'robot3'\nimport {\n DismissalPayPeriodSelectionContextual,\n DismissalExecutionContextual,\n type DismissalFlowContextInterface,\n} from './DismissalFlowComponents'\nimport { componentEvents } from '@/shared/constants'\nimport type { MachineTransition } from '@/types/Helpers'\nimport type { BreadcrumbNodes } from '@/components/Common/FlowBreadcrumbs/FlowBreadcrumbsTypes'\n\nfunction toPayPeriodSelectionReducer(\n ctx: DismissalFlowContextInterface,\n): DismissalFlowContextInterface {\n return {\n ...ctx,\n component: DismissalPayPeriodSelectionContextual,\n payrollUuid: undefined,\n currentBreadcrumbId: 'payPeriodSelection',\n progressBarType: 'breadcrumbs',\n }\n}\n\nexport const dismissalBreadcrumbsNodes: BreadcrumbNodes = {\n payPeriodSelection: {\n parent: null,\n item: {\n id: 'payPeriodSelection',\n label: 'breadcrumbLabel',\n namespace: 'Payroll.Dismissal',\n onNavigate: toPayPeriodSelectionReducer as (context: unknown) => unknown,\n },\n },\n}\n\nconst payPeriodSelectionBreadcrumbTransition = transition(\n componentEvents.BREADCRUMB_NAVIGATE,\n 'payPeriodSelection',\n guard(\n (_ctx: DismissalFlowContextInterface, ev: { payload: { key: string } }) =>\n ev.payload.key === 'payPeriodSelection',\n ),\n reduce(toPayPeriodSelectionReducer),\n)\n\nexport const dismissalMachine = {\n payPeriodSelection: state<MachineTransition>(\n transition(\n componentEvents.DISMISSAL_PAY_PERIOD_SELECTED,\n 'execution',\n reduce(\n (\n ctx: DismissalFlowContextInterface,\n ev: { payload?: { payrollUuid?: string } },\n ): DismissalFlowContextInterface => ({\n ...ctx,\n payrollUuid: ev.payload?.payrollUuid,\n component: DismissalExecutionContextual,\n progressBarType: null,\n }),\n ),\n ),\n ),\n\n execution: state<MachineTransition>(payPeriodSelectionBreadcrumbTransition),\n}\n"],"names":["toPayPeriodSelectionReducer","ctx","DismissalPayPeriodSelectionContextual","dismissalBreadcrumbsNodes","payPeriodSelectionBreadcrumbTransition","transition","componentEvents","guard","_ctx","ev","reduce","dismissalMachine","state","DismissalExecutionContextual"],"mappings":";;;AAUA,SAASA,EACPC,GAC+B;AAC/B,SAAO;AAAA,IACL,GAAGA;AAAA,IACH,WAAWC;AAAA,IACX,aAAa;AAAA,IACb,qBAAqB;AAAA,IACrB,iBAAiB;AAAA,EAAA;AAErB;AAEO,MAAMC,IAA6C;AAAA,EACxD,oBAAoB;AAAA,IAClB,QAAQ;AAAA,IACR,MAAM;AAAA,MACJ,IAAI;AAAA,MACJ,OAAO;AAAA,MACP,WAAW;AAAA,MACX,YAAYH;AAAA,IAAA;AAAA,EACd;AAEJ,GAEMI,IAAyCC;AAAA,EAC7CC,EAAgB;AAAA,EAChB;AAAA,EACAC;AAAA,IACE,CAACC,GAAqCC,MACpCA,EAAG,QAAQ,QAAQ;AAAA,EAAA;AAAA,EAEvBC,EAAOV,CAA2B;AACpC,GAEaW,IAAmB;AAAA,EAC9B,oBAAoBC;AAAA,IAClBP;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAI;AAAA,QACE,CACET,GACAQ,OACmC;AAAA,UACnC,GAAGR;AAAA,UACH,aAAaQ,EAAG,SAAS;AAAA,UACzB,WAAWI;AAAA,UACX,iBAAiB;AAAA,QAAA;AAAA,MACnB;AAAA,IACF;AAAA,EACF;AAAA,EAGF,WAAWD,EAAyBR,CAAsC;AAC5E;"}
@@ -0,0 +1,3 @@
1
+ import "./types/i18next.d.ts"
2
+ export { DismissalFlow } from './DismissalFlow';
3
+ export type { DismissalFlowProps, DismissalFlowContextInterface } from './DismissalFlowComponents';
@@ -11,11 +11,11 @@ import { ActionsLayout as H } from "../../Common/ActionsLayout/ActionsLayout.js"
11
11
  import { NumberInputField as V } from "../../Common/Fields/NumberInputField/NumberInputField.js";
12
12
  import { useComponentContext as z } from "../../../contexts/ComponentAdapter/useComponentContext.js";
13
13
  import "react-error-boundary";
14
- import "@gusto/embedded-api/models/errors/gustoembeddederror";
15
- import "@gusto/embedded-api/models/errors/sdkvalidationerror";
16
14
  import "@tanstack/react-query";
17
15
  import { useBase as B } from "../../Base/useBase.js";
18
- import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
16
+ import "@gusto/embedded-api/models/errors/gustoembeddederror";
17
+ import "@gusto/embedded-api/models/errors/httpclienterrors";
18
+ import "@gusto/embedded-api/models/errors/sdkvalidationerror";
19
19
  import { formatNumberAsCurrency as E } from "../../../helpers/formattedStrings.js";
20
20
  import { useI18n as T } from "../../../i18n/I18n.js";
21
21
  const q = v.object({
@@ -1,2 +1,2 @@
1
1
  import { OffCycleFlowProps } from './OffCycleFlowComponents';
2
- export declare function OffCycleFlow({ companyId, onEvent }: OffCycleFlowProps): import("react/jsx-runtime").JSX.Element;
2
+ export declare function OffCycleFlow({ companyId, payrollType, onEvent }: OffCycleFlowProps): import("react/jsx-runtime").JSX.Element;
@@ -1,29 +1,30 @@
1
- import { jsx as f } from "react/jsx-runtime";
2
- import { useMemo as m } from "react";
3
- import { createMachine as t } from "robot3";
4
- import { offCycleMachine as a, offCycleBreadcrumbsNodes as l } from "./offCycleStateMachine.js";
5
- import { OffCycleCreationContextual as i } from "./OffCycleFlowComponents.js";
6
- import { Flow as n } from "../../Flow/Flow.js";
7
- import { buildBreadcrumbs as u } from "../../../helpers/breadcrumbHelpers.js";
8
- function B({ companyId: r, onEvent: e }) {
9
- const o = m(
10
- () => t(
1
+ import { jsx as m } from "react/jsx-runtime";
2
+ import { useMemo as t } from "react";
3
+ import { createMachine as a } from "robot3";
4
+ import { offCycleMachine as i, offCycleBreadcrumbsNodes as l } from "./offCycleStateMachine.js";
5
+ import { OffCycleCreationContextual as n } from "./OffCycleFlowComponents.js";
6
+ import { Flow as u } from "../../Flow/Flow.js";
7
+ import { buildBreadcrumbs as s } from "../../../helpers/breadcrumbHelpers.js";
8
+ function M({ companyId: r, payrollType: e, onEvent: o }) {
9
+ const c = t(
10
+ () => a(
11
11
  "createOffCyclePayroll",
12
- a,
13
- (c) => ({
14
- ...c,
15
- component: i,
12
+ i,
13
+ (f) => ({
14
+ ...f,
15
+ component: n,
16
16
  companyId: r,
17
- breadcrumbs: u(l),
17
+ payrollType: e,
18
+ breadcrumbs: s(l),
18
19
  currentBreadcrumbId: "createOffCyclePayroll",
19
20
  progressBarType: "breadcrumbs"
20
21
  })
21
22
  ),
22
- [r]
23
+ [r, e]
23
24
  );
24
- return /* @__PURE__ */ f(n, { machine: o, onEvent: e });
25
+ return /* @__PURE__ */ m(u, { machine: c, onEvent: o });
25
26
  }
26
27
  export {
27
- B as OffCycleFlow
28
+ M as OffCycleFlow
28
29
  };
29
30
  //# sourceMappingURL=OffCycleFlow.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"OffCycleFlow.js","sources":["../../../../src/components/Payroll/OffCycle/OffCycleFlow.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { createMachine } from 'robot3'\nimport { offCycleMachine, offCycleBreadcrumbsNodes } from './offCycleStateMachine'\nimport {\n OffCycleCreationContextual,\n type OffCycleFlowContextInterface,\n type OffCycleFlowProps,\n} from './OffCycleFlowComponents'\nimport { Flow } from '@/components/Flow/Flow'\nimport { buildBreadcrumbs } from '@/helpers/breadcrumbHelpers'\n\nexport function OffCycleFlow({ companyId, onEvent }: OffCycleFlowProps) {\n const offCycleFlowMachine = useMemo(\n () =>\n createMachine(\n 'createOffCyclePayroll',\n offCycleMachine,\n (initialContext: OffCycleFlowContextInterface) => ({\n ...initialContext,\n component: OffCycleCreationContextual,\n companyId,\n breadcrumbs: buildBreadcrumbs(offCycleBreadcrumbsNodes),\n currentBreadcrumbId: 'createOffCyclePayroll',\n progressBarType: 'breadcrumbs' as const,\n }),\n ),\n [companyId],\n )\n\n return <Flow machine={offCycleFlowMachine} onEvent={onEvent} />\n}\n"],"names":["OffCycleFlow","companyId","onEvent","offCycleFlowMachine","useMemo","createMachine","offCycleMachine","initialContext","OffCycleCreationContextual","buildBreadcrumbs","offCycleBreadcrumbsNodes","jsx","Flow"],"mappings":";;;;;;;AAWO,SAASA,EAAa,EAAE,WAAAC,GAAW,SAAAC,KAA8B;AACtE,QAAMC,IAAsBC;AAAA,IAC1B,MACEC;AAAA,MACE;AAAA,MACAC;AAAA,MACA,CAACC,OAAkD;AAAA,QACjD,GAAGA;AAAA,QACH,WAAWC;AAAA,QACX,WAAAP;AAAA,QACA,aAAaQ,EAAiBC,CAAwB;AAAA,QACtD,qBAAqB;AAAA,QACrB,iBAAiB;AAAA,MAAA;AAAA,IACnB;AAAA,IAEJ,CAACT,CAAS;AAAA,EAAA;AAGZ,SAAO,gBAAAU,EAACC,GAAA,EAAK,SAAST,GAAqB,SAAAD,EAAA,CAAkB;AAC/D;"}
1
+ {"version":3,"file":"OffCycleFlow.js","sources":["../../../../src/components/Payroll/OffCycle/OffCycleFlow.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { createMachine } from 'robot3'\nimport { offCycleMachine, offCycleBreadcrumbsNodes } from './offCycleStateMachine'\nimport {\n OffCycleCreationContextual,\n type OffCycleFlowContextInterface,\n type OffCycleFlowProps,\n} from './OffCycleFlowComponents'\nimport { Flow } from '@/components/Flow/Flow'\nimport { buildBreadcrumbs } from '@/helpers/breadcrumbHelpers'\n\nexport function OffCycleFlow({ companyId, payrollType, onEvent }: OffCycleFlowProps) {\n const offCycleFlowMachine = useMemo(\n () =>\n createMachine(\n 'createOffCyclePayroll',\n offCycleMachine,\n (initialContext: OffCycleFlowContextInterface) => ({\n ...initialContext,\n component: OffCycleCreationContextual,\n companyId,\n payrollType,\n breadcrumbs: buildBreadcrumbs(offCycleBreadcrumbsNodes),\n currentBreadcrumbId: 'createOffCyclePayroll',\n progressBarType: 'breadcrumbs' as const,\n }),\n ),\n [companyId, payrollType],\n )\n\n return <Flow machine={offCycleFlowMachine} onEvent={onEvent} />\n}\n"],"names":["OffCycleFlow","companyId","payrollType","onEvent","offCycleFlowMachine","useMemo","createMachine","offCycleMachine","initialContext","OffCycleCreationContextual","buildBreadcrumbs","offCycleBreadcrumbsNodes","jsx","Flow"],"mappings":";;;;;;;AAWO,SAASA,EAAa,EAAE,WAAAC,GAAW,aAAAC,GAAa,SAAAC,KAA8B;AACnF,QAAMC,IAAsBC;AAAA,IAC1B,MACEC;AAAA,MACE;AAAA,MACAC;AAAA,MACA,CAACC,OAAkD;AAAA,QACjD,GAAGA;AAAA,QACH,WAAWC;AAAA,QACX,WAAAR;AAAA,QACA,aAAAC;AAAA,QACA,aAAaQ,EAAiBC,CAAwB;AAAA,QACtD,qBAAqB;AAAA,QACrB,iBAAiB;AAAA,MAAA;AAAA,IACnB;AAAA,IAEJ,CAACV,GAAWC,CAAW;AAAA,EAAA;AAGzB,SAAO,gBAAAU,EAACC,GAAA,EAAK,SAAST,GAAqB,SAAAD,EAAA,CAAkB;AAC/D;"}
@@ -1,12 +1,15 @@
1
+ import { OffCycleReason } from '../OffCycleReasonSelection';
1
2
  import { FlowContextInterface } from '../../Flow/useFlow';
2
3
  import { OnEventType } from '../../Base/useBase';
3
4
  import { EventType } from '../../../shared/constants';
4
5
  export interface OffCycleFlowContextInterface extends FlowContextInterface {
5
6
  companyId: string;
6
7
  payrollUuid?: string;
8
+ payrollType?: OffCycleReason;
7
9
  }
8
10
  export interface OffCycleFlowProps {
9
11
  companyId: string;
12
+ payrollType?: OffCycleReason;
10
13
  onEvent: OnEventType<EventType, unknown>;
11
14
  }
12
15
  export declare function OffCycleCreationContextual(): import("react/jsx-runtime").JSX.Element;
@@ -1,44 +1,52 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- import { useMemo as m, Suspense as s } from "react";
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ import { useMemo as u } from "react";
3
3
  import { usePayrollsGetSuspense as p } from "@gusto/embedded-api/react-query/payrollsGet";
4
- import { PayrollExecutionFlow as y } from "../PayrollExecutionFlow/PayrollExecutionFlow.js";
5
- import { useFlow as a } from "../../Flow/useFlow.js";
6
- import { ensureRequired as i } from "../../../helpers/ensureRequired.js";
4
+ import { PayrollExecutionFlow as s } from "../PayrollExecutionFlow/PayrollExecutionFlow.js";
5
+ import { useFlow as i } from "../../Flow/useFlow.js";
6
+ import { ensureRequired as c } from "../../../helpers/ensureRequired.js";
7
+ import { BaseComponent as y } from "../../Base/Base.js";
7
8
  import { OffCycleCreation as d } from "../OffCycleCreation/OffCycleCreation.js";
8
- function h() {
9
- const { companyId: o, onEvent: e } = a();
10
- return /* @__PURE__ */ t(d, { companyId: i(o), onEvent: e });
11
- }
12
9
  function w() {
13
- const { companyId: o, payrollUuid: e, onEvent: n, breadcrumbs: c } = a(), r = c?.createOffCyclePayroll?.[0], l = m(() => r ? [r] : void 0, [r]), f = i(o), u = i(e);
14
- return /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(
10
+ const { companyId: o, payrollType: r, onEvent: e } = i();
11
+ return /* @__PURE__ */ n(
12
+ d,
13
+ {
14
+ companyId: c(o),
15
+ payrollType: r,
16
+ onEvent: e
17
+ }
18
+ );
19
+ }
20
+ function B() {
21
+ const { companyId: o, payrollUuid: r, onEvent: e, breadcrumbs: a } = i(), t = a?.createOffCyclePayroll?.[0], l = u(() => t ? [t] : void 0, [t]), m = c(o), f = c(r);
22
+ return /* @__PURE__ */ n(y, { onEvent: e, children: /* @__PURE__ */ n(
15
23
  C,
16
24
  {
17
- companyId: f,
18
- payrollId: u,
19
- onEvent: n,
25
+ companyId: m,
26
+ payrollId: f,
27
+ onEvent: e,
20
28
  prefixBreadcrumbs: l
21
29
  }
22
30
  ) });
23
31
  }
24
32
  function C({
25
33
  companyId: o,
26
- payrollId: e,
27
- ...n
34
+ payrollId: r,
35
+ ...e
28
36
  }) {
29
- const { data: c } = p({ companyId: o, payrollId: e }), r = c.payrollShow?.payPeriod;
30
- return /* @__PURE__ */ t(
31
- y,
37
+ const { data: a } = p({ companyId: o, payrollId: r }), t = a.payrollShow?.payPeriod;
38
+ return /* @__PURE__ */ n(
39
+ s,
32
40
  {
33
41
  companyId: o,
34
- payrollId: e,
35
- initialPayPeriod: r,
36
- ...n
42
+ payrollId: r,
43
+ initialPayPeriod: t,
44
+ ...e
37
45
  }
38
46
  );
39
47
  }
40
48
  export {
41
- h as OffCycleCreationContextual,
42
- w as OffCycleExecutionContextual
49
+ w as OffCycleCreationContextual,
50
+ B as OffCycleExecutionContextual
43
51
  };
44
52
  //# sourceMappingURL=OffCycleFlowComponents.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"OffCycleFlowComponents.js","sources":["../../../../src/components/Payroll/OffCycle/OffCycleFlowComponents.tsx"],"sourcesContent":["import { Suspense, useMemo } from 'react'\nimport { usePayrollsGetSuspense } from '@gusto/embedded-api/react-query/payrollsGet'\nimport { OffCycleCreation } from '../OffCycleCreation'\nimport {\n PayrollExecutionFlow,\n type PayrollExecutionFlowProps,\n} from '../PayrollExecutionFlow/PayrollExecutionFlow'\nimport { useFlow, type FlowContextInterface } from '@/components/Flow/useFlow'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport type { EventType } from '@/shared/constants'\nimport { ensureRequired } from '@/helpers/ensureRequired'\n\nexport interface OffCycleFlowContextInterface extends FlowContextInterface {\n companyId: string\n payrollUuid?: string\n}\n\nexport interface OffCycleFlowProps {\n companyId: string\n onEvent: OnEventType<EventType, unknown>\n}\n\nexport function OffCycleCreationContextual() {\n const { companyId, onEvent } = useFlow<OffCycleFlowContextInterface>()\n return <OffCycleCreation companyId={ensureRequired(companyId)} onEvent={onEvent} />\n}\n\nexport function OffCycleExecutionContextual() {\n const { companyId, payrollUuid, onEvent, breadcrumbs } = useFlow<OffCycleFlowContextInterface>()\n\n const offCycleCreationBreadcrumb = breadcrumbs?.['createOffCyclePayroll']?.[0]\n const prefixBreadcrumbs = useMemo(() => {\n return offCycleCreationBreadcrumb ? [offCycleCreationBreadcrumb] : undefined\n }, [offCycleCreationBreadcrumb])\n\n const resolvedCompanyId = ensureRequired(companyId)\n const resolvedPayrollId = ensureRequired(payrollUuid)\n\n return (\n <Suspense>\n <OffCycleExecutionWithData\n companyId={resolvedCompanyId}\n payrollId={resolvedPayrollId}\n onEvent={onEvent}\n prefixBreadcrumbs={prefixBreadcrumbs}\n />\n </Suspense>\n )\n}\n\ntype OffCycleExecutionWithDataProps = Pick<\n PayrollExecutionFlowProps,\n 'companyId' | 'payrollId' | 'onEvent' | 'prefixBreadcrumbs'\n>\n\nfunction OffCycleExecutionWithData({\n companyId,\n payrollId,\n ...rest\n}: OffCycleExecutionWithDataProps) {\n const { data } = usePayrollsGetSuspense({ companyId, payrollId })\n const initialPayPeriod = data.payrollShow?.payPeriod\n\n return (\n <PayrollExecutionFlow\n companyId={companyId}\n payrollId={payrollId}\n initialPayPeriod={initialPayPeriod}\n {...rest}\n />\n )\n}\n"],"names":["OffCycleCreationContextual","companyId","onEvent","useFlow","OffCycleCreation","ensureRequired","OffCycleExecutionContextual","payrollUuid","breadcrumbs","offCycleCreationBreadcrumb","prefixBreadcrumbs","useMemo","resolvedCompanyId","resolvedPayrollId","Suspense","jsx","OffCycleExecutionWithData","payrollId","rest","data","usePayrollsGetSuspense","initialPayPeriod","PayrollExecutionFlow"],"mappings":";;;;;;;AAsBO,SAASA,IAA6B;AAC3C,QAAM,EAAE,WAAAC,GAAW,SAAAC,EAAA,IAAYC,EAAA;AAC/B,2BAAQC,GAAA,EAAiB,WAAWC,EAAeJ,CAAS,GAAG,SAAAC,GAAkB;AACnF;AAEO,SAASI,IAA8B;AAC5C,QAAM,EAAE,WAAAL,GAAW,aAAAM,GAAa,SAAAL,GAAS,aAAAM,EAAA,IAAgBL,EAAA,GAEnDM,IAA6BD,GAAc,wBAA2B,CAAC,GACvEE,IAAoBC,EAAQ,MACzBF,IAA6B,CAACA,CAA0B,IAAI,QAClE,CAACA,CAA0B,CAAC,GAEzBG,IAAoBP,EAAeJ,CAAS,GAC5CY,IAAoBR,EAAeE,CAAW;AAEpD,2BACGO,GAAA,EACC,UAAA,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,WAAWJ;AAAA,MACX,WAAWC;AAAA,MACX,SAAAX;AAAA,MACA,mBAAAQ;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;AAOA,SAASM,EAA0B;AAAA,EACjC,WAAAf;AAAA,EACA,WAAAgB;AAAA,EACA,GAAGC;AACL,GAAmC;AACjC,QAAM,EAAE,MAAAC,EAAA,IAASC,EAAuB,EAAE,WAAAnB,GAAW,WAAAgB,GAAW,GAC1DI,IAAmBF,EAAK,aAAa;AAE3C,SACE,gBAAAJ;AAAA,IAACO;AAAA,IAAA;AAAA,MACC,WAAArB;AAAA,MACA,WAAAgB;AAAA,MACA,kBAAAI;AAAA,MACC,GAAGH;AAAA,IAAA;AAAA,EAAA;AAGV;"}
1
+ {"version":3,"file":"OffCycleFlowComponents.js","sources":["../../../../src/components/Payroll/OffCycle/OffCycleFlowComponents.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { usePayrollsGetSuspense } from '@gusto/embedded-api/react-query/payrollsGet'\nimport { OffCycleCreation } from '../OffCycleCreation'\nimport {\n PayrollExecutionFlow,\n type PayrollExecutionFlowProps,\n} from '../PayrollExecutionFlow/PayrollExecutionFlow'\nimport type { OffCycleReason } from '../OffCycleReasonSelection'\nimport { useFlow, type FlowContextInterface } from '@/components/Flow/useFlow'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport type { EventType } from '@/shared/constants'\nimport { ensureRequired } from '@/helpers/ensureRequired'\nimport { BaseComponent } from '@/components/Base/Base'\n\nexport interface OffCycleFlowContextInterface extends FlowContextInterface {\n companyId: string\n payrollUuid?: string\n payrollType?: OffCycleReason\n}\n\nexport interface OffCycleFlowProps {\n companyId: string\n payrollType?: OffCycleReason\n onEvent: OnEventType<EventType, unknown>\n}\n\nexport function OffCycleCreationContextual() {\n const { companyId, payrollType, onEvent } = useFlow<OffCycleFlowContextInterface>()\n return (\n <OffCycleCreation\n companyId={ensureRequired(companyId)}\n payrollType={payrollType}\n onEvent={onEvent}\n />\n )\n}\n\nexport function OffCycleExecutionContextual() {\n const { companyId, payrollUuid, onEvent, breadcrumbs } = useFlow<OffCycleFlowContextInterface>()\n\n const offCycleCreationBreadcrumb = breadcrumbs?.['createOffCyclePayroll']?.[0]\n const prefixBreadcrumbs = useMemo(() => {\n return offCycleCreationBreadcrumb ? [offCycleCreationBreadcrumb] : undefined\n }, [offCycleCreationBreadcrumb])\n\n const resolvedCompanyId = ensureRequired(companyId)\n const resolvedPayrollId = ensureRequired(payrollUuid)\n\n return (\n <BaseComponent onEvent={onEvent}>\n <OffCycleExecutionWithData\n companyId={resolvedCompanyId}\n payrollId={resolvedPayrollId}\n onEvent={onEvent}\n prefixBreadcrumbs={prefixBreadcrumbs}\n />\n </BaseComponent>\n )\n}\n\ntype OffCycleExecutionWithDataProps = Pick<\n PayrollExecutionFlowProps,\n 'companyId' | 'payrollId' | 'onEvent' | 'prefixBreadcrumbs'\n>\n\nfunction OffCycleExecutionWithData({\n companyId,\n payrollId,\n ...rest\n}: OffCycleExecutionWithDataProps) {\n const { data } = usePayrollsGetSuspense({ companyId, payrollId })\n const initialPayPeriod = data.payrollShow?.payPeriod\n\n return (\n <PayrollExecutionFlow\n companyId={companyId}\n payrollId={payrollId}\n initialPayPeriod={initialPayPeriod}\n {...rest}\n />\n )\n}\n"],"names":["OffCycleCreationContextual","companyId","payrollType","onEvent","useFlow","jsx","OffCycleCreation","ensureRequired","OffCycleExecutionContextual","payrollUuid","breadcrumbs","offCycleCreationBreadcrumb","prefixBreadcrumbs","useMemo","resolvedCompanyId","resolvedPayrollId","BaseComponent","OffCycleExecutionWithData","payrollId","rest","data","usePayrollsGetSuspense","initialPayPeriod","PayrollExecutionFlow"],"mappings":";;;;;;;;AA0BO,SAASA,IAA6B;AAC3C,QAAM,EAAE,WAAAC,GAAW,aAAAC,GAAa,SAAAC,EAAA,IAAYC,EAAA;AAC5C,SACE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAeN,CAAS;AAAA,MACnC,aAAAC;AAAA,MACA,SAAAC;AAAA,IAAA;AAAA,EAAA;AAGN;AAEO,SAASK,IAA8B;AAC5C,QAAM,EAAE,WAAAP,GAAW,aAAAQ,GAAa,SAAAN,GAAS,aAAAO,EAAA,IAAgBN,EAAA,GAEnDO,IAA6BD,GAAc,wBAA2B,CAAC,GACvEE,IAAoBC,EAAQ,MACzBF,IAA6B,CAACA,CAA0B,IAAI,QAClE,CAACA,CAA0B,CAAC,GAEzBG,IAAoBP,EAAeN,CAAS,GAC5Cc,IAAoBR,EAAeE,CAAW;AAEpD,SACE,gBAAAJ,EAACW,KAAc,SAAAb,GACb,UAAA,gBAAAE;AAAA,IAACY;AAAA,IAAA;AAAA,MACC,WAAWH;AAAA,MACX,WAAWC;AAAA,MACX,SAAAZ;AAAA,MACA,mBAAAS;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;AAOA,SAASK,EAA0B;AAAA,EACjC,WAAAhB;AAAA,EACA,WAAAiB;AAAA,EACA,GAAGC;AACL,GAAmC;AACjC,QAAM,EAAE,MAAAC,EAAA,IAASC,EAAuB,EAAE,WAAApB,GAAW,WAAAiB,GAAW,GAC1DI,IAAmBF,EAAK,aAAa;AAE3C,SACE,gBAAAf;AAAA,IAACkB;AAAA,IAAA;AAAA,MACC,WAAAtB;AAAA,MACA,WAAAiB;AAAA,MACA,kBAAAI;AAAA,MACC,GAAGH;AAAA,IAAA;AAAA,EAAA;AAGV;"}
@@ -1,65 +1,66 @@
1
1
  import { jsx as s } from "react/jsx-runtime";
2
- import { useState as w, useCallback as C, useMemo as z, useEffect as Y } from "react";
3
- import { useForm as H, FormProvider as Z } from "react-hook-form";
4
- import { zodResolver as G } from "@hookform/resolvers/zod";
2
+ import { useState as w, useCallback as C, useMemo as q, useEffect as z } from "react";
3
+ import { useForm as Y, FormProvider as H } from "react-hook-form";
4
+ import { zodResolver as K } from "@hookform/resolvers/zod";
5
5
  import { z as t } from "zod";
6
6
  import { useTranslation as S } from "react-i18next";
7
- import { usePayrollsCreateOffCycleMutation as J } from "@gusto/embedded-api/react-query/payrollsCreateOffCycle";
8
- import { WithholdingPayPeriod as K, OffCycleReason as b } from "@gusto/embedded-api/models/operations/postv1companiescompanyidpayrolls";
7
+ import { usePayrollsCreateOffCycleMutation as Z } from "@gusto/embedded-api/react-query/payrollsCreateOffCycle";
8
+ import { WithholdingPayPeriod as G, OffCycleReason as b } from "@gusto/embedded-api/models/operations/postv1companiescompanyidpayrolls";
9
9
  import { RFCDate as g } from "@gusto/embedded-api/types/rfcdate";
10
- import { useEmployeesListSuspense as Q } from "@gusto/embedded-api/react-query/employeesList";
11
- import { createOffCyclePayPeriodDateFormSchema as X } from "../OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.js";
12
- import { useOffCyclePayPeriodDateValidation as $ } from "../OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.js";
13
- import { OffCycleCreationPresentation as ee } from "./OffCycleCreationPresentation.js";
14
- import { BaseComponent as oe } from "../../Base/Base.js";
15
- import { useBase as te } from "../../Base/useBase.js";
16
- import { useComponentDictionary as ne, useI18n as i } from "../../../i18n/I18n.js";
17
- import { componentEvents as le } from "../../../shared/constants.js";
10
+ import { useEmployeesListSuspense as J } from "@gusto/embedded-api/react-query/employeesList";
11
+ import { createOffCyclePayPeriodDateFormSchema as Q } from "../OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.js";
12
+ import { useOffCyclePayPeriodDateValidation as X } from "../OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.js";
13
+ import { OffCycleCreationPresentation as $ } from "./OffCycleCreationPresentation.js";
14
+ import { BaseComponent as ee } from "../../Base/Base.js";
15
+ import { useBase as oe } from "../../Base/useBase.js";
16
+ import { useComponentDictionary as te, useI18n as i } from "../../../i18n/I18n.js";
17
+ import { componentEvents as ne } from "../../../shared/constants.js";
18
+ import { SDKInternalError as le } from "../../../types/sdkError.js";
18
19
  import { Form as ie } from "../../Common/Form/Form.js";
19
20
  import { OFF_CYCLE_REASON_DEFAULTS as m } from "../OffCycleReasonSelection/types.js";
20
21
  const se = {
21
22
  bonus: b.Bonus,
22
23
  correction: b.Correction
23
24
  };
24
- function Te(r) {
25
- return /* @__PURE__ */ s(oe, { ...r, children: /* @__PURE__ */ s(re, { ...r }) });
25
+ function xe(r) {
26
+ return /* @__PURE__ */ s(ee, { ...r, children: /* @__PURE__ */ s(re, { ...r }) });
26
27
  }
27
28
  function re({ dictionary: r, companyId: P, payrollType: a = "bonus" }) {
28
- ne("Payroll.OffCycleCreation", r), i("Payroll.OffCycleCreation"), i("Payroll.OffCycleReasonSelection"), i("Payroll.OffCyclePayPeriodDateForm"), i("Payroll.OffCycleDeductionsSetting"), i("Payroll.EmployeeSelection");
29
- const { t: T } = S("Payroll.OffCyclePayPeriodDateForm"), { t: D } = S("Payroll.OffCycleCreation"), { onEvent: x, baseSubmitHandler: W } = te(), { minCheckDate: A, today: F } = $(), { mutateAsync: U, isPending: v } = J(), [u, O] = w({
30
- withholdingPayPeriod: K.EveryOtherWeek,
29
+ te("Payroll.OffCycleCreation", r), i("Payroll.OffCycleCreation"), i("Payroll.OffCycleReasonSelection"), i("Payroll.OffCyclePayPeriodDateForm"), i("Payroll.OffCycleDeductionsSetting"), i("Payroll.EmployeeSelection");
30
+ const { t: T } = S("Payroll.OffCyclePayPeriodDateForm"), { t: D } = S("Payroll.OffCycleCreation"), { onEvent: x, baseSubmitHandler: W } = oe(), { minCheckDate: A, today: F } = X(), { mutateAsync: U, isPending: v } = Z(), [u, O] = w({
31
+ withholdingPayPeriod: G.EveryOtherWeek,
31
32
  withholdingRate: m[a].withholdingType
32
33
  }), [L, y] = w(!1), M = C(() => {
33
34
  y(!0);
34
35
  }, []), _ = C((e) => {
35
36
  O(e), y(!1);
36
- }, []), N = C(() => {
37
+ }, []), I = C(() => {
37
38
  y(!1);
38
- }, []), { data: E, isLoading: B } = Q({
39
+ }, []), { data: E } = J({
39
40
  companyId: P,
40
41
  onboardedActive: !0
41
- }), I = z(() => (E.showEmployees ?? []).map((o) => ({
42
+ }), N = q(() => (E.showEmployees ?? []).map((o) => ({
42
43
  label: [o.firstName, o.lastName].filter(Boolean).join(" "),
43
44
  value: o.uuid
44
- })), [E]), V = (e) => T(e), l = H({
45
+ })), [E]), B = (e) => T(e), l = Y({
45
46
  resolver: (e, o, n) => {
46
- const f = e.reason, p = e.isCheckOnly, c = X(
47
- V,
48
- f === "correction" ? "correction" : a,
47
+ const h = e.reason, p = e.isCheckOnly, c = Q(
48
+ B,
49
+ h === "correction" ? "correction" : a,
49
50
  p ? F : A
50
51
  ), d = t.object({
51
52
  reason: t.enum(["bonus", "correction"]),
52
53
  skipRegularDeductions: t.boolean(),
53
54
  includeAllEmployees: t.boolean(),
54
55
  selectedEmployeeUuids: t.array(t.string())
55
- }).and(c).superRefine((R, q) => {
56
- !R.includeAllEmployees && R.selectedEmployeeUuids.length === 0 && q.addIssue({
56
+ }).and(c).superRefine((R, j) => {
57
+ !R.includeAllEmployees && R.selectedEmployeeUuids.length === 0 && j.addIssue({
57
58
  code: t.ZodIssueCode.custom,
58
59
  path: ["selectedEmployeeUuids"],
59
60
  message: D("errors.noEmployeesSelected")
60
61
  });
61
62
  });
62
- return G(d)(e, o, n);
63
+ return K(d)(e, o, n);
63
64
  },
64
65
  defaultValues: {
65
66
  reason: a,
@@ -68,21 +69,21 @@ function re({ dictionary: r, companyId: P, payrollType: a = "bonus" }) {
68
69
  endDate: null,
69
70
  checkDate: null,
70
71
  skipRegularDeductions: m[a].skipDeductions,
71
- includeAllEmployees: !0,
72
+ includeAllEmployees: !1,
72
73
  selectedEmployeeUuids: []
73
74
  }
74
- }), h = l.watch("reason");
75
- Y(() => {
75
+ }), f = l.watch("reason");
76
+ z(() => {
76
77
  l.setValue(
77
78
  "skipRegularDeductions",
78
- m[h].skipDeductions
79
+ m[f].skipDeductions
79
80
  ), O((e) => ({
80
81
  ...e,
81
- withholdingRate: m[h].withholdingType
82
+ withholdingRate: m[f].withholdingType
82
83
  }));
83
- }, [h, l]);
84
- const j = async (e) => {
85
- const o = e.reason, n = e.checkDate, f = e.isCheckOnly ? n : e.startDate, p = e.isCheckOnly ? n : e.endDate, k = !e.includeAllEmployees && e.selectedEmployeeUuids.length > 0 ? e.selectedEmployeeUuids : void 0;
84
+ }, [f, l]);
85
+ const V = async (e) => {
86
+ const o = e.reason, n = e.checkDate, h = e.isCheckOnly ? n : e.startDate, p = e.isCheckOnly ? n : e.endDate, k = !e.includeAllEmployees && e.selectedEmployeeUuids.length > 0 ? e.selectedEmployeeUuids : void 0;
86
87
  await W(e, async () => {
87
88
  const c = await U({
88
89
  request: {
@@ -90,7 +91,7 @@ function re({ dictionary: r, companyId: P, payrollType: a = "bonus" }) {
90
91
  requestBody: {
91
92
  offCycle: !0,
92
93
  offCycleReason: se[o],
93
- startDate: new g(f),
94
+ startDate: new g(h),
94
95
  endDate: new g(p),
95
96
  checkDate: new g(n),
96
97
  skipRegularDeductions: e.skipRegularDeductions,
@@ -102,25 +103,24 @@ function re({ dictionary: r, companyId: P, payrollType: a = "bonus" }) {
102
103
  }
103
104
  }), d = c.payrollUnprocessed?.payrollUuid ?? c.payrollUnprocessed?.uuid;
104
105
  if (!d)
105
- throw new Error(D("errors.missingPayrollId"));
106
- x(le.OFF_CYCLE_CREATED, { payrollUuid: d });
106
+ throw new le(D("errors.missingPayrollId"));
107
+ x(ne.OFF_CYCLE_CREATED, { payrollUuid: d });
107
108
  });
108
109
  };
109
- return /* @__PURE__ */ s(Z, { ...l, children: /* @__PURE__ */ s(ie, { onSubmit: l.handleSubmit(j), children: /* @__PURE__ */ s(
110
- ee,
110
+ return /* @__PURE__ */ s(H, { ...l, children: /* @__PURE__ */ s(ie, { onSubmit: l.handleSubmit(V), children: /* @__PURE__ */ s(
111
+ $,
111
112
  {
112
- employees: I,
113
- isLoadingEmployees: B,
113
+ employees: N,
114
114
  isPending: v,
115
115
  taxWithholdingConfig: u,
116
116
  isTaxWithholdingModalOpen: L,
117
117
  onTaxWithholdingEditClick: M,
118
118
  onTaxWithholdingModalDone: _,
119
- onTaxWithholdingModalCancel: N
119
+ onTaxWithholdingModalCancel: I
120
120
  }
121
121
  ) }) });
122
122
  }
123
123
  export {
124
- Te as OffCycleCreation
124
+ xe as OffCycleCreation
125
125
  };
126
126
  //# sourceMappingURL=OffCycleCreation.js.map