@gusto/embedded-react-sdk 0.24.1 → 0.26.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 +118 -0
- package/dist/assets/icons/icon-file-jpg.svg.js +10 -0
- package/dist/assets/icons/icon-file-jpg.svg.js.map +1 -0
- package/dist/assets/icons/icon-file-pdf.svg.js +10 -0
- package/dist/assets/icons/icon-file-pdf.svg.js.map +1 -0
- package/dist/assets/icons/icon-file-png.svg.js +10 -0
- package/dist/assets/icons/icon-file-png.svg.js.map +1 -0
- package/dist/assets/icons/icon-trashcan.svg.js +10 -0
- package/dist/assets/icons/icon-trashcan.svg.js.map +1 -0
- package/dist/assets/icons/slash-circle.svg.js +10 -0
- package/dist/assets/icons/slash-circle.svg.js.map +1 -0
- package/dist/components/Base/Base.d.ts +1 -1
- package/dist/components/Base/Base.js +12 -13
- package/dist/components/Base/Base.js.map +1 -1
- package/dist/components/Common/Fields/FileInputField/FileInputField.d.ts +5 -0
- package/dist/components/Common/Fields/FileInputField/FileInputField.js +34 -0
- package/dist/components/Common/Fields/FileInputField/FileInputField.js.map +1 -0
- package/dist/components/Common/Fields/FileInputField/index.d.ts +2 -0
- package/dist/components/Common/PaginationControl/PaginationControl.js +41 -40
- package/dist/components/Common/PaginationControl/PaginationControl.js.map +1 -1
- package/dist/components/Common/PaginationControl/PaginationControlTypes.d.ts +1 -0
- package/dist/components/Common/SignatureForm/SignatureForm.js +2 -3
- package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormActions.js +3 -4
- package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormFields.js +6 -7
- package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
- package/dist/components/Common/UI/Alert/Alert.js +10 -10
- package/dist/components/Common/UI/Alert/Alert.js.map +1 -1
- package/dist/components/Common/UI/Alert/Alert.module.scss.js +14 -14
- package/dist/components/Common/UI/Badge/Badge.module.scss.js +1 -1
- package/dist/components/Common/UI/Banner/Banner.module.scss.js +4 -4
- package/dist/components/Common/UI/ComboBox/ComboBox.module.scss.js +6 -6
- package/dist/components/Common/UI/FileInput/FileInput.d.ts +2 -0
- package/dist/components/Common/UI/FileInput/FileInput.js +150 -0
- package/dist/components/Common/UI/FileInput/FileInput.js.map +1 -0
- package/dist/components/Common/UI/FileInput/FileInput.module.scss.js +36 -0
- package/dist/components/Common/UI/FileInput/FileInput.module.scss.js.map +1 -0
- package/dist/components/Common/UI/FileInput/FileInputTypes.d.ts +45 -0
- package/dist/components/Common/UI/FileInput/FileInputTypes.js +8 -0
- package/dist/components/Common/UI/FileInput/FileInputTypes.js.map +1 -0
- package/dist/components/Common/UI/FileInput/index.d.ts +4 -0
- package/dist/components/Common/UI/Input/Input.module.scss.js +7 -7
- package/dist/components/Common/UI/List/List.module.scss.js +1 -1
- package/dist/components/Common/UI/Modal/Modal.js +41 -40
- package/dist/components/Common/UI/Modal/Modal.js.map +1 -1
- package/dist/components/Common/UI/Modal/Modal.module.scss.js +4 -4
- package/dist/components/Common/UI/Select/Select.module.scss.js +6 -6
- package/dist/components/Common/UI/TextArea/TextArea.module.scss.js +4 -4
- package/dist/components/Common/UI/TextInput/TextInput.js +27 -23
- 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 +2 -3
- package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +2 -3
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +2 -3
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +5 -6
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.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/Actions.js +2 -3
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +4 -5
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.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/TitleSelect.js +3 -4
- 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 +8 -9
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js +4 -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 +2 -3
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +6 -7
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +4 -5
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +2 -3
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +8 -9
- 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 +2 -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 +6 -7
- package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Company/FederalTaxes/FederalTaxes.js +2 -3
- package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Form.js +2 -3
- package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +10 -9
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Actions.js +7 -8
- 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 +2 -3
- package/dist/components/Company/Industry/Edit.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Actions.js +6 -7
- package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Form.js +4 -5
- package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/LocationForm.js +2 -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 +2 -3
- package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/List.js +31 -30
- package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +29 -29
- package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.d.ts +1 -0
- 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 +10 -11
- package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js +6 -7
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +6 -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 +2 -3
- package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Actions.js +2 -3
- package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Edit.js +9 -10
- package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Head.js +8 -9
- package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/List.js +5 -6
- 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 +2 -3
- 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 +2 -3
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js +2 -3
- 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/Contractor/Address/Address.js +3 -4
- package/dist/components/Contractor/Address/Address.js.map +1 -1
- package/dist/components/Contractor/Address/Form.js +6 -7
- package/dist/components/Contractor/Address/Form.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/ContractorList/index.js +24 -24
- package/dist/components/Contractor/ContractorList/index.js.map +1 -1
- package/dist/components/Contractor/NewHireReport/NewHireReport.js +13 -14
- package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +10 -11
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +2 -3
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +2 -3
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js +108 -92
- package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +33 -32
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +25 -7
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.d.ts +8 -0
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js +58 -0
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js.map +1 -0
- package/dist/components/Contractor/Payments/CreatePayment/GenericBlocker.d.ts +6 -0
- package/dist/components/Contractor/Payments/CreatePayment/GenericBlocker.js +18 -0
- package/dist/components/Contractor/Payments/CreatePayment/GenericBlocker.js.map +1 -0
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.d.ts +5 -1
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +84 -52
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.d.ts +4 -0
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js +32 -13
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.d.ts +2 -0
- package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js +100 -53
- package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistory.d.ts +1 -2
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistory.js +46 -21
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistory.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.d.ts +6 -15
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js +115 -100
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.module.scss.js +8 -0
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.module.scss.js.map +1 -0
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatement.d.ts +8 -0
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatement.js +51 -0
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatement.js.map +1 -0
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.d.ts +11 -0
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js +155 -0
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js.map +1 -0
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.module.scss.js +22 -0
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.module.scss.js.map +1 -0
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummary.d.ts +8 -0
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummary.js +45 -0
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummary.js.map +1 -0
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.d.ts +15 -0
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js +125 -0
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js.map +1 -0
- package/dist/components/Contractor/Payments/PaymentSummary/index.d.ts +3 -0
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js +37 -28
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.d.ts +5 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +61 -60
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
- package/dist/components/Contractor/Profile/useContractorProfile.js +1 -1
- package/dist/components/Contractor/Submit/Submit.js +19 -20
- package/dist/components/Contractor/Submit/Submit.js.map +1 -1
- package/dist/components/Employee/Compensation/Actions.js +12 -13
- package/dist/components/Employee/Compensation/Actions.js.map +1 -1
- package/dist/components/Employee/Compensation/Edit.js +2 -3
- package/dist/components/Employee/Compensation/Edit.js.map +1 -1
- package/dist/components/Employee/Compensation/List.js +22 -23
- package/dist/components/Employee/Compensation/List.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +4 -3
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +4 -3
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +4 -3
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +2 -3
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js.map +1 -1
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js +2 -3
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +2 -3
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +2 -3
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js +2 -3
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
- 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/SignatureForm/SignatureForm.js +2 -3
- 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/EmployeeList/Actions.js +6 -7
- package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
- package/dist/components/Employee/EmployeeList/EmployeeList.js +55 -54
- package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
- package/dist/components/Employee/EmployeeList/Head.js +5 -6
- package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
- package/dist/components/Employee/EmployeeList/List.js +32 -31
- package/dist/components/Employee/EmployeeList/List.js.map +1 -1
- package/dist/components/Employee/EmployeeList/useEmployeeList.d.ts +1 -0
- package/dist/components/Employee/EmployeeList/useEmployeeList.js +5 -4
- package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
- package/dist/components/Employee/EmploymentEligibility/EmploymentEligibility.d.ts +3 -0
- package/dist/components/Employee/EmploymentEligibility/EmploymentEligibilityPresentation.d.ts +37 -0
- package/dist/components/Employee/EmploymentEligibility/index.d.ts +4 -0
- package/dist/components/Employee/FederalTaxes/Actions.js +5 -6
- package/dist/components/Employee/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/FederalForm.js +4 -5
- package/dist/components/Employee/FederalTaxes/FederalForm.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 +2 -3
- package/dist/components/Employee/Landing/Landing.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/Actions.js +5 -6
- package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +2 -3
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js +2 -3
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +5 -6
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/Split.js +2 -3
- 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 +5 -6
- package/dist/components/Employee/Profile/Actions.js.map +1 -1
- package/dist/components/Employee/Profile/AdminPersonalDetails.js +4 -5
- package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
- package/dist/components/Employee/Profile/HomeAddress.js +8 -9
- package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js +8 -9
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
- 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 +5 -6
- package/dist/components/Employee/StateTaxes/Actions.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 +6 -7
- package/dist/components/Employee/Taxes/Actions.js.map +1 -1
- package/dist/components/Employee/Taxes/FederalForm.js +6 -7
- package/dist/components/Employee/Taxes/FederalForm.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/Flow/Flow.js +7 -8
- package/dist/components/Flow/Flow.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.d.ts +15 -0
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js +162 -0
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -0
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.module.scss.js +20 -0
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.module.scss.js.map +1 -0
- package/dist/components/InformationRequests/InformationRequestForm/index.d.ts +2 -0
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.d.ts +8 -0
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js +96 -0
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js.map +1 -0
- package/dist/components/InformationRequests/InformationRequestList/index.d.ts +2 -0
- package/dist/components/InformationRequests/InformationRequests.d.ts +7 -0
- package/dist/components/InformationRequests/InformationRequests.js +68 -0
- package/dist/components/InformationRequests/InformationRequests.js.map +1 -0
- package/dist/components/InformationRequests/InformationRequestsComponents.d.ts +19 -0
- package/dist/components/InformationRequests/InformationRequestsComponents.js +20 -0
- package/dist/components/InformationRequests/InformationRequestsComponents.js.map +1 -0
- package/dist/components/InformationRequests/index.d.ts +4 -0
- package/dist/components/InformationRequests/index.js +9 -0
- package/dist/components/InformationRequests/index.js.map +1 -0
- package/dist/components/InformationRequests/informationRequestsStateMachine.d.ts +13 -0
- package/dist/components/InformationRequests/informationRequestsStateMachine.js +47 -0
- package/dist/components/InformationRequests/informationRequestsStateMachine.js.map +1 -0
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.js +69 -59
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +0 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.js +61 -52
- package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +17 -18
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.d.ts +5 -13
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +102 -27
- 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.js +14 -14
- package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +116 -130
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.d.ts +6 -3
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +165 -156
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.module.scss.js +2 -4
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.module.scss.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.d.ts +21 -0
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js +105 -0
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js.map +1 -0
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js +41 -37
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.d.ts +5 -4
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +151 -146
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +6 -6
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.d.ts +1 -0
- package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js +45 -38
- package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.d.ts +2 -0
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js +179 -97
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.js +28 -28
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.d.ts +2 -2
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +86 -106
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollLanding/PayrollLanding.d.ts +2 -1
- package/dist/components/Payroll/PayrollLanding/PayrollLanding.js +28 -22
- package/dist/components/Payroll/PayrollLanding/PayrollLanding.js.map +1 -1
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.d.ts +4 -0
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js +74 -47
- 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 +159 -57
- package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollList.js +14 -17
- package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.d.ts +1 -2
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +137 -132
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js +8 -4
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +102 -96
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.d.ts +7 -5
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +253 -250
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewTypes.d.ts +6 -0
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewTypes.js +5 -0
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewTypes.js.map +1 -0
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.d.ts +2 -2
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js +2 -3
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/GenericBlocker.d.ts +2 -2
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/GenericBlocker.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCaseErrorCode.module.scss.js +8 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCaseErrorCode.module.scss.js.map +1 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCases.d.ts +6 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCases.js +55 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCases.js.map +1 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesComponents.d.ts +19 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesComponents.js +19 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesComponents.js.map +1 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.d.ts +7 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js +104 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js.map +1 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.module.scss.js +8 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.module.scss.js.map +1 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/index.d.ts +2 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.d.ts +14 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js +69 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js.map +1 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/index.d.ts +2 -0
- package/dist/components/Payroll/RecoveryCases/index.d.ts +3 -0
- package/dist/components/Payroll/RecoveryCases/recoveryCasesStateMachine.d.ts +13 -0
- package/dist/components/Payroll/RecoveryCases/recoveryCasesStateMachine.js +47 -0
- package/dist/components/Payroll/RecoveryCases/recoveryCasesStateMachine.js.map +1 -0
- package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.d.ts +7 -0
- package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js +65 -0
- package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js.map +1 -0
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationContext.d.ts +1 -1
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationContext.js.map +1 -1
- package/dist/components/Payroll/helpers.d.ts +12 -0
- package/dist/components/Payroll/helpers.js +129 -117
- package/dist/components/Payroll/helpers.js.map +1 -1
- package/dist/components/Payroll/index.d.ts +2 -1
- package/dist/components/Payroll/index.js +12 -10
- package/dist/components/Payroll/index.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.d.ts +5 -2
- package/dist/components/Payroll/usePreparedPayrollData.js +44 -32
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js +27 -25
- package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js.map +1 -1
- package/dist/contexts/ComponentAdapter/componentAdapterTypes.d.ts +1 -0
- package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.d.ts +5 -0
- package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.js +17 -15
- package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.js.map +1 -1
- package/dist/contexts/ComponentAdapter/useComponentContext.d.ts +2 -0
- package/dist/contexts/ComponentAdapter/useComponentContext.js +3 -3
- package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +1 -1
- package/dist/contexts/ThemeProvider/theme.js +5 -5
- package/dist/contexts/ThemeProvider/theme.js.map +1 -1
- package/dist/helpers/dateFormatting.d.ts +1 -0
- package/dist/helpers/dateFormatting.js +1 -0
- package/dist/helpers/dateFormatting.js.map +1 -1
- package/dist/helpers/formattedStrings.d.ts +1 -0
- package/dist/helpers/formattedStrings.js +27 -21
- package/dist/helpers/formattedStrings.js.map +1 -1
- package/dist/helpers/responsive.js +1 -1
- package/dist/helpers/responsive.js.map +1 -1
- package/dist/i18n/I18n.js +9 -9
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Contractor.Payments.CreatePayment.json.js +44 -36
- package/dist/i18n/en/Contractor.Payments.CreatePayment.json.js.map +1 -1
- package/dist/i18n/en/Contractor.Payments.PaymentHistory.json.js +11 -11
- package/dist/i18n/en/Contractor.Payments.PaymentStatement.json.js +28 -0
- package/dist/i18n/en/Contractor.Payments.PaymentStatement.json.js.map +1 -0
- package/dist/i18n/en/Contractor.Payments.PaymentSummary.json.js +58 -0
- package/dist/i18n/en/Contractor.Payments.PaymentSummary.json.js.map +1 -0
- package/dist/i18n/en/Contractor.Payments.PaymentsList.json.js +14 -14
- package/dist/i18n/en/Employee.EmploymentEligibility.json.js +28 -0
- package/dist/i18n/en/Employee.EmploymentEligibility.json.js.map +1 -0
- package/dist/i18n/en/InformationRequests.InformationRequestForm.json.js +20 -0
- package/dist/i18n/en/InformationRequests.InformationRequestForm.json.js.map +1 -0
- package/dist/i18n/en/InformationRequests.InformationRequestList.json.js +18 -0
- package/dist/i18n/en/InformationRequests.InformationRequestList.json.js.map +1 -0
- package/dist/i18n/en/Payroll.ConfirmWireDetailsBanner.json.js +1 -1
- package/dist/i18n/en/Payroll.PayrollBlocker.json.js +24 -20
- package/dist/i18n/en/Payroll.PayrollBlocker.json.js.map +1 -1
- package/dist/i18n/en/Payroll.PayrollConfiguration.json.js +27 -21
- package/dist/i18n/en/Payroll.PayrollConfiguration.json.js.map +1 -1
- package/dist/i18n/en/Payroll.PayrollHistory.json.js +6 -6
- package/dist/i18n/en/Payroll.PayrollLanding.json.js +7 -3
- package/dist/i18n/en/Payroll.PayrollLanding.json.js.map +1 -1
- package/dist/i18n/en/Payroll.PayrollOverview.json.js +32 -28
- package/dist/i18n/en/Payroll.PayrollOverview.json.js.map +1 -1
- package/dist/i18n/en/Payroll.RecoveryCasesList.json.js +18 -0
- package/dist/i18n/en/Payroll.RecoveryCasesList.json.js.map +1 -0
- package/dist/i18n/en/Payroll.RecoveryCasesResubmit.json.js +10 -0
- package/dist/i18n/en/Payroll.RecoveryCasesResubmit.json.js.map +1 -0
- package/dist/i18n/en/Payroll.WireInstructions.json.js +20 -16
- package/dist/i18n/en/Payroll.WireInstructions.json.js.map +1 -1
- package/dist/i18n/en/common.json.d.ts +5 -0
- package/dist/i18n/en/common.json.js +4 -2
- package/dist/i18n/en/common.json.js.map +1 -1
- package/dist/index.js +10 -8
- package/dist/index.js.map +1 -1
- package/dist/shared/constants.d.ts +30 -0
- package/dist/shared/constants.js +73 -54
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +321 -3
- package/package.json +32 -21
- package/dist/components/Payroll/PayrollBlocker/PayrollBlocker.d.ts +0 -6
- package/dist/components/Payroll/PayrollBlocker/PayrollBlocker.js +0 -32
- package/dist/components/Payroll/PayrollBlocker/PayrollBlocker.js.map +0 -1
|
@@ -1,49 +1,48 @@
|
|
|
1
1
|
import { jsx as l, jsxs as d } from "react/jsx-runtime";
|
|
2
|
-
import { useTranslation as
|
|
3
|
-
import { getBlockerTranslationKeys as
|
|
4
|
-
import { useComponentContext as
|
|
2
|
+
import { useTranslation as K } from "react-i18next";
|
|
3
|
+
import { getBlockerTranslationKeys as P } from "../payrollHelpers.js";
|
|
4
|
+
import { useComponentContext as v } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
5
5
|
import { Flex as m } from "../../../Common/Flex/Flex.js";
|
|
6
|
-
import "classnames";
|
|
7
6
|
import "react";
|
|
8
|
-
import { useI18n as
|
|
7
|
+
import { useI18n as D } from "../../../../i18n/I18n.js";
|
|
9
8
|
function F({
|
|
10
9
|
blockers: o,
|
|
11
10
|
onMultipleViewClick: i,
|
|
12
|
-
multipleViewLabel:
|
|
11
|
+
multipleViewLabel: f,
|
|
13
12
|
className: s
|
|
14
13
|
}) {
|
|
15
|
-
|
|
16
|
-
const { t: e } =
|
|
14
|
+
D("Payroll.PayrollBlocker");
|
|
15
|
+
const { t: e } = K("Payroll.PayrollBlocker"), { Alert: c, Button: h, Text: a, UnorderedList: x } = v();
|
|
17
16
|
if (o.length === 0)
|
|
18
17
|
return null;
|
|
19
18
|
const y = o.length > 1, p = o.map((r) => {
|
|
20
|
-
const n =
|
|
21
|
-
defaultValue:
|
|
19
|
+
const n = P(r.key), g = e(n.titleKey, {
|
|
20
|
+
defaultValue: e("defaultBlockerDescription")
|
|
22
21
|
}), T = e(n.descriptionKey, {
|
|
23
22
|
defaultValue: r.message || e("defaultBlockerDescription")
|
|
24
23
|
}), k = e(n.helpTextKey, { defaultValue: e("defaultBlockerHelp") });
|
|
25
24
|
return {
|
|
26
25
|
...r,
|
|
27
|
-
title:
|
|
26
|
+
title: g,
|
|
28
27
|
description: T,
|
|
29
28
|
helpText: k
|
|
30
29
|
};
|
|
31
30
|
}), t = p[0];
|
|
32
31
|
if (!y && t)
|
|
33
|
-
return /* @__PURE__ */ l(
|
|
34
|
-
/* @__PURE__ */ l(
|
|
35
|
-
t.helpText && t.helpText !== t.description && /* @__PURE__ */ l(
|
|
32
|
+
return /* @__PURE__ */ l(c, { status: "error", label: t.title, className: s, children: /* @__PURE__ */ d(m, { flexDirection: "column", gap: 8, children: [
|
|
33
|
+
/* @__PURE__ */ l(a, { children: t.description }),
|
|
34
|
+
t.helpText && t.helpText !== t.description && /* @__PURE__ */ l(a, { variant: "supporting", size: "sm", children: t.helpText })
|
|
36
35
|
] }) });
|
|
37
|
-
const
|
|
36
|
+
const B = p.map((r) => r.title), u = f || e("viewAllBlockers");
|
|
38
37
|
return /* @__PURE__ */ l(
|
|
39
|
-
|
|
38
|
+
c,
|
|
40
39
|
{
|
|
41
40
|
status: "error",
|
|
42
41
|
label: e("multipleIssuesTitle", { count: o.length }),
|
|
43
42
|
className: s,
|
|
44
43
|
children: /* @__PURE__ */ d(m, { flexDirection: "column", gap: 16, children: [
|
|
45
|
-
/* @__PURE__ */ l(x, { items:
|
|
46
|
-
i && /* @__PURE__ */ l("div", { children: /* @__PURE__ */ l(
|
|
44
|
+
/* @__PURE__ */ l(x, { items: B }),
|
|
45
|
+
i && /* @__PURE__ */ l("div", { children: /* @__PURE__ */ l(h, { variant: "secondary", onClick: i, title: u, children: u }) })
|
|
47
46
|
] })
|
|
48
47
|
}
|
|
49
48
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PayrollBlockerAlerts.js","sources":["../../../../../src/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { type ApiPayrollBlocker, getBlockerTranslationKeys } 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 onMultipleViewClick?: () => void\n multipleViewLabel?: string\n}\n\n/**\n * PayrollBlockerAlerts - Alert-style component for inline blocker display\n * Shows single blocker as alert, or multiple blockers as summary with \"Review\" button\n * Returns null for empty blocker arrays\n */\nexport function PayrollBlockerAlerts({\n blockers,\n onMultipleViewClick,\n multipleViewLabel,\n className,\n}: PayrollBlockerAlertsProps) {\n useI18n('Payroll.PayrollBlocker')\n const { t } = useTranslation('Payroll.PayrollBlocker')\n const { Alert, Button, Text, UnorderedList } = useComponentContext()\n\n // Return null for empty blockers array\n if (blockers.length === 0) {\n return null\n }\n\n const hasMultipleBlockers = blockers.length > 1\n\n const enrichedBlockers = blockers.map(blocker => {\n const translationKeys = getBlockerTranslationKeys(blocker.key)\n\n const title = t(translationKeys.titleKey, {\n defaultValue:
|
|
1
|
+
{"version":3,"file":"PayrollBlockerAlerts.js","sources":["../../../../../src/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { type ApiPayrollBlocker, getBlockerTranslationKeys } 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 onMultipleViewClick?: () => void\n multipleViewLabel?: string\n}\n\n/**\n * PayrollBlockerAlerts - Alert-style component for inline blocker display\n * Shows single blocker as alert, or multiple blockers as summary with \"Review\" button\n * Returns null for empty blocker arrays\n */\nexport function PayrollBlockerAlerts({\n blockers,\n onMultipleViewClick,\n multipleViewLabel,\n className,\n}: PayrollBlockerAlertsProps) {\n useI18n('Payroll.PayrollBlocker')\n const { t } = useTranslation('Payroll.PayrollBlocker')\n const { Alert, Button, Text, UnorderedList } = useComponentContext()\n\n // Return null for empty blockers array\n if (blockers.length === 0) {\n return null\n }\n\n const hasMultipleBlockers = blockers.length > 1\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 = t(translationKeys.helpTextKey, { defaultValue: t('defaultBlockerHelp') })\n\n return {\n ...blocker,\n title,\n description,\n helpText,\n }\n })\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 </Flex>\n </Alert>\n )\n }\n\n const listItems = enrichedBlockers.map(blocker => blocker.title)\n const defaultMultipleLabel = multipleViewLabel || t('viewAllBlockers')\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 {onMultipleViewClick && (\n <div>\n <Button variant=\"secondary\" onClick={onMultipleViewClick} title={defaultMultipleLabel}>\n {defaultMultipleLabel}\n </Button>\n </div>\n )}\n </Flex>\n </Alert>\n )\n}\n"],"names":["PayrollBlockerAlerts","blockers","onMultipleViewClick","multipleViewLabel","className","useI18n","t","useTranslation","Alert","Button","Text","UnorderedList","useComponentContext","hasMultipleBlockers","enrichedBlockers","blocker","translationKeys","getBlockerTranslationKeys","title","description","helpText","singleBlocker","jsx","jsxs","Flex","listItems","defaultMultipleLabel"],"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,GAAAC,EAAA,IAAMC,EAAe,wBAAwB,GAC/C,EAAE,OAAAC,GAAO,QAAAC,GAAQ,MAAAC,GAAM,eAAAC,EAAA,IAAkBC,EAAA;AAG/C,MAAIX,EAAS,WAAW;AACtB,WAAO;AAGT,QAAMY,IAAsBZ,EAAS,SAAS,GAExCa,IAAmBb,EAAS,IAAI,CAAAc,MAAW;AAC/C,UAAMC,IAAkBC,EAA0BF,EAAQ,GAAG,GAEvDG,IAAQZ,EAAEU,EAAgB,UAAU;AAAA,MACxC,cAAcV,EAAE,2BAA2B;AAAA,IAAA,CAC5C,GACKa,IAAcb,EAAEU,EAAgB,gBAAgB;AAAA,MACpD,cAAcD,EAAQ,WAAWT,EAAE,2BAA2B;AAAA,IAAA,CAC/D,GACKc,IAAWd,EAAEU,EAAgB,aAAa,EAAE,cAAcV,EAAE,oBAAoB,GAAG;AAEzF,WAAO;AAAA,MACL,GAAGS;AAAA,MACH,OAAAG;AAAA,MACA,aAAAC;AAAA,MACA,UAAAC;AAAA,IAAA;AAAA,EAEJ,CAAC,GAEKC,IAAgBP,EAAiB,CAAC;AAExC,MAAI,CAACD,KAAuBQ;AAC1B,WACE,gBAAAC,EAACd,GAAA,EAAM,QAAO,SAAQ,OAAOa,EAAc,OAAO,WAAAjB,GAChD,UAAA,gBAAAmB,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,GAChC,UAAA;AAAA,MAAA,gBAAAF,EAACZ,GAAA,EAAM,YAAc,YAAA,CAAY;AAAA,MAChCW,EAAc,YAAYA,EAAc,aAAaA,EAAc,eAClE,gBAAAC,EAACZ,GAAA,EAAK,SAAQ,cAAa,MAAK,MAC7B,YAAc,SAAA,CACjB;AAAA,IAAA,EAAA,CAEJ,EAAA,CACF;AAIJ,QAAMe,IAAYX,EAAiB,IAAI,CAAAC,MAAWA,EAAQ,KAAK,GACzDW,IAAuBvB,KAAqBG,EAAE,iBAAiB;AAErE,SACE,gBAAAgB;AAAA,IAACd;AAAA,IAAA;AAAA,MACC,QAAO;AAAA,MACP,OAAOF,EAAE,uBAAuB,EAAE,OAAOL,EAAS,QAAQ;AAAA,MAC1D,WAAAG;AAAA,MAEA,UAAA,gBAAAmB,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,QAAA,gBAAAF,EAACX,GAAA,EAAc,OAAOc,EAAA,CAAW;AAAA,QAChCvB,KACC,gBAAAoB,EAAC,OAAA,EACC,UAAA,gBAAAA,EAACb,GAAA,EAAO,SAAQ,aAAY,SAASP,GAAqB,OAAOwB,GAC9D,UAAAA,EAAA,CACH,EAAA,CACF;AAAA,MAAA,EAAA,CAEJ;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -1,19 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
description: string;
|
|
5
|
-
action?: {
|
|
6
|
-
label: string;
|
|
7
|
-
onClick: () => void;
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
interface PayrollBlockerListProps {
|
|
11
|
-
blockers: PayrollBlocker[];
|
|
12
|
-
className?: string;
|
|
1
|
+
import { BaseComponentInterface } from '../../../Base';
|
|
2
|
+
interface PayrollBlockerListProps extends BaseComponentInterface<'Payroll.PayrollBlocker'> {
|
|
3
|
+
companyId: string;
|
|
13
4
|
}
|
|
14
5
|
/**
|
|
15
6
|
* PayrollBlockerList - DataView-based component displaying payroll blockers
|
|
16
7
|
* Shows each blocker with individual resolution buttons
|
|
8
|
+
* Also displays recovery cases and information requests sections when applicable
|
|
17
9
|
*/
|
|
18
|
-
export declare function PayrollBlockerList(
|
|
10
|
+
export declare function PayrollBlockerList(props: PayrollBlockerListProps): import("react/jsx-runtime").JSX.Element;
|
|
19
11
|
export {};
|
|
@@ -1,40 +1,115 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import "react";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { jsx as o, jsxs as m } from "react/jsx-runtime";
|
|
2
|
+
import { useState as _, useCallback as d } from "react";
|
|
3
|
+
import { useTranslation as N } from "react-i18next";
|
|
4
|
+
import R from "classnames";
|
|
5
|
+
import { usePayrollsGetBlockersSuspense as O } from "@gusto/embedded-api/react-query/payrollsGetBlockers";
|
|
6
|
+
import { useRecoveryCasesGetSuspense as V } from "@gusto/embedded-api/react-query/recoveryCasesGet";
|
|
7
|
+
import { useInformationRequestsGetInformationRequestsSuspense as F } from "@gusto/embedded-api/react-query/informationRequestsGetInformationRequests";
|
|
8
|
+
import { InformationRequestStatus as K } from "@gusto/embedded-api/models/components/informationrequest";
|
|
9
|
+
import { getBlockerTranslationKeys as G } from "../payrollHelpers.js";
|
|
10
|
+
import B from "./PayrollBlockerList.module.scss.js";
|
|
11
|
+
import { useComponentContext as M } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
12
|
+
import { FlexItem as j, Flex as a } from "../../../Common/Flex/Flex.js";
|
|
13
|
+
import { DataView as $ } from "../../../Common/DataView/DataView.js";
|
|
14
|
+
import { useDataView as H } from "../../../Common/DataView/useDataView.js";
|
|
15
|
+
import { useComponentDictionary as Q, useI18n as Y } from "../../../../i18n/I18n.js";
|
|
16
|
+
import { RecoveryCases as z } from "../../RecoveryCases/RecoveryCases.js";
|
|
17
|
+
import { BaseComponent as J } from "../../../Base/Base.js";
|
|
18
|
+
import "../../../Base/useBase.js";
|
|
19
|
+
import { recoveryCasesEvents as W, informationRequestEvents as X } from "../../../../shared/constants.js";
|
|
20
|
+
import { InformationRequestsFlow as Z } from "../../../InformationRequests/InformationRequests.js";
|
|
21
|
+
function be(s) {
|
|
22
|
+
return /* @__PURE__ */ o(J, { ...s, children: /* @__PURE__ */ o(ee, { ...s, children: s.children }) });
|
|
23
|
+
}
|
|
24
|
+
function ee({ className: s, companyId: n, dictionary: g, onEvent: u }) {
|
|
25
|
+
Q("Payroll.PayrollBlocker", g), Y("Payroll.PayrollBlocker");
|
|
26
|
+
const { t: r } = N("Payroll.PayrollBlocker"), { Button: v, Text: i, Heading: b, Alert: D } = M(), [x, f] = _({
|
|
27
|
+
id: 0,
|
|
28
|
+
alerts: []
|
|
29
|
+
}), E = d((e) => {
|
|
30
|
+
f((t) => ({
|
|
31
|
+
...t,
|
|
32
|
+
alerts: t.alerts.filter((l) => l.id !== e)
|
|
33
|
+
}));
|
|
34
|
+
}, []), c = d((e) => {
|
|
35
|
+
f((t) => ({
|
|
36
|
+
id: t.id + 1,
|
|
37
|
+
alerts: [{ id: t.id, type: e }, ...t.alerts]
|
|
38
|
+
}));
|
|
39
|
+
}, []), p = d(
|
|
40
|
+
(e, t) => {
|
|
41
|
+
e === W.RECOVERY_CASE_RESUBMIT_DONE && c("recoveryCaseResubmitted"), e === X.INFORMATION_REQUEST_FORM_DONE && c("informationRequestResponded"), u(e, t);
|
|
42
|
+
},
|
|
43
|
+
[u, c]
|
|
44
|
+
), { data: P } = O({
|
|
45
|
+
companyUuid: n
|
|
46
|
+
}), { data: S } = V({
|
|
47
|
+
companyUuid: n
|
|
48
|
+
}), { data: A } = F({
|
|
49
|
+
companyUuid: n
|
|
50
|
+
}), y = (P.payrollBlockerList ?? []).map((e) => {
|
|
51
|
+
const t = e.key ?? "unknown", l = G(t), T = r(l.titleKey, {
|
|
52
|
+
defaultValue: t.replace(/_/g, " ").replace(/\b\w/g, (U) => U.toUpperCase())
|
|
53
|
+
}), I = r(l.descriptionKey, {
|
|
54
|
+
defaultValue: e.message || r("defaultBlockerDescription")
|
|
55
|
+
});
|
|
56
|
+
return {
|
|
57
|
+
id: t,
|
|
58
|
+
title: T,
|
|
59
|
+
description: I
|
|
60
|
+
};
|
|
61
|
+
}), q = S.recoveryCaseList ?? [], L = A.informationRequestList ?? [], h = q.some(
|
|
62
|
+
(e) => e.status !== "recovered"
|
|
63
|
+
), k = L.some(
|
|
64
|
+
(e) => e.blockingPayroll && e.status !== K.Approved
|
|
65
|
+
), w = H({
|
|
66
|
+
data: y,
|
|
15
67
|
columns: [
|
|
16
68
|
{
|
|
17
|
-
title:
|
|
18
|
-
render: (
|
|
19
|
-
/* @__PURE__ */
|
|
20
|
-
/* @__PURE__ */
|
|
69
|
+
title: r("blockerSectionLabel"),
|
|
70
|
+
render: (e) => /* @__PURE__ */ o(j, { flexGrow: 1, children: /* @__PURE__ */ m(a, { flexDirection: "column", gap: 8, children: [
|
|
71
|
+
/* @__PURE__ */ o(i, { weight: "semibold", children: e.title }),
|
|
72
|
+
/* @__PURE__ */ o(i, { variant: "supporting", children: e.description })
|
|
21
73
|
] }) })
|
|
22
74
|
},
|
|
23
75
|
{
|
|
24
76
|
title: "",
|
|
25
|
-
render: (
|
|
26
|
-
const
|
|
27
|
-
return
|
|
77
|
+
render: (e) => {
|
|
78
|
+
const t = e.action;
|
|
79
|
+
return t ? /* @__PURE__ */ o(a, { justifyContent: "flex-end", alignItems: "center", children: /* @__PURE__ */ o(v, { variant: "secondary", onClick: t.onClick, title: t.label, children: t.label }) }) : null;
|
|
28
80
|
}
|
|
29
81
|
}
|
|
30
82
|
]
|
|
31
|
-
});
|
|
32
|
-
return
|
|
33
|
-
/* @__PURE__ */
|
|
34
|
-
|
|
35
|
-
|
|
83
|
+
}), C = y.length > 0;
|
|
84
|
+
return C || h || k ? /* @__PURE__ */ o("div", { className: R(B.root, s), children: /* @__PURE__ */ m(a, { flexDirection: "column", gap: 32, children: [
|
|
85
|
+
x.alerts.map((e) => /* @__PURE__ */ o(
|
|
86
|
+
D,
|
|
87
|
+
{
|
|
88
|
+
status: "success",
|
|
89
|
+
label: r(`alerts.${e.type}.title`),
|
|
90
|
+
onDismiss: () => {
|
|
91
|
+
E(e.id);
|
|
92
|
+
},
|
|
93
|
+
children: /* @__PURE__ */ o(i, { children: r(`alerts.${e.type}.description`) })
|
|
94
|
+
},
|
|
95
|
+
e.id
|
|
96
|
+
)),
|
|
97
|
+
C && /* @__PURE__ */ m(a, { flexDirection: "column", gap: 20, children: [
|
|
98
|
+
/* @__PURE__ */ o(b, { as: "h2", styledAs: "h4", children: r("blockersListTitle") }),
|
|
99
|
+
/* @__PURE__ */ o($, { ...w, label: r("blockersListTitle") })
|
|
100
|
+
] }),
|
|
101
|
+
h && /* @__PURE__ */ o(z, { companyId: n, onEvent: p }),
|
|
102
|
+
k && /* @__PURE__ */ o(
|
|
103
|
+
Z,
|
|
104
|
+
{
|
|
105
|
+
companyId: n,
|
|
106
|
+
filterByPayrollBlocking: !0,
|
|
107
|
+
onEvent: p
|
|
108
|
+
}
|
|
109
|
+
)
|
|
110
|
+
] }) }) : /* @__PURE__ */ o("div", { className: R(B.root, s), children: /* @__PURE__ */ o(i, { children: r("noBlockersMessage") }) });
|
|
36
111
|
}
|
|
37
112
|
export {
|
|
38
|
-
|
|
113
|
+
be as PayrollBlockerList
|
|
39
114
|
};
|
|
40
115
|
//# sourceMappingURL=PayrollBlockerList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PayrollBlockerList.js","sources":["../../../../../src/components/Payroll/PayrollBlocker/components/PayrollBlockerList.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport classNames from 'classnames'\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 { useI18n } from '@/i18n'\n\nexport interface PayrollBlocker {\n id: string\n title: string\n description: string\n action?: {\n label: string\n onClick: () => void\n }\n}\n\ninterface PayrollBlockerListProps {\n blockers: PayrollBlocker[]\n className?: string\n}\n\n/**\n * PayrollBlockerList - DataView-based component displaying payroll blockers\n * Shows each blocker with individual resolution buttons\n */\nexport function PayrollBlockerList({ blockers, className }: PayrollBlockerListProps) {\n useI18n('Payroll.PayrollBlocker')\n const { t } = useTranslation('Payroll.PayrollBlocker')\n const { Button, Text, Heading } = useComponentContext()\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 // For presentational purposes, just show the primary action if it exists\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 if (blockers.length === 0) {\n return null\n }\n\n return (\n <div className={classNames(styles.root, className)}>\n <Flex flexDirection=\"column\" gap={24}>\n <Heading as=\"h2\" styledAs=\"h4\">\n {t('blockersListTitle')}\n </Heading>\n\n <DataView {...dataViewProps} label={t('blockersListTitle')} />\n </Flex>\n </div>\n )\n}\n"],"names":["PayrollBlockerList","blockers","className","useI18n","t","useTranslation","Button","Text","Heading","useComponentContext","dataViewProps","useDataView","blocker","jsx","FlexItem","jsxs","Flex","action","classNames","styles","DataView"],"mappings":";;;;;;;;;;AA4BO,SAASA,EAAmB,EAAE,UAAAC,GAAU,WAAAC,KAAsC;AACnF,EAAAC,EAAQ,wBAAwB;AAChC,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,wBAAwB,GAC/C,EAAE,QAAAC,GAAQ,MAAAC,GAAM,SAAAC,EAAA,IAAYC,EAAA,GAE5BC,IAAgBC,EAAY;AAAA,IAChC,MAAMV;AAAA,IACN,SAAS;AAAA,MACP;AAAA,QACE,OAAOG,EAAE,qBAAqB;AAAA,QAC9B,QAAQ,CAAAQ,MACN,gBAAAC,EAACC,GAAA,EAAS,UAAU,GAClB,UAAA,gBAAAC,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,GAChC,UAAA;AAAA,UAAA,gBAAAH,EAACN,GAAA,EAAK,QAAO,YAAY,UAAAK,EAAQ,OAAM;AAAA,UACvC,gBAAAC,EAACN,GAAA,EAAK,SAAQ,cAAc,YAAQ,YAAA,CAAY;AAAA,QAAA,EAAA,CAClD,EAAA,CACF;AAAA,MAAA;AAAA,MAGJ;AAAA,QACE,OAAO;AAAA,QACP,QAAQ,CAAAK,MAAW;AAEjB,gBAAMK,IAASL,EAAQ;AAEvB,iBAAKK,sBAKFD,GAAA,EAAK,gBAAe,YAAW,YAAW,UACzC,4BAACV,GAAA,EAAO,SAAQ,aAAY,SAASW,EAAO,SAAS,OAAOA,EAAO,OAChE,UAAAA,EAAO,OACV,EAAA,CACF,IARO;AAAA,QAUX;AAAA,MAAA;AAAA,IACF;AAAA,EACF,CACD;AAED,SAAIhB,EAAS,WAAW,IACf,OAIP,gBAAAY,EAAC,OAAA,EAAI,WAAWK,EAAWC,EAAO,MAAMjB,CAAS,GAC/C,UAAA,gBAAAa,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,IAAA,gBAAAH,EAACL,KAAQ,IAAG,MAAK,UAAS,MACvB,UAAAJ,EAAE,mBAAmB,GACxB;AAAA,sBAECgB,GAAA,EAAU,GAAGV,GAAe,OAAON,EAAE,mBAAmB,EAAA,CAAG;AAAA,EAAA,EAAA,CAC9D,EAAA,CACF;AAEJ;"}
|
|
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 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":"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"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import "./types/i18next.d.ts"
|
|
2
|
-
export { PayrollBlocker } from './PayrollBlocker';
|
|
3
2
|
export { PayrollBlockerAlerts } from './components/PayrollBlockerAlerts';
|
|
4
3
|
export { PayrollBlockerList } from './components/PayrollBlockerList';
|
|
5
4
|
export type { ApiPayrollBlocker } from './payrollHelpers';
|
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
import { PayrollBlockersError as s } from "@gusto/embedded-api/models/errors/payrollblockerserror";
|
|
2
|
-
import { UnprocessableEntityErrorObject1 as
|
|
2
|
+
import { UnprocessableEntityErrorObject1 as n } from "@gusto/embedded-api/models/errors/unprocessableentityerrorobject1";
|
|
3
3
|
function t(r) {
|
|
4
4
|
return typeof r == "object" && r !== null && "key" in r && typeof r.key == "string";
|
|
5
5
|
}
|
|
6
|
-
function
|
|
6
|
+
function l(r) {
|
|
7
7
|
return r instanceof s;
|
|
8
8
|
}
|
|
9
9
|
function a(r) {
|
|
10
|
-
return r instanceof
|
|
10
|
+
return r instanceof n && Array.isArray(r.errors) && r.errors.some((o) => o.category === "payroll_blocker");
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
return
|
|
12
|
+
function i(r) {
|
|
13
|
+
return l(r) ? !r.errors || r.errors.length === 0 ? [] : r.errors.map((e) => ({ key: t(e.metadata) ? e.metadata.key : e.errorKey || "unknown", message: e.message })) : a(r) ? r.errors.filter((e) => e.category === "payroll_blocker").map((e) => ({ key: t(e.metadata) ? e.metadata.key : e.errorKey || "unknown", message: e.message })) : [];
|
|
14
14
|
}
|
|
15
|
-
const
|
|
15
|
+
const y = (r) => r instanceof s ? !0 : r instanceof n ? Array.isArray(r.errors) && r.errors.some((o) => o.category === "payroll_blocker") : !1, f = async (r) => {
|
|
16
16
|
try {
|
|
17
17
|
return await r(), { success: !0, blockers: [] };
|
|
18
18
|
} catch (o) {
|
|
19
|
-
if (
|
|
20
|
-
return { success: !1, blockers:
|
|
19
|
+
if (y(o))
|
|
20
|
+
return { success: !1, blockers: i(o) };
|
|
21
21
|
throw o;
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
24
|
function b(r) {
|
|
25
25
|
return {
|
|
26
|
-
titleKey: `
|
|
27
|
-
descriptionKey: `
|
|
28
|
-
helpTextKey: `
|
|
29
|
-
defaultActionKey: `
|
|
26
|
+
titleKey: `blockers.${r}.title`,
|
|
27
|
+
descriptionKey: `blockers.${r}.description`,
|
|
28
|
+
helpTextKey: `blockers.${r}.help`,
|
|
29
|
+
defaultActionKey: `blockers.${r}.defaultAction`
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
32
|
export {
|
|
33
33
|
b as getBlockerTranslationKeys,
|
|
34
|
-
|
|
34
|
+
l as isPayrollBlockersError,
|
|
35
35
|
a as isUnprocessableEntityWithPayrollBlockers,
|
|
36
|
-
|
|
36
|
+
i as parsePayrollBlockersFromError,
|
|
37
37
|
f as payrollSubmitHandler
|
|
38
38
|
};
|
|
39
39
|
//# 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: `
|
|
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","getBlockerTranslationKeys","key"],"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/BA,EAAM,OACpB,OAAO,CAAAI,MAAOA,EAAI,aAAa,iBAAiB,EAChD,IAAI,CAAAA,OAGI,EAAE,KAFGP,EAAeO,EAAI,QAAQ,IAAIA,EAAI,SAAS,MAAMA,EAAI,YAAY,WAEhE,SAASA,EAAI,QAAA,EAC5B,IAKE,CAAA;AACT;AAIA,MAAME,IAAqB,CAACN,MACtBA,aAAiBC,IACZ,KAELD,aAAiBG,IAEjB,MAAM,QAAQH,EAAM,MAAM,KAAKA,EAAM,OAAO,KAAK,CAAAI,MAAOA,EAAI,aAAa,iBAAiB,IAGvF,IAYIG,IAAuB,OAClCC,MACiC;AACjC,MAAI;AACF,iBAAMA,EAAA,GACC,EAAE,SAAS,IAAM,UAAU,CAAA,EAAC;AAAA,EACrC,SAASR,GAAgB;AACvB,QAAIM,EAAmBN,CAAK;AAE1B,aAAO,EAAE,SAAS,IAAO,UADRK,EAA8BL,CAAK,EAC3B;AAI3B,UAAMA;AAAA,EACR;AACF;AAKO,SAASS,EAA0BC,GAAa;AACrD,SAAO;AAAA,IACL,UAAU,YAAYA,CAAG;AAAA,IACzB,gBAAgB,YAAYA,CAAG;AAAA,IAC/B,aAAa,YAAYA,CAAG;AAAA,IAC5B,kBAAkB,YAAYA,CAAG;AAAA,EAAA;AAErC;"}
|