@gusto/embedded-react-sdk 0.37.0-rc.5 → 0.38.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (549) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/dist/UNSTABLE_Hooks.js +2 -2
  3. package/dist/assets/icons/filter-funnel.svg.js +10 -0
  4. package/dist/assets/icons/filter-funnel.svg.js.map +1 -0
  5. package/dist/components/Base/Base.js +3 -2
  6. package/dist/components/Base/Base.js.map +1 -1
  7. package/dist/components/Common/DateRangeFilter/DateRangeFilter.d.ts +17 -0
  8. package/dist/components/Common/DateRangeFilter/DateRangeFilter.js +100 -0
  9. package/dist/components/Common/DateRangeFilter/DateRangeFilter.js.map +1 -0
  10. package/dist/components/Common/DateRangeFilter/DateRangeFilter.module.scss.js +10 -0
  11. package/dist/components/Common/DateRangeFilter/DateRangeFilter.module.scss.js.map +1 -0
  12. package/dist/components/Common/DetailViewLayout/DetailViewLayout.d.ts +2 -0
  13. package/dist/components/Common/DetailViewLayout/DetailViewLayoutTypes.d.ts +40 -0
  14. package/dist/components/Common/DetailViewLayout/index.d.ts +3 -0
  15. package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.js +21 -20
  16. package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.js.map +1 -1
  17. package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbsTypes.d.ts +5 -0
  18. package/dist/components/Common/FlowBreadcrumbs/breadcrumbTransitionHelpers.d.ts +1 -1
  19. package/dist/components/Common/FlowBreadcrumbs/breadcrumbTransitionHelpers.js +10 -8
  20. package/dist/components/Common/FlowBreadcrumbs/breadcrumbTransitionHelpers.js.map +1 -1
  21. package/dist/components/Common/SignatureForm/SignatureForm.js +6 -4
  22. package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
  23. package/dist/components/Common/SignatureForm/SignatureFormActions.js +6 -5
  24. package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
  25. package/dist/components/Common/SignatureForm/SignatureFormFields.js +7 -6
  26. package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
  27. package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js +18 -18
  28. package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js.map +1 -1
  29. package/dist/components/Common/UI/Breadcrumbs/BreadcrumbsTypes.d.ts +5 -0
  30. package/dist/components/Common/UI/Breadcrumbs/BreadcrumbsTypes.js.map +1 -1
  31. package/dist/components/Common/UI/DateRangePicker/DateRangePicker.d.ts +2 -0
  32. package/dist/components/Common/UI/DateRangePicker/DateRangePicker.js +74 -0
  33. package/dist/components/Common/UI/DateRangePicker/DateRangePicker.js.map +1 -0
  34. package/dist/components/Common/UI/DateRangePicker/DateRangePicker.module.scss.js +30 -0
  35. package/dist/components/Common/UI/DateRangePicker/DateRangePicker.module.scss.js.map +1 -0
  36. package/dist/components/Common/UI/DateRangePicker/DateRangePickerTypes.d.ts +14 -0
  37. package/dist/components/Common/UI/DateRangePicker/index.d.ts +2 -0
  38. package/dist/components/Common/UI/FileInput/FileInput.js +1 -1
  39. package/dist/components/Common/UI/Heading/Heading.d.ts +1 -1
  40. package/dist/components/Common/UI/Heading/Heading.js +11 -9
  41. package/dist/components/Common/UI/Heading/Heading.js.map +1 -1
  42. package/dist/components/Common/UI/Heading/HeadingTypes.d.ts +1 -1
  43. package/dist/components/Common/UI/ProgressBar/ProgressBar.js +4 -4
  44. package/dist/components/Common/index.d.ts +2 -0
  45. package/dist/components/Company/AssignSignatory/AssignSignatory.js +3 -2
  46. package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
  47. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +3 -2
  48. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
  49. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +3 -2
  50. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
  51. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +11 -11
  52. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +5 -3
  53. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  54. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +3 -2
  55. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
  56. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +1 -1
  57. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +5 -3
  58. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  59. package/dist/components/Company/AssignSignatory/TitleSelect.js +3 -2
  60. package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
  61. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +7 -5
  62. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  63. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +3 -2
  64. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
  65. package/dist/components/Company/BankAccount/BankAccountForm/Form.js +11 -9
  66. package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
  67. package/dist/components/Company/BankAccount/BankAccountForm/context.js +5 -3
  68. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  69. package/dist/components/Company/BankAccount/BankAccountList/Actions.js +9 -8
  70. package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
  71. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +8 -7
  72. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
  73. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +6 -4
  74. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
  75. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +3 -2
  76. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
  77. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +9 -8
  78. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  79. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +5 -3
  80. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  81. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +3 -2
  82. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  83. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +5 -3
  84. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  85. package/dist/components/Company/FederalTaxes/Actions.js +6 -5
  86. package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
  87. package/dist/components/Company/FederalTaxes/FederalTaxes.js +7 -6
  88. package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
  89. package/dist/components/Company/FederalTaxes/Form.js +5 -3
  90. package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
  91. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +10 -8
  92. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  93. package/dist/components/Company/Industry/Actions.js +3 -2
  94. package/dist/components/Company/Industry/Actions.js.map +1 -1
  95. package/dist/components/Company/Industry/Context.js +8 -6
  96. package/dist/components/Company/Industry/Context.js.map +1 -1
  97. package/dist/components/Company/Industry/Edit.js +5 -4
  98. package/dist/components/Company/Industry/Edit.js.map +1 -1
  99. package/dist/components/Company/Locations/LocationForm/Actions.js +7 -6
  100. package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
  101. package/dist/components/Company/Locations/LocationForm/Form.js +1 -1
  102. package/dist/components/Company/Locations/LocationForm/LocationForm.js +4 -3
  103. package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
  104. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +5 -3
  105. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  106. package/dist/components/Company/Locations/LocationsList/Actions.js +7 -6
  107. package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
  108. package/dist/components/Company/Locations/LocationsList/List.js +7 -6
  109. package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
  110. package/dist/components/Company/Locations/LocationsList/LocationsList.js +3 -2
  111. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  112. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +5 -3
  113. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  114. package/dist/components/Company/OnboardingOverview/Completed.js +14 -12
  115. package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
  116. package/dist/components/Company/OnboardingOverview/MissingRequirements.js +7 -5
  117. package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
  118. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +3 -2
  119. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
  120. package/dist/components/Company/OnboardingOverview/context.js +5 -3
  121. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  122. package/dist/components/Company/PaySchedule/PaySchedule.js +23 -21
  123. package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
  124. package/dist/components/Company/PaySchedule/_parts/Actions.js +17 -16
  125. package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
  126. package/dist/components/Company/PaySchedule/_parts/Edit.js +15 -15
  127. package/dist/components/Company/PaySchedule/_parts/Head.js +10 -8
  128. package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
  129. package/dist/components/Company/PaySchedule/_parts/List.js +15 -13
  130. package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
  131. package/dist/components/Company/PaySchedule/usePaySchedule.d.ts +1 -0
  132. package/dist/components/Company/PaySchedule/usePaySchedule.js +7 -5
  133. package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
  134. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +3 -2
  135. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
  136. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +5 -3
  137. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  138. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +3 -2
  139. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
  140. package/dist/components/Company/StateTaxes/StateTaxesList/List.js +3 -2
  141. package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
  142. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +5 -3
  143. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  144. package/dist/components/Contractor/Address/Address.js +4 -3
  145. package/dist/components/Contractor/Address/Address.js.map +1 -1
  146. package/dist/components/Contractor/Address/useAddress.js +7 -5
  147. package/dist/components/Contractor/Address/useAddress.js.map +1 -1
  148. package/dist/components/Contractor/ContractorList/index.js +51 -50
  149. package/dist/components/Contractor/ContractorList/index.js.map +1 -1
  150. package/dist/components/Contractor/NewHireReport/NewHireReport.js +3 -2
  151. package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
  152. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +6 -5
  153. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
  154. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +3 -2
  155. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
  156. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +3 -2
  157. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
  158. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +4 -2
  159. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
  160. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +10 -10
  161. package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js +7 -5
  162. package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js.map +1 -1
  163. package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +4 -3
  164. package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js.map +1 -1
  165. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js +4 -2
  166. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map +1 -1
  167. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js +8 -6
  168. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js.map +1 -1
  169. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js +4 -2
  170. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js.map +1 -1
  171. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +4 -2
  172. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
  173. package/dist/components/Contractor/Profile/ContractorProfileForm.js +15 -15
  174. package/dist/components/Contractor/Profile/useContractorProfile.js +53 -49
  175. package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
  176. package/dist/components/Contractor/Submit/Submit.d.ts +2 -2
  177. package/dist/components/Contractor/Submit/Submit.js +46 -45
  178. package/dist/components/Contractor/Submit/Submit.js.map +1 -1
  179. package/dist/components/Employee/Compensation/Actions.js +5 -4
  180. package/dist/components/Employee/Compensation/Actions.js.map +1 -1
  181. package/dist/components/Employee/Compensation/Edit.js +28 -27
  182. package/dist/components/Employee/Compensation/Edit.js.map +1 -1
  183. package/dist/components/Employee/Compensation/List.js +23 -22
  184. package/dist/components/Employee/Compensation/List.js.map +1 -1
  185. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +12 -10
  186. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
  187. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +19 -17
  188. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
  189. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +13 -11
  190. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -1
  191. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +8 -7
  192. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js.map +1 -1
  193. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +7 -6
  194. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
  195. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +6 -5
  196. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  197. package/dist/components/Employee/DocumentSigner/DocumentList/List.js +4 -2
  198. package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
  199. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +5 -3
  200. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  201. package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js +26 -24
  202. package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js.map +1 -1
  203. package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.js +10 -9
  204. package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.js.map +1 -1
  205. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +8 -7
  206. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  207. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +5 -3
  208. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  209. package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.js +4 -2
  210. package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.js.map +1 -1
  211. package/dist/components/Employee/EmployeeList/EmployeeList.d.ts +2 -5
  212. package/dist/components/Employee/EmployeeList/EmployeeList.js +45 -91
  213. package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
  214. package/dist/components/Employee/EmployeeList/EmployeeListView.d.ts +15 -0
  215. package/dist/components/Employee/EmployeeList/EmployeeListView.js +132 -0
  216. package/dist/components/Employee/EmployeeList/EmployeeListView.js.map +1 -0
  217. package/dist/components/Employee/EmployeeList/ManagementEmployeeList.d.ts +9 -0
  218. package/dist/components/Employee/EmployeeList/ManagementEmployeeList.js +81 -0
  219. package/dist/components/Employee/EmployeeList/ManagementEmployeeList.js.map +1 -0
  220. package/dist/components/Employee/EmployeeList/ManagementEmployeeListView.d.ts +17 -0
  221. package/dist/components/Employee/EmployeeList/ManagementEmployeeListView.js +195 -0
  222. package/dist/components/Employee/EmployeeList/ManagementEmployeeListView.js.map +1 -0
  223. package/dist/components/Employee/EmployeeList/index.d.ts +3 -0
  224. package/dist/components/Employee/EmployeeList/useEmployeeList.d.ts +36 -23
  225. package/dist/components/Employee/EmployeeList/useEmployeeList.js +114 -17
  226. package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
  227. package/dist/components/Employee/FederalTaxes/Actions.js +7 -6
  228. package/dist/components/Employee/FederalTaxes/Actions.js.map +1 -1
  229. package/dist/components/Employee/FederalTaxes/FederalForm.js +11 -10
  230. package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
  231. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +5 -3
  232. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
  233. package/dist/components/Employee/Landing/Landing.js +15 -14
  234. package/dist/components/Employee/Landing/Landing.js.map +1 -1
  235. package/dist/components/Employee/OnboardingFlow/OnboardingFlow.js +4 -4
  236. package/dist/components/Employee/OnboardingFlow/OnboardingFlow.js.map +1 -1
  237. package/dist/components/Employee/OnboardingFlow/OnboardingFlowComponents.d.ts +1 -0
  238. package/dist/components/Employee/OnboardingFlow/OnboardingFlowComponents.js +14 -8
  239. package/dist/components/Employee/OnboardingFlow/OnboardingFlowComponents.js.map +1 -1
  240. package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.js +10 -11
  241. package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.js.map +1 -1
  242. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +7 -7
  243. package/dist/components/Employee/PaymentMethod/Actions.js +6 -5
  244. package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
  245. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +6 -5
  246. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
  247. package/dist/components/Employee/PaymentMethod/BankAccountsList.js +9 -8
  248. package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
  249. package/dist/components/Employee/PaymentMethod/PaymentMethod.js +44 -43
  250. package/dist/components/Employee/PaymentMethod/PaymentMethod.js.map +1 -1
  251. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +7 -6
  252. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
  253. package/dist/components/Employee/PaymentMethod/Split.js +11 -10
  254. package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
  255. package/dist/components/Employee/PaymentMethod/usePaymentMethod.d.ts +1 -0
  256. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +7 -5
  257. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
  258. package/dist/components/Employee/Profile/Actions.js +7 -6
  259. package/dist/components/Employee/Profile/Actions.js.map +1 -1
  260. package/dist/components/Employee/Profile/AdminPersonalDetails.js +5 -4
  261. package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
  262. package/dist/components/Employee/Profile/HomeAddress.js +1 -1
  263. package/dist/components/Employee/Profile/PersonalDetailsInputs.js +2 -2
  264. package/dist/components/Employee/Profile/useProfile.js +5 -3
  265. package/dist/components/Employee/Profile/useProfile.js.map +1 -1
  266. package/dist/components/Employee/StateTaxes/Actions.js +8 -7
  267. package/dist/components/Employee/StateTaxes/Actions.js.map +1 -1
  268. package/dist/components/Employee/StateTaxes/useStateTaxes.js +5 -3
  269. package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
  270. package/dist/components/Employee/Taxes/Actions.js +9 -8
  271. package/dist/components/Employee/Taxes/Actions.js.map +1 -1
  272. package/dist/components/Employee/Taxes/FederalForm.js +11 -10
  273. package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
  274. package/dist/components/Employee/Taxes/useTaxes.js +5 -3
  275. package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
  276. package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js +16 -14
  277. package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js.map +1 -1
  278. package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.js +13 -12
  279. package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.js.map +1 -1
  280. package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.js +4 -2
  281. package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.js.map +1 -1
  282. package/dist/components/Employee/index.d.ts +1 -0
  283. package/dist/components/Employee/index.js +38 -36
  284. package/dist/components/Employee/index.js.map +1 -1
  285. package/dist/components/Flow/Flow.js +18 -16
  286. package/dist/components/Flow/Flow.js.map +1 -1
  287. package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js +17 -16
  288. package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -1
  289. package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js +12 -11
  290. package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js.map +1 -1
  291. package/dist/components/InformationRequests/InformationRequests.js +4 -3
  292. package/dist/components/InformationRequests/InformationRequests.js.map +1 -1
  293. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +9 -8
  294. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js.map +1 -1
  295. package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.js +10 -8
  296. package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.js.map +1 -1
  297. package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +14 -12
  298. package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
  299. package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js +30 -25
  300. package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js.map +1 -1
  301. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js +32 -30
  302. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js.map +1 -1
  303. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js +2 -1
  304. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js.map +1 -1
  305. package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js +7 -6
  306. package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js.map +1 -1
  307. package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js +13 -12
  308. package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js.map +1 -1
  309. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +13 -11
  310. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
  311. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +12 -12
  312. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +192 -186
  313. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
  314. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.d.ts +2 -1
  315. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js +102 -76
  316. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js.map +1 -1
  317. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +158 -159
  318. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
  319. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.module.scss.js +7 -7
  320. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.d.ts +11 -0
  321. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +55 -18
  322. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
  323. package/dist/components/Payroll/PayrollExecutionFlow/PayrollExecutionFlow.js +40 -40
  324. package/dist/components/Payroll/PayrollExecutionFlow/PayrollExecutionFlow.js.map +1 -1
  325. package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.js +65 -54
  326. package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.js.map +1 -1
  327. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.d.ts +1 -0
  328. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js.map +1 -1
  329. package/dist/components/Payroll/PayrollFlow/TransitionFlowContextual.js +35 -14
  330. package/dist/components/Payroll/PayrollFlow/TransitionFlowContextual.js.map +1 -1
  331. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js +80 -69
  332. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js.map +1 -1
  333. package/dist/components/Payroll/PayrollHistory/PayrollHistory.d.ts +0 -1
  334. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js +59 -66
  335. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js.map +1 -1
  336. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.d.ts +5 -4
  337. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +95 -100
  338. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
  339. package/dist/components/Payroll/PayrollList/PayrollList.js +98 -68
  340. package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
  341. package/dist/components/Payroll/PayrollList/PayrollListPresentation.d.ts +9 -1
  342. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +213 -132
  343. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
  344. package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js +8 -6
  345. package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js.map +1 -1
  346. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +49 -47
  347. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
  348. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +187 -178
  349. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
  350. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js +4 -2
  351. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js.map +1 -1
  352. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +3 -2
  353. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
  354. package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js +3 -2
  355. package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js.map +1 -1
  356. package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js +7 -6
  357. package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js.map +1 -1
  358. package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js +4 -2
  359. package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js.map +1 -1
  360. package/dist/components/Payroll/Transition/TransitionFlow.d.ts +1 -1
  361. package/dist/components/Payroll/Transition/TransitionFlow.js +29 -27
  362. package/dist/components/Payroll/Transition/TransitionFlow.js.map +1 -1
  363. package/dist/components/Payroll/Transition/TransitionFlowComponents.d.ts +1 -0
  364. package/dist/components/Payroll/Transition/TransitionFlowComponents.js.map +1 -1
  365. package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.js +14 -12
  366. package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.js.map +1 -1
  367. package/dist/components/Payroll/usePreparedPayrollData.js +4 -2
  368. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  369. package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataContext.d.ts +1 -1
  370. package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataContext.js.map +1 -1
  371. package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataProvider.d.ts +1 -1
  372. package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataProvider.js.map +1 -1
  373. package/dist/components/UNSTABLE_Hooks/form/SDKFormProvider.d.ts +1 -2
  374. package/dist/components/UNSTABLE_Hooks/form/SDKFormProvider.js.map +1 -1
  375. package/dist/components/UNSTABLE_Hooks/form/deriveFieldsMetadata.d.ts +1 -1
  376. package/dist/components/UNSTABLE_Hooks/form/deriveFieldsMetadata.js.map +1 -1
  377. package/dist/components/UNSTABLE_Hooks/form/fields/CheckboxHookField.d.ts +1 -2
  378. package/dist/components/UNSTABLE_Hooks/form/fields/CheckboxHookField.js +10 -9
  379. package/dist/components/UNSTABLE_Hooks/form/fields/CheckboxHookField.js.map +1 -1
  380. package/dist/components/UNSTABLE_Hooks/form/fields/DatePickerHookField.d.ts +1 -2
  381. package/dist/components/UNSTABLE_Hooks/form/fields/DatePickerHookField.js.map +1 -1
  382. package/dist/components/UNSTABLE_Hooks/form/fields/NumberInputHookField.d.ts +1 -2
  383. package/dist/components/UNSTABLE_Hooks/form/fields/NumberInputHookField.js +11 -10
  384. package/dist/components/UNSTABLE_Hooks/form/fields/NumberInputHookField.js.map +1 -1
  385. package/dist/components/UNSTABLE_Hooks/form/fields/RadioGroupHookField.d.ts +1 -2
  386. package/dist/components/UNSTABLE_Hooks/form/fields/RadioGroupHookField.js +10 -9
  387. package/dist/components/UNSTABLE_Hooks/form/fields/RadioGroupHookField.js.map +1 -1
  388. package/dist/components/UNSTABLE_Hooks/form/fields/SelectHookField.d.ts +1 -2
  389. package/dist/components/UNSTABLE_Hooks/form/fields/SelectHookField.js +13 -12
  390. package/dist/components/UNSTABLE_Hooks/form/fields/SelectHookField.js.map +1 -1
  391. package/dist/components/UNSTABLE_Hooks/form/fields/SwitchHookField.d.ts +1 -2
  392. package/dist/components/UNSTABLE_Hooks/form/fields/SwitchHookField.js +14 -13
  393. package/dist/components/UNSTABLE_Hooks/form/fields/SwitchHookField.js.map +1 -1
  394. package/dist/components/UNSTABLE_Hooks/form/fields/TextInputHookField.d.ts +1 -2
  395. package/dist/components/UNSTABLE_Hooks/form/fields/TextInputHookField.js +15 -14
  396. package/dist/components/UNSTABLE_Hooks/form/fields/TextInputHookField.js.map +1 -1
  397. package/dist/components/UNSTABLE_Hooks/form/getFieldWithOptions.d.ts +1 -1
  398. package/dist/components/UNSTABLE_Hooks/form/getFieldWithOptions.js.map +1 -1
  399. package/dist/components/UNSTABLE_Hooks/form/index.d.ts +1 -1
  400. package/dist/components/UNSTABLE_Hooks/form/resolveFieldError.d.ts +1 -1
  401. package/dist/components/UNSTABLE_Hooks/form/resolveFieldError.js.map +1 -1
  402. package/dist/components/UNSTABLE_Hooks/form/useFieldErrorMessage.d.ts +1 -1
  403. package/dist/components/UNSTABLE_Hooks/form/useFieldErrorMessage.js.map +1 -1
  404. package/dist/components/UNSTABLE_Hooks/form/useFieldsMetadata.d.ts +1 -1
  405. package/dist/components/UNSTABLE_Hooks/form/useFieldsMetadata.js.map +1 -1
  406. package/dist/components/UNSTABLE_Hooks/form/useHookFieldResolution.d.ts +1 -2
  407. package/dist/components/UNSTABLE_Hooks/form/useHookFieldResolution.js.map +1 -1
  408. package/dist/components/UNSTABLE_Hooks/form/withOptions.d.ts +1 -1
  409. package/dist/components/UNSTABLE_Hooks/form/withOptions.js.map +1 -1
  410. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/CompensationForm.js +3 -2
  411. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/CompensationForm.js.map +1 -1
  412. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/fields.d.ts +1 -1
  413. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/fields.js.map +1 -1
  414. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.d.ts +10 -10
  415. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.js +19 -19
  416. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.js.map +1 -1
  417. package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/EmployeeDetailsForm.js +3 -2
  418. package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/EmployeeDetailsForm.js.map +1 -1
  419. package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/fields.d.ts +1 -1
  420. package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/fields.js.map +1 -1
  421. package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/useEmployeeDetailsForm.d.ts +9 -9
  422. package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/useEmployeeDetailsForm.js +15 -15
  423. package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/useEmployeeDetailsForm.js.map +1 -1
  424. package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/WorkAddressForm.js +7 -6
  425. package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/WorkAddressForm.js.map +1 -1
  426. package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/fields.d.ts +1 -1
  427. package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/fields.js.map +1 -1
  428. package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/useWorkAddressForm.d.ts +5 -5
  429. package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/useWorkAddressForm.js +13 -13
  430. package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/useWorkAddressForm.js.map +1 -1
  431. package/dist/components/UNSTABLE_Hooks/index.d.ts +3 -3
  432. package/dist/components/UNSTABLE_TimeOff/AddEmployeesHoliday/AddEmployeesHoliday.d.ts +5 -0
  433. package/dist/components/UNSTABLE_TimeOff/AddEmployeesHoliday/AddEmployeesHoliday.js +46 -0
  434. package/dist/components/UNSTABLE_TimeOff/AddEmployeesHoliday/AddEmployeesHoliday.js.map +1 -0
  435. package/dist/components/UNSTABLE_TimeOff/AddEmployeesToPolicy/AddEmployeesToPolicy.d.ts +5 -0
  436. package/dist/components/UNSTABLE_TimeOff/AddEmployeesToPolicy/AddEmployeesToPolicy.js +46 -0
  437. package/dist/components/UNSTABLE_TimeOff/AddEmployeesToPolicy/AddEmployeesToPolicy.js.map +1 -0
  438. package/dist/components/UNSTABLE_TimeOff/HolidaySelectionForm/HolidaySelectionForm.d.ts +5 -0
  439. package/dist/components/UNSTABLE_TimeOff/HolidaySelectionForm/HolidaySelectionForm.js +46 -0
  440. package/dist/components/UNSTABLE_TimeOff/HolidaySelectionForm/HolidaySelectionForm.js.map +1 -0
  441. package/dist/components/UNSTABLE_TimeOff/PolicyDetailsForm/PolicyDetailsForm.d.ts +6 -0
  442. package/dist/components/UNSTABLE_TimeOff/PolicyDetailsForm/PolicyDetailsForm.js +50 -0
  443. package/dist/components/UNSTABLE_TimeOff/PolicyDetailsForm/PolicyDetailsForm.js.map +1 -0
  444. package/dist/components/UNSTABLE_TimeOff/PolicyList/PolicyList.d.ts +5 -0
  445. package/dist/components/UNSTABLE_TimeOff/PolicyList/PolicyList.js +50 -0
  446. package/dist/components/UNSTABLE_TimeOff/PolicyList/PolicyList.js.map +1 -0
  447. package/dist/components/UNSTABLE_TimeOff/PolicySettings/PolicySettings.d.ts +5 -0
  448. package/dist/components/UNSTABLE_TimeOff/PolicySettings/PolicySettings.js +46 -0
  449. package/dist/components/UNSTABLE_TimeOff/PolicySettings/PolicySettings.js.map +1 -0
  450. package/dist/components/UNSTABLE_TimeOff/PolicyTypeSelector/PolicyTypeSelector.d.ts +5 -0
  451. package/dist/components/UNSTABLE_TimeOff/PolicyTypeSelector/PolicyTypeSelector.js +59 -0
  452. package/dist/components/UNSTABLE_TimeOff/PolicyTypeSelector/PolicyTypeSelector.js.map +1 -0
  453. package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/TimeOffFlow.d.ts +2 -0
  454. package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/TimeOffFlow.js +25 -0
  455. package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/TimeOffFlow.js.map +1 -0
  456. package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/TimeOffFlowComponents.d.ts +29 -0
  457. package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/TimeOffFlowComponents.js +98 -0
  458. package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/TimeOffFlowComponents.js.map +1 -0
  459. package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/index.d.ts +3 -0
  460. package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/timeOffStateMachine.d.ts +14 -0
  461. package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/timeOffStateMachine.js +290 -0
  462. package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/timeOffStateMachine.js.map +1 -0
  463. package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/shared/EmployeeTable/EmployeeTable.d.ts +2 -0
  464. package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/shared/EmployeeTable/EmployeeTableTypes.d.ts +26 -0
  465. package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/shared/EmployeeTable/index.d.ts +4 -0
  466. package/dist/components/UNSTABLE_TimeOff/ViewHolidayEmployees/ViewHolidayEmployees.d.ts +5 -0
  467. package/dist/components/UNSTABLE_TimeOff/ViewHolidayEmployees/ViewHolidayEmployees.js +35 -0
  468. package/dist/components/UNSTABLE_TimeOff/ViewHolidayEmployees/ViewHolidayEmployees.js.map +1 -0
  469. package/dist/components/UNSTABLE_TimeOff/ViewHolidaySchedule/ViewHolidaySchedule.d.ts +5 -0
  470. package/dist/components/UNSTABLE_TimeOff/ViewHolidaySchedule/ViewHolidaySchedule.js +35 -0
  471. package/dist/components/UNSTABLE_TimeOff/ViewHolidaySchedule/ViewHolidaySchedule.js.map +1 -0
  472. package/dist/components/UNSTABLE_TimeOff/ViewPolicyDetails/ViewPolicyDetails.d.ts +5 -0
  473. package/dist/components/UNSTABLE_TimeOff/ViewPolicyDetails/ViewPolicyDetails.js +35 -0
  474. package/dist/components/UNSTABLE_TimeOff/ViewPolicyDetails/ViewPolicyDetails.js.map +1 -0
  475. package/dist/components/UNSTABLE_TimeOff/ViewPolicyEmployees/ViewPolicyEmployees.d.ts +5 -0
  476. package/dist/components/UNSTABLE_TimeOff/ViewPolicyEmployees/ViewPolicyEmployees.js +35 -0
  477. package/dist/components/UNSTABLE_TimeOff/ViewPolicyEmployees/ViewPolicyEmployees.js.map +1 -0
  478. package/dist/components/UNSTABLE_TimeOff/index.d.ts +25 -0
  479. package/dist/components/UNSTABLE_TimeOff/index.js +27 -0
  480. package/dist/components/UNSTABLE_TimeOff/index.js.map +1 -0
  481. package/dist/components/index.d.ts +1 -0
  482. package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js +48 -46
  483. package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js.map +1 -1
  484. package/dist/contexts/ComponentAdapter/useComponentContext.d.ts +2 -0
  485. package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
  486. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +11 -10
  487. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  488. package/dist/helpers/breadcrumbHelpers.d.ts +14 -0
  489. package/dist/helpers/breadcrumbHelpers.js +35 -26
  490. package/dist/helpers/breadcrumbHelpers.js.map +1 -1
  491. package/dist/{components/UNSTABLE_Hooks → helpers}/collectErrors.d.ts +1 -1
  492. package/dist/{components/UNSTABLE_Hooks → helpers}/collectErrors.js +1 -1
  493. package/dist/helpers/collectErrors.js.map +1 -0
  494. package/dist/hooks/useDateRangeFilter/useDateRangeFilter.d.ts +20 -0
  495. package/dist/hooks/useDateRangeFilter/useDateRangeFilter.js +38 -0
  496. package/dist/hooks/useDateRangeFilter/useDateRangeFilter.js.map +1 -0
  497. package/dist/hooks/useDateRangeFilter/useDateRangeFilter.test.d.ts +1 -0
  498. package/dist/{components/UNSTABLE_Hooks → hooks}/useErrorHandling.d.ts +2 -2
  499. package/dist/{components/UNSTABLE_Hooks → hooks}/useErrorHandling.js +1 -1
  500. package/dist/hooks/useErrorHandling.js.map +1 -0
  501. package/dist/hooks/useErrorHandling.test.d.ts +1 -0
  502. package/dist/hooks/usePagination/usePagination.d.ts +2 -0
  503. package/dist/hooks/usePagination/usePagination.js +32 -29
  504. package/dist/hooks/usePagination/usePagination.js.map +1 -1
  505. package/dist/i18n/I18n.js +15 -15
  506. package/dist/i18n/I18n.js.map +1 -1
  507. package/dist/i18n/en/Company.TimeOff.CreateTimeOffPolicy.json.js +10 -12
  508. package/dist/i18n/en/Company.TimeOff.CreateTimeOffPolicy.json.js.map +1 -1
  509. package/dist/i18n/en/Company.TimeOff.EmployeeTable.json.js +32 -0
  510. package/dist/i18n/en/Company.TimeOff.EmployeeTable.json.js.map +1 -0
  511. package/dist/i18n/en/Company.TimeOff.HolidayPolicy.json.js +11 -13
  512. package/dist/i18n/en/Company.TimeOff.HolidayPolicy.json.js.map +1 -1
  513. package/dist/i18n/en/Company.TimeOff.TimeOffPolicyDetails.json.js +10 -10
  514. package/dist/i18n/en/Employee.EmployeeList.json.js +22 -20
  515. package/dist/i18n/en/Employee.EmployeeList.json.js.map +1 -1
  516. package/dist/i18n/en/Employee.ManagementEmployeeList.json.js +40 -0
  517. package/dist/i18n/en/Employee.ManagementEmployeeList.json.js.map +1 -0
  518. package/dist/i18n/en/Payroll.PayrollHistory.json.js +12 -12
  519. package/dist/i18n/en/Payroll.PayrollList.json.js +28 -20
  520. package/dist/i18n/en/Payroll.PayrollList.json.js.map +1 -1
  521. package/dist/i18n/en/Payroll.PayrollOverview.json.js +30 -28
  522. package/dist/i18n/en/Payroll.PayrollOverview.json.js.map +1 -1
  523. package/dist/index.js +18 -16
  524. package/dist/index.js.map +1 -1
  525. package/dist/shared/constants.d.ts +46 -0
  526. package/dist/shared/constants.js +99 -74
  527. package/dist/shared/constants.js.map +1 -1
  528. package/dist/style.css +1 -1
  529. package/dist/types/i18next.d.ts +85 -32
  530. package/dist/{components/UNSTABLE_Hooks/types.d.ts → types/sdkHooks.d.ts} +28 -2
  531. package/docs/reference/endpoint-inventory.json +554 -385
  532. package/package.json +25 -16
  533. package/dist/components/Employee/EmployeeList/Actions.d.ts +0 -1
  534. package/dist/components/Employee/EmployeeList/Actions.js +0 -14
  535. package/dist/components/Employee/EmployeeList/Actions.js.map +0 -1
  536. package/dist/components/Employee/EmployeeList/Head.d.ts +0 -1
  537. package/dist/components/Employee/EmployeeList/Head.js +0 -12
  538. package/dist/components/Employee/EmployeeList/Head.js.map +0 -1
  539. package/dist/components/Employee/EmployeeList/List.d.ts +0 -2
  540. package/dist/components/Employee/EmployeeList/List.js +0 -124
  541. package/dist/components/Employee/EmployeeList/List.js.map +0 -1
  542. package/dist/components/Employee/EmployeeList/List.module.scss.js +0 -8
  543. package/dist/components/Employee/EmployeeList/List.module.scss.js.map +0 -1
  544. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.module.scss.js +0 -8
  545. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.module.scss.js.map +0 -1
  546. package/dist/components/UNSTABLE_Hooks/collectErrors.js.map +0 -1
  547. package/dist/components/UNSTABLE_Hooks/form/types.d.ts +0 -27
  548. package/dist/components/UNSTABLE_Hooks/useErrorHandling.js.map +0 -1
  549. /package/dist/components/{UNSTABLE_Hooks/useErrorHandling.test.d.ts → UNSTABLE_TimeOff/TimeOffFlow/timeOffStateMachine.test.d.ts} +0 -0
