@gusto/embedded-react-sdk 0.54.1-rc.1 → 0.54.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 (284) hide show
  1. package/dist/components/Common/FlowBreadcrumbs/breadcrumbTransitionHelpers.d.ts +3 -3
  2. package/dist/components/Common/FlowBreadcrumbs/breadcrumbTransitionHelpers.js +5 -6
  3. package/dist/components/Common/FlowBreadcrumbs/breadcrumbTransitionHelpers.js.map +1 -1
  4. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +4 -5
  5. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  6. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +4 -5
  7. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  8. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +6 -7
  9. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  10. package/dist/components/Company/BankAccount/BankAccount.js +9 -9
  11. package/dist/components/Company/BankAccount/BankAccount.js.map +1 -1
  12. package/dist/components/Company/BankAccount/BankAccountForm/context.js +4 -5
  13. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  14. package/dist/components/Company/BankAccount/stateMachine.d.ts +3 -3
  15. package/dist/components/Company/BankAccount/stateMachine.js +6 -7
  16. package/dist/components/Company/BankAccount/stateMachine.js.map +1 -1
  17. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +4 -5
  18. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  19. package/dist/components/Company/DocumentSigner/DocumentSigner.js +10 -10
  20. package/dist/components/Company/DocumentSigner/DocumentSigner.js.map +1 -1
  21. package/dist/components/Company/DocumentSigner/assignSignatoryState.d.ts +1 -1
  22. package/dist/components/Company/DocumentSigner/assignSignatoryState.js +12 -13
  23. package/dist/components/Company/DocumentSigner/assignSignatoryState.js.map +1 -1
  24. package/dist/components/Company/DocumentSigner/stateMachine.d.ts +4 -4
  25. package/dist/components/Company/DocumentSigner/stateMachine.js +13 -14
  26. package/dist/components/Company/DocumentSigner/stateMachine.js.map +1 -1
  27. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +9 -10
  28. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  29. package/dist/components/Company/Industry/Context.js +7 -8
  30. package/dist/components/Company/Industry/Context.js.map +1 -1
  31. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +4 -5
  32. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  33. package/dist/components/Company/Locations/Locations.js +8 -8
  34. package/dist/components/Company/Locations/Locations.js.map +1 -1
  35. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +4 -5
  36. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  37. package/dist/components/Company/Locations/stateMachine.d.ts +3 -3
  38. package/dist/components/Company/Locations/stateMachine.js +2 -3
  39. package/dist/components/Company/Locations/stateMachine.js.map +1 -1
  40. package/dist/components/Company/OnboardingFlow/OnboardingFlow.js +8 -8
  41. package/dist/components/Company/OnboardingFlow/OnboardingFlow.js.map +1 -1
  42. package/dist/components/Company/OnboardingFlow/onboardingStateMachine.d.ts +10 -10
  43. package/dist/components/Company/OnboardingFlow/onboardingStateMachine.js +10 -11
  44. package/dist/components/Company/OnboardingFlow/onboardingStateMachine.js.map +1 -1
  45. package/dist/components/Company/OnboardingOverview/context.js +4 -5
  46. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  47. package/dist/components/Company/PaySchedule/PaySchedule.js +7 -7
  48. package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
  49. package/dist/components/Company/PaySchedule/payScheduleStateMachine.d.ts +3 -3
  50. package/dist/components/Company/PaySchedule/payScheduleStateMachine.js +3 -4
  51. package/dist/components/Company/PaySchedule/payScheduleStateMachine.js.map +1 -1
  52. package/dist/components/Company/StateTaxes/StateTaxes.js +8 -8
  53. package/dist/components/Company/StateTaxes/StateTaxes.js.map +1 -1
  54. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +4 -5
  55. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  56. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +4 -5
  57. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  58. package/dist/components/Company/StateTaxes/TaxRateManagement/context.js +4 -5
  59. package/dist/components/Company/StateTaxes/TaxRateManagement/context.js.map +1 -1
  60. package/dist/components/Company/StateTaxes/stateTaxesStateMachine.d.ts +3 -3
  61. package/dist/components/Company/StateTaxes/stateTaxesStateMachine.js +12 -13
  62. package/dist/components/Company/StateTaxes/stateTaxesStateMachine.js.map +1 -1
  63. package/dist/components/Contractor/Address/management/Address.js +7 -7
  64. package/dist/components/Contractor/Address/management/Address.js.map +1 -1
  65. package/dist/components/Contractor/Address/management/addressStateMachine.d.ts +2 -2
  66. package/dist/components/Contractor/Address/management/addressStateMachine.js +13 -14
  67. package/dist/components/Contractor/Address/management/addressStateMachine.js.map +1 -1
  68. package/dist/components/Contractor/Compensation/management/Compensation.js +7 -7
  69. package/dist/components/Contractor/Compensation/management/Compensation.js.map +1 -1
  70. package/dist/components/Contractor/Compensation/management/compensationStateMachine.d.ts +2 -2
  71. package/dist/components/Contractor/Compensation/management/compensationStateMachine.js +3 -4
  72. package/dist/components/Contractor/Compensation/management/compensationStateMachine.js.map +1 -1
  73. package/dist/components/Contractor/Dashboard/DashboardFlow.js +8 -8
  74. package/dist/components/Contractor/Dashboard/DashboardFlow.js.map +1 -1
  75. package/dist/components/Contractor/Dashboard/dashboardStateMachine.d.ts +5 -5
  76. package/dist/components/Contractor/Dashboard/dashboardStateMachine.js +6 -7
  77. package/dist/components/Contractor/Dashboard/dashboardStateMachine.js.map +1 -1
  78. package/dist/components/Contractor/Documents/onboarding/DocumentSigner/DocumentSigner.js +8 -8
  79. package/dist/components/Contractor/Documents/onboarding/DocumentSigner/DocumentSigner.js.map +1 -1
  80. package/dist/components/Contractor/Documents/onboarding/DocumentSigner/stateMachine.d.ts +2 -2
  81. package/dist/components/Contractor/Documents/onboarding/DocumentSigner/stateMachine.js +12 -13
  82. package/dist/components/Contractor/Documents/onboarding/DocumentSigner/stateMachine.js.map +1 -1
  83. package/dist/components/Contractor/OnboardingFlow/OnboardingFlow.js +8 -8
  84. package/dist/components/Contractor/OnboardingFlow/OnboardingFlow.js.map +1 -1
  85. package/dist/components/Contractor/OnboardingFlow/onboardingStateMachine.d.ts +7 -7
  86. package/dist/components/Contractor/OnboardingFlow/onboardingStateMachine.js +7 -8
  87. package/dist/components/Contractor/OnboardingFlow/onboardingStateMachine.js.map +1 -1
  88. package/dist/components/Contractor/PaymentMethod/management/PaymentMethod.js +7 -7
  89. package/dist/components/Contractor/PaymentMethod/management/PaymentMethod.js.map +1 -1
  90. package/dist/components/Contractor/PaymentMethod/management/paymentMethodStateMachine.d.ts +2 -2
  91. package/dist/components/Contractor/PaymentMethod/management/paymentMethodStateMachine.js +13 -14
  92. package/dist/components/Contractor/PaymentMethod/management/paymentMethodStateMachine.js.map +1 -1
  93. package/dist/components/Contractor/Payments/CreatePaymentFlow/CreatePaymentFlow.js +9 -9
  94. package/dist/components/Contractor/Payments/CreatePaymentFlow/CreatePaymentFlow.js.map +1 -1
  95. package/dist/components/Contractor/Payments/CreatePaymentFlow/createPaymentMachine.d.ts +2 -2
  96. package/dist/components/Contractor/Payments/CreatePaymentFlow/createPaymentMachine.js +8 -9
  97. package/dist/components/Contractor/Payments/CreatePaymentFlow/createPaymentMachine.js.map +1 -1
  98. package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlow.js +8 -8
  99. package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlow.js.map +1 -1
  100. package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.d.ts +4 -4
  101. package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js +9 -10
  102. package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js.map +1 -1
  103. package/dist/components/Contractor/Payments/ViewPaymentFlow/ViewPaymentFlow.js +8 -8
  104. package/dist/components/Contractor/Payments/ViewPaymentFlow/ViewPaymentFlow.js.map +1 -1
  105. package/dist/components/Contractor/Payments/ViewPaymentFlow/viewPaymentMachine.d.ts +2 -2
  106. package/dist/components/Contractor/Payments/ViewPaymentFlow/viewPaymentMachine.js +14 -15
  107. package/dist/components/Contractor/Payments/ViewPaymentFlow/viewPaymentMachine.js.map +1 -1
  108. package/dist/components/Contractor/Profile/management/Profile.js +7 -7
  109. package/dist/components/Contractor/Profile/management/Profile.js.map +1 -1
  110. package/dist/components/Contractor/Profile/management/profileStateMachine.d.ts +2 -2
  111. package/dist/components/Contractor/Profile/management/profileStateMachine.js +10 -11
  112. package/dist/components/Contractor/Profile/management/profileStateMachine.js.map +1 -1
  113. package/dist/components/Contractor/SelfOnboardingFlow/SelfOnboardingFlow.js +8 -8
  114. package/dist/components/Contractor/SelfOnboardingFlow/SelfOnboardingFlow.js.map +1 -1
  115. package/dist/components/Contractor/SelfOnboardingFlow/selfOnboardingMachine.d.ts +5 -5
  116. package/dist/components/Contractor/SelfOnboardingFlow/selfOnboardingMachine.js +6 -7
  117. package/dist/components/Contractor/SelfOnboardingFlow/selfOnboardingMachine.js.map +1 -1
  118. package/dist/components/Employee/Compensation/management/Compensation.js +7 -7
  119. package/dist/components/Employee/Compensation/management/Compensation.js.map +1 -1
  120. package/dist/components/Employee/Compensation/management/CompensationComponents.js +4 -4
  121. package/dist/components/Employee/Compensation/management/compensationStateMachine.d.ts +4 -4
  122. package/dist/components/Employee/Compensation/management/compensationStateMachine.js +20 -21
  123. package/dist/components/Employee/Compensation/management/compensationStateMachine.js.map +1 -1
  124. package/dist/components/Employee/Compensation/onboarding/Compensation.js +11 -11
  125. package/dist/components/Employee/Compensation/onboarding/Compensation.js.map +1 -1
  126. package/dist/components/Employee/Compensation/onboarding/compensationStateMachine.d.ts +4 -4
  127. package/dist/components/Employee/Compensation/onboarding/compensationStateMachine.js +10 -11
  128. package/dist/components/Employee/Compensation/onboarding/compensationStateMachine.js.map +1 -1
  129. package/dist/components/Employee/Dashboard/DashboardFlow.js +8 -8
  130. package/dist/components/Employee/Dashboard/DashboardFlow.js.map +1 -1
  131. package/dist/components/Employee/Dashboard/dashboardStateMachine.d.ts +13 -13
  132. package/dist/components/Employee/Dashboard/dashboardStateMachine.js +14 -15
  133. package/dist/components/Employee/Dashboard/dashboardStateMachine.js.map +1 -1
  134. package/dist/components/Employee/Deductions/management/Deductions.js +7 -7
  135. package/dist/components/Employee/Deductions/management/Deductions.js.map +1 -1
  136. package/dist/components/Employee/Deductions/management/deductionsStateMachine.d.ts +2 -2
  137. package/dist/components/Employee/Deductions/management/deductionsStateMachine.js +8 -9
  138. package/dist/components/Employee/Deductions/management/deductionsStateMachine.js.map +1 -1
  139. package/dist/components/Employee/Deductions/onboarding/Deductions.js +7 -7
  140. package/dist/components/Employee/Deductions/onboarding/Deductions.js.map +1 -1
  141. package/dist/components/Employee/Deductions/onboarding/stateMachine.d.ts +3 -3
  142. package/dist/components/Employee/Deductions/onboarding/stateMachine.js +8 -9
  143. package/dist/components/Employee/Deductions/onboarding/stateMachine.js.map +1 -1
  144. package/dist/components/Employee/Documents/management/Documents.js +7 -7
  145. package/dist/components/Employee/Documents/management/Documents.js.map +1 -1
  146. package/dist/components/Employee/Documents/management/documentsStateMachine.d.ts +2 -2
  147. package/dist/components/Employee/Documents/management/documentsStateMachine.js +3 -4
  148. package/dist/components/Employee/Documents/management/documentsStateMachine.js.map +1 -1
  149. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js +4 -5
  150. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  151. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentSigner.js +10 -10
  152. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentSigner.js.map +1 -1
  153. package/dist/components/Employee/Documents/onboarding/DocumentSigner/stateMachine.d.ts +4 -4
  154. package/dist/components/Employee/Documents/onboarding/DocumentSigner/stateMachine.js +12 -13
  155. package/dist/components/Employee/Documents/onboarding/DocumentSigner/stateMachine.js.map +1 -1
  156. package/dist/components/Employee/EmployeeListFlow/EmployeeListFlow.js +8 -8
  157. package/dist/components/Employee/EmployeeListFlow/EmployeeListFlow.js.map +1 -1
  158. package/dist/components/Employee/EmployeeListFlow/employeeListStateMachine.d.ts +4 -4
  159. package/dist/components/Employee/EmployeeListFlow/employeeListStateMachine.js +7 -8
  160. package/dist/components/Employee/EmployeeListFlow/employeeListStateMachine.js.map +1 -1
  161. package/dist/components/Employee/FederalTaxes/management/FederalTaxes.js +7 -7
  162. package/dist/components/Employee/FederalTaxes/management/FederalTaxes.js.map +1 -1
  163. package/dist/components/Employee/FederalTaxes/management/federalTaxesStateMachine.d.ts +2 -2
  164. package/dist/components/Employee/FederalTaxes/management/federalTaxesStateMachine.js +3 -4
  165. package/dist/components/Employee/FederalTaxes/management/federalTaxesStateMachine.js.map +1 -1
  166. package/dist/components/Employee/HomeAddress/management/HomeAddress.js +7 -7
  167. package/dist/components/Employee/HomeAddress/management/HomeAddress.js.map +1 -1
  168. package/dist/components/Employee/HomeAddress/management/homeAddressStateMachine.d.ts +2 -2
  169. package/dist/components/Employee/HomeAddress/management/homeAddressStateMachine.js +5 -6
  170. package/dist/components/Employee/HomeAddress/management/homeAddressStateMachine.js.map +1 -1
  171. package/dist/components/Employee/OnboardingExecutionFlow/OnboardingExecutionFlow.js +6 -6
  172. package/dist/components/Employee/OnboardingExecutionFlow/OnboardingExecutionFlow.js.map +1 -1
  173. package/dist/components/Employee/OnboardingExecutionFlow/onboardingExecutionStateMachine.d.ts +8 -8
  174. package/dist/components/Employee/OnboardingExecutionFlow/onboardingExecutionStateMachine.js +19 -20
  175. package/dist/components/Employee/OnboardingExecutionFlow/onboardingExecutionStateMachine.js.map +1 -1
  176. package/dist/components/Employee/OnboardingFlow/OnboardingFlow.js +8 -8
  177. package/dist/components/Employee/OnboardingFlow/OnboardingFlow.js.map +1 -1
  178. package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.d.ts +3 -3
  179. package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.js +3 -4
  180. package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.js.map +1 -1
  181. package/dist/components/Employee/PaymentMethod/management/PaymentMethod.js +7 -7
  182. package/dist/components/Employee/PaymentMethod/management/PaymentMethod.js.map +1 -1
  183. package/dist/components/Employee/PaymentMethod/management/paymentMethodStateMachine.d.ts +3 -3
  184. package/dist/components/Employee/PaymentMethod/management/paymentMethodStateMachine.js +8 -9
  185. package/dist/components/Employee/PaymentMethod/management/paymentMethodStateMachine.js.map +1 -1
  186. package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethod.js +8 -8
  187. package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethod.js.map +1 -1
  188. package/dist/components/Employee/PaymentMethod/onboarding/paymentMethodStateMachine.d.ts +3 -3
  189. package/dist/components/Employee/PaymentMethod/onboarding/paymentMethodStateMachine.js +6 -7
  190. package/dist/components/Employee/PaymentMethod/onboarding/paymentMethodStateMachine.js.map +1 -1
  191. package/dist/components/Employee/Profile/management/Profile.js +7 -7
  192. package/dist/components/Employee/Profile/management/Profile.js.map +1 -1
  193. package/dist/components/Employee/Profile/management/profileStateMachine.d.ts +2 -2
  194. package/dist/components/Employee/Profile/management/profileStateMachine.js +11 -12
  195. package/dist/components/Employee/Profile/management/profileStateMachine.js.map +1 -1
  196. package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingFlow.js +8 -8
  197. package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingFlow.js.map +1 -1
  198. package/dist/components/Employee/SelfOnboardingFlow/selfOnboardingMachine.d.ts +6 -6
  199. package/dist/components/Employee/SelfOnboardingFlow/selfOnboardingMachine.js +20 -21
  200. package/dist/components/Employee/SelfOnboardingFlow/selfOnboardingMachine.js.map +1 -1
  201. package/dist/components/Employee/StateTaxes/management/StateTaxes.js +7 -7
  202. package/dist/components/Employee/StateTaxes/management/StateTaxes.js.map +1 -1
  203. package/dist/components/Employee/StateTaxes/management/stateTaxesStateMachine.d.ts +2 -2
  204. package/dist/components/Employee/StateTaxes/management/stateTaxesStateMachine.js +3 -4
  205. package/dist/components/Employee/StateTaxes/management/stateTaxesStateMachine.js.map +1 -1
  206. package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlow.js +9 -9
  207. package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlow.js.map +1 -1
  208. package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.d.ts +4 -4
  209. package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.js +6 -7
  210. package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.js.map +1 -1
  211. package/dist/components/Employee/WorkAddress/management/WorkAddress.js +7 -7
  212. package/dist/components/Employee/WorkAddress/management/WorkAddress.js.map +1 -1
  213. package/dist/components/Employee/WorkAddress/management/workAddressStateMachine.d.ts +2 -2
  214. package/dist/components/Employee/WorkAddress/management/workAddressStateMachine.js +1 -2
  215. package/dist/components/Employee/WorkAddress/management/workAddressStateMachine.js.map +1 -1
  216. package/dist/components/Flow/Flow.d.ts +7 -6
  217. package/dist/components/Flow/Flow.js +22 -21
  218. package/dist/components/Flow/Flow.js.map +1 -1
  219. package/dist/components/InformationRequests/InformationRequests.js +19 -19
  220. package/dist/components/InformationRequests/InformationRequests.js.map +1 -1
  221. package/dist/components/InformationRequests/informationRequestsStateMachine.d.ts +3 -3
  222. package/dist/components/InformationRequests/informationRequestsStateMachine.js +9 -10
  223. package/dist/components/InformationRequests/informationRequestsStateMachine.js.map +1 -1
  224. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js +18 -18
  225. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js.map +1 -1
  226. package/dist/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.d.ts +4 -4
  227. package/dist/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.js +3 -4
  228. package/dist/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.js.map +1 -1
  229. package/dist/components/Payroll/Dismissal/DismissalFlow.js +7 -7
  230. package/dist/components/Payroll/Dismissal/DismissalFlow.js.map +1 -1
  231. package/dist/components/Payroll/Dismissal/dismissalStateMachine.d.ts +2 -2
  232. package/dist/components/Payroll/Dismissal/dismissalStateMachine.js +9 -10
  233. package/dist/components/Payroll/Dismissal/dismissalStateMachine.js.map +1 -1
  234. package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +3 -2
  235. package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
  236. package/dist/components/Payroll/OffCycle/OffCycleFlow.js +7 -7
  237. package/dist/components/Payroll/OffCycle/OffCycleFlow.js.map +1 -1
  238. package/dist/components/Payroll/OffCycle/offCycleStateMachine.d.ts +2 -2
  239. package/dist/components/Payroll/OffCycle/offCycleStateMachine.js +14 -15
  240. package/dist/components/Payroll/OffCycle/offCycleStateMachine.js.map +1 -1
  241. package/dist/components/Payroll/PayrollExecutionFlow/PayrollExecutionFlow.js +9 -9
  242. package/dist/components/Payroll/PayrollExecutionFlow/PayrollExecutionFlow.js.map +1 -1
  243. package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.d.ts +5 -5
  244. package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.js +11 -12
  245. package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.js.map +1 -1
  246. package/dist/components/Payroll/PayrollFlow/PayrollFlow.js +10 -10
  247. package/dist/components/Payroll/PayrollFlow/PayrollFlow.js.map +1 -1
  248. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.d.ts +7 -7
  249. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js +14 -15
  250. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js.map +1 -1
  251. package/dist/components/Payroll/PayrollLanding/PayrollLanding.js +7 -7
  252. package/dist/components/Payroll/PayrollLanding/PayrollLanding.js.map +1 -1
  253. package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.d.ts +3 -3
  254. package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.js +12 -13
  255. package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.js.map +1 -1
  256. package/dist/components/Payroll/RecoveryCases/RecoveryCases.js +12 -12
  257. package/dist/components/Payroll/RecoveryCases/RecoveryCases.js.map +1 -1
  258. package/dist/components/Payroll/RecoveryCases/recoveryCasesStateMachine.d.ts +3 -3
  259. package/dist/components/Payroll/RecoveryCases/recoveryCasesStateMachine.js +5 -6
  260. package/dist/components/Payroll/RecoveryCases/recoveryCasesStateMachine.js.map +1 -1
  261. package/dist/components/Payroll/Transition/TransitionFlow.js +7 -7
  262. package/dist/components/Payroll/Transition/TransitionFlow.js.map +1 -1
  263. package/dist/components/Payroll/Transition/transitionStateMachine.d.ts +2 -2
  264. package/dist/components/Payroll/Transition/transitionStateMachine.js +14 -15
  265. package/dist/components/Payroll/Transition/transitionStateMachine.js.map +1 -1
  266. package/dist/components/Payroll/usePreparedPayrollData.js +3 -4
  267. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  268. package/dist/components/TimeOff/TimeOffFlow/TimeOffFlow.js +8 -8
  269. package/dist/components/TimeOff/TimeOffFlow/TimeOffFlow.js.map +1 -1
  270. package/dist/components/TimeOff/TimeOffFlow/timeOffStateMachine.d.ts +14 -14
  271. package/dist/components/TimeOff/TimeOffFlow/timeOffStateMachine.js +4 -5
  272. package/dist/components/TimeOff/TimeOffFlow/timeOffStateMachine.js.map +1 -1
  273. package/dist/shared/constants.js +1 -0
  274. package/dist/shared/constants.js.map +1 -1
  275. package/dist/types/Helpers.d.ts +3 -1
  276. package/package.json +4 -2
  277. package/dist/lib/state-machine/__tests__/core.test.d.ts +0 -1
  278. package/dist/lib/state-machine/core.d.ts +0 -20
  279. package/dist/lib/state-machine/core.js +0 -48
  280. package/dist/lib/state-machine/core.js.map +0 -1
  281. package/dist/lib/state-machine/index.d.ts +0 -5
  282. package/dist/lib/state-machine/index.js +0 -39
  283. package/dist/lib/state-machine/index.js.map +0 -1
  284. package/dist/lib/state-machine/types.d.ts +0 -60
