@gusto/embedded-react-sdk 0.51.2 → 0.52.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 (213) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbsTypes.d.ts +1 -1
  3. package/dist/components/Common/OnboardingStatusBadge/index.d.ts +1 -1
  4. package/dist/components/Common/OnboardingStatusBadge/index.js.map +1 -1
  5. package/dist/components/Common/UI/FormBox/FormBox.d.ts +9 -0
  6. package/dist/components/Common/UI/FormBox/FormBox.js +13 -0
  7. package/dist/components/Common/UI/FormBox/FormBox.js.map +1 -0
  8. package/dist/components/Common/UI/FormBox/FormBox.module.scss.js +14 -0
  9. package/dist/components/Common/UI/FormBox/FormBox.module.scss.js.map +1 -0
  10. package/dist/components/Common/UI/FormBox/FormBoxTypes.d.ts +26 -0
  11. package/dist/components/Common/UI/FormBoxHeader/FormBoxHeader.d.ts +9 -0
  12. package/dist/components/Common/UI/FormBoxHeader/FormBoxHeader.js +23 -0
  13. package/dist/components/Common/UI/FormBoxHeader/FormBoxHeader.js.map +1 -0
  14. package/dist/components/Common/UI/FormBoxHeader/FormBoxHeader.module.scss.js +8 -0
  15. package/dist/components/Common/UI/FormBoxHeader/FormBoxHeader.module.scss.js.map +1 -0
  16. package/dist/components/Common/UI/FormBoxHeader/FormBoxHeaderTypes.d.ts +36 -0
  17. package/dist/components/Common/UI/FormBoxHeader/FormBoxHeaderTypes.js +7 -0
  18. package/dist/components/Common/UI/FormBoxHeader/FormBoxHeaderTypes.js.map +1 -0
  19. package/dist/components/Common/UI/FormBoxHeader/index.d.ts +1 -0
  20. package/dist/components/Common/UI/Input/InputTypes.d.ts +1 -0
  21. package/dist/components/Common/UI/Input/InputTypes.js.map +1 -1
  22. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.d.ts +1 -2
  23. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.d.ts +1 -1
  24. package/dist/components/Company/BankAccount/BankAccountForm/Form.d.ts +1 -1
  25. package/dist/components/Company/BankAccount/BankAccountVerify/Form.d.ts +1 -1
  26. package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/signCompanyFormSchema.d.ts +1 -1
  27. package/dist/components/Company/FederalTaxes/useFederalTaxes.d.ts +1 -1
  28. package/dist/components/Company/Locations/LocationForm/Form.d.ts +1 -1
  29. package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/payScheduleSchema.d.ts +3 -3
  30. package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/usePayScheduleForm.d.ts +1 -1
  31. package/dist/components/Company/StateTaxes/StateTaxes.d.ts +10 -1
  32. package/dist/components/Company/StateTaxes/StateTaxes.js +23 -17
  33. package/dist/components/Company/StateTaxes/StateTaxes.js.map +1 -1
  34. package/dist/components/Company/StateTaxes/StateTaxesComponents.d.ts +2 -0
  35. package/dist/components/Company/StateTaxes/StateTaxesComponents.js +17 -10
  36. package/dist/components/Company/StateTaxes/StateTaxesComponents.js.map +1 -1
  37. package/dist/components/Company/StateTaxes/StateTaxesList/List.js +26 -26
  38. package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
  39. package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.d.ts +9 -0
  40. package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js +24 -24
  41. package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js.map +1 -1
  42. package/dist/components/Contractor/Address/Address.d.ts +4 -3
  43. package/dist/components/Contractor/Address/Address.js.map +1 -1
  44. package/dist/components/Contractor/Address/shared/useContractorAddressForm/contractorAddressSchema.d.ts +2 -2
  45. package/dist/components/Contractor/Address/shared/useContractorAddressForm/useContractorAddressForm.d.ts +1 -1
  46. package/dist/components/Contractor/ContractorList/index.js +95 -92
  47. package/dist/components/Contractor/ContractorList/index.js.map +1 -1
  48. package/dist/components/Contractor/Documents/SignatureForm/SignatureForm.js +22 -19
  49. package/dist/components/Contractor/Documents/SignatureForm/SignatureForm.js.map +1 -1
  50. package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/contractorSignatureFormSchema.d.ts +1 -1
  51. package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/useContractorSignatureForm.d.ts +1 -1
  52. package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/w9Fields.d.ts +1 -1
  53. package/dist/components/Contractor/PaymentMethod/shared/useContractorBankAccountForm/useContractorBankAccountFormSchema.d.ts +1 -1
  54. package/dist/components/Contractor/PaymentMethod/shared/useContractorPaymentMethodForm/contractorPaymentMethodSchema.d.ts +1 -1
  55. package/dist/components/Contractor/PaymentMethod/shared/useContractorPaymentMethodForm/contractorPaymentMethodSchema.js.map +1 -1
  56. package/dist/components/Contractor/PaymentMethod/shared/useContractorPaymentMethodForm/useContractorPaymentMethodForm.d.ts +2 -2
  57. package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js.map +1 -1
  58. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.d.ts +1 -1
  59. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
  60. package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js +2 -2
  61. package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js.map +1 -1
  62. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummary.d.ts +17 -5
  63. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummary.js +32 -31
  64. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummary.js.map +1 -1
  65. package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.d.ts +16 -4
  66. package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js +33 -29
  67. package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js.map +1 -1
  68. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +1 -1
  69. package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/contractorDetailsSchema.d.ts +1 -1
  70. package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/contractorDetailsSchema.js +6 -6
  71. package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/contractorDetailsSchema.js.map +1 -1
  72. package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/useContractorDetailsForm.d.ts +1 -1
  73. package/dist/components/Employee/Compensation/onboarding/Compensation.d.ts +0 -4
  74. package/dist/components/Employee/Compensation/onboarding/Compensation.js +38 -42
  75. package/dist/components/Employee/Compensation/onboarding/Compensation.js.map +1 -1
  76. package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.d.ts +2 -2
  77. package/dist/components/Employee/Compensation/shared/useJobForm/jobSchema.d.ts +1 -1
  78. package/dist/components/Employee/Dashboard/index.d.ts +1 -1
  79. package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/childSupportGarnishmentFormSchema.d.ts +1 -1
  80. package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/useChildSupportGarnishmentForm.d.ts +1 -1
  81. package/dist/components/Employee/Deductions/shared/useDeductionForm/deductionFormSchema.d.ts +2 -2
  82. package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilitySchema.d.ts +2 -2
  83. package/dist/components/Employee/Documents/onboarding/EmployeeDocuments/EmployeeDocuments.js +1 -4
  84. package/dist/components/Employee/Documents/onboarding/EmployeeDocuments/EmployeeDocuments.js.map +1 -1
  85. package/dist/components/Employee/Documents/shared/useSignEmployeeForm/signEmployeeFormSchema.d.ts +2 -2
  86. package/dist/components/Employee/Documents/shared/useSignEmployeeForm/signEmployeeFormSchema.js +27 -32
  87. package/dist/components/Employee/Documents/shared/useSignEmployeeForm/signEmployeeFormSchema.js.map +1 -1
  88. package/dist/components/Employee/EmployeeList/shared/useEmployeeList.js +1 -2
  89. package/dist/components/Employee/EmployeeList/shared/useEmployeeList.js.map +1 -1
  90. package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/federalTaxesSchema.d.ts +2 -2
  91. package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/useFederalTaxesForm.d.ts +1 -1
  92. package/dist/components/Employee/OnboardingExecutionFlow/onboardingExecutionStateMachine.d.ts +1 -1
  93. package/dist/components/Employee/OnboardingExecutionFlow/onboardingExecutionStateMachine.js +1 -3
  94. package/dist/components/Employee/OnboardingExecutionFlow/onboardingExecutionStateMachine.js.map +1 -1
  95. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +55 -49
  96. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js.map +1 -1
  97. package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankFormSchema.d.ts +1 -1
  98. package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/useSplitPaymentsFormSchema.d.ts +1 -1
  99. package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/employeeDetailsSchema.d.ts +2 -2
  100. package/dist/components/Employee/Profile/shared/useHomeAddressForm/homeAddressSchema.d.ts +1 -1
  101. package/dist/components/Employee/Profile/shared/useHomeAddressForm/useHomeAddressForm.d.ts +1 -1
  102. package/dist/components/Employee/exports/employeeManagement.d.ts +1 -1
  103. package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.d.ts +4 -5
  104. package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js +101 -125
  105. package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -1
  106. package/dist/components/InformationRequests/InformationRequestsComponents.d.ts +0 -5
  107. package/dist/components/InformationRequests/InformationRequestsComponents.js +12 -13
  108. package/dist/components/InformationRequests/InformationRequestsComponents.js.map +1 -1
  109. package/dist/components/Payroll/Dismissal/DismissalFlowComponents.js +4 -4
  110. package/dist/components/Payroll/Dismissal/DismissalFlowComponents.js.map +1 -1
  111. package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.d.ts +1 -1
  112. package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js +8 -8
  113. package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js.map +1 -1
  114. package/dist/components/Payroll/OffCycle/index.d.ts +1 -1
  115. package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes.d.ts +1 -1
  116. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +97 -92
  117. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
  118. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.d.ts +2 -3
  119. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
  120. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.d.ts +2 -2
  121. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js +1 -1
  122. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js.map +1 -1
  123. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js +57 -56
  124. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js.map +1 -1
  125. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
  126. package/dist/components/Payroll/PayrollExecutionFlow/PayrollExecutionFlow.d.ts +23 -6
  127. package/dist/components/Payroll/PayrollExecutionFlow/PayrollExecutionFlow.js +37 -33
  128. package/dist/components/Payroll/PayrollExecutionFlow/PayrollExecutionFlow.js.map +1 -1
  129. package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.js +2 -2
  130. package/dist/components/Payroll/PayrollFlow/PayrollExecutionFlowContextual.js +6 -6
  131. package/dist/components/Payroll/PayrollFlow/PayrollExecutionFlowContextual.js.map +1 -1
  132. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js +1 -1
  133. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js.map +1 -1
  134. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.d.ts +1 -1
  135. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
  136. package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
  137. package/dist/components/Payroll/PayrollList/PayrollListPresentation.d.ts +1 -1
  138. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +1 -1
  139. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
  140. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.d.ts +1 -1
  141. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +31 -31
  142. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
  143. package/dist/components/Payroll/RecoveryCases/RecoveryCases.d.ts +9 -5
  144. package/dist/components/Payroll/RecoveryCases/RecoveryCases.js.map +1 -1
  145. package/dist/components/Payroll/Transition/TransitionFlowComponents.d.ts +1 -1
  146. package/dist/components/Payroll/Transition/TransitionFlowComponents.js +1 -1
  147. package/dist/components/Payroll/Transition/TransitionFlowComponents.js.map +1 -1
  148. package/dist/components/Payroll/Transition/index.d.ts +1 -1
  149. package/dist/components/Payroll/helpers.d.ts +22 -8
  150. package/dist/components/Payroll/helpers.js +1 -1
  151. package/dist/components/Payroll/helpers.js.map +1 -1
  152. package/dist/components/Payroll/index.d.ts +3 -2
  153. package/dist/components/Payroll/payrollTypes.d.ts +1 -1
  154. package/dist/components/Payroll/payrollTypes.js +1 -1
  155. package/dist/components/Payroll/payrollTypes.js.map +1 -1
  156. package/dist/components/Payroll/usePreparedPayrollData.d.ts +1 -1
  157. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  158. package/dist/components/TimeOff/TimeOffFlow/timeOffPolicyTypes.d.ts +1 -1
  159. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/useSelectEmployeesData.js +19 -19
  160. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/useSelectEmployeesData.js.map +1 -1
  161. package/dist/contexts/ApiProvider/ApiProvider.d.ts +5 -5
  162. package/dist/contexts/ApiProvider/ApiProvider.js.map +1 -1
  163. package/dist/contexts/ApiProvider/apiVersion.d.ts +2 -2
  164. package/dist/contexts/ApiProvider/apiVersion.js +1 -1
  165. package/dist/contexts/ApiProvider/apiVersion.js.map +1 -1
  166. package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js +40 -36
  167. package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js.map +1 -1
  168. package/dist/contexts/ComponentAdapter/componentAdapterTypes.d.ts +2 -0
  169. package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.d.ts +5 -0
  170. package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.js +18 -16
  171. package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.js.map +1 -1
  172. package/dist/contexts/ComponentAdapter/useComponentContext.d.ts +6 -0
  173. package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
  174. package/dist/contexts/GustoProvider/GustoProvider.d.ts +4 -5
  175. package/dist/contexts/GustoProvider/GustoProvider.js +6 -6
  176. package/dist/contexts/GustoProvider/GustoProvider.js.map +1 -1
  177. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.d.ts +7 -7
  178. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +8 -8
  179. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  180. package/dist/contexts/GustoProvider/index.d.ts +1 -1
  181. package/dist/contexts/index.d.ts +2 -6
  182. package/dist/i18n/en/Contractor.ContractorList.json.js +18 -16
  183. package/dist/i18n/en/Contractor.ContractorList.json.js.map +1 -1
  184. package/dist/i18n/en/Contractor.SignatureForm.json.js +5 -5
  185. package/dist/i18n/en/Employee.OnboardingSummary.json.js +24 -20
  186. package/dist/i18n/en/Employee.OnboardingSummary.json.js.map +1 -1
  187. package/dist/i18n/types.d.ts +8 -0
  188. package/dist/index.d.ts +8 -7
  189. package/dist/index.js +121 -134
  190. package/dist/index.js.map +1 -1
  191. package/dist/models/WA_RISK_CODES.d.ts +5 -2
  192. package/dist/models/WA_RISK_CODES.js.map +1 -1
  193. package/dist/models/external.d.ts +67 -57
  194. package/dist/partner-hook-utils/composeErrorHandler.d.ts +9 -4
  195. package/dist/partner-hook-utils/composeErrorHandler.js.map +1 -1
  196. package/dist/partner-hook-utils/form/SDKFormProvider.d.ts +10 -2
  197. package/dist/partner-hook-utils/form/SDKFormProvider.js +7 -1
  198. package/dist/partner-hook-utils/form/SDKFormProvider.js.map +1 -1
  199. package/dist/partner-hook-utils/form/composeSubmitHandler.d.ts +7 -4
  200. package/dist/partner-hook-utils/form/composeSubmitHandler.js.map +1 -1
  201. package/dist/partner-hook-utils/form/fields/index.d.ts +1 -0
  202. package/dist/partner-hook-utils/form/index.d.ts +3 -3
  203. package/dist/partner-hook-utils/form/useHookFieldResolution.js.map +1 -1
  204. package/dist/partner-hook-utils/index.d.ts +1 -1
  205. package/dist/partner-hook-utils/types.d.ts +7 -3
  206. package/dist/shared/constants.d.ts +2 -2
  207. package/dist/shared/constants.js +4 -4
  208. package/dist/shared/constants.js.map +1 -1
  209. package/dist/style.css +1 -1
  210. package/dist/types/Helpers.d.ts +11 -0
  211. package/dist/types/hooks.d.ts +1 -1
  212. package/docs/guides/endpoint-inventory.json +379 -379
  213. package/package.json +7 -7
