@gusto/embedded-react-sdk 0.31.0 → 0.31.1-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (387) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/assets/icons/icon-arrow-right.svg.js +10 -0
  3. package/dist/assets/icons/icon-arrow-right.svg.js.map +1 -0
  4. package/dist/components/Base/Base.js +12 -13
  5. package/dist/components/Base/Base.js.map +1 -1
  6. package/dist/components/Common/DataView/DataView.js +1 -1
  7. package/dist/components/Common/DocumentList/DocumentList.js +1 -1
  8. package/dist/components/Common/DocumentViewer/DocumentViewer.js +1 -1
  9. package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.js +1 -1
  10. package/dist/components/Common/RequirementsList/RequirementsList.js +1 -1
  11. package/dist/components/Common/RequirementsList/RequirementsList.js.map +1 -1
  12. package/dist/components/Common/RequirementsList/RequirementsList.module.scss.js +1 -1
  13. package/dist/components/Common/SignatureForm/SignatureForm.js +10 -12
  14. package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
  15. package/dist/components/Common/SignatureForm/SignatureFormActions.js +2 -3
  16. package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
  17. package/dist/components/Common/SignatureForm/SignatureFormFields.js +6 -7
  18. package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
  19. package/dist/components/Common/UI/Box/Box.d.ts +2 -0
  20. package/dist/components/Common/UI/Box/Box.js +13 -0
  21. package/dist/components/Common/UI/Box/Box.js.map +1 -0
  22. package/dist/components/Common/UI/Box/Box.module.scss.js +12 -0
  23. package/dist/components/Common/UI/Box/Box.module.scss.js.map +1 -0
  24. package/dist/components/Common/UI/Box/BoxTypes.d.ts +15 -0
  25. package/dist/components/Common/UI/Box/index.d.ts +2 -0
  26. package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js +1 -1
  27. package/dist/components/Common/UI/Dialog/Dialog.js +1 -1
  28. package/dist/components/Common/UI/FileInput/FileInput.js +1 -1
  29. package/dist/components/Common/UI/Input/InputTypes.d.ts +1 -1
  30. package/dist/components/Common/UI/Input/InputTypes.js.map +1 -1
  31. package/dist/components/Common/UI/List/List.module.scss.js +1 -1
  32. package/dist/components/Common/UI/Modal/Modal.js +1 -1
  33. package/dist/components/Common/UI/ProgressBar/ProgressBar.js +4 -4
  34. package/dist/components/Common/UI/Tabs/Tabs.js +1 -1
  35. package/dist/components/Common/UI/TextInput/TextInput.js +30 -28
  36. package/dist/components/Common/UI/TextInput/TextInput.js.map +1 -1
  37. package/dist/components/Common/UI/TextInput/TextInputTypes.d.ts +1 -1
  38. package/dist/components/Common/UI/TextInput/TextInputTypes.js.map +1 -1
  39. package/dist/components/Company/AssignSignatory/AssignSignatory.js +2 -3
  40. package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
  41. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +3 -4
  42. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
  43. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +2 -3
  44. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
  45. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +1 -1
  46. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +12 -12
  47. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +3 -4
  48. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  49. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +2 -3
  50. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
  51. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +1 -1
  52. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +1 -1
  53. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +3 -4
  54. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  55. package/dist/components/Company/AssignSignatory/TitleSelect.js +4 -6
  56. package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
  57. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +5 -6
  58. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  59. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +8 -9
  60. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
  61. package/dist/components/Company/BankAccount/BankAccountForm/Form.js +5 -7
  62. package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
  63. package/dist/components/Company/BankAccount/BankAccountForm/context.js +3 -4
  64. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  65. package/dist/components/Company/BankAccount/BankAccountList/Actions.js +2 -3
  66. package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
  67. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +6 -7
  68. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
  69. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +5 -7
  70. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
  71. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +2 -3
  72. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
  73. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +8 -9
  74. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  75. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +3 -4
  76. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  77. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +3 -4
  78. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  79. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +3 -4
  80. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  81. package/dist/components/Company/FederalTaxes/Actions.js +6 -7
  82. package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
  83. package/dist/components/Company/FederalTaxes/FederalTaxes.js +3 -4
  84. package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
  85. package/dist/components/Company/FederalTaxes/Form.js +3 -5
  86. package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
  87. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +5 -6
  88. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  89. package/dist/components/Company/Industry/Actions.js +7 -8
  90. package/dist/components/Company/Industry/Actions.js.map +1 -1
  91. package/dist/components/Company/Industry/Context.js +6 -7
  92. package/dist/components/Company/Industry/Context.js.map +1 -1
  93. package/dist/components/Company/Industry/Edit.js +2 -3
  94. package/dist/components/Company/Industry/Edit.js.map +1 -1
  95. package/dist/components/Company/Locations/LocationForm/Actions.js +6 -7
  96. package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
  97. package/dist/components/Company/Locations/LocationForm/Form.js +1 -1
  98. package/dist/components/Company/Locations/LocationForm/LocationForm.js +3 -4
  99. package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
  100. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +3 -4
  101. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  102. package/dist/components/Company/Locations/LocationsList/Actions.js +2 -3
  103. package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
  104. package/dist/components/Company/Locations/LocationsList/List.js +6 -7
  105. package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
  106. package/dist/components/Company/Locations/LocationsList/LocationsList.js +3 -4
  107. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  108. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +3 -4
  109. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  110. package/dist/components/Company/OnboardingOverview/Completed.js +10 -12
  111. package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
  112. package/dist/components/Company/OnboardingOverview/MissingRequirements.js +37 -28
  113. package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
  114. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +7 -8
  115. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
  116. package/dist/components/Company/OnboardingOverview/context.js +3 -4
  117. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  118. package/dist/components/Company/PaySchedule/PaySchedule.js +3 -4
  119. package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
  120. package/dist/components/Company/PaySchedule/_parts/Actions.js +2 -3
  121. package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
  122. package/dist/components/Company/PaySchedule/_parts/Edit.js +15 -15
  123. package/dist/components/Company/PaySchedule/_parts/Head.js +11 -13
  124. package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
  125. package/dist/components/Company/PaySchedule/_parts/List.js +13 -15
  126. package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
  127. package/dist/components/Company/PaySchedule/usePaySchedule.js +5 -6
  128. package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
  129. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +2 -3
  130. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
  131. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +3 -4
  132. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  133. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +2 -3
  134. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
  135. package/dist/components/Company/StateTaxes/StateTaxesList/List.js +2 -3
  136. package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
  137. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +3 -4
  138. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  139. package/dist/components/Company/index.js +20 -20
  140. package/dist/components/Contractor/Address/Address.js +6 -8
  141. package/dist/components/Contractor/Address/Address.js.map +1 -1
  142. package/dist/components/Contractor/Address/Form.js +1 -1
  143. package/dist/components/Contractor/Address/useAddress.js +5 -6
  144. package/dist/components/Contractor/Address/useAddress.js.map +1 -1
  145. package/dist/components/Contractor/ContractorList/index.js +31 -32
  146. package/dist/components/Contractor/ContractorList/index.js.map +1 -1
  147. package/dist/components/Contractor/NewHireReport/NewHireReport.js +13 -14
  148. package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
  149. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +11 -12
  150. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
  151. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +2 -3
  152. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
  153. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +3 -4
  154. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
  155. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +2 -4
  156. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
  157. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +10 -10
  158. package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js +7 -9
  159. package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js.map +1 -1
  160. package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +3 -4
  161. package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js.map +1 -1
  162. package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js +0 -1
  163. package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js.map +1 -1
  164. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js +2 -4
  165. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map +1 -1
  166. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js +6 -8
  167. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js.map +1 -1
  168. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js +2 -4
  169. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js.map +1 -1
  170. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +2 -4
  171. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
  172. package/dist/components/Contractor/Profile/ContractorProfileForm.js +15 -15
  173. package/dist/components/Contractor/Profile/useContractorProfile.js +2 -3
  174. package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
  175. package/dist/components/Contractor/Submit/Submit.js +20 -21
  176. package/dist/components/Contractor/Submit/Submit.js.map +1 -1
  177. package/dist/components/Employee/Compensation/Actions.js +12 -13
  178. package/dist/components/Employee/Compensation/Actions.js.map +1 -1
  179. package/dist/components/Employee/Compensation/Edit.js +16 -17
  180. package/dist/components/Employee/Compensation/Edit.js.map +1 -1
  181. package/dist/components/Employee/Compensation/List.js +22 -23
  182. package/dist/components/Employee/Compensation/List.js.map +1 -1
  183. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +10 -11
  184. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
  185. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +11 -12
  186. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
  187. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +11 -12
  188. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -1
  189. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +7 -8
  190. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js.map +1 -1
  191. package/dist/components/Employee/Deductions/stateMachine.js +1 -1
  192. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +5 -6
  193. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
  194. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +2 -3
  195. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  196. package/dist/components/Employee/DocumentSigner/DocumentList/List.js +2 -4
  197. package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
  198. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +3 -4
  199. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  200. package/dist/components/Employee/DocumentSigner/DocumentSigner.js +25 -37
  201. package/dist/components/Employee/DocumentSigner/DocumentSigner.js.map +1 -1
  202. package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js +47 -45
  203. package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js.map +1 -1
  204. package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.js +146 -109
  205. package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.js.map +1 -1
  206. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +2 -3
  207. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  208. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +3 -4
  209. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  210. package/dist/components/Employee/DocumentSigner/documentSignerStateMachine.d.ts +1 -0
  211. package/dist/components/Employee/DocumentSigner/documentSignerStateMachine.js.map +1 -1
  212. package/dist/components/Employee/DocumentSigner/stateMachine.js +34 -22
  213. package/dist/components/Employee/DocumentSigner/stateMachine.js.map +1 -1
  214. package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.js +2 -4
  215. package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.js.map +1 -1
  216. package/dist/components/Employee/EmployeeList/Actions.js +6 -7
  217. package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
  218. package/dist/components/Employee/EmployeeList/EmployeeList.js +3 -4
  219. package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
  220. package/dist/components/Employee/EmployeeList/Head.js +5 -7
  221. package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
  222. package/dist/components/Employee/EmployeeList/List.js +2 -3
  223. package/dist/components/Employee/EmployeeList/List.js.map +1 -1
  224. package/dist/components/Employee/EmployeeList/useEmployeeList.js +3 -4
  225. package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
  226. package/dist/components/Employee/FederalTaxes/Actions.js +5 -6
  227. package/dist/components/Employee/FederalTaxes/Actions.js.map +1 -1
  228. package/dist/components/Employee/FederalTaxes/FederalForm.js +11 -12
  229. package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
  230. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +3 -4
  231. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
  232. package/dist/components/Employee/Landing/Landing.js +49 -45
  233. package/dist/components/Employee/Landing/Landing.js.map +1 -1
  234. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +7 -7
  235. package/dist/components/Employee/PaymentMethod/Actions.js +5 -6
  236. package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
  237. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +4 -5
  238. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
  239. package/dist/components/Employee/PaymentMethod/BankAccountsList.js +2 -3
  240. package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
  241. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +6 -7
  242. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
  243. package/dist/components/Employee/PaymentMethod/Split.js +10 -11
  244. package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
  245. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +5 -6
  246. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
  247. package/dist/components/Employee/Profile/Actions.js +5 -6
  248. package/dist/components/Employee/Profile/Actions.js.map +1 -1
  249. package/dist/components/Employee/Profile/AdminPersonalDetails.js +8 -9
  250. package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
  251. package/dist/components/Employee/Profile/HomeAddress.js +1 -1
  252. package/dist/components/Employee/Profile/PersonalDetailsInputs.js +2 -2
  253. package/dist/components/Employee/Profile/useProfile.js +3 -4
  254. package/dist/components/Employee/Profile/useProfile.js.map +1 -1
  255. package/dist/components/Employee/StateTaxes/Actions.js +5 -6
  256. package/dist/components/Employee/StateTaxes/Actions.js.map +1 -1
  257. package/dist/components/Employee/StateTaxes/useStateTaxes.js +3 -4
  258. package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
  259. package/dist/components/Employee/Taxes/Actions.js +6 -7
  260. package/dist/components/Employee/Taxes/Actions.js.map +1 -1
  261. package/dist/components/Employee/Taxes/FederalForm.js +13 -14
  262. package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
  263. package/dist/components/Employee/Taxes/useTaxes.js +3 -4
  264. package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
  265. package/dist/components/Employee/index.js +22 -22
  266. package/dist/components/Flow/Flow.js +7 -9
  267. package/dist/components/Flow/Flow.js.map +1 -1
  268. package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js +16 -17
  269. package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -1
  270. package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.d.ts +0 -1
  271. package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js +36 -43
  272. package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js.map +1 -1
  273. package/dist/components/InformationRequests/InformationRequests.d.ts +1 -2
  274. package/dist/components/InformationRequests/InformationRequests.js +37 -46
  275. package/dist/components/InformationRequests/InformationRequests.js.map +1 -1
  276. package/dist/components/InformationRequests/index.js +4 -4
  277. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +9 -10
  278. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js.map +1 -1
  279. package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js +23 -21
  280. package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js.map +1 -1
  281. package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.d.ts +2 -0
  282. package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js +70 -0
  283. package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js.map +1 -0
  284. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.d.ts +2 -0
  285. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js +25 -0
  286. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js.map +1 -0
  287. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationTypes.d.ts +13 -0
  288. package/dist/components/Payroll/OffCycleCreation/index.d.ts +3 -0
  289. package/dist/components/Payroll/OffCycleDeductionsSetting/OffCycleDeductionsSetting.d.ts +2 -0
  290. package/dist/components/Payroll/OffCycleDeductionsSetting/OffCycleDeductionsSetting.js +50 -0
  291. package/dist/components/Payroll/OffCycleDeductionsSetting/OffCycleDeductionsSetting.js.map +1 -0
  292. package/dist/components/Payroll/OffCycleDeductionsSetting/index.d.ts +3 -0
  293. package/dist/components/Payroll/OffCycleDeductionsSetting/types.d.ts +11 -0
  294. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.d.ts +1 -2
  295. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js +36 -0
  296. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js.map +1 -0
  297. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.module.scss.js +12 -0
  298. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.module.scss.js.map +1 -0
  299. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.d.ts +0 -4
  300. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.js +48 -0
  301. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.js.map +1 -0
  302. package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.js +18 -0
  303. package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.js.map +1 -0
  304. package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelection.js +26 -27
  305. package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelection.js.map +1 -1
  306. package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.d.ts +3 -3
  307. package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js +18 -18
  308. package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js.map +1 -1
  309. package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.d.ts +2 -0
  310. package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModalTypes.d.ts +8 -0
  311. package/dist/components/Payroll/OffCycleTaxWithholdingModal/index.d.ts +3 -0
  312. package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTable.d.ts +2 -0
  313. package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes.d.ts +17 -0
  314. package/dist/components/Payroll/OffCycleTaxWithholdingTable/index.d.ts +3 -0
  315. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.d.ts +3 -8
  316. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +38 -39
  317. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
  318. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +25 -33
  319. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js.map +1 -1
  320. package/dist/components/Payroll/PayrollBlocker/payrollHelpers.d.ts +1 -0
  321. package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js +22 -19
  322. package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js.map +1 -1
  323. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +26 -26
  324. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
  325. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +36 -36
  326. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +19 -21
  327. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
  328. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +15 -17
  329. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
  330. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js +32 -32
  331. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js.map +1 -1
  332. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +18 -20
  333. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
  334. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +2 -3
  335. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
  336. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +1 -1
  337. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js +2 -4
  338. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js.map +1 -1
  339. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +3 -4
  340. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
  341. package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js +3 -4
  342. package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js.map +1 -1
  343. package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js +11 -12
  344. package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js.map +1 -1
  345. package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js +3 -5
  346. package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js.map +1 -1
  347. package/dist/components/Payroll/index.d.ts +4 -0
  348. package/dist/components/Payroll/index.js +22 -18
  349. package/dist/components/Payroll/index.js.map +1 -1
  350. package/dist/components/Payroll/usePreparedPayrollData.js +2 -3
  351. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  352. package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js +48 -46
  353. package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js.map +1 -1
  354. package/dist/contexts/ComponentAdapter/componentAdapterTypes.d.ts +1 -0
  355. package/dist/contexts/ComponentAdapter/useComponentContext.d.ts +2 -0
  356. package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
  357. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +2 -3
  358. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  359. package/dist/contexts/ThemeProvider/theme.d.ts +1 -0
  360. package/dist/contexts/ThemeProvider/theme.js +1 -0
  361. package/dist/contexts/ThemeProvider/theme.js.map +1 -1
  362. package/dist/helpers/dateFormatting.js +61 -45
  363. package/dist/helpers/dateFormatting.js.map +1 -1
  364. package/dist/hooks/useOverflowDetection/useOverflowDetection.js +5 -6
  365. package/dist/i18n/I18n.js +7 -7
  366. package/dist/i18n/I18n.js.map +1 -1
  367. package/dist/i18n/en/Employee.EmployeeDocuments.json.js +1 -1
  368. package/dist/i18n/en/Employee.I9SignatureForm.json.js +83 -65
  369. package/dist/i18n/en/Employee.I9SignatureForm.json.js.map +1 -1
  370. package/dist/i18n/en/Employee.Landing.json.js +7 -9
  371. package/dist/i18n/en/Employee.Landing.json.js.map +1 -1
  372. package/dist/i18n/en/Payroll.OffCycleCreation.json.js +14 -0
  373. package/dist/i18n/en/Payroll.OffCycleCreation.json.js.map +1 -0
  374. package/dist/i18n/en/Payroll.OffCycleDeductionsSetting.json.js +12 -0
  375. package/dist/i18n/en/Payroll.OffCycleDeductionsSetting.json.js.map +1 -0
  376. package/dist/i18n/en/Payroll.OffCycleTaxWithholding.json.js +18 -0
  377. package/dist/i18n/en/Payroll.OffCycleTaxWithholding.json.js.map +1 -0
  378. package/dist/i18n/en/Payroll.PayrollBlocker.json.js +21 -19
  379. package/dist/i18n/en/Payroll.PayrollBlocker.json.js.map +1 -1
  380. package/dist/shared/constants.d.ts +4 -0
  381. package/dist/shared/constants.js +6 -4
  382. package/dist/shared/constants.js.map +1 -1
  383. package/dist/style.css +1 -1
  384. package/dist/types/i18next.d.ts +72 -2
  385. package/package.json +19 -7
  386. package/dist/components/Employee/Landing/Landing.module.scss.js +0 -8
  387. package/dist/components/Employee/Landing/Landing.module.scss.js.map +0 -1