@@ -1 +1 @@
1
- {"version":3,"file":"WorkAddress.js","sources":["../../../../../src/components/Employee/WorkAddress/management/WorkAddress.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport {\n WorkAddressCardContextual,\n type WorkAddressContextInterface,\n} from './WorkAddressComponents'\nimport { workAddressStateMachine } from './workAddressStateMachine'\nimport { createMachine } from '@/lib/state-machine'\nimport { Flow } from '@/components/Flow/Flow'\nimport { BaseBoundaries, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentDictionary } from '@/i18n/I18n'\nimport { useI18n } from '@/i18n'\n\n/**\n * Props for {@link WorkAddress}.\n *\n * @public\n */\nexport interface WorkAddressProps extends BaseComponentInterface<'Employee.Management.WorkAddress'> {\n /** The associated employee identifier. */\n employeeId: string\n}\n\nfunction WorkAddressFlow({ employeeId, onEvent, LoaderComponent }: WorkAddressProps) {\n useI18n('Employee.Management.WorkAddress')\n\n const machine = useMemo(\n () =>\n createMachine('card', workAddressStateMachine, (ctx: WorkAddressContextInterface) => ({\n ...ctx,\n component: WorkAddressCardContextual,\n employeeId,\n LoaderComponent,\n })),\n [employeeId, LoaderComponent],\n )\n\n return <Flow machine={machine} onEvent={onEvent} />\n}\n\n/**\n * Standalone employee work address management flow.\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `employee/management/workAddress/editRequested` | Manage button on the work address card clicked | `{ employeeId: string }` |\n * | `employee/management/workAddress/editCancelled` | User backed out of the edit form | — |\n * | `employee/management/workAddress/created` | A new work address was created | {@link APIModels.EmployeeWorkAddress} |\n * | `employee/management/workAddress/updated` | An existing work address was updated | {@link APIModels.EmployeeWorkAddress} |\n * | `employee/management/workAddress/deleted` | A work address was deleted | {@link APIModels.EmployeeWorkAddress} |\n *\n * @public\n */\nexport function WorkAddress({\n dictionary,\n FallbackComponent,\n LoaderComponent,\n ...props\n}: WorkAddressProps) {\n useComponentDictionary('Employee.Management.WorkAddress', dictionary)\n return (\n <BaseBoundaries\n componentName=\"Employee.Management.WorkAddress\"\n FallbackComponent={FallbackComponent}\n LoaderComponent={LoaderComponent}\n >\n <WorkAddressFlow LoaderComponent={LoaderComponent} {...props} />\n </BaseBoundaries>\n )\n}\n"],"names":["WorkAddressFlow","employeeId","onEvent","LoaderComponent","useI18n","machine","useMemo","createMachine","workAddressStateMachine","ctx","WorkAddressCardContextual","jsx","Flow","WorkAddress","dictionary","FallbackComponent","props","useComponentDictionary","BaseBoundaries"],"mappings":";;;;;;;;;AAsBA,SAASA,EAAgB,EAAE,YAAAC,GAAY,SAAAC,GAAS,iBAAAC,KAAqC;AACnF,EAAAC,EAAQ,iCAAiC;AAEzC,QAAMC,IAAUC;AAAA,IACd,MACEC,EAAc,QAAQC,GAAyB,CAACC,OAAsC;AAAA,MACpF,GAAGA;AAAA,MACH,WAAWC;AAAA,MACX,YAAAT;AAAA,MACA,iBAAAE;AAAA,IAAA,EACA;AAAA,IACJ,CAACF,GAAYE,CAAe;AAAA,EAAA;AAG9B,SAAO,gBAAAQ,EAACC,GAAA,EAAK,SAAAP,GAAkB,SAAAH,EAAA,CAAkB;AACnD;AAgBO,SAASW,EAAY;AAAA,EAC1B,YAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,iBAAAZ;AAAA,EACA,GAAGa;AACL,GAAqB;AACnB,SAAAC,EAAuB,mCAAmCH,CAAU,GAElE,gBAAAH;AAAA,IAACO;AAAA,IAAA;AAAA,MACC,eAAc;AAAA,MACd,mBAAAH;AAAA,MACA,iBAAAZ;AAAA,MAEA,UAAA,gBAAAQ,EAACX,GAAA,EAAgB,iBAAAG,GAAmC,GAAGa,EAAA,CAAO;AAAA,IAAA;AAAA,EAAA;AAGpE;"}
1
+ {"version":3,"file":"WorkAddress.js","sources":["../../../../../src/components/Employee/WorkAddress/management/WorkAddress.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMemo } from 'react'\nimport {\n WorkAddressCardContextual,\n type WorkAddressContextInterface,\n} from './WorkAddressComponents'\nimport { workAddressStateMachine } from './workAddressStateMachine'\nimport { Flow } from '@/components/Flow/Flow'\nimport { BaseBoundaries, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentDictionary } from '@/i18n/I18n'\nimport { useI18n } from '@/i18n'\n\n/**\n * Props for {@link WorkAddress}.\n *\n * @public\n */\nexport interface WorkAddressProps extends BaseComponentInterface<'Employee.Management.WorkAddress'> {\n /** The associated employee identifier. */\n employeeId: string\n}\n\nfunction WorkAddressFlow({ employeeId, onEvent, LoaderComponent }: WorkAddressProps) {\n useI18n('Employee.Management.WorkAddress')\n\n const machine = useMemo(\n () =>\n createMachine('card', workAddressStateMachine, (ctx: WorkAddressContextInterface) => ({\n ...ctx,\n component: WorkAddressCardContextual,\n employeeId,\n LoaderComponent,\n })),\n [employeeId, LoaderComponent],\n )\n\n return <Flow machine={machine} onEvent={onEvent} />\n}\n\n/**\n * Standalone employee work address management flow.\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `employee/management/workAddress/editRequested` | Manage button on the work address card clicked | `{ employeeId: string }` |\n * | `employee/management/workAddress/editCancelled` | User backed out of the edit form | — |\n * | `employee/management/workAddress/created` | A new work address was created | {@link APIModels.EmployeeWorkAddress} |\n * | `employee/management/workAddress/updated` | An existing work address was updated | {@link APIModels.EmployeeWorkAddress} |\n * | `employee/management/workAddress/deleted` | A work address was deleted | {@link APIModels.EmployeeWorkAddress} |\n *\n * @public\n */\nexport function WorkAddress({\n dictionary,\n FallbackComponent,\n LoaderComponent,\n ...props\n}: WorkAddressProps) {\n useComponentDictionary('Employee.Management.WorkAddress', dictionary)\n return (\n <BaseBoundaries\n componentName=\"Employee.Management.WorkAddress\"\n FallbackComponent={FallbackComponent}\n LoaderComponent={LoaderComponent}\n >\n <WorkAddressFlow LoaderComponent={LoaderComponent} {...props} />\n </BaseBoundaries>\n )\n}\n"],"names":["WorkAddressFlow","employeeId","onEvent","LoaderComponent","useI18n","machine","useMemo","createMachine","workAddressStateMachine","ctx","WorkAddressCardContextual","jsx","Flow","WorkAddress","dictionary","FallbackComponent","props","useComponentDictionary","BaseBoundaries"],"mappings":";;;;;;;;;AAsBA,SAASA,EAAgB,EAAE,YAAAC,GAAY,SAAAC,GAAS,iBAAAC,KAAqC;AACnF,EAAAC,EAAQ,iCAAiC;AAEzC,QAAMC,IAAUC;AAAA,IACd,MACEC,EAAc,QAAQC,GAAyB,CAACC,OAAsC;AAAA,MACpF,GAAGA;AAAA,MACH,WAAWC;AAAA,MACX,YAAAT;AAAA,MACA,iBAAAE;AAAA,IAAA,EACA;AAAA,IACJ,CAACF,GAAYE,CAAe;AAAA,EAAA;AAG9B,SAAO,gBAAAQ,EAACC,GAAA,EAAK,SAAAP,GAAkB,SAAAH,EAAA,CAAkB;AACnD;AAgBO,SAASW,EAAY;AAAA,EAC1B,YAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,iBAAAZ;AAAA,EACA,GAAGa;AACL,GAAqB;AACnB,SAAAC,EAAuB,mCAAmCH,CAAU,GAElE,gBAAAH;AAAA,IAACO;AAAA,IAAA;AAAA,MACC,eAAc;AAAA,MACd,mBAAAH;AAAA,MACA,iBAAAZ;AAAA,MAEA,UAAA,gBAAAQ,EAACX,GAAA,EAAgB,iBAAAG,GAAmC,GAAGa,EAAA,CAAO;AAAA,IAAA;AAAA,EAAA;AAGpE;"}
@@ -1,5 +1,5 @@
1
1
  /** @internal */
