@gusto/embedded-react-sdk 0.53.0 → 0.54.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (661) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/DISCLAIMER.md +13 -0
  3. package/LICENSE +198 -4
  4. package/README.md +6 -0
  5. package/dist/components/Base/Base.d.ts +26 -5
  6. package/dist/components/Base/Base.js +89 -78
  7. package/dist/components/Base/Base.js.map +1 -1
  8. package/dist/components/Base/index.d.ts +1 -1
  9. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +4 -3
  10. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  11. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +4 -3
  12. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  13. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +6 -5
  14. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  15. package/dist/components/Company/BankAccount/BankAccountForm/context.js +4 -3
  16. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  17. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +4 -3
  18. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  19. package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/fields.js +4 -4
  20. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +6 -5
  21. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  22. package/dist/components/Company/Industry/Context.js +7 -6
  23. package/dist/components/Company/Industry/Context.js.map +1 -1
  24. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +4 -3
  25. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  26. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +4 -3
  27. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  28. package/dist/components/Company/OnboardingOverview/context.js +4 -3
  29. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  30. package/dist/components/Company/PaySchedule/PayScheduleForm.d.ts +4 -1
  31. package/dist/components/Company/PaySchedule/PayScheduleForm.js +55 -48
  32. package/dist/components/Company/PaySchedule/PayScheduleForm.js.map +1 -1
  33. package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/fields.js +5 -5
  34. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +4 -3
  35. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  36. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +4 -3
  37. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  38. package/dist/components/Company/StateTaxes/TaxRateManagement/context.js +4 -3
  39. package/dist/components/Company/StateTaxes/TaxRateManagement/context.js.map +1 -1
  40. package/dist/components/Contractor/Address/management/Address.d.ts +30 -0
  41. package/dist/components/Contractor/Address/management/Address.js +43 -0
  42. package/dist/components/Contractor/Address/management/Address.js.map +1 -0
  43. package/dist/components/Contractor/Address/management/AddressCard/AddressCard.d.ts +35 -0
  44. package/dist/components/Contractor/Address/management/AddressCard/AddressCard.js +45 -0
  45. package/dist/components/Contractor/Address/management/AddressCard/AddressCard.js.map +1 -0
  46. package/dist/components/Contractor/Address/management/AddressCard/index.d.ts +1 -0
  47. package/dist/components/Contractor/Address/management/AddressComponents.d.ts +12 -0
  48. package/dist/components/Contractor/Address/management/AddressComponents.js +48 -0
  49. package/dist/components/Contractor/Address/management/AddressComponents.js.map +1 -0
  50. package/dist/components/Contractor/Address/management/AddressEditForm.d.ts +29 -0
  51. package/dist/components/Contractor/Address/management/AddressEditForm.js +126 -0
  52. package/dist/components/Contractor/Address/management/AddressEditForm.js.map +1 -0
  53. package/dist/components/Contractor/Address/management/AddressEditForm.module.scss.js +8 -0
  54. package/dist/components/Contractor/Address/management/AddressEditForm.module.scss.js.map +1 -0
  55. package/dist/components/Contractor/Address/management/addressStateMachine.d.ts +5 -0
  56. package/dist/components/Contractor/Address/management/addressStateMachine.js +37 -0
  57. package/dist/components/Contractor/Address/management/addressStateMachine.js.map +1 -0
  58. package/dist/components/Contractor/Address/management/index.d.ts +3 -0
  59. package/dist/components/Contractor/Address/{Address.d.ts → onboarding/Address.d.ts} +7 -4
  60. package/dist/components/Contractor/Address/onboarding/Address.js +119 -0
  61. package/dist/components/Contractor/Address/onboarding/Address.js.map +1 -0
  62. package/dist/components/Contractor/Address/{types.d.ts → onboarding/types.d.ts} +2 -2
  63. package/dist/components/Contractor/Address/shared/useContractorAddressSummary/index.d.ts +1 -0
  64. package/dist/components/Contractor/Address/shared/useContractorAddressSummary/useContractorAddressSummary.d.ts +19 -0
  65. package/dist/components/Contractor/Address/shared/useContractorAddressSummary/useContractorAddressSummary.js +27 -0
  66. package/dist/components/Contractor/Address/shared/useContractorAddressSummary/useContractorAddressSummary.js.map +1 -0
  67. package/dist/components/Contractor/Compensation/management/Compensation.d.ts +30 -0
  68. package/dist/components/Contractor/Compensation/management/Compensation.js +43 -0
  69. package/dist/components/Contractor/Compensation/management/Compensation.js.map +1 -0
  70. package/dist/components/Contractor/Compensation/management/CompensationCard/CompensationCard.d.ts +35 -0
  71. package/dist/components/Contractor/Compensation/management/CompensationCard/CompensationCard.js +57 -0
  72. package/dist/components/Contractor/Compensation/management/CompensationCard/CompensationCard.js.map +1 -0
  73. package/dist/components/Contractor/Compensation/management/CompensationCard/index.d.ts +1 -0
  74. package/dist/components/Contractor/Compensation/management/CompensationComponents.d.ts +12 -0
  75. package/dist/components/Contractor/Compensation/management/CompensationComponents.js +48 -0
  76. package/dist/components/Contractor/Compensation/management/CompensationComponents.js.map +1 -0
  77. package/dist/components/Contractor/Compensation/management/CompensationEditForm.d.ts +29 -0
  78. package/dist/components/Contractor/Compensation/management/CompensationEditForm.js +94 -0
  79. package/dist/components/Contractor/Compensation/management/CompensationEditForm.js.map +1 -0
  80. package/dist/components/Contractor/Compensation/management/CompensationEditForm.module.scss.js +8 -0
  81. package/dist/components/Contractor/Compensation/management/CompensationEditForm.module.scss.js.map +1 -0
  82. package/dist/components/Contractor/Compensation/management/compensationStateMachine.d.ts +5 -0
  83. package/dist/components/Contractor/Compensation/management/compensationStateMachine.js +45 -0
  84. package/dist/components/Contractor/Compensation/management/compensationStateMachine.js.map +1 -0
  85. package/dist/components/Contractor/Compensation/management/index.d.ts +3 -0
  86. package/dist/components/Contractor/Compensation/shared/useContractorCompensationSummary/index.d.ts +1 -0
  87. package/dist/components/Contractor/Compensation/shared/useContractorCompensationSummary/useContractorCompensationSummary.d.ts +17 -0
  88. package/dist/components/Contractor/Compensation/shared/useContractorCompensationSummary/useContractorCompensationSummary.js +23 -0
  89. package/dist/components/Contractor/Compensation/shared/useContractorCompensationSummary/useContractorCompensationSummary.js.map +1 -0
  90. package/dist/components/Contractor/Compensation/shared/useContractorPayForm/contractorPaySchema.d.ts +50 -0
  91. package/dist/components/Contractor/Compensation/shared/useContractorPayForm/contractorPaySchema.js +32 -0
  92. package/dist/components/Contractor/Compensation/shared/useContractorPayForm/contractorPaySchema.js.map +1 -0
  93. package/dist/components/Contractor/Compensation/shared/useContractorPayForm/fields.d.ts +26 -0
  94. package/dist/components/Contractor/Compensation/shared/useContractorPayForm/fields.js +14 -0
  95. package/dist/components/Contractor/Compensation/shared/useContractorPayForm/fields.js.map +1 -0
  96. package/dist/components/Contractor/Compensation/shared/useContractorPayForm/index.d.ts +4 -0
  97. package/dist/components/Contractor/Compensation/shared/useContractorPayForm/useContractorPayForm.d.ts +111 -0
  98. package/dist/components/Contractor/Compensation/shared/useContractorPayForm/useContractorPayForm.js +95 -0
  99. package/dist/components/Contractor/Compensation/shared/useContractorPayForm/useContractorPayForm.js.map +1 -0
  100. package/dist/components/Contractor/ContractorList/management/ManagementContractorList.d.ts +1 -1
  101. package/dist/components/Contractor/ContractorList/management/ManagementContractorList.js +56 -46
  102. package/dist/components/Contractor/ContractorList/management/ManagementContractorList.js.map +1 -1
  103. package/dist/components/Contractor/ContractorList/onboarding/ContractorList.d.ts +1 -1
  104. package/dist/components/Contractor/ContractorList/onboarding/ContractorList.js +44 -24
  105. package/dist/components/Contractor/ContractorList/onboarding/ContractorList.js.map +1 -1
  106. package/dist/components/Contractor/ContractorList/onboarding/ContractorListView.js +3 -3
  107. package/dist/components/Contractor/Dashboard/Dashboard.d.ts +30 -0
  108. package/dist/components/Contractor/Dashboard/Dashboard.js +80 -0
  109. package/dist/components/Contractor/Dashboard/Dashboard.js.map +1 -0
  110. package/dist/components/Contractor/Dashboard/DashboardComponents.d.ts +25 -0
  111. package/dist/components/Contractor/Dashboard/DashboardComponents.js +67 -0
  112. package/dist/components/Contractor/Dashboard/DashboardComponents.js.map +1 -0
  113. package/dist/components/Contractor/Dashboard/DashboardFlow.d.ts +88 -0
  114. package/dist/components/Contractor/Dashboard/DashboardFlow.js +25 -0
  115. package/dist/components/Contractor/Dashboard/DashboardFlow.js.map +1 -0
  116. package/dist/components/Contractor/Dashboard/DetailsView.d.ts +26 -0
  117. package/dist/components/Contractor/Dashboard/DetailsView.js +14 -0
  118. package/dist/components/Contractor/Dashboard/DetailsView.js.map +1 -0
  119. package/dist/components/Contractor/Dashboard/PayView.d.ts +26 -0
  120. package/dist/components/Contractor/Dashboard/PayView.js +14 -0
  121. package/dist/components/Contractor/Dashboard/PayView.js.map +1 -0
  122. package/dist/components/Contractor/Dashboard/dashboardStateMachine.d.ts +8 -0
  123. package/dist/components/Contractor/Dashboard/dashboardStateMachine.js +138 -0
  124. package/dist/components/Contractor/Dashboard/dashboardStateMachine.js.map +1 -0
  125. package/dist/components/Contractor/Dashboard/index.d.ts +4 -0
  126. package/dist/components/Contractor/Documents/management/DocumentsCard/DocumentsCard.d.ts +36 -0
  127. package/dist/components/Contractor/Documents/management/DocumentsCard/DocumentsCard.js +93 -0
  128. package/dist/components/Contractor/Documents/management/DocumentsCard/DocumentsCard.js.map +1 -0
  129. package/dist/components/Contractor/Documents/management/DocumentsCard/index.d.ts +1 -0
  130. package/dist/components/Contractor/Documents/management/index.d.ts +2 -0
  131. package/dist/components/Contractor/Documents/{DocumentSigner → onboarding/DocumentSigner}/DocumentSigner.d.ts +1 -1
  132. package/dist/components/Contractor/Documents/{DocumentSigner → onboarding/DocumentSigner}/DocumentSigner.js +4 -4
  133. package/dist/components/Contractor/Documents/onboarding/DocumentSigner/DocumentSigner.js.map +1 -0
  134. package/dist/components/Contractor/Documents/{DocumentSigner → onboarding/DocumentSigner}/documentSignerStateMachine.d.ts +2 -2
  135. package/dist/components/Contractor/Documents/{DocumentSigner → onboarding/DocumentSigner}/documentSignerStateMachine.js +3 -3
  136. package/dist/components/Contractor/Documents/onboarding/DocumentSigner/documentSignerStateMachine.js.map +1 -0
  137. package/dist/components/Contractor/Documents/{DocumentSigner → onboarding/DocumentSigner}/stateMachine.js +1 -1
  138. package/dist/components/Contractor/Documents/onboarding/DocumentSigner/stateMachine.js.map +1 -0
  139. package/dist/components/Contractor/Documents/{DocumentsList → onboarding/DocumentsList}/DocumentsList.d.ts +1 -1
  140. package/dist/components/Contractor/Documents/onboarding/DocumentsList/DocumentsList.js +81 -0
  141. package/dist/components/Contractor/Documents/onboarding/DocumentsList/DocumentsList.js.map +1 -0
  142. package/dist/components/Contractor/Documents/onboarding/DocumentsList/index.d.ts +1 -0
  143. package/dist/components/Contractor/Documents/{SignatureForm → shared/SignatureForm}/SignatureForm.d.ts +1 -1
  144. package/dist/components/Contractor/Documents/{SignatureForm → shared/SignatureForm}/SignatureForm.js +112 -116
  145. package/dist/components/Contractor/Documents/shared/SignatureForm/SignatureForm.js.map +1 -0
  146. package/dist/components/Contractor/Documents/{SignatureForm → shared/SignatureForm}/useContractorSignatureForm/contractorSignatureFormSchema.d.ts +2 -2
  147. package/dist/components/Contractor/Documents/{SignatureForm → shared/SignatureForm}/useContractorSignatureForm/contractorSignatureFormSchema.js +3 -3
  148. package/dist/components/Contractor/Documents/shared/SignatureForm/useContractorSignatureForm/contractorSignatureFormSchema.js.map +1 -0
  149. package/dist/components/Contractor/Documents/{SignatureForm → shared/SignatureForm}/useContractorSignatureForm/fields.d.ts +5 -5
  150. package/dist/components/Contractor/Documents/{SignatureForm → shared/SignatureForm}/useContractorSignatureForm/fields.js +10 -10
  151. package/dist/components/Contractor/Documents/shared/SignatureForm/useContractorSignatureForm/fields.js.map +1 -0
  152. package/dist/components/Contractor/Documents/{SignatureForm → shared/SignatureForm}/useContractorSignatureForm/useContractorSignatureForm.d.ts +2 -2
  153. package/dist/components/Contractor/Documents/{SignatureForm → shared/SignatureForm}/useContractorSignatureForm/useContractorSignatureForm.js +8 -8
  154. package/dist/components/Contractor/Documents/shared/SignatureForm/useContractorSignatureForm/useContractorSignatureForm.js.map +1 -0
  155. package/dist/components/Contractor/Documents/shared/SignatureForm/useContractorSignatureForm/w9Fields.js.map +1 -0
  156. package/dist/components/Contractor/Documents/shared/documentSigningStatus.d.ts +15 -0
  157. package/dist/components/Contractor/Documents/shared/documentSigningStatus.js +7 -0
  158. package/dist/components/Contractor/Documents/shared/documentSigningStatus.js.map +1 -0
  159. package/dist/components/Contractor/Documents/shared/documentSigningStatus.test.d.ts +1 -0
  160. package/dist/components/Contractor/Documents/shared/useContractorDocumentsList/useContractorDocumentsList.js.map +1 -0
  161. package/dist/components/Contractor/OnboardingFlow/OnboardingFlowComponents.d.ts +1 -1
  162. package/dist/components/Contractor/OnboardingFlow/OnboardingFlowComponents.js +16 -16
  163. package/dist/components/Contractor/OnboardingFlow/OnboardingFlowComponents.js.map +1 -1
  164. package/dist/components/Contractor/PaymentMethod/management/PaymentMethod.d.ts +32 -0
  165. package/dist/components/Contractor/PaymentMethod/management/PaymentMethod.js +43 -0
  166. package/dist/components/Contractor/PaymentMethod/management/PaymentMethod.js.map +1 -0
  167. package/dist/components/Contractor/PaymentMethod/management/PaymentMethodCard/PaymentMethodCard.d.ts +37 -0
  168. package/dist/components/Contractor/PaymentMethod/management/PaymentMethodCard/PaymentMethodCard.js +133 -0
  169. package/dist/components/Contractor/PaymentMethod/management/PaymentMethodCard/PaymentMethodCard.js.map +1 -0
  170. package/dist/components/Contractor/PaymentMethod/management/PaymentMethodCard/index.d.ts +1 -0
  171. package/dist/components/Contractor/PaymentMethod/management/PaymentMethodComponents.d.ts +12 -0
  172. package/dist/components/Contractor/PaymentMethod/management/PaymentMethodComponents.js +48 -0
  173. package/dist/components/Contractor/PaymentMethod/management/PaymentMethodComponents.js.map +1 -0
  174. package/dist/components/Contractor/PaymentMethod/management/PaymentMethodEditForm.d.ts +30 -0
  175. package/dist/components/Contractor/PaymentMethod/management/PaymentMethodEditForm.js +57 -0
  176. package/dist/components/Contractor/PaymentMethod/management/PaymentMethodEditForm.js.map +1 -0
  177. package/dist/components/Contractor/PaymentMethod/management/PaymentMethodEditForm.module.scss.js +8 -0
  178. package/dist/components/Contractor/PaymentMethod/management/PaymentMethodEditForm.module.scss.js.map +1 -0
  179. package/dist/components/Contractor/PaymentMethod/management/index.d.ts +3 -0
  180. package/dist/components/Contractor/PaymentMethod/management/paymentMethodStateMachine.d.ts +5 -0
  181. package/dist/components/Contractor/PaymentMethod/management/paymentMethodStateMachine.js +61 -0
  182. package/dist/components/Contractor/PaymentMethod/management/paymentMethodStateMachine.js.map +1 -0
  183. package/dist/components/Contractor/PaymentMethod/management/useFormDictionary.d.ts +11 -0
  184. package/dist/components/Contractor/PaymentMethod/management/useFormDictionary.js +33 -0
  185. package/dist/components/Contractor/PaymentMethod/management/useFormDictionary.js.map +1 -0
  186. package/dist/components/Contractor/PaymentMethod/{PaymentMethod.d.ts → onboarding/PaymentMethod.d.ts} +1 -1
  187. package/dist/components/Contractor/PaymentMethod/onboarding/PaymentMethod.js +87 -0
  188. package/dist/components/Contractor/PaymentMethod/onboarding/PaymentMethod.js.map +1 -0
  189. package/dist/components/Contractor/PaymentMethod/{types.d.ts → onboarding/types.d.ts} +1 -1
  190. package/dist/components/Contractor/PaymentMethod/onboarding/useFormDictionary.d.ts +12 -0
  191. package/dist/components/Contractor/PaymentMethod/onboarding/useFormDictionary.js +31 -0
  192. package/dist/components/Contractor/PaymentMethod/onboarding/useFormDictionary.js.map +1 -0
  193. package/dist/components/Contractor/PaymentMethod/shared/ContractorBankAccountFields/ContractorBankAccountFields.d.ts +29 -0
  194. package/dist/components/Contractor/PaymentMethod/shared/ContractorBankAccountFields/ContractorBankAccountFields.js +55 -0
  195. package/dist/components/Contractor/PaymentMethod/shared/ContractorBankAccountFields/ContractorBankAccountFields.js.map +1 -0
  196. package/dist/components/Contractor/PaymentMethod/shared/ContractorBankAccountFields/index.d.ts +1 -0
  197. package/dist/components/Contractor/PaymentMethod/shared/ContractorBankAccountFormBody/ContractorBankAccountFormBody.d.ts +30 -0
  198. package/dist/components/Contractor/PaymentMethod/shared/ContractorBankAccountFormBody/ContractorBankAccountFormBody.js +46 -0
  199. package/dist/components/Contractor/PaymentMethod/shared/ContractorBankAccountFormBody/ContractorBankAccountFormBody.js.map +1 -0
  200. package/dist/components/Contractor/PaymentMethod/shared/ContractorBankAccountFormBody/index.d.ts +1 -0
  201. package/dist/components/Contractor/PaymentMethod/shared/useContractorBankAccountForm/fields.js +1 -1
  202. package/dist/components/Contractor/PaymentMethod/shared/useContractorBankAccountForm/useContractorBankAccountForm.d.ts +12 -3
  203. package/dist/components/Contractor/PaymentMethod/shared/useContractorBankAccountForm/useContractorBankAccountForm.js +71 -69
  204. package/dist/components/Contractor/PaymentMethod/shared/useContractorBankAccountForm/useContractorBankAccountForm.js.map +1 -1
  205. package/dist/components/Contractor/PaymentMethod/shared/useContractorPaymentMethodSummary/index.d.ts +1 -0
  206. package/dist/components/Contractor/PaymentMethod/shared/useContractorPaymentMethodSummary/useContractorPaymentMethodSummary.d.ts +24 -0
  207. package/dist/components/Contractor/PaymentMethod/shared/useContractorPaymentMethodSummary/useContractorPaymentMethodSummary.js +43 -0
  208. package/dist/components/Contractor/PaymentMethod/shared/useContractorPaymentMethodSummary/useContractorPaymentMethodSummary.js.map +1 -0
  209. package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js +134 -141
  210. package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js.map +1 -1
  211. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.d.ts +7 -3
  212. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +58 -137
  213. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
  214. package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +1 -1
  215. package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js.map +1 -1
  216. package/dist/components/Contractor/Payments/CreatePayment/useFormDictionary.d.ts +9 -0
  217. package/dist/components/Contractor/Payments/CreatePayment/useFormDictionary.js +53 -0
  218. package/dist/components/Contractor/Payments/CreatePayment/useFormDictionary.js.map +1 -0
  219. package/dist/components/Contractor/Payments/CreatePaymentFlow/CreatePaymentFlow.d.ts +63 -0
  220. package/dist/components/Contractor/Payments/CreatePaymentFlow/CreatePaymentFlow.js +46 -0
  221. package/dist/components/Contractor/Payments/CreatePaymentFlow/CreatePaymentFlow.js.map +1 -0
  222. package/dist/components/Contractor/Payments/CreatePaymentFlow/CreatePaymentFlowComponents.d.ts +22 -0
  223. package/dist/components/Contractor/Payments/CreatePaymentFlow/CreatePaymentFlowComponents.js +26 -0
  224. package/dist/components/Contractor/Payments/CreatePaymentFlow/CreatePaymentFlowComponents.js.map +1 -0
  225. package/dist/components/Contractor/Payments/CreatePaymentFlow/createPaymentMachine.d.ts +8 -0
  226. package/dist/components/Contractor/Payments/CreatePaymentFlow/createPaymentMachine.js +63 -0
  227. package/dist/components/Contractor/Payments/CreatePaymentFlow/createPaymentMachine.js.map +1 -0
  228. package/dist/components/Contractor/Payments/CreatePaymentFlow/createPaymentMachine.test.d.ts +1 -0
  229. package/dist/components/Contractor/Payments/CreatePaymentFlow/index.d.ts +2 -0
  230. package/dist/components/Contractor/Payments/HistoricalPaymentAmounts/HistoricalPaymentAmounts.d.ts +33 -0
  231. package/dist/components/Contractor/Payments/HistoricalPaymentAmounts/HistoricalPaymentAmounts.js +62 -0
  232. package/dist/components/Contractor/Payments/HistoricalPaymentAmounts/HistoricalPaymentAmounts.js.map +1 -0
  233. package/dist/components/Contractor/Payments/HistoricalPaymentAmounts/index.d.ts +1 -0
  234. package/dist/components/Contractor/Payments/HistoricalPaymentAmounts/useFormDictionary.d.ts +9 -0
  235. package/dist/components/Contractor/Payments/HistoricalPaymentAmounts/useFormDictionary.js +53 -0
  236. package/dist/components/Contractor/Payments/HistoricalPaymentAmounts/useFormDictionary.js.map +1 -0
  237. package/dist/components/Contractor/Payments/HistoricalPaymentContractors/HistoricalPaymentContractors.d.ts +27 -0
  238. package/dist/components/Contractor/Payments/HistoricalPaymentContractors/HistoricalPaymentContractors.js +56 -0
  239. package/dist/components/Contractor/Payments/HistoricalPaymentContractors/HistoricalPaymentContractors.js.map +1 -0
  240. package/dist/components/Contractor/Payments/HistoricalPaymentContractors/index.d.ts +1 -0
  241. package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.d.ts +2 -10
  242. package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js +35 -44
  243. package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js.map +1 -1
  244. package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.d.ts +22 -4
  245. package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js +58 -152
  246. package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js.map +1 -1
  247. package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.test.d.ts +1 -0
  248. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js +1 -1
  249. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map +1 -1
  250. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js +1 -1
  251. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js.map +1 -1
  252. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js +1 -1
  253. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js.map +1 -1
  254. package/dist/components/Contractor/Payments/ViewPaymentFlow/ViewPaymentFlow.d.ts +63 -0
  255. package/dist/components/Contractor/Payments/ViewPaymentFlow/ViewPaymentFlow.js +46 -0
  256. package/dist/components/Contractor/Payments/ViewPaymentFlow/ViewPaymentFlow.js.map +1 -0
  257. package/dist/components/Contractor/Payments/ViewPaymentFlow/ViewPaymentFlowComponents.d.ts +20 -0
  258. package/dist/components/Contractor/Payments/ViewPaymentFlow/ViewPaymentFlowComponents.js +25 -0
  259. package/dist/components/Contractor/Payments/ViewPaymentFlow/ViewPaymentFlowComponents.js.map +1 -0
  260. package/dist/components/Contractor/Payments/ViewPaymentFlow/index.d.ts +2 -0
  261. package/dist/components/Contractor/Payments/ViewPaymentFlow/viewPaymentMachine.d.ts +8 -0
  262. package/dist/components/Contractor/Payments/ViewPaymentFlow/viewPaymentMachine.js +51 -0
  263. package/dist/components/Contractor/Payments/ViewPaymentFlow/viewPaymentMachine.js.map +1 -0
  264. package/dist/components/Contractor/Payments/ViewPaymentFlow/viewPaymentMachine.test.d.ts +1 -0
  265. package/dist/components/Contractor/Payments/shared/SetPaymentAmounts/EditContractorPaymentFormSchema.js.map +1 -0
  266. package/dist/components/Contractor/Payments/shared/SetPaymentAmounts/EditContractorPaymentPresentation.d.ts +44 -0
  267. package/dist/components/Contractor/Payments/shared/SetPaymentAmounts/EditContractorPaymentPresentation.js +128 -0
  268. package/dist/components/Contractor/Payments/shared/SetPaymentAmounts/EditContractorPaymentPresentation.js.map +1 -0
  269. package/dist/components/Contractor/Payments/shared/SetPaymentAmounts/SetPaymentAmounts.d.ts +52 -0
  270. package/dist/components/Contractor/Payments/shared/SetPaymentAmounts/SetPaymentAmounts.js +131 -0
  271. package/dist/components/Contractor/Payments/shared/SetPaymentAmounts/SetPaymentAmounts.js.map +1 -0
  272. package/dist/components/Contractor/Payments/shared/SetPaymentAmounts/index.d.ts +1 -0
  273. package/dist/components/Contractor/Payments/shared/historicalPaymentDateBounds.d.ts +19 -0
  274. package/dist/components/Contractor/Payments/shared/historicalPaymentDateBounds.js +13 -0
  275. package/dist/components/Contractor/Payments/shared/historicalPaymentDateBounds.js.map +1 -0
  276. package/dist/components/Contractor/Payments/shared/historicalPaymentDateBounds.test.d.ts +1 -0
  277. package/dist/components/Contractor/Payments/shared/usePaymentAmountsEditor.d.ts +1 -1
  278. package/dist/components/Contractor/Payments/shared/usePaymentAmountsEditor.js +44 -35
  279. package/dist/components/Contractor/Payments/shared/usePaymentAmountsEditor.js.map +1 -1
  280. package/dist/components/Contractor/Profile/management/Profile.d.ts +30 -0
  281. package/dist/components/Contractor/Profile/management/Profile.js +43 -0
  282. package/dist/components/Contractor/Profile/management/Profile.js.map +1 -0
  283. package/dist/components/Contractor/Profile/management/ProfileCard/ProfileCard.d.ts +35 -0
  284. package/dist/components/Contractor/Profile/management/ProfileCard/ProfileCard.js +55 -0
  285. package/dist/components/Contractor/Profile/management/ProfileCard/ProfileCard.js.map +1 -0
  286. package/dist/components/Contractor/Profile/management/ProfileCard/index.d.ts +1 -0
  287. package/dist/components/Contractor/Profile/management/ProfileComponents.d.ts +12 -0
  288. package/dist/components/Contractor/Profile/management/ProfileComponents.js +48 -0
  289. package/dist/components/Contractor/Profile/management/ProfileComponents.js.map +1 -0
  290. package/dist/components/Contractor/Profile/management/ProfileEditForm.d.ts +32 -0
  291. package/dist/components/Contractor/Profile/management/ProfileEditForm.js +235 -0
  292. package/dist/components/Contractor/Profile/management/ProfileEditForm.js.map +1 -0
  293. package/dist/components/Contractor/Profile/management/ProfileEditForm.module.scss.js +16 -0
  294. package/dist/components/Contractor/Profile/management/ProfileEditForm.module.scss.js.map +1 -0
  295. package/dist/components/Contractor/Profile/management/index.d.ts +3 -0
  296. package/dist/components/Contractor/Profile/management/profileStateMachine.d.ts +5 -0
  297. package/dist/components/Contractor/Profile/management/profileStateMachine.js +37 -0
  298. package/dist/components/Contractor/Profile/management/profileStateMachine.js.map +1 -0
  299. package/dist/components/Contractor/Profile/{BusinessSelfOnboardingProfile.d.ts → onboarding/BusinessSelfOnboardingProfile.d.ts} +1 -1
  300. package/dist/components/Contractor/Profile/{BusinessSelfOnboardingProfile.js → onboarding/BusinessSelfOnboardingProfile.js} +34 -26
  301. package/dist/components/Contractor/Profile/onboarding/BusinessSelfOnboardingProfile.js.map +1 -0
  302. package/dist/components/Contractor/Profile/{ContractorProfile.d.ts → onboarding/ContractorProfile.d.ts} +2 -2
  303. package/dist/components/Contractor/Profile/{ContractorProfile.js → onboarding/ContractorProfile.js} +82 -63
  304. package/dist/components/Contractor/Profile/onboarding/ContractorProfile.js.map +1 -0
  305. package/dist/components/Contractor/Profile/{IndividualSelfOnboardingProfile.d.ts → onboarding/IndividualSelfOnboardingProfile.d.ts} +1 -1
  306. package/dist/components/Contractor/Profile/onboarding/IndividualSelfOnboardingProfile.js +104 -0
  307. package/dist/components/Contractor/Profile/onboarding/IndividualSelfOnboardingProfile.js.map +1 -0
  308. package/dist/components/Contractor/Profile/{SelfOnboardingContractorProfile.d.ts → onboarding/SelfOnboardingContractorProfile.d.ts} +6 -3
  309. package/dist/components/Contractor/Profile/onboarding/SelfOnboardingContractorProfile.js +43 -0
  310. package/dist/components/Contractor/Profile/onboarding/SelfOnboardingContractorProfile.js.map +1 -0
  311. package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/fields.js +16 -16
  312. package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/useContractorDetailsForm.d.ts +13 -3
  313. package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/useContractorDetailsForm.js +93 -92
  314. package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/useContractorDetailsForm.js.map +1 -1
  315. package/dist/components/Contractor/Profile/shared/useContractorProfileSummary/index.d.ts +1 -0
  316. package/dist/components/Contractor/Profile/shared/useContractorProfileSummary/useContractorProfileSummary.d.ts +17 -0
  317. package/dist/components/Contractor/Profile/shared/useContractorProfileSummary/useContractorProfileSummary.js +23 -0
  318. package/dist/components/Contractor/Profile/shared/useContractorProfileSummary/useContractorProfileSummary.js.map +1 -0
  319. package/dist/components/Contractor/SelfOnboardingFlow/SelfOnboardingComponents.js +12 -12
  320. package/dist/components/Contractor/SelfOnboardingFlow/SelfOnboardingComponents.js.map +1 -1
  321. package/dist/components/Contractor/Submit/Submit.js +1 -1
  322. package/dist/components/Contractor/Submit/Submit.js.map +1 -1
  323. package/dist/components/Contractor/exports/contractorManagement.d.ts +15 -0
  324. package/dist/components/Contractor/exports/contractorManagement.js +51 -13
  325. package/dist/components/Contractor/exports/contractorManagement.js.map +1 -1
  326. package/dist/components/Contractor/exports/contractorOnboarding.d.ts +8 -8
  327. package/dist/components/Contractor/exports/contractorOnboarding.js +13 -13
  328. package/dist/components/Contractor/shared/SelectContractors/SelectContractors.d.ts +19 -0
  329. package/dist/components/Contractor/shared/SelectContractors/SelectContractors.js +39 -0
  330. package/dist/components/Contractor/shared/SelectContractors/SelectContractors.js.map +1 -0
  331. package/dist/components/Contractor/shared/SelectContractors/SelectContractorsPresentation.d.ts +3 -0
  332. package/dist/components/Contractor/shared/SelectContractors/SelectContractorsPresentation.js +78 -0
  333. package/dist/components/Contractor/shared/SelectContractors/SelectContractorsPresentation.js.map +1 -0
  334. package/dist/components/Contractor/shared/SelectContractors/SelectContractorsPresentation.module.scss.js +10 -0
  335. package/dist/components/Contractor/shared/SelectContractors/SelectContractorsPresentation.module.scss.js.map +1 -0
  336. package/dist/components/Contractor/shared/SelectContractors/SelectContractorsPresentationTypes.d.ts +18 -0
  337. package/dist/components/Contractor/shared/SelectContractors/useSelectContractors.d.ts +58 -0
  338. package/dist/components/Contractor/shared/SelectContractors/useSelectContractors.js +82 -0
  339. package/dist/components/Contractor/shared/SelectContractors/useSelectContractors.js.map +1 -0
  340. package/dist/components/Contractor/shared/SelectContractors/useSelectContractors.test.d.ts +1 -0
  341. package/dist/components/Contractor/{Payments/CreatePayment → shared}/helpers.js +1 -1
  342. package/dist/components/Contractor/shared/helpers.js.map +1 -0
  343. package/dist/components/Contractor/shared/useContractorHasSignedW9.js +1 -1
  344. package/dist/components/Contractor/shared/useContractorHasSignedW9.js.map +1 -1
  345. package/dist/components/Employee/Compensation/management/Compensation.d.ts +1 -1
  346. package/dist/components/Employee/Compensation/management/Compensation.js +30 -23
  347. package/dist/components/Employee/Compensation/management/Compensation.js.map +1 -1
  348. package/dist/components/Employee/Compensation/management/CompensationAddAnotherJobForm/CompensationAddAnotherJobForm.d.ts +4 -2
  349. package/dist/components/Employee/Compensation/management/CompensationAddAnotherJobForm/CompensationAddAnotherJobForm.js +55 -46
  350. package/dist/components/Employee/Compensation/management/CompensationAddAnotherJobForm/CompensationAddAnotherJobForm.js.map +1 -1
  351. package/dist/components/Employee/Compensation/management/CompensationAddJobForm/CompensationAddJobForm.d.ts +4 -2
  352. package/dist/components/Employee/Compensation/management/CompensationAddJobForm/CompensationAddJobForm.js +37 -21
  353. package/dist/components/Employee/Compensation/management/CompensationAddJobForm/CompensationAddJobForm.js.map +1 -1
  354. package/dist/components/Employee/Compensation/management/CompensationCard/CompensationCard.d.ts +4 -1
  355. package/dist/components/Employee/Compensation/management/CompensationCard/CompensationCard.js +122 -102
  356. package/dist/components/Employee/Compensation/management/CompensationCard/CompensationCard.js.map +1 -1
  357. package/dist/components/Employee/Compensation/management/CompensationComponents.js +44 -22
  358. package/dist/components/Employee/Compensation/management/CompensationComponents.js.map +1 -1
  359. package/dist/components/Employee/Compensation/management/CompensationEditForm/CompensationEditForm.d.ts +4 -2
  360. package/dist/components/Employee/Compensation/management/CompensationEditForm/CompensationEditForm.js +29 -26
  361. package/dist/components/Employee/Compensation/management/CompensationEditForm/CompensationEditForm.js.map +1 -1
  362. package/dist/components/Employee/Compensation/management/CompensationEditJobForm/CompensationEditJobForm.d.ts +4 -2
  363. package/dist/components/Employee/Compensation/management/CompensationEditJobForm/CompensationEditJobForm.js +74 -46
  364. package/dist/components/Employee/Compensation/management/CompensationEditJobForm/CompensationEditJobForm.js.map +1 -1
  365. package/dist/components/Employee/Compensation/management/CompensationEditPendingJobForm/CompensationEditPendingJobForm.d.ts +4 -2
  366. package/dist/components/Employee/Compensation/management/CompensationEditPendingJobForm/CompensationEditPendingJobForm.js +62 -53
  367. package/dist/components/Employee/Compensation/management/CompensationEditPendingJobForm/CompensationEditPendingJobForm.js.map +1 -1
  368. package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.d.ts +4 -2
  369. package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.js +46 -45
  370. package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.js.map +1 -1
  371. package/dist/components/Employee/Compensation/onboarding/compensationStateMachine.d.ts +12 -2
  372. package/dist/components/Employee/Compensation/onboarding/compensationStateMachine.js +32 -35
  373. package/dist/components/Employee/Compensation/onboarding/compensationStateMachine.js.map +1 -1
  374. package/dist/components/Employee/Compensation/onboarding/compensationStateMachine.test.d.ts +1 -0
  375. package/dist/components/Employee/Compensation/shared/useCompensationForm/fields.js +4 -4
  376. package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.js +20 -20
  377. package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.js.map +1 -1
  378. package/dist/components/Employee/Compensation/shared/useJobForm/fields.js +6 -6
  379. package/dist/components/Employee/Dashboard/Dashboard.d.ts +1 -1
  380. package/dist/components/Employee/Dashboard/Dashboard.js +50 -34
  381. package/dist/components/Employee/Dashboard/Dashboard.js.map +1 -1
  382. package/dist/components/Employee/Deductions/management/Deductions.d.ts +1 -1
  383. package/dist/components/Employee/Deductions/management/Deductions.js +30 -23
  384. package/dist/components/Employee/Deductions/management/Deductions.js.map +1 -1
  385. package/dist/components/Employee/Deductions/management/DeductionsCard/DeductionsCard.d.ts +4 -1
  386. package/dist/components/Employee/Deductions/management/DeductionsCard/DeductionsCard.js +61 -54
  387. package/dist/components/Employee/Deductions/management/DeductionsCard/DeductionsCard.js.map +1 -1
  388. package/dist/components/Employee/Deductions/management/DeductionsComponents.js +27 -19
  389. package/dist/components/Employee/Deductions/management/DeductionsComponents.js.map +1 -1
  390. package/dist/components/Employee/Deductions/management/DeductionsEditForm/DeductionsEditForm.d.ts +1 -1
  391. package/dist/components/Employee/Deductions/management/DeductionsEditForm/DeductionsEditForm.js +40 -33
  392. package/dist/components/Employee/Deductions/management/DeductionsEditForm/DeductionsEditForm.js.map +1 -1
  393. package/dist/components/Employee/Deductions/onboarding/Deductions.d.ts +1 -1
  394. package/dist/components/Employee/Deductions/onboarding/Deductions.js +28 -19
  395. package/dist/components/Employee/Deductions/onboarding/Deductions.js.map +1 -1
  396. package/dist/components/Employee/Deductions/onboarding/deductionsContextualComponents.js +39 -38
  397. package/dist/components/Employee/Deductions/onboarding/deductionsContextualComponents.js.map +1 -1
  398. package/dist/components/Employee/Deductions/onboarding/stateMachine.d.ts +12 -2
  399. package/dist/components/Employee/Deductions/onboarding/stateMachine.js +18 -20
  400. package/dist/components/Employee/Deductions/onboarding/stateMachine.js.map +1 -1
  401. package/dist/components/Employee/Deductions/onboarding/stateMachine.test.d.ts +1 -0
  402. package/dist/components/Employee/Deductions/shared/DeductionsForm/ChildSupportFormView.d.ts +3 -1
  403. package/dist/components/Employee/Deductions/shared/DeductionsForm/ChildSupportFormView.js +20 -19
  404. package/dist/components/Employee/Deductions/shared/DeductionsForm/ChildSupportFormView.js.map +1 -1
  405. package/dist/components/Employee/Deductions/shared/DeductionsForm/DeductionsForm.d.ts +4 -1
  406. package/dist/components/Employee/Deductions/shared/DeductionsForm/DeductionsForm.js +48 -44
  407. package/dist/components/Employee/Deductions/shared/DeductionsForm/DeductionsForm.js.map +1 -1
  408. package/dist/components/Employee/Deductions/shared/DeductionsForm/StandardDeductionForm.d.ts +3 -1
  409. package/dist/components/Employee/Deductions/shared/DeductionsForm/StandardDeductionForm.js +41 -38
  410. package/dist/components/Employee/Deductions/shared/DeductionsForm/StandardDeductionForm.js.map +1 -1
  411. package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/fields.js +8 -8
  412. package/dist/components/Employee/Deductions/shared/useDeductionForm/fields.js +4 -4
  413. package/dist/components/Employee/Documents/management/Documents.d.ts +1 -1
  414. package/dist/components/Employee/Documents/management/Documents.js +25 -18
  415. package/dist/components/Employee/Documents/management/Documents.js.map +1 -1
  416. package/dist/components/Employee/Documents/management/DocumentsCard/DocumentsCard.d.ts +3 -0
  417. package/dist/components/Employee/Documents/management/DocumentsCard/DocumentsCard.js +26 -19
  418. package/dist/components/Employee/Documents/management/DocumentsCard/DocumentsCard.js.map +1 -1
  419. package/dist/components/Employee/Documents/management/DocumentsComponents.js +22 -14
  420. package/dist/components/Employee/Documents/management/DocumentsComponents.js.map +1 -1
  421. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js +4 -3
  422. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  423. package/dist/components/Employee/Documents/onboarding/DocumentSigner/stateMachine.d.ts +12 -2
  424. package/dist/components/Employee/Documents/onboarding/DocumentSigner/stateMachine.js +35 -37
  425. package/dist/components/Employee/Documents/onboarding/DocumentSigner/stateMachine.js.map +1 -1
  426. package/dist/components/Employee/Documents/onboarding/DocumentSigner/stateMachine.test.d.ts +1 -0
  427. package/dist/components/Employee/Documents/shared/useSignEmployeeForm/fields.js +1 -1
  428. package/dist/components/Employee/EmployeeList/management/ManagementEmployeeList.d.ts +3 -2
  429. package/dist/components/Employee/EmployeeList/management/ManagementEmployeeList.js +53 -43
  430. package/dist/components/Employee/EmployeeList/management/ManagementEmployeeList.js.map +1 -1
  431. package/dist/components/Employee/EmployeeList/management/ManagementEmployeeListView.js +1 -1
  432. package/dist/components/Employee/EmployeeList/management/ManagementEmployeeListView.js.map +1 -1
  433. package/dist/components/Employee/EmployeeList/onboarding/EmployeeList.d.ts +1 -1
  434. package/dist/components/Employee/EmployeeList/onboarding/EmployeeList.js +56 -40
  435. package/dist/components/Employee/EmployeeList/onboarding/EmployeeList.js.map +1 -1
  436. package/dist/components/Employee/FederalTaxes/management/FederalTaxes.d.ts +1 -1
  437. package/dist/components/Employee/FederalTaxes/management/FederalTaxes.js +28 -21
  438. package/dist/components/Employee/FederalTaxes/management/FederalTaxes.js.map +1 -1
  439. package/dist/components/Employee/FederalTaxes/management/FederalTaxesCard/FederalTaxesCard.d.ts +3 -0
  440. package/dist/components/Employee/FederalTaxes/management/FederalTaxesCard/FederalTaxesCard.js +31 -24
  441. package/dist/components/Employee/FederalTaxes/management/FederalTaxesCard/FederalTaxesCard.js.map +1 -1
  442. package/dist/components/Employee/FederalTaxes/management/FederalTaxesComponents.js +27 -13
  443. package/dist/components/Employee/FederalTaxes/management/FederalTaxesComponents.js.map +1 -1
  444. package/dist/components/Employee/FederalTaxes/management/FederalTaxesEditForm.d.ts +1 -1
  445. package/dist/components/Employee/FederalTaxes/management/FederalTaxesEditForm.js +54 -40
  446. package/dist/components/Employee/FederalTaxes/management/FederalTaxesEditForm.js.map +1 -1
  447. package/dist/components/Employee/FederalTaxes/onboarding/FederalTaxes.d.ts +1 -1
  448. package/dist/components/Employee/FederalTaxes/onboarding/FederalTaxes.js +47 -30
  449. package/dist/components/Employee/FederalTaxes/onboarding/FederalTaxes.js.map +1 -1
  450. package/dist/components/Employee/FederalTaxes/shared/FederalTaxesView.d.ts +3 -1
  451. package/dist/components/Employee/FederalTaxes/shared/FederalTaxesView.js +15 -14
  452. package/dist/components/Employee/FederalTaxes/shared/FederalTaxesView.js.map +1 -1
  453. package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/fields.js +4 -4
  454. package/dist/components/Employee/HomeAddress/management/HomeAddress.d.ts +1 -1
  455. package/dist/components/Employee/HomeAddress/management/HomeAddress.js +27 -20
  456. package/dist/components/Employee/HomeAddress/management/HomeAddress.js.map +1 -1
  457. package/dist/components/Employee/HomeAddress/management/HomeAddressCard/HomeAddressCard.d.ts +3 -0
  458. package/dist/components/Employee/HomeAddress/management/HomeAddressCard/HomeAddressCard.js +30 -23
  459. package/dist/components/Employee/HomeAddress/management/HomeAddressCard/HomeAddressCard.js.map +1 -1
  460. package/dist/components/Employee/HomeAddress/management/HomeAddressComponents.js +26 -12
  461. package/dist/components/Employee/HomeAddress/management/HomeAddressComponents.js.map +1 -1
  462. package/dist/components/Employee/HomeAddress/management/HomeAddressEditForm.d.ts +1 -1
  463. package/dist/components/Employee/HomeAddress/management/HomeAddressEditForm.js +39 -22
  464. package/dist/components/Employee/HomeAddress/management/HomeAddressEditForm.js.map +1 -1
  465. package/dist/components/Employee/PaymentMethod/management/PaymentMethod.d.ts +1 -1
  466. package/dist/components/Employee/PaymentMethod/management/PaymentMethod.js +37 -29
  467. package/dist/components/Employee/PaymentMethod/management/PaymentMethod.js.map +1 -1
  468. package/dist/components/Employee/PaymentMethod/management/PaymentMethodCard.d.ts +4 -1
  469. package/dist/components/Employee/PaymentMethod/management/PaymentMethodCard.js +81 -68
  470. package/dist/components/Employee/PaymentMethod/management/PaymentMethodCard.js.map +1 -1
  471. package/dist/components/Employee/PaymentMethod/management/PaymentMethodComponents.js +28 -21
  472. package/dist/components/Employee/PaymentMethod/management/PaymentMethodComponents.js.map +1 -1
  473. package/dist/components/Employee/PaymentMethod/onboarding/ListView.d.ts +3 -1
  474. package/dist/components/Employee/PaymentMethod/onboarding/ListView.js +83 -81
  475. package/dist/components/Employee/PaymentMethod/onboarding/ListView.js.map +1 -1
  476. package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethod.d.ts +1 -1
  477. package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethod.js +54 -27
  478. package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethod.js.map +1 -1
  479. package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethodComponents.js +17 -9
  480. package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethodComponents.js.map +1 -1
  481. package/dist/components/Employee/PaymentMethod/shared/BankFormBody/BankFormBody.d.ts +3 -1
  482. package/dist/components/Employee/PaymentMethod/shared/BankFormBody/BankFormBody.js +31 -23
  483. package/dist/components/Employee/PaymentMethod/shared/BankFormBody/BankFormBody.js.map +1 -1
  484. package/dist/components/Employee/PaymentMethod/shared/SplitPaymentsFormBody/SplitPaymentsFormBody.d.ts +3 -1
  485. package/dist/components/Employee/PaymentMethod/shared/SplitPaymentsFormBody/SplitPaymentsFormBody.js +81 -64
  486. package/dist/components/Employee/PaymentMethod/shared/SplitPaymentsFormBody/SplitPaymentsFormBody.js.map +1 -1
  487. package/dist/components/Employee/PaymentMethod/shared/useBankForm/fields.js +1 -1
  488. package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/splitFieldFactory.js +4 -4
  489. package/dist/components/Employee/Paystubs/management/PaystubsCard/PaystubsCard.d.ts +4 -1
  490. package/dist/components/Employee/Paystubs/management/PaystubsCard/PaystubsCard.js +69 -67
  491. package/dist/components/Employee/Paystubs/management/PaystubsCard/PaystubsCard.js.map +1 -1
  492. package/dist/components/Employee/Profile/management/Profile.d.ts +1 -1
  493. package/dist/components/Employee/Profile/management/Profile.js +31 -24
  494. package/dist/components/Employee/Profile/management/Profile.js.map +1 -1
  495. package/dist/components/Employee/Profile/management/ProfileCard/ProfileCard.d.ts +4 -1
  496. package/dist/components/Employee/Profile/management/ProfileCard/ProfileCard.js +26 -26
  497. package/dist/components/Employee/Profile/management/ProfileCard/ProfileCard.js.map +1 -1
  498. package/dist/components/Employee/Profile/management/ProfileComponents.js +27 -13
  499. package/dist/components/Employee/Profile/management/ProfileComponents.js.map +1 -1
  500. package/dist/components/Employee/Profile/management/ProfileEditForm.d.ts +1 -1
  501. package/dist/components/Employee/Profile/management/ProfileEditForm.js +65 -47
  502. package/dist/components/Employee/Profile/management/ProfileEditForm.js.map +1 -1
  503. package/dist/components/Employee/Profile/onboarding/AdminProfile.d.ts +1 -1
  504. package/dist/components/Employee/Profile/onboarding/AdminProfile.js +105 -102
  505. package/dist/components/Employee/Profile/onboarding/AdminProfile.js.map +1 -1
  506. package/dist/components/Employee/Profile/onboarding/EmployeeProfile.d.ts +1 -1
  507. package/dist/components/Employee/Profile/onboarding/EmployeeProfile.js +46 -45
  508. package/dist/components/Employee/Profile/onboarding/EmployeeProfile.js.map +1 -1
  509. package/dist/components/Employee/Profile/onboarding/Profile.d.ts +1 -1
  510. package/dist/components/Employee/Profile/onboarding/Profile.js +37 -15
  511. package/dist/components/Employee/Profile/onboarding/Profile.js.map +1 -1
  512. package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/fields.js +8 -8
  513. package/dist/components/Employee/Profile/shared/useHomeAddressForm/fields.js +5 -5
  514. package/dist/components/Employee/Profile/shared/useWorkAddressForm/fields.js +4 -4
  515. package/dist/components/Employee/Profile/shared/useWorkAddressForm/useWorkAddressForm.js +18 -15
  516. package/dist/components/Employee/Profile/shared/useWorkAddressForm/useWorkAddressForm.js.map +1 -1
  517. package/dist/components/Employee/StateTaxes/management/StateTaxes.d.ts +1 -1
  518. package/dist/components/Employee/StateTaxes/management/StateTaxes.js +29 -22
  519. package/dist/components/Employee/StateTaxes/management/StateTaxes.js.map +1 -1
  520. package/dist/components/Employee/StateTaxes/management/StateTaxesCard/StateTaxesCard.d.ts +4 -1
  521. package/dist/components/Employee/StateTaxes/management/StateTaxesCard/StateTaxesCard.js +37 -30
  522. package/dist/components/Employee/StateTaxes/management/StateTaxesCard/StateTaxesCard.js.map +1 -1
  523. package/dist/components/Employee/StateTaxes/management/StateTaxesComponents.js +33 -19
  524. package/dist/components/Employee/StateTaxes/management/StateTaxesComponents.js.map +1 -1
  525. package/dist/components/Employee/StateTaxes/management/StateTaxesEditForm.d.ts +1 -1
  526. package/dist/components/Employee/StateTaxes/management/StateTaxesEditForm.js +46 -32
  527. package/dist/components/Employee/StateTaxes/management/StateTaxesEditForm.js.map +1 -1
  528. package/dist/components/Employee/StateTaxes/onboarding/StateTaxes.d.ts +1 -1
  529. package/dist/components/Employee/StateTaxes/onboarding/StateTaxes.js +48 -31
  530. package/dist/components/Employee/StateTaxes/onboarding/StateTaxes.js.map +1 -1
  531. package/dist/components/Employee/StateTaxes/shared/EmployeeStateTaxesView.d.ts +3 -1
  532. package/dist/components/Employee/StateTaxes/shared/EmployeeStateTaxesView.js +19 -18
  533. package/dist/components/Employee/StateTaxes/shared/EmployeeStateTaxesView.js.map +1 -1
  534. package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fieldComponents.js +8 -8
  535. package/dist/components/Employee/WorkAddress/management/WorkAddress.d.ts +1 -1
  536. package/dist/components/Employee/WorkAddress/management/WorkAddress.js +27 -20
  537. package/dist/components/Employee/WorkAddress/management/WorkAddress.js.map +1 -1
  538. package/dist/components/Employee/WorkAddress/management/WorkAddressCard/WorkAddressCard.d.ts +3 -0
  539. package/dist/components/Employee/WorkAddress/management/WorkAddressCard/WorkAddressCard.js +35 -28
  540. package/dist/components/Employee/WorkAddress/management/WorkAddressCard/WorkAddressCard.js.map +1 -1
  541. package/dist/components/Employee/WorkAddress/management/WorkAddressComponents.js +26 -12
  542. package/dist/components/Employee/WorkAddress/management/WorkAddressComponents.js.map +1 -1
  543. package/dist/components/Employee/WorkAddress/management/WorkAddressEditForm.d.ts +1 -1
  544. package/dist/components/Employee/WorkAddress/management/WorkAddressEditForm.js +40 -23
  545. package/dist/components/Employee/WorkAddress/management/WorkAddressEditForm.js.map +1 -1
  546. package/dist/components/Flow/useFlow.d.ts +7 -1
  547. package/dist/components/Flow/useFlow.js.map +1 -1
  548. package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js +125 -101
  549. package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -1
  550. package/dist/components/InformationRequests/InformationRequestForm/index.d.ts +1 -1
  551. package/dist/components/InformationRequests/InformationRequests.d.ts +1 -1
  552. package/dist/components/InformationRequests/InformationRequests.js +52 -50
  553. package/dist/components/InformationRequests/InformationRequests.js.map +1 -1
  554. package/dist/components/InformationRequests/InformationRequestsComponents.d.ts +3 -0
  555. package/dist/components/InformationRequests/InformationRequestsComponents.js +12 -10
  556. package/dist/components/InformationRequests/InformationRequestsComponents.js.map +1 -1
  557. package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +3 -2
  558. package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
  559. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +94 -92
  560. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
  561. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js +15 -15
  562. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js.map +1 -1
  563. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +1 -1
  564. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
  565. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +103 -97
  566. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
  567. package/dist/components/Payroll/PayrollStatusBadges/payrollStatusConfig.d.ts +1 -1
  568. package/dist/components/Payroll/PayrollStatusBadges/payrollStatusConfig.js +1 -9
  569. package/dist/components/Payroll/PayrollStatusBadges/payrollStatusConfig.js.map +1 -1
  570. package/dist/components/Payroll/usePreparedPayrollData.js +9 -8
  571. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  572. package/dist/components/TimeOff/PolicyList/PolicyList.d.ts +1 -1
  573. package/dist/components/TimeOff/PolicyList/PolicyList.js +71 -70
  574. package/dist/components/TimeOff/PolicyList/PolicyList.js.map +1 -1
  575. package/dist/i18n/I18n.js +15 -5
  576. package/dist/i18n/I18n.js.map +1 -1
  577. package/dist/i18n/en/Contractor.BankAccountFields.json.js +26 -0
  578. package/dist/i18n/en/Contractor.BankAccountFields.json.js.map +1 -0
  579. package/dist/i18n/en/Contractor.Dashboard.json.js +14 -0
  580. package/dist/i18n/en/Contractor.Dashboard.json.js.map +1 -0
  581. package/dist/i18n/en/Contractor.Management.Address.json.js +16 -0
  582. package/dist/i18n/en/Contractor.Management.Address.json.js.map +1 -0
  583. package/dist/i18n/en/Contractor.Management.Compensation.json.js +26 -0
  584. package/dist/i18n/en/Contractor.Management.Compensation.json.js.map +1 -0
  585. package/dist/i18n/en/Contractor.Management.Documents.json.js +24 -0
  586. package/dist/i18n/en/Contractor.Management.Documents.json.js.map +1 -0
  587. package/dist/i18n/en/Contractor.Management.PaymentMethod.json.js +34 -0
  588. package/dist/i18n/en/Contractor.Management.PaymentMethod.json.js.map +1 -0
  589. package/dist/i18n/en/Contractor.Management.Profile.json.js +26 -0
  590. package/dist/i18n/en/Contractor.Management.Profile.json.js.map +1 -0
  591. package/dist/i18n/en/Contractor.Payments.HistoricalPaymentAmounts.json.js +36 -0
  592. package/dist/i18n/en/Contractor.Payments.HistoricalPaymentAmounts.json.js.map +1 -0
  593. package/dist/i18n/en/Contractor.Payments.HistoricalPaymentContractors.json.js +18 -0
  594. package/dist/i18n/en/Contractor.Payments.HistoricalPaymentContractors.json.js.map +1 -0
  595. package/dist/i18n/en/Contractor.SelectContractors.json.js +20 -0
  596. package/dist/i18n/en/Contractor.SelectContractors.json.js.map +1 -0
  597. package/dist/i18n/en/Contractor.SignatureForm.json.js +5 -5
  598. package/dist/i18n/en/Employee.ManagementEmployeeList.json.js +18 -20
  599. package/dist/i18n/en/Employee.ManagementEmployeeList.json.js.map +1 -1
  600. package/dist/i18n/en/Payroll.Common.json.js +1 -1
  601. package/dist/i18n/types.d.ts +476 -10
  602. package/dist/index.d.ts +7 -5
  603. package/dist/index.js +93 -88
  604. package/dist/index.js.map +1 -1
  605. package/dist/shared/constants.d.ts +60 -0
  606. package/dist/shared/constants.js +103 -76
  607. package/dist/shared/constants.js.map +1 -1
  608. package/dist/style.css +1 -1
  609. package/docs/guides/endpoint-inventory.json +176 -4
  610. package/package.json +27 -25
  611. package/dist/components/Contractor/Address/Address.js +0 -98
  612. package/dist/components/Contractor/Address/Address.js.map +0 -1
  613. package/dist/components/Contractor/Address/index.d.ts +0 -2
  614. package/dist/components/Contractor/Documents/DocumentSigner/DocumentSigner.js.map +0 -1
  615. package/dist/components/Contractor/Documents/DocumentSigner/documentSignerStateMachine.js.map +0 -1
  616. package/dist/components/Contractor/Documents/DocumentSigner/stateMachine.js.map +0 -1
  617. package/dist/components/Contractor/Documents/DocumentsList/DocumentsList.js +0 -83
  618. package/dist/components/Contractor/Documents/DocumentsList/DocumentsList.js.map +0 -1
  619. package/dist/components/Contractor/Documents/DocumentsList/index.d.ts +0 -2
  620. package/dist/components/Contractor/Documents/DocumentsList/useContractorDocumentsList/useContractorDocumentsList.js.map +0 -1
  621. package/dist/components/Contractor/Documents/SignatureForm/SignatureForm.js.map +0 -1
  622. package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/contractorSignatureFormSchema.js.map +0 -1
  623. package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/fields.js.map +0 -1
  624. package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/useContractorSignatureForm.js.map +0 -1
  625. package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/w9Fields.js.map +0 -1
  626. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +0 -114
  627. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +0 -1
  628. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentFormSchema.js.map +0 -1
  629. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.d.ts +0 -12
  630. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +0 -124
  631. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js.map +0 -1
  632. package/dist/components/Contractor/Payments/CreatePayment/helpers.js.map +0 -1
  633. package/dist/components/Contractor/Profile/BusinessSelfOnboardingProfile.js.map +0 -1
  634. package/dist/components/Contractor/Profile/ContractorProfile.js.map +0 -1
  635. package/dist/components/Contractor/Profile/IndividualSelfOnboardingProfile.js +0 -96
  636. package/dist/components/Contractor/Profile/IndividualSelfOnboardingProfile.js.map +0 -1
  637. package/dist/components/Contractor/Profile/SelfOnboardingContractorProfile.js +0 -40
  638. package/dist/components/Contractor/Profile/SelfOnboardingContractorProfile.js.map +0 -1
  639. package/dist/components/Contractor/Profile/index.d.ts +0 -1
  640. /package/dist/components/Contractor/Address/{Address.module.scss.js → onboarding/Address.module.scss.js} +0 -0
  641. /package/dist/components/Contractor/Address/{Address.module.scss.js.map → onboarding/Address.module.scss.js.map} +0 -0
  642. /package/dist/components/Contractor/Documents/{DocumentSigner → onboarding/DocumentSigner}/index.d.ts +0 -0
  643. /package/dist/components/Contractor/Documents/{DocumentSigner → onboarding/DocumentSigner}/stateMachine.d.ts +0 -0
  644. /package/dist/components/Contractor/Documents/{SignatureForm → shared/SignatureForm}/SignatureForm.module.scss.js +0 -0
  645. /package/dist/components/Contractor/Documents/{SignatureForm → shared/SignatureForm}/SignatureForm.module.scss.js.map +0 -0
  646. /package/dist/components/Contractor/Documents/{SignatureForm → shared/SignatureForm}/index.d.ts +0 -0
  647. /package/dist/components/Contractor/Documents/{SignatureForm → shared/SignatureForm}/useContractorSignatureForm/contractorSignatureFormSchema.test.d.ts +0 -0
  648. /package/dist/components/Contractor/Documents/{SignatureForm → shared/SignatureForm}/useContractorSignatureForm/index.d.ts +0 -0
  649. /package/dist/components/Contractor/Documents/{SignatureForm → shared/SignatureForm}/useContractorSignatureForm/w9Fields.d.ts +0 -0
  650. /package/dist/components/Contractor/Documents/{SignatureForm → shared/SignatureForm}/useContractorSignatureForm/w9Fields.js +0 -0
  651. /package/dist/components/Contractor/Documents/{SignatureForm → shared/SignatureForm}/useContractorSignatureForm/w9Fields.test.d.ts +0 -0
  652. /package/dist/components/Contractor/Documents/{DocumentsList → shared}/useContractorDocumentsList/index.d.ts +0 -0
  653. /package/dist/components/Contractor/Documents/{DocumentsList → shared}/useContractorDocumentsList/useContractorDocumentsList.d.ts +0 -0
  654. /package/dist/components/Contractor/Documents/{DocumentsList → shared}/useContractorDocumentsList/useContractorDocumentsList.js +0 -0
  655. /package/dist/components/Contractor/PaymentMethod/{PaymentMethod.module.scss.js → onboarding/PaymentMethod.module.scss.js} +0 -0
  656. /package/dist/components/Contractor/PaymentMethod/{PaymentMethod.module.scss.js.map → onboarding/PaymentMethod.module.scss.js.map} +0 -0
  657. /package/dist/components/Contractor/Payments/{CreatePayment → shared/SetPaymentAmounts}/EditContractorPaymentFormSchema.d.ts +0 -0
  658. /package/dist/components/Contractor/Payments/{CreatePayment → shared/SetPaymentAmounts}/EditContractorPaymentFormSchema.js +0 -0
  659. /package/dist/components/Contractor/Profile/{ContractorProfile.module.scss.js → onboarding/ContractorProfile.module.scss.js} +0 -0
  660. /package/dist/components/Contractor/Profile/{ContractorProfile.module.scss.js.map → onboarding/ContractorProfile.module.scss.js.map} +0 -0
  661. /package/dist/components/Contractor/{Payments/CreatePayment → shared}/helpers.d.ts +0 -0