@@ -1,39 +1,41 @@
1
- import { EmployeeList as e } from "./EmployeeList/EmployeeList.js";
2
- import { OnboardingFlow as t } from "./OnboardingFlow/OnboardingFlow.js";
3
- import { SelfOnboardingFlow as n } from "./SelfOnboardingFlow/SelfOnboardingFlow.js";
4
- import { TerminateEmployee as f } from "./Terminations/TerminateEmployee/TerminateEmployee.js";
5
- import { TerminationSummary as a } from "./Terminations/TerminationSummary/TerminationSummary.js";
6
- import { TerminationFlow as y } from "./Terminations/TerminationFlow/TerminationFlow.js";
7
- import { Compensation as s } from "./Compensation/Compensation.js";
8
- import { Deductions as T } from "./Deductions/Deductions.js";
9
- import { DocumentSigner as E } from "./DocumentSigner/DocumentSigner.js";
10
- import { EmployeeDocuments as b } from "./EmployeeDocuments/EmployeeDocuments.js";
11
- import { EmploymentEligibility as c } from "./DocumentSigner/EmploymentEligibility/EmploymentEligibility.js";
12
- import { FederalTaxes as D } from "./FederalTaxes/FederalTaxes.js";
13
- import { Landing as L } from "./Landing/Landing.js";
14
- import { OnboardingSummary as h } from "./OnboardingSummary/OnboardingSummary.js";
15
- import { PaymentMethod as M } from "./PaymentMethod/PaymentMethod.js";
16
- import { Profile as k } from "./Profile/Profile.js";
17
- import { StateTaxes as v } from "./StateTaxes/StateTaxes.js";
18
- import { Taxes as A } from "./Taxes/Taxes.js";
1
+ import { EmployeeList as r } from "./EmployeeList/EmployeeList.js";
2
+ import { ManagementEmployeeList as t } from "./EmployeeList/ManagementEmployeeList.js";
3
+ import { OnboardingFlow as n } from "./OnboardingFlow/OnboardingFlow.js";
4
+ import { SelfOnboardingFlow as f } from "./SelfOnboardingFlow/SelfOnboardingFlow.js";
5
+ import { TerminateEmployee as a } from "./Terminations/TerminateEmployee/TerminateEmployee.js";
6
+ import { TerminationSummary as y } from "./Terminations/TerminationSummary/TerminationSummary.js";
7
+ import { TerminationFlow as d } from "./Terminations/TerminationFlow/TerminationFlow.js";
8
+ import { Compensation as E } from "./Compensation/Compensation.js";
9
+ import { Deductions as u } from "./Deductions/Deductions.js";
10
+ import { DocumentSigner as b } from "./DocumentSigner/DocumentSigner.js";
11
+ import { EmployeeDocuments as c } from "./EmployeeDocuments/EmployeeDocuments.js";
12
+ import { EmploymentEligibility as D } from "./DocumentSigner/EmploymentEligibility/EmploymentEligibility.js";
13
+ import { FederalTaxes as O } from "./FederalTaxes/FederalTaxes.js";
14
+ import { Landing as P } from "./Landing/Landing.js";
15
+ import { OnboardingSummary as C } from "./OnboardingSummary/OnboardingSummary.js";
16
+ import { PaymentMethod as k } from "./PaymentMethod/PaymentMethod.js";
17
+ import { Profile as v } from "./Profile/Profile.js";
18
+ import { StateTaxes as A } from "./StateTaxes/StateTaxes.js";
19
+ import { Taxes as G } from "./Taxes/Taxes.js";
19
20
  export {
20
- s as Compensation,
21
- T as Deductions,
22
- E as DocumentSigner,
23
- b as EmployeeDocuments,
24
- e as EmployeeList,
25
- c as EmploymentEligibility,
26
- D as FederalTaxes,
27
- L as Landing,
28
- t as OnboardingFlow,
29
- h as OnboardingSummary,
30
- M as PaymentMethod,
31
- k as Profile,
32
- n as SelfOnboardingFlow,
33
- v as StateTaxes,
34
- A as Taxes,
35
- f as TerminateEmployee,
36
- y as TerminationFlow,
37
- a as TerminationSummary
21
+ E as Compensation,
22
+ u as Deductions,
23
+ b as DocumentSigner,
24
+ c as EmployeeDocuments,
25
+ r as EmployeeList,
26
+ D as EmploymentEligibility,
27
+ O as FederalTaxes,
28
+ P as Landing,
29
+ t as ManagementEmployeeList,
30
+ n as OnboardingFlow,
31
+ C as OnboardingSummary,
32
+ k as PaymentMethod,
33
+ v as Profile,
34
+ f as SelfOnboardingFlow,
35
+ A as StateTaxes,
36
+ G as Taxes,
37
+ a as TerminateEmployee,
38
+ d as TerminationFlow,
39
+ y as TerminationSummary
38
40
  };