2
2
  export declare const workAddressStateMachine: {
3
- card: import('../../../../lib/state-machine').StateDefinition;
4
- editWorkAddress: import('../../../../lib/state-machine').StateDefinition;
3
+ card: import('robot3').MachineState<any>;
4
+ editWorkAddress: import('robot3').MachineState<any>;
5
5
  };
@@ -1,6 +1,5 @@
1
+ import { state as o, transition as t, reduce as e } from "robot3";
1
2
  import { WorkAddressEditFormContextual as d, WorkAddressCardContextual as n } from "./WorkAddressComponents.js";
2
- import "react";
3
- import { state as o, transition as t, reduce as e } from "../../../../lib/state-machine/core.js";
4
3
  import { componentEvents as E } from "../../../../shared/constants.js";
5
4
  const s = e((r) => ({
6
5
  ...r,
@@ -1 +1 @@
1
- {"version":3,"file":"workAddressStateMachine.js","sources":["../../../../../src/components/Employee/WorkAddress/management/workAddressStateMachine.ts"],"sourcesContent":["import type { ComponentType } from 'react'\nimport type { WorkAddressContextInterface } from './WorkAddressComponents'\nimport { WorkAddressCardContextual, WorkAddressEditFormContextual } from './WorkAddressComponents'\nimport { reduce, state, transition } from '@/lib/state-machine'\nimport { componentEvents } from '@/shared/constants'\nimport type { MachineTransition } from '@/types/Helpers'\n\nconst returnToCard = reduce((ctx: WorkAddressContextInterface): WorkAddressContextInterface => ({\n ...ctx,\n component: WorkAddressCardContextual as ComponentType,\n}))\n\n/** @internal */\nexport const workAddressStateMachine = {\n card: state<MachineTransition>(\n transition(\n componentEvents.EMPLOYEE_MANAGEMENT_WORK_ADDRESS_EDIT_REQUESTED,\n 'editWorkAddress',\n reduce((ctx: WorkAddressContextInterface): WorkAddressContextInterface => ({\n ...ctx,\n component: WorkAddressEditFormContextual as ComponentType,\n })),\n ),\n ),\n // The edit surface is modal-style: editing/changing/deleting a row closes\n // the modal but keeps the user on the edit screen so they can manage\n // additional rows. Only the explicit Back action returns to the card.\n editWorkAddress: state<MachineTransition>(\n transition(\n componentEvents.EMPLOYEE_MANAGEMENT_WORK_ADDRESS_EDIT_CANCELLED,\n 'card',\n returnToCard,\n ),\n ),\n}\n"],"names":["returnToCard","reduce","ctx","WorkAddressCardContextual","workAddressStateMachine","state","transition","componentEvents","WorkAddressEditFormContextual"],"mappings":";;;;AAOA,MAAMA,IAAeC,EAAO,CAACC,OAAmE;AAAA,EAC9F,GAAGA;AAAA,EACH,WAAWC;AACb,EAAE,GAGWC,IAA0B;AAAA,EACrC,MAAMC;AAAA,IACJC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAN,EAAO,CAACC,OAAmE;AAAA,QACzE,GAAGA;AAAA,QACH,WAAWM;AAAA,MAAA,EACX;AAAA,IAAA;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA,EAKF,iBAAiBH;AAAA,IACfC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAP;AAAA,IAAA;AAAA,EACF;AAEJ;"}
1
+ {"version":3,"file":"workAddressStateMachine.js","sources":["../../../../../src/components/Employee/WorkAddress/management/workAddressStateMachine.ts"],"sourcesContent":["import { reduce, state, transition } from 'robot3'\nimport type { ComponentType } from 'react'\nimport type { WorkAddressContextInterface } from './WorkAddressComponents'\nimport { WorkAddressCardContextual, WorkAddressEditFormContextual } from './WorkAddressComponents'\nimport { componentEvents } from '@/shared/constants'\nimport type { MachineTransition } from '@/types/Helpers'\n\nconst returnToCard = reduce((ctx: WorkAddressContextInterface): WorkAddressContextInterface => ({\n ...ctx,\n component: WorkAddressCardContextual as ComponentType,\n}))\n\n/** @internal */\nexport const workAddressStateMachine = {\n card: state<MachineTransition>(\n transition(\n componentEvents.EMPLOYEE_MANAGEMENT_WORK_ADDRESS_EDIT_REQUESTED,\n 'editWorkAddress',\n reduce((ctx: WorkAddressContextInterface): WorkAddressContextInterface => ({\n ...ctx,\n component: WorkAddressEditFormContextual as ComponentType,\n })),\n ),\n ),\n // The edit surface is modal-style: editing/changing/deleting a row closes\n // the modal but keeps the user on the edit screen so they can manage\n // additional rows. Only the explicit Back action returns to the card.\n editWorkAddress: state<MachineTransition>(\n transition(\n componentEvents.EMPLOYEE_MANAGEMENT_WORK_ADDRESS_EDIT_CANCELLED,\n 'card',\n returnToCard,\n ),\n ),\n}\n"],"names":["returnToCard","reduce","ctx","WorkAddressCardContextual","workAddressStateMachine","state","transition","componentEvents","WorkAddressEditFormContextual"],"mappings":";;;AAOA,MAAMA,IAAeC,EAAO,CAACC,OAAmE;AAAA,EAC9F,GAAGA;AAAA,EACH,WAAWC;AACb,EAAE,GAGWC,IAA0B;AAAA,EACrC,MAAMC;AAAA,IACJC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAN,EAAO,CAACC,OAAmE;AAAA,QACzE,GAAGA;AAAA,QACH,WAAWM;AAAA,MAAA,EACX;AAAA,IAAA;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA,EAKF,iBAAiBH;AAAA,IACfC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAP;AAAA,IAAA;AAAA,EACF;AAEJ;"}
@@ -1,21 +1,22 @@
1
+ import { Machine } from 'robot3';
1
2
  import { OnEventType } from '../Base/useBase';
2
3
  import { FlowContextInterface } from './useFlow';
3
- import { Machine } from '../../lib/state-machine';
4
4
  import { EventType } from '../../shared/constants';
5
5
  type FlowProps<M extends Machine> = {
6
6
  machine: M;
7
7
  onEvent: OnEventType<EventType, unknown>;
8
8
  };
9
9
  /**
10
- * Drives a state machine that orchestrates a multi-step SDK flow, rendering the active
10
+ * Drives a robot3 state machine that orchestrates a multi-step SDK flow, rendering the active
11
11
  * step component inside a {@link FlowContext} provider with optional header chrome above it.
12
12
  *
13
13
  * @remarks
14
- * Re-emits every event to the upstream `onEvent` callback, so the consuming flow component
15
- * (e.g. `PayrollFlow`, `OnboardingFlow`) can forward them to partner code. The set of event
16
- * types is defined by the machine itself rather than a fixed catalogue.
14
+ * Re-emits every event produced by the state machine (or the active child machine, when one is
15
+ * nested) to the upstream `onEvent` callback, so the consuming flow component (e.g. `PayrollFlow`,
16
+ * `OnboardingFlow`) can forward them to partner code. The set of event types is defined by the
17
+ * machine itself rather than a fixed catalogue.
17
18
  *
18
- * @typeParam M - The {@link Machine} type whose context extends {@link FlowContextInterface}.
19
+ * @typeParam M - The robot3 {@link Machine} type whose context extends {@link FlowContextInterface}.
19
20
  * @param props - Component props: the `machine` instance to run and an `onEvent` handler that
20
21
  * receives every event the machine emits.
21
22
  * @returns A React element rendering the machine's current `component` inside the flow context,
@@ -1,41 +1,42 @@
1
- import { jsx as o, jsxs as d } from "react/jsx-runtime";
2
- import { Suspense as p } from "react";
3
- import { FlowContext as s } from "./useFlow.js";
4
- import { FlowHeader as f } from "./FlowHeader.js";
5
- import { useLoadingIndicator as u } from "../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
6
- import { useMachine as h } from "../../lib/state-machine/index.js";
7
- import { Flex as i } from "../Common/Flex/Flex.js";
8
- const x = 40;
9
- function E() {
10
- const { LoadingIndicator: n } = u();
11
- return /* @__PURE__ */ o(n, { height: x });
1
+ import { jsx as o, jsxs as f } from "react/jsx-runtime";
2
+ import { Suspense as u } from "react";
3
+ import { useMachine as h } from "react-robot";
4
+ import { FlowContext as x } from "./useFlow.js";
5
+ import { FlowHeader as F } from "./FlowHeader.js";
6
+ import { useLoadingIndicator as v } from "../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
7
+ import { Flex as s } from "../Common/Flex/Flex.js";
8
+ const E = 40;
9
+ function H() {
10
+ const { LoadingIndicator: n } = v();
11
+ return /* @__PURE__ */ o(n, { height: E });
12
12
  }
13
- const L = ({
13
+ const k = ({
14
14
  onEvent: n,
15
- machine: l
15
+ machine: m
16
16
  }) => {
17
- const [e, m] = h(l, {
17
+ const [e, d, t] = h(m, {
18
18
  onEvent: a,
19
19
  component: null
20
20
  });
21
- function a(t, c) {
22
- m({ type: t, payload: c }), n(t, c);
21
+ function a(c, i) {
22
+ const l = { type: c, payload: i }, p = d;
23
+ t.child ? t.child.send(l) : p(l), n(c, i);
23
24
  }
24
25
  const r = e.context.component;
25
- return /* @__PURE__ */ o(i, { children: /* @__PURE__ */ o(
26
- s.Provider,
26
+ return /* @__PURE__ */ o(s, { children: /* @__PURE__ */ o(
27
+ x.Provider,
27
28
  {
28
29
  value: {
29
30
  ...e.context
30
31
  },
31
- children: /* @__PURE__ */ d(i, { flexDirection: "column", gap: 32, children: [
32
- /* @__PURE__ */ o(p, { fallback: /* @__PURE__ */ o(E, {}), children: /* @__PURE__ */ o(f, {}) }),
32
+ children: /* @__PURE__ */ f(s, { flexDirection: "column", gap: 32, children: [
33
+ /* @__PURE__ */ o(u, { fallback: /* @__PURE__ */ o(H, {}), children: /* @__PURE__ */ o(F, {}) }),
33
34
  r && /* @__PURE__ */ o(r, {})
34
35
  ] })
35
36
  }
36
37
  ) });
37
38
  };
38
39
  export {
39
- L as Flow
40
+ k as Flow
40
41
  };
41
42
  //# sourceMappingURL=Flow.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Flow.js","sources":["../../../src/components/Flow/Flow.tsx"],"sourcesContent":["import { Suspense } from 'react'\nimport type { OnEventType } from '../Base/useBase'\nimport { Flex } from '../Common/Flex'\nimport type { FlowContextInterface } from './useFlow'\nimport { FlowContext } from './useFlow'\nimport { FlowHeader } from './FlowHeader'\nimport { useLoadingIndicator } from '@/contexts/LoadingIndicatorProvider/useLoadingIndicator'\nimport { useMachine, type Machine } from '@/lib/state-machine'\nimport { type EventType } from '@/shared/constants'\n\n/**\n * Header chrome is short (a back-button row is the only header that can suspend),\n * so the header fallback matches its height rather than the full content loader —\n * this keeps the step body at the same level, avoiding a layout shift.\n */\nconst HEADER_LOADER_HEIGHT = 40\n\n/**\n * Fallback for the {@link FlowHeader} Suspense boundary. FlowHeader calls\n * `useTranslation` and renders above the active step's own boundary, so a\n * first-time i18n namespace load during a synchronous transition would otherwise\n * throw React #426. Reuses the SDK loading indicator sized to the header height\n * so the placeholder matches the header chrome and the step body doesn't shift.\n * (Step components manage their own loading via `BaseComponent`/`BaseBoundaries`.)\n */\nfunction FlowHeaderFallback() {\n const { LoadingIndicator } = useLoadingIndicator()\n return <LoadingIndicator height={HEADER_LOADER_HEIGHT} />\n}\n\ntype FlowProps<M extends Machine> = {\n machine: M\n onEvent: OnEventType<EventType, unknown>\n}\n\n/**\n * Drives a state machine that orchestrates a multi-step SDK flow, rendering the active\n * step component inside a {@link FlowContext} provider with optional header chrome above it.\n *\n * @remarks\n * Re-emits every event to the upstream `onEvent` callback, so the consuming flow component\n * (e.g. `PayrollFlow`, `OnboardingFlow`) can forward them to partner code. The set of event\n * types is defined by the machine itself rather than a fixed catalogue.\n *\n * @typeParam M - The {@link Machine} type whose context extends {@link FlowContextInterface}.\n * @param props - Component props: the `machine` instance to run and an `onEvent` handler that\n * receives every event the machine emits.\n * @returns A React element rendering the machine's current `component` inside the flow context,\n * with a {@link FlowHeader} above it.\n * @internal\n */\nexport const Flow = <M extends Machine<object, FlowContextInterface>>({\n onEvent,\n machine,\n}: FlowProps<M>) => {\n const [current, send] = useMachine(machine, {\n onEvent: handleEvent,\n component: null,\n })\n\n function handleEvent(type: EventType, data: unknown): void {\n send({ type, payload: data })\n onEvent(type, data)\n }\n\n const Component = current.context.component\n\n return (\n <Flex>\n <FlowContext.Provider\n value={{\n ...current.context,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n <Suspense fallback={<FlowHeaderFallback />}>\n <FlowHeader />\n </Suspense>\n {Component && <Component />}\n </Flex>\n </FlowContext.Provider>\n </Flex>\n )\n}\n"],"names":["HEADER_LOADER_HEIGHT","FlowHeaderFallback","LoadingIndicator","useLoadingIndicator","jsx","Flow","onEvent","machine","current","send","useMachine","handleEvent","type","data","Component","Flex","FlowContext","jsxs","Suspense","FlowHeader"],"mappings":";;;;;;;AAeA,MAAMA,IAAuB;AAU7B,SAASC,IAAqB;AAC5B,QAAM,EAAE,kBAAAC,EAAA,IAAqBC,EAAA;AAC7B,SAAO,gBAAAC,EAACF,GAAA,EAAiB,QAAQF,EAAA,CAAsB;AACzD;AAuBO,MAAMK,IAAO,CAAkD;AAAA,EACpE,SAAAC;AAAA,EACA,SAAAC;AACF,MAAoB;AAClB,QAAM,CAACC,GAASC,CAAI,IAAIC,EAAWH,GAAS;AAAA,IAC1C,SAASI;AAAA,IACT,WAAW;AAAA,EAAA,CACZ;AAED,WAASA,EAAYC,GAAiBC,GAAqB;AACzD,IAAAJ,EAAK,EAAE,MAAAG,GAAM,SAASC,EAAA,CAAM,GAC5BP,EAAQM,GAAMC,CAAI;AAAA,EACpB;AAEA,QAAMC,IAAYN,EAAQ,QAAQ;AAElC,2BACGO,GAAA,EACC,UAAA,gBAAAX;AAAA,IAACY,EAAY;AAAA,IAAZ;AAAA,MACC,OAAO;AAAA,QACL,GAAGR,EAAQ;AAAA,MAAA;AAAA,MAGb,UAAA,gBAAAS,EAACF,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,QAAA,gBAAAX,EAACc,KAAS,UAAU,gBAAAd,EAACH,KAAmB,GACtC,UAAA,gBAAAG,EAACe,KAAW,EAAA,CACd;AAAA,QACCL,uBAAcA,GAAA,CAAA,CAAU;AAAA,MAAA,EAAA,CAC3B;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
1
+ {"version":3,"file":"Flow.js","sources":["../../../src/components/Flow/Flow.tsx"],"sourcesContent":["import { Suspense } from 'react'\nimport { useMachine } from 'react-robot'\nimport { type Machine, type SendFunction } from 'robot3'\nimport type { OnEventType } from '../Base/useBase'\nimport { Flex } from '../Common/Flex'\nimport type { FlowContextInterface } from './useFlow'\nimport { FlowContext } from './useFlow'\nimport { FlowHeader } from './FlowHeader'\nimport { useLoadingIndicator } from '@/contexts/LoadingIndicatorProvider/useLoadingIndicator'\nimport { type EventType } from '@/shared/constants'\n\n/**\n * Header chrome is short (a back-button row is the only header that can suspend),\n * so the header fallback matches its height rather than the full content loader —\n * this keeps the step body at the same level, avoiding a layout shift.\n */\nconst HEADER_LOADER_HEIGHT = 40\n\n/**\n * Fallback for the {@link FlowHeader} Suspense boundary. FlowHeader calls\n * `useTranslation` and renders above the active step's own boundary, so a\n * first-time i18n namespace load during a synchronous transition would otherwise\n * throw React #426. Reuses the SDK loading indicator sized to the header height\n * so the placeholder matches the header chrome and the step body doesn't shift.\n * (Step components manage their own loading via `BaseComponent`/`BaseBoundaries`.)\n */\nfunction FlowHeaderFallback() {\n const { LoadingIndicator } = useLoadingIndicator()\n return <LoadingIndicator height={HEADER_LOADER_HEIGHT} />\n}\n\ntype FlowProps<M extends Machine> = {\n machine: M\n onEvent: OnEventType<EventType, unknown>\n}\n\n/**\n * Drives a robot3 state machine that orchestrates a multi-step SDK flow, rendering the active\n * step component inside a {@link FlowContext} provider with optional header chrome above it.\n *\n * @remarks\n * Re-emits every event produced by the state machine (or the active child machine, when one is\n * nested) to the upstream `onEvent` callback, so the consuming flow component (e.g. `PayrollFlow`,\n * `OnboardingFlow`) can forward them to partner code. The set of event types is defined by the\n * machine itself rather than a fixed catalogue.\n *\n * @typeParam M - The robot3 {@link Machine} type whose context extends {@link FlowContextInterface}.\n * @param props - Component props: the `machine` instance to run and an `onEvent` handler that\n * receives every event the machine emits.\n * @returns A React element rendering the machine's current `component` inside the flow context,\n * with a {@link FlowHeader} above it.\n * @internal\n */\nexport const Flow = <M extends Machine<object, FlowContextInterface>>({\n onEvent,\n machine,\n}: FlowProps<M>) => {\n const [current, send, service] = useMachine(machine, {\n onEvent: handleEvent,\n component: null,\n })\n\n function handleEvent(type: EventType, data: unknown): void {\n const event = { type, payload: data }\n const sendFn = send as SendFunction<string>\n //When dealing with nested state machine, correct machine needs to recieve an event\n if (service.child) {\n ;(service.child.send as SendFunction<string>)(event)\n } else {\n sendFn(event)\n }\n // Pass event upstream - onEvent can be optional on Flow component\n onEvent(type, data)\n }\n\n const Component = current.context.component\n\n return (\n <Flex>\n <FlowContext.Provider\n value={{\n ...current.context,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n <Suspense fallback={<FlowHeaderFallback />}>\n <FlowHeader />\n </Suspense>\n {Component && <Component />}\n </Flex>\n </FlowContext.Provider>\n </Flex>\n )\n}\n"],"names":["HEADER_LOADER_HEIGHT","FlowHeaderFallback","LoadingIndicator","useLoadingIndicator","jsx","Flow","onEvent","machine","current","send","service","useMachine","handleEvent","type","data","event","sendFn","Component","Flex","FlowContext","jsxs","Suspense","FlowHeader"],"mappings":";;;;;;;AAgBA,MAAMA,IAAuB;AAU7B,SAASC,IAAqB;AAC5B,QAAM,EAAE,kBAAAC,EAAA,IAAqBC,EAAA;AAC7B,SAAO,gBAAAC,EAACF,GAAA,EAAiB,QAAQF,EAAA,CAAsB;AACzD;AAwBO,MAAMK,IAAO,CAAkD;AAAA,EACpE,SAAAC;AAAA,EACA,SAAAC;AACF,MAAoB;AAClB,QAAM,CAACC,GAASC,GAAMC,CAAO,IAAIC,EAAWJ,GAAS;AAAA,IACnD,SAASK;AAAA,IACT,WAAW;AAAA,EAAA,CACZ;AAED,WAASA,EAAYC,GAAiBC,GAAqB;AACzD,UAAMC,IAAQ,EAAE,MAAAF,GAAM,SAASC,EAAA,GACzBE,IAASP;AAEf,IAAIC,EAAQ,QACRA,EAAQ,MAAM,KAA8BK,CAAK,IAEnDC,EAAOD,CAAK,GAGdT,EAAQO,GAAMC,CAAI;AAAA,EACpB;AAEA,QAAMG,IAAYT,EAAQ,QAAQ;AAElC,2BACGU,GAAA,EACC,UAAA,gBAAAd;AAAA,IAACe,EAAY;AAAA,IAAZ;AAAA,MACC,OAAO;AAAA,QACL,GAAGX,EAAQ;AAAA,MAAA;AAAA,MAGb,UAAA,gBAAAY,EAACF,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,QAAA,gBAAAd,EAACiB,KAAS,UAAU,gBAAAjB,EAACH,KAAmB,GACtC,UAAA,gBAAAG,EAACkB,KAAW,EAAA,CACd;AAAA,QACCL,uBAAcA,GAAA,CAAA,CAAU;AAAA,MAAA,EAAA,CAC3B;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
@@ -1,16 +1,16 @@
1
1
  import { jsx as t, jsxs as b } from "react/jsx-runtime";
2
- import { useState as E, useCallback as p, useMemo as Q, Suspense as I } from "react";
3
- import { useTranslation as U } from "react-i18next";
4
- import { informationRequestsMachine as k } from "./informationRequestsStateMachine.js";
5
- import { useMachine as P } from "../../lib/state-machine/index.js";
6
- import { BaseBoundaries as g } from "../Base/Base.js";
2
+ import { createMachine as Q } from "robot3";
3
+ import { useMachine as U } from "react-robot";
4
+ import { useState as E, useCallback as p, useMemo as k, Suspense as I } from "react";
5
+ import { useTranslation as P } from "react-i18next";
6
+ import { informationRequestsMachine as g } from "./informationRequestsStateMachine.js";
7
+ import { BaseBoundaries as j } from "../Base/Base.js";
7
8
  import "../Base/useBase.js";
8
- import { Flex as j } from "../Common/Flex/Flex.js";
9
- import { useComponentContext as B } from "../../contexts/ComponentAdapter/useComponentContext.js";
10
- import { FlowContext as L } from "../Flow/useFlow.js";
11
- import { useComponentDictionary as $, useI18n as w } from "../../i18n/I18n.js";
9
+ import { Flex as B } from "../Common/Flex/Flex.js";
10
+ import { useComponentContext as L } from "../../contexts/ComponentAdapter/useComponentContext.js";
11
+ import { FlowContext as $ } from "../Flow/useFlow.js";
12
+ import { useComponentDictionary as w, useI18n as z } from "../../i18n/I18n.js";
12
13
  import { informationRequestEvents as s } from "../../shared/constants.js";
13
- import { createMachine as z } from "../../lib/state-machine/core.js";
14
14
  import { InformationRequestList as Y } from "./InformationRequestList/InformationRequestList.js";
15
15
  const O = "informationRequestResponded";
16
16
  function re({
@@ -21,8 +21,8 @@ function re({
21
21
  },
22
22
  LoaderComponent: i
23
23
  }) {
24
- $("InformationRequests", M), w("InformationRequests");
25
- const { t: c } = U("InformationRequests"), { Modal: x, LoadingSpinner: f, Alert: A, Text: F } = B(), [N, l] = E(!1), [T, u] = E({
24
+ w("InformationRequests", M), z("InformationRequests");
25
+ const { t: c } = P("InformationRequests"), { Modal: x, LoadingSpinner: f, Alert: A, Text: F } = L(), [N, l] = E(!1), [T, u] = E({
26
26
  nextAlertId: 0,
27
27
  alerts: []
28
28
  }), _ = p((e) => {
@@ -35,10 +35,10 @@ function re({
35
35
  nextAlertId: e.nextAlertId + 1,
36
36
  alerts: [{ id: e.nextAlertId }, ...e.alerts]
37
37
  }));
38
- }, []), q = Q(
39
- () => z(
38
+ }, []), q = k(
39
+ () => Q(
40
40
  "list",
41
- k,
41
+ g,
42
42
  () => ({
43
43
  component: null,
44
44
  companyId: r,
@@ -47,7 +47,7 @@ function re({
47
47
  })
48
48
  ),
49
49
  [r, i]
50
- ), [d, C] = P(q);
50
+ ), [d, C] = U(q);
51
51
  function n(e, o) {
52
52
  C({ type: e, payload: o }), e === s.INFORMATION_REQUEST_RESPOND && l(!0), (e === s.INFORMATION_REQUEST_FORM_CANCEL || e === s.INFORMATION_REQUEST_FORM_DONE) && l(!1), e === s.INFORMATION_REQUEST_FORM_DONE && m && S(), h(e, o);
53
53
  }
@@ -55,13 +55,13 @@ function re({
55
55
  l(!1);
56
56
  }, a = d.context.component, R = a?.Footer || void 0;
57
57
  return /* @__PURE__ */ t(
58
- L.Provider,
58
+ $.Provider,
59
59
  {
60
60
  value: {
61
61
  ...d.context,
62
62
  onEvent: n
63
63
  },
64
- children: /* @__PURE__ */ b(j, { flexDirection: "column", gap: 32, children: [
64
+ children: /* @__PURE__ */ b(B, { flexDirection: "column", gap: 32, children: [
65
65
  m && T.alerts.map((e) => /* @__PURE__ */ t(
66
66
  A,
67
67
  {
@@ -80,7 +80,7 @@ function re({
80
80
  {
81
81
  isOpen: N,
82
82
  onClose: D,
83
- footer: R && /* @__PURE__ */ t(g, { LoaderComponent: i, children: /* @__PURE__ */ t(I, { fallback: /* @__PURE__ */ t(f, { size: "sm" }), children: /* @__PURE__ */ t(R, { onEvent: n }) }) }),
83
+ footer: R && /* @__PURE__ */ t(j, { LoaderComponent: i, children: /* @__PURE__ */ t(I, { fallback: /* @__PURE__ */ t(f, { size: "sm" }), children: /* @__PURE__ */ t(R, { onEvent: n }) }) }),
84
84
  children: a && /* @__PURE__ */ t(a, {})
85
85
  }
86
86
  )
@@ -1 +1 @@
1
- {"version":3,"file":"InformationRequests.js","sources":["../../../src/components/InformationRequests/InformationRequests.tsx"],"sourcesContent":["import { Suspense, useCallback, useMemo, useState } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { InformationRequestList } from './InformationRequestList'\nimport { informationRequestsMachine } from './informationRequestsStateMachine'\nimport { type InformationRequestsContextInterface } from './InformationRequestsComponents'\nimport { createMachine, useMachine } from '@/lib/state-machine'\nimport { BaseBoundaries, type BaseComponentInterface } from '@/components/Base'\nimport { Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { FlowContext } from '@/components/Flow/useFlow'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { informationRequestEvents, type EventType } from '@/shared/constants'\n\ninterface SubmissionAlert {\n id: number\n}\n\ninterface SubmissionAlertState {\n nextAlertId: number\n alerts: SubmissionAlert[]\n}\n\n/**\n * Props for {@link InformationRequestsFlow}.\n *\n * @public\n */\nexport interface InformationRequestsFlowProps extends Omit<\n BaseComponentInterface<'InformationRequests'>,\n 'onEvent'\n> {\n /** The associated company identifier. */\n companyId: string\n /**\n * When `true` (default), the submission success alert is rendered at the top of this component.\n * Set to `false` when embedding in a parent that renders the alert elsewhere.\n */\n withAlert?: boolean\n /** Callback invoked when the flow or its blocks emit an event. */\n onEvent?: BaseComponentInterface['onEvent']\n}\n\nconst ALERT_TYPE = 'informationRequestResponded' as const\n\n/**\n * Hub for viewing and responding to outstanding information requests from Gusto.\n *\n * @remarks\n * Renders the list of open and submitted information requests for a company and hosts the response form in a modal.\n * On successful submit, a dismissible success alert appears at the top of the list (when `withAlert` is `true`) and the modal closes.\n *\n * Information requests can also block payroll processing; in that case they are surfaced inline within\n * `Payroll.PayrollBlockerList`, which embeds this flow with `withAlert={false}` so the blocker list owns the alert UX.\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `informationRequest/respond` | Fired when the user clicks \"Respond\" on a request and the form modal opens | `{ requestId: string }` |\n * | `informationRequest/form/done` | Fired when an information request is successfully submitted | Response from the Submit information request endpoint |\n * | `informationRequest/form/cancel` | Fired when the user cancels the response form (closes the modal without submitting) | — |\n *\n * Each piece is also exported as a standalone block (see the Blocks\n * table) for composing a custom workflow when this orchestration is the wrong\n * fit. See the\n * {@link https://sdk.gusto.com/docs/guides/integration-guide/composition | Composition guide}\n * for how to recompose these blocks into your own flow.\n *\n * @components\n * - {@link InformationRequestList}\n * - {@link InformationRequestForm}\n *\n * @param props - See {@link InformationRequestsFlowProps}.\n * @returns The information requests flow surface.\n * @public\n *\n * @example\n * ```tsx title=\"App.tsx\"\n * import { InformationRequests } from '@gusto/embedded-react-sdk'\n *\n * function MyApp() {\n * return (\n * <InformationRequests.InformationRequestsFlow\n * companyId=\"a007e1ab-3595-43c2-ab4b-af7a5af2e365\"\n * onEvent={() => {}}\n * />\n * )\n * }\n * ```\n */\nexport function InformationRequestsFlow({\n companyId,\n dictionary,\n withAlert = true,\n onEvent = () => {},\n LoaderComponent,\n}: InformationRequestsFlowProps) {\n useComponentDictionary('InformationRequests', dictionary)\n useI18n('InformationRequests')\n const { t } = useTranslation('InformationRequests')\n const { Modal, LoadingSpinner, Alert, Text } = useComponentContext()\n const [isModalOpen, setIsModalOpen] = useState(false)\n const [alertState, setAlertState] = useState<SubmissionAlertState>({\n nextAlertId: 0,\n alerts: [],\n })\n\n const handleDismissAlert = useCallback((alertId: number) => {\n setAlertState(prev => ({\n ...prev,\n alerts: prev.alerts.filter(alert => alert.id !== alertId),\n }))\n }, [])\n\n const addSubmissionAlert = useCallback(() => {\n setAlertState(prev => ({\n nextAlertId: prev.nextAlertId + 1,\n alerts: [{ id: prev.nextAlertId }, ...prev.alerts],\n }))\n }, [])\n\n const informationRequestsMachineInstance = useMemo(\n () =>\n createMachine(\n 'list',\n informationRequestsMachine,\n (): InformationRequestsContextInterface => ({\n component: null,\n companyId,\n onEvent: handleEvent,\n LoaderComponent,\n }),\n ),\n [companyId, LoaderComponent],\n )\n const [current, send] = useMachine(informationRequestsMachineInstance)\n\n function handleEvent(type: EventType, data?: unknown) {\n send({ type, payload: data })\n\n if (type === informationRequestEvents.INFORMATION_REQUEST_RESPOND) {\n setIsModalOpen(true)\n }\n\n if (\n type === informationRequestEvents.INFORMATION_REQUEST_FORM_CANCEL ||\n type === informationRequestEvents.INFORMATION_REQUEST_FORM_DONE\n ) {\n setIsModalOpen(false)\n }\n\n if (type === informationRequestEvents.INFORMATION_REQUEST_FORM_DONE && withAlert) {\n addSubmissionAlert()\n }\n\n onEvent(type, data)\n }\n\n const handleCloseModal = () => {\n setIsModalOpen(false)\n }\n\n const CurrentComponent = current.context.component\n const Footer = CurrentComponent?.Footer || undefined\n\n return (\n <FlowContext.Provider\n value={{\n ...current.context,\n onEvent: handleEvent,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {withAlert &&\n alertState.alerts.map(alert => (\n <Alert\n key={alert.id}\n status=\"success\"\n label={t(`alerts.${ALERT_TYPE}.title`)}\n onDismiss={() => {\n handleDismissAlert(alert.id)\n }}\n >\n <Text>{t(`alerts.${ALERT_TYPE}.description`)}</Text>\n </Alert>\n ))}\n\n <Suspense fallback={<LoadingSpinner />}>\n <InformationRequestList companyId={companyId} onEvent={handleEvent} />\n </Suspense>\n <Modal\n isOpen={isModalOpen}\n onClose={handleCloseModal}\n footer={\n Footer && (\n <BaseBoundaries LoaderComponent={LoaderComponent}>\n <Suspense fallback={<LoadingSpinner size=\"sm\" />}>\n <Footer onEvent={handleEvent} />\n </Suspense>\n </BaseBoundaries>\n )\n }\n >\n {CurrentComponent && <CurrentComponent />}\n </Modal>\n </Flex>\n </FlowContext.Provider>\n )\n}\n"],"names":["ALERT_TYPE","InformationRequestsFlow","companyId","dictionary","withAlert","onEvent","LoaderComponent","useComponentDictionary","useI18n","t","useTranslation","Modal","LoadingSpinner","Alert","Text","useComponentContext","isModalOpen","setIsModalOpen","useState","alertState","setAlertState","handleDismissAlert","useCallback","alertId","prev","alert","addSubmissionAlert","informationRequestsMachineInstance","useMemo","createMachine","informationRequestsMachine","handleEvent","current","send","useMachine","type","data","informationRequestEvents","handleCloseModal","CurrentComponent","Footer","jsx","FlowContext","jsxs","Flex","Suspense","InformationRequestList","BaseBoundaries"],"mappings":"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"}
1
+ {"version":3,"file":"InformationRequests.js","sources":["../../../src/components/InformationRequests/InformationRequests.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMachine } from 'react-robot'\nimport { Suspense, useCallback, useMemo, useState } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { InformationRequestList } from './InformationRequestList'\nimport { informationRequestsMachine } from './informationRequestsStateMachine'\nimport { type InformationRequestsContextInterface } from './InformationRequestsComponents'\nimport { BaseBoundaries, type BaseComponentInterface } from '@/components/Base'\nimport { Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { FlowContext } from '@/components/Flow/useFlow'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { informationRequestEvents, type EventType } from '@/shared/constants'\n\ninterface SubmissionAlert {\n id: number\n}\n\ninterface SubmissionAlertState {\n nextAlertId: number\n alerts: SubmissionAlert[]\n}\n\n/**\n * Props for {@link InformationRequestsFlow}.\n *\n * @public\n */\nexport interface InformationRequestsFlowProps extends Omit<\n BaseComponentInterface<'InformationRequests'>,\n 'onEvent'\n> {\n /** The associated company identifier. */\n companyId: string\n /**\n * When `true` (default), the submission success alert is rendered at the top of this component.\n * Set to `false` when embedding in a parent that renders the alert elsewhere.\n */\n withAlert?: boolean\n /** Callback invoked when the flow or its blocks emit an event. */\n onEvent?: BaseComponentInterface['onEvent']\n}\n\nconst ALERT_TYPE = 'informationRequestResponded' as const\n\n/**\n * Hub for viewing and responding to outstanding information requests from Gusto.\n *\n * @remarks\n * Renders the list of open and submitted information requests for a company and hosts the response form in a modal.\n * On successful submit, a dismissible success alert appears at the top of the list (when `withAlert` is `true`) and the modal closes.\n *\n * Information requests can also block payroll processing; in that case they are surfaced inline within\n * `Payroll.PayrollBlockerList`, which embeds this flow with `withAlert={false}` so the blocker list owns the alert UX.\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `informationRequest/respond` | Fired when the user clicks \"Respond\" on a request and the form modal opens | `{ requestId: string }` |\n * | `informationRequest/form/done` | Fired when an information request is successfully submitted | Response from the Submit information request endpoint |\n * | `informationRequest/form/cancel` | Fired when the user cancels the response form (closes the modal without submitting) | — |\n *\n * Each piece is also exported as a standalone block (see the Blocks\n * table) for composing a custom workflow when this orchestration is the wrong\n * fit. See the\n * {@link https://sdk.gusto.com/docs/guides/integration-guide/composition | Composition guide}\n * for how to recompose these blocks into your own flow.\n *\n * @components\n * - {@link InformationRequestList}\n * - {@link InformationRequestForm}\n *\n * @param props - See {@link InformationRequestsFlowProps}.\n * @returns The information requests flow surface.\n * @public\n *\n * @example\n * ```tsx title=\"App.tsx\"\n * import { InformationRequests } from '@gusto/embedded-react-sdk'\n *\n * function MyApp() {\n * return (\n * <InformationRequests.InformationRequestsFlow\n * companyId=\"a007e1ab-3595-43c2-ab4b-af7a5af2e365\"\n * onEvent={() => {}}\n * />\n * )\n * }\n * ```\n */\nexport function InformationRequestsFlow({\n companyId,\n dictionary,\n withAlert = true,\n onEvent = () => {},\n LoaderComponent,\n}: InformationRequestsFlowProps) {\n useComponentDictionary('InformationRequests', dictionary)\n useI18n('InformationRequests')\n const { t } = useTranslation('InformationRequests')\n const { Modal, LoadingSpinner, Alert, Text } = useComponentContext()\n const [isModalOpen, setIsModalOpen] = useState(false)\n const [alertState, setAlertState] = useState<SubmissionAlertState>({\n nextAlertId: 0,\n alerts: [],\n })\n\n const handleDismissAlert = useCallback((alertId: number) => {\n setAlertState(prev => ({\n ...prev,\n alerts: prev.alerts.filter(alert => alert.id !== alertId),\n }))\n }, [])\n\n const addSubmissionAlert = useCallback(() => {\n setAlertState(prev => ({\n nextAlertId: prev.nextAlertId + 1,\n alerts: [{ id: prev.nextAlertId }, ...prev.alerts],\n }))\n }, [])\n\n const informationRequestsMachineInstance = useMemo(\n () =>\n createMachine(\n 'list',\n informationRequestsMachine,\n (): InformationRequestsContextInterface => ({\n component: null,\n companyId,\n onEvent: handleEvent,\n LoaderComponent,\n }),\n ),\n [companyId, LoaderComponent],\n )\n const [current, send] = useMachine(informationRequestsMachineInstance)\n\n function handleEvent(type: EventType, data?: unknown) {\n send({ type, payload: data })\n\n if (type === informationRequestEvents.INFORMATION_REQUEST_RESPOND) {\n setIsModalOpen(true)\n }\n\n if (\n type === informationRequestEvents.INFORMATION_REQUEST_FORM_CANCEL ||\n type === informationRequestEvents.INFORMATION_REQUEST_FORM_DONE\n ) {\n setIsModalOpen(false)\n }\n\n if (type === informationRequestEvents.INFORMATION_REQUEST_FORM_DONE && withAlert) {\n addSubmissionAlert()\n }\n\n onEvent(type, data)\n }\n\n const handleCloseModal = () => {\n setIsModalOpen(false)\n }\n\n const CurrentComponent = current.context.component\n const Footer = CurrentComponent?.Footer || undefined\n\n return (\n <FlowContext.Provider\n value={{\n ...current.context,\n onEvent: handleEvent,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {withAlert &&\n alertState.alerts.map(alert => (\n <Alert\n key={alert.id}\n status=\"success\"\n label={t(`alerts.${ALERT_TYPE}.title`)}\n onDismiss={() => {\n handleDismissAlert(alert.id)\n }}\n >\n <Text>{t(`alerts.${ALERT_TYPE}.description`)}</Text>\n </Alert>\n ))}\n\n <Suspense fallback={<LoadingSpinner />}>\n <InformationRequestList companyId={companyId} onEvent={handleEvent} />\n </Suspense>\n <Modal\n isOpen={isModalOpen}\n onClose={handleCloseModal}\n footer={\n Footer && (\n <BaseBoundaries LoaderComponent={LoaderComponent}>\n <Suspense fallback={<LoadingSpinner size=\"sm\" />}>\n <Footer onEvent={handleEvent} />\n </Suspense>\n </BaseBoundaries>\n )\n }\n >\n {CurrentComponent && <CurrentComponent />}\n </Modal>\n </Flex>\n </FlowContext.Provider>\n )\n}\n"],"names":["ALERT_TYPE","InformationRequestsFlow","companyId","dictionary","withAlert","onEvent","LoaderComponent","useComponentDictionary","useI18n","t","useTranslation","Modal","LoadingSpinner","Alert","Text","useComponentContext","isModalOpen","setIsModalOpen","useState","alertState","setAlertState","handleDismissAlert","useCallback","alertId","prev","alert","addSubmissionAlert","informationRequestsMachineInstance","useMemo","createMachine","informationRequestsMachine","handleEvent","current","send","useMachine","type","data","informationRequestEvents","handleCloseModal","CurrentComponent","Footer","jsx","FlowContext","jsxs","Flex","Suspense","InformationRequestList","BaseBoundaries"],"mappings":"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"}
@@ -9,7 +9,7 @@ export type EventPayloads = {
9
9
  };
10
10
  /** @internal */
11
11
  export declare const informationRequestsMachine: {
12
- list: import('../../lib/state-machine').StateDefinition;
13
- form: import('../../lib/state-machine').StateDefinition;
14
- final: import('../../lib/state-machine').StateDefinition;
12
+ list: import('robot3').MachineState<any>;
13
+ form: import('robot3').MachineState<any>;
14
+ final: import('robot3').MachineState<any>;
15
15
  };
@@ -1,24 +1,23 @@
1
+ import { state as t, transition as o, reduce as n } from "robot3";
1
2
  import { InformationRequestFormContextual as r } from "./InformationRequestsComponents.js";
2
- import "react";
3
- import { state as t, transition as o, reduce as n } from "../../lib/state-machine/core.js";
4
- import { informationRequestEvents as i } from "../../shared/constants.js";
5
- const u = {
3
+ import { informationRequestEvents as s } from "../../shared/constants.js";
4
+ const d = {
6
5
  list: t(
7
6
  o(
8
- i.INFORMATION_REQUEST_RESPOND,
7
+ s.INFORMATION_REQUEST_RESPOND,
9
8
  "form",
10
9
  n(
11
- (e, s) => ({
10
+ (e, i) => ({
12
11
  ...e,
13
12
  component: r,
14
- selectedRequestId: s.payload.requestId
13
+ selectedRequestId: i.payload.requestId
15
14
  })
16
15
  )
17
16
  )
18
17
  ),
19
18
  form: t(
20
19
  o(
21
- i.INFORMATION_REQUEST_FORM_DONE,
20
+ s.INFORMATION_REQUEST_FORM_DONE,
22
21
  "list",
23
22
  n((e) => ({
24
23
  ...e,
@@ -27,7 +26,7 @@ const u = {
27
26
  }))
28
27
  ),
29
28
  o(
30
- i.INFORMATION_REQUEST_FORM_CANCEL,
29
+ s.INFORMATION_REQUEST_FORM_CANCEL,
31
30
  "list",
32
31
  n((e) => ({
33
32
  ...e,
@@ -39,6 +38,6 @@ const u = {
39
38
  final: t()
40
39
  };
41
40
  export {
42
- u as informationRequestsMachine
41
+ d as informationRequestsMachine
43
42
  };
44
43
  //# sourceMappingURL=informationRequestsStateMachine.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"informationRequestsStateMachine.js","sources":["../../../src/components/InformationRequests/informationRequestsStateMachine.tsx"],"sourcesContent":["import type { InformationRequestsContextInterface } from './InformationRequestsComponents'\nimport { InformationRequestFormContextual } from './InformationRequestsComponents'\nimport { state, transition, reduce } from '@/lib/state-machine'\nimport { informationRequestEvents } from '@/shared/constants'\nimport type { MachineEventType, MachineTransition } from '@/types/Helpers'\n\n/** @internal */\nexport type EventPayloads = {\n [informationRequestEvents.INFORMATION_REQUEST_RESPOND]: {\n requestId: string\n }\n [informationRequestEvents.INFORMATION_REQUEST_FORM_CANCEL]: undefined\n [informationRequestEvents.INFORMATION_REQUEST_FORM_DONE]: undefined\n}\n\n/** @internal */\nexport const informationRequestsMachine = {\n list: state<MachineTransition>(\n transition(\n informationRequestEvents.INFORMATION_REQUEST_RESPOND,\n 'form',\n reduce(\n (\n ctx: InformationRequestsContextInterface,\n ev: MachineEventType<\n EventPayloads,\n typeof informationRequestEvents.INFORMATION_REQUEST_RESPOND\n >,\n ): InformationRequestsContextInterface => ({\n ...ctx,\n component: InformationRequestFormContextual,\n selectedRequestId: ev.payload.requestId,\n }),\n ),\n ),\n ),\n form: state<MachineTransition>(\n transition(\n informationRequestEvents.INFORMATION_REQUEST_FORM_DONE,\n 'list',\n reduce((ctx: InformationRequestsContextInterface): InformationRequestsContextInterface => ({\n ...ctx,\n component: null,\n selectedRequestId: undefined,\n })),\n ),\n transition(\n informationRequestEvents.INFORMATION_REQUEST_FORM_CANCEL,\n 'list',\n reduce((ctx: InformationRequestsContextInterface): InformationRequestsContextInterface => ({\n ...ctx,\n component: null,\n selectedRequestId: undefined,\n })),\n ),\n ),\n final: state<MachineTransition>(),\n}\n"],"names":["informationRequestsMachine","state","transition","informationRequestEvents","reduce","ctx","ev","InformationRequestFormContextual"],"mappings":";;;;AAgBO,MAAMA,IAA6B;AAAA,EACxC,MAAMC;AAAA,IACJC;AAAA,MACEC,EAAyB;AAAA,MACzB;AAAA,MACAC;AAAA,QACE,CACEC,GACAC,OAIyC;AAAA,UACzC,GAAGD;AAAA,UACH,WAAWE;AAAA,UACX,mBAAmBD,EAAG,QAAQ;AAAA,QAAA;AAAA,MAChC;AAAA,IACF;AAAA,EACF;AAAA,EAEF,MAAML;AAAA,IACJC;AAAA,MACEC,EAAyB;AAAA,MACzB;AAAA,MACAC,EAAO,CAACC,OAAmF;AAAA,QACzF,GAAGA;AAAA,QACH,WAAW;AAAA,QACX,mBAAmB;AAAA,MAAA,EACnB;AAAA,IAAA;AAAA,IAEJH;AAAA,MACEC,EAAyB;AAAA,MACzB;AAAA,MACAC,EAAO,CAACC,OAAmF;AAAA,QACzF,GAAGA;AAAA,QACH,WAAW;AAAA,QACX,mBAAmB;AAAA,MAAA,EACnB;AAAA,IAAA;AAAA,EACJ;AAAA,EAEF,OAAOJ,EAAA;AACT;"}
1
+ {"version":3,"file":"informationRequestsStateMachine.js","sources":["../../../src/components/InformationRequests/informationRequestsStateMachine.tsx"],"sourcesContent":["import { state, transition, reduce } from 'robot3'\nimport type { InformationRequestsContextInterface } from './InformationRequestsComponents'\nimport { InformationRequestFormContextual } from './InformationRequestsComponents'\nimport { informationRequestEvents } from '@/shared/constants'\nimport type { MachineEventType, MachineTransition } from '@/types/Helpers'\n\n/** @internal */\nexport type EventPayloads = {\n [informationRequestEvents.INFORMATION_REQUEST_RESPOND]: {\n requestId: string\n }\n [informationRequestEvents.INFORMATION_REQUEST_FORM_CANCEL]: undefined\n [informationRequestEvents.INFORMATION_REQUEST_FORM_DONE]: undefined\n}\n\n/** @internal */\nexport const informationRequestsMachine = {\n list: state<MachineTransition>(\n transition(\n informationRequestEvents.INFORMATION_REQUEST_RESPOND,\n 'form',\n reduce(\n (\n ctx: InformationRequestsContextInterface,\n ev: MachineEventType<\n EventPayloads,\n typeof informationRequestEvents.INFORMATION_REQUEST_RESPOND\n >,\n ): InformationRequestsContextInterface => ({\n ...ctx,\n component: InformationRequestFormContextual,\n selectedRequestId: ev.payload.requestId,\n }),\n ),\n ),\n ),\n form: state<MachineTransition>(\n transition(\n informationRequestEvents.INFORMATION_REQUEST_FORM_DONE,\n 'list',\n reduce((ctx: InformationRequestsContextInterface): InformationRequestsContextInterface => ({\n ...ctx,\n component: null,\n selectedRequestId: undefined,\n })),\n ),\n transition(\n informationRequestEvents.INFORMATION_REQUEST_FORM_CANCEL,\n 'list',\n reduce((ctx: InformationRequestsContextInterface): InformationRequestsContextInterface => ({\n ...ctx,\n component: null,\n selectedRequestId: undefined,\n })),\n ),\n ),\n final: state<MachineTransition>(),\n}\n"],"names":["informationRequestsMachine","state","transition","informationRequestEvents","reduce","ctx","ev","InformationRequestFormContextual"],"mappings":";;;AAgBO,MAAMA,IAA6B;AAAA,EACxC,MAAMC;AAAA,IACJC;AAAA,MACEC,EAAyB;AAAA,MACzB;AAAA,MACAC;AAAA,QACE,CACEC,GACAC,OAIyC;AAAA,UACzC,GAAGD;AAAA,UACH,WAAWE;AAAA,UACX,mBAAmBD,EAAG,QAAQ;AAAA,QAAA;AAAA,MAChC;AAAA,IACF;AAAA,EACF;AAAA,EAEF,MAAML;AAAA,IACJC;AAAA,MACEC,EAAyB;AAAA,MACzB;AAAA,MACAC,EAAO,CAACC,OAAmF;AAAA,QACzF,GAAGA;AAAA,QACH,WAAW;AAAA,QACX,mBAAmB;AAAA,MAAA,EACnB;AAAA,IAAA;AAAA,IAEJH;AAAA,MACEC,EAAyB;AAAA,MACzB;AAAA,MACAC,EAAO,CAACC,OAAmF;AAAA,QACzF,GAAGA;AAAA,QACH,WAAW;AAAA,QACX,mBAAmB;AAAA,MAAA,EACnB;AAAA,IAAA;AAAA,EACJ;AAAA,EAEF,OAAOJ,EAAA;AACT;"}
@@ -1,28 +1,28 @@
1
1
  import { jsx as e, jsxs as S } from "react/jsx-runtime";
2
- import { useState as M, useRef as T, useMemo as d, Suspense as v } from "react";
3
- import { useWireInRequestsListSuspense as x } from "@gusto/embedded-api/react-query/wireInRequestsList";
4
- import { confirmWireDetailsMachine as N } from "./confirmWireDetailsStateMachine.js";
5
- import F from "./ConfirmWireDetails.module.scss.js";
6
- import { BaseComponent as D, BaseBoundaries as P } from "../../Base/Base.js";
2
+ import { createMachine as M } from "robot3";
3
+ import { useMachine as T } from "react-robot";
4
+ import { useState as v, useRef as x, useMemo as d, Suspense as N } from "react";
5
+ import { useWireInRequestsListSuspense as F } from "@gusto/embedded-api/react-query/wireInRequestsList";
6
+ import { confirmWireDetailsMachine as D } from "./confirmWireDetailsStateMachine.js";
7
+ import P from "./ConfirmWireDetails.module.scss.js";
8
+ import { BaseComponent as Y, BaseBoundaries as q } from "../../Base/Base.js";
7
9
  import "../../Base/useBase.js";
8
- import { useComponentContext as Y } from "../../../contexts/ComponentAdapter/useComponentContext.js";
9
- import { FlowContext as q } from "../../Flow/useFlow.js";
10
- import { useMachine as B } from "../../../lib/state-machine/index.js";
10
+ import { useComponentContext as B } from "../../../contexts/ComponentAdapter/useComponentContext.js";
11
+ import { FlowContext as b } from "../../Flow/useFlow.js";
11
12
  import { payrollWireEvents as r } from "../../../shared/constants.js";
12
- import { createMachine as b } from "../../../lib/state-machine/core.js";
13
13
  import { ConfirmWireDetailsBanner as g } from "./ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.js";
14
14
  function w({ onEvent: t, ...o }) {
15
- return /* @__PURE__ */ e(D, { ...o, onEvent: t, children: /* @__PURE__ */ e(j, { ...o, onEvent: t }) });
15
+ return /* @__PURE__ */ e(Y, { ...o, onEvent: t, children: /* @__PURE__ */ e(j, { ...o, onEvent: t }) });
16
16
  }
17
17
  function j({ companyId: t, wireInId: o, onEvent: l }) {
18
- const { Modal: p, LoadingSpinner: C } = Y(), [_, s] = M(!1), m = T(null), { data: L } = x({
18
+ const { Modal: p, LoadingSpinner: C } = B(), [_, s] = v(!1), m = x(null), { data: L } = F({
19
19
  companyUuid: t
20
20
  }), f = (L.wireInRequestList || []).filter(
21
21
  (n) => n.status === "awaiting_funds"
22
22
  ), W = d(() => o || f[0]?.uuid, [o, f[0]?.uuid]), h = d(
23
- () => b(
23
+ () => M(
24
24
  "banner",
25
- N,
25
+ D,
26
26
  () => ({
27
27
  component: null,
28
28
  companyId: t,
@@ -33,7 +33,7 @@ function j({ companyId: t, wireInId: o, onEvent: l }) {
33
33
  })
34
34
  ),
35
35
  [t, o]
36
- ), [a, A] = B(h);
36
+ ), [a, A] = T(h);
37
37
  function i(n, R) {
38
38
  A({ type: n, payload: R }), n === r.PAYROLL_WIRE_START_TRANSFER && s(!0), (n === r.PAYROLL_WIRE_INSTRUCTIONS_CANCEL || n === r.PAYROLL_WIRE_FORM_CANCEL || n === r.PAYROLL_WIRE_FORM_DONE) && s(!1), l(n, R);
39
39
  }
@@ -43,7 +43,7 @@ function j({ companyId: t, wireInId: o, onEvent: l }) {
43
43
  s(!1);
44
44
  }, c = a.context.component, u = c?.Footer || void 0;
45
45
  return /* @__PURE__ */ S(
46
- q.Provider,
46
+ b.Provider,
47
47
  {
48
48
  value: {
49
49
  ...a.context,
@@ -66,10 +66,10 @@ function j({ companyId: t, wireInId: o, onEvent: l }) {
66
66
  isOpen: _,
67
67
  onClose: O,
68
68
  containerRef: m,
69
- footer: u && /* @__PURE__ */ e(P, { children: /* @__PURE__ */ e(
70
- v,
69
+ footer: u && /* @__PURE__ */ e(q, { children: /* @__PURE__ */ e(
70
+ N,
71
71
  {
72
- fallback: /* @__PURE__ */ e("div", { className: F.footer, children: /* @__PURE__ */ e(C, { size: "sm" }) }),
72
+ fallback: /* @__PURE__ */ e("div", { className: P.footer, children: /* @__PURE__ */ e(C, { size: "sm" }) }),
73
73
  children: /* @__PURE__ */ e(u, { onEvent: i })
74
74
  }
75
75
  ) }),
@@ -1 +1 @@
1
- {"version":3,"file":"ConfirmWireDetails.js","sources":["../../../../src/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.tsx"],"sourcesContent":["import { Suspense, useMemo, useRef, useState } from 'react'\nimport { useWireInRequestsListSuspense } from '@gusto/embedded-api/react-query/wireInRequestsList'\nimport { ConfirmWireDetailsBanner } from './ConfirmWireDetailsBanner'\nimport { confirmWireDetailsMachine } from './confirmWireDetailsStateMachine'\nimport { type ConfirmWireDetailsContextInterface } from './ConfirmWireDetailsComponents'\nimport type { ConfirmWireDetailsProps } from './types'\nexport type { ConfirmWireDetailsComponentType } from './types'\nimport styles from './ConfirmWireDetails.module.scss'\nimport { BaseComponent, BaseBoundaries } from '@/components/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { FlowContext } from '@/components/Flow/useFlow'\nimport { createMachine, useMachine } from '@/lib/state-machine'\nimport { payrollWireEvents, type EventType } from '@/shared/constants'\n\n/**\n * Wire transfer confirmation workflow for payroll funding.\n *\n * Displays a banner when wire transfers are awaiting funds and walks the user\n * through viewing wire instructions and confirming transfer details via a modal.\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `payroll/wire/startTransfer` | User initiates the wire transfer flow | — |\n * | `payroll/wire/instructions/select` | User selects a wire-in request from the instructions screen | `{ selectedWireInId: string }` |\n * | `payroll/wire/instructions/done` | User completes viewing wire instructions | `{ selectedWireInId: string }` |\n * | `payroll/wire/instructions/cancel` | User cancels viewing wire instructions | — |\n * | `payroll/wire/form/done` | User completes the wire confirmation form | `{ wireInRequest: WireInRequest }` |\n * | `payroll/wire/form/cancel` | User cancels the wire confirmation form | — |\n *\n * @param props - {@link ConfirmWireDetailsProps}\n * @returns The wire confirmation banner and modal flow.\n * @public\n *\n * @example\n * ```tsx\n * import { Payroll } from '@gusto/embedded-react-sdk'\n *\n * function MyComponent() {\n * return (\n * <Payroll.ConfirmWireDetails\n * companyId=\"your-company-id\"\n * wireInId=\"your-wire-in-id\"\n * onEvent={() => {}}\n * />\n * )\n * }\n * ```\n */\nexport function ConfirmWireDetails({ onEvent, ...props }: ConfirmWireDetailsProps) {\n return (\n <BaseComponent {...props} onEvent={onEvent}>\n <Root {...props} onEvent={onEvent} />\n </BaseComponent>\n )\n}\n\nfunction Root({ companyId, wireInId, onEvent }: ConfirmWireDetailsProps) {\n const { Modal, LoadingSpinner } = useComponentContext()\n const [isModalOpen, setIsModalOpen] = useState(false)\n const modalContainerRef = useRef<HTMLDivElement>(null)\n\n const { data: wireInRequestsData } = useWireInRequestsListSuspense({\n companyUuid: companyId,\n })\n\n const activeWireInRequests = (wireInRequestsData.wireInRequestList || []).filter(\n r => r.status === 'awaiting_funds',\n )\n\n const selectedWireInId = useMemo(() => {\n if (wireInId) {\n return wireInId\n }\n\n return activeWireInRequests[0]?.uuid\n }, [wireInId, activeWireInRequests[0]?.uuid])\n\n const confirmWireDetailsMachineInstance = useMemo(\n () =>\n createMachine(\n 'banner',\n confirmWireDetailsMachine,\n (): ConfirmWireDetailsContextInterface => ({\n component: null,\n companyId,\n wireInId,\n selectedWireInId,\n onEvent: handleEvent,\n modalContainerRef,\n }),\n ),\n [companyId, wireInId],\n )\n const [current, send] = useMachine(confirmWireDetailsMachineInstance)\n\n function handleEvent(type: EventType, data?: unknown) {\n send({ type, payload: data })\n\n if (type === payrollWireEvents.PAYROLL_WIRE_START_TRANSFER) {\n setIsModalOpen(true)\n }\n\n if (\n type === payrollWireEvents.PAYROLL_WIRE_INSTRUCTIONS_CANCEL ||\n type === payrollWireEvents.PAYROLL_WIRE_FORM_CANCEL ||\n type === payrollWireEvents.PAYROLL_WIRE_FORM_DONE\n ) {\n setIsModalOpen(false)\n }\n\n onEvent(type, data)\n }\n\n const handleStartWireTransfer = () => {\n handleEvent(payrollWireEvents.PAYROLL_WIRE_START_TRANSFER)\n }\n\n const handleCloseModal = () => {\n setIsModalOpen(false)\n }\n\n const CurrentComponent = current.context.component\n const Footer = CurrentComponent?.Footer || undefined\n\n return (\n <FlowContext.Provider\n value={{\n ...current.context,\n onEvent: handleEvent,\n }}\n >\n <ConfirmWireDetailsBanner\n companyId={companyId}\n wireInId={wireInId}\n onStartWireTransfer={handleStartWireTransfer}\n onEvent={onEvent}\n confirmationAlert={current.context.confirmationAlert}\n />\n <Modal\n isOpen={isModalOpen}\n onClose={handleCloseModal}\n containerRef={modalContainerRef}\n footer={\n Footer && (\n <BaseBoundaries>\n <Suspense\n fallback={\n <div className={styles.footer}>\n <LoadingSpinner size=\"sm\" />\n </div>\n }\n >\n <Footer onEvent={handleEvent} />\n </Suspense>\n </BaseBoundaries>\n )\n }\n >\n {CurrentComponent && <CurrentComponent />}\n </Modal>\n </FlowContext.Provider>\n )\n}\n"],"names":["ConfirmWireDetails","onEvent","props","jsx","BaseComponent","Root","companyId","wireInId","Modal","LoadingSpinner","useComponentContext","isModalOpen","setIsModalOpen","useState","modalContainerRef","useRef","wireInRequestsData","useWireInRequestsListSuspense","activeWireInRequests","r","selectedWireInId","useMemo","confirmWireDetailsMachineInstance","createMachine","confirmWireDetailsMachine","handleEvent","current","send","useMachine","type","data","payrollWireEvents","handleStartWireTransfer","handleCloseModal","CurrentComponent","Footer","jsxs","FlowContext","ConfirmWireDetailsBanner","BaseBoundaries","Suspense","styles"],"mappings":";;;;;;;;;;;;;AAiDO,SAASA,EAAmB,EAAE,SAAAC,GAAS,GAAGC,KAAkC;AACjF,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GAAO,SAAAD,GACxB,4BAACI,GAAA,EAAM,GAAGH,GAAO,SAAAD,EAAA,CAAkB,EAAA,CACrC;AAEJ;AAEA,SAASI,EAAK,EAAE,WAAAC,GAAW,UAAAC,GAAU,SAAAN,KAAoC;AACvE,QAAM,EAAE,OAAAO,GAAO,gBAAAC,EAAA,IAAmBC,EAAA,GAC5B,CAACC,GAAaC,CAAc,IAAIC,EAAS,EAAK,GAC9CC,IAAoBC,EAAuB,IAAI,GAE/C,EAAE,MAAMC,EAAA,IAAuBC,EAA8B;AAAA,IACjE,aAAaX;AAAA,EAAA,CACd,GAEKY,KAAwBF,EAAmB,qBAAqB,CAAA,GAAI;AAAA,IACxE,CAAAG,MAAKA,EAAE,WAAW;AAAA,EAAA,GAGdC,IAAmBC,EAAQ,MAC3Bd,KAIGW,EAAqB,CAAC,GAAG,MAC/B,CAACX,GAAUW,EAAqB,CAAC,GAAG,IAAI,CAAC,GAEtCI,IAAoCD;AAAA,IACxC,MACEE;AAAA,MACE;AAAA,MACAC;AAAA,MACA,OAA2C;AAAA,QACzC,WAAW;AAAA,QACX,WAAAlB;AAAA,QACA,UAAAC;AAAA,QACA,kBAAAa;AAAA,QACA,SAASK;AAAA,QACT,mBAAAX;AAAA,MAAA;AAAA,IACF;AAAA,IAEJ,CAACR,GAAWC,CAAQ;AAAA,EAAA,GAEhB,CAACmB,GAASC,CAAI,IAAIC,EAAWN,CAAiC;AAEpE,WAASG,EAAYI,GAAiBC,GAAgB;AACpD,IAAAH,EAAK,EAAE,MAAAE,GAAM,SAASC,EAAA,CAAM,GAExBD,MAASE,EAAkB,+BAC7BnB,EAAe,EAAI,IAInBiB,MAASE,EAAkB,oCAC3BF,MAASE,EAAkB,4BAC3BF,MAASE,EAAkB,2BAE3BnB,EAAe,EAAK,GAGtBX,EAAQ4B,GAAMC,CAAI;AAAA,EACpB;AAEA,QAAME,IAA0B,MAAM;AACpC,IAAAP,EAAYM,EAAkB,2BAA2B;AAAA,EAC3D,GAEME,IAAmB,MAAM;AAC7B,IAAArB,EAAe,EAAK;AAAA,EACtB,GAEMsB,IAAmBR,EAAQ,QAAQ,WACnCS,IAASD,GAAkB,UAAU;AAE3C,SACE,gBAAAE;AAAA,IAACC,EAAY;AAAA,IAAZ;AAAA,MACC,OAAO;AAAA,QACL,GAAGX,EAAQ;AAAA,QACX,SAASD;AAAA,MAAA;AAAA,MAGX,UAAA;AAAA,QAAA,gBAAAtB;AAAA,UAACmC;AAAA,UAAA;AAAA,YACC,WAAAhC;AAAA,YACA,UAAAC;AAAA,YACA,qBAAqByB;AAAA,YACrB,SAAA/B;AAAA,YACA,mBAAmByB,EAAQ,QAAQ;AAAA,UAAA;AAAA,QAAA;AAAA,QAErC,gBAAAvB;AAAA,UAACK;AAAA,UAAA;AAAA,YACC,QAAQG;AAAA,YACR,SAASsB;AAAA,YACT,cAAcnB;AAAA,YACd,QACEqB,KACE,gBAAAhC,EAACoC,GAAA,EACC,UAAA,gBAAApC;AAAA,cAACqC;AAAA,cAAA;AAAA,gBACC,UACE,gBAAArC,EAAC,OAAA,EAAI,WAAWsC,EAAO,QACrB,UAAA,gBAAAtC,EAACM,GAAA,EAAe,MAAK,KAAA,CAAK,EAAA,CAC5B;AAAA,gBAGF,UAAA,gBAAAN,EAACgC,GAAA,EAAO,SAASV,EAAA,CAAa;AAAA,cAAA;AAAA,YAAA,GAElC;AAAA,YAIH,UAAAS,uBAAqBA,GAAA,CAAA,CAAiB;AAAA,UAAA;AAAA,QAAA;AAAA,MACzC;AAAA,IAAA;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"ConfirmWireDetails.js","sources":["../../../../src/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMachine } from 'react-robot'\nimport { Suspense, useMemo, useRef, useState } from 'react'\nimport { useWireInRequestsListSuspense } from '@gusto/embedded-api/react-query/wireInRequestsList'\nimport { ConfirmWireDetailsBanner } from './ConfirmWireDetailsBanner'\nimport { confirmWireDetailsMachine } from './confirmWireDetailsStateMachine'\nimport { type ConfirmWireDetailsContextInterface } from './ConfirmWireDetailsComponents'\nimport type { ConfirmWireDetailsProps } from './types'\nexport type { ConfirmWireDetailsComponentType } from './types'\nimport styles from './ConfirmWireDetails.module.scss'\nimport { BaseComponent, BaseBoundaries } from '@/components/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { FlowContext } from '@/components/Flow/useFlow'\nimport { payrollWireEvents, type EventType } from '@/shared/constants'\n\n/**\n * Wire transfer confirmation workflow for payroll funding.\n *\n * Displays a banner when wire transfers are awaiting funds and walks the user\n * through viewing wire instructions and confirming transfer details via a modal.\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `payroll/wire/startTransfer` | User initiates the wire transfer flow | — |\n * | `payroll/wire/instructions/select` | User selects a wire-in request from the instructions screen | `{ selectedWireInId: string }` |\n * | `payroll/wire/instructions/done` | User completes viewing wire instructions | `{ selectedWireInId: string }` |\n * | `payroll/wire/instructions/cancel` | User cancels viewing wire instructions | — |\n * | `payroll/wire/form/done` | User completes the wire confirmation form | `{ wireInRequest: WireInRequest }` |\n * | `payroll/wire/form/cancel` | User cancels the wire confirmation form | — |\n *\n * @param props - {@link ConfirmWireDetailsProps}\n * @returns The wire confirmation banner and modal flow.\n * @public\n *\n * @example\n * ```tsx\n * import { Payroll } from '@gusto/embedded-react-sdk'\n *\n * function MyComponent() {\n * return (\n * <Payroll.ConfirmWireDetails\n * companyId=\"your-company-id\"\n * wireInId=\"your-wire-in-id\"\n * onEvent={() => {}}\n * />\n * )\n * }\n * ```\n */\nexport function ConfirmWireDetails({ onEvent, ...props }: ConfirmWireDetailsProps) {\n return (\n <BaseComponent {...props} onEvent={onEvent}>\n <Root {...props} onEvent={onEvent} />\n </BaseComponent>\n )\n}\n\nfunction Root({ companyId, wireInId, onEvent }: ConfirmWireDetailsProps) {\n const { Modal, LoadingSpinner } = useComponentContext()\n const [isModalOpen, setIsModalOpen] = useState(false)\n const modalContainerRef = useRef<HTMLDivElement>(null)\n\n const { data: wireInRequestsData } = useWireInRequestsListSuspense({\n companyUuid: companyId,\n })\n\n const activeWireInRequests = (wireInRequestsData.wireInRequestList || []).filter(\n r => r.status === 'awaiting_funds',\n )\n\n const selectedWireInId = useMemo(() => {\n if (wireInId) {\n return wireInId\n }\n\n return activeWireInRequests[0]?.uuid\n }, [wireInId, activeWireInRequests[0]?.uuid])\n\n const confirmWireDetailsMachineInstance = useMemo(\n () =>\n createMachine(\n 'banner',\n confirmWireDetailsMachine,\n (): ConfirmWireDetailsContextInterface => ({\n component: null,\n companyId,\n wireInId,\n selectedWireInId,\n onEvent: handleEvent,\n modalContainerRef,\n }),\n ),\n [companyId, wireInId],\n )\n const [current, send] = useMachine(confirmWireDetailsMachineInstance)\n\n function handleEvent(type: EventType, data?: unknown) {\n send({ type, payload: data })\n\n if (type === payrollWireEvents.PAYROLL_WIRE_START_TRANSFER) {\n setIsModalOpen(true)\n }\n\n if (\n type === payrollWireEvents.PAYROLL_WIRE_INSTRUCTIONS_CANCEL ||\n type === payrollWireEvents.PAYROLL_WIRE_FORM_CANCEL ||\n type === payrollWireEvents.PAYROLL_WIRE_FORM_DONE\n ) {\n setIsModalOpen(false)\n }\n\n onEvent(type, data)\n }\n\n const handleStartWireTransfer = () => {\n handleEvent(payrollWireEvents.PAYROLL_WIRE_START_TRANSFER)\n }\n\n const handleCloseModal = () => {\n setIsModalOpen(false)\n }\n\n const CurrentComponent = current.context.component\n const Footer = CurrentComponent?.Footer || undefined\n\n return (\n <FlowContext.Provider\n value={{\n ...current.context,\n onEvent: handleEvent,\n }}\n >\n <ConfirmWireDetailsBanner\n companyId={companyId}\n wireInId={wireInId}\n onStartWireTransfer={handleStartWireTransfer}\n onEvent={onEvent}\n confirmationAlert={current.context.confirmationAlert}\n />\n <Modal\n isOpen={isModalOpen}\n onClose={handleCloseModal}\n containerRef={modalContainerRef}\n footer={\n Footer && (\n <BaseBoundaries>\n <Suspense\n fallback={\n <div className={styles.footer}>\n <LoadingSpinner size=\"sm\" />\n </div>\n }\n >\n <Footer onEvent={handleEvent} />\n </Suspense>\n </BaseBoundaries>\n )\n }\n >\n {CurrentComponent && <CurrentComponent />}\n </Modal>\n </FlowContext.Provider>\n )\n}\n"],"names":["ConfirmWireDetails","onEvent","props","jsx","BaseComponent","Root","companyId","wireInId","Modal","LoadingSpinner","useComponentContext","isModalOpen","setIsModalOpen","useState","modalContainerRef","useRef","wireInRequestsData","useWireInRequestsListSuspense","activeWireInRequests","r","selectedWireInId","useMemo","confirmWireDetailsMachineInstance","createMachine","confirmWireDetailsMachine","handleEvent","current","send","useMachine","type","data","payrollWireEvents","handleStartWireTransfer","handleCloseModal","CurrentComponent","Footer","jsxs","FlowContext","ConfirmWireDetailsBanner","BaseBoundaries","Suspense","styles"],"mappings":";;;;;;;;;;;;;AAkDO,SAASA,EAAmB,EAAE,SAAAC,GAAS,GAAGC,KAAkC;AACjF,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GAAO,SAAAD,GACxB,4BAACI,GAAA,EAAM,GAAGH,GAAO,SAAAD,EAAA,CAAkB,EAAA,CACrC;AAEJ;AAEA,SAASI,EAAK,EAAE,WAAAC,GAAW,UAAAC,GAAU,SAAAN,KAAoC;AACvE,QAAM,EAAE,OAAAO,GAAO,gBAAAC,EAAA,IAAmBC,EAAA,GAC5B,CAACC,GAAaC,CAAc,IAAIC,EAAS,EAAK,GAC9CC,IAAoBC,EAAuB,IAAI,GAE/C,EAAE,MAAMC,EAAA,IAAuBC,EAA8B;AAAA,IACjE,aAAaX;AAAA,EAAA,CACd,GAEKY,KAAwBF,EAAmB,qBAAqB,CAAA,GAAI;AAAA,IACxE,CAAAG,MAAKA,EAAE,WAAW;AAAA,EAAA,GAGdC,IAAmBC,EAAQ,MAC3Bd,KAIGW,EAAqB,CAAC,GAAG,MAC/B,CAACX,GAAUW,EAAqB,CAAC,GAAG,IAAI,CAAC,GAEtCI,IAAoCD;AAAA,IACxC,MACEE;AAAA,MACE;AAAA,MACAC;AAAA,MACA,OAA2C;AAAA,QACzC,WAAW;AAAA,QACX,WAAAlB;AAAA,QACA,UAAAC;AAAA,QACA,kBAAAa;AAAA,QACA,SAASK;AAAA,QACT,mBAAAX;AAAA,MAAA;AAAA,IACF;AAAA,IAEJ,CAACR,GAAWC,CAAQ;AAAA,EAAA,GAEhB,CAACmB,GAASC,CAAI,IAAIC,EAAWN,CAAiC;AAEpE,WAASG,EAAYI,GAAiBC,GAAgB;AACpD,IAAAH,EAAK,EAAE,MAAAE,GAAM,SAASC,EAAA,CAAM,GAExBD,MAASE,EAAkB,+BAC7BnB,EAAe,EAAI,IAInBiB,MAASE,EAAkB,oCAC3BF,MAASE,EAAkB,4BAC3BF,MAASE,EAAkB,2BAE3BnB,EAAe,EAAK,GAGtBX,EAAQ4B,GAAMC,CAAI;AAAA,EACpB;AAEA,QAAME,IAA0B,MAAM;AACpC,IAAAP,EAAYM,EAAkB,2BAA2B;AAAA,EAC3D,GAEME,IAAmB,MAAM;AAC7B,IAAArB,EAAe,EAAK;AAAA,EACtB,GAEMsB,IAAmBR,EAAQ,QAAQ,WACnCS,IAASD,GAAkB,UAAU;AAE3C,SACE,gBAAAE;AAAA,IAACC,EAAY;AAAA,IAAZ;AAAA,MACC,OAAO;AAAA,QACL,GAAGX,EAAQ;AAAA,QACX,SAASD;AAAA,MAAA;AAAA,MAGX,UAAA;AAAA,QAAA,gBAAAtB;AAAA,UAACmC;AAAA,UAAA;AAAA,YACC,WAAAhC;AAAA,YACA,UAAAC;AAAA,YACA,qBAAqByB;AAAA,YACrB,SAAA/B;AAAA,YACA,mBAAmByB,EAAQ,QAAQ;AAAA,UAAA;AAAA,QAAA;AAAA,QAErC,gBAAAvB;AAAA,UAACK;AAAA,UAAA;AAAA,YACC,QAAQG;AAAA,YACR,SAASsB;AAAA,YACT,cAAcnB;AAAA,YACd,QACEqB,KACE,gBAAAhC,EAACoC,GAAA,EACC,UAAA,gBAAApC;AAAA,cAACqC;AAAA,cAAA;AAAA,gBACC,UACE,gBAAArC,EAAC,OAAA,EAAI,WAAWsC,EAAO,QACrB,UAAA,gBAAAtC,EAACM,GAAA,EAAe,MAAK,KAAA,CAAK,EAAA,CAC5B;AAAA,gBAGF,UAAA,gBAAAN,EAACgC,GAAA,EAAO,SAASV,EAAA,CAAa;AAAA,cAAA;AAAA,YAAA,GAElC;AAAA,YAIH,UAAAS,uBAAqBA,GAAA,CAAA,CAAiB;AAAA,UAAA;AAAA,QAAA;AAAA,MACzC;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -25,8 +25,8 @@ export type EventPayloads = {
25
25
  };
26
26
  /** @internal */
27
27
  export declare const confirmWireDetailsMachine: {
28
- banner: import('../../../lib/state-machine').StateDefinition;
29
- wireInstructions: import('../../../lib/state-machine').StateDefinition;
30
- confirmForm: import('../../../lib/state-machine').StateDefinition;
31
- final: import('../../../lib/state-machine').StateDefinition;
28
+ banner: import('robot3').MachineState<any>;
29
+ wireInstructions: import('robot3').MachineState<any>;
30
+ confirmForm: import('robot3').MachineState<any>;
31
+ final: import('robot3').MachineState<any>;
32
32
  };
@@ -1,8 +1,7 @@
1
+ import { state as i, transition as e, reduce as r } from "robot3";
1
2
  import { ConfirmWireDetailsFormContextual as I, WireInstructionsContextual as a } from "./ConfirmWireDetailsComponents.js";
2
- import "react";
3
- import { state as i, transition as e, reduce as r } from "../../../lib/state-machine/core.js";
4
3
  import { payrollWireEvents as o } from "../../../shared/constants.js";
5
- const s = {
4
+ const m = {
6
5
  banner: i(
7
6
  e(
8
7
  o.PAYROLL_WIRE_START_TRANSFER,
@@ -67,6 +66,6 @@ const s = {
67
66
  final: i()
68
67
  };
69
68
  export {
70
- s as confirmWireDetailsMachine
69
+ m as confirmWireDetailsMachine
71
70
  };
72
71
  //# sourceMappingURL=confirmWireDetailsStateMachine.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"confirmWireDetailsStateMachine.js","sources":["../../../../src/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.tsx"],"sourcesContent":["import type { ConfirmationAlert } from './types'\nimport type { ConfirmWireDetailsContextInterface } from './ConfirmWireDetailsComponents'\nimport {\n WireInstructionsContextual,\n ConfirmWireDetailsFormContextual,\n} from './ConfirmWireDetailsComponents'\nimport { state, transition, reduce } from '@/lib/state-machine'\nimport { payrollWireEvents } from '@/shared/constants'\nimport type { MachineEventType, MachineTransition } from '@/types/Helpers'\n\n/**\n * Payload shapes for each wire-confirmation state machine event.\n *\n * @internal\n */\nexport type EventPayloads = {\n /** Wire-in request selected within the instructions screen. */\n [payrollWireEvents.PAYROLL_WIRE_INSTRUCTIONS_SELECT]: {\n selectedWireInId: string\n }\n /** Banner button pressed to begin the wire transfer flow. */\n [payrollWireEvents.PAYROLL_WIRE_START_TRANSFER]: undefined\n /** Instructions screen completed; advances to the confirmation form. */\n [payrollWireEvents.PAYROLL_WIRE_INSTRUCTIONS_DONE]: {\n selectedWireInId: string\n }\n /** Confirmation form submitted; carries the alert to surface on the banner. */\n [payrollWireEvents.PAYROLL_WIRE_FORM_DONE]: {\n confirmationAlert: ConfirmationAlert\n }\n /** Confirmation form cancelled. */\n [payrollWireEvents.PAYROLL_WIRE_FORM_CANCEL]: undefined\n}\n\n/** @internal */\nexport const confirmWireDetailsMachine = {\n banner: state<MachineTransition>(\n transition(\n payrollWireEvents.PAYROLL_WIRE_START_TRANSFER,\n 'wireInstructions',\n reduce((ctx: ConfirmWireDetailsContextInterface): ConfirmWireDetailsContextInterface => ({\n ...ctx,\n component: WireInstructionsContextual,\n })),\n ),\n ),\n wireInstructions: state<MachineTransition>(\n transition(\n payrollWireEvents.PAYROLL_WIRE_INSTRUCTIONS_SELECT,\n 'wireInstructions',\n reduce(\n (\n ctx: ConfirmWireDetailsContextInterface,\n ev: MachineEventType<\n EventPayloads,\n typeof payrollWireEvents.PAYROLL_WIRE_INSTRUCTIONS_SELECT\n >,\n ): ConfirmWireDetailsContextInterface => ({\n ...ctx,\n selectedWireInId: ev.payload.selectedWireInId,\n }),\n ),\n ),\n transition(\n payrollWireEvents.PAYROLL_WIRE_INSTRUCTIONS_DONE,\n 'confirmForm',\n reduce(\n (\n ctx: ConfirmWireDetailsContextInterface,\n ev: MachineEventType<\n EventPayloads,\n typeof payrollWireEvents.PAYROLL_WIRE_INSTRUCTIONS_DONE\n >,\n ): ConfirmWireDetailsContextInterface => ({\n ...ctx,\n component: ConfirmWireDetailsFormContextual,\n selectedWireInId: ev.payload.selectedWireInId,\n }),\n ),\n ),\n transition(\n payrollWireEvents.PAYROLL_WIRE_FORM_CANCEL,\n 'banner',\n reduce((ctx: ConfirmWireDetailsContextInterface): ConfirmWireDetailsContextInterface => ({\n ...ctx,\n })),\n ),\n ),\n confirmForm: state<MachineTransition>(\n transition(\n payrollWireEvents.PAYROLL_WIRE_FORM_DONE,\n 'banner',\n reduce(\n (\n ctx: ConfirmWireDetailsContextInterface,\n ev: MachineEventType<EventPayloads, typeof payrollWireEvents.PAYROLL_WIRE_FORM_DONE>,\n ): ConfirmWireDetailsContextInterface => ({\n ...ctx,\n component: null,\n confirmationAlert: ev.payload.confirmationAlert,\n }),\n ),\n ),\n transition(\n payrollWireEvents.PAYROLL_WIRE_FORM_CANCEL,\n 'banner',\n reduce((ctx: ConfirmWireDetailsContextInterface): ConfirmWireDetailsContextInterface => ({\n ...ctx,\n component: null,\n })),\n ),\n ),\n final: state<MachineTransition>(),\n}\n"],"names":["confirmWireDetailsMachine","state","transition","payrollWireEvents","reduce","ctx","WireInstructionsContextual","ev","ConfirmWireDetailsFormContextual"],"mappings":";;;;AAmCO,MAAMA,IAA4B;AAAA,EACvC,QAAQC;AAAA,IACNC;AAAA,MACEC,EAAkB;AAAA,MAClB;AAAA,MACAC,EAAO,CAACC,OAAiF;AAAA,QACvF,GAAGA;AAAA,QACH,WAAWC;AAAA,MAAA,EACX;AAAA,IAAA;AAAA,EACJ;AAAA,EAEF,kBAAkBL;AAAA,IAChBC;AAAA,MACEC,EAAkB;AAAA,MAClB;AAAA,MACAC;AAAA,QACE,CACEC,GACAE,OAIwC;AAAA,UACxC,GAAGF;AAAA,UACH,kBAAkBE,EAAG,QAAQ;AAAA,QAAA;AAAA,MAC/B;AAAA,IACF;AAAA,IAEFL;AAAA,MACEC,EAAkB;AAAA,MAClB;AAAA,MACAC;AAAA,QACE,CACEC,GACAE,OAIwC;AAAA,UACxC,GAAGF;AAAA,UACH,WAAWG;AAAA,UACX,kBAAkBD,EAAG,QAAQ;AAAA,QAAA;AAAA,MAC/B;AAAA,IACF;AAAA,IAEFL;AAAA,MACEC,EAAkB;AAAA,MAClB;AAAA,MACAC,EAAO,CAACC,OAAiF;AAAA,QACvF,GAAGA;AAAA,MAAA,EACH;AAAA,IAAA;AAAA,EACJ;AAAA,EAEF,aAAaJ;AAAA,IACXC;AAAA,MACEC,EAAkB;AAAA,MAClB;AAAA,MACAC;AAAA,QACE,CACEC,GACAE,OACwC;AAAA,UACxC,GAAGF;AAAA,UACH,WAAW;AAAA,UACX,mBAAmBE,EAAG,QAAQ;AAAA,QAAA;AAAA,MAChC;AAAA,IACF;AAAA,IAEFL;AAAA,MACEC,EAAkB;AAAA,MAClB;AAAA,MACAC,EAAO,CAACC,OAAiF;AAAA,QACvF,GAAGA;AAAA,QACH,WAAW;AAAA,MAAA,EACX;AAAA,IAAA;AAAA,EACJ;AAAA,EAEF,OAAOJ,EAAA;AACT;"}
1
+ {"version":3,"file":"confirmWireDetailsStateMachine.js","sources":["../../../../src/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.tsx"],"sourcesContent":["import { state, transition, reduce } from 'robot3'\nimport type { ConfirmationAlert } from './types'\nimport type { ConfirmWireDetailsContextInterface } from './ConfirmWireDetailsComponents'\nimport {\n WireInstructionsContextual,\n ConfirmWireDetailsFormContextual,\n} from './ConfirmWireDetailsComponents'\nimport { payrollWireEvents } from '@/shared/constants'\nimport type { MachineEventType, MachineTransition } from '@/types/Helpers'\n\n/**\n * Payload shapes for each wire-confirmation state machine event.\n *\n * @internal\n */\nexport type EventPayloads = {\n /** Wire-in request selected within the instructions screen. */\n [payrollWireEvents.PAYROLL_WIRE_INSTRUCTIONS_SELECT]: {\n selectedWireInId: string\n }\n /** Banner button pressed to begin the wire transfer flow. */\n [payrollWireEvents.PAYROLL_WIRE_START_TRANSFER]: undefined\n /** Instructions screen completed; advances to the confirmation form. */\n [payrollWireEvents.PAYROLL_WIRE_INSTRUCTIONS_DONE]: {\n selectedWireInId: string\n }\n /** Confirmation form submitted; carries the alert to surface on the banner. */\n [payrollWireEvents.PAYROLL_WIRE_FORM_DONE]: {\n confirmationAlert: ConfirmationAlert\n }\n /** Confirmation form cancelled. */\n [payrollWireEvents.PAYROLL_WIRE_FORM_CANCEL]: undefined\n}\n\n/** @internal */\nexport const confirmWireDetailsMachine = {\n banner: state<MachineTransition>(\n transition(\n payrollWireEvents.PAYROLL_WIRE_START_TRANSFER,\n 'wireInstructions',\n reduce((ctx: ConfirmWireDetailsContextInterface): ConfirmWireDetailsContextInterface => ({\n ...ctx,\n component: WireInstructionsContextual,\n })),\n ),\n ),\n wireInstructions: state<MachineTransition>(\n transition(\n payrollWireEvents.PAYROLL_WIRE_INSTRUCTIONS_SELECT,\n 'wireInstructions',\n reduce(\n (\n ctx: ConfirmWireDetailsContextInterface,\n ev: MachineEventType<\n EventPayloads,\n typeof payrollWireEvents.PAYROLL_WIRE_INSTRUCTIONS_SELECT\n >,\n ): ConfirmWireDetailsContextInterface => ({\n ...ctx,\n selectedWireInId: ev.payload.selectedWireInId,\n }),\n ),\n ),\n transition(\n payrollWireEvents.PAYROLL_WIRE_INSTRUCTIONS_DONE,\n 'confirmForm',\n reduce(\n (\n ctx: ConfirmWireDetailsContextInterface,\n ev: MachineEventType<\n EventPayloads,\n typeof payrollWireEvents.PAYROLL_WIRE_INSTRUCTIONS_DONE\n >,\n ): ConfirmWireDetailsContextInterface => ({\n ...ctx,\n component: ConfirmWireDetailsFormContextual,\n selectedWireInId: ev.payload.selectedWireInId,\n }),\n ),\n ),\n transition(\n payrollWireEvents.PAYROLL_WIRE_FORM_CANCEL,\n 'banner',\n reduce((ctx: ConfirmWireDetailsContextInterface): ConfirmWireDetailsContextInterface => ({\n ...ctx,\n })),\n ),\n ),\n confirmForm: state<MachineTransition>(\n transition(\n payrollWireEvents.PAYROLL_WIRE_FORM_DONE,\n 'banner',\n reduce(\n (\n ctx: ConfirmWireDetailsContextInterface,\n ev: MachineEventType<EventPayloads, typeof payrollWireEvents.PAYROLL_WIRE_FORM_DONE>,\n ): ConfirmWireDetailsContextInterface => ({\n ...ctx,\n component: null,\n confirmationAlert: ev.payload.confirmationAlert,\n }),\n ),\n ),\n transition(\n payrollWireEvents.PAYROLL_WIRE_FORM_CANCEL,\n 'banner',\n reduce((ctx: ConfirmWireDetailsContextInterface): ConfirmWireDetailsContextInterface => ({\n ...ctx,\n component: null,\n })),\n ),\n ),\n final: state<MachineTransition>(),\n}\n"],"names":["confirmWireDetailsMachine","state","transition","payrollWireEvents","reduce","ctx","WireInstructionsContextual","ev","ConfirmWireDetailsFormContextual"],"mappings":";;;AAmCO,MAAMA,IAA4B;AAAA,EACvC,QAAQC;AAAA,IACNC;AAAA,MACEC,EAAkB;AAAA,MAClB;AAAA,MACAC,EAAO,CAACC,OAAiF;AAAA,QACvF,GAAGA;AAAA,QACH,WAAWC;AAAA,MAAA,EACX;AAAA,IAAA;AAAA,EACJ;AAAA,EAEF,kBAAkBL;AAAA,IAChBC;AAAA,MACEC,EAAkB;AAAA,MAClB;AAAA,MACAC;AAAA,QACE,CACEC,GACAE,OAIwC;AAAA,UACxC,GAAGF;AAAA,UACH,kBAAkBE,EAAG,QAAQ;AAAA,QAAA;AAAA,MAC/B;AAAA,IACF;AAAA,IAEFL;AAAA,MACEC,EAAkB;AAAA,MAClB;AAAA,MACAC;AAAA,QACE,CACEC,GACAE,OAIwC;AAAA,UACxC,GAAGF;AAAA,UACH,WAAWG;AAAA,UACX,kBAAkBD,EAAG,QAAQ;AAAA,QAAA;AAAA,MAC/B;AAAA,IACF;AAAA,IAEFL;AAAA,MACEC,EAAkB;AAAA,MAClB;AAAA,MACAC,EAAO,CAACC,OAAiF;AAAA,QACvF,GAAGA;AAAA,MAAA,EACH;AAAA,IAAA;AAAA,EACJ;AAAA,EAEF,aAAaJ;AAAA,IACXC;AAAA,MACEC,EAAkB;AAAA,MAClB;AAAA,MACAC;AAAA,QACE,CACEC,GACAE,OACwC;AAAA,UACxC,GAAGF;AAAA,UACH,WAAW;AAAA,UACX,mBAAmBE,EAAG,QAAQ;AAAA,QAAA;AAAA,MAChC;AAAA,IACF;AAAA,IAEFL;AAAA,MACEC,EAAkB;AAAA,MAClB;AAAA,MACAC,EAAO,CAACC,OAAiF;AAAA,QACvF,GAAGA;AAAA,QACH,WAAW;AAAA,MAAA,EACX;AAAA,IAAA;AAAA,EACJ;AAAA,EAEF,OAAOJ,EAAA;AACT;"}