@gusto/embedded-react-sdk 0.48.0 → 0.48.2
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 +34 -0
- package/dist/components/Common/DocumentList/DocumentList.js +12 -12
- package/dist/components/Common/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Common/DocumentList/DocumentList.module.scss.js +3 -5
- package/dist/components/Common/DocumentList/DocumentList.module.scss.js.map +1 -1
- package/dist/components/Common/EmptyData/EmptyData.d.ts +1 -1
- package/dist/components/Common/EmptyData/EmptyData.js +10 -12
- package/dist/components/Common/EmptyData/EmptyData.js.map +1 -1
- package/dist/components/Common/EmptyData/EmptyData.module.scss.js +6 -10
- package/dist/components/Common/EmptyData/EmptyData.module.scss.js.map +1 -1
- package/dist/components/Common/Form/Form.d.ts +1 -1
- package/dist/components/Common/Form/Form.js +8 -7
- package/dist/components/Common/Form/Form.js.map +1 -1
- package/dist/components/Common/HorizontalFieldLayout/HorizontalFieldLayoutTypes.d.ts +1 -0
- package/dist/components/Common/PaginationControl/PaginationControlTypes.d.ts +7 -3
- package/dist/components/Common/PayrollLoading/PayrollLoadingTypes.d.ts +1 -0
- package/dist/components/Common/UI/Alert/AlertTypes.d.ts +1 -0
- package/dist/components/Common/UI/Alert/AlertTypes.js.map +1 -1
- package/dist/components/Common/UI/Badge/BadgeTypes.d.ts +1 -0
- package/dist/components/Common/UI/Badge/BadgeTypes.js.map +1 -1
- package/dist/components/Common/UI/Banner/BannerTypes.d.ts +1 -0
- package/dist/components/Common/UI/Banner/BannerTypes.js.map +1 -1
- package/dist/components/Common/UI/Box/BoxTypes.d.ts +1 -0
- package/dist/components/Common/UI/BoxHeader/BoxHeaderTypes.d.ts +1 -0
- package/dist/components/Common/UI/BoxHeader/BoxHeaderTypes.js.map +1 -1
- package/dist/components/Common/UI/Breadcrumbs/BreadcrumbsTypes.d.ts +2 -0
- package/dist/components/Common/UI/Breadcrumbs/BreadcrumbsTypes.js.map +1 -1
- package/dist/components/Common/UI/Button/ButtonTypes.d.ts +4 -2
- package/dist/components/Common/UI/Button/ButtonTypes.js.map +1 -1
- package/dist/components/Common/UI/CalendarPreview/CalendarPreviewTypes.d.ts +3 -2
- package/dist/components/Common/UI/Card/Card.js +8 -8
- package/dist/components/Common/UI/Card/Card.js.map +1 -1
- package/dist/components/Common/UI/Card/Card.module.scss.js +5 -3
- package/dist/components/Common/UI/Card/Card.module.scss.js.map +1 -1
- package/dist/components/Common/UI/Card/CardTypes.d.ts +1 -0
- package/dist/components/Common/UI/Checkbox/CheckboxTypes.d.ts +1 -0
- package/dist/components/Common/UI/Checkbox/CheckboxTypes.js.map +1 -1
- package/dist/components/Common/UI/CheckboxGroup/CheckboxGroupTypes.d.ts +2 -0
- package/dist/components/Common/UI/CheckboxGroup/CheckboxGroupTypes.js.map +1 -1
- package/dist/components/Common/UI/ComboBox/ComboBoxTypes.d.ts +2 -0
- package/dist/components/Common/UI/DatePicker/DatePickerTypes.d.ts +1 -0
- package/dist/components/Common/UI/DateRangePicker/DateRangePickerTypes.d.ts +2 -0
- package/dist/components/Common/UI/DescriptionList/DescriptionListTypes.d.ts +2 -0
- package/dist/components/Common/UI/DescriptionList/DescriptionListTypes.js.map +1 -1
- package/dist/components/Common/UI/Dialog/DialogTypes.d.ts +1 -0
- package/dist/components/Common/UI/Dialog/DialogTypes.js.map +1 -1
- package/dist/components/Common/UI/FileInput/FileInputTypes.d.ts +1 -0
- package/dist/components/Common/UI/FileInput/FileInputTypes.js.map +1 -1
- package/dist/components/Common/UI/Heading/HeadingTypes.d.ts +1 -0
- package/dist/components/Common/UI/Link/LinkTypes.d.ts +4 -3
- package/dist/components/Common/UI/List/ListTypes.d.ts +13 -4
- package/dist/components/Common/UI/LoadingSpinner/LoadingSpinnerTypes.d.ts +1 -0
- package/dist/components/Common/UI/LoadingSpinner/LoadingSpinnerTypes.js.map +1 -1
- package/dist/components/Common/UI/Menu/MenuTypes.d.ts +2 -0
- package/dist/components/Common/UI/Menu/MenuTypes.js.map +1 -1
- package/dist/components/Common/UI/Modal/ModalTypes.d.ts +1 -0
- package/dist/components/Common/UI/Modal/ModalTypes.js.map +1 -1
- package/dist/components/Common/UI/MultiSelectComboBox/MultiSelectComboBoxTypes.d.ts +2 -0
- package/dist/components/Common/UI/NumberInput/NumberInputTypes.d.ts +1 -0
- package/dist/components/Common/UI/ProgressBar/ProgressBarTypes.d.ts +1 -0
- package/dist/components/Common/UI/Radio/RadioTypes.d.ts +1 -0
- package/dist/components/Common/UI/Radio/RadioTypes.js.map +1 -1
- package/dist/components/Common/UI/RadioGroup/RadioGroupTypes.d.ts +2 -0
- package/dist/components/Common/UI/RadioGroup/RadioGroupTypes.js.map +1 -1
- package/dist/components/Common/UI/Select/SelectTypes.d.ts +2 -0
- package/dist/components/Common/UI/Switch/SwitchTypes.d.ts +1 -0
- package/dist/components/Common/UI/Switch/SwitchTypes.js.map +1 -1
- package/dist/components/Common/UI/Table/TableTypes.d.ts +3 -0
- package/dist/components/Common/UI/Table/TableTypes.js.map +1 -1
- package/dist/components/Common/UI/Tabs/TabsTypes.d.ts +2 -0
- package/dist/components/Common/UI/Text/TextTypes.d.ts +1 -0
- package/dist/components/Common/UI/Text/TextTypes.js.map +1 -1
- package/dist/components/Common/UI/TextArea/TextAreaTypes.d.ts +1 -0
- package/dist/components/Common/UI/TextArea/TextAreaTypes.js.map +1 -1
- package/dist/components/Common/UI/TextInput/TextInputTypes.d.ts +1 -0
- package/dist/components/Common/UI/TextInput/TextInputTypes.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +5 -4
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +5 -4
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +7 -6
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +5 -4
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +5 -4
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/fields.js +4 -4
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +10 -9
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +8 -7
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Industry/IndustrySelect.js +6 -8
- package/dist/components/Company/Industry/IndustrySelect.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +5 -4
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +5 -4
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +5 -4
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/PayScheduleForm.js +3 -1
- package/dist/components/Company/PaySchedule/PayScheduleForm.js.map +1 -1
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/fields.js +5 -5
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +5 -4
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +5 -4
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Contractor/Address/useAddress.js +7 -6
- package/dist/components/Contractor/Address/useAddress.js.map +1 -1
- package/dist/components/Contractor/Profile/useContractorProfile.js +26 -27
- package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useCompensationForm/fields.js +6 -6
- package/dist/components/Employee/Compensation/shared/useJobForm/fields.js +10 -10
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/fields.js +1 -1
- package/dist/components/Employee/Deductions/shared/useDeductionForm/fields.js +2 -2
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/DocumentList.d.ts +25 -5
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/index.d.ts +3 -0
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js +5 -4
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/I9SignatureForm/I9SignatureForm.d.ts +28 -5
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/I9SignatureForm/I9SignatureForm.js +3 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/I9SignatureForm/I9SignatureForm.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/I9SignatureForm/index.d.ts +3 -0
- package/dist/components/Employee/Documents/shared/SignatureForm/SignatureForm.d.ts +26 -5
- package/dist/components/Employee/Documents/shared/SignatureForm/SignatureForm.js +3 -1
- package/dist/components/Employee/Documents/shared/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Employee/Documents/shared/SignatureForm/index.d.ts +3 -0
- package/dist/components/Employee/Documents/shared/useSignEmployeeForm/fields.js +2 -2
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/fields.js +1 -1
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/splitFieldFactory.js +4 -4
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/fields.js +8 -8
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/fields.js +6 -6
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/fields.js +4 -4
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fieldComponents.js +8 -8
- package/dist/components/Employee/exports/employeeOnboarding.d.ts +3 -0
- package/dist/components/Employee/exports/employeeOnboarding.js +28 -22
- package/dist/components/Employee/exports/employeeOnboarding.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.d.ts +36 -2
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestForm/index.d.ts +1 -1
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.d.ts +22 -2
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestList/index.d.ts +1 -1
- package/dist/components/InformationRequests/InformationRequests.d.ts +29 -2
- package/dist/components/InformationRequests/InformationRequests.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestsComponents.d.ts +2 -0
- package/dist/components/InformationRequests/InformationRequestsComponents.js.map +1 -1
- package/dist/components/InformationRequests/index.d.ts +3 -3
- package/dist/components/InformationRequests/informationRequestsStateMachine.d.ts +2 -0
- package/dist/components/InformationRequests/informationRequestsStateMachine.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.d.ts +36 -3
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js +6 -2
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.d.ts +1 -0
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsComponents.d.ts +14 -0
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsComponents.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.d.ts +1 -8
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +1 -2
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.d.ts +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.js +0 -1
- package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.d.ts +11 -0
- package/dist/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/index.d.ts +1 -2
- package/dist/components/Payroll/ConfirmWireDetails/types.d.ts +23 -0
- package/dist/components/Payroll/Dismissal/DismissalFlow.d.ts +18 -0
- package/dist/components/Payroll/Dismissal/DismissalFlow.js.map +1 -1
- package/dist/components/Payroll/Dismissal/DismissalFlowComponents.d.ts +15 -0
- package/dist/components/Payroll/Dismissal/DismissalFlowComponents.js.map +1 -1
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.d.ts +24 -0
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.js.map +1 -1
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.d.ts +7 -0
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.js.map +1 -1
- package/dist/components/Payroll/Dismissal/dismissalStateMachine.d.ts +2 -0
- package/dist/components/Payroll/Dismissal/dismissalStateMachine.js.map +1 -1
- package/dist/components/Payroll/Dismissal/index.d.ts +1 -1
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.d.ts +1 -0
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +2 -3
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
- package/dist/components/Payroll/GrossUpModal/GrossUpModalTypes.d.ts +5 -0
- package/dist/components/Payroll/GrossUpModal/index.d.ts +0 -1
- package/dist/components/Payroll/OffCycle/OffCycleFlow.d.ts +31 -0
- package/dist/components/Payroll/OffCycle/OffCycleFlow.js.map +1 -1
- package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.d.ts +20 -0
- package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js.map +1 -1
- package/dist/components/Payroll/OffCycle/offCycleStateMachine.d.ts +2 -0
- package/dist/components/Payroll/OffCycle/offCycleStateMachine.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.d.ts +20 -0
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.d.ts +1 -0
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationTypes.d.ts +24 -0
- package/dist/components/Payroll/OffCycleCreation/index.d.ts +1 -1
- package/dist/components/Payroll/OffCycleDeductionsSetting/OffCycleDeductionsSetting.d.ts +16 -0
- package/dist/components/Payroll/OffCycleDeductionsSetting/OffCycleDeductionsSetting.js.map +1 -1
- package/dist/components/Payroll/OffCycleDeductionsSetting/types.d.ts +13 -0
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.d.ts +1 -0
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.d.ts +18 -1
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.js.map +1 -1
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.d.ts +1 -1
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.js +0 -1
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.js.map +1 -1
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelection.d.ts +15 -0
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelection.js.map +1 -1
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.d.ts +1 -0
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCycleReasonSelection/types.d.ts +43 -0
- package/dist/components/Payroll/OffCycleReasonSelection/types.js.map +1 -1
- package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.d.ts +1 -0
- package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js.map +1 -1
- package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModalTypes.d.ts +5 -1
- package/dist/components/Payroll/OffCycleTaxWithholdingModal/index.d.ts +0 -1
- package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTable.d.ts +1 -0
- package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTable.js.map +1 -1
- package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes.d.ts +14 -0
- package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes.js.map +1 -1
- package/dist/components/Payroll/OffCycleTaxWithholdingTable/index.d.ts +0 -2
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.d.ts +3 -0
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.d.ts +19 -5
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/index.d.ts +0 -1
- package/dist/components/Payroll/PayrollBlocker/payrollHelpers.d.ts +17 -11
- package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js +0 -2
- package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.d.ts +31 -3
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +1 -2
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.d.ts +1 -0
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/grossUpHelpers.d.ts +2 -0
- package/dist/components/Payroll/PayrollConfiguration/grossUpHelpers.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.d.ts +2 -0
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.d.ts +42 -3
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js +1 -2
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.d.ts +3 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +0 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.d.ts +8 -6
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +0 -1
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
- package/dist/components/Payroll/PayrollExecutionFlow/PayrollExecutionFlow.d.ts +65 -0
- package/dist/components/Payroll/PayrollExecutionFlow/PayrollExecutionFlow.js.map +1 -1
- package/dist/components/Payroll/PayrollExecutionFlow/index.d.ts +0 -1
- package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.d.ts +2 -0
- package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/OffCycleFlowContextual.d.ts +1 -0
- package/dist/components/Payroll/PayrollFlow/OffCycleFlowContextual.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/PayrollExecutionFlowContextual.d.ts +1 -0
- package/dist/components/Payroll/PayrollFlow/PayrollExecutionFlowContextual.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/PayrollFlow.d.ts +38 -0
- package/dist/components/Payroll/PayrollFlow/PayrollFlow.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.d.ts +27 -0
- package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/TransitionFlowContextual.d.ts +1 -0
- package/dist/components/Payroll/PayrollFlow/TransitionFlowContextual.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.d.ts +2 -0
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.d.ts +25 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.js +1 -2
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.d.ts +1 -0
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollLanding/PayrollLanding.d.ts +33 -4
- package/dist/components/Payroll/PayrollLanding/PayrollLanding.js +1 -2
- package/dist/components/Payroll/PayrollLanding/PayrollLanding.js.map +1 -1
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.d.ts +19 -0
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js.map +1 -1
- package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.d.ts +2 -0
- package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollList.d.ts +32 -13
- package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.d.ts +1 -0
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +65 -68
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollList/types.d.ts +1 -0
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.d.ts +39 -3
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +1 -2
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.d.ts +1 -0
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewTypes.d.ts +1 -0
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewTypes.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.d.ts +1 -0
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/GenericBlocker.d.ts +1 -0
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/GenericBlocker.js.map +1 -1
- package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.d.ts +26 -3
- package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.js +2 -7
- package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.js.map +1 -1
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.d.ts +1 -0
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollStatusBadges/PayrollStatusBadges.d.ts +1 -0
- package/dist/components/Payroll/PayrollStatusBadges/PayrollStatusBadges.js.map +1 -1
- package/dist/components/Payroll/PayrollStatusBadges/index.d.ts +0 -2
- package/dist/components/Payroll/PayrollStatusBadges/payrollStatusConfig.d.ts +26 -0
- package/dist/components/Payroll/PayrollStatusBadges/payrollStatusConfig.js.map +1 -1
- package/dist/components/Payroll/PayrollStatusBadges/usePayrollStatusBadges.d.ts +2 -0
- package/dist/components/Payroll/PayrollStatusBadges/usePayrollStatusBadges.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCases.d.ts +21 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCases.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesComponents.d.ts +5 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesComponents.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.d.ts +1 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.d.ts +1 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/index.d.ts +0 -1
- package/dist/components/Payroll/RecoveryCases/recoveryCasesStateMachine.d.ts +5 -0
- package/dist/components/Payroll/RecoveryCases/recoveryCasesStateMachine.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.d.ts +5 -0
- package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js.map +1 -1
- package/dist/components/Payroll/Transition/TransitionFlow.d.ts +21 -0
- package/dist/components/Payroll/Transition/TransitionFlow.js.map +1 -1
- package/dist/components/Payroll/Transition/TransitionFlowComponents.d.ts +23 -0
- package/dist/components/Payroll/Transition/TransitionFlowComponents.js.map +1 -1
- package/dist/components/Payroll/Transition/transitionStateMachine.d.ts +2 -0
- package/dist/components/Payroll/Transition/transitionStateMachine.js.map +1 -1
- package/dist/components/Payroll/TransitionCreation/TransitionCreation.d.ts +20 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreation.js.map +1 -1
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.d.ts +7 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.js.map +1 -1
- package/dist/components/Payroll/TransitionCreation/TransitionCreationTypes.d.ts +27 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreationTypes.js.map +1 -1
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.d.ts +1 -0
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.js.map +1 -1
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.d.ts +5 -0
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.js.map +1 -1
- package/dist/components/Payroll/helpers.d.ts +157 -26
- package/dist/components/Payroll/helpers.js +0 -1
- package/dist/components/Payroll/helpers.js.map +1 -1
- package/dist/components/Payroll/index.d.ts +11 -2
- package/dist/components/Payroll/payrollTypes.d.ts +24 -0
- package/dist/components/Payroll/payrollTypes.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.d.ts +12 -0
- package/dist/components/Payroll/usePreparedPayrollData.js +4 -3
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/components/Payroll/useUnprocessedTransitionPayPeriods.d.ts +7 -0
- package/dist/components/Payroll/useUnprocessedTransitionPayPeriods.js.map +1 -1
- package/dist/components/TimeOff/AddEmployeesHoliday/AddEmployeesHoliday.d.ts +19 -0
- package/dist/components/TimeOff/AddEmployeesHoliday/AddEmployeesHoliday.js.map +1 -1
- package/dist/components/TimeOff/AddEmployeesToPolicy/AddEmployeesToPolicy.d.ts +44 -0
- package/dist/components/TimeOff/AddEmployeesToPolicy/AddEmployeesToPolicy.js.map +1 -1
- package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetail.d.ts +4 -0
- package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetail.js.map +1 -1
- package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetailPresentation.d.ts +1 -0
- package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetailPresentation.js.map +1 -1
- package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetailTypes.d.ts +28 -2
- package/dist/components/TimeOff/HolidayPolicyDetail/index.d.ts +0 -2
- package/dist/components/TimeOff/HolidaySelectionForm/HolidaySelectionForm.d.ts +26 -0
- package/dist/components/TimeOff/HolidaySelectionForm/HolidaySelectionForm.js.map +1 -1
- package/dist/components/TimeOff/HolidaySelectionForm/HolidaySelectionFormPresentation.d.ts +1 -0
- package/dist/components/TimeOff/HolidaySelectionForm/HolidaySelectionFormPresentation.js.map +1 -1
- package/dist/components/TimeOff/HolidaySelectionForm/HolidaySelectionFormTypes.d.ts +10 -0
- package/dist/components/TimeOff/PolicyList/PolicyList.d.ts +25 -0
- package/dist/components/TimeOff/PolicyList/PolicyList.js.map +1 -1
- package/dist/components/TimeOff/PolicyList/PolicyListPresentation.d.ts +1 -0
- package/dist/components/TimeOff/PolicyList/PolicyListPresentation.js.map +1 -1
- package/dist/components/TimeOff/PolicyList/PolicyListTypes.d.ts +17 -0
- package/dist/components/TimeOff/PolicySettings/PolicySettings.d.ts +22 -0
- package/dist/components/TimeOff/PolicySettings/PolicySettings.js.map +1 -1
- package/dist/components/TimeOff/PolicySettings/PolicySettingsPresentation.d.ts +14 -0
- package/dist/components/TimeOff/PolicySettings/PolicySettingsPresentation.js.map +1 -1
- package/dist/components/TimeOff/PolicySettings/PolicySettingsTypes.d.ts +31 -0
- package/dist/components/TimeOff/PolicyTypeSelector/PolicyTypeSelector.d.ts +23 -0
- package/dist/components/TimeOff/PolicyTypeSelector/PolicyTypeSelector.js.map +1 -1
- package/dist/components/TimeOff/PolicyTypeSelector/PolicyTypeSelectorPresentation.d.ts +1 -0
- package/dist/components/TimeOff/PolicyTypeSelector/PolicyTypeSelectorPresentation.js.map +1 -1
- package/dist/components/TimeOff/PolicyTypeSelector/PolicyTypeSelectorTypes.d.ts +10 -0
- package/dist/components/TimeOff/TimeOffFlow/TimeOffFlow.d.ts +42 -0
- package/dist/components/TimeOff/TimeOffFlow/TimeOffFlow.js.map +1 -1
- package/dist/components/TimeOff/TimeOffFlow/TimeOffFlowComponents.d.ts +26 -0
- package/dist/components/TimeOff/TimeOffFlow/TimeOffFlowComponents.js.map +1 -1
- package/dist/components/TimeOff/TimeOffFlow/timeOffPolicyTypes.d.ts +15 -2
- package/dist/components/TimeOff/TimeOffFlow/timeOffPolicyTypes.js +1 -6
- package/dist/components/TimeOff/TimeOffFlow/timeOffPolicyTypes.js.map +1 -1
- package/dist/components/TimeOff/TimeOffFlow/timeOffStateMachine.d.ts +1 -0
- package/dist/components/TimeOff/TimeOffFlow/timeOffStateMachine.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.d.ts +29 -0
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.d.ts +1 -0
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormTypes.d.ts +59 -1
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/index.d.ts +0 -3
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesHoliday.d.ts +1 -0
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesHoliday.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.d.ts +1 -0
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.js +43 -42
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentationTypes.d.ts +2 -0
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesTimeOff.d.ts +1 -0
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesTimeOff.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/useSelectEmployeesData.d.ts +3 -0
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/useSelectEmployeesData.js.map +1 -1
- package/dist/components/TimeOff/TimeOffPolicyDetail/EditEmployeeBalanceModal.d.ts +9 -0
- package/dist/components/TimeOff/TimeOffPolicyDetail/EditEmployeeBalanceModal.js.map +1 -1
- package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetail.d.ts +25 -0
- package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetail.js.map +1 -1
- package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetailPresentation.d.ts +14 -0
- package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetailPresentation.js.map +1 -1
- package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetailTypes.d.ts +97 -6
- package/dist/components/TimeOff/TimeOffPolicyDetail/index.d.ts +1 -5
- package/dist/components/TimeOff/ViewHolidayEmployees/ViewHolidayEmployees.d.ts +23 -0
- package/dist/components/TimeOff/ViewHolidayEmployees/ViewHolidayEmployees.js.map +1 -1
- package/dist/components/TimeOff/ViewHolidayPolicyDetails/ViewHolidayPolicyDetails.d.ts +22 -0
- package/dist/components/TimeOff/ViewHolidayPolicyDetails/ViewHolidayPolicyDetails.js.map +1 -1
- package/dist/components/TimeOff/ViewHolidaySchedule/ViewHolidaySchedule.d.ts +22 -0
- package/dist/components/TimeOff/ViewHolidaySchedule/ViewHolidaySchedule.js.map +1 -1
- package/dist/components/TimeOff/index.d.ts +8 -2
- package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTable.d.ts +1 -0
- package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTable.js +48 -49
- package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTable.js.map +1 -1
- package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTableTypes.d.ts +66 -0
- package/dist/components/TimeOff/shared/PolicyDetailLayout/PolicyDetailLayout.d.ts +1 -0
- package/dist/components/TimeOff/shared/PolicyDetailLayout/PolicyDetailLayout.js.map +1 -1
- package/dist/components/TimeOff/shared/PolicyDetailLayout/PolicyDetailLayoutTypes.d.ts +28 -0
- package/dist/components/TimeOff/shared/PolicyDetailLayout/index.d.ts +0 -1
- package/dist/components/TimeOff/shared/holidayHelpers.d.ts +5 -0
- package/dist/components/TimeOff/shared/holidayHelpers.js.map +1 -1
- package/dist/contexts/ComponentAdapter/componentAdapterTypes.d.ts +4 -4
- package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.d.ts +39 -39
- package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.js.map +1 -1
- package/dist/contexts/ComponentAdapter/useComponentContext.d.ts +42 -42
- package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
- package/dist/i18n/en/common.json.d.ts +0 -1
- package/dist/i18n/en/common.json.js +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +206 -205
- package/dist/node_modules/react-dnd/dist/core/DndProvider.js +1 -1
- package/dist/node_modules/react-dnd/dist/core/DndProvider.js.map +1 -1
- package/dist/partner-hook-utils/composeErrorHandler.js +3 -1
- package/dist/partner-hook-utils/composeErrorHandler.js.map +1 -1
- package/dist/shared/constants.d.ts +12 -1
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +0 -1
- package/docs/reference/endpoint-inventory.json +55 -0
- package/package.json +24 -11
- package/dist/assets/icons/feature-icon-check.svg.js +0 -10
- package/dist/assets/icons/feature-icon-check.svg.js.map +0 -1
- package/dist/assets/icons/magnifyingGlass.png.js +0 -5
- package/dist/assets/icons/magnifyingGlass.png.js.map +0 -1
- package/dist/components/Payroll/PayrollEditEmployee/index.d.ts +0 -4
- package/dist/components/Payroll/PayrollFlow/index.d.ts +0 -3
- package/dist/components/TimeOff/TimeOffFlow/index.d.ts +0 -3
- package/dist/components/TimeOff/shared/EmployeeTable/index.d.ts +0 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PayrollReceiptsPresentation.js","sources":["../../../../src/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.tsx"],"sourcesContent":["import { useRef } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport classNames from 'classnames'\nimport type {\n PayrollReceipt,\n Taxes as TaxBreakdownItem,\n PayrollReceiptEmployeeCompensations as EmployeeBreakdownItem,\n} from '@gusto/embedded-api-v-2025-11-15/models/components/payrollreceipt'\nimport styles from './PayrollReceiptsPresentation.module.scss'\nimport { DataView, DataTable, Flex } from '@/components/Common'\nimport type { DescriptionListItem } from '@/components/Common/UI/DescriptionList/DescriptionListTypes'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { formatNumberAsCurrency } from '@/helpers/formattedStrings'\nimport { useI18n } from '@/i18n'\nimport { useContainerBreakpoints } from '@/hooks/useContainerBreakpoints/useContainerBreakpoints'\nimport ReceiptCheck from '@/assets/icons/receipt-check.svg?react'\n\ninterface PayrollReceiptsPresentationProps {\n receiptData: PayrollReceipt\n withReimbursements?: boolean\n}\n\nexport const PayrollReceiptsPresentation = ({\n receiptData,\n withReimbursements = true,\n}: PayrollReceiptsPresentationProps) => {\n const Components = useComponentContext()\n const { Heading, Text } = Components\n useI18n('Payroll.PayrollReceipts')\n const { t } = useTranslation('Payroll.PayrollReceipts')\n\n const containerRef = useRef<HTMLDivElement>(null)\n const breakpoints = useContainerBreakpoints({ ref: containerRef })\n const isMobile = !breakpoints.includes('small')\n\n // Helper to get employee full name\n const getEmployeeFullName = (emp: EmployeeBreakdownItem) =>\n `${emp.employeeFirstName || ''} ${emp.employeeLastName || ''}`.trim()\n\n const getTotalChildSupport = () =>\n (receiptData.employeeCompensations || []).reduce(\n (sum, emp) => sum + parseFloat(emp.childSupportGarnishment || '0'),\n 0,\n )\n\n const getTotalReimbursements = () =>\n (receiptData.employeeCompensations || []).reduce(\n (sum, emp) => sum + parseFloat(emp.totalReimbursement || '0'),\n 0,\n )\n\n const getTotalNetPay = () =>\n (receiptData.employeeCompensations || []).reduce(\n (sum, emp) => sum + parseFloat(emp.netPay || '0'),\n 0,\n )\n\n const getTotalTaxes = () =>\n (receiptData.employeeCompensations || []).reduce(\n (sum, emp) => sum + parseFloat(emp.totalTax || '0'),\n 0,\n )\n\n const breakdownData = [\n {\n label: t('breakdown.directDeposits'),\n amount: parseFloat(receiptData.totals?.netPayDebit || '0'),\n },\n ...(withReimbursements\n ? [\n {\n label: t('breakdown.reimbursements'),\n amount: parseFloat(receiptData.totals?.reimbursementDebit || '0'),\n },\n ]\n : []),\n {\n label: t('breakdown.garnishments'),\n amount: parseFloat(receiptData.totals?.childSupportDebit || '0'),\n },\n { label: t('breakdown.taxes'), amount: parseFloat(receiptData.totals?.taxDebit || '0') },\n ]\n\n const receiptDetailsConfig = [\n {\n label: t('receipt.receiptId'),\n value: receiptData.payrollUuid || '',\n },\n {\n label: t('receipt.from'),\n value: receiptData.nameOfSender || '',\n },\n {\n label: t('receipt.to'),\n value: receiptData.nameOfRecipient || 'Payroll Recipients',\n },\n {\n label: t('receipt.debitDate'),\n value: receiptData.debitDate || '',\n },\n ]\n\n const renderReceiptHeader = () => (\n <div className={classNames(styles.receiptHeader, isMobile && styles.receiptHeaderMobile)}>\n <Flex flexDirection=\"column\" gap={24}>\n <Flex flexDirection=\"column\" alignItems=\"center\" gap={16}>\n <div className={styles.receiptIcon}>\n <ReceiptCheck className={styles.checkmarkIcon} />\n </div>\n\n <Flex flexDirection=\"column\" alignItems=\"center\" gap={8}>\n <Text size=\"sm\" variant=\"supporting\">\n {t('receipt.totalLabel')}\n </Text>\n <Heading as=\"h1\" styledAs=\"h2\" className={styles.totalAmount}>\n {formatNumberAsCurrency(parseFloat(receiptData.totals?.companyDebit || '0'))}\n </Heading>\n </Flex>\n </Flex>\n\n <Components.DescriptionList\n layout=\"horizontal\"\n showSeparators={false}\n items={receiptDetailsConfig.map(\n ({ label, value }): DescriptionListItem => ({\n term: (\n <Text size=\"sm\" variant=\"supporting\">\n {label}\n </Text>\n ),\n description: <Text size=\"sm\">{value}</Text>,\n }),\n )}\n />\n\n <Flex flexDirection=\"column\" alignItems=\"center\" gap={12}>\n <Text\n size=\"sm\"\n variant=\"supporting\"\n className={classNames(styles.disclaimer, isMobile && styles.textMobile)}\n >\n {receiptData.recipientNotice}\n </Text>\n\n <Text\n size=\"sm\"\n variant=\"supporting\"\n className={classNames(styles.companyInfo, isMobile && styles.textMobile)}\n >\n {receiptData.license}\n </Text>\n\n <Text\n size=\"sm\"\n variant=\"supporting\"\n className={classNames(styles.address, isMobile && styles.textMobile)}\n >\n {receiptData.licensee &&\n `${receiptData.licensee.address || ''}, ${receiptData.licensee.city || ''}, ${receiptData.licensee.state || ''} ${receiptData.licensee.postalCode || ''}`}\n </Text>\n </Flex>\n </Flex>\n </div>\n )\n\n const renderBreakdownSection = () => (\n <Flex flexDirection=\"column\" gap={16}>\n <DataTable\n label={t('sections.debitedLabel')}\n columns={[\n {\n title: t('sections.debitedLabel'),\n render: (item: { label: string; amount: number }) => item.label,\n },\n {\n title: t('breakdown.amount'),\n render: (item: { label: string; amount: number }) =>\n formatNumberAsCurrency(item.amount),\n },\n ]}\n data={breakdownData}\n footer={() => ({\n 'column-0': t('breakdown.totals'),\n 'column-1': formatNumberAsCurrency(parseFloat(receiptData.totals?.companyDebit || '0')),\n })}\n />\n </Flex>\n )\n\n const renderTaxBreakdown = () => (\n <Flex flexDirection=\"column\" gap={16}>\n <DataTable\n label={t('sections.taxLabel')}\n columns={[\n {\n title: t('sections.taxLabel'),\n render: (tax: TaxBreakdownItem) => tax.name,\n },\n {\n title: t('tax.amount'),\n render: (tax: TaxBreakdownItem) =>\n formatNumberAsCurrency(parseFloat(tax.amount || '0')),\n },\n ]}\n data={receiptData.taxes || []}\n footer={() => ({\n 'column-0': t('breakdown.totals'),\n 'column-1': formatNumberAsCurrency(parseFloat(receiptData.totals?.taxDebit || '0')),\n })}\n />\n </Flex>\n )\n\n const renderEmployeeBreakdown = () => {\n const footerValues = [\n <Flex flexDirection=\"column\" gap={4} key=\"totals\">\n {t('breakdown.totals')}\n <Text size=\"sm\" variant=\"supporting\">\n {t('employee.totalEmployees', {\n count: receiptData.employeeCompensations?.length || 0,\n })}\n </Text>\n </Flex>,\n '\\u00A0',\n\n formatNumberAsCurrency(getTotalChildSupport()),\n ...(withReimbursements ? [formatNumberAsCurrency(getTotalReimbursements())] : []),\n formatNumberAsCurrency(getTotalTaxes()),\n formatNumberAsCurrency(getTotalNetPay()),\n ]\n\n const footerContent = footerValues.reduce<Record<string, React.ReactNode>>(\n (acc, value, index) => {\n acc[`column-${index}`] = value\n return acc\n },\n {},\n )\n\n return (\n <Flex flexDirection=\"column\" gap={16}>\n {isMobile && <Heading as=\"h2\">{t('sections.employeesLabel')}</Heading>}\n <DataView\n label={t('sections.employeesLabel')}\n columns={[\n {\n title: t('employee.name'),\n render: (employee: EmployeeBreakdownItem) => getEmployeeFullName(employee),\n },\n {\n title: t('employee.paymentMethod'),\n render: (employee: EmployeeBreakdownItem) => employee.paymentMethod || 'N/A',\n },\n {\n title: t('employee.childSupport'),\n render: (employee: EmployeeBreakdownItem) =>\n formatNumberAsCurrency(parseFloat(employee.childSupportGarnishment || '0')),\n },\n ...(withReimbursements\n ? [\n {\n title: t('employee.reimbursement'),\n render: (employee: EmployeeBreakdownItem) =>\n formatNumberAsCurrency(parseFloat(employee.totalReimbursement || '0')),\n },\n ]\n : []),\n {\n title: t('employee.totalTaxes'),\n render: (employee: EmployeeBreakdownItem) =>\n formatNumberAsCurrency(parseFloat(employee.totalTax || '0')),\n },\n {\n title: t('employee.netPay'),\n render: (employee: EmployeeBreakdownItem) =>\n formatNumberAsCurrency(parseFloat(employee.netPay || '0')),\n },\n ]}\n data={receiptData.employeeCompensations || []}\n footer={() => footerContent}\n />\n </Flex>\n )\n }\n\n return (\n <div className={styles.container} ref={containerRef}>\n <Flex flexDirection=\"column\" gap={24}>\n {renderReceiptHeader()}\n {renderBreakdownSection()}\n {renderTaxBreakdown()}\n {renderEmployeeBreakdown()}\n </Flex>\n </div>\n )\n}\n"],"names":["PayrollReceiptsPresentation","receiptData","withReimbursements","Components","useComponentContext","Heading","Text","useI18n","t","useTranslation","containerRef","useRef","isMobile","useContainerBreakpoints","getEmployeeFullName","emp","getTotalChildSupport","sum","getTotalReimbursements","getTotalNetPay","getTotalTaxes","breakdownData","receiptDetailsConfig","renderReceiptHeader","jsx","classNames","styles","jsxs","Flex","ReceiptCheck","formatNumberAsCurrency","label","value","renderBreakdownSection","DataTable","item","renderTaxBreakdown","tax","renderEmployeeBreakdown","footerContent","acc","index","DataView","employee"],"mappings":";;;;;;;;;;;;;AAsBO,MAAMA,IAA8B,CAAC;AAAA,EAC1C,aAAAC;AAAA,EACA,oBAAAC,IAAqB;AACvB,MAAwC;AACtC,QAAMC,IAAaC,EAAA,GACb,EAAE,SAAAC,GAAS,MAAAC,EAAA,IAASH;AAC1B,EAAAI,EAAQ,yBAAyB;AACjC,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,yBAAyB,GAEhDC,IAAeC,EAAuB,IAAI,GAE1CC,IAAW,CADGC,EAAwB,EAAE,KAAKH,GAAc,EACnC,SAAS,OAAO,GAGxCI,IAAsB,CAACC,MAC3B,GAAGA,EAAI,qBAAqB,EAAE,IAAIA,EAAI,oBAAoB,EAAE,GAAG,KAAA,GAE3DC,IAAuB,OAC1Bf,EAAY,yBAAyB,CAAA,GAAI;AAAA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AA,UAC3C,QAAQ,MAAMsC;AAAA,QAAA;AAAA,MAAA;AAAA,IAChB,GACF;AAAA,EAEJ;AAEA,SACE,gBAAAf,EAAC,OAAA,EAAI,WAAWE,EAAO,WAAW,KAAKhB,GACrC,UAAA,gBAAAiB,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAC/B,UAAA;AAAA,IAAAL,EAAA;AAAA,IACAU,EAAA;AAAA,IACAG,EAAA;AAAA,IACAE,EAAA;AAAA,EAAwB,EAAA,CAC3B,EAAA,CACF;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"PayrollReceiptsPresentation.js","sources":["../../../../src/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.tsx"],"sourcesContent":["import { useRef } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport classNames from 'classnames'\nimport type {\n PayrollReceipt,\n Taxes as TaxBreakdownItem,\n PayrollReceiptEmployeeCompensations as EmployeeBreakdownItem,\n} from '@gusto/embedded-api-v-2025-11-15/models/components/payrollreceipt'\nimport styles from './PayrollReceiptsPresentation.module.scss'\nimport { DataView, DataTable, Flex } from '@/components/Common'\nimport type { DescriptionListItem } from '@/components/Common/UI/DescriptionList/DescriptionListTypes'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { formatNumberAsCurrency } from '@/helpers/formattedStrings'\nimport { useI18n } from '@/i18n'\nimport { useContainerBreakpoints } from '@/hooks/useContainerBreakpoints/useContainerBreakpoints'\nimport ReceiptCheck from '@/assets/icons/receipt-check.svg?react'\n\ninterface PayrollReceiptsPresentationProps {\n receiptData: PayrollReceipt\n withReimbursements?: boolean\n}\n\n/** @internal */\nexport const PayrollReceiptsPresentation = ({\n receiptData,\n withReimbursements = true,\n}: PayrollReceiptsPresentationProps) => {\n const Components = useComponentContext()\n const { Heading, Text } = Components\n useI18n('Payroll.PayrollReceipts')\n const { t } = useTranslation('Payroll.PayrollReceipts')\n\n const containerRef = useRef<HTMLDivElement>(null)\n const breakpoints = useContainerBreakpoints({ ref: containerRef })\n const isMobile = !breakpoints.includes('small')\n\n // Helper to get employee full name\n const getEmployeeFullName = (emp: EmployeeBreakdownItem) =>\n `${emp.employeeFirstName || ''} ${emp.employeeLastName || ''}`.trim()\n\n const getTotalChildSupport = () =>\n (receiptData.employeeCompensations || []).reduce(\n (sum, emp) => sum + parseFloat(emp.childSupportGarnishment || '0'),\n 0,\n )\n\n const getTotalReimbursements = () =>\n (receiptData.employeeCompensations || []).reduce(\n (sum, emp) => sum + parseFloat(emp.totalReimbursement || '0'),\n 0,\n )\n\n const getTotalNetPay = () =>\n (receiptData.employeeCompensations || []).reduce(\n (sum, emp) => sum + parseFloat(emp.netPay || '0'),\n 0,\n )\n\n const getTotalTaxes = () =>\n (receiptData.employeeCompensations || []).reduce(\n (sum, emp) => sum + parseFloat(emp.totalTax || '0'),\n 0,\n )\n\n const breakdownData = [\n {\n label: t('breakdown.directDeposits'),\n amount: parseFloat(receiptData.totals?.netPayDebit || '0'),\n },\n ...(withReimbursements\n ? [\n {\n label: t('breakdown.reimbursements'),\n amount: parseFloat(receiptData.totals?.reimbursementDebit || '0'),\n },\n ]\n : []),\n {\n label: t('breakdown.garnishments'),\n amount: parseFloat(receiptData.totals?.childSupportDebit || '0'),\n },\n { label: t('breakdown.taxes'), amount: parseFloat(receiptData.totals?.taxDebit || '0') },\n ]\n\n const receiptDetailsConfig = [\n {\n label: t('receipt.receiptId'),\n value: receiptData.payrollUuid || '',\n },\n {\n label: t('receipt.from'),\n value: receiptData.nameOfSender || '',\n },\n {\n label: t('receipt.to'),\n value: receiptData.nameOfRecipient || 'Payroll Recipients',\n },\n {\n label: t('receipt.debitDate'),\n value: receiptData.debitDate || '',\n },\n ]\n\n const renderReceiptHeader = () => (\n <div className={classNames(styles.receiptHeader, isMobile && styles.receiptHeaderMobile)}>\n <Flex flexDirection=\"column\" gap={24}>\n <Flex flexDirection=\"column\" alignItems=\"center\" gap={16}>\n <div className={styles.receiptIcon}>\n <ReceiptCheck className={styles.checkmarkIcon} />\n </div>\n\n <Flex flexDirection=\"column\" alignItems=\"center\" gap={8}>\n <Text size=\"sm\" variant=\"supporting\">\n {t('receipt.totalLabel')}\n </Text>\n <Heading as=\"h1\" styledAs=\"h2\" className={styles.totalAmount}>\n {formatNumberAsCurrency(parseFloat(receiptData.totals?.companyDebit || '0'))}\n </Heading>\n </Flex>\n </Flex>\n\n <Components.DescriptionList\n layout=\"horizontal\"\n showSeparators={false}\n items={receiptDetailsConfig.map(\n ({ label, value }): DescriptionListItem => ({\n term: (\n <Text size=\"sm\" variant=\"supporting\">\n {label}\n </Text>\n ),\n description: <Text size=\"sm\">{value}</Text>,\n }),\n )}\n />\n\n <Flex flexDirection=\"column\" alignItems=\"center\" gap={12}>\n <Text\n size=\"sm\"\n variant=\"supporting\"\n className={classNames(styles.disclaimer, isMobile && styles.textMobile)}\n >\n {receiptData.recipientNotice}\n </Text>\n\n <Text\n size=\"sm\"\n variant=\"supporting\"\n className={classNames(styles.companyInfo, isMobile && styles.textMobile)}\n >\n {receiptData.license}\n </Text>\n\n <Text\n size=\"sm\"\n variant=\"supporting\"\n className={classNames(styles.address, isMobile && styles.textMobile)}\n >\n {receiptData.licensee &&\n `${receiptData.licensee.address || ''}, ${receiptData.licensee.city || ''}, ${receiptData.licensee.state || ''} ${receiptData.licensee.postalCode || ''}`}\n </Text>\n </Flex>\n </Flex>\n </div>\n )\n\n const renderBreakdownSection = () => (\n <Flex flexDirection=\"column\" gap={16}>\n <DataTable\n label={t('sections.debitedLabel')}\n columns={[\n {\n title: t('sections.debitedLabel'),\n render: (item: { label: string; amount: number }) => item.label,\n },\n {\n title: t('breakdown.amount'),\n render: (item: { label: string; amount: number }) =>\n formatNumberAsCurrency(item.amount),\n },\n ]}\n data={breakdownData}\n footer={() => ({\n 'column-0': t('breakdown.totals'),\n 'column-1': formatNumberAsCurrency(parseFloat(receiptData.totals?.companyDebit || '0')),\n })}\n />\n </Flex>\n )\n\n const renderTaxBreakdown = () => (\n <Flex flexDirection=\"column\" gap={16}>\n <DataTable\n label={t('sections.taxLabel')}\n columns={[\n {\n title: t('sections.taxLabel'),\n render: (tax: TaxBreakdownItem) => tax.name,\n },\n {\n title: t('tax.amount'),\n render: (tax: TaxBreakdownItem) =>\n formatNumberAsCurrency(parseFloat(tax.amount || '0')),\n },\n ]}\n data={receiptData.taxes || []}\n footer={() => ({\n 'column-0': t('breakdown.totals'),\n 'column-1': formatNumberAsCurrency(parseFloat(receiptData.totals?.taxDebit || '0')),\n })}\n />\n </Flex>\n )\n\n const renderEmployeeBreakdown = () => {\n const footerValues = [\n <Flex flexDirection=\"column\" gap={4} key=\"totals\">\n {t('breakdown.totals')}\n <Text size=\"sm\" variant=\"supporting\">\n {t('employee.totalEmployees', {\n count: receiptData.employeeCompensations?.length || 0,\n })}\n </Text>\n </Flex>,\n '\\u00A0',\n\n formatNumberAsCurrency(getTotalChildSupport()),\n ...(withReimbursements ? [formatNumberAsCurrency(getTotalReimbursements())] : []),\n formatNumberAsCurrency(getTotalTaxes()),\n formatNumberAsCurrency(getTotalNetPay()),\n ]\n\n const footerContent = footerValues.reduce<Record<string, React.ReactNode>>(\n (acc, value, index) => {\n acc[`column-${index}`] = value\n return acc\n },\n {},\n )\n\n return (\n <Flex flexDirection=\"column\" gap={16}>\n {isMobile && <Heading as=\"h2\">{t('sections.employeesLabel')}</Heading>}\n <DataView\n label={t('sections.employeesLabel')}\n columns={[\n {\n title: t('employee.name'),\n render: (employee: EmployeeBreakdownItem) => getEmployeeFullName(employee),\n },\n {\n title: t('employee.paymentMethod'),\n render: (employee: EmployeeBreakdownItem) => employee.paymentMethod || 'N/A',\n },\n {\n title: t('employee.childSupport'),\n render: (employee: EmployeeBreakdownItem) =>\n formatNumberAsCurrency(parseFloat(employee.childSupportGarnishment || '0')),\n },\n ...(withReimbursements\n ? [\n {\n title: t('employee.reimbursement'),\n render: (employee: EmployeeBreakdownItem) =>\n formatNumberAsCurrency(parseFloat(employee.totalReimbursement || '0')),\n },\n ]\n : []),\n {\n title: t('employee.totalTaxes'),\n render: (employee: EmployeeBreakdownItem) =>\n formatNumberAsCurrency(parseFloat(employee.totalTax || '0')),\n },\n {\n title: t('employee.netPay'),\n render: (employee: EmployeeBreakdownItem) =>\n formatNumberAsCurrency(parseFloat(employee.netPay || '0')),\n },\n ]}\n data={receiptData.employeeCompensations || []}\n footer={() => footerContent}\n />\n </Flex>\n )\n }\n\n return (\n <div className={styles.container} ref={containerRef}>\n <Flex flexDirection=\"column\" gap={24}>\n {renderReceiptHeader()}\n {renderBreakdownSection()}\n {renderTaxBreakdown()}\n {renderEmployeeBreakdown()}\n </Flex>\n </div>\n )\n}\n"],"names":["PayrollReceiptsPresentation","receiptData","withReimbursements","Components","useComponentContext","Heading","Text","useI18n","t","useTranslation","containerRef","useRef","isMobile","useContainerBreakpoints","getEmployeeFullName","emp","getTotalChildSupport","sum","getTotalReimbursements","getTotalNetPay","getTotalTaxes","breakdownData","receiptDetailsConfig","renderReceiptHeader","jsx","classNames","styles","jsxs","Flex","ReceiptCheck","formatNumberAsCurrency","label","value","renderBreakdownSection","DataTable","item","renderTaxBreakdown","tax","renderEmployeeBreakdown","footerContent","acc","index","DataView","employee"],"mappings":";;;;;;;;;;;;;AAuBO,MAAMA,IAA8B,CAAC;AAAA,EAC1C,aAAAC;AAAA,EACA,oBAAAC,IAAqB;AACvB,MAAwC;AACtC,QAAMC,IAAaC,EAAA,GACb,EAAE,SAAAC,GAAS,MAAAC,EAAA,IAASH;AAC1B,EAAAI,EAAQ,yBAAyB;AACjC,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,yBAAyB,GAEhDC,IAAeC,EAAuB,IAAI,GAE1CC,IAAW,CADGC,EAAwB,EAAE,KAAKH,GAAc,EACnC,SAAS,OAAO,GAGxCI,IAAsB,CAACC,MAC3B,GAAGA,EAAI,qBAAqB,EAAE,IAAIA,EAAI,oBAAoB,EAAE,GAAG,KAAA,GAE3DC,IAAuB,OAC1Bf,EAAY,yBAAyB,CA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AAyB,CAAA;AAAA,UAC3C,QAAQ,MAAMsC;AAAA,QAAA;AAAA,MAAA;AAAA,IAChB,GACF;AAAA,EAEJ;AAEA,SACE,gBAAAf,EAAC,OAAA,EAAI,WAAWE,EAAO,WAAW,KAAKhB,GACrC,UAAA,gBAAAiB,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAC/B,UAAA;AAAA,IAAAL,EAAA;AAAA,IACAU,EAAA;AAAA,IACAG,EAAA;AAAA,IACAE,EAAA;AAAA,EAAwB,EAAA,CAC3B,EAAA,CACF;AAEJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PayrollStatusBadges.js","sources":["../../../../src/components/Payroll/PayrollStatusBadges/PayrollStatusBadges.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type {\n PayrollInput,\n WireInRequestInput,\n PayrollStatusTranslationKey,\n} from './payrollStatusConfig'\nimport { usePayrollStatusBadges } from './usePayrollStatusBadges'\nimport styles from './PayrollStatusBadges.module.scss'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\n\ninterface PayrollStatusBadgesProps {\n payroll: PayrollInput\n wireInRequest?: WireInRequestInput\n}\n\nexport const PayrollStatusBadges = ({ payroll, wireInRequest }: PayrollStatusBadgesProps) => {\n const { Badge } = useComponentContext()\n useI18n('Payroll.Common')\n const { t } = useTranslation('Payroll.Common')\n\n const { badges } = usePayrollStatusBadges(payroll, wireInRequest)\n\n const translateStatus = (\n translationKey: PayrollStatusTranslationKey,\n params?: Record<string, string | number>,\n ) => {\n const options = { ...params }\n\n if (params?.hours !== undefined) {\n options.count = params.hours\n } else if (params?.days !== undefined) {\n options.count = params.days\n }\n\n return t(`status.${translationKey}`, options)\n }\n\n return (\n <div className={styles.statusCell}>\n <div className={styles.badges}>\n {badges.map(badge => (\n <span key={badge.translationKey}>\n <Badge status={badge.variant}>\n {translateStatus(badge.translationKey, badge.translationParams)}\n </Badge>\n </span>\n ))}\n </div>\n </div>\n )\n}\n"],"names":["PayrollStatusBadges","payroll","wireInRequest","Badge","useComponentContext","useI18n","t","useTranslation","badges","usePayrollStatusBadges","translateStatus","translationKey","params","options","jsx","styles","badge"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"PayrollStatusBadges.js","sources":["../../../../src/components/Payroll/PayrollStatusBadges/PayrollStatusBadges.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type {\n PayrollInput,\n WireInRequestInput,\n PayrollStatusTranslationKey,\n} from './payrollStatusConfig'\nimport { usePayrollStatusBadges } from './usePayrollStatusBadges'\nimport styles from './PayrollStatusBadges.module.scss'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\n\ninterface PayrollStatusBadgesProps {\n payroll: PayrollInput\n wireInRequest?: WireInRequestInput\n}\n\n/** @internal */\nexport const PayrollStatusBadges = ({ payroll, wireInRequest }: PayrollStatusBadgesProps) => {\n const { Badge } = useComponentContext()\n useI18n('Payroll.Common')\n const { t } = useTranslation('Payroll.Common')\n\n const { badges } = usePayrollStatusBadges(payroll, wireInRequest)\n\n const translateStatus = (\n translationKey: PayrollStatusTranslationKey,\n params?: Record<string, string | number>,\n ) => {\n const options = { ...params }\n\n if (params?.hours !== undefined) {\n options.count = params.hours\n } else if (params?.days !== undefined) {\n options.count = params.days\n }\n\n return t(`status.${translationKey}`, options)\n }\n\n return (\n <div className={styles.statusCell}>\n <div className={styles.badges}>\n {badges.map(badge => (\n <span key={badge.translationKey}>\n <Badge status={badge.variant}>\n {translateStatus(badge.translationKey, badge.translationParams)}\n </Badge>\n </span>\n ))}\n </div>\n </div>\n )\n}\n"],"names":["PayrollStatusBadges","payroll","wireInRequest","Badge","useComponentContext","useI18n","t","useTranslation","badges","usePayrollStatusBadges","translateStatus","translationKey","params","options","jsx","styles","badge"],"mappings":";;;;;;AAiBO,MAAMA,IAAsB,CAAC,EAAE,SAAAC,GAAS,eAAAC,QAA8C;AAC3F,QAAM,EAAE,OAAAC,EAAA,IAAUC,EAAA;AAClB,EAAAC,EAAQ,gBAAgB;AACxB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,gBAAgB,GAEvC,EAAE,QAAAC,EAAA,IAAWC,EAAuBR,GAASC,CAAa,GAE1DQ,IAAkB,CACtBC,GACAC,MACG;AACH,UAAMC,IAAU,EAAE,GAAGD,EAAA;AAErB,WAAIA,GAAQ,UAAU,SACpBC,EAAQ,QAAQD,EAAO,QACdA,GAAQ,SAAS,WAC1BC,EAAQ,QAAQD,EAAO,OAGlBN,EAAE,UAAUK,CAAc,IAAIE,CAAO;AAAA,EAC9C;AAEA,SACE,gBAAAC,EAAC,OAAA,EAAI,WAAWC,EAAO,YACrB,UAAA,gBAAAD,EAAC,OAAA,EAAI,WAAWC,EAAO,QACpB,UAAAP,EAAO,IAAI,OACV,gBAAAM,EAAC,QAAA,EACC,UAAA,gBAAAA,EAACX,GAAA,EAAM,QAAQa,EAAM,SAClB,UAAAN,EAAgBM,EAAM,gBAAgBA,EAAM,iBAAiB,EAAA,CAChE,EAAA,GAHSA,EAAM,cAIjB,CACD,GACH,GACF;AAEJ;"}
|
|
@@ -1,4 +1,2 @@
|
|
|
1
1
|
import "./types/i18next.d.ts"
|
|
2
2
|
export { PayrollStatusBadges } from './PayrollStatusBadges';
|
|
3
|
-
export { usePayrollStatusBadges, getPayrollStatusBadges } from './usePayrollStatusBadges';
|
|
4
|
-
export type { PayrollStatusBadge, PayrollStatusBadges as PayrollStatusBadgesResult, PayrollInput, WireInRequestInput, } from './payrollStatusConfig';
|
|
@@ -1,33 +1,59 @@
|
|
|
1
1
|
import { PayrollProcessingRequestStatus } from '@gusto/embedded-api-v-2025-11-15/models/components/payrollprocessingrequest';
|
|
2
|
+
/** @internal */
|
|
2
3
|
export type PayrollStatusTranslationKey = 'processed' | 'unprocessed' | 'calculating' | 'readyToSubmit' | 'processing' | 'failed' | 'waitingForWireIn' | 'pendingApproval' | 'dueInHours' | 'dueInDays' | 'daysLate' | 'pending' | 'paid' | 'complete' | 'submitted' | 'inProgress';
|
|
4
|
+
/** @internal */
|
|
3
5
|
export type PayrollStatusBadge = {
|
|
6
|
+
/** Optional pre-translated label; when omitted the consumer translates `translationKey`. */
|
|
4
7
|
label?: string;
|
|
8
|
+
/** Badge color variant. */
|
|
5
9
|
variant: 'success' | 'warning' | 'error' | 'info';
|
|
10
|
+
/** Key into the `Payroll.Common` `status.*` translation namespace. */
|
|
6
11
|
translationKey: PayrollStatusTranslationKey;
|
|
12
|
+
/** Optional interpolation values for the translation (e.g. `{ hours: 3 }`). */
|
|
7
13
|
translationParams?: Record<string, string | number>;
|
|
8
14
|
};
|
|
15
|
+
/** @internal */
|
|
9
16
|
export type PayrollStatusBadges = {
|
|
17
|
+
/** Ordered list of badges to render for a payroll row. */
|
|
10
18
|
badges: PayrollStatusBadge[];
|
|
11
19
|
};
|
|
20
|
+
/** @internal */
|
|
12
21
|
export type PayrollInput = {
|
|
22
|
+
/** Whether the payroll has been submitted for processing. */
|
|
13
23
|
processed?: boolean;
|
|
24
|
+
/** Date employees are paid; used to distinguish `pending` from `complete`. */
|
|
14
25
|
checkDate?: string | null | Date;
|
|
26
|
+
/** Deadline by which the payroll must be submitted. */
|
|
15
27
|
payrollDeadline?: string | null | Date;
|
|
28
|
+
/** Timestamp marking when calculation finished. */
|
|
16
29
|
calculatedAt?: Date | null;
|
|
30
|
+
/** Current processing request status and any associated errors. */
|
|
17
31
|
processingRequest?: {
|
|
32
|
+
/** Lifecycle status reported by the payroll processing request. */
|
|
18
33
|
status?: PayrollProcessingRequestStatus;
|
|
34
|
+
/** Errors surfaced by the processing request, when any. */
|
|
19
35
|
errors?: unknown[];
|
|
20
36
|
} | null;
|
|
21
37
|
};
|
|
38
|
+
/** @internal */
|
|
22
39
|
export type WireInRequestInput = {
|
|
40
|
+
/** Wire-in request lifecycle status (e.g. awaiting funds, pending review). */
|
|
23
41
|
status?: string;
|
|
42
|
+
/** UUID of the associated payment. */
|
|
24
43
|
paymentUuid?: string;
|
|
44
|
+
/** Deadline by which the wire must be received. */
|
|
25
45
|
wireInDeadline?: string;
|
|
26
46
|
} | null;
|
|
47
|
+
/** @internal */
|
|
27
48
|
export type StatusConfig = {
|
|
49
|
+
/** Identifier for the status rule; used for debugging and snapshot diffs. */
|
|
28
50
|
name: string;
|
|
51
|
+
/** Either a static badge or a factory that derives one from the payroll/wire-in inputs. */
|
|
29
52
|
badge: PayrollStatusBadge | ((payroll: PayrollInput, wireInRequest?: WireInRequestInput) => PayrollStatusBadge);
|
|
53
|
+
/** Predicate that decides whether this status applies to the given inputs. */
|
|
30
54
|
condition: (payroll: PayrollInput, wireInRequest?: WireInRequestInput) => boolean;
|
|
55
|
+
/** When true, evaluation continues to later rules instead of stopping at the first match. */
|
|
31
56
|
continueChecking?: boolean;
|
|
32
57
|
};
|
|
58
|
+
/** @internal */
|
|
33
59
|
export declare const STATUS_CONFIG: StatusConfig[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payrollStatusConfig.js","sources":["../../../../src/components/Payroll/PayrollStatusBadges/payrollStatusConfig.ts"],"sourcesContent":["import { PayrollProcessingRequestStatus } from '@gusto/embedded-api-v-2025-11-15/models/components/payrollprocessingrequest'\nimport { WireInRequestStatus } from '@gusto/embedded-api-v-2025-11-15/models/components/wireinrequest'\nimport { normalizeToDate, getHoursUntil, getDaysUntil } from '@/helpers/dateFormatting'\n\nexport type PayrollStatusTranslationKey =\n | 'processed'\n | 'unprocessed'\n | 'calculating'\n | 'readyToSubmit'\n | 'processing'\n | 'failed'\n | 'waitingForWireIn'\n | 'pendingApproval'\n | 'dueInHours'\n | 'dueInDays'\n | 'daysLate'\n | 'pending'\n | 'paid'\n | 'complete'\n | 'submitted'\n | 'inProgress'\n\nexport type PayrollStatusBadge = {\n label?: string\n variant: 'success' | 'warning' | 'error' | 'info'\n translationKey: PayrollStatusTranslationKey\n translationParams?: Record<string, string | number>\n}\n\nexport type PayrollStatusBadges = {\n badges: PayrollStatusBadge[]\n}\n\nexport type PayrollInput = {\n processed?: boolean\n checkDate?: string | null | Date\n payrollDeadline?: string | null | Date\n calculatedAt?: Date | null\n processingRequest?: {\n status?: PayrollProcessingRequestStatus\n errors?: unknown[]\n } | null\n}\n\nexport type WireInRequestInput = {\n status?: string\n paymentUuid?: string\n wireInDeadline?: string\n} | null\n\nexport type StatusConfig = {\n name: string\n badge:\n | PayrollStatusBadge\n | ((payroll: PayrollInput, wireInRequest?: WireInRequestInput) => PayrollStatusBadge)\n condition: (payroll: PayrollInput, wireInRequest?: WireInRequestInput) => boolean\n continueChecking?: boolean\n}\n\nconst ACTIVE_PROCESSING_STATUSES: PayrollProcessingRequestStatus[] = [\n PayrollProcessingRequestStatus.Calculating,\n PayrollProcessingRequestStatus.Submitting,\n PayrollProcessingRequestStatus.ProcessingFailed,\n]\n\nexport const STATUS_CONFIG: StatusConfig[] = [\n {\n name: 'calculating',\n badge: {\n variant: 'info',\n translationKey: 'calculating',\n },\n condition: payroll =>\n payroll.processingRequest?.status === PayrollProcessingRequestStatus.Calculating,\n },\n {\n name: 'readyToSubmit',\n badge: {\n variant: 'info',\n translationKey: 'readyToSubmit',\n },\n condition: payroll =>\n payroll.processingRequest?.status === PayrollProcessingRequestStatus.CalculateSuccess &&\n !!payroll.calculatedAt,\n },\n {\n name: 'processing',\n badge: {\n variant: 'warning',\n translationKey: 'processing',\n },\n condition: payroll =>\n payroll.processingRequest?.status === PayrollProcessingRequestStatus.Submitting,\n continueChecking: true,\n },\n {\n name: 'failed',\n badge: {\n variant: 'error',\n translationKey: 'failed',\n },\n condition: payroll =>\n payroll.processingRequest?.status === PayrollProcessingRequestStatus.ProcessingFailed,\n continueChecking: true,\n },\n {\n name: 'late',\n badge: payroll => {\n const daysDiff = getDaysUntil(payroll.payrollDeadline)\n if (daysDiff === null) {\n return {\n variant: 'error',\n translationKey: 'daysLate',\n translationParams: { days: 0 },\n }\n }\n\n const daysPast = Math.abs(Math.floor(daysDiff))\n\n return {\n variant: 'error',\n translationKey: 'daysLate',\n translationParams: { days: daysPast },\n }\n },\n condition: payroll => {\n if (!payroll.payrollDeadline || payroll.processed) return false\n\n const hoursDiff = getHoursUntil(payroll.payrollDeadline)\n if (hoursDiff === null) return false\n\n return hoursDiff < 0\n },\n },\n {\n name: 'readyToSubmitFallback',\n badge: {\n variant: 'info',\n translationKey: 'readyToSubmit',\n },\n condition: payroll => !!payroll.calculatedAt && !payroll.processed,\n },\n {\n name: 'waitingForWireIn',\n badge: {\n variant: 'warning',\n translationKey: 'waitingForWireIn',\n },\n condition: (payroll, wireInRequest) =>\n !!payroll.processed && wireInRequest?.status === WireInRequestStatus.AwaitingFunds,\n },\n {\n name: 'pendingApproval',\n badge: {\n variant: 'warning',\n translationKey: 'pendingApproval',\n },\n condition: (payroll, wireInRequest) =>\n !!payroll.processed && wireInRequest?.status === WireInRequestStatus.PendingReview,\n },\n {\n name: 'dueInHours',\n badge: payroll => {\n const hoursDiff = getHoursUntil(payroll.payrollDeadline)\n if (hoursDiff === null) {\n return {\n variant: 'warning',\n translationKey: 'dueInHours',\n translationParams: { hours: 0 },\n }\n }\n\n const hours = Math.ceil(hoursDiff)\n\n return {\n variant: 'warning',\n translationKey: 'dueInHours',\n translationParams: { hours },\n }\n },\n condition: payroll => {\n if (!payroll.payrollDeadline || payroll.processed) return false\n\n if (\n payroll.processingRequest?.status &&\n ACTIVE_PROCESSING_STATUSES.includes(payroll.processingRequest.status)\n ) {\n return false\n }\n\n const hoursDiff = getHoursUntil(payroll.payrollDeadline)\n if (hoursDiff === null) return false\n\n return hoursDiff > 0 && hoursDiff < 24\n },\n },\n {\n name: 'dueInDays',\n badge: payroll => {\n const daysDiff = getDaysUntil(payroll.payrollDeadline)\n if (daysDiff === null) {\n return {\n variant: 'info',\n translationKey: 'dueInDays',\n translationParams: { days: 0 },\n }\n }\n\n const days = Math.ceil(daysDiff)\n\n return {\n variant: 'info',\n translationKey: 'dueInDays',\n translationParams: { days },\n }\n },\n condition: payroll => {\n if (!payroll.payrollDeadline || payroll.processed) return false\n\n if (\n payroll.processingRequest?.status &&\n ACTIVE_PROCESSING_STATUSES.includes(payroll.processingRequest.status)\n ) {\n return false\n }\n\n const hoursDiff = getHoursUntil(payroll.payrollDeadline)\n const daysDiff = getDaysUntil(payroll.payrollDeadline)\n if (hoursDiff === null || daysDiff === null) return false\n\n return hoursDiff > 0 && hoursDiff >= 24 && Math.ceil(daysDiff) <= 30\n },\n },\n {\n name: 'paid',\n badge: {\n variant: 'success',\n translationKey: 'complete',\n },\n condition: payroll => {\n if (!payroll.processed) return false\n\n const now = new Date()\n const checkDate = normalizeToDate(payroll.checkDate)\n\n return checkDate !== null && checkDate <= now\n },\n },\n {\n name: 'pending',\n badge: {\n variant: 'info',\n translationKey: 'pending',\n },\n condition: payroll => !!payroll.processed,\n },\n {\n name: 'unprocessed',\n badge: {\n variant: 'info',\n translationKey: 'unprocessed',\n },\n condition: payroll => !payroll.processed && !payroll.processingRequest?.status,\n },\n]\n"],"names":["ACTIVE_PROCESSING_STATUSES","PayrollProcessingRequestStatus","STATUS_CONFIG","payroll","daysDiff","getDaysUntil","hoursDiff","getHoursUntil","wireInRequest","WireInRequestStatus","now","checkDate","normalizeToDate"],"mappings":";;;AA2DA,MAAMA,IAA+D;AAAA,EACnEC,EAA+B;AAAA,EAC/BA,EAA+B;AAAA,EAC/BA,EAA+B;AACjC,GAEaC,IAAgC;AAAA,EAC3C;AAAA,IACE,MAAM;AAAA,IACN,OAAO;AAAA,MACL,SAAS;AAAA,MACT,gBAAgB;AAAA,IAAA;AAAA,IAElB,WAAW,CAAAC,MACTA,EAAQ,mBAAmB,WAAWF,EAA+B;AAAA,EAAA;AAAA,EAEzE;AAAA,IACE,MAAM;AAAA,IACN,OAAO;AAAA,MACL,SAAS;AAAA,MACT,gBAAgB;AAAA,IAAA;AAAA,IAElB,WAAW,OACTE,EAAQ,mBAAmB,WAAWF,EAA+B,oBACrE,CAAC,C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AAW,CAAAD,MAAW;AAGpB,UAFI,CAACA,EAAQ,mBAAmBA,EAAQ,aAGtCA,EAAQ,mBAAmB,UAC3BH,EAA2B,SAASG,EAAQ,kBAAkB,MAAM;AAEpE,eAAO;AAGT,YAAMG,IAAYC,EAAcJ,EAAQ,eAAe,GACjDC,IAAWC,EAAaF,EAAQ,eAAe;AACrD,aAAIG,MAAc,QAAQF,MAAa,OAAa,KAE7CE,IAAY,KAAKA,KAAa,MAAM,KAAK,KAAKF,CAAQ,KAAK;AAAA,IACpE;AAAA,EAAA;AAAA,EAEF;AAAA,IACE,MAAM;AAAA,IACN,OAAO;AAAA,MACL,SAAS;AAAA,MACT,gBAAgB;AAAA,IAAA;AAAA,IAElB,WAAW,CAAAD,MAAW;AACpB,UAAI,CAACA,EAAQ,UAAW,QAAO;AAE/B,YAAMO,wBAAU,KAAA,GACVC,IAAYC,EAAgBT,EAAQ,SAAS;AAEnD,aAAOQ,MAAc,QAAQA,KAAaD;AAAA,IAC5C;AAAA,EAAA;AAAA,EAEF;AAAA,IACE,MAAM;AAAA,IACN,OAAO;AAAA,MACL,SAAS;AAAA,MACT,gBAAgB;AAAA,IAAA;AAAA,IAElB,WAAW,CAAAP,MAAW,CAAC,CAACA,EAAQ;AAAA,EAAA;AAAA,EAElC;AAAA,IACE,MAAM;AAAA,IACN,OAAO;AAAA,MACL,SAAS;AAAA,MACT,gBAAgB;AAAA,IAAA;AAAA,IAElB,WAAW,CAAAA,MAAW,CAACA,EAAQ,aAAa,CAACA,EAAQ,mBAAmB;AAAA,EAAA;AAE5E;"}
|
|
1
|
+
{"version":3,"file":"payrollStatusConfig.js","sources":["../../../../src/components/Payroll/PayrollStatusBadges/payrollStatusConfig.ts"],"sourcesContent":["import { PayrollProcessingRequestStatus } from '@gusto/embedded-api-v-2025-11-15/models/components/payrollprocessingrequest'\nimport { WireInRequestStatus } from '@gusto/embedded-api-v-2025-11-15/models/components/wireinrequest'\nimport { normalizeToDate, getHoursUntil, getDaysUntil } from '@/helpers/dateFormatting'\n\n/** @internal */\nexport type PayrollStatusTranslationKey =\n | 'processed'\n | 'unprocessed'\n | 'calculating'\n | 'readyToSubmit'\n | 'processing'\n | 'failed'\n | 'waitingForWireIn'\n | 'pendingApproval'\n | 'dueInHours'\n | 'dueInDays'\n | 'daysLate'\n | 'pending'\n | 'paid'\n | 'complete'\n | 'submitted'\n | 'inProgress'\n\n/** @internal */\nexport type PayrollStatusBadge = {\n /** Optional pre-translated label; when omitted the consumer translates `translationKey`. */\n label?: string\n /** Badge color variant. */\n variant: 'success' | 'warning' | 'error' | 'info'\n /** Key into the `Payroll.Common` `status.*` translation namespace. */\n translationKey: PayrollStatusTranslationKey\n /** Optional interpolation values for the translation (e.g. `{ hours: 3 }`). */\n translationParams?: Record<string, string | number>\n}\n\n/** @internal */\nexport type PayrollStatusBadges = {\n /** Ordered list of badges to render for a payroll row. */\n badges: PayrollStatusBadge[]\n}\n\n/** @internal */\nexport type PayrollInput = {\n /** Whether the payroll has been submitted for processing. */\n processed?: boolean\n /** Date employees are paid; used to distinguish `pending` from `complete`. */\n checkDate?: string | null | Date\n /** Deadline by which the payroll must be submitted. */\n payrollDeadline?: string | null | Date\n /** Timestamp marking when calculation finished. */\n calculatedAt?: Date | null\n /** Current processing request status and any associated errors. */\n processingRequest?: {\n /** Lifecycle status reported by the payroll processing request. */\n status?: PayrollProcessingRequestStatus\n /** Errors surfaced by the processing request, when any. */\n errors?: unknown[]\n } | null\n}\n\n/** @internal */\nexport type WireInRequestInput = {\n /** Wire-in request lifecycle status (e.g. awaiting funds, pending review). */\n status?: string\n /** UUID of the associated payment. */\n paymentUuid?: string\n /** Deadline by which the wire must be received. */\n wireInDeadline?: string\n} | null\n\n/** @internal */\nexport type StatusConfig = {\n /** Identifier for the status rule; used for debugging and snapshot diffs. */\n name: string\n /** Either a static badge or a factory that derives one from the payroll/wire-in inputs. */\n badge:\n | PayrollStatusBadge\n | ((payroll: PayrollInput, wireInRequest?: WireInRequestInput) => PayrollStatusBadge)\n /** Predicate that decides whether this status applies to the given inputs. */\n condition: (payroll: PayrollInput, wireInRequest?: WireInRequestInput) => boolean\n /** When true, evaluation continues to later rules instead of stopping at the first match. */\n continueChecking?: boolean\n}\n\nconst ACTIVE_PROCESSING_STATUSES: PayrollProcessingRequestStatus[] = [\n PayrollProcessingRequestStatus.Calculating,\n PayrollProcessingRequestStatus.Submitting,\n PayrollProcessingRequestStatus.ProcessingFailed,\n]\n\n/** @internal */\nexport const STATUS_CONFIG: StatusConfig[] = [\n {\n name: 'calculating',\n badge: {\n variant: 'info',\n translationKey: 'calculating',\n },\n condition: payroll =>\n payroll.processingRequest?.status === PayrollProcessingRequestStatus.Calculating,\n },\n {\n name: 'readyToSubmit',\n badge: {\n variant: 'info',\n translationKey: 'readyToSubmit',\n },\n condition: payroll =>\n payroll.processingRequest?.status === PayrollProcessingRequestStatus.CalculateSuccess &&\n !!payroll.calculatedAt,\n },\n {\n name: 'processing',\n badge: {\n variant: 'warning',\n translationKey: 'processing',\n },\n condition: payroll =>\n payroll.processingRequest?.status === PayrollProcessingRequestStatus.Submitting,\n continueChecking: true,\n },\n {\n name: 'failed',\n badge: {\n variant: 'error',\n translationKey: 'failed',\n },\n condition: payroll =>\n payroll.processingRequest?.status === PayrollProcessingRequestStatus.ProcessingFailed,\n continueChecking: true,\n },\n {\n name: 'late',\n badge: payroll => {\n const daysDiff = getDaysUntil(payroll.payrollDeadline)\n if (daysDiff === null) {\n return {\n variant: 'error',\n translationKey: 'daysLate',\n translationParams: { days: 0 },\n }\n }\n\n const daysPast = Math.abs(Math.floor(daysDiff))\n\n return {\n variant: 'error',\n translationKey: 'daysLate',\n translationParams: { days: daysPast },\n }\n },\n condition: payroll => {\n if (!payroll.payrollDeadline || payroll.processed) return false\n\n const hoursDiff = getHoursUntil(payroll.payrollDeadline)\n if (hoursDiff === null) return false\n\n return hoursDiff < 0\n },\n },\n {\n name: 'readyToSubmitFallback',\n badge: {\n variant: 'info',\n translationKey: 'readyToSubmit',\n },\n condition: payroll => !!payroll.calculatedAt && !payroll.processed,\n },\n {\n name: 'waitingForWireIn',\n badge: {\n variant: 'warning',\n translationKey: 'waitingForWireIn',\n },\n condition: (payroll, wireInRequest) =>\n !!payroll.processed && wireInRequest?.status === WireInRequestStatus.AwaitingFunds,\n },\n {\n name: 'pendingApproval',\n badge: {\n variant: 'warning',\n translationKey: 'pendingApproval',\n },\n condition: (payroll, wireInRequest) =>\n !!payroll.processed && wireInRequest?.status === WireInRequestStatus.PendingReview,\n },\n {\n name: 'dueInHours',\n badge: payroll => {\n const hoursDiff = getHoursUntil(payroll.payrollDeadline)\n if (hoursDiff === null) {\n return {\n variant: 'warning',\n translationKey: 'dueInHours',\n translationParams: { hours: 0 },\n }\n }\n\n const hours = Math.ceil(hoursDiff)\n\n return {\n variant: 'warning',\n translationKey: 'dueInHours',\n translationParams: { hours },\n }\n },\n condition: payroll => {\n if (!payroll.payrollDeadline || payroll.processed) return false\n\n if (\n payroll.processingRequest?.status &&\n ACTIVE_PROCESSING_STATUSES.includes(payroll.processingRequest.status)\n ) {\n return false\n }\n\n const hoursDiff = getHoursUntil(payroll.payrollDeadline)\n if (hoursDiff === null) return false\n\n return hoursDiff > 0 && hoursDiff < 24\n },\n },\n {\n name: 'dueInDays',\n badge: payroll => {\n const daysDiff = getDaysUntil(payroll.payrollDeadline)\n if (daysDiff === null) {\n return {\n variant: 'info',\n translationKey: 'dueInDays',\n translationParams: { days: 0 },\n }\n }\n\n const days = Math.ceil(daysDiff)\n\n return {\n variant: 'info',\n translationKey: 'dueInDays',\n translationParams: { days },\n }\n },\n condition: payroll => {\n if (!payroll.payrollDeadline || payroll.processed) return false\n\n if (\n payroll.processingRequest?.status &&\n ACTIVE_PROCESSING_STATUSES.includes(payroll.processingRequest.status)\n ) {\n return false\n }\n\n const hoursDiff = getHoursUntil(payroll.payrollDeadline)\n const daysDiff = getDaysUntil(payroll.payrollDeadline)\n if (hoursDiff === null || daysDiff === null) return false\n\n return hoursDiff > 0 && hoursDiff >= 24 && Math.ceil(daysDiff) <= 30\n },\n },\n {\n name: 'paid',\n badge: {\n variant: 'success',\n translationKey: 'complete',\n },\n condition: payroll => {\n if (!payroll.processed) return false\n\n const now = new Date()\n const checkDate = normalizeToDate(payroll.checkDate)\n\n return checkDate !== null && checkDate <= now\n },\n },\n {\n name: 'pending',\n badge: {\n variant: 'info',\n translationKey: 'pending',\n },\n condition: payroll => !!payroll.processed,\n },\n {\n name: 'unprocessed',\n badge: {\n variant: 'info',\n translationKey: 'unprocessed',\n },\n condition: payroll => !payroll.processed && !payroll.processingRequest?.status,\n },\n]\n"],"names":["ACTIVE_PROCESSING_STATUSES","PayrollProcessingRequestStatus","STATUS_CONFIG","payroll","daysDiff","getDaysUntil","hoursDiff","getHoursUntil","wireInRequest","WireInRequestStatus","now","checkDate","normalizeToDate"],"mappings":";;;AAoFA,MAAMA,IAA+D;AAAA,EACnEC,EAA+B;AAAA,EAC/BA,EAA+B;AAAA,EAC/BA,EAA+B;AACjC,GAGaC,IAAgC;AAAA,EAC3C;AAAA,IACE,MAAM;AAAA,IACN,OAAO;AAAA,MACL,SAAS;AAAA,MACT,gBAAgB;AAAA,IAAA;AAAA,IAElB,WAAW,CAAAC,MACTA,EAAQ,mBAAmB,WAAWF,EAA+B;AAAA,EAAA;AAAA,EAEzE;AAAA,IACE,MAAM;AAAA,IACN,OAAO;AAAA,MACL,SAAS;AAAA,MACT,gBAAgB;AAAA,IAAA;AAAA,IAElB,WAAW,OACTE,EAAQ,mBAAmB,WAAWF,EAA+B,oBACrE,CAAC,CAACE,EAAQ;AAAA,EAAA;AAAA,EAEd;AAAA,IACE,MAAM;AAAA,IACN,OAAO;AAAA,MACL,SAAS;AAAA,MACT,gBAAgB;AAAA,IAAA;AAAA,IAElB,WAAW,CAAAA,MACTA,EAAQ,mBAAmB,WAAWF,EAA+B;AAAA,IACvE,kBAAkB;AAAA,EAAA;AAAA,EAEpB;AAAA,IACE,MAAM;AAAA,IACN,OAAO;AAA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CE,IAAY,KAAKA,KAAa,MAAM,KAAK,KAAKF,CAAQ,KAAK;AAAA,IACpE;AAAA,EAAA;AAAA,EAEF;AAAA,IACE,MAAM;AAAA,IACN,OAAO;AAAA,MACL,SAAS;AAAA,MACT,gBAAgB;AAAA,IAAA;AAAA,IAElB,WAAW,CAAAD,MAAW;AACpB,UAAI,CAACA,EAAQ,UAAW,QAAO;AAE/B,YAAMO,wBAAU,KAAA,GACVC,IAAYC,EAAgBT,EAAQ,SAAS;AAEnD,aAAOQ,MAAc,QAAQA,KAAaD;AAAA,IAC5C;AAAA,EAAA;AAAA,EAEF;AAAA,IACE,MAAM;AAAA,IACN,OAAO;AAAA,MACL,SAAS;AAAA,MACT,gBAAgB;AAAA,IAAA;AAAA,IAElB,WAAW,CAAAP,MAAW,CAAC,CAACA,EAAQ;AAAA,EAAA;AAAA,EAElC;AAAA,IACE,MAAM;AAAA,IACN,OAAO;AAAA,MACL,SAAS;AAAA,MACT,gBAAgB;AAAA,IAAA;AAAA,IAElB,WAAW,CAAAA,MAAW,CAACA,EAAQ,aAAa,CAACA,EAAQ,mBAAmB;AAAA,EAAA;AAE5E;"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import { PayrollInput, WireInRequestInput, PayrollStatusBadges } from './payrollStatusConfig';
|
|
2
|
+
/** @internal */
|
|
2
3
|
export declare const getPayrollStatusBadges: (payroll: PayrollInput, wireInRequest?: WireInRequestInput) => PayrollStatusBadges;
|
|
4
|
+
/** @internal */
|
|
3
5
|
export declare const usePayrollStatusBadges: (payroll: PayrollInput, wireInRequest?: WireInRequestInput) => PayrollStatusBadges;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePayrollStatusBadges.js","sources":["../../../../src/components/Payroll/PayrollStatusBadges/usePayrollStatusBadges.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport type {\n PayrollInput,\n WireInRequestInput,\n PayrollStatusBadges,\n PayrollStatusBadge,\n} from './payrollStatusConfig'\nimport { STATUS_CONFIG } from './payrollStatusConfig'\n\nexport const getPayrollStatusBadges = (\n payroll: PayrollInput,\n wireInRequest?: WireInRequestInput,\n): PayrollStatusBadges => {\n const badges: PayrollStatusBadge[] = []\n\n for (const config of STATUS_CONFIG) {\n if (config.condition(payroll, wireInRequest)) {\n const badge =\n typeof config.badge === 'function' ? config.badge(payroll, wireInRequest) : config.badge\n badges.push(badge)\n\n if (!config.continueChecking) {\n break\n }\n }\n }\n\n return { badges }\n}\n\nexport const usePayrollStatusBadges = (\n payroll: PayrollInput,\n wireInRequest?: WireInRequestInput,\n): PayrollStatusBadges => {\n return useMemo(() => getPayrollStatusBadges(payroll, wireInRequest), [payroll, wireInRequest])\n}\n"],"names":["getPayrollStatusBadges","payroll","wireInRequest","badges","config","STATUS_CONFIG","badge","usePayrollStatusBadges","useMemo"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"usePayrollStatusBadges.js","sources":["../../../../src/components/Payroll/PayrollStatusBadges/usePayrollStatusBadges.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport type {\n PayrollInput,\n WireInRequestInput,\n PayrollStatusBadges,\n PayrollStatusBadge,\n} from './payrollStatusConfig'\nimport { STATUS_CONFIG } from './payrollStatusConfig'\n\n/** @internal */\nexport const getPayrollStatusBadges = (\n payroll: PayrollInput,\n wireInRequest?: WireInRequestInput,\n): PayrollStatusBadges => {\n const badges: PayrollStatusBadge[] = []\n\n for (const config of STATUS_CONFIG) {\n if (config.condition(payroll, wireInRequest)) {\n const badge =\n typeof config.badge === 'function' ? config.badge(payroll, wireInRequest) : config.badge\n badges.push(badge)\n\n if (!config.continueChecking) {\n break\n }\n }\n }\n\n return { badges }\n}\n\n/** @internal */\nexport const usePayrollStatusBadges = (\n payroll: PayrollInput,\n wireInRequest?: WireInRequestInput,\n): PayrollStatusBadges => {\n return useMemo(() => getPayrollStatusBadges(payroll, wireInRequest), [payroll, wireInRequest])\n}\n"],"names":["getPayrollStatusBadges","payroll","wireInRequest","badges","config","STATUS_CONFIG","badge","usePayrollStatusBadges","useMemo"],"mappings":";;AAUO,MAAMA,IAAyB,CACpCC,GACAC,MACwB;AACxB,QAAMC,IAA+B,CAAA;AAErC,aAAWC,KAAUC;AACnB,QAAID,EAAO,UAAUH,GAASC,CAAa,GAAG;AAC5C,YAAMI,IACJ,OAAOF,EAAO,SAAU,aAAaA,EAAO,MAAMH,GAASC,CAAa,IAAIE,EAAO;AAGrF,UAFAD,EAAO,KAAKG,CAAK,GAEb,CAACF,EAAO;AACV;AAAA,IAEJ;AAGF,SAAO,EAAE,QAAAD,EAAA;AACX,GAGaI,IAAyB,CACpCN,GACAC,MAEOM,EAAQ,MAAMR,EAAuBC,GAASC,CAAa,GAAG,CAACD,GAASC,CAAa,CAAC;"}
|
|
@@ -1,9 +1,29 @@
|
|
|
1
1
|
import { BaseComponentInterface } from '../../Base';
|
|
2
|
-
|
|
2
|
+
interface RecoveryCasesProps {
|
|
3
3
|
companyId: string;
|
|
4
4
|
onEvent?: BaseComponentInterface['onEvent'];
|
|
5
5
|
}
|
|
6
6
|
interface RecoveryCasesInternalProps extends Omit<BaseComponentInterface, 'onEvent'>, RecoveryCasesProps {
|
|
7
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* Displays open recovery cases for a company and provides an in-modal resubmit workflow for resolving them.
|
|
10
|
+
*
|
|
11
|
+
* @remarks
|
|
12
|
+
* Recovery cases are issues that surface after a payroll has been submitted
|
|
13
|
+
* (for example, a returned ACH transfer) and must be resolved before subsequent
|
|
14
|
+
* payrolls can run cleanly. This component is also embedded inside
|
|
15
|
+
* {@link PayrollBlockerList}, but can be used standalone when you want a
|
|
16
|
+
* dedicated recovery cases surface.
|
|
17
|
+
*
|
|
18
|
+
* | Event | Description | Data |
|
|
19
|
+
* | ----- | ----------- | ---- |
|
|
20
|
+
* | `recoveryCase/resolve` | User opens the resubmit modal for a recovery case | `{ recoveryCaseId: string }` |
|
|
21
|
+
* | `recoveryCase/resubmit/done` | User successfully resubmits a recovery case | Resubmit result payload |
|
|
22
|
+
* | `recoveryCase/resubmit/cancel` | User cancels the resubmit modal | — |
|
|
23
|
+
*
|
|
24
|
+
* @param props - Accepts `companyId` (required) and an optional `onEvent` handler.
|
|
25
|
+
* @returns The recovery cases list with an embedded resubmit modal.
|
|
26
|
+
* @public
|
|
27
|
+
*/
|
|
8
28
|
export declare function RecoveryCases({ onEvent, ...props }: RecoveryCasesInternalProps): import("react").JSX.Element;
|
|
9
29
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RecoveryCases.js","sources":["../../../../src/components/Payroll/RecoveryCases/RecoveryCases.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMachine } from 'react-robot'\nimport { useMemo, useState } from 'react'\nimport { RecoveryCasesList } from './RecoveryCasesList'\nimport { recoveryCasesMachine } from './recoveryCasesStateMachine'\nimport { type RecoveryCasesContextInterface } from './RecoveryCasesComponents'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { FlowContext } from '@/components/Flow/useFlow'\nimport { recoveryCasesEvents, type EventType } from '@/shared/constants'\n\
|
|
1
|
+
{"version":3,"file":"RecoveryCases.js","sources":["../../../../src/components/Payroll/RecoveryCases/RecoveryCases.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMachine } from 'react-robot'\nimport { useMemo, useState } from 'react'\nimport { RecoveryCasesList } from './RecoveryCasesList'\nimport { recoveryCasesMachine } from './recoveryCasesStateMachine'\nimport { type RecoveryCasesContextInterface } from './RecoveryCasesComponents'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { FlowContext } from '@/components/Flow/useFlow'\nimport { recoveryCasesEvents, type EventType } from '@/shared/constants'\n\ninterface RecoveryCasesProps {\n companyId: string\n onEvent?: BaseComponentInterface['onEvent']\n}\n\ninterface RecoveryCasesInternalProps\n extends Omit<BaseComponentInterface, 'onEvent'>, RecoveryCasesProps {}\n\n/**\n * Displays open recovery cases for a company and provides an in-modal resubmit workflow for resolving them.\n *\n * @remarks\n * Recovery cases are issues that surface after a payroll has been submitted\n * (for example, a returned ACH transfer) and must be resolved before subsequent\n * payrolls can run cleanly. This component is also embedded inside\n * {@link PayrollBlockerList}, but can be used standalone when you want a\n * dedicated recovery cases surface.\n *\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `recoveryCase/resolve` | User opens the resubmit modal for a recovery case | `{ recoveryCaseId: string }` |\n * | `recoveryCase/resubmit/done` | User successfully resubmits a recovery case | Resubmit result payload |\n * | `recoveryCase/resubmit/cancel` | User cancels the resubmit modal | — |\n *\n * @param props - Accepts `companyId` (required) and an optional `onEvent` handler.\n * @returns The recovery cases list with an embedded resubmit modal.\n * @public\n */\nexport function RecoveryCases({ onEvent = () => {}, ...props }: RecoveryCasesInternalProps) {\n return (\n <BaseComponent {...props} onEvent={onEvent}>\n <Root {...props} onEvent={onEvent} />\n </BaseComponent>\n )\n}\n\nfunction Root({ companyId, onEvent = () => {} }: RecoveryCasesInternalProps) {\n const { Modal } = useComponentContext()\n const [isModalOpen, setIsModalOpen] = useState(false)\n\n const recoveryCasesMachineInstance = useMemo(\n () =>\n createMachine(\n 'list',\n recoveryCasesMachine,\n (): RecoveryCasesContextInterface => ({\n component: null,\n companyId,\n onEvent: handleEvent,\n }),\n ),\n [companyId],\n )\n const [current, send] = useMachine(recoveryCasesMachineInstance)\n\n function handleEvent(type: EventType, data?: unknown): void {\n send({ type, payload: data })\n\n if (type === recoveryCasesEvents.RECOVERY_CASE_RESOLVE) {\n setIsModalOpen(true)\n }\n\n if (\n type === recoveryCasesEvents.RECOVERY_CASE_RESUBMIT_CANCEL ||\n type === recoveryCasesEvents.RECOVERY_CASE_RESUBMIT_DONE\n ) {\n setIsModalOpen(false)\n }\n\n onEvent(type, data)\n }\n\n const handleCloseModal = () => {\n setIsModalOpen(false)\n }\n\n const CurrentComponent = current.context.component\n const Footer = CurrentComponent?.Footer || undefined\n\n return (\n <FlowContext.Provider\n value={{\n ...current.context,\n onEvent: handleEvent,\n }}\n >\n <RecoveryCasesList companyId={companyId} onEvent={handleEvent} />\n <Modal\n isOpen={isModalOpen}\n onClose={handleCloseModal}\n footer={Footer && <Footer onEvent={handleEvent} />}\n >\n {CurrentComponent && <CurrentComponent />}\n </Modal>\n </FlowContext.Provider>\n )\n}\n"],"names":["RecoveryCases","onEvent","props","jsx","BaseComponent","Root","companyId","Modal","useComponentContext","isModalOpen","setIsModalOpen","useState","recoveryCasesMachineInstance","useMemo","createMachine","recoveryCasesMachine","handleEvent","current","send","useMachine","type","data","recoveryCasesEvents","handleCloseModal","CurrentComponent","Footer","jsxs","FlowContext","RecoveryCasesList"],"mappings":";;;;;;;;;;;AAuCO,SAASA,EAAc,EAAE,SAAAC,IAAU,MAAM;AAAC,GAAG,GAAGC,KAAqC;AAC1F,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GAAO,SAAAD,GACxB,4BAACI,GAAA,EAAM,GAAGH,GAAO,SAAAD,EAAA,CAAkB,EAAA,CACrC;AAEJ;AAEA,SAASI,EAAK,EAAE,WAAAC,GAAW,SAAAL,IAAU,MAAM;AAAC,KAAiC;AAC3E,QAAM,EAAE,OAAAM,EAAA,IAAUC,EAAA,GACZ,CAACC,GAAaC,CAAc,IAAIC,EAAS,EAAK,GAE9CC,IAA+BC;AAAA,IACnC,MACEC;AAAA,MACE;AAAA,MACAC;AAAA,MACA,OAAsC;AAAA,QACpC,WAAW;AAAA,QACX,WAAAT;AAAA,QACA,SAASU;AAAA,MAAA;AAAA,IACX;AAAA,IAEJ,CAACV,CAAS;AAAA,EAAA,GAEN,CAACW,GAASC,CAAI,IAAIC,EAAWP,CAA4B;AAE/D,WAASI,EAAYI,GAAiBC,GAAsB;AAC1D,IAAAH,EAAK,EAAE,MAAAE,GAAM,SAASC,EAAA,CAAM,GAExBD,MAASE,EAAoB,yBAC/BZ,EAAe,EAAI,IAInBU,MAASE,EAAoB,iCAC7BF,MAASE,EAAoB,gCAE7BZ,EAAe,EAAK,GAGtBT,EAAQmB,GAAMC,CAAI;AAAA,EACpB;AAEA,QAAME,IAAmB,MAAM;AAC7B,IAAAb,EAAe,EAAK;AAAA,EACtB,GAEMc,IAAmBP,EAAQ,QAAQ,WACnCQ,IAASD,GAAkB,UAAU;AAE3C,SACE,gBAAAE;AAAA,IAACC,EAAY;AAAA,IAAZ;AAAA,MACC,OAAO;AAAA,QACL,GAAGV,EAAQ;AAAA,QACX,SAASD;AAAA,MAAA;AAAA,MAGX,UAAA;AAAA,QAAA,gBAAAb,EAACyB,GAAA,EAAkB,WAAAtB,GAAsB,SAASU,EAAA,CAAa;AAAA,QAC/D,gBAAAb;AAAA,UAACI;AAAA,UAAA;AAAA,YACC,QAAQE;AAAA,YACR,SAASc;AAAA,YACT,QAAQE,KAAU,gBAAAtB,EAACsB,GAAA,EAAO,SAAST,GAAa;AAAA,YAE/C,UAAAQ,uBAAqBA,GAAA,CAAA,CAAiB;AAAA,UAAA;AAAA,QAAA;AAAA,MACzC;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -2,15 +2,20 @@ import { FlowContextInterface } from '../../Flow/useFlow';
|
|
|
2
2
|
import { CommonComponentInterface } from '../../Base';
|
|
3
3
|
import { EventType } from '../../../types/Helpers';
|
|
4
4
|
import { OnEventType } from '../../Base/useBase';
|
|
5
|
+
/** @internal */
|
|
5
6
|
export interface RecoveryCasesContextInterface extends FlowContextInterface {
|
|
7
|
+
/** Identifier of the company whose recovery cases are being managed. */
|
|
6
8
|
companyId: string;
|
|
9
|
+
/** Identifier of the recovery case the user is currently resolving, if any. */
|
|
7
10
|
selectedRecoveryCaseId?: string;
|
|
11
|
+
/** Component to render inside the modal for the current state, or `null` when no modal step is active. */
|
|
8
12
|
component: (React.ComponentType<CommonComponentInterface> & {
|
|
9
13
|
Footer?: React.ComponentType<{
|
|
10
14
|
onEvent: OnEventType<EventType, unknown>;
|
|
11
15
|
}>;
|
|
12
16
|
}) | null;
|
|
13
17
|
}
|
|
18
|
+
/** @internal */
|
|
14
19
|
export declare function RecoveryCasesResubmitContextual(): import("react").JSX.Element;
|
|
15
20
|
export declare namespace RecoveryCasesResubmitContextual {
|
|
16
21
|
var Footer: ({ onEvent }: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RecoveryCasesComponents.js","sources":["../../../../src/components/Payroll/RecoveryCases/RecoveryCasesComponents.tsx"],"sourcesContent":["import { RecoveryCasesResubmit } from './RecoveryCasesResubmit'\nimport { useFlow } from '@/components/Flow/useFlow'\nimport { ensureRequired } from '@/helpers/ensureRequired'\nimport type { FlowContextInterface } from '@/components/Flow/useFlow'\nimport type { CommonComponentInterface } from '@/components/Base'\nimport type { EventType } from '@/types/Helpers'\nimport type { OnEventType } from '@/components/Base/useBase'\n\nexport interface RecoveryCasesContextInterface extends FlowContextInterface {\n companyId: string\n selectedRecoveryCaseId?: string\n component:\n | (React.ComponentType<CommonComponentInterface> & {\n Footer?: React.ComponentType<{\n onEvent: OnEventType<EventType, unknown>\n }>\n })\n | null\n}\n\nexport function RecoveryCasesResubmitContextual() {\n const { selectedRecoveryCaseId, onEvent } = useFlow<RecoveryCasesContextInterface>()\n\n return (\n <RecoveryCasesResubmit\n recoveryCaseId={ensureRequired(selectedRecoveryCaseId)}\n onEvent={onEvent}\n />\n )\n}\n\nRecoveryCasesResubmitContextual.Footer = RecoveryCasesResubmit.Footer\n"],"names":["RecoveryCasesResubmitContextual","selectedRecoveryCaseId","onEvent","useFlow","jsx","RecoveryCasesResubmit","ensureRequired"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"RecoveryCasesComponents.js","sources":["../../../../src/components/Payroll/RecoveryCases/RecoveryCasesComponents.tsx"],"sourcesContent":["import { RecoveryCasesResubmit } from './RecoveryCasesResubmit'\nimport { useFlow } from '@/components/Flow/useFlow'\nimport { ensureRequired } from '@/helpers/ensureRequired'\nimport type { FlowContextInterface } from '@/components/Flow/useFlow'\nimport type { CommonComponentInterface } from '@/components/Base'\nimport type { EventType } from '@/types/Helpers'\nimport type { OnEventType } from '@/components/Base/useBase'\n\n/** @internal */\nexport interface RecoveryCasesContextInterface extends FlowContextInterface {\n /** Identifier of the company whose recovery cases are being managed. */\n companyId: string\n /** Identifier of the recovery case the user is currently resolving, if any. */\n selectedRecoveryCaseId?: string\n /** Component to render inside the modal for the current state, or `null` when no modal step is active. */\n component:\n | (React.ComponentType<CommonComponentInterface> & {\n Footer?: React.ComponentType<{\n onEvent: OnEventType<EventType, unknown>\n }>\n })\n | null\n}\n\n/** @internal */\nexport function RecoveryCasesResubmitContextual() {\n const { selectedRecoveryCaseId, onEvent } = useFlow<RecoveryCasesContextInterface>()\n\n return (\n <RecoveryCasesResubmit\n recoveryCaseId={ensureRequired(selectedRecoveryCaseId)}\n onEvent={onEvent}\n />\n )\n}\n\nRecoveryCasesResubmitContextual.Footer = RecoveryCasesResubmit.Footer\n"],"names":["RecoveryCasesResubmitContextual","selectedRecoveryCaseId","onEvent","useFlow","jsx","RecoveryCasesResubmit","ensureRequired"],"mappings":";;;;AAyBO,SAASA,IAAkC;AAChD,QAAM,EAAE,wBAAAC,GAAwB,SAAAC,EAAA,IAAYC,EAAA;AAE5C,SACE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,gBAAgBC,EAAeL,CAAsB;AAAA,MACrD,SAAAC;AAAA,IAAA;AAAA,EAAA;AAGN;AAEAF,EAAgC,SAASK,EAAsB;"}
|
|
@@ -3,5 +3,6 @@ interface RecoveryCasesListProps extends BaseComponentInterface<'Payroll.Recover
|
|
|
3
3
|
companyId: string;
|
|
4
4
|
onEvent: BaseComponentInterface['onEvent'];
|
|
5
5
|
}
|
|
6
|
+
/** @internal */
|
|
6
7
|
export declare function RecoveryCasesList(props: RecoveryCasesListProps): import("react").JSX.Element;
|
|
7
8
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RecoveryCasesList.js","sources":["../../../../../src/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type {\n RecoveryCase,\n RecoveryCaseStatus,\n} from '@gusto/embedded-api-v-2025-11-15/models/components/recoverycase'\nimport { useRecoveryCasesGetSuspense } from '@gusto/embedded-api-v-2025-11-15/react-query/recoveryCasesGet'\nimport { useRecoveryCaseErrorCode } from '../useRecoveryCaseErrorCode'\nimport styles from './RecoveryCasesList.module.scss'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { DataView } from '@/components/Common/DataView/DataView'\nimport { useDataView } from '@/components/Common/DataView/useDataView'\nimport { EmptyData, Flex, FlexItem } from '@/components/Common'\nimport { recoveryCasesEvents } from '@/shared/constants'\nimport type { BadgeProps } from '@/components/Common/UI/Badge/BadgeTypes'\nimport { formatNumberAsCurrency } from '@/helpers/formattedStrings'\n\ninterface RecoveryCasesListProps extends BaseComponentInterface<'Payroll.RecoveryCasesList'> {\n companyId: string\n onEvent: BaseComponentInterface['onEvent']\n}\n\nexport function RecoveryCasesList(props: RecoveryCasesListProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction getStatusBadgeStatus(status: RecoveryCaseStatus | undefined): BadgeProps['status'] {\n if (status === 'open') {\n return 'info'\n }\n return 'warning'\n}\n\nfunction ErrorCodeCell({ errorCode }: { errorCode: string | null | undefined }) {\n useI18n('Payroll.RecoveryCasesList')\n const { t } = useTranslation('Payroll.RecoveryCasesList')\n const { Text } = useComponentContext()\n const { title, subtitle } = useRecoveryCaseErrorCode(errorCode)\n\n if (!title && !subtitle) {\n return (\n <span aria-label={t('labels.noLatestErrorCodeAriaLabel')} aria-live=\"polite\">\n {t('labels.noLatestErrorCode')}\n </span>\n )\n }\n\n return (\n <Flex flexDirection=\"column\" gap={4}>\n {title && <Text weight=\"semibold\">{title}</Text>}\n {subtitle && <Text>{subtitle}</Text>}\n </Flex>\n )\n}\n\nfunction StatusCell({ status }: { status: RecoveryCaseStatus | undefined }) {\n useI18n('Payroll.RecoveryCasesList')\n const { t } = useTranslation('Payroll.RecoveryCasesList')\n const { Badge } = useComponentContext()\n\n if (!status) {\n return null\n }\n\n const badgeStatus = getStatusBadgeStatus(status)\n const statusLabel = t(`status.${status}`)\n\n return <Badge status={badgeStatus}>{statusLabel}</Badge>\n}\n\nfunction ResolveButton({\n recoveryCase,\n onEvent,\n}: {\n recoveryCase: RecoveryCase\n onEvent: BaseComponentInterface['onEvent']\n}) {\n useI18n('Payroll.RecoveryCasesList')\n const { t } = useTranslation('Payroll.RecoveryCasesList')\n const { Button } = useComponentContext()\n\n if (recoveryCase.status !== 'open') {\n return null\n }\n\n return (\n <Button\n variant=\"secondary\"\n onClick={() => {\n onEvent(recoveryCasesEvents.RECOVERY_CASE_RESOLVE, {\n recoveryCaseId: recoveryCase.uuid,\n })\n }}\n >\n {t('cta.resolve')}\n </Button>\n )\n}\n\nfunction Root({ companyId, dictionary, onEvent }: RecoveryCasesListProps) {\n useComponentDictionary('Payroll.RecoveryCasesList', dictionary)\n useI18n('Payroll.RecoveryCasesList')\n const { t } = useTranslation('Payroll.RecoveryCasesList')\n const { Heading, Text } = useComponentContext()\n\n const { data } = useRecoveryCasesGetSuspense({\n companyUuid: companyId,\n })\n\n const recoveryCases = (data.recoveryCases ?? []).filter(rc => rc.status !== 'recovered')\n\n const dataViewProps = useDataView({\n data: recoveryCases,\n emptyState: () => (\n <EmptyData title={t('emptyTableTitle')} description={t('emptyTableDescription')} />\n ),\n columns: [\n {\n key: 'originalDebitDate',\n title: t('columns.originalDebitDate'),\n render: recoveryCase => (\n <FlexItem flexGrow={1}>\n <Text>{recoveryCase.originalDebitDate ?? '-'}</Text>\n </FlexItem>\n ),\n },\n {\n key: 'totalAmount',\n title: t('columns.totalAmount'),\n render: recoveryCase => (\n <Text>\n {recoveryCase.eventTotalAmount\n ? formatNumberAsCurrency(parseFloat(recoveryCase.eventTotalAmount))\n : '-'}\n </Text>\n ),\n },\n {\n key: 'amountOutstanding',\n title: t('columns.amountOutstanding'),\n render: recoveryCase => (\n <Text>\n {recoveryCase.amountOutstanding\n ? formatNumberAsCurrency(parseFloat(recoveryCase.amountOutstanding))\n : '-'}\n </Text>\n ),\n },\n {\n key: 'latestErrorCode',\n title: t('columns.latestErrorCode'),\n render: recoveryCase => <ErrorCodeCell errorCode={recoveryCase.latestErrorCode} />,\n },\n {\n key: 'status',\n title: t('columns.status'),\n render: recoveryCase => <StatusCell status={recoveryCase.status} />,\n },\n ],\n itemMenu: recoveryCase => <ResolveButton recoveryCase={recoveryCase} onEvent={onEvent} />,\n })\n\n return (\n <div className={styles.root}>\n <Flex flexDirection=\"column\" gap={20}>\n <Flex flexDirection=\"column\" gap={2}>\n <Heading as=\"h2\" styledAs=\"h4\">\n {t('title')}\n </Heading>\n {recoveryCases.length > 0 && <Text>{t('description')}</Text>}\n </Flex>\n\n <DataView {...dataViewProps} label={t('title')} />\n </Flex>\n </div>\n )\n}\n"],"names":["RecoveryCasesList","props","jsx","BaseComponent","Root","getStatusBadgeStatus","status","ErrorCodeCell","errorCode","useI18n","t","useTranslation","Text","useComponentContext","title","subtitle","useRecoveryCaseErrorCode","jsxs","Flex","StatusCell","Badge","badgeStatus","statusLabel","ResolveButton","recoveryCase","onEvent","Button","recoveryCasesEvents","companyId","dictionary","useComponentDictionary","Heading","data","useRecoveryCasesGetSuspense","recoveryCases","rc","dataViewProps","useDataView","EmptyData","FlexItem","formatNumberAsCurrency","styles","DataView"],"mappings":";;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"RecoveryCasesList.js","sources":["../../../../../src/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type {\n RecoveryCase,\n RecoveryCaseStatus,\n} from '@gusto/embedded-api-v-2025-11-15/models/components/recoverycase'\nimport { useRecoveryCasesGetSuspense } from '@gusto/embedded-api-v-2025-11-15/react-query/recoveryCasesGet'\nimport { useRecoveryCaseErrorCode } from '../useRecoveryCaseErrorCode'\nimport styles from './RecoveryCasesList.module.scss'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { DataView } from '@/components/Common/DataView/DataView'\nimport { useDataView } from '@/components/Common/DataView/useDataView'\nimport { EmptyData, Flex, FlexItem } from '@/components/Common'\nimport { recoveryCasesEvents } from '@/shared/constants'\nimport type { BadgeProps } from '@/components/Common/UI/Badge/BadgeTypes'\nimport { formatNumberAsCurrency } from '@/helpers/formattedStrings'\n\ninterface RecoveryCasesListProps extends BaseComponentInterface<'Payroll.RecoveryCasesList'> {\n companyId: string\n onEvent: BaseComponentInterface['onEvent']\n}\n\n/** @internal */\nexport function RecoveryCasesList(props: RecoveryCasesListProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction getStatusBadgeStatus(status: RecoveryCaseStatus | undefined): BadgeProps['status'] {\n if (status === 'open') {\n return 'info'\n }\n return 'warning'\n}\n\nfunction ErrorCodeCell({ errorCode }: { errorCode: string | null | undefined }) {\n useI18n('Payroll.RecoveryCasesList')\n const { t } = useTranslation('Payroll.RecoveryCasesList')\n const { Text } = useComponentContext()\n const { title, subtitle } = useRecoveryCaseErrorCode(errorCode)\n\n if (!title && !subtitle) {\n return (\n <span aria-label={t('labels.noLatestErrorCodeAriaLabel')} aria-live=\"polite\">\n {t('labels.noLatestErrorCode')}\n </span>\n )\n }\n\n return (\n <Flex flexDirection=\"column\" gap={4}>\n {title && <Text weight=\"semibold\">{title}</Text>}\n {subtitle && <Text>{subtitle}</Text>}\n </Flex>\n )\n}\n\nfunction StatusCell({ status }: { status: RecoveryCaseStatus | undefined }) {\n useI18n('Payroll.RecoveryCasesList')\n const { t } = useTranslation('Payroll.RecoveryCasesList')\n const { Badge } = useComponentContext()\n\n if (!status) {\n return null\n }\n\n const badgeStatus = getStatusBadgeStatus(status)\n const statusLabel = t(`status.${status}`)\n\n return <Badge status={badgeStatus}>{statusLabel}</Badge>\n}\n\nfunction ResolveButton({\n recoveryCase,\n onEvent,\n}: {\n recoveryCase: RecoveryCase\n onEvent: BaseComponentInterface['onEvent']\n}) {\n useI18n('Payroll.RecoveryCasesList')\n const { t } = useTranslation('Payroll.RecoveryCasesList')\n const { Button } = useComponentContext()\n\n if (recoveryCase.status !== 'open') {\n return null\n }\n\n return (\n <Button\n variant=\"secondary\"\n onClick={() => {\n onEvent(recoveryCasesEvents.RECOVERY_CASE_RESOLVE, {\n recoveryCaseId: recoveryCase.uuid,\n })\n }}\n >\n {t('cta.resolve')}\n </Button>\n )\n}\n\nfunction Root({ companyId, dictionary, onEvent }: RecoveryCasesListProps) {\n useComponentDictionary('Payroll.RecoveryCasesList', dictionary)\n useI18n('Payroll.RecoveryCasesList')\n const { t } = useTranslation('Payroll.RecoveryCasesList')\n const { Heading, Text } = useComponentContext()\n\n const { data } = useRecoveryCasesGetSuspense({\n companyUuid: companyId,\n })\n\n const recoveryCases = (data.recoveryCases ?? []).filter(rc => rc.status !== 'recovered')\n\n const dataViewProps = useDataView({\n data: recoveryCases,\n emptyState: () => (\n <EmptyData title={t('emptyTableTitle')} description={t('emptyTableDescription')} />\n ),\n columns: [\n {\n key: 'originalDebitDate',\n title: t('columns.originalDebitDate'),\n render: recoveryCase => (\n <FlexItem flexGrow={1}>\n <Text>{recoveryCase.originalDebitDate ?? '-'}</Text>\n </FlexItem>\n ),\n },\n {\n key: 'totalAmount',\n title: t('columns.totalAmount'),\n render: recoveryCase => (\n <Text>\n {recoveryCase.eventTotalAmount\n ? formatNumberAsCurrency(parseFloat(recoveryCase.eventTotalAmount))\n : '-'}\n </Text>\n ),\n },\n {\n key: 'amountOutstanding',\n title: t('columns.amountOutstanding'),\n render: recoveryCase => (\n <Text>\n {recoveryCase.amountOutstanding\n ? formatNumberAsCurrency(parseFloat(recoveryCase.amountOutstanding))\n : '-'}\n </Text>\n ),\n },\n {\n key: 'latestErrorCode',\n title: t('columns.latestErrorCode'),\n render: recoveryCase => <ErrorCodeCell errorCode={recoveryCase.latestErrorCode} />,\n },\n {\n key: 'status',\n title: t('columns.status'),\n render: recoveryCase => <StatusCell status={recoveryCase.status} />,\n },\n ],\n itemMenu: recoveryCase => <ResolveButton recoveryCase={recoveryCase} onEvent={onEvent} />,\n })\n\n return (\n <div className={styles.root}>\n <Flex flexDirection=\"column\" gap={20}>\n <Flex flexDirection=\"column\" gap={2}>\n <Heading as=\"h2\" styledAs=\"h4\">\n {t('title')}\n </Heading>\n {recoveryCases.length > 0 && <Text>{t('description')}</Text>}\n </Flex>\n\n <DataView {...dataViewProps} label={t('title')} />\n </Flex>\n </div>\n )\n}\n"],"names":["RecoveryCasesList","props","jsx","BaseComponent","Root","getStatusBadgeStatus","status","ErrorCodeCell","errorCode","useI18n","t","useTranslation","Text","useComponentContext","title","subtitle","useRecoveryCaseErrorCode","jsxs","Flex","StatusCell","Badge","badgeStatus","statusLabel","ResolveButton","recoveryCase","onEvent","Button","recoveryCasesEvents","companyId","dictionary","useComponentDictionary","Heading","data","useRecoveryCasesGetSuspense","recoveryCases","rc","dataViewProps","useDataView","EmptyData","FlexItem","formatNumberAsCurrency","styles","DataView"],"mappings":";;;;;;;;;;;;;;;;AAwBO,SAASA,EAAkBC,GAA+B;AAC/D,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,SAASI,EAAqBC,GAA8D;AAC1F,SAAIA,MAAW,SACN,SAEF;AACT;AAEA,SAASC,EAAc,EAAE,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oBACVgB,EAAuB,WAAWhB,EAAa,iBAAiB,CAAC,IACjE,IAAA,CACN;AAAA,MAAA;AAAA,MAGJ;AAAA,QACE,KAAK;AAAA,QACL,OAAO,EAAE,yBAAyB;AAAA,QAClC,QAAQ,CAAAA,MAAgB,gBAAAtB,EAACK,GAAA,EAAc,WAAWiB,EAAa,gBAAA,CAAiB;AAAA,MAAA;AAAA,MAElF;AAAA,QACE,KAAK;AAAA,QACL,OAAO,EAAE,gBAAgB;AAAA,QACzB,QAAQ,CAAAA,MAAgB,gBAAAtB,EAACiB,GAAA,EAAW,QAAQK,EAAa,OAAA,CAAQ;AAAA,MAAA;AAAA,IACnE;AAAA,IAEF,UAAU,CAAAA,MAAgB,gBAAAtB,EAACqB,GAAA,EAAc,cAAAC,GAA4B,SAAAC,EAAA,CAAkB;AAAA,EAAA,CACxF;AAED,SACE,gBAAAvB,EAAC,OAAA,EAAI,WAAWuC,EAAO,MACrB,4BAACvB,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,IAAA,gBAAAD,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,GAChC,UAAA;AAAA,MAAA,gBAAAhB,EAAC6B,KAAQ,IAAG,MAAK,UAAS,MACvB,UAAA,EAAE,OAAO,GACZ;AAAA,MACCG,EAAc,SAAS,uBAAMtB,GAAA,EAAM,UAAA,EAAE,aAAa,EAAA,CAAE;AAAA,IAAA,GACvD;AAAA,sBAEC8B,GAAA,EAAU,GAAGN,GAAe,OAAO,EAAE,OAAO,EAAA,CAAG;AAAA,EAAA,EAAA,CAClD,EAAA,CACF;AAEJ;"}
|
package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ interface RecoveryCasesResubmitProps extends BaseComponentInterface<'Payroll.Rec
|
|
|
5
5
|
recoveryCaseId: string;
|
|
6
6
|
onEvent: OnEventType<EventType, unknown>;
|
|
7
7
|
}
|
|
8
|
+
/** @internal */
|
|
8
9
|
export declare function RecoveryCasesResubmit(props: RecoveryCasesResubmitProps): import("react").JSX.Element;
|
|
9
10
|
export declare namespace RecoveryCasesResubmit {
|
|
10
11
|
var Footer: ({ onEvent }: {
|
package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RecoveryCasesResubmit.js","sources":["../../../../../src/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useIsMutating } from '@tanstack/react-query'\nimport {\n useRecoveryCasesRedebitMutation,\n mutationKeyRecoveryCasesRedebit,\n} from '@gusto/embedded-api-v-2025-11-15/react-query/recoveryCasesRedebit'\nimport { useRecoveryCasesGet } from '@gusto/embedded-api-v-2025-11-15/react-query/recoveryCasesGet'\nimport type { RecoveryCasesContextInterface } from '../RecoveryCasesComponents'\nimport { useRecoveryCaseErrorCode } from '../useRecoveryCaseErrorCode'\nimport { BaseComponent, useBase, type BaseComponentInterface } from '@/components/Base'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport { Flex } from '@/components/Common'\nimport { Form } from '@/components/Common/Form'\nimport { useFlow } from '@/components/Flow/useFlow'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { recoveryCasesEvents, type EventType } from '@/shared/constants'\n\nconst RECOVERY_CASES_RESUBMIT_FORM_ID = 'gusto-sdk-recovery-cases-resubmit-form'\n\ninterface RecoveryCasesResubmitProps extends BaseComponentInterface<'Payroll.RecoveryCasesResubmit'> {\n recoveryCaseId: string\n onEvent: OnEventType<EventType, unknown>\n}\n\nexport function RecoveryCasesResubmit(props: RecoveryCasesResubmitProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ dictionary, recoveryCaseId }: RecoveryCasesResubmitProps) {\n useComponentDictionary('Payroll.RecoveryCasesResubmit', dictionary)\n const { Heading, Text } = useComponentContext()\n const { onEvent, baseSubmitHandler } = useBase()\n const { companyId } = useFlow<RecoveryCasesContextInterface>()\n\n const { data: recoveryCasesData } = useRecoveryCasesGet({\n companyUuid: companyId,\n })\n\n const recoveryCase = recoveryCasesData?.recoveryCases?.find(rc => rc.uuid === recoveryCaseId)\n\n const { title, subtitle, description } = useRecoveryCaseErrorCode(\n recoveryCase?.latestErrorCode ?? undefined,\n )\n\n const redebitMutation = useRecoveryCasesRedebitMutation()\n\n const onSubmit = async (e: React.FormEvent<HTMLFormElement>) => {\n e.preventDefault()\n await baseSubmitHandler({}, async () => {\n await redebitMutation.mutateAsync({\n request: {\n recoveryCaseUuid: recoveryCaseId,\n },\n })\n onEvent(recoveryCasesEvents.RECOVERY_CASE_RESUBMIT_DONE, {\n recoveryCaseId,\n })\n })\n }\n\n return (\n <Flex flexDirection=\"column\" gap={16}>\n {title && <Heading as=\"h2\">{title}</Heading>}\n {subtitle && <Text>{subtitle}</Text>}\n {description.length > 0 && description}\n {/*\n This empty form is used to connect the Footer's submit button to the submission logic\n via the form attribute. This is semantically incorrect and hidden from assistive tech.\n */}\n <Form id={RECOVERY_CASES_RESUBMIT_FORM_ID} onSubmit={onSubmit} aria-hidden=\"true\">\n {/* Empty form - submission triggered by footer button via form attribute */}\n </Form>\n </Flex>\n )\n}\n\nconst Footer = ({ onEvent }: { onEvent: OnEventType<EventType, unknown> }) => {\n useI18n('Payroll.RecoveryCasesResubmit')\n const { t } = useTranslation('Payroll.RecoveryCasesResubmit')\n const { Button } = useComponentContext()\n\n const isMutating = useIsMutating({\n mutationKey: mutationKeyRecoveryCasesRedebit(),\n })\n const isPending = isMutating > 0\n\n const handleCancel = () => {\n onEvent(recoveryCasesEvents.RECOVERY_CASE_RESUBMIT_CANCEL)\n }\n\n return (\n <Flex justifyContent=\"flex-end\" gap={12}>\n <Button variant=\"secondary\" onClick={handleCancel} isDisabled={isPending}>\n {t('cta.cancel')}\n </Button>\n <Button\n variant=\"primary\"\n type=\"submit\"\n form={RECOVERY_CASES_RESUBMIT_FORM_ID}\n isLoading={isPending}\n >\n {t('cta.resubmit')}\n </Button>\n </Flex>\n )\n}\n\nRecoveryCasesResubmit.Footer = Footer\n"],"names":["RECOVERY_CASES_RESUBMIT_FORM_ID","RecoveryCasesResubmit","props","jsx","BaseComponent","Root","dictionary","recoveryCaseId","useComponentDictionary","Heading","Text","useComponentContext","onEvent","baseSubmitHandler","useBase","companyId","useFlow","recoveryCasesData","useRecoveryCasesGet","recoveryCase","rc","title","subtitle","description","useRecoveryCaseErrorCode","redebitMutation","useRecoveryCasesRedebitMutation","onSubmit","e","recoveryCasesEvents","jsxs","Flex","Form","Footer","useI18n","t","useTranslation","Button","isPending","useIsMutating","mutationKeyRecoveryCasesRedebit"],"mappings":";;;;;;;;;;;;;;;AAkBA,MAAMA,IAAkC;
|
|
1
|
+
{"version":3,"file":"RecoveryCasesResubmit.js","sources":["../../../../../src/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useIsMutating } from '@tanstack/react-query'\nimport {\n useRecoveryCasesRedebitMutation,\n mutationKeyRecoveryCasesRedebit,\n} from '@gusto/embedded-api-v-2025-11-15/react-query/recoveryCasesRedebit'\nimport { useRecoveryCasesGet } from '@gusto/embedded-api-v-2025-11-15/react-query/recoveryCasesGet'\nimport type { RecoveryCasesContextInterface } from '../RecoveryCasesComponents'\nimport { useRecoveryCaseErrorCode } from '../useRecoveryCaseErrorCode'\nimport { BaseComponent, useBase, type BaseComponentInterface } from '@/components/Base'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport { Flex } from '@/components/Common'\nimport { Form } from '@/components/Common/Form'\nimport { useFlow } from '@/components/Flow/useFlow'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { recoveryCasesEvents, type EventType } from '@/shared/constants'\n\nconst RECOVERY_CASES_RESUBMIT_FORM_ID = 'gusto-sdk-recovery-cases-resubmit-form'\n\ninterface RecoveryCasesResubmitProps extends BaseComponentInterface<'Payroll.RecoveryCasesResubmit'> {\n recoveryCaseId: string\n onEvent: OnEventType<EventType, unknown>\n}\n\n/** @internal */\nexport function RecoveryCasesResubmit(props: RecoveryCasesResubmitProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ dictionary, recoveryCaseId }: RecoveryCasesResubmitProps) {\n useComponentDictionary('Payroll.RecoveryCasesResubmit', dictionary)\n const { Heading, Text } = useComponentContext()\n const { onEvent, baseSubmitHandler } = useBase()\n const { companyId } = useFlow<RecoveryCasesContextInterface>()\n\n const { data: recoveryCasesData } = useRecoveryCasesGet({\n companyUuid: companyId,\n })\n\n const recoveryCase = recoveryCasesData?.recoveryCases?.find(rc => rc.uuid === recoveryCaseId)\n\n const { title, subtitle, description } = useRecoveryCaseErrorCode(\n recoveryCase?.latestErrorCode ?? undefined,\n )\n\n const redebitMutation = useRecoveryCasesRedebitMutation()\n\n const onSubmit = async (e: React.FormEvent<HTMLFormElement>) => {\n e.preventDefault()\n await baseSubmitHandler({}, async () => {\n await redebitMutation.mutateAsync({\n request: {\n recoveryCaseUuid: recoveryCaseId,\n },\n })\n onEvent(recoveryCasesEvents.RECOVERY_CASE_RESUBMIT_DONE, {\n recoveryCaseId,\n })\n })\n }\n\n return (\n <Flex flexDirection=\"column\" gap={16}>\n {title && <Heading as=\"h2\">{title}</Heading>}\n {subtitle && <Text>{subtitle}</Text>}\n {description.length > 0 && description}\n {/*\n This empty form is used to connect the Footer's submit button to the submission logic\n via the form attribute. This is semantically incorrect and hidden from assistive tech.\n */}\n <Form id={RECOVERY_CASES_RESUBMIT_FORM_ID} onSubmit={onSubmit} aria-hidden=\"true\">\n {/* Empty form - submission triggered by footer button via form attribute */}\n </Form>\n </Flex>\n )\n}\n\nconst Footer = ({ onEvent }: { onEvent: OnEventType<EventType, unknown> }) => {\n useI18n('Payroll.RecoveryCasesResubmit')\n const { t } = useTranslation('Payroll.RecoveryCasesResubmit')\n const { Button } = useComponentContext()\n\n const isMutating = useIsMutating({\n mutationKey: mutationKeyRecoveryCasesRedebit(),\n })\n const isPending = isMutating > 0\n\n const handleCancel = () => {\n onEvent(recoveryCasesEvents.RECOVERY_CASE_RESUBMIT_CANCEL)\n }\n\n return (\n <Flex justifyContent=\"flex-end\" gap={12}>\n <Button variant=\"secondary\" onClick={handleCancel} isDisabled={isPending}>\n {t('cta.cancel')}\n </Button>\n <Button\n variant=\"primary\"\n type=\"submit\"\n form={RECOVERY_CASES_RESUBMIT_FORM_ID}\n isLoading={isPending}\n >\n {t('cta.resubmit')}\n </Button>\n </Flex>\n )\n}\n\nRecoveryCasesResubmit.Footer = Footer\n"],"names":["RECOVERY_CASES_RESUBMIT_FORM_ID","RecoveryCasesResubmit","props","jsx","BaseComponent","Root","dictionary","recoveryCaseId","useComponentDictionary","Heading","Text","useComponentContext","onEvent","baseSubmitHandler","useBase","companyId","useFlow","recoveryCasesData","useRecoveryCasesGet","recoveryCase","rc","title","subtitle","description","useRecoveryCaseErrorCode","redebitMutation","useRecoveryCasesRedebitMutation","onSubmit","e","recoveryCasesEvents","jsxs","Flex","Form","Footer","useI18n","t","useTranslation","Button","isPending","useIsMutating","mutationKeyRecoveryCasesRedebit"],"mappings":";;;;;;;;;;;;;;;AAkBA,MAAMA,IAAkC;AAQjC,SAASC,EAAsBC,GAAmC;AACvE,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,SAASG,EAAK,EAAE,YAAAC,GAAY,gBAAAC,KAA8C;AACxE,EAAAC,EAAuB,iCAAiCF,CAAU;AAClE,QAAM,EA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/B,aAAaC,EAAA;AAAA,EAAgC,CAC9C,IAC8B;AAM/B,SACE,gBAAAV,EAACC,GAAA,EAAK,gBAAe,YAAW,KAAK,IACnC,UAAA;AAAA,IAAA,gBAAA5B,EAACkC,GAAA,EAAO,SAAQ,aAAY,SANX,MAAM;AACzB,MAAAzB,EAAQiB,EAAoB,6BAA6B;AAAA,IAC3D,GAIuD,YAAYS,GAC5D,UAAAH,EAAE,YAAY,EAAA,CACjB;AAAA,IACA,gBAAAhC;AAAA,MAACkC;AAAA,MAAA;AAAA,QACC,SAAQ;AAAA,QACR,MAAK;AAAA,QACL,MAAMrC;AAAA,QACN,WAAWsC;AAAA,QAEV,YAAE,cAAc;AAAA,MAAA;AAAA,IAAA;AAAA,EACnB,GACF;AAEJ;AAEArC,EAAsB,SAASgC;"}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import { recoveryCasesEvents } from '../../../shared/constants';
|
|
2
|
+
/** @internal */
|
|
2
3
|
export type EventPayloads = {
|
|
4
|
+
/** Payload carried when a user opens the resubmit modal for a recovery case. */
|
|
3
5
|
[recoveryCasesEvents.RECOVERY_CASE_RESOLVE]: {
|
|
4
6
|
recoveryCaseId: string;
|
|
5
7
|
};
|
|
8
|
+
/** No payload — the modal was cancelled. */
|
|
6
9
|
[recoveryCasesEvents.RECOVERY_CASE_RESUBMIT_CANCEL]: undefined;
|
|
10
|
+
/** No payload — the resubmit completed successfully. */
|
|
7
11
|
[recoveryCasesEvents.RECOVERY_CASE_RESUBMIT_DONE]: undefined;
|
|
8
12
|
};
|
|
13
|
+
/** @internal */
|
|
9
14
|
export declare const recoveryCasesMachine: {
|
|
10
15
|
list: import('robot3').MachineState<any>;
|
|
11
16
|
resubmit: import('robot3').MachineState<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recoveryCasesStateMachine.js","sources":["../../../../src/components/Payroll/RecoveryCases/recoveryCasesStateMachine.tsx"],"sourcesContent":["import { state, transition, reduce } from 'robot3'\nimport type { RecoveryCasesContextInterface } from './RecoveryCasesComponents'\nimport { RecoveryCasesResubmitContextual } from './RecoveryCasesComponents'\nimport { recoveryCasesEvents } from '@/shared/constants'\nimport type { MachineEventType, MachineTransition } from '@/types/Helpers'\n\nexport type EventPayloads = {\n [recoveryCasesEvents.RECOVERY_CASE_RESOLVE]: {\n recoveryCaseId: string\n }\n [recoveryCasesEvents.RECOVERY_CASE_RESUBMIT_CANCEL]: undefined\n [recoveryCasesEvents.RECOVERY_CASE_RESUBMIT_DONE]: undefined\n}\n\nexport const recoveryCasesMachine = {\n list: state<MachineTransition>(\n transition(\n recoveryCasesEvents.RECOVERY_CASE_RESOLVE,\n 'resubmit',\n reduce(\n (\n ctx: RecoveryCasesContextInterface,\n ev: MachineEventType<EventPayloads, typeof recoveryCasesEvents.RECOVERY_CASE_RESOLVE>,\n ): RecoveryCasesContextInterface => ({\n ...ctx,\n component: RecoveryCasesResubmitContextual,\n selectedRecoveryCaseId: ev.payload.recoveryCaseId,\n }),\n ),\n ),\n ),\n resubmit: state<MachineTransition>(\n transition(\n recoveryCasesEvents.RECOVERY_CASE_RESUBMIT_DONE,\n 'list',\n reduce(\n (ctx: RecoveryCasesContextInterface): RecoveryCasesContextInterface => ({\n ...ctx,\n component: null,\n selectedRecoveryCaseId: undefined,\n }),\n ),\n ),\n transition(\n recoveryCasesEvents.RECOVERY_CASE_RESUBMIT_CANCEL,\n 'list',\n reduce(\n (ctx: RecoveryCasesContextInterface): RecoveryCasesContextInterface => ({\n ...ctx,\n component: null,\n selectedRecoveryCaseId: undefined,\n }),\n ),\n ),\n ),\n final: state<MachineTransition>(),\n}\n"],"names":["recoveryCasesMachine","state","transition","recoveryCasesEvents","reduce","ctx","ev","RecoveryCasesResubmitContextual"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"recoveryCasesStateMachine.js","sources":["../../../../src/components/Payroll/RecoveryCases/recoveryCasesStateMachine.tsx"],"sourcesContent":["import { state, transition, reduce } from 'robot3'\nimport type { RecoveryCasesContextInterface } from './RecoveryCasesComponents'\nimport { RecoveryCasesResubmitContextual } from './RecoveryCasesComponents'\nimport { recoveryCasesEvents } from '@/shared/constants'\nimport type { MachineEventType, MachineTransition } from '@/types/Helpers'\n\n/** @internal */\nexport type EventPayloads = {\n /** Payload carried when a user opens the resubmit modal for a recovery case. */\n [recoveryCasesEvents.RECOVERY_CASE_RESOLVE]: {\n recoveryCaseId: string\n }\n /** No payload — the modal was cancelled. */\n [recoveryCasesEvents.RECOVERY_CASE_RESUBMIT_CANCEL]: undefined\n /** No payload — the resubmit completed successfully. */\n [recoveryCasesEvents.RECOVERY_CASE_RESUBMIT_DONE]: undefined\n}\n\n/** @internal */\nexport const recoveryCasesMachine = {\n list: state<MachineTransition>(\n transition(\n recoveryCasesEvents.RECOVERY_CASE_RESOLVE,\n 'resubmit',\n reduce(\n (\n ctx: RecoveryCasesContextInterface,\n ev: MachineEventType<EventPayloads, typeof recoveryCasesEvents.RECOVERY_CASE_RESOLVE>,\n ): RecoveryCasesContextInterface => ({\n ...ctx,\n component: RecoveryCasesResubmitContextual,\n selectedRecoveryCaseId: ev.payload.recoveryCaseId,\n }),\n ),\n ),\n ),\n resubmit: state<MachineTransition>(\n transition(\n recoveryCasesEvents.RECOVERY_CASE_RESUBMIT_DONE,\n 'list',\n reduce(\n (ctx: RecoveryCasesContextInterface): RecoveryCasesContextInterface => ({\n ...ctx,\n component: null,\n selectedRecoveryCaseId: undefined,\n }),\n ),\n ),\n transition(\n recoveryCasesEvents.RECOVERY_CASE_RESUBMIT_CANCEL,\n 'list',\n reduce(\n (ctx: RecoveryCasesContextInterface): RecoveryCasesContextInterface => ({\n ...ctx,\n component: null,\n selectedRecoveryCaseId: undefined,\n }),\n ),\n ),\n ),\n final: state<MachineTransition>(),\n}\n"],"names":["recoveryCasesMachine","state","transition","recoveryCasesEvents","reduce","ctx","ev","RecoveryCasesResubmitContextual"],"mappings":";;;AAmBO,MAAMA,IAAuB;AAAA,EAClC,MAAMC;AAAA,IACJC;AAAA,MACEC,EAAoB;AAAA,MACpB;AAAA,MACAC;AAAA,QACE,CACEC,GACAC,OACmC;AAAA,UACnC,GAAGD;AAAA,UACH,WAAWE;AAAA,UACX,wBAAwBD,EAAG,QAAQ;AAAA,QAAA;AAAA,MACrC;AAAA,IACF;AAAA,EACF;AAAA,EAEF,UAAUL;AAAA,IACRC;AAAA,MACEC,EAAoB;AAAA,MACpB;AAAA,MACAC;AAAA,QACE,CAACC,OAAuE;AAAA,UACtE,GAAGA;AAAA,UACH,WAAW;AAAA,UACX,wBAAwB;AAAA,QAAA;AAAA,MAC1B;AAAA,IACF;AAAA,IAEFH;AAAA,MACEC,EAAoB;AAAA,MACpB;AAAA,MACAC;AAAA,QACE,CAACC,OAAuE;AAAA,UACtE,GAAGA;AAAA,UACH,WAAW;AAAA,UACX,wBAAwB;AAAA,QAAA;AAAA,MAC1B;AAAA,IACF;AAAA,EACF;AAAA,EAEF,OAAOJ,EAAA;AACT;"}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
/** @internal */
|
|
2
3
|
export interface RecoveryCaseErrorCodeContent {
|
|
4
|
+
/** Localized title for the error code, or `null` when no error code is set. */
|
|
3
5
|
title: string | null;
|
|
6
|
+
/** Localized subtitle for the error code, or `null` when no error code is set. */
|
|
4
7
|
subtitle: string | null;
|
|
8
|
+
/** Localized description nodes for the error code, including any per-code instructions. Empty when no error code is set. */
|
|
5
9
|
description: ReactNode[];
|
|
6
10
|
}
|
|
11
|
+
/** @internal */
|
|
7
12
|
export declare function useRecoveryCaseErrorCode(errorCode: string | null | undefined): RecoveryCaseErrorCodeContent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRecoveryCaseErrorCode.js","sources":["../../../../src/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { Trans, useTranslation } from 'react-i18next'\nimport styles from './RecoveryCaseErrorCode.module.scss'\nimport { Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\n\nexport interface RecoveryCaseErrorCodeContent {\n title: string | null\n subtitle: string | null\n description: ReactNode[]\n}\n\ntype ErrorCodeKey = 'R01' | 'R02' | 'R16' | 'R29' | 'bankError'\n\nfunction getErrorCodeKey(errorCode: string | null | undefined): ErrorCodeKey {\n switch (errorCode) {\n case 'R01':\n return 'R01'\n case 'R02':\n return 'R02'\n case 'R16':\n return 'R16'\n case 'R29':\n return 'R29'\n default:\n return 'bankError'\n }\n}\n\nexport function useRecoveryCaseErrorCode(\n errorCode: string | null | undefined,\n): RecoveryCaseErrorCodeContent {\n useI18n('Payroll.RecoveryCasesResubmit')\n const { t } = useTranslation('Payroll.RecoveryCasesResubmit')\n const { Text } = useComponentContext()\n\n if (!errorCode) {\n return {\n title: null,\n subtitle: null,\n description: [],\n }\n }\n\n const errorCodeKey = getErrorCodeKey(errorCode)\n\n const transComponents = {\n medium: <Text as=\"span\" weight=\"medium\" />,\n }\n\n const description: ReactNode[] = [\n <Text key=\"body\">\n <Trans t={t} i18nKey={`errorCodes.${errorCodeKey}.body`} components={transComponents} />\n </Text>,\n ]\n\n if (errorCodeKey === 'R29') {\n const achCodes = Object.values(t('errorCodes.R29.achCodes', { returnObjects: true }))\n description.push(\n <Flex key=\"instruction\" flexDirection=\"column\" gap={16}>\n <Text>{t('errorCodes.R29.listDescription')}</Text>\n <ul className={styles.compactList}>\n {achCodes.map((code, index) => (\n <li key={index}>{code}</li>\n ))}\n </ul>\n <Text>\n <Trans t={t} i18nKey=\"errorCodes.R29.instruction\" components={transComponents} />\n </Text>\n </Flex>,\n )\n } else {\n const instruction = t(`errorCodes.${errorCodeKey}.instruction`)\n if (instruction) {\n description.push(\n <Text key=\"instruction\">\n <Trans\n t={t}\n i18nKey={`errorCodes.${errorCodeKey}.instruction`}\n components={transComponents}\n />\n </Text>,\n )\n }\n }\n\n return {\n title: t(`errorCodes.${errorCodeKey}.title`),\n subtitle: t(`errorCodes.${errorCodeKey}.subtitle`),\n description,\n }\n}\n"],"names":["getErrorCodeKey","errorCode","useRecoveryCaseErrorCode","useI18n","t","useTranslation","Text","useComponentContext","errorCodeKey","transComponents","jsx","description","Trans","achCodes","jsxs","Flex","styles","code","index"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"useRecoveryCaseErrorCode.js","sources":["../../../../src/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { Trans, useTranslation } from 'react-i18next'\nimport styles from './RecoveryCaseErrorCode.module.scss'\nimport { Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\n\n/** @internal */\nexport interface RecoveryCaseErrorCodeContent {\n /** Localized title for the error code, or `null` when no error code is set. */\n title: string | null\n /** Localized subtitle for the error code, or `null` when no error code is set. */\n subtitle: string | null\n /** Localized description nodes for the error code, including any per-code instructions. Empty when no error code is set. */\n description: ReactNode[]\n}\n\ntype ErrorCodeKey = 'R01' | 'R02' | 'R16' | 'R29' | 'bankError'\n\nfunction getErrorCodeKey(errorCode: string | null | undefined): ErrorCodeKey {\n switch (errorCode) {\n case 'R01':\n return 'R01'\n case 'R02':\n return 'R02'\n case 'R16':\n return 'R16'\n case 'R29':\n return 'R29'\n default:\n return 'bankError'\n }\n}\n\n/** @internal */\nexport function useRecoveryCaseErrorCode(\n errorCode: string | null | undefined,\n): RecoveryCaseErrorCodeContent {\n useI18n('Payroll.RecoveryCasesResubmit')\n const { t } = useTranslation('Payroll.RecoveryCasesResubmit')\n const { Text } = useComponentContext()\n\n if (!errorCode) {\n return {\n title: null,\n subtitle: null,\n description: [],\n }\n }\n\n const errorCodeKey = getErrorCodeKey(errorCode)\n\n const transComponents = {\n medium: <Text as=\"span\" weight=\"medium\" />,\n }\n\n const description: ReactNode[] = [\n <Text key=\"body\">\n <Trans t={t} i18nKey={`errorCodes.${errorCodeKey}.body`} components={transComponents} />\n </Text>,\n ]\n\n if (errorCodeKey === 'R29') {\n const achCodes = Object.values(t('errorCodes.R29.achCodes', { returnObjects: true }))\n description.push(\n <Flex key=\"instruction\" flexDirection=\"column\" gap={16}>\n <Text>{t('errorCodes.R29.listDescription')}</Text>\n <ul className={styles.compactList}>\n {achCodes.map((code, index) => (\n <li key={index}>{code}</li>\n ))}\n </ul>\n <Text>\n <Trans t={t} i18nKey=\"errorCodes.R29.instruction\" components={transComponents} />\n </Text>\n </Flex>,\n )\n } else {\n const instruction = t(`errorCodes.${errorCodeKey}.instruction`)\n if (instruction) {\n description.push(\n <Text key=\"instruction\">\n <Trans\n t={t}\n i18nKey={`errorCodes.${errorCodeKey}.instruction`}\n components={transComponents}\n />\n </Text>,\n )\n }\n }\n\n return {\n title: t(`errorCodes.${errorCodeKey}.title`),\n subtitle: t(`errorCodes.${errorCodeKey}.subtitle`),\n description,\n }\n}\n"],"names":["getErrorCodeKey","errorCode","useRecoveryCaseErrorCode","useI18n","t","useTranslation","Text","useComponentContext","errorCodeKey","transComponents","jsx","description","Trans","achCodes","jsxs","Flex","styles","code","index"],"mappings":";;;;;;;AAmBA,SAASA,EAAgBC,GAAoD;AAC3E,UAAQA,GAAA;AAAA,IACN,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT;AACE,aAAO;AAAA,EAAA;AAEb;AAGO,SAASC,EACdD,GAC8B;AAC9B,EAAAE,EAAQ,+BAA+B;AACvC,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,+BAA+B,GACtD,EAAE,MAAAC,EAAA,IAASC,EAAA;AAEjB,MAAI,CAACN;AACH,WAAO;AAAA,MACL,OAAO;AAAA,MACP,UAAU;AAAA,MACV,aAAa,CAAA;AAAA,IAAC;AAIlB,QAAMO,IAAeR,EAAgBC,C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D,aAAAG;AAAA,EAAA;AAEJ;"}
|
|
@@ -1,2 +1,23 @@
|
|
|
1
1
|
import { TransitionFlowProps } from './TransitionFlowComponents';
|
|
2
|
+
/**
|
|
3
|
+
* Multi-step flow for running a transition payroll that covers the gap between an old and new pay schedule.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* Starts on the creation step (configure check date, deductions, and tax withholding for the
|
|
7
|
+
* transition pay period). After the payroll is created, the flow hands off to the standard
|
|
8
|
+
* payroll execution experience — configure compensation, review, submit, and view receipts.
|
|
9
|
+
*
|
|
10
|
+
* If a `payrollUuid` is supplied, the flow skips creation and resumes directly in execution.
|
|
11
|
+
*
|
|
12
|
+
* | Event | Description | Data |
|
|
13
|
+
* | ----- | ----------- | ---- |
|
|
14
|
+
* | `breadcrumb/navigate` | Fired when the user navigates back to the creation step via breadcrumbs | `{ key: string }` |
|
|
15
|
+
* | `transition/created` | Fired when the transition payroll is created and the flow advances to execution | `{ payrollUuid: string }` |
|
|
16
|
+
*
|
|
17
|
+
* Once execution begins, all standard run-payroll events are emitted as well.
|
|
18
|
+
*
|
|
19
|
+
* @param props - See {@link TransitionFlowProps}.
|
|
20
|
+
* @returns The transition payroll flow.
|
|
21
|
+
* @public
|
|
22
|
+
*/
|
|
2
23
|
export declare function TransitionFlow({ companyId, startDate, endDate, payScheduleUuid, payrollUuid, onEvent, }: TransitionFlowProps): import("react").JSX.Element;
|