@gusto/embedded-react-sdk 0.54.1-rc.1 → 0.54.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Common/FlowBreadcrumbs/breadcrumbTransitionHelpers.d.ts +3 -3
- package/dist/components/Common/FlowBreadcrumbs/breadcrumbTransitionHelpers.js +5 -6
- package/dist/components/Common/FlowBreadcrumbs/breadcrumbTransitionHelpers.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +4 -5
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +4 -5
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +6 -7
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccount.js +9 -9
- package/dist/components/Company/BankAccount/BankAccount.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +4 -5
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/BankAccount/stateMachine.d.ts +3 -3
- package/dist/components/Company/BankAccount/stateMachine.js +6 -7
- package/dist/components/Company/BankAccount/stateMachine.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +4 -5
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentSigner.js +10 -10
- package/dist/components/Company/DocumentSigner/DocumentSigner.js.map +1 -1
- package/dist/components/Company/DocumentSigner/assignSignatoryState.d.ts +1 -1
- package/dist/components/Company/DocumentSigner/assignSignatoryState.js +12 -13
- package/dist/components/Company/DocumentSigner/assignSignatoryState.js.map +1 -1
- package/dist/components/Company/DocumentSigner/stateMachine.d.ts +4 -4
- package/dist/components/Company/DocumentSigner/stateMachine.js +13 -14
- package/dist/components/Company/DocumentSigner/stateMachine.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +9 -10
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +7 -8
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +4 -5
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/Locations.js +8 -8
- package/dist/components/Company/Locations/Locations.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +4 -5
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/Locations/stateMachine.d.ts +3 -3
- package/dist/components/Company/Locations/stateMachine.js +2 -3
- package/dist/components/Company/Locations/stateMachine.js.map +1 -1
- package/dist/components/Company/OnboardingFlow/OnboardingFlow.js +8 -8
- package/dist/components/Company/OnboardingFlow/OnboardingFlow.js.map +1 -1
- package/dist/components/Company/OnboardingFlow/onboardingStateMachine.d.ts +10 -10
- package/dist/components/Company/OnboardingFlow/onboardingStateMachine.js +10 -11
- package/dist/components/Company/OnboardingFlow/onboardingStateMachine.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +4 -5
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/PaySchedule.js +7 -7
- package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
- package/dist/components/Company/PaySchedule/payScheduleStateMachine.d.ts +3 -3
- package/dist/components/Company/PaySchedule/payScheduleStateMachine.js +3 -4
- package/dist/components/Company/PaySchedule/payScheduleStateMachine.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxes.js +8 -8
- package/dist/components/Company/StateTaxes/StateTaxes.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +4 -5
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +4 -5
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/TaxRateManagement/context.js +4 -5
- package/dist/components/Company/StateTaxes/TaxRateManagement/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/stateTaxesStateMachine.d.ts +3 -3
- package/dist/components/Company/StateTaxes/stateTaxesStateMachine.js +12 -13
- package/dist/components/Company/StateTaxes/stateTaxesStateMachine.js.map +1 -1
- package/dist/components/Contractor/Address/management/Address.js +7 -7
- package/dist/components/Contractor/Address/management/Address.js.map +1 -1
- package/dist/components/Contractor/Address/management/addressStateMachine.d.ts +2 -2
- package/dist/components/Contractor/Address/management/addressStateMachine.js +13 -14
- package/dist/components/Contractor/Address/management/addressStateMachine.js.map +1 -1
- package/dist/components/Contractor/Compensation/management/Compensation.js +7 -7
- package/dist/components/Contractor/Compensation/management/Compensation.js.map +1 -1
- package/dist/components/Contractor/Compensation/management/compensationStateMachine.d.ts +2 -2
- package/dist/components/Contractor/Compensation/management/compensationStateMachine.js +3 -4
- package/dist/components/Contractor/Compensation/management/compensationStateMachine.js.map +1 -1
- package/dist/components/Contractor/Dashboard/DashboardFlow.js +8 -8
- package/dist/components/Contractor/Dashboard/DashboardFlow.js.map +1 -1
- package/dist/components/Contractor/Dashboard/dashboardStateMachine.d.ts +5 -5
- package/dist/components/Contractor/Dashboard/dashboardStateMachine.js +6 -7
- package/dist/components/Contractor/Dashboard/dashboardStateMachine.js.map +1 -1
- package/dist/components/Contractor/Documents/onboarding/DocumentSigner/DocumentSigner.js +8 -8
- package/dist/components/Contractor/Documents/onboarding/DocumentSigner/DocumentSigner.js.map +1 -1
- package/dist/components/Contractor/Documents/onboarding/DocumentSigner/stateMachine.d.ts +2 -2
- package/dist/components/Contractor/Documents/onboarding/DocumentSigner/stateMachine.js +12 -13
- package/dist/components/Contractor/Documents/onboarding/DocumentSigner/stateMachine.js.map +1 -1
- package/dist/components/Contractor/OnboardingFlow/OnboardingFlow.js +8 -8
- package/dist/components/Contractor/OnboardingFlow/OnboardingFlow.js.map +1 -1
- package/dist/components/Contractor/OnboardingFlow/onboardingStateMachine.d.ts +7 -7
- package/dist/components/Contractor/OnboardingFlow/onboardingStateMachine.js +7 -8
- package/dist/components/Contractor/OnboardingFlow/onboardingStateMachine.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/management/PaymentMethod.js +7 -7
- package/dist/components/Contractor/PaymentMethod/management/PaymentMethod.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/management/paymentMethodStateMachine.d.ts +2 -2
- package/dist/components/Contractor/PaymentMethod/management/paymentMethodStateMachine.js +13 -14
- package/dist/components/Contractor/PaymentMethod/management/paymentMethodStateMachine.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePaymentFlow/CreatePaymentFlow.js +9 -9
- package/dist/components/Contractor/Payments/CreatePaymentFlow/CreatePaymentFlow.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePaymentFlow/createPaymentMachine.d.ts +2 -2
- package/dist/components/Contractor/Payments/CreatePaymentFlow/createPaymentMachine.js +8 -9
- package/dist/components/Contractor/Payments/CreatePaymentFlow/createPaymentMachine.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlow.js +8 -8
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlow.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.d.ts +4 -4
- package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js +9 -10
- package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js.map +1 -1
- package/dist/components/Contractor/Payments/ViewPaymentFlow/ViewPaymentFlow.js +8 -8
- package/dist/components/Contractor/Payments/ViewPaymentFlow/ViewPaymentFlow.js.map +1 -1
- package/dist/components/Contractor/Payments/ViewPaymentFlow/viewPaymentMachine.d.ts +2 -2
- package/dist/components/Contractor/Payments/ViewPaymentFlow/viewPaymentMachine.js +14 -15
- package/dist/components/Contractor/Payments/ViewPaymentFlow/viewPaymentMachine.js.map +1 -1
- package/dist/components/Contractor/Profile/management/Profile.js +7 -7
- package/dist/components/Contractor/Profile/management/Profile.js.map +1 -1
- package/dist/components/Contractor/Profile/management/profileStateMachine.d.ts +2 -2
- package/dist/components/Contractor/Profile/management/profileStateMachine.js +10 -11
- package/dist/components/Contractor/Profile/management/profileStateMachine.js.map +1 -1
- package/dist/components/Contractor/SelfOnboardingFlow/SelfOnboardingFlow.js +8 -8
- package/dist/components/Contractor/SelfOnboardingFlow/SelfOnboardingFlow.js.map +1 -1
- package/dist/components/Contractor/SelfOnboardingFlow/selfOnboardingMachine.d.ts +5 -5
- package/dist/components/Contractor/SelfOnboardingFlow/selfOnboardingMachine.js +6 -7
- package/dist/components/Contractor/SelfOnboardingFlow/selfOnboardingMachine.js.map +1 -1
- package/dist/components/Employee/Compensation/management/Compensation.js +7 -7
- package/dist/components/Employee/Compensation/management/Compensation.js.map +1 -1
- package/dist/components/Employee/Compensation/management/CompensationComponents.js +4 -4
- package/dist/components/Employee/Compensation/management/compensationStateMachine.d.ts +4 -4
- package/dist/components/Employee/Compensation/management/compensationStateMachine.js +20 -21
- package/dist/components/Employee/Compensation/management/compensationStateMachine.js.map +1 -1
- package/dist/components/Employee/Compensation/onboarding/Compensation.js +11 -11
- package/dist/components/Employee/Compensation/onboarding/Compensation.js.map +1 -1
- package/dist/components/Employee/Compensation/onboarding/compensationStateMachine.d.ts +4 -4
- package/dist/components/Employee/Compensation/onboarding/compensationStateMachine.js +10 -11
- package/dist/components/Employee/Compensation/onboarding/compensationStateMachine.js.map +1 -1
- package/dist/components/Employee/Dashboard/DashboardFlow.js +8 -8
- package/dist/components/Employee/Dashboard/DashboardFlow.js.map +1 -1
- package/dist/components/Employee/Dashboard/dashboardStateMachine.d.ts +13 -13
- package/dist/components/Employee/Dashboard/dashboardStateMachine.js +14 -15
- package/dist/components/Employee/Dashboard/dashboardStateMachine.js.map +1 -1
- package/dist/components/Employee/Deductions/management/Deductions.js +7 -7
- package/dist/components/Employee/Deductions/management/Deductions.js.map +1 -1
- package/dist/components/Employee/Deductions/management/deductionsStateMachine.d.ts +2 -2
- package/dist/components/Employee/Deductions/management/deductionsStateMachine.js +8 -9
- package/dist/components/Employee/Deductions/management/deductionsStateMachine.js.map +1 -1
- package/dist/components/Employee/Deductions/onboarding/Deductions.js +7 -7
- package/dist/components/Employee/Deductions/onboarding/Deductions.js.map +1 -1
- package/dist/components/Employee/Deductions/onboarding/stateMachine.d.ts +3 -3
- package/dist/components/Employee/Deductions/onboarding/stateMachine.js +8 -9
- package/dist/components/Employee/Deductions/onboarding/stateMachine.js.map +1 -1
- package/dist/components/Employee/Documents/management/Documents.js +7 -7
- package/dist/components/Employee/Documents/management/Documents.js.map +1 -1
- package/dist/components/Employee/Documents/management/documentsStateMachine.d.ts +2 -2
- package/dist/components/Employee/Documents/management/documentsStateMachine.js +3 -4
- package/dist/components/Employee/Documents/management/documentsStateMachine.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js +4 -5
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentSigner.js +10 -10
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentSigner.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/stateMachine.d.ts +4 -4
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/stateMachine.js +12 -13
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/stateMachine.js.map +1 -1
- package/dist/components/Employee/EmployeeListFlow/EmployeeListFlow.js +8 -8
- package/dist/components/Employee/EmployeeListFlow/EmployeeListFlow.js.map +1 -1
- package/dist/components/Employee/EmployeeListFlow/employeeListStateMachine.d.ts +4 -4
- package/dist/components/Employee/EmployeeListFlow/employeeListStateMachine.js +7 -8
- package/dist/components/Employee/EmployeeListFlow/employeeListStateMachine.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/management/FederalTaxes.js +7 -7
- package/dist/components/Employee/FederalTaxes/management/FederalTaxes.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/management/federalTaxesStateMachine.d.ts +2 -2
- package/dist/components/Employee/FederalTaxes/management/federalTaxesStateMachine.js +3 -4
- package/dist/components/Employee/FederalTaxes/management/federalTaxesStateMachine.js.map +1 -1
- package/dist/components/Employee/HomeAddress/management/HomeAddress.js +7 -7
- package/dist/components/Employee/HomeAddress/management/HomeAddress.js.map +1 -1
- package/dist/components/Employee/HomeAddress/management/homeAddressStateMachine.d.ts +2 -2
- package/dist/components/Employee/HomeAddress/management/homeAddressStateMachine.js +5 -6
- package/dist/components/Employee/HomeAddress/management/homeAddressStateMachine.js.map +1 -1
- package/dist/components/Employee/OnboardingExecutionFlow/OnboardingExecutionFlow.js +6 -6
- package/dist/components/Employee/OnboardingExecutionFlow/OnboardingExecutionFlow.js.map +1 -1
- package/dist/components/Employee/OnboardingExecutionFlow/onboardingExecutionStateMachine.d.ts +8 -8
- package/dist/components/Employee/OnboardingExecutionFlow/onboardingExecutionStateMachine.js +19 -20
- package/dist/components/Employee/OnboardingExecutionFlow/onboardingExecutionStateMachine.js.map +1 -1
- package/dist/components/Employee/OnboardingFlow/OnboardingFlow.js +8 -8
- package/dist/components/Employee/OnboardingFlow/OnboardingFlow.js.map +1 -1
- package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.d.ts +3 -3
- package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.js +3 -4
- package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/management/PaymentMethod.js +7 -7
- package/dist/components/Employee/PaymentMethod/management/PaymentMethod.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/management/paymentMethodStateMachine.d.ts +3 -3
- package/dist/components/Employee/PaymentMethod/management/paymentMethodStateMachine.js +8 -9
- package/dist/components/Employee/PaymentMethod/management/paymentMethodStateMachine.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethod.js +8 -8
- package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethod.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/onboarding/paymentMethodStateMachine.d.ts +3 -3
- package/dist/components/Employee/PaymentMethod/onboarding/paymentMethodStateMachine.js +6 -7
- package/dist/components/Employee/PaymentMethod/onboarding/paymentMethodStateMachine.js.map +1 -1
- package/dist/components/Employee/Profile/management/Profile.js +7 -7
- package/dist/components/Employee/Profile/management/Profile.js.map +1 -1
- package/dist/components/Employee/Profile/management/profileStateMachine.d.ts +2 -2
- package/dist/components/Employee/Profile/management/profileStateMachine.js +11 -12
- package/dist/components/Employee/Profile/management/profileStateMachine.js.map +1 -1
- package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingFlow.js +8 -8
- package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingFlow.js.map +1 -1
- package/dist/components/Employee/SelfOnboardingFlow/selfOnboardingMachine.d.ts +6 -6
- package/dist/components/Employee/SelfOnboardingFlow/selfOnboardingMachine.js +20 -21
- package/dist/components/Employee/SelfOnboardingFlow/selfOnboardingMachine.js.map +1 -1
- package/dist/components/Employee/StateTaxes/management/StateTaxes.js +7 -7
- package/dist/components/Employee/StateTaxes/management/StateTaxes.js.map +1 -1
- package/dist/components/Employee/StateTaxes/management/stateTaxesStateMachine.d.ts +2 -2
- package/dist/components/Employee/StateTaxes/management/stateTaxesStateMachine.js +3 -4
- package/dist/components/Employee/StateTaxes/management/stateTaxesStateMachine.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlow.js +9 -9
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlow.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.d.ts +4 -4
- package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.js +6 -7
- package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.js.map +1 -1
- package/dist/components/Employee/WorkAddress/management/WorkAddress.js +7 -7
- package/dist/components/Employee/WorkAddress/management/WorkAddress.js.map +1 -1
- package/dist/components/Employee/WorkAddress/management/workAddressStateMachine.d.ts +2 -2
- package/dist/components/Employee/WorkAddress/management/workAddressStateMachine.js +1 -2
- package/dist/components/Employee/WorkAddress/management/workAddressStateMachine.js.map +1 -1
- package/dist/components/Flow/Flow.d.ts +7 -6
- package/dist/components/Flow/Flow.js +22 -21
- package/dist/components/Flow/Flow.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequests.js +19 -19
- package/dist/components/InformationRequests/InformationRequests.js.map +1 -1
- package/dist/components/InformationRequests/informationRequestsStateMachine.d.ts +3 -3
- package/dist/components/InformationRequests/informationRequestsStateMachine.js +9 -10
- package/dist/components/InformationRequests/informationRequestsStateMachine.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js +18 -18
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.d.ts +4 -4
- package/dist/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.js +3 -4
- package/dist/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.js.map +1 -1
- package/dist/components/Payroll/Dismissal/DismissalFlow.js +7 -7
- package/dist/components/Payroll/Dismissal/DismissalFlow.js.map +1 -1
- package/dist/components/Payroll/Dismissal/dismissalStateMachine.d.ts +2 -2
- package/dist/components/Payroll/Dismissal/dismissalStateMachine.js +9 -10
- package/dist/components/Payroll/Dismissal/dismissalStateMachine.js.map +1 -1
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +3 -2
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
- package/dist/components/Payroll/OffCycle/OffCycleFlow.js +7 -7
- package/dist/components/Payroll/OffCycle/OffCycleFlow.js.map +1 -1
- package/dist/components/Payroll/OffCycle/offCycleStateMachine.d.ts +2 -2
- package/dist/components/Payroll/OffCycle/offCycleStateMachine.js +14 -15
- package/dist/components/Payroll/OffCycle/offCycleStateMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollExecutionFlow/PayrollExecutionFlow.js +9 -9
- package/dist/components/Payroll/PayrollExecutionFlow/PayrollExecutionFlow.js.map +1 -1
- package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.d.ts +5 -5
- package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.js +11 -12
- package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/PayrollFlow.js +10 -10
- package/dist/components/Payroll/PayrollFlow/PayrollFlow.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.d.ts +7 -7
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js +14 -15
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollLanding/PayrollLanding.js +7 -7
- package/dist/components/Payroll/PayrollLanding/PayrollLanding.js.map +1 -1
- package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.d.ts +3 -3
- package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.js +12 -13
- package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCases.js +12 -12
- package/dist/components/Payroll/RecoveryCases/RecoveryCases.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/recoveryCasesStateMachine.d.ts +3 -3
- package/dist/components/Payroll/RecoveryCases/recoveryCasesStateMachine.js +5 -6
- package/dist/components/Payroll/RecoveryCases/recoveryCasesStateMachine.js.map +1 -1
- package/dist/components/Payroll/Transition/TransitionFlow.js +7 -7
- package/dist/components/Payroll/Transition/TransitionFlow.js.map +1 -1
- package/dist/components/Payroll/Transition/transitionStateMachine.d.ts +2 -2
- package/dist/components/Payroll/Transition/transitionStateMachine.js +14 -15
- package/dist/components/Payroll/Transition/transitionStateMachine.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.js +3 -4
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/components/TimeOff/TimeOffFlow/TimeOffFlow.js +8 -8
- package/dist/components/TimeOff/TimeOffFlow/TimeOffFlow.js.map +1 -1
- package/dist/components/TimeOff/TimeOffFlow/timeOffStateMachine.d.ts +14 -14
- package/dist/components/TimeOff/TimeOffFlow/timeOffStateMachine.js +4 -5
- package/dist/components/TimeOff/TimeOffFlow/timeOffStateMachine.js.map +1 -1
- package/dist/shared/constants.js +1 -0
- package/dist/shared/constants.js.map +1 -1
- package/dist/types/Helpers.d.ts +3 -1
- package/package.json +4 -2
- package/dist/lib/state-machine/__tests__/core.test.d.ts +0 -1
- package/dist/lib/state-machine/core.d.ts +0 -20
- package/dist/lib/state-machine/core.js +0 -48
- package/dist/lib/state-machine/core.js.map +0 -1
- package/dist/lib/state-machine/index.d.ts +0 -5
- package/dist/lib/state-machine/index.js +0 -39
- package/dist/lib/state-machine/index.js.map +0 -1
- package/dist/lib/state-machine/types.d.ts +0 -60
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "
|
|
3
|
-
import { state as t, transition as n, reduce as r } from "../../../lib/state-machine/core.js";
|
|
1
|
+
import { state as t, transition as n, reduce as r } from "robot3";
|
|
2
|
+
import { OnboardingSummary as c, DocumentSigner as O, PaymentMethod as m, Address as a, Profile as i } from "./SelfOnboardingComponents.js";
|
|
4
3
|
import { componentEvents as e } from "../../../shared/constants.js";
|
|
5
|
-
const
|
|
4
|
+
const N = {
|
|
6
5
|
index: t(
|
|
7
6
|
n(
|
|
8
7
|
e.CONTRACTOR_SELF_ONBOARDING_START,
|
|
@@ -29,7 +28,7 @@ const A = {
|
|
|
29
28
|
"contractorPaymentMethod",
|
|
30
29
|
r((o) => ({
|
|
31
30
|
...o,
|
|
32
|
-
component:
|
|
31
|
+
component: m
|
|
33
32
|
}))
|
|
34
33
|
)
|
|
35
34
|
),
|
|
@@ -39,7 +38,7 @@ const A = {
|
|
|
39
38
|
"contractorDocumentSigner",
|
|
40
39
|
r((o) => ({
|
|
41
40
|
...o,
|
|
42
|
-
component:
|
|
41
|
+
component: O
|
|
43
42
|
}))
|
|
44
43
|
)
|
|
45
44
|
),
|
|
@@ -55,6 +54,6 @@ const A = {
|
|
|
55
54
|
)
|
|
56
55
|
};
|
|
57
56
|
export {
|
|
58
|
-
|
|
57
|
+
N as contractorSelfOnboardingMachine
|
|
59
58
|
};
|
|
60
59
|
//# sourceMappingURL=selfOnboardingMachine.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selfOnboardingMachine.js","sources":["../../../../src/components/Contractor/SelfOnboardingFlow/selfOnboardingMachine.ts"],"sourcesContent":["import type { SelfOnboardingContextInterface } from './SelfOnboardingComponents'\nimport {\n Profile,\n Address,\n PaymentMethod,\n DocumentSigner,\n OnboardingSummary,\n} from './SelfOnboardingComponents'\nimport {
|
|
1
|
+
{"version":3,"file":"selfOnboardingMachine.js","sources":["../../../../src/components/Contractor/SelfOnboardingFlow/selfOnboardingMachine.ts"],"sourcesContent":["import { transition, reduce, state } from 'robot3'\nimport type { SelfOnboardingContextInterface } from './SelfOnboardingComponents'\nimport {\n Profile,\n Address,\n PaymentMethod,\n DocumentSigner,\n OnboardingSummary,\n} from './SelfOnboardingComponents'\nimport { componentEvents } from '@/shared/constants'\nimport type { MachineTransition } from '@/types/Helpers'\n\n/** @internal */\nexport const contractorSelfOnboardingMachine = {\n index: state<MachineTransition>(\n transition(\n componentEvents.CONTRACTOR_SELF_ONBOARDING_START,\n 'contractorProfile',\n reduce((ctx: SelfOnboardingContextInterface): SelfOnboardingContextInterface => ({\n ...ctx,\n component: Profile,\n })),\n ),\n ),\n contractorProfile: state<MachineTransition>(\n transition(\n componentEvents.CONTRACTOR_PROFILE_DONE,\n 'contractorAddress',\n reduce((ctx: SelfOnboardingContextInterface): SelfOnboardingContextInterface => ({\n ...ctx,\n component: Address,\n })),\n ),\n ),\n contractorAddress: state<MachineTransition>(\n transition(\n componentEvents.CONTRACTOR_ADDRESS_DONE,\n 'contractorPaymentMethod',\n reduce((ctx: SelfOnboardingContextInterface): SelfOnboardingContextInterface => ({\n ...ctx,\n component: PaymentMethod,\n })),\n ),\n ),\n contractorPaymentMethod: state<MachineTransition>(\n transition(\n componentEvents.CONTRACTOR_PAYMENT_METHOD_DONE,\n 'contractorDocumentSigner',\n reduce((ctx: SelfOnboardingContextInterface): SelfOnboardingContextInterface => ({\n ...ctx,\n component: DocumentSigner,\n })),\n ),\n ),\n contractorDocumentSigner: state<MachineTransition>(\n transition(\n componentEvents.CONTRACTOR_DOCUMENTS_DONE,\n 'index',\n reduce((ctx: SelfOnboardingContextInterface): SelfOnboardingContextInterface => ({\n ...ctx,\n component: OnboardingSummary,\n })),\n ),\n ),\n}\n"],"names":["contractorSelfOnboardingMachine","state","transition","componentEvents","reduce","ctx","Profile","Address","PaymentMethod","DocumentSigner","OnboardingSummary"],"mappings":";;;AAaO,MAAMA,IAAkC;AAAA,EAC7C,OAAOC;AAAA,IACLC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC,EAAO,CAACC,OAAyE;AAAA,QAC/E,GAAGA;AAAA,QACH,WAAWC;AAAA,MAAA,EACX;AAAA,IAAA;AAAA,EACJ;AAAA,EAEF,mBAAmBL;AAAA,IACjBC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC,EAAO,CAACC,OAAyE;AAAA,QAC/E,GAAGA;AAAA,QACH,WAAWE;AAAA,MAAA,EACX;AAAA,IAAA;AAAA,EACJ;AAAA,EAEF,mBAAmBN;AAAA,IACjBC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC,EAAO,CAACC,OAAyE;AAAA,QAC/E,GAAGA;AAAA,QACH,WAAWG;AAAA,MAAA,EACX;AAAA,IAAA;AAAA,EACJ;AAAA,EAEF,yBAAyBP;AAAA,IACvBC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC,EAAO,CAACC,OAAyE;AAAA,QAC/E,GAAGA;AAAA,QACH,WAAWI;AAAA,MAAA,EACX;AAAA,IAAA;AAAA,EACJ;AAAA,EAEF,0BAA0BR;AAAA,IACxBC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC,EAAO,CAACC,OAAyE;AAAA,QAC/E,GAAGA;AAAA,QACH,WAAWK;AAAA,MAAA,EACX;AAAA,IAAA;AAAA,EACJ;AAEJ;"}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { createMachine as i } from "robot3";
|
|
3
|
+
import { useMemo as a } from "react";
|
|
4
|
+
import { CompensationCardContextual as p } from "./CompensationComponents.js";
|
|
5
|
+
import { compensationStateMachine as s } from "./compensationStateMachine.js";
|
|
6
6
|
import { Flow as c } from "../../../Flow/Flow.js";
|
|
7
7
|
import { BaseBoundaries as u } from "../../../Base/Base.js";
|
|
8
8
|
import "../../../Base/useBase.js";
|
|
9
9
|
import { useComponentDictionary as f, useI18n as l } from "../../../../i18n/I18n.js";
|
|
10
10
|
function C({ employeeId: n, onEvent: e, LoaderComponent: o }) {
|
|
11
11
|
l("Employee.Management.Compensation");
|
|
12
|
-
const m =
|
|
13
|
-
() =>
|
|
12
|
+
const m = a(
|
|
13
|
+
() => i("card", s, (r) => ({
|
|
14
14
|
...r,
|
|
15
|
-
component:
|
|
15
|
+
component: p,
|
|
16
16
|
employeeId: n,
|
|
17
17
|
successAlert: null,
|
|
18
18
|
LoaderComponent: o
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Compensation.js","sources":["../../../../../src/components/Employee/Compensation/management/Compensation.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport {\n CompensationCardContextual,\n type CompensationContextInterface,\n} from './CompensationComponents'\nimport { compensationStateMachine } from './compensationStateMachine'\nimport {
|
|
1
|
+
{"version":3,"file":"Compensation.js","sources":["../../../../../src/components/Employee/Compensation/management/Compensation.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMemo } from 'react'\nimport {\n CompensationCardContextual,\n type CompensationContextInterface,\n} from './CompensationComponents'\nimport { compensationStateMachine } from './compensationStateMachine'\nimport { Flow } from '@/components/Flow/Flow'\nimport { BaseBoundaries, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentDictionary } from '@/i18n/I18n'\nimport { useI18n } from '@/i18n'\n\n/**\n * Props for {@link Compensation}.\n *\n * @public\n */\nexport interface CompensationProps extends BaseComponentInterface<'Employee.Management.Compensation'> {\n /** The associated employee identifier. */\n employeeId: string\n}\n\nfunction CompensationFlow({ employeeId, onEvent, LoaderComponent }: CompensationProps) {\n useI18n('Employee.Management.Compensation')\n\n const machine = useMemo(\n () =>\n createMachine('card', compensationStateMachine, (ctx: CompensationContextInterface) => ({\n ...ctx,\n component: CompensationCardContextual,\n employeeId,\n successAlert: null,\n LoaderComponent,\n })),\n [employeeId, LoaderComponent],\n )\n\n return <Flow machine={machine} onEvent={onEvent} />\n}\n\n/**\n * Self-contained block for viewing and managing an employee's jobs and compensation — the same experience the dashboard surfaces, but as a drop-in component that doesn't require the surrounding dashboard chrome.\n *\n * @remarks\n * Renders a read-only card showing the employee's job(s), pay type, wage, and effective date, along with affordances to edit a job's compensation, add a first job from the empty state, add another job (when the primary job is Nonexempt), delete a non-primary job, and cancel a scheduled future-dated change. Choosing to edit or add a job swaps the card for the corresponding form; a successful add returns to the card with a dismissible \"Job successfully added.\" alert, an edit returns to the card without an alert, and cancelling returns without saving. Wraps everything in error and suspense boundaries.\n *\n * The card and form surfaces ({@link CompensationCard}, {@link CompensationEditForm}, {@link CompensationAddJobForm}, {@link CompensationAddAnotherJobForm}) are also exported individually for cases where that orchestration is the wrong fit — for example, when a form needs to render in a modal or drawer, when the card needs to appear read-only with no edit/add affordances, or when the swap is driven by a router. Using them directly means owning the swap, the alert, and any cross-component state yourself.\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `employee/management/compensation/card/editRequested` | Fired when an \"Edit\" CTA is clicked for a job; the block opens the edit form for that job | `{ employeeId: string, jobId: string }` |\n * | `employee/management/compensation/card/addRequested` | Fired when the \"Add job\" CTA is clicked from the card's empty state; the block opens the add-first-job form | `{ employeeId: string }` |\n * | `employee/management/compensation/card/addAnotherRequested` | Fired when the \"Add another job\" CTA is clicked; the block opens the add-another-job form | `{ employeeId: string }` |\n * | `employee/management/compensation/card/jobDeleted` | Fired after a non-primary job is deleted via the card's confirm dialog; the block stays on the card | `{ employeeId: string, jobId: string }` |\n * | `employee/management/compensation/card/changeCancelled` | Fired after a scheduled future-dated change is cancelled from the card; the block stays on the card | `{ employeeId: string, compensationId: string }` |\n * | `employee/management/compensation/editForm/submitted` | Fired after an edit-compensation save completes; the block returns to the card view | Updated `Compensation` entity |\n * | `employee/management/compensation/editForm/cancelled` | Fired when the user cancels the edit form; the block returns to the card view | — |\n * | `employee/management/compensation/addJobForm/submitted` | Fired after the first job + compensation are saved; the block returns to the card and surfaces the \"Job added\" alert | Updated `Compensation` entity |\n * | `employee/management/compensation/addJobForm/cancelled` | Fired when the user cancels the add-job form; the block returns to the card view | — |\n * | `employee/management/compensation/addAnotherJobForm/submitted` | Fired after a secondary job + compensation are saved; the block returns to the card and surfaces the \"Job added\" alert | Updated `Compensation` entity |\n * | `employee/management/compensation/addAnotherJobForm/cancelled` | Fired when the user cancels the add-another-job form; the block returns to the card view | — |\n * | `employee/management/compensation/alertDismissed` | Fired when the user dismisses the \"Job added\" success alert above the card | `null` |\n *\n * @param props - See {@link CompensationProps}.\n * @returns The rendered compensation block.\n * @public\n * @group Block components\n */\nexport function Compensation({\n dictionary,\n FallbackComponent,\n LoaderComponent,\n ...props\n}: CompensationProps) {\n useComponentDictionary('Employee.Management.Compensation', dictionary)\n return (\n <BaseBoundaries\n componentName=\"Employee.Management.Compensation\"\n FallbackComponent={FallbackComponent}\n LoaderComponent={LoaderComponent}\n >\n <CompensationFlow LoaderComponent={LoaderComponent} {...props} />\n </BaseBoundaries>\n )\n}\n"],"names":["CompensationFlow","employeeId","onEvent","LoaderComponent","useI18n","machine","useMemo","createMachine","compensationStateMachine","ctx","CompensationCardContextual","jsx","Flow","Compensation","dictionary","FallbackComponent","props","useComponentDictionary","BaseBoundaries"],"mappings":";;;;;;;;;AAsBA,SAASA,EAAiB,EAAE,YAAAC,GAAY,SAAAC,GAAS,iBAAAC,KAAsC;AACrF,EAAAC,EAAQ,kCAAkC;AAE1C,QAAMC,IAAUC;AAAA,IACd,MACEC,EAAc,QAAQC,GAA0B,CAACC,OAAuC;AAAA,MACtF,GAAGA;AAAA,MACH,WAAWC;AAAA,MACX,YAAAT;AAAA,MACA,cAAc;AAAA,MACd,iBAAAE;AAAA,IAAA,EACA;AAAA,IACJ,CAACF,GAAYE,CAAe;AAAA,EAAA;AAG9B,SAAO,gBAAAQ,EAACC,GAAA,EAAK,SAAAP,GAAkB,SAAAH,EAAA,CAAkB;AACnD;AA+BO,SAASW,EAAa;AAAA,EAC3B,YAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,iBAAAZ;AAAA,EACA,GAAGa;AACL,GAAsB;AACpB,SAAAC,EAAuB,oCAAoCH,CAAU,GAEnE,gBAAAH;AAAA,IAACO;AAAA,IAAA;AAAA,MACC,eAAc;AAAA,MACd,mBAAAH;AAAA,MACA,iBAAAZ;AAAA,MAEA,UAAA,gBAAAQ,EAACX,GAAA,EAAiB,iBAAAG,GAAmC,GAAGa,EAAA,CAAO;AAAA,IAAA;AAAA,EAAA;AAGrE;"}
|
|
@@ -7,8 +7,8 @@ import { useComponentContext as C } from "../../../../contexts/ComponentAdapter/
|
|
|
7
7
|
import { ensureRequired as m } from "../../../../helpers/ensureRequired.js";
|
|
8
8
|
import { componentEvents as c } from "../../../../shared/constants.js";
|
|
9
9
|
import { CompensationCard as f } from "./CompensationCard/CompensationCard.js";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
10
|
+
import { CompensationEditForm as E } from "./CompensationEditForm/CompensationEditForm.js";
|
|
11
|
+
import { CompensationAddJobForm as I } from "./CompensationAddJobForm/CompensationAddJobForm.js";
|
|
12
12
|
function S() {
|
|
13
13
|
const { employeeId: n, onEvent: o, successAlert: e, LoaderComponent: p } = r(), { t: s } = l("Employee.Management.Compensation"), i = C();
|
|
14
14
|
return /* @__PURE__ */ d(u, { flexDirection: "column", gap: 16, children: [
|
|
@@ -35,7 +35,7 @@ function S() {
|
|
|
35
35
|
function T() {
|
|
36
36
|
const { employeeId: n, currentJobId: o, onEvent: e, LoaderComponent: p } = r();
|
|
37
37
|
return /* @__PURE__ */ t(
|
|
38
|
-
|
|
38
|
+
E,
|
|
39
39
|
{
|
|
40
40
|
employeeId: m(n),
|
|
41
41
|
jobId: m(o ?? void 0),
|
|
@@ -47,7 +47,7 @@ function T() {
|
|
|
47
47
|
function _() {
|
|
48
48
|
const { employeeId: n, onEvent: o, LoaderComponent: e } = r();
|
|
49
49
|
return /* @__PURE__ */ t(
|
|
50
|
-
|
|
50
|
+
I,
|
|
51
51
|
{
|
|
52
52
|
employeeId: m(n),
|
|
53
53
|
onEvent: o,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** @internal */
|
|
2
2
|
export declare const compensationStateMachine: {
|
|
3
|
-
card: import('
|
|
4
|
-
editCompensation: import('
|
|
5
|
-
addJob: import('
|
|
6
|
-
addAnotherJob: import('
|
|
3
|
+
card: import('robot3').MachineState<any>;
|
|
4
|
+
editCompensation: import('robot3').MachineState<any>;
|
|
5
|
+
addJob: import('robot3').MachineState<any>;
|
|
6
|
+
addAnotherJob: import('robot3').MachineState<any>;
|
|
7
7
|
};
|
|
@@ -1,26 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "
|
|
3
|
-
import { state as n, transition as E, reduce as _ } from "../../../../lib/state-machine/core.js";
|
|
1
|
+
import { state as t, transition as E, reduce as n } from "robot3";
|
|
2
|
+
import { CompensationEditFormContextual as N, CompensationAddJobFormContextual as O, CompensationAddAnotherJobFormContextual as d, CompensationCardContextual as r } from "./CompensationComponents.js";
|
|
4
3
|
import { componentEvents as o } from "../../../../shared/constants.js";
|
|
5
|
-
const
|
|
4
|
+
const _ = n((A) => ({
|
|
6
5
|
...A,
|
|
7
6
|
component: r,
|
|
8
7
|
successAlert: null,
|
|
9
8
|
currentJobId: null
|
|
10
|
-
})), e = (A) =>
|
|
9
|
+
})), e = (A) => n((M) => ({
|
|
11
10
|
...M,
|
|
12
11
|
component: r,
|
|
13
12
|
successAlert: A,
|
|
14
13
|
currentJobId: null
|
|
15
|
-
})),
|
|
16
|
-
card:
|
|
14
|
+
})), C = {
|
|
15
|
+
card: t(
|
|
17
16
|
E(
|
|
18
17
|
o.EMPLOYEE_MANAGEMENT_COMPENSATION_CARD_EDIT_REQUESTED,
|
|
19
18
|
"editCompensation",
|
|
20
|
-
|
|
19
|
+
n(
|
|
21
20
|
(A, M) => ({
|
|
22
21
|
...A,
|
|
23
|
-
component:
|
|
22
|
+
component: N,
|
|
24
23
|
currentJobId: M.payload.jobId,
|
|
25
24
|
successAlert: null
|
|
26
25
|
})
|
|
@@ -29,7 +28,7 @@ const t = _((A) => ({
|
|
|
29
28
|
E(
|
|
30
29
|
o.EMPLOYEE_MANAGEMENT_COMPENSATION_CARD_ADD_REQUESTED,
|
|
31
30
|
"addJob",
|
|
32
|
-
|
|
31
|
+
n((A) => ({
|
|
33
32
|
...A,
|
|
34
33
|
component: O,
|
|
35
34
|
currentJobId: null,
|
|
@@ -39,9 +38,9 @@ const t = _((A) => ({
|
|
|
39
38
|
E(
|
|
40
39
|
o.EMPLOYEE_MANAGEMENT_COMPENSATION_CARD_ADD_ANOTHER_REQUESTED,
|
|
41
40
|
"addAnotherJob",
|
|
42
|
-
|
|
41
|
+
n((A) => ({
|
|
43
42
|
...A,
|
|
44
|
-
component:
|
|
43
|
+
component: d,
|
|
45
44
|
currentJobId: null,
|
|
46
45
|
successAlert: null
|
|
47
46
|
}))
|
|
@@ -49,22 +48,22 @@ const t = _((A) => ({
|
|
|
49
48
|
E(
|
|
50
49
|
o.EMPLOYEE_MANAGEMENT_COMPENSATION_ALERT_DISMISSED,
|
|
51
50
|
"card",
|
|
52
|
-
|
|
51
|
+
_
|
|
53
52
|
)
|
|
54
53
|
),
|
|
55
|
-
editCompensation:
|
|
54
|
+
editCompensation: t(
|
|
56
55
|
E(
|
|
57
56
|
o.EMPLOYEE_MANAGEMENT_COMPENSATION_EDIT_FORM_SUBMITTED,
|
|
58
57
|
"card",
|
|
59
|
-
|
|
58
|
+
_
|
|
60
59
|
),
|
|
61
60
|
E(
|
|
62
61
|
o.EMPLOYEE_MANAGEMENT_COMPENSATION_EDIT_FORM_CANCELLED,
|
|
63
62
|
"card",
|
|
64
|
-
|
|
63
|
+
_
|
|
65
64
|
)
|
|
66
65
|
),
|
|
67
|
-
addJob:
|
|
66
|
+
addJob: t(
|
|
68
67
|
E(
|
|
69
68
|
o.EMPLOYEE_MANAGEMENT_COMPENSATION_ADD_JOB_FORM_SUBMITTED,
|
|
70
69
|
"card",
|
|
@@ -73,10 +72,10 @@ const t = _((A) => ({
|
|
|
73
72
|
E(
|
|
74
73
|
o.EMPLOYEE_MANAGEMENT_COMPENSATION_ADD_JOB_FORM_CANCELLED,
|
|
75
74
|
"card",
|
|
76
|
-
|
|
75
|
+
_
|
|
77
76
|
)
|
|
78
77
|
),
|
|
79
|
-
addAnotherJob:
|
|
78
|
+
addAnotherJob: t(
|
|
80
79
|
E(
|
|
81
80
|
o.EMPLOYEE_MANAGEMENT_COMPENSATION_ADD_ANOTHER_JOB_FORM_SUBMITTED,
|
|
82
81
|
"card",
|
|
@@ -85,11 +84,11 @@ const t = _((A) => ({
|
|
|
85
84
|
E(
|
|
86
85
|
o.EMPLOYEE_MANAGEMENT_COMPENSATION_ADD_ANOTHER_JOB_FORM_CANCELLED,
|
|
87
86
|
"card",
|
|
88
|
-
|
|
87
|
+
_
|
|
89
88
|
)
|
|
90
89
|
)
|
|
91
90
|
};
|
|
92
91
|
export {
|
|
93
|
-
|
|
92
|
+
C as compensationStateMachine
|
|
94
93
|
};
|
|
95
94
|
//# sourceMappingURL=compensationStateMachine.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compensationStateMachine.js","sources":["../../../../../src/components/Employee/Compensation/management/compensationStateMachine.ts"],"sourcesContent":["import type { ComponentType } from 'react'\nimport type { CompensationContextInterface } from './CompensationComponents'\nimport {\n CompensationCardContextual,\n CompensationEditFormContextual,\n CompensationAddJobFormContextual,\n CompensationAddAnotherJobFormContextual,\n} from './CompensationComponents'\nimport {
|
|
1
|
+
{"version":3,"file":"compensationStateMachine.js","sources":["../../../../../src/components/Employee/Compensation/management/compensationStateMachine.ts"],"sourcesContent":["import { reduce, state, transition } from 'robot3'\nimport type { ComponentType } from 'react'\nimport type { CompensationContextInterface } from './CompensationComponents'\nimport {\n CompensationCardContextual,\n CompensationEditFormContextual,\n CompensationAddJobFormContextual,\n CompensationAddAnotherJobFormContextual,\n} from './CompensationComponents'\nimport { componentEvents } from '@/shared/constants'\nimport type { MachineEventType, MachineTransition } from '@/types/Helpers'\n\ntype EventPayloads = {\n [componentEvents.EMPLOYEE_MANAGEMENT_COMPENSATION_CARD_EDIT_REQUESTED]: {\n employeeId: string\n jobId: string\n }\n}\n\nconst returnToCard = reduce((ctx: CompensationContextInterface): CompensationContextInterface => ({\n ...ctx,\n component: CompensationCardContextual as ComponentType,\n successAlert: null,\n currentJobId: null,\n}))\n\nconst returnToCardWithAlert = (alert: CompensationContextInterface['successAlert']) =>\n reduce((ctx: CompensationContextInterface): CompensationContextInterface => ({\n ...ctx,\n component: CompensationCardContextual as ComponentType,\n successAlert: alert,\n currentJobId: null,\n }))\n\n/** @internal */\nexport const compensationStateMachine = {\n card: state<MachineTransition>(\n transition(\n componentEvents.EMPLOYEE_MANAGEMENT_COMPENSATION_CARD_EDIT_REQUESTED,\n 'editCompensation',\n reduce(\n (\n ctx: CompensationContextInterface,\n ev: MachineEventType<\n EventPayloads,\n typeof componentEvents.EMPLOYEE_MANAGEMENT_COMPENSATION_CARD_EDIT_REQUESTED\n >,\n ): CompensationContextInterface => ({\n ...ctx,\n component: CompensationEditFormContextual as ComponentType,\n currentJobId: ev.payload.jobId,\n successAlert: null,\n }),\n ),\n ),\n transition(\n componentEvents.EMPLOYEE_MANAGEMENT_COMPENSATION_CARD_ADD_REQUESTED,\n 'addJob',\n reduce((ctx: CompensationContextInterface): CompensationContextInterface => ({\n ...ctx,\n component: CompensationAddJobFormContextual as ComponentType,\n currentJobId: null,\n successAlert: null,\n })),\n ),\n transition(\n componentEvents.EMPLOYEE_MANAGEMENT_COMPENSATION_CARD_ADD_ANOTHER_REQUESTED,\n 'addAnotherJob',\n reduce((ctx: CompensationContextInterface): CompensationContextInterface => ({\n ...ctx,\n component: CompensationAddAnotherJobFormContextual as ComponentType,\n currentJobId: null,\n successAlert: null,\n })),\n ),\n transition(\n componentEvents.EMPLOYEE_MANAGEMENT_COMPENSATION_ALERT_DISMISSED,\n 'card',\n returnToCard,\n ),\n ),\n editCompensation: state<MachineTransition>(\n transition(\n componentEvents.EMPLOYEE_MANAGEMENT_COMPENSATION_EDIT_FORM_SUBMITTED,\n 'card',\n returnToCard,\n ),\n transition(\n componentEvents.EMPLOYEE_MANAGEMENT_COMPENSATION_EDIT_FORM_CANCELLED,\n 'card',\n returnToCard,\n ),\n ),\n addJob: state<MachineTransition>(\n transition(\n componentEvents.EMPLOYEE_MANAGEMENT_COMPENSATION_ADD_JOB_FORM_SUBMITTED,\n 'card',\n returnToCardWithAlert('jobAdded'),\n ),\n transition(\n componentEvents.EMPLOYEE_MANAGEMENT_COMPENSATION_ADD_JOB_FORM_CANCELLED,\n 'card',\n returnToCard,\n ),\n ),\n addAnotherJob: state<MachineTransition>(\n transition(\n componentEvents.EMPLOYEE_MANAGEMENT_COMPENSATION_ADD_ANOTHER_JOB_FORM_SUBMITTED,\n 'card',\n returnToCardWithAlert('jobAdded'),\n ),\n transition(\n componentEvents.EMPLOYEE_MANAGEMENT_COMPENSATION_ADD_ANOTHER_JOB_FORM_CANCELLED,\n 'card',\n returnToCard,\n ),\n ),\n}\n"],"names":["returnToCard","reduce","ctx","CompensationCardContextual","returnToCardWithAlert","alert","compensationStateMachine","state","transition","componentEvents","ev","CompensationEditFormContextual","CompensationAddJobFormContextual","CompensationAddAnotherJobFormContextual"],"mappings":";;;AAmBA,MAAMA,IAAeC,EAAO,CAACC,OAAqE;AAAA,EAChG,GAAGA;AAAA,EACH,WAAWC;AAAA,EACX,cAAc;AAAA,EACd,cAAc;AAChB,EAAE,GAEIC,IAAwB,CAACC,MAC7BJ,EAAO,CAACC,OAAqE;AAAA,EAC3E,GAAGA;AAAA,EACH,WAAWC;AAAA,EACX,cAAcE;AAAA,EACd,cAAc;AAChB,EAAE,GAGSC,IAA2B;AAAA,EACtC,MAAMC;AAAA,IACJC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAR;AAAA,QACE,CACEC,GACAQ,OAIkC;AAAA,UAClC,GAAGR;AAAA,UACH,WAAWS;AAAA,UACX,cAAcD,EAAG,QAAQ;AAAA,UACzB,cAAc;AAAA,QAAA;AAAA,MAChB;AAAA,IACF;AAAA,IAEFF;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAR,EAAO,CAACC,OAAqE;AAAA,QAC3E,GAAGA;AAAA,QACH,WAAWU;AAAA,QACX,cAAc;AAAA,QACd,cAAc;AAAA,MAAA,EACd;AAAA,IAAA;AAAA,IAEJJ;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAR,EAAO,CAACC,OAAqE;AAAA,QAC3E,GAAGA;AAAA,QACH,WAAWW;AAAA,QACX,cAAc;AAAA,QACd,cAAc;AAAA,MAAA,EACd;AAAA,IAAA;AAAA,IAEJL;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAT;AAAA,IAAA;AAAA,EACF;AAAA,EAEF,kBAAkBO;AAAA,IAChBC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAT;AAAA,IAAA;AAAA,IAEFQ;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAT;AAAA,IAAA;AAAA,EACF;AAAA,EAEF,QAAQO;AAAA,IACNC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAL,EAAsB,UAAU;AAAA,IAAA;AAAA,IAElCI;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAT;AAAA,IAAA;AAAA,EACF;AAAA,EAEF,eAAeO;AAAA,IACbC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAL,EAAsB,UAAU;AAAA,IAAA;AAAA,IAElCI;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAT;AAAA,IAAA;AAAA,EACF;AAEJ;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import { useState as p, useMemo as c } from "react";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
3
|
+
import { createMachine as f } from "robot3";
|
|
4
|
+
import { useTranslation as d } from "react-i18next";
|
|
5
|
+
import { useJobsAndCompensationsGetJobsSuspense as C } from "@gusto/embedded-api/react-query/jobsAndCompensationsGetJobs";
|
|
6
|
+
import { JobsListContextual as b, InitialEditCompensationContextual as J } from "./CompensationFlowComponents.js";
|
|
7
|
+
import { compensationStateMachine as E } from "./compensationStateMachine.js";
|
|
8
8
|
import { FlsaStatus as S } from "../../../../shared/constants.js";
|
|
9
9
|
import { useComponentDictionary as w } from "../../../../i18n/I18n.js";
|
|
10
10
|
import { BaseComponent as I } from "../../../Base/Base.js";
|
|
@@ -12,8 +12,8 @@ import "../../../Base/useBase.js";
|
|
|
12
12
|
import { Flow as h } from "../../../Flow/Flow.js";
|
|
13
13
|
import { useFlow as v } from "../../../Flow/useFlow.js";
|
|
14
14
|
const x = {
|
|
15
|
-
initialEditJob:
|
|
16
|
-
viewJobs:
|
|
15
|
+
initialEditJob: J,
|
|
16
|
+
viewJobs: b
|
|
17
17
|
};
|
|
18
18
|
function F(t) {
|
|
19
19
|
if (t.length === 0)
|
|
@@ -33,12 +33,12 @@ function M({
|
|
|
33
33
|
onEvent: r
|
|
34
34
|
}) {
|
|
35
35
|
w("Employee.Compensation", e);
|
|
36
|
-
const { data: m } =
|
|
36
|
+
const { data: m } = C({ employeeId: t }), [{ initialState: a, currentJobId: s }] = p(
|
|
37
37
|
() => F(m.jobs ?? [])
|
|
38
38
|
), u = c(
|
|
39
|
-
() =>
|
|
39
|
+
() => f(
|
|
40
40
|
a,
|
|
41
|
-
|
|
41
|
+
E,
|
|
42
42
|
(l) => ({
|
|
43
43
|
...l,
|
|
44
44
|
component: x[a],
|
|
@@ -58,7 +58,7 @@ function M({
|
|
|
58
58
|
return /* @__PURE__ */ i(h, { machine: u, onEvent: r });
|
|
59
59
|
}
|
|
60
60
|
const X = () => {
|
|
61
|
-
const { employeeId: t, onEvent: o, startDate: n, defaultValues: e } = v(), { t: r } =
|
|
61
|
+
const { employeeId: t, onEvent: o, startDate: n, defaultValues: e } = v(), { t: r } = d("common");
|
|
62
62
|
if (!t || !n)
|
|
63
63
|
throw new Error(
|
|
64
64
|
r("errors.missingParamsOrContext", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Compensation.js","sources":["../../../../../src/components/Employee/Compensation/onboarding/Compensation.tsx"],"sourcesContent":["import { useMemo, useState } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { useJobsAndCompensationsGetJobsSuspense } from '@gusto/embedded-api/react-query/jobsAndCompensationsGetJobs'\nimport { type Job } from '@gusto/embedded-api/models/components/job'\nimport type { FlsaStatusType } from '@gusto/embedded-api/models/components/flsastatustype'\nimport type { OnboardingContextInterface } from '../../OnboardingFlow/OnboardingFlowComponents'\nimport {\n InitialEditCompensationContextual,\n JobsListContextual,\n type CompensationFlowContextInterface,\n} from './CompensationFlowComponents'\nimport { compensationStateMachine } from './compensationStateMachine'\nimport { createMachine } from '@/lib/state-machine'\nimport type { RequireAtLeastOne } from '@/types/Helpers'\nimport type { PAY_PERIODS } from '@/shared/constants'\nimport { FlsaStatus } from '@/shared/constants'\nimport { useComponentDictionary } from '@/i18n'\nimport {\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { Flow } from '@/components/Flow/Flow'\nimport { useFlow } from '@/components/Flow/useFlow'\n\ntype CompensationInitialState = 'initialEditJob' | 'viewJobs'\n\ninterface InitialFlowConfig {\n initialState: CompensationInitialState\n currentJobId: string | null\n}\n\nconst INITIAL_COMPONENT_BY_STATE: Record<\n CompensationInitialState,\n React.ComponentType<CommonComponentInterface>\n> = {\n initialEditJob: InitialEditCompensationContextual,\n viewJobs: JobsListContextual,\n}\n\nfunction deriveInitialFlowConfig(employeeJobs: Job[]): InitialFlowConfig {\n if (employeeJobs.length === 0) {\n return { initialState: 'initialEditJob', currentJobId: null }\n }\n\n const onlyJob = employeeJobs.length === 1 ? (employeeJobs[0] ?? null) : null\n const onlyJobCompensation = findCurrentCompensation(onlyJob)\n\n if (onlyJob && onlyJobCompensation?.flsaStatus !== FlsaStatus.NONEXEMPT) {\n return { initialState: 'initialEditJob', currentJobId: onlyJob.uuid }\n }\n\n return { initialState: 'viewJobs', currentJobId: null }\n}\n\n/**\n * Default values for the compensation form fields.\n *\n * @remarks\n * At least one of the fields must be provided. If employee data is available\n * via the API, these values are overwritten.\n *\n * @public\n */\nexport type CompensationDefaultValues = RequireAtLeastOne<{\n /** The compensation rate (an amount in dollars). */\n rate?: Job['rate']\n /** The job title. */\n title?: Job['title']\n /** The pay period — one of `Hour`, `Week`, `Month`, `Year`, `Paycheck`. */\n paymentUnit?: (typeof PAY_PERIODS)[keyof typeof PAY_PERIODS]\n /** The FLSA classification — drives whether the role is treated as exempt, nonexempt, etc. */\n flsaStatus?: FlsaStatusType\n}>\n\n/**\n * Props for {@link Compensation}.\n *\n * @public\n */\nexport interface CompensationProps extends BaseComponentInterface<'Employee.Compensation'> {\n /** The associated employee identifier. */\n employeeId: string\n /** The date the employee will start work. */\n startDate: string\n /** Default values for the compensation form fields. If employee data is available via the API, these values are overwritten. */\n defaultValues?: CompensationDefaultValues\n}\n\n/**\n * Onboarding step for collecting an employee's role and compensation details.\n *\n * @remarks\n * Collects the job title, employee type (hourly, salary), compensation\n * amount, and pay period. For hourly employees, allows configuring multiple\n * roles. Automatically routes between editing the only job (when an employee\n * has zero or one non-Nonexempt job) and a jobs-list view (when multiple\n * roles need to be managed) on first mount; on subsequent refetches the user\n * stays on their current step.\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `employee/job/created` | Fired after a job is successfully created | {@link Job} |\n * | `employee/job/updated` | Fired after a job is successfully updated | {@link Job} |\n * | `employee/job/deleted` | Fired after a job is successfully deleted | — |\n * | `employee/compensation/updated` | Fired after compensation details are updated | {@link Compensation} |\n * | `employee/compensation/done` | Fired when compensation setup is complete and the parent flow can advance | — |\n *\n * @param props - See {@link CompensationProps}.\n * @returns The compensation onboarding step.\n * @public\n * @group Block components\n *\n * @example\n * ```tsx\n * import { EmployeeOnboarding } from '@gusto/embedded-react-sdk'\n *\n * function MyComponent() {\n * return (\n * <EmployeeOnboarding.Compensation\n * employeeId=\"4b3f930f-82cd-48a8-b797-798686e12e5e\"\n * startDate=\"2025-01-01\"\n * onEvent={() => {}}\n * />\n * )\n * }\n * ```\n */\nexport function Compensation(props: CompensationProps) {\n return (\n <BaseComponent {...props}>\n <CompensationFlow {...props} />\n </BaseComponent>\n )\n}\n\nconst findCurrentCompensation = (job?: Job | null) => {\n return job?.compensations?.find(comp => comp.uuid === job.currentCompensationUuid)\n}\n\nfunction CompensationFlow({\n employeeId,\n startDate,\n defaultValues,\n dictionary,\n onEvent,\n}: CompensationProps) {\n useComponentDictionary('Employee.Compensation', dictionary)\n\n const { data: jobsData } = useJobsAndCompensationsGetJobsSuspense({ employeeId })\n\n // Capture the routing decision from the first jobsData snapshot only. Suspense\n // guarantees that snapshot is fresh on first render. Subsequent refetches (e.g.\n // the getJobs invalidation that fires between EditCompensation's awaited job +\n // compensation mutations) must NOT re-seat the machine and reset the user's\n // place in the flow. Callers needing to re-derive routing for a different\n // employee should remount via `key`, matching the contract used by\n // OnboardingFlow / PayrollExecutionFlow / DismissalFlow.\n const [{ initialState, currentJobId }] = useState<InitialFlowConfig>(() =>\n deriveInitialFlowConfig(jobsData.jobs ?? []),\n )\n\n const manageCompensation = useMemo(\n () =>\n createMachine(\n initialState,\n compensationStateMachine,\n (initialContext: CompensationFlowContextInterface) => ({\n ...initialContext,\n component: INITIAL_COMPONENT_BY_STATE[initialState],\n employeeId,\n startDate,\n partnerDefaultValues: defaultValues,\n currentJobId,\n }),\n ),\n // `defaultValues` is intentionally omitted: a partner-supplied prop that may\n // arrive as a fresh object reference each render and only seeds the form\n // once. `initialState` and `currentJobId` are stable values from useState\n // above, so they're listed here as honest deps but never trigger recompute.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [employeeId, startDate, initialState, currentJobId],\n )\n\n return <Flow machine={manageCompensation} onEvent={onEvent} />\n}\n\n/** @internal */\nexport const CompensationContextual = () => {\n const { employeeId, onEvent, startDate, defaultValues } = useFlow<OnboardingContextInterface>()\n const { t } = useTranslation('common')\n\n if (!employeeId || !startDate) {\n throw new Error(\n t('errors.missingParamsOrContext', {\n component: 'Compensation',\n param: !employeeId ? 'employeeId' : 'startDate',\n provider: 'FlowProvider',\n }),\n )\n }\n return (\n <Compensation\n employeeId={employeeId}\n startDate={startDate}\n onEvent={onEvent}\n defaultValues={defaultValues?.compensation}\n />\n )\n}\n"],"names":["INITIAL_COMPONENT_BY_STATE","InitialEditCompensationContextual","JobsListContextual","deriveInitialFlowConfig","employeeJobs","onlyJob","onlyJobCompensation","findCurrentCompensation","FlsaStatus","Compensation","props","jsx","BaseComponent","CompensationFlow","job","comp","employeeId","startDate","defaultValues","dictionary","onEvent","useComponentDictionary","jobsData","useJobsAndCompensationsGetJobsSuspense","initialState","currentJobId","useState","manageCompensation","useMemo","createMachine","compensationStateMachine","initialContext","Flow","CompensationContextual","useFlow","t","useTranslation"],"mappings":";;;;;;;;;;;;;AAgCA,MAAMA,IAGF;AAAA,EACF,gBAAgBC;AAAA,EAChB,UAAUC;AACZ;AAEA,SAASC,EAAwBC,GAAwC;AACvE,MAAIA,EAAa,WAAW;AAC1B,WAAO,EAAE,cAAc,kBAAkB,cAAc,KAAA;AAGzD,QAAMC,IAAUD,EAAa,WAAW,IAAKA,EAAa,CAAC,KAAK,OAAQ,MAClEE,IAAsBC,EAAwBF,CAAO;AAE3D,SAAIA,KAAWC,GAAqB,eAAeE,EAAW,YACrD,EAAE,cAAc,kBAAkB,cAAcH,EAAQ,KAAA,IAG1D,EAAE,cAAc,YAAY,cAAc,KAAA;AACnD;AA4EO,SAASI,EAAaC,GAA0B;AACrD,SACE,gBAAAC,EAACC,KAAe,GAAGF,GACjB,4BAACG,GAAA,EAAkB,GAAGH,GAAO,EAAA,CAC/B;AAEJ;AAEA,MAAMH,IAA0B,CAACO,MACxBA,GAAK,eAAe,KAAK,OAAQC,EAAK,SAASD,EAAI,uBAAuB;AAGnF,SAASD,EAAiB;AAAA,EACxB,YAAAG;AAAA,EACA,WAAAC;AAAA,EACA,eAAAC;AAAA,EACA,YAAAC;AAAA,EACA,SAAAC;AACF,GAAsB;AACpB,EAAAC,EAAuB,yBAAyBF,CAAU;AAE1D,QAAM,EAAE,MAAMG,EAAA,IAAaC,EAAuC,EAAE,YAAAP,GAAY,GAS1E,CAAC,EAAE,cAAAQ,GAAc,cAAAC,EAAA,CAAc,IAAIC;AAAA,IAA4B,MACnEvB,EAAwBmB,EAAS,QAAQ,CAAA,CAAE;AAAA,EAAA,GAGvCK,IAAqBC;AAAA,IACzB,MACEC;AAAA,MACEL;AAAA,MACAM;AAAA,MACA,CAACC,OAAsD;AAAA,QACrD,GAAGA;AAAA,QACH,WAAW/B,EAA2BwB,CAAY;AAAA,QAClD,YAAAR;AAAA,QACA,WAAAC;AAAA,QACA,sBAAsBC;AAAA,QACtB,cAAAO;AAAA,MAAA;AAAA,IACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOJ,CAACT,GAAYC,GAAWO,GAAcC,CAAY;AAAA,EAAA;AAGpD,SAAO,gBAAAd,EAACqB,GAAA,EAAK,SAASL,GAAoB,SAAAP,EAAA,CAAkB;AAC9D;AAGO,MAAMa,IAAyB,MAAM;AAC1C,QAAM,EAAE,YAAAjB,GAAY,SAAAI,GAAS,WAAAH,GAAW,eAAAC,EAAA,IAAkBgB,EAAA,GACpD,EAAE,GAAAC,EAAA,IAAMC,EAAe,QAAQ;AAErC,MAAI,CAACpB,KAAc,CAACC;AAClB,UAAM,IAAI;AAAA,MACRkB,EAAE,iCAAiC;AAAA,QACjC,WAAW;AAAA,QACX,OAAQnB,IAA4B,cAAf;AAAA,QACrB,UAAU;AAAA,MAAA,CACX;AAAA,IAAA;AAGL,SACE,gBAAAL;AAAA,IAACF;AAAA,IAAA;AAAA,MACC,YAAAO;AAAA,MACA,WAAAC;AAAA,MACA,SAAAG;AAAA,MACA,eAAeF,GAAe;AAAA,IAAA;AAAA,EAAA;AAGpC;"}
|
|
1
|
+
{"version":3,"file":"Compensation.js","sources":["../../../../../src/components/Employee/Compensation/onboarding/Compensation.tsx"],"sourcesContent":["import { useMemo, useState } from 'react'\nimport { createMachine } from 'robot3'\nimport { useTranslation } from 'react-i18next'\nimport { useJobsAndCompensationsGetJobsSuspense } from '@gusto/embedded-api/react-query/jobsAndCompensationsGetJobs'\nimport { type Job } from '@gusto/embedded-api/models/components/job'\nimport type { FlsaStatusType } from '@gusto/embedded-api/models/components/flsastatustype'\nimport type { OnboardingContextInterface } from '../../OnboardingFlow/OnboardingFlowComponents'\nimport {\n InitialEditCompensationContextual,\n JobsListContextual,\n type CompensationFlowContextInterface,\n} from './CompensationFlowComponents'\nimport { compensationStateMachine } from './compensationStateMachine'\nimport type { RequireAtLeastOne } from '@/types/Helpers'\nimport type { PAY_PERIODS } from '@/shared/constants'\nimport { FlsaStatus } from '@/shared/constants'\nimport { useComponentDictionary } from '@/i18n'\nimport {\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { Flow } from '@/components/Flow/Flow'\nimport { useFlow } from '@/components/Flow/useFlow'\n\ntype CompensationInitialState = 'initialEditJob' | 'viewJobs'\n\ninterface InitialFlowConfig {\n initialState: CompensationInitialState\n currentJobId: string | null\n}\n\nconst INITIAL_COMPONENT_BY_STATE: Record<\n CompensationInitialState,\n React.ComponentType<CommonComponentInterface>\n> = {\n initialEditJob: InitialEditCompensationContextual,\n viewJobs: JobsListContextual,\n}\n\nfunction deriveInitialFlowConfig(employeeJobs: Job[]): InitialFlowConfig {\n if (employeeJobs.length === 0) {\n return { initialState: 'initialEditJob', currentJobId: null }\n }\n\n const onlyJob = employeeJobs.length === 1 ? (employeeJobs[0] ?? null) : null\n const onlyJobCompensation = findCurrentCompensation(onlyJob)\n\n if (onlyJob && onlyJobCompensation?.flsaStatus !== FlsaStatus.NONEXEMPT) {\n return { initialState: 'initialEditJob', currentJobId: onlyJob.uuid }\n }\n\n return { initialState: 'viewJobs', currentJobId: null }\n}\n\n/**\n * Default values for the compensation form fields.\n *\n * @remarks\n * At least one of the fields must be provided. If employee data is available\n * via the API, these values are overwritten.\n *\n * @public\n */\nexport type CompensationDefaultValues = RequireAtLeastOne<{\n /** The compensation rate (an amount in dollars). */\n rate?: Job['rate']\n /** The job title. */\n title?: Job['title']\n /** The pay period — one of `Hour`, `Week`, `Month`, `Year`, `Paycheck`. */\n paymentUnit?: (typeof PAY_PERIODS)[keyof typeof PAY_PERIODS]\n /** The FLSA classification — drives whether the role is treated as exempt, nonexempt, etc. */\n flsaStatus?: FlsaStatusType\n}>\n\n/**\n * Props for {@link Compensation}.\n *\n * @public\n */\nexport interface CompensationProps extends BaseComponentInterface<'Employee.Compensation'> {\n /** The associated employee identifier. */\n employeeId: string\n /** The date the employee will start work. */\n startDate: string\n /** Default values for the compensation form fields. If employee data is available via the API, these values are overwritten. */\n defaultValues?: CompensationDefaultValues\n}\n\n/**\n * Onboarding step for collecting an employee's role and compensation details.\n *\n * @remarks\n * Collects the job title, employee type (hourly, salary), compensation\n * amount, and pay period. For hourly employees, allows configuring multiple\n * roles. Automatically routes between editing the only job (when an employee\n * has zero or one non-Nonexempt job) and a jobs-list view (when multiple\n * roles need to be managed) on first mount; on subsequent refetches the user\n * stays on their current step.\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `employee/job/created` | Fired after a job is successfully created | {@link Job} |\n * | `employee/job/updated` | Fired after a job is successfully updated | {@link Job} |\n * | `employee/job/deleted` | Fired after a job is successfully deleted | — |\n * | `employee/compensation/updated` | Fired after compensation details are updated | {@link Compensation} |\n * | `employee/compensation/done` | Fired when compensation setup is complete and the parent flow can advance | — |\n *\n * @param props - See {@link CompensationProps}.\n * @returns The compensation onboarding step.\n * @public\n * @group Block components\n *\n * @example\n * ```tsx\n * import { EmployeeOnboarding } from '@gusto/embedded-react-sdk'\n *\n * function MyComponent() {\n * return (\n * <EmployeeOnboarding.Compensation\n * employeeId=\"4b3f930f-82cd-48a8-b797-798686e12e5e\"\n * startDate=\"2025-01-01\"\n * onEvent={() => {}}\n * />\n * )\n * }\n * ```\n */\nexport function Compensation(props: CompensationProps) {\n return (\n <BaseComponent {...props}>\n <CompensationFlow {...props} />\n </BaseComponent>\n )\n}\n\nconst findCurrentCompensation = (job?: Job | null) => {\n return job?.compensations?.find(comp => comp.uuid === job.currentCompensationUuid)\n}\n\nfunction CompensationFlow({\n employeeId,\n startDate,\n defaultValues,\n dictionary,\n onEvent,\n}: CompensationProps) {\n useComponentDictionary('Employee.Compensation', dictionary)\n\n const { data: jobsData } = useJobsAndCompensationsGetJobsSuspense({ employeeId })\n\n // Capture the routing decision from the first jobsData snapshot only. Suspense\n // guarantees that snapshot is fresh on first render. Subsequent refetches (e.g.\n // the getJobs invalidation that fires between EditCompensation's awaited job +\n // compensation mutations) must NOT re-seat the machine and reset the user's\n // place in the flow. Callers needing to re-derive routing for a different\n // employee should remount via `key`, matching the contract used by\n // OnboardingFlow / PayrollExecutionFlow / DismissalFlow.\n const [{ initialState, currentJobId }] = useState<InitialFlowConfig>(() =>\n deriveInitialFlowConfig(jobsData.jobs ?? []),\n )\n\n const manageCompensation = useMemo(\n () =>\n createMachine(\n initialState,\n compensationStateMachine,\n (initialContext: CompensationFlowContextInterface) => ({\n ...initialContext,\n component: INITIAL_COMPONENT_BY_STATE[initialState],\n employeeId,\n startDate,\n partnerDefaultValues: defaultValues,\n currentJobId,\n }),\n ),\n // `defaultValues` is intentionally omitted: a partner-supplied prop that may\n // arrive as a fresh object reference each render and only seeds the form\n // once. `initialState` and `currentJobId` are stable values from useState\n // above, so they're listed here as honest deps but never trigger recompute.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [employeeId, startDate, initialState, currentJobId],\n )\n\n return <Flow machine={manageCompensation} onEvent={onEvent} />\n}\n\n/** @internal */\nexport const CompensationContextual = () => {\n const { employeeId, onEvent, startDate, defaultValues } = useFlow<OnboardingContextInterface>()\n const { t } = useTranslation('common')\n\n if (!employeeId || !startDate) {\n throw new Error(\n t('errors.missingParamsOrContext', {\n component: 'Compensation',\n param: !employeeId ? 'employeeId' : 'startDate',\n provider: 'FlowProvider',\n }),\n )\n }\n return (\n <Compensation\n employeeId={employeeId}\n startDate={startDate}\n onEvent={onEvent}\n defaultValues={defaultValues?.compensation}\n />\n )\n}\n"],"names":["INITIAL_COMPONENT_BY_STATE","InitialEditCompensationContextual","JobsListContextual","deriveInitialFlowConfig","employeeJobs","onlyJob","onlyJobCompensation","findCurrentCompensation","FlsaStatus","Compensation","props","jsx","BaseComponent","CompensationFlow","job","comp","employeeId","startDate","defaultValues","dictionary","onEvent","useComponentDictionary","jobsData","useJobsAndCompensationsGetJobsSuspense","initialState","currentJobId","useState","manageCompensation","useMemo","createMachine","compensationStateMachine","initialContext","Flow","CompensationContextual","useFlow","t","useTranslation"],"mappings":";;;;;;;;;;;;;AAgCA,MAAMA,IAGF;AAAA,EACF,gBAAgBC;AAAA,EAChB,UAAUC;AACZ;AAEA,SAASC,EAAwBC,GAAwC;AACvE,MAAIA,EAAa,WAAW;AAC1B,WAAO,EAAE,cAAc,kBAAkB,cAAc,KAAA;AAGzD,QAAMC,IAAUD,EAAa,WAAW,IAAKA,EAAa,CAAC,KAAK,OAAQ,MAClEE,IAAsBC,EAAwBF,CAAO;AAE3D,SAAIA,KAAWC,GAAqB,eAAeE,EAAW,YACrD,EAAE,cAAc,kBAAkB,cAAcH,EAAQ,KAAA,IAG1D,EAAE,cAAc,YAAY,cAAc,KAAA;AACnD;AA4EO,SAASI,EAAaC,GAA0B;AACrD,SACE,gBAAAC,EAACC,KAAe,GAAGF,GACjB,4BAACG,GAAA,EAAkB,GAAGH,GAAO,EAAA,CAC/B;AAEJ;AAEA,MAAMH,IAA0B,CAACO,MACxBA,GAAK,eAAe,KAAK,OAAQC,EAAK,SAASD,EAAI,uBAAuB;AAGnF,SAASD,EAAiB;AAAA,EACxB,YAAAG;AAAA,EACA,WAAAC;AAAA,EACA,eAAAC;AAAA,EACA,YAAAC;AAAA,EACA,SAAAC;AACF,GAAsB;AACpB,EAAAC,EAAuB,yBAAyBF,CAAU;AAE1D,QAAM,EAAE,MAAMG,EAAA,IAAaC,EAAuC,EAAE,YAAAP,GAAY,GAS1E,CAAC,EAAE,cAAAQ,GAAc,cAAAC,EAAA,CAAc,IAAIC;AAAA,IAA4B,MACnEvB,EAAwBmB,EAAS,QAAQ,CAAA,CAAE;AAAA,EAAA,GAGvCK,IAAqBC;AAAA,IACzB,MACEC;AAAA,MACEL;AAAA,MACAM;AAAA,MACA,CAACC,OAAsD;AAAA,QACrD,GAAGA;AAAA,QACH,WAAW/B,EAA2BwB,CAAY;AAAA,QAClD,YAAAR;AAAA,QACA,WAAAC;AAAA,QACA,sBAAsBC;AAAA,QACtB,cAAAO;AAAA,MAAA;AAAA,IACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOJ,CAACT,GAAYC,GAAWO,GAAcC,CAAY;AAAA,EAAA;AAGpD,SAAO,gBAAAd,EAACqB,GAAA,EAAK,SAASL,GAAoB,SAAAP,EAAA,CAAkB;AAC9D;AAGO,MAAMa,IAAyB,MAAM;AAC1C,QAAM,EAAE,YAAAjB,GAAY,SAAAI,GAAS,WAAAH,GAAW,eAAAC,EAAA,IAAkBgB,EAAA,GACpD,EAAE,GAAAC,EAAA,IAAMC,EAAe,QAAQ;AAErC,MAAI,CAACpB,KAAc,CAACC;AAClB,UAAM,IAAI;AAAA,MACRkB,EAAE,iCAAiC;AAAA,QACjC,WAAW;AAAA,QACX,OAAQnB,IAA4B,cAAf;AAAA,QACrB,UAAU;AAAA,MAAA,CACX;AAAA,IAAA;AAGL,SACE,gBAAAL;AAAA,IAACF;AAAA,IAAA;AAAA,MACC,YAAAO;AAAA,MACA,WAAAC;AAAA,MACA,SAAAG;AAAA,MACA,eAAeF,GAAe;AAAA,IAAA;AAAA,EAAA;AAGpC;"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* `EMPLOYEE_COMPENSATION_DONE` deliberately has no transition out of `initialEditJob` or
|
|
3
3
|
* `viewJobs`. `Flow` re-emits every event to the upstream `onEvent` regardless of whether the
|
|
4
4
|
* local machine has a matching transition, so the parent flow still advances/unmounts this
|
|
5
|
-
* component on that signal. Modeling completion as a final state instead left `component`
|
|
5
|
+
* component on that signal. Modeling completion as a robot3 final state instead left `component`
|
|
6
6
|
* pointing at a step whose controls could never fire another transition — if a host doesn't
|
|
7
7
|
* unmount immediately, the screen would look interactive but be permanently dead (SDK-1169).
|
|
8
8
|
* Staying put means a host that keeps this component mounted past completion keeps a fully
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* @internal
|
|
12
12
|
*/
|
|
13
13
|
export declare const compensationStateMachine: {
|
|
14
|
-
initialEditJob: import('
|
|
15
|
-
viewJobs: import('
|
|
16
|
-
editJob: import('
|
|
14
|
+
initialEditJob: import('robot3').MachineState<any>;
|
|
15
|
+
viewJobs: import('robot3').MachineState<any>;
|
|
16
|
+
editJob: import('robot3').MachineState<any>;
|
|
17
17
|
};
|
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "
|
|
3
|
-
import { state as i, transition as t, reduce as n } from "../../../../lib/state-machine/core.js";
|
|
1
|
+
import { state as E, transition as t, reduce as n } from "robot3";
|
|
2
|
+
import { JobsListContextual as i, EditCompensationContextual as r } from "./CompensationFlowComponents.js";
|
|
4
3
|
import { componentEvents as e } from "../../../../shared/constants.js";
|
|
5
|
-
const
|
|
6
|
-
initialEditJob:
|
|
4
|
+
const m = {
|
|
5
|
+
initialEditJob: E(
|
|
7
6
|
t(
|
|
8
7
|
e.EMPLOYEE_COMPENSATION_RETURN_TO_LIST,
|
|
9
8
|
"viewJobs",
|
|
10
9
|
n((o) => ({
|
|
11
10
|
...o,
|
|
12
|
-
component:
|
|
11
|
+
component: i,
|
|
13
12
|
currentJobId: null
|
|
14
13
|
}))
|
|
15
14
|
)
|
|
16
15
|
),
|
|
17
|
-
viewJobs:
|
|
16
|
+
viewJobs: E(
|
|
18
17
|
t(
|
|
19
18
|
e.EMPLOYEE_JOB_ADD,
|
|
20
19
|
"editJob",
|
|
@@ -36,13 +35,13 @@ const p = {
|
|
|
36
35
|
)
|
|
37
36
|
)
|
|
38
37
|
),
|
|
39
|
-
editJob:
|
|
38
|
+
editJob: E(
|
|
40
39
|
t(
|
|
41
40
|
e.EMPLOYEE_COMPENSATION_RETURN_TO_LIST,
|
|
42
41
|
"viewJobs",
|
|
43
42
|
n((o) => ({
|
|
44
43
|
...o,
|
|
45
|
-
component:
|
|
44
|
+
component: i,
|
|
46
45
|
currentJobId: null
|
|
47
46
|
}))
|
|
48
47
|
),
|
|
@@ -51,13 +50,13 @@ const p = {
|
|
|
51
50
|
"viewJobs",
|
|
52
51
|
n((o) => ({
|
|
53
52
|
...o,
|
|
54
|
-
component:
|
|
53
|
+
component: i,
|
|
55
54
|
currentJobId: null
|
|
56
55
|
}))
|
|
57
56
|
)
|
|
58
57
|
)
|
|
59
58
|
};
|
|
60
59
|
export {
|
|
61
|
-
|
|
60
|
+
m as compensationStateMachine
|
|
62
61
|
};
|
|
63
62
|
//# sourceMappingURL=compensationStateMachine.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compensationStateMachine.js","sources":["../../../../../src/components/Employee/Compensation/onboarding/compensationStateMachine.ts"],"sourcesContent":["import {\n EditCompensationContextual,\n JobsListContextual,\n type CompensationFlowContextInterface,\n type EventPayloads,\n} from './CompensationFlowComponents'\nimport {
|
|
1
|
+
{"version":3,"file":"compensationStateMachine.js","sources":["../../../../../src/components/Employee/Compensation/onboarding/compensationStateMachine.ts"],"sourcesContent":["import { reduce, state, transition } from 'robot3'\nimport {\n EditCompensationContextual,\n JobsListContextual,\n type CompensationFlowContextInterface,\n type EventPayloads,\n} from './CompensationFlowComponents'\nimport { componentEvents } from '@/shared/constants'\nimport type { MachineEventType, MachineTransition } from '@/types/Helpers'\n\n/**\n * `EMPLOYEE_COMPENSATION_DONE` deliberately has no transition out of `initialEditJob` or\n * `viewJobs`. `Flow` re-emits every event to the upstream `onEvent` regardless of whether the\n * local machine has a matching transition, so the parent flow still advances/unmounts this\n * component on that signal. Modeling completion as a robot3 final state instead left `component`\n * pointing at a step whose controls could never fire another transition — if a host doesn't\n * unmount immediately, the screen would look interactive but be permanently dead (SDK-1169).\n * Staying put means a host that keeps this component mounted past completion keeps a fully\n * working jobs list instead.\n *\n * @internal\n */\nexport const compensationStateMachine = {\n initialEditJob: state<MachineTransition>(\n transition(\n componentEvents.EMPLOYEE_COMPENSATION_RETURN_TO_LIST,\n 'viewJobs',\n reduce((ctx: CompensationFlowContextInterface): CompensationFlowContextInterface => ({\n ...ctx,\n component: JobsListContextual,\n currentJobId: null,\n })),\n ),\n ),\n viewJobs: state<MachineTransition>(\n transition(\n componentEvents.EMPLOYEE_JOB_ADD,\n 'editJob',\n reduce((ctx: CompensationFlowContextInterface): CompensationFlowContextInterface => ({\n ...ctx,\n component: EditCompensationContextual,\n currentJobId: null,\n })),\n ),\n transition(\n componentEvents.EMPLOYEE_JOB_EDIT,\n 'editJob',\n reduce(\n (\n ctx: CompensationFlowContextInterface,\n ev: MachineEventType<EventPayloads, typeof componentEvents.EMPLOYEE_JOB_EDIT>,\n ): CompensationFlowContextInterface => ({\n ...ctx,\n component: EditCompensationContextual,\n currentJobId: ev.payload.uuid,\n }),\n ),\n ),\n ),\n editJob: state<MachineTransition>(\n transition(\n componentEvents.EMPLOYEE_COMPENSATION_RETURN_TO_LIST,\n 'viewJobs',\n reduce((ctx: CompensationFlowContextInterface): CompensationFlowContextInterface => ({\n ...ctx,\n component: JobsListContextual,\n currentJobId: null,\n })),\n ),\n transition(\n componentEvents.EMPLOYEE_COMPENSATION_CANCEL,\n 'viewJobs',\n reduce((ctx: CompensationFlowContextInterface): CompensationFlowContextInterface => ({\n ...ctx,\n component: JobsListContextual,\n currentJobId: null,\n })),\n ),\n ),\n}\n"],"names":["compensationStateMachine","state","transition","componentEvents","reduce","ctx","JobsListContextual","EditCompensationContextual","ev"],"mappings":";;;AAsBO,MAAMA,IAA2B;AAAA,EACtC,gBAAgBC;AAAA,IACdC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC,EAAO,CAACC,OAA6E;AAAA,QACnF,GAAGA;AAAA,QACH,WAAWC;AAAA,QACX,cAAc;AAAA,MAAA,EACd;AAAA,IAAA;AAAA,EACJ;AAAA,EAEF,UAAUL;AAAA,IACRC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC,EAAO,CAACC,OAA6E;AAAA,QACnF,GAAGA;AAAA,QACH,WAAWE;AAAA,QACX,cAAc;AAAA,MAAA,EACd;AAAA,IAAA;AAAA,IAEJL;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC;AAAA,QACE,CACEC,GACAG,OACsC;AAAA,UACtC,GAAGH;AAAA,UACH,WAAWE;AAAA,UACX,cAAcC,EAAG,QAAQ;AAAA,QAAA;AAAA,MAC3B;AAAA,IACF;AAAA,EACF;AAAA,EAEF,SAASP;AAAA,IACPC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC,EAAO,CAACC,OAA6E;AAAA,QACnF,GAAGA;AAAA,QACH,WAAWC;AAAA,QACX,cAAc;AAAA,MAAA,EACd;AAAA,IAAA;AAAA,IAEJJ;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC,EAAO,CAACC,OAA6E;AAAA,QACnF,GAAGA;AAAA,QACH,WAAWC;AAAA,QACX,cAAc;AAAA,MAAA,EACd;AAAA,IAAA;AAAA,EACJ;AAEJ;"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { createMachine as e } from "robot3";
|
|
3
|
+
import { useMemo as i } from "react";
|
|
4
|
+
import { dashboardStateMachine as n } from "./dashboardStateMachine.js";
|
|
5
|
+
import { DashboardViewContextual as c } from "./DashboardComponents.js";
|
|
6
6
|
import { Flow as h } from "../../Flow/Flow.js";
|
|
7
7
|
const M = ({ employeeId: o, onEvent: r }) => {
|
|
8
|
-
const t =
|
|
9
|
-
() =>
|
|
8
|
+
const t = i(
|
|
9
|
+
() => e(
|
|
10
10
|
"index",
|
|
11
|
-
|
|
11
|
+
n,
|
|
12
12
|
(a) => ({
|
|
13
13
|
...a,
|
|
14
|
-
component:
|
|
14
|
+
component: c,
|
|
15
15
|
employeeId: o
|
|
16
16
|
})
|
|
17
17
|
),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardFlow.js","sources":["../../../../src/components/Employee/Dashboard/DashboardFlow.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { dashboardStateMachine } from './dashboardStateMachine'\nimport { type DashboardContextInterface, DashboardViewContextual } from './DashboardComponents'\nimport { createMachine } from '@/lib/state-machine'\nimport { Flow } from '@/components/Flow/Flow'\nimport type { BaseComponentInterface } from '@/components/Base'\n\n/**\n * Props for {@link DashboardFlow}.\n *\n * @public\n */\nexport interface DashboardFlowProps extends BaseComponentInterface<never> {\n /** The associated employee identifier. */\n employeeId: string\n}\n\n/**\n * Hub for viewing and managing a single employee's profile, pay, and documents.\n *\n * @remarks\n * Renders a tabbed view of an employee's profile (Basic details, Job and pay,\n * Taxes, Documents), wires the card surfaces to their corresponding edit\n * screens via an internal state machine, and surfaces success alerts at the\n * top of the dashboard after each successful edit. Wraps the dashboard in\n * error and suspense boundaries.\n *\n * Every tab section of the dashboard is also exported as a self-contained\n * block that can be dropped into a custom layout without the surrounding\n * dashboard chrome (see the blocks below).\n *\n * Each block wraps its read-only card, its edit form, and the card↔form\n * transitions as a single drop-in. For cases where that built-in orchestration\n * doesn't fit — rendering a form in a modal, driving navigation via a router,\n * or showing a card read-only — each block's card and form are also exported\n * individually (e.g. {@link CompensationCard}, {@link CompensationEditForm}).\n * Using the individual pieces means owning the swap, any success alerts, and\n * cross-component state yourself.\n *\n * The dashboard composes self-fetching cards and their edit forms and forwards\n * every event they emit to the partner via `onEvent`; its internal state\n * machine also reacts to a subset of these events to swap between the cards\n * and edit screens and to surface success alerts. The table below is the\n * complete, current set of events observable from `DashboardFlow`, grouped by\n * the tab that emits them.\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `employee/management/profile/editRequested` | Fired when \"Edit\" is clicked on the Basic details (Profile) card | `{ employeeId: string }` |\n * | `employee/management/profile/updated` | Fired after the basic-details edit form is saved; the dashboard returns to the cards and surfaces the \"Profile updated\" alert | Updated `Employee` entity |\n * | `employee/management/profile/editCancelled` | Fired when the user clicks Cancel on the basic-details edit form; the dashboard returns to the cards | — |\n * | `employee/management/homeAddress/editRequested` | Fired when \"Manage\" is clicked on the Home address card | `{ employeeId: string }` |\n * | `employee/management/homeAddress/created` | Fired after a new home address is created on the manage screen; the manage screen stays open | Created `EmployeeAddress` entity |\n * | `employee/management/homeAddress/updated` | Fired after a home address is updated on the manage screen; the manage screen stays open | Updated `EmployeeAddress` entity |\n * | `employee/management/homeAddress/deleted` | Fired after a non-active home address is deleted on the manage screen; the manage screen stays open | Deleted `EmployeeAddress` entity |\n * | `employee/management/homeAddress/editCancelled` | Fired when the user clicks Back on the manage screen; the dashboard returns to the cards | — |\n * | `employee/management/workAddress/editRequested` | Fired when \"Manage\" is clicked on the Work address card | `{ employeeId: string }` |\n * | `employee/management/workAddress/created` | Fired after a new work address is created on the manage screen; the manage screen stays open | Created `EmployeeWorkAddress` entity |\n * | `employee/management/workAddress/updated` | Fired after a work address is updated on the manage screen; the manage screen stays open | Updated `EmployeeWorkAddress` entity |\n * | `employee/management/workAddress/deleted` | Fired after a work address is deleted on the manage screen; the manage screen stays open | Deleted `EmployeeWorkAddress` entity |\n * | `employee/management/workAddress/editCancelled` | Fired when the user clicks Back on the manage screen; the dashboard returns to the cards | — |\n * | `employee/management/compensation/card/editRequested` | Fired when an \"Edit\" CTA is clicked for a job on the Compensation card | `{ employeeId: string, jobId: string }` |\n * | `employee/management/compensation/card/addRequested` | Fired when \"Add job\" is clicked from the Compensation card's empty state | `{ employeeId: string }` |\n * | `employee/management/compensation/card/addAnotherRequested` | Fired when \"Add another job\" is clicked on the Compensation card | `{ employeeId: string }` |\n * | `employee/management/compensation/card/jobDeleted` | Fired after a non-primary job is deleted via the card's confirm dialog | `{ employeeId: string, jobId: string }` |\n * | `employee/management/compensation/card/changeCancelled` | Fired after a scheduled future-dated change is cancelled from the card | `{ employeeId: string, compensationId: string }` |\n * | `employee/management/compensation/editForm/submitted` | Fired after an edit-compensation save completes; the dashboard returns to the cards | Updated `Compensation` entity |\n * | `employee/management/compensation/editForm/cancelled` | Fired when the user cancels the edit-compensation form; the dashboard returns to the cards | — |\n * | `employee/management/compensation/addJobForm/submitted` | Fired after the first job and compensation are saved; the dashboard returns to the cards and surfaces the \"Job added\" alert | Updated `Compensation` entity |\n * | `employee/management/compensation/addJobForm/cancelled` | Fired when the user cancels the add-job form; the dashboard returns to the cards | — |\n * | `employee/management/compensation/addAnotherJobForm/submitted` | Fired after a secondary job and compensation are saved; the dashboard returns to the cards and surfaces the \"Job added\" alert | Updated `Compensation` entity |\n * | `employee/management/compensation/addAnotherJobForm/cancelled` | Fired when the user cancels the add-another-job form; the dashboard returns to the cards | — |\n * | `employee/management/paymentMethod/card/addRequested` | Fired when \"Add bank account\" / \"Add another bank account\" is clicked on the Payment card | — |\n * | `employee/management/paymentMethod/card/splitRequested` | Fired when \"Split paycheck\" is clicked on the Payment card | — |\n * | `employee/management/paymentMethod/card/bankAccountDeleted` | Fired after a bank account is deleted from the card; the dashboard surfaces the \"Bank account deleted\" alert | Response from the Delete a bank account endpoint |\n * | `employee/management/paymentMethod/bankForm/submitted` | Fired after a new bank account is saved; the dashboard returns to the cards and surfaces the \"Bank account added\" alert | Created `EmployeeBankAccount` entity |\n * | `employee/management/paymentMethod/bankForm/cancelled` | Fired when the user cancels the add-bank-account screen; the dashboard returns to the cards | — |\n * | `employee/management/paymentMethod/splitForm/submitted` | Fired after the split configuration is saved; the dashboard returns to the cards and surfaces the \"Split updated\" alert | Updated `EmployeePaymentMethod` entity |\n * | `employee/management/paymentMethod/splitForm/cancelled` | Fired when the user cancels the split-paycheck screen; the dashboard returns to the cards | — |\n * | `employee/management/deductions/card/addRequested` | Fired when \"Add deduction\" is clicked on the Deductions card | `{ employeeId: string }` |\n * | `employee/management/deductions/card/editRequested` | Fired when a row's \"Edit\" menu item is chosen on the Deductions card | The `Garnishment` row being edited |\n * | `employee/management/deductions/card/deleted` | Fired after the soft-delete dialog is confirmed; the dashboard surfaces the \"Deduction deleted\" alert | The now-inactive `Garnishment` |\n * | `employee/management/deductions/editForm/created` | Fired after a new deduction is created; the dashboard returns to the cards and surfaces the \"Deduction added\" alert | The created `Garnishment` |\n * | `employee/management/deductions/editForm/updated` | Fired after a deduction is updated; the dashboard returns to the cards and surfaces the \"Deduction updated\" alert | The updated `Garnishment` |\n * | `employee/management/deductions/editForm/cancelled` | Fired when the user cancels the add/edit deduction form; the dashboard returns to the cards | — |\n * | `employee/management/paystubs/card/downloadRequested` | Fired when a paystub row's download button is clicked, before the PDF is fetched | `{ employeeId: string, payrollUuid: string }` |\n * | `employee/management/paystubs/card/downloaded` | Fired after the paystub PDF is fetched and opened in a new tab | `{ employeeId: string, payrollUuid: string }` |\n * | `employee/management/federalTaxes/card/editRequested` | Fired when \"Edit\" is clicked on the Federal taxes card | `{ employeeId: string }` |\n * | `employee/management/federalTaxes/editForm/submitted` | Fired after a federal-taxes save succeeds; the dashboard returns to the cards and surfaces the \"Federal taxes updated\" alert | Updated `EmployeeFederalTax` entity |\n * | `employee/management/federalTaxes/editForm/cancelled` | Fired when the user cancels the federal-taxes edit form; the dashboard returns to the cards | — |\n * | `employee/management/stateTaxes/editRequested` | Fired when \"Edit\" is clicked on the State taxes card | `{ employeeId: string }` |\n * | `employee/management/stateTaxes/updated` | Fired after a state-taxes save succeeds; the dashboard returns to the cards and surfaces the \"State taxes updated\" alert | `{ employeeStateTaxesList: EmployeeStateTaxesList[] }` |\n * | `employee/management/stateTaxes/editCancelled` | Fired when the user cancels the state-taxes edit form; the dashboard returns to the cards | — |\n * | `employee/management/documents/card/viewRequested` | Fired when a document row's \"View\" CTA is clicked; the dashboard swaps to the read-only document viewer | `{ employeeId: string, formId: string }` |\n * | `CANCEL` | Fired when the user clicks Back in the document viewer; the dashboard returns to the cards | — |\n * | `employee/dashboard/tabChange` | Fired when the user switches dashboard tabs | `{ tab: 'basicDetails' \\| 'jobAndPay' \\| 'taxes' \\| 'documents' }` |\n * | `employee/dismiss` | Fired when the user dismisses a top-of-dashboard success alert | — |\n *\n * @components\n * - {@link Dashboard}\n * - {@link ProfileEditForm}\n * - {@link HomeAddressEditForm}\n * - {@link WorkAddressEditForm}\n * - {@link FederalTaxesEditForm}\n * - {@link StateTaxesEditForm}\n * - {@link PaymentMethodBankForm}\n * - {@link PaymentMethodSplitForm}\n * - {@link CompensationAddJobForm}\n * - {@link CompensationEditForm}\n * - {@link CompensationAddAnotherJobForm}\n * - {@link DeductionsEditForm}\n * - {@link DocumentManager}\n *\n * @param props - See {@link DashboardFlowProps}.\n * @returns The tabbed dashboard with internal navigation between cards and edit screens.\n * @public\n * @group Flow components\n *\n * @example\n * ```tsx title=\"App.tsx\"\n * import { EmployeeManagement } from '@gusto/embedded-react-sdk'\n *\n * function MyApp() {\n * return (\n * <EmployeeManagement.DashboardFlow\n * employeeId=\"4b3f930f-82cd-48a8-b797-798686e12e5e\"\n * onEvent={() => {}}\n * />\n * )\n * }\n * ```\n */\nexport const DashboardFlow = ({ employeeId, onEvent }: DashboardFlowProps) => {\n const dashboardMachine = useMemo(\n () =>\n createMachine(\n 'index',\n dashboardStateMachine,\n (initialContext: DashboardContextInterface) => ({\n ...initialContext,\n component: DashboardViewContextual,\n employeeId,\n }),\n ),\n [employeeId],\n )\n\n return <Flow machine={dashboardMachine} onEvent={onEvent} />\n}\n"],"names":["DashboardFlow","employeeId","onEvent","dashboardMachine","useMemo","createMachine","dashboardStateMachine","initialContext","DashboardViewContextual","jsx","Flow"],"mappings":";;;;;;AAqIO,MAAMA,IAAgB,CAAC,EAAE,YAAAC,GAAY,SAAAC,QAAkC;AAC5E,QAAMC,IAAmBC;AAAA,IACvB,MACEC;AAAA,MACE;AAAA,MACAC;AAAA,MACA,CAACC,OAA+C;AAAA,QAC9C,GAAGA;AAAA,QACH,WAAWC;AAAA,QACX,YAAAP;AAAA,MAAA;AAAA,IACF;AAAA,IAEJ,CAACA,CAAU;AAAA,EAAA;AAGb,SAAO,gBAAAQ,EAACC,GAAA,EAAK,SAASP,GAAkB,SAAAD,EAAA,CAAkB;AAC5D;"}
|
|
1
|
+
{"version":3,"file":"DashboardFlow.js","sources":["../../../../src/components/Employee/Dashboard/DashboardFlow.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMemo } from 'react'\nimport { dashboardStateMachine } from './dashboardStateMachine'\nimport { type DashboardContextInterface, DashboardViewContextual } from './DashboardComponents'\nimport { Flow } from '@/components/Flow/Flow'\nimport type { BaseComponentInterface } from '@/components/Base'\n\n/**\n * Props for {@link DashboardFlow}.\n *\n * @public\n */\nexport interface DashboardFlowProps extends BaseComponentInterface<never> {\n /** The associated employee identifier. */\n employeeId: string\n}\n\n/**\n * Hub for viewing and managing a single employee's profile, pay, and documents.\n *\n * @remarks\n * Renders a tabbed view of an employee's profile (Basic details, Job and pay,\n * Taxes, Documents), wires the card surfaces to their corresponding edit\n * screens via an internal state machine, and surfaces success alerts at the\n * top of the dashboard after each successful edit. Wraps the dashboard in\n * error and suspense boundaries.\n *\n * Every tab section of the dashboard is also exported as a self-contained\n * block that can be dropped into a custom layout without the surrounding\n * dashboard chrome (see the blocks below).\n *\n * Each block wraps its read-only card, its edit form, and the card↔form\n * transitions as a single drop-in. For cases where that built-in orchestration\n * doesn't fit — rendering a form in a modal, driving navigation via a router,\n * or showing a card read-only — each block's card and form are also exported\n * individually (e.g. {@link CompensationCard}, {@link CompensationEditForm}).\n * Using the individual pieces means owning the swap, any success alerts, and\n * cross-component state yourself.\n *\n * The dashboard composes self-fetching cards and their edit forms and forwards\n * every event they emit to the partner via `onEvent`; its internal state\n * machine also reacts to a subset of these events to swap between the cards\n * and edit screens and to surface success alerts. The table below is the\n * complete, current set of events observable from `DashboardFlow`, grouped by\n * the tab that emits them.\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `employee/management/profile/editRequested` | Fired when \"Edit\" is clicked on the Basic details (Profile) card | `{ employeeId: string }` |\n * | `employee/management/profile/updated` | Fired after the basic-details edit form is saved; the dashboard returns to the cards and surfaces the \"Profile updated\" alert | Updated `Employee` entity |\n * | `employee/management/profile/editCancelled` | Fired when the user clicks Cancel on the basic-details edit form; the dashboard returns to the cards | — |\n * | `employee/management/homeAddress/editRequested` | Fired when \"Manage\" is clicked on the Home address card | `{ employeeId: string }` |\n * | `employee/management/homeAddress/created` | Fired after a new home address is created on the manage screen; the manage screen stays open | Created `EmployeeAddress` entity |\n * | `employee/management/homeAddress/updated` | Fired after a home address is updated on the manage screen; the manage screen stays open | Updated `EmployeeAddress` entity |\n * | `employee/management/homeAddress/deleted` | Fired after a non-active home address is deleted on the manage screen; the manage screen stays open | Deleted `EmployeeAddress` entity |\n * | `employee/management/homeAddress/editCancelled` | Fired when the user clicks Back on the manage screen; the dashboard returns to the cards | — |\n * | `employee/management/workAddress/editRequested` | Fired when \"Manage\" is clicked on the Work address card | `{ employeeId: string }` |\n * | `employee/management/workAddress/created` | Fired after a new work address is created on the manage screen; the manage screen stays open | Created `EmployeeWorkAddress` entity |\n * | `employee/management/workAddress/updated` | Fired after a work address is updated on the manage screen; the manage screen stays open | Updated `EmployeeWorkAddress` entity |\n * | `employee/management/workAddress/deleted` | Fired after a work address is deleted on the manage screen; the manage screen stays open | Deleted `EmployeeWorkAddress` entity |\n * | `employee/management/workAddress/editCancelled` | Fired when the user clicks Back on the manage screen; the dashboard returns to the cards | — |\n * | `employee/management/compensation/card/editRequested` | Fired when an \"Edit\" CTA is clicked for a job on the Compensation card | `{ employeeId: string, jobId: string }` |\n * | `employee/management/compensation/card/addRequested` | Fired when \"Add job\" is clicked from the Compensation card's empty state | `{ employeeId: string }` |\n * | `employee/management/compensation/card/addAnotherRequested` | Fired when \"Add another job\" is clicked on the Compensation card | `{ employeeId: string }` |\n * | `employee/management/compensation/card/jobDeleted` | Fired after a non-primary job is deleted via the card's confirm dialog | `{ employeeId: string, jobId: string }` |\n * | `employee/management/compensation/card/changeCancelled` | Fired after a scheduled future-dated change is cancelled from the card | `{ employeeId: string, compensationId: string }` |\n * | `employee/management/compensation/editForm/submitted` | Fired after an edit-compensation save completes; the dashboard returns to the cards | Updated `Compensation` entity |\n * | `employee/management/compensation/editForm/cancelled` | Fired when the user cancels the edit-compensation form; the dashboard returns to the cards | — |\n * | `employee/management/compensation/addJobForm/submitted` | Fired after the first job and compensation are saved; the dashboard returns to the cards and surfaces the \"Job added\" alert | Updated `Compensation` entity |\n * | `employee/management/compensation/addJobForm/cancelled` | Fired when the user cancels the add-job form; the dashboard returns to the cards | — |\n * | `employee/management/compensation/addAnotherJobForm/submitted` | Fired after a secondary job and compensation are saved; the dashboard returns to the cards and surfaces the \"Job added\" alert | Updated `Compensation` entity |\n * | `employee/management/compensation/addAnotherJobForm/cancelled` | Fired when the user cancels the add-another-job form; the dashboard returns to the cards | — |\n * | `employee/management/paymentMethod/card/addRequested` | Fired when \"Add bank account\" / \"Add another bank account\" is clicked on the Payment card | — |\n * | `employee/management/paymentMethod/card/splitRequested` | Fired when \"Split paycheck\" is clicked on the Payment card | — |\n * | `employee/management/paymentMethod/card/bankAccountDeleted` | Fired after a bank account is deleted from the card; the dashboard surfaces the \"Bank account deleted\" alert | Response from the Delete a bank account endpoint |\n * | `employee/management/paymentMethod/bankForm/submitted` | Fired after a new bank account is saved; the dashboard returns to the cards and surfaces the \"Bank account added\" alert | Created `EmployeeBankAccount` entity |\n * | `employee/management/paymentMethod/bankForm/cancelled` | Fired when the user cancels the add-bank-account screen; the dashboard returns to the cards | — |\n * | `employee/management/paymentMethod/splitForm/submitted` | Fired after the split configuration is saved; the dashboard returns to the cards and surfaces the \"Split updated\" alert | Updated `EmployeePaymentMethod` entity |\n * | `employee/management/paymentMethod/splitForm/cancelled` | Fired when the user cancels the split-paycheck screen; the dashboard returns to the cards | — |\n * | `employee/management/deductions/card/addRequested` | Fired when \"Add deduction\" is clicked on the Deductions card | `{ employeeId: string }` |\n * | `employee/management/deductions/card/editRequested` | Fired when a row's \"Edit\" menu item is chosen on the Deductions card | The `Garnishment` row being edited |\n * | `employee/management/deductions/card/deleted` | Fired after the soft-delete dialog is confirmed; the dashboard surfaces the \"Deduction deleted\" alert | The now-inactive `Garnishment` |\n * | `employee/management/deductions/editForm/created` | Fired after a new deduction is created; the dashboard returns to the cards and surfaces the \"Deduction added\" alert | The created `Garnishment` |\n * | `employee/management/deductions/editForm/updated` | Fired after a deduction is updated; the dashboard returns to the cards and surfaces the \"Deduction updated\" alert | The updated `Garnishment` |\n * | `employee/management/deductions/editForm/cancelled` | Fired when the user cancels the add/edit deduction form; the dashboard returns to the cards | — |\n * | `employee/management/paystubs/card/downloadRequested` | Fired when a paystub row's download button is clicked, before the PDF is fetched | `{ employeeId: string, payrollUuid: string }` |\n * | `employee/management/paystubs/card/downloaded` | Fired after the paystub PDF is fetched and opened in a new tab | `{ employeeId: string, payrollUuid: string }` |\n * | `employee/management/federalTaxes/card/editRequested` | Fired when \"Edit\" is clicked on the Federal taxes card | `{ employeeId: string }` |\n * | `employee/management/federalTaxes/editForm/submitted` | Fired after a federal-taxes save succeeds; the dashboard returns to the cards and surfaces the \"Federal taxes updated\" alert | Updated `EmployeeFederalTax` entity |\n * | `employee/management/federalTaxes/editForm/cancelled` | Fired when the user cancels the federal-taxes edit form; the dashboard returns to the cards | — |\n * | `employee/management/stateTaxes/editRequested` | Fired when \"Edit\" is clicked on the State taxes card | `{ employeeId: string }` |\n * | `employee/management/stateTaxes/updated` | Fired after a state-taxes save succeeds; the dashboard returns to the cards and surfaces the \"State taxes updated\" alert | `{ employeeStateTaxesList: EmployeeStateTaxesList[] }` |\n * | `employee/management/stateTaxes/editCancelled` | Fired when the user cancels the state-taxes edit form; the dashboard returns to the cards | — |\n * | `employee/management/documents/card/viewRequested` | Fired when a document row's \"View\" CTA is clicked; the dashboard swaps to the read-only document viewer | `{ employeeId: string, formId: string }` |\n * | `CANCEL` | Fired when the user clicks Back in the document viewer; the dashboard returns to the cards | — |\n * | `employee/dashboard/tabChange` | Fired when the user switches dashboard tabs | `{ tab: 'basicDetails' \\| 'jobAndPay' \\| 'taxes' \\| 'documents' }` |\n * | `employee/dismiss` | Fired when the user dismisses a top-of-dashboard success alert | — |\n *\n * @components\n * - {@link Dashboard}\n * - {@link ProfileEditForm}\n * - {@link HomeAddressEditForm}\n * - {@link WorkAddressEditForm}\n * - {@link FederalTaxesEditForm}\n * - {@link StateTaxesEditForm}\n * - {@link PaymentMethodBankForm}\n * - {@link PaymentMethodSplitForm}\n * - {@link CompensationAddJobForm}\n * - {@link CompensationEditForm}\n * - {@link CompensationAddAnotherJobForm}\n * - {@link DeductionsEditForm}\n * - {@link DocumentManager}\n *\n * @param props - See {@link DashboardFlowProps}.\n * @returns The tabbed dashboard with internal navigation between cards and edit screens.\n * @public\n * @group Flow components\n *\n * @example\n * ```tsx title=\"App.tsx\"\n * import { EmployeeManagement } from '@gusto/embedded-react-sdk'\n *\n * function MyApp() {\n * return (\n * <EmployeeManagement.DashboardFlow\n * employeeId=\"4b3f930f-82cd-48a8-b797-798686e12e5e\"\n * onEvent={() => {}}\n * />\n * )\n * }\n * ```\n */\nexport const DashboardFlow = ({ employeeId, onEvent }: DashboardFlowProps) => {\n const dashboardMachine = useMemo(\n () =>\n createMachine(\n 'index',\n dashboardStateMachine,\n (initialContext: DashboardContextInterface) => ({\n ...initialContext,\n component: DashboardViewContextual,\n employeeId,\n }),\n ),\n [employeeId],\n )\n\n return <Flow machine={dashboardMachine} onEvent={onEvent} />\n}\n"],"names":["DashboardFlow","employeeId","onEvent","dashboardMachine","useMemo","createMachine","dashboardStateMachine","initialContext","DashboardViewContextual","jsx","Flow"],"mappings":";;;;;;AAqIO,MAAMA,IAAgB,CAAC,EAAE,YAAAC,GAAY,SAAAC,QAAkC;AAC5E,QAAMC,IAAmBC;AAAA,IACvB,MACEC;AAAA,MACE;AAAA,MACAC;AAAA,MACA,CAACC,OAA+C;AAAA,QAC9C,GAAGA;AAAA,QACH,WAAWC;AAAA,QACX,YAAAP;AAAA,MAAA;AAAA,IACF;AAAA,IAEJ,CAACA,CAAU;AAAA,EAAA;AAGb,SAAO,gBAAAQ,EAACC,GAAA,EAAK,SAASP,GAAkB,SAAAD,EAAA,CAAkB;AAC5D;"}
|