@@ -7,15 +7,14 @@ import "@gusto/embedded-api/models/errors/sdkvalidationerror";
7
7
  import "@tanstack/react-query";
8
8
  import "../../../Base/useBase.js";
9
9
  import "../../../../shared/constants.js";
10
- import "classnames";
11
10
  import "../../../../contexts/ComponentAdapter/useComponentContext.js";
12
11
  import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
13
12
  import "dompurify";
14
13
  import "../../../../contexts/LocaleProvider/useLocale.js";
15
14
  import { createCompoundContext as t } from "../../../Base/createCompoundContext.js";
16
- const [a, f] = t("DocumentListContext");
15
+ const [d, a] = t("DocumentListContext");
17
16
  export {
18
- f as DocumentListProvider,
19
- a as useDocumentList
17
+ a as DocumentListProvider,
18
+ d as useDocumentList
20
19
  };
21
20
  //# sourceMappingURL=useDocumentList.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useDocumentList.js","sources":["../../../../../src/components/Employee/DocumentSigner/DocumentList/useDocumentList.ts"],"sourcesContent":["import type { Form } from '@gusto/embedded-api/models/components/form'\nimport { createCompoundContext } from '@/components/Base'\n\ntype DocumentListContextType = {\n employeeForms: Form[]\n handleContinue: () => void\n handleRequestFormToSign: (form: Form) => void\n documentListError: Error | null\n formToSign?: Form\n}\n\nconst [useDocumentList, DocumentListProvider] =\n createCompoundContext<DocumentListContextType>('DocumentListContext')\nexport { useDocumentList, DocumentListProvider }\n"],"names":["useDocumentList","DocumentListProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;AAWA,MAAM,CAACA,GAAiBC,CAAoB,IAC1CC,EAA+C,qBAAqB;"}
