@gusto/embedded-react-sdk 0.57.2 → 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 +108 -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/DateRangeFilter/DateRangeFilter.js +32 -32
- package/dist/components/Common/DateRangeFilter/DateRangeFilter.js.map +1 -1
- package/dist/components/Common/OnboardingStatusBadge/index.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/management/AutoPilotDialog/AutoPilotDialog.js.map +1 -1
- package/dist/components/Company/PaySchedule/management/AutoPilotDialog/useAutoPilotDialog.js.map +1 -1
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentCompensationStepPresentation.js +34 -14
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentCompensationStepPresentation.js.map +1 -1
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentDepartmentStepPresentation.js +106 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentDepartmentStepPresentation.js.map +1 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentEmployeeStepPresentation.js +136 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentEmployeeStepPresentation.js.map +1 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentScheduleStepPresentation.js +38 -20
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentScheduleStepPresentation.js.map +1 -1
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentTypeStepPresentation.js +78 -44
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentTypeStepPresentation.js.map +1 -1
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/PayScheduleAssignment.js +45 -37
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/PayScheduleAssignment.js.map +1 -1
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/PayScheduleAssignmentComponents.js +244 -95
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/PayScheduleAssignmentComponents.js.map +1 -1
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/departmentAccess.js +22 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/departmentAccess.js.map +1 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/employeeJob.js +13 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/employeeJob.js.map +1 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/payScheduleAssignmentStateMachine.js +48 -43
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/payScheduleAssignmentStateMachine.js.map +1 -1
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/scheduleLabel.js.map +1 -1
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/useAssignableEmployees.js +57 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleAssignment/useAssignableEmployees.js.map +1 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleCompensationOverviewPresentation.js.map +1 -1
- package/dist/components/Company/PaySchedule/management/PayScheduleDepartmentOverviewPresentation.js +83 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleDepartmentOverviewPresentation.js.map +1 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleEmployeeOverviewPresentation.js +84 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleEmployeeOverviewPresentation.js.map +1 -0
- package/dist/components/Company/PaySchedule/management/PayScheduleManagementComponents.js.map +1 -1
- package/dist/components/Company/PaySchedule/management/PayScheduleOverview.js +109 -39
- package/dist/components/Company/PaySchedule/management/PayScheduleOverview.js.map +1 -1
- package/dist/components/Company/PaySchedule/management/PayScheduleOverviewPresentation.js.map +1 -1
- package/dist/components/Company/PaySchedule/management/payScheduleManagementStateMachine.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/Address/shared/useContractorAddressForm/useContractorAddressForm.js +5 -5
- package/dist/components/Contractor/Address/shared/useContractorAddressForm/useContractorAddressForm.js.map +1 -1
- package/dist/components/Contractor/Address/shared/useContractorAddressSummary/useContractorAddressSummary.js +1 -1
- package/dist/components/Contractor/Address/shared/useContractorAddressSummary/useContractorAddressSummary.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/useContractorCompensationSummary/useContractorCompensationSummary.js +4 -4
- package/dist/components/Contractor/Compensation/shared/useContractorCompensationSummary/useContractorCompensationSummary.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/Compensation/shared/useContractorPayForm/useContractorPayForm.js +3 -3
- package/dist/components/Contractor/Compensation/shared/useContractorPayForm/useContractorPayForm.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/Dashboard/Dashboard.js +20 -20
- package/dist/components/Contractor/Dashboard/Dashboard.js.map +1 -1
- package/dist/components/Contractor/Dismissal/useDismissal/useDismissal.js +10 -10
- package/dist/components/Contractor/Dismissal/useDismissal/useDismissal.js.map +1 -1
- package/dist/components/Contractor/Landing/Landing.js +43 -39
- package/dist/components/Contractor/Landing/Landing.js.map +1 -1
- package/dist/components/Contractor/NewHireReport/NewHireReport.js +3 -3
- package/dist/components/Contractor/NewHireReport/NewHireReport.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/Payments/CreateHistoricalPayment/CreateHistoricalPayment.js +1 -1
- package/dist/components/Contractor/Payments/CreateHistoricalPayment/CreateHistoricalPayment.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js +10 -10
- package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js.map +1 -1
- package/dist/components/Contractor/Payments/HistoricalPaymentSummary/HistoricalPaymentSummary.js +4 -4
- package/dist/components/Contractor/Payments/HistoricalPaymentSummary/HistoricalPaymentSummary.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistory.js +8 -8
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistory.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatement.js +5 -5
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatement.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummary.js +3 -3
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummary.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/onboarding/SelfOnboardingContractorProfile.js +1 -1
- package/dist/components/Contractor/Profile/onboarding/SelfOnboardingContractorProfile.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 +15 -13
- package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/useContractorDetailsForm.js.map +1 -1
- package/dist/components/Contractor/Profile/shared/useContractorProfileSummary/useContractorProfileSummary.js +1 -1
- package/dist/components/Contractor/Profile/shared/useContractorProfileSummary/useContractorProfileSummary.js.map +1 -1
- package/dist/components/Contractor/SelfOnboardingFlow/SelfOnboardingComponents.js +2 -9
- package/dist/components/Contractor/SelfOnboardingFlow/SelfOnboardingComponents.js.map +1 -1
- package/dist/components/Contractor/Submit/Submit.js +18 -18
- package/dist/components/Contractor/Submit/Submit.js.map +1 -1
- package/dist/components/Contractor/shared/SelectContractors/useSelectContractors.js +6 -6
- package/dist/components/Contractor/shared/SelectContractors/useSelectContractors.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/Compensation/shared/useCompensationForm/useCompensationForm.js +25 -25
- package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useCompensationManagement/useCompensationManagement.js +15 -15
- package/dist/components/Employee/Compensation/shared/useCompensationManagement/useCompensationManagement.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.js +1 -1
- package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.js.map +1 -1
- package/dist/components/Employee/Dashboard/Dashboard.js +25 -25
- package/dist/components/Employee/Dashboard/Dashboard.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/Documents/onboarding/DocumentSigner/DocumentSigner.js +7 -7
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentSigner.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/EmployeeDocuments/EmployeeDocuments.js +1 -1
- package/dist/components/Employee/Documents/onboarding/EmployeeDocuments/EmployeeDocuments.js.map +1 -1
- package/dist/components/Employee/HomeAddress/management/useHomeAddressManagement.js +6 -6
- package/dist/components/Employee/HomeAddress/management/useHomeAddressManagement.js.map +1 -1
- package/dist/components/Employee/Landing/Landing.js +37 -33
- package/dist/components/Employee/Landing/Landing.js.map +1 -1
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +27 -27
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.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/Employee/Profile/shared/useEmployeeDetailsForm/useEmployeeDetailsForm.js +6 -6
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/useEmployeeDetailsForm.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useEmployeeProfileSummary/useEmployeeProfileSummary.js +1 -1
- package/dist/components/Employee/Profile/shared/useEmployeeProfileSummary/useEmployeeProfileSummary.js.map +1 -1
- package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingComponents.js +8 -15
- package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingComponents.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.js +11 -11
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummary.js +12 -12
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummary.js.map +1 -1
- package/dist/components/Employee/WorkAddress/management/useWorkAddressManagement.js +26 -26
- package/dist/components/Employee/WorkAddress/management/useWorkAddressManagement.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 +97 -92
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js +1 -1
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js +18 -18
- 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/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/usePayrollEditEmployeeForm.js +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/usePayrollEditEmployeeForm.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/PayrollHistory/PayrollHistory.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +6 -6
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.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/PayrollList/PayrollListPresentation.js +9 -9
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.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/PayrollOverview/PayrollOverviewPresentation.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/helpers.js +1 -1
- package/dist/components/Payroll/helpers.js.map +1 -1
- package/dist/components/Payroll/index.js +16 -20
- package/dist/components/Payroll/index.js.map +1 -1
- package/dist/components/Payroll/payrollTypes.js +1 -1
- package/dist/components/Payroll/payrollTypes.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/ApiProvider/payrollOffCycleReasonEnumHook.js +1 -1
- package/dist/contexts/ApiProvider/payrollOffCycleReasonEnumHook.js.map +1 -1
- 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/Company.Management.PaySchedule.json.js +31 -13
- package/dist/i18n/en/Company.Management.PaySchedule.json.js.map +1 -1
- package/dist/i18n/en/Company.Management.PayScheduleAssignment.json.js +20 -12
- package/dist/i18n/en/Company.Management.PayScheduleAssignment.json.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.PayrollHistory.json.js +1 -1
- package/dist/i18n/en/Payroll.PayrollLanding.json.js +1 -1
- package/dist/i18n/en/Payroll.PayrollList.json.js +5 -5
- 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 +7 -6
- 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/DateRangeFilter/DateRangeFilter.d.ts +2 -2
- package/dist/src/components/Common/OnboardingStatusBadge/index.d.ts +1 -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/management/AutoPilotDialog/AutoPilotDialog.d.ts +1 -1
- package/dist/src/components/Company/PaySchedule/management/AutoPilotDialog/useAutoPilotDialog.d.ts +1 -1
- package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentCompensationStepPresentation.d.ts +10 -3
- package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentDepartmentStepPresentation.d.ts +21 -0
- package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentEmployeeStepPresentation.d.ts +34 -0
- package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentScheduleStepPresentation.d.ts +9 -3
- package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/AssignmentTypeStepPresentation.d.ts +5 -1
- package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/PayScheduleAssignment.d.ts +10 -10
- package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/PayScheduleAssignmentComponents.d.ts +12 -4
- package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/departmentAccess.d.ts +19 -0
- package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/employeeJob.d.ts +17 -0
- package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/scheduleLabel.d.ts +1 -1
- package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/useAssignableEmployees.d.ts +34 -0
- package/dist/src/components/Company/PaySchedule/management/PayScheduleAssignment/usePayScheduleAssignment.d.ts +16 -3
- package/dist/src/components/Company/PaySchedule/management/PayScheduleCompensationOverviewPresentation.d.ts +1 -1
- package/dist/src/components/Company/PaySchedule/management/PayScheduleDepartmentOverviewPresentation.d.ts +23 -0
- package/dist/src/components/Company/PaySchedule/management/PayScheduleEmployeeOverviewPresentation.d.ts +25 -0
- package/dist/src/components/Company/PaySchedule/management/PayScheduleManagementComponents.d.ts +1 -1
- package/dist/src/components/Company/PaySchedule/management/PayScheduleOverviewPresentation.d.ts +1 -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 +4 -15
- 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/Landing/Landing.d.ts +5 -2
- package/dist/src/components/Contractor/shared/hourlyRate.d.ts +23 -0
- package/dist/src/components/Employee/Landing/Landing.d.ts +5 -2
- package/dist/src/components/Payroll/OffCycleTaxWithholdingTable/getDefaultWithholdingPayPeriod.d.ts +9 -0
- package/dist/src/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.d.ts +1 -1
- package/dist/src/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.d.ts +1 -1
- package/dist/src/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.d.ts +1 -1
- 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/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/usePayrollEditEmployeeForm.d.ts +2 -2
- 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/PayrollHistory/PayrollHistoryPresentation.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/PayrollList/PayrollListPresentation.d.ts +2 -2
- package/dist/src/components/Payroll/PayrollOverview/PayrollOverviewPresentation.d.ts +1 -1
- 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/helpers.d.ts +2 -2
- package/dist/src/components/Payroll/index.d.ts +2 -6
- package/dist/src/components/Payroll/usePreparedPayrollData.d.ts +2 -2
- 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 +195 -70
- package/dist/src/models/external.d.ts +63 -48
- package/dist/src/partner-hook-utils/form/fields/RadioGroupHookField.d.ts +9 -7
- package/dist/src/shared/constants.d.ts +5 -3
- package/dist/src/test-utils/renderWithProviders.d.ts +2 -0
- package/dist/style.css +1 -1
- package/docs/guides/endpoint-inventory.json +57 -40
- package/package.json +23 -22
- 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
|
@@ -13,9 +13,8 @@ import "@gusto/embedded-api/models/errors/sdkvalidationerror";
|
|
|
13
13
|
import "@gusto/embedded-api/models/errors/httpclienterrors";
|
|
14
14
|
import "../../shared/constants.js";
|
|
15
15
|
import "../../contexts/ComponentAdapter/useComponentContext.js";
|
|
16
|
-
import "../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
17
16
|
import { retryAsync as T } from "../../helpers/retryAsync.js";
|
|
18
|
-
const U = 4, q = 1500, B = (e) => e instanceof w ? e.errors.some((r) => r.category === "invalid_operation") : !1,
|
|
17
|
+
const U = 4, q = 1500, B = (e) => e instanceof w ? e.errors.some((r) => r.category === "invalid_operation") : !1, W = ({
|
|
19
18
|
companyId: e,
|
|
20
19
|
payrollId: r,
|
|
21
20
|
employeeUuids: a,
|
|
@@ -75,6 +74,6 @@ const U = 4, q = 1500, B = (e) => e instanceof w ? e.errors.some((r) => r.catego
|
|
|
75
74
|
};
|
|
76
75
|
};
|
|
77
76
|
export {
|
|
78
|
-
|
|
77
|
+
W as usePreparedPayrollData
|
|
79
78
|
};
|
|
80
79
|
//# sourceMappingURL=usePreparedPayrollData.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePreparedPayrollData.js","sources":["../../../src/components/Payroll/usePreparedPayrollData.ts"],"sourcesContent":["import { useState, useEffect, useCallback, useRef, useMemo } from 'react'\nimport { usePayrollsPrepareMutation } from '@gusto/embedded-api/react-query/payrollsPrepare'\nimport { usePaySchedulesGet } from '@gusto/embedded-api/react-query/paySchedulesGet'\nimport type { PayrollPrepared } from '@gusto/embedded-api/models/components/
|
|
1
|
+
{"version":3,"file":"usePreparedPayrollData.js","sources":["../../../src/components/Payroll/usePreparedPayrollData.ts"],"sourcesContent":["import { useState, useEffect, useCallback, useRef, useMemo } from 'react'\nimport { usePayrollsPrepareMutation } from '@gusto/embedded-api/react-query/payrollsPrepare'\nimport { usePaySchedulesGet } from '@gusto/embedded-api/react-query/paySchedulesGet'\nimport type { PayrollPrepared } from '@gusto/embedded-api/models/components/unprocessedpayroll'\nimport type { PayScheduleShow } from '@gusto/embedded-api/models/components/payschedulelistitem'\nimport { UnprocessableEntityError } from '@gusto/embedded-api/models/errors/unprocessableentityerror'\nimport { useBase } from '../Base'\nimport { retryAsync } from '@/helpers/retryAsync'\n\ninterface UsePreparedPayrollDataParams {\n companyId: string\n payrollId: string\n employeeUuids?: string[]\n sortBy?: string\n onDataReady?: (preparedPayroll: PayrollPrepared) => void\n /**\n * When true, prepare is called without a roster. A transition payroll's roster is fixed by the\n * pay-schedule transition, so the API rejects any `employeeUuids` sent to prepare.\n */\n isTransitionPayroll?: boolean\n}\n\ninterface UsePreparedPayrollDataReturn {\n handlePreparePayroll: () => Promise<void>\n preparedPayroll: PayrollPrepared | undefined\n paySchedule: PayScheduleShow | undefined\n isLoading: boolean\n isPaginating: boolean\n hasInitialData: boolean\n}\n\nconst PREPARE_MAX_ATTEMPTS = 4\nconst PREPARE_RETRY_DELAY_MS = 1500\n\nconst isPayrollBeingProcessedError = (error: unknown): boolean => {\n if (!(error instanceof UnprocessableEntityError)) return false\n return error.errors.some(e => e.category === 'invalid_operation')\n}\n\n/**\n * Wraps the prepare-payroll mutation and pay-schedule fetch, retrying while the payroll is still being processed.\n *\n * @remarks\n * Fires the prepare call once on mount, then exposes `handlePreparePayroll` for callers that need to re-prepare\n * (e.g. after sort or pagination changes). Distinguishes initial loading from subsequent pagination via\n * `isLoading` and `isPaginating`, and surfaces the pay schedule for the prepared payroll's pay period.\n *\n * @param params - The company and payroll identifiers, plus optional employee filter, sort, and ready callback.\n * @returns The prepared payroll, its pay schedule, loading flags, and a `handlePreparePayroll` callback to re-run.\n * @internal\n */\nexport const usePreparedPayrollData = ({\n companyId,\n payrollId,\n employeeUuids,\n sortBy,\n onDataReady,\n isTransitionPayroll = false,\n}: UsePreparedPayrollDataParams): UsePreparedPayrollDataReturn => {\n const { mutateAsync: preparePayroll, isPending: isPreparePayrollPending } =\n usePayrollsPrepareMutation()\n const [preparedPayroll, setPreparedPayroll] = useState<PayrollPrepared | undefined>()\n const hasInitialDataRef = useRef(false)\n const hasFiredRef = useRef(false)\n const { baseSubmitHandler } = useBase()\n\n const employeeUuidsKey = useMemo(() => employeeUuids?.join(',') ?? '', [employeeUuids])\n\n const { data: payScheduleData, isLoading: isPayScheduleLoading } = usePaySchedulesGet(\n {\n companyId,\n payScheduleId: preparedPayroll?.payPeriod?.payScheduleUuid || '',\n },\n {\n enabled: !!preparedPayroll?.payPeriod?.payScheduleUuid,\n },\n )\n\n const executePrepare = useCallback(async () => {\n const result = await preparePayroll({\n request: {\n companyId,\n payrollId,\n sortBy,\n requestBody: {\n employeeUuids: isTransitionPayroll ? undefined : employeeUuids,\n },\n },\n })\n setPreparedPayroll(result.payrollPrepared)\n if (result.payrollPrepared) {\n hasInitialDataRef.current = true\n onDataReady?.(result.payrollPrepared)\n }\n }, [\n companyId,\n payrollId,\n preparePayroll,\n employeeUuidsKey,\n sortBy,\n onDataReady,\n isTransitionPayroll,\n ])\n\n const handlePreparePayroll = useCallback(async () => {\n await baseSubmitHandler(null, () =>\n retryAsync(executePrepare, {\n maxAttempts: PREPARE_MAX_ATTEMPTS,\n delayMs: PREPARE_RETRY_DELAY_MS,\n shouldRetry: isPayrollBeingProcessedError,\n }),\n )\n }, [baseSubmitHandler, executePrepare])\n\n useEffect(() => {\n if (hasFiredRef.current) return\n hasFiredRef.current = true\n void handlePreparePayroll()\n }, [handlePreparePayroll])\n\n const isInitialLoading = isPreparePayrollPending && !hasInitialDataRef.current\n const isPaginating = isPreparePayrollPending && hasInitialDataRef.current\n const isLoading = isInitialLoading || isPayScheduleLoading\n\n return {\n handlePreparePayroll,\n preparedPayroll,\n paySchedule: payScheduleData?.payScheduleShow,\n isLoading,\n isPaginating,\n hasInitialData: hasInitialDataRef.current,\n }\n}\n"],"names":["PREPARE_MAX_ATTEMPTS","PREPARE_RETRY_DELAY_MS","isPayrollBeingProcessedError","error","UnprocessableEntityError","e","usePreparedPayrollData","companyId","payrollId","employeeUuids","sortBy","onDataReady","isTransitionPayroll","preparePayroll","isPreparePayrollPending","usePayrollsPrepareMutation","preparedPayroll","setPreparedPayroll","useState","hasInitialDataRef","useRef","hasFiredRef","baseSubmitHandler","useBase","employeeUuidsKey","useMemo","payScheduleData","isPayScheduleLoading","usePaySchedulesGet","executePrepare","useCallback","result","handlePreparePayroll","retryAsync","useEffect","isInitialLoading","isPaginating","isLoading"],"mappings":";;;;;;;;;;;;;;;;AA+BA,MAAMA,IAAuB,GACvBC,IAAyB,MAEzBC,IAA+B,CAACC,MAC9BA,aAAiBC,IAChBD,EAAM,OAAO,KAAK,CAAAE,MAAKA,EAAE,aAAa,mBAAmB,IADP,IAgB9CC,IAAyB,CAAC;AAAA,EACrC,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,eAAAC;AAAA,EACA,QAAAC;AAAA,EACA,aAAAC;AAAA,EACA,qBAAAC,IAAsB;AACxB,MAAkE;AAChE,QAAM,EAAE,aAAaC,GAAgB,WAAWC,EAAA,IAC9CC,EAAA,GACI,CAACC,GAAiBC,CAAkB,IAAIC,EAAA,GACxCC,IAAoBC,EAAO,EAAK,GAChCC,IAAcD,EAAO,EAAK,GAC1B,EAAE,mBAAAE,EAAA,IAAsBC,EAAA,GAExBC,IAAmBC,EAAQ,MAAMhB,GAAe,KAAK,GAAG,KAAK,IAAI,CAACA,CAAa,CAAC,GAEhF,EAAE,MAAMiB,GAAiB,WAAWC,MAAyBC;AAAA,IACjE;AAAA,MACE,WAAArB;AAAA,MACA,eAAeS,GAAiB,WAAW,mBAAmB;AAAA,IAAA;AAAA,IAEhE;AAAA,MACE,SAAS,CAAC,CAACA,GAAiB,WAAW;AAAA,IAAA;AAAA,EACzC,GAGIa,IAAiBC,EAAY,YAAY;AAC7C,UAAMC,IAAS,MAAMlB,EAAe;AAAA,MAClC,SAAS;AAAA,QACP,WAAAN;AAAA,QACA,WAAAC;AAAA,QACA,QAAAE;AAAA,QACA,aAAa;AAAA,UACX,eAAeE,IAAsB,SAAYH;AAAA,QAAA;AAAA,MACnD;AAAA,IACF,CACD;AACD,IAAAQ,EAAmBc,EAAO,eAAe,GACrCA,EAAO,oBACTZ,EAAkB,UAAU,IAC5BR,IAAcoB,EAAO,eAAe;AAAA,EAExC,GAAG;AAAA,IACDxB;AAAA,IACAC;AAAA,IACAK;AAAA,IACAW;AAAA,IACAd;AAAA,IACAC;AAAA,IACAC;AAAA,EAAA,CACD,GAEKoB,IAAuBF,EAAY,YAAY;AACnD,UAAMR;AAAA,MAAkB;AAAA,MAAM,MAC5BW,EAAWJ,GAAgB;AAAA,QACzB,aAAa7B;AAAA,QACb,SAASC;AAAA,QACT,aAAaC;AAAA,MAAA,CACd;AAAA,IAAA;AAAA,EAEL,GAAG,CAACoB,GAAmBO,CAAc,CAAC;AAEtC,EAAAK,EAAU,MAAM;AACd,IAAIb,EAAY,YAChBA,EAAY,UAAU,IACjBW,EAAA;AAAA,EACP,GAAG,CAACA,CAAoB,CAAC;AAEzB,QAAMG,IAAmBrB,KAA2B,CAACK,EAAkB,SACjEiB,IAAetB,KAA2BK,EAAkB,SAC5DkB,IAAYF,KAAoBR;AAEtC,SAAO;AAAA,IACL,sBAAAK;AAAA,IACA,iBAAAhB;AAAA,IACA,aAAaU,GAAiB;AAAA,IAC9B,WAAAW;AAAA,IACA,cAAAD;AAAA,IACA,gBAAgBjB,EAAkB;AAAA,EAAA;AAEtC;"}
|
|
@@ -1,23 +1,20 @@
|
|
|
1
|
-
import { useMemo as
|
|
2
|
-
import { usePaySchedulesGetPayPeriodsSuspense as
|
|
1
|
+
import { useMemo as s } from "react";
|
|
2
|
+
import { usePaySchedulesGetPayPeriodsSuspense as n } from "@gusto/embedded-api/react-query/paySchedulesGetPayPeriods";
|
|
3
3
|
import { PayrollTypes as i } from "@gusto/embedded-api/models/operations/getv1companiescompanyidpayperiods";
|
|
4
|
-
import { toRFCDate as p } from "../../helpers/dateFormatting.js";
|
|
5
|
-
const
|
|
4
|
+
import { toRFCDate as d, addDays as p } from "../../helpers/dateFormatting.js";
|
|
5
|
+
const y = 90;
|
|
6
6
|
function u(r) {
|
|
7
|
-
const
|
|
8
|
-
const e = /* @__PURE__ */ new Date();
|
|
9
|
-
return e.setDate(e.getDate() + d), p(e);
|
|
10
|
-
}, []), { data: o } = a({
|
|
7
|
+
const t = s(() => d(p(/* @__PURE__ */ new Date(), y)), []), { data: e } = n({
|
|
11
8
|
companyId: r,
|
|
12
9
|
payrollTypes: i.Transition,
|
|
13
|
-
endDate:
|
|
14
|
-
}),
|
|
15
|
-
() => (
|
|
16
|
-
[
|
|
10
|
+
endDate: t
|
|
11
|
+
}), o = s(
|
|
12
|
+
() => (e.payPeriods ?? []).filter((a) => !a.payroll?.processed),
|
|
13
|
+
[e]
|
|
17
14
|
);
|
|
18
15
|
return {
|
|
19
|
-
unprocessedPayPeriods:
|
|
20
|
-
hasUnprocessedTransitions:
|
|
16
|
+
unprocessedPayPeriods: o,
|
|
17
|
+
hasUnprocessedTransitions: o.length > 0
|
|
21
18
|
};
|
|
22
19
|
}
|
|
23
20
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useUnprocessedTransitionPayPeriods.js","sources":["../../../src/components/Payroll/useUnprocessedTransitionPayPeriods.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport { usePaySchedulesGetPayPeriodsSuspense } from '@gusto/embedded-api/react-query/paySchedulesGetPayPeriods'\nimport { PayrollTypes } from '@gusto/embedded-api/models/operations/getv1companiescompanyidpayperiods'\nimport type { PayPeriod } from '@gusto/embedded-api/models/components/payperiod'\nimport { toRFCDate } from '@/helpers/dateFormatting'\n\nconst LOOK_AHEAD_DAYS = 90\n\ninterface UseUnprocessedTransitionPayPeriodsResult {\n unprocessedPayPeriods: PayPeriod[]\n hasUnprocessedTransitions: boolean\n}\n\n/**\n * Returns the company's unprocessed transition pay periods within the next 90 days.\n *\n * @param companyId - The company whose transition pay periods to fetch.\n * @returns The unprocessed transition pay periods and a flag indicating whether any exist.\n * @internal\n */\nexport function useUnprocessedTransitionPayPeriods(\n companyId: string,\n): UseUnprocessedTransitionPayPeriodsResult {\n const lookAheadEndDate = useMemo(() =>
|
|
1
|
+
{"version":3,"file":"useUnprocessedTransitionPayPeriods.js","sources":["../../../src/components/Payroll/useUnprocessedTransitionPayPeriods.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport { usePaySchedulesGetPayPeriodsSuspense } from '@gusto/embedded-api/react-query/paySchedulesGetPayPeriods'\nimport { PayrollTypes } from '@gusto/embedded-api/models/operations/getv1companiescompanyidpayperiods'\nimport type { PayPeriod } from '@gusto/embedded-api/models/components/payperiod'\nimport { addDays, toRFCDate } from '@/helpers/dateFormatting'\n\nconst LOOK_AHEAD_DAYS = 90\n\ninterface UseUnprocessedTransitionPayPeriodsResult {\n unprocessedPayPeriods: PayPeriod[]\n hasUnprocessedTransitions: boolean\n}\n\n/**\n * Returns the company's unprocessed transition pay periods within the next 90 days.\n *\n * @param companyId - The company whose transition pay periods to fetch.\n * @returns The unprocessed transition pay periods and a flag indicating whether any exist.\n * @internal\n */\nexport function useUnprocessedTransitionPayPeriods(\n companyId: string,\n): UseUnprocessedTransitionPayPeriodsResult {\n const lookAheadEndDate = useMemo(() => toRFCDate(addDays(new Date(), LOOK_AHEAD_DAYS)), [])\n\n const { data } = usePaySchedulesGetPayPeriodsSuspense({\n companyId,\n payrollTypes: PayrollTypes.Transition,\n endDate: lookAheadEndDate,\n })\n\n const unprocessedPayPeriods = useMemo<PayPeriod[]>(\n () => (data.payPeriods ?? []).filter((pp: PayPeriod) => !pp.payroll?.processed),\n [data],\n )\n\n return {\n unprocessedPayPeriods,\n hasUnprocessedTransitions: unprocessedPayPeriods.length > 0,\n }\n}\n"],"names":["LOOK_AHEAD_DAYS","useUnprocessedTransitionPayPeriods","companyId","lookAheadEndDate","useMemo","toRFCDate","addDays","data","usePaySchedulesGetPayPeriodsSuspense","PayrollTypes","unprocessedPayPeriods","pp"],"mappings":";;;;AAMA,MAAMA,IAAkB;AAcjB,SAASC,EACdC,GAC0C;AAC1C,QAAMC,IAAmBC,EAAQ,MAAMC,EAAUC,EAAQ,oBAAI,QAAQN,CAAe,CAAC,GAAG,EAAE,GAEpF,EAAE,MAAAO,EAAA,IAASC,EAAqC;AAAA,IACpD,WAAAN;AAAA,IACA,cAAcO,EAAa;AAAA,IAC3B,SAASN;AAAA,EAAA,CACV,GAEKO,IAAwBN;AAAA,IAC5B,OAAOG,EAAK,cAAc,IAAI,OAAO,CAACI,MAAkB,CAACA,EAAG,SAAS,SAAS;AAAA,IAC9E,CAACJ,CAAI;AAAA,EAAA;AAGP,SAAO;AAAA,IACL,uBAAAG;AAAA,IACA,2BAA2BA,EAAsB,SAAS;AAAA,EAAA;AAE9D;"}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
-
import { QueryClientProvider as
|
|
3
|
-
import { GustoEmbeddedProvider as
|
|
4
|
-
import { GustoEmbeddedCore as
|
|
2
|
+
import { QueryClientProvider as g } from "@tanstack/react-query";
|
|
3
|
+
import { GustoEmbeddedProvider as l } from "@gusto/embedded-api/react-query/_context";
|
|
4
|
+
import { GustoEmbeddedCore as E } from "@gusto/embedded-api/core";
|
|
5
5
|
import { SDKHooks as R } from "@gusto/embedded-api/hooks/hooks";
|
|
6
6
|
import { useMemo as u } from "react";
|
|
7
|
-
import { apiVersionHook as
|
|
7
|
+
import { apiVersionHook as S } from "./apiVersionHook.js";
|
|
8
8
|
import { apiVersionMismatchHook as a } from "./apiVersionMismatchHook.js";
|
|
9
|
-
import { informationRequestEnumHook as
|
|
10
|
-
import { payrollDeductionAmountHook as
|
|
11
|
-
import { payrollOffCycleReasonEnumHook as
|
|
12
|
-
import {
|
|
13
|
-
|
|
9
|
+
import { informationRequestEnumHook as q } from "./informationRequestEnumHook.js";
|
|
10
|
+
import { payrollDeductionAmountHook as A } from "./payrollDeductionAmountHook.js";
|
|
11
|
+
import { payrollOffCycleReasonEnumHook as C } from "./payrollOffCycleReasonEnumHook.js";
|
|
12
|
+
import { payScheduleCustomNameHook as b } from "./payScheduleCustomNameHook.js";
|
|
13
|
+
import { createSdkQueryClient as y } from "./createSdkQueryClient.js";
|
|
14
|
+
function N({
|
|
14
15
|
url: i,
|
|
15
16
|
headers: s,
|
|
16
17
|
hooks: r,
|
|
@@ -18,14 +19,14 @@ function K({
|
|
|
18
19
|
queryClient: f
|
|
19
20
|
}) {
|
|
20
21
|
const p = u(() => {
|
|
21
|
-
const t = new
|
|
22
|
+
const t = new E({
|
|
22
23
|
serverURL: i
|
|
23
24
|
}), e = t._options.hooks || new R();
|
|
24
|
-
if (e.registerBeforeRequestHook(
|
|
25
|
+
if (e.registerBeforeRequestHook(S), e.registerAfterSuccessHook(a), e.registerAfterErrorHook(a), e.registerAfterSuccessHook(q), e.registerAfterSuccessHook(A), e.registerAfterSuccessHook(C), e.registerAfterSuccessHook(b), s) {
|
|
25
26
|
const o = {
|
|
26
|
-
beforeRequest: (
|
|
27
|
-
|
|
28
|
-
}),
|
|
27
|
+
beforeRequest: (v, c) => (new Headers(s).forEach((n, d) => {
|
|
28
|
+
n && c.headers.set(d, n);
|
|
29
|
+
}), c)
|
|
29
30
|
};
|
|
30
31
|
e.registerBeforeRequestHook(o);
|
|
31
32
|
}
|
|
@@ -38,10 +39,10 @@ function K({
|
|
|
38
39
|
}), r?.afterError && r.afterError.forEach((o) => {
|
|
39
40
|
e.registerAfterErrorHook(o);
|
|
40
41
|
}), t._options.hooks || (t._options.hooks = e), t;
|
|
41
|
-
}, [i, s, r]),
|
|
42
|
-
return /* @__PURE__ */ m(
|
|
42
|
+
}, [i, s, r]), k = u(() => f ?? y(), [f]);
|
|
43
|
+
return /* @__PURE__ */ m(g, { client: k, children: /* @__PURE__ */ m(l, { client: p, children: H }) });
|
|
43
44
|
}
|
|
44
45
|
export {
|
|
45
|
-
|
|
46
|
+
N as ApiProvider
|
|
46
47
|
};
|
|
47
48
|
//# sourceMappingURL=ApiProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiProvider.js","sources":["../../../src/contexts/ApiProvider/ApiProvider.tsx"],"sourcesContent":["import { QueryClientProvider, type QueryClient } from '@tanstack/react-query'\nimport { GustoEmbeddedProvider } from '@gusto/embedded-api/react-query/_context'\nimport { GustoEmbeddedCore } from '@gusto/embedded-api/core'\nimport { SDKHooks as NativeSDKHooks } from '@gusto/embedded-api/hooks/hooks'\nimport { useMemo } from 'react'\nimport { apiVersionHook } from './apiVersionHook'\nimport { apiVersionMismatchHook } from './apiVersionMismatchHook'\nimport { informationRequestEnumHook } from './informationRequestEnumHook'\nimport { payrollDeductionAmountHook } from './payrollDeductionAmountHook'\nimport { payrollOffCycleReasonEnumHook } from './payrollOffCycleReasonEnumHook'\nimport { createSdkQueryClient } from './createSdkQueryClient'\nimport type { SDKHooks, BeforeRequestHook } from '@/types/hooks'\n\n/**\n * Props for {@link ApiProvider}.\n *\n * @internal\n */\nexport interface ApiProviderProps {\n /** Base URL the SDK uses for all `@gusto/embedded-api-v-2026-06-15` requests. */\n url: string\n /** Default headers applied to every SDK request, in addition to the `X-Gusto-API-Version` header set automatically. */\n headers?: HeadersInit\n /** Lifecycle hooks for intercepting and modifying SDK requests and responses. */\n hooks?: SDKHooks\n /** Subtree that renders inside the API + React Query providers. */\n children: React.ReactNode\n /** Optional React Query client. When omitted, a client is created with the SDK's defaults (auto-invalidation on mutation success). */\n queryClient?: QueryClient\n}\n\n/**\n * Wires the `@gusto/embedded-api-v-2026-06-15` client and a React Query client into the React tree.\n *\n * @remarks\n * Registers the SDK's `X-Gusto-API-Version` header on every request, warns via `console.warn` if a\n * response reports a different `X-Gusto-API-Version` than was requested (e.g. a proxy rewriting the\n * header), applies any default `headers`, and registers user-supplied lifecycle hooks\n * (`beforeCreateRequest`, `beforeRequest`, `afterSuccess`, `afterError`). When no `queryClient` is\n * supplied, one is created with the SDK's defaults so\n * successful mutations under the `['@gusto/embedded-api-v-2026-06-15']` key invalidate every SDK\n * query automatically. Partners who supply their own `QueryClient` are responsible for matching that\n * contract.\n *\n * Typically wrapped by {@link GustoProvider}; use directly only when composing the provider stack\n * manually.\n *\n * @param props - See {@link ApiProviderProps}.\n * @returns A React subtree wrapped in `QueryClientProvider` and the embedded API context.\n * @internal\n */\nexport function ApiProvider({\n url,\n headers,\n hooks,\n children,\n queryClient: queryClientFromProps,\n}: ApiProviderProps) {\n const gustoClient = useMemo(() => {\n const client = new GustoEmbeddedCore({\n serverURL: url,\n })\n\n const sdkHooks = client._options.hooks || new NativeSDKHooks()\n\n sdkHooks.registerBeforeRequestHook(apiVersionHook)\n sdkHooks.registerAfterSuccessHook(apiVersionMismatchHook)\n sdkHooks.registerAfterErrorHook(apiVersionMismatchHook)\n sdkHooks.registerAfterSuccessHook(informationRequestEnumHook)\n sdkHooks.registerAfterSuccessHook(payrollDeductionAmountHook)\n sdkHooks.registerAfterSuccessHook(payrollOffCycleReasonEnumHook)\n\n if (headers) {\n const defaultHeaderHook: BeforeRequestHook = {\n beforeRequest: (context, request) => {\n const headersInstance = new Headers(headers)\n headersInstance.forEach((headerValue, headerName) => {\n if (headerValue) {\n request.headers.set(headerName, headerValue)\n }\n })\n return request\n },\n }\n sdkHooks.registerBeforeRequestHook(defaultHeaderHook)\n }\n\n if (hooks?.beforeCreateRequest) {\n hooks.beforeCreateRequest.forEach(hook => {\n sdkHooks.registerBeforeCreateRequestHook(hook)\n })\n }\n\n if (hooks?.beforeRequest) {\n hooks.beforeRequest.forEach(hook => {\n sdkHooks.registerBeforeRequestHook(hook)\n })\n }\n\n if (hooks?.afterSuccess) {\n hooks.afterSuccess.forEach(hook => {\n sdkHooks.registerAfterSuccessHook(hook)\n })\n }\n\n if (hooks?.afterError) {\n hooks.afterError.forEach(hook => {\n sdkHooks.registerAfterErrorHook(hook)\n })\n }\n\n if (!client._options.hooks) {\n client._options.hooks = sdkHooks\n }\n\n return client\n }, [url, headers, hooks])\n\n const queryClient = useMemo(() => {\n return queryClientFromProps ?? createSdkQueryClient()\n }, [queryClientFromProps])\n\n return (\n <QueryClientProvider client={queryClient}>\n <GustoEmbeddedProvider client={gustoClient}>{children}</GustoEmbeddedProvider>\n </QueryClientProvider>\n )\n}\n"],"names":["ApiProvider","url","headers","hooks","children","queryClientFromProps","gustoClient","useMemo","client","GustoEmbeddedCore","sdkHooks","NativeSDKHooks","apiVersionHook","apiVersionMismatchHook","informationRequestEnumHook","payrollDeductionAmountHook","payrollOffCycleReasonEnumHook","defaultHeaderHook","context","request","headerValue","headerName","hook","queryClient","createSdkQueryClient","jsx","QueryClientProvider","GustoEmbeddedProvider"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ApiProvider.js","sources":["../../../src/contexts/ApiProvider/ApiProvider.tsx"],"sourcesContent":["import { QueryClientProvider, type QueryClient } from '@tanstack/react-query'\nimport { GustoEmbeddedProvider } from '@gusto/embedded-api/react-query/_context'\nimport { GustoEmbeddedCore } from '@gusto/embedded-api/core'\nimport { SDKHooks as NativeSDKHooks } from '@gusto/embedded-api/hooks/hooks'\nimport { useMemo } from 'react'\nimport { apiVersionHook } from './apiVersionHook'\nimport { apiVersionMismatchHook } from './apiVersionMismatchHook'\nimport { informationRequestEnumHook } from './informationRequestEnumHook'\nimport { payrollDeductionAmountHook } from './payrollDeductionAmountHook'\nimport { payrollOffCycleReasonEnumHook } from './payrollOffCycleReasonEnumHook'\nimport { payScheduleCustomNameHook } from './payScheduleCustomNameHook'\nimport { createSdkQueryClient } from './createSdkQueryClient'\nimport type { SDKHooks, BeforeRequestHook } from '@/types/hooks'\n\n/**\n * Props for {@link ApiProvider}.\n *\n * @internal\n */\nexport interface ApiProviderProps {\n /** Base URL the SDK uses for all `@gusto/embedded-api-v-2026-06-15` requests. */\n url: string\n /** Default headers applied to every SDK request, in addition to the `X-Gusto-API-Version` header set automatically. */\n headers?: HeadersInit\n /** Lifecycle hooks for intercepting and modifying SDK requests and responses. */\n hooks?: SDKHooks\n /** Subtree that renders inside the API + React Query providers. */\n children: React.ReactNode\n /** Optional React Query client. When omitted, a client is created with the SDK's defaults (auto-invalidation on mutation success). */\n queryClient?: QueryClient\n}\n\n/**\n * Wires the `@gusto/embedded-api-v-2026-06-15` client and a React Query client into the React tree.\n *\n * @remarks\n * Registers the SDK's `X-Gusto-API-Version` header on every request, warns via `console.warn` if a\n * response reports a different `X-Gusto-API-Version` than was requested (e.g. a proxy rewriting the\n * header), applies any default `headers`, and registers user-supplied lifecycle hooks\n * (`beforeCreateRequest`, `beforeRequest`, `afterSuccess`, `afterError`). When no `queryClient` is\n * supplied, one is created with the SDK's defaults so\n * successful mutations under the `['@gusto/embedded-api-v-2026-06-15']` key invalidate every SDK\n * query automatically. Partners who supply their own `QueryClient` are responsible for matching that\n * contract.\n *\n * Typically wrapped by {@link GustoProvider}; use directly only when composing the provider stack\n * manually.\n *\n * @param props - See {@link ApiProviderProps}.\n * @returns A React subtree wrapped in `QueryClientProvider` and the embedded API context.\n * @internal\n */\nexport function ApiProvider({\n url,\n headers,\n hooks,\n children,\n queryClient: queryClientFromProps,\n}: ApiProviderProps) {\n const gustoClient = useMemo(() => {\n const client = new GustoEmbeddedCore({\n serverURL: url,\n })\n\n const sdkHooks = client._options.hooks || new NativeSDKHooks()\n\n sdkHooks.registerBeforeRequestHook(apiVersionHook)\n sdkHooks.registerAfterSuccessHook(apiVersionMismatchHook)\n sdkHooks.registerAfterErrorHook(apiVersionMismatchHook)\n sdkHooks.registerAfterSuccessHook(informationRequestEnumHook)\n sdkHooks.registerAfterSuccessHook(payrollDeductionAmountHook)\n sdkHooks.registerAfterSuccessHook(payrollOffCycleReasonEnumHook)\n sdkHooks.registerAfterSuccessHook(payScheduleCustomNameHook)\n\n if (headers) {\n const defaultHeaderHook: BeforeRequestHook = {\n beforeRequest: (context, request) => {\n const headersInstance = new Headers(headers)\n headersInstance.forEach((headerValue, headerName) => {\n if (headerValue) {\n request.headers.set(headerName, headerValue)\n }\n })\n return request\n },\n }\n sdkHooks.registerBeforeRequestHook(defaultHeaderHook)\n }\n\n if (hooks?.beforeCreateRequest) {\n hooks.beforeCreateRequest.forEach(hook => {\n sdkHooks.registerBeforeCreateRequestHook(hook)\n })\n }\n\n if (hooks?.beforeRequest) {\n hooks.beforeRequest.forEach(hook => {\n sdkHooks.registerBeforeRequestHook(hook)\n })\n }\n\n if (hooks?.afterSuccess) {\n hooks.afterSuccess.forEach(hook => {\n sdkHooks.registerAfterSuccessHook(hook)\n })\n }\n\n if (hooks?.afterError) {\n hooks.afterError.forEach(hook => {\n sdkHooks.registerAfterErrorHook(hook)\n })\n }\n\n if (!client._options.hooks) {\n client._options.hooks = sdkHooks\n }\n\n return client\n }, [url, headers, hooks])\n\n const queryClient = useMemo(() => {\n return queryClientFromProps ?? createSdkQueryClient()\n }, [queryClientFromProps])\n\n return (\n <QueryClientProvider client={queryClient}>\n <GustoEmbeddedProvider client={gustoClient}>{children}</GustoEmbeddedProvider>\n </QueryClientProvider>\n )\n}\n"],"names":["ApiProvider","url","headers","hooks","children","queryClientFromProps","gustoClient","useMemo","client","GustoEmbeddedCore","sdkHooks","NativeSDKHooks","apiVersionHook","apiVersionMismatchHook","informationRequestEnumHook","payrollDeductionAmountHook","payrollOffCycleReasonEnumHook","payScheduleCustomNameHook","defaultHeaderHook","context","request","headerValue","headerName","hook","queryClient","createSdkQueryClient","jsx","QueryClientProvider","GustoEmbeddedProvider"],"mappings":";;;;;;;;;;;;;AAoDO,SAASA,EAAY;AAAA,EAC1B,KAAAC;AAAA,EACA,SAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,aAAaC;AACf,GAAqB;AACnB,QAAMC,IAAcC,EAAQ,MAAM;AAChC,UAAMC,IAAS,IAAIC,EAAkB;AAAA,MACnC,WAAWR;AAAA,IAAA,CACZ,GAEKS,IAAWF,EAAO,SAAS,SAAS,IAAIG,EAAA;AAU9C,QARAD,EAAS,0BAA0BE,CAAc,GACjDF,EAAS,yBAAyBG,CAAsB,GACxDH,EAAS,uBAAuBG,CAAsB,GACtDH,EAAS,yBAAyBI,CAA0B,GAC5DJ,EAAS,yBAAyBK,CAA0B,GAC5DL,EAAS,yBAAyBM,CAA6B,GAC/DN,EAAS,yBAAyBO,CAAyB,GAEvDf,GAAS;AACX,YAAMgB,IAAuC;AAAA,QAC3C,eAAe,CAACC,GAASC,OACC,IAAI,QAAQlB,CAAO,EAC3B,QAAQ,CAACmB,GAAaC,MAAe;AACnD,UAAID,KACFD,EAAQ,QAAQ,IAAIE,GAAYD,CAAW;AAAA,QAE/C,CAAC,GACMD;AAAA,MACT;AAEF,MAAAV,EAAS,0BAA0BQ,CAAiB;AAAA,IACtD;AAEA,WAAIf,GAAO,uBACTA,EAAM,oBAAoB,QAAQ,CAAAoB,MAAQ;AACxC,MAAAb,EAAS,gCAAgCa,CAAI;AAAA,IAC/C,CAAC,GAGCpB,GAAO,iBACTA,EAAM,cAAc,QAAQ,CAAAoB,MAAQ;AAClC,MAAAb,EAAS,0BAA0Ba,CAAI;AAAA,IACzC,CAAC,GAGCpB,GAAO,gBACTA,EAAM,aAAa,QAAQ,CAAAoB,MAAQ;AACjC,MAAAb,EAAS,yBAAyBa,CAAI;AAAA,IACxC,CAAC,GAGCpB,GAAO,cACTA,EAAM,WAAW,QAAQ,CAAAoB,MAAQ;AAC/B,MAAAb,EAAS,uBAAuBa,CAAI;AAAA,IACtC,CAAC,GAGEf,EAAO,SAAS,UACnBA,EAAO,SAAS,QAAQE,IAGnBF;AAAA,EACT,GAAG,CAACP,GAAKC,GAASC,CAAK,CAAC,GAElBqB,IAAcjB,EAAQ,MACnBF,KAAwBoB,EAAA,GAC9B,CAACpB,CAAoB,CAAC;AAEzB,SACE,gBAAAqB,EAACC,KAAoB,QAAQH,GAC3B,4BAACI,GAAA,EAAsB,QAAQtB,GAAc,UAAAF,EAAA,CAAS,EAAA,CACxD;AAEJ;"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
const u = "get-v1-companies-company_id-pay_schedules", i = /* @__PURE__ */ new Set([
|
|
2
|
+
"get-v1-companies-company_id-pay_schedules-pay_schedule_id",
|
|
3
|
+
"post-v1-companies-company_id-pay_schedules",
|
|
4
|
+
"put-v1-companies-company_id-pay_schedules-pay_schedule_id"
|
|
5
|
+
]), p = (e) => e !== null && typeof e == "object" && !Array.isArray(e), a = (e) => p(e) && e.custom_name === null, r = (e) => {
|
|
6
|
+
const { custom_name: t, ...s } = e;
|
|
7
|
+
return s;
|
|
8
|
+
}, _ = (e, t) => t === u ? !Array.isArray(e) || !e.some(a) ? void 0 : e.map((s) => a(s) ? r(s) : s) : a(e) ? r(e) : void 0, d = {
|
|
9
|
+
afterSuccess: async (e, t) => {
|
|
10
|
+
if (!(e.operationID === u || i.has(e.operationID)))
|
|
11
|
+
return t;
|
|
12
|
+
let n;
|
|
13
|
+
try {
|
|
14
|
+
n = await t.clone().json();
|
|
15
|
+
} catch {
|
|
16
|
+
return t;
|
|
17
|
+
}
|
|
18
|
+
const c = _(n, e.operationID);
|
|
19
|
+
if (c === void 0) return t;
|
|
20
|
+
const o = new Headers(t.headers);
|
|
21
|
+
return o.delete("content-length"), new Response(JSON.stringify(c), {
|
|
22
|
+
status: t.status,
|
|
23
|
+
statusText: t.statusText,
|
|
24
|
+
headers: o
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
export {
|
|
29
|
+
d as payScheduleCustomNameHook
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=payScheduleCustomNameHook.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payScheduleCustomNameHook.js","sources":["../../../src/contexts/ApiProvider/payScheduleCustomNameHook.ts"],"sourcesContent":["import type { AfterSuccessHook } from '@/types/hooks'\n\nconst PAY_SCHEDULE_LIST_OPERATION_ID = 'get-v1-companies-company_id-pay_schedules'\nconst PAY_SCHEDULE_OBJECT_OPERATION_IDS: ReadonlySet<string> = new Set([\n 'get-v1-companies-company_id-pay_schedules-pay_schedule_id',\n 'post-v1-companies-company_id-pay_schedules',\n 'put-v1-companies-company_id-pay_schedules-pay_schedule_id',\n])\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n value !== null && typeof value === 'object' && !Array.isArray(value)\n\nconst hasNullCustomName = (value: unknown): value is Record<string, unknown> =>\n isRecord(value) && value.custom_name === null\n\nconst stripNullCustomName = (paySchedule: Record<string, unknown>): Record<string, unknown> => {\n const { custom_name: _customName, ...rest } = paySchedule\n return rest\n}\n\nconst remapBody = (body: unknown, operationID: string): unknown => {\n if (operationID === PAY_SCHEDULE_LIST_OPERATION_ID) {\n if (!Array.isArray(body) || !body.some(hasNullCustomName)) return undefined\n return body.map(item => (hasNullCustomName(item) ? stripNullCustomName(item) : item))\n }\n\n return hasNullCustomName(body) ? stripNullCustomName(body) : undefined\n}\n\n/**\n * Temporary workaround for a pay-schedule response compatibility gap: `custom_name` is generated as\n * a non-nullable optional string (`z.string().optional()`) in `@gusto/embedded-api`, so a response\n * with `custom_name: null` throws an `SDKValidationError` -- rejecting the whole pay schedule list\n * response, not just the one affected item. This afterSuccess hook deletes an explicit\n * `custom_name: null` before the SDK's zod parse, collapsing it to the same \"omitted\" shape the\n * schema already accepts and that pay schedule display and form initialization already default to\n * an empty string for. Omission, valid strings, and unrelated fields are left untouched. Remove once\n * the generated client accepts `custom_name: null` directly.\n *\n * @internal\n */\nexport const payScheduleCustomNameHook: AfterSuccessHook = {\n afterSuccess: async (context, response) => {\n const isPayScheduleOperation =\n context.operationID === PAY_SCHEDULE_LIST_OPERATION_ID ||\n PAY_SCHEDULE_OBJECT_OPERATION_IDS.has(context.operationID)\n if (!isPayScheduleOperation) {\n return response\n }\n\n let body: unknown\n try {\n body = await response.clone().json()\n } catch {\n return response\n }\n\n const remapped = remapBody(body, context.operationID)\n if (remapped === undefined) return response\n\n const headers = new Headers(response.headers)\n headers.delete('content-length')\n return new Response(JSON.stringify(remapped), {\n status: response.status,\n statusText: response.statusText,\n headers,\n })\n },\n}\n"],"names":["PAY_SCHEDULE_LIST_OPERATION_ID","PAY_SCHEDULE_OBJECT_OPERATION_IDS","isRecord","value","hasNullCustomName","stripNullCustomName","paySchedule","_customName","rest","remapBody","body","operationID","item","payScheduleCustomNameHook","context","response","remapped","headers"],"mappings":"AAEA,MAAMA,IAAiC,6CACjCC,wBAA6D,IAAI;AAAA,EACrE;AAAA,EACA;AAAA,EACA;AACF,CAAC,GAEKC,IAAW,CAACC,MAChBA,MAAU,QAAQ,OAAOA,KAAU,YAAY,CAAC,MAAM,QAAQA,CAAK,GAE/DC,IAAoB,CAACD,MACzBD,EAASC,CAAK,KAAKA,EAAM,gBAAgB,MAErCE,IAAsB,CAACC,MAAkE;AAC7F,QAAM,EAAE,aAAaC,GAAa,GAAGC,MAASF;AAC9C,SAAOE;AACT,GAEMC,IAAY,CAACC,GAAeC,MAC5BA,MAAgBX,IACd,CAAC,MAAM,QAAQU,CAAI,KAAK,CAACA,EAAK,KAAKN,CAAiB,IAAG,SACpDM,EAAK,IAAI,CAAAE,MAASR,EAAkBQ,CAAI,IAAIP,EAAoBO,CAAI,IAAIA,CAAK,IAG/ER,EAAkBM,CAAI,IAAIL,EAAoBK,CAAI,IAAI,QAelDG,IAA8C;AAAA,EACzD,cAAc,OAAOC,GAASC,MAAa;AAIzC,QAAI,EAFFD,EAAQ,gBAAgBd,KACxBC,EAAkC,IAAIa,EAAQ,WAAW;AAEzD,aAAOC;AAGT,QAAIL;AACJ,QAAI;AACF,MAAAA,IAAO,MAAMK,EAAS,MAAA,EAAQ,KAAA;AAAA,IAChC,QAAQ;AACN,aAAOA;AAAA,IACT;AAEA,UAAMC,IAAWP,EAAUC,GAAMI,EAAQ,WAAW;AACpD,QAAIE,MAAa,OAAW,QAAOD;AAEnC,UAAME,IAAU,IAAI,QAAQF,EAAS,OAAO;AAC5C,WAAAE,EAAQ,OAAO,gBAAgB,GACxB,IAAI,SAAS,KAAK,UAAUD,CAAQ,GAAG;AAAA,MAC5C,QAAQD,EAAS;AAAA,MACjB,YAAYA,EAAS;AAAA,MACrB,SAAAE;AAAA,IAAA,CACD;AAAA,EACH;AACF;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OffCycleReasonType as i } from "@gusto/embedded-api/models/components/
|
|
1
|
+
import { OffCycleReasonType as i } from "@gusto/embedded-api/models/components/unprocessedpayroll";
|
|
2
2
|
const c = "get-v1-companies-company_id-payrolls", p = /* @__PURE__ */ new Set([
|
|
3
3
|
"get-v1-companies-company_id-payrolls-payroll_id",
|
|
4
4
|
"post-v1-companies-company_id-payrolls",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payrollOffCycleReasonEnumHook.js","sources":["../../../src/contexts/ApiProvider/payrollOffCycleReasonEnumHook.ts"],"sourcesContent":["import { OffCycleReasonType } from '@gusto/embedded-api/models/components/
|
|
1
|
+
{"version":3,"file":"payrollOffCycleReasonEnumHook.js","sources":["../../../src/contexts/ApiProvider/payrollOffCycleReasonEnumHook.ts"],"sourcesContent":["import { OffCycleReasonType } from '@gusto/embedded-api/models/components/unprocessedpayroll'\nimport type { AfterSuccessHook } from '@/types/hooks'\n\nconst PAYROLL_LIST_OPERATION_ID = 'get-v1-companies-company_id-payrolls'\n\nconst SINGLE_PAYROLL_OPERATIONS: ReadonlySet<string> = new Set([\n 'get-v1-companies-company_id-payrolls-payroll_id',\n 'post-v1-companies-company_id-payrolls',\n 'put-v1-companies-company_id-payrolls',\n 'put-v1-companies-company_id-payrolls-payroll_id-prepare',\n 'put-api-v1-companies-company_id-payrolls-payroll_id-cancel',\n])\n\nconst KNOWN_OFF_CYCLE_REASONS: ReadonlySet<string> = new Set(Object.values(OffCycleReasonType))\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n value !== null && typeof value === 'object' && !Array.isArray(value)\n\nconst hasUnknownOffCycleReason = (payroll: unknown): payroll is Record<string, unknown> =>\n isRecord(payroll) &&\n typeof payroll.off_cycle_reason === 'string' &&\n !KNOWN_OFF_CYCLE_REASONS.has(payroll.off_cycle_reason)\n\n// `off_cycle_reason` is nullable in the schema, so an unrecognized reason collapses to `null`\n// (rendered as a generic off-cycle payroll) rather than being relabeled as some other reason.\nconst clearOffCycleReason = (payroll: Record<string, unknown>): Record<string, unknown> => ({\n ...payroll,\n off_cycle_reason: null,\n})\n\nconst remapBody = (body: unknown, operationID: string): unknown => {\n if (operationID === PAYROLL_LIST_OPERATION_ID) {\n if (!Array.isArray(body) || !body.some(hasUnknownOffCycleReason)) return undefined\n return body.map(payroll =>\n hasUnknownOffCycleReason(payroll) ? clearOffCycleReason(payroll) : payroll,\n )\n }\n\n return hasUnknownOffCycleReason(body) ? clearOffCycleReason(body) : undefined\n}\n\n/**\n * Temporary workaround for a Gusto-Partner-API spec gap: `off_cycle_reason` on payroll responses\n * is generated as a closed enum (`z.nativeEnum(OffCycleReasonType)`) in `@gusto/embedded-api`, but\n * the API also emits reasons the published OAS doesn't list (e.g. `Max out 401k`, `Other`). A\n * single such payroll makes the whole `GetV1CompaniesCompanyIdPayrolls` response throw an\n * `SDKValidationError`, taking down Payroll History and every other payroll list for the company.\n * This afterSuccess hook nulls out any reason outside the closed enum before the SDK's zod parse,\n * so the response still validates and the payroll renders as a generic off-cycle payroll. Remove\n * once the client supports lax/open enum parsing for this field.\n *\n * @internal\n */\nexport const payrollOffCycleReasonEnumHook: AfterSuccessHook = {\n afterSuccess: async (context, response) => {\n if (\n context.operationID !== PAYROLL_LIST_OPERATION_ID &&\n !SINGLE_PAYROLL_OPERATIONS.has(context.operationID)\n ) {\n return response\n }\n\n let body: unknown\n try {\n body = await response.clone().json()\n } catch {\n return response\n }\n\n const remapped = remapBody(body, context.operationID)\n if (remapped === undefined) return response\n\n const headers = new Headers(response.headers)\n headers.delete('content-length')\n return new Response(JSON.stringify(remapped), {\n status: response.status,\n statusText: response.statusText,\n headers,\n })\n },\n}\n"],"names":["PAYROLL_LIST_OPERATION_ID","SINGLE_PAYROLL_OPERATIONS","KNOWN_OFF_CYCLE_REASONS","OffCycleReasonType","isRecord","value","hasUnknownOffCycleReason","payroll","clearOffCycleReason","remapBody","body","operationID","payrollOffCycleReasonEnumHook","context","response","remapped","headers"],"mappings":";AAGA,MAAMA,IAA4B,wCAE5BC,wBAAqD,IAAI;AAAA,EAC7D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC,GAEKC,IAA+C,IAAI,IAAI,OAAO,OAAOC,CAAkB,CAAC,GAExFC,IAAW,CAACC,MAChBA,MAAU,QAAQ,OAAOA,KAAU,YAAY,CAAC,MAAM,QAAQA,CAAK,GAE/DC,IAA2B,CAACC,MAChCH,EAASG,CAAO,KAChB,OAAOA,EAAQ,oBAAqB,YACpC,CAACL,EAAwB,IAAIK,EAAQ,gBAAgB,GAIjDC,IAAsB,CAACD,OAA+D;AAAA,EAC1F,GAAGA;AAAA,EACH,kBAAkB;AACpB,IAEME,IAAY,CAACC,GAAeC,MAC5BA,MAAgBX,IACd,CAAC,MAAM,QAAQU,CAAI,KAAK,CAACA,EAAK,KAAKJ,CAAwB,IAAG,SAC3DI,EAAK;AAAA,EAAI,OACdJ,EAAyBC,CAAO,IAAIC,EAAoBD,CAAO,IAAIA;AAAA,IAIhED,EAAyBI,CAAI,IAAIF,EAAoBE,CAAI,IAAI,QAezDE,IAAkD;AAAA,EAC7D,cAAc,OAAOC,GAASC,MAAa;AACzC,QACED,EAAQ,gBAAgBb,KACxB,CAACC,EAA0B,IAAIY,EAAQ,WAAW;AAElD,aAAOC;AAGT,QAAIJ;AACJ,QAAI;AACF,MAAAA,IAAO,MAAMI,EAAS,MAAA,EAAQ,KAAA;AAAA,IAChC,QAAQ;AACN,aAAOA;AAAA,IACT;AAEA,UAAMC,IAAWN,EAAUC,GAAMG,EAAQ,WAAW;AACpD,QAAIE,MAAa,OAAW,QAAOD;AAEnC,UAAME,IAAU,IAAI,QAAQF,EAAS,OAAO;AAC5C,WAAAE,EAAQ,OAAO,gBAAgB,GACxB,IAAI,SAAS,KAAK,UAAUD,CAAQ,GAAG;AAAA,MAC5C,QAAQD,EAAS;AAAA,MACjB,YAAYA,EAAS;AAAA,MACrB,SAAAE;AAAA,IAAA,CACD;AAAA,EACH;AACF;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as n } from "react";
|
|
3
|
+
import { FeaturesContext as i } from "./useFeature.js";
|
|
4
|
+
function l({ children: o, value: u }) {
|
|
5
|
+
const e = u ?? {}, r = JSON.stringify(e, Object.keys(e).sort()), t = n({
|
|
6
|
+
key: r,
|
|
7
|
+
value: e
|
|
8
|
+
});
|
|
9
|
+
return t.current.key !== r && (t.current = { key: r, value: e }), /* @__PURE__ */ s(i.Provider, { value: t.current.value, children: o });
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
l as FeaturesProvider
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=FeaturesProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FeaturesProvider.js","sources":["../../../src/contexts/FeaturesProvider/FeaturesProvider.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { useRef } from 'react'\nimport { FeaturesContext, type Features } from './useFeature'\n\n/** @internal */\nexport interface FeaturesProviderProps {\n children: ReactNode\n value?: Features\n}\n\n/**\n * Provides the {@link Features} flags to SDK components via {@link FeaturesContext}.\n *\n * @remarks\n * Composed by `GustoProvider` so the `features` prop flows down to any SDK Flow or Block that\n * checks {@link useFeature}. The context value is keyed on its sorted, serialized content rather\n * than the `value` object's identity — the returned reference only changes when a flag's value\n * actually changes, and adding a new flag to {@link Features} needs no update here.\n *\n * @param props - See {@link FeaturesProviderProps}.\n * @returns A React subtree with the features context applied.\n * @internal\n */\nexport function FeaturesProvider({ children, value }: FeaturesProviderProps) {\n const resolvedValue = value ?? {}\n const key = JSON.stringify(resolvedValue, Object.keys(resolvedValue).sort())\n\n const stableRef = useRef<{ key: string; value: Features }>({\n key,\n value: resolvedValue,\n })\n if (stableRef.current.key !== key) {\n stableRef.current = { key, value: resolvedValue }\n }\n\n return (\n <FeaturesContext.Provider value={stableRef.current.value}>{children}</FeaturesContext.Provider>\n )\n}\n"],"names":["FeaturesProvider","children","value","resolvedValue","key","stableRef","useRef","jsx","FeaturesContext"],"mappings":";;;AAuBO,SAASA,EAAiB,EAAE,UAAAC,GAAU,OAAAC,KAAgC;AAC3E,QAAMC,IAAgBD,KAAS,CAAA,GACzBE,IAAM,KAAK,UAAUD,GAAe,OAAO,KAAKA,CAAa,EAAE,MAAM,GAErEE,IAAYC,EAAyC;AAAA,IACzD,KAAAF;AAAA,IACA,OAAOD;AAAA,EAAA,CACR;AACD,SAAIE,EAAU,QAAQ,QAAQD,MAC5BC,EAAU,UAAU,EAAE,KAAAD,GAAK,OAAOD,EAAA,IAIlC,gBAAAI,EAACC,EAAgB,UAAhB,EAAyB,OAAOH,EAAU,QAAQ,OAAQ,UAAAJ,GAAS;AAExE;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFeature.js","sources":["../../../src/contexts/FeaturesProvider/useFeature.ts"],"sourcesContent":["import { createContext, useContext } from 'react'\n\n/**\n * Flags for turning released SDK functionality on or off.\n *\n * @remarks\n * Pass to {@link GustoProvider} via the `features` prop. Each flag documents its default and what\n * changes when you set it. Omitted flags use their default.\n *\n * @public\n * @page providers\n */\nexport interface Features {\n /**\n * Regular rate of pay (RRoP) support: per-workweek overtime in payroll editing, and the pay\n * schedule workweek start day it depends on.\n *\n * When `true`, `Payroll.PayrollEditEmployee` renders the RRoP editor, where adding overtime for an\n * overtime-eligible employee on a multi-workweek payroll splits hours and overtime-affecting\n * earnings into one column per workweek. `Payroll.PayrollConfiguration` shows each employee's\n * total pay as the gross pay returned by the API. `usePayScheduleForm` exposes\n * `Fields.WorkweekStartDay` and submits `workweekStartDay`, so the pay schedule forms in\n * `CompanyOnboarding.PaySchedule` and `CompanyManagement.PaySchedule` show the field.\n *\n * When `false`, `Payroll.PayrollEditEmployee` renders the previous editor, which edits total hours\n * for the whole pay period and sends no per-workweek breakdowns. `Payroll.PayrollConfiguration`\n * estimates total pay from hours and pay rates. `Fields.WorkweekStartDay` is `undefined` and\n * `workweekStartDay` is not submitted.\n *\n * Every flow that renders these screens follows the flag, including `Payroll.PayrollFlow`,\n * `Payroll.PayrollExecutionFlow`, `Payroll.OffCycleFlow`, `Payroll.DismissalFlow`, and\n * `CompanyOnboarding.OnboardingFlow`.\n *\n * @defaultValue `true`\n */\n regularRateOfPay?: boolean\n}\n\n/**\n * React context backing {@link useFeature}.\n *\n * @internal\n */\nexport const FeaturesContext = createContext<Features>({})\n\n/**\n * Reads whether `feature` is enabled via {@link GustoProvider}'s `features` prop.\n *\n * @remarks\n * Only an explicit `false` disables a flag, so omitting it — or rendering outside a\n * `GustoProvider` — leaves the functionality on.\n *\n * @param feature - The {@link Features} flag to read.\n * @returns `false` when `feature` is explicitly set to `false`, otherwise `true`.\n * @internal\n */\nexport const useFeature = (feature: keyof Features): boolean => {\n const features = useContext(FeaturesContext)\n return features[feature] !== false\n}\n"],"names":["FeaturesContext","createContext","useFeature","feature","useContext"],"mappings":";AA2CO,MAAMA,IAAkBC,EAAwB,CAAA,CAAE,GAa5CC,IAAa,CAACC,MACRC,EAAWJ,CAAe,EAC3BG,CAAO,MAAM;"}
|
|
@@ -1,35 +1,37 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { ErrorBoundary as
|
|
3
|
-
import { I18nextProvider as
|
|
4
|
-
import { useEffect as
|
|
5
|
-
import { ComponentsProvider as
|
|
6
|
-
import { ApiProvider as
|
|
7
|
-
import { LoadingIndicatorProvider as
|
|
8
|
-
import { sanitizeError as
|
|
9
|
-
import { UnstableFeaturesProvider as
|
|
2
|
+
import { ErrorBoundary as C } from "react-error-boundary";
|
|
3
|
+
import { I18nextProvider as S } from "react-i18next";
|
|
4
|
+
import { useEffect as x, useMemo as I } from "react";
|
|
5
|
+
import { ComponentsProvider as L } from "../ComponentAdapter/ComponentsProvider.js";
|
|
6
|
+
import { ApiProvider as U } from "../ApiProvider/ApiProvider.js";
|
|
7
|
+
import { LoadingIndicatorProvider as z } from "../LoadingIndicatorProvider/LoadingIndicatorProvider.js";
|
|
8
|
+
import { sanitizeError as D } from "../ObservabilityProvider/sanitization.js";
|
|
9
|
+
import { UnstableFeaturesProvider as F } from "../UnstableFeaturesProvider/UnstableFeaturesProvider.js";
|
|
10
|
+
import { FeaturesProvider as T } from "../FeaturesProvider/FeaturesProvider.js";
|
|
10
11
|
import { SDKI18next as m } from "./SDKI18next.js";
|
|
11
|
-
import { InternalError as
|
|
12
|
-
import { LocaleProvider as
|
|
12
|
+
import { InternalError as w } from "../../components/Common/InternalError/InternalError.js";
|
|
13
|
+
import { LocaleProvider as A } from "../LocaleProvider/LocaleProvider.js";
|
|
13
14
|
import "../LocaleProvider/useLocale.js";
|
|
14
|
-
import { ThemeProvider as
|
|
15
|
-
import { normalizeToSDKError as
|
|
16
|
-
import { NonceContext as
|
|
17
|
-
import { ObservabilityProvider as
|
|
18
|
-
function
|
|
15
|
+
import { ThemeProvider as B } from "../ThemeProvider/ThemeProvider.js";
|
|
16
|
+
import { normalizeToSDKError as K } from "../../types/sdkError.js";
|
|
17
|
+
import { NonceContext as j } from "../NonceProvider/useNonce.js";
|
|
18
|
+
import { ObservabilityProvider as q } from "../ObservabilityProvider/ObservabilityProvider.js";
|
|
19
|
+
function ir(l) {
|
|
19
20
|
const {
|
|
20
21
|
children: s,
|
|
21
22
|
config: o,
|
|
22
23
|
dictionary: i,
|
|
23
24
|
lng: n = "en",
|
|
24
|
-
locale:
|
|
25
|
-
currency:
|
|
25
|
+
locale: d = "en-US",
|
|
26
|
+
currency: c = "USD",
|
|
26
27
|
theme: p,
|
|
27
|
-
nonce:
|
|
28
|
-
portalContainer:
|
|
28
|
+
nonce: u,
|
|
29
|
+
portalContainer: v,
|
|
29
30
|
components: f,
|
|
30
31
|
LoaderComponent: b,
|
|
31
32
|
queryClient: h,
|
|
32
|
-
|
|
33
|
+
features: y,
|
|
34
|
+
unstableFeatures: E
|
|
33
35
|
} = l;
|
|
34
36
|
if (i)
|
|
35
37
|
for (const t in i) {
|
|
@@ -43,33 +45,33 @@ function rr(l) {
|
|
|
43
45
|
!0
|
|
44
46
|
);
|
|
45
47
|
}
|
|
46
|
-
|
|
48
|
+
x(() => {
|
|
47
49
|
(async () => await m.changeLanguage(n))();
|
|
48
50
|
}, [n]);
|
|
49
|
-
const
|
|
51
|
+
const P = I(() => {
|
|
50
52
|
if (o.observability?.onError)
|
|
51
53
|
return (t, e) => {
|
|
52
54
|
if (!o.observability?.onError) return;
|
|
53
|
-
const
|
|
54
|
-
...
|
|
55
|
+
const g = {
|
|
56
|
+
...K(t),
|
|
55
57
|
timestamp: Date.now(),
|
|
56
58
|
componentStack: e.componentStack ?? void 0
|
|
57
|
-
},
|
|
58
|
-
o.observability.onError(
|
|
59
|
+
}, k = D(g, o.observability.sanitization);
|
|
60
|
+
o.observability.onError(k);
|
|
59
61
|
};
|
|
60
62
|
}, [o.observability]);
|
|
61
|
-
return /* @__PURE__ */ r(
|
|
62
|
-
|
|
63
|
+
return /* @__PURE__ */ r(j.Provider, { value: u, children: /* @__PURE__ */ r(L, { value: f, children: /* @__PURE__ */ r(z, { value: b, children: /* @__PURE__ */ r(q, { observability: o.observability, children: /* @__PURE__ */ r(C, { FallbackComponent: w, onError: P, children: /* @__PURE__ */ r(B, { theme: p, portalContainer: v, children: /* @__PURE__ */ r(A, { locale: d, currency: c, children: /* @__PURE__ */ r(S, { i18n: m, children: /* @__PURE__ */ r(
|
|
64
|
+
U,
|
|
63
65
|
{
|
|
64
66
|
url: o.baseUrl,
|
|
65
67
|
headers: o.headers,
|
|
66
68
|
hooks: o.hooks,
|
|
67
69
|
queryClient: h,
|
|
68
|
-
children: /* @__PURE__ */ r(
|
|
70
|
+
children: /* @__PURE__ */ r(T, { value: y, children: /* @__PURE__ */ r(F, { value: E, children: s }) })
|
|
69
71
|
}
|
|
70
72
|
) }, n) }) }) }) }) }) }) });
|
|
71
73
|
}
|
|
72
74
|
export {
|
|
73
|
-
|
|
75
|
+
ir as GustoProviderCustomUIAdapter
|
|
74
76
|
};
|
|
75
77
|
//# sourceMappingURL=GustoProviderCustomUIAdapter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GustoProviderCustomUIAdapter.js","sources":["../../../src/contexts/GustoProvider/GustoProviderCustomUIAdapter.tsx"],"sourcesContent":["import type React from 'react'\nimport type { ErrorInfo, JSX, ReactNode } from 'react'\nimport { ErrorBoundary } from 'react-error-boundary'\nimport { I18nextProvider } from 'react-i18next'\nimport type { QueryClient } from '@tanstack/react-query'\nimport { useEffect, useMemo } from 'react'\nimport { ComponentsProvider } from '../ComponentAdapter/ComponentsProvider'\nimport type { ComponentsContextType } from '../ComponentAdapter/useComponentContext'\nimport { ApiProvider } from '../ApiProvider/ApiProvider'\nimport { LoadingIndicatorProvider } from '../LoadingIndicatorProvider/LoadingIndicatorProvider'\nimport { ObservabilityProvider } from '../ObservabilityProvider'\nimport { sanitizeError } from '../ObservabilityProvider/sanitization'\nimport { UnstableFeaturesProvider } from '../UnstableFeaturesProvider/UnstableFeaturesProvider'\nimport type { UnstableFeatures } from '../UnstableFeaturesProvider/useUnstableFeature'\nimport { SDKI18next } from './SDKI18next'\nimport { InternalError } from '@/components/Common'\nimport { LocaleProvider } from '@/contexts/LocaleProvider'\nimport { NonceContext } from '@/contexts/NonceProvider'\nimport { ThemeProvider } from '@/contexts/ThemeProvider'\nimport type { GustoSDKTheme } from '@/contexts/ThemeProvider/theme'\nimport type { GlobalResourceDictionary, SupportedLanguages } from '@/types/Helpers'\nimport type { SDKHooks } from '@/types/hooks'\nimport type { ObservabilityHook } from '@/types/observability'\nimport { normalizeToSDKError } from '@/types/sdkError'\n\n/**\n * API client configuration passed to {@link GustoProvider} (and {@link GustoProviderCustomUIAdapter}).\n *\n * @public\n */\nexport interface APIConfig {\n /** URL of your backend proxy that forwards SDK requests to the Gusto Embedded API. SDK components never call Gusto directly. */\n baseUrl: string\n /** Extra headers applied to every API request. Combined with any headers your proxy adds. */\n headers?: HeadersInit\n /** Request interceptor hooks. Use these to inspect, modify, or react to requests and responses. See {@link SDKHooks}. */\n hooks?: SDKHooks\n /** Observability hook for surfacing errors and metrics from the SDK to your monitoring stack. See {@link ObservabilityHook}. */\n observability?: ObservabilityHook\n}\n\n/**\n * Shared configuration props accepted by {@link GustoProvider} and {@link GustoProviderCustomUIAdapter}.\n *\n * @public\n */\nexport interface GustoBaseProviderProps {\n /** API client configuration, including the proxy `baseUrl`, request hooks, and observability. See {@link APIConfig}. */\n config: APIConfig\n /** Translation overrides keyed by language and i18next namespace. Strings supplied here replace the SDK defaults for the matching keys. */\n dictionary?: GlobalResourceDictionary\n /** Active i18next language. Defaults to `'en'`. */\n lng?: string\n /** BCP 47 locale used for number, date, and currency formatting throughout the SDK. Defaults to `'en-US'`. */\n locale?: string\n /** ISO 4217 currency code used for monetary formatting. Defaults to `'USD'`. */\n currency?: string\n /** Theme overrides applied to SDK components. See {@link GustoSDKTheme}. */\n theme?: Partial<GustoSDKTheme>\n /**\n * CSP nonce to apply to runtime-injected `<style>` elements (theming, PDF download window).\n * Pass the same per-request nonce your app uses in its `style-src 'nonce-…'` directive.\n * Also exposed to custom UI components via `useNonce`.\n */\n nonce?: string\n /**\n * Element to use as the portal container for SDK popovers and dropdowns.\n * Defaults to a themed root element the SDK appends to `document.body`.\n *\n * Pass an element here if rendering inside a modal, or **required** if\n * rendering inside a shadow root — `document.body` sits outside every\n * shadow boundary, so without an explicit container overlays would\n * otherwise escape your shadow root's style encapsulation.\n */\n portalContainer?: HTMLElement\n /** Optional TanStack Query `QueryClient`. When omitted, the SDK creates its own client configured for Gusto's API. */\n queryClient?: QueryClient\n /** Complete map of UI components the SDK renders. Required because this adapter ships no defaults. */\n components: ComponentsContextType\n /** Loading indicator rendered while SDK queries are pending. Overrides the SDK default spinner. */\n LoaderComponent?: ({ children }: { children?: ReactNode }) => JSX.Element\n /**\n * Opt-in flags for alpha SDK functionality. See {@link UnstableFeatures}.\n * @alpha\n */\n unstableFeatures?: UnstableFeatures\n}\n\n/**\n * Props for {@link GustoProviderCustomUIAdapter}.\n *\n * @public\n */\nexport interface GustoProviderCustomUIAdapterProps extends GustoBaseProviderProps {\n /** The application tree that should have access to the SDK. */\n children?: React.ReactNode\n}\n\n/**\n * Top-level provider that requires a complete component map and ships no UI defaults.\n *\n * @remarks\n * Use this adapter when you want full control over every UI primitive the SDK renders, or when\n * you want to avoid the React Aria dependency for tree-shaking. Unlike {@link GustoProvider}, the\n * `components` prop on {@link GustoProviderProps} is required and must supply every component the\n * SDK renders.\n *\n * @param props - See {@link GustoProviderCustomUIAdapterProps}.\n * @returns The configured provider tree wrapping `children`.\n * @public\n * @group Providers\n */\nexport function GustoProviderCustomUIAdapter(props: GustoProviderCustomUIAdapterProps) {\n const {\n children,\n config,\n dictionary,\n lng = 'en',\n locale = 'en-US',\n currency = 'USD',\n theme,\n nonce,\n portalContainer,\n components,\n LoaderComponent,\n queryClient,\n unstableFeatures,\n } = props\n\n if (dictionary) {\n for (const language in dictionary) {\n const lang = language as SupportedLanguages\n for (const ns in dictionary[lang]) {\n SDKI18next.addResourceBundle(\n lang,\n ns,\n (dictionary[lang] as Record<string, unknown>)[ns],\n true,\n true,\n )\n }\n }\n }\n\n useEffect(() => {\n void (async () => {\n await SDKI18next.changeLanguage(lng)\n })()\n }, [lng])\n\n const handleTopLevelError = useMemo(() => {\n if (!config.observability?.onError) return undefined\n\n return (error: unknown, errorInfo: ErrorInfo) => {\n if (!config.observability?.onError) return\n\n const sdkError = normalizeToSDKError(error)\n\n const observabilityError = {\n ...sdkError,\n timestamp: Date.now(),\n componentStack: errorInfo.componentStack ?? undefined,\n }\n\n const sanitizedError = sanitizeError(observabilityError, config.observability.sanitization)\n\n config.observability.onError(sanitizedError)\n }\n }, [config.observability])\n return (\n <NonceContext.Provider value={nonce}>\n <ComponentsProvider value={components}>\n <LoadingIndicatorProvider value={LoaderComponent}>\n <ObservabilityProvider observability={config.observability}>\n <ErrorBoundary FallbackComponent={InternalError} onError={handleTopLevelError}>\n <ThemeProvider theme={theme} portalContainer={portalContainer}>\n <LocaleProvider locale={locale} currency={currency}>\n <I18nextProvider i18n={SDKI18next} key={lng}>\n <ApiProvider\n url={config.baseUrl}\n headers={config.headers}\n hooks={config.hooks}\n queryClient={queryClient}\n >\n <UnstableFeaturesProvider value={unstableFeatures}>\n {children}\n </UnstableFeaturesProvider>\n </ApiProvider>\n </I18nextProvider>\n </LocaleProvider>\n </ThemeProvider>\n </ErrorBoundary>\n </ObservabilityProvider>\n </LoadingIndicatorProvider>\n </ComponentsProvider>\n </NonceContext.Provider>\n )\n}\n"],"names":["GustoProviderCustomUIAdapter","props","children","config","dictionary","lng","locale","currency","theme","nonce","portalContainer","components","LoaderComponent","queryClient","unstableFeatures","language","lang","ns","SDKI18next","useEffect","handleTopLevelError","useMemo","error","errorInfo","observabilityError","normalizeToSDKError","sanitizedError","sanitizeError","NonceContext","jsx","ComponentsProvider","LoadingIndicatorProvider","ObservabilityProvider","ErrorBoundary","InternalError","ThemeProvider","LocaleProvider","I18nextProvider","ApiProvider","UnstableFeaturesProvider"],"mappings":";;;;;;;;;;;;;;;;;AAgHO,SAASA,GAA6BC,GAA0C;AACrF,QAAM;AAAA,IACJ,UAAAC;AAAA,IACA,QAAAC;AAAA,IACA,YAAAC;AAAA,IACA,KAAAC,IAAM;AAAA,IACN,QAAAC,IAAS;AAAA,IACT,UAAAC,IAAW;AAAA,IACX,OAAAC;AAAA,IACA,OAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,kBAAAC;AAAA,EAAA,IACEb;AAEJ,MAAIG;AACF,eAAWW,KAAYX,GAAY;AACjC,YAAMY,IAAOD;AACb,iBAAWE,KAAMb,EAAWY,CAAI;AAC9B,QAAAE,EAAW;AAAA,UACTF;AAAA,UACAC;AAAA,UACCb,EAAWY,CAAI,EAA8BC,CAAE;AAAA,UAChD;AAAA,UACA;AAAA,QAAA;AAAA,IAGN;AAGF,EAAAE,EAAU,MAAM;AACd,KAAM,YACJ,MAAMD,EAAW,eAAeb,CAAG;AAAA,EAEvC,GAAG,CAACA,CAAG,CAAC;AAER,QAAMe,IAAsBC,EAAQ,MAAM;AACxC,QAAKlB,EAAO,eAAe;AAE3B,aAAO,CAACmB,GAAgBC,MAAyB;AAC/C,YAAI,CAACpB,EAAO,eAAe,QAAS;AAIpC,cAAMqB,IAAqB;AAAA,UACzB,GAHeC,EAAoBH,CAAK;AAAA,UAIxC,WAAW,KAAK,IAAA;AAAA,UAChB,gBAAgBC,EAAU,kBAAkB;AAAA,QAAA,GAGxCG,IAAiBC,EAAcH,GAAoBrB,EAAO,cAAc,YAAY;AAE1F,QAAAA,EAAO,cAAc,QAAQuB,CAAc;AAAA,MAC7C;AAAA,EACF,GAAG,CAACvB,EAAO,aAAa,CAAC;AACzB,2BACGyB,EAAa,UAAb,EAAsB,OAAOnB,GAC5B,UAAA,gBAAAoB,EAACC,GAAA,EAAmB,OAAOnB,GACzB,4BAACoB,GAAA,EAAyB,OAAOnB,GAC/B,UAAA,gBAAAiB,EAACG,KAAsB,eAAe7B,EAAO,eAC3C,UAAA,gBAAA0B,EAACI,KAAc,mBAAmBC,GAAe,SAASd,GACxD,4BAACe,GAAA,EAAc,OAAA3B,GAAc,iBAAAE,GAC3B,UAAA,gBAAAmB,EAACO,KAAe,QAAA9B,GAAgB,UAAAC,GAC9B,UAAA,gBAAAsB,EAACQ,GAAA,EAAgB,MAAMnB,GACrB,UAAA,gBAAAW;AAAA,IAACS;AAAA,IAAA;AAAA,MACC,KAAKnC,EAAO;AAAA,MACZ,SAASA,EAAO;AAAA,MAChB,OAAOA,EAAO;AAAA,MACd,aAAAU;AAAA,MAEA,UAAA,gBAAAgB,EAACU,GAAA,EAAyB,OAAOzB,GAC9B,UAAAZ,EAAA,CACH;AAAA,IAAA;AAAA,EAAA,KAToCG,CAWxC,EAAA,CACF,EAAA,CACF,GACF,GACF,EAAA,CACF,GACF,GACF;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"GustoProviderCustomUIAdapter.js","sources":["../../../src/contexts/GustoProvider/GustoProviderCustomUIAdapter.tsx"],"sourcesContent":["import type React from 'react'\nimport type { ErrorInfo, JSX, ReactNode } from 'react'\nimport { ErrorBoundary } from 'react-error-boundary'\nimport { I18nextProvider } from 'react-i18next'\nimport type { QueryClient } from '@tanstack/react-query'\nimport { useEffect, useMemo } from 'react'\nimport { ComponentsProvider } from '../ComponentAdapter/ComponentsProvider'\nimport type { ComponentsContextType } from '../ComponentAdapter/useComponentContext'\nimport { ApiProvider } from '../ApiProvider/ApiProvider'\nimport { LoadingIndicatorProvider } from '../LoadingIndicatorProvider/LoadingIndicatorProvider'\nimport { ObservabilityProvider } from '../ObservabilityProvider'\nimport { sanitizeError } from '../ObservabilityProvider/sanitization'\nimport { UnstableFeaturesProvider } from '../UnstableFeaturesProvider/UnstableFeaturesProvider'\nimport type { UnstableFeatures } from '../UnstableFeaturesProvider/useUnstableFeature'\nimport { FeaturesProvider } from '../FeaturesProvider/FeaturesProvider'\nimport type { Features } from '../FeaturesProvider/useFeature'\nimport { SDKI18next } from './SDKI18next'\nimport { InternalError } from '@/components/Common'\nimport { LocaleProvider } from '@/contexts/LocaleProvider'\nimport { NonceContext } from '@/contexts/NonceProvider'\nimport { ThemeProvider } from '@/contexts/ThemeProvider'\nimport type { GustoSDKTheme } from '@/contexts/ThemeProvider/theme'\nimport type { GlobalResourceDictionary, SupportedLanguages } from '@/types/Helpers'\nimport type { SDKHooks } from '@/types/hooks'\nimport type { ObservabilityHook } from '@/types/observability'\nimport { normalizeToSDKError } from '@/types/sdkError'\n\n/**\n * API client configuration passed to {@link GustoProvider} (and {@link GustoProviderCustomUIAdapter}).\n *\n * @public\n */\nexport interface APIConfig {\n /** URL of your backend proxy that forwards SDK requests to the Gusto Embedded API. SDK components never call Gusto directly. */\n baseUrl: string\n /** Extra headers applied to every API request. Combined with any headers your proxy adds. */\n headers?: HeadersInit\n /** Request interceptor hooks. Use these to inspect, modify, or react to requests and responses. See {@link SDKHooks}. */\n hooks?: SDKHooks\n /** Observability hook for surfacing errors and metrics from the SDK to your monitoring stack. See {@link ObservabilityHook}. */\n observability?: ObservabilityHook\n}\n\n/**\n * Shared configuration props accepted by {@link GustoProvider} and {@link GustoProviderCustomUIAdapter}.\n *\n * @public\n */\nexport interface GustoBaseProviderProps {\n /** API client configuration, including the proxy `baseUrl`, request hooks, and observability. See {@link APIConfig}. */\n config: APIConfig\n /** Translation overrides keyed by language and i18next namespace. Strings supplied here replace the SDK defaults for the matching keys. */\n dictionary?: GlobalResourceDictionary\n /** Active i18next language. Defaults to `'en'`. */\n lng?: string\n /** BCP 47 locale used for number, date, and currency formatting throughout the SDK. Defaults to `'en-US'`. */\n locale?: string\n /** ISO 4217 currency code used for monetary formatting. Defaults to `'USD'`. */\n currency?: string\n /** Theme overrides applied to SDK components. See {@link GustoSDKTheme}. */\n theme?: Partial<GustoSDKTheme>\n /**\n * CSP nonce to apply to runtime-injected `<style>` elements (theming, PDF download window).\n * Pass the same per-request nonce your app uses in its `style-src 'nonce-…'` directive.\n * Also exposed to custom UI components via `useNonce`.\n */\n nonce?: string\n /**\n * Element to use as the portal container for SDK popovers and dropdowns.\n * Defaults to a themed root element the SDK appends to `document.body`.\n *\n * Pass an element here if rendering inside a modal, or **required** if\n * rendering inside a shadow root — `document.body` sits outside every\n * shadow boundary, so without an explicit container overlays would\n * otherwise escape your shadow root's style encapsulation.\n */\n portalContainer?: HTMLElement\n /** Optional TanStack Query `QueryClient`. When omitted, the SDK creates its own client configured for Gusto's API. */\n queryClient?: QueryClient\n /** Complete map of UI components the SDK renders. Required because this adapter ships no defaults. */\n components: ComponentsContextType\n /** Loading indicator rendered while SDK queries are pending. Overrides the SDK default spinner. */\n LoaderComponent?: ({ children }: { children?: ReactNode }) => JSX.Element\n /** Flags for turning released SDK functionality on or off. Omitted flags use their default. See {@link Features}. */\n features?: Features\n /**\n * Opt-in flags for alpha SDK functionality. See {@link UnstableFeatures}.\n * @alpha\n */\n unstableFeatures?: UnstableFeatures\n}\n\n/**\n * Props for {@link GustoProviderCustomUIAdapter}.\n *\n * @public\n */\nexport interface GustoProviderCustomUIAdapterProps extends GustoBaseProviderProps {\n /** The application tree that should have access to the SDK. */\n children?: React.ReactNode\n}\n\n/**\n * Top-level provider that requires a complete component map and ships no UI defaults.\n *\n * @remarks\n * Use this adapter when you want full control over every UI primitive the SDK renders, or when\n * you want to avoid the React Aria dependency for tree-shaking. Unlike {@link GustoProvider}, the\n * `components` prop on {@link GustoProviderProps} is required and must supply every component the\n * SDK renders.\n *\n * @param props - See {@link GustoProviderCustomUIAdapterProps}.\n * @returns The configured provider tree wrapping `children`.\n * @public\n * @group Providers\n */\nexport function GustoProviderCustomUIAdapter(props: GustoProviderCustomUIAdapterProps) {\n const {\n children,\n config,\n dictionary,\n lng = 'en',\n locale = 'en-US',\n currency = 'USD',\n theme,\n nonce,\n portalContainer,\n components,\n LoaderComponent,\n queryClient,\n features,\n unstableFeatures,\n } = props\n\n if (dictionary) {\n for (const language in dictionary) {\n const lang = language as SupportedLanguages\n for (const ns in dictionary[lang]) {\n SDKI18next.addResourceBundle(\n lang,\n ns,\n (dictionary[lang] as Record<string, unknown>)[ns],\n true,\n true,\n )\n }\n }\n }\n\n useEffect(() => {\n void (async () => {\n await SDKI18next.changeLanguage(lng)\n })()\n }, [lng])\n\n const handleTopLevelError = useMemo(() => {\n if (!config.observability?.onError) return undefined\n\n return (error: unknown, errorInfo: ErrorInfo) => {\n if (!config.observability?.onError) return\n\n const sdkError = normalizeToSDKError(error)\n\n const observabilityError = {\n ...sdkError,\n timestamp: Date.now(),\n componentStack: errorInfo.componentStack ?? undefined,\n }\n\n const sanitizedError = sanitizeError(observabilityError, config.observability.sanitization)\n\n config.observability.onError(sanitizedError)\n }\n }, [config.observability])\n return (\n <NonceContext.Provider value={nonce}>\n <ComponentsProvider value={components}>\n <LoadingIndicatorProvider value={LoaderComponent}>\n <ObservabilityProvider observability={config.observability}>\n <ErrorBoundary FallbackComponent={InternalError} onError={handleTopLevelError}>\n <ThemeProvider theme={theme} portalContainer={portalContainer}>\n <LocaleProvider locale={locale} currency={currency}>\n <I18nextProvider i18n={SDKI18next} key={lng}>\n <ApiProvider\n url={config.baseUrl}\n headers={config.headers}\n hooks={config.hooks}\n queryClient={queryClient}\n >\n <FeaturesProvider value={features}>\n <UnstableFeaturesProvider value={unstableFeatures}>\n {children}\n </UnstableFeaturesProvider>\n </FeaturesProvider>\n </ApiProvider>\n </I18nextProvider>\n </LocaleProvider>\n </ThemeProvider>\n </ErrorBoundary>\n </ObservabilityProvider>\n </LoadingIndicatorProvider>\n </ComponentsProvider>\n </NonceContext.Provider>\n )\n}\n"],"names":["GustoProviderCustomUIAdapter","props","children","config","dictionary","lng","locale","currency","theme","nonce","portalContainer","components","LoaderComponent","queryClient","features","unstableFeatures","language","lang","ns","SDKI18next","useEffect","handleTopLevelError","useMemo","error","errorInfo","observabilityError","normalizeToSDKError","sanitizedError","sanitizeError","NonceContext","jsx","ComponentsProvider","LoadingIndicatorProvider","ObservabilityProvider","ErrorBoundary","InternalError","ThemeProvider","LocaleProvider","I18nextProvider","ApiProvider","FeaturesProvider","UnstableFeaturesProvider"],"mappings":";;;;;;;;;;;;;;;;;;AAoHO,SAASA,GAA6BC,GAA0C;AACrF,QAAM;AAAA,IACJ,UAAAC;AAAA,IACA,QAAAC;AAAA,IACA,YAAAC;AAAA,IACA,KAAAC,IAAM;AAAA,IACN,QAAAC,IAAS;AAAA,IACT,UAAAC,IAAW;AAAA,IACX,OAAAC;AAAA,IACA,OAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,UAAAC;AAAA,IACA,kBAAAC;AAAA,EAAA,IACEd;AAEJ,MAAIG;AACF,eAAWY,KAAYZ,GAAY;AACjC,YAAMa,IAAOD;AACb,iBAAWE,KAAMd,EAAWa,CAAI;AAC9B,QAAAE,EAAW;AAAA,UACTF;AAAA,UACAC;AAAA,UACCd,EAAWa,CAAI,EAA8BC,CAAE;AAAA,UAChD;AAAA,UACA;AAAA,QAAA;AAAA,IAGN;AAGF,EAAAE,EAAU,MAAM;AACd,KAAM,YACJ,MAAMD,EAAW,eAAed,CAAG;AAAA,EAEvC,GAAG,CAACA,CAAG,CAAC;AAER,QAAMgB,IAAsBC,EAAQ,MAAM;AACxC,QAAKnB,EAAO,eAAe;AAE3B,aAAO,CAACoB,GAAgBC,MAAyB;AAC/C,YAAI,CAACrB,EAAO,eAAe,QAAS;AAIpC,cAAMsB,IAAqB;AAAA,UACzB,GAHeC,EAAoBH,CAAK;AAAA,UAIxC,WAAW,KAAK,IAAA;AAAA,UAChB,gBAAgBC,EAAU,kBAAkB;AAAA,QAAA,GAGxCG,IAAiBC,EAAcH,GAAoBtB,EAAO,cAAc,YAAY;AAE1F,QAAAA,EAAO,cAAc,QAAQwB,CAAc;AAAA,MAC7C;AAAA,EACF,GAAG,CAACxB,EAAO,aAAa,CAAC;AACzB,2BACG0B,EAAa,UAAb,EAAsB,OAAOpB,GAC5B,UAAA,gBAAAqB,EAACC,GAAA,EAAmB,OAAOpB,GACzB,4BAACqB,GAAA,EAAyB,OAAOpB,GAC/B,UAAA,gBAAAkB,EAACG,KAAsB,eAAe9B,EAAO,eAC3C,UAAA,gBAAA2B,EAACI,KAAc,mBAAmBC,GAAe,SAASd,GACxD,4BAACe,GAAA,EAAc,OAAA5B,GAAc,iBAAAE,GAC3B,UAAA,gBAAAoB,EAACO,KAAe,QAAA/B,GAAgB,UAAAC,GAC9B,UAAA,gBAAAuB,EAACQ,GAAA,EAAgB,MAAMnB,GACrB,UAAA,gBAAAW;AAAA,IAACS;AAAA,IAAA;AAAA,MACC,KAAKpC,EAAO;AAAA,MACZ,SAASA,EAAO;AAAA,MAChB,OAAOA,EAAO;AAAA,MACd,aAAAU;AAAA,MAEA,UAAA,gBAAAiB,EAACU,KAAiB,OAAO1B,GACvB,4BAAC2B,GAAA,EAAyB,OAAO1B,GAC9B,UAAAb,EAAA,CACH,EAAA,CACF;AAAA,IAAA;AAAA,EAAA,KAXoCG,CAaxC,EAAA,CACF,EAAA,CACF,GACF,GACF,EAAA,CACF,GACF,GACF;AAEJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useUnstableFeature.js","sources":["../../../src/contexts/UnstableFeaturesProvider/useUnstableFeature.ts"],"sourcesContent":["import { createContext, useContext } from 'react'\n\n/**\n * Opt-in flags for SDK functionality that is still in active development.\n *\n * @remarks\n * Pass to {@link GustoProvider} via the `unstableFeatures` prop to enable a feature ahead of its\n * public release. Every flag defaults to disabled when omitted. When a feature graduates to\n * public release, its flag is deleted from this interface
|
|
1
|
+
{"version":3,"file":"useUnstableFeature.js","sources":["../../../src/contexts/UnstableFeaturesProvider/useUnstableFeature.ts"],"sourcesContent":["import { createContext, useContext } from 'react'\n\n/**\n * Opt-in flags for SDK functionality that is still in active development.\n *\n * @remarks\n * Pass to {@link GustoProvider} via the `unstableFeatures` prop to enable a feature ahead of its\n * public release. Every flag defaults to disabled when omitted. When a feature graduates to\n * public release, its flag is deleted from this interface — there is no deprecation step. The\n * conditional checks that read it are deleted too, or moved to a {@link Features} flag when the\n * released feature still needs a way to turn it off. This interface may have no flags at all\n * at any given time — e.g. immediately after the last active flag graduates and before the next\n * one is added — the opt-in mechanism itself is permanent even when nothing is currently gated\n * behind it.\n *\n * @alpha\n */\nexport interface UnstableFeatures {\n /**\n * Recording contractor payments that were made outside of Gusto.\n *\n * When `true`, `ContractorManagement.PaymentsList` (and `ContractorManagement.PaymentFlow`, which\n * renders it) shows a \"Record a historical payment\" call to action that opens the historical\n * payment flow. `ContractorManagement.HistoricalPaymentFlow`,\n * `ContractorManagement.CreateHistoricalPayment`, and\n * `ContractorManagement.HistoricalPaymentSummary` can be mounted.\n *\n * When `false`, the call to action is hidden and those three components throw when mounted.\n *\n * @defaultValue `false`\n */\n historicalPayments?: boolean\n /**\n * Managing pay schedules and their employee assignments after onboarding.\n *\n * When `true`, `CompanyManagement.PaySchedule` and `CompanyManagement.PayScheduleAssignment` can\n * be mounted.\n *\n * When `false`, both components throw when mounted. `CompanyOnboarding.PaySchedule` is not\n * affected.\n *\n * @defaultValue `false`\n */\n managePaySchedules?: boolean\n /**\n * Reviewing a company's tax payments and their liabilities.\n *\n * When `true`, `CompanyManagement.TaxPaymentsFlow`, `CompanyManagement.TaxPaymentsList`, and\n * `CompanyManagement.TaxPaymentDetail` can be mounted.\n *\n * When `false`, all three components throw when mounted.\n *\n * @defaultValue `false`\n */\n taxPayments?: boolean\n}\n\n/**\n * React context backing {@link useUnstableFeature}.\n *\n * @internal\n */\nexport const UnstableFeaturesContext = createContext<UnstableFeatures>({})\n\n/**\n * Reads whether `feature` is enabled via {@link GustoProvider}'s `unstableFeatures` prop.\n *\n * @remarks\n * With `throwIfDisabled: true`, call unconditionally at the top of an alpha component's body —\n * not inside {@link WithUnstableFeature} — so mounting the component without opting in fails\n * loudly and immediately. This throws in every environment, including production: using an alpha\n * component without its flag is an integration mistake, not a runtime state, the same as\n * {@link useComponentContext} throwing when called outside a `ComponentsProvider`.\n *\n * @param feature - The {@link UnstableFeatures} flag to read.\n * @param options - Set `throwIfDisabled` to throw instead of returning `false` when `feature` is disabled.\n * @throws When `options.throwIfDisabled` is set and `feature` is not enabled.\n * @internal\n */\nexport const useUnstableFeature = (\n feature: keyof UnstableFeatures,\n options: { throwIfDisabled?: boolean } = { throwIfDisabled: false },\n): boolean => {\n const features = useContext(UnstableFeaturesContext)\n const isEnabled = !!features[feature]\n\n if (options.throwIfDisabled && !isEnabled) {\n throw new Error(\n `This component requires the unstable feature flag \"${feature}\" to be enabled via GustoProvider's \\`unstableFeatures\\` prop.`,\n )\n }\n\n return isEnabled\n}\n"],"names":["UnstableFeaturesContext","createContext","useUnstableFeature","feature","options","isEnabled","useContext"],"mappings":";AA8DO,MAAMA,IAA0BC,EAAgC,CAAA,CAAE,GAiB5DC,IAAqB,CAChCC,GACAC,IAAyC,EAAE,iBAAiB,SAChD;AAEZ,QAAMC,IAAY,CAAC,CADFC,EAAWN,CAAuB,EACtBG,CAAO;AAEpC,MAAIC,EAAQ,mBAAmB,CAACC;AAC9B,UAAM,IAAI;AAAA,MACR,sDAAsDF,CAAO;AAAA,IAAA;AAIjE,SAAOE;AACT;"}
|
package/dist/i18n/I18n.js
CHANGED
|
@@ -123,10 +123,9 @@ const j = "common", i = /* @__PURE__ */ Object.assign({
|
|
|
123
123
|
"./en/Payroll.PrintChecksSummary.json": () => import("./en/Payroll.PrintChecksSummary.json.js").then((e) => e.default),
|
|
124
124
|
"./en/Payroll.RecoveryCasesList.json": () => import("./en/Payroll.RecoveryCasesList.json.js").then((e) => e.default),
|
|
125
125
|
"./en/Payroll.RecoveryCasesResubmit.json": () => import("./en/Payroll.RecoveryCasesResubmit.json.js").then((e) => e.default),
|
|
126
|
-
"./en/Payroll.
|
|
127
|
-
"./en/Payroll.
|
|
126
|
+
"./en/Payroll.RropPayrollEditEmployee.json": () => import("./en/Payroll.RropPayrollEditEmployee.json.js").then((e) => e.default),
|
|
127
|
+
"./en/Payroll.TransitionConfiguration.json": () => import("./en/Payroll.TransitionConfiguration.json.js").then((e) => e.default),
|
|
128
128
|
"./en/Payroll.TransitionPayrollAlert.json": () => import("./en/Payroll.TransitionPayrollAlert.json.js").then((e) => e.default),
|
|
129
|
-
"./en/Payroll.UNSTABLE_PayrollEditEmployee.json": () => import("./en/Payroll.UNSTABLE_PayrollEditEmployee.json.js").then((e) => e.default),
|
|
130
129
|
"./en/Payroll.WireInstructions.json": () => import("./en/Payroll.WireInstructions.json.js").then((e) => e.default),
|
|
131
130
|
"./en/common.json": () => import("./en/common.json.js").then((e) => e.default),
|
|
132
131
|
"./es_US/Company.Addresses.json": () => import("./es_US/Company.Addresses.json.js").then((e) => e.default),
|