@gusto/embedded-react-sdk 0.31.1 → 0.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +40 -0
- package/dist/assets/icons/icon-arrow-right.svg.js +10 -0
- package/dist/assets/icons/icon-arrow-right.svg.js.map +1 -0
- package/dist/components/Base/Base.js +46 -45
- package/dist/components/Base/Base.js.map +1 -1
- package/dist/components/Base/useBase.d.ts +2 -3
- package/dist/components/Base/useBase.js.map +1 -1
- package/dist/components/Base/useBaseSubmit.js +32 -19
- package/dist/components/Base/useBaseSubmit.js.map +1 -1
- package/dist/components/Common/DataView/DataView.js +1 -1
- package/dist/components/Common/DocumentList/DocumentList.js +1 -1
- package/dist/components/Common/DocumentViewer/DocumentViewer.js +1 -1
- package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.js +1 -1
- package/dist/components/Common/RequirementsList/RequirementsList.js +1 -1
- package/dist/components/Common/RequirementsList/RequirementsList.js.map +1 -1
- package/dist/components/Common/RequirementsList/RequirementsList.module.scss.js +1 -1
- package/dist/components/Common/SignatureForm/SignatureForm.js +12 -10
- package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormActions.js +3 -2
- package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormFields.js +7 -6
- package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
- package/dist/components/Common/UI/Box/Box.d.ts +2 -0
- package/dist/components/Common/UI/Box/Box.js +13 -0
- package/dist/components/Common/UI/Box/Box.js.map +1 -0
- package/dist/components/Common/UI/Box/Box.module.scss.js +12 -0
- package/dist/components/Common/UI/Box/Box.module.scss.js.map +1 -0
- package/dist/components/Common/UI/Box/BoxTypes.d.ts +15 -0
- package/dist/components/Common/UI/Box/index.d.ts +2 -0
- package/dist/components/Common/UI/Dialog/Dialog.js +1 -1
- package/dist/components/Common/UI/Input/InputTypes.d.ts +1 -1
- package/dist/components/Common/UI/Input/InputTypes.js.map +1 -1
- package/dist/components/Common/UI/List/List.module.scss.js +1 -1
- package/dist/components/Common/UI/Modal/Modal.js +1 -1
- package/dist/components/Common/UI/Tabs/Tabs.js +1 -1
- package/dist/components/Common/UI/TextInput/TextInput.js +30 -28
- package/dist/components/Common/UI/TextInput/TextInput.js.map +1 -1
- package/dist/components/Common/UI/TextInput/TextInputTypes.d.ts +1 -1
- package/dist/components/Common/UI/TextInput/TextInputTypes.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatory.js +3 -2
- package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +4 -3
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +3 -2
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +12 -12
- 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/Actions.js +3 -2
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +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/TitleSelect.js +5 -5
- package/dist/components/Company/AssignSignatory/TitleSelect.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/Actions.js +9 -8
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js +7 -5
- package/dist/components/Company/BankAccount/BankAccountForm/Form.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/BankAccount/BankAccountList/Actions.js +3 -2
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +7 -6
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +7 -5
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +3 -2
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +9 -8
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.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/SignatureForm/SignatureForm.js +4 -3
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +5 -4
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Actions.js +7 -6
- package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Company/FederalTaxes/FederalTaxes.js +4 -3
- package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Form.js +5 -3
- package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +7 -6
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Actions.js +8 -7
- package/dist/components/Company/Industry/Actions.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/Edit.js +3 -2
- package/dist/components/Company/Industry/Edit.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Actions.js +7 -6
- package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Form.js +1 -1
- package/dist/components/Company/Locations/LocationForm/LocationForm.js +4 -3
- package/dist/components/Company/Locations/LocationForm/LocationForm.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/Actions.js +3 -2
- package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/List.js +7 -6
- package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +4 -3
- package/dist/components/Company/Locations/LocationsList/LocationsList.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/Completed.js +12 -10
- package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js +39 -26
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +8 -7
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.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/PaySchedule.js +25 -22
- package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Actions.js +3 -2
- package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Edit.js +15 -15
- package/dist/components/Company/PaySchedule/_parts/Head.js +13 -11
- package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/List.js +15 -13
- package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
- package/dist/components/Company/PaySchedule/usePaySchedule.js +7 -6
- package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +3 -2
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
- 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/Actions.js +3 -2
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js +3 -2
- package/dist/components/Company/StateTaxes/StateTaxesList/List.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/Company/index.js +20 -20
- package/dist/components/Contractor/Address/Address.js +7 -7
- package/dist/components/Contractor/Address/Address.js.map +1 -1
- package/dist/components/Contractor/Address/Form.js +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/ContractorList/index.js +32 -31
- package/dist/components/Contractor/ContractorList/index.js.map +1 -1
- package/dist/components/Contractor/NewHireReport/NewHireReport.js +14 -13
- package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +12 -11
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +3 -2
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +4 -3
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js +135 -108
- package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +4 -2
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentFormSchema.d.ts +84 -0
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentFormSchema.js +23 -0
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentFormSchema.js.map +1 -0
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.d.ts +3 -31
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +63 -69
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.d.ts +2 -1
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js +29 -29
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.d.ts +2 -1
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +32 -29
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js +0 -1
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js +4 -2
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js +8 -6
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js +4 -2
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +28 -27
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
- package/dist/components/Contractor/Profile/ContractorProfileForm.js +15 -15
- package/dist/components/Contractor/Profile/useContractorProfile.js +4 -3
- package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
- package/dist/components/Contractor/Submit/Submit.js +21 -20
- package/dist/components/Contractor/Submit/Submit.js.map +1 -1
- package/dist/components/Employee/Compensation/Actions.js +13 -12
- package/dist/components/Employee/Compensation/Actions.js.map +1 -1
- package/dist/components/Employee/Compensation/Edit.js +17 -16
- package/dist/components/Employee/Compensation/Edit.js.map +1 -1
- package/dist/components/Employee/Compensation/List.js +23 -22
- package/dist/components/Employee/Compensation/List.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +12 -11
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +13 -12
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +13 -12
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +8 -7
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js.map +1 -1
- package/dist/components/Employee/Deductions/stateMachine.js +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +9 -8
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +24 -22
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js +4 -2
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.d.ts +1 -0
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +5 -4
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentSigner.js +9 -9
- package/dist/components/Employee/DocumentSigner/DocumentSigner.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js +49 -43
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.js +150 -111
- package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +3 -2
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +5 -4
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/documentSignerStateMachine.d.ts +1 -0
- package/dist/components/Employee/DocumentSigner/documentSignerStateMachine.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/stateMachine.js +34 -22
- package/dist/components/Employee/DocumentSigner/stateMachine.js.map +1 -1
- package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.js +4 -2
- package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.js.map +1 -1
- package/dist/components/Employee/EmployeeList/Actions.js +7 -6
- package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
- package/dist/components/Employee/EmployeeList/EmployeeList.js +4 -3
- package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
- package/dist/components/Employee/EmployeeList/Head.js +7 -5
- package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
- package/dist/components/Employee/EmployeeList/List.js +3 -2
- package/dist/components/Employee/EmployeeList/List.js.map +1 -1
- package/dist/components/Employee/EmployeeList/useEmployeeList.js +5 -4
- package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/Actions.js +6 -5
- package/dist/components/Employee/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/FederalForm.js +12 -11
- package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/FederalTaxes.js +16 -15
- package/dist/components/Employee/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +5 -4
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Employee/Landing/Landing.js +50 -44
- package/dist/components/Employee/Landing/Landing.js.map +1 -1
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +7 -7
- package/dist/components/Employee/PaymentMethod/Actions.js +6 -5
- package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +5 -4
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js +3 -2
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +7 -6
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/Split.js +11 -10
- package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +7 -6
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
- package/dist/components/Employee/Profile/Actions.js +6 -5
- package/dist/components/Employee/Profile/Actions.js.map +1 -1
- package/dist/components/Employee/Profile/AdminPersonalDetails.js +9 -8
- package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
- package/dist/components/Employee/Profile/HomeAddress.js +1 -1
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js +2 -2
- package/dist/components/Employee/Profile/useProfile.js +5 -4
- package/dist/components/Employee/Profile/useProfile.js.map +1 -1
- package/dist/components/Employee/StateTaxes/Actions.js +6 -5
- package/dist/components/Employee/StateTaxes/Actions.js.map +1 -1
- package/dist/components/Employee/StateTaxes/StateTaxes.js +29 -29
- package/dist/components/Employee/StateTaxes/StateTaxes.js.map +1 -1
- package/dist/components/Employee/StateTaxes/useStateTaxes.js +5 -4
- package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
- package/dist/components/Employee/Taxes/Actions.js +7 -6
- package/dist/components/Employee/Taxes/Actions.js.map +1 -1
- package/dist/components/Employee/Taxes/FederalForm.js +14 -13
- package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/Taxes/Taxes.js +19 -19
- package/dist/components/Employee/Taxes/Taxes.js.map +1 -1
- package/dist/components/Employee/Taxes/useTaxes.js +5 -4
- package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
- package/dist/components/Employee/index.js +22 -22
- package/dist/components/Flow/Flow.js +9 -7
- package/dist/components/Flow/Flow.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js +17 -16
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.d.ts +0 -1
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js +32 -37
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequests.d.ts +1 -2
- package/dist/components/InformationRequests/InformationRequests.js +36 -43
- package/dist/components/InformationRequests/InformationRequests.js.map +1 -1
- package/dist/components/InformationRequests/index.js +4 -4
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +10 -9
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js.map +1 -1
- package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js +23 -21
- package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.d.ts +2 -0
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js +79 -0
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js.map +1 -0
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.d.ts +2 -0
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js +47 -0
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js.map +1 -0
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationTypes.d.ts +14 -0
- package/dist/components/Payroll/OffCycleCreation/index.d.ts +3 -0
- package/dist/components/Payroll/OffCycleDeductionsSetting/OffCycleDeductionsSetting.d.ts +2 -0
- package/dist/components/Payroll/OffCycleDeductionsSetting/OffCycleDeductionsSetting.js +44 -0
- package/dist/components/Payroll/OffCycleDeductionsSetting/OffCycleDeductionsSetting.js.map +1 -0
- package/dist/components/Payroll/OffCycleDeductionsSetting/index.d.ts +3 -0
- package/dist/components/Payroll/OffCycleDeductionsSetting/types.d.ts +10 -0
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.d.ts +1 -2
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js +37 -0
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js.map +1 -0
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.module.scss.js +12 -0
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.module.scss.js.map +1 -0
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.d.ts +0 -4
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.js +48 -0
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.js.map +1 -0
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.js +18 -0
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.js.map +1 -0
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelection.js +26 -27
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelection.js.map +1 -1
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.d.ts +3 -3
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js +17 -16
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.d.ts +2 -0
- package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModalTypes.d.ts +8 -0
- package/dist/components/Payroll/OffCycleTaxWithholdingModal/index.d.ts +3 -0
- package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTable.d.ts +2 -0
- package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes.d.ts +17 -0
- package/dist/components/Payroll/OffCycleTaxWithholdingTable/index.d.ts +3 -0
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.d.ts +3 -8
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +38 -35
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +25 -33
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/payrollHelpers.d.ts +2 -0
- package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js +21 -19
- package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +26 -26
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +36 -36
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +21 -19
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +17 -15
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js +32 -32
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +20 -18
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +70 -67
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.d.ts +2 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +38 -36
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.d.ts +2 -1
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js +20 -20
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js.map +1 -1
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +4 -3
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js +4 -3
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js +12 -11
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js +5 -3
- package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js.map +1 -1
- package/dist/components/Payroll/index.d.ts +4 -0
- package/dist/components/Payroll/index.js +22 -18
- package/dist/components/Payroll/index.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.js +4 -3
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js +48 -46
- package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js.map +1 -1
- package/dist/contexts/ComponentAdapter/componentAdapterTypes.d.ts +1 -0
- package/dist/contexts/ComponentAdapter/useComponentContext.d.ts +2 -0
- package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +3 -2
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/contexts/ThemeProvider/theme.d.ts +1 -0
- package/dist/contexts/ThemeProvider/theme.js +1 -0
- package/dist/contexts/ThemeProvider/theme.js.map +1 -1
- package/dist/helpers/apiErrorToList.js +14 -8
- package/dist/helpers/apiErrorToList.js.map +1 -1
- package/dist/helpers/dateFormatting.js +61 -45
- package/dist/helpers/dateFormatting.js.map +1 -1
- package/dist/helpers/formattedStrings.d.ts +1 -0
- package/dist/helpers/formattedStrings.js +21 -20
- package/dist/helpers/formattedStrings.js.map +1 -1
- package/dist/hooks/useOverflowDetection/useOverflowDetection.js +5 -6
- package/dist/i18n/I18n.js +7 -7
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Contractor.Payments.CreatePayment.json.js +12 -12
- package/dist/i18n/en/Employee.EmployeeDocuments.json.js +1 -1
- package/dist/i18n/en/Employee.I9SignatureForm.json.js +83 -65
- package/dist/i18n/en/Employee.I9SignatureForm.json.js.map +1 -1
- package/dist/i18n/en/Employee.Landing.json.js +7 -9
- package/dist/i18n/en/Employee.Landing.json.js.map +1 -1
- package/dist/i18n/en/Payroll.OffCycleCreation.json.js +14 -0
- package/dist/i18n/en/Payroll.OffCycleCreation.json.js.map +1 -0
- package/dist/i18n/en/Payroll.OffCycleDeductionsSetting.json.js +12 -0
- package/dist/i18n/en/Payroll.OffCycleDeductionsSetting.json.js.map +1 -0
- package/dist/i18n/en/Payroll.OffCycleTaxWithholding.json.js +18 -0
- package/dist/i18n/en/Payroll.OffCycleTaxWithholding.json.js.map +1 -0
- package/dist/i18n/en/Payroll.PayrollBlocker.json.js +21 -19
- package/dist/i18n/en/Payroll.PayrollBlocker.json.js.map +1 -1
- package/dist/i18n/en/Payroll.PayrollOverview.json.js +1 -1
- package/dist/shared/constants.d.ts +4 -0
- package/dist/shared/constants.js +6 -4
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +76 -2
- package/docs/reference/endpoint-inventory.json +1706 -0
- package/package.json +27 -11
- package/dist/components/Employee/Landing/Landing.module.scss.js +0 -8
- package/dist/components/Employee/Landing/Landing.module.scss.js.map +0 -1
package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { OffCycleReason } from './types';
|
|
2
2
|
interface OffCycleReasonSelectionPresentationProps {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
name: string;
|
|
4
|
+
onChange?: (value: OffCycleReason) => void;
|
|
5
5
|
}
|
|
6
|
-
export declare function OffCycleReasonSelectionPresentation({
|
|
6
|
+
export declare function OffCycleReasonSelectionPresentation({ name, onChange, }: OffCycleReasonSelectionPresentationProps): import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export {};
|
package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import { useTranslation as
|
|
4
|
-
import
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as n } from "react";
|
|
3
|
+
import { useTranslation as s } from "react-i18next";
|
|
4
|
+
import "../../../shared/constants.js";
|
|
5
|
+
import "classnames";
|
|
6
|
+
import { RadioGroupField as l } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
7
|
+
import "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
5
8
|
function d({
|
|
6
|
-
|
|
7
|
-
|
|
9
|
+
name: e,
|
|
10
|
+
onChange: i
|
|
8
11
|
}) {
|
|
9
|
-
const { t: o } =
|
|
12
|
+
const { t: o } = s("Payroll.OffCycleReasonSelection"), t = n(
|
|
10
13
|
() => [
|
|
11
14
|
{
|
|
12
15
|
value: "correction",
|
|
@@ -20,17 +23,15 @@ function d({
|
|
|
20
23
|
}
|
|
21
24
|
],
|
|
22
25
|
[o]
|
|
23
|
-
)
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return /* @__PURE__ */ l(
|
|
27
|
-
t,
|
|
26
|
+
);
|
|
27
|
+
return /* @__PURE__ */ r(
|
|
28
|
+
l,
|
|
28
29
|
{
|
|
30
|
+
name: e,
|
|
29
31
|
label: o("title"),
|
|
30
|
-
options:
|
|
31
|
-
|
|
32
|
-
onChange:
|
|
33
|
-
isRequired: !0
|
|
32
|
+
options: t,
|
|
33
|
+
isRequired: !0,
|
|
34
|
+
onChange: i
|
|
34
35
|
}
|
|
35
36
|
);
|
|
36
37
|
}
|
package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OffCycleReasonSelectionPresentation.js","sources":["../../../../src/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport type { OffCycleReason } from './types'\nimport {
|
|
1
|
+
{"version":3,"file":"OffCycleReasonSelectionPresentation.js","sources":["../../../../src/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport type { OffCycleReason } from './types'\nimport { RadioGroupField } from '@/components/Common'\n\ninterface OffCycleReasonSelectionPresentationProps {\n name: string\n onChange?: (value: OffCycleReason) => void\n}\n\nexport function OffCycleReasonSelectionPresentation({\n name,\n onChange,\n}: OffCycleReasonSelectionPresentationProps) {\n const { t } = useTranslation('Payroll.OffCycleReasonSelection')\n\n const options = useMemo(\n () => [\n {\n value: 'correction' as OffCycleReason,\n label: t('options.correction.label'),\n description: t('options.correction.description'),\n },\n {\n value: 'bonus' as OffCycleReason,\n label: t('options.bonus.label'),\n description: t('options.bonus.description'),\n },\n ],\n [t],\n )\n\n return (\n <RadioGroupField<OffCycleReason>\n name={name}\n label={t('title')}\n options={options}\n isRequired\n onChange={onChange}\n />\n )\n}\n"],"names":["OffCycleReasonSelectionPresentation","name","onChange","t","useTranslation","options","useMemo","jsx","RadioGroupField"],"mappings":";;;;;;;AAUO,SAASA,EAAoC;AAAA,EAClD,MAAAC;AAAA,EACA,UAAAC;AACF,GAA6C;AAC3C,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,iCAAiC,GAExDC,IAAUC;AAAA,IACd,MAAM;AAAA,MACJ;AAAA,QACE,OAAO;AAAA,QACP,OAAOH,EAAE,0BAA0B;AAAA,QACnC,aAAaA,EAAE,gCAAgC;AAAA,MAAA;AAAA,MAEjD;AAAA,QACE,OAAO;AAAA,QACP,OAAOA,EAAE,qBAAqB;AAAA,QAC9B,aAAaA,EAAE,2BAA2B;AAAA,MAAA;AAAA,IAC5C;AAAA,IAEF,CAACA,CAAC;AAAA,EAAA;AAGJ,SACE,gBAAAI;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAAP;AAAA,MACA,OAAOE,EAAE,OAAO;AAAA,MAChB,SAAAE;AAAA,MACA,YAAU;AAAA,MACV,UAAAH;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModalTypes.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { OffCycleTaxWithholdingConfig } from '../OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes';
|
|
2
|
+
export type { OffCycleTaxWithholdingConfig };
|
|
3
|
+
export interface OffCycleTaxWithholdingModalProps {
|
|
4
|
+
isOpen: boolean;
|
|
5
|
+
defaultConfig: OffCycleTaxWithholdingConfig;
|
|
6
|
+
onDone: (config: OffCycleTaxWithholdingConfig) => void;
|
|
7
|
+
onCancel: () => void;
|
|
8
|
+
}
|
package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { WithholdingPayPeriod } from '@gusto/embedded-api/models/operations/postv1companiescompanyidpayrolls';
|
|
2
|
+
import { WithholdingType } from '../OffCycleReasonSelection';
|
|
3
|
+
export interface WageTypeGroup {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
category: 'regular' | 'supplemental' | 'reimbursement';
|
|
8
|
+
}
|
|
9
|
+
export interface OffCycleTaxWithholdingConfig {
|
|
10
|
+
withholdingPayPeriod: WithholdingPayPeriod;
|
|
11
|
+
withholdingRate: WithholdingType;
|
|
12
|
+
}
|
|
13
|
+
export interface OffCycleTaxWithholdingTableProps {
|
|
14
|
+
wageTypeGroups: WageTypeGroup[];
|
|
15
|
+
config: OffCycleTaxWithholdingConfig;
|
|
16
|
+
onEditClick: () => void;
|
|
17
|
+
}
|
|
@@ -2,13 +2,8 @@ import { ApiPayrollBlocker } from '../payrollHelpers';
|
|
|
2
2
|
interface PayrollBlockerAlertsProps {
|
|
3
3
|
blockers: ApiPayrollBlocker[];
|
|
4
4
|
className?: string;
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
onViewBlockersClick?: () => void;
|
|
6
|
+
viewBlockersLabel?: string;
|
|
7
7
|
}
|
|
8
|
-
|
|
9
|
-
* PayrollBlockerAlerts - Alert-style component for inline blocker display
|
|
10
|
-
* Shows single blocker as alert, or multiple blockers as summary with "Review" button
|
|
11
|
-
* Returns null for empty blocker arrays
|
|
12
|
-
*/
|
|
13
|
-
export declare function PayrollBlockerAlerts({ blockers, onMultipleViewClick, multipleViewLabel, className, }: PayrollBlockerAlertsProps): import("react/jsx-runtime").JSX.Element | null;
|
|
8
|
+
export declare function PayrollBlockerAlerts({ blockers, onViewBlockersClick, viewBlockersLabel, className, }: PayrollBlockerAlertsProps): import("react/jsx-runtime").JSX.Element | null;
|
|
14
9
|
export {};
|
|
@@ -1,53 +1,56 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useTranslation as
|
|
3
|
-
import { getBlockerTranslationKeys as P } from "../payrollHelpers.js";
|
|
4
|
-
import { useComponentContext as
|
|
5
|
-
import { Flex as
|
|
1
|
+
import { jsx as e, jsxs as f } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation as A } from "react-i18next";
|
|
3
|
+
import { hasActionableBlockers as K, getBlockerTranslationKeys as P, isActionableBlocker as D } from "../payrollHelpers.js";
|
|
4
|
+
import { useComponentContext as C } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
5
|
+
import { Flex as B } from "../../../Common/Flex/Flex.js";
|
|
6
|
+
import "classnames";
|
|
7
|
+
import "../../../../shared/constants.js";
|
|
6
8
|
import "react";
|
|
7
|
-
import { useI18n as
|
|
8
|
-
function
|
|
9
|
+
import { useI18n as I } from "../../../../i18n/I18n.js";
|
|
10
|
+
function q({
|
|
9
11
|
blockers: o,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
className:
|
|
12
|
+
onViewBlockersClick: n,
|
|
13
|
+
viewBlockersLabel: y,
|
|
14
|
+
className: a
|
|
13
15
|
}) {
|
|
14
|
-
|
|
15
|
-
const { t
|
|
16
|
+
I("Payroll.PayrollBlocker");
|
|
17
|
+
const { t } = A("Payroll.PayrollBlocker"), { Alert: p, Button: d, Text: u, UnorderedList: x } = C();
|
|
16
18
|
if (o.length === 0)
|
|
17
19
|
return null;
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
defaultValue:
|
|
21
|
-
}),
|
|
22
|
-
defaultValue: r.message ||
|
|
23
|
-
}),
|
|
20
|
+
const s = o.length > 1, m = !!n && (s || K(o)), h = o.map((r) => {
|
|
21
|
+
const c = P(r.key), T = t(c.titleKey, {
|
|
22
|
+
defaultValue: t("defaultBlockerDescription")
|
|
23
|
+
}), k = t(c.descriptionKey, {
|
|
24
|
+
defaultValue: r.message || t("defaultBlockerDescription")
|
|
25
|
+
}), v = D(r.key) ? void 0 : t(c.helpTextKey, { defaultValue: t("defaultBlockerHelp") });
|
|
24
26
|
return {
|
|
25
27
|
...r,
|
|
26
|
-
title:
|
|
27
|
-
description:
|
|
28
|
-
helpText:
|
|
28
|
+
title: T,
|
|
29
|
+
description: k,
|
|
30
|
+
helpText: v
|
|
29
31
|
};
|
|
30
|
-
}), t =
|
|
31
|
-
if (!
|
|
32
|
-
return /* @__PURE__ */
|
|
33
|
-
/* @__PURE__ */
|
|
34
|
-
|
|
32
|
+
}), i = y || t(s ? "viewAllBlockers" : "viewBlocker"), l = h[0];
|
|
33
|
+
if (!s && l)
|
|
34
|
+
return /* @__PURE__ */ e(p, { status: "error", label: l.title, className: a, children: /* @__PURE__ */ f(B, { flexDirection: "column", gap: 8, children: [
|
|
35
|
+
/* @__PURE__ */ e(u, { children: l.description }),
|
|
36
|
+
l.helpText && l.helpText !== l.description && /* @__PURE__ */ e(u, { variant: "supporting", size: "sm", children: l.helpText }),
|
|
37
|
+
m && /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(d, { variant: "secondary", onClick: n, title: i, children: i }) })
|
|
35
38
|
] }) });
|
|
36
|
-
const
|
|
37
|
-
return /* @__PURE__ */
|
|
38
|
-
|
|
39
|
+
const g = h.map((r) => r.title);
|
|
40
|
+
return /* @__PURE__ */ e(
|
|
41
|
+
p,
|
|
39
42
|
{
|
|
40
43
|
status: "error",
|
|
41
|
-
label:
|
|
42
|
-
className:
|
|
43
|
-
children: /* @__PURE__ */
|
|
44
|
-
/* @__PURE__ */
|
|
45
|
-
|
|
44
|
+
label: t("multipleIssuesTitle", { count: o.length }),
|
|
45
|
+
className: a,
|
|
46
|
+
children: /* @__PURE__ */ f(B, { flexDirection: "column", gap: 16, children: [
|
|
47
|
+
/* @__PURE__ */ e(x, { items: g }),
|
|
48
|
+
m && /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(d, { variant: "secondary", onClick: n, title: i, children: i }) })
|
|
46
49
|
] })
|
|
47
50
|
}
|
|
48
51
|
);
|
|
49
52
|
}
|
|
50
53
|
export {
|
|
51
|
-
|
|
54
|
+
q as PayrollBlockerAlerts
|
|
52
55
|
};
|
|
53
56
|
//# sourceMappingURL=PayrollBlockerAlerts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PayrollBlockerAlerts.js","sources":["../../../../../src/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport {
|
|
1
|
+
{"version":3,"file":"PayrollBlockerAlerts.js","sources":["../../../../../src/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport {\n type ApiPayrollBlocker,\n getBlockerTranslationKeys,\n hasActionableBlockers,\n isActionableBlocker,\n} from '../payrollHelpers'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { Flex } from '@/components/Common'\nimport { useI18n } from '@/i18n'\n\ninterface PayrollBlockerAlertsProps {\n blockers: ApiPayrollBlocker[]\n className?: string\n onViewBlockersClick?: () => void\n viewBlockersLabel?: string\n}\n\nexport function PayrollBlockerAlerts({\n blockers,\n onViewBlockersClick,\n viewBlockersLabel,\n className,\n}: PayrollBlockerAlertsProps) {\n useI18n('Payroll.PayrollBlocker')\n const { t } = useTranslation('Payroll.PayrollBlocker')\n const { Alert, Button, Text, UnorderedList } = useComponentContext()\n\n if (blockers.length === 0) {\n return null\n }\n\n const hasMultipleBlockers = blockers.length > 1\n const showViewBlockersCta =\n Boolean(onViewBlockersClick) && (hasMultipleBlockers || hasActionableBlockers(blockers))\n\n const enrichedBlockers = blockers.map(blocker => {\n const translationKeys = getBlockerTranslationKeys(blocker.key)\n\n const title = t(translationKeys.titleKey, {\n defaultValue: t('defaultBlockerDescription'),\n })\n const description = t(translationKeys.descriptionKey, {\n defaultValue: blocker.message || t('defaultBlockerDescription'),\n })\n const helpText = isActionableBlocker(blocker.key)\n ? undefined\n : t(translationKeys.helpTextKey, { defaultValue: t('defaultBlockerHelp') })\n\n return {\n ...blocker,\n title,\n description,\n helpText,\n }\n })\n\n const ctaLabel = viewBlockersLabel || t(hasMultipleBlockers ? 'viewAllBlockers' : 'viewBlocker')\n\n const singleBlocker = enrichedBlockers[0]\n\n if (!hasMultipleBlockers && singleBlocker) {\n return (\n <Alert status=\"error\" label={singleBlocker.title} className={className}>\n <Flex flexDirection=\"column\" gap={8}>\n <Text>{singleBlocker.description}</Text>\n {singleBlocker.helpText && singleBlocker.helpText !== singleBlocker.description && (\n <Text variant=\"supporting\" size=\"sm\">\n {singleBlocker.helpText}\n </Text>\n )}\n {showViewBlockersCta && (\n <div>\n <Button variant=\"secondary\" onClick={onViewBlockersClick} title={ctaLabel}>\n {ctaLabel}\n </Button>\n </div>\n )}\n </Flex>\n </Alert>\n )\n }\n\n const listItems = enrichedBlockers.map(blocker => blocker.title)\n\n return (\n <Alert\n status=\"error\"\n label={t('multipleIssuesTitle', { count: blockers.length })}\n className={className}\n >\n <Flex flexDirection=\"column\" gap={16}>\n <UnorderedList items={listItems} />\n {showViewBlockersCta && (\n <div>\n <Button variant=\"secondary\" onClick={onViewBlockersClick} title={ctaLabel}>\n {ctaLabel}\n </Button>\n </div>\n )}\n </Flex>\n </Alert>\n )\n}\n"],"names":["PayrollBlockerAlerts","blockers","onViewBlockersClick","viewBlockersLabel","className","useI18n","useTranslation","Alert","Button","Text","UnorderedList","useComponentContext","hasMultipleBlockers","showViewBlockersCta","hasActionableBlockers","enrichedBlockers","blocker","translationKeys","getBlockerTranslationKeys","title","description","helpText","isActionableBlocker","ctaLabel","singleBlocker","jsx","jsxs","Flex","listItems"],"mappings":";;;;;;;;;AAkBO,SAASA,EAAqB;AAAA,EACnC,UAAAC;AAAA,EACA,qBAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,WAAAC;AACF,GAA8B;AAC5B,EAAAC,EAAQ,wBAAwB;AAChC,QAAM,EAAE,EAAA,IAAMC,EAAe,wBAAwB,GAC/C,EAAE,OAAAC,GAAO,QAAAC,GAAQ,MAAAC,GAAM,eAAAC,EAAA,IAAkBC,EAAA;AAE/C,MAAIV,EAAS,WAAW;AACtB,WAAO;AAGT,QAAMW,I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AQ,KAAK;AAE/D,SACE,gBAAAS;AAAA,IAAClB;AAAA,IAAA;AAAA,MACC,QAAO;AAAA,MACP,OAAO,EAAE,uBAAuB,EAAE,OAAON,EAAS,QAAQ;AAAA,MAC1D,WAAAG;AAAA,MAEA,UAAA,gBAAAsB,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,QAAA,gBAAAF,EAACf,GAAA,EAAc,OAAOkB,EAAA,CAAW;AAAA,QAChCf,KACC,gBAAAY,EAAC,OAAA,EACC,UAAA,gBAAAA,EAACjB,GAAA,EAAO,SAAQ,aAAY,SAASN,GAAqB,OAAOqB,GAC9D,UAAAA,EAAA,CACH,EAAA,CACF;AAAA,MAAA,EAAA,CAEJ;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -7,23 +7,23 @@ import { useRecoveryCasesGetSuspense as V } from "@gusto/embedded-api/react-quer
|
|
|
7
7
|
import { useInformationRequestsGetInformationRequestsSuspense as F } from "@gusto/embedded-api/react-query/informationRequestsGetInformationRequests";
|
|
8
8
|
import { InformationRequestStatus as K } from "@gusto/embedded-api/models/components/informationrequest";
|
|
9
9
|
import { getBlockerTranslationKeys as G } from "../payrollHelpers.js";
|
|
10
|
-
import
|
|
10
|
+
import v from "./PayrollBlockerList.module.scss.js";
|
|
11
11
|
import { useComponentContext as M } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
12
12
|
import { FlexItem as j, Flex as a } from "../../../Common/Flex/Flex.js";
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
13
|
+
import { recoveryCasesEvents as $, informationRequestEvents as H } from "../../../../shared/constants.js";
|
|
14
|
+
import { DataView as Q } from "../../../Common/DataView/DataView.js";
|
|
15
|
+
import { useDataView as Y } from "../../../Common/DataView/useDataView.js";
|
|
16
|
+
import { useComponentDictionary as z, useI18n as J } from "../../../../i18n/I18n.js";
|
|
17
|
+
import { RecoveryCases as W } from "../../RecoveryCases/RecoveryCases.js";
|
|
18
|
+
import { BaseComponent as X } from "../../../Base/Base.js";
|
|
18
19
|
import "../../../Base/useBase.js";
|
|
19
|
-
import { recoveryCasesEvents as W, informationRequestEvents as X } from "../../../../shared/constants.js";
|
|
20
20
|
import { InformationRequestsFlow as Z } from "../../../InformationRequests/InformationRequests.js";
|
|
21
21
|
function be(s) {
|
|
22
|
-
return /* @__PURE__ */ o(
|
|
22
|
+
return /* @__PURE__ */ o(X, { ...s, children: /* @__PURE__ */ o(ee, { ...s, children: s.children }) });
|
|
23
23
|
}
|
|
24
|
-
function ee({ className: s, companyId: n, dictionary:
|
|
25
|
-
|
|
26
|
-
const { t: r } = N("Payroll.PayrollBlocker"), { Button:
|
|
24
|
+
function ee({ className: s, companyId: n, dictionary: B, onEvent: u }) {
|
|
25
|
+
z("Payroll.PayrollBlocker", B), J("Payroll.PayrollBlocker");
|
|
26
|
+
const { t: r } = N("Payroll.PayrollBlocker"), { Button: D, Text: i, Heading: b, Alert: g } = M(), [x, f] = _({
|
|
27
27
|
id: 0,
|
|
28
28
|
alerts: []
|
|
29
29
|
}), E = d((e) => {
|
|
@@ -38,14 +38,14 @@ function ee({ className: s, companyId: n, dictionary: g, onEvent: u }) {
|
|
|
38
38
|
}));
|
|
39
39
|
}, []), p = d(
|
|
40
40
|
(e, t) => {
|
|
41
|
-
e ===
|
|
41
|
+
e === $.RECOVERY_CASE_RESUBMIT_DONE && c("recoveryCaseResubmitted"), e === H.INFORMATION_REQUEST_FORM_DONE && c("informationRequestResponded"), u(e, t);
|
|
42
42
|
},
|
|
43
43
|
[u, c]
|
|
44
44
|
), { data: A } = O({
|
|
45
45
|
companyUuid: n
|
|
46
|
-
}), { data:
|
|
46
|
+
}), { data: S } = V({
|
|
47
47
|
companyUuid: n
|
|
48
|
-
}), { data:
|
|
48
|
+
}), { data: q } = F({
|
|
49
49
|
companyUuid: n
|
|
50
50
|
}), y = (A.payrollBlockerList ?? []).map((e) => {
|
|
51
51
|
const t = e.key ?? "unknown", l = G(t), T = r(l.titleKey, {
|
|
@@ -58,11 +58,11 @@ function ee({ className: s, companyId: n, dictionary: g, onEvent: u }) {
|
|
|
58
58
|
title: T,
|
|
59
59
|
description: I
|
|
60
60
|
};
|
|
61
|
-
}),
|
|
61
|
+
}), w = S.recoveryCaseList ?? [], L = q.informationRequestList ?? [], h = w.some(
|
|
62
62
|
(e) => e.status !== "recovered"
|
|
63
|
-
), k =
|
|
64
|
-
(e) => e.
|
|
65
|
-
),
|
|
63
|
+
), k = L.some(
|
|
64
|
+
(e) => e.status !== K.Approved
|
|
65
|
+
), P = Y({
|
|
66
66
|
data: y,
|
|
67
67
|
columns: [
|
|
68
68
|
{
|
|
@@ -76,14 +76,14 @@ function ee({ className: s, companyId: n, dictionary: g, onEvent: u }) {
|
|
|
76
76
|
title: "",
|
|
77
77
|
render: (e) => {
|
|
78
78
|
const t = e.action;
|
|
79
|
-
return t ? /* @__PURE__ */ o(a, { justifyContent: "flex-end", alignItems: "center", children: /* @__PURE__ */ o(
|
|
79
|
+
return t ? /* @__PURE__ */ o(a, { justifyContent: "flex-end", alignItems: "center", children: /* @__PURE__ */ o(D, { variant: "secondary", onClick: t.onClick, title: t.label, children: t.label }) }) : null;
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
]
|
|
83
83
|
}), C = y.length > 0;
|
|
84
|
-
return C || h || k ? /* @__PURE__ */ o("div", { className: R(
|
|
84
|
+
return C || h || k ? /* @__PURE__ */ o("div", { className: R(v.root, s), children: /* @__PURE__ */ m(a, { flexDirection: "column", gap: 32, children: [
|
|
85
85
|
x.alerts.map((e) => /* @__PURE__ */ o(
|
|
86
|
-
|
|
86
|
+
g,
|
|
87
87
|
{
|
|
88
88
|
status: "success",
|
|
89
89
|
label: r(`alerts.${e.type}.title`),
|
|
@@ -96,19 +96,11 @@ function ee({ className: s, companyId: n, dictionary: g, onEvent: u }) {
|
|
|
96
96
|
)),
|
|
97
97
|
C && /* @__PURE__ */ m(a, { flexDirection: "column", gap: 20, children: [
|
|
98
98
|
/* @__PURE__ */ o(b, { as: "h2", styledAs: "h4", children: r("blockersListTitle") }),
|
|
99
|
-
/* @__PURE__ */ o(
|
|
99
|
+
/* @__PURE__ */ o(Q, { ...P, label: r("blockersListTitle") })
|
|
100
100
|
] }),
|
|
101
|
-
h && /* @__PURE__ */ o(
|
|
102
|
-
k && /* @__PURE__ */ o(
|
|
103
|
-
|
|
104
|
-
{
|
|
105
|
-
companyId: n,
|
|
106
|
-
filterByPayrollBlocking: !0,
|
|
107
|
-
withAlert: !1,
|
|
108
|
-
onEvent: p
|
|
109
|
-
}
|
|
110
|
-
)
|
|
111
|
-
] }) }) : /* @__PURE__ */ o("div", { className: R(B.root, s), children: /* @__PURE__ */ o(i, { children: r("noBlockersMessage") }) });
|
|
101
|
+
h && /* @__PURE__ */ o(W, { companyId: n, onEvent: p }),
|
|
102
|
+
k && /* @__PURE__ */ o(Z, { companyId: n, withAlert: !1, onEvent: p })
|
|
103
|
+
] }) }) : /* @__PURE__ */ o("div", { className: R(v.root, s), children: /* @__PURE__ */ o(i, { children: r("noBlockersMessage") }) });
|
|
112
104
|
}
|
|
113
105
|
export {
|
|
114
106
|
be as PayrollBlockerList
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PayrollBlockerList.js","sources":["../../../../../src/components/Payroll/PayrollBlocker/components/PayrollBlockerList.tsx"],"sourcesContent":["import { useState, useCallback } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport classNames from 'classnames'\nimport { usePayrollsGetBlockersSuspense } from '@gusto/embedded-api/react-query/payrollsGetBlockers'\nimport { useRecoveryCasesGetSuspense } from '@gusto/embedded-api/react-query/recoveryCasesGet'\nimport { useInformationRequestsGetInformationRequestsSuspense } from '@gusto/embedded-api/react-query/informationRequestsGetInformationRequests'\nimport { InformationRequestStatus } from '@gusto/embedded-api/models/components/informationrequest'\nimport { getBlockerTranslationKeys } from '../payrollHelpers'\nimport styles from './PayrollBlockerList.module.scss'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { Flex, FlexItem } from '@/components/Common'\nimport { DataView } from '@/components/Common/DataView/DataView'\nimport { useDataView } from '@/components/Common/DataView/useDataView'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { RecoveryCases } from '@/components/Payroll/RecoveryCases'\nimport { InformationRequestsFlow } from '@/components/InformationRequests'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { informationRequestEvents, recoveryCasesEvents, type EventType } from '@/shared/constants'\n\ntype ResponseAlertType = 'recoveryCaseResubmitted' | 'informationRequestResponded'\n\ninterface ResponseAlert {\n id: number\n type: ResponseAlertType\n}\n\ninterface ResponseAlertState {\n id: number\n alerts: ResponseAlert[]\n}\n\ninterface PayrollBlocker {\n id: string\n title: string\n description: string\n action?: {\n label: string\n onClick: () => void\n }\n}\n\ninterface PayrollBlockerListProps extends BaseComponentInterface<'Payroll.PayrollBlocker'> {\n companyId: string\n}\n\n/**\n * PayrollBlockerList - DataView-based component displaying payroll blockers\n * Shows each blocker with individual resolution buttons\n * Also displays recovery cases and information requests sections when applicable\n */\nexport function PayrollBlockerList(props: PayrollBlockerListProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ className, companyId, dictionary, onEvent }: PayrollBlockerListProps) {\n useComponentDictionary('Payroll.PayrollBlocker', dictionary)\n useI18n('Payroll.PayrollBlocker')\n const { t } = useTranslation('Payroll.PayrollBlocker')\n const { Button, Text, Heading, Alert } = useComponentContext()\n\n const [alertState, setAlertState] = useState<ResponseAlertState>({\n id: 0,\n alerts: [],\n })\n\n const handleDismissAlert = useCallback((alertId: number) => {\n setAlertState(prev => ({\n ...prev,\n alerts: prev.alerts.filter(alert => alert.id !== alertId),\n }))\n }, [])\n\n const addAlert = useCallback((alertType: ResponseAlertType) => {\n setAlertState(prev => ({\n id: prev.id + 1,\n alerts: [{ id: prev.id, type: alertType }, ...prev.alerts],\n }))\n }, [])\n\n const handleEvent = useCallback(\n (type: EventType, data?: unknown) => {\n if (type === recoveryCasesEvents.RECOVERY_CASE_RESUBMIT_DONE) {\n addAlert('recoveryCaseResubmitted')\n }\n\n if (type === informationRequestEvents.INFORMATION_REQUEST_FORM_DONE) {\n addAlert('informationRequestResponded')\n }\n\n onEvent(type, data)\n },\n [onEvent, addAlert],\n )\n\n const { data: blockersData } = usePayrollsGetBlockersSuspense({\n companyUuid: companyId,\n })\n\n const { data: recoveryCasesData } = useRecoveryCasesGetSuspense({\n companyUuid: companyId,\n })\n\n const { data: informationRequestsData } = useInformationRequestsGetInformationRequestsSuspense({\n companyUuid: companyId,\n })\n\n const payrollBlockerList = blockersData.payrollBlockerList ?? []\n const blockers: PayrollBlocker[] = payrollBlockerList.map(blocker => {\n const blockerKey = blocker.key ?? 'unknown'\n const translationKeys = getBlockerTranslationKeys(blockerKey)\n\n const title = t(translationKeys.titleKey, {\n defaultValue: blockerKey.replace(/_/g, ' ').replace(/\\b\\w/g, letter => letter.toUpperCase()),\n })\n\n const description = t(translationKeys.descriptionKey, {\n defaultValue: blocker.message || t('defaultBlockerDescription'),\n })\n\n return {\n id: blockerKey,\n title,\n description,\n }\n })\n\n const recoveryCases = recoveryCasesData.recoveryCaseList ?? []\n const informationRequests = informationRequestsData.informationRequestList ?? []\n\n const hasUnrecoveredCases = recoveryCases.some(\n recoveryCase => recoveryCase.status !== 'recovered',\n )\n\n const hasBlockingInformationRequests = informationRequests.some(\n request => request.blockingPayroll && request.status !== InformationRequestStatus.Approved,\n )\n\n const dataViewProps = useDataView({\n data: blockers,\n columns: [\n {\n title: t('blockerSectionLabel'),\n render: blocker => (\n <FlexItem flexGrow={1}>\n <Flex flexDirection=\"column\" gap={8}>\n <Text weight=\"semibold\">{blocker.title}</Text>\n <Text variant=\"supporting\">{blocker.description}</Text>\n </Flex>\n </FlexItem>\n ),\n },\n {\n title: '',\n render: blocker => {\n const action = blocker.action\n\n if (!action) {\n return null\n }\n\n return (\n <Flex justifyContent=\"flex-end\" alignItems=\"center\">\n <Button variant=\"secondary\" onClick={action.onClick} title={action.label}>\n {action.label}\n </Button>\n </Flex>\n )\n },\n },\n ],\n })\n\n const hasBlockers = blockers.length > 0\n const hasAnyContent = hasBlockers || hasUnrecoveredCases || hasBlockingInformationRequests\n\n if (!hasAnyContent) {\n return (\n <div className={classNames(styles.root, className)}>\n <Text>{t('noBlockersMessage')}</Text>\n </div>\n )\n }\n\n return (\n <div className={classNames(styles.root, className)}>\n <Flex flexDirection=\"column\" gap={32}>\n {alertState.alerts.map(alert => (\n <Alert\n key={alert.id}\n status=\"success\"\n label={t(`alerts.${alert.type}.title`)}\n onDismiss={() => {\n handleDismissAlert(alert.id)\n }}\n >\n <Text>{t(`alerts.${alert.type}.description`)}</Text>\n </Alert>\n ))}\n\n {hasBlockers && (\n <Flex flexDirection=\"column\" gap={20}>\n <Heading as=\"h2\" styledAs=\"h4\">\n {t('blockersListTitle')}\n </Heading>\n <DataView {...dataViewProps} label={t('blockersListTitle')} />\n </Flex>\n )}\n\n {hasUnrecoveredCases && <RecoveryCases companyId={companyId} onEvent={handleEvent} />}\n\n {hasBlockingInformationRequests && (\n <InformationRequestsFlow\n companyId={companyId}\n filterByPayrollBlocking\n withAlert={false}\n onEvent={handleEvent}\n />\n )}\n </Flex>\n </div>\n )\n}\n"],"names":["PayrollBlockerList","props","jsx","BaseComponent","Root","className","companyId","dictionary","onEvent","useComponentDictionary","useI18n","t","useTranslation","Button","Text","Heading","Alert","useComponentContext","alertState","setAlertState","useState","handleDismissAlert","useCallback","alertId","prev","alert","addAlert","alertType","handleEvent","type","data","recoveryCasesEvents","informationRequestEvents","blockersData","usePayrollsGetBlockersSuspense","recoveryCasesData","useRecoveryCasesGetSuspense","informationRequestsData","useInformationRequestsGetInformationRequestsSuspense","blockers","blocker","blockerKey","translationKeys","getBlockerTranslationKeys","title","letter","description","recoveryCases","informationRequests","hasUnrecoveredCases","recoveryCase","hasBlockingInformationRequests","request","InformationRequestStatus","dataViewProps","useDataView","FlexItem","jsxs","Flex","action","hasBlockers","classNames","styles","DataView","RecoveryCases","InformationRequestsFlow"],"mappings":";;;;;;;;;;;;;;;;;;;;AAkDO,SAASA,GAAmBC,GAAgC;AACjE,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,MAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,SAASG,GAAK,EAAE,WAAAC,GAAW,WAAAC,GAAW,YAAAC,GAAY,SAAAC,KAAoC;AACpF,EAAAC,EAAuB,0BAA0BF,CAAU,GAC3DG,EAAQ,wBAAwB;AAChC,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,wBAAwB,GAC/C,EAAE,QAAAC,GAAQ,MAAAC,GAAM,SAAAC,GAAS,OAAAC,EAAA,IAAUC,EAAA,GAEnC,CAACC,GAAYC,CAAa,IAAIC,EAA6B;AAAA,IAC/D,IAAI;AAAA,IACJ,QAAQ,CAAA;AAAA,EAAC,CACV,GAEKC,IAAqBC,EAAY,CAACC,MAAoB;AAC1D,IAAAJ,EAAc,CAAAK,OAAS;AAAA,MACrB,GAAGA;AAAA,MACH,QAAQA,EAAK,OAAO,OAAO,CAAAC,MAASA,EAAM,OAAOF,CAAO;AAAA,IAAA,EACxD;AAAA,EACJ,GAAG,CAAA,CAAE,GAECG,IAAWJ,EAAY,CAACK,MAAiC;AAC7D,IAAAR,EAAc,CAAAK,OAAS;AAAA,MACrB,IAAIA,EAAK,KAAK;AAAA,MACd,QAAQ,CAAC,EAAE,IAAIA,EAAK,IAAI,MAAMG,EAAA,GAAa,GAAGH,EAAK,MAAM;AAAA,IAAA,EACzD;AAAA,EACJ,GAAG,CAAA,CAAE,GAECI,IAAcN;AAAA,IAClB,CAACO,GAAiBC,MAAmB;AACnC,MAAID,MAASE,EAAoB,+BAC/BL,EAAS,yBAAyB,GAGhC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K,IAChC,UAAA;AAAA,MAAA,gBAAAxD,EAACa,KAAQ,IAAG,MAAK,UAAS,MACvB,UAAAJ,EAAE,mBAAmB,GACxB;AAAA,wBACCoD,GAAA,EAAU,GAAGT,GAAe,OAAO3C,EAAE,mBAAmB,EAAA,CAAG;AAAA,IAAA,GAC9D;AAAA,IAGDsC,KAAuB,gBAAA/C,EAAC8D,GAAA,EAAc,WAAA1D,GAAsB,SAASsB,GAAa;AAAA,IAElFuB,KACC,gBAAAjD;AAAA,MAAC+D;AAAA,MAAA;AAAA,QACC,WAAA3D;AAAA,QACA,yBAAuB;AAAA,QACvB,WAAW;AAAA,QACX,SAASsB;AAAA,MAAA;AAAA,IAAA;AAAA,EACX,EAAA,CAEJ,EAAA,CACF,IA1CE,gBAAA1B,EAAC,OAAA,EAAI,WAAW2D,EAAWC,EAAO,MAAMzD,CAAS,GAC/C,UAAA,gBAAAH,EAACY,GAAA,EAAM,UAAAH,EAAE,mBAAmB,GAAE,GAChC;AA0CN;"}
|
|
1
|
+
{"version":3,"file":"PayrollBlockerList.js","sources":["../../../../../src/components/Payroll/PayrollBlocker/components/PayrollBlockerList.tsx"],"sourcesContent":["import { useState, useCallback } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport classNames from 'classnames'\nimport { usePayrollsGetBlockersSuspense } from '@gusto/embedded-api/react-query/payrollsGetBlockers'\nimport { useRecoveryCasesGetSuspense } from '@gusto/embedded-api/react-query/recoveryCasesGet'\nimport { useInformationRequestsGetInformationRequestsSuspense } from '@gusto/embedded-api/react-query/informationRequestsGetInformationRequests'\nimport { InformationRequestStatus } from '@gusto/embedded-api/models/components/informationrequest'\nimport { getBlockerTranslationKeys } from '../payrollHelpers'\nimport styles from './PayrollBlockerList.module.scss'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { Flex, FlexItem } from '@/components/Common'\nimport { DataView } from '@/components/Common/DataView/DataView'\nimport { useDataView } from '@/components/Common/DataView/useDataView'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { RecoveryCases } from '@/components/Payroll/RecoveryCases'\nimport { InformationRequestsFlow } from '@/components/InformationRequests'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { informationRequestEvents, recoveryCasesEvents, type EventType } from '@/shared/constants'\n\ntype ResponseAlertType = 'recoveryCaseResubmitted' | 'informationRequestResponded'\n\ninterface ResponseAlert {\n id: number\n type: ResponseAlertType\n}\n\ninterface ResponseAlertState {\n id: number\n alerts: ResponseAlert[]\n}\n\ninterface PayrollBlocker {\n id: string\n title: string\n description: string\n action?: {\n label: string\n onClick: () => void\n }\n}\n\ninterface PayrollBlockerListProps extends BaseComponentInterface<'Payroll.PayrollBlocker'> {\n companyId: string\n}\n\n/**\n * PayrollBlockerList - DataView-based component displaying payroll blockers\n * Shows each blocker with individual resolution buttons\n * Also displays recovery cases and information requests sections when applicable\n */\nexport function PayrollBlockerList(props: PayrollBlockerListProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ className, companyId, dictionary, onEvent }: PayrollBlockerListProps) {\n useComponentDictionary('Payroll.PayrollBlocker', dictionary)\n useI18n('Payroll.PayrollBlocker')\n const { t } = useTranslation('Payroll.PayrollBlocker')\n const { Button, Text, Heading, Alert } = useComponentContext()\n\n const [alertState, setAlertState] = useState<ResponseAlertState>({\n id: 0,\n alerts: [],\n })\n\n const handleDismissAlert = useCallback((alertId: number) => {\n setAlertState(prev => ({\n ...prev,\n alerts: prev.alerts.filter(alert => alert.id !== alertId),\n }))\n }, [])\n\n const addAlert = useCallback((alertType: ResponseAlertType) => {\n setAlertState(prev => ({\n id: prev.id + 1,\n alerts: [{ id: prev.id, type: alertType }, ...prev.alerts],\n }))\n }, [])\n\n const handleEvent = useCallback(\n (type: EventType, data?: unknown) => {\n if (type === recoveryCasesEvents.RECOVERY_CASE_RESUBMIT_DONE) {\n addAlert('recoveryCaseResubmitted')\n }\n\n if (type === informationRequestEvents.INFORMATION_REQUEST_FORM_DONE) {\n addAlert('informationRequestResponded')\n }\n\n onEvent(type, data)\n },\n [onEvent, addAlert],\n )\n\n const { data: blockersData } = usePayrollsGetBlockersSuspense({\n companyUuid: companyId,\n })\n\n const { data: recoveryCasesData } = useRecoveryCasesGetSuspense({\n companyUuid: companyId,\n })\n\n const { data: informationRequestsData } = useInformationRequestsGetInformationRequestsSuspense({\n companyUuid: companyId,\n })\n\n const payrollBlockerList = blockersData.payrollBlockerList ?? []\n const blockers: PayrollBlocker[] = payrollBlockerList.map(blocker => {\n const blockerKey = blocker.key ?? 'unknown'\n const translationKeys = getBlockerTranslationKeys(blockerKey)\n\n const title = t(translationKeys.titleKey, {\n defaultValue: blockerKey.replace(/_/g, ' ').replace(/\\b\\w/g, letter => letter.toUpperCase()),\n })\n\n const description = t(translationKeys.descriptionKey, {\n defaultValue: blocker.message || t('defaultBlockerDescription'),\n })\n\n return {\n id: blockerKey,\n title,\n description,\n }\n })\n\n const recoveryCases = recoveryCasesData.recoveryCaseList ?? []\n const informationRequests = informationRequestsData.informationRequestList ?? []\n\n const hasUnrecoveredCases = recoveryCases.some(\n recoveryCase => recoveryCase.status !== 'recovered',\n )\n\n const hasInformationRequests = informationRequests.some(\n request => request.status !== InformationRequestStatus.Approved,\n )\n\n const dataViewProps = useDataView({\n data: blockers,\n columns: [\n {\n title: t('blockerSectionLabel'),\n render: blocker => (\n <FlexItem flexGrow={1}>\n <Flex flexDirection=\"column\" gap={8}>\n <Text weight=\"semibold\">{blocker.title}</Text>\n <Text variant=\"supporting\">{blocker.description}</Text>\n </Flex>\n </FlexItem>\n ),\n },\n {\n title: '',\n render: blocker => {\n const action = blocker.action\n\n if (!action) {\n return null\n }\n\n return (\n <Flex justifyContent=\"flex-end\" alignItems=\"center\">\n <Button variant=\"secondary\" onClick={action.onClick} title={action.label}>\n {action.label}\n </Button>\n </Flex>\n )\n },\n },\n ],\n })\n\n const hasBlockers = blockers.length > 0\n const hasAnyContent = hasBlockers || hasUnrecoveredCases || hasInformationRequests\n\n if (!hasAnyContent) {\n return (\n <div className={classNames(styles.root, className)}>\n <Text>{t('noBlockersMessage')}</Text>\n </div>\n )\n }\n\n return (\n <div className={classNames(styles.root, className)}>\n <Flex flexDirection=\"column\" gap={32}>\n {alertState.alerts.map(alert => (\n <Alert\n key={alert.id}\n status=\"success\"\n label={t(`alerts.${alert.type}.title`)}\n onDismiss={() => {\n handleDismissAlert(alert.id)\n }}\n >\n <Text>{t(`alerts.${alert.type}.description`)}</Text>\n </Alert>\n ))}\n\n {hasBlockers && (\n <Flex flexDirection=\"column\" gap={20}>\n <Heading as=\"h2\" styledAs=\"h4\">\n {t('blockersListTitle')}\n </Heading>\n <DataView {...dataViewProps} label={t('blockersListTitle')} />\n </Flex>\n )}\n\n {hasUnrecoveredCases && <RecoveryCases companyId={companyId} onEvent={handleEvent} />}\n\n {hasInformationRequests && (\n <InformationRequestsFlow companyId={companyId} withAlert={false} onEvent={handleEvent} />\n )}\n </Flex>\n </div>\n )\n}\n"],"names":["PayrollBlockerList","props","jsx","BaseComponent","Root","className","companyId","dictionary","onEvent","useComponentDictionary","useI18n","t","useTranslation","Button","Text","Heading","Alert","useComponentContext","alertState","setAlertState","useState","handleDismissAlert","useCallback","alertId","prev","alert","addAlert","alertType","handleEvent","type","data","recoveryCasesEvents","informationRequestEvents","blockersData","usePayrollsGetBlockersSuspense","recoveryCasesData","useRecoveryCasesGetSuspense","informationRequestsData","useInformationRequestsGetInformationRequestsSuspense","blockers","blocker","blockerKey","translationKeys","getBlockerTranslationKeys","title","letter","description","recoveryCases","informationRequests","hasUnrecoveredCases","recoveryCase","hasInformationRequests","request","InformationRequestStatus","dataViewProps","useDataView","FlexItem","jsxs","Flex","action","hasBlockers","classNames","styles","DataView","RecoveryCases","InformationRequestsFlow"],"mappings":";;;;;;;;;;;;;;;;;;;;AAkDO,SAASA,GAAmBC,GAAgC;AACjE,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB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c,WAAA1D,GAAsB,SAASsB,GAAa;AAAA,IAElFuB,KACC,gBAAAjD,EAAC+D,GAAA,EAAwB,WAAA3D,GAAsB,WAAW,IAAO,SAASsB,EAAA,CAAa;AAAA,EAAA,EAAA,CAE3F,EAAA,CACF,IArCE,gBAAA1B,EAAC,OAAA,EAAI,WAAW2D,EAAWC,EAAO,MAAMzD,CAAS,GAC/C,UAAA,gBAAAH,EAACY,GAAA,EAAM,UAAAH,EAAE,mBAAmB,GAAE,GAChC;AAqCN;"}
|
|
@@ -16,6 +16,8 @@ export interface PayrollSubmitResult {
|
|
|
16
16
|
* Returns blockers if found, otherwise throws the error for caller to handle
|
|
17
17
|
*/
|
|
18
18
|
export declare const payrollSubmitHandler: (payrollHandler: () => Promise<void>) => Promise<PayrollSubmitResult>;
|
|
19
|
+
export declare const isActionableBlocker: (key: string) => boolean;
|
|
20
|
+
export declare const hasActionableBlockers: (blockers: ApiPayrollBlocker[]) => boolean;
|
|
19
21
|
/**
|
|
20
22
|
* Get translation keys for a blocker - use these in components with useTranslation
|
|
21
23
|
*/
|
|
@@ -1,39 +1,41 @@
|
|
|
1
|
-
import { PayrollBlockersError as
|
|
1
|
+
import { PayrollBlockersError as t } from "@gusto/embedded-api/models/errors/payrollblockerserror";
|
|
2
2
|
import { UnprocessableEntityErrorObject1 as n } from "@gusto/embedded-api/models/errors/unprocessableentityerrorobject1";
|
|
3
|
-
function
|
|
4
|
-
return typeof
|
|
3
|
+
function s(e) {
|
|
4
|
+
return typeof e == "object" && e !== null && "key" in e && typeof e.key == "string";
|
|
5
5
|
}
|
|
6
|
-
function l(
|
|
7
|
-
return
|
|
6
|
+
function l(e) {
|
|
7
|
+
return e instanceof t;
|
|
8
8
|
}
|
|
9
|
-
function a(
|
|
10
|
-
return
|
|
9
|
+
function a(e) {
|
|
10
|
+
return e instanceof n && Array.isArray(e.errors) && e.errors.some((o) => o.category === "payroll_blocker");
|
|
11
11
|
}
|
|
12
|
-
function i(
|
|
13
|
-
return l(
|
|
12
|
+
function i(e) {
|
|
13
|
+
return l(e) ? !e.errors || e.errors.length === 0 ? [] : e.errors.map((r) => ({ key: s(r.metadata) ? r.metadata.key : r.errorKey || "unknown", message: r.message })) : a(e) ? e.errors.filter((r) => r.category === "payroll_blocker").map((r) => ({ key: s(r.metadata) ? r.metadata.key : r.errorKey || "unknown", message: r.message })) : [];
|
|
14
14
|
}
|
|
15
|
-
const y = (
|
|
15
|
+
const y = (e) => e instanceof t ? !0 : e instanceof n ? Array.isArray(e.errors) && e.errors.some((o) => o.category === "payroll_blocker") : !1, p = async (e) => {
|
|
16
16
|
try {
|
|
17
|
-
return await
|
|
17
|
+
return await e(), { success: !0, blockers: [] };
|
|
18
18
|
} catch (o) {
|
|
19
19
|
if (y(o))
|
|
20
20
|
return { success: !1, blockers: i(o) };
|
|
21
21
|
throw o;
|
|
22
22
|
}
|
|
23
|
-
};
|
|
24
|
-
function
|
|
23
|
+
}, u = ["pending_information_request", "pending_recovery_case"], k = (e) => u.includes(e), m = (e) => e.some((o) => k(o.key));
|
|
24
|
+
function g(e) {
|
|
25
25
|
return {
|
|
26
|
-
titleKey: `blockers.${
|
|
27
|
-
descriptionKey: `blockers.${
|
|
28
|
-
helpTextKey: `blockers.${
|
|
29
|
-
defaultActionKey: `blockers.${
|
|
26
|
+
titleKey: `blockers.${e}.title`,
|
|
27
|
+
descriptionKey: `blockers.${e}.description`,
|
|
28
|
+
helpTextKey: `blockers.${e}.help`,
|
|
29
|
+
defaultActionKey: `blockers.${e}.defaultAction`
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
32
|
export {
|
|
33
|
-
|
|
33
|
+
g as getBlockerTranslationKeys,
|
|
34
|
+
m as hasActionableBlockers,
|
|
35
|
+
k as isActionableBlocker,
|
|
34
36
|
l as isPayrollBlockersError,
|
|
35
37
|
a as isUnprocessableEntityWithPayrollBlockers,
|
|
36
38
|
i as parsePayrollBlockersFromError,
|
|
37
|
-
|
|
39
|
+
p as payrollSubmitHandler
|
|
38
40
|
};
|
|
39
41
|
//# sourceMappingURL=payrollHelpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payrollHelpers.js","sources":["../../../../src/components/Payroll/PayrollBlocker/payrollHelpers.ts"],"sourcesContent":["import { PayrollBlockersError } from '@gusto/embedded-api/models/errors/payrollblockerserror'\nimport { UnprocessableEntityErrorObject1 } from '@gusto/embedded-api/models/errors/unprocessableentityerrorobject1'\n\nfunction hasMetadataKey(metadata: unknown): metadata is { key: string } {\n return (\n typeof metadata === 'object' &&\n metadata !== null &&\n 'key' in metadata &&\n typeof (metadata as { key: unknown }).key === 'string'\n )\n}\n\nexport interface ApiPayrollBlocker {\n key: string\n message?: string\n}\n\nexport function isPayrollBlockersError(error: unknown): error is PayrollBlockersError {\n return error instanceof PayrollBlockersError\n}\n\nexport function isUnprocessableEntityWithPayrollBlockers(\n error: unknown,\n): error is UnprocessableEntityErrorObject1 {\n return (\n error instanceof UnprocessableEntityErrorObject1 &&\n Array.isArray(error.errors) &&\n error.errors.some(err => err.category === 'payroll_blocker')\n )\n}\n\nexport function parsePayrollBlockersFromError(error: unknown): ApiPayrollBlocker[] {\n // Handle PayrollBlockersError (dedicated blocker error type)\n if (isPayrollBlockersError(error)) {\n if (!error.errors || error.errors.length === 0) {\n return []\n }\n\n const blockers = error.errors.map(err => {\n const key = hasMetadataKey(err.metadata) ? err.metadata.key : err.errorKey || 'unknown'\n\n return { key, message: err.message }\n })\n\n return blockers\n }\n\n // Handle UnprocessableEntityErrorObject1 with payroll blockers\n if (isUnprocessableEntityWithPayrollBlockers(error)) {\n const blockers = error.errors\n .filter(err => err.category === 'payroll_blocker')\n .map(err => {\n const key = hasMetadataKey(err.metadata) ? err.metadata.key : err.errorKey || 'unknown'\n\n return { key, message: err.message }\n })\n\n return blockers\n }\n\n return []\n}\n\ntype PayrollBlockerError = PayrollBlockersError | UnprocessableEntityErrorObject1\n\nconst hasPayrollBlockers = (error: unknown): error is PayrollBlockerError => {\n if (error instanceof PayrollBlockersError) {\n return true\n }\n if (error instanceof UnprocessableEntityErrorObject1) {\n return (\n Array.isArray(error.errors) && error.errors.some(err => err.category === 'payroll_blocker')\n )\n }\n return false\n}\n\nexport interface PayrollSubmitResult {\n success: boolean\n blockers: ApiPayrollBlocker[]\n}\n\n/**\n * Direct submit handler for payroll operations that handles payroll blockers\n * Returns blockers if found, otherwise throws the error for caller to handle\n */\nexport const payrollSubmitHandler = async (\n payrollHandler: () => Promise<void>,\n): Promise<PayrollSubmitResult> => {\n try {\n await payrollHandler()\n return { success: true, blockers: [] }\n } catch (error: unknown) {\n if (hasPayrollBlockers(error)) {\n const blockers = parsePayrollBlockersFromError(error)\n return { success: false, blockers }\n }\n\n // For non-payroll errors, re-throw\n throw error\n }\n}\n\n/**\n * Get translation keys for a blocker - use these in components with useTranslation\n */\nexport function getBlockerTranslationKeys(key: string) {\n return {\n titleKey: `blockers.${key}.title`,\n descriptionKey: `blockers.${key}.description`,\n helpTextKey: `blockers.${key}.help`,\n defaultActionKey: `blockers.${key}.defaultAction`,\n }\n}\n"],"names":["hasMetadataKey","metadata","isPayrollBlockersError","error","PayrollBlockersError","isUnprocessableEntityWithPayrollBlockers","UnprocessableEntityErrorObject1","err","parsePayrollBlockersFromError","hasPayrollBlockers","payrollSubmitHandler","payrollHandler","
|
|
1
|
+
{"version":3,"file":"payrollHelpers.js","sources":["../../../../src/components/Payroll/PayrollBlocker/payrollHelpers.ts"],"sourcesContent":["import { PayrollBlockersError } from '@gusto/embedded-api/models/errors/payrollblockerserror'\nimport { UnprocessableEntityErrorObject1 } from '@gusto/embedded-api/models/errors/unprocessableentityerrorobject1'\n\nfunction hasMetadataKey(metadata: unknown): metadata is { key: string } {\n return (\n typeof metadata === 'object' &&\n metadata !== null &&\n 'key' in metadata &&\n typeof (metadata as { key: unknown }).key === 'string'\n )\n}\n\nexport interface ApiPayrollBlocker {\n key: string\n message?: string\n}\n\nexport function isPayrollBlockersError(error: unknown): error is PayrollBlockersError {\n return error instanceof PayrollBlockersError\n}\n\nexport function isUnprocessableEntityWithPayrollBlockers(\n error: unknown,\n): error is UnprocessableEntityErrorObject1 {\n return (\n error instanceof UnprocessableEntityErrorObject1 &&\n Array.isArray(error.errors) &&\n error.errors.some(err => err.category === 'payroll_blocker')\n )\n}\n\nexport function parsePayrollBlockersFromError(error: unknown): ApiPayrollBlocker[] {\n // Handle PayrollBlockersError (dedicated blocker error type)\n if (isPayrollBlockersError(error)) {\n if (!error.errors || error.errors.length === 0) {\n return []\n }\n\n const blockers = error.errors.map(err => {\n const key = hasMetadataKey(err.metadata) ? err.metadata.key : err.errorKey || 'unknown'\n\n return { key, message: err.message }\n })\n\n return blockers\n }\n\n // Handle UnprocessableEntityErrorObject1 with payroll blockers\n if (isUnprocessableEntityWithPayrollBlockers(error)) {\n const blockers = error.errors\n .filter(err => err.category === 'payroll_blocker')\n .map(err => {\n const key = hasMetadataKey(err.metadata) ? err.metadata.key : err.errorKey || 'unknown'\n\n return { key, message: err.message }\n })\n\n return blockers\n }\n\n return []\n}\n\ntype PayrollBlockerError = PayrollBlockersError | UnprocessableEntityErrorObject1\n\nconst hasPayrollBlockers = (error: unknown): error is PayrollBlockerError => {\n if (error instanceof PayrollBlockersError) {\n return true\n }\n if (error instanceof UnprocessableEntityErrorObject1) {\n return (\n Array.isArray(error.errors) && error.errors.some(err => err.category === 'payroll_blocker')\n )\n }\n return false\n}\n\nexport interface PayrollSubmitResult {\n success: boolean\n blockers: ApiPayrollBlocker[]\n}\n\n/**\n * Direct submit handler for payroll operations that handles payroll blockers\n * Returns blockers if found, otherwise throws the error for caller to handle\n */\nexport const payrollSubmitHandler = async (\n payrollHandler: () => Promise<void>,\n): Promise<PayrollSubmitResult> => {\n try {\n await payrollHandler()\n return { success: true, blockers: [] }\n } catch (error: unknown) {\n if (hasPayrollBlockers(error)) {\n const blockers = parsePayrollBlockersFromError(error)\n return { success: false, blockers }\n }\n\n // For non-payroll errors, re-throw\n throw error\n }\n}\n\nconst ACTIONABLE_BLOCKER_KEYS = ['pending_information_request', 'pending_recovery_case'] as const\n\nexport const isActionableBlocker = (key: string) =>\n ACTIONABLE_BLOCKER_KEYS.includes(key as (typeof ACTIONABLE_BLOCKER_KEYS)[number])\n\nexport const hasActionableBlockers = (blockers: ApiPayrollBlocker[]) =>\n blockers.some(b => isActionableBlocker(b.key))\n\n/**\n * Get translation keys for a blocker - use these in components with useTranslation\n */\nexport function getBlockerTranslationKeys(key: string) {\n return {\n titleKey: `blockers.${key}.title`,\n descriptionKey: `blockers.${key}.description`,\n helpTextKey: `blockers.${key}.help`,\n defaultActionKey: `blockers.${key}.defaultAction`,\n }\n}\n"],"names":["hasMetadataKey","metadata","isPayrollBlockersError","error","PayrollBlockersError","isUnprocessableEntityWithPayrollBlockers","UnprocessableEntityErrorObject1","err","parsePayrollBlockersFromError","hasPayrollBlockers","payrollSubmitHandler","payrollHandler","ACTIONABLE_BLOCKER_KEYS","isActionableBlocker","key","hasActionableBlockers","blockers","b","getBlockerTranslationKeys"],"mappings":";;AAGA,SAASA,EAAeC,GAAgD;AACtE,SACE,OAAOA,KAAa,YACpBA,MAAa,QACb,SAASA,KACT,OAAQA,EAA8B,OAAQ;AAElD;AAOO,SAASC,EAAuBC,GAA+C;AACpF,SAAOA,aAAiBC;AAC1B;AAEO,SAASC,EACdF,GAC0C;AAC1C,SACEA,aAAiBG,KACjB,MAAM,QAAQH,EAAM,MAAM,KAC1BA,EAAM,OAAO,KAAK,CAAAI,MAAOA,EAAI,aAAa,iBAAiB;AAE/D;AAEO,SAASC,EAA8BL,GAAqC;AAEjF,SAAID,EAAuBC,CAAK,IAC1B,CAACA,EAAM,UAAUA,EAAM,OAAO,WAAW,IACpC,CAAA,IAGQA,EAAM,OAAO,IAAI,CAAAI,OAGzB,EAAE,KAFGP,EAAeO,EAAI,QAAQ,IAAIA,EAAI,SAAS,MAAMA,EAAI,YAAY,WAEhE,SAASA,EAAI,QAAA,EAC5B,IAMCF,EAAyCF,CAAK,IAC/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