@@ -1 +1 @@
1
- {"version":3,"file":"useEmployeeList.js","sources":["../../../../../src/components/Employee/EmployeeList/shared/useEmployeeList.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { useEmployeesList } from '@gusto/embedded-api/react-query/employeesList'\nimport type { Employee } from '@gusto/embedded-api/models/components/employee'\nimport type { Job } from '@gusto/embedded-api/models/components/job'\nimport type { EmployeeOnboardingStatus as EmployeeOnboardingStatusEntity } from '@gusto/embedded-api/models/components/employeeonboardingstatus'\nimport { useEmployeesDeleteMutation } from '@gusto/embedded-api/react-query/employeesDelete'\nimport { useEmployeesUpdateOnboardingStatusMutation } from '@gusto/embedded-api/react-query/employeesUpdateOnboardingStatus'\nimport { keepPreviousData } from '@tanstack/react-query'\nimport { usePagination } from '@/hooks/usePagination/usePagination'\nimport type { PaginationControlProps } from '@/components/Common/PaginationControl/PaginationControlTypes'\nimport { useBaseSubmit } from '@/components/Base/useBaseSubmit'\nimport { composeErrorHandler } from '@/partner-hook-utils/composeErrorHandler'\nimport { EmployeeOnboardingStatus, EmployeeSelfOnboardingStatuses } from '@/shared/constants'\nimport type { HookLoadingResult, BaseHookReady } from '@/partner-hook-utils/types'\n\n/**\n * Action that may be performed on an employee row, determined by the employee's onboarding state\n * and the `employeeType` filter passed to {@link useEmployeeList}.\n *\n * @public\n */\nexport type EmployeeAction =\n 'edit' | 'delete' | 'cancel_self_onboarding' | 'review' | 'dismiss' | 'rehire'\n\n/**\n * An employee entity extended with the actions permitted on it and a reference to its primary job.\n *\n * @public\n */\nexport interface EmployeeWithActions extends Employee {\n /** Actions permitted for this employee given its onboarding status and the active filter. */\n allowedActions: EmployeeAction[]\n /** The employee's primary job, if one is marked primary. */\n primaryJob?: Job\n}\n\n/**\n * Filter applied to {@link useEmployeeList} that scopes the result set and tailors the per-row action list.\n *\n * @public\n */\nexport type EmployeeType = 'active' | 'onboarding' | 'terminated'\n\n/**\n * Props for {@link useEmployeeList}.\n *\n * @public\n */\nexport interface UseEmployeeListProps {\n /** The associated company identifier. */\n companyId: string\n /** Filters the list and tailors the allowed actions. Omit to list all employees. */\n employeeType?: EmployeeType\n}\n\n/**\n * Ready state of {@link useEmployeeList}.\n *\n * @public\n */\nexport interface UseEmployeeListReady extends BaseHookReady<\n { employees: EmployeeWithActions[] },\n { isFetching: boolean; isPending: boolean }\n> {\n /** Pagination controls for the current employee list page. */\n pagination: PaginationControlProps\n /** Actions that mutate an employee's state, gated by the entry's `allowedActions`. */\n actions: {\n /** Deletes the employee. */\n onDelete: (employeeId: string) => Promise<void>\n /** Moves the employee into the admin-review onboarding status. Resolves to the updated record, or `undefined` if the call failed. */\n onReview: (employeeId: string) => Promise<EmployeeOnboardingStatusEntity | undefined>\n /** Reverts a self-onboarding employee to admin-driven onboarding. Resolves to the updated record, or `undefined` if the call failed. */\n onCancelSelfOnboarding: (\n employeeId: string,\n ) => Promise<EmployeeOnboardingStatusEntity | undefined>\n }\n}\n\n/**\n * Return type of {@link useEmployeeList}.\n *\n * @public\n */\nexport type UseEmployeeListResult = HookLoadingResult | UseEmployeeListReady\n\nfunction deriveAllowedActions(employee: Employee, employeeType?: EmployeeType): EmployeeAction[] {\n const actions: EmployeeAction[] = []\n\n // Edit action - available for certain onboarding statuses, but not for terminated employees\n if (\n employeeType !== 'terminated' &&\n (employee.onboardingStatus === EmployeeOnboardingStatus.ADMIN_ONBOARDING_INCOMPLETE ||\n employee.onboardingStatus === EmployeeOnboardingStatus.SELF_ONBOARDING_PENDING_INVITE ||\n employee.onboardingStatus ===\n EmployeeOnboardingStatus.SELF_ONBOARDING_AWAITING_ADMIN_REVIEW ||\n employee.onboardingStatus === EmployeeOnboardingStatus.ONBOARDING_COMPLETED)\n ) {\n actions.push('edit')\n }\n\n // Cancel self onboarding - available for employees in self-onboarding flow\n if (\n employee.onboardingStatus &&\n // @ts-expect-error: onboardingStatus during runtime can be one of self onboarding statuses\n EmployeeSelfOnboardingStatuses.has(employee.onboardingStatus)\n ) {\n actions.push('cancel_self_onboarding')\n }\n\n // Review action - available when employee completed self-onboarding\n if (\n employee.onboardingStatus === EmployeeOnboardingStatus.SELF_ONBOARDING_COMPLETED_BY_EMPLOYEE\n ) {\n actions.push('review')\n }\n\n // Delete action - available for non-onboarded employees\n if (!employee.onboarded) {\n actions.push('delete')\n }\n\n // Tab-specific actions for ManagementEmployeeList\n if (employeeType === 'active') {\n actions.push('dismiss')\n }\n\n if (employeeType === 'terminated') {\n actions.push('rehire')\n }\n\n return actions\n}\n\n/**\n * Fetches a paginated list of a company's employees and decorates each entry with the actions\n * allowed for its current onboarding state.\n *\n * @remarks\n * `employeeType` maps to a server-side filter and changes which actions appear on each row:\n * `'active'` adds `dismiss`, `'terminated'` adds `rehire`, `'onboarding'` adds none. Omit it\n * to list every employee.\n *\n * Page changes use placeholder data: the previous page stays rendered while the next one loads,\n * and `status.isFetching` flips to `true` during the request.\n *\n * @param input - Company and optional filter for the list.\n * @returns A {@link HookLoadingResult} while the first page is in flight, or a {@link UseEmployeeListReady} once data has arrived.\n * @public\n *\n * @example\n * ```tsx\n * import { useEmployeeList } from '@gusto/embedded-react-sdk'\n *\n * function EmployeeListPage({ companyId }: { companyId: string }) {\n * const employeeList = useEmployeeList({ companyId, employeeType: 'onboarding' })\n *\n * if (employeeList.isLoading) return <div>Loading...</div>\n *\n * return (\n * <ul>\n * {employeeList.data.employees.map(employee => (\n * <li key={employee.uuid}>\n * {employee.firstName} {employee.lastName}\n * {employee.allowedActions.includes('delete') && (\n * <button onClick={() => employeeList.actions.onDelete(employee.uuid)}>Delete</button>\n * )}\n * </li>\n * ))}\n * </ul>\n * )\n * }\n * ```\n */\nexport function useEmployeeList({\n companyId,\n employeeType,\n}: UseEmployeeListProps): UseEmployeeListResult {\n const { currentPage, itemsPerPage, getPaginationProps } = usePagination()\n\n const queryParams = useMemo(() => {\n const baseParams = {\n companyId,\n page: currentPage,\n per: itemsPerPage,\n }\n\n switch (employeeType) {\n case 'active':\n return { ...baseParams, onboardedActive: true }\n case 'onboarding':\n return { ...baseParams, onboarded: false }\n case 'terminated':\n return { ...baseParams, terminated: true }\n default:\n return baseParams\n }\n }, [companyId, currentPage, itemsPerPage, employeeType])\n\n const employeesQuery = useEmployeesList(queryParams, { placeholderData: keepPreviousData })\n\n const deleteEmployeeMutation = useEmployeesDeleteMutation()\n const updateOnboardingStatusMutation = useEmployeesUpdateOnboardingStatusMutation()\n\n const {\n baseSubmitHandler,\n error: submitError,\n setError: setSubmitError,\n } = useBaseSubmit('EmployeeList')\n\n const errorHandling = composeErrorHandler([employeesQuery], { submitError, setSubmitError })\n\n const isPending = deleteEmployeeMutation.isPending || updateOnboardingStatusMutation.isPending\n\n const { data, isFetching } = employeesQuery\n\n const employees = useMemo<EmployeeWithActions[]>(() => {\n return (data?.showEmployees ?? []).map(employee => {\n const primaryJob = employee.jobs?.find(job => job.primary === true)\n\n return {\n ...employee,\n allowedActions: deriveAllowedActions(employee, employeeType),\n primaryJob,\n }\n })\n }, [data?.showEmployees, employeeType])\n\n const paginationProps = data?.httpMeta.response.headers\n ? getPaginationProps(data.httpMeta.response.headers, isFetching)\n : {\n handleNextPage: () => {},\n handleFirstPage: () => {},\n handleLastPage: () => {},\n handlePreviousPage: () => {},\n handleItemsPerPageChange: () => {},\n currentPage: 1,\n totalPages: 1,\n totalCount: 0,\n itemsPerPage: 5 as const,\n }\n\n const onDelete = async (employeeId: string): Promise<void> => {\n await baseSubmitHandler(employeeId, async id => {\n await deleteEmployeeMutation.mutateAsync({\n request: { employeeId: id },\n })\n })\n }\n\n const onReview = async (\n employeeId: string,\n ): Promise<EmployeeOnboardingStatusEntity | undefined> => {\n let onboardingStatus: EmployeeOnboardingStatusEntity | undefined\n\n await baseSubmitHandler(employeeId, async id => {\n const result = await updateOnboardingStatusMutation.mutateAsync({\n request: {\n employeeId: id,\n requestBody: {\n onboardingStatus: EmployeeOnboardingStatus.SELF_ONBOARDING_AWAITING_ADMIN_REVIEW,\n },\n },\n })\n\n onboardingStatus = result.employeeOnboardingStatus\n })\n\n return onboardingStatus\n }\n\n const onCancelSelfOnboarding = async (\n employeeId: string,\n ): Promise<EmployeeOnboardingStatusEntity | undefined> => {\n let onboardingStatus: EmployeeOnboardingStatusEntity | undefined\n\n await baseSubmitHandler(employeeId, async id => {\n const result = await updateOnboardingStatusMutation.mutateAsync({\n request: {\n employeeId: id,\n requestBody: {\n onboardingStatus: EmployeeOnboardingStatus.ADMIN_ONBOARDING_INCOMPLETE,\n },\n },\n })\n\n onboardingStatus = result.employeeOnboardingStatus\n })\n\n return onboardingStatus\n }\n\n const isLoading = !data && isFetching\n\n if (isLoading) {\n return {\n isLoading: true,\n errorHandling,\n }\n }\n\n return {\n isLoading: false,\n data: {\n employees,\n },\n pagination: paginationProps,\n status: { isFetching, isPending },\n actions: { onDelete, onReview, onCancelSelfOnboarding },\n errorHandling,\n }\n}\n"],"names":["deriveAllowedActions","employee","employeeType","actions","EmployeeOnboardingStatus","EmployeeSelfOnboardingStatuses","useEmployeeList","companyId","currentPage","itemsPerPage","getPaginationProps","usePagination","queryParams","useMemo","baseParams","employeesQuery","useEmployeesList","keepPreviousData","deleteEmployeeMutation","useEmployeesDeleteMutation","updateOnboardingStatusMutation","useEmployeesUpdateOnboardingStatusMutation","baseSubmitHandler","submitError","setSubmitError","useBaseSubmit","errorHandling","composeErrorHandler","isPending","data","isFetching","employees","primaryJob","job","paginationProps","onDelete","employeeId","id","onReview","onboardingStatus","onCancelSelfOnboarding"],"mappings":";;;;;;;;;AAsFA,SAASA,EAAqBC,GAAoBC,GAA+C;AAC/F,QAAMC,IAA4B,CAAA;AAGlC,SACED,MAAiB,iBAChBD,EAAS,qBAAqBG,EAAyB,+BACtDH,EAAS,qBAAqBG,EAAyB,kCACvDH,EAAS,qBACPG,EAAyB,yCAC3BH,EAAS,qBAAqBG,EAAyB,yBAEzDD,EAAQ,KAAK,MAAM,GAKnBF,EAAS;AAAA,EAETI,EAA+B,IAAIJ,EAAS,gBAAgB,KAE5DE,EAAQ,KAAK,wBAAwB,GAKrCF,EAAS,qBAAqBG,EAAyB,yCAEvDD,EAAQ,KAAK,QAAQ,GAIlBF,EAAS,aACZE,EAAQ,KAAK,QAAQ,GAInBD,MAAiB,YACnBC,EAAQ,KAAK,SAAS,GAGpBD,MAAiB,gBACnBC,EAAQ,KAAK,QAAQ,GAGhBA;AACT;AA0CO,SAASG,EAAgB;AAAA,EAC9B,WAAAC;AAAA,EACA,cAAAL;AACF,GAAgD;AAC9C,QAAM,EAAE,aAAAM,GAAa,cAAAC,GAAc,oBAAAC,EAAA,IAAuBC,EAAA,GAEpDC,IAAcC,EAAQ,MAAM;AAChC,UAAMC,IAAa;AAAA,MACjB,WAAAP;AAAA,MACA,MAAMC;AAAA,MACN,KAAKC;AAAA,IAAA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,"file":"useEmployeeList.js","sources":["../../../../../src/components/Employee/EmployeeList/shared/useEmployeeList.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { useEmployeesList } from '@gusto/embedded-api/react-query/employeesList'\nimport type { Employee } from '@gusto/embedded-api/models/components/employee'\nimport type { Job } from '@gusto/embedded-api/models/components/job'\nimport type { EmployeeOnboardingStatus as EmployeeOnboardingStatusEntity } from '@gusto/embedded-api/models/components/employeeonboardingstatus'\nimport { useEmployeesDeleteMutation } from '@gusto/embedded-api/react-query/employeesDelete'\nimport { useEmployeesUpdateOnboardingStatusMutation } from '@gusto/embedded-api/react-query/employeesUpdateOnboardingStatus'\nimport { keepPreviousData } from '@tanstack/react-query'\nimport { usePagination } from '@/hooks/usePagination/usePagination'\nimport type { PaginationControlProps } from '@/components/Common/PaginationControl/PaginationControlTypes'\nimport { useBaseSubmit } from '@/components/Base/useBaseSubmit'\nimport { composeErrorHandler } from '@/partner-hook-utils/composeErrorHandler'\nimport { EmployeeOnboardingStatus, EmployeeSelfOnboardingStatuses } from '@/shared/constants'\nimport type { HookLoadingResult, BaseHookReady } from '@/partner-hook-utils/types'\n\n/**\n * Action that may be performed on an employee row, determined by the employee's onboarding state\n * and the `employeeType` filter passed to {@link useEmployeeList}.\n *\n * @public\n */\nexport type EmployeeAction =\n 'edit' | 'delete' | 'cancel_self_onboarding' | 'review' | 'dismiss' | 'rehire'\n\n/**\n * An employee entity extended with the actions permitted on it and a reference to its primary job.\n *\n * @public\n */\nexport interface EmployeeWithActions extends Employee {\n /** Actions permitted for this employee given its onboarding status and the active filter. */\n allowedActions: EmployeeAction[]\n /** The employee's primary job, if one is marked primary. */\n primaryJob?: Job\n}\n\n/**\n * Filter applied to {@link useEmployeeList} that scopes the result set and tailors the per-row action list.\n *\n * @public\n */\nexport type EmployeeType = 'active' | 'onboarding' | 'terminated'\n\n/**\n * Props for {@link useEmployeeList}.\n *\n * @public\n */\nexport interface UseEmployeeListProps {\n /** The associated company identifier. */\n companyId: string\n /** Filters the list and tailors the allowed actions. Omit to list all employees. */\n employeeType?: EmployeeType\n}\n\n/**\n * Ready state of {@link useEmployeeList}.\n *\n * @public\n */\nexport interface UseEmployeeListReady extends BaseHookReady<\n { employees: EmployeeWithActions[] },\n { isFetching: boolean; isPending: boolean }\n> {\n /** Pagination controls for the current employee list page. */\n pagination: PaginationControlProps\n /** Actions that mutate an employee's state, gated by the entry's `allowedActions`. */\n actions: {\n /** Deletes the employee. */\n onDelete: (employeeId: string) => Promise<void>\n /** Moves the employee into the admin-review onboarding status. Resolves to the updated record, or `undefined` if the call failed. */\n onReview: (employeeId: string) => Promise<EmployeeOnboardingStatusEntity | undefined>\n /** Reverts a self-onboarding employee to admin-driven onboarding. Resolves to the updated record, or `undefined` if the call failed. */\n onCancelSelfOnboarding: (\n employeeId: string,\n ) => Promise<EmployeeOnboardingStatusEntity | undefined>\n }\n}\n\n/**\n * Return type of {@link useEmployeeList}.\n *\n * @public\n */\nexport type UseEmployeeListResult = HookLoadingResult | UseEmployeeListReady\n\nfunction deriveAllowedActions(employee: Employee, employeeType?: EmployeeType): EmployeeAction[] {\n const actions: EmployeeAction[] = []\n\n // Edit action - available for certain onboarding statuses, but not for terminated employees\n if (\n employeeType !== 'terminated' &&\n (employee.onboardingStatus === EmployeeOnboardingStatus.ADMIN_ONBOARDING_INCOMPLETE ||\n employee.onboardingStatus === EmployeeOnboardingStatus.SELF_ONBOARDING_PENDING_INVITE ||\n employee.onboardingStatus ===\n EmployeeOnboardingStatus.SELF_ONBOARDING_AWAITING_ADMIN_REVIEW ||\n employee.onboardingStatus === EmployeeOnboardingStatus.ONBOARDING_COMPLETED)\n ) {\n actions.push('edit')\n }\n\n // Cancel self onboarding - available for employees in self-onboarding flow\n if (employee.onboardingStatus && EmployeeSelfOnboardingStatuses.has(employee.onboardingStatus)) {\n actions.push('cancel_self_onboarding')\n }\n\n // Review action - available when employee completed self-onboarding\n if (\n employee.onboardingStatus === EmployeeOnboardingStatus.SELF_ONBOARDING_COMPLETED_BY_EMPLOYEE\n ) {\n actions.push('review')\n }\n\n // Delete action - available for non-onboarded employees\n if (!employee.onboarded) {\n actions.push('delete')\n }\n\n // Tab-specific actions for ManagementEmployeeList\n if (employeeType === 'active') {\n actions.push('dismiss')\n }\n\n if (employeeType === 'terminated') {\n actions.push('rehire')\n }\n\n return actions\n}\n\n/**\n * Fetches a paginated list of a company's employees and decorates each entry with the actions\n * allowed for its current onboarding state.\n *\n * @remarks\n * `employeeType` maps to a server-side filter and changes which actions appear on each row:\n * `'active'` adds `dismiss`, `'terminated'` adds `rehire`, `'onboarding'` adds none. Omit it\n * to list every employee.\n *\n * Page changes use placeholder data: the previous page stays rendered while the next one loads,\n * and `status.isFetching` flips to `true` during the request.\n *\n * @param input - Company and optional filter for the list.\n * @returns A {@link HookLoadingResult} while the first page is in flight, or a {@link UseEmployeeListReady} once data has arrived.\n * @public\n *\n * @example\n * ```tsx\n * import { useEmployeeList } from '@gusto/embedded-react-sdk'\n *\n * function EmployeeListPage({ companyId }: { companyId: string }) {\n * const employeeList = useEmployeeList({ companyId, employeeType: 'onboarding' })\n *\n * if (employeeList.isLoading) return <div>Loading...</div>\n *\n * return (\n * <ul>\n * {employeeList.data.employees.map(employee => (\n * <li key={employee.uuid}>\n * {employee.firstName} {employee.lastName}\n * {employee.allowedActions.includes('delete') && (\n * <button onClick={() => employeeList.actions.onDelete(employee.uuid)}>Delete</button>\n * )}\n * </li>\n * ))}\n * </ul>\n * )\n * }\n * ```\n */\nexport function useEmployeeList({\n companyId,\n employeeType,\n}: UseEmployeeListProps): UseEmployeeListResult {\n const { currentPage, itemsPerPage, getPaginationProps } = usePagination()\n\n const queryParams = useMemo(() => {\n const baseParams = {\n companyId,\n page: currentPage,\n per: itemsPerPage,\n }\n\n switch (employeeType) {\n case 'active':\n return { ...baseParams, onboardedActive: true }\n case 'onboarding':\n return { ...baseParams, onboarded: false }\n case 'terminated':\n return { ...baseParams, terminated: true }\n default:\n return baseParams\n }\n }, [companyId, currentPage, itemsPerPage, employeeType])\n\n const employeesQuery = useEmployeesList(queryParams, { placeholderData: keepPreviousData })\n\n const deleteEmployeeMutation = useEmployeesDeleteMutation()\n const updateOnboardingStatusMutation = useEmployeesUpdateOnboardingStatusMutation()\n\n const {\n baseSubmitHandler,\n error: submitError,\n setError: setSubmitError,\n } = useBaseSubmit('EmployeeList')\n\n const errorHandling = composeErrorHandler([employeesQuery], { submitError, setSubmitError })\n\n const isPending = deleteEmployeeMutation.isPending || updateOnboardingStatusMutation.isPending\n\n const { data, isFetching } = employeesQuery\n\n const employees = useMemo<EmployeeWithActions[]>(() => {\n return (data?.showEmployees ?? []).map(employee => {\n const primaryJob = employee.jobs?.find(job => job.primary === true)\n\n return {\n ...employee,\n allowedActions: deriveAllowedActions(employee, employeeType),\n primaryJob,\n }\n })\n }, [data?.showEmployees, employeeType])\n\n const paginationProps = data?.httpMeta.response.headers\n ? getPaginationProps(data.httpMeta.response.headers, isFetching)\n : {\n handleNextPage: () => {},\n handleFirstPage: () => {},\n handleLastPage: () => {},\n handlePreviousPage: () => {},\n handleItemsPerPageChange: () => {},\n currentPage: 1,\n totalPages: 1,\n totalCount: 0,\n itemsPerPage: 5 as const,\n }\n\n const onDelete = async (employeeId: string): Promise<void> => {\n await baseSubmitHandler(employeeId, async id => {\n await deleteEmployeeMutation.mutateAsync({\n request: { employeeId: id },\n })\n })\n }\n\n const onReview = async (\n employeeId: string,\n ): Promise<EmployeeOnboardingStatusEntity | undefined> => {\n let onboardingStatus: EmployeeOnboardingStatusEntity | undefined\n\n await baseSubmitHandler(employeeId, async id => {\n const result = await updateOnboardingStatusMutation.mutateAsync({\n request: {\n employeeId: id,\n requestBody: {\n onboardingStatus: EmployeeOnboardingStatus.SELF_ONBOARDING_AWAITING_ADMIN_REVIEW,\n },\n },\n })\n\n onboardingStatus = result.employeeOnboardingStatus\n })\n\n return onboardingStatus\n }\n\n const onCancelSelfOnboarding = async (\n employeeId: string,\n ): Promise<EmployeeOnboardingStatusEntity | undefined> => {\n let onboardingStatus: EmployeeOnboardingStatusEntity | undefined\n\n await baseSubmitHandler(employeeId, async id => {\n const result = await updateOnboardingStatusMutation.mutateAsync({\n request: {\n employeeId: id,\n requestBody: {\n onboardingStatus: EmployeeOnboardingStatus.ADMIN_ONBOARDING_INCOMPLETE,\n },\n },\n })\n\n onboardingStatus = result.employeeOnboardingStatus\n })\n\n return onboardingStatus\n }\n\n const isLoading = !data && isFetching\n\n if (isLoading) {\n return {\n isLoading: true,\n errorHandling,\n }\n }\n\n return {\n isLoading: false,\n data: {\n employees,\n },\n pagination: paginationProps,\n status: { isFetching, isPending },\n actions: { onDelete, onReview, onCancelSelfOnboarding },\n errorHandling,\n }\n}\n"],"names":["deriveAllowedActions","employee","employeeType","actions","EmployeeOnboardingStatus","EmployeeSelfOnboardingStatuses","useEmployeeList","companyId","currentPage","itemsPerPage","getPaginationProps","usePagination","queryParams","useMemo","baseParams","employeesQuery","useEmployeesList","keepPreviousData","deleteEmployeeMutation","useEmployeesDeleteMutation","updateOnboardingStatusMutation","useEmployeesUpdateOnboardingStatusMutation","baseSubmitHandler","submitError","setSubmitError","useBaseSubmit","errorHandling","composeErrorHandler","isPending","data","isFetching","employees","primaryJob","job","paginationProps","onDelete","employeeId","id","onReview","onboardingStatus","onCancelSelfOnboarding"],"mappings":";;;;;;;;;AAsFA,SAASA,EAAqBC,GAAoBC,GAA+C;AAC/F,QAAMC,IAA4B,CAAA;AAGlC,SACED,MAAiB,iBAChBD,EAAS,qBAAqBG,EAAyB,+BACtDH,EAAS,qBAAqBG,EAAyB,kCACvDH,EAAS,qBACPG,EAAyB,yCAC3BH,EAAS,qBAAqBG,EAAyB,yBAEzDD,EAAQ,KAAK,MAAM,GAIjBF,EAAS,oBAAoBI,EAA+B,IAAIJ,EAAS,gBAAgB,KAC3FE,EAAQ,KAAK,wBAAwB,GAKrCF,EAAS,qBAAqBG,EAAyB,yCAEvDD,EAAQ,KAAK,QAAQ,GAIlBF,EAAS,aACZE,EAAQ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C5B,CAAC,GAEMmC;AAAA,EACT;AAIA,SAFkB,CAACV,KAAQC,IAGlB;AAAA,IACL,WAAW;AAAA,IACX,eAAAJ;AAAA,EAAA,IAIG;AAAA,IACL,WAAW;AAAA,IACX,MAAM;AAAA,MACJ,WAAAK;AAAA,IAAA;AAAA,IAEF,YAAYG;AAAA,IACZ,QAAQ,EAAE,YAAAJ,GAAY,WAAAF,EAAA;AAAA,IACtB,SAAS,EAAE,UAAAO,GAAU,UAAAG,GAAU,wBAAAE,EAAA;AAAA,IAC/B,eAAAd;AAAA,EAAA;AAEJ;"}
@@ -34,7 +34,7 @@ export type FilingStatusValue = (typeof FILING_STATUS_VALUES)[number];
34
34
  *
35
35
  * @public
36
36
  */
37
- export type FederalTaxesField = "filingStatus" | "twoJobs" | "dependentsAmount" | "otherIncome" | "deductions" | "extraWithholding";
37
+ export type FederalTaxesField = "deductions" | "dependentsAmount" | "extraWithholding" | "filingStatus" | "otherIncome" | "twoJobs";
38
38
  /**
39
39
  * Shape of the values managed by the federal taxes form.
40
40
  *
@@ -50,7 +50,7 @@ export type FederalTaxesFormOutputs = FederalTaxesFormData;
50
50
  *
51
51
  * @public
52
52
  */
53
- export type FederalTaxesOptionalFieldsToRequire = { create?: ("twoJobs" | "dependentsAmount" | "otherIncome" | "deductions" | "extraWithholding")[] | undefined; update?: ("twoJobs" | "dependentsAmount" | "otherIncome" | "deductions" | "extraWithholding")[] | undefined; };
53
+ export type FederalTaxesOptionalFieldsToRequire = { create?: ("deductions" | "dependentsAmount" | "extraWithholding" | "otherIncome" | "twoJobs")[] | undefined; update?: ("deductions" | "dependentsAmount" | "extraWithholding" | "otherIncome" | "twoJobs")[] | undefined; };
54
54
  /** @internal */
55
55
  interface FederalTaxesSchemaOptions {
56
56
  optionalFieldsToRequire?: FederalTaxesOptionalFieldsToRequire;
@@ -136,4 +136,4 @@ export type UseFederalTaxesFormResult = HookLoadingResult | UseFederalTaxesFormR
136
136
  *
137
137
  * @public
138
138
  */
139
- export type FederalTaxesFieldsMetadata = { filingStatus: import("../../../../../partner-hook-utils/types").FieldMetadataWithOptions<"Single" | "Married" | "Head of Household" | "Exempt from withholding">; twoJobs: import("../../../../../partner-hook-utils/types").FieldMetadataWithOptions<boolean>; dependentsAmount: FieldMetadata; otherIncome: FieldMetadata; deductions: FieldMetadata; extraWithholding: FieldMetadata; };
139
+ export type FederalTaxesFieldsMetadata = { filingStatus: import("../../../../../partner-hook-utils/types").FieldMetadataWithOptions<"Exempt from withholding" | "Head of Household" | "Married" | "Single">; twoJobs: import("../../../../../partner-hook-utils/types").FieldMetadataWithOptions<boolean>; dependentsAmount: FieldMetadata; otherIncome: FieldMetadata; deductions: FieldMetadata; extraWithholding: FieldMetadata; };
@@ -18,4 +18,4 @@ export declare const INITIAL_COMPONENT_MAP: {
18
18
  *
19
19
  * @public
20
20
  */
21
- export type OnboardingExecutionInitialState = keyof typeof INITIAL_COMPONENT_MAP;
21
+ export type OnboardingExecutionInitialState = "employeeProfile";
@@ -13,9 +13,7 @@ const E = (e) => (r) => ({
13
13
  s.SELF_ONBOARDING_COMPLETED_BY_EMPLOYEE,
14
14
  s.SELF_ONBOARDING_AWAITING_ADMIN_REVIEW,
15
15
  s.ONBOARDING_COMPLETED
16
- ]), P = (e) => !(!e.withEmployeeI9 || e.onboardingStatus && M.has(e.onboardingStatus)), u = (e) => e.onboardingStatus ? !// prettier-ignore
17
- // @ts-expect-error: onboarding_status during runtime can be one of self onboarding statuses
18
- (_.has(e.onboardingStatus) || e.onboardingStatus === s.SELF_ONBOARDING_PENDING_INVITE) : !0, g = {
16
+ ]), P = (e) => !(!e.withEmployeeI9 || e.onboardingStatus && M.has(e.onboardingStatus)), u = (e) => e.onboardingStatus ? !(_.has(e.onboardingStatus) || e.onboardingStatus === s.SELF_ONBOARDING_PENDING_INVITE) : !0, g = {
19
17
  employeeProfile: a(
20
18
  o(
21
19
  n.EMPLOYEE_PROFILE_DONE,
@@ -1 +1 @@
1
- {"version":3,"file":"onboardingExecutionStateMachine.js","sources":["../../../../src/components/Employee/OnboardingExecutionFlow/onboardingExecutionStateMachine.ts"],"sourcesContent":["import { transition, reduce, state, guard } from 'robot3'\nimport {\n FederalTaxesContextual,\n StateTaxesContextual,\n DeductionsContextual,\n type OnboardingContextInterface,\n} from './OnboardingExecutionFlowComponents'\nimport {\n componentEvents,\n EmployeeSelfOnboardingStatuses,\n EmployeeOnboardingStatus,\n} from '@/shared/constants'\nimport type { MachineEventType, MachineTransition } from '@/types/Helpers'\nimport { CompensationContextual } from '@/components/Employee/Compensation'\nimport { EmployeeDocumentsContextual } from '@/components/Employee/Documents/onboarding/EmployeeDocuments'\nimport { PaymentMethodContextual } from '@/components/Employee/PaymentMethod'\nimport { ProfileContextual } from '@/components/Employee/Profile/onboarding/Profile'\nimport { OnboardingSummaryContextual } from '@/components/Employee/OnboardingSummary'\n\ntype EventPayloads = {\n [componentEvents.EMPLOYEE_PROFILE_DONE]: {\n uuid: string\n onboardingStatus: (typeof EmployeeOnboardingStatus)[keyof typeof EmployeeOnboardingStatus]\n startDate: string\n }\n}\n\nconst createReducer = (props: Partial<OnboardingContextInterface>) => {\n return (ctx: OnboardingContextInterface): OnboardingContextInterface => ({\n ...ctx,\n ...props,\n })\n}\n\nconst employeeDocumentsConfigCompletedStatuses: Set<\n (typeof EmployeeOnboardingStatus)[keyof typeof EmployeeOnboardingStatus]\n> = new Set([\n EmployeeOnboardingStatus.SELF_ONBOARDING_COMPLETED_BY_EMPLOYEE,\n EmployeeOnboardingStatus.SELF_ONBOARDING_AWAITING_ADMIN_REVIEW,\n EmployeeOnboardingStatus.ONBOARDING_COMPLETED,\n])\n\nconst employeeDocumentsGuard = (ctx: OnboardingContextInterface) => {\n if (!ctx.withEmployeeI9) return false\n if (ctx.onboardingStatus && employeeDocumentsConfigCompletedStatuses.has(ctx.onboardingStatus))\n return false\n return true\n}\n\nconst selfOnboardingGuard = (ctx: OnboardingContextInterface) =>\n ctx.onboardingStatus\n ? !(\n // prettier-ignore\n // @ts-expect-error: onboarding_status during runtime can be one of self onboarding statuses\n EmployeeSelfOnboardingStatuses.has(ctx.onboardingStatus) ||\n ctx.onboardingStatus === EmployeeOnboardingStatus.SELF_ONBOARDING_PENDING_INVITE\n )\n : true\n\n/** @internal */\nexport const onboardingExecutionMachine = {\n employeeProfile: state<MachineTransition>(\n transition(\n componentEvents.EMPLOYEE_PROFILE_DONE,\n 'compensation',\n reduce(\n (\n ctx: OnboardingContextInterface,\n ev: MachineEventType<EventPayloads, typeof componentEvents.EMPLOYEE_PROFILE_DONE>,\n ): OnboardingContextInterface => ({\n ...ctx,\n component: CompensationContextual,\n employeeId: ev.payload.uuid,\n onboardingStatus: ev.payload.onboardingStatus,\n startDate: ev.payload.startDate,\n }),\n ),\n ),\n ),\n compensation: state<MachineTransition>(\n transition(\n componentEvents.EMPLOYEE_COMPENSATION_DONE,\n 'federalTaxes',\n reduce(createReducer({ component: FederalTaxesContextual })),\n guard(selfOnboardingGuard),\n ),\n transition(\n componentEvents.EMPLOYEE_COMPENSATION_DONE,\n 'deductions',\n reduce(createReducer({ component: DeductionsContextual })),\n ),\n ),\n federalTaxes: state<MachineTransition>(\n transition(\n componentEvents.EMPLOYEE_FEDERAL_TAXES_DONE,\n 'stateTaxes',\n reduce(createReducer({ component: StateTaxesContextual })),\n guard(selfOnboardingGuard),\n ),\n ),\n stateTaxes: state<MachineTransition>(\n transition(\n componentEvents.EMPLOYEE_STATE_TAXES_DONE,\n 'paymentMethod',\n reduce(createReducer({ component: PaymentMethodContextual })),\n guard(selfOnboardingGuard),\n ),\n ),\n paymentMethod: state<MachineTransition>(\n transition(\n componentEvents.EMPLOYEE_PAYMENT_METHOD_DONE,\n 'deductions',\n reduce(createReducer({ component: DeductionsContextual })),\n ),\n ),\n deductions: state<MachineTransition>(\n transition(\n componentEvents.EMPLOYEE_DEDUCTION_DONE,\n 'employeeDocuments',\n reduce(createReducer({ component: EmployeeDocumentsContextual })),\n guard(employeeDocumentsGuard),\n ),\n transition(\n componentEvents.EMPLOYEE_DEDUCTION_DONE,\n 'summary',\n reduce(createReducer({ component: OnboardingSummaryContextual })),\n ),\n ),\n employeeDocuments: state<MachineTransition>(\n transition(\n componentEvents.EMPLOYEE_DOCUMENTS_DONE,\n 'summary',\n reduce(createReducer({ component: OnboardingSummaryContextual })),\n ),\n ),\n summary: state<MachineTransition>(),\n}\n\n/** @internal */\nexport const INITIAL_COMPONENT_MAP = {\n employeeProfile: ProfileContextual,\n} as const\n\n/**\n * The set of steps {@link OnboardingExecutionFlow} can be started on.\n *\n * @public\n */\nexport type OnboardingExecutionInitialState = keyof typeof INITIAL_COMPONENT_MAP\n"],"names":["createReducer","props","ctx","employeeDocumentsConfigCompletedStatuses","EmployeeOnboardingStatus","employeeDocumentsGuard","selfOnboardingGuard","EmployeeSelfOnboardingStatuses","onboardingExecutionMachine","state","transition","componentEvents","reduce","ev","CompensationContextual","FederalTaxesContextual","guard","DeductionsContextual","StateTaxesContextual","PaymentMethodContextual","EmployeeDocumentsContextual","OnboardingSummaryContextual","INITIAL_COMPONENT_MAP","ProfileContextual"],"mappings":";;;;;;;;AA2BA,MAAMA,IAAgB,CAACC,MACd,CAACC,OAAiE;AAAA,EACvE,GAAGA;AAAA,EACH,GAAGD;AAAA,IAIDE,wBAEE,IAAI;AAAA,EACVC,EAAyB;AAAA,EACzBA,EAAyB;AAAA,EACzBA,EAAyB;AAC3B,CAAC,GAEKC,IAAyB,CAACH,MAC1B,GAACA,EAAI,kBACLA,EAAI,oBAAoBC,EAAyC,IAAID,EAAI,gBAAgB,IAKzFI,IAAsB,CAACJ,MAC3BA,EAAI,mBACA;AAAA;AAAA,CAGEK,EAA+B,IAAIL,EAAI,gBAAgB,KACvDA,EAAI,qBAAqBE,EAAyB,kCAEpD,IAGOI,IAA6B;AAAA,EACxC,iBAAiBC;AAAA,IACfC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC;AAAA,QACE,CACEV,GACAW,OACgC;AAAA,UAChC,GAAGX;AAA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AAA;AAAA,EAClE;AAAA,EAEF,mBAAmBZ;AAAA,IACjBC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC,EAAOZ,EAAc,EAAE,WAAWqB,EAAA,CAA6B,CAAC;AAAA,IAAA;AAAA,EAClE;AAAA,EAEF,SAASZ,EAAA;AACX,GAGaa,IAAwB;AAAA,EACnC,iBAAiBC;AACnB;"}
1
+ {"version":3,"file":"onboardingExecutionStateMachine.js","sources":["../../../../src/components/Employee/OnboardingExecutionFlow/onboardingExecutionStateMachine.ts"],"sourcesContent":["import { transition, reduce, state, guard } from 'robot3'\nimport {\n FederalTaxesContextual,\n StateTaxesContextual,\n DeductionsContextual,\n type OnboardingContextInterface,\n} from './OnboardingExecutionFlowComponents'\nimport {\n componentEvents,\n EmployeeSelfOnboardingStatuses,\n EmployeeOnboardingStatus,\n} from '@/shared/constants'\nimport type { MachineEventType, MachineTransition } from '@/types/Helpers'\nimport { CompensationContextual } from '@/components/Employee/Compensation'\nimport { EmployeeDocumentsContextual } from '@/components/Employee/Documents/onboarding/EmployeeDocuments'\nimport { PaymentMethodContextual } from '@/components/Employee/PaymentMethod'\nimport { ProfileContextual } from '@/components/Employee/Profile/onboarding/Profile'\nimport { OnboardingSummaryContextual } from '@/components/Employee/OnboardingSummary'\n\ntype EventPayloads = {\n [componentEvents.EMPLOYEE_PROFILE_DONE]: {\n uuid: string\n onboardingStatus: (typeof EmployeeOnboardingStatus)[keyof typeof EmployeeOnboardingStatus]\n startDate: string\n }\n}\n\nconst createReducer = (props: Partial<OnboardingContextInterface>) => {\n return (ctx: OnboardingContextInterface): OnboardingContextInterface => ({\n ...ctx,\n ...props,\n })\n}\n\nconst employeeDocumentsConfigCompletedStatuses: Set<\n (typeof EmployeeOnboardingStatus)[keyof typeof EmployeeOnboardingStatus]\n> = new Set([\n EmployeeOnboardingStatus.SELF_ONBOARDING_COMPLETED_BY_EMPLOYEE,\n EmployeeOnboardingStatus.SELF_ONBOARDING_AWAITING_ADMIN_REVIEW,\n EmployeeOnboardingStatus.ONBOARDING_COMPLETED,\n])\n\nconst employeeDocumentsGuard = (ctx: OnboardingContextInterface) => {\n if (!ctx.withEmployeeI9) return false\n if (ctx.onboardingStatus && employeeDocumentsConfigCompletedStatuses.has(ctx.onboardingStatus))\n return false\n return true\n}\n\nconst selfOnboardingGuard = (ctx: OnboardingContextInterface) =>\n ctx.onboardingStatus\n ? !(\n EmployeeSelfOnboardingStatuses.has(ctx.onboardingStatus) ||\n ctx.onboardingStatus === EmployeeOnboardingStatus.SELF_ONBOARDING_PENDING_INVITE\n )\n : true\n\n/** @internal */\nexport const onboardingExecutionMachine = {\n employeeProfile: state<MachineTransition>(\n transition(\n componentEvents.EMPLOYEE_PROFILE_DONE,\n 'compensation',\n reduce(\n (\n ctx: OnboardingContextInterface,\n ev: MachineEventType<EventPayloads, typeof componentEvents.EMPLOYEE_PROFILE_DONE>,\n ): OnboardingContextInterface => ({\n ...ctx,\n component: CompensationContextual,\n employeeId: ev.payload.uuid,\n onboardingStatus: ev.payload.onboardingStatus,\n startDate: ev.payload.startDate,\n }),\n ),\n ),\n ),\n compensation: state<MachineTransition>(\n transition(\n componentEvents.EMPLOYEE_COMPENSATION_DONE,\n 'federalTaxes',\n reduce(createReducer({ component: FederalTaxesContextual })),\n guard(selfOnboardingGuard),\n ),\n transition(\n componentEvents.EMPLOYEE_COMPENSATION_DONE,\n 'deductions',\n reduce(createReducer({ component: DeductionsContextual })),\n ),\n ),\n federalTaxes: state<MachineTransition>(\n transition(\n componentEvents.EMPLOYEE_FEDERAL_TAXES_DONE,\n 'stateTaxes',\n reduce(createReducer({ component: StateTaxesContextual })),\n guard(selfOnboardingGuard),\n ),\n ),\n stateTaxes: state<MachineTransition>(\n transition(\n componentEvents.EMPLOYEE_STATE_TAXES_DONE,\n 'paymentMethod',\n reduce(createReducer({ component: PaymentMethodContextual })),\n guard(selfOnboardingGuard),\n ),\n ),\n paymentMethod: state<MachineTransition>(\n transition(\n componentEvents.EMPLOYEE_PAYMENT_METHOD_DONE,\n 'deductions',\n reduce(createReducer({ component: DeductionsContextual })),\n ),\n ),\n deductions: state<MachineTransition>(\n transition(\n componentEvents.EMPLOYEE_DEDUCTION_DONE,\n 'employeeDocuments',\n reduce(createReducer({ component: EmployeeDocumentsContextual })),\n guard(employeeDocumentsGuard),\n ),\n transition(\n componentEvents.EMPLOYEE_DEDUCTION_DONE,\n 'summary',\n reduce(createReducer({ component: OnboardingSummaryContextual })),\n ),\n ),\n employeeDocuments: state<MachineTransition>(\n transition(\n componentEvents.EMPLOYEE_DOCUMENTS_DONE,\n 'summary',\n reduce(createReducer({ component: OnboardingSummaryContextual })),\n ),\n ),\n summary: state<MachineTransition>(),\n}\n\n/** @internal */\nexport const INITIAL_COMPONENT_MAP = {\n employeeProfile: ProfileContextual,\n} as const\n\n/**\n * The set of steps {@link OnboardingExecutionFlow} can be started on.\n *\n * @public\n */\nexport type OnboardingExecutionInitialState = keyof typeof INITIAL_COMPONENT_MAP\n"],"names":["createReducer","props","ctx","employeeDocumentsConfigCompletedStatuses","EmployeeOnboardingStatus","employeeDocumentsGuard","selfOnboardingGuard","EmployeeSelfOnboardingStatuses","onboardingExecutionMachine","state","transition","componentEvents","reduce","ev","CompensationContextual","FederalTaxesContextual","guard","DeductionsContextual","StateTaxesContextual","PaymentMethodContextual","EmployeeDocumentsContextual","OnboardingSummaryContextual","INITIAL_COMPONENT_MAP","ProfileContextual"],"mappings":";;;;;;;;AA2BA,MAAMA,IAAgB,CAACC,MACd,CAACC,OAAiE;AAAA,EACvE,GAAGA;AAAA,EACH,GAAGD;AAAA,IAIDE,wBAEE,IAAI;AAAA,EACVC,EAAyB;AAAA,EACzBA,EAAyB;AAAA,EACzBA,EAAyB;AAC3B,CAAC,GAEKC,IAAyB,CAACH,MAC1B,GAACA,EAAI,kBACLA,EAAI,oBAAoBC,EAAyC,IAAID,EAAI,gBAAgB,IAKzFI,IAAsB,CAACJ,MAC3BA,EAAI,mBACA,EACEK,EAA+B,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,EAAOZ,EAAc,EAAE,WAAWoB,EAAA,CAA6B,CAAC;AAAA,MAChEJ,EAAMX,CAAsB;AAAA,IAAA;AAAA,IAE9BK;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC,EAAOZ,EAAc,EAAE,WAAWqB,EAAA,CAA6B,CAAC;AAAA,IAAA;AAAA,EAClE;AAAA,EAEF,mBAAmBZ;AAAA,IACjBC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC,EAAOZ,EAAc,EAAE,WAAWqB,EAAA,CAA6B,CAAC;AAAA,IAAA;AAAA,EAClE;AAAA,EAEF,SAASZ,EAAA;AACX,GAGaa,IAAwB;AAAA,EACnC,iBAAiBC;AACnB;"}
@@ -1,18 +1,18 @@
1
- import { jsx as e, jsxs as a, Fragment as I } from "react/jsx-runtime";
2
- import { useTranslation as y } from "react-i18next";
3
- import { useEmployeesGetSuspense as N } from "@gusto/embedded-api/react-query/employeesGet";
4
- import { useEmployeesGetOnboardingStatusSuspense as v } from "@gusto/embedded-api/react-query/employeesGetOnboardingStatus";
5
- import _ from "dompurify";
6
- import { useMemo as E } from "react";
1
+ import { jsx as e, jsxs as a, Fragment as C } from "react/jsx-runtime";
2
+ import { useTranslation as D } from "react-i18next";
3
+ import { useEmployeesGetSuspense as v } from "@gusto/embedded-api/react-query/employeesGet";
4
+ import { useEmployeesGetOnboardingStatusSuspense as A } from "@gusto/embedded-api/react-query/employeesGetOnboardingStatus";
5
+ import y from "dompurify";
6
+ import { useMemo as x } from "react";
7
7
  import { BaseComponent as L } from "../../Base/Base.js";
8
- import { useBase as B } from "../../Base/useBase.js";
8
+ import { useBase as T } from "../../Base/useBase.js";
9
9
  import { Flex as r } from "../../Common/Flex/Flex.js";
10
10
  import { ActionsLayout as p } from "../../Common/ActionsLayout/ActionsLayout.js";
11
- import { useComponentContext as P } from "../../../contexts/ComponentAdapter/useComponentContext.js";
12
- import { RequirementsList as T } from "../../Common/RequirementsList/RequirementsList.js";
13
- import { useI18n as w, useComponentDictionary as A } from "../../../i18n/I18n.js";
14
- import { EmployeeOnboardingStatus as S, componentEvents as u } from "../../../shared/constants.js";
15
- import { useFlow as R } from "../../Flow/useFlow.js";
11
+ import { useComponentContext as B } from "../../../contexts/ComponentAdapter/useComponentContext.js";
12
+ import { RequirementsList as P } from "../../Common/RequirementsList/RequirementsList.js";
13
+ import { useI18n as R, useComponentDictionary as w } from "../../../i18n/I18n.js";
14
+ import { EmployeeOnboardingStatus as u, EmployeeSelfOnboardingStatuses as G, componentEvents as f } from "../../../shared/constants.js";
15
+ import { useFlow as F } from "../../Flow/useFlow.js";
16
16
  const M = [
17
17
  "personal_details",
18
18
  "compensation_details",
@@ -25,79 +25,85 @@ const M = [
25
25
  "file_new_hire_report",
26
26
  "admin_review"
27
27
  ], q = (n) => n !== void 0 && M.includes(n);
28
- function F(n) {
29
- return w("Employee.OnboardingSummary"), A("Employee.OnboardingSummary", n.dictionary), /* @__PURE__ */ e(L, { ...n, children: /* @__PURE__ */ e(G, { ...n, children: n.children }) });
28
+ function $(n) {
29
+ return R("Employee.OnboardingSummary"), w("Employee.OnboardingSummary", n.dictionary), /* @__PURE__ */ e(L, { ...n, children: /* @__PURE__ */ e(j, { ...n, children: n.children }) });
30
30
  }
31
- const G = ({ employeeId: n, className: c, isAdmin: m = !1 }) => {
32
- const { onEvent: s } = B(), { t } = y("Employee.OnboardingSummary"), o = P(), {
33
- data: { employee: O }
34
- } = N({ employeeId: n }), { firstName: f, lastName: g } = O, { data: x } = v({ employeeId: n }), { onboardingStatus: h, onboardingSteps: d } = x.employeeOnboardingStatus, D = d?.length && d.findIndex((i) => i.required && !i.completed) > -1, l = h === S.ONBOARDING_COMPLETED || !D && h === S.SELF_ONBOARDING_PENDING_INVITE, b = E(() => _.sanitize(f), [f]), C = E(() => _.sanitize(g), [g]);
31
+ const j = ({ employeeId: n, className: c, isAdmin: d = !1 }) => {
32
+ const { onEvent: s } = T(), { t } = D("Employee.OnboardingSummary"), i = B(), {
33
+ data: { employee: I }
34
+ } = v({ employeeId: n }), { firstName: g, lastName: h } = I, { data: b } = A({ employeeId: n }), { onboardingStatus: m, onboardingSteps: l } = b.employeeOnboardingStatus, N = l?.length && l.findIndex((o) => o.required && !o.completed) > -1, E = m === u.ONBOARDING_COMPLETED || !N && m === u.SELF_ONBOARDING_PENDING_INVITE, S = m === u.SELF_ONBOARDING_PENDING_INVITE || m !== void 0 && G.has(m), _ = x(() => y.sanitize(g), [g]), O = x(() => y.sanitize(h), [h]);
35
35
  return /* @__PURE__ */ e("section", { className: c, children: /* @__PURE__ */ a(r, { flexDirection: "column", gap: 20, children: [
36
- /* @__PURE__ */ e(r, { alignItems: "center", flexDirection: "column", gap: 8, children: m ? l ? /* @__PURE__ */ a(r, { flexDirection: "column", gap: 4, alignItems: "center", children: [
37
- /* @__PURE__ */ e(o.Heading, { as: "h2", textAlign: "center", children: t("onboardedAdminSubtitle", {
38
- name: `${b} ${C}`,
36
+ /* @__PURE__ */ e(r, { alignItems: "center", flexDirection: "column", gap: 8, children: d ? E ? /* @__PURE__ */ a(r, { flexDirection: "column", gap: 4, alignItems: "center", children: [
37
+ /* @__PURE__ */ e(i.Heading, { as: "h2", textAlign: "center", children: t("onboardedAdminSubtitle", {
38
+ name: `${_} ${O}`,
39
39
  interpolation: { escapeValue: !1 }
40
40
  }) }),
41
- /* @__PURE__ */ e(o.Text, { variant: "supporting", children: t("onboardedAdminDescription") })
41
+ /* @__PURE__ */ e(i.Text, { variant: "supporting", children: t("onboardedAdminDescription") })
42
+ ] }) : S ? /* @__PURE__ */ a(r, { flexDirection: "column", gap: 4, alignItems: "center", children: [
43
+ /* @__PURE__ */ e(i.Heading, { as: "h2", textAlign: "center", children: t("handedOffAdminSubtitle", {
44
+ name: `${_} ${O}`,
45
+ interpolation: { escapeValue: !1 }
46
+ }) }),
47
+ /* @__PURE__ */ e(i.Text, { variant: "supporting", children: t("handedOffAdminDescription") })
42
48
  ] }) : /* @__PURE__ */ e(
43
- o.Box,
49
+ i.Box,
44
50
  {
45
51
  header: /* @__PURE__ */ a(r, { flexDirection: "column", gap: 4, children: [
46
- /* @__PURE__ */ e(o.Heading, { as: "h2", children: t("missingRequirementsSubtitle") }),
47
- /* @__PURE__ */ e(o.Text, { variant: "supporting", children: t("missingRequirementsDescription") })
52
+ /* @__PURE__ */ e(i.Heading, { as: "h2", children: t("missingRequirementsSubtitle") }),
53
+ /* @__PURE__ */ e(i.Text, { variant: "supporting", children: t("missingRequirementsDescription") })
48
54
  ] }),
49
55
  footer: /* @__PURE__ */ e(p, { children: /* @__PURE__ */ e(
50
- o.Button,
56
+ i.Button,
51
57
  {
52
58
  variant: "secondary",
53
59
  onClick: () => {
54
- s(u.EMPLOYEES_LIST);
60
+ s(f.EMPLOYEES_LIST);
55
61
  },
56
62
  children: t("doneCta")
57
63
  }
58
64
  ) }),
59
- children: d && /* @__PURE__ */ e(
60
- T,
65
+ children: l && /* @__PURE__ */ e(
66
+ P,
61
67
  {
62
- requirements: d.filter(
63
- (i) => i.completed !== void 0 && q(i.id)
64
- ).map((i) => ({
65
- completed: i.completed,
66
- title: t(`steps.${i.id}`),
67
- description: t(`stepsDescriptions.${i.id}`)
68
+ requirements: l.filter(
69
+ (o) => o.completed !== void 0 && q(o.id)
70
+ ).map((o) => ({
71
+ completed: o.completed,
72
+ title: t(`steps.${o.id}`),
73
+ description: t(`stepsDescriptions.${o.id}`)
68
74
  }))
69
75
  }
70
76
  )
71
77
  }
72
- ) : /* @__PURE__ */ e(I, { children: /* @__PURE__ */ a(r, { flexDirection: "column", gap: 20, alignItems: "center", children: [
78
+ ) : /* @__PURE__ */ e(C, { children: /* @__PURE__ */ a(r, { flexDirection: "column", gap: 20, alignItems: "center", children: [
73
79
  /* @__PURE__ */ a(r, { flexDirection: "column", gap: 4, alignItems: "center", children: [
74
- /* @__PURE__ */ e(o.Heading, { as: "h2", textAlign: "center", children: t("onboardedSelfSubtitle") }),
75
- /* @__PURE__ */ e(o.Text, { variant: "supporting", children: t("onboardedSelfDescription") })
80
+ /* @__PURE__ */ e(i.Heading, { as: "h2", textAlign: "center", children: t("onboardedSelfSubtitle") }),
81
+ /* @__PURE__ */ e(i.Text, { variant: "supporting", children: t("onboardedSelfDescription") })
76
82
  ] }),
77
- /* @__PURE__ */ e(p, { justifyContent: l ? "center" : "start", children: /* @__PURE__ */ e(
78
- o.Button,
83
+ /* @__PURE__ */ e(p, { justifyContent: "center", children: /* @__PURE__ */ e(
84
+ i.Button,
79
85
  {
80
86
  variant: "secondary",
81
87
  onClick: () => {
82
- s(u.EMPLOYEE_ONBOARDING_DONE);
88
+ s(f.EMPLOYEE_ONBOARDING_DONE);
83
89
  },
84
90
  children: t("doneCta")
85
91
  }
86
92
  ) })
87
93
  ] }) }) }),
88
- m && l && /* @__PURE__ */ e(p, { justifyContent: "center", children: /* @__PURE__ */ e(
89
- o.Button,
94
+ d && (E || S) && /* @__PURE__ */ e(p, { justifyContent: "center", children: /* @__PURE__ */ e(
95
+ i.Button,
90
96
  {
91
97
  variant: "secondary",
92
98
  onClick: () => {
93
- s(u.EMPLOYEES_LIST);
99
+ s(f.EMPLOYEES_LIST);
94
100
  },
95
101
  children: t("doneCta")
96
102
  }
97
103
  ) })
98
104
  ] }) });
99
- }, ne = () => {
100
- const { employeeId: n, onEvent: c, isAdmin: m } = R(), { t: s } = y("common");
105
+ }, ie = () => {
106
+ const { employeeId: n, onEvent: c, isAdmin: d } = F(), { t: s } = D("common");
101
107
  if (!n)
102
108
  throw new Error(
103
109
  s("errors.missingParamsOrContext", {
@@ -106,10 +112,10 @@ const G = ({ employeeId: n, className: c, isAdmin: m = !1 }) => {
106
112
  provider: "FlowProvider"
107
113
  })
108
114
  );
109
- return /* @__PURE__ */ e(F, { employeeId: n, onEvent: c, isAdmin: m });
115
+ return /* @__PURE__ */ e($, { employeeId: n, onEvent: c, isAdmin: d });
110
116
  };
111
117
  export {
112
- F as OnboardingSummary,
113
- ne as OnboardingSummaryContextual
118
+ $ as OnboardingSummary,
119
+ ie as OnboardingSummaryContextual
114
120
  };
115
121
  //# sourceMappingURL=OnboardingSummary.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"OnboardingSummary.js","sources":["../../../../src/components/Employee/OnboardingSummary/OnboardingSummary.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useEmployeesGetSuspense } from '@gusto/embedded-api/react-query/employeesGet'\nimport { useEmployeesGetOnboardingStatusSuspense } from '@gusto/embedded-api/react-query/employeesGetOnboardingStatus'\nimport DOMPurify from 'dompurify'\nimport { useMemo } from 'react'\nimport type { OnboardingContextInterface } from '../OnboardingFlow/OnboardingFlowComponents'\nimport { BaseComponent, useBase, type BaseComponentInterface } from '@/components/Base'\nimport { Flex, ActionsLayout } from '@/components/Common'\nimport { RequirementsList } from '@/components/Common/RequirementsList/RequirementsList'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\nimport { componentEvents, EmployeeOnboardingStatus } from '@/shared/constants'\nimport { useFlow } from '@/components/Flow/useFlow'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\nconst KNOWN_STEP_IDS = [\n 'personal_details',\n 'compensation_details',\n 'add_work_address',\n 'add_home_address',\n 'federal_tax_setup',\n 'state_tax_setup',\n 'direct_deposit_setup',\n 'employee_form_signing',\n 'file_new_hire_report',\n 'admin_review',\n] as const\n\ntype KnownStepId = (typeof KNOWN_STEP_IDS)[number]\n\nconst isKnownStepId = (id: string | undefined): id is KnownStepId =>\n id !== undefined && (KNOWN_STEP_IDS as readonly string[]).includes(id)\n\n/**\n * Props for {@link OnboardingSummary}.\n *\n * @public\n */\nexport interface OnboardingSummaryProps extends BaseComponentInterface<'Employee.OnboardingSummary'> {\n /** The associated employee identifier. */\n employeeId: string\n /** When `true`, renders the admin-facing view of the onboarding summary. Defaults to `false`. */\n isAdmin?: boolean\n}\n\n/**\n * Displays a summary of an employee's onboarding status, listing completed and\n * outstanding steps. Rendered as a standalone step inside `OnboardingFlow`.\n *\n * @public\n */\nexport function OnboardingSummary(props: OnboardingSummaryProps) {\n useI18n('Employee.OnboardingSummary')\n useComponentDictionary('Employee.OnboardingSummary', props.dictionary)\n\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nconst Root = ({ employeeId, className, isAdmin = false }: OnboardingSummaryProps) => {\n const { onEvent } = useBase()\n const { t } = useTranslation('Employee.OnboardingSummary')\n const Components = useComponentContext()\n\n const {\n data: { employee },\n } = useEmployeesGetSuspense({ employeeId })\n const { firstName, lastName } = employee!\n\n const { data } = useEmployeesGetOnboardingStatusSuspense({ employeeId })\n const { onboardingStatus, onboardingSteps } = data.employeeOnboardingStatus!\n\n const hasMissingRequirements =\n onboardingSteps?.length &&\n onboardingSteps.findIndex(step => step.required && !step.completed) > -1\n\n const isOnboardingCompleted =\n onboardingStatus === EmployeeOnboardingStatus.ONBOARDING_COMPLETED ||\n (!hasMissingRequirements &&\n onboardingStatus === EmployeeOnboardingStatus.SELF_ONBOARDING_PENDING_INVITE)\n\n const sanitizedFirstName = useMemo(() => DOMPurify.sanitize(firstName), [firstName])\n const sanitizedLastName = useMemo(() => DOMPurify.sanitize(lastName), [lastName])\n\n return (\n <section className={className}>\n <Flex flexDirection=\"column\" gap={20}>\n <Flex alignItems=\"center\" flexDirection=\"column\" gap={8}>\n {isAdmin ? (\n isOnboardingCompleted ? (\n <Flex flexDirection=\"column\" gap={4} alignItems=\"center\">\n <Components.Heading as=\"h2\" textAlign=\"center\">\n {t('onboardedAdminSubtitle', {\n name: `${sanitizedFirstName} ${sanitizedLastName}`,\n interpolation: { escapeValue: false },\n })}\n </Components.Heading>\n <Components.Text variant=\"supporting\">\n {t('onboardedAdminDescription')}\n </Components.Text>\n </Flex>\n ) : (\n <Components.Box\n header={\n <Flex flexDirection=\"column\" gap={4}>\n <Components.Heading as=\"h2\">\n {t('missingRequirementsSubtitle')}\n </Components.Heading>\n <Components.Text variant=\"supporting\">\n {t('missingRequirementsDescription')}\n </Components.Text>\n </Flex>\n }\n footer={\n <ActionsLayout>\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n onEvent(componentEvents.EMPLOYEES_LIST)\n }}\n >\n {t('doneCta')}\n </Components.Button>\n </ActionsLayout>\n }\n >\n {onboardingSteps && (\n <RequirementsList\n requirements={onboardingSteps\n .filter(\n (step): step is typeof step & { id: KnownStepId; completed: boolean } =>\n step.completed !== undefined && isKnownStepId(step.id),\n )\n .map(step => ({\n completed: step.completed,\n title: t(`steps.${step.id}`),\n description: t(`stepsDescriptions.${step.id}`),\n }))}\n />\n )}\n </Components.Box>\n )\n ) : (\n <>\n <Flex flexDirection=\"column\" gap={20} alignItems=\"center\">\n <Flex flexDirection=\"column\" gap={4} alignItems=\"center\">\n <Components.Heading as=\"h2\" textAlign=\"center\">\n {t('onboardedSelfSubtitle')}\n </Components.Heading>\n <Components.Text variant=\"supporting\">\n {t('onboardedSelfDescription')}\n </Components.Text>\n </Flex>\n <ActionsLayout justifyContent={isOnboardingCompleted ? 'center' : 'start'}>\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n onEvent(componentEvents.EMPLOYEE_ONBOARDING_DONE)\n }}\n >\n {t('doneCta')}\n </Components.Button>\n </ActionsLayout>\n </Flex>\n </>\n )}\n </Flex>\n\n {isAdmin && isOnboardingCompleted && (\n <ActionsLayout justifyContent={'center'}>\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n onEvent(componentEvents.EMPLOYEES_LIST)\n }}\n >\n {t('doneCta')}\n </Components.Button>\n </ActionsLayout>\n )}\n </Flex>\n </section>\n )\n}\n\n/** @internal */\nexport const OnboardingSummaryContextual = () => {\n const { employeeId, onEvent, isAdmin } = useFlow<OnboardingContextInterface>()\n const { t } = useTranslation('common')\n\n if (!employeeId) {\n throw new Error(\n t('errors.missingParamsOrContext', {\n component: 'Summary',\n param: 'employeeId',\n provider: 'FlowProvider',\n }),\n )\n }\n return <OnboardingSummary employeeId={employeeId} onEvent={onEvent} isAdmin={isAdmin} />\n}\n"],"names":["KNOWN_STEP_IDS","isKnownStepId","id","OnboardingSummary","props","useI18n","useComponentDictionary","jsx","BaseComponent","Root","employeeId","className","isAdmin","onEvent","useBase","useTranslation","Components","useComponentContext","employee","useEmployeesGetSuspense","firstName","lastName","data","useEmployeesGetOnboardingStatusSuspense","onboardingStatus","onboardingSteps","hasMissingRequirements","step","isOnboardingCompleted","EmployeeOnboardingStatus","sanitizedFirstName","useMemo","DOMPurify","sanitizedLastName","jsxs","Flex","ActionsLayout","componentEvents","RequirementsList","OnboardingSummaryContextual","useFlow","t"],"mappings":";;;;;;;;;;;;;;;AAeA,MAAMA,IAAiB;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAIMC,IAAgB,CAACC,MACrBA,MAAO,UAAcF,EAAqC,SAASE,CAAE;AAoBhE,SAASC,EAAkBC,GAA+B;AAC/D,SAAAC,EAAQ,4BAA4B,GACpCC,EAAuB,8BAA8BF,EAAM,UAAU,GAGnE,gBAAAG,EAACC,GAAA,EAAe,GAAGJ,GACjB,UAAA,gBAAAG,EAACE,KAAM,GAAGL,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,MAAMK,IAAO,CAAC,EAAE,YAAAC,GAAY,WAAAC,GAAW,SAAAC,IAAU,SAAoC;AACnF,QAAM,EAAE,SAAAC,EAAA,IAAYC,EAAA,GACd,EAAE,EAAA,IAAMC,EAAe,4BAA4B,GACnDC,IAAaC,EAAA,GAEb;AAAA,IACJ,MAAM,EAAE,UAAAC,EAAA;AAAA,EAAS,IACfC,EAAwB,EAAE,YAAAT,GAAY,GACpC,EAAE,WAAAU,GAAW,UAAAC,EAAA,IAAaH,GAE1B,EAAE,MAAAI,EAAA,IAASC,EAAwC,EAAE,YAAAb,GAAY,GACjE,EAAE,kBAAAc,GAAkB,iBAAAC,EAA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GAEJ;AAAA,IAECzB,KAAWgB,KACV,gBAAArB,EAAC6B,GAAA,EAAc,gBAAgB,UAC7B,UAAA,gBAAA7B;AAAA,MAACS,EAAW;AAAA,MAAX;AAAA,QACC,SAAQ;AAAA,QACR,SAAS,MAAM;AACb,UAAAH,EAAQwB,EAAgB,cAAc;AAAA,QACxC;AAAA,QAEC,YAAE,SAAS;AAAA,MAAA;AAAA,IAAA,EACd,CACF;AAAA,EAAA,EAAA,CAEJ,EAAA,CACF;AAEJ,GAGaE,KAA8B,MAAM;AAC/C,QAAM,EAAE,YAAA7B,GAAY,SAAAG,GAAS,SAAAD,EAAA,IAAY4B,EAAA,GACnC,EAAE,GAAAC,EAAA,IAAM1B,EAAe,QAAQ;AAErC,MAAI,CAACL;AACH,UAAM,IAAI;AAAA,MACR+B,EAAE,iCAAiC;AAAA,QACjC,WAAW;AAAA,QACX,OAAO;AAAA,QACP,UAAU;AAAA,MAAA,CACX;AAAA,IAAA;AAGL,SAAO,gBAAAlC,EAACJ,GAAA,EAAkB,YAAAO,GAAwB,SAAAG,GAAkB,SAAAD,EAAA,CAAkB;AACxF;"}
1
+ {"version":3,"file":"OnboardingSummary.js","sources":["../../../../src/components/Employee/OnboardingSummary/OnboardingSummary.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useEmployeesGetSuspense } from '@gusto/embedded-api/react-query/employeesGet'\nimport { useEmployeesGetOnboardingStatusSuspense } from '@gusto/embedded-api/react-query/employeesGetOnboardingStatus'\nimport DOMPurify from 'dompurify'\nimport { useMemo } from 'react'\nimport type { OnboardingContextInterface } from '../OnboardingFlow/OnboardingFlowComponents'\nimport { BaseComponent, useBase, type BaseComponentInterface } from '@/components/Base'\nimport { Flex, ActionsLayout } from '@/components/Common'\nimport { RequirementsList } from '@/components/Common/RequirementsList/RequirementsList'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\nimport {\n componentEvents,\n EmployeeOnboardingStatus,\n EmployeeSelfOnboardingStatuses,\n} from '@/shared/constants'\nimport { useFlow } from '@/components/Flow/useFlow'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\nconst KNOWN_STEP_IDS = [\n 'personal_details',\n 'compensation_details',\n 'add_work_address',\n 'add_home_address',\n 'federal_tax_setup',\n 'state_tax_setup',\n 'direct_deposit_setup',\n 'employee_form_signing',\n 'file_new_hire_report',\n 'admin_review',\n] as const\n\ntype KnownStepId = (typeof KNOWN_STEP_IDS)[number]\n\nconst isKnownStepId = (id: string | undefined): id is KnownStepId =>\n id !== undefined && (KNOWN_STEP_IDS as readonly string[]).includes(id)\n\n/**\n * Props for {@link OnboardingSummary}.\n *\n * @public\n */\nexport interface OnboardingSummaryProps extends BaseComponentInterface<'Employee.OnboardingSummary'> {\n /** The associated employee identifier. */\n employeeId: string\n /** When `true`, renders the admin-facing view of the onboarding summary. Defaults to `false`. */\n isAdmin?: boolean\n}\n\n/**\n * Displays a summary of an employee's onboarding status, listing completed and\n * outstanding steps. Rendered as a standalone step inside `OnboardingFlow`.\n *\n * @public\n */\nexport function OnboardingSummary(props: OnboardingSummaryProps) {\n useI18n('Employee.OnboardingSummary')\n useComponentDictionary('Employee.OnboardingSummary', props.dictionary)\n\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nconst Root = ({ employeeId, className, isAdmin = false }: OnboardingSummaryProps) => {\n const { onEvent } = useBase()\n const { t } = useTranslation('Employee.OnboardingSummary')\n const Components = useComponentContext()\n\n const {\n data: { employee },\n } = useEmployeesGetSuspense({ employeeId })\n const { firstName, lastName } = employee!\n\n const { data } = useEmployeesGetOnboardingStatusSuspense({ employeeId })\n const { onboardingStatus, onboardingSteps } = data.employeeOnboardingStatus!\n\n const hasMissingRequirements =\n onboardingSteps?.length &&\n onboardingSteps.findIndex(step => step.required && !step.completed) > -1\n\n const isOnboardingCompleted =\n onboardingStatus === EmployeeOnboardingStatus.ONBOARDING_COMPLETED ||\n (!hasMissingRequirements &&\n onboardingStatus === EmployeeOnboardingStatus.SELF_ONBOARDING_PENDING_INVITE)\n\n const isEmployeeCompletingSelfOnboarding =\n onboardingStatus === EmployeeOnboardingStatus.SELF_ONBOARDING_PENDING_INVITE ||\n (onboardingStatus !== undefined && EmployeeSelfOnboardingStatuses.has(onboardingStatus))\n\n const sanitizedFirstName = useMemo(() => DOMPurify.sanitize(firstName), [firstName])\n const sanitizedLastName = useMemo(() => DOMPurify.sanitize(lastName), [lastName])\n\n return (\n <section className={className}>\n <Flex flexDirection=\"column\" gap={20}>\n <Flex alignItems=\"center\" flexDirection=\"column\" gap={8}>\n {isAdmin ? (\n isOnboardingCompleted ? (\n <Flex flexDirection=\"column\" gap={4} alignItems=\"center\">\n <Components.Heading as=\"h2\" textAlign=\"center\">\n {t('onboardedAdminSubtitle', {\n name: `${sanitizedFirstName} ${sanitizedLastName}`,\n interpolation: { escapeValue: false },\n })}\n </Components.Heading>\n <Components.Text variant=\"supporting\">\n {t('onboardedAdminDescription')}\n </Components.Text>\n </Flex>\n ) : isEmployeeCompletingSelfOnboarding ? (\n <Flex flexDirection=\"column\" gap={4} alignItems=\"center\">\n <Components.Heading as=\"h2\" textAlign=\"center\">\n {t('handedOffAdminSubtitle', {\n name: `${sanitizedFirstName} ${sanitizedLastName}`,\n interpolation: { escapeValue: false },\n })}\n </Components.Heading>\n <Components.Text variant=\"supporting\">\n {t('handedOffAdminDescription')}\n </Components.Text>\n </Flex>\n ) : (\n <Components.Box\n header={\n <Flex flexDirection=\"column\" gap={4}>\n <Components.Heading as=\"h2\">\n {t('missingRequirementsSubtitle')}\n </Components.Heading>\n <Components.Text variant=\"supporting\">\n {t('missingRequirementsDescription')}\n </Components.Text>\n </Flex>\n }\n footer={\n <ActionsLayout>\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n onEvent(componentEvents.EMPLOYEES_LIST)\n }}\n >\n {t('doneCta')}\n </Components.Button>\n </ActionsLayout>\n }\n >\n {onboardingSteps && (\n <RequirementsList\n requirements={onboardingSteps\n .filter(\n (step): step is typeof step & { id: KnownStepId; completed: boolean } =>\n step.completed !== undefined && isKnownStepId(step.id),\n )\n .map(step => ({\n completed: step.completed,\n title: t(`steps.${step.id}`),\n description: t(`stepsDescriptions.${step.id}`),\n }))}\n />\n )}\n </Components.Box>\n )\n ) : (\n <>\n <Flex flexDirection=\"column\" gap={20} alignItems=\"center\">\n <Flex flexDirection=\"column\" gap={4} alignItems=\"center\">\n <Components.Heading as=\"h2\" textAlign=\"center\">\n {t('onboardedSelfSubtitle')}\n </Components.Heading>\n <Components.Text variant=\"supporting\">\n {t('onboardedSelfDescription')}\n </Components.Text>\n </Flex>\n <ActionsLayout justifyContent=\"center\">\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n onEvent(componentEvents.EMPLOYEE_ONBOARDING_DONE)\n }}\n >\n {t('doneCta')}\n </Components.Button>\n </ActionsLayout>\n </Flex>\n </>\n )}\n </Flex>\n\n {isAdmin && (isOnboardingCompleted || isEmployeeCompletingSelfOnboarding) && (\n <ActionsLayout justifyContent={'center'}>\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n onEvent(componentEvents.EMPLOYEES_LIST)\n }}\n >\n {t('doneCta')}\n </Components.Button>\n </ActionsLayout>\n )}\n </Flex>\n </section>\n )\n}\n\n/** @internal */\nexport const OnboardingSummaryContextual = () => {\n const { employeeId, onEvent, isAdmin } = useFlow<OnboardingContextInterface>()\n const { t } = useTranslation('common')\n\n if (!employeeId) {\n throw new Error(\n t('errors.missingParamsOrContext', {\n component: 'Summary',\n param: 'employeeId',\n provider: 'FlowProvider',\n }),\n )\n }\n return <OnboardingSummary employeeId={employeeId} onEvent={onEvent} isAdmin={isAdmin} />\n}\n"],"names":["KNOWN_STEP_IDS","isKnownStepId","id","OnboardingSummary","props","useI18n","useComponentDictionary","jsx","BaseComponent","Root","employeeId","className","isAdmin","onEvent","useBase","useTranslation","Components","useComponentContext","employee","useEmployeesGetSuspense","firstName","lastName","data","useEmployeesGetOnboardingStatusSuspense","onboardingStatus","onboardingSteps","hasMissingRequirements","step","isOnboardingCompleted","EmployeeOnboardingStatus","isEmployeeCompletingSelfOnboarding","EmployeeSelfOnboardingStatuses","sanitizedFirstName","useMemo","DOMPurify","sanitizedLastName","jsxs","Flex","ActionsLayout","componentEvents","RequirementsList","OnboardingSummaryContextual","useFlow","t"],"mappings":";;;;;;;;;;;;;;;AAmBA,MAAMA,IAAiB;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAIMC,IAAgB,CAACC,MACrBA,MAAO,UAAcF,EAAqC,SAASE,CAAE;AAoBhE,SAASC,EAAkBC,GAA+B;AAC/D,SAAAC,EAAQ,4BAA4B,GACpCC,EAAuB,8BAA8BF,EAAM,UAAU,GAGnE,gBAAAG,EAACC,GAAA,EAAe,GAAGJ,GACjB,UAAA,gBAAAG,EAACE,KAAM,GAAGL,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,MAAMK,IAAO,CAAC,EAAE,YAAAC,GAAY,WAAAC,GAAW,SAAAC,IAAU,SAAoC;AACnF,QAAM,EAAE,SAAAC,EAAA,IAAYC,EAAA,GACd,EAAE,EAAA,IAAMC,EAAe,4BAA4B,GACnDC,IAAaC,EAAA,GAEb;AAAA,IACJ,MAAM,EAAE,UAAAC,EAAA;AAAA,EAAS,IACfC,EAAwB,EAAE,YAAAT,GAAY,GACpC,EAAE,WAAAU,GAAW,UAAAC,EAAA,IAAaH,GAE1B,EAAE,MAAAI,EAAA,IAASC,EAAwC,EAAE,YAAAb,GAAY,GACjE,EAAE,kBAAAc,GAAkB,iBAAAC,EAAA,IAAoBH,EAAK,0BAE7CI,IACJD,GAAiB,UACjBA,EAAgB,UAAU,CAAAE,MAAQA,EAAK,YAAY,CAACA,EAAK,SAAS,IAAI,IAElEC,IACJJ,MAAqBK,E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AE,0BAA0B,EAAA,CAC/B;AAAA,MAAA,GACF;AAAA,MACA,gBAAAT,EAAC+B,GAAA,EAAc,gBAAe,UAC5B,UAAA,gBAAA/B;AAAA,QAACS,EAAW;AAAA,QAAX;AAAA,UACC,SAAQ;AAAA,UACR,SAAS,MAAM;AACb,YAAAH,EAAQ0B,EAAgB,wBAAwB;AAAA,UAClD;AAAA,UAEC,YAAE,SAAS;AAAA,QAAA;AAAA,MAAA,EACd,CACF;AAAA,IAAA,EAAA,CACF,GACF,GAEJ;AAAA,IAEC3B,MAAYgB,KAAyBE,MACpC,gBAAAvB,EAAC+B,GAAA,EAAc,gBAAgB,UAC7B,UAAA,gBAAA/B;AAAA,MAACS,EAAW;AAAA,MAAX;AAAA,QACC,SAAQ;AAAA,QACR,SAAS,MAAM;AACb,UAAAH,EAAQ0B,EAAgB,cAAc;AAAA,QACxC;AAAA,QAEC,YAAE,SAAS;AAAA,MAAA;AAAA,IAAA,EACd,CACF;AAAA,EAAA,EAAA,CAEJ,EAAA,CACF;AAEJ,GAGaE,KAA8B,MAAM;AAC/C,QAAM,EAAE,YAAA/B,GAAY,SAAAG,GAAS,SAAAD,EAAA,IAAY8B,EAAA,GACnC,EAAE,GAAAC,EAAA,IAAM5B,EAAe,QAAQ;AAErC,MAAI,CAACL;AACH,UAAM,IAAI;AAAA,MACRiC,EAAE,iCAAiC;AAAA,QACjC,WAAW;AAAA,QACX,OAAO;AAAA,QACP,UAAU;AAAA,MAAA,CACX;AAAA,IAAA;AAGL,SAAO,gBAAApC,EAACJ,GAAA,EAAkB,YAAAO,GAAwB,SAAAG,GAAkB,SAAAD,EAAA,CAAkB;AACxF;"}
@@ -35,7 +35,7 @@ export type AccountType = (typeof ACCOUNT_TYPES)[number];
35
35
  *
36
36
  * @public
37
37
  */
38
- export type BankFormField = "name" | "accountNumber" | "routingNumber" | "accountType";
38
+ export type BankFormField = "accountNumber" | "accountType" | "name" | "routingNumber";
39
39
  /**
40
40
  * Shape of the values managed by the bank account form.
41
41
  *
@@ -46,7 +46,7 @@ export type SplitByValue = (typeof SPLIT_BY_VALUES)[number];
46
46
  *
47
47
  * @public
48
48
  */
49
- export type SplitPaymentsFormField = "splitBy" | "splitAmount" | "priority";
49
+ export type SplitPaymentsFormField = "priority" | "splitAmount" | "splitBy";
50
50
  /**
51
51
  * Shape of the values managed by the split payments form. `splitAmount` and
52
52
  * `priority` are keyed by bank account uuid.
@@ -25,7 +25,7 @@ export type EmployeeDetailsErrorCode = (typeof EmployeeDetailsErrorCodes)[keyof
25
25
  *
26
26
  * @public
27
27
  */
28
- export type EmployeeDetailsField = "ssn" | "email" | "firstName" | "lastName" | "middleInitial" | "dateOfBirth";
28
+ export type EmployeeDetailsField = "dateOfBirth" | "email" | "firstName" | "lastName" | "middleInitial" | "ssn";
29
29
  /**
30
30
  * Shape of the values managed by the employee details form.
31
31
  *
@@ -41,7 +41,7 @@ export type EmployeeDetailsFormOutputs = EmployeeDetailsFormData;
41
41
  *
42
42
  * @public
43
43
  */
44
- export type EmployeeDetailsOptionalFieldsToRequire = { create?: ("ssn" | "email" | "middleInitial" | "dateOfBirth")[] | undefined; update?: ("ssn" | "email" | "firstName" | "lastName" | "middleInitial" | "dateOfBirth")[] | undefined; };
44
+ export type EmployeeDetailsOptionalFieldsToRequire = { create?: ("dateOfBirth" | "email" | "middleInitial" | "ssn")[] | undefined; update?: ("dateOfBirth" | "email" | "firstName" | "lastName" | "middleInitial" | "ssn")[] | undefined; };
45
45
  /** @internal */
46
46
  interface EmployeeDetailsSchemaOptions {
47
47
  mode?: 'create' | 'update';
@@ -22,7 +22,7 @@ export type HomeAddressErrorCode = (typeof HomeAddressErrorCodes)[keyof typeof H
22
22
  *
23
23
  * @public
24
24
  */
25
- export type HomeAddressField = "street1" | "street2" | "city" | "state" | "zip" | "effectiveDate" | "courtesyWithholding";
25
+ export type HomeAddressField = "city" | "courtesyWithholding" | "effectiveDate" | "state" | "street1" | "street2" | "zip";
26
26
  /**
27
27
  * Shape of the values managed by the home address form.
28
28
  *
@@ -159,4 +159,4 @@ export type UseHomeAddressFormResult = HookLoadingResult | UseHomeAddressFormRea
159
159
  *
160
160
  * @public
161
161
  */
162
- export type HomeAddressFieldsMetadata = { street1: FieldMetadata; street2: FieldMetadata; city: FieldMetadata; state: import("../../../../../partner-hook-utils/types").FieldMetadataWithOptions<"AL" | "AK" | "AZ" | "AR" | "CA" | "CO" | "CT" | "DE" | "DC" | "FL" | "GA" | "HI" | "ID" | "IL" | "IN" | "IA" | "KS" | "KY" | "LA" | "ME" | "MD" | "MA" | "MI" | "MN" | "MS" | "MO" | "MT" | "NE" | "NV" | "NH" | "NJ" | "NM" | "NY" | "NC" | "ND" | "OH" | "OK" | "OR" | "PA" | "RI" | "SC" | "SD" | "TN" | "TX" | "UT" | "VT" | "VA" | "WA" | "WV" | "WI" | "WY">; zip: FieldMetadata; courtesyWithholding: FieldMetadata; effectiveDate: FieldMetadata; };
162
+ export type HomeAddressFieldsMetadata = { street1: FieldMetadata; street2: FieldMetadata; city: FieldMetadata; state: import("../../../../../partner-hook-utils/types").FieldMetadataWithOptions<"AK" | "AL" | "AR" | "AZ" | "CA" | "CO" | "CT" | "DC" | "DE" | "FL" | "GA" | "HI" | "IA" | "ID" | "IL" | "IN" | "KS" | "KY" | "LA" | "MA" | "MD" | "ME" | "MI" | "MN" | "MO" | "MS" | "MT" | "NC" | "ND" | "NE" | "NH" | "NJ" | "NM" | "NV" | "NY" | "OH" | "OK" | "OR" | "PA" | "RI" | "SC" | "SD" | "TN" | "TX" | "UT" | "VA" | "VT" | "WA" | "WI" | "WV" | "WY">; zip: FieldMetadata; courtesyWithholding: FieldMetadata; effectiveDate: FieldMetadata; };
@@ -4,7 +4,7 @@ export type { EmployeeListFlowProps } from '../EmployeeListFlow';
4
4
  export { Documents, DocumentsCard, DocumentManager } from '../Documents/management';
5
5
  export type { DocumentsProps, DocumentsCardProps, DocumentManagerProps, } from '../Documents/management';
6
6
  export { DashboardFlow, Dashboard } from '../Dashboard';
7
- export type { DashboardFlowProps, DashboardProps } from '../Dashboard';
7
+ export type { DashboardFlowProps, DashboardProps, DashboardTab } from '../Dashboard';
8
8
  export { HomeAddress, HomeAddressCard, HomeAddressEditForm } from '../HomeAddress/management';
9
9
  export type { HomeAddressProps, HomeAddressCardProps, HomeAddressEditFormProps, } from '../HomeAddress/management';
10
10
  export { WorkAddress, WorkAddressCard, WorkAddressEditForm } from '../WorkAddress/management';
@@ -43,8 +43,7 @@ export interface InformationRequestFormProps extends BaseComponentInterface<'Inf
43
43
  * @public
44
44
  */
45
45
  export declare function InformationRequestForm(props: InformationRequestFormProps): import("react").JSX.Element;
46
- export declare namespace InformationRequestForm {
47
- var Footer: ({ onEvent }: {
48
- onEvent: OnEventType<EventType, unknown>;
49
- }) => import("react").JSX.Element;
50
- }
46
+ /** @internal */
47
+ export declare function Footer({ onEvent }: {
48
+ onEvent: OnEventType<EventType, unknown>;
49
+ }): import("react").JSX.Element;