@gusto/embedded-react-sdk 0.41.0 → 0.42.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.
- package/CHANGELOG.md +26 -0
- package/dist/assets/icons/house.svg.js +10 -0
- package/dist/assets/icons/house.svg.js.map +1 -0
- package/dist/components/Base/Base.js +2 -3
- package/dist/components/Base/Base.js.map +1 -1
- package/dist/components/Common/EmptyData/EmptyData.d.ts +3 -0
- package/dist/components/Common/EmptyData/EmptyData.js +11 -11
- package/dist/components/Common/EmptyData/EmptyData.js.map +1 -1
- package/dist/components/Common/EmptyData/EmptyData.module.scss.js +8 -6
- package/dist/components/Common/EmptyData/EmptyData.module.scss.js.map +1 -1
- package/dist/components/Common/UI/Input/InputTypes.d.ts +1 -1
- package/dist/components/Common/UI/Input/InputTypes.js.map +1 -1
- package/dist/components/Common/UI/TextInput/TextInput.js +37 -35
- package/dist/components/Common/UI/TextInput/TextInput.js.map +1 -1
- package/dist/components/Common/UI/TextInput/TextInputTypes.d.ts +1 -1
- package/dist/components/Common/UI/TextInput/TextInputTypes.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatory.js +6 -8
- package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +6 -8
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +8 -10
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +6 -7
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +2 -3
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +3 -4
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +6 -8
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +5 -6
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +9 -10
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +3 -4
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/TitleSelect.js +2 -3
- package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +5 -6
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +8 -9
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js +7 -8
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +3 -4
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js +10 -12
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +11 -13
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +4 -5
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +5 -7
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +8 -10
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +3 -4
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.d.ts +0 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +9 -11
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Actions.js +7 -9
- package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Company/FederalTaxes/FederalTaxes.js +7 -9
- package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Form.js +2 -3
- package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +5 -6
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Actions.js +5 -7
- package/dist/components/Company/Industry/Actions.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +6 -7
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Industry/Edit.js +10 -12
- package/dist/components/Company/Industry/Edit.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Actions.js +6 -8
- package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Form.js +4 -5
- package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/LocationForm.js +2 -4
- package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +3 -4
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/Actions.js +6 -8
- package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/List.js +8 -10
- package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +6 -8
- package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +3 -4
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingFlow/OnboardingFlow.js +11 -15
- package/dist/components/Company/OnboardingFlow/OnboardingFlow.js.map +1 -1
- package/dist/components/Company/OnboardingFlow/onboardingStateMachine.js +37 -35
- package/dist/components/Company/OnboardingFlow/onboardingStateMachine.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/Completed.js +5 -6
- package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js +5 -6
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +2 -4
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +3 -4
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/PayScheduleForm.js +87 -100
- package/dist/components/Company/PaySchedule/PayScheduleForm.js.map +1 -1
- package/dist/components/Company/PaySchedule/PayScheduleForm.module.scss.js +8 -10
- package/dist/components/Company/PaySchedule/PayScheduleForm.module.scss.js.map +1 -1
- package/dist/components/Company/PaySchedule/PayScheduleList.js +2 -3
- package/dist/components/Company/PaySchedule/PayScheduleList.js.map +1 -1
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/usePayScheduleForm.d.ts +11 -1
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/usePayScheduleForm.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +5 -7
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +3 -4
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +6 -8
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js +5 -7
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +3 -4
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Contractor/Address/Address.js +2 -4
- package/dist/components/Contractor/Address/Address.js.map +1 -1
- package/dist/components/Contractor/Address/Form.js +6 -7
- package/dist/components/Contractor/Address/Form.js.map +1 -1
- package/dist/components/Contractor/Address/useAddress.js +5 -6
- package/dist/components/Contractor/Address/useAddress.js.map +1 -1
- package/dist/components/Contractor/ContractorList/index.js +2 -3
- package/dist/components/Contractor/ContractorList/index.js.map +1 -1
- package/dist/components/Contractor/NewHireReport/NewHireReport.js +2 -3
- package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
- package/dist/components/Contractor/OnboardingFlow/OnboardingFlow.js +13 -16
- package/dist/components/Contractor/OnboardingFlow/OnboardingFlow.js.map +1 -1
- package/dist/components/Contractor/OnboardingFlow/onboardingStateMachine.js +61 -63
- package/dist/components/Contractor/OnboardingFlow/onboardingStateMachine.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +4 -6
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +2 -3
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +2 -3
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +2 -3
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +2 -3
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js +2 -3
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +2 -3
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlow.js +11 -11
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlow.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js +88 -111
- package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js +2 -3
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js +13 -14
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js +2 -3
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +2 -3
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
- package/dist/components/Contractor/Profile/useContractorProfile.js +2 -3
- package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
- package/dist/components/Contractor/Submit/Submit.js +2 -3
- package/dist/components/Contractor/Submit/Submit.js.map +1 -1
- package/dist/components/Employee/Compensation/Actions.js +5 -6
- package/dist/components/Employee/Compensation/Actions.js.map +1 -1
- package/dist/components/Employee/Compensation/Edit.js +14 -15
- package/dist/components/Employee/Compensation/Edit.js.map +1 -1
- package/dist/components/Employee/Compensation/List.js +23 -25
- package/dist/components/Employee/Compensation/List.js.map +1 -1
- package/dist/components/Employee/Dashboard/DashboardComponents.d.ts +2 -0
- package/dist/components/Employee/Dashboard/DashboardComponents.js +18 -6
- package/dist/components/Employee/Dashboard/DashboardComponents.js.map +1 -1
- package/dist/components/Employee/Dashboard/dashboardStateMachine.d.ts +2 -0
- package/dist/components/Employee/Dashboard/dashboardStateMachine.js +55 -4
- package/dist/components/Employee/Dashboard/dashboardStateMachine.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +2 -3
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +2 -3
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +2 -3
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +6 -7
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js.map +1 -1
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js +2 -3
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +6 -8
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +9 -11
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js +2 -3
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +3 -4
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js +7 -8
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.d.ts +0 -33
- package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.js +130 -215
- package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +79 -58
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/fields.d.ts +2 -3
- package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/fields.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/index.d.ts +2 -2
- package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/signEmployeeFormSchema.d.ts +0 -1
- package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/signEmployeeFormSchema.js +33 -49
- package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/signEmployeeFormSchema.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/useSignEmployeeForm.d.ts +12 -3
- package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/useSignEmployeeForm.js.map +1 -1
- package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.js +2 -3
- package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.js.map +1 -1
- package/dist/components/Employee/EmployeeList/management/ManagementEmployeeList.js.map +1 -0
- package/dist/components/Employee/{employee-list → EmployeeList}/management/ManagementEmployeeListView.js +2 -3
- package/dist/components/Employee/EmployeeList/management/ManagementEmployeeListView.js.map +1 -0
- package/dist/components/Employee/EmployeeList/onboarding/EmployeeList.js.map +1 -0
- package/dist/components/Employee/{employee-list → EmployeeList}/onboarding/EmployeeListView.js +34 -35
- package/dist/components/Employee/EmployeeList/onboarding/EmployeeListView.js.map +1 -0
- package/dist/components/Employee/EmployeeList/shared/useEmployeeList.js.map +1 -0
- package/dist/components/Employee/FederalTaxes/Actions.js +6 -8
- package/dist/components/Employee/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/FederalForm.js +4 -6
- package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +3 -4
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Employee/HomeAddress/management/HomeAddress.d.ts +6 -0
- package/dist/components/Employee/HomeAddress/management/HomeAddress.js +48 -0
- package/dist/components/Employee/HomeAddress/management/HomeAddress.js.map +1 -0
- package/dist/components/Employee/HomeAddress/management/HomeAddressView.d.ts +18 -0
- package/dist/components/Employee/HomeAddress/management/HomeAddressView.js +476 -0
- package/dist/components/Employee/HomeAddress/management/HomeAddressView.js.map +1 -0
- package/dist/components/Employee/HomeAddress/management/getPendingFutureHomeAddress.d.ts +8 -0
- package/dist/components/Employee/HomeAddress/management/getPendingFutureHomeAddress.js +36 -0
- package/dist/components/Employee/HomeAddress/management/getPendingFutureHomeAddress.js.map +1 -0
- package/dist/components/Employee/HomeAddress/management/getPendingFutureHomeAddress.test.d.ts +1 -0
- package/dist/components/Employee/HomeAddress/management/useHomeAddressManagement.d.ts +45 -0
- package/dist/components/Employee/HomeAddress/management/useHomeAddressManagement.js +112 -0
- package/dist/components/Employee/HomeAddress/management/useHomeAddressManagement.js.map +1 -0
- package/dist/components/Employee/Landing/Landing.js +6 -7
- package/dist/components/Employee/Landing/Landing.js.map +1 -1
- package/dist/components/Employee/OnboardingFlow/OnboardingFlowComponents.js +1 -1
- package/dist/components/Employee/OnboardingFlow/OnboardingFlowComponents.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/Actions.js +7 -9
- package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +4 -5
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js +6 -7
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +6 -7
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/Split.js +25 -25
- package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +6 -7
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
- package/dist/components/Employee/Profile/AdminProfile.js +42 -42
- package/dist/components/Employee/Profile/AdminProfile.js.map +1 -1
- package/dist/components/Employee/Profile/EmployeeProfile.js +40 -36
- package/dist/components/Employee/Profile/EmployeeProfile.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/useEmployeeDetailsForm.js +37 -36
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/useEmployeeDetailsForm.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/index.d.ts +2 -0
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/useCurrentHomeAddressForm.d.ts +3 -0
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/useCurrentHomeAddressForm.js +24 -0
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/useCurrentHomeAddressForm.js.map +1 -0
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/useHomeAddressForm.d.ts +9 -3
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/useHomeAddressForm.js +97 -97
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/useHomeAddressForm.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/index.d.ts +2 -0
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/useCurrentWorkAddressForm.d.ts +3 -0
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/useCurrentWorkAddressForm.js +24 -0
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/useCurrentWorkAddressForm.js.map +1 -0
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/useWorkAddressForm.d.ts +10 -4
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/useWorkAddressForm.js +95 -84
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/useWorkAddressForm.js.map +1 -1
- package/dist/components/Employee/StateTaxes/Actions.js +8 -10
- package/dist/components/Employee/StateTaxes/Actions.js.map +1 -1
- package/dist/components/Employee/StateTaxes/useStateTaxes.js +3 -4
- package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
- package/dist/components/Employee/Taxes/Actions.js +8 -10
- package/dist/components/Employee/Taxes/Actions.js.map +1 -1
- package/dist/components/Employee/Taxes/FederalForm.js +4 -6
- package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/Taxes/useTaxes.js +3 -4
- package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js +2 -3
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlow.js +11 -9
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlow.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.js +8 -9
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.js +71 -89
- package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.js +2 -3
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.js.map +1 -1
- package/dist/components/Employee/WorkAddress/management/WorkAddress.d.ts +6 -0
- package/dist/components/Employee/WorkAddress/management/WorkAddress.js +48 -0
- package/dist/components/Employee/WorkAddress/management/WorkAddress.js.map +1 -0
- package/dist/components/Employee/WorkAddress/management/WorkAddressView.d.ts +16 -0
- package/dist/components/Employee/WorkAddress/management/WorkAddressView.js +367 -0
- package/dist/components/Employee/WorkAddress/management/WorkAddressView.js.map +1 -0
- package/dist/components/Employee/WorkAddress/management/getPendingFutureWorkAddress.d.ts +4 -0
- package/dist/components/Employee/WorkAddress/management/getPendingFutureWorkAddress.js +35 -0
- package/dist/components/Employee/WorkAddress/management/getPendingFutureWorkAddress.js.map +1 -0
- package/dist/components/Employee/WorkAddress/management/useWorkAddressManagement.d.ts +45 -0
- package/dist/components/Employee/WorkAddress/management/useWorkAddressManagement.js +143 -0
- package/dist/components/Employee/WorkAddress/management/useWorkAddressManagement.js.map +1 -0
- package/dist/components/Employee/exports/employeeManagement.d.ts +3 -1
- package/dist/components/Employee/exports/employeeManagement.js +12 -10
- package/dist/components/Employee/exports/employeeManagement.js.map +1 -1
- package/dist/components/Employee/exports/employeeOnboarding.d.ts +1 -1
- package/dist/components/Employee/exports/employeeOnboarding.js +1 -1
- package/dist/components/Employee/index.d.ts +5 -1
- package/dist/components/Employee/index.js +37 -33
- package/dist/components/Employee/index.js.map +1 -1
- package/dist/components/Flow/Flow.js +23 -51
- package/dist/components/Flow/Flow.js.map +1 -1
- package/dist/components/Flow/FlowHeader.d.ts +16 -0
- package/dist/components/Flow/FlowHeader.js +89 -0
- package/dist/components/Flow/FlowHeader.js.map +1 -0
- package/dist/components/Flow/useFlow.d.ts +33 -6
- package/dist/components/Flow/useFlow.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js +17 -18
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js +7 -8
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequests.js +2 -3
- package/dist/components/InformationRequests/InformationRequests.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +0 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js.map +1 -1
- package/dist/components/Payroll/Dismissal/DismissalFlow.js +20 -18
- package/dist/components/Payroll/Dismissal/DismissalFlow.js.map +1 -1
- package/dist/components/Payroll/Dismissal/DismissalFlowComponents.js +10 -10
- package/dist/components/Payroll/Dismissal/DismissalFlowComponents.js.map +1 -1
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.js +8 -9
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.js.map +1 -1
- package/dist/components/Payroll/Dismissal/dismissalStateMachine.js +17 -19
- package/dist/components/Payroll/Dismissal/dismissalStateMachine.js.map +1 -1
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +2 -3
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
- package/dist/components/Payroll/OffCycle/OffCycleFlow.js +13 -11
- package/dist/components/Payroll/OffCycle/OffCycleFlow.js.map +1 -1
- package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js +9 -9
- package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js.map +1 -1
- package/dist/components/Payroll/OffCycle/offCycleStateMachine.js +25 -29
- package/dist/components/Payroll/OffCycle/offCycleStateMachine.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js +18 -19
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js +10 -12
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js +6 -8
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js +2 -4
- package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +7 -8
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +2 -3
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +2 -3
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +4 -5
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
- package/dist/components/Payroll/PayrollExecutionFlow/PayrollExecutionFlow.js +43 -42
- package/dist/components/Payroll/PayrollExecutionFlow/PayrollExecutionFlow.js.map +1 -1
- package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.js +38 -42
- package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/PayrollFlow.js +18 -17
- package/dist/components/Payroll/PayrollFlow/PayrollFlow.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js +69 -78
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +2 -3
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollLanding/PayrollLanding.js +13 -12
- package/dist/components/Payroll/PayrollLanding/PayrollLanding.js.map +1 -1
- package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.js +51 -82
- package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +12 -13
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +29 -30
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +2 -3
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js +2 -3
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js +45 -44
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js +0 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js +2 -3
- package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js.map +1 -1
- package/dist/components/Payroll/Transition/TransitionFlow.js +17 -15
- package/dist/components/Payroll/Transition/TransitionFlow.js.map +1 -1
- package/dist/components/Payroll/Transition/TransitionFlowComponents.js +24 -24
- package/dist/components/Payroll/Transition/TransitionFlowComponents.js.map +1 -1
- package/dist/components/Payroll/Transition/transitionStateMachine.js +25 -29
- package/dist/components/Payroll/Transition/transitionStateMachine.js.map +1 -1
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.js +2 -3
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.js +6 -7
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/components/UNSTABLE_TimeOff/HolidaySelectionForm/HolidaySelectionFormPresentation.js +12 -13
- package/dist/components/UNSTABLE_TimeOff/HolidaySelectionForm/HolidaySelectionFormPresentation.js.map +1 -1
- package/dist/components/UNSTABLE_TimeOff/PolicyList/PolicyListPresentation.js +2 -3
- package/dist/components/UNSTABLE_TimeOff/PolicyList/PolicyListPresentation.js.map +1 -1
- package/dist/components/UNSTABLE_TimeOff/PolicyTypeSelector/PolicyTypeSelectorPresentation.js +2 -3
- package/dist/components/UNSTABLE_TimeOff/PolicyTypeSelector/PolicyTypeSelectorPresentation.js.map +1 -1
- package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/TimeOffFlowComponents.js +22 -24
- package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/TimeOffFlowComponents.js.map +1 -1
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js +2 -3
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js.map +1 -1
- package/dist/components/UNSTABLE_TimeOff/shared/EmployeeTable/EmployeeTableTypes.d.ts +1 -0
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +10 -12
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/helpers/breadcrumbHelpers.d.ts +35 -22
- package/dist/helpers/breadcrumbHelpers.js +45 -35
- package/dist/helpers/breadcrumbHelpers.js.map +1 -1
- package/dist/helpers/dateFormatting.d.ts +12 -0
- package/dist/helpers/dateFormatting.js +72 -65
- package/dist/helpers/dateFormatting.js.map +1 -1
- package/dist/helpers/formattedStrings.d.ts +2 -0
- package/dist/helpers/formattedStrings.js +30 -27
- package/dist/helpers/formattedStrings.js.map +1 -1
- package/dist/i18n/I18n.js +130 -35
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Employee.HomeAddress.Management.json.js +60 -0
- package/dist/i18n/en/Employee.HomeAddress.Management.json.js.map +1 -0
- package/dist/i18n/en/Employee.HomeAddress.json.js +22 -20
- package/dist/i18n/en/Employee.HomeAddress.json.js.map +1 -1
- package/dist/i18n/en/Employee.I9SignatureForm.json.js +79 -75
- package/dist/i18n/en/Employee.I9SignatureForm.json.js.map +1 -1
- package/dist/i18n/en/Employee.PaymentMethod.json.js +13 -13
- package/dist/i18n/en/Employee.WorkAddress.Management.json.js +62 -0
- package/dist/i18n/en/Employee.WorkAddress.Management.json.js.map +1 -0
- package/dist/i18n/en/Payroll.RecoveryCasesList.json.js +14 -10
- package/dist/i18n/en/Payroll.RecoveryCasesList.json.js.map +1 -1
- package/dist/i18n/en/common.json.d.ts +1 -0
- package/dist/i18n/en/common.json.js +28 -26
- package/dist/i18n/en/common.json.js.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +72 -68
- package/dist/index.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/CheckboxHookField.js +15 -18
- package/dist/partner-hook-utils/form/fields/CheckboxHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/DatePickerHookField.d.ts +4 -2
- package/dist/partner-hook-utils/form/fields/DatePickerHookField.js +19 -13
- package/dist/partner-hook-utils/form/fields/DatePickerHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/NumberInputHookField.js +21 -24
- package/dist/partner-hook-utils/form/fields/NumberInputHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/RadioGroupHookField.js +15 -18
- package/dist/partner-hook-utils/form/fields/RadioGroupHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/SelectHookField.d.ts +5 -2
- package/dist/partner-hook-utils/form/fields/SelectHookField.js +29 -28
- package/dist/partner-hook-utils/form/fields/SelectHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/SwitchHookField.js +16 -19
- package/dist/partner-hook-utils/form/fields/SwitchHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/TextInputHookField.js +22 -25
- package/dist/partner-hook-utils/form/fields/TextInputHookField.js.map +1 -1
- package/dist/shared/constants.d.ts +4 -0
- package/dist/shared/constants.js +14 -12
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +89 -1
- package/docs/reference/endpoint-inventory.json +72 -8
- package/package.json +7 -7
- package/dist/_virtual/dynamic-import-helper.js +0 -17
- package/dist/_virtual/dynamic-import-helper.js.map +0 -1
- package/dist/components/Common/SignatureForm/SignatureForm.d.ts +0 -14
- package/dist/components/Common/SignatureForm/SignatureForm.js +0 -28
- package/dist/components/Common/SignatureForm/SignatureForm.js.map +0 -1
- package/dist/components/Common/SignatureForm/SignatureForm.module.scss.js +0 -10
- package/dist/components/Common/SignatureForm/SignatureForm.module.scss.js.map +0 -1
- package/dist/components/Common/SignatureForm/SignatureFormActions.d.ts +0 -8
- package/dist/components/Common/SignatureForm/SignatureFormActions.js +0 -22
- package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +0 -1
- package/dist/components/Common/SignatureForm/SignatureFormFields.d.ts +0 -9
- package/dist/components/Common/SignatureForm/SignatureFormFields.js +0 -39
- package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +0 -1
- package/dist/components/Common/SignatureForm/index.d.ts +0 -5
- package/dist/components/Employee/DocumentSigner/SignatureForm/Actions.d.ts +0 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/Actions.js +0 -20
- package/dist/components/Employee/DocumentSigner/SignatureForm/Actions.js.map +0 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/Form.d.ts +0 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/Form.js +0 -20
- package/dist/components/Employee/DocumentSigner/SignatureForm/Form.js.map +0 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/Head.d.ts +0 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/Head.js +0 -35
- package/dist/components/Employee/DocumentSigner/SignatureForm/Head.js.map +0 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/Preview.d.ts +0 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/Preview.js +0 -20
- package/dist/components/Employee/DocumentSigner/SignatureForm/Preview.js.map +0 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.d.ts +0 -9
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +0 -21
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +0 -1
- package/dist/components/Employee/employee-list/management/ManagementEmployeeList.js.map +0 -1
- package/dist/components/Employee/employee-list/management/ManagementEmployeeListView.js.map +0 -1
- package/dist/components/Employee/employee-list/onboarding/EmployeeList.js.map +0 -1
- package/dist/components/Employee/employee-list/onboarding/EmployeeListView.js.map +0 -1
- package/dist/components/Employee/employee-list/shared/useEmployeeList.js.map +0 -1
- /package/dist/components/Employee/{employee-list → EmployeeList}/management/ManagementEmployeeList.d.ts +0 -0
- /package/dist/components/Employee/{employee-list → EmployeeList}/management/ManagementEmployeeList.js +0 -0
- /package/dist/components/Employee/{employee-list → EmployeeList}/management/ManagementEmployeeListView.d.ts +0 -0
- /package/dist/components/Employee/{employee-list → EmployeeList}/onboarding/EmployeeList.d.ts +0 -0
- /package/dist/components/Employee/{employee-list → EmployeeList}/onboarding/EmployeeList.js +0 -0
- /package/dist/components/Employee/{employee-list → EmployeeList}/onboarding/EmployeeListView.d.ts +0 -0
- /package/dist/components/Employee/{employee-list → EmployeeList}/shared/index.d.ts +0 -0
- /package/dist/components/Employee/{employee-list → EmployeeList}/shared/useEmployeeList.d.ts +0 -0
- /package/dist/components/Employee/{employee-list → EmployeeList}/shared/useEmployeeList.js +0 -0
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { useState as N, useMemo as g } from "react";
|
|
2
|
+
import { useEmployeeAddressesDeleteWorkAddressMutation as T } from "@gusto/embedded-api/react-query/employeeAddressesDeleteWorkAddress";
|
|
3
|
+
import { useEmployeeAddressesGetWorkAddresses as C } from "@gusto/embedded-api/react-query/employeeAddressesGetWorkAddresses";
|
|
4
|
+
import { useEmployeesGet as K } from "@gusto/embedded-api/react-query/employeesGet";
|
|
5
|
+
import { useBaseSubmit as O } from "../../../Base/useBaseSubmit.js";
|
|
6
|
+
import { useWorkAddressForm as W } from "../../Profile/shared/useWorkAddressForm/useWorkAddressForm.js";
|
|
7
|
+
import { composeErrorHandler as Q } from "../../../../partner-hook-utils/composeErrorHandler.js";
|
|
8
|
+
import { firstLastName as q } from "../../../../helpers/formattedStrings.js";
|
|
9
|
+
import { normalizeToSDKError as G, SDKInternalError as n } from "../../../../types/sdkError.js";
|
|
10
|
+
import { componentEvents as x } from "../../../../shared/constants.js";
|
|
11
|
+
function te(e) {
|
|
12
|
+
return e.isLoading ? !1 : !e.status.isEmployeeError;
|
|
13
|
+
}
|
|
14
|
+
function z(e, d) {
|
|
15
|
+
if (e.isLoading)
|
|
16
|
+
throw new n("Edit work address form is still loading");
|
|
17
|
+
if (d.isLoading)
|
|
18
|
+
throw new n("Change work address form is still loading");
|
|
19
|
+
return {
|
|
20
|
+
editWorkAddressForm: e,
|
|
21
|
+
changeWorkAddressForm: d
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
function ie({
|
|
25
|
+
employeeId: e,
|
|
26
|
+
onEvent: d
|
|
27
|
+
}) {
|
|
28
|
+
const {
|
|
29
|
+
baseSubmitHandler: h,
|
|
30
|
+
error: D,
|
|
31
|
+
setError: F
|
|
32
|
+
} = O("Employee.WorkAddress.Management"), l = T(), [t, S] = N(void 0), o = K({ employeeId: e }, { enabled: !!e }), a = o.data?.employee?.companyUuid, f = C(
|
|
33
|
+
{ employeeId: e },
|
|
34
|
+
{ enabled: !!e && !!a }
|
|
35
|
+
), r = f.data?.employeeWorkAddressesList, b = g(() => r?.length ? r.find((s) => s.active) ?? r[0] ?? null : null, [r]), v = t ?? b?.uuid, E = g(() => {
|
|
36
|
+
if (!(!t || !r))
|
|
37
|
+
return r.find((s) => s.uuid === t);
|
|
38
|
+
}, [t, r]), R = E ? E.active !== !0 : !1, m = W({
|
|
39
|
+
companyId: a,
|
|
40
|
+
employeeId: e,
|
|
41
|
+
workAddressUuid: v,
|
|
42
|
+
withEffectiveDateField: R
|
|
43
|
+
}), u = W({
|
|
44
|
+
companyId: a,
|
|
45
|
+
employeeId: e,
|
|
46
|
+
withEffectiveDateField: !0
|
|
47
|
+
}), p = g(() => {
|
|
48
|
+
const s = o.data?.employee;
|
|
49
|
+
return s ? q({
|
|
50
|
+
first_name: s.firstName,
|
|
51
|
+
last_name: s.lastName
|
|
52
|
+
}).trim() : "";
|
|
53
|
+
}, [o.data?.employee]), y = !!o.data?.employee && !a, i = Q(
|
|
54
|
+
[
|
|
55
|
+
o,
|
|
56
|
+
f,
|
|
57
|
+
m,
|
|
58
|
+
u,
|
|
59
|
+
...y ? [
|
|
60
|
+
{
|
|
61
|
+
errorHandling: {
|
|
62
|
+
errors: [
|
|
63
|
+
G(
|
|
64
|
+
new n(
|
|
65
|
+
"Employee record is missing companyUuid, which is required to load work address locations."
|
|
66
|
+
)
|
|
67
|
+
)
|
|
68
|
+
],
|
|
69
|
+
retryQueries: () => {
|
|
70
|
+
},
|
|
71
|
+
clearSubmitError: () => {
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
] : []
|
|
76
|
+
],
|
|
77
|
+
{ submitError: D, setSubmitError: F }
|
|
78
|
+
), k = {
|
|
79
|
+
setEditTargetUuid: S,
|
|
80
|
+
confirmDeleteWorkAddress: async (s) => {
|
|
81
|
+
const _ = r?.find((c) => c.uuid === s) ?? null;
|
|
82
|
+
let w = !1;
|
|
83
|
+
return await h(
|
|
84
|
+
{ workAddressUuid: s, snapshot: _ },
|
|
85
|
+
async ({ workAddressUuid: c, snapshot: A }) => {
|
|
86
|
+
const L = r?.find((H) => H.uuid === c);
|
|
87
|
+
if (!L)
|
|
88
|
+
throw new n("Work address not found");
|
|
89
|
+
if (L.active === !0)
|
|
90
|
+
throw new n("Cannot delete the active work address");
|
|
91
|
+
await l.mutateAsync({
|
|
92
|
+
request: { workAddressUuid: c }
|
|
93
|
+
}), w = !0, A && d(x.EMPLOYEE_WORK_ADDRESS_DELETED, A);
|
|
94
|
+
}
|
|
95
|
+
), w;
|
|
96
|
+
}
|
|
97
|
+
}, M = {
|
|
98
|
+
employeeDisplayName: p,
|
|
99
|
+
employeeWorkAddresses: r,
|
|
100
|
+
editTargetUuid: t,
|
|
101
|
+
editWorkAddressForm: m,
|
|
102
|
+
changeWorkAddressForm: u
|
|
103
|
+
};
|
|
104
|
+
if (o.isLoading)
|
|
105
|
+
return { isLoading: !0, errorHandling: i };
|
|
106
|
+
if (o.isError || y)
|
|
107
|
+
return {
|
|
108
|
+
isLoading: !1,
|
|
109
|
+
data: M,
|
|
110
|
+
status: {
|
|
111
|
+
isDeletePending: l.isPending,
|
|
112
|
+
isEmployeeError: !0
|
|
113
|
+
},
|
|
114
|
+
errorHandling: i,
|
|
115
|
+
actions: k
|
|
116
|
+
};
|
|
117
|
+
if (f.isLoading)
|
|
118
|
+
return { isLoading: !0, errorHandling: i };
|
|
119
|
+
if (m.isLoading || u.isLoading)
|
|
120
|
+
return { isLoading: !0, errorHandling: i };
|
|
121
|
+
const { editWorkAddressForm: U, changeWorkAddressForm: P } = z(m, u);
|
|
122
|
+
return {
|
|
123
|
+
isLoading: !1,
|
|
124
|
+
data: {
|
|
125
|
+
employeeDisplayName: p,
|
|
126
|
+
employeeWorkAddresses: r,
|
|
127
|
+
editTargetUuid: t,
|
|
128
|
+
editWorkAddressForm: U,
|
|
129
|
+
changeWorkAddressForm: P
|
|
130
|
+
},
|
|
131
|
+
status: {
|
|
132
|
+
isDeletePending: l.isPending,
|
|
133
|
+
isEmployeeError: !1
|
|
134
|
+
},
|
|
135
|
+
errorHandling: i,
|
|
136
|
+
actions: k
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
export {
|
|
140
|
+
te as isUseWorkAddressManagementSuccess,
|
|
141
|
+
ie as useWorkAddressManagement
|
|
142
|
+
};
|
|
143
|
+
//# sourceMappingURL=useWorkAddressManagement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useWorkAddressManagement.js","sources":["../../../../../src/components/Employee/WorkAddress/management/useWorkAddressManagement.tsx"],"sourcesContent":["import { useMemo, useState } from 'react'\nimport type { EmployeeWorkAddress } from '@gusto/embedded-api/models/components/employeeworkaddress'\nimport { useEmployeeAddressesDeleteWorkAddressMutation } from '@gusto/embedded-api/react-query/employeeAddressesDeleteWorkAddress'\nimport { useEmployeeAddressesGetWorkAddresses } from '@gusto/embedded-api/react-query/employeeAddressesGetWorkAddresses'\nimport { useEmployeesGet } from '@gusto/embedded-api/react-query/employeesGet'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport { useBaseSubmit } from '@/components/Base/useBaseSubmit'\nimport { useWorkAddressForm } from '@/components/Employee/Profile/shared/useWorkAddressForm'\nimport type {\n UseWorkAddressFormReady,\n UseWorkAddressFormResult,\n} from '@/components/Employee/Profile/shared/useWorkAddressForm'\nimport { composeErrorHandler } from '@/partner-hook-utils/composeErrorHandler'\nimport type {\n BaseHookReady,\n HookErrorHandling,\n HookLoadingResult,\n} from '@/partner-hook-utils/types'\nimport { firstLastName } from '@/helpers/formattedStrings'\nimport { normalizeToSDKError, SDKInternalError } from '@/types/sdkError'\nimport { componentEvents, type EventType } from '@/shared/constants'\n\nexport interface UseWorkAddressManagementParams {\n employeeId: string\n onEvent: OnEventType<EventType, unknown>\n}\n\nexport interface UseWorkAddressManagementDataPendingForms extends Record<string, unknown> {\n employeeDisplayName: string\n employeeWorkAddresses: EmployeeWorkAddress[] | undefined\n editTargetUuid: string | undefined\n editWorkAddressForm: UseWorkAddressFormResult\n changeWorkAddressForm: UseWorkAddressFormResult\n}\n\nexport interface UseWorkAddressManagementDataReady extends Record<string, unknown> {\n employeeDisplayName: string\n employeeWorkAddresses: EmployeeWorkAddress[] | undefined\n editTargetUuid: string | undefined\n editWorkAddressForm: UseWorkAddressFormReady\n changeWorkAddressForm: UseWorkAddressFormReady\n}\n\nexport interface UseWorkAddressManagementStatusEmployeeError extends Record<string, unknown> {\n isDeletePending: boolean\n isEmployeeError: true\n}\n\nexport interface UseWorkAddressManagementStatusSuccess extends Record<string, unknown> {\n isDeletePending: boolean\n isEmployeeError: false\n}\n\nexport interface UseWorkAddressManagementActions {\n setEditTargetUuid: (workAddressUuid: string | undefined) => void\n confirmDeleteWorkAddress: (workAddressUuid: string) => Promise<boolean>\n}\n\nexport interface UseWorkAddressManagementReadyEmployeeError extends BaseHookReady<\n UseWorkAddressManagementDataPendingForms,\n UseWorkAddressManagementStatusEmployeeError\n> {\n actions: UseWorkAddressManagementActions\n}\n\nexport interface UseWorkAddressManagementReadySuccess extends BaseHookReady<\n UseWorkAddressManagementDataReady,\n UseWorkAddressManagementStatusSuccess\n> {\n actions: UseWorkAddressManagementActions\n}\n\nexport type UseWorkAddressManagementReady =\n | UseWorkAddressManagementReadyEmployeeError\n | UseWorkAddressManagementReadySuccess\n\nexport type UseWorkAddressManagementResult = HookLoadingResult | UseWorkAddressManagementReady\n\nexport function isUseWorkAddressManagementSuccess(\n value: UseWorkAddressManagementResult,\n): value is UseWorkAddressManagementReadySuccess {\n if (value.isLoading) {\n return false\n }\n return !value.status.isEmployeeError\n}\n\nfunction workAddressFormsReady(\n editWorkAddressForm: UseWorkAddressFormResult,\n changeWorkAddressForm: UseWorkAddressFormResult,\n): Pick<UseWorkAddressManagementDataReady, 'editWorkAddressForm' | 'changeWorkAddressForm'> {\n if (editWorkAddressForm.isLoading) {\n throw new SDKInternalError('Edit work address form is still loading')\n }\n if (changeWorkAddressForm.isLoading) {\n throw new SDKInternalError('Change work address form is still loading')\n }\n return {\n editWorkAddressForm,\n changeWorkAddressForm,\n }\n}\n\nexport function useWorkAddressManagement({\n employeeId,\n onEvent,\n}: UseWorkAddressManagementParams): UseWorkAddressManagementResult {\n const {\n baseSubmitHandler,\n error: rootSubmitError,\n setError: setRootSubmitError,\n } = useBaseSubmit('Employee.WorkAddress.Management')\n const deleteWorkAddressMutation = useEmployeeAddressesDeleteWorkAddressMutation()\n const [editTargetUuid, setEditTargetUuid] = useState<string | undefined>(undefined)\n\n const employeeQuery = useEmployeesGet({ employeeId }, { enabled: !!employeeId })\n const companyId = employeeQuery.data?.employee?.companyUuid\n\n const workAddressesQuery = useEmployeeAddressesGetWorkAddresses(\n { employeeId },\n { enabled: !!employeeId && !!companyId },\n )\n\n const employeeWorkAddresses = workAddressesQuery.data?.employeeWorkAddressesList\n\n const currentWorkAddress = useMemo<EmployeeWorkAddress | null>(() => {\n if (!employeeWorkAddresses?.length) {\n return null\n }\n return employeeWorkAddresses.find(w => w.active) ?? employeeWorkAddresses[0] ?? null\n }, [employeeWorkAddresses])\n\n const workAddressUuidForEdit = editTargetUuid ?? currentWorkAddress?.uuid\n\n const editInactiveRow = useMemo(() => {\n if (!editTargetUuid || !employeeWorkAddresses) {\n return undefined\n }\n return employeeWorkAddresses.find(w => w.uuid === editTargetUuid)\n }, [editTargetUuid, employeeWorkAddresses])\n\n const withEffectiveDateOnEdit = editInactiveRow ? editInactiveRow.active !== true : false\n\n const editWorkAddressForm = useWorkAddressForm({\n companyId,\n employeeId,\n workAddressUuid: workAddressUuidForEdit,\n withEffectiveDateField: withEffectiveDateOnEdit,\n })\n\n const changeWorkAddressForm = useWorkAddressForm({\n companyId,\n employeeId,\n withEffectiveDateField: true,\n })\n\n const employeeDisplayName = useMemo(() => {\n const employee = employeeQuery.data?.employee\n if (!employee) {\n return ''\n }\n return firstLastName({\n first_name: employee.firstName,\n last_name: employee.lastName,\n }).trim()\n }, [employeeQuery.data?.employee])\n\n const isMissingCompany = !!employeeQuery.data?.employee && !companyId\n\n const errorHandling: HookErrorHandling = composeErrorHandler(\n [\n employeeQuery,\n workAddressesQuery,\n editWorkAddressForm,\n changeWorkAddressForm,\n ...(isMissingCompany\n ? [\n {\n errorHandling: {\n errors: [\n normalizeToSDKError(\n new SDKInternalError(\n 'Employee record is missing companyUuid, which is required to load work address locations.',\n ),\n ),\n ],\n retryQueries: () => {},\n clearSubmitError: () => {},\n },\n },\n ]\n : []),\n ],\n { submitError: rootSubmitError, setSubmitError: setRootSubmitError },\n )\n\n const confirmDeleteWorkAddress = async (workAddressUuid: string): Promise<boolean> => {\n const snapshot = employeeWorkAddresses?.find(w => w.uuid === workAddressUuid) ?? null\n\n let succeeded = false\n await baseSubmitHandler(\n { workAddressUuid, snapshot },\n async ({ workAddressUuid: uuid, snapshot: snap }) => {\n const target = employeeWorkAddresses?.find(w => w.uuid === uuid)\n if (!target) {\n throw new SDKInternalError('Work address not found')\n }\n if (target.active === true) {\n throw new SDKInternalError('Cannot delete the active work address')\n }\n\n await deleteWorkAddressMutation.mutateAsync({\n request: { workAddressUuid: uuid },\n })\n succeeded = true\n if (snap) {\n onEvent(componentEvents.EMPLOYEE_WORK_ADDRESS_DELETED, snap)\n }\n },\n )\n return succeeded\n }\n\n const actions: UseWorkAddressManagementActions = {\n setEditTargetUuid,\n confirmDeleteWorkAddress,\n }\n\n const dataPayloadPendingForms: UseWorkAddressManagementDataPendingForms = {\n employeeDisplayName,\n employeeWorkAddresses,\n editTargetUuid,\n editWorkAddressForm,\n changeWorkAddressForm,\n }\n\n if (employeeQuery.isLoading) {\n return { isLoading: true, errorHandling }\n }\n\n if (employeeQuery.isError || isMissingCompany) {\n return {\n isLoading: false,\n data: dataPayloadPendingForms,\n status: {\n isDeletePending: deleteWorkAddressMutation.isPending,\n isEmployeeError: true,\n },\n errorHandling,\n actions,\n }\n }\n\n if (workAddressesQuery.isLoading) {\n return { isLoading: true, errorHandling }\n }\n\n const isFormsLoading = editWorkAddressForm.isLoading || changeWorkAddressForm.isLoading\n if (isFormsLoading) {\n return { isLoading: true, errorHandling }\n }\n\n const { editWorkAddressForm: editReady, changeWorkAddressForm: changeReady } =\n workAddressFormsReady(editWorkAddressForm, changeWorkAddressForm)\n\n const dataReady: UseWorkAddressManagementDataReady = {\n employeeDisplayName,\n employeeWorkAddresses,\n editTargetUuid,\n editWorkAddressForm: editReady,\n changeWorkAddressForm: changeReady,\n }\n\n return {\n isLoading: false,\n data: dataReady,\n status: {\n isDeletePending: deleteWorkAddressMutation.isPending,\n isEmployeeError: false,\n },\n errorHandling,\n actions,\n }\n}\n"],"names":["isUseWorkAddressManagementSuccess","value","workAddressFormsReady","editWorkAddressForm","changeWorkAddressForm","SDKInternalError","useWorkAddressManagement","employeeId","onEvent","baseSubmitHandler","rootSubmitError","setRootSubmitError","useBaseSubmit","deleteWorkAddressMutation","useEmployeeAddressesDeleteWorkAddressMutation","editTargetUuid","setEditTargetUuid","useState","employeeQuery","useEmployeesGet","companyId","workAddressesQuery","useEmployeeAddressesGetWorkAddresses","employeeWorkAddresses","currentWorkAddress","useMemo","w","workAddressUuidForEdit","editInactiveRow","withEffectiveDateOnEdit","useWorkAddressForm","employeeDisplayName","employee","firstLastName","isMissingCompany","errorHandling","composeErrorHandler","normalizeToSDKError","actions","workAddressUuid","snapshot","succeeded","uuid","snap","target","componentEvents","dataPayloadPendingForms","editReady","changeReady"],"mappings":";;;;;;;;;;AA8EO,SAASA,GACdC,GAC+C;AAC/C,SAAIA,EAAM,YACD,KAEF,CAACA,EAAM,OAAO;AACvB;AAEA,SAASC,EACPC,GACAC,GAC0F;AAC1F,MAAID,EAAoB;AACtB,UAAM,IAAIE,EAAiB,yCAAyC;AAEtE,MAAID,EAAsB;AACxB,UAAM,IAAIC,EAAiB,2CAA2C;AAExE,SAAO;AAAA,IACL,qBAAAF;AAAA,IACA,uBAAAC;AAAA,EAAA;AAEJ;AAEO,SAASE,GAAyB;AAAA,EACvC,YAAAC;AAAA,EACA,SAAAC;AACF,GAAmE;AACjE,QAAM;AAAA,IACJ,mBAAAC;AAAA,IACA,OAAOC;AAAA,IACP,UAAUC;AAAA,EAAA,IACRC,EAAc,iCAAiC,GAC7CC,IAA4BC,EAAA,GAC5B,CAACC,GAAgBC,CAAiB,IAAIC,EAA6B,MAAS,GAE5EC,IAAgBC,EAAgB,EAAE,YAAAZ,EAAA,GAAc,EAAE,SAAS,CAAC,CAACA,GAAY,GACzEa,IAAYF,EAAc,MAAM,UAAU,aAE1CG,IAAqBC;AAAA,IACzB,EAAE,YAAAf,EAAA;AAAA,IACF,EAAE,SAAS,CAAC,CAACA,KAAc,CAAC,CAACa,EAAA;AAAA,EAAU,GAGnCG,IAAwBF,EAAmB,MAAM,2BAEjDG,IAAqBC,EAAoC,MACxDF,GAAuB,SAGrBA,EAAsB,KAAK,CAAAG,MAAKA,EAAE,MAAM,KAAKH,EAAsB,CAAC,KAAK,OAFvE,MAGR,CAACA,CAAqB,CAAC,GAEpBI,IAAyBZ,KAAkBS,GAAoB,MAE/DI,IAAkBH,EAAQ,MAAM;AACpC,QAAI,GAACV,KAAkB,CAACQ;AAGxB,aAAOA,EAAsB,KAAK,CAAAG,MAAKA,EAAE,SAASX,CAAc;AAAA,EAClE,GAAG,CAACA,GAAgBQ,CAAqB,CAAC,GAEpCM,IAA0BD,IAAkBA,EAAgB,WAAW,KAAO,IAE9EzB,IAAsB2B,EAAmB;AAAA,IAC7C,WAAAV;AAAA,IACA,YAAAb;AAAA,IACA,iBAAiBoB;AAAA,IACjB,wBAAwBE;AAAA,EAAA,CACzB,GAEKzB,IAAwB0B,EAAmB;AAAA,IAC/C,WAAAV;AAAA,IACA,YAAAb;AAAA,IACA,wBAAwB;AAAA,EAAA,CACzB,GAEKwB,IAAsBN,EAAQ,MAAM;AACxC,UAAMO,IAAWd,EAAc,MAAM;AACrC,WAAKc,IAGEC,EAAc;AAAA,MACnB,YAAYD,EAAS;AAAA,MACrB,WAAWA,EAAS;AAAA,IAAA,CACrB,EAAE,KAAA,IALM;AAAA,EAMX,GAAG,CAACd,EAAc,MAAM,QAAQ,CAAC,GAE3BgB,IAAmB,CAAC,CAAChB,EAAc,MAAM,YAAY,CAACE,GAEtDe,IAAmCC;AAAA,IACvC;AAAA,MACElB;AAAA,MACAG;AAAA,MACAlB;AAAA,MACAC;AAAA,MACA,GAAI8B,IACA;AAAA,QACE;AAAA,UACE,eAAe;AAAA,YACb,QAAQ;AAAA,cACNG;AAAA,gBACE,IAAIhC;AAAA,kBACF;AAAA,gBAAA;AAAA,cACF;AAAA,YACF;AAAA,YAEF,cAAc,MAAM;AAAA,YAAC;AAAA,YACrB,kBAAkB,MAAM;AAAA,YAAC;AAAA,UAAA;AAAA,QAC3B;AAAA,MACF,IAEF,CAAA;AAAA,IAAC;AAAA,IAEP,EAAE,aAAaK,GAAiB,gBAAgBC,EAAA;AAAA,EAAmB,GA8B/D2B,IAA2C;AAAA,IAC/C,mBAAAtB;AAAA,IACA,0BA7B+B,OAAOuB,MAA8C;AACpF,YAAMC,IAAWjB,GAAuB,KAAK,OAAKG,EAAE,SAASa,CAAe,KAAK;AAEjF,UAAIE,IAAY;AAChB,mBAAMhC;AAAA,QACJ,EAAE,iBAAA8B,GAAiB,UAAAC,EAAA;AAAA,QACnB,OAAO,EAAE,iBAAiBE,GAAM,UAAUC,QAAW;AACnD,gBAAMC,IAASrB,GAAuB,KAAK,CAAAG,MAAKA,EAAE,SAASgB,CAAI;AAC/D,cAAI,CAACE;AACH,kBAAM,IAAIvC,EAAiB,wBAAwB;AAErD,cAAIuC,EAAO,WAAW;AACpB,kBAAM,IAAIvC,EAAiB,uCAAuC;AAGpE,gBAAMQ,EAA0B,YAAY;AAAA,YAC1C,SAAS,EAAE,iBAAiB6B,EAAA;AAAA,UAAK,CAClC,GACDD,IAAY,IACRE,KACFnC,EAAQqC,EAAgB,+BAA+BF,CAAI;AAAA,QAE/D;AAAA,MAAA,GAEKF;AAAA,IACT;AAAA,EAIE,GAGIK,IAAoE;AAAA,IACxE,qBAAAf;AAAA,IACA,uBAAAR;AAAA,IACA,gBAAAR;AAAA,IACA,qBAAAZ;AAAA,IACA,uBAAAC;AAAA,EAAA;AAGF,MAAIc,EAAc;AAChB,WAAO,EAAE,WAAW,IAAM,eAAAiB,EAAA;AAG5B,MAAIjB,EAAc,WAAWgB;AAC3B,WAAO;AAAA,MACL,WAAW;AAAA,MACX,MAAMY;AAAA,MACN,QAAQ;AAAA,QACN,iBAAiBjC,EAA0B;AAAA,QAC3C,iBAAiB;AAAA,MAAA;AAAA,MAEnB,eAAAsB;AAAA,MACA,SAAAG;AAAA,IAAA;AAIJ,MAAIjB,EAAmB;AACrB,WAAO,EAAE,WAAW,IAAM,eAAAc,EAAA;AAI5B,MADuBhC,EAAoB,aAAaC,EAAsB;AAE5E,WAAO,EAAE,WAAW,IAAM,eAAA+B,EAAA;AAG5B,QAAM,EAAE,qBAAqBY,GAAW,uBAAuBC,MAC7D9C,EAAsBC,GAAqBC,CAAqB;AAUlE,SAAO;AAAA,IACL,WAAW;AAAA,IACX,MAVmD;AAAA,MACnD,qBAAA2B;AAAA,MACA,uBAAAR;AAAA,MACA,gBAAAR;AAAA,MACA,qBAAqBgC;AAAA,MACrB,uBAAuBC;AAAA,IAAA;AAAA,IAMvB,QAAQ;AAAA,MACN,iBAAiBnC,EAA0B;AAAA,MAC3C,iBAAiB;AAAA,IAAA;AAAA,IAEnB,eAAAsB;AAAA,IACA,SAAAG;AAAA,EAAA;AAEJ;"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
export { ManagementEmployeeList as EmployeeList } from '../
|
|
1
|
+
export { ManagementEmployeeList as EmployeeList } from '../EmployeeList/management/ManagementEmployeeList';
|
|
2
2
|
export { EmployeeDocuments } from '../EmployeeDocuments';
|
|
3
3
|
export { DashboardFlow } from '../Dashboard';
|
|
4
|
+
export { WorkAddress } from '../WorkAddress/management/WorkAddress';
|
|
5
|
+
export type { WorkAddressProps } from '../WorkAddress/management/WorkAddress';
|
|
4
6
|
export { TerminateEmployee } from '../Terminations/TerminateEmployee/TerminateEmployee';
|
|
5
7
|
export { TerminationSummary } from '../Terminations/TerminationSummary/TerminationSummary';
|
|
6
8
|
export { TerminationFlow } from '../Terminations/TerminationFlow/TerminationFlow';
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import { ManagementEmployeeList as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { ManagementEmployeeList as r } from "../EmployeeList/management/ManagementEmployeeList.js";
|
|
2
|
+
import { WorkAddress as t } from "../WorkAddress/management/WorkAddress.js";
|
|
3
|
+
import { TerminateEmployee as a } from "../Terminations/TerminateEmployee/TerminateEmployee.js";
|
|
4
|
+
import { TerminationSummary as f } from "../Terminations/TerminationSummary/TerminationSummary.js";
|
|
5
|
+
import { TerminationFlow as s } from "../Terminations/TerminationFlow/TerminationFlow.js";
|
|
5
6
|
import { DashboardFlow as l } from "../Dashboard/DashboardFlow.js";
|
|
6
|
-
import { EmployeeDocuments as
|
|
7
|
+
import { EmployeeDocuments as E } from "../EmployeeDocuments/EmployeeDocuments.js";
|
|
7
8
|
export {
|
|
8
9
|
l as DashboardFlow,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
E as EmployeeDocuments,
|
|
11
|
+
r as EmployeeList,
|
|
12
|
+
a as TerminateEmployee,
|
|
13
|
+
s as TerminationFlow,
|
|
14
|
+
f as TerminationSummary,
|
|
15
|
+
t as WorkAddress
|
|
14
16
|
};
|
|
15
17
|
//# sourceMappingURL=employeeManagement.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"employeeManagement.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"employeeManagement.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { OnboardingFlow } from '../OnboardingFlow/OnboardingFlow';
|
|
2
2
|
export { SelfOnboardingFlow } from '../SelfOnboardingFlow/SelfOnboardingFlow';
|
|
3
|
-
export { EmployeeList } from '../
|
|
3
|
+
export { EmployeeList } from '../EmployeeList/onboarding/EmployeeList';
|
|
4
4
|
export { OnboardingSummary } from '../OnboardingSummary';
|
|
5
5
|
export { Landing } from '../Landing';
|
|
6
6
|
export { DocumentSigner } from '../DocumentSigner';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { OnboardingFlow as e } from "../OnboardingFlow/OnboardingFlow.js";
|
|
2
2
|
import { SelfOnboardingFlow as m } from "../SelfOnboardingFlow/SelfOnboardingFlow.js";
|
|
3
|
-
import { EmployeeList as x } from "../
|
|
3
|
+
import { EmployeeList as x } from "../EmployeeList/onboarding/EmployeeList.js";
|
|
4
4
|
import { Compensation as n } from "../Compensation/Compensation.js";
|
|
5
5
|
import { Deductions as a } from "../Deductions/Deductions.js";
|
|
6
6
|
import { DocumentSigner as d } from "../DocumentSigner/DocumentSigner.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./types/i18next.d.ts"
|
|
2
|
-
export { EmployeeList } from './
|
|
2
|
+
export { EmployeeList } from './EmployeeList/onboarding/EmployeeList';
|
|
3
3
|
export { Deductions } from './Deductions';
|
|
4
4
|
export { OnboardingSummary } from './OnboardingSummary';
|
|
5
5
|
export { Profile } from './Profile';
|
|
@@ -14,6 +14,8 @@ export { SelfOnboardingFlow } from './SelfOnboardingFlow/SelfOnboardingFlow';
|
|
|
14
14
|
export { EmployeeDocuments } from './EmployeeDocuments';
|
|
15
15
|
export { DashboardFlow } from './Dashboard';
|
|
16
16
|
export type { DashboardFlowProps } from './Dashboard';
|
|
17
|
+
export { HomeAddress } from './HomeAddress/management/HomeAddress';
|
|
18
|
+
export type { HomeAddressProps } from './HomeAddress/management/HomeAddress';
|
|
17
19
|
export { EmploymentEligibility } from './DocumentSigner/EmploymentEligibility';
|
|
18
20
|
export type { EmploymentEligibilityProps } from './DocumentSigner/EmploymentEligibility';
|
|
19
21
|
export { TerminateEmployee } from './Terminations/TerminateEmployee/TerminateEmployee';
|
|
@@ -23,4 +25,6 @@ export type { TerminationSummaryProps } from './Terminations/TerminationSummary/
|
|
|
23
25
|
export { TerminationFlow } from './Terminations/TerminationFlow/TerminationFlow';
|
|
24
26
|
export type { TerminationFlowProps } from './Terminations/TerminationFlow/TerminationFlowComponents';
|
|
25
27
|
export type { PayrollOption } from './Terminations/types';
|
|
28
|
+
export { WorkAddress } from './WorkAddress/management/WorkAddress';
|
|
29
|
+
export type { WorkAddressProps } from './WorkAddress/management/WorkAddress';
|
|
26
30
|
export { Taxes } from './Taxes';
|
|
@@ -1,41 +1,45 @@
|
|
|
1
|
-
import { EmployeeList as e } from "./
|
|
1
|
+
import { EmployeeList as e } from "./EmployeeList/onboarding/EmployeeList.js";
|
|
2
2
|
import { OnboardingFlow as t } from "./OnboardingFlow/OnboardingFlow.js";
|
|
3
3
|
import { SelfOnboardingFlow as x } from "./SelfOnboardingFlow/SelfOnboardingFlow.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
4
|
+
import { HomeAddress as n } from "./HomeAddress/management/HomeAddress.js";
|
|
5
|
+
import { TerminateEmployee as i } from "./Terminations/TerminateEmployee/TerminateEmployee.js";
|
|
6
|
+
import { TerminationSummary as d } from "./Terminations/TerminationSummary/TerminationSummary.js";
|
|
7
|
+
import { TerminationFlow as y } from "./Terminations/TerminationFlow/TerminationFlow.js";
|
|
8
|
+
import { WorkAddress as T } from "./WorkAddress/management/WorkAddress.js";
|
|
9
|
+
import { Compensation as u } from "./Compensation/Compensation.js";
|
|
10
|
+
import { DashboardFlow as F } from "./Dashboard/DashboardFlow.js";
|
|
11
|
+
import { Deductions as w } from "./Deductions/Deductions.js";
|
|
12
|
+
import { DocumentSigner as c } from "./DocumentSigner/DocumentSigner.js";
|
|
13
|
+
import { EmployeeDocuments as h } from "./EmployeeDocuments/EmployeeDocuments.js";
|
|
14
|
+
import { EmploymentEligibility as L } from "./DocumentSigner/EmploymentEligibility/EmploymentEligibility.js";
|
|
15
|
+
import { FederalTaxes as k } from "./FederalTaxes/FederalTaxes.js";
|
|
16
|
+
import { Landing as H } from "./Landing/Landing.js";
|
|
17
|
+
import { OnboardingSummary as W } from "./OnboardingSummary/OnboardingSummary.js";
|
|
18
|
+
import { PaymentMethod as q } from "./PaymentMethod/PaymentMethod.js";
|
|
19
|
+
import { Profile as z } from "./Profile/Profile.js";
|
|
20
|
+
import { StateTaxes as G } from "./StateTaxes/StateTaxes.js";
|
|
21
|
+
import { Taxes as J } from "./Taxes/Taxes.js";
|
|
20
22
|
export {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
u as Compensation,
|
|
24
|
+
F as DashboardFlow,
|
|
25
|
+
w as Deductions,
|
|
26
|
+
c as DocumentSigner,
|
|
27
|
+
h as EmployeeDocuments,
|
|
26
28
|
e as EmployeeList,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
L as EmploymentEligibility,
|
|
30
|
+
k as FederalTaxes,
|
|
31
|
+
n as HomeAddress,
|
|
32
|
+
H as Landing,
|
|
30
33
|
t as OnboardingFlow,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
+
W as OnboardingSummary,
|
|
35
|
+
q as PaymentMethod,
|
|
36
|
+
z as Profile,
|
|
34
37
|
x as SelfOnboardingFlow,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
G as StateTaxes,
|
|
39
|
+
J as Taxes,
|
|
40
|
+
i as TerminateEmployee,
|
|
41
|
+
y as TerminationFlow,
|
|
42
|
+
d as TerminationSummary,
|
|
43
|
+
T as WorkAddress
|
|
40
44
|
};
|
|
41
45
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,63 +1,35 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useMachine as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { Flex as
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const M = ({
|
|
10
|
-
onEvent: x,
|
|
11
|
-
machine: f
|
|
1
|
+
import { jsx as n, jsxs as x } from "react/jsx-runtime";
|
|
2
|
+
import { useMachine as h } from "react-robot";
|
|
3
|
+
import { FlowContext as u } from "./useFlow.js";
|
|
4
|
+
import { FlowHeader as v } from "./FlowHeader.js";
|
|
5
|
+
import { Flex as l } from "../Common/Flex/Flex.js";
|
|
6
|
+
const E = ({
|
|
7
|
+
onEvent: m,
|
|
8
|
+
machine: s
|
|
12
9
|
}) => {
|
|
13
|
-
const
|
|
14
|
-
onEvent:
|
|
15
|
-
component: null
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
currentStep: t = null,
|
|
21
|
-
currentBreadcrumbId: n,
|
|
22
|
-
breadcrumbs: B = {}
|
|
23
|
-
} = r.context;
|
|
24
|
-
function a(i, m) {
|
|
25
|
-
const p = { type: i, payload: m }, C = h;
|
|
26
|
-
c.child ? c.child.send(p) : C(p), x(i, m);
|
|
10
|
+
const [o, d, e] = h(s, {
|
|
11
|
+
onEvent: p,
|
|
12
|
+
component: null
|
|
13
|
+
});
|
|
14
|
+
function p(r, c) {
|
|
15
|
+
const i = { type: r, payload: c }, f = d;
|
|
16
|
+
e.child ? e.child.send(i) : f(i), m(r, c);
|
|
27
17
|
}
|
|
28
|
-
|
|
29
|
-
|
|
18
|
+
const t = o.context.component;
|
|
19
|
+
return /* @__PURE__ */ n(l, { children: /* @__PURE__ */ n(
|
|
20
|
+
u.Provider,
|
|
30
21
|
{
|
|
31
22
|
value: {
|
|
32
|
-
...
|
|
23
|
+
...o.context
|
|
33
24
|
},
|
|
34
|
-
children: /* @__PURE__ */
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
{
|
|
38
|
-
totalSteps: o,
|
|
39
|
-
currentStep: t,
|
|
40
|
-
label: g("progressBarLabel", { totalSteps: o, currentStep: t }),
|
|
41
|
-
cta: r.context.progressBarCta
|
|
42
|
-
}
|
|
43
|
-
),
|
|
44
|
-
l === "breadcrumbs" && /* @__PURE__ */ u(s, { flexDirection: "row", justifyContent: "space-between", alignItems: "center", children: [
|
|
45
|
-
/* @__PURE__ */ e(d, { flexGrow: 1, children: /* @__PURE__ */ e(
|
|
46
|
-
F,
|
|
47
|
-
{
|
|
48
|
-
breadcrumbs: n ? B[n] ?? [] : [],
|
|
49
|
-
currentBreadcrumbId: n,
|
|
50
|
-
onEvent: a
|
|
51
|
-
}
|
|
52
|
-
) }),
|
|
53
|
-
/* @__PURE__ */ e(d, { children: r.context.progressBarCta && /* @__PURE__ */ e(r.context.progressBarCta, {}) })
|
|
54
|
-
] }),
|
|
55
|
-
r.context.component && /* @__PURE__ */ e(r.context.component, {})
|
|
25
|
+
children: /* @__PURE__ */ x(l, { flexDirection: "column", gap: 32, children: [
|
|
26
|
+
/* @__PURE__ */ n(v, {}),
|
|
27
|
+
t && /* @__PURE__ */ n(t, {})
|
|
56
28
|
] })
|
|
57
29
|
}
|
|
58
30
|
) });
|
|
59
31
|
};
|
|
60
32
|
export {
|
|
61
|
-
|
|
33
|
+
E as Flow
|
|
62
34
|
};
|
|
63
35
|
//# sourceMappingURL=Flow.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Flow.js","sources":["../../../src/components/Flow/Flow.tsx"],"sourcesContent":["import { useMachine } from 'react-robot'\nimport { type Machine, type SendFunction } from 'robot3'\nimport
|
|
1
|
+
{"version":3,"file":"Flow.js","sources":["../../../src/components/Flow/Flow.tsx"],"sourcesContent":["import { useMachine } from 'react-robot'\nimport { type Machine, type SendFunction } from 'robot3'\nimport type { OnEventType } from '../Base/useBase'\nimport { Flex } from '../Common/Flex'\nimport type { FlowContextInterface } from './useFlow'\nimport { FlowContext } from './useFlow'\nimport { FlowHeader } from './FlowHeader'\nimport { type EventType } from '@/shared/constants'\n\ntype FlowProps<M extends Machine> = {\n machine: M\n onEvent: OnEventType<EventType, unknown>\n}\n\nexport const Flow = <M extends Machine<object, FlowContextInterface>>({\n onEvent,\n machine,\n}: FlowProps<M>) => {\n const [current, send, service] = useMachine(machine, {\n onEvent: handleEvent,\n component: null,\n })\n\n function handleEvent(type: EventType, data: unknown): void {\n const event = { type, payload: data }\n const sendFn = send as SendFunction<string>\n //When dealing with nested state machine, correct machine needs to recieve an event\n if (service.child) {\n ;(service.child.send as SendFunction<string>)(event)\n } else {\n sendFn(event)\n }\n // Pass event upstream - onEvent can be optional on Flow component\n onEvent(type, data)\n }\n\n const Component = current.context.component\n\n return (\n <Flex>\n <FlowContext.Provider\n value={{\n ...current.context,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n <FlowHeader />\n {Component && <Component />}\n </Flex>\n </FlowContext.Provider>\n </Flex>\n )\n}\n"],"names":["Flow","onEvent","machine","current","send","service","useMachine","handleEvent","type","data","event","sendFn","Component","Flex","jsx","FlowContext","jsxs","FlowHeader"],"mappings":";;;;;AAcO,MAAMA,IAAO,CAAkD;AAAA,EACpE,SAAAC;AAAA,EACA,SAAAC;AACF,MAAoB;AAClB,QAAM,CAACC,GAASC,GAAMC,CAAO,IAAIC,EAAWJ,GAAS;AAAA,IACnD,SAASK;AAAA,IACT,WAAW;AAAA,EAAA,CACZ;AAED,WAASA,EAAYC,GAAiBC,GAAqB;AACzD,UAAMC,IAAQ,EAAE,MAAAF,GAAM,SAASC,EAAA,GACzBE,IAASP;AAEf,IAAIC,EAAQ,QACRA,EAAQ,MAAM,KAA8BK,CAAK,IAEnDC,EAAOD,CAAK,GAGdT,EAAQO,GAAMC,CAAI;AAAA,EACpB;AAEA,QAAMG,IAAYT,EAAQ,QAAQ;AAElC,2BACGU,GAAA,EACC,UAAA,gBAAAC;AAAA,IAACC,EAAY;AAAA,IAAZ;AAAA,MACC,OAAO;AAAA,QACL,GAAGZ,EAAQ;AAAA,MAAA;AAAA,MAGb,UAAA,gBAAAa,EAACH,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,QAAA,gBAAAC,EAACG,GAAA,EAAW;AAAA,QACXL,uBAAcA,GAAA,CAAA,CAAU;AAAA,MAAA,EAAA,CAC3B;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Renders the chrome above the active flow component (back affordance,
|
|
3
|
+
* progress bar, breadcrumbs, ...). Layout is driven by a single
|
|
4
|
+
* discriminated `header` field on the flow context. Each variant maps to a
|
|
5
|
+
* focused renderer below:
|
|
6
|
+
*
|
|
7
|
+
* header.type === 'minimal' → MinimalHeader
|
|
8
|
+
* header.type === 'progress' → ProgressHeader
|
|
9
|
+
* header.type === 'breadcrumbs' → BreadcrumbsHeader
|
|
10
|
+
*
|
|
11
|
+
* To add a new piece of chrome:
|
|
12
|
+
* 1. Add a new variant to `FlowHeaderConfig` in `useFlow.ts`.
|
|
13
|
+
* 2. Add a new renderer function below.
|
|
14
|
+
* 3. Branch on it in `FlowHeader`.
|
|
15
|
+
*/
|
|
16
|
+
export declare function FlowHeader(): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation as s } from "react-i18next";
|
|
3
|
+
import { FlowBreadcrumbs as d } from "../Common/FlowBreadcrumbs/FlowBreadcrumbs.js";
|
|
4
|
+
import { Flex as m, FlexItem as c } from "../Common/Flex/Flex.js";
|
|
5
|
+
import { useFlow as a } from "./useFlow.js";
|
|
6
|
+
import { componentEvents as p } from "../../shared/constants.js";
|
|
7
|
+
import { useComponentContext as u } from "../../contexts/ComponentAdapter/useComponentContext.js";
|
|
8
|
+
import f from "../../assets/icons/caret-left.svg.js";
|
|
9
|
+
function E() {
|
|
10
|
+
const { header: e, component: t } = a();
|
|
11
|
+
if (!e || !t) return null;
|
|
12
|
+
switch (e.type) {
|
|
13
|
+
case "minimal":
|
|
14
|
+
return /* @__PURE__ */ r(b, { cta: e.cta });
|
|
15
|
+
case "progress":
|
|
16
|
+
return /* @__PURE__ */ r(
|
|
17
|
+
h,
|
|
18
|
+
{
|
|
19
|
+
currentStep: e.currentStep,
|
|
20
|
+
totalSteps: e.totalSteps,
|
|
21
|
+
cta: e.cta
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
case "breadcrumbs":
|
|
25
|
+
return e.currentBreadcrumbId ? /* @__PURE__ */ r(
|
|
26
|
+
w,
|
|
27
|
+
{
|
|
28
|
+
currentBreadcrumbId: e.currentBreadcrumbId,
|
|
29
|
+
breadcrumbs: e.breadcrumbs,
|
|
30
|
+
cta: e.cta
|
|
31
|
+
}
|
|
32
|
+
) : null;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
function b({ cta: e }) {
|
|
36
|
+
const { onEvent: t } = a(), n = u(), { t: o } = s();
|
|
37
|
+
return /* @__PURE__ */ i(m, { flexDirection: "row", justifyContent: "space-between", alignItems: "center", children: [
|
|
38
|
+
/* @__PURE__ */ r(c, { children: /* @__PURE__ */ r(
|
|
39
|
+
n.Button,
|
|
40
|
+
{
|
|
41
|
+
variant: "tertiary",
|
|
42
|
+
icon: /* @__PURE__ */ r(f, { "aria-hidden": "true" }),
|
|
43
|
+
onClick: () => {
|
|
44
|
+
t(p.CANCEL, void 0);
|
|
45
|
+
},
|
|
46
|
+
children: o("back")
|
|
47
|
+
}
|
|
48
|
+
) }),
|
|
49
|
+
e && /* @__PURE__ */ r(c, { children: /* @__PURE__ */ r(e, {}) })
|
|
50
|
+
] });
|
|
51
|
+
}
|
|
52
|
+
function h({
|
|
53
|
+
currentStep: e,
|
|
54
|
+
totalSteps: t,
|
|
55
|
+
cta: n
|
|
56
|
+
}) {
|
|
57
|
+
const o = u(), { t: l } = s();
|
|
58
|
+
return /* @__PURE__ */ r(
|
|
59
|
+
o.ProgressBar,
|
|
60
|
+
{
|
|
61
|
+
totalSteps: t,
|
|
62
|
+
currentStep: e,
|
|
63
|
+
label: l("progressBarLabel", { totalSteps: t, currentStep: e }),
|
|
64
|
+
cta: n
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
function w({
|
|
69
|
+
currentBreadcrumbId: e,
|
|
70
|
+
breadcrumbs: t = {},
|
|
71
|
+
cta: n
|
|
72
|
+
}) {
|
|
73
|
+
const { onEvent: o } = a();
|
|
74
|
+
return /* @__PURE__ */ i(m, { flexDirection: "row", justifyContent: "space-between", alignItems: "center", children: [
|
|
75
|
+
/* @__PURE__ */ r(c, { flexGrow: 1, children: /* @__PURE__ */ r(
|
|
76
|
+
d,
|
|
77
|
+
{
|
|
78
|
+
breadcrumbs: e ? t[e] ?? [] : [],
|
|
79
|
+
currentBreadcrumbId: e,
|
|
80
|
+
onEvent: o
|
|
81
|
+
}
|
|
82
|
+
) }),
|
|
83
|
+
/* @__PURE__ */ r(c, { children: n && /* @__PURE__ */ r(n, {}) })
|
|
84
|
+
] });
|
|
85
|
+
}
|
|
86
|
+
export {
|
|
87
|
+
E as FlowHeader
|
|
88
|
+
};
|
|
89
|
+
//# sourceMappingURL=FlowHeader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FlowHeader.js","sources":["../../../src/components/Flow/FlowHeader.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { FlowBreadcrumbs } from '../Common/FlowBreadcrumbs/FlowBreadcrumbs'\nimport type { BreadcrumbTrail } from '../Common/FlowBreadcrumbs/FlowBreadcrumbsTypes'\nimport { Flex } from '../Common/Flex'\nimport { FlexItem } from '../Common'\nimport { useFlow } from './useFlow'\nimport { componentEvents } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport CaretLeftIcon from '@/assets/icons/caret-left.svg?react'\n\n/**\n * Renders the chrome above the active flow component (back affordance,\n * progress bar, breadcrumbs, ...). Layout is driven by a single\n * discriminated `header` field on the flow context. Each variant maps to a\n * focused renderer below:\n *\n * header.type === 'minimal' → MinimalHeader\n * header.type === 'progress' → ProgressHeader\n * header.type === 'breadcrumbs' → BreadcrumbsHeader\n *\n * To add a new piece of chrome:\n * 1. Add a new variant to `FlowHeaderConfig` in `useFlow.ts`.\n * 2. Add a new renderer function below.\n * 3. Branch on it in `FlowHeader`.\n */\nexport function FlowHeader() {\n const { header, component } = useFlow()\n\n if (!header || !component) return null\n\n switch (header.type) {\n case 'minimal':\n return <MinimalHeader cta={header.cta} />\n case 'progress':\n return (\n <ProgressHeader\n currentStep={header.currentStep}\n totalSteps={header.totalSteps}\n cta={header.cta}\n />\n )\n case 'breadcrumbs':\n // The breadcrumb trail is intentionally persisted across \"passive\"\n // states (e.g. landing screens) so that subsequent transitions can\n // pick up where they left off without rebuilding it. We render the\n // bar only when there's an active breadcrumb to show; otherwise\n // we treat the flow as \"no chrome\" for this state.\n if (!header.currentBreadcrumbId) return null\n return (\n <BreadcrumbsHeader\n currentBreadcrumbId={header.currentBreadcrumbId}\n breadcrumbs={header.breadcrumbs}\n cta={header.cta}\n />\n )\n }\n}\n\nfunction MinimalHeader({ cta: Cta }: { cta?: React.ComponentType }) {\n const { onEvent } = useFlow()\n const Components = useComponentContext()\n const { t } = useTranslation()\n\n return (\n <Flex flexDirection=\"row\" justifyContent=\"space-between\" alignItems=\"center\">\n <FlexItem>\n <Components.Button\n variant=\"tertiary\"\n icon={<CaretLeftIcon aria-hidden=\"true\" />}\n onClick={() => {\n onEvent(componentEvents.CANCEL, undefined)\n }}\n >\n {t('back')}\n </Components.Button>\n </FlexItem>\n {Cta && (\n <FlexItem>\n <Cta />\n </FlexItem>\n )}\n </Flex>\n )\n}\n\nfunction ProgressHeader({\n currentStep,\n totalSteps,\n cta: Cta,\n}: {\n currentStep: number\n totalSteps: number\n cta?: React.ComponentType\n}) {\n const Components = useComponentContext()\n const { t } = useTranslation()\n\n return (\n <Components.ProgressBar\n totalSteps={totalSteps}\n currentStep={currentStep}\n label={t('progressBarLabel', { totalSteps, currentStep })}\n cta={Cta}\n />\n )\n}\n\nfunction BreadcrumbsHeader({\n currentBreadcrumbId,\n breadcrumbs = {},\n cta: Cta,\n}: {\n currentBreadcrumbId?: string\n breadcrumbs?: BreadcrumbTrail\n cta?: React.ComponentType\n}) {\n const { onEvent } = useFlow()\n\n return (\n <Flex flexDirection=\"row\" justifyContent=\"space-between\" alignItems=\"center\">\n <FlexItem flexGrow={1}>\n <FlowBreadcrumbs\n breadcrumbs={currentBreadcrumbId ? (breadcrumbs[currentBreadcrumbId] ?? []) : []}\n currentBreadcrumbId={currentBreadcrumbId}\n onEvent={onEvent}\n />\n </FlexItem>\n <FlexItem>{Cta && <Cta />}</FlexItem>\n </Flex>\n )\n}\n"],"names":["FlowHeader","header","component","useFlow","jsx","MinimalHeader","ProgressHeader","BreadcrumbsHeader","Cta","onEvent","Components","useComponentContext","t","useTranslation","Flex","FlexItem","CaretLeftIcon","componentEvents","currentStep","totalSteps","currentBreadcrumbId","breadcrumbs","FlowBreadcrumbs"],"mappings":";;;;;;;;AAyBO,SAASA,IAAa;AAC3B,QAAM,EAAE,QAAAC,GAAQ,WAAAC,EAAA,IAAcC,EAAA;AAE9B,MAAI,CAACF,KAAU,CAACC,EAAW,QAAO;AAElC,UAAQD,EAAO,MAAA;AAAA,IACb,KAAK;AACH,aAAO,gBAAAG,EAACC,GAAA,EAAc,KAAKJ,EAAO,IAAA,CAAK;AAAA,IACzC,KAAK;AACH,aACE,gBAAAG;AAAA,QAACE;AAAA,QAAA;AAAA,UACC,aAAaL,EAAO;AAAA,UACpB,YAAYA,EAAO;AAAA,UACnB,KAAKA,EAAO;AAAA,QAAA;AAAA,MAAA;AAAA,IAGlB,KAAK;AAMH,aAAKA,EAAO,sBAEV,gBAAAG;AAAA,QAACG;AAAA,QAAA;AAAA,UACC,qBAAqBN,EAAO;AAAA,UAC5B,aAAaA,EAAO;AAAA,UACpB,KAAKA,EAAO;AAAA,QAAA;AAAA,MAAA,IALwB;AAAA,EAMtC;AAGR;AAEA,SAASI,EAAc,EAAE,KAAKG,KAAsC;AAClE,QAAM,EAAE,SAAAC,EAAA,IAAYN,EAAA,GACdO,IAAaC,EAAA,GACb,EAAE,GAAAC,EAAA,IAAMC,EAAA;AAEd,2BACGC,GAAA,EAAK,eAAc,OAAM,gBAAe,iBAAgB,YAAW,UAClE,UAAA;AAAA,IAAA,gBAAAV,EAACW,GAAA,EACC,UAAA,gBAAAX;AAAA,MAACM,EAAW;AAAA,MAAX;AAAA,QACC,SAAQ;AAAA,QACR,MAAM,gBAAAN,EAACY,GAAA,EAAc,eAAY,OAAA,CAAO;AAAA,QACxC,SAAS,MAAM;AACb,UAAAP,EAAQQ,EAAgB,QAAQ,MAAS;AAAA,QAC3C;AAAA,QAEC,YAAE,MAAM;AAAA,MAAA;AAAA,IAAA,GAEb;AAAA,IACCT,KACC,gBAAAJ,EAACW,GAAA,EACC,UAAA,gBAAAX,EAACI,KAAI,EAAA,CACP;AAAA,EAAA,GAEJ;AAEJ;AAEA,SAASF,EAAe;AAAA,EACtB,aAAAY;AAAA,EACA,YAAAC;AAAA,EACA,KAAKX;AACP,GAIG;AACD,QAAME,IAAaC,EAAA,GACb,EAAE,GAAAC,EAAA,IAAMC,EAAA;AAEd,SACE,gBAAAT;AAAA,IAACM,EAAW;AAAA,IAAX;AAAA,MACC,YAAAS;AAAA,MACA,aAAAD;AAAA,MACA,OAAON,EAAE,oBAAoB,EAAE,YAAAO,GAAY,aAAAD,GAAa;AAAA,MACxD,KAAKV;AAAA,IAAA;AAAA,EAAA;AAGX;AAEA,SAASD,EAAkB;AAAA,EACzB,qBAAAa;AAAA,EACA,aAAAC,IAAc,CAAA;AAAA,EACd,KAAKb;AACP,GAIG;AACD,QAAM,EAAE,SAAAC,EAAA,IAAYN,EAAA;AAEpB,2BACGW,GAAA,EAAK,eAAc,OAAM,gBAAe,iBAAgB,YAAW,UAClE,UAAA;AAAA,IAAA,gBAAAV,EAACW,GAAA,EAAS,UAAU,GAClB,UAAA,gBAAAX;AAAA,MAACkB;AAAA,MAAA;AAAA,QACC,aAAaF,IAAuBC,EAAYD,CAAmB,KAAK,CAAA,IAAM,CAAA;AAAA,QAC9E,qBAAAA;AAAA,QACA,SAAAX;AAAA,MAAA;AAAA,IAAA,GAEJ;AAAA,IACA,gBAAAL,EAACW,GAAA,EAAU,UAAAP,KAAO,gBAAAJ,EAACI,KAAI,EAAA,CAAG;AAAA,EAAA,GAC5B;AAEJ;"}
|
|
@@ -7,17 +7,44 @@ export interface CtaConfig {
|
|
|
7
7
|
labelKey: string;
|
|
8
8
|
namespace?: keyof CustomTypeOptions['resources'];
|
|
9
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* Discriminated union describing the chrome rendered above the active flow
|
|
12
|
+
* component. Each variant declares only the data it needs:
|
|
13
|
+
* - `minimal` → Back button. Optional `cta` for an extra control next to it.
|
|
14
|
+
* - `progress` → Step indicator. Requires `currentStep` / `totalSteps`,
|
|
15
|
+
* plus optional `cta`.
|
|
16
|
+
* - `breadcrumbs` → Breadcrumb trail. Optional `currentBreadcrumbId` /
|
|
17
|
+
* `breadcrumbs` (typically populated via
|
|
18
|
+
* `buildBreadcrumbs` + `updateBreadcrumbs`), plus optional
|
|
19
|
+
* `cta`.
|
|
20
|
+
*
|
|
21
|
+
* `cta` carries the same meaning across every variant: an optional component
|
|
22
|
+
* rendered as part of the header chrome.
|
|
23
|
+
*/
|
|
24
|
+
export type FlowHeaderConfig = {
|
|
25
|
+
type: 'minimal';
|
|
26
|
+
cta?: React.ComponentType;
|
|
27
|
+
} | {
|
|
28
|
+
type: 'progress';
|
|
29
|
+
currentStep: number;
|
|
30
|
+
totalSteps: number;
|
|
31
|
+
cta?: React.ComponentType;
|
|
32
|
+
} | {
|
|
33
|
+
type: 'breadcrumbs';
|
|
34
|
+
currentBreadcrumbId?: string;
|
|
35
|
+
breadcrumbs?: BreadcrumbTrail;
|
|
36
|
+
cta?: React.ComponentType;
|
|
37
|
+
};
|
|
10
38
|
export interface FlowContextInterface {
|
|
11
39
|
component: React.ComponentType<CommonComponentInterface> | null;
|
|
12
40
|
onEvent: OnEventType<EventType, unknown>;
|
|
13
|
-
progressBarType?: 'progress' | 'breadcrumbs' | null;
|
|
14
|
-
totalSteps?: number;
|
|
15
|
-
currentStep?: number | null;
|
|
16
41
|
defaultValues?: Record<string, unknown>;
|
|
17
|
-
progressBarCta?: React.ComponentType | null;
|
|
18
|
-
breadcrumbs?: BreadcrumbTrail;
|
|
19
|
-
currentBreadcrumbId?: string;
|
|
20
42
|
ctaConfig?: CtaConfig | null;
|
|
43
|
+
/**
|
|
44
|
+
* Optional chrome rendered above the active flow component. When omitted
|
|
45
|
+
* (or set to `null`), no header is shown.
|
|
46
|
+
*/
|
|
47
|
+
header?: FlowHeaderConfig | null;
|
|
21
48
|
}
|
|
22
49
|
export declare const FlowContext: import('react').Context<FlowContextInterface | null>;
|
|
23
50
|
export declare function useFlow<C extends FlowContextInterface>(): C;
|