@@ -1,144 +1,168 @@
1
- import { jsx as e, jsxs as p } from "react/jsx-runtime";
2
- import M from "dompurify";
3
- import { useTranslation as C } from "react-i18next";
4
- import { useForm as L, FormProvider as Q } from "react-hook-form";
5
- import { zodResolver as k } from "@hookform/resolvers/zod";
6
- import { z as l } from "zod";
7
- import "@tanstack/react-query";
8
- import { useInformationRequestsGetInformationRequestsSuspense as z } from "@gusto/embedded-api/react-query/informationRequestsGetInformationRequests";
9
- import { useInformationRequestsSubmitMutation as B } from "@gusto/embedded-api/react-query/informationRequestsSubmit";
10
- import { ResponseType as i } from "@gusto/embedded-api/models/components/informationrequest";
11
- import { ResponseType as v } from "@gusto/embedded-api/models/operations/submitinformationrequest";
12
- import s from "./InformationRequestForm.module.scss.js";
13
- import { BaseComponent as W } from "../../Base/Base.js";
14
- import { useBase as j } from "../../Base/useBase.js";
15
- import { Flex as E } from "../../Common/Flex/Flex.js";
16
- import { FileInputField as H } from "../../Common/Fields/FileInputField/FileInputField.js";
17
- import { Form as G } from "../../Common/Form/Form.js";
18
- import { useComponentContext as V } from "../../../contexts/ComponentAdapter/useComponentContext.js";
19
- import { useComponentDictionary as X, useI18n as Y } from "../../../i18n/I18n.js";
20
- import { informationRequestEvents as $ } from "../../../shared/constants.js";
21
- import "../../Flow/useFlow.js";
22
- import { TextInputField as J } from "../../Common/Fields/TextInputField/TextInputField.js";
23
- const K = "gusto-sdk-information-request-form", Z = ["image/jpeg", "image/png", "application/pdf"], ee = {
1
+ import { jsx as e, jsxs as m } from "react/jsx-runtime";
2
+ import B from "dompurify";
3
+ import { useTranslation as D } from "react-i18next";
4
+ import { useForm as W, FormProvider as H } from "react-hook-form";
5
+ import { zodResolver as G } from "@hookform/resolvers/zod";
6
+ import { z as f } from "zod";
7
+ import { useIsMutating as K } from "@tanstack/react-query";
8
+ import { useInformationRequestsGetInformationRequestsSuspense as _ } from "@gusto/embedded-api/react-query/informationRequestsGetInformationRequests";
9
+ import { useInformationRequestsSubmitMutation as V, mutationKeyInformationRequestsSubmit as X } from "@gusto/embedded-api/react-query/informationRequestsSubmit";
10
+ import { ResponseType as u } from "@gusto/embedded-api/models/components/informationrequest";
11
+ import { ResponseType as U } from "@gusto/embedded-api/models/operations/submitinformationrequest";
12
+ import i from "./InformationRequestForm.module.scss.js";
13
+ import { BaseComponent as Y } from "../../Base/Base.js";
14
+ import { useBase as $ } from "../../Base/useBase.js";
15
+ import { Flex as q } from "../../Common/Flex/Flex.js";
16
+ import { FileInputField as J } from "../../Common/Fields/FileInputField/FileInputField.js";
17
+ import { Form as Z } from "../../Common/Form/Form.js";
18
+ import { useComponentContext as P } from "../../../contexts/ComponentAdapter/useComponentContext.js";
19
+ import { useComponentDictionary as ee, useI18n as A } from "../../../i18n/I18n.js";
20
+ import { informationRequestEvents as C } from "../../../shared/constants.js";
21
+ import { useFlow as ne } from "../../Flow/useFlow.js";
22
+ import { TextInputField as te } from "../../Common/Fields/TextInputField/TextInputField.js";
23
+ const M = "gusto-sdk-information-request-form", oe = ["image/jpeg", "image/png", "application/pdf"], se = {
24
24
  ALLOWED_TAGS: ["a", "b", "strong"],
25
25
  ALLOWED_ATTR: ["target", "href", "rel"]
26
- }, oe = 5e3, ne = l.record(
27
- l.string(),
28
- l.union([l.string().min(1), l.instanceof(File)])
26
+ }, ie = 5e3, re = f.record(
27
+ f.string(),
28
+ f.union([f.string().min(1), f.instanceof(File)])
29
29
  );
30
- function be(t) {
31
- return /* @__PURE__ */ e(W, { ...t, children: /* @__PURE__ */ e(ae, { ...t, children: t.children }) });
30
+ function Ae(o) {
31
+ return /* @__PURE__ */ e(Y, { ...o, children: /* @__PURE__ */ e(me, { ...o, children: o.children }) });
32
32
  }
33
- const te = (t) => new Promise((r, h) => {
34
- const o = new FileReader();
35
- o.onload = () => {
36
- r(o.result);
37
- }, o.onerror = h, o.readAsDataURL(t);
38
- }), se = [i.Text, i.Document];
39
- function re(t) {
40
- return t.some((r) => !se.includes(r.responseType));
33
+ const ae = (o) => new Promise((s, r) => {
34
+ const n = new FileReader();
35
+ n.onload = () => {
36
+ s(n.result);
37
+ }, n.onerror = r, n.readAsDataURL(o);
38
+ }), ue = [u.Text, u.Document];
39
+ function O(o) {
40
+ return o.some((s) => !ue.includes(s.responseType));
41
41
  }
42
- function ie(t) {
43
- return t.some((r) => r.responseType === i.Persona);
42
+ function ce(o) {
43
+ return o.some((s) => s.responseType === u.Persona);
44
44
  }
45
- function ae({ companyId: t, requestId: r, dictionary: h }) {
46
- X("InformationRequests.InformationRequestForm", h), Y("InformationRequests.InformationRequestForm");
47
- const { t: o } = C("InformationRequests.InformationRequestForm"), { Alert: F, Heading: S, Text: a } = V(), { onEvent: x, baseSubmitHandler: N } = j(), { data: D } = z({
48
- companyUuid: t
49
- }), y = D.informationRequests?.find((n) => n.uuid === r), c = y?.requiredQuestions ?? [], U = y?.blockingPayroll ?? !1, b = re(c), g = ie(c), { mutateAsync: P } = B(), T = {}, R = [];
50
- c.forEach((n) => {
51
- n.responseType === i.Text ? (R.push(n.questionUuid), T[n.questionUuid] = "") : n.responseType === i.Document && (R.push(n.questionUuid), T[n.questionUuid] = void 0);
45
+ function me({ companyId: o, requestId: s, dictionary: r }) {
46
+ ee("InformationRequests.InformationRequestForm", r), A("InformationRequests.InformationRequestForm");
47
+ const { t: n } = D("InformationRequests.InformationRequestForm"), { Alert: T, Heading: y, Text: c } = P(), { onEvent: g, baseSubmitHandler: I } = $(), { data: x } = _({
48
+ companyUuid: o
49
+ }), l = x.informationRequests?.find((t) => t.uuid === s), a = l?.requiredQuestions ?? [], F = l?.blockingPayroll ?? !1, w = O(a), N = ce(a), { mutateAsync: Q } = V(), v = {}, E = [];
50
+ a.forEach((t) => {
51
+ t.responseType === u.Text ? (E.push(t.questionUuid), v[t.questionUuid] = "") : t.responseType === u.Document && (E.push(t.questionUuid), v[t.questionUuid] = void 0);
52
52
  });
53
- const I = L({
54
- resolver: k(ne),
55
- defaultValues: T
56
- }), _ = async (n) => {
57
- await N(n, async () => {
58
- const f = (await Promise.all(
59
- R.map(async (u) => {
60
- const m = n[u];
61
- if (typeof m == "string")
53
+ const b = W({
54
+ resolver: G(re),
55
+ defaultValues: v
56
+ }), L = async (t) => {
57
+ await I(t, async () => {
58
+ const h = (await Promise.all(
59
+ E.map(async (p) => {
60
+ const d = t[p];
61
+ if (typeof d == "string")
62
62
  return {
63
- questionUuid: u,
64
- responseType: v.Text,
65
- textResponse: m
63
+ questionUuid: p,
64
+ responseType: U.Text,
65
+ textResponse: d
66
66
  };
67
- if (m instanceof File) {
68
- const w = await te(m);
67
+ if (d instanceof File) {
68
+ const z = await ae(d);
69
69
  return {
70
- questionUuid: u,
71
- responseType: v.Document,
72
- fileResponse: w,
73
- fileName: m.name
70
+ questionUuid: p,
71
+ responseType: U.Document,
72
+ fileResponse: z,
73
+ fileName: d.name
74
74
  };
75
75
  }
76
76
  return null;
77
77
  })
78
- )).filter((u) => u !== null), q = await P({
78
+ )).filter((p) => p !== null), S = await Q({
79
79
  request: {
80
- informationRequestUuid: r,
80
+ informationRequestUuid: s,
81
81
  requestBody: {
82
- requiredQuestions: f
82
+ requiredQuestions: h
83
83
  }
84
84
  }
85
85
  });
86
- x($.INFORMATION_REQUEST_FORM_DONE, q.informationRequest);
86
+ g(C.INFORMATION_REQUEST_FORM_DONE, S.informationRequest);
87
87
  });
88
- }, A = (n) => {
89
- const d = n.questionUuid, f = n.responseType === i.Document, q = n.responseType === i.Text;
90
- return /* @__PURE__ */ p("div", { className: s.questionCard, children: [
91
- /* @__PURE__ */ p("div", { className: s.questionDescription, children: [
92
- /* @__PURE__ */ e(a, { size: "sm", weight: "medium", children: o(f ? "questionTypes.document" : "questionTypes.answer") }),
93
- /* @__PURE__ */ e(a, { size: "sm", variant: "supporting", children: /* @__PURE__ */ e(
88
+ }, k = (t) => {
89
+ const R = t.questionUuid, h = t.responseType === u.Document, S = t.responseType === u.Text;
90
+ return /* @__PURE__ */ m("div", { className: i.questionCard, children: [
91
+ /* @__PURE__ */ m("div", { className: i.questionDescription, children: [
92
+ /* @__PURE__ */ e(c, { size: "sm", weight: "medium", children: n(h ? "questionTypes.document" : "questionTypes.answer") }),
93
+ /* @__PURE__ */ e(c, { size: "sm", variant: "supporting", children: /* @__PURE__ */ e(
94
94
  "span",
95
95
  {
96
96
  dangerouslySetInnerHTML: {
97
- __html: M.sanitize(n.questionText, ee)
97
+ __html: B.sanitize(t.questionText, se)
98
98
  }
99
99
  }
100
100
  ) })
101
101
  ] }),
102
- /* @__PURE__ */ e("hr", { className: s.divider }),
103
- q && /* @__PURE__ */ e("div", { className: s.textInputWrapper, children: /* @__PURE__ */ e(
104
- J,
102
+ /* @__PURE__ */ e("hr", { className: i.divider }),
103
+ S && /* @__PURE__ */ e("div", { className: i.textInputWrapper, children: /* @__PURE__ */ e(
104
+ te,
105
105
  {
106
- name: d,
107
- label: o("fields.textAnswer.label"),
108
- placeholder: o("fields.textAnswer.placeholder"),
109
- maxLength: oe,
106
+ name: R,
107
+ label: n("fields.textAnswer.label"),
108
+ placeholder: n("fields.textAnswer.placeholder"),
109
+ maxLength: ie,
110
110
  isRequired: !0,
111
- errorMessage: o("validation.required")
111
+ errorMessage: n("validation.required")
112
112
  }
113
113
  ) }),
114
- f && /* @__PURE__ */ e("div", { className: s.fileInputWrapper, children: /* @__PURE__ */ e(
115
- H,
114
+ h && /* @__PURE__ */ e("div", { className: i.fileInputWrapper, children: /* @__PURE__ */ e(
115
+ J,
116
116
  {
117
- name: d,
118
- label: o("fields.fileUpload.label"),
119
- accept: Z,
117
+ name: R,
118
+ label: n("fields.fileUpload.label"),
119
+ accept: oe,
120
120
  isRequired: !0,
121
- errorMessage: o("validation.required")
121
+ errorMessage: n("validation.required")
122
122
  }
123
123
  ) })
124
- ] }, d);
125
- }, O = /* @__PURE__ */ p("div", { className: s.questionCard, children: [
126
- /* @__PURE__ */ p("div", { className: s.questionDescription, children: [
127
- /* @__PURE__ */ e(a, { weight: "medium", children: o(g ? "unsupported.persona.title" : "unsupported.generic.title") }),
128
- /* @__PURE__ */ e(a, { children: o(
129
- g ? "unsupported.persona.description" : "unsupported.generic.description"
124
+ ] }, R);
125
+ }, j = /* @__PURE__ */ m("div", { className: i.questionCard, children: [
126
+ /* @__PURE__ */ m("div", { className: i.questionDescription, children: [
127
+ /* @__PURE__ */ e(c, { weight: "medium", children: n(N ? "unsupported.persona.title" : "unsupported.generic.title") }),
128
+ /* @__PURE__ */ e(c, { children: n(
129
+ N ? "unsupported.persona.description" : "unsupported.generic.description"
130
130
  ) })
131
131
  ] }),
132
- /* @__PURE__ */ e("hr", { className: s.divider }),
133
- /* @__PURE__ */ e("div", { className: s.contactSupport, children: /* @__PURE__ */ e(a, { variant: "supporting", children: o("unsupported.contactSupport") }) })
132
+ /* @__PURE__ */ e("hr", { className: i.divider }),
133
+ /* @__PURE__ */ e("div", { className: i.contactSupport, children: /* @__PURE__ */ e(c, { variant: "supporting", children: n("unsupported.contactSupport") }) })
134
134
  ] });
135
- return /* @__PURE__ */ e("div", { className: s.root, children: /* @__PURE__ */ p(E, { flexDirection: "column", gap: 16, children: [
136
- /* @__PURE__ */ e(S, { as: "h2", children: o("title") }),
137
- U && /* @__PURE__ */ e(F, { status: "error", label: o("blockingAlert.title"), disableScrollIntoView: !0, children: o("blockingAlert.description") }),
138
- b ? O : /* @__PURE__ */ e(Q, { ...I, children: /* @__PURE__ */ e(G, { id: K, onSubmit: I.handleSubmit(_), children: /* @__PURE__ */ e(E, { flexDirection: "column", gap: 16, children: c.map(A) }) }) })
135
+ return /* @__PURE__ */ e("div", { className: i.root, children: /* @__PURE__ */ m(q, { flexDirection: "column", gap: 16, children: [
136
+ /* @__PURE__ */ e(y, { as: "h2", children: n("title") }),
137
+ F && /* @__PURE__ */ e(T, { status: "error", label: n("blockingAlert.title"), disableScrollIntoView: !0, children: n("blockingAlert.description") }),
138
+ w ? j : /* @__PURE__ */ e(H, { ...b, children: /* @__PURE__ */ e(Z, { id: M, onSubmit: b.handleSubmit(L), children: /* @__PURE__ */ e(q, { flexDirection: "column", gap: 16, children: a.map(k) }) }) })
139
139
  ] }) });
140
140
  }
141
+ function Ce({ onEvent: o }) {
142
+ A("InformationRequests.InformationRequestForm");
143
+ const { t: s } = D("InformationRequests.InformationRequestForm"), { Button: r } = P(), { companyId: n, selectedRequestId: T } = ne(), { data: y } = _({
144
+ companyUuid: n
145
+ }), g = y.informationRequests?.find((F) => F.uuid === T)?.requiredQuestions ?? [], I = O(g), l = K({
146
+ mutationKey: X()
147
+ }) > 0, a = () => {
148
+ o(C.INFORMATION_REQUEST_FORM_CANCEL);
149
+ };
150
+ return I ? /* @__PURE__ */ e(q, { justifyContent: "flex-end", gap: 12, children: /* @__PURE__ */ e(r, { variant: "secondary", onClick: a, children: s("cta.close") }) }) : /* @__PURE__ */ m(q, { justifyContent: "flex-end", gap: 12, children: [
151
+ /* @__PURE__ */ e(r, { variant: "secondary", onClick: a, isDisabled: l, children: s("cta.cancel") }),
152
+ /* @__PURE__ */ e(
153
+ r,
154
+ {
155
+ variant: "primary",
156
+ type: "submit",
157
+ form: M,
158
+ isLoading: l,
159
+ children: s("cta.submit")
160
+ }
161
+ )
162
+ ] });
163
+ }
141
164
  export {
142
- be as InformationRequestForm
165
+ Ce as Footer,
166
+ Ae as InformationRequestForm
143
167
  };
144
168
  //# sourceMappingURL=InformationRequestForm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"InformationRequestForm.js","sources":["../../../../src/components/InformationRequests/InformationRequestForm/InformationRequestForm.tsx"],"sourcesContent":["import DOMPurify from 'dompurify'\nimport { useTranslation } from 'react-i18next'\nimport { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { z } from 'zod'\nimport { useIsMutating } from '@tanstack/react-query'\nimport { useInformationRequestsGetInformationRequestsSuspense } from '@gusto/embedded-api/react-query/informationRequestsGetInformationRequests'\nimport {\n useInformationRequestsSubmitMutation,\n mutationKeyInformationRequestsSubmit,\n} from '@gusto/embedded-api/react-query/informationRequestsSubmit'\nimport type { RequiredQuestions } from '@gusto/embedded-api/models/components/informationrequest'\nimport { ResponseType } from '@gusto/embedded-api/models/components/informationrequest'\nimport { ResponseType as SubmitResponseType } from '@gusto/embedded-api/models/operations/submitinformationrequest'\nimport type { InformationRequestsContextInterface } from '../InformationRequestsComponents'\nimport styles from './InformationRequestForm.module.scss'\nimport { BaseComponent, useBase, type BaseComponentInterface } from '@/components/Base'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport { Flex, TextInputField } from '@/components/Common'\nimport { FileInputField } from '@/components/Common/Fields/FileInputField'\nimport { Form } from '@/components/Common/Form'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { informationRequestEvents, type EventType } from '@/shared/constants'\nimport { useFlow } from '@/components/Flow/useFlow'\n\nconst INFORMATION_REQUEST_FORM_ID = 'gusto-sdk-information-request-form'\nconst ACCEPTED_FILE_TYPES = ['image/jpeg', 'image/png', 'application/pdf']\nconst dompurifyConfig = {\n ALLOWED_TAGS: ['a', 'b', 'strong'],\n ALLOWED_ATTR: ['target', 'href', 'rel'],\n}\n\n/* API does not enforce an upper limit, so set a reasonable character max for a single-line input. */\nconst MAX_TEXT_RESPONSE = 5000\n\nconst InformationRequestFormSchema = z.record(\n z.string(),\n z.union([z.string().min(1), z.instanceof(File)]),\n)\n\ntype InformationRequestFormValues = z.infer<typeof InformationRequestFormSchema>\n\n/**\n * Props for {@link InformationRequestForm}.\n *\n * @public\n */\nexport interface InformationRequestFormProps extends BaseComponentInterface<'InformationRequests.InformationRequestForm'> {\n /** The associated company identifier. */\n companyId: string\n /** The identifier of the information request to respond to. */\n requestId: string\n /** Event handler invoked when the form is submitted or cancelled. See the events table in {@link InformationRequestForm}. */\n onEvent: OnEventType<EventType, unknown>\n}\n\n/**\n * Dynamic response form for a single information request.\n *\n * Renders supported question types (text and document upload) based on the request's\n * `requiredQuestions` payload and submits responses to the Submit information request\n * endpoint. Use this component directly when you have built your own list or routing\n * surface and need to host the form — typically inside a modal or page you control.\n *\n * Requests with unsupported response types (e.g. `persona`-driven identity verification)\n * display a guidance message instead of the form; in those cases the user must complete\n * the request through your own integration with the underlying provider.\n *\n * Text inputs accept up to 5,000 characters. Document uploads are restricted to JPEG,\n * PNG, or PDF.\n *\n * @remarks\n * Events emitted via `onEvent`:\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `informationRequest/form/done` | Fired when the form is successfully submitted | The `informationRequest` field from the Submit information request response |\n * | `informationRequest/form/cancel` | Fired when the user cancels the form | — |\n *\n * @param props - See {@link InformationRequestFormProps}.\n * @returns The rendered information request response form.\n * @public\n */\nexport function InformationRequestForm(props: InformationRequestFormProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nconst convertFileToDataUrl = (file: File) => {\n return new Promise<string>((resolve, reject) => {\n const reader = new FileReader()\n reader.onload = () => {\n resolve(reader.result as string)\n }\n reader.onerror = reject\n reader.readAsDataURL(file)\n })\n}\n\nconst SUPPORTED_RESPONSE_TYPES: ResponseType[] = [ResponseType.Text, ResponseType.Document]\n\nfunction hasUnsupportedQuestionTypes(questions: RequiredQuestions[]) {\n return questions.some(question => !SUPPORTED_RESPONSE_TYPES.includes(question.responseType))\n}\n\nfunction hasPersonaQuestionType(questions: RequiredQuestions[]) {\n return questions.some(question => question.responseType === ResponseType.Persona)\n}\n\nfunction Root({ companyId, requestId, dictionary }: InformationRequestFormProps) {\n useComponentDictionary('InformationRequests.InformationRequestForm', dictionary)\n useI18n('InformationRequests.InformationRequestForm')\n const { t } = useTranslation('InformationRequests.InformationRequestForm')\n const { Alert, Heading, Text } = useComponentContext()\n const { onEvent, baseSubmitHandler } = useBase()\n\n const { data } = useInformationRequestsGetInformationRequestsSuspense({\n companyUuid: companyId,\n })\n\n const informationRequest = data.informationRequests?.find(req => req.uuid === requestId)\n const requiredQuestions = informationRequest?.requiredQuestions ?? []\n const isBlockingPayroll = informationRequest?.blockingPayroll ?? false\n const hasUnsupportedTypes = hasUnsupportedQuestionTypes(requiredQuestions)\n const hasPersonaType = hasPersonaQuestionType(requiredQuestions)\n\n const { mutateAsync: submitInformationRequest } = useInformationRequestsSubmitMutation()\n\n const defaultValues: Record<string, string | File | undefined> = {}\n const questionUuids: string[] = []\n\n requiredQuestions.forEach(question => {\n if (question.responseType === ResponseType.Text) {\n questionUuids.push(question.questionUuid)\n defaultValues[question.questionUuid] = ''\n } else if (question.responseType === ResponseType.Document) {\n questionUuids.push(question.questionUuid)\n defaultValues[question.questionUuid] = undefined\n }\n })\n\n const formMethods = useForm<InformationRequestFormValues>({\n resolver: zodResolver(InformationRequestFormSchema),\n defaultValues,\n })\n\n const onSubmit = async (formData: InformationRequestFormValues) => {\n await baseSubmitHandler(formData, async () => {\n const questionResponses = await Promise.all(\n questionUuids.map(async uuid => {\n const value = formData[uuid]\n\n if (typeof value === 'string') {\n return {\n questionUuid: uuid,\n responseType: SubmitResponseType.Text,\n textResponse: value,\n }\n }\n\n if (value instanceof File) {\n const fileResponse = await convertFileToDataUrl(value)\n return {\n questionUuid: uuid,\n responseType: SubmitResponseType.Document,\n fileResponse,\n fileName: value.name,\n }\n }\n\n return null\n }),\n )\n\n const validResponses = questionResponses.filter(response => response !== null)\n\n const response = await submitInformationRequest({\n request: {\n informationRequestUuid: requestId,\n requestBody: {\n requiredQuestions: validResponses,\n },\n },\n })\n\n onEvent(informationRequestEvents.INFORMATION_REQUEST_FORM_DONE, response.informationRequest)\n })\n }\n\n const renderQuestion = (question: RequiredQuestions) => {\n const fieldName = question.questionUuid\n const isDocumentType = question.responseType === ResponseType.Document\n const isTextType = question.responseType === ResponseType.Text\n\n return (\n <div key={fieldName} className={styles.questionCard}>\n <div className={styles.questionDescription}>\n <Text size=\"sm\" weight=\"medium\">\n {isDocumentType ? t('questionTypes.document') : t('questionTypes.answer')}\n </Text>\n <Text size=\"sm\" variant=\"supporting\">\n {/* SECURITY: XSS mitigated via DOMPurify with strict allowlist. Pattern matches TaxInputs.tsx */}\n <span\n dangerouslySetInnerHTML={{\n __html: DOMPurify.sanitize(question.questionText, dompurifyConfig),\n }}\n />\n </Text>\n </div>\n\n <hr className={styles.divider} />\n\n {isTextType && (\n <div className={styles.textInputWrapper}>\n <TextInputField\n name={fieldName}\n label={t('fields.textAnswer.label')}\n placeholder={t('fields.textAnswer.placeholder')}\n maxLength={MAX_TEXT_RESPONSE}\n isRequired\n errorMessage={t('validation.required')}\n />\n </div>\n )}\n\n {isDocumentType && (\n <div className={styles.fileInputWrapper}>\n <FileInputField\n name={fieldName}\n label={t('fields.fileUpload.label')}\n accept={ACCEPTED_FILE_TYPES}\n isRequired\n errorMessage={t('validation.required')}\n />\n </div>\n )}\n </div>\n )\n }\n\n const unsupportedPlaceholder = (\n <div className={styles.questionCard}>\n <div className={styles.questionDescription}>\n <Text weight=\"medium\">\n {t(hasPersonaType ? 'unsupported.persona.title' : 'unsupported.generic.title')}\n </Text>\n <Text>\n {t(\n hasPersonaType ? 'unsupported.persona.description' : 'unsupported.generic.description',\n )}\n </Text>\n </div>\n\n <hr className={styles.divider} />\n\n <div className={styles.contactSupport}>\n <Text variant=\"supporting\">{t('unsupported.contactSupport')}</Text>\n </div>\n </div>\n )\n\n return (\n <div className={styles.root}>\n <Flex flexDirection=\"column\" gap={16}>\n <Heading as=\"h2\">{t('title')}</Heading>\n\n {isBlockingPayroll && (\n <Alert status=\"error\" label={t('blockingAlert.title')} disableScrollIntoView>\n {t('blockingAlert.description')}\n </Alert>\n )}\n\n {hasUnsupportedTypes ? (\n unsupportedPlaceholder\n ) : (\n <FormProvider {...formMethods}>\n <Form id={INFORMATION_REQUEST_FORM_ID} onSubmit={formMethods.handleSubmit(onSubmit)}>\n <Flex flexDirection=\"column\" gap={16}>\n {requiredQuestions.map(renderQuestion)}\n </Flex>\n </Form>\n </FormProvider>\n )}\n </Flex>\n </div>\n )\n}\n\n/** @internal */\nexport function Footer({ onEvent }: { onEvent: OnEventType<EventType, unknown> }) {\n useI18n('InformationRequests.InformationRequestForm')\n const { t } = useTranslation('InformationRequests.InformationRequestForm')\n const { Button } = useComponentContext()\n const { companyId, selectedRequestId } = useFlow<InformationRequestsContextInterface>()\n\n const { data } = useInformationRequestsGetInformationRequestsSuspense({\n companyUuid: companyId,\n })\n\n const informationRequest = data.informationRequests?.find(req => req.uuid === selectedRequestId)\n const requiredQuestions = informationRequest?.requiredQuestions ?? []\n const hasUnsupportedTypes = hasUnsupportedQuestionTypes(requiredQuestions)\n\n const isMutating = useIsMutating({\n mutationKey: mutationKeyInformationRequestsSubmit(),\n })\n const isPending = isMutating > 0\n\n const handleCancel = () => {\n onEvent(informationRequestEvents.INFORMATION_REQUEST_FORM_CANCEL)\n }\n\n if (hasUnsupportedTypes) {\n return (\n <Flex justifyContent=\"flex-end\" gap={12}>\n <Button variant=\"secondary\" onClick={handleCancel}>\n {t('cta.close')}\n </Button>\n </Flex>\n )\n }\n\n return (\n <Flex justifyContent=\"flex-end\" gap={12}>\n <Button variant=\"secondary\" onClick={handleCancel} isDisabled={isPending}>\n {t('cta.cancel')}\n </Button>\n <Button\n variant=\"primary\"\n type=\"submit\"\n form={INFORMATION_REQUEST_FORM_ID}\n isLoading={isPending}\n >\n {t('cta.submit')}\n </Button>\n </Flex>\n )\n}\n"],"names":["INFORMATION_REQUEST_FORM_ID","ACCEPTED_FILE_TYPES","dompurifyConfig","MAX_TEXT_RESPONSE","InformationRequestFormSchema","z","InformationRequestForm","props","jsx","BaseComponent","Root","convertFileToDataUrl","file","resolve","reject","reader","SUPPORTED_RESPONSE_TYPES","ResponseType","hasUnsupportedQuestionTypes","questions","question","hasPersonaQuestionType","companyId","requestId","dictionary","useComponentDictionary","useI18n","t","useTranslation","Alert","Heading","Text","useComponentContext","onEvent","baseSubmitHandler","useBase","data","useInformationRequestsGetInformationRequestsSuspense","informationRequest","req","requiredQuestions","isBlockingPayroll","hasUnsupportedTypes","hasPersonaType","submitInformationRequest","useInformationRequestsSubmitMutation","defaultValues","questionUuids","formMethods","useForm","zodResolver","onSubmit","formData","validResponses","uuid","value","SubmitResponseType","fileResponse","response","informationRequestEvents","renderQuestion","fieldName","isDocumentType","isTextType","jsxs","styles","DOMPurify","TextInputField","FileInputField","unsupportedPlaceholder","Flex","FormProvider","Form"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAMA,IAA8B,sCAC9BC,IAAsB,CAAC,cAAc,aAAa,iBAAiB,GACnEC,KAAkB;AAAA,EACtB,cAAc,CAAC,KAAK,KAAK,QAAQ;AAAA,EACjC,cAAc,CAAC,UAAU,QAAQ,KAAK;AACxC,GAGMC,KAAoB,KAEpBC,KAA+BC,EAAE;AAAA,EACrCA,EAAE,OAAA;AAAA,EACFA,EAAE,MAAM,CAACA,EAAE,OAAA,EAAS,IAAI,CAAC,GAAGA,EAAE,WAAW,IAAI,CAAC,CAAC;AACjD;AA8CO,SAASC,GAAuBC,GAAoC;AACzE,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,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file":"InformationRequestForm.js","sources":["../../../../src/components/InformationRequests/InformationRequestForm/InformationRequestForm.tsx"],"sourcesContent":["import DOMPurify from 'dompurify'\nimport { useTranslation } from 'react-i18next'\nimport { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { z } from 'zod'\nimport { useIsMutating } from '@tanstack/react-query'\nimport { useInformationRequestsGetInformationRequestsSuspense } from '@gusto/embedded-api/react-query/informationRequestsGetInformationRequests'\nimport {\n useInformationRequestsSubmitMutation,\n mutationKeyInformationRequestsSubmit,\n} from '@gusto/embedded-api/react-query/informationRequestsSubmit'\nimport type { RequiredQuestions } from '@gusto/embedded-api/models/components/informationrequest'\nimport { ResponseType } from '@gusto/embedded-api/models/components/informationrequest'\nimport { ResponseType as SubmitResponseType } from '@gusto/embedded-api/models/operations/submitinformationrequest'\nimport type { InformationRequestsContextInterface } from '../InformationRequestsComponents'\nimport styles from './InformationRequestForm.module.scss'\nimport { BaseComponent, useBase, type BaseComponentInterface } from '@/components/Base'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport { Flex, TextInputField } from '@/components/Common'\nimport { FileInputField } from '@/components/Common/Fields/FileInputField'\nimport { Form } from '@/components/Common/Form'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { informationRequestEvents, type EventType } from '@/shared/constants'\nimport { useFlow } from '@/components/Flow/useFlow'\n\nconst INFORMATION_REQUEST_FORM_ID = 'gusto-sdk-information-request-form'\nconst ACCEPTED_FILE_TYPES = ['image/jpeg', 'image/png', 'application/pdf']\nconst dompurifyConfig = {\n ALLOWED_TAGS: ['a', 'b', 'strong'],\n ALLOWED_ATTR: ['target', 'href', 'rel'],\n}\n\n/* API does not enforce an upper limit, so set a reasonable character max for a single-line input. */\nconst MAX_TEXT_RESPONSE = 5000\n\nconst InformationRequestFormSchema = z.record(\n z.string(),\n z.union([z.string().min(1), z.instanceof(File)]),\n)\n\ntype InformationRequestFormValues = z.infer<typeof InformationRequestFormSchema>\n\n/**\n * Props for {@link InformationRequestForm}.\n *\n * @public\n */\nexport interface InformationRequestFormProps extends BaseComponentInterface<'InformationRequests.InformationRequestForm'> {\n /** The associated company identifier. */\n companyId: string\n /** The identifier of the information request to respond to. */\n requestId: string\n /** Event handler invoked when the form is submitted or cancelled. See the events table in {@link InformationRequestForm}. */\n onEvent: OnEventType<EventType, unknown>\n}\n\n/**\n * Dynamic response form for a single information request.\n *\n * Renders supported question types (text and document upload) based on the request's\n * `requiredQuestions` payload and submits responses to the Submit information request\n * endpoint. Use this component directly when you have built your own list or routing\n * surface and need to host the form — typically inside a modal or page you control.\n *\n * Requests with unsupported response types (e.g. `persona`-driven identity verification)\n * display a guidance message instead of the form; in those cases the user must complete\n * the request through your own integration with the underlying provider.\n *\n * Text inputs accept up to 5,000 characters. Document uploads are restricted to JPEG,\n * PNG, or PDF.\n *\n * @remarks\n * Events emitted via `onEvent`:\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `informationRequest/form/done` | Fired when the form is successfully submitted | The `informationRequest` field from the Submit information request response |\n * | `informationRequest/form/cancel` | Fired when the user cancels the form | — |\n *\n * @param props - See {@link InformationRequestFormProps}.\n * @returns The rendered information request response form.\n * @public\n */\nexport function InformationRequestForm(props: InformationRequestFormProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nconst convertFileToDataUrl = (file: File) => {\n return new Promise<string>((resolve, reject) => {\n const reader = new FileReader()\n reader.onload = () => {\n resolve(reader.result as string)\n }\n reader.onerror = reject\n reader.readAsDataURL(file)\n })\n}\n\nconst SUPPORTED_RESPONSE_TYPES: ResponseType[] = [ResponseType.Text, ResponseType.Document]\n\nfunction hasUnsupportedQuestionTypes(questions: RequiredQuestions[]) {\n return questions.some(question => !SUPPORTED_RESPONSE_TYPES.includes(question.responseType))\n}\n\nfunction hasPersonaQuestionType(questions: RequiredQuestions[]) {\n return questions.some(question => question.responseType === ResponseType.Persona)\n}\n\nfunction Root({ companyId, requestId, dictionary }: InformationRequestFormProps) {\n useComponentDictionary('InformationRequests.InformationRequestForm', dictionary)\n useI18n('InformationRequests.InformationRequestForm')\n const { t } = useTranslation('InformationRequests.InformationRequestForm')\n const { Alert, Heading, Text } = useComponentContext()\n const { onEvent, baseSubmitHandler } = useBase()\n\n const { data } = useInformationRequestsGetInformationRequestsSuspense({\n companyUuid: companyId,\n })\n\n const informationRequest = data.informationRequests?.find(req => req.uuid === requestId)\n const requiredQuestions = informationRequest?.requiredQuestions ?? []\n const isBlockingPayroll = informationRequest?.blockingPayroll ?? false\n const hasUnsupportedTypes = hasUnsupportedQuestionTypes(requiredQuestions)\n const hasPersonaType = hasPersonaQuestionType(requiredQuestions)\n\n const { mutateAsync: submitInformationRequest } = useInformationRequestsSubmitMutation()\n\n const defaultValues: Record<string, string | File | undefined> = {}\n const questionUuids: string[] = []\n\n requiredQuestions.forEach(question => {\n if (question.responseType === ResponseType.Text) {\n questionUuids.push(question.questionUuid)\n defaultValues[question.questionUuid] = ''\n } else if (question.responseType === ResponseType.Document) {\n questionUuids.push(question.questionUuid)\n defaultValues[question.questionUuid] = undefined\n }\n })\n\n const formMethods = useForm<InformationRequestFormValues>({\n resolver: zodResolver(InformationRequestFormSchema),\n defaultValues,\n })\n\n const onSubmit = async (formData: InformationRequestFormValues) => {\n await baseSubmitHandler(formData, async () => {\n const questionResponses = await Promise.all(\n questionUuids.map(async uuid => {\n const value = formData[uuid]\n\n if (typeof value === 'string') {\n return {\n questionUuid: uuid,\n responseType: SubmitResponseType.Text,\n textResponse: value,\n }\n }\n\n if (value instanceof File) {\n const fileResponse = await convertFileToDataUrl(value)\n return {\n questionUuid: uuid,\n responseType: SubmitResponseType.Document,\n fileResponse,\n fileName: value.name,\n }\n }\n\n return null\n }),\n )\n\n const validResponses = questionResponses.filter(response => response !== null)\n\n const response = await submitInformationRequest({\n request: {\n informationRequestUuid: requestId,\n requestBody: {\n requiredQuestions: validResponses,\n },\n },\n })\n\n onEvent(informationRequestEvents.INFORMATION_REQUEST_FORM_DONE, response.informationRequest)\n })\n }\n\n const renderQuestion = (question: RequiredQuestions) => {\n const fieldName = question.questionUuid\n const isDocumentType = question.responseType === ResponseType.Document\n const isTextType = question.responseType === ResponseType.Text\n\n return (\n <div key={fieldName} className={styles.questionCard}>\n <div className={styles.questionDescription}>\n <Text size=\"sm\" weight=\"medium\">\n {isDocumentType ? t('questionTypes.document') : t('questionTypes.answer')}\n </Text>\n <Text size=\"sm\" variant=\"supporting\">\n {/* SECURITY: XSS mitigated via DOMPurify with strict allowlist. Pattern matches TaxInputs.tsx */}\n <span\n dangerouslySetInnerHTML={{\n __html: DOMPurify.sanitize(question.questionText, dompurifyConfig),\n }}\n />\n </Text>\n </div>\n\n <hr className={styles.divider} />\n\n {isTextType && (\n <div className={styles.textInputWrapper}>\n <TextInputField\n name={fieldName}\n label={t('fields.textAnswer.label')}\n placeholder={t('fields.textAnswer.placeholder')}\n maxLength={MAX_TEXT_RESPONSE}\n isRequired\n errorMessage={t('validation.required')}\n />\n </div>\n )}\n\n {isDocumentType && (\n <div className={styles.fileInputWrapper}>\n <FileInputField\n name={fieldName}\n label={t('fields.fileUpload.label')}\n accept={ACCEPTED_FILE_TYPES}\n isRequired\n errorMessage={t('validation.required')}\n />\n </div>\n )}\n </div>\n )\n }\n\n const unsupportedPlaceholder = (\n <div className={styles.questionCard}>\n <div className={styles.questionDescription}>\n <Text weight=\"medium\">\n {t(hasPersonaType ? 'unsupported.persona.title' : 'unsupported.generic.title')}\n </Text>\n <Text>\n {t(\n hasPersonaType ? 'unsupported.persona.description' : 'unsupported.generic.description',\n )}\n </Text>\n </div>\n\n <hr className={styles.divider} />\n\n <div className={styles.contactSupport}>\n <Text variant=\"supporting\">{t('unsupported.contactSupport')}</Text>\n </div>\n </div>\n )\n\n return (\n <div className={styles.root}>\n <Flex flexDirection=\"column\" gap={16}>\n <Heading as=\"h2\">{t('title')}</Heading>\n\n {isBlockingPayroll && (\n <Alert status=\"error\" label={t('blockingAlert.title')} disableScrollIntoView>\n {t('blockingAlert.description')}\n </Alert>\n )}\n\n {hasUnsupportedTypes ? (\n unsupportedPlaceholder\n ) : (\n <FormProvider {...formMethods}>\n <Form id={INFORMATION_REQUEST_FORM_ID} onSubmit={formMethods.handleSubmit(onSubmit)}>\n <Flex flexDirection=\"column\" gap={16}>\n {requiredQuestions.map(renderQuestion)}\n </Flex>\n </Form>\n </FormProvider>\n )}\n </Flex>\n </div>\n )\n}\n\n/** @internal */\nexport function Footer({ onEvent }: { onEvent: OnEventType<EventType, unknown> }) {\n useI18n('InformationRequests.InformationRequestForm')\n const { t } = useTranslation('InformationRequests.InformationRequestForm')\n const { Button } = useComponentContext()\n const { companyId, selectedRequestId } = useFlow<InformationRequestsContextInterface>()\n\n const { data } = useInformationRequestsGetInformationRequestsSuspense({\n companyUuid: companyId,\n })\n\n const informationRequest = data.informationRequests?.find(req => req.uuid === selectedRequestId)\n const requiredQuestions = informationRequest?.requiredQuestions ?? []\n const hasUnsupportedTypes = hasUnsupportedQuestionTypes(requiredQuestions)\n\n const isMutating = useIsMutating({\n mutationKey: mutationKeyInformationRequestsSubmit(),\n })\n const isPending = isMutating > 0\n\n const handleCancel = () => {\n onEvent(informationRequestEvents.INFORMATION_REQUEST_FORM_CANCEL)\n }\n\n if (hasUnsupportedTypes) {\n return (\n <Flex justifyContent=\"flex-end\" gap={12}>\n <Button variant=\"secondary\" onClick={handleCancel}>\n {t('cta.close')}\n </Button>\n </Flex>\n )\n }\n\n return (\n <Flex justifyContent=\"flex-end\" gap={12}>\n <Button variant=\"secondary\" onClick={handleCancel} isDisabled={isPending}>\n {t('cta.cancel')}\n </Button>\n <Button\n variant=\"primary\"\n type=\"submit\"\n form={INFORMATION_REQUEST_FORM_ID}\n isLoading={isPending}\n >\n {t('cta.submit')}\n </Button>\n </Flex>\n )\n}\n"],"names":["INFORMATION_REQUEST_FORM_ID","ACCEPTED_FILE_TYPES","dompurifyConfig","MAX_TEXT_RESPONSE","InformationRequestFormSchema","z","InformationRequestForm","props","jsx","BaseComponent","Root","convertFileToDataUrl","file","resolve","reject","reader","SUPPORTED_RESPONSE_TYPES","ResponseType","hasUnsupportedQuestionTypes","questions","question","hasPersonaQuestionType","companyId","requestId","dictionary","useComponentDictionary","useI18n","t","useTranslation","Alert","Heading","Text","useComponentContext","onEvent","baseSubmitHandler","useBase","data","useInformationRequestsGetInformationRequestsSuspense","informationRequest","req","requiredQuestions","isBlockingPayroll","hasUnsupportedTypes","hasPersonaType","submitInformationRequest","useInformationRequestsSubmitMutation","defaultValues","questionUuids","formMethods","useForm","zodResolver","onSubmit","formData","validResponses","uuid","value","SubmitResponseType","fileResponse","response","informationRequestEvents","renderQuestion","fieldName","isDocumentType","isTextType","jsxs","styles","DOMPurify","TextInputField","FileInputField","unsupportedPlaceholder","Flex","FormProvider","Form","Footer","Button","selectedRequestId","useFlow","isPending","useIsMutating","mutationKeyInformationRequestsSubmit","handleCancel"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAMA,IAA8B,sCAC9BC,KAAsB,CAAC,cAAc,aAAa,iBAAiB,GACnEC,KAAkB;AAAA,EACtB,cAAc,CAAC,KAAK,KAAK,QAAQ;AAAA,EACjC,cAAc,CAAC,UAAU,QAAQ,KAAK;AACxC,GAGMC,KAAoB,KAEpBC,KAA+BC,EAAE;AAAA,EACrCA,EAAE,OAAA;AAAA,EACFA,EAAE,MAAM,CAACA,EAAE,OAAA,EAAS,IAAI,CAAC,GAAGA,EAAE,WAAW,IAAI,CAAC,CAAC;AACjD;AA8CO,SAASC,GAAuBC,GAAoC;AACzE,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,MAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,MAAMI,KAAuB,CAACC,MACrB,IAAI,QAAgB,CAACC,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QAAA8C,EAAA,IAAW1C,EAAA,GACb,EAAE,WAAAV,GAAW,mBAAAqD,EAAA,IAAsBC,GAAA,GAEnC,EAAE,MAAAxC,EAAA,IAASC,EAAqD;AAAA,IACpE,aAAaf;AAAA,EAAA,CACd,GAGKkB,IADqBJ,EAAK,qBAAqB,KAAK,CAAAG,MAAOA,EAAI,SAASoC,CAAiB,GACjD,qBAAqB,CAAA,GAC7DjC,IAAsBxB,EAA4BsB,CAAiB,GAKnEqC,IAHaC,EAAc;AAAA,IAC/B,aAAaC,EAAA;AAAA,EAAqC,CACnD,IAC8B,GAEzBC,IAAe,MAAM;AACzB,IAAA/C,EAAQ0B,EAAyB,+BAA+B;AAAA,EAClE;AAEA,SAAIjB,IAEA,gBAAAlC,EAAC8D,GAAA,EAAK,gBAAe,YAAW,KAAK,IACnC,UAAA,gBAAA9D,EAACkE,GAAA,EAAO,SAAQ,aAAY,SAASM,GAClC,UAAArD,EAAE,WAAW,GAChB,GACF,IAKF,gBAAAqC,EAACM,GAAA,EAAK,gBAAe,YAAW,KAAK,IACnC,UAAA;AAAA,IAAA,gBAAA9D,EAACkE,GAAA,EAAO,SAAQ,aAAY,SAASM,GAAc,YAAYH,GAC5D,UAAAlD,EAAE,YAAY,EAAA,CACjB;AAAA,IACA,gBAAAnB;AAAA,MAACkE;AAAA,MAAA;AAAA,QACC,SAAQ;AAAA,QACR,MAAK;AAAA,QACL,MAAM1E;AAAA,QACN,WAAW6E;AAAA,QAEV,YAAE,YAAY;AAAA,MAAA;AAAA,IAAA;AAAA,EACjB,GACF;AAEJ;"}
@@ -1 +1 @@
1
- export { InformationRequestForm, type InformationRequestFormProps } from './InformationRequestForm';
1
+ export { InformationRequestForm, Footer, type InformationRequestFormProps, } from './InformationRequestForm';
@@ -60,4 +60,4 @@ export interface InformationRequestsFlowProps extends Omit<BaseComponentInterfac
60
60
  * }
61
61
  * ```
62
62
  */
63
- export declare function InformationRequestsFlow({ companyId, dictionary, withAlert, onEvent, }: InformationRequestsFlowProps): import("react").JSX.Element;
63
+ export declare function InformationRequestsFlow({ companyId, dictionary, withAlert, onEvent, LoaderComponent, }: InformationRequestsFlowProps): import("react").JSX.Element;
@@ -1,85 +1,87 @@
1
- import { jsx as t, jsxs as v } from "react/jsx-runtime";
2
- import { createMachine as b } from "robot3";
3
- import { useMachine as L } from "react-robot";
4
- import { useState as R, useCallback as p, useMemo as Q, Suspense as E } from "react";
5
- import { useTranslation as U } from "react-i18next";
6
- import { informationRequestsMachine as k } from "./informationRequestsStateMachine.js";
7
- import { BaseBoundaries as P } from "../Base/Base.js";
1
+ import { jsx as t, jsxs as b } from "react/jsx-runtime";
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";
8
8
  import "../Base/useBase.js";
9
- import { Flex as g } from "../Common/Flex/Flex.js";
10
- import { useComponentContext as j } from "../../contexts/ComponentAdapter/useComponentContext.js";
11
- import { FlowContext as B } from "../Flow/useFlow.js";
12
- 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";
13
13
  import { informationRequestEvents as s } from "../../shared/constants.js";
14
- import { InformationRequestList as z } from "./InformationRequestList/InformationRequestList.js";
15
- const I = "informationRequestResponded";
16
- function se({
14
+ import { InformationRequestList as Y } from "./InformationRequestList/InformationRequestList.js";
15
+ const O = "informationRequestResponded";
16
+ function re({
17
17
  companyId: r,
18
- dictionary: O,
19
- withAlert: a = !0,
20
- onEvent: M = () => {
21
- }
18
+ dictionary: M,
19
+ withAlert: m = !0,
20
+ onEvent: h = () => {
21
+ },
22
+ LoaderComponent: i
22
23
  }) {
23
- $("InformationRequests", O), w("InformationRequests");
24
- const { t: m } = U("InformationRequests"), { Modal: h, LoadingSpinner: c, Alert: x, Text: A } = j(), [F, i] = R(!1), [N, f] = R({
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({
25
26
  nextAlertId: 0,
26
27
  alerts: []
27
- }), T = p((e) => {
28
- f((o) => ({
28
+ }), _ = p((e) => {
29
+ u((o) => ({
29
30
  ...o,
30
- alerts: o.alerts.filter((D) => D.id !== e)
31
+ alerts: o.alerts.filter((v) => v.id !== e)
31
32
  }));
32
- }, []), _ = p(() => {
33
- f((e) => ({
33
+ }, []), S = p(() => {
34
+ u((e) => ({
34
35
  nextAlertId: e.nextAlertId + 1,
35
36
  alerts: [{ id: e.nextAlertId }, ...e.alerts]
36
37
  }));
37
- }, []), C = Q(
38
- () => b(
38
+ }, []), q = k(
39
+ () => Q(
39
40
  "list",
40
- k,
41
+ g,
41
42
  () => ({
42
43
  component: null,
43
44
  companyId: r,
44
- onEvent: n
45
+ onEvent: n,
46
+ LoaderComponent: i
45
47
  })
46
48
  ),
47
- [r]
48
- ), [u, S] = L(C);
49
+ [r, i]
50
+ ), [d, C] = U(q);
49
51
  function n(e, o) {
50
- S({ type: e, payload: o }), e === s.INFORMATION_REQUEST_RESPOND && i(!0), (e === s.INFORMATION_REQUEST_FORM_CANCEL || e === s.INFORMATION_REQUEST_FORM_DONE) && i(!1), e === s.INFORMATION_REQUEST_FORM_DONE && a && _(), M(e, o);
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);
51
53
  }
52
- const q = () => {
53
- i(!1);
54
- }, l = u.context.component, d = l?.Footer || void 0;
54
+ const D = () => {
55
+ l(!1);
56
+ }, a = d.context.component, R = a?.Footer || void 0;
55
57
  return /* @__PURE__ */ t(
56
- B.Provider,
58
+ $.Provider,
57
59
  {
58
60
  value: {
59
- ...u.context,
61
+ ...d.context,
60
62
  onEvent: n
61
63
  },
62
- children: /* @__PURE__ */ v(g, { flexDirection: "column", gap: 32, children: [
63
- a && N.alerts.map((e) => /* @__PURE__ */ t(
64
- x,
64
+ children: /* @__PURE__ */ b(B, { flexDirection: "column", gap: 32, children: [
65
+ m && T.alerts.map((e) => /* @__PURE__ */ t(
66
+ A,
65
67
  {
66
68
  status: "success",
67
- label: m(`alerts.${I}.title`),
69
+ label: c(`alerts.${O}.title`),
68
70
  onDismiss: () => {
69
- T(e.id);
71
+ _(e.id);
70
72
  },
71
- children: /* @__PURE__ */ t(A, { children: m(`alerts.${I}.description`) })
73
+ children: /* @__PURE__ */ t(F, { children: c(`alerts.${O}.description`) })
72
74
  },
73
75
  e.id
74
76
  )),
75
- /* @__PURE__ */ t(E, { fallback: /* @__PURE__ */ t(c, {}), children: /* @__PURE__ */ t(z, { companyId: r, onEvent: n }) }),
77
+ /* @__PURE__ */ t(I, { fallback: /* @__PURE__ */ t(f, {}), children: /* @__PURE__ */ t(Y, { companyId: r, onEvent: n }) }),
76
78
  /* @__PURE__ */ t(
77
- h,
79
+ x,
78
80
  {
79
- isOpen: F,
80
- onClose: q,
81
- footer: d && /* @__PURE__ */ t(P, { children: /* @__PURE__ */ t(E, { fallback: /* @__PURE__ */ t(c, { size: "sm" }), children: /* @__PURE__ */ t(d, { onEvent: n }) }) }),
82
- children: l && /* @__PURE__ */ t(l, {})
81
+ isOpen: N,
82
+ onClose: D,
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
+ children: a && /* @__PURE__ */ t(a, {})
83
85
  }
84
86
  )
85
87
  ] })
@@ -87,6 +89,6 @@ function se({
87
89
  );
88
90
  }
89
91
  export {
90
- se as InformationRequestsFlow
92
+ re as InformationRequestsFlow
91
93
  };
92
94
  //# sourceMappingURL=InformationRequests.js.map
@@ -1 +1 @@
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}: 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 }),\n ),\n [companyId],\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>\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","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":";;;;;;;;;;;;;;AA2CA,MAAMA,IAAa;AA+CZ,SAASC,GAAwB;AAAA,EACtC,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,SAAAC,IAAU,MAAM;AAAA,EAAC;AACnB,GAAiC;AAC/B,EAAAC,EAAuB,uBAAuBH,CAAU,GACxDI,EAAQ,qBAAqB;AAC7B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5C,EAAE,OAAAC,GAAO,gBAAAC,GAAgB,OAAAC,GAAO,MAAAC,EAAA,IAASC,EAAA,GACzC,CAACC,GAAaC,CAAc,IAAIC,EAAS,EAAK,GAC9C,CAACC,GAAYC,CAAa,IAAIF,EAA+B;AAAA,IACjE,aAAa;AAAA,IACb,QAAQ,CAAA;AAAA,EAAC,CACV,GAEKG,IAAqBC,EAAY,CAACC,MAAoB;AAC1D,IAAAH,EAAc,CAAAI,OAAS;AAAA,MACrB,GAAGA;AAAA,MACH,QAAQA,EAAK,OAAO,OAAO,CAAAC,MAASA,EAAM,OAAOF,CAAO;AAAA,IAAA,EACxD;AAAA,EACJ,GAAG,CAAA,CAAE,GAECG,IAAqBJ,EAAY,MAAM;AAC3C,IAAAF,EAAc,CAAAI,OAAS;AAAA,MACrB,aAAaA,EAAK,cAAc;AAAA,MAChC,QAAQ,CAAC,EAAE,IAAIA,EAAK,YAAA,GAAe,GAAGA,EAAK,MAAM;AAAA,IAAA,EACjD;AAAA,EACJ,GAAG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gB,EAACI,GAAA,EAAS,UAAU,gBAAAJ,EAAC7B,GAAA,CAAA,CAAe,GAClC,UAAA,gBAAA6B,EAACK,GAAA,EAAuB,WAAA3C,GAAsB,SAAS4B,EAAA,CAAa,GACtE;AAAA,QACA,gBAAAU;AAAA,UAAC9B;AAAA,UAAA;AAAA,YACC,QAAQK;AAAA,YACR,SAASsB;AAAA,YACT,QACEE,KACE,gBAAAC,EAACM,GAAA,EACC,UAAA,gBAAAN,EAACI,KAAS,UAAU,gBAAAJ,EAAC7B,GAAA,EAAe,MAAK,MAAK,GAC5C,UAAA,gBAAA6B,EAACD,KAAO,SAAST,EAAA,CAAa,GAChC,GACF;AAAA,YAIH,UAAAQ,uBAAqBA,GAAA,CAAA,CAAiB;AAAA,UAAA;AAAA,QAAA;AAAA,MACzC,EAAA,CACF;AAAA,IAAA;AAAA,EAAA;AAGN;"}
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":";;;;;;;;;;;;;;AA2CA,MAAMA,IAAa;AA+CZ,SAASC,GAAwB;AAAA,EACtC,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,SAAAC,IAAU,MAAM;AAAA,EAAC;AAAA,EACjB,iBAAAC;AACF,GAAiC;AAC/B,EAAAC,EAAuB,uBAAuBJ,CAAU,GACxDK,EAAQ,qBAAqB;AAC7B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5C,EAAE,OAAAC,GAAO,gBAAAC,GAAgB,OAAAC,GAAO,MAAAC,EAAA,IAASC,EAAA,GACzC,CAACC,GAAaC,CAAc,IAAIC,EAAS,EAAK,GAC9C,CAACC,GAAYC,CAAa,IAAIF,EAA+B;AAAA,IACjE,aAAa;AAAA,IACb,QAAQ,CAAA;AAA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,MAAA;AAAA,MAGX,UAAA,gBAAAY,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAC/B,UAAA;AAAA,QAAAxC,KACCe,EAAW,OAAO,IAAI,CAAAM,MACpB,gBAAAgB;AAAA,UAAC5B;AAAA,UAAA;AAAA,YAEC,QAAO;AAAA,YACP,OAAOJ,EAAE,UAAUT,CAAU,QAAQ;AAAA,YACrC,WAAW,MAAM;AACf,cAAAqB,EAAmBI,EAAM,EAAE;AAAA,YAC7B;AAAA,YAEA,4BAACX,GAAA,EAAM,UAAAL,EAAE,UAAUT,CAAU,cAAc,EAAA,CAAE;AAAA,UAAA;AAAA,UAPxCyB,EAAM;AAAA,QAAA,CASd;AAAA,QAEH,gBAAAgB,EAACI,GAAA,EAAS,UAAU,gBAAAJ,EAAC7B,GAAA,CAAA,CAAe,GAClC,UAAA,gBAAA6B,EAACK,GAAA,EAAuB,WAAA5C,GAAsB,SAAS6B,EAAA,CAAa,GACtE;AAAA,QACA,gBAAAU;AAAA,UAAC9B;AAAA,UAAA;AAAA,YACC,QAAQK;AAAA,YACR,SAASsB;AAAA,YACT,QACEE,KACE,gBAAAC,EAACM,KAAe,iBAAAzC,GACd,UAAA,gBAAAmC,EAACI,KAAS,UAAU,gBAAAJ,EAAC7B,GAAA,EAAe,MAAK,MAAK,GAC5C,UAAA,gBAAA6B,EAACD,KAAO,SAAST,GAAa,GAChC,EAAA,CACF;AAAA,YAIH,UAAAQ,uBAAqBA,GAAA,CAAA,CAAiB;AAAA,UAAA;AAAA,QAAA;AAAA,MACzC,EAAA,CACF;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -14,3 +14,6 @@ export interface InformationRequestsContextInterface extends FlowContextInterfac
14
14
  }
15
15
  /** @internal */
16
16
  export declare function InformationRequestFormContextual(): import("react").JSX.Element;
17
+ export declare namespace InformationRequestFormContextual {
18
+ var Footer: typeof import("./InformationRequestForm").Footer;
19
+ }