39
41
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;"}
@@ -3,26 +3,28 @@ import { useMachine as v } from "react-robot";
3
3
  import { useTranslation as w } from "react-i18next";
4
4
  import { FlowBreadcrumbs as F } from "../Common/FlowBreadcrumbs/FlowBreadcrumbs.js";
5
5
  import { Flex as s, FlexItem as d } from "../Common/Flex/Flex.js";
6
+ import "classnames";
7
+ import "../../shared/constants.js";
6
8
  import { FlowContext as j } from "./useFlow.js";
7
9
  import { useComponentContext as E } from "../../contexts/ComponentAdapter/useComponentContext.js";
8
- const L = ({
10
+ const k = ({
9
11
  onEvent: x,
10
12
  machine: f
11
13
  }) => {
12
14
  const b = E(), { t: g } = w(), [r, h, c] = v(f, {
13
- onEvent: a,
15
+ onEvent: i,
14
16
  component: null,
15
17
  progressBarCta: null
16
18
  }), {
17
19
  progressBarType: l = null,
18
- totalSteps: n = null,
19
- currentStep: o = null,
20
- currentBreadcrumbId: t,
20
+ totalSteps: o = null,
21
+ currentStep: t = null,
22
+ currentBreadcrumbId: n,
21
23
  breadcrumbs: B = {}
22
24
  } = r.context;
23
- function a(i, m) {
24
- const p = { type: i, payload: m }, C = h;
25
- c.child ? c.child.send(p) : C(p), x(i, m);
25
+ function i(m, a) {
26
+ const p = { type: m, payload: a }, C = h;
27
+ c.child ? c.child.send(p) : C(p), x(m, a);
26
28
  }
27
29
  return /* @__PURE__ */ e(s, { children: /* @__PURE__ */ e(
28
30
  j.Provider,
@@ -31,12 +33,12 @@ const L = ({
31
33
  ...r.context
32
34
  },
33
35
  children: /* @__PURE__ */ u(s, { flexDirection: "column", gap: 32, children: [
34
- l === "progress" && o && n && /* @__PURE__ */ e(
36
+ l === "progress" && t && o && /* @__PURE__ */ e(
35
37
  b.ProgressBar,
36
38
  {
37
- totalSteps: n,
38
- currentStep: o,
39
- label: g("progressBarLabel", { totalSteps: n, currentStep: o }),
39
+ totalSteps: o,
40
+ currentStep: t,
41
+ label: g("progressBarLabel", { totalSteps: o, currentStep: t }),
40
42
  cta: r.context.progressBarCta
41
43
  }
42
44
  ),
@@ -44,9 +46,9 @@ const L = ({
44
46
  /* @__PURE__ */ e(d, { flexGrow: 1, children: /* @__PURE__ */ e(
45
47
  F,
46
48
  {
47
- breadcrumbs: t ? B[t] ?? [] : [],
48
- currentBreadcrumbId: t,
49
- onEvent: a
49
+ breadcrumbs: n ? B[n] ?? [] : [],
50
+ currentBreadcrumbId: n,
51
+ onEvent: i
50
52
  }
51
53
  ) }),
52
54
  /* @__PURE__ */ e(d, { children: r.context.progressBarCta && /* @__PURE__ */ e(r.context.progressBarCta, {}) })
@@ -57,6 +59,6 @@ const L = ({
57
59
  ) });
58
60
  };
59
61
  export {
60
- L as Flow
62
+ k as Flow
61
63
  };
62
64
  //# sourceMappingURL=Flow.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Flow.js","sources":["../../../src/components/Flow/Flow.tsx"],"sourcesContent":["import { useMachine } from 'react-robot'\nimport { type Machine, type SendFunction } from 'robot3'\nimport { useTranslation } from 'react-i18next'\nimport type { OnEventType } from '../Base/useBase'\nimport { FlowBreadcrumbs } from '../Common/FlowBreadcrumbs/FlowBreadcrumbs'\nimport { Flex } from '../Common/Flex'\nimport { FlexItem } from '../Common'\nimport type { FlowContextInterface } from './useFlow'\nimport { FlowContext } from './useFlow'\nimport { type EventType } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\ntype FlowProps<M extends Machine> = {\n machine: M\n onEvent: OnEventType<EventType, unknown>\n}\n\nexport const Flow = <M extends Machine<object, FlowContextInterface>>({\n onEvent,\n machine,\n}: FlowProps<M>) => {\n const Components = useComponentContext()\n const { t } = useTranslation()\n const [current, send, service] = useMachine(machine, {\n onEvent: handleEvent,\n component: null,\n progressBarCta: null,\n })\n\n const {\n progressBarType = null,\n totalSteps = null,\n currentStep = null,\n currentBreadcrumbId,\n breadcrumbs = {},\n } = current.context\n\n function handleEvent(type: EventType, data: unknown): void {\n const event = { type, payload: data }\n const sendFn = send as SendFunction<string>\n //When dealing with nested state machine, correct machine needs to recieve an event\n if (service.child) {\n ;(service.child.send as SendFunction<string>)(event)\n } else {\n sendFn(event)\n }\n // Pass event upstream - onEvent can be optional on Flow component\n onEvent(type, data)\n }\n\n return (\n <Flex>\n <FlowContext.Provider\n value={{\n ...current.context,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {progressBarType === 'progress' && currentStep && totalSteps && (\n <Components.ProgressBar\n totalSteps={totalSteps}\n currentStep={currentStep}\n label={t('progressBarLabel', { totalSteps, currentStep })}\n cta={current.context.progressBarCta}\n />\n )}\n {progressBarType === 'breadcrumbs' && (\n <Flex flexDirection=\"row\" justifyContent=\"space-between\" alignItems=\"center\">\n <FlexItem flexGrow={1}>\n <FlowBreadcrumbs\n breadcrumbs={currentBreadcrumbId ? (breadcrumbs[currentBreadcrumbId] ?? []) : []}\n currentBreadcrumbId={currentBreadcrumbId}\n onEvent={handleEvent}\n />\n </FlexItem>\n <FlexItem>\n {current.context.progressBarCta && <current.context.progressBarCta />}\n </FlexItem>\n </Flex>\n )}\n {current.context.component && <current.context.component />}\n </Flex>\n </FlowContext.Provider>\n </Flex>\n )\n}\n"],"names":["Flow","onEvent","machine","Components","useComponentContext","t","useTranslation","current","send","service","useMachine","handleEvent","progressBarType","totalSteps","currentStep","currentBreadcrumbId","breadcrumbs","type","data","event","sendFn","Flex","jsx","FlowContext","js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UAAA,gBAAAC,EAACG,GAAA,EAAS,UAAU,GAClB,UAAA,gBAAAH;AAAA,YAACI;AAAA,YAAA;AAAA,cACC,aAAaX,IAAuBC,EAAYD,CAAmB,KAAK,CAAA,IAAM,CAAA;AAAA,cAC9E,qBAAAA;AAAA,cACA,SAASJ;AAAA,YAAA;AAAA,UAAA,GAEb;AAAA,UACA,gBAAAW,EAACG,GAAA,EACE,UAAAlB,EAAQ,QAAQ,oCAAmBA,EAAQ,QAAQ,gBAAhB,CAAA,CAA+B,EAAA,CACrE;AAAA,QAAA,GACF;AAAA,QAEDA,EAAQ,QAAQ,+BAAcA,EAAQ,QAAQ,WAAhB,CAAA,CAA0B;AAAA,MAAA,EAAA,CAC3D;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
1
+ {"version":3,"file":"Flow.js","sources":["../../../src/components/Flow/Flow.tsx"],"sourcesContent":["import { useMachine } from 'react-robot'\nimport { type Machine, type SendFunction } from 'robot3'\nimport { useTranslation } from 'react-i18next'\nimport type { OnEventType } from '../Base/useBase'\nimport { FlowBreadcrumbs } from '../Common/FlowBreadcrumbs/FlowBreadcrumbs'\nimport { Flex } from '../Common/Flex'\nimport { FlexItem } from '../Common'\nimport type { FlowContextInterface } from './useFlow'\nimport { FlowContext } from './useFlow'\nimport { type EventType } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\ntype FlowProps<M extends Machine> = {\n machine: M\n onEvent: OnEventType<EventType, unknown>\n}\n\nexport const Flow = <M extends Machine<object, FlowContextInterface>>({\n onEvent,\n machine,\n}: FlowProps<M>) => {\n const Components = useComponentContext()\n const { t } = useTranslation()\n const [current, send, service] = useMachine(machine, {\n onEvent: handleEvent,\n component: null,\n progressBarCta: null,\n })\n\n const {\n progressBarType = null,\n totalSteps = null,\n currentStep = null,\n currentBreadcrumbId,\n breadcrumbs = {},\n } = current.context\n\n function handleEvent(type: EventType, data: unknown): void {\n const event = { type, payload: data }\n const sendFn = send as SendFunction<string>\n //When dealing with nested state machine, correct machine needs to recieve an event\n if (service.child) {\n ;(service.child.send as SendFunction<string>)(event)\n } else {\n sendFn(event)\n }\n // Pass event upstream - onEvent can be optional on Flow component\n onEvent(type, data)\n }\n\n return (\n <Flex>\n <FlowContext.Provider\n value={{\n ...current.context,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {progressBarType === 'progress' && currentStep && totalSteps && (\n <Components.ProgressBar\n totalSteps={totalSteps}\n currentStep={currentStep}\n label={t('progressBarLabel', { totalSteps, currentStep })}\n cta={current.context.progressBarCta}\n />\n )}\n {progressBarType === 'breadcrumbs' && (\n <Flex flexDirection=\"row\" justifyContent=\"space-between\" alignItems=\"center\">\n <FlexItem flexGrow={1}>\n <FlowBreadcrumbs\n breadcrumbs={currentBreadcrumbId ? (breadcrumbs[currentBreadcrumbId] ?? []) : []}\n currentBreadcrumbId={currentBreadcrumbId}\n onEvent={handleEvent}\n />\n </FlexItem>\n <FlexItem>\n {current.context.progressBarCta && <current.context.progressBarCta />}\n </FlexItem>\n </Flex>\n )}\n {current.context.component && <current.context.component />}\n </Flex>\n </FlowContext.Provider>\n </Flex>\n )\n}\n"],"names":["Flow","onEvent","machine","Components","useComponentContext","t","useTranslation","current","send","service","useMachine","handleEvent","progressBarType","totalSteps","currentStep","currentBreadcrumbId","breadcrumbs","type","data","event","sendFn","Flex","jsx","FlowContext","jsxs","FlexItem","FlowBreadcrumbs"],"mappings":";;;;;;;;;AAiBO,MAAMA,IAAO,CAAkD;AAAA,EACpE,SAAAC;AAAA,EACA,SAAAC;AACF,MAAoB;AAClB,QAAMC,IAAaC,EAAA,GACb,EAAE,GAAAC,EAAA,IAAMC,EAAA,GACR,CAACC,GAASC,GAAMC,CAAO,IAAIC,EAAWR,GAAS;AAAA,IACnD,SAASS;AAAA,IACT,WAAW;AAAA,IACX,gBAAgB;AAAA,EAAA,CACjB,GAEK;AAAA,IACJ,iBAAAC,IAAkB;AAAA,IAClB,YAAAC,IAAa;A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EAAQ,QAAQ,+BAAcA,EAAQ,QAAQ,WAAhB,CAAA,CAA0B;AAAA,MAAA,EAAA,CAC3D;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
@@ -13,13 +13,14 @@ import r from "./InformationRequestForm.module.scss.js";
13
13
  import { BaseComponent as $ } from "../../Base/Base.js";
14
14
  import { useBase as J } from "../../Base/useBase.js";
15
15
  import { Flex as y } from "../../Common/Flex/Flex.js";
16
- import { FileInputField as X } from "../../Common/Fields/FileInputField/FileInputField.js";
17
- import { Form as Z } from "../../Common/Form/Form.js";
18
- import { useComponentContext as _ } from "../../../contexts/ComponentAdapter/useComponentContext.js";
19
- import { useComponentDictionary as ee, useI18n as A } from "../../../i18n/I18n.js";
20
- import { informationRequestEvents as C } from "../../../shared/constants.js";
21
- import { useFlow as ne } from "../../Flow/useFlow.js";
22
- import { TextInputField as te } from "../../Common/Fields/TextInputField/TextInputField.js";
16
+ import "classnames";
17
+ import { informationRequestEvents as _ } from "../../../shared/constants.js";
18
+ import { TextInputField as X } from "../../Common/Fields/TextInputField/TextInputField.js";
19
+ import { FileInputField as Z } from "../../Common/Fields/FileInputField/FileInputField.js";
20
+ import { Form as ee } from "../../Common/Form/Form.js";
21
+ import { useComponentContext as A } from "../../../contexts/ComponentAdapter/useComponentContext.js";
22
+ import { useComponentDictionary as ne, useI18n as C } from "../../../i18n/I18n.js";
23
+ import { useFlow as te } from "../../Flow/useFlow.js";
23
24
  const M = "gusto-sdk-information-request-form", oe = ["image/jpeg", "image/png", "application/pdf"], se = {
24
25
  ALLOWED_TAGS: ["a", "b", "strong"],
25
26
  ALLOWED_ATTR: ["target", "href", "rel"]
@@ -45,8 +46,8 @@ function ce(o) {
45
46
  return o.some((s) => s.responseType === u.Persona);
46
47
  }
47
48
  function me({ companyId: o, requestId: s, dictionary: i }) {
48
- ee("InformationRequests.InformationRequestForm", i), A("InformationRequests.InformationRequestForm");
49
- const { t: n } = D("InformationRequests.InformationRequestForm"), { Alert: T, Heading: q, Text: c } = _(), { onEvent: I, baseSubmitHandler: g } = J(), { data: x } = P({
49
+ ne("InformationRequests.InformationRequestForm", i), C("InformationRequests.InformationRequestForm");
50
+ const { t: n } = D("InformationRequests.InformationRequestForm"), { Alert: T, Heading: q, Text: c } = A(), { onEvent: I, baseSubmitHandler: g } = J(), { data: x } = P({
50
51
  companyUuid: o
51
52
  }), l = x.informationRequestList?.find((t) => t.uuid === s), a = l?.requiredQuestions ?? [], F = l?.blockingPayroll ?? !1, w = O(a), E = ce(a), { mutateAsync: L } = V(), v = {}, U = [];
52
53
  a.forEach((t) => {
@@ -85,7 +86,7 @@ function me({ companyId: o, requestId: s, dictionary: i }) {
85
86
  }
86
87
  }
87
88
  });
88
- I(C.INFORMATION_REQUEST_FORM_DONE, b.informationRequest);
89
+ I(_.INFORMATION_REQUEST_FORM_DONE, b.informationRequest);
89
90
  });
90
91
  }, k = (t) => {
91
92
  if (!t.questionUuid || !t.responseType) return null;
@@ -104,7 +105,7 @@ function me({ companyId: o, requestId: s, dictionary: i }) {
104
105
  ] }),
105
106
  /* @__PURE__ */ e("hr", { className: r.divider }),
106
107
  b && /* @__PURE__ */ e("div", { className: r.textInputWrapper, children: /* @__PURE__ */ e(
107
- te,
108
+ X,
108
109
  {
109
110
  name: R,
110
111
  label: n("fields.textAnswer.label"),
@@ -114,7 +115,7 @@ function me({ companyId: o, requestId: s, dictionary: i }) {
114
115
  }
115
116
  ) }),
116
117
  h && /* @__PURE__ */ e("div", { className: r.fileInputWrapper, children: /* @__PURE__ */ e(
117
- X,
118
+ Z,
118
119
  {
119
120
  name: R,
120
121
  label: n("fields.fileUpload.label"),
@@ -137,19 +138,19 @@ function me({ companyId: o, requestId: s, dictionary: i }) {
137
138
  return /* @__PURE__ */ e("div", { className: r.root, children: /* @__PURE__ */ m(y, { flexDirection: "column", gap: 16, children: [
138
139
  /* @__PURE__ */ e(q, { as: "h2", children: n("title") }),
139
140
  F && /* @__PURE__ */ e(T, { status: "error", label: n("blockingAlert.title"), disableScrollIntoView: !0, children: n("blockingAlert.description") }),
140
- w ? j : /* @__PURE__ */ e(H, { ...N, children: /* @__PURE__ */ e(Z, { id: M, onSubmit: N.handleSubmit(Q), children: /* @__PURE__ */ e(y, { flexDirection: "column", gap: 16, children: a.map(k) }) }) })
141
+ w ? j : /* @__PURE__ */ e(H, { ...N, children: /* @__PURE__ */ e(ee, { id: M, onSubmit: N.handleSubmit(Q), children: /* @__PURE__ */ e(y, { flexDirection: "column", gap: 16, children: a.map(k) }) }) })
141
142
  ] }) });
142
143
  }
143
144
  const le = ({ onEvent: o }) => {
144
- A("InformationRequests.InformationRequestForm");
145
- const { t: s } = D("InformationRequests.InformationRequestForm"), { Button: i } = _(), { companyId: n, selectedRequestId: T } = ne(), { data: q } = P({
145
+ C("InformationRequests.InformationRequestForm");
146
+ const { t: s } = D("InformationRequests.InformationRequestForm"), { Button: i } = A(), { companyId: n, selectedRequestId: T } = te(), { data: q } = P({
146
147
  companyUuid: n
147
148
  }), I = q.informationRequestList?.find(
148
149
  (F) => F.uuid === T
149
150
  )?.requiredQuestions ?? [], g = O(I), l = K({
150
151
  mutationKey: Y()
151
152
  }) > 0, a = () => {
152
- o(C.INFORMATION_REQUEST_FORM_CANCEL);
153
+ o(_.INFORMATION_REQUEST_FORM_CANCEL);
153
154
  };
154
155
  return g ? /* @__PURE__ */ e(y, { justifyContent: "flex-end", gap: 12, children: /* @__PURE__ */ e(i, { variant: "secondary", onClick: a, children: s("cta.close") }) }) : /* @__PURE__ */ m(y, { justifyContent: "flex-end", gap: 12, children: [
155
156
  /* @__PURE__ */ e(i, { variant: "secondary", onClick: a, isDisabled: l, children: s("cta.cancel") }),
@@ -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\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\ninterface InformationRequestFormProps extends BaseComponentInterface<'InformationRequests.InformationRequestForm'> {\n companyId: string\n requestId: string\n onEvent: OnEventType<EventType, unknown>\n}\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(\n question => question.responseType && !SUPPORTED_RESPONSE_TYPES.includes(question.responseType),\n )\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.informationRequestList?.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.questionUuid || !question.responseType) return\n\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 // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-arguments -- removing this breaks resolver type compatibility\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 if (!question.questionUuid || !question.responseType) return null\n\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 weight=\"medium\">\n {isDocumentType ? t('questionTypes.document') : t('questionTypes.answer')}\n </Text>\n <Text>\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 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.informationRequestList?.find(\n req => req.uuid === selectedRequestId,\n )\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","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,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lD,EAAE,YAAY,EAAA,CACjB;AAAA,IACA,gBAAAnB;AAAA,MAACkE;AAAA,MAAA;AAAA,QACC,SAAQ;AAAA,QACR,MAAK;AAAA,QACL,MAAMzE;AAAA,QACN,WAAW4E;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\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\ninterface InformationRequestFormProps extends BaseComponentInterface<'InformationRequests.InformationRequestForm'> {\n companyId: string\n requestId: string\n onEvent: OnEventType<EventType, unknown>\n}\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(\n question => question.responseType && !SUPPORTED_RESPONSE_TYPES.includes(question.responseType),\n )\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.informationRequestList?.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.questionUuid || !question.responseType) return\n\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 if (!question.questionUuid || !question.responseType) return null\n\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 weight=\"medium\">\n {isDocumentType ? t('questionTypes.document') : t('questionTypes.answer')}\n </Text>\n <Text>\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 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.informationRequestList?.find(\n req => req.uuid === selectedRequestId,\n )\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","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,GAEMC,KAA+BC,EAAE;AAAA,EACrCA,EAAE,OAAA;AAAA,EACFA,EAAE,MAAM,CAACA,EAAE,OAAA,EAAS,IAAI,CAAC,GAAGA,EAAE,WAAW,IAAI,CAAC,CAAC;AACjD;AAUO,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;AAAA,IACf,OAAYC,EAAS,gBAAgB,CAACJ,GAAyB,SAASI,EAAS,YAAY;AAAA,EAAA;AAEjG;AAEA,SAASC,GAAuBF,GAAgC;AAC9D,SAAOA,EAAU,KAAK,CAAAC,MAAYA,EAAS,iBAAiBH,EAAa,OAAO;AAClF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ACzB,IAAA/C,EAAQ0B,EAAyB,+BAA+B;AAAA,EAClE;AAEA,SAAIjB,IAEA,gBAAAlC,EAAC8D,GAAA,EAAK,gBAAe,YAAW,KAAK,IACnC,UAAA,gBAAA9D,EAACkE,GAAA,EAAO,SAAQ,aAAY,SAASM,GAClC,UAAArD,EAAE,WAAW,GAChB,GACF,IAKF,gBAAAqC,EAACM,GAAA,EAAK,gBAAe,YAAW,KAAK,IACnC,UAAA;AAAA,IAAA,gBAAA9D,EAACkE,GAAA,EAAO,SAAQ,aAAY,SAASM,GAAc,YAAYH,GAC5D,UAAAlD,EAAE,YAAY,EAAA,CACjB;AAAA,IACA,gBAAAnB;AAAA,MAACkE;AAAA,MAAA;AAAA,QACC,SAAQ;AAAA,QACR,MAAK;AAAA,QACL,MAAMzE;AAAA,QACN,WAAW4E;AAAA,QAEV,YAAE,YAAY;AAAA,MAAA;AAAA,IAAA;AAAA,EACjB,GACF;AAEJ;AAEAvE,GAAuB,SAASmE;"}
@@ -9,14 +9,15 @@ import { useComponentDictionary as S, useI18n as T } from "../../../i18n/I18n.js
9
9
  import { DataView as D } from "../../Common/DataView/DataView.js";
10
10
  import { useDataView as k } from "../../Common/DataView/useDataView.js";
11
11
  import { FlexItem as E, Flex as u } from "../../Common/Flex/Flex.js";
12
- import { EmptyData as v } from "../../Common/EmptyData/EmptyData.js";
13
- import { informationRequestEvents as B } from "../../../shared/constants.js";
14
- function J(o) {
12
+ import "classnames";
13
+ import { informationRequestEvents as v } from "../../../shared/constants.js";
14
+ import { EmptyData as B } from "../../Common/EmptyData/EmptyData.js";
15
+ function K(o) {
15
16
  return /* @__PURE__ */ n(w, { ...o, children: /* @__PURE__ */ n(C, { ...o, children: o.children }) });
16
17
  }
17
18
  function C({ companyId: o, dictionary: d, onEvent: f }) {
18
19
  S("InformationRequests.InformationRequestList", d), T("InformationRequests.InformationRequestList");
19
- const { t } = b("InformationRequests.InformationRequestList"), { Heading: y, Text: l, Button: R, Badge: m } = x(), { data: g } = P({
20
+ const { t } = b("InformationRequests.InformationRequestList"), { Heading: y, Text: m, Button: R, Badge: l } = x(), { data: g } = P({
20
21
  companyUuid: o
21
22
  }), c = (g.informationRequestList ?? []).filter(
22
23
  (e) => e.status !== r.Approved
@@ -44,12 +45,12 @@ function C({ companyId: o, dictionary: d, onEvent: f }) {
44
45
  }
45
46
  }, I = k({
46
47
  data: c,
47
- emptyState: () => /* @__PURE__ */ n(v, { title: t("emptyTableTitle"), description: t("emptyTableDescription") }),
48
+ emptyState: () => /* @__PURE__ */ n(B, { title: t("emptyTableTitle"), description: t("emptyTableDescription") }),
48
49
  columns: [
49
50
  {
50
51
  key: "type",
51
52
  title: t("columns.type"),
52
- render: (e) => /* @__PURE__ */ n(E, { flexGrow: 1, children: /* @__PURE__ */ n(l, { weight: "medium", children: h(e.type) }) })
53
+ render: (e) => /* @__PURE__ */ n(E, { flexGrow: 1, children: /* @__PURE__ */ n(m, { weight: "medium", children: h(e.type) }) })
53
54
  },
54
55
  {
55
56
  key: "status",
@@ -57,8 +58,8 @@ function C({ companyId: o, dictionary: d, onEvent: f }) {
57
58
  render: (e) => {
58
59
  const s = q(e.status), p = e.blockingPayroll;
59
60
  return !s && !p ? null : /* @__PURE__ */ a(u, { gap: 8, alignItems: "center", children: [
60
- s && /* @__PURE__ */ n(m, { status: s.badgeStatus, children: s.label }),
61
- p && /* @__PURE__ */ n(m, { status: "error", children: t("status.payrollBlocking") })
61
+ s && /* @__PURE__ */ n(l, { status: s.badgeStatus, children: s.label }),
62
+ p && /* @__PURE__ */ n(l, { status: "error", children: t("status.payrollBlocking") })
62
63
  ] });
63
64
  }
64
65
  }
@@ -68,7 +69,7 @@ function C({ companyId: o, dictionary: d, onEvent: f }) {
68
69
  {
69
70
  variant: "secondary",
70
71
  onClick: () => {
71
- f(B.INFORMATION_REQUEST_RESPOND, {
72
+ f(v.INFORMATION_REQUEST_RESPOND, {
72
73
  requestId: e.uuid
73
74
  });
74
75
  },
@@ -79,12 +80,12 @@ function C({ companyId: o, dictionary: d, onEvent: f }) {
79
80
  return /* @__PURE__ */ a(u, { flexDirection: "column", gap: 20, children: [
80
81
  /* @__PURE__ */ a(u, { flexDirection: "column", gap: 2, children: [
81
82
  /* @__PURE__ */ n(y, { as: "h2", styledAs: "h4", children: t("title") }),
82
- c.length > 0 && /* @__PURE__ */ n(l, { children: t("description") })
83
+ c.length > 0 && /* @__PURE__ */ n(m, { children: t("description") })
83
84
  ] }),
84
85
  /* @__PURE__ */ n(D, { ...I, label: t("title") })
85
86
  ] });
86
87
  }
87
88
  export {
88
- J as InformationRequestList
89
+ K as InformationRequestList
89
90
  };
90
91
  //# sourceMappingURL=InformationRequestList.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"InformationRequestList.js","sources":["../../../../src/components/InformationRequests/InformationRequestList/InformationRequestList.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useInformationRequestsGetInformationRequestsSuspense } from '@gusto/embedded-api/react-query/informationRequestsGetInformationRequests'\nimport type { InformationRequest } from '@gusto/embedded-api/models/components/informationrequest'\nimport {\n InformationRequestStatus,\n InformationRequestType,\n} from '@gusto/embedded-api/models/components/informationrequest'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { DataView } from '@/components/Common/DataView/DataView'\nimport { useDataView } from '@/components/Common/DataView/useDataView'\nimport { EmptyData, Flex, FlexItem } from '@/components/Common'\nimport { informationRequestEvents } from '@/shared/constants'\nimport type { BadgeProps } from '@/components/Common/UI/Badge/BadgeTypes'\n\ninterface InformationRequestListProps extends BaseComponentInterface<'InformationRequests.InformationRequestList'> {\n companyId: string\n onEvent: BaseComponentInterface['onEvent']\n}\n\nexport function InformationRequestList(props: InformationRequestListProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\ntype StatusMapping = {\n label: string\n badgeStatus: BadgeProps['status']\n} | null\n\nfunction Root({ companyId, dictionary, onEvent }: InformationRequestListProps) {\n useComponentDictionary('InformationRequests.InformationRequestList', dictionary)\n useI18n('InformationRequests.InformationRequestList')\n const { t } = useTranslation('InformationRequests.InformationRequestList')\n const { Heading, Text, Button, Badge } = useComponentContext()\n\n const { data } = useInformationRequestsGetInformationRequestsSuspense({\n companyUuid: companyId,\n })\n\n const informationRequests = data.informationRequestList ?? []\n\n const visibleRequests = informationRequests.filter(\n request => request.status !== InformationRequestStatus.Approved,\n )\n\n const getTypeLabel = (type: InformationRequest['type']): string => {\n switch (type) {\n case InformationRequestType.CompanyOnboarding:\n return t('types.companyOnboarding')\n case InformationRequestType.AccountProtection:\n return t('types.accountProtection')\n case InformationRequestType.PaymentRequest:\n return t('types.paymentRequest')\n case InformationRequestType.PaymentError:\n return t('types.paymentError')\n default:\n return t('types.unknown')\n }\n }\n\n const getStatusMapping = (status: InformationRequest['status']): StatusMapping => {\n switch (status) {\n case InformationRequestStatus.PendingResponse:\n return { label: t('status.incomplete'), badgeStatus: 'info' }\n case InformationRequestStatus.PendingReview:\n return { label: t('status.underReview'), badgeStatus: 'warning' }\n default:\n return null\n }\n }\n\n const dataViewProps = useDataView({\n data: visibleRequests,\n emptyState: () => (\n <EmptyData title={t('emptyTableTitle')} description={t('emptyTableDescription')} />\n ),\n columns: [\n {\n key: 'type',\n title: t('columns.type'),\n render: request => (\n <FlexItem flexGrow={1}>\n <Text weight=\"medium\">{getTypeLabel(request.type)}</Text>\n </FlexItem>\n ),\n },\n {\n key: 'status',\n title: t('columns.status'),\n render: request => {\n const statusMapping = getStatusMapping(request.status)\n const showPayrollBlockingBadge = request.blockingPayroll\n\n if (!statusMapping && !showPayrollBlockingBadge) {\n return null\n }\n\n return (\n <Flex gap={8} alignItems=\"center\">\n {statusMapping && (\n <Badge status={statusMapping.badgeStatus}>{statusMapping.label}</Badge>\n )}\n {showPayrollBlockingBadge && (\n <Badge status=\"error\">{t('status.payrollBlocking')}</Badge>\n )}\n </Flex>\n )\n },\n },\n ],\n itemMenu: request => {\n const isPendingResponse = request.status === InformationRequestStatus.PendingResponse\n if (!isPendingResponse) {\n return null\n }\n return (\n <Button\n variant=\"secondary\"\n onClick={() => {\n onEvent(informationRequestEvents.INFORMATION_REQUEST_RESPOND, {\n requestId: request.uuid,\n })\n }}\n >\n {t('cta.respond')}\n </Button>\n )\n },\n })\n\n return (\n <Flex flexDirection=\"column\" gap={20}>\n <Flex flexDirection=\"column\" gap={2}>\n <Heading as=\"h2\" styledAs=\"h4\">\n {t('title')}\n </Heading>\n {visibleRequests.length > 0 && <Text>{t('description')}</Text>}\n </Flex>\n\n <DataView {...dataViewProps} label={t('title')} />\n </Flex>\n )\n}\n"],"names":["InformationRequestList","props","jsx","BaseComponent","Root","companyId","dictionary","onEvent","useComponentDictionary","useI18n","useTranslation","Heading","Text","Button","Badge","useComponentContext","data","useInformationRequestsGetInformationRequestsSuspense","visibleRequests","request","InformationRequestStatus","getTypeLabel","type","InformationRequestType","getStatusMapping","status","dataViewProps","useDataView","EmptyData","FlexItem","statusMapping","showPayrollBlockingBadge","jsxs","Flex","informationRequestEvents","DataView"],"mappings":";;;;;;;;;;;;;AAqBO,SAASA,EAAuBC,GAAoC;AACzE,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAOA,SAASG,EAAK,EAAE,WAAAC,GAAW,YAAAC,GAAY,SAAAC,KAAwC;AAC7E,EAAAC,EAAuB,8CAA8CF,CAAU,GAC/EG,EAAQ,4CAA4C;AACpD,QAAM,EAAE,EAAA,IAAMC,EAAe,4CAA4C,GACnE,EAAE,SAAAC,GAAS,MAAAC,GAAM,QAAAC,GAAQ,OAAAC,EAAA,IAAUC,EAAA,GAEnC,EAAE,MAAAC,EAAA,IAASC,EAAqD;AAAA,IACpE,aAAaZ;AAAA,EA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,MAAM,GAC/CY,IAA2BZ,EAAQ;AAEzC,iBAAI,CAACW,KAAiB,CAACC,IACd,OAIP,gBAAAC,EAACC,GAAA,EAAK,KAAK,GAAG,YAAW,UACtB,UAAA;AAAA,YAAAH,uBACEhB,GAAA,EAAM,QAAQgB,EAAc,aAAc,YAAc,OAAM;AAAA,YAEhEC,KACC,gBAAA7B,EAACY,GAAA,EAAM,QAAO,SAAS,UAAA,EAAE,wBAAwB,EAAA,CAAE;AAAA,UAAA,GAEvD;AAAA,QAEJ;AAAA,MAAA;AAAA,IACF;AAAA,IAEF,UAAU,CAAAK,MACkBA,EAAQ,WAAWC,EAAyB,kBAKpE,gBAAAlB;AAAA,MAACW;AAAA,MAAA;AAAA,QACC,SAAQ;AAAA,QACR,SAAS,MAAM;AACb,UAAAN,EAAQ2B,EAAyB,6BAA6B;AAAA,YAC5D,WAAWf,EAAQ;AAAA,UAAA,CACpB;AAAA,QACH;AAAA,QAEC,YAAE,aAAa;AAAA,MAAA;AAAA,IAAA,IAXX;AAAA,EAcX,CACD;AAED,SACE,gBAAAa,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,IAAA,gBAAAD,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,GAChC,UAAA;AAAA,MAAA,gBAAA/B,EAACS,KAAQ,IAAG,MAAK,UAAS,MACvB,UAAA,EAAE,OAAO,GACZ;AAAA,MACCO,EAAgB,SAAS,uBAAMN,GAAA,EAAM,UAAA,EAAE,aAAa,EAAA,CAAE;AAAA,IAAA,GACzD;AAAA,sBAECuB,GAAA,EAAU,GAAGT,GAAe,OAAO,EAAE,OAAO,EAAA,CAAG;AAAA,EAAA,GAClD;AAEJ;"}
1
+ {"version":3,"file":"InformationRequestList.js","sources":["../../../../src/components/InformationRequests/InformationRequestList/InformationRequestList.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useInformationRequestsGetInformationRequestsSuspense } from '@gusto/embedded-api/react-query/informationRequestsGetInformationRequests'\nimport type { InformationRequest } from '@gusto/embedded-api/models/components/informationrequest'\nimport {\n InformationRequestStatus,\n InformationRequestType,\n} from '@gusto/embedded-api/models/components/informationrequest'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { DataView } from '@/components/Common/DataView/DataView'\nimport { useDataView } from '@/components/Common/DataView/useDataView'\nimport { EmptyData, Flex, FlexItem } from '@/components/Common'\nimport { informationRequestEvents } from '@/shared/constants'\nimport type { BadgeProps } from '@/components/Common/UI/Badge/BadgeTypes'\n\ninterface InformationRequestListProps extends BaseComponentInterface<'InformationRequests.InformationRequestList'> {\n companyId: string\n onEvent: BaseComponentInterface['onEvent']\n}\n\nexport function InformationRequestList(props: InformationRequestListProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\ntype StatusMapping = {\n label: string\n badgeStatus: BadgeProps['status']\n} | null\n\nfunction Root({ companyId, dictionary, onEvent }: InformationRequestListProps) {\n useComponentDictionary('InformationRequests.InformationRequestList', dictionary)\n useI18n('InformationRequests.InformationRequestList')\n const { t } = useTranslation('InformationRequests.InformationRequestList')\n const { Heading, Text, Button, Badge } = useComponentContext()\n\n const { data } = useInformationRequestsGetInformationRequestsSuspense({\n companyUuid: companyId,\n })\n\n const informationRequests = data.informationRequestList ?? []\n\n const visibleRequests = informationRequests.filter(\n request => request.status !== InformationRequestStatus.Approved,\n )\n\n const getTypeLabel = (type: InformationRequest['type']): string => {\n switch (type) {\n case InformationRequestType.CompanyOnboarding:\n return t('types.companyOnboarding')\n case InformationRequestType.AccountProtection:\n return t('types.accountProtection')\n case InformationRequestType.PaymentRequest:\n return t('types.paymentRequest')\n case InformationRequestType.PaymentError:\n return t('types.paymentError')\n default:\n return t('types.unknown')\n }\n }\n\n const getStatusMapping = (status: InformationRequest['status']): StatusMapping => {\n switch (status) {\n case InformationRequestStatus.PendingResponse:\n return { label: t('status.incomplete'), badgeStatus: 'info' }\n case InformationRequestStatus.PendingReview:\n return { label: t('status.underReview'), badgeStatus: 'warning' }\n default:\n return null\n }\n }\n\n const dataViewProps = useDataView({\n data: visibleRequests,\n emptyState: () => (\n <EmptyData title={t('emptyTableTitle')} description={t('emptyTableDescription')} />\n ),\n columns: [\n {\n key: 'type',\n title: t('columns.type'),\n render: request => (\n <FlexItem flexGrow={1}>\n <Text weight=\"medium\">{getTypeLabel(request.type)}</Text>\n </FlexItem>\n ),\n },\n {\n key: 'status',\n title: t('columns.status'),\n render: request => {\n const statusMapping = getStatusMapping(request.status)\n const showPayrollBlockingBadge = request.blockingPayroll\n\n if (!statusMapping && !showPayrollBlockingBadge) {\n return null\n }\n\n return (\n <Flex gap={8} alignItems=\"center\">\n {statusMapping && (\n <Badge status={statusMapping.badgeStatus}>{statusMapping.label}</Badge>\n )}\n {showPayrollBlockingBadge && (\n <Badge status=\"error\">{t('status.payrollBlocking')}</Badge>\n )}\n </Flex>\n )\n },\n },\n ],\n itemMenu: request => {\n const isPendingResponse = request.status === InformationRequestStatus.PendingResponse\n if (!isPendingResponse) {\n return null\n }\n return (\n <Button\n variant=\"secondary\"\n onClick={() => {\n onEvent(informationRequestEvents.INFORMATION_REQUEST_RESPOND, {\n requestId: request.uuid,\n })\n }}\n >\n {t('cta.respond')}\n </Button>\n )\n },\n })\n\n return (\n <Flex flexDirection=\"column\" gap={20}>\n <Flex flexDirection=\"column\" gap={2}>\n <Heading as=\"h2\" styledAs=\"h4\">\n {t('title')}\n </Heading>\n {visibleRequests.length > 0 && <Text>{t('description')}</Text>}\n </Flex>\n\n <DataView {...dataViewProps} label={t('title')} />\n </Flex>\n )\n}\n"],"names":["InformationRequestList","props","jsx","BaseComponent","Root","companyId","dictionary","onEvent","useComponentDictionary","useI18n","useTranslation","Heading","Text","Button","Badge","useComponentContext","data","useInformationRequestsGetInformationRequestsSuspense","visibleRequests","request","InformationRequestStatus","getTypeLabel","type","InformationRequestType","getStatusMapping","status","dataViewProps","useDataView","EmptyData","FlexItem","statusMapping","showPayrollBlockingBadge","jsxs","Flex","informationRequestEvents","DataView"],"mappings":";;;;;;;;;;;;;;AAqBO,SAASA,EAAuBC,GAAoC;AACzE,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAOA,SAASG,EAAK,EAAE,WAAAC,GAAW,YAAAC,GAAY,SAAAC,KAAwC;AAC7E,EAAAC,EAAuB,8CAA8CF,CAAU,GAC/EG,EAAQ,4CAA4C;AACpD,QAAM,EAAE,EAAA,IAAMC,EAAe,4CAA4C,GACnE,EAAE,SAAAC,GAAS,MAAAC,GAAM,QAAAC,GAAQ,OAAAC,EAAA,IAAUC,EAAA,GAEnC,EAAE,MAAAC,EAAA,IAASC,EAAqD;AAAA,IACpE,aAAaZ;AAAA,EAAA,CACd,GAIKa,KAFsBF,EAAK,0BAA0B,CAAA,GAEf;AAAA,IAC1C,CAAAG,MAAWA,EAAQ,WAAWC,EAAyB;AAAA,EAAA,GAGnDC,IAAe,CAACC,MAA6C;AACjE,YAAQA,GAAA;AAAA,MACN,KAAKC,EAAuB;AAC1B,eAAO,EAAE,yBAAyB;AAAA,MACpC,KAAKA,EAAuB;AAC1B,eAAO,EAAE,yBAAyB;AAAA,MACpC,KAAKA,EAAuB;AAC1B,eAAO,EAAE,sBAAsB;AAAA,MACjC,KAAKA,EAAuB;AAC1B,eAAO,EAAE,oBAAoB;AAAA,MAC/B;AACE,eAAO,EAAE,eAAe;AAAA,IAAA;AAAA,EAE9B,GAEMC,IAAmB,CAACC,MAAwD;AAChF,YAAQA,GAAA;AAAA,MACN,KAAKL,EAAyB;AAC5B,eAAO,EAAE,OAAO,EAAE,mBAAmB,GAAG,aAAa,OAAA;AAAA,MACvD,KAAKA,EAAyB;AAC5B,eAAO,EAA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AAA;AAAA,IAAA,IAXX;AAAA,EAcX,CACD;AAED,SACE,gBAAAa,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,IAAA,gBAAAD,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,GAChC,UAAA;AAAA,MAAA,gBAAA/B,EAACS,KAAQ,IAAG,MAAK,UAAS,MACvB,UAAA,EAAE,OAAO,GACZ;AAAA,MACCO,EAAgB,SAAS,uBAAMN,GAAA,EAAM,UAAA,EAAE,aAAa,EAAA,CAAE;AAAA,IAAA,GACzD;AAAA,sBAECuB,GAAA,EAAU,GAAGT,GAAe,OAAO,EAAE,OAAO,EAAA,CAAG;AAAA,EAAA,GAClD;AAEJ;"}
@@ -7,13 +7,14 @@ import { informationRequestsMachine as k } from "./informationRequestsStateMachi
7
7
  import { BaseBoundaries as P } from "../Base/Base.js";
8
8
  import "../Base/useBase.js";
9
9
  import { Flex as g } from "../Common/Flex/Flex.js";
10
+ import "classnames";
11
+ import { informationRequestEvents as s } from "../../shared/constants.js";
10
12
  import { useComponentContext as j } from "../../contexts/ComponentAdapter/useComponentContext.js";
11
13
  import { FlowContext as B } from "../Flow/useFlow.js";
12
14
  import { useComponentDictionary as $, useI18n as w } from "../../i18n/I18n.js";
13
- import { informationRequestEvents as s } from "../../shared/constants.js";
14
15
  import { InformationRequestList as z } from "./InformationRequestList/InformationRequestList.js";
15
16
  const I = "informationRequestResponded";
16
- function se({
17
+ function re({
17
18
  companyId: r,
18
19
  dictionary: O,
19
20
  withAlert: a = !0,
@@ -87,6 +88,6 @@ function se({
87
88
  );
88
89
  }
89
90
  export {
90
- se as InformationRequestsFlow
91
+ re as InformationRequestsFlow
91
92
  };
92
93
  //# sourceMappingURL=InformationRequests.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"InformationRequests.js","sources":["../../../src/components/InformationRequests/InformationRequests.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMachine } from 'react-robot'\nimport { Suspense, useCallback, useMemo, useState } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { InformationRequestList } from './InformationRequestList'\nimport { informationRequestsMachine } from './informationRequestsStateMachine'\nimport { type InformationRequestsContextInterface } from './InformationRequestsComponents'\nimport { BaseBoundaries, type BaseComponentInterface } from '@/components/Base'\nimport { Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { FlowContext } from '@/components/Flow/useFlow'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { informationRequestEvents, type EventType } from '@/shared/constants'\n\ninterface SubmissionAlert {\n id: number\n}\n\ninterface SubmissionAlertState {\n nextAlertId: number\n alerts: SubmissionAlert[]\n}\n\nexport interface InformationRequestsFlowProps extends Omit<\n BaseComponentInterface<'InformationRequests'>,\n 'onEvent'\n> {\n companyId: string\n /**\n * When true (default), the submission success alert is rendered at the top of this component.\n * Set to false when embedding in a parent (e.g. PayrollBlockerList) that renders the alert elsewhere.\n */\n withAlert?: boolean\n onEvent?: BaseComponentInterface['onEvent']\n}\n\nconst ALERT_TYPE = 'informationRequestResponded' as const\n\nexport function InformationRequestsFlow({\n companyId,\n dictionary,\n withAlert = true,\n onEvent = () => {},\n}: InformationRequestsFlowProps) {\n useComponentDictionary('InformationRequests', dictionary)\n useI18n('InformationRequests')\n const { t } = useTranslation('InformationRequests')\n const { Modal, LoadingSpinner, Alert, Text } = useComponentContext()\n const [isModalOpen, setIsModalOpen] = useState(false)\n const [alertState, setAlertState] = useState<SubmissionAlertState>({\n nextAlertId: 0,\n alerts: [],\n })\n\n const handleDismissAlert = useCallback((alertId: number) => {\n setAlertState(prev => ({\n ...prev,\n alerts: prev.alerts.filter(alert => alert.id !== alertId),\n }))\n }, [])\n\n const addSubmissionAlert = useCallback(() => {\n setAlertState(prev => ({\n nextAlertId: prev.nextAlertId + 1,\n alerts: [{ id: prev.nextAlertId }, ...prev.alerts],\n }))\n }, [])\n\n const informationRequestsMachineInstance = useMemo(\n () =>\n createMachine(\n 'list',\n informationRequestsMachine,\n (): InformationRequestsContextInterface => ({\n component: null,\n companyId,\n onEvent: handleEvent,\n }),\n ),\n [companyId],\n )\n const [current, send] = useMachine(informationRequestsMachineInstance)\n\n function handleEvent(type: EventType, data?: unknown) {\n send({ type, payload: data })\n\n if (type === informationRequestEvents.INFORMATION_REQUEST_RESPOND) {\n setIsModalOpen(true)\n }\n\n if (\n type === informationRequestEvents.INFORMATION_REQUEST_FORM_CANCEL ||\n type === informationRequestEvents.INFORMATION_REQUEST_FORM_DONE\n ) {\n setIsModalOpen(false)\n }\n\n if (type === informationRequestEvents.INFORMATION_REQUEST_FORM_DONE && withAlert) {\n addSubmissionAlert()\n }\n\n onEvent(type, data)\n }\n\n const handleCloseModal = () => {\n setIsModalOpen(false)\n }\n\n const CurrentComponent = current.context.component\n const Footer = CurrentComponent?.Footer || undefined\n\n return (\n <FlowContext.Provider\n value={{\n ...current.context,\n onEvent: handleEvent,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {withAlert &&\n alertState.alerts.map(alert => (\n <Alert\n key={alert.id}\n status=\"success\"\n label={t(`alerts.${ALERT_TYPE}.title`)}\n onDismiss={() => {\n handleDismissAlert(alert.id)\n }}\n >\n <Text>{t(`alerts.${ALERT_TYPE}.description`)}</Text>\n </Alert>\n ))}\n\n <Suspense fallback={<LoadingSpinner />}>\n <InformationRequestList companyId={companyId} onEvent={handleEvent} />\n </Suspense>\n <Modal\n isOpen={isModalOpen}\n onClose={handleCloseModal}\n footer={\n Footer && (\n <BaseBoundaries>\n <Suspense fallback={<LoadingSpinner size=\"sm\" />}>\n <Footer onEvent={handleEvent} />\n </Suspense>\n </BaseBoundaries>\n )\n }\n >\n {CurrentComponent && <CurrentComponent />}\n </Modal>\n </Flex>\n </FlowContext.Provider>\n )\n}\n"],"names":["ALERT_TYPE","InformationRequestsFlow","companyId","dictionary","withAlert","onEvent","useComponentDictionary","useI18n","t","useTranslation","Modal","LoadingSpinner","Alert","Text","useComponentContext","isModalOpen","setIsModalOpen","useState","alertState","setAlertState","handleDismissAlert","useCallback","alertId","prev","alert","addSubmissionAlert","informationRequestsMachineInstance","useMemo","createMachine","informationRequestsMachine","handleEvent","current","send","useMachine","type","data","informationRequestEvents","handleCloseModal","CurrentComponent","Footer","jsx","FlowContext","jsxs","Flex","Suspense","InformationRequestList","BaseBoundaries"],"mappings":";;;;;;;;;;;;;;AAoCA,MAAMA,IAAa;AAEZ,SAASC,GAAwB;AAAA,EACtC,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,SAAAC,IAAU,MAAM;AAAA,EAAC;AACnB,GAAiC;AAC/B,EAAAC,EAAuB,uBAAuBH,CAAU,GACxDI,EAAQ,qBAAqB;AAC7B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5C,EAAE,OAAAC,GAAO,gBAAAC,GAAgB,OAAAC,GAAO,MAAAC,EAAA,IAASC,EAAA,GACzC,CAACC,GAAaC,CAAc,IAAIC,EAAS,EAAK,GAC9C,CAACC,GAAYC,CAAa,IAAIF,EAA+B;AAAA,IACjE,aAAa;AAAA,IACb,QAAQ,CAAA;AAAA,EAAC,CACV,GAEKG,IAAqBC,EAAY,CAACC,MAAoB;AAC1D,IAAAH,EAAc,CAAAI,OAAS;AAAA,MACrB,GAAGA;AAAA,MACH,QAAQA,EAAK,OAAO,OAAO,CAAAC,MAASA,EAAM,OAAOF,CAAO;AAAA,IAAA,EACxD;AAAA,EACJ,GAAG,CAAA,CAAE,GAECG,IAAqBJ,EAAY,MAAM;AAC3C,IAAAF,EAAc,CAAAI,OAAS;AAAA,MACrB,aAAaA,EAAK,cAAc;AAAA,MAChC,QAAQ,CAAC,EAAE,IAAIA,EAAK,YAAA,GAAe,GAAGA,EAAK,MAAM;AAAA,IAAA,EACjD;AAAA,EACJ,GAAG,CAAA,CAAE,GAECG,IAAqCC;AAAA,IACzC,MACEC;AAAA,MACE;AAAA,MACAC;AAAA,MACA,OAA4C;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AACK,GAAA,EAAuB,WAAA3C,GAAsB,SAAS4B,EAAA,CAAa,GACtE;AAAA,QACA,gBAAAU;AAAA,UAAC9B;AAAA,UAAA;AAAA,YACC,QAAQK;AAAA,YACR,SAASsB;AAAA,YACT,QACEE,KACE,gBAAAC,EAACM,GAAA,EACC,UAAA,gBAAAN,EAACI,KAAS,UAAU,gBAAAJ,EAAC7B,GAAA,EAAe,MAAK,MAAK,GAC5C,UAAA,gBAAA6B,EAACD,KAAO,SAAST,EAAA,CAAa,GAChC,GACF;AAAA,YAIH,UAAAQ,uBAAqBA,GAAA,CAAA,CAAiB;AAAA,UAAA;AAAA,QAAA;AAAA,MACzC,EAAA,CACF;AAAA,IAAA;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"InformationRequests.js","sources":["../../../src/components/InformationRequests/InformationRequests.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMachine } from 'react-robot'\nimport { Suspense, useCallback, useMemo, useState } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { InformationRequestList } from './InformationRequestList'\nimport { informationRequestsMachine } from './informationRequestsStateMachine'\nimport { type InformationRequestsContextInterface } from './InformationRequestsComponents'\nimport { BaseBoundaries, type BaseComponentInterface } from '@/components/Base'\nimport { Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { FlowContext } from '@/components/Flow/useFlow'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { informationRequestEvents, type EventType } from '@/shared/constants'\n\ninterface SubmissionAlert {\n id: number\n}\n\ninterface SubmissionAlertState {\n nextAlertId: number\n alerts: SubmissionAlert[]\n}\n\nexport interface InformationRequestsFlowProps extends Omit<\n BaseComponentInterface<'InformationRequests'>,\n 'onEvent'\n> {\n companyId: string\n /**\n * When true (default), the submission success alert is rendered at the top of this component.\n * Set to false when embedding in a parent (e.g. PayrollBlockerList) that renders the alert elsewhere.\n */\n withAlert?: boolean\n onEvent?: BaseComponentInterface['onEvent']\n}\n\nconst ALERT_TYPE = 'informationRequestResponded' as const\n\nexport function InformationRequestsFlow({\n companyId,\n dictionary,\n withAlert = true,\n onEvent = () => {},\n}: InformationRequestsFlowProps) {\n useComponentDictionary('InformationRequests', dictionary)\n useI18n('InformationRequests')\n const { t } = useTranslation('InformationRequests')\n const { Modal, LoadingSpinner, Alert, Text } = useComponentContext()\n const [isModalOpen, setIsModalOpen] = useState(false)\n const [alertState, setAlertState] = useState<SubmissionAlertState>({\n nextAlertId: 0,\n alerts: [],\n })\n\n const handleDismissAlert = useCallback((alertId: number) => {\n setAlertState(prev => ({\n ...prev,\n alerts: prev.alerts.filter(alert => alert.id !== alertId),\n }))\n }, [])\n\n const addSubmissionAlert = useCallback(() => {\n setAlertState(prev => ({\n nextAlertId: prev.nextAlertId + 1,\n alerts: [{ id: prev.nextAlertId }, ...prev.alerts],\n }))\n }, [])\n\n const informationRequestsMachineInstance = useMemo(\n () =>\n createMachine(\n 'list',\n informationRequestsMachine,\n (): InformationRequestsContextInterface => ({\n component: null,\n companyId,\n onEvent: handleEvent,\n }),\n ),\n [companyId],\n )\n const [current, send] = useMachine(informationRequestsMachineInstance)\n\n function handleEvent(type: EventType, data?: unknown) {\n send({ type, payload: data })\n\n if (type === informationRequestEvents.INFORMATION_REQUEST_RESPOND) {\n setIsModalOpen(true)\n }\n\n if (\n type === informationRequestEvents.INFORMATION_REQUEST_FORM_CANCEL ||\n type === informationRequestEvents.INFORMATION_REQUEST_FORM_DONE\n ) {\n setIsModalOpen(false)\n }\n\n if (type === informationRequestEvents.INFORMATION_REQUEST_FORM_DONE && withAlert) {\n addSubmissionAlert()\n }\n\n onEvent(type, data)\n }\n\n const handleCloseModal = () => {\n setIsModalOpen(false)\n }\n\n const CurrentComponent = current.context.component\n const Footer = CurrentComponent?.Footer || undefined\n\n return (\n <FlowContext.Provider\n value={{\n ...current.context,\n onEvent: handleEvent,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {withAlert &&\n alertState.alerts.map(alert => (\n <Alert\n key={alert.id}\n status=\"success\"\n label={t(`alerts.${ALERT_TYPE}.title`)}\n onDismiss={() => {\n handleDismissAlert(alert.id)\n }}\n >\n <Text>{t(`alerts.${ALERT_TYPE}.description`)}</Text>\n </Alert>\n ))}\n\n <Suspense fallback={<LoadingSpinner />}>\n <InformationRequestList companyId={companyId} onEvent={handleEvent} />\n </Suspense>\n <Modal\n isOpen={isModalOpen}\n onClose={handleCloseModal}\n footer={\n Footer && (\n <BaseBoundaries>\n <Suspense fallback={<LoadingSpinner size=\"sm\" />}>\n <Footer onEvent={handleEvent} />\n </Suspense>\n </BaseBoundaries>\n )\n }\n >\n {CurrentComponent && <CurrentComponent />}\n </Modal>\n </Flex>\n </FlowContext.Provider>\n )\n}\n"],"names":["ALERT_TYPE","InformationRequestsFlow","companyId","dictionary","withAlert","onEvent","useComponentDictionary","useI18n","t","useTranslation","Modal","LoadingSpinner","Alert","Text","useComponentContext","isModalOpen","setIsModalOpen","useState","alertState","setAlertState","handleDismissAlert","useCallback","alertId","prev","alert","addSubmissionAlert","informationRequestsMachineInstance","useMemo","createMachine","informationRequestsMachine","handleEvent","current","send","useMachine","type","data","informationRequestEvents","handleCloseModal","CurrentComponent","Footer","jsx","FlowContext","jsxs","Flex","Suspense","InformationRequestList","BaseBoundaries"],"mappings":";;;;;;;;;;;;;;;AAoCA,MAAMA,IAAa;AAEZ,SAASC,GAAwB;AAAA,EACtC,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,SAAAC,IAAU,MAAM;AAAA,EAAC;AACnB,GAAiC;AAC/B,EAAAC,EAAuB,uBAAuBH,CAAU,GACxDI,EAAQ,qBAAqB;AAC7B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5C,EAAE,OAAAC,GAAO,gBAAAC,GAAgB,OAAAC,GAAO,MAAAC,EAAA,IAASC,EAAA,GACzC,CAACC,GAAaC,CAAc,IAAIC,EAAS,EAAK,GAC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,OAAO;AAAA,QACL,GAAGV,EAAQ;AAAA,QACX,SAASD;AAAA,MAAA;AAAA,MAGX,UAAA,gBAAAY,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAC/B,UAAA;AAAA,QAAAvC,KACCc,EAAW,OAAO,IAAI,CAAAM,MACpB,gBAAAgB;AAAA,UAAC5B;AAAA,UAAA;AAAA,YAEC,QAAO;AAAA,YACP,OAAOJ,EAAE,UAAUR,CAAU,QAAQ;AAAA,YACrC,WAAW,MAAM;AACf,cAAAoB,EAAmBI,EAAM,EAAE;AAAA,YAC7B;AAAA,YAEA,4BAACX,GAAA,EAAM,UAAAL,EAAE,UAAUR,CAAU,cAAc,EAAA,CAAE;AAAA,UAAA;AAAA,UAPxCwB,EAAM;AAAA,QAAA,CASd;AAAA,QAEH,gBAAAgB,EAACI,GAAA,EAAS,UAAU,gBAAAJ,EAAC7B,GAAA,CAAA,CAAe,GAClC,UAAA,gBAAA6B,EAACK,GAAA,EAAuB,WAAA3C,GAAsB,SAAS4B,EAAA,CAAa,GACtE;AAAA,QACA,gBAAAU;AAAA,UAAC9B;AAAA,UAAA;AAAA,YACC,QAAQK;AAAA,YACR,SAASsB;AAAA,YACT,QACEE,KACE,gBAAAC,EAACM,GAAA,EACC,UAAA,gBAAAN,EAACI,KAAS,UAAU,gBAAAJ,EAAC7B,GAAA,EAAe,MAAK,MAAK,GAC5C,UAAA,gBAAA6B,EAACD,KAAO,SAAST,EAAA,CAAa,GAChC,GACF;AAAA,YAIH,UAAAQ,uBAAqBA,GAAA,CAAA,CAAiB;AAAA,UAAA;AAAA,QAAA;AAAA,MACzC,EAAA,CACF;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -15,11 +15,12 @@ import { useComponentContext as S } from "../../../../contexts/ComponentAdapter/
15
15
  import { useComponentDictionary as z, useI18n as g } from "../../../../i18n/I18n.js";
16
16
  import { Flex as p, FlexItem as f } from "../../../Common/Flex/Flex.js";
17
17
  import { payrollWireEvents as N } from "../../../../shared/constants.js";
18
- import { TextAreaField as V } from "../../../Common/Fields/TextAreaField/TextAreaField.js";
19
- import { useDateFormatter as J } from "../../../../hooks/useDateFormatter.js";
18
+ import "classnames";
19
+ import { TextInputField as V } from "../../../Common/Fields/TextInputField/TextInputField.js";
20
+ import { DatePickerField as J } from "../../../Common/Fields/DatePickerField/DatePickerField.js";
20
21
  import { NumberInputField as Q } from "../../../Common/Fields/NumberInputField/NumberInputField.js";
21
- import { TextInputField as X } from "../../../Common/Fields/TextInputField/TextInputField.js";
22
- import { DatePickerField as Z } from "../../../Common/Fields/DatePickerField/DatePickerField.js";
22
+ import { TextAreaField as X } from "../../../Common/Fields/TextAreaField/TextAreaField.js";
23
+ import { useDateFormatter as Z } from "../../../../hooks/useDateFormatter.js";
23
24
  const $ = r.object({
24
25
  amountSent: r.number().positive(),
25
26
  dateSent: r.date(),
@@ -41,7 +42,7 @@ const oe = ({
41
42
  modalContainerRef: y
42
43
  }) => {
43
44
  z("Payroll.ConfirmWireDetailsForm", i), g("Payroll.ConfirmWireDetailsForm");
44
- const { onEvent: a, baseSubmitHandler: I } = Y(), { t } = F("Payroll.ConfirmWireDetailsForm"), { Heading: v, Text: b } = S(), R = J(), { data: P } = U({
45
+ const { onEvent: a, baseSubmitHandler: I } = Y(), { t } = F("Payroll.ConfirmWireDetailsForm"), { Heading: v, Text: b } = S(), R = Z(), { data: P } = U({
45
46
  wireInRequestUuid: o
46
47
  }), W = P.wireInRequest, { data: q } = G({
47
48
  companyId: n,
@@ -93,7 +94,7 @@ const oe = ({
93
94
  }
94
95
  ),
95
96
  /* @__PURE__ */ e(
96
- Z,
97
+ J,
97
98
  {
98
99
  name: "dateSent",
99
100
  label: t("dateLabel"),
@@ -103,7 +104,7 @@ const oe = ({
103
104
  }
104
105
  ),
105
106
  /* @__PURE__ */ e(
106
- X,
107
+ V,
107
108
  {
108
109
  name: "bankName",
109
110
  label: t("bankNameLabel"),
@@ -113,7 +114,7 @@ const oe = ({
113
114
  errorMessage: t("validations.bankName")
114
115
  }
115
116
  ),
116
- /* @__PURE__ */ e(V, { name: "additionalNotes", label: t("notesLabel"), rows: 3 })
117
+ /* @__PURE__ */ e(X, { name: "additionalNotes", label: t("notesLabel"), rows: 3 })
117
118
  ] })
118
119
  }
119
120
  ) })