1
+ {"version":3,"file":"useDocumentList.js","sources":["../../../../../src/components/Employee/DocumentSigner/DocumentList/useDocumentList.ts"],"sourcesContent":["import type { Form } from '@gusto/embedded-api/models/components/form'\nimport { createCompoundContext } from '@/components/Base'\n\ntype DocumentListContextType = {\n employeeForms: Form[]\n handleContinue: () => void\n handleRequestFormToSign: (form: Form) => void\n documentListError: Error | null\n formToSign?: Form\n}\n\nconst [useDocumentList, DocumentListProvider] =\n createCompoundContext<DocumentListContextType>('DocumentListContext')\nexport { useDocumentList, DocumentListProvider }\n"],"names":["useDocumentList","DocumentListProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;AAWA,MAAM,CAACA,GAAiBC,CAAoB,IAC1CC,EAA+C,qBAAqB;"}
@@ -1,48 +1,36 @@
1
- import { jsx as i } from "react/jsx-runtime";
2
- import { createMachine as d } from "robot3";
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ import { createMachine as f } from "robot3";
3
3
  import { useMemo as l } from "react";
4
- import { useIsMutating as b } from "@tanstack/react-query";
5
- import { APIError as D } from "@gusto/embedded-api/models/errors/apierror";
6
- import { useI9VerificationGetAuthorization as y } from "@gusto/embedded-api/react-query/i9VerificationGetAuthorization";
7
- import { mutationKeyI9VerificationUpdate as L } from "@gusto/embedded-api/react-query/i9VerificationUpdate";
8
- import { useEmployeesGet as S } from "@gusto/embedded-api/react-query/employeesGet";
9
- import { EmploymentEligibilityContextual as h, DocumentListContextual as x } from "./documentSignerStateMachine.js";
10
- import { documentSignerMachine as A } from "./stateMachine.js";
11
- import { Flow as C } from "../../Flow/Flow.js";
12
- import { BaseComponent as M } from "../../Base/Base.js";
13
- import { useBase as E } from "../../Base/useBase.js";
14
- import { useComponentDictionary as z } from "../../../i18n/I18n.js";
15
- function N(o) {
16
- return /* @__PURE__ */ i(M, { ...o, children: /* @__PURE__ */ i(B, { ...o }) });
4
+ import { useEmployeesGetSuspense as g } from "@gusto/embedded-api/react-query/employeesGet";
5
+ import { useEmployeeFormsListSuspense as D } from "@gusto/embedded-api/react-query/employeeFormsList";
6
+ import { EmploymentEligibilityContextual as d, DocumentListContextual as y } from "./documentSignerStateMachine.js";
7
+ import { documentSignerMachine as E } from "./stateMachine.js";
8
+ import { Flow as S } from "../../Flow/Flow.js";
9
+ import { BaseComponent as x } from "../../Base/Base.js";
10
+ import "../../Base/useBase.js";
11
+ import { useComponentDictionary as C } from "../../../i18n/I18n.js";
12
+ import { I9_FORM_NAME as F } from "../../../shared/constants.js";
13
+ function O(o) {
14
+ return /* @__PURE__ */ n(x, { ...o, children: /* @__PURE__ */ n(M, { ...o }) });
17
15
  }
18
- function B({ employeeId: o, onEvent: m, dictionary: a, withEmployeeI9: t = !1 }) {
19
- z("Employee.DocumentSigner", a);
20
- const { LoadingIndicator: s } = E(), { data: u, isLoading: c } = S(
21
- { employeeId: o },
22
- { enabled: t }
23
- ), r = u?.employee?.onboardingDocumentsConfig?.i9Document === !0, { data: f, isLoading: p } = y(
24
- { employeeId: o },
25
- {
26
- enabled: t && r,
27
- retry: !1,
28
- throwOnError: (n) => !(n instanceof D && n.httpMeta.response.status === 404)
29
- }
30
- ), e = t && r && !f?.i9Authorization?.employeeSigned, g = l(
31
- () => d(
32
- e ? "employmentEligibility" : "index",
33
- A,
34
- (n) => ({
35
- ...n,
36
- component: e ? h : x,
16
+ function M({ employeeId: o, onEvent: i, dictionary: s, withEmployeeI9: t = !1 }) {
17
+ C("Employee.DocumentSigner", s);
18
+ const { data: a } = g({ employeeId: o }), { data: c } = D({ employeeId: o }), u = a.employee?.onboardingDocumentsConfig?.i9Document === !0, m = c.formList?.find((e) => e.name === F), r = t && u && (!m || m.requiresSigning === !0), p = l(
19
+ () => f(
20
+ r ? "employmentEligibility" : "index",
21
+ E,
22
+ (e) => ({
23
+ ...e,
24
+ component: r ? d : y,
37
25
  employeeId: o,
38
26
  withEmployeeI9: t
39
27
  })
40
28
  ),
41
- [o, e, t]
29
+ [o, t]
42
30
  );
43
- return !(b({ mutationKey: L() }) > 0) && t && (c || p) ? /* @__PURE__ */ i(s, {}) : /* @__PURE__ */ i(C, { machine: g, onEvent: m });
31
+ return /* @__PURE__ */ n(S, { machine: p, onEvent: i });
44
32
  }
45
33
  export {
46
- N as DocumentSigner
34
+ O as DocumentSigner
47
35
  };
48
36
  //# sourceMappingURL=DocumentSigner.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DocumentSigner.js","sources":["../../../../src/components/Employee/DocumentSigner/DocumentSigner.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMemo } from 'react'\nimport { useIsMutating } from '@tanstack/react-query'\nimport { APIError } from '@gusto/embedded-api/models/errors/apierror'\nimport { useI9VerificationGetAuthorization } from '@gusto/embedded-api/react-query/i9VerificationGetAuthorization'\nimport { mutationKeyI9VerificationUpdate } from '@gusto/embedded-api/react-query/i9VerificationUpdate'\nimport { useEmployeesGet } from '@gusto/embedded-api/react-query/employeesGet'\nimport {\n DocumentListContextual,\n EmploymentEligibilityContextual,\n type DocumentSignerContextInterface,\n} from './documentSignerStateMachine'\nimport { documentSignerMachine } from './stateMachine'\nimport { Flow } from '@/components/Flow/Flow'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { useBase } from '@/components/Base'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\nexport interface DocumentSignerProps extends BaseComponentInterface<'Employee.DocumentSigner'> {\n employeeId: string\n withEmployeeI9?: boolean\n}\n\nexport function DocumentSigner(props: DocumentSignerProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nfunction Root({ employeeId, onEvent, dictionary, withEmployeeI9 = false }: DocumentSignerProps) {\n useComponentDictionary('Employee.DocumentSigner', dictionary)\n const { LoadingIndicator } = useBase()\n\n const { data: employeeData, isLoading: employeeLoading } = useEmployeesGet(\n { employeeId },\n { enabled: withEmployeeI9 },\n )\n\n const employeeHasI9Enabled =\n employeeData?.employee?.onboardingDocumentsConfig?.i9Document === true\n\n const { data: i9AuthData, isLoading: i9AuthLoading } = useI9VerificationGetAuthorization(\n { employeeId },\n {\n enabled: withEmployeeI9 && employeeHasI9Enabled,\n retry: false,\n throwOnError: (error: Error) => {\n return !(error instanceof APIError && error.httpMeta.response.status === 404)\n },\n },\n )\n\n const needsI9Form =\n withEmployeeI9 && employeeHasI9Enabled && !i9AuthData?.i9Authorization?.employeeSigned\n\n const machine = useMemo(\n () =>\n createMachine(\n needsI9Form ? 'employmentEligibility' : 'index',\n documentSignerMachine,\n (initialContext: DocumentSignerContextInterface) => ({\n ...initialContext,\n component: needsI9Form ? EmploymentEligibilityContextual : DocumentListContextual,\n employeeId,\n withEmployeeI9,\n }),\n ),\n [employeeId, needsI9Form, withEmployeeI9],\n )\n\n const isSubmittingI9 = useIsMutating({ mutationKey: mutationKeyI9VerificationUpdate() }) > 0\n\n if (!isSubmittingI9 && withEmployeeI9 && (employeeLoading || i9AuthLoading)) {\n return <LoadingIndicator />\n }\n\n return <Flow machine={machine} onEvent={onEvent} />\n}\n"],"names":["DocumentSigner","props","jsx","BaseComponent","Root","employeeId","onEvent","dictionary","withEmployeeI9","useComponentDictionary","LoadingIndicator","useBase","employeeData","employeeLoading","useEmployeesGet","employeeHasI9Enabled","i9AuthData","i9AuthLoading","useI9VerificationGetAuthorization","error","APIError","needsI9Form","machine","useMemo","createMachine","documentSignerMachine","initialContext","EmploymentEligibilityContextual","DocumentListContextual","useIsMutating","mutationKeyI9VerificationUpdate","Flow"],"mappings":";;;;;;;;;;;;;;AAuBO,SAASA,EAAeC,GAA4B;AACzD,SACE,gBAAAC,EAACC,KAAe,GAAGF,GACjB,4BAACG,GAAA,EAAM,GAAGH,GAAO,EAAA,CACnB;AAEJ;AAEA,SAASG,EAAK,EAAE,YAAAC,GAAY,SAAAC,GAAS,YAAAC,GAAY,gBAAAC,IAAiB,MAA8B;AAC9F,EAAAC,EAAuB,2BAA2BF,CAAU;AAC5D,QAAM,EAAE,kBAAAG,EAAA,IAAqBC,EAAA,GAEvB,EAAE,MAAMC,GAAc,WAAWC,MAAoBC;AAAA,IACzD,EAAE,YAAAT,EAAA;AAAA,IACF,EAAE,SAASG,EAAA;AAAA,EAAe,GAGtBO,IACJH,GAAc,UAAU,2BAA2B,eAAe,IAE9D,EAAE,MAAMI,GAAY,WAAWC,MAAkBC;AAAA,IACrD,EAAE,YAAAb,EAAA;AAAA,IACF;AAAA,MACE,SAASG,KAAkBO;AAAA,MAC3B,OAAO;AAAA,MACP,cAAc,CAACI,MACN,EAAEA,aAAiBC,KAAYD,EAAM,SAAS,SAAS,WAAW;AAAA,IAC3E;AAAA,EACF,GAGIE,IACJb,KAAkBO,KAAwB,CAACC,GAAY,iBAAiB,gBAEpEM,IAAUC;AAAA,IACd,MACEC;AAAA,MACEH,IAAc,0BAA0B;AAAA,MACxCI;AAAA,MACA,CAACC,OAAoD;AAAA,QACnD,GAAGA;AAAA,QACH,WAAWL,IAAcM,IAAkCC;AAAA,QAC3D,YAAAvB;AAAA,QACA,gBAAAG;AAAA,MAAA;AAAA,IACF;AAAA,IAEJ,CAACH,GAAYgB,GAAab,CAAc;AAAA,EAAA;AAK1C,SAAI,EAFmBqB,EAAc,EAAE,aAAaC,EAAA,EAAgC,CAAG,IAAI,MAEpEtB,MAAmBK,KAAmBI,uBACnDP,GAAA,EAAiB,IAGpB,gBAAAR,EAAC6B,GAAA,EAAK,SAAAT,GAAkB,SAAAhB,EAAA,CAAkB;AACnD;"}
1
+ {"version":3,"file":"DocumentSigner.js","sources":["../../../../src/components/Employee/DocumentSigner/DocumentSigner.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMemo } from 'react'\nimport { useEmployeesGetSuspense } from '@gusto/embedded-api/react-query/employeesGet'\nimport { useEmployeeFormsListSuspense } from '@gusto/embedded-api/react-query/employeeFormsList'\nimport {\n DocumentListContextual,\n EmploymentEligibilityContextual,\n type DocumentSignerContextInterface,\n} from './documentSignerStateMachine'\nimport { documentSignerMachine } from './stateMachine'\nimport { Flow } from '@/components/Flow/Flow'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentDictionary } from '@/i18n/I18n'\nimport { I9_FORM_NAME } from '@/shared/constants'\n\nexport interface DocumentSignerProps extends BaseComponentInterface<'Employee.DocumentSigner'> {\n employeeId: string\n withEmployeeI9?: boolean\n}\n\nexport function DocumentSigner(props: DocumentSignerProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nfunction Root({ employeeId, onEvent, dictionary, withEmployeeI9 = false }: DocumentSignerProps) {\n useComponentDictionary('Employee.DocumentSigner', dictionary)\n\n const { data: employeeData } = useEmployeesGetSuspense({ employeeId })\n const { data: formsData } = useEmployeeFormsListSuspense({ employeeId })\n\n const employeeHasI9Enabled = employeeData.employee?.onboardingDocumentsConfig?.i9Document === true\n\n const i9Form = formsData.formList?.find(form => form.name === I9_FORM_NAME)\n const needsI9Form =\n withEmployeeI9 && employeeHasI9Enabled && (!i9Form || i9Form.requiresSigning === true)\n\n const machine = useMemo(\n () =>\n createMachine(\n needsI9Form ? 'employmentEligibility' : 'index',\n documentSignerMachine,\n (initialContext: DocumentSignerContextInterface) => ({\n ...initialContext,\n component: needsI9Form ? EmploymentEligibilityContextual : DocumentListContextual,\n employeeId,\n withEmployeeI9,\n }),\n ),\n [employeeId, withEmployeeI9],\n )\n\n return <Flow machine={machine} onEvent={onEvent} />\n}\n"],"names":["DocumentSigner","props","jsx","BaseComponent","Root","employeeId","onEvent","dictionary","withEmployeeI9","useComponentDictionary","employeeData","useEmployeesGetSuspense","formsData","useEmployeeFormsListSuspense","employeeHasI9Enabled","i9Form","form","I9_FORM_NAME","needsI9Form","machine","useMemo","createMachine","documentSignerMachine","initialContext","EmploymentEligibilityContextual","DocumentListContextual","Flow"],"mappings":";;;;;;;;;;;;AAoBO,SAASA,EAAeC,GAA4B;AACzD,SACE,gBAAAC,EAACC,KAAe,GAAGF,GACjB,4BAACG,GAAA,EAAM,GAAGH,GAAO,EAAA,CACnB;AAEJ;AAEA,SAASG,EAAK,EAAE,YAAAC,GAAY,SAAAC,GAAS,YAAAC,GAAY,gBAAAC,IAAiB,MAA8B;AAC9F,EAAAC,EAAuB,2BAA2BF,CAAU;AAE5D,QAAM,EAAE,MAAMG,EAAA,IAAiBC,EAAwB,EAAE,YAAAN,GAAY,GAC/D,EAAE,MAAMO,EAAA,IAAcC,EAA6B,EAAE,YAAAR,GAAY,GAEjES,IAAuBJ,EAAa,UAAU,2BAA2B,eAAe,IAExFK,IAASH,EAAU,UAAU,KAAK,CAAAI,MAAQA,EAAK,SAASC,CAAY,GACpEC,IACJV,KAAkBM,MAAyB,CAACC,KAAUA,EAAO,oBAAoB,KAE7EI,IAAUC;AAAA,IACd,MACEC;AAAA,MACEH,IAAc,0BAA0B;AAAA,MACxCI;AAAA,MACA,CAACC,OAAoD;AAAA,QACnD,GAAGA;AAAA,QACH,WAAWL,IAAcM,IAAkCC;AAAA,QAC3D,YAAApB;AAAA,QACA,gBAAAG;AAAA,MAAA;AAAA,IACF;AAAA,IAEJ,CAACH,GAAYG,CAAc;AAAA,EAAA;AAG7B,SAAO,gBAAAN,EAACwB,GAAA,EAAK,SAAAP,GAAkB,SAAAb,EAAA,CAAkB;AACnD;"}
@@ -1,52 +1,53 @@
1
1
  import { jsx as t, jsxs as p } from "react/jsx-runtime";
2
- import { useState as v } from "react";
3
- import { useTranslation as I, Trans as A } from "react-i18next";
2
+ import { useState as I } from "react";
3
+ import { useTranslation as L, Trans as A } from "react-i18next";
4
4
  import { useForm as O, useWatch as d, FormProvider as $ } from "react-hook-form";
5
5
  import { zodResolver as j } from "@hookform/resolvers/zod";
6
6
  import { AuthorizationStatus as q, I9AuthorizationDocumentType as w } from "@gusto/embedded-api/models/components/i9authorization";
7
- import { generateEmploymentEligibilitySchema as L } from "./EmploymentEligibilitySchema.js";
8
- import { COUNTRIES as k } from "./countries.js";
7
+ import { generateEmploymentEligibilitySchema as k } from "./EmploymentEligibilitySchema.js";
8
+ import { COUNTRIES as P } from "./countries.js";
9
9
  import { Flex as b } from "../../../Common/Flex/Flex.js";
10
- import "classnames";
11
- import "../../../../shared/constants.js";
12
- import { RadioGroupField as P } from "../../../Common/Fields/RadioGroupField/RadioGroupField.js";
13
- import { TextInputField as V } from "../../../Common/Fields/TextInputField/TextInputField.js";
14
- import { ActionsLayout as B } from "../../../Common/ActionsLayout/ActionsLayout.js";
15
- import { DatePickerField as H } from "../../../Common/Fields/DatePickerField/DatePickerField.js";
16
- import { useComponentContext as K } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
17
- import { ComboBoxField as G } from "../../../Common/Fields/ComboBoxField/ComboBoxField.js";
18
- import { Form as M } from "../../../Common/Form/Form.js";
19
- import { useI18n as U } from "../../../../i18n/I18n.js";
20
- import { SelectField as W } from "../../../Common/Fields/SelectField/SelectField.js";
21
- const J = {
10
+ import { ActionsLayout as V } from "../../../Common/ActionsLayout/ActionsLayout.js";
11
+ import { useComponentContext as B } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
12
+ import { ComboBoxField as H } from "../../../Common/Fields/ComboBoxField/ComboBoxField.js";
13
+ import { Form as K } from "../../../Common/Form/Form.js";
14
+ import { useI18n as M } from "../../../../i18n/I18n.js";
15
+ import { SelectField as G } from "../../../Common/Fields/SelectField/SelectField.js";
16
+ import { RadioGroupField as U } from "../../../Common/Fields/RadioGroupField/RadioGroupField.js";
17
+ import { TextInputField as W } from "../../../Common/Fields/TextInputField/TextInputField.js";
18
+ import { DatePickerField as J } from "../../../Common/Fields/DatePickerField/DatePickerField.js";
19
+ const Q = {
22
20
  citizen: "statusDescriptions.citizen",
23
21
  permanent_resident: "statusDescriptions.permanent_resident",
24
22
  noncitizen: "statusDescriptions.noncitizen",
25
23
  alien: "statusDescriptions.alien"
26
- }, fe = ({
24
+ }, he = ({
27
25
  onSubmit: h,
28
26
  defaultValues: f,
29
27
  hasDocumentNumber: y,
30
- isPending: D
28
+ isPending: g
31
29
  }) => {
32
- U("Employee.EmploymentEligibility");
33
- const { Heading: g, Text: x, Alert: z, Button: E, Link: N } = K(), { t: e } = I("Employee.EmploymentEligibility"), [m, a] = v(!!y), r = O({
34
- resolver: j(L(m)),
30
+ M("Employee.EmploymentEligibility");
31
+ const { Heading: D, Text: x, Alert: z, Button: E, Link: N } = B(), { t: e } = L("Employee.EmploymentEligibility"), [a, m] = I(!!y), r = O({
32
+ resolver: j(k(a)),
35
33
  defaultValues: f
36
- }), { control: l, setValue: u, clearErrors: c } = r, o = d({ control: l, name: "authorizationStatus" }), s = d({ control: l, name: "documentType" }), S = Object.values(q).map((n) => ({
34
+ }), { control: l, setValue: u, clearErrors: c } = r, o = d({ control: l, name: "authorizationStatus" }), s = d({ control: l, name: "documentType" }), _ = Object.values(q).map((n) => ({
37
35
  value: n,
38
36
  label: e(`select.options.${n}`)
39
- })), T = Object.values(w).map((n) => ({
37
+ })), S = Object.values(w).map((n) => ({
40
38
  value: n,
41
39
  label: e(`authorizationDocument.options.${n}`)
42
- })), C = () => {
43
- u("documentNumber", ""), c("documentNumber"), a(!1);
44
- }, F = () => {
45
- u("documentNumber", ""), c("documentNumber"), a(!1);
46
- }, _ = o === "alien", R = o === "permanent_resident" || o === "alien" && !!s, i = o === "permanent_resident" ? "uscis_alien_registration_number" : s;
47
- return /* @__PURE__ */ t($, { ...r, children: /* @__PURE__ */ t(M, { onSubmit: r.handleSubmit(h), children: /* @__PURE__ */ p(b, { flexDirection: "column", gap: 16, children: [
40
+ })), T = () => {
41
+ u("documentNumber", ""), c("documentNumber"), m(!1);
42
+ }, C = () => {
43
+ u("documentNumber", ""), c("documentNumber"), m(!1);
44
+ }, F = o === "alien", R = o === "permanent_resident" || o === "alien" && !!s, i = o === "permanent_resident" ? "uscis_alien_registration_number" : s, v = {
45
+ uscis_alien_registration_number: 9,
46
+ form_i94: 11
47
+ };
48
+ return /* @__PURE__ */ t($, { ...r, children: /* @__PURE__ */ t(K, { onSubmit: r.handleSubmit(h), children: /* @__PURE__ */ p(b, { flexDirection: "column", gap: 16, children: [
48
49
  /* @__PURE__ */ p(b, { flexDirection: "column", gap: 2, children: [
49
- /* @__PURE__ */ t(g, { as: "h2", children: e("title") }),
50
+ /* @__PURE__ */ t(D, { as: "h2", children: e("title") }),
50
51
  /* @__PURE__ */ t(x, { variant: "supporting", children: /* @__PURE__ */ t(
51
52
  A,
52
53
  {
@@ -59,62 +60,63 @@ const J = {
59
60
  ) })
60
61
  ] }),
61
62
  /* @__PURE__ */ t(
62
- W,
63
+ G,
63
64
  {
64
65
  name: "authorizationStatus",
65
66
  label: e("select.label"),
66
67
  description: e("select.description"),
67
68
  placeholder: e("select.placeholder"),
68
- options: S,
69
+ options: _,
69
70
  isRequired: !0,
70
- onChange: C
71
+ onChange: T
71
72
  }
72
73
  ),
73
74
  o && /* @__PURE__ */ t(
74
75
  z,
75
76
  {
76
77
  status: "info",
77
- label: e(J[o]),
78
+ label: e(Q[o]),
78
79
  disableScrollIntoView: !0
79
80
  }
80
81
  ),
81
- o === "alien" && /* @__PURE__ */ t(H, { name: "expirationDate", label: e("expirationDate.label") }),
82
- _ && /* @__PURE__ */ t(
83
- P,
82
+ o === "alien" && /* @__PURE__ */ t(J, { name: "expirationDate", label: e("expirationDate.label") }),
83
+ F && /* @__PURE__ */ t(
84
+ U,
84
85
  {
85
86
  name: "documentType",
86
87
  label: e("authorizationDocument.label"),
87
- options: T,
88
+ options: S,
88
89
  isRequired: !0,
89
- onChange: F
90
+ onChange: C
90
91
  }
91
92
  ),
92
93
  R && i && /* @__PURE__ */ t(
93
- V,
94
+ W,
94
95
  {
95
96
  name: "documentNumber",
96
97
  label: e(`documentNumber.${i}.label`),
97
98
  description: i !== "foreign_passport" ? e(`documentNumber.${i}.description`) : void 0,
98
- placeholder: m ? e(`documentNumber.${i}.placeholder`) : void 0,
99
+ placeholder: a ? e(`documentNumber.${i}.placeholder`) : void 0,
100
+ maxLength: v[i],
99
101
  isRequired: !0
100
102
  }
101
103
  ),
102
104
  s === "foreign_passport" && o === "alien" && /* @__PURE__ */ t(
103
- G,
105
+ H,
104
106
  {
105
107
  name: "country",
106
108
  label: e("country.label"),
107
109
  description: e("country.description"),
108
- options: k,
110
+ options: P,
109
111
  placeholder: e("country.placeholder"),
110
112
  allowsCustomValue: !0,
111
113
  isRequired: !0
112
114
  }
113
115
  ),
114
- /* @__PURE__ */ t(B, { children: /* @__PURE__ */ t(E, { type: "submit", isLoading: D, children: e("submit") }) })
116
+ /* @__PURE__ */ t(V, { children: /* @__PURE__ */ t(E, { type: "submit", isLoading: g, children: e("submit") }) })
115
117
  ] }) }) });
116
118
  };
117
119
  export {
118
- fe as EmploymentEligibilityPresentation
120
+ he as EmploymentEligibilityPresentation
119
121
  };
120
122
  //# sourceMappingURL=EmploymentEligibilityPresentation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"EmploymentEligibilityPresentation.js","sources":["../../../../../src/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.tsx"],"sourcesContent":["import { useState } from 'react'\nimport { useTranslation, Trans } from 'react-i18next'\nimport { FormProvider, useForm, useWatch, type SubmitHandler } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport {\n AuthorizationStatus,\n I9AuthorizationDocumentType,\n} from '@gusto/embedded-api/models/components/i9authorization'\nimport {\n generateEmploymentEligibilitySchema,\n type EmploymentEligibilityInputs,\n type EmploymentEligibilityPayload,\n} from './EmploymentEligibilitySchema'\nimport { COUNTRIES } from './countries'\nimport {\n Flex,\n SelectField,\n RadioGroupField,\n TextInputField,\n DatePickerField,\n ActionsLayout,\n} from '@/components/Common'\nimport { ComboBoxField } from '@/components/Common/Fields/ComboBoxField/ComboBoxField'\nimport { Form } from '@/components/Common/Form'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\n\ninterface EmploymentEligibilityPresentationProps {\n onSubmit: SubmitHandler<EmploymentEligibilityPayload>\n defaultValues?: Partial<EmploymentEligibilityInputs>\n hasDocumentNumber?: boolean | null\n isPending?: boolean\n}\n\nconst statusDescriptionKeys = {\n citizen: 'statusDescriptions.citizen',\n permanent_resident: 'statusDescriptions.permanent_resident',\n noncitizen: 'statusDescriptions.noncitizen',\n alien: 'statusDescriptions.alien',\n} as const satisfies Record<AuthorizationStatus, string>\n\nexport const EmploymentEligibilityPresentation = ({\n onSubmit,\n defaultValues,\n hasDocumentNumber,\n isPending,\n}: EmploymentEligibilityPresentationProps) => {\n useI18n('Employee.EmploymentEligibility')\n const { Heading, Text, Alert, Button, Link } = useComponentContext()\n const { t } = useTranslation('Employee.EmploymentEligibility')\n\n const [hasExistingDocumentNumber, setHasExistingDocumentNumber] = useState(!!hasDocumentNumber)\n\n const formMethods = useForm<EmploymentEligibilityInputs, unknown, EmploymentEligibilityPayload>({\n resolver: zodResolver(generateEmploymentEligibilitySchema(hasExistingDocumentNumber)),\n defaultValues,\n })\n\n const { control, setValue, clearErrors } = formMethods\n const authorizationStatus = useWatch({ control, name: 'authorizationStatus' })\n const documentType = useWatch({ control, name: 'documentType' })\n\n const statusOptions = Object.values(AuthorizationStatus).map(value => ({\n value,\n label: t(`select.options.${value}`),\n }))\n\n const authorizationDocumentOptions = Object.values(I9AuthorizationDocumentType).map(value => ({\n value,\n label: t(`authorizationDocument.options.${value}`),\n }))\n\n const handleAuthorizationStatusChange = () => {\n setValue('documentNumber', '')\n clearErrors('documentNumber')\n setHasExistingDocumentNumber(false)\n }\n\n const handleDocumentTypeChange = () => {\n setValue('documentNumber', '')\n clearErrors('documentNumber')\n setHasExistingDocumentNumber(false)\n }\n\n const showDocumentTypeRadio = authorizationStatus === 'alien'\n const showDocumentNumberInput =\n authorizationStatus === 'permanent_resident' ||\n (authorizationStatus === 'alien' && !!documentType)\n const activeDocumentType =\n authorizationStatus === 'permanent_resident' ? 'uscis_alien_registration_number' : documentType\n\n return (\n <FormProvider {...formMethods}>\n <Form onSubmit={formMethods.handleSubmit(onSubmit)}>\n <Flex flexDirection=\"column\" gap={16}>\n <Flex flexDirection=\"column\" gap={2}>\n <Heading as=\"h2\">{t('title')}</Heading>\n <Text variant=\"supporting\">\n <Trans\n i18nKey={'subtitle'}\n t={t}\n components={{\n formI9Link: <Link />,\n }}\n />\n </Text>\n </Flex>\n\n <SelectField\n name=\"authorizationStatus\"\n label={t('select.label')}\n description={t('select.description')}\n placeholder={t('select.placeholder')}\n options={statusOptions}\n isRequired\n onChange={handleAuthorizationStatusChange}\n />\n\n {authorizationStatus && (\n <Alert\n status=\"info\"\n label={t(statusDescriptionKeys[authorizationStatus])}\n disableScrollIntoView\n />\n )}\n\n {authorizationStatus === 'alien' && (\n <DatePickerField name=\"expirationDate\" label={t('expirationDate.label')} />\n )}\n\n {showDocumentTypeRadio && (\n <RadioGroupField\n name=\"documentType\"\n label={t('authorizationDocument.label')}\n options={authorizationDocumentOptions}\n isRequired\n onChange={handleDocumentTypeChange}\n />\n )}\n\n {showDocumentNumberInput && activeDocumentType && (\n <TextInputField\n name=\"documentNumber\"\n label={t(`documentNumber.${activeDocumentType}.label`)}\n description={\n activeDocumentType !== 'foreign_passport'\n ? t(`documentNumber.${activeDocumentType}.description`)\n : undefined\n }\n placeholder={\n hasExistingDocumentNumber\n ? t(`documentNumber.${activeDocumentType}.placeholder`)\n : undefined\n }\n isRequired\n />\n )}\n\n {documentType === 'foreign_passport' && authorizationStatus === 'alien' && (\n <ComboBoxField\n name=\"country\"\n label={t('country.label')}\n description={t('country.description')}\n options={COUNTRIES}\n placeholder={t('country.placeholder')}\n allowsCustomValue\n isRequired\n />\n )}\n\n <ActionsLayout>\n <Button type=\"submit\" isLoading={isPending}>\n {t('submit')}\n </Button>\n </ActionsLayout>\n </Flex>\n </Form>\n </FormProvider>\n )\n}\n"],"names":["statusDescriptionKeys","EmploymentEligibilityPresentation","onSubmit","defaultValues","hasDocumentNumber","isPending","useI18n","Heading","Text","Alert","Button","Link","useComponentContext","t","useTranslation","hasExistingDocumentNumber","setHasExistingDocumentNumber","useState","formMethods","useForm","zodResolver","generateEmploymentEligibilitySchema","control","setValue","clearErrors","authorizationStatus","useWatch","documentType","statusOptions","AuthorizationStatus","value","authorizationDocumentOptions","I9AuthorizationDocumentType","handleAuthorizationStatusChange","handleDocumentTypeChange","showDocumentTypeRadio","showDocumentNumberInput","activeDocumentType","FormProvider","jsx","Form","jsxs","Flex","Trans","SelectField","DatePickerField","RadioGroupField","TextInputField","ComboBoxField","COUNTRIES","ActionsLayout"],"mappings":";;;;;;;;;;;;;;;;;;;;AAkCA,MAAMA,IAAwB;AAAA,EAC5B,SAAS;AAAA,EACT,oBAAoB;AAAA,EACpB,YAAY;AAAA,EACZ,OAAO;AACT,GAEaC,KAAoC,CAAC;AAAA,EAChD,UAAAC;AAAA,EACA,eAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,WAAAC;AACF,MAA8C;AAC5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MAAK;AAAA,QACL,OAAOlC,EAAE,kBAAkBwB,CAAkB,QAAQ;AAAA,QACrD,aACEA,MAAuB,qBACnBxB,EAAE,kBAAkBwB,CAAkB,cAAc,IACpD;AAAA,QAEN,aACEtB,IACIF,EAAE,kBAAkBwB,CAAkB,cAAc,IACpD;AAAA,QAEN,YAAU;AAAA,MAAA;AAAA,IAAA;AAAA,IAIbV,MAAiB,sBAAsBF,MAAwB,WAC9D,gBAAAc;AAAA,MAACS;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOnC,EAAE,eAAe;AAAA,QACxB,aAAaA,EAAE,qBAAqB;AAAA,QACpC,SAASoC;AAAA,QACT,aAAapC,EAAE,qBAAqB;AAAA,QACpC,mBAAiB;AAAA,QACjB,YAAU;AAAA,MAAA;AAAA,IAAA;AAAA,IAId,gBAAA0B,EAACW,GAAA,EACC,UAAA,gBAAAX,EAAC7B,GAAA,EAAO,MAAK,UAAS,WAAWL,GAC9B,UAAAQ,EAAE,QAAQ,EAAA,CACb,EAAA,CACF;AAAA,EAAA,EAAA,CACF,GACF,GACF;AAEJ;"}
1
+ {"version":3,"file":"EmploymentEligibilityPresentation.js","sources":["../../../../../src/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.tsx"],"sourcesContent":["import { useState } from 'react'\nimport { useTranslation, Trans } from 'react-i18next'\nimport { FormProvider, useForm, useWatch, type SubmitHandler } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport {\n AuthorizationStatus,\n I9AuthorizationDocumentType,\n} from '@gusto/embedded-api/models/components/i9authorization'\nimport {\n generateEmploymentEligibilitySchema,\n type EmploymentEligibilityInputs,\n type EmploymentEligibilityPayload,\n} from './EmploymentEligibilitySchema'\nimport { COUNTRIES } from './countries'\nimport {\n Flex,\n SelectField,\n RadioGroupField,\n TextInputField,\n DatePickerField,\n ActionsLayout,\n} from '@/components/Common'\nimport { ComboBoxField } from '@/components/Common/Fields/ComboBoxField/ComboBoxField'\nimport { Form } from '@/components/Common/Form'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\n\ninterface EmploymentEligibilityPresentationProps {\n onSubmit: SubmitHandler<EmploymentEligibilityPayload>\n defaultValues?: Partial<EmploymentEligibilityInputs>\n hasDocumentNumber?: boolean | null\n isPending?: boolean\n}\n\nconst statusDescriptionKeys = {\n citizen: 'statusDescriptions.citizen',\n permanent_resident: 'statusDescriptions.permanent_resident',\n noncitizen: 'statusDescriptions.noncitizen',\n alien: 'statusDescriptions.alien',\n} as const satisfies Record<AuthorizationStatus, string>\n\nexport const EmploymentEligibilityPresentation = ({\n onSubmit,\n defaultValues,\n hasDocumentNumber,\n isPending,\n}: EmploymentEligibilityPresentationProps) => {\n useI18n('Employee.EmploymentEligibility')\n const { Heading, Text, Alert, Button, Link } = useComponentContext()\n const { t } = useTranslation('Employee.EmploymentEligibility')\n\n const [hasExistingDocumentNumber, setHasExistingDocumentNumber] = useState(!!hasDocumentNumber)\n\n const formMethods = useForm<EmploymentEligibilityInputs, unknown, EmploymentEligibilityPayload>({\n resolver: zodResolver(generateEmploymentEligibilitySchema(hasExistingDocumentNumber)),\n defaultValues,\n })\n\n const { control, setValue, clearErrors } = formMethods\n const authorizationStatus = useWatch({ control, name: 'authorizationStatus' })\n const documentType = useWatch({ control, name: 'documentType' })\n\n const statusOptions = Object.values(AuthorizationStatus).map(value => ({\n value,\n label: t(`select.options.${value}`),\n }))\n\n const authorizationDocumentOptions = Object.values(I9AuthorizationDocumentType).map(value => ({\n value,\n label: t(`authorizationDocument.options.${value}`),\n }))\n\n const handleAuthorizationStatusChange = () => {\n setValue('documentNumber', '')\n clearErrors('documentNumber')\n setHasExistingDocumentNumber(false)\n }\n\n const handleDocumentTypeChange = () => {\n setValue('documentNumber', '')\n clearErrors('documentNumber')\n setHasExistingDocumentNumber(false)\n }\n\n const showDocumentTypeRadio = authorizationStatus === 'alien'\n const showDocumentNumberInput =\n authorizationStatus === 'permanent_resident' ||\n (authorizationStatus === 'alien' && !!documentType)\n const activeDocumentType =\n authorizationStatus === 'permanent_resident' ? 'uscis_alien_registration_number' : documentType\n\n const documentNumberMaxLength: Partial<Record<I9AuthorizationDocumentType, number>> = {\n uscis_alien_registration_number: 9,\n form_i94: 11,\n }\n\n return (\n <FormProvider {...formMethods}>\n <Form onSubmit={formMethods.handleSubmit(onSubmit)}>\n <Flex flexDirection=\"column\" gap={16}>\n <Flex flexDirection=\"column\" gap={2}>\n <Heading as=\"h2\">{t('title')}</Heading>\n <Text variant=\"supporting\">\n <Trans\n i18nKey={'subtitle'}\n t={t}\n components={{\n formI9Link: <Link />,\n }}\n />\n </Text>\n </Flex>\n\n <SelectField\n name=\"authorizationStatus\"\n label={t('select.label')}\n description={t('select.description')}\n placeholder={t('select.placeholder')}\n options={statusOptions}\n isRequired\n onChange={handleAuthorizationStatusChange}\n />\n\n {authorizationStatus && (\n <Alert\n status=\"info\"\n label={t(statusDescriptionKeys[authorizationStatus])}\n disableScrollIntoView\n />\n )}\n\n {authorizationStatus === 'alien' && (\n <DatePickerField name=\"expirationDate\" label={t('expirationDate.label')} />\n )}\n\n {showDocumentTypeRadio && (\n <RadioGroupField\n name=\"documentType\"\n label={t('authorizationDocument.label')}\n options={authorizationDocumentOptions}\n isRequired\n onChange={handleDocumentTypeChange}\n />\n )}\n\n {showDocumentNumberInput && activeDocumentType && (\n <TextInputField\n name=\"documentNumber\"\n label={t(`documentNumber.${activeDocumentType}.label`)}\n description={\n activeDocumentType !== 'foreign_passport'\n ? t(`documentNumber.${activeDocumentType}.description`)\n : undefined\n }\n placeholder={\n hasExistingDocumentNumber\n ? t(`documentNumber.${activeDocumentType}.placeholder`)\n : undefined\n }\n maxLength={documentNumberMaxLength[activeDocumentType]}\n isRequired\n />\n )}\n\n {documentType === 'foreign_passport' && authorizationStatus === 'alien' && (\n <ComboBoxField\n name=\"country\"\n label={t('country.label')}\n description={t('country.description')}\n options={COUNTRIES}\n placeholder={t('country.placeholder')}\n allowsCustomValue\n isRequired\n />\n )}\n\n <ActionsLayout>\n <Button type=\"submit\" isLoading={isPending}>\n {t('submit')}\n </Button>\n </ActionsLayout>\n </Flex>\n </Form>\n </FormProvider>\n )\n}\n"],"names":["statusDescriptionKeys","EmploymentEligibilityPresentation","onSubmit","defaultValues","hasDocumentNumber","isPending","useI18n","Heading","Text","Alert","Button","Link","useComponentContext","t","useTranslation","hasExistingDocumentNumber","setHasExistingDocumentNumber","useState","formMethods","useForm","zodResolver","generateEmploymentEligibilitySchema","control","setValue","clearErrors","authorizationStatus","useWatch","documentType","statusOptions","AuthorizationStatus","value","authorizationDocumentOptions","I9AuthorizationDocumentType","handleAuthorizationStatusChange","handleDocumentTypeChange","showDocumentTypeRadio","showDocumentNumberInput","activeDocumentType","documentNumberMaxLength","FormProvider","jsx","Form","jsxs","Flex","Trans","SelectField","DatePickerField","RadioGroupField","TextInputField","ComboBoxField","COUNTRIES","ActionsLayout"],"mappings":";;;;;;;;;;;;;;;;;;AAkCA,MAAMA,IAAwB;AAAA,EAC5B,SAAS;AAAA,EACT,oBAAoB;AAAA,EACpB,YAAY;AAAA,EACZ,OAAO;AACT,GAEaC,KAAoC,CAAC;AAAA,EAChD,UAAAC;AAAA,EACA,eAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,WAAAC;AACF,MAA8C;AAC5C,EAAAC,EAAQ,gCAAgC;AACxC,QAAM,EAAE,SAAAC,GAAS,MAAAC,GAAM,OAAAC,GAAO,QAAAC,GAAQ,MAAAC,EAAA,IAASC,EAAA,GACzC,EAAE,GAAAC,EAAA,IAAMC,EAAe,gCAAgC,GAEvD,CAACC,GAA2BC,CAA4B,IAAIC,EAAS,CAAC,CAACb,CAAiB,GAExFc,IAAcC,EAA4E;AAAA,IAC9F,UAAUC,EAAYC,EAAoCN,CAAyB,CAAC;AAAA,IACpF,eAAAZ;AAAA,EAAA,CACD,GAEK,EAAE,SAAAmB,GAAS,UAAAC,GAAU,aAAAC,EA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