@gusto/embedded-react-sdk 0.51.2 → 0.52.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (296) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/dist/components/Base/Base.d.ts +2 -0
  3. package/dist/components/Base/Base.js.map +1 -1
  4. package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbsTypes.d.ts +1 -1
  5. package/dist/components/Common/OnboardingStatusBadge/index.d.ts +1 -1
  6. package/dist/components/Common/OnboardingStatusBadge/index.js.map +1 -1
  7. package/dist/components/Common/PaginationControl/PaginationControlTypes.d.ts +4 -1
  8. package/dist/components/Common/UI/Breadcrumbs/BreadcrumbsTypes.d.ts +1 -1
  9. package/dist/components/Common/UI/Breadcrumbs/BreadcrumbsTypes.js.map +1 -1
  10. package/dist/components/Common/UI/CheckboxGroup/CheckboxGroupTypes.d.ts +1 -1
  11. package/dist/components/Common/UI/CheckboxGroup/CheckboxGroupTypes.js.map +1 -1
  12. package/dist/components/Common/UI/ComboBox/ComboBoxTypes.d.ts +2 -2
  13. package/dist/components/Common/UI/DateRangePicker/DateRangePickerTypes.d.ts +3 -2
  14. package/dist/components/Common/UI/DescriptionList/DescriptionListTypes.d.ts +1 -1
  15. package/dist/components/Common/UI/DescriptionList/DescriptionListTypes.js.map +1 -1
  16. package/dist/components/Common/UI/FormBox/FormBox.d.ts +9 -0
  17. package/dist/components/Common/UI/FormBox/FormBox.js +13 -0
  18. package/dist/components/Common/UI/FormBox/FormBox.js.map +1 -0
  19. package/dist/components/Common/UI/FormBox/FormBox.module.scss.js +14 -0
  20. package/dist/components/Common/UI/FormBox/FormBox.module.scss.js.map +1 -0
  21. package/dist/components/Common/UI/FormBox/FormBoxTypes.d.ts +26 -0
  22. package/dist/components/Common/UI/FormBoxHeader/FormBoxHeader.d.ts +9 -0
  23. package/dist/components/Common/UI/FormBoxHeader/FormBoxHeader.js +23 -0
  24. package/dist/components/Common/UI/FormBoxHeader/FormBoxHeader.js.map +1 -0
  25. package/dist/components/Common/UI/FormBoxHeader/FormBoxHeader.module.scss.js +8 -0
  26. package/dist/components/Common/UI/FormBoxHeader/FormBoxHeader.module.scss.js.map +1 -0
  27. package/dist/components/Common/UI/FormBoxHeader/FormBoxHeaderTypes.d.ts +36 -0
  28. package/dist/components/Common/UI/FormBoxHeader/FormBoxHeaderTypes.js +7 -0
  29. package/dist/components/Common/UI/FormBoxHeader/FormBoxHeaderTypes.js.map +1 -0
  30. package/dist/components/Common/UI/FormBoxHeader/index.d.ts +1 -0
  31. package/dist/components/Common/UI/Input/InputTypes.d.ts +1 -0
  32. package/dist/components/Common/UI/Input/InputTypes.js.map +1 -1
  33. package/dist/components/Common/UI/Menu/MenuTypes.d.ts +3 -3
  34. package/dist/components/Common/UI/Menu/MenuTypes.js.map +1 -1
  35. package/dist/components/Common/UI/MultiSelectComboBox/MultiSelectComboBoxTypes.d.ts +2 -2
  36. package/dist/components/Common/UI/RadioGroup/RadioGroupTypes.d.ts +2 -2
  37. package/dist/components/Common/UI/RadioGroup/RadioGroupTypes.js.map +1 -1
  38. package/dist/components/Common/UI/Select/SelectTypes.d.ts +2 -2
  39. package/dist/components/Common/UI/Table/TableTypes.d.ts +4 -4
  40. package/dist/components/Common/UI/Table/TableTypes.js.map +1 -1
  41. package/dist/components/Common/UI/Tabs/TabsTypes.d.ts +2 -2
  42. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.d.ts +1 -2
  43. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +5 -3
  44. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  45. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.d.ts +1 -1
  46. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +5 -3
  47. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  48. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +7 -5
  49. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  50. package/dist/components/Company/BankAccount/BankAccountForm/Form.d.ts +1 -1
  51. package/dist/components/Company/BankAccount/BankAccountForm/context.js +5 -3
  52. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  53. package/dist/components/Company/BankAccount/BankAccountVerify/Form.d.ts +1 -1
  54. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +5 -3
  55. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  56. package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/signCompanyFormSchema.d.ts +1 -1
  57. package/dist/components/Company/FederalTaxes/useFederalTaxes.d.ts +1 -1
  58. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +10 -8
  59. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  60. package/dist/components/Company/Industry/Context.js +8 -6
  61. package/dist/components/Company/Industry/Context.js.map +1 -1
  62. package/dist/components/Company/Locations/LocationForm/Form.d.ts +1 -1
  63. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +5 -3
  64. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  65. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +5 -3
  66. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  67. package/dist/components/Company/OnboardingOverview/context.js +5 -3
  68. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  69. package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/payScheduleSchema.d.ts +3 -3
  70. package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/usePayScheduleForm.d.ts +1 -1
  71. package/dist/components/Company/StateTaxes/StateTaxes.d.ts +10 -1
  72. package/dist/components/Company/StateTaxes/StateTaxes.js +23 -17
  73. package/dist/components/Company/StateTaxes/StateTaxes.js.map +1 -1
  74. package/dist/components/Company/StateTaxes/StateTaxesComponents.d.ts +2 -0
  75. package/dist/components/Company/StateTaxes/StateTaxesComponents.js +17 -10
  76. package/dist/components/Company/StateTaxes/StateTaxesComponents.js.map +1 -1
  77. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +5 -3
  78. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  79. package/dist/components/Company/StateTaxes/StateTaxesList/List.js +26 -26
  80. package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
  81. package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.d.ts +9 -0
  82. package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js +24 -24
  83. package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js.map +1 -1
  84. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +5 -3
  85. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  86. package/dist/components/Contractor/Address/Address.d.ts +4 -3
  87. package/dist/components/Contractor/Address/Address.js.map +1 -1
  88. package/dist/components/Contractor/Address/shared/useContractorAddressForm/contractorAddressSchema.d.ts +2 -2
  89. package/dist/components/Contractor/Address/shared/useContractorAddressForm/useContractorAddressForm.d.ts +1 -1
  90. package/dist/components/Contractor/ContractorList/index.d.ts +2 -1
  91. package/dist/components/Contractor/ContractorList/index.js +123 -98
  92. package/dist/components/Contractor/ContractorList/index.js.map +1 -1
  93. package/dist/components/Contractor/Documents/SignatureForm/SignatureForm.js +22 -19
  94. package/dist/components/Contractor/Documents/SignatureForm/SignatureForm.js.map +1 -1
  95. package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/contractorSignatureFormSchema.d.ts +1 -1
  96. package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/useContractorSignatureForm.d.ts +1 -1
  97. package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/w9Fields.d.ts +1 -1
  98. package/dist/components/Contractor/OnboardingFlow/OnboardingFlow.d.ts +1 -1
  99. package/dist/components/Contractor/OnboardingFlow/OnboardingFlow.js.map +1 -1
  100. package/dist/components/Contractor/OnboardingFlow/OnboardingFlowComponents.d.ts +2 -0
  101. package/dist/components/Contractor/OnboardingFlow/OnboardingFlowComponents.js.map +1 -1
  102. package/dist/components/Contractor/OnboardingFlow/onboardingStateMachine.js +150 -80
  103. package/dist/components/Contractor/OnboardingFlow/onboardingStateMachine.js.map +1 -1
  104. package/dist/components/Contractor/OnboardingFlow/onboardingStateMachine.test.d.ts +1 -0
  105. package/dist/components/Contractor/PaymentMethod/shared/useContractorBankAccountForm/useContractorBankAccountFormSchema.d.ts +1 -1
  106. package/dist/components/Contractor/PaymentMethod/shared/useContractorPaymentMethodForm/contractorPaymentMethodSchema.d.ts +1 -1
  107. package/dist/components/Contractor/PaymentMethod/shared/useContractorPaymentMethodForm/contractorPaymentMethodSchema.js.map +1 -1
  108. package/dist/components/Contractor/PaymentMethod/shared/useContractorPaymentMethodForm/useContractorPaymentMethodForm.d.ts +2 -2
  109. package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js.map +1 -1
  110. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.d.ts +1 -1
  111. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
  112. package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js +2 -2
  113. package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js.map +1 -1
  114. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummary.d.ts +17 -5
  115. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummary.js +32 -31
  116. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummary.js.map +1 -1
  117. package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.d.ts +16 -4
  118. package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js +33 -29
  119. package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js.map +1 -1
  120. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +1 -1
  121. package/dist/components/Contractor/Profile/BusinessSelfOnboardingProfile.js +19 -18
  122. package/dist/components/Contractor/Profile/BusinessSelfOnboardingProfile.js.map +1 -1
  123. package/dist/components/Contractor/Profile/ContractorProfile.d.ts +1 -1
  124. package/dist/components/Contractor/Profile/ContractorProfile.js +114 -110
  125. package/dist/components/Contractor/Profile/ContractorProfile.js.map +1 -1
  126. package/dist/components/Contractor/Profile/IndividualSelfOnboardingProfile.js +27 -26
  127. package/dist/components/Contractor/Profile/IndividualSelfOnboardingProfile.js.map +1 -1
  128. package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/contractorDetailsSchema.d.ts +1 -1
  129. package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/contractorDetailsSchema.js +6 -6
  130. package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/contractorDetailsSchema.js.map +1 -1
  131. package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/useContractorDetailsForm.d.ts +1 -1
  132. package/dist/components/Contractor/Submit/Submit.js +106 -63
  133. package/dist/components/Contractor/Submit/Submit.js.map +1 -1
  134. package/dist/components/Employee/Compensation/onboarding/Compensation.d.ts +0 -4
  135. package/dist/components/Employee/Compensation/onboarding/Compensation.js +38 -42
  136. package/dist/components/Employee/Compensation/onboarding/Compensation.js.map +1 -1
  137. package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.d.ts +2 -2
  138. package/dist/components/Employee/Compensation/shared/useJobForm/jobSchema.d.ts +1 -1
  139. package/dist/components/Employee/Dashboard/index.d.ts +1 -1
  140. package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/childSupportGarnishmentFormSchema.d.ts +1 -1
  141. package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/useChildSupportGarnishmentForm.d.ts +1 -1
  142. package/dist/components/Employee/Deductions/shared/useDeductionForm/deductionFormSchema.d.ts +2 -2
  143. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js +5 -3
  144. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  145. package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilitySchema.d.ts +2 -2
  146. package/dist/components/Employee/Documents/onboarding/EmployeeDocuments/EmployeeDocuments.js +1 -4
  147. package/dist/components/Employee/Documents/onboarding/EmployeeDocuments/EmployeeDocuments.js.map +1 -1
  148. package/dist/components/Employee/Documents/shared/useSignEmployeeForm/signEmployeeFormSchema.d.ts +2 -2
  149. package/dist/components/Employee/Documents/shared/useSignEmployeeForm/signEmployeeFormSchema.js +27 -32
  150. package/dist/components/Employee/Documents/shared/useSignEmployeeForm/signEmployeeFormSchema.js.map +1 -1
  151. package/dist/components/Employee/EmployeeList/shared/useEmployeeList.js +1 -2
  152. package/dist/components/Employee/EmployeeList/shared/useEmployeeList.js.map +1 -1
  153. package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/federalTaxesSchema.d.ts +2 -2
  154. package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/useFederalTaxesForm.d.ts +1 -1
  155. package/dist/components/Employee/OnboardingExecutionFlow/onboardingExecutionStateMachine.d.ts +1 -1
  156. package/dist/components/Employee/OnboardingExecutionFlow/onboardingExecutionStateMachine.js +1 -3
  157. package/dist/components/Employee/OnboardingExecutionFlow/onboardingExecutionStateMachine.js.map +1 -1
  158. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +55 -49
  159. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js.map +1 -1
  160. package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankFormSchema.d.ts +1 -1
  161. package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/useSplitPaymentsFormSchema.d.ts +1 -1
  162. package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/employeeDetailsSchema.d.ts +2 -2
  163. package/dist/components/Employee/Profile/shared/useHomeAddressForm/homeAddressSchema.d.ts +1 -1
  164. package/dist/components/Employee/Profile/shared/useHomeAddressForm/useHomeAddressForm.d.ts +1 -1
  165. package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fields.d.ts +2 -2
  166. package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fields.js.map +1 -1
  167. package/dist/components/Employee/exports/employeeManagement.d.ts +1 -1
  168. package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.d.ts +4 -5
  169. package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js +101 -125
  170. package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -1
  171. package/dist/components/InformationRequests/InformationRequestsComponents.d.ts +0 -5
  172. package/dist/components/InformationRequests/InformationRequestsComponents.js +12 -13
  173. package/dist/components/InformationRequests/InformationRequestsComponents.js.map +1 -1
  174. package/dist/components/Payroll/Dismissal/DismissalFlowComponents.js +4 -4
  175. package/dist/components/Payroll/Dismissal/DismissalFlowComponents.js.map +1 -1
  176. package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.d.ts +1 -1
  177. package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js +8 -8
  178. package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js.map +1 -1
  179. package/dist/components/Payroll/OffCycle/index.d.ts +1 -1
  180. package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes.d.ts +1 -1
  181. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +97 -92
  182. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
  183. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.d.ts +2 -3
  184. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
  185. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.d.ts +2 -2
  186. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js +1 -1
  187. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js.map +1 -1
  188. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js +57 -56
  189. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js.map +1 -1
  190. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
  191. package/dist/components/Payroll/PayrollExecutionFlow/PayrollExecutionFlow.d.ts +23 -6
  192. package/dist/components/Payroll/PayrollExecutionFlow/PayrollExecutionFlow.js +37 -33
  193. package/dist/components/Payroll/PayrollExecutionFlow/PayrollExecutionFlow.js.map +1 -1
  194. package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.js +2 -2
  195. package/dist/components/Payroll/PayrollFlow/PayrollExecutionFlowContextual.js +6 -6
  196. package/dist/components/Payroll/PayrollFlow/PayrollExecutionFlowContextual.js.map +1 -1
  197. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js +1 -1
  198. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js.map +1 -1
  199. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.d.ts +1 -1
  200. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
  201. package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
  202. package/dist/components/Payroll/PayrollList/PayrollListPresentation.d.ts +1 -1
  203. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +1 -1
  204. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
  205. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.d.ts +1 -1
  206. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +31 -31
  207. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
  208. package/dist/components/Payroll/RecoveryCases/RecoveryCases.d.ts +9 -5
  209. package/dist/components/Payroll/RecoveryCases/RecoveryCases.js.map +1 -1
  210. package/dist/components/Payroll/Transition/TransitionFlowComponents.d.ts +1 -1
  211. package/dist/components/Payroll/Transition/TransitionFlowComponents.js +1 -1
  212. package/dist/components/Payroll/Transition/TransitionFlowComponents.js.map +1 -1
  213. package/dist/components/Payroll/Transition/index.d.ts +1 -1
  214. package/dist/components/Payroll/helpers.d.ts +22 -8
  215. package/dist/components/Payroll/helpers.js +1 -1
  216. package/dist/components/Payroll/helpers.js.map +1 -1
  217. package/dist/components/Payroll/index.d.ts +3 -2
  218. package/dist/components/Payroll/payrollTypes.d.ts +1 -1
  219. package/dist/components/Payroll/payrollTypes.js +1 -1
  220. package/dist/components/Payroll/payrollTypes.js.map +1 -1
  221. package/dist/components/Payroll/usePreparedPayrollData.d.ts +1 -1
  222. package/dist/components/Payroll/usePreparedPayrollData.js +10 -8
  223. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  224. package/dist/components/TimeOff/TimeOffFlow/timeOffPolicyTypes.d.ts +1 -1
  225. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/useSelectEmployeesData.js +19 -19
  226. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/useSelectEmployeesData.js.map +1 -1
  227. package/dist/contexts/ApiProvider/ApiProvider.d.ts +5 -5
  228. package/dist/contexts/ApiProvider/ApiProvider.js.map +1 -1
  229. package/dist/contexts/ApiProvider/apiVersion.d.ts +2 -2
  230. package/dist/contexts/ApiProvider/apiVersion.js +1 -1
  231. package/dist/contexts/ApiProvider/apiVersion.js.map +1 -1
  232. package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js +40 -36
  233. package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js.map +1 -1
  234. package/dist/contexts/ComponentAdapter/componentAdapterTypes.d.ts +2 -0
  235. package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.d.ts +5 -0
  236. package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.js +18 -16
  237. package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.js.map +1 -1
  238. package/dist/contexts/ComponentAdapter/useComponentContext.d.ts +7 -1
  239. package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
  240. package/dist/contexts/GustoProvider/GustoProvider.d.ts +5 -5
  241. package/dist/contexts/GustoProvider/GustoProvider.js +6 -6
  242. package/dist/contexts/GustoProvider/GustoProvider.js.map +1 -1
  243. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.d.ts +8 -7
  244. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +8 -8
  245. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  246. package/dist/contexts/GustoProvider/index.d.ts +1 -1
  247. package/dist/contexts/ThemeProvider/types.d.ts +2 -2
  248. package/dist/contexts/index.d.ts +2 -6
  249. package/dist/i18n/en/Contractor.ContractorList.json.js +22 -18
  250. package/dist/i18n/en/Contractor.ContractorList.json.js.map +1 -1
  251. package/dist/i18n/en/Contractor.SignatureForm.json.js +5 -5
  252. package/dist/i18n/en/Contractor.Submit.json.js +11 -11
  253. package/dist/i18n/en/Employee.OnboardingSummary.json.js +24 -20
  254. package/dist/i18n/en/Employee.OnboardingSummary.json.js.map +1 -1
  255. package/dist/i18n/types.d.ts +15 -3
  256. package/dist/index.d.ts +8 -7
  257. package/dist/index.js +121 -134
  258. package/dist/index.js.map +1 -1
  259. package/dist/models/WA_RISK_CODES.d.ts +6 -2
  260. package/dist/models/WA_RISK_CODES.js.map +1 -1
  261. package/dist/models/external.d.ts +67 -57
  262. package/dist/partner-hook-utils/composeErrorHandler.d.ts +13 -4
  263. package/dist/partner-hook-utils/composeErrorHandler.js.map +1 -1
  264. package/dist/partner-hook-utils/form/SDKFormProvider.d.ts +11 -2
  265. package/dist/partner-hook-utils/form/SDKFormProvider.js +7 -1
  266. package/dist/partner-hook-utils/form/SDKFormProvider.js.map +1 -1
  267. package/dist/partner-hook-utils/form/composeSubmitHandler.d.ts +11 -4
  268. package/dist/partner-hook-utils/form/composeSubmitHandler.js.map +1 -1
  269. package/dist/partner-hook-utils/form/fields/CheckboxHookField.d.ts +1 -0
  270. package/dist/partner-hook-utils/form/fields/CheckboxHookField.js.map +1 -1
  271. package/dist/partner-hook-utils/form/fields/DatePickerHookField.d.ts +1 -0
  272. package/dist/partner-hook-utils/form/fields/DatePickerHookField.js.map +1 -1
  273. package/dist/partner-hook-utils/form/fields/NumberInputHookField.d.ts +1 -0
  274. package/dist/partner-hook-utils/form/fields/NumberInputHookField.js.map +1 -1
  275. package/dist/partner-hook-utils/form/fields/RadioGroupHookField.d.ts +1 -0
  276. package/dist/partner-hook-utils/form/fields/RadioGroupHookField.js.map +1 -1
  277. package/dist/partner-hook-utils/form/fields/SelectHookField.d.ts +1 -0
  278. package/dist/partner-hook-utils/form/fields/SelectHookField.js.map +1 -1
  279. package/dist/partner-hook-utils/form/fields/SwitchHookField.d.ts +1 -0
  280. package/dist/partner-hook-utils/form/fields/SwitchHookField.js.map +1 -1
  281. package/dist/partner-hook-utils/form/fields/TextInputHookField.d.ts +1 -0
  282. package/dist/partner-hook-utils/form/fields/TextInputHookField.js.map +1 -1
  283. package/dist/partner-hook-utils/form/fields/index.d.ts +1 -0
  284. package/dist/partner-hook-utils/form/index.d.ts +3 -3
  285. package/dist/partner-hook-utils/form/useHookFieldResolution.js.map +1 -1
  286. package/dist/partner-hook-utils/index.d.ts +1 -1
  287. package/dist/partner-hook-utils/types.d.ts +16 -3
  288. package/dist/shared/constants.d.ts +12 -2
  289. package/dist/shared/constants.js +11 -10
  290. package/dist/shared/constants.js.map +1 -1
  291. package/dist/style.css +1 -1
  292. package/dist/types/Helpers.d.ts +13 -0
  293. package/dist/types/hooks.d.ts +2 -1
  294. package/dist/types/observability.d.ts +1 -0
  295. package/docs/guides/endpoint-inventory.json +396 -380
  296. package/package.json +17 -17
@@ -1,169 +1,145 @@
1
- import { jsx as e, jsxs as c } 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 { useComponentContext as P } from "../../../contexts/ComponentAdapter/useComponentContext.js";
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 { useComponentContext as H } from "../../../contexts/ComponentAdapter/useComponentContext.js";
17
17
  import "react";
18
- import { FileInputField as J } from "../../Common/Fields/FileInputField/FileInputField.js";
19
- import { Form as Z } from "../../Common/Form/Form.js";
20
- import { useComponentDictionary as ee, useI18n as A } from "../../../i18n/I18n.js";
21
- import { informationRequestEvents as C } from "../../../shared/constants.js";
22
- import { useFlow as ne } from "../../Flow/useFlow.js";
23
- import { TextInputField as te } from "../../Common/Fields/TextInputField/TextInputField.js";
24
- const M = "gusto-sdk-information-request-form", oe = ["image/jpeg", "image/png", "application/pdf"], se = {
18
+ import { FileInputField as G } from "../../Common/Fields/FileInputField/FileInputField.js";
19
+ import { Form as V } from "../../Common/Form/Form.js";
20
+ import { useComponentDictionary as X, useI18n as Y } from "../../../i18n/I18n.js";
21
+ import { informationRequestEvents as $ } from "../../../shared/constants.js";
22
+ import "../../Flow/useFlow.js";
23
+ import { TextInputField as J } from "../../Common/Fields/TextInputField/TextInputField.js";
24
+ const K = "gusto-sdk-information-request-form", Z = ["image/jpeg", "image/png", "application/pdf"], ee = {
25
25
  ALLOWED_TAGS: ["a", "b", "strong"],
26
26
  ALLOWED_ATTR: ["target", "href", "rel"]
27
- }, ie = 5e3, re = f.record(
28
- f.string(),
29
- f.union([f.string().min(1), f.instanceof(File)])
27
+ }, oe = 5e3, ne = l.record(
28
+ l.string(),
29
+ l.union([l.string().min(1), l.instanceof(File)])
30
30
  );
31
- function ae(o) {
32
- return /* @__PURE__ */ e(Y, { ...o, children: /* @__PURE__ */ e(le, { ...o, children: o.children }) });
31
+ function Pe(t) {
32
+ return /* @__PURE__ */ e(W, { ...t, children: /* @__PURE__ */ e(ae, { ...t, children: t.children }) });
33
33
  }
34
- const ue = (o) => new Promise((s, r) => {
35
- const n = new FileReader();
36
- n.onload = () => {
37
- s(n.result);
38
- }, n.onerror = r, n.readAsDataURL(o);
39
- }), me = [u.Text, u.Document];
40
- function O(o) {
41
- return o.some((s) => !me.includes(s.responseType));
34
+ const te = (t) => new Promise((r, h) => {
35
+ const o = new FileReader();
36
+ o.onload = () => {
37
+ r(o.result);
38
+ }, o.onerror = h, o.readAsDataURL(t);
39
+ }), se = [i.Text, i.Document];
40
+ function re(t) {
41
+ return t.some((r) => !se.includes(r.responseType));
42
42
  }
43
- function ce(o) {
44
- return o.some((s) => s.responseType === u.Persona);
43
+ function ie(t) {
44
+ return t.some((r) => r.responseType === i.Persona);
45
45
  }
46
- function le({ companyId: o, requestId: s, dictionary: r }) {
47
- ee("InformationRequests.InformationRequestForm", r), A("InformationRequests.InformationRequestForm");
48
- const { t: n } = D("InformationRequests.InformationRequestForm"), { Alert: T, Heading: y, Text: m } = P(), { onEvent: g, baseSubmitHandler: I } = $(), { data: x } = _({
49
- companyUuid: o
50
- }), 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 = [];
51
- a.forEach((t) => {
52
- t.responseType === u.Text ? (E.push(t.questionUuid), v[t.questionUuid] = "") : t.responseType === u.Document && (E.push(t.questionUuid), v[t.questionUuid] = void 0);
46
+ function ae({ companyId: t, requestId: r, dictionary: h }) {
47
+ X("InformationRequests.InformationRequestForm", h), Y("InformationRequests.InformationRequestForm");
48
+ const { t: o } = C("InformationRequests.InformationRequestForm"), { Alert: F, Heading: S, Text: a } = H(), { onEvent: x, baseSubmitHandler: N } = j(), { data: D } = z({
49
+ companyUuid: t
50
+ }), 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 = [];
51
+ c.forEach((n) => {
52
+ n.responseType === i.Text ? (R.push(n.questionUuid), T[n.questionUuid] = "") : n.responseType === i.Document && (R.push(n.questionUuid), T[n.questionUuid] = void 0);
53
53
  });
54
- const b = W({
55
- resolver: G(re),
56
- defaultValues: v
57
- }), L = async (t) => {
58
- await I(t, async () => {
59
- const h = (await Promise.all(
60
- E.map(async (p) => {
61
- const d = t[p];
62
- if (typeof d == "string")
54
+ const I = L({
55
+ resolver: k(ne),
56
+ defaultValues: T
57
+ }), _ = async (n) => {
58
+ await N(n, async () => {
59
+ const f = (await Promise.all(
60
+ R.map(async (u) => {
61
+ const m = n[u];
62
+ if (typeof m == "string")
63
63
  return {
64
- questionUuid: p,
65
- responseType: U.Text,
66
- textResponse: d
64
+ questionUuid: u,
65
+ responseType: v.Text,
66
+ textResponse: m
67
67
  };
68
- if (d instanceof File) {
69
- const z = await ue(d);
68
+ if (m instanceof File) {
69
+ const w = await te(m);
70
70
  return {
71
- questionUuid: p,
72
- responseType: U.Document,
73
- fileResponse: z,
74
- fileName: d.name
71
+ questionUuid: u,
72
+ responseType: v.Document,
73
+ fileResponse: w,
74
+ fileName: m.name
75
75
  };
76
76
  }
77
77
  return null;
78
78
  })
79
- )).filter((p) => p !== null), S = await Q({
79
+ )).filter((u) => u !== null), q = await P({
80
80
  request: {
81
- informationRequestUuid: s,
81
+ informationRequestUuid: r,
82
82
  requestBody: {
83
- requiredQuestions: h
83
+ requiredQuestions: f
84
84
  }
85
85
  }
86
86
  });
87
- g(C.INFORMATION_REQUEST_FORM_DONE, S.informationRequest);
87
+ x($.INFORMATION_REQUEST_FORM_DONE, q.informationRequest);
88
88
  });
89
- }, k = (t) => {
90
- const R = t.questionUuid, h = t.responseType === u.Document, S = t.responseType === u.Text;
91
- return /* @__PURE__ */ c("div", { className: i.questionCard, children: [
92
- /* @__PURE__ */ c("div", { className: i.questionDescription, children: [
93
- /* @__PURE__ */ e(m, { size: "sm", weight: "medium", children: n(h ? "questionTypes.document" : "questionTypes.answer") }),
94
- /* @__PURE__ */ e(m, { size: "sm", variant: "supporting", children: /* @__PURE__ */ e(
89
+ }, A = (n) => {
90
+ const d = n.questionUuid, f = n.responseType === i.Document, q = n.responseType === i.Text;
91
+ return /* @__PURE__ */ p("div", { className: s.questionCard, children: [
92
+ /* @__PURE__ */ p("div", { className: s.questionDescription, children: [
93
+ /* @__PURE__ */ e(a, { size: "sm", weight: "medium", children: o(f ? "questionTypes.document" : "questionTypes.answer") }),
94
+ /* @__PURE__ */ e(a, { size: "sm", variant: "supporting", children: /* @__PURE__ */ e(
95
95
  "span",
96
96
  {
97
97
  dangerouslySetInnerHTML: {
98
- __html: B.sanitize(t.questionText, se)
98
+ __html: M.sanitize(n.questionText, ee)
99
99
  }
100
100
  }
101
101
  ) })
102
102
  ] }),
103
- /* @__PURE__ */ e("hr", { className: i.divider }),
104
- S && /* @__PURE__ */ e("div", { className: i.textInputWrapper, children: /* @__PURE__ */ e(
105
- te,
103
+ /* @__PURE__ */ e("hr", { className: s.divider }),
104
+ q && /* @__PURE__ */ e("div", { className: s.textInputWrapper, children: /* @__PURE__ */ e(
105
+ J,
106
106
  {
107
- name: R,
108
- label: n("fields.textAnswer.label"),
109
- placeholder: n("fields.textAnswer.placeholder"),
110
- maxLength: ie,
107
+ name: d,
108
+ label: o("fields.textAnswer.label"),
109
+ placeholder: o("fields.textAnswer.placeholder"),
110
+ maxLength: oe,
111
111
  isRequired: !0,
112
- errorMessage: n("validation.required")
112
+ errorMessage: o("validation.required")
113
113
  }
114
114
  ) }),
115
- h && /* @__PURE__ */ e("div", { className: i.fileInputWrapper, children: /* @__PURE__ */ e(
116
- J,
115
+ f && /* @__PURE__ */ e("div", { className: s.fileInputWrapper, children: /* @__PURE__ */ e(
116
+ G,
117
117
  {
118
- name: R,
119
- label: n("fields.fileUpload.label"),
120
- accept: oe,
118
+ name: d,
119
+ label: o("fields.fileUpload.label"),
120
+ accept: Z,
121
121
  isRequired: !0,
122
- errorMessage: n("validation.required")
122
+ errorMessage: o("validation.required")
123
123
  }
124
124
  ) })
125
- ] }, R);
126
- }, j = /* @__PURE__ */ c("div", { className: i.questionCard, children: [
127
- /* @__PURE__ */ c("div", { className: i.questionDescription, children: [
128
- /* @__PURE__ */ e(m, { weight: "medium", children: n(N ? "unsupported.persona.title" : "unsupported.generic.title") }),
129
- /* @__PURE__ */ e(m, { children: n(
130
- N ? "unsupported.persona.description" : "unsupported.generic.description"
125
+ ] }, d);
126
+ }, O = /* @__PURE__ */ p("div", { className: s.questionCard, children: [
127
+ /* @__PURE__ */ p("div", { className: s.questionDescription, children: [
128
+ /* @__PURE__ */ e(a, { weight: "medium", children: o(g ? "unsupported.persona.title" : "unsupported.generic.title") }),
129
+ /* @__PURE__ */ e(a, { children: o(
130
+ g ? "unsupported.persona.description" : "unsupported.generic.description"
131
131
  ) })
132
132
  ] }),
133
- /* @__PURE__ */ e("hr", { className: i.divider }),
134
- /* @__PURE__ */ e("div", { className: i.contactSupport, children: /* @__PURE__ */ e(m, { variant: "supporting", children: n("unsupported.contactSupport") }) })
133
+ /* @__PURE__ */ e("hr", { className: s.divider }),
134
+ /* @__PURE__ */ e("div", { className: s.contactSupport, children: /* @__PURE__ */ e(a, { variant: "supporting", children: o("unsupported.contactSupport") }) })
135
135
  ] });
136
- return /* @__PURE__ */ e("div", { className: i.root, children: /* @__PURE__ */ c(q, { flexDirection: "column", gap: 16, children: [
137
- /* @__PURE__ */ e(y, { as: "h2", children: n("title") }),
138
- F && /* @__PURE__ */ e(T, { status: "error", label: n("blockingAlert.title"), disableScrollIntoView: !0, children: n("blockingAlert.description") }),
139
- 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) }) }) })
136
+ return /* @__PURE__ */ e("div", { className: s.root, children: /* @__PURE__ */ p(E, { flexDirection: "column", gap: 16, children: [
137
+ /* @__PURE__ */ e(S, { as: "h2", children: o("title") }),
138
+ U && /* @__PURE__ */ e(F, { status: "error", label: o("blockingAlert.title"), disableScrollIntoView: !0, children: o("blockingAlert.description") }),
139
+ b ? O : /* @__PURE__ */ e(Q, { ...I, children: /* @__PURE__ */ e(V, { id: K, onSubmit: I.handleSubmit(_), children: /* @__PURE__ */ e(E, { flexDirection: "column", gap: 16, children: c.map(A) }) }) })
140
140
  ] }) });
141
141
  }
142
- const pe = ({ onEvent: o }) => {
143
- A("InformationRequests.InformationRequestForm");
144
- const { t: s } = D("InformationRequests.InformationRequestForm"), { Button: r } = P(), { companyId: n, selectedRequestId: T } = ne(), { data: y } = _({
145
- companyUuid: n
146
- }), g = y.informationRequests?.find((F) => F.uuid === T)?.requiredQuestions ?? [], I = O(g), l = K({
147
- mutationKey: X()
148
- }) > 0, a = () => {
149
- o(C.INFORMATION_REQUEST_FORM_CANCEL);
150
- };
151
- return I ? /* @__PURE__ */ e(q, { justifyContent: "flex-end", gap: 12, children: /* @__PURE__ */ e(r, { variant: "secondary", onClick: a, children: s("cta.close") }) }) : /* @__PURE__ */ c(q, { justifyContent: "flex-end", gap: 12, children: [
152
- /* @__PURE__ */ e(r, { variant: "secondary", onClick: a, isDisabled: l, children: s("cta.cancel") }),
153
- /* @__PURE__ */ e(
154
- r,
155
- {
156
- variant: "primary",
157
- type: "submit",
158
- form: M,
159
- isLoading: l,
160
- children: s("cta.submit")
161
- }
162
- )
163
- ] });
164
- };
165
- ae.Footer = pe;
166
142
  export {
167
- ae as InformationRequestForm
143
+ Pe as InformationRequestForm
168
144
  };
169
145
  //# 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\nconst 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\nInformationRequestForm.Footer = Footer\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,GAASC,MAAW;AAC9C,QAAMC,IAAS,IAAI,WAAA;AACnB,EAAAA,EAAO,SAAS,MAAM;AACpB,IAAAF,EAAQE,EAAO,MAAgB;AAAA,EACjC,GACAA,EAAO,UAAUD,GACjBC,EAAO,cAAcH,CAAI;AAC3B,CAAC,GAGGI,KAA2C,CAACC,EAAa,MAAMA,EAAa,QAAQ;AAE1F,SAASC,EAA4BC,GAAgC;AACnE,SAAOA,EAAU,KAAK,CAAAC,MAAY,CAACJ,GAAyB,SAASI,EAAS,YAAY,CAAC;AAC7F;AAEA,SAASC,GAAuBF,GAAgC;AAC9D,SAAOA,EAAU,KAAK,CAAAC,MAAYA,EAAS,iBAAiBH,EAAa,OAAO;AAClF;AAEA,SAASP,GAAK,EAAE,WAAAY,GAAW,WAAAC,GAAW,YAAAC,KAA2C;AAC/E,EAAAC,GAAuB,8CAA8CD,CAAU,GAC/EE,EAAQ,4CAA4C;AACpD,QAA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C,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;AAEAvE,GAAuB,SAASmE;"}
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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AxC,EAACgE,GAAA,EAAK,IAAIxE,GAA6B,UAAUgD,EAAY,aAAaG,CAAQ,GAChF,UAAA,gBAAA3C,EAAC8D,GAAA,EAAK,eAAc,UAAS,KAAK,IAC/B,UAAA9B,EAAkB,IAAIoB,CAAc,EAAA,CACvC,EAAA,CACF,EAAA,CACF;AAAA,EAAA,EAAA,CAEJ,EAAA,CACF;AAEJ;"}
@@ -14,8 +14,3 @@ 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: ({ onEvent }: {
19
- onEvent: OnEventType<EventType, unknown>;
20
- }) => import("react").JSX.Element;
21
- }
@@ -1,20 +1,19 @@
1
- import { jsx as m } from "react/jsx-runtime";
2
- import { useFlow as n } from "../Flow/useFlow.js";
3
- import { ensureRequired as u } from "../../helpers/ensureRequired.js";
4
- import { InformationRequestForm as o } from "./InformationRequestForm/InformationRequestForm.js";
5
- function s() {
6
- const { companyId: e, selectedRequestId: r, onEvent: t } = n();
7
- return /* @__PURE__ */ m(
8
- o,
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { useFlow as m } from "../Flow/useFlow.js";
3
+ import { ensureRequired as n } from "../../helpers/ensureRequired.js";
4
+ import { InformationRequestForm as u } from "./InformationRequestForm/InformationRequestForm.js";
5
+ function d() {
6
+ const { companyId: o, selectedRequestId: e, onEvent: r } = m();
7
+ return /* @__PURE__ */ t(
8
+ u,
9
9
  {
10
- companyId: e,
11
- requestId: u(r),
12
- onEvent: t
10
+ companyId: o,
11
+ requestId: n(e),
12
+ onEvent: r
13
13
  }
14
14
  );
15
15
  }
16
- s.Footer = o.Footer;
17
16
  export {
18
- s as InformationRequestFormContextual
17
+ d as InformationRequestFormContextual
19
18
  };
20
19
  //# sourceMappingURL=InformationRequestsComponents.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"InformationRequestsComponents.js","sources":["../../../src/components/InformationRequests/InformationRequestsComponents.tsx"],"sourcesContent":["import { InformationRequestForm } from './InformationRequestForm'\nimport { useFlow } from '@/components/Flow/useFlow'\nimport { ensureRequired } from '@/helpers/ensureRequired'\nimport type { FlowContextInterface } from '@/components/Flow/useFlow'\nimport type { CommonComponentInterface } from '@/components/Base'\nimport type { EventType } from '@/types/Helpers'\nimport type { OnEventType } from '@/components/Base/useBase'\n\n/** @internal */\nexport interface InformationRequestsContextInterface extends FlowContextInterface {\n companyId: string\n selectedRequestId?: string\n component:\n | (React.ComponentType<CommonComponentInterface> & {\n Footer?: React.ComponentType<{\n onEvent: OnEventType<EventType, unknown>\n }>\n })\n | null\n}\n\n/** @internal */\nexport function InformationRequestFormContextual() {\n const { companyId, selectedRequestId, onEvent } = useFlow<InformationRequestsContextInterface>()\n\n return (\n <InformationRequestForm\n companyId={companyId}\n requestId={ensureRequired(selectedRequestId)}\n onEvent={onEvent}\n />\n )\n}\n\nInformationRequestFormContextual.Footer = InformationRequestForm.Footer\n"],"names":["InformationRequestFormContextual","companyId","selectedRequestId","onEvent","useFlow","jsx","InformationRequestForm","ensureRequired"],"mappings":";;;;AAsBO,SAASA,IAAmC;AACjD,QAAM,EAAE,WAAAC,GAAW,mBAAAC,GAAmB,SAAAC,EAAA,IAAYC,EAAA;AAElD,SACE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,WAAAL;AAAA,MACA,WAAWM,EAAeL,CAAiB;AAAA,MAC3C,SAAAC;AAAA,IAAA;AAAA,EAAA;AAGN;AAEAH,EAAiC,SAASM,EAAuB;"}
1
+ {"version":3,"file":"InformationRequestsComponents.js","sources":["../../../src/components/InformationRequests/InformationRequestsComponents.tsx"],"sourcesContent":["import { InformationRequestForm } from './InformationRequestForm'\nimport { useFlow } from '@/components/Flow/useFlow'\nimport { ensureRequired } from '@/helpers/ensureRequired'\nimport type { FlowContextInterface } from '@/components/Flow/useFlow'\nimport type { CommonComponentInterface } from '@/components/Base'\nimport type { EventType } from '@/types/Helpers'\nimport type { OnEventType } from '@/components/Base/useBase'\n\n/** @internal */\nexport interface InformationRequestsContextInterface extends FlowContextInterface {\n companyId: string\n selectedRequestId?: string\n component:\n | (React.ComponentType<CommonComponentInterface> & {\n Footer?: React.ComponentType<{\n onEvent: OnEventType<EventType, unknown>\n }>\n })\n | null\n}\n\n/** @internal */\nexport function InformationRequestFormContextual() {\n const { companyId, selectedRequestId, onEvent } = useFlow<InformationRequestsContextInterface>()\n\n return (\n <InformationRequestForm\n companyId={companyId}\n requestId={ensureRequired(selectedRequestId)}\n onEvent={onEvent}\n />\n )\n}\n"],"names":["InformationRequestFormContextual","companyId","selectedRequestId","onEvent","useFlow","jsx","InformationRequestForm","ensureRequired"],"mappings":";;;;AAsBO,SAASA,IAAmC;AACjD,QAAM,EAAE,WAAAC,GAAW,mBAAAC,GAAmB,SAAAC,EAAA,IAAYC,EAAA;AAElD,SACE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,WAAAL;AAAA,MACA,WAAWM,EAAeL,CAAiB;AAAA,MAC3C,SAAAC;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -1,7 +1,7 @@
1
1
  import { jsx as n } from "react/jsx-runtime";
2
2
  import { useMemo as d } from "react";
3
3
  import { usePayrollsGetSuspense as u } from "@gusto/embedded-api/react-query/payrollsGet";
4
- import { PayrollExecutionFlow as p } from "../PayrollExecutionFlow/PayrollExecutionFlow.js";
4
+ import { PayrollExecutionInternalFlow as p } from "../PayrollExecutionFlow/PayrollExecutionFlow.js";
5
5
  import { DismissalPayPeriodSelection as y } from "./DismissalPayPeriodSelection/DismissalPayPeriodSelection.js";
6
6
  import { useFlow as a } from "../../Flow/useFlow.js";
7
7
  import { ensureRequired as s } from "../../../helpers/ensureRequired.js";
@@ -18,7 +18,7 @@ function C() {
18
18
  );
19
19
  }
20
20
  function w() {
21
- const { companyId: o, payrollUuid: e, onEvent: r, header: t } = a(), i = t?.type === "breadcrumbs" ? t.breadcrumbs?.payPeriodSelection?.[0] : void 0, m = d(() => i ? [i] : void 0, [i]), l = s(o), c = s(e);
21
+ const { companyId: o, payrollUuid: e, onEvent: r, header: i } = a(), t = i?.type === "breadcrumbs" ? i.breadcrumbs?.payPeriodSelection?.[0] : void 0, m = d(() => t ? [t] : void 0, [t]), l = s(o), c = s(e);
22
22
  return /* @__PURE__ */ n(P, { onEvent: r, children: /* @__PURE__ */ n(
23
23
  f,
24
24
  {
@@ -34,13 +34,13 @@ function f({
34
34
  payrollId: e,
35
35
  ...r
36
36
  }) {
37
- const { data: t } = u({ companyId: o, payrollId: e }), i = t.payrollShow?.payPeriod;
37
+ const { data: i } = u({ companyId: o, payrollId: e }), t = i.payrollShow?.payPeriod;
38
38
  return /* @__PURE__ */ n(
39
39
  p,
40
40
  {
41
41
  companyId: o,
42
42
  payrollId: e,
43
- initialPayPeriod: i,
43
+ initialPayPeriod: t,
44
44
  isDismissalPayroll: !0,
45
45
  ...r
46
46
  }
@@ -1 +1 @@
1
- {"version":3,"file":"DismissalFlowComponents.js","sources":["../../../../src/components/Payroll/Dismissal/DismissalFlowComponents.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { usePayrollsGetSuspense } from '@gusto/embedded-api/react-query/payrollsGet'\nimport {\n PayrollExecutionFlow,\n type PayrollExecutionFlowProps,\n} from '../PayrollExecutionFlow/PayrollExecutionFlow'\nimport { DismissalPayPeriodSelection } from './DismissalPayPeriodSelection/DismissalPayPeriodSelection'\nimport { useFlow, type FlowContextInterface } from '@/components/Flow/useFlow'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport type { EventType } from '@/shared/constants'\nimport { ensureRequired } from '@/helpers/ensureRequired'\nimport { BaseComponent } from '@/components/Base/Base'\n\n/** @internal */\nexport interface DismissalFlowContextInterface extends FlowContextInterface {\n /** The associated company identifier. */\n companyId: string\n /** The terminated employee whose final payroll is being run. */\n employeeId?: string\n /** The dismissal payroll identifier, set once a pay period has been selected and the payroll created. */\n payrollUuid?: string\n}\n\n/**\n * Props for {@link DismissalFlow}.\n *\n * @public\n */\nexport interface DismissalFlowProps {\n /** The associated company identifier. */\n companyId: string\n /** The terminated employee whose final payroll is being run. */\n employeeId?: string\n /** Handler for events emitted by the flow. See {@link DismissalFlow} for the event table. */\n onEvent: OnEventType<EventType, unknown>\n /** Optional dismissal payroll identifier. When provided, the flow skips pay period selection and starts directly at payroll execution. */\n payrollId?: string\n}\n\n/** @internal */\nexport function DismissalPayPeriodSelectionContextual() {\n const { companyId, employeeId, onEvent } = useFlow<DismissalFlowContextInterface>()\n return (\n <DismissalPayPeriodSelection\n companyId={ensureRequired(companyId)}\n employeeId={employeeId}\n onEvent={onEvent}\n />\n )\n}\n\n/** @internal */\nexport function DismissalExecutionContextual() {\n const { companyId, payrollUuid, onEvent, header } = useFlow<DismissalFlowContextInterface>()\n\n const payPeriodSelectionBreadcrumb =\n header?.type === 'breadcrumbs' ? header.breadcrumbs?.['payPeriodSelection']?.[0] : undefined\n const prefixBreadcrumbs = useMemo(() => {\n return payPeriodSelectionBreadcrumb ? [payPeriodSelectionBreadcrumb] : undefined\n }, [payPeriodSelectionBreadcrumb])\n\n const resolvedCompanyId = ensureRequired(companyId)\n const resolvedPayrollId = ensureRequired(payrollUuid)\n\n return (\n <BaseComponent onEvent={onEvent}>\n <DismissalExecutionWithData\n companyId={resolvedCompanyId}\n payrollId={resolvedPayrollId}\n onEvent={onEvent}\n prefixBreadcrumbs={prefixBreadcrumbs}\n />\n </BaseComponent>\n )\n}\n\ntype DismissalExecutionWithDataProps = Pick<\n PayrollExecutionFlowProps,\n 'companyId' | 'payrollId' | 'onEvent' | 'prefixBreadcrumbs'\n>\n\nfunction DismissalExecutionWithData({\n companyId,\n payrollId,\n ...rest\n}: DismissalExecutionWithDataProps) {\n const { data } = usePayrollsGetSuspense({ companyId, payrollId })\n const initialPayPeriod = data.payrollShow?.payPeriod\n\n return (\n <PayrollExecutionFlow\n companyId={companyId}\n payrollId={payrollId}\n initialPayPeriod={initialPayPeriod}\n isDismissalPayroll\n {...rest}\n />\n )\n}\n"],"names":["DismissalPayPeriodSelectionContextual","companyId","employeeId","onEvent","useFlow","jsx","DismissalPayPeriodSelection","ensureRequired","DismissalExecutionContextual","payrollUuid","header","payPeriodSelectionBreadcrumb","prefixBreadcrumbs","useMemo","resolvedCompanyId","resolvedPayrollId","BaseComponent","DismissalExecutionWithData","payrollId","rest","data","usePayrollsGetSuspense","initialPayPeriod","PayrollExecutionFlow"],"mappings":";;;;;;;;AAwCO,SAASA,IAAwC;AACtD,QAAM,EAAE,WAAAC,GAAW,YAAAC,GAAY,SAAAC,EAAA,IAAYC,EAAA;AAC3C,SACE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAeN,CAAS;AAAA,MACnC,YAAAC;AAAA,MACA,SAAAC;AAAA,IAAA;AAAA,EAAA;AAGN;AAGO,SAASK,IAA+B;AAC7C,QAAM,EAAE,WAAAP,GAAW,aAAAQ,GAAa,SAAAN,GAAS,QAAAO,EAAA,IAAWN,EAAA,GAE9CO,IACJD,GAAQ,SAAS,gBAAgBA,EAAO,aAAc,qBAAwB,CAAC,IAAI,QAC/EE,IAAoBC,EAAQ,MACzBF,IAA+B,CAACA,CAA4B,IAAI,QACtE,CAACA,CAA4B,CAAC,GAE3BG,IAAoBP,EAAeN,CAAS,GAC5Cc,IAAoBR,EAAeE,CAAW;AAEpD,SACE,gBAAAJ,EAACW,KAAc,SAAAb,GACb,UAAA,gBAAAE;AAAA,IAACY;AAAA,IAAA;AAAA,MACC,WAAWH;AAAA,MACX,WAAWC;AAAA,MACX,SAAAZ;AAAA,MACA,mBAAAS;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;AAOA,SAASK,EAA2B;AAAA,EAClC,WAAAhB;AAAA,EACA,WAAAiB;AAAA,EACA,GAAGC;AACL,GAAoC;AAClC,QAAM,EAAE,MAAAC,EAAA,IAASC,EAAuB,EAAE,WAAApB,GAAW,WAAAiB,GAAW,GAC1DI,IAAmBF,EAAK,aAAa;AAE3C,SACE,gBAAAf;AAAA,IAACkB;AAAA,IAAA;AAAA,MACC,WAAAtB;AAAA,MACA,WAAAiB;AAAA,MACA,kBAAAI;AAAA,MACA,oBAAkB;AAAA,MACjB,GAAGH;AAAA,IAAA;AAAA,EAAA;AAGV;"}
1
+ {"version":3,"file":"DismissalFlowComponents.js","sources":["../../../../src/components/Payroll/Dismissal/DismissalFlowComponents.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { usePayrollsGetSuspense } from '@gusto/embedded-api/react-query/payrollsGet'\nimport {\n PayrollExecutionInternalFlow,\n type PayrollExecutionInternalFlowProps,\n} from '../PayrollExecutionFlow/PayrollExecutionFlow'\nimport { DismissalPayPeriodSelection } from './DismissalPayPeriodSelection/DismissalPayPeriodSelection'\nimport { useFlow, type FlowContextInterface } from '@/components/Flow/useFlow'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport type { EventType } from '@/shared/constants'\nimport { ensureRequired } from '@/helpers/ensureRequired'\nimport { BaseComponent } from '@/components/Base/Base'\n\n/** @internal */\nexport interface DismissalFlowContextInterface extends FlowContextInterface {\n /** The associated company identifier. */\n companyId: string\n /** The terminated employee whose final payroll is being run. */\n employeeId?: string\n /** The dismissal payroll identifier, set once a pay period has been selected and the payroll created. */\n payrollUuid?: string\n}\n\n/**\n * Props for {@link DismissalFlow}.\n *\n * @public\n */\nexport interface DismissalFlowProps {\n /** The associated company identifier. */\n companyId: string\n /** The terminated employee whose final payroll is being run. */\n employeeId?: string\n /** Handler for events emitted by the flow. See {@link DismissalFlow} for the event table. */\n onEvent: OnEventType<EventType, unknown>\n /** Optional dismissal payroll identifier. When provided, the flow skips pay period selection and starts directly at payroll execution. */\n payrollId?: string\n}\n\n/** @internal */\nexport function DismissalPayPeriodSelectionContextual() {\n const { companyId, employeeId, onEvent } = useFlow<DismissalFlowContextInterface>()\n return (\n <DismissalPayPeriodSelection\n companyId={ensureRequired(companyId)}\n employeeId={employeeId}\n onEvent={onEvent}\n />\n )\n}\n\n/** @internal */\nexport function DismissalExecutionContextual() {\n const { companyId, payrollUuid, onEvent, header } = useFlow<DismissalFlowContextInterface>()\n\n const payPeriodSelectionBreadcrumb =\n header?.type === 'breadcrumbs' ? header.breadcrumbs?.['payPeriodSelection']?.[0] : undefined\n const prefixBreadcrumbs = useMemo(() => {\n return payPeriodSelectionBreadcrumb ? [payPeriodSelectionBreadcrumb] : undefined\n }, [payPeriodSelectionBreadcrumb])\n\n const resolvedCompanyId = ensureRequired(companyId)\n const resolvedPayrollId = ensureRequired(payrollUuid)\n\n return (\n <BaseComponent onEvent={onEvent}>\n <DismissalExecutionWithData\n companyId={resolvedCompanyId}\n payrollId={resolvedPayrollId}\n onEvent={onEvent}\n prefixBreadcrumbs={prefixBreadcrumbs}\n />\n </BaseComponent>\n )\n}\n\ntype DismissalExecutionWithDataProps = Pick<\n PayrollExecutionInternalFlowProps,\n 'companyId' | 'payrollId' | 'onEvent' | 'prefixBreadcrumbs'\n>\n\nfunction DismissalExecutionWithData({\n companyId,\n payrollId,\n ...rest\n}: DismissalExecutionWithDataProps) {\n const { data } = usePayrollsGetSuspense({ companyId, payrollId })\n const initialPayPeriod = data.payrollShow?.payPeriod\n\n return (\n <PayrollExecutionInternalFlow\n companyId={companyId}\n payrollId={payrollId}\n initialPayPeriod={initialPayPeriod}\n isDismissalPayroll\n {...rest}\n />\n )\n}\n"],"names":["DismissalPayPeriodSelectionContextual","companyId","employeeId","onEvent","useFlow","jsx","DismissalPayPeriodSelection","ensureRequired","DismissalExecutionContextual","payrollUuid","header","payPeriodSelectionBreadcrumb","prefixBreadcrumbs","useMemo","resolvedCompanyId","resolvedPayrollId","BaseComponent","DismissalExecutionWithData","payrollId","rest","data","usePayrollsGetSuspense","initialPayPeriod","PayrollExecutionInternalFlow"],"mappings":";;;;;;;;AAwCO,SAASA,IAAwC;AACtD,QAAM,EAAE,WAAAC,GAAW,YAAAC,GAAY,SAAAC,EAAA,IAAYC,EAAA;AAC3C,SACE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAeN,CAAS;AAAA,MACnC,YAAAC;AAAA,MACA,SAAAC;AAAA,IAAA;AAAA,EAAA;AAGN;AAGO,SAASK,IAA+B;AAC7C,QAAM,EAAE,WAAAP,GAAW,aAAAQ,GAAa,SAAAN,GAAS,QAAAO,EAAA,IAAWN,EAAA,GAE9CO,IACJD,GAAQ,SAAS,gBAAgBA,EAAO,aAAc,qBAAwB,CAAC,IAAI,QAC/EE,IAAoBC,EAAQ,MACzBF,IAA+B,CAACA,CAA4B,IAAI,QACtE,CAACA,CAA4B,CAAC,GAE3BG,IAAoBP,EAAeN,CAAS,GAC5Cc,IAAoBR,EAAeE,CAAW;AAEpD,SACE,gBAAAJ,EAACW,KAAc,SAAAb,GACb,UAAA,gBAAAE;AAAA,IAACY;AAAA,IAAA;AAAA,MACC,WAAWH;AAAA,MACX,WAAWC;AAAA,MACX,SAAAZ;AAAA,MACA,mBAAAS;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;AAOA,SAASK,EAA2B;AAAA,EAClC,WAAAhB;AAAA,EACA,WAAAiB;AAAA,EACA,GAAGC;AACL,GAAoC;AAClC,QAAM,EAAE,MAAAC,EAAA,IAASC,EAAuB,EAAE,WAAApB,GAAW,WAAAiB,GAAW,GAC1DI,IAAmBF,EAAK,aAAa;AAE3C,SACE,gBAAAf;AAAA,IAACkB;AAAA,IAAA;AAAA,MACC,WAAAtB;AAAA,MACA,WAAAiB;AAAA,MACA,kBAAAI;AAAA,MACA,oBAAkB;AAAA,MACjB,GAAGH;AAAA,IAAA;AAAA,EAAA;AAGV;"}
@@ -5,7 +5,7 @@ import { EventType } from '../../../shared/constants';
5
5
  /**
6
6
  * Flow context shared across the off-cycle payroll flow steps.
7
7
  *
8
- * @public
8
+ * @internal
9
9
  */
10
10
  export interface OffCycleFlowContextInterface extends FlowContextInterface {
11
11
  /** The associated company identifier. */
@@ -1,7 +1,7 @@
1
- import { jsx as i } from "react/jsx-runtime";
1
+ import { jsx as l } from "react/jsx-runtime";
2
2
  import { useMemo as y } from "react";
3
3
  import { usePayrollsGetSuspense as p } from "@gusto/embedded-api/react-query/payrollsGet";
4
- import { PayrollExecutionFlow as u } from "../PayrollExecutionFlow/PayrollExecutionFlow.js";
4
+ import { PayrollExecutionInternalFlow as u } from "../PayrollExecutionFlow/PayrollExecutionFlow.js";
5
5
  import { isDismissalPayroll as d } from "../helpers.js";
6
6
  import { useFlow as s } from "../../Flow/useFlow.js";
7
7
  import { ensureRequired as a } from "../../../helpers/ensureRequired.js";
@@ -9,7 +9,7 @@ import { BaseComponent as C } from "../../Base/Base.js";
9
9
  import { OffCycleCreation as P } from "../OffCycleCreation/OffCycleCreation.js";
10
10
  function D() {
11
11
  const { companyId: o, payrollType: r, onEvent: e } = s();
12
- return /* @__PURE__ */ i(
12
+ return /* @__PURE__ */ l(
13
13
  P,
14
14
  {
15
15
  companyId: a(o),
@@ -19,11 +19,11 @@ function D() {
19
19
  );
20
20
  }
21
21
  function S() {
22
- const { companyId: o, payrollUuid: r, onEvent: e, withReimbursements: t, header: n } = s(), m = a(o), c = a(r), l = n?.type === "breadcrumbs" ? n.breadcrumbs?.createOffCyclePayroll?.[0] : void 0, f = y(
23
- () => l ? [l] : void 0,
24
- [l]
22
+ const { companyId: o, payrollUuid: r, onEvent: e, withReimbursements: t, header: n } = s(), m = a(o), c = a(r), i = n?.type === "breadcrumbs" ? n.breadcrumbs?.createOffCyclePayroll?.[0] : void 0, f = y(
23
+ () => i ? [i] : void 0,
24
+ [i]
25
25
  );
26
- return /* @__PURE__ */ i(C, { onEvent: e, children: /* @__PURE__ */ i(
26
+ return /* @__PURE__ */ l(C, { onEvent: e, children: /* @__PURE__ */ l(
27
27
  x,
28
28
  {
29
29
  companyId: m,
@@ -40,7 +40,7 @@ function x({
40
40
  ...e
41
41
  }) {
42
42
  const { data: t } = p({ companyId: o, payrollId: r }), n = t.payrollShow?.payPeriod;
43
- return /* @__PURE__ */ i(
43
+ return /* @__PURE__ */ l(
44
44
  u,
45
45
  {
46
46
  companyId: o,
@@ -1 +1 @@
1
- {"version":3,"file":"OffCycleFlowComponents.js","sources":["../../../../src/components/Payroll/OffCycle/OffCycleFlowComponents.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { usePayrollsGetSuspense } from '@gusto/embedded-api/react-query/payrollsGet'\nimport { OffCycleCreation } from '../OffCycleCreation'\nimport {\n PayrollExecutionFlow,\n type PayrollExecutionFlowProps,\n} from '../PayrollExecutionFlow/PayrollExecutionFlow'\nimport type { OffCycleReason } from '../OffCycleReasonSelection'\nimport { isDismissalPayroll } from '../helpers'\nimport { useFlow, type FlowContextInterface } from '@/components/Flow/useFlow'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport type { EventType } from '@/shared/constants'\nimport { ensureRequired } from '@/helpers/ensureRequired'\nimport { BaseComponent } from '@/components/Base/Base'\n\n/**\n * Flow context shared across the off-cycle payroll flow steps.\n *\n * @public\n */\nexport interface OffCycleFlowContextInterface extends FlowContextInterface {\n /** The associated company identifier. */\n companyId: string\n /** Identifier of the off-cycle payroll created during the flow; set once creation completes. */\n payrollUuid?: string\n /** Pre-selected off-cycle reason (bonus or correction). */\n payrollType?: OffCycleReason\n /** Whether to show reimbursement fields throughout the execution steps. Defaults to true. */\n withReimbursements?: boolean\n}\n\n/**\n * Props for {@link OffCycleFlow}.\n *\n * @public\n */\nexport interface OffCycleFlowProps {\n /** The associated company identifier. */\n companyId: string\n /** Optional pre-selected off-cycle reason. When provided, the creation form starts with this reason selected. */\n payrollType?: OffCycleReason\n /** Callback invoked when the flow emits an event. See the events table on {@link OffCycleFlow}. */\n onEvent: OnEventType<EventType, unknown>\n /** Optional flag to show/hide reimbursement fields throughout the flow. Defaults to true. */\n withReimbursements?: boolean\n}\n\n/** @internal */\nexport function OffCycleCreationContextual() {\n const { companyId, payrollType, onEvent } = useFlow<OffCycleFlowContextInterface>()\n return (\n <OffCycleCreation\n companyId={ensureRequired(companyId)}\n payrollType={payrollType}\n onEvent={onEvent}\n />\n )\n}\n\n/** @internal */\nexport function OffCycleExecutionContextual() {\n const { companyId, payrollUuid, onEvent, withReimbursements, header } =\n useFlow<OffCycleFlowContextInterface>()\n\n const resolvedCompanyId = ensureRequired(companyId)\n const resolvedPayrollId = ensureRequired(payrollUuid)\n\n const offCycleRootBreadcrumb =\n header?.type === 'breadcrumbs' ? header.breadcrumbs?.['createOffCyclePayroll']?.[0] : undefined\n const prefixBreadcrumbs = useMemo(\n () => (offCycleRootBreadcrumb ? [offCycleRootBreadcrumb] : undefined),\n [offCycleRootBreadcrumb],\n )\n\n return (\n <BaseComponent onEvent={onEvent}>\n <OffCycleExecutionWithData\n companyId={resolvedCompanyId}\n payrollId={resolvedPayrollId}\n onEvent={onEvent}\n withReimbursements={withReimbursements}\n prefixBreadcrumbs={prefixBreadcrumbs}\n />\n </BaseComponent>\n )\n}\n\ntype OffCycleExecutionWithDataProps = Pick<\n PayrollExecutionFlowProps,\n 'companyId' | 'payrollId' | 'onEvent' | 'prefixBreadcrumbs' | 'withReimbursements'\n>\n\nfunction OffCycleExecutionWithData({\n companyId,\n payrollId,\n ...rest\n}: OffCycleExecutionWithDataProps) {\n const { data } = usePayrollsGetSuspense({ companyId, payrollId })\n const initialPayPeriod = data.payrollShow?.payPeriod\n\n return (\n <PayrollExecutionFlow\n companyId={companyId}\n payrollId={payrollId}\n initialPayPeriod={initialPayPeriod}\n isDismissalPayroll={isDismissalPayroll(data.payrollShow?.offCycleReason)}\n {...rest}\n />\n )\n}\n"],"names":["OffCycleCreationContextual","companyId","payrollType","onEvent","useFlow","jsx","OffCycleCreation","ensureRequired","OffCycleExecutionContextual","payrollUuid","withReimbursements","header","resolvedCompanyId","resolvedPayrollId","offCycleRootBreadcrumb","prefixBreadcrumbs","useMemo","BaseComponent","OffCycleExecutionWithData","payrollId","rest","data","usePayrollsGetSuspense","initialPayPeriod","PayrollExecutionFlow","isDismissalPayroll"],"mappings":";;;;;;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lowComponents.js","sources":["../../../../src/components/Payroll/OffCycle/OffCycleFlowComponents.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { usePayrollsGetSuspense } from '@gusto/embedded-api/react-query/payrollsGet'\nimport { OffCycleCreation } from '../OffCycleCreation'\nimport {\n PayrollExecutionInternalFlow,\n type PayrollExecutionInternalFlowProps,\n} from '../PayrollExecutionFlow/PayrollExecutionFlow'\nimport type { OffCycleReason } from '../OffCycleReasonSelection'\nimport { isDismissalPayroll } from '../helpers'\nimport { useFlow, type FlowContextInterface } from '@/components/Flow/useFlow'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport type { EventType } from '@/shared/constants'\nimport { ensureRequired } from '@/helpers/ensureRequired'\nimport { BaseComponent } from '@/components/Base/Base'\n\n/**\n * Flow context shared across the off-cycle payroll flow steps.\n *\n * @internal\n */\nexport interface OffCycleFlowContextInterface extends FlowContextInterface {\n /** The associated company identifier. */\n companyId: string\n /** Identifier of the off-cycle payroll created during the flow; set once creation completes. */\n payrollUuid?: string\n /** Pre-selected off-cycle reason (bonus or correction). */\n payrollType?: OffCycleReason\n /** Whether to show reimbursement fields throughout the execution steps. Defaults to true. */\n withReimbursements?: boolean\n}\n\n/**\n * Props for {@link OffCycleFlow}.\n *\n * @public\n */\nexport interface OffCycleFlowProps {\n /** The associated company identifier. */\n companyId: string\n /** Optional pre-selected off-cycle reason. When provided, the creation form starts with this reason selected. */\n payrollType?: OffCycleReason\n /** Callback invoked when the flow emits an event. See the events table on {@link OffCycleFlow}. */\n onEvent: OnEventType<EventType, unknown>\n /** Optional flag to show/hide reimbursement fields throughout the flow. Defaults to true. */\n withReimbursements?: boolean\n}\n\n/** @internal */\nexport function OffCycleCreationContextual() {\n const { companyId, payrollType, onEvent } = useFlow<OffCycleFlowContextInterface>()\n return (\n <OffCycleCreation\n companyId={ensureRequired(companyId)}\n payrollType={payrollType}\n onEvent={onEvent}\n />\n )\n}\n\n/** @internal */\nexport function OffCycleExecutionContextual() {\n const { companyId, payrollUuid, onEvent, withReimbursements, header } =\n useFlow<OffCycleFlowContextInterface>()\n\n const resolvedCompanyId = ensureRequired(companyId)\n const resolvedPayrollId = ensureRequired(payrollUuid)\n\n const offCycleRootBreadcrumb =\n header?.type === 'breadcrumbs' ? header.breadcrumbs?.['createOffCyclePayroll']?.[0] : undefined\n const prefixBreadcrumbs = useMemo(\n () => (offCycleRootBreadcrumb ? [offCycleRootBreadcrumb] : undefined),\n [offCycleRootBreadcrumb],\n )\n\n return (\n <BaseComponent onEvent={onEvent}>\n <OffCycleExecutionWithData\n companyId={resolvedCompanyId}\n payrollId={resolvedPayrollId}\n onEvent={onEvent}\n withReimbursements={withReimbursements}\n prefixBreadcrumbs={prefixBreadcrumbs}\n />\n </BaseComponent>\n )\n}\n\ntype OffCycleExecutionWithDataProps = Pick<\n PayrollExecutionInternalFlowProps,\n 'companyId' | 'payrollId' | 'onEvent' | 'prefixBreadcrumbs' | 'withReimbursements'\n>\n\nfunction OffCycleExecutionWithData({\n companyId,\n payrollId,\n ...rest\n}: OffCycleExecutionWithDataProps) {\n const { data } = usePayrollsGetSuspense({ companyId, payrollId })\n const initialPayPeriod = data.payrollShow?.payPeriod\n\n return (\n <PayrollExecutionInternalFlow\n companyId={companyId}\n payrollId={payrollId}\n initialPayPeriod={initialPayPeriod}\n isDismissalPayroll={isDismissalPayroll(data.payrollShow?.offCycleReason)}\n {...rest}\n />\n )\n}\n"],"names":["OffCycleCreationContextual","companyId","payrollType","onEvent","useFlow","jsx","OffCycleCreation","ensureRequired","OffCycleExecutionContextual","payrollUuid","withReimbursements","header","resolvedCompanyId","resolvedPayrollId","offCycleRootBreadcrumb","prefixBreadcrumbs","useMemo","BaseComponent","OffCycleExecutionWithData","payrollId","rest","data","usePayrollsGetSuspense","initialPayPeriod","PayrollExecutionInternalFlow","isDismissalPayroll"],"mappings":";;;;;;;;;AAgDO,SAASA,IAA6B;AAC3C,QAAM,EAAE,WAAAC,GAAW,aAAAC,GAAa,SAAAC,EAAA,IAAYC,EAAA;AAC5C,SACE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAeN,CAAS;AAAA,MACnC,aAAAC;AAAA,MACA,SAAAC;AAAA,IAAA;AAAA,EAAA;AAGN;AAGO,SAASK,IAA8B;AAC5C,QAAM,EAAE,WAAAP,GAAW,aAAAQ,GAAa,SAAAN,GAAS,oBAAAO,GAAoB,QAAAC,EAAA,IAC3DP,EAAA,GAEIQ,IAAoBL,EAAeN,CAAS,GAC5CY,IAAoBN,EAAeE,CAAW,GAE9CK,IACJH,GAAQ,SAAS,gBAAgBA,EAAO,aAAc,wBAA2B,CAAC,IAAI,QAClFI,IAAoBC;AAAA,IACxB,MAAOF,IAAyB,CAACA,CAAsB,IAAI;AAAA,IAC3D,CAACA,CAAsB;AAAA,EAAA;AAGzB,SACE,gBAAAT,EAACY,KAAc,SAAAd,GACb,UAAA,gBAAAE;AAAA,IAACa;AAAA,IAAA;AAAA,MACC,WAAWN;AAAA,MACX,WAAWC;AAAA,MACX,SAAAV;AAAA,MACA,oBAAAO;AAAA,MACA,mBAAAK;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;AAOA,SAASG,EAA0B;AAAA,EACjC,WAAAjB;AAAA,EACA,WAAAkB;AAAA,EACA,GAAGC;AACL,GAAmC;AACjC,QAAM,EAAE,MAAAC,EAAA,IAASC,EAAuB,EAAE,WAAArB,GAAW,WAAAkB,GAAW,GAC1DI,IAAmBF,EAAK,aAAa;AAE3C,SACE,gBAAAhB;AAAA,IAACmB;AAAA,IAAA;AAAA,MACC,WAAAvB;AAAA,MACA,WAAAkB;AAAA,MACA,kBAAAI;AAAA,MACA,oBAAoBE,EAAmBJ,EAAK,aAAa,cAAc;AAAA,MACtE,GAAGD;AAAA,IAAA;AAAA,EAAA;AAGV;"}
@@ -1,2 +1,2 @@
1
1
  export { OffCycleFlow } from './OffCycleFlow';
2
- export type { OffCycleFlowContextInterface, OffCycleFlowProps } from './OffCycleFlowComponents';
2
+ export type { OffCycleFlowProps } from './OffCycleFlowComponents';
@@ -13,7 +13,7 @@ export declare const WITHHOLDING_PAY_PERIOD_I18N_KEY: {
13
13
  /** @internal */
14
14
  export declare const WAGE_TYPE_CATEGORIES: readonly ["regular", "supplemental", "reimbursement"];
15
15
  /** @internal */
16
- export type WageTypeCategory = (typeof WAGE_TYPE_CATEGORIES)[number];
16
+ export type WageTypeCategory = "regular" | "reimbursement" | "supplemental";
17
17
  /** @internal */
18
18
  export interface WageTypeGroup {
19
19
  /** Wage type grouping this row represents. */