@gusto/embedded-react-sdk 0.57.3 → 0.58.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +88 -0
- package/dist/components/Common/DataView/DataCards/DataCards.js +98 -66
- package/dist/components/Common/DataView/DataCards/DataCards.js.map +1 -1
- package/dist/components/Common/DataView/DataCards/DataCards.module.scss.js +11 -9
- package/dist/components/Common/DataView/DataCards/DataCards.module.scss.js.map +1 -1
- package/dist/components/Common/DataView/DataTable/DataTable.js +86 -75
- package/dist/components/Common/DataView/DataTable/DataTable.js.map +1 -1
- package/dist/components/Common/DataView/DataView.js.map +1 -1
- package/dist/components/Common/DataView/getSortControls.js +22 -0
- package/dist/components/Common/DataView/getSortControls.js.map +1 -0
- package/dist/components/Common/DataView/useDataView.js +30 -24
- package/dist/components/Common/DataView/useDataView.js.map +1 -1
- package/dist/components/Common/UI/Table/Table.js +65 -25
- package/dist/components/Common/UI/Table/Table.js.map +1 -1
- package/dist/components/Common/UI/Table/Table.module.scss.js +8 -4
- package/dist/components/Common/UI/Table/Table.module.scss.js.map +1 -1
- package/dist/components/Common/UI/Table/TableTypes.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +3 -4
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +3 -4
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +5 -6
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +3 -4
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +3 -4
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +5 -6
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +6 -7
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +3 -4
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +3 -4
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +3 -4
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/PaySchedule.js +30 -45
- package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
- package/dist/components/Company/PaySchedule/PayScheduleComponents.js +11 -12
- package/dist/components/Company/PaySchedule/PayScheduleComponents.js.map +1 -1
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/fields.js.map +1 -1
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/payScheduleSchema.js.map +1 -1
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/usePayScheduleForm.js +78 -83
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/usePayScheduleForm.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +3 -4
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +3 -4
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/TaxRateManagement/context.js +3 -4
- package/dist/components/Company/StateTaxes/TaxRateManagement/context.js.map +1 -1
- package/dist/components/Contractor/Compensation/management/CompensationEditForm.js +45 -54
- package/dist/components/Contractor/Compensation/management/CompensationEditForm.js.map +1 -1
- package/dist/components/Contractor/Compensation/shared/useContractorPayForm/contractorPaySchema.js +17 -22
- package/dist/components/Contractor/Compensation/shared/useContractorPayForm/contractorPaySchema.js.map +1 -1
- package/dist/components/Contractor/ContractorList/management/ManagementContractorList.js +1 -0
- package/dist/components/Contractor/ContractorList/management/ManagementContractorList.js.map +1 -1
- package/dist/components/Contractor/ContractorList/management/ManagementContractorListView.js +122 -113
- package/dist/components/Contractor/ContractorList/management/ManagementContractorListView.js.map +1 -1
- package/dist/components/Contractor/ContractorList/shared/useContractorList.js +63 -54
- package/dist/components/Contractor/ContractorList/shared/useContractorList.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/onboarding/PaymentMethod.js +39 -48
- package/dist/components/Contractor/PaymentMethod/onboarding/PaymentMethod.js.map +1 -1
- package/dist/components/Contractor/Profile/onboarding/ContractorProfile.js +76 -69
- package/dist/components/Contractor/Profile/onboarding/ContractorProfile.js.map +1 -1
- package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/contractorDetailsSchema.js +27 -29
- package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/contractorDetailsSchema.js.map +1 -1
- package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/useContractorDetailsForm.js +14 -12
- package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/useContractorDetailsForm.js.map +1 -1
- package/dist/components/Contractor/shared/hourlyRate.js +14 -0
- package/dist/components/Contractor/shared/hourlyRate.js.map +1 -0
- package/dist/components/Employee/Compensation/management/CompensationCard/CompensationCard.js +63 -63
- package/dist/components/Employee/Compensation/management/CompensationCard/CompensationCard.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js +3 -4
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/onboarding/ListView.js +65 -74
- package/dist/components/Employee/PaymentMethod/onboarding/ListView.js.map +1 -1
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.js +16 -16
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.js.map +1 -1
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +2 -3
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js +84 -82
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js.map +1 -1
- package/dist/components/Payroll/OffCycleTaxWithholdingTable/getDefaultWithholdingPayPeriod.js +8 -0
- package/dist/components/Payroll/OffCycleTaxWithholdingTable/getDefaultWithholdingPayPeriod.js.map +1 -0
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +91 -88
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js +16 -16
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +146 -134
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.module.scss.js +14 -12
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.module.scss.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +34 -33
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/fields.js +49 -48
- package/dist/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/fields.js.map +1 -1
- package/dist/components/Payroll/PayrollExecutionFlow/PayrollExecutionFlow.js.map +1 -1
- package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.js +0 -4
- package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/PayrollFlow.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js +51 -38
- package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js +121 -102
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollLanding/PayrollLanding.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollList.js +79 -74
- package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +92 -83
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +23 -27
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
- package/dist/components/Payroll/PrintChecks/PrintChecksForm/PrintChecksForm.js +82 -75
- package/dist/components/Payroll/PrintChecks/PrintChecksForm/PrintChecksForm.js.map +1 -1
- package/dist/components/Payroll/RropPayrollEditEmployee/RropPayrollEditEmployee.js +416 -0
- package/dist/components/Payroll/RropPayrollEditEmployee/RropPayrollEditEmployee.js.map +1 -0
- package/dist/components/Payroll/{UNSTABLE_PayrollEditEmployee/UNSTABLE_PayrollEditEmployee.module.scss.js → RropPayrollEditEmployee/RropPayrollEditEmployee.module.scss.js} +1 -1
- package/dist/components/Payroll/RropPayrollEditEmployee/RropPayrollEditEmployee.module.scss.js.map +1 -0
- package/dist/components/Payroll/TransitionConfiguration/TransitionConfiguration.js +97 -0
- package/dist/components/Payroll/TransitionConfiguration/TransitionConfiguration.js.map +1 -0
- package/dist/components/Payroll/TransitionConfiguration/TransitionConfigurationPresentation.js +106 -0
- package/dist/components/Payroll/TransitionConfiguration/TransitionConfigurationPresentation.js.map +1 -0
- package/dist/components/Payroll/{TransitionCreation/TransitionCreationPresentation.module.scss.js → TransitionConfiguration/TransitionConfigurationPresentation.module.scss.js} +1 -1
- package/dist/components/Payroll/TransitionConfiguration/TransitionConfigurationPresentation.module.scss.js.map +1 -0
- package/dist/components/Payroll/TransitionConfiguration/TransitionConfigurationTypes.js +10 -0
- package/dist/components/Payroll/TransitionConfiguration/TransitionConfigurationTypes.js.map +1 -0
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.js +86 -64
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.js.map +1 -1
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.js +126 -77
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.js.map +1 -1
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.module.scss.js +8 -0
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.module.scss.js.map +1 -0
- package/dist/components/Payroll/index.js +16 -20
- package/dist/components/Payroll/index.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.js +2 -3
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/components/Payroll/useUnprocessedTransitionPayPeriods.js +11 -14
- package/dist/components/Payroll/useUnprocessedTransitionPayPeriods.js.map +1 -1
- package/dist/contexts/ApiProvider/ApiProvider.js +18 -17
- package/dist/contexts/ApiProvider/ApiProvider.js.map +1 -1
- package/dist/contexts/ApiProvider/payScheduleCustomNameHook.js +31 -0
- package/dist/contexts/ApiProvider/payScheduleCustomNameHook.js.map +1 -0
- package/dist/contexts/FeaturesProvider/FeaturesProvider.js +14 -0
- package/dist/contexts/FeaturesProvider/FeaturesProvider.js.map +1 -0
- package/dist/contexts/FeaturesProvider/useFeature.js +7 -0
- package/dist/contexts/FeaturesProvider/useFeature.js.map +1 -0
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +32 -30
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/contexts/UnstableFeaturesProvider/useUnstableFeature.js.map +1 -1
- package/dist/i18n/I18n.js +2 -3
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Contractor.Profile.json.js +1 -1
- package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js +29 -23
- package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js.map +1 -1
- package/dist/i18n/en/Payroll.PayrollLanding.json.js +1 -1
- package/dist/i18n/en/{Payroll.UNSTABLE_PayrollEditEmployee.json.js → Payroll.RropPayrollEditEmployee.json.js} +42 -38
- package/dist/i18n/en/Payroll.RropPayrollEditEmployee.json.js.map +1 -0
- package/dist/i18n/en/Payroll.TransitionConfiguration.json.js +28 -0
- package/dist/i18n/en/Payroll.TransitionConfiguration.json.js.map +1 -0
- package/dist/i18n/en/Payroll.TransitionPayrollAlert.json.js +16 -12
- package/dist/i18n/en/Payroll.TransitionPayrollAlert.json.js.map +1 -1
- package/dist/i18n/en/common.json.js +1 -1
- package/dist/package.json.js +1 -1
- package/dist/partner-hook-utils/form/composeSubmitHandler.js +55 -48
- package/dist/partner-hook-utils/form/composeSubmitHandler.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/RadioGroupHookField.js +31 -29
- package/dist/partner-hook-utils/form/fields/RadioGroupHookField.js.map +1 -1
- package/dist/shared/constants.js +2 -1
- package/dist/shared/constants.js.map +1 -1
- package/dist/src/components/Common/DataView/DataCards/DataCards.d.ts +3 -1
- package/dist/src/components/Common/DataView/DataTable/DataTable.d.ts +3 -1
- package/dist/src/components/Common/DataView/DataView.d.ts +2 -0
- package/dist/src/components/Common/DataView/getSortControls.d.ts +24 -0
- package/dist/src/components/Common/DataView/useDataView.d.ts +22 -1
- package/dist/src/components/Common/UI/Table/TableTypes.d.ts +71 -2
- package/dist/src/components/Company/PaySchedule/PaySchedule.d.ts +1 -9
- package/dist/src/components/Company/PaySchedule/PayScheduleComponents.d.ts +0 -1
- package/dist/src/components/Company/PaySchedule/shared/usePayScheduleForm/fields.d.ts +1 -1
- package/dist/src/components/Company/PaySchedule/shared/usePayScheduleForm/payScheduleSchema.d.ts +1 -1
- package/dist/src/components/Company/PaySchedule/shared/usePayScheduleForm/usePayScheduleForm.d.ts +3 -14
- package/dist/src/components/Contractor/ContractorList/management/ManagementContractorListView.d.ts +2 -2
- package/dist/src/components/Contractor/ContractorList/shared/index.d.ts +1 -1
- package/dist/src/components/Contractor/ContractorList/shared/useContractorList.d.ts +38 -0
- package/dist/src/components/Contractor/shared/hourlyRate.d.ts +23 -0
- package/dist/src/components/Payroll/OffCycleTaxWithholdingTable/getDefaultWithholdingPayPeriod.d.ts +9 -0
- package/dist/src/components/Payroll/PayrollEditEmployee/TimeOffField.d.ts +3 -1
- package/dist/src/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/fields.d.ts +2 -0
- package/dist/src/components/Payroll/PayrollExecutionFlow/PayrollExecutionFlow.d.ts +8 -6
- package/dist/src/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.d.ts +0 -8
- package/dist/src/components/Payroll/PayrollFlow/PayrollFlow.d.ts +5 -3
- package/dist/src/components/Payroll/PayrollFlow/PayrollFlowComponents.d.ts +2 -3
- package/dist/src/components/Payroll/PayrollFlow/payrollStateMachine.d.ts +1 -1
- package/dist/src/components/Payroll/PayrollLanding/PayrollLanding.d.ts +18 -5
- package/dist/src/components/Payroll/PayrollList/PayrollList.d.ts +11 -5
- package/dist/src/components/Payroll/{UNSTABLE_PayrollEditEmployee/UNSTABLE_PayrollEditEmployee.d.ts → RropPayrollEditEmployee/RropPayrollEditEmployee.d.ts} +9 -5
- package/dist/src/components/Payroll/TransitionConfiguration/TransitionConfiguration.d.ts +55 -0
- package/dist/src/components/Payroll/TransitionConfiguration/TransitionConfigurationPresentation.d.ts +9 -0
- package/dist/src/components/Payroll/TransitionConfiguration/TransitionConfigurationTypes.d.ts +52 -0
- package/dist/src/components/Payroll/TransitionConfiguration/index.d.ts +2 -0
- package/dist/src/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.d.ts +5 -2
- package/dist/src/components/Payroll/index.d.ts +2 -6
- package/dist/src/contexts/ApiProvider/payScheduleCustomNameHook.d.ts +14 -0
- package/dist/src/contexts/ApiProvider/payScheduleCustomNameHook.test.d.ts +1 -0
- package/dist/src/contexts/ComponentAdapter/componentAdapterTypes.d.ts +1 -1
- package/dist/src/contexts/FeaturesProvider/FeaturesProvider.d.ts +21 -0
- package/dist/src/contexts/FeaturesProvider/useFeature.d.ts +53 -0
- package/dist/src/contexts/GustoProvider/GustoProviderCustomUIAdapter.d.ts +3 -0
- package/dist/src/contexts/UnstableFeaturesProvider/useUnstableFeature.d.ts +38 -10
- package/dist/src/contexts/index.d.ts +1 -0
- package/dist/src/i18n/en/common.json.d.ts +5 -1
- package/dist/src/i18n/types.d.ts +113 -66
- package/dist/src/partner-hook-utils/form/fields/RadioGroupHookField.d.ts +9 -7
- package/dist/src/shared/constants.d.ts +4 -2
- package/dist/src/test-utils/renderWithProviders.d.ts +2 -0
- package/dist/style.css +1 -1
- package/docs/guides/endpoint-inventory.json +24 -27
- package/package.json +15 -14
- package/dist/components/Payroll/PayrollFlow/TransitionFlowContextual.js +0 -29
- package/dist/components/Payroll/PayrollFlow/TransitionFlowContextual.js.map +0 -1
- package/dist/components/Payroll/Transition/TransitionFlow.js +0 -60
- package/dist/components/Payroll/Transition/TransitionFlow.js.map +0 -1
- package/dist/components/Payroll/Transition/TransitionFlowComponents.js +0 -31
- package/dist/components/Payroll/Transition/TransitionFlowComponents.js.map +0 -1
- package/dist/components/Payroll/Transition/transitionStateMachine.js +0 -49
- package/dist/components/Payroll/Transition/transitionStateMachine.js.map +0 -1
- package/dist/components/Payroll/TransitionCreation/TransitionCreation.js +0 -100
- package/dist/components/Payroll/TransitionCreation/TransitionCreation.js.map +0 -1
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.js +0 -110
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.js.map +0 -1
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.module.scss.js.map +0 -1
- package/dist/components/Payroll/TransitionCreation/TransitionCreationTypes.js +0 -21
- package/dist/components/Payroll/TransitionCreation/TransitionCreationTypes.js.map +0 -1
- package/dist/components/Payroll/TransitionPayroll/TransitionPayroll.js +0 -48
- package/dist/components/Payroll/TransitionPayroll/TransitionPayroll.js.map +0 -1
- package/dist/components/Payroll/TransitionPayroll/TransitionPayrollComponents.js +0 -35
- package/dist/components/Payroll/TransitionPayroll/TransitionPayrollComponents.js.map +0 -1
- package/dist/components/Payroll/TransitionPayroll/transitionPayrollStateMachine.js +0 -23
- package/dist/components/Payroll/TransitionPayroll/transitionPayrollStateMachine.js.map +0 -1
- package/dist/components/Payroll/TransitionPayroll/useResolveTransitionPayroll.js +0 -29
- package/dist/components/Payroll/TransitionPayroll/useResolveTransitionPayroll.js.map +0 -1
- package/dist/components/Payroll/UNSTABLE_PayrollEditEmployee/UNSTABLE_PayrollEditEmployee.js +0 -411
- package/dist/components/Payroll/UNSTABLE_PayrollEditEmployee/UNSTABLE_PayrollEditEmployee.js.map +0 -1
- package/dist/components/Payroll/UNSTABLE_PayrollEditEmployee/UNSTABLE_PayrollEditEmployee.module.scss.js.map +0 -1
- package/dist/i18n/en/Payroll.Transition.json.js +0 -8
- package/dist/i18n/en/Payroll.Transition.json.js.map +0 -1
- package/dist/i18n/en/Payroll.TransitionCreation.json.js +0 -26
- package/dist/i18n/en/Payroll.TransitionCreation.json.js.map +0 -1
- package/dist/i18n/en/Payroll.UNSTABLE_PayrollEditEmployee.json.js.map +0 -1
- package/dist/src/components/Payroll/PayrollFlow/TransitionFlowContextual.d.ts +0 -7
- package/dist/src/components/Payroll/Transition/TransitionFlow.d.ts +0 -55
- package/dist/src/components/Payroll/Transition/TransitionFlowComponents.d.ts +0 -52
- package/dist/src/components/Payroll/Transition/index.d.ts +0 -2
- package/dist/src/components/Payroll/Transition/transitionStateMachine.d.ts +0 -29
- package/dist/src/components/Payroll/TransitionCreation/TransitionCreation.d.ts +0 -22
- package/dist/src/components/Payroll/TransitionCreation/TransitionCreationPresentation.d.ts +0 -9
- package/dist/src/components/Payroll/TransitionCreation/TransitionCreationTypes.d.ts +0 -57
- package/dist/src/components/Payroll/TransitionCreation/index.d.ts +0 -2
- package/dist/src/components/Payroll/TransitionPayroll/TransitionPayroll.d.ts +0 -55
- package/dist/src/components/Payroll/TransitionPayroll/TransitionPayrollComponents.d.ts +0 -24
- package/dist/src/components/Payroll/TransitionPayroll/TransitionPayrollTypes.d.ts +0 -23
- package/dist/src/components/Payroll/TransitionPayroll/index.d.ts +0 -2
- package/dist/src/components/Payroll/TransitionPayroll/transitionPayrollStateMachine.d.ts +0 -15
- package/dist/src/components/Payroll/TransitionPayroll/useResolveTransitionPayroll.d.ts +0 -28
- /package/dist/src/components/{Payroll/Transition/transitionStateMachine.test.d.ts → Common/DataView/getSortControls.test.d.ts} +0 -0
|
@@ -184,6 +184,11 @@
|
|
|
184
184
|
"path": "/v1/companies/:companyId/pay_schedules",
|
|
185
185
|
"docsUrl": "https://docs.gusto.com/embedded-payroll/v2026-06-15/reference/get-v1-companies-company_id-pay_schedules"
|
|
186
186
|
},
|
|
187
|
+
{
|
|
188
|
+
"method": "GET",
|
|
189
|
+
"path": "/v1/companies/:companyId/payrolls",
|
|
190
|
+
"docsUrl": "https://docs.gusto.com/embedded-payroll/v2026-06-15/reference/get-v1-companies-company_id-payrolls"
|
|
191
|
+
},
|
|
187
192
|
{
|
|
188
193
|
"method": "GET",
|
|
189
194
|
"path": "/v1/companies/:companyUuid/payrolls/blockers",
|
|
@@ -417,6 +422,11 @@
|
|
|
417
422
|
"path": "/v1/companies/:companyId/employees",
|
|
418
423
|
"docsUrl": "https://docs.gusto.com/embedded-payroll/v2026-06-15/reference/get-v1-companies-company_id-employees"
|
|
419
424
|
},
|
|
425
|
+
{
|
|
426
|
+
"method": "GET",
|
|
427
|
+
"path": "/v1/companies/:companyId/pay_schedules",
|
|
428
|
+
"docsUrl": "https://docs.gusto.com/embedded-payroll/v2026-06-15/reference/get-v1-companies-company_id-pay_schedules"
|
|
429
|
+
},
|
|
420
430
|
{
|
|
421
431
|
"method": "POST",
|
|
422
432
|
"path": "/v1/companies/:companyId/payrolls",
|
|
@@ -497,7 +507,7 @@
|
|
|
497
507
|
"payrollId"
|
|
498
508
|
]
|
|
499
509
|
},
|
|
500
|
-
"Payroll.
|
|
510
|
+
"Payroll.TransitionConfiguration": {
|
|
501
511
|
"endpoints": [
|
|
502
512
|
{
|
|
503
513
|
"method": "GET",
|
|
@@ -505,31 +515,24 @@
|
|
|
505
515
|
"docsUrl": "https://docs.gusto.com/embedded-payroll/v2026-06-15/reference/get-v1-companies-company_id-pay_schedules"
|
|
506
516
|
},
|
|
507
517
|
{
|
|
508
|
-
"method": "
|
|
509
|
-
"path": "/v1/companies/:companyId/payrolls",
|
|
510
|
-
"docsUrl": "https://docs.gusto.com/embedded-payroll/v2026-06-15/reference/
|
|
518
|
+
"method": "GET",
|
|
519
|
+
"path": "/v1/companies/:companyId/payrolls/:payrollId",
|
|
520
|
+
"docsUrl": "https://docs.gusto.com/embedded-payroll/v2026-06-15/reference/get-v1-companies-company_id-payrolls-payroll_id"
|
|
511
521
|
},
|
|
512
522
|
{
|
|
513
|
-
"method": "
|
|
514
|
-
"path": "/v1/companies/:
|
|
515
|
-
"docsUrl": "https://docs.gusto.com/embedded-payroll/v2026-06-15/reference/
|
|
516
|
-
}
|
|
517
|
-
],
|
|
518
|
-
"variables": [
|
|
519
|
-
"companyId",
|
|
520
|
-
"companyUuid"
|
|
521
|
-
]
|
|
522
|
-
},
|
|
523
|
-
"Payroll.TransitionPayroll": {
|
|
524
|
-
"endpoints": [
|
|
523
|
+
"method": "PUT",
|
|
524
|
+
"path": "/v1/companies/:companyId/payrolls/:payrollId",
|
|
525
|
+
"docsUrl": "https://docs.gusto.com/embedded-payroll/v2026-06-15/reference/put-v1-companies-company_id-payrolls"
|
|
526
|
+
},
|
|
525
527
|
{
|
|
526
|
-
"method": "
|
|
527
|
-
"path": "/v1/companies/:companyId/payrolls",
|
|
528
|
-
"docsUrl": "https://docs.gusto.com/embedded-payroll/v2026-06-15/reference/
|
|
528
|
+
"method": "PUT",
|
|
529
|
+
"path": "/v1/companies/:companyId/payrolls/:payrollId/prepare",
|
|
530
|
+
"docsUrl": "https://docs.gusto.com/embedded-payroll/v2026-06-15/reference/put-v1-companies-company_id-payrolls-payroll_id-prepare"
|
|
529
531
|
}
|
|
530
532
|
],
|
|
531
533
|
"variables": [
|
|
532
|
-
"companyId"
|
|
534
|
+
"companyId",
|
|
535
|
+
"payrollId"
|
|
533
536
|
]
|
|
534
537
|
},
|
|
535
538
|
"TimeOff.PolicyList": {
|
|
@@ -2813,13 +2816,7 @@
|
|
|
2813
2816
|
"Payroll.PayrollLanding",
|
|
2814
2817
|
"Payroll.PayrollOverview",
|
|
2815
2818
|
"Payroll.PayrollReceipts",
|
|
2816
|
-
"Payroll.
|
|
2817
|
-
]
|
|
2818
|
-
},
|
|
2819
|
-
"Payroll.TransitionFlow": {
|
|
2820
|
-
"blocks": [
|
|
2821
|
-
"Payroll.PayrollExecutionFlow",
|
|
2822
|
-
"Payroll.TransitionPayroll"
|
|
2819
|
+
"Payroll.TransitionConfiguration"
|
|
2823
2820
|
]
|
|
2824
2821
|
},
|
|
2825
2822
|
"TimeOff.TimeOffFlow": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gusto/embedded-react-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.58.0",
|
|
4
4
|
"homepage": "https://github.com/Gusto/embedded-react-sdk",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/Gusto/embedded-react-sdk/issues"
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
"docs": "npm --prefix docs-site start",
|
|
50
50
|
"docs:build": "npm --prefix docs-site run build",
|
|
51
51
|
"docs:clear": "npm --prefix docs-site run clear",
|
|
52
|
-
"docs:install": "npm --prefix docs-site install",
|
|
53
|
-
"docs:api:generate": "npm --prefix
|
|
52
|
+
"docs:install": "npm --prefix docs-site install && npm --prefix typedoc install",
|
|
53
|
+
"docs:api:generate": "npm --prefix typedoc run typedoc",
|
|
54
54
|
"docs:lint": "npx tsx ./build/lintDocsFrontmatter.ts",
|
|
55
55
|
"docs:lint:markdown": "markdownlint-cli2",
|
|
56
56
|
"docs:lint:spell": "cspell lint --no-progress --no-must-find-files",
|
|
@@ -99,13 +99,14 @@
|
|
|
99
99
|
"@commitlint/cli": "^21.2.4",
|
|
100
100
|
"@commitlint/config-conventional": "^21.2.2",
|
|
101
101
|
"@eslint/js": "^9.39.5",
|
|
102
|
-
"@microsoft/api-extractor": "^7.
|
|
102
|
+
"@microsoft/api-extractor": "^7.60.0",
|
|
103
|
+
"@mswjs/interceptors": "^0.45.9",
|
|
103
104
|
"@playwright/test": "^1.64.1",
|
|
104
105
|
"@release-it/conventional-changelog": "^12.0.2",
|
|
105
|
-
"@storybook/addon-a11y": "^10.6.
|
|
106
|
-
"@storybook/addon-docs": "^10.6.
|
|
107
|
-
"@storybook/addon-onboarding": "^10.6.
|
|
108
|
-
"@storybook/react-vite": "^10.6.
|
|
106
|
+
"@storybook/addon-a11y": "^10.6.5",
|
|
107
|
+
"@storybook/addon-docs": "^10.6.4",
|
|
108
|
+
"@storybook/addon-onboarding": "^10.6.4",
|
|
109
|
+
"@storybook/react-vite": "^10.6.4",
|
|
109
110
|
"@storybook/test-runner": "^0.26.0",
|
|
110
111
|
"@testing-library/dom": "^10.4.2",
|
|
111
112
|
"@testing-library/jest-dom": "^7.0.1",
|
|
@@ -118,7 +119,7 @@
|
|
|
118
119
|
"@types/react": "^19.2.18",
|
|
119
120
|
"@types/react-dom": "^19.3.0",
|
|
120
121
|
"@typescript-eslint/parser": "^8.70.1",
|
|
121
|
-
"@typescript-eslint/rule-tester": "^8.72.
|
|
122
|
+
"@typescript-eslint/rule-tester": "^8.72.1",
|
|
122
123
|
"@typescript-eslint/utils": "^8.70.1",
|
|
123
124
|
"@vitejs/plugin-react-swc": "^4.3.3",
|
|
124
125
|
"@vitest/coverage-v8": "^5.0.0",
|
|
@@ -145,7 +146,7 @@
|
|
|
145
146
|
"markdownlint-cli2": "^0.24.0",
|
|
146
147
|
"msw": "^3.0.3",
|
|
147
148
|
"npm-run-all": "^4.1.5",
|
|
148
|
-
"pixelmatch": "^
|
|
149
|
+
"pixelmatch": "^8.0.0",
|
|
149
150
|
"pngjs": "^7.0.0",
|
|
150
151
|
"prettier": "^3.9.10",
|
|
151
152
|
"prism-react-renderer": "^2.4.1",
|
|
@@ -153,12 +154,12 @@
|
|
|
153
154
|
"react-dnd-html5-backend": "^16.0.1",
|
|
154
155
|
"react-router-dom": "^7.18.4",
|
|
155
156
|
"release-it": "^21.1.1",
|
|
156
|
-
"sass-embedded": "^1.
|
|
157
|
+
"sass-embedded": "^1.107.0",
|
|
157
158
|
"storybook": "^10.6.3",
|
|
158
159
|
"stylelint-config-standard": "^40.0.0",
|
|
159
160
|
"ts-morph": "^28.0.0",
|
|
160
161
|
"tsx": "^4.23.15",
|
|
161
|
-
"typescript-eslint": "^8.72.
|
|
162
|
+
"typescript-eslint": "^8.72.1",
|
|
162
163
|
"vite": "^6.4.5",
|
|
163
164
|
"vite-plugin-checker": "^0.14.5",
|
|
164
165
|
"vite-plugin-circular-dependency": "^0.6.0",
|
|
@@ -196,12 +197,12 @@
|
|
|
196
197
|
"classnames": "^2.5.1",
|
|
197
198
|
"deepmerge": "^4.3.1",
|
|
198
199
|
"dompurify": "^3.4.17",
|
|
199
|
-
"i18next": "^26.5.
|
|
200
|
+
"i18next": "^26.5.11",
|
|
200
201
|
"react-aria": "^3.47.0",
|
|
201
202
|
"react-aria-components": "1.16.0",
|
|
202
203
|
"react-error-boundary": "^6.1.6",
|
|
203
204
|
"react-hook-form": "^7.91.0",
|
|
204
|
-
"react-i18next": "^17.1.
|
|
205
|
+
"react-i18next": "^17.1.9",
|
|
205
206
|
"react-robot": "^1.2.1",
|
|
206
207
|
"robot3": "^1.4.0",
|
|
207
208
|
"zod": "^4.3.6"
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
-
import { TransitionFlow as s } from "../Transition/TransitionFlow.js";
|
|
3
|
-
import { useFlow as u } from "../../Flow/useFlow.js";
|
|
4
|
-
import { ensureRequired as t } from "../../../helpers/ensureRequired.js";
|
|
5
|
-
function f() {
|
|
6
|
-
const {
|
|
7
|
-
companyId: n,
|
|
8
|
-
transitionStartDate: o,
|
|
9
|
-
transitionEndDate: e,
|
|
10
|
-
transitionPayScheduleUuid: r,
|
|
11
|
-
withReimbursements: i,
|
|
12
|
-
onEvent: a
|
|
13
|
-
} = u();
|
|
14
|
-
return /* @__PURE__ */ m(
|
|
15
|
-
s,
|
|
16
|
-
{
|
|
17
|
-
companyId: t(n),
|
|
18
|
-
startDate: t(o),
|
|
19
|
-
endDate: t(e),
|
|
20
|
-
payScheduleUuid: t(r),
|
|
21
|
-
withReimbursements: i,
|
|
22
|
-
onEvent: a
|
|
23
|
-
}
|
|
24
|
-
);
|
|
25
|
-
}
|
|
26
|
-
export {
|
|
27
|
-
f as TransitionFlowContextual
|
|
28
|
-
};
|
|
29
|
-
//# sourceMappingURL=TransitionFlowContextual.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TransitionFlowContextual.js","sources":["../../../../src/components/Payroll/PayrollFlow/TransitionFlowContextual.tsx"],"sourcesContent":["import { TransitionFlow } from '../Transition/TransitionFlow'\nimport type { PayrollFlowContextInterface } from './PayrollFlowComponents'\nimport { useFlow } from '@/components/Flow/useFlow'\nimport { ensureRequired } from '@/helpers/ensureRequired'\n\n/**\n * Adapts the `PayrollFlow` machine context to {@link TransitionFlow}'s props. The resolve/resume\n * lookup that used to live here now lives inside `TransitionPayroll`, so this is a thin bridge.\n *\n * @internal\n */\nexport function TransitionFlowContextual() {\n const {\n companyId,\n transitionStartDate,\n transitionEndDate,\n transitionPayScheduleUuid,\n withReimbursements,\n onEvent,\n } = useFlow<PayrollFlowContextInterface>()\n\n return (\n <TransitionFlow\n companyId={ensureRequired(companyId)}\n startDate={ensureRequired(transitionStartDate)}\n endDate={ensureRequired(transitionEndDate)}\n payScheduleUuid={ensureRequired(transitionPayScheduleUuid)}\n withReimbursements={withReimbursements}\n onEvent={onEvent}\n />\n )\n}\n"],"names":["TransitionFlowContextual","companyId","transitionStartDate","transitionEndDate","transitionPayScheduleUuid","withReimbursements","onEvent","useFlow","jsx","TransitionFlow","ensureRequired"],"mappings":";;;;AAWO,SAASA,IAA2B;AACzC,QAAM;AAAA,IACJ,WAAAC;AAAA,IACA,qBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,2BAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,SAAAC;AAAA,EAAA,IACEC,EAAA;AAEJ,SACE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAeT,CAAS;AAAA,MACnC,WAAWS,EAAeR,CAAmB;AAAA,MAC7C,SAASQ,EAAeP,CAAiB;AAAA,MACzC,iBAAiBO,EAAeN,CAAyB;AAAA,MACzD,oBAAAC;AAAA,MACA,SAAAC;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import { useState as d } from "react";
|
|
3
|
-
import { createMachine as y } from "robot3";
|
|
4
|
-
import { useResolveTransitionPayroll as P } from "../TransitionPayroll/useResolveTransitionPayroll.js";
|
|
5
|
-
import { transitionBreadcrumbsNodes as B, transitionMachine as h } from "./transitionStateMachine.js";
|
|
6
|
-
import { TransitionPayrollContextual as x } from "./TransitionFlowComponents.js";
|
|
7
|
-
import { Flow as T } from "../../Flow/Flow.js";
|
|
8
|
-
import { BaseComponent as v } from "../../Base/Base.js";
|
|
9
|
-
import { useBase as w } from "../../Base/useBase.js";
|
|
10
|
-
import { buildBreadcrumbs as C, updateBreadcrumbs as F } from "../../../helpers/breadcrumbHelpers.js";
|
|
11
|
-
function A(r) {
|
|
12
|
-
return /* @__PURE__ */ n(v, { ...r, children: /* @__PURE__ */ n(M, { ...r }) });
|
|
13
|
-
}
|
|
14
|
-
function M({
|
|
15
|
-
companyId: r,
|
|
16
|
-
startDate: o,
|
|
17
|
-
endDate: i,
|
|
18
|
-
payScheduleUuid: t,
|
|
19
|
-
payrollUuid: m,
|
|
20
|
-
withReimbursements: a = !0
|
|
21
|
-
}) {
|
|
22
|
-
const { onEvent: l } = w(), s = P({
|
|
23
|
-
companyId: r,
|
|
24
|
-
startDate: o,
|
|
25
|
-
endDate: i,
|
|
26
|
-
payScheduleUuid: t
|
|
27
|
-
}), e = m ?? s, [c] = d(() => {
|
|
28
|
-
const u = e ? "configuration" : "createTransitionPayroll", f = C(B), p = F(
|
|
29
|
-
u,
|
|
30
|
-
{ header: { type: "breadcrumbs", breadcrumbs: f } },
|
|
31
|
-
{ startDate: o, endDate: i }
|
|
32
|
-
);
|
|
33
|
-
return y(
|
|
34
|
-
"transitionPayroll",
|
|
35
|
-
h,
|
|
36
|
-
(b) => ({
|
|
37
|
-
...b,
|
|
38
|
-
...p,
|
|
39
|
-
component: x,
|
|
40
|
-
companyId: r,
|
|
41
|
-
startDate: o,
|
|
42
|
-
endDate: i,
|
|
43
|
-
payScheduleUuid: t,
|
|
44
|
-
payrollUuid: e,
|
|
45
|
-
withReimbursements: a,
|
|
46
|
-
withOffcyclePayroll: !0,
|
|
47
|
-
// employeeEditTransition (shared with PayrollFlow via payrollExecutionMachine) reads
|
|
48
|
-
// ctx.payPeriod for the edit-employee breadcrumb's date range. Regular payrolls get this
|
|
49
|
-
// from PayrollExecutionFlowContextual's fetch; a transition payroll's pay period is these
|
|
50
|
-
// same gap dates, so seed it here rather than duplicating a fetch.
|
|
51
|
-
payPeriod: { startDate: o, endDate: i, payScheduleUuid: t }
|
|
52
|
-
})
|
|
53
|
-
);
|
|
54
|
-
});
|
|
55
|
-
return /* @__PURE__ */ n(T, { machine: c, onEvent: l });
|
|
56
|
-
}
|
|
57
|
-
export {
|
|
58
|
-
A as TransitionFlow
|
|
59
|
-
};
|
|
60
|
-
//# sourceMappingURL=TransitionFlow.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TransitionFlow.js","sources":["../../../../src/components/Payroll/Transition/TransitionFlow.tsx"],"sourcesContent":["import { useState } from 'react'\nimport { createMachine } from 'robot3'\nimport { useResolveTransitionPayroll } from '../TransitionPayroll/useResolveTransitionPayroll'\nimport { transitionMachine, transitionBreadcrumbsNodes } from './transitionStateMachine'\nimport {\n TransitionPayrollContextual,\n type TransitionFlowContextInterface,\n type TransitionFlowProps,\n} from './TransitionFlowComponents'\nimport { Flow } from '@/components/Flow/Flow'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { buildBreadcrumbs, updateBreadcrumbs } from '@/helpers/breadcrumbHelpers'\n\n/**\n * Macro flow that runs a transition payroll end to end: resolve or create the payroll, then\n * configure, review, submit, and view receipts.\n *\n * @remarks\n * Renders {@link TransitionPayroll} as its entry step, then routes the events its configuration\n * screen emits into the shared payroll-execution states (overview, edit-employee, receipts,\n * blockers). It owns the breadcrumb chrome and back-navigation, and re-runs the same cached resolve\n * lookup to seed its initial breadcrumb and payroll context.\n *\n * There is no terminal state (SDK-1169). Completion events bubble via `onEvent` for the parent to\n * handle (in `Payroll.PayrollFlow` the parent machine does).\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `transition/created` | Fired when the transition payroll is created and the flow advances to configuration | `{ payrollUuid: string }` |\n * | `breadcrumb/navigate` | Fired when the user navigates via the breadcrumb header | `{ key: string }` |\n *\n * All standard run-payroll events are emitted once configuration begins.\n *\n * @components\n * - {@link TransitionPayroll}\n * - {@link PayrollOverview}\n * - {@link PayrollEditEmployee}\n * - {@link PayrollReceipts}\n * - {@link PayrollBlockerList}\n *\n * @param props - See {@link TransitionFlowProps}.\n * @returns The transition payroll flow.\n * @public\n *\n * @example\n * ```tsx title=\"App.tsx\"\n * import { Payroll, type EventType } from '@gusto/embedded-react-sdk'\n *\n * function MyApp() {\n * return (\n * <Payroll.TransitionFlow\n * companyId=\"a007e1ab-3595-43c2-ab4b-af7a5af2e365\"\n * startDate=\"2025-01-16\"\n * endDate=\"2025-01-31\"\n * payScheduleUuid=\"c75c1ef6-2ec0-4cca-94a5-8b4cf7e5ea21\"\n * onEvent={(eventType: EventType) => {\n * if (eventType === 'runPayroll/submitted') {\n * // Payroll submitted — navigate to your next screen\n * }\n * }}\n * />\n * )\n * }\n * ```\n */\nexport function TransitionFlow(props: TransitionFlowProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nfunction Root({\n companyId,\n startDate,\n endDate,\n payScheduleUuid,\n payrollUuid,\n withReimbursements = true,\n}: TransitionFlowProps) {\n const { onEvent } = useBase()\n\n const resolvedPayrollUuid = useResolveTransitionPayroll({\n companyId,\n startDate,\n endDate,\n payScheduleUuid,\n })\n\n // A caller-supplied payrollUuid wins over the lookup, so a parent that already knows the payroll\n // can skip creation.\n const initialPayrollUuid = payrollUuid ?? resolvedPayrollUuid\n\n // Freeze the machine once. Creating a payroll refetches the resolve query, so recomputing this\n // would re-seat the machine mid-flow. TransitionPayroll freezes the same decision independently.\n const [machine] = useState(() => {\n const initialBreadcrumbId = initialPayrollUuid ? 'configuration' : 'createTransitionPayroll'\n const breadcrumbs = buildBreadcrumbs(transitionBreadcrumbsNodes)\n const initialBreadcrumbContext = updateBreadcrumbs(\n initialBreadcrumbId,\n { header: { type: 'breadcrumbs' as const, breadcrumbs } },\n { startDate, endDate },\n )\n\n return createMachine(\n 'transitionPayroll',\n transitionMachine,\n (initialContext: TransitionFlowContextInterface) => ({\n ...initialContext,\n ...initialBreadcrumbContext,\n component: TransitionPayrollContextual,\n companyId,\n startDate,\n endDate,\n payScheduleUuid,\n payrollUuid: initialPayrollUuid,\n withReimbursements,\n withOffcyclePayroll: true,\n // employeeEditTransition (shared with PayrollFlow via payrollExecutionMachine) reads\n // ctx.payPeriod for the edit-employee breadcrumb's date range. Regular payrolls get this\n // from PayrollExecutionFlowContextual's fetch; a transition payroll's pay period is these\n // same gap dates, so seed it here rather than duplicating a fetch.\n payPeriod: { startDate, endDate, payScheduleUuid },\n }),\n )\n })\n\n return <Flow machine={machine} onEvent={onEvent} />\n}\n"],"names":["TransitionFlow","props","jsx","BaseComponent","Root","companyId","startDate","endDate","payScheduleUuid","payrollUuid","withReimbursements","onEvent","useBase","resolvedPayrollUuid","useResolveTransitionPayroll","initialPayrollUuid","machine","useState","initialBreadcrumbId","breadcrumbs","buildBreadcrumbs","transitionBreadcrumbsNodes","initialBreadcrumbContext","updateBreadcrumbs","createMachine","transitionMachine","initialContext","TransitionPayrollContextual","Flow"],"mappings":";;;;;;;;;;AAmEO,SAASA,EAAeC,GAA4B;AACzD,SACE,gBAAAC,EAACC,KAAe,GAAGF,GACjB,4BAACG,GAAA,EAAM,GAAGH,GAAO,EAAA,CACnB;AAEJ;AAEA,SAASG,EAAK;AAAA,EACZ,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,aAAAC;AAAA,EACA,oBAAAC,IAAqB;AACvB,GAAwB;AACtB,QAAM,EAAE,SAAAC,EAAA,IAAYC,EAAA,GAEdC,IAAsBC,EAA4B;AAAA,IACtD,WAAAT;AAAA,IACA,WAAAC;AAAA,IACA,SAAAC;AAAA,IACA,iBAAAC;AAAA,EAAA,CACD,GAIKO,IAAqBN,KAAeI,GAIpC,CAACG,CAAO,IAAIC,EAAS,MAAM;AAC/B,UAAMC,IAAsBH,IAAqB,kBAAkB,2BAC7DI,IAAcC,EAAiBC,CAA0B,GACzDC,IAA2BC;AAAA,MAC/BL;AAAA,MACA,EAAE,QAAQ,EAAE,MAAM,eAAwB,aAAAC,IAAY;AAAA,MACtD,EAAE,WAAAb,GAAW,SAAAC,EAAA;AAAA,IAAQ;AAGvB,WAAOiB;AAAA,MACL;AAAA,MACAC;AAAA,MACA,CAACC,OAAoD;AAAA,QACnD,GAAGA;AAAA,QACH,GAAGJ;AAAA,QACH,WAAWK;AAAA,QACX,WAAAtB;AAAA,QACA,WAAAC;AAAA,QACA,SAAAC;AAAA,QACA,iBAAAC;AAAA,QACA,aAAaO;AAAA,QACb,oBAAAL;AAAA,QACA,qBAAqB;AAAA;AAAA;AAAA;AAAA;AAAA,QAKrB,WAAW,EAAE,WAAAJ,GAAW,SAAAC,GAAS,iBAAAC,EAAA;AAAA,MAAgB;AAAA,IACnD;AAAA,EAEJ,CAAC;AAED,SAAO,gBAAAN,EAAC0B,GAAA,EAAK,SAAAZ,GAAkB,SAAAL,EAAA,CAAkB;AACnD;"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { jsx as u } from "react/jsx-runtime";
|
|
2
|
-
import { useFlow as d } from "../../Flow/useFlow.js";
|
|
3
|
-
import { ensureRequired as t } from "../../../helpers/ensureRequired.js";
|
|
4
|
-
import { TransitionPayroll as l } from "../TransitionPayroll/TransitionPayroll.js";
|
|
5
|
-
function f() {
|
|
6
|
-
const {
|
|
7
|
-
companyId: e,
|
|
8
|
-
startDate: o,
|
|
9
|
-
endDate: r,
|
|
10
|
-
payScheduleUuid: n,
|
|
11
|
-
payrollUuid: a,
|
|
12
|
-
withReimbursements: i,
|
|
13
|
-
onEvent: m
|
|
14
|
-
} = d();
|
|
15
|
-
return /* @__PURE__ */ u(
|
|
16
|
-
l,
|
|
17
|
-
{
|
|
18
|
-
companyId: t(e),
|
|
19
|
-
startDate: t(o),
|
|
20
|
-
endDate: t(r),
|
|
21
|
-
payScheduleUuid: t(n),
|
|
22
|
-
payrollUuid: a,
|
|
23
|
-
withReimbursements: i,
|
|
24
|
-
onEvent: m
|
|
25
|
-
}
|
|
26
|
-
);
|
|
27
|
-
}
|
|
28
|
-
export {
|
|
29
|
-
f as TransitionPayrollContextual
|
|
30
|
-
};
|
|
31
|
-
//# sourceMappingURL=TransitionFlowComponents.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TransitionFlowComponents.js","sources":["../../../../src/components/Payroll/Transition/TransitionFlowComponents.tsx"],"sourcesContent":["import { TransitionPayroll } from '../TransitionPayroll'\nimport type { PayrollFlowContextInterface } from '../PayrollFlow/PayrollFlowComponents'\nimport { useFlow } from '@/components/Flow/useFlow'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport type { EventType } from '@/shared/constants'\nimport { ensureRequired } from '@/helpers/ensureRequired'\n\n/**\n * Flow context shape carried through the transition payroll macro state machine.\n *\n * @remarks\n * Extends {@link PayrollFlowContextInterface} so the payroll-execution reducers reused by the\n * transition machine (overview, edit-employee, receipts, blockers) typecheck against a single\n * shared context shape.\n *\n * @internal\n */\nexport interface TransitionFlowContextInterface extends PayrollFlowContextInterface {\n /** Start date of the transition pay period (YYYY-MM-DD). */\n startDate: string\n /** End date of the transition pay period (YYYY-MM-DD). */\n endDate: string\n /** UUID of the pay schedule the transition is associated with. */\n payScheduleUuid: string\n}\n\n/**\n * Props for {@link TransitionFlow}.\n *\n * @public\n */\nexport interface TransitionFlowProps {\n /** Company running the transition payroll. */\n companyId: string\n /** Start date of the transition pay period (YYYY-MM-DD). */\n startDate: string\n /** End date of the transition pay period (YYYY-MM-DD). */\n endDate: string\n /** UUID of the pay schedule the transition is associated with. */\n payScheduleUuid: string\n /**\n * UUID of an existing transition payroll. When provided, the flow skips the lookup and starts on\n * configuration for this payroll. When omitted, it resolves the payroll for the pay period.\n */\n payrollUuid?: string\n /** Whether reimbursement fields are shown throughout the flow. Defaults to `true`. */\n withReimbursements?: boolean\n /** Callback invoked for each event emitted by the flow and its child steps. */\n onEvent: OnEventType<EventType, unknown>\n}\n\n/**\n * Renders {@link TransitionPayroll} as the entry step of {@link TransitionFlow}, wiring its events\n * up to the flow's state machine.\n *\n * @internal\n */\nexport function TransitionPayrollContextual() {\n const {\n companyId,\n startDate,\n endDate,\n payScheduleUuid,\n payrollUuid,\n withReimbursements,\n onEvent,\n } = useFlow<TransitionFlowContextInterface>()\n return (\n <TransitionPayroll\n companyId={ensureRequired(companyId)}\n startDate={ensureRequired(startDate)}\n endDate={ensureRequired(endDate)}\n payScheduleUuid={ensureRequired(payScheduleUuid)}\n payrollUuid={payrollUuid}\n withReimbursements={withReimbursements}\n onEvent={onEvent}\n />\n )\n}\n"],"names":["TransitionPayrollContextual","companyId","startDate","endDate","payScheduleUuid","payrollUuid","withReimbursements","onEvent","useFlow","jsx","TransitionPayroll","ensureRequired"],"mappings":";;;;AAyDO,SAASA,IAA8B;AAC5C,QAAM;AAAA,IACJ,WAAAC;AAAA,IACA,WAAAC;AAAA,IACA,SAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,SAAAC;AAAA,EAAA,IACEC,EAAA;AACJ,SACE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAeV,CAAS;AAAA,MACnC,WAAWU,EAAeT,CAAS;AAAA,MACnC,SAASS,EAAeR,CAAO;AAAA,MAC/B,iBAAiBQ,EAAeP,CAAe;AAAA,MAC/C,aAAAC;AAAA,MACA,oBAAAC;AAAA,MACA,SAAAC;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { state as t, transition as n, reduce as i } from "robot3";
|
|
2
|
-
import { payrollExecutionMachine as e, getPayrollExecutionBreadcrumbsNodes as l, calculatedTransition as s, alreadyProcessedTransition as c, employeeEditTransition as d, blockersViewAllTransition as m } from "../PayrollExecutionFlow/payrollExecutionMachine.js";
|
|
3
|
-
import { TransitionPayrollContextual as u } from "./TransitionFlowComponents.js";
|
|
4
|
-
import { componentEvents as p } from "../../../shared/constants.js";
|
|
5
|
-
import { updateBreadcrumbs as y } from "../../../helpers/breadcrumbHelpers.js";
|
|
6
|
-
const r = l(), T = r.configuration, D = {
|
|
7
|
-
// Display-only creation crumb (no `onNavigate`, matching the non-navigable prefix the flow
|
|
8
|
-
// rendered before this refactor).
|
|
9
|
-
createTransitionPayroll: {
|
|
10
|
-
parent: null,
|
|
11
|
-
item: {
|
|
12
|
-
id: "createTransitionPayroll",
|
|
13
|
-
label: "breadcrumbLabel",
|
|
14
|
-
namespace: "Payroll.Transition"
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
...r,
|
|
18
|
-
configuration: {
|
|
19
|
-
...T,
|
|
20
|
-
parent: "createTransitionPayroll"
|
|
21
|
-
}
|
|
22
|
-
}, b = n(
|
|
23
|
-
p.TRANSITION_CREATED,
|
|
24
|
-
"transitionPayroll",
|
|
25
|
-
i(
|
|
26
|
-
(o, a) => ({
|
|
27
|
-
...y("configuration", o, {
|
|
28
|
-
startDate: o.startDate,
|
|
29
|
-
endDate: o.endDate
|
|
30
|
-
}),
|
|
31
|
-
component: u,
|
|
32
|
-
payrollUuid: a.payload?.payrollUuid ?? o.payrollUuid
|
|
33
|
-
})
|
|
34
|
-
)
|
|
35
|
-
), B = {
|
|
36
|
-
transitionPayroll: t(
|
|
37
|
-
b,
|
|
38
|
-
s,
|
|
39
|
-
c,
|
|
40
|
-
d,
|
|
41
|
-
m
|
|
42
|
-
),
|
|
43
|
-
...e
|
|
44
|
-
};
|
|
45
|
-
export {
|
|
46
|
-
D as transitionBreadcrumbsNodes,
|
|
47
|
-
B as transitionMachine
|
|
48
|
-
};
|
|
49
|
-
//# sourceMappingURL=transitionStateMachine.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transitionStateMachine.js","sources":["../../../../src/components/Payroll/Transition/transitionStateMachine.ts"],"sourcesContent":["import { state, transition, reduce } from 'robot3'\nimport {\n payrollExecutionMachine,\n getPayrollExecutionBreadcrumbsNodes,\n calculatedTransition,\n alreadyProcessedTransition,\n employeeEditTransition,\n blockersViewAllTransition,\n} from '../PayrollExecutionFlow/payrollExecutionMachine'\nimport {\n TransitionPayrollContextual,\n type TransitionFlowContextInterface,\n} from './TransitionFlowComponents'\nimport { componentEvents } from '@/shared/constants'\nimport type { MachineTransition } from '@/types/Helpers'\nimport type {\n BreadcrumbNode,\n BreadcrumbNodes,\n} from '@/components/Common/FlowBreadcrumbs/FlowBreadcrumbsTypes'\nimport { updateBreadcrumbs } from '@/helpers/breadcrumbHelpers'\n\nconst executionBreadcrumbsNodes = getPayrollExecutionBreadcrumbsNodes()\nconst sharedConfigurationNode = executionBreadcrumbsNodes.configuration!\n\n/**\n * Breadcrumb nodes for the transition payroll macro flow: the creation crumb merged with the\n * shared payroll-execution crumbs. `configuration` is nested under the creation crumb so the\n * \"Transition Payroll\" crumb persists in the trail once the flow advances past creation, matching\n * the display-only prefix the flow rendered before this refactor.\n *\n * @internal\n */\nexport const transitionBreadcrumbsNodes: BreadcrumbNodes = {\n // Display-only creation crumb (no `onNavigate`, matching the non-navigable prefix the flow\n // rendered before this refactor).\n createTransitionPayroll: {\n parent: null,\n item: {\n id: 'createTransitionPayroll',\n label: 'breadcrumbLabel',\n namespace: 'Payroll.Transition',\n },\n },\n ...executionBreadcrumbsNodes,\n configuration: {\n ...sharedConfigurationNode,\n parent: 'createTransitionPayroll',\n },\n} satisfies Record<string, BreadcrumbNode>\n\n// Records the created payroll's UUID and moves the breadcrumb to configuration, keeping\n// TransitionPayroll mounted so it advances its own screen from creation to configuration.\nconst transitionCreatedTransition = transition(\n componentEvents.TRANSITION_CREATED,\n 'transitionPayroll',\n reduce(\n (\n ctx: TransitionFlowContextInterface,\n ev: { payload?: { payrollUuid?: string } },\n ): TransitionFlowContextInterface => ({\n ...updateBreadcrumbs('configuration', ctx, {\n startDate: ctx.startDate,\n endDate: ctx.endDate,\n }),\n component: TransitionPayrollContextual,\n payrollUuid: ev.payload?.payrollUuid ?? ctx.payrollUuid,\n }),\n ),\n)\n\n/**\n * Macro state machine for {@link TransitionFlow}.\n *\n * @remarks\n * The entry state renders {@link TransitionPayroll}; the rest of the states are the shared\n * {@link payrollExecutionMachine} states, reused via object spread. The entry state reuses that\n * machine's onward transitions so configuration events route into overview / edit-employee /\n * blockers.\n *\n * @internal\n */\nexport const transitionMachine = {\n transitionPayroll: state<MachineTransition>(\n transitionCreatedTransition,\n calculatedTransition,\n alreadyProcessedTransition,\n employeeEditTransition,\n blockersViewAllTransition,\n ),\n ...payrollExecutionMachine,\n}\n"],"names":["executionBreadcrumbsNodes","getPayrollExecutionBreadcrumbsNodes","sharedConfigurationNode","transitionBreadcrumbsNodes","transitionCreatedTransition","transition","componentEvents","reduce","ctx","ev","updateBreadcrumbs","TransitionPayrollContextual","transitionMachine","state","calculatedTransition","alreadyProcessedTransition","employeeEditTransition","blockersViewAllTransition","payrollExecutionMachine"],"mappings":";;;;;AAqBA,MAAMA,IAA4BC,EAAA,GAC5BC,IAA0BF,EAA0B,eAU7CG,IAA8C;AAAA;AAAA;AAAA,EAGzD,yBAAyB;AAAA,IACvB,QAAQ;AAAA,IACR,MAAM;AAAA,MACJ,IAAI;AAAA,MACJ,OAAO;AAAA,MACP,WAAW;AAAA,IAAA;AAAA,EACb;AAAA,EAEF,GAAGH;AAAA,EACH,eAAe;AAAA,IACb,GAAGE;AAAA,IACH,QAAQ;AAAA,EAAA;AAEZ,GAIME,IAA8BC;AAAA,EAClCC,EAAgB;AAAA,EAChB;AAAA,EACAC;AAAA,IACE,CACEC,GACAC,OACoC;AAAA,MACpC,GAAGC,EAAkB,iBAAiBF,GAAK;AAAA,QACzC,WAAWA,EAAI;AAAA,QACf,SAASA,EAAI;AAAA,MAAA,CACd;AAAA,MACD,WAAWG;AAAA,MACX,aAAaF,EAAG,SAAS,eAAeD,EAAI;AAAA,IAAA;AAAA,EAC9C;AAEJ,GAaaI,IAAoB;AAAA,EAC/B,mBAAmBC;AAAA,IACjBT;AAAA,IACAU;AAAA,IACAC;AAAA,IACAC;AAAA,IACAC;AAAA,EAAA;AAAA,EAEF,GAAGC;AACL;"}
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { useState as P, useCallback as d, useMemo as T } from "react";
|
|
3
|
-
import { useForm as N, FormProvider as B } from "react-hook-form";
|
|
4
|
-
import { zodResolver as V } from "@hookform/resolvers/zod";
|
|
5
|
-
import { useTranslation as q } from "react-i18next";
|
|
6
|
-
import { usePayrollsCreateOffCycleMutation as U } from "@gusto/embedded-api/react-query/payrollsCreateOffCycle";
|
|
7
|
-
import { WithholdingPayPeriod as j, OffCycleReason as z } from "@gusto/embedded-api/models/operations/postv1companiescompanyidpayrolls";
|
|
8
|
-
import { RFCDate as D } from "@gusto/embedded-api/types/rfcdate";
|
|
9
|
-
import { usePaySchedulesGetAllSuspense as G } from "@gusto/embedded-api/react-query/paySchedulesGetAll";
|
|
10
|
-
import { useOffCyclePayPeriodDateValidation as H } from "../OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.js";
|
|
11
|
-
import { createTransitionCreationSchema as K } from "./TransitionCreationTypes.js";
|
|
12
|
-
import { TransitionCreationPresentation as _ } from "./TransitionCreationPresentation.js";
|
|
13
|
-
import { useCompanyPaymentSpeed as J } from "../../../hooks/useCompanyPaymentSpeed.js";
|
|
14
|
-
import { BaseComponent as L } from "../../Base/Base.js";
|
|
15
|
-
import { useBase as Q } from "../../Base/useBase.js";
|
|
16
|
-
import { useComponentDictionary as X, useI18n as h } from "../../../i18n/I18n.js";
|
|
17
|
-
import { componentEvents as Y } from "../../../shared/constants.js";
|
|
18
|
-
import { SDKInternalError as Z } from "../../../types/sdkError.js";
|
|
19
|
-
import { Form as $ } from "../../Common/Form/Form.js";
|
|
20
|
-
import { toRFCDate as oo } from "../../../helpers/dateFormatting.js";
|
|
21
|
-
function Ro(n) {
|
|
22
|
-
return /* @__PURE__ */ t(L, { ...n, children: /* @__PURE__ */ t(eo, { ...n }) });
|
|
23
|
-
}
|
|
24
|
-
function eo({
|
|
25
|
-
dictionary: n,
|
|
26
|
-
companyId: r,
|
|
27
|
-
startDate: u,
|
|
28
|
-
endDate: f,
|
|
29
|
-
payScheduleUuid: a,
|
|
30
|
-
className: S
|
|
31
|
-
}) {
|
|
32
|
-
X("Payroll.TransitionCreation", n), h("Payroll.TransitionCreation"), h("Payroll.OffCycleDeductionsSetting"), h("Payroll.OffCycleTaxWithholding");
|
|
33
|
-
const { t: l } = q("Payroll.TransitionCreation"), { onEvent: R, baseSubmitHandler: x } = Q(), { paymentSpeedDays: s } = J(r), { minCheckDate: p } = H(s), { mutateAsync: W, isPending: w } = U(), { data: y } = G({ companyId: r }), [c, k] = P({
|
|
34
|
-
withholdingPayPeriod: j.EveryOtherWeek,
|
|
35
|
-
withholdingRate: "regular"
|
|
36
|
-
}), [O, m] = P(!1), E = d(() => {
|
|
37
|
-
m(!0);
|
|
38
|
-
}, []), M = d((o) => {
|
|
39
|
-
k(o), m(!1);
|
|
40
|
-
}, []), b = d(() => {
|
|
41
|
-
m(!1);
|
|
42
|
-
}, []), v = T(() => {
|
|
43
|
-
const e = (y.payScheduleShowResponse ?? []).find((i) => i.uuid === a);
|
|
44
|
-
return e?.customName ?? e?.name ?? null;
|
|
45
|
-
}, [y, a]), F = (o, e) => (
|
|
46
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
47
|
-
l(o, e)
|
|
48
|
-
), A = T(
|
|
49
|
-
() => K(F, p, s),
|
|
50
|
-
[l, p, s]
|
|
51
|
-
), C = N({
|
|
52
|
-
resolver: V(A),
|
|
53
|
-
defaultValues: {
|
|
54
|
-
checkDate: null,
|
|
55
|
-
skipRegularDeductions: !1
|
|
56
|
-
}
|
|
57
|
-
}), I = async (o) => {
|
|
58
|
-
const { checkDate: e } = o;
|
|
59
|
-
e && await x(o, async () => {
|
|
60
|
-
const i = await W({
|
|
61
|
-
request: {
|
|
62
|
-
companyId: r,
|
|
63
|
-
requestBody: {
|
|
64
|
-
offCycle: !0,
|
|
65
|
-
offCycleReason: z.TransitionFromOldPaySchedule,
|
|
66
|
-
startDate: new D(u),
|
|
67
|
-
endDate: new D(f),
|
|
68
|
-
checkDate: oo(e),
|
|
69
|
-
payScheduleUuid: a,
|
|
70
|
-
skipRegularDeductions: o.skipRegularDeductions,
|
|
71
|
-
withholdingPayPeriod: c.withholdingPayPeriod,
|
|
72
|
-
fixedWithholdingRate: c.withholdingRate === "supplemental"
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}), g = i.payrollUnprocessed?.payrollUuid ?? i.payrollUnprocessed?.uuid;
|
|
76
|
-
if (!g)
|
|
77
|
-
throw new Z(l("errors.missingPayrollId"));
|
|
78
|
-
R(Y.TRANSITION_CREATED, { payrollUuid: g });
|
|
79
|
-
});
|
|
80
|
-
};
|
|
81
|
-
return /* @__PURE__ */ t(B, { ...C, children: /* @__PURE__ */ t($, { onSubmit: C.handleSubmit(I), children: /* @__PURE__ */ t(
|
|
82
|
-
_,
|
|
83
|
-
{
|
|
84
|
-
className: S,
|
|
85
|
-
startDate: u,
|
|
86
|
-
endDate: f,
|
|
87
|
-
payScheduleName: v,
|
|
88
|
-
isPending: w,
|
|
89
|
-
taxWithholdingConfig: c,
|
|
90
|
-
isTaxWithholdingModalOpen: O,
|
|
91
|
-
onTaxWithholdingEditClick: E,
|
|
92
|
-
onTaxWithholdingModalDone: M,
|
|
93
|
-
onTaxWithholdingModalCancel: b
|
|
94
|
-
}
|
|
95
|
-
) }) });
|
|
96
|
-
}
|
|
97
|
-
export {
|
|
98
|
-
Ro as TransitionCreation
|
|
99
|
-
};
|
|
100
|
-
//# sourceMappingURL=TransitionCreation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TransitionCreation.js","sources":["../../../../src/components/Payroll/TransitionCreation/TransitionCreation.tsx"],"sourcesContent":["import { useCallback, useMemo, useState } from 'react'\nimport { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { useTranslation } from 'react-i18next'\nimport { usePayrollsCreateOffCycleMutation } from '@gusto/embedded-api/react-query/payrollsCreateOffCycle'\nimport {\n OffCycleReason,\n WithholdingPayPeriod,\n} from '@gusto/embedded-api/models/operations/postv1companiescompanyidpayrolls'\nimport { RFCDate } from '@gusto/embedded-api/types/rfcdate'\nimport { usePaySchedulesGetAllSuspense } from '@gusto/embedded-api/react-query/paySchedulesGetAll'\nimport { useOffCyclePayPeriodDateValidation } from '../OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation'\nimport type { OffCycleTaxWithholdingConfig } from '../OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes'\nimport type { TransitionCreationProps, TransitionCreationFormData } from './TransitionCreationTypes'\nimport { createTransitionCreationSchema } from './TransitionCreationTypes'\nimport { TransitionCreationPresentation } from './TransitionCreationPresentation'\nimport { useCompanyPaymentSpeed } from '@/hooks/useCompanyPaymentSpeed'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { SDKInternalError } from '@/types/sdkError'\nimport { Form } from '@/components/Common/Form'\nimport { toRFCDate } from '@/helpers/dateFormatting'\n\n/**\n * Creation form for transition payrolls covering the gap between an old and new pay schedule.\n *\n * Displays the transition pay period and pay schedule information, and collects a check\n * date, deduction preference, and tax withholding configuration before submitting the\n * resulting off-cycle payroll for execution.\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `transition/created` | The transition payroll has been created | `{ payrollUuid: string }` |\n *\n * The check date must be at least the company's ACH lead time (typically two business\n * days) from today. Deductions default to included and tax withholding defaults to the\n * regular rate with an every-other-week pay period.\n *\n * @param props - {@link TransitionCreationProps} plus base component props.\n * @returns The transition payroll creation form.\n * @public\n */\nexport function TransitionCreation(props: TransitionCreationProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nfunction Root({\n dictionary,\n companyId,\n startDate,\n endDate,\n payScheduleUuid,\n className,\n}: TransitionCreationProps) {\n useComponentDictionary('Payroll.TransitionCreation', dictionary)\n useI18n('Payroll.TransitionCreation')\n useI18n('Payroll.OffCycleDeductionsSetting')\n useI18n('Payroll.OffCycleTaxWithholding')\n\n const { t } = useTranslation('Payroll.TransitionCreation')\n const { onEvent, baseSubmitHandler } = useBase()\n\n const { paymentSpeedDays } = useCompanyPaymentSpeed(companyId)\n\n const { minCheckDate } = useOffCyclePayPeriodDateValidation(paymentSpeedDays)\n const { mutateAsync: createTransitionPayroll, isPending } = usePayrollsCreateOffCycleMutation()\n\n const { data: paySchedulesData } = usePaySchedulesGetAllSuspense({ companyId })\n\n const [taxWithholdingConfig, setTaxWithholdingConfig] = useState<OffCycleTaxWithholdingConfig>({\n withholdingPayPeriod: WithholdingPayPeriod.EveryOtherWeek,\n withholdingRate: 'regular',\n })\n const [isTaxWithholdingModalOpen, setIsTaxWithholdingModalOpen] = useState(false)\n\n const handleTaxWithholdingEditClick = useCallback(() => {\n setIsTaxWithholdingModalOpen(true)\n }, [])\n\n const handleTaxWithholdingModalDone = useCallback((config: OffCycleTaxWithholdingConfig) => {\n setTaxWithholdingConfig(config)\n setIsTaxWithholdingModalOpen(false)\n }, [])\n\n const handleTaxWithholdingModalCancel = useCallback(() => {\n setIsTaxWithholdingModalOpen(false)\n }, [])\n\n const payScheduleName = useMemo(() => {\n const schedules = paySchedulesData.payScheduleShowResponse ?? []\n const match = schedules.find(s => s.uuid === payScheduleUuid)\n return match?.customName ?? match?.name ?? null\n }, [paySchedulesData, payScheduleUuid])\n\n const translateValidation = (key: string, options?: Record<string, unknown>): string =>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n t(key as any, options as any) as string\n\n const schema = useMemo(\n () => createTransitionCreationSchema(translateValidation, minCheckDate, paymentSpeedDays),\n [t, minCheckDate, paymentSpeedDays],\n )\n\n const methods = useForm<TransitionCreationFormData>({\n resolver: zodResolver(schema),\n defaultValues: {\n checkDate: null,\n skipRegularDeductions: false,\n },\n })\n\n const onSubmit = async (data: TransitionCreationFormData) => {\n const { checkDate } = data\n if (!checkDate) return\n\n await baseSubmitHandler(data, async () => {\n const response = await createTransitionPayroll({\n request: {\n companyId,\n requestBody: {\n offCycle: true,\n offCycleReason: OffCycleReason.TransitionFromOldPaySchedule,\n startDate: new RFCDate(startDate),\n endDate: new RFCDate(endDate),\n checkDate: toRFCDate(checkDate),\n payScheduleUuid,\n skipRegularDeductions: data.skipRegularDeductions,\n withholdingPayPeriod: taxWithholdingConfig.withholdingPayPeriod,\n fixedWithholdingRate: taxWithholdingConfig.withholdingRate === 'supplemental',\n },\n },\n })\n\n const payrollUuid =\n response.payrollUnprocessed?.payrollUuid ?? response.payrollUnprocessed?.uuid\n\n if (!payrollUuid) {\n throw new SDKInternalError(t('errors.missingPayrollId'))\n }\n\n onEvent(componentEvents.TRANSITION_CREATED, { payrollUuid })\n })\n }\n\n return (\n <FormProvider {...methods}>\n <Form onSubmit={methods.handleSubmit(onSubmit)}>\n <TransitionCreationPresentation\n className={className}\n startDate={startDate}\n endDate={endDate}\n payScheduleName={payScheduleName}\n isPending={isPending}\n taxWithholdingConfig={taxWithholdingConfig}\n isTaxWithholdingModalOpen={isTaxWithholdingModalOpen}\n onTaxWithholdingEditClick={handleTaxWithholdingEditClick}\n onTaxWithholdingModalDone={handleTaxWithholdingModalDone}\n onTaxWithholdingModalCancel={handleTaxWithholdingModalCancel}\n />\n </Form>\n </FormProvider>\n )\n}\n"],"names":["TransitionCreation","props","jsx","BaseComponent","Root","dictionary","companyId","startDate","endDate","payScheduleUuid","className","useComponentDictionary","useI18n","t","useTranslation","onEvent","baseSubmitHandler","useBase","paymentSpeedDays","useCompanyPaymentSpeed","minCheckDate","useOffCyclePayPeriodDateValidation","createTransitionPayroll","isPending","usePayrollsCreateOffCycleMutation","paySchedulesData","usePaySchedulesGetAllSuspense","taxWithholdingConfig","setTaxWithholdingConfig","useState","WithholdingPayPeriod","isTaxWithholdingModalOpen","setIsTaxWithholdingModalOpen","handleTaxWithholdingEditClick","useCallback","handleTaxWithholdingModalDone","config","handleTaxWithholdingModalCancel","payScheduleName","useMemo","match","s","translateValidation","key","options","schema","createTransitionCreationSchema","methods","useForm","zodResolver","onSubmit","data","checkDate","response","OffCycleReason","RFCDate","toRFCDate","payrollUuid","SDKInternalError","componentEvents","FormProvider","Form","TransitionCreationPresentation"],"mappings":";;;;;;;;;;;;;;;;;;;;AA6CO,SAASA,GAAmBC,GAAgC;AACjE,SACE,gBAAAC,EAACC,KAAe,GAAGF,GACjB,4BAACG,IAAA,EAAM,GAAGH,GAAO,EAAA,CACnB;AAEJ;AAEA,SAASG,GAAK;AAAA,EACZ,YAAAC;AAAA,EACA,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,WAAAC;AACF,GAA4B;AAC1B,EAAAC,EAAuB,8BAA8BN,CAAU,GAC/DO,EAAQ,4BAA4B,GACpCA,EAAQ,mCAAmC,GAC3CA,EAAQ,gCAAgC;AAExC,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,4BAA4B,GACnD,EAAE,SAAAC,GAAS,mBAAAC,EAAA,IAAsBC,EAAA,GAEjC,EAAE,kBAAAC,EAAA,IAAqBC,EAAuBb,CAAS,GAEvD,EAAE,cAAAc,EAAA,IAAiBC,EAAmCH,CAAgB,GACtE,EAAE,aAAaI,GAAyB,WAAAC,EAAA,IAAcC,EAAA,GAEtD,EAAE,MAAMC,EAAA,IAAqBC,EAA8B,EAAE,WAAApB,GAAW,GAExE,CAACqB,GAAsBC,CAAuB,IAAIC,EAAuC;AAAA,IAC7F,sBAAsBC,EAAqB;AAAA,IAC3C,iBAAiB;AAAA,EAAA,CAClB,GACK,CAACC,GAA2BC,CAA4B,IAAIH,EAAS,EAAK,GAE1EI,IAAgCC,EAAY,MAAM;AACtD,IAAAF,EAA6B,EAAI;AAAA,EACnC,GAAG,CAAA,CAAE,GAECG,IAAgCD,EAAY,CAACE,MAAyC;AAC1F,IAAAR,EAAwBQ,CAAM,GAC9BJ,EAA6B,EAAK;AAAA,EACpC,GAAG,CAAA,CAAE,GAECK,IAAkCH,EAAY,MAAM;AACxD,IAAAF,EAA6B,EAAK;AAAA,EACpC,GAAG,CAAA,CAAE,GAECM,IAAkBC,EAAQ,MAAM;AAEpC,UAAMC,KADYf,EAAiB,2BAA2B,CAAA,GACtC,KAAK,CAAAgB,MAAKA,EAAE,SAAShC,CAAe;AAC5D,WAAO+B,GAAO,cAAcA,GAAO,QAAQ;AAAA,EAC7C,GAAG,CAACf,GAAkBhB,CAAe,CAAC,GAEhCiC,IAAsB,CAACC,GAAaC;AAAA;AAAA,IAExC/B,EAAE8B,GAAYC,CAAc;AAAA,KAExBC,IAASN;AAAA,IACb,MAAMO,EAA+BJ,GAAqBtB,GAAcF,CAAgB;AAAA,IACxF,CAACL,GAAGO,GAAcF,CAAgB;AAAA,EAAA,GAG9B6B,IAAUC,EAAoC;AAAA,IAClD,UAAUC,EAAYJ,CAAM;AAAA,IAC5B,eAAe;AAAA,MACb,WAAW;AAAA,MACX,uBAAuB;AAAA,IAAA;AAAA,EACzB,CACD,GAEKK,IAAW,OAAOC,MAAqC;AAC3D,UAAM,EAAE,WAAAC,MAAcD;AACtB,IAAKC,KAEL,MAAMpC,EAAkBmC,GAAM,YAAY;AACxC,YAAME,IAAW,MAAM/B,EAAwB;AAAA,QAC7C,SAAS;AAAA,UACP,WAAAhB;AAAA,UACA,aAAa;AAAA,YACX,UAAU;AAAA,YACV,gBAAgBgD,EAAe;AAAA,YAC/B,WAAW,IAAIC,EAAQhD,CAAS;AAAA,YAChC,SAAS,IAAIgD,EAAQ/C,CAAO;AAAA,YAC5B,WAAWgD,GAAUJ,CAAS;AAAA,YAC9B,iBAAA3C;AAAA,YACA,uBAAuB0C,EAAK;AAAA,YAC5B,sBAAsBxB,EAAqB;AAAA,YAC3C,sBAAsBA,EAAqB,oBAAoB;AAAA,UAAA;AAAA,QACjE;AAAA,MACF,CACD,GAEK8B,IACJJ,EAAS,oBAAoB,eAAeA,EAAS,oBAAoB;AAE3E,UAAI,CAACI;AACH,cAAM,IAAIC,EAAiB7C,EAAE,yBAAyB,CAAC;AAGzD,MAAAE,EAAQ4C,EAAgB,oBAAoB,EAAE,aAAAF,EAAA,CAAa;AAAA,IAC7D,CAAC;AAAA,EACH;AAEA,SACE,gBAAAvD,EAAC0D,GAAA,EAAc,GAAGb,GAChB,UAAA,gBAAA7C,EAAC2D,KAAK,UAAUd,EAAQ,aAAaG,CAAQ,GAC3C,UAAA,gBAAAhD;AAAA,IAAC4D;AAAA,IAAA;AAAA,MACC,WAAApD;AAAA,MACA,WAAAH;AAAA,MACA,SAAAC;AAAA,MACA,iBAAA8B;AAAA,MACA,WAAAf;AAAA,MACA,sBAAAI;AAAA,MACA,2BAAAI;AAAA,MACA,2BAA2BE;AAAA,MAC3B,2BAA2BE;AAAA,MAC3B,6BAA6BE;AAAA,IAAA;AAAA,EAAA,GAEjC,EAAA,CACF;AAEJ;"}
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import { jsxs as n, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo as b } from "react";
|
|
3
|
-
import { useTranslation as c } from "react-i18next";
|
|
4
|
-
import { WAGE_TYPE_CATEGORIES as G } from "../OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes.js";
|
|
5
|
-
import a from "./TransitionCreationPresentation.module.scss.js";
|
|
6
|
-
import { useI18n as d } from "../../../i18n/I18n.js";
|
|
7
|
-
import { useComponentContext as j } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
8
|
-
import { Flex as t } from "../../Common/Flex/Flex.js";
|
|
9
|
-
import { useDateFormatter as F } from "../../../hooks/useDateFormatter.js";
|
|
10
|
-
import { RadioGroupField as L } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
11
|
-
import { OffCycleTaxWithholdingTable as R } from "../OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTable.js";
|
|
12
|
-
import { OffCycleTaxWithholdingModal as A } from "../OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js";
|
|
13
|
-
import { DatePickerField as N } from "../../Common/Fields/DatePickerField/DatePickerField.js";
|
|
14
|
-
function U({
|
|
15
|
-
className: D,
|
|
16
|
-
startDate: C,
|
|
17
|
-
endDate: x,
|
|
18
|
-
payScheduleName: p,
|
|
19
|
-
isPending: m,
|
|
20
|
-
taxWithholdingConfig: f,
|
|
21
|
-
isTaxWithholdingModalOpen: y,
|
|
22
|
-
onTaxWithholdingEditClick: T,
|
|
23
|
-
onTaxWithholdingModalDone: O,
|
|
24
|
-
onTaxWithholdingModalCancel: P
|
|
25
|
-
}) {
|
|
26
|
-
d("Payroll.TransitionCreation"), d("Payroll.OffCycleDeductionsSetting"), d("Payroll.OffCycleTaxWithholding");
|
|
27
|
-
const { t: i } = c("Payroll.TransitionCreation"), { t: r } = c("Payroll.OffCycleDeductionsSetting"), { t: s } = c("Payroll.OffCycleTaxWithholding"), { Heading: u, Text: l, Alert: v, Button: S } = j(), h = F(), w = h.formatShortWithYear(C), E = h.formatShortWithYear(x), W = b(
|
|
28
|
-
() => [
|
|
29
|
-
{
|
|
30
|
-
value: !1,
|
|
31
|
-
label: r("options.include.label")
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
value: !0,
|
|
35
|
-
label: r("options.skip.label")
|
|
36
|
-
}
|
|
37
|
-
],
|
|
38
|
-
[r]
|
|
39
|
-
), k = b(
|
|
40
|
-
() => G.map((o) => {
|
|
41
|
-
const g = {
|
|
42
|
-
category: o,
|
|
43
|
-
label: s(`wageTypeGroups.${o}.label`)
|
|
44
|
-
};
|
|
45
|
-
return (o === "regular" || o === "supplemental") && (g.description = s(`wageTypeGroups.${o}.description`)), g;
|
|
46
|
-
}),
|
|
47
|
-
[s]
|
|
48
|
-
);
|
|
49
|
-
return /* @__PURE__ */ n(t, { className: D, flexDirection: "column", gap: 32, children: [
|
|
50
|
-
/* @__PURE__ */ n(t, { flexDirection: "column", gap: 4, children: [
|
|
51
|
-
/* @__PURE__ */ e(u, { as: "h2", children: i("pageTitle") }),
|
|
52
|
-
/* @__PURE__ */ e(l, { variant: "supporting", children: i("pageDescription") })
|
|
53
|
-
] }),
|
|
54
|
-
/* @__PURE__ */ e(v, { status: "info", label: i("transitionExplanation") }),
|
|
55
|
-
/* @__PURE__ */ e("hr", { className: a.divider }),
|
|
56
|
-
/* @__PURE__ */ n(t, { flexDirection: "column", gap: 16, children: [
|
|
57
|
-
/* @__PURE__ */ e(u, { as: "h3", children: i("detailsHeading") }),
|
|
58
|
-
/* @__PURE__ */ n(t, { flexDirection: "column", gap: 8, children: [
|
|
59
|
-
/* @__PURE__ */ n(t, { justifyContent: "space-between", children: [
|
|
60
|
-
/* @__PURE__ */ e(l, { weight: "bold", children: i("payPeriodLabel") }),
|
|
61
|
-
/* @__PURE__ */ n(l, { children: [
|
|
62
|
-
w,
|
|
63
|
-
" - ",
|
|
64
|
-
E
|
|
65
|
-
] })
|
|
66
|
-
] }),
|
|
67
|
-
p && /* @__PURE__ */ n(t, { justifyContent: "space-between", children: [
|
|
68
|
-
/* @__PURE__ */ e(l, { weight: "bold", children: i("payScheduleLabel") }),
|
|
69
|
-
/* @__PURE__ */ e(l, { children: p })
|
|
70
|
-
] })
|
|
71
|
-
] })
|
|
72
|
-
] }),
|
|
73
|
-
/* @__PURE__ */ e("hr", { className: a.divider }),
|
|
74
|
-
/* @__PURE__ */ e(t, { flexDirection: "column", gap: 20, children: /* @__PURE__ */ e(N, { name: "checkDate", label: i("checkDateLabel"), isRequired: !0 }) }),
|
|
75
|
-
/* @__PURE__ */ e("hr", { className: a.divider }),
|
|
76
|
-
/* @__PURE__ */ e(t, { flexDirection: "column", gap: 20, children: /* @__PURE__ */ e(
|
|
77
|
-
L,
|
|
78
|
-
{
|
|
79
|
-
name: "skipRegularDeductions",
|
|
80
|
-
label: r("title"),
|
|
81
|
-
description: r("description"),
|
|
82
|
-
options: W,
|
|
83
|
-
convertValueToString: (o) => String(o)
|
|
84
|
-
}
|
|
85
|
-
) }),
|
|
86
|
-
/* @__PURE__ */ e("hr", { className: a.divider }),
|
|
87
|
-
/* @__PURE__ */ e(
|
|
88
|
-
R,
|
|
89
|
-
{
|
|
90
|
-
wageTypeGroups: k,
|
|
91
|
-
config: f,
|
|
92
|
-
onEditClick: T
|
|
93
|
-
}
|
|
94
|
-
),
|
|
95
|
-
y && /* @__PURE__ */ e(
|
|
96
|
-
A,
|
|
97
|
-
{
|
|
98
|
-
isOpen: !0,
|
|
99
|
-
defaultConfig: f,
|
|
100
|
-
onDone: O,
|
|
101
|
-
onCancel: P
|
|
102
|
-
}
|
|
103
|
-
),
|
|
104
|
-
/* @__PURE__ */ e(t, { justifyContent: "flex-end", gap: 12, children: /* @__PURE__ */ e(S, { type: "submit", isLoading: m, isDisabled: m, children: i("continueCta") }) })
|
|
105
|
-
] });
|
|
106
|
-
}
|
|
107
|
-
export {
|
|
108
|
-
U as TransitionCreationPresentation
|
|
109
|
-
};
|
|
110
|
-
//# sourceMappingURL=TransitionCreationPresentation.js.map
|