@gusto/embedded-react-sdk 0.19.0 → 0.21.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 +48 -0
- package/dist/UNSTABLE_Hooks.d.ts +1 -0
- package/dist/UNSTABLE_Hooks.js +9 -0
- package/dist/UNSTABLE_Hooks.js.map +1 -0
- package/dist/assets/icons/coins-hand.svg.js +10 -0
- package/dist/assets/icons/coins-hand.svg.js.map +1 -0
- package/dist/components/Base/Base.d.ts +19 -4
- package/dist/components/Base/Base.js +68 -61
- package/dist/components/Base/Base.js.map +1 -1
- package/dist/components/Base/useBase.d.ts +1 -1
- package/dist/components/Base/useBase.js.map +1 -1
- package/dist/components/Base/useBaseSubmit.d.ts +10 -0
- package/dist/components/Base/useBaseSubmit.js +33 -0
- package/dist/components/Base/useBaseSubmit.js.map +1 -0
- package/dist/components/Common/Fields/TextAreaField/TextAreaField.d.ts +5 -0
- package/dist/components/Common/Fields/TextAreaField/TextAreaField.js +34 -0
- package/dist/components/Common/Fields/TextAreaField/TextAreaField.js.map +1 -0
- package/dist/components/Common/Fields/TextAreaField/index.d.ts +3 -0
- package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.js +10 -10
- package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureForm.js +15 -10
- package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormActions.js +14 -10
- package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormFields.js +19 -14
- package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
- package/dist/components/Common/UI/Alert/Alert.js +23 -22
- package/dist/components/Common/UI/Alert/Alert.js.map +1 -1
- package/dist/components/Common/UI/Alert/AlertTypes.d.ts +4 -0
- package/dist/components/Common/UI/Alert/AlertTypes.js.map +1 -1
- package/dist/components/Common/UI/DatePicker/DatePicker.d.ts +1 -1
- package/dist/components/Common/UI/DatePicker/DatePicker.js +38 -37
- package/dist/components/Common/UI/DatePicker/DatePicker.js.map +1 -1
- package/dist/components/Common/UI/DatePicker/DatePickerTypes.d.ts +4 -0
- package/dist/components/Common/UI/Modal/Modal.module.scss.js +17 -17
- package/dist/components/Common/UI/Select/Select.d.ts +1 -1
- package/dist/components/Common/UI/Select/Select.js +27 -26
- package/dist/components/Common/UI/Select/Select.js.map +1 -1
- package/dist/components/Common/UI/Select/SelectTypes.d.ts +4 -0
- package/dist/components/Common/UI/TextArea/TextArea.d.ts +2 -0
- package/dist/components/Common/UI/TextArea/TextArea.js +79 -0
- package/dist/components/Common/UI/TextArea/TextArea.js.map +1 -0
- package/dist/components/Common/UI/TextArea/TextArea.module.scss.js +12 -0
- package/dist/components/Common/UI/TextArea/TextArea.module.scss.js.map +1 -0
- package/dist/components/Common/UI/TextArea/TextAreaTypes.d.ts +37 -0
- package/dist/components/Common/UI/TextArea/TextAreaTypes.js +9 -0
- package/dist/components/Common/UI/TextArea/TextAreaTypes.js.map +1 -0
- package/dist/components/Common/UI/TextArea/index.d.ts +4 -0
- package/dist/components/Company/AssignSignatory/AssignSignatory.js +11 -7
- package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +10 -6
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +11 -8
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +9 -6
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +14 -13
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +6 -4
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +9 -6
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +13 -10
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +14 -13
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +6 -4
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/TitleSelect.js +10 -7
- package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +8 -6
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +11 -9
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js +13 -9
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +6 -4
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js +13 -10
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +15 -12
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +8 -4
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +8 -5
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +15 -11
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +6 -4
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +15 -11
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +6 -4
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Actions.js +11 -8
- package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Company/FederalTaxes/FederalTaxes.js +19 -15
- package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Form.js +8 -6
- package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +11 -9
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Actions.js +11 -8
- package/dist/components/Company/Industry/Actions.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +9 -7
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Industry/Edit.js +14 -10
- package/dist/components/Company/Industry/Edit.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Actions.js +11 -8
- package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Form.js +7 -5
- package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/LocationForm.js +19 -15
- package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +6 -4
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/Actions.js +9 -6
- package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/List.js +17 -15
- package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +15 -12
- package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +6 -4
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/Completed.js +15 -12
- package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js +12 -9
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +10 -6
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +6 -4
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/PaySchedule.js +36 -33
- package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Actions.js +13 -10
- 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 +14 -11
- package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/List.js +21 -19
- package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
- package/dist/components/Company/PaySchedule/usePaySchedule.js +8 -6
- package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +8 -5
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +6 -4
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +9 -6
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js +8 -5
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +6 -4
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Contractor/Address/Address.js +8 -4
- package/dist/components/Contractor/Address/Address.js.map +1 -1
- package/dist/components/Contractor/Address/Form.js +8 -6
- package/dist/components/Contractor/Address/Form.js.map +1 -1
- package/dist/components/Contractor/Address/useAddress.js +8 -6
- package/dist/components/Contractor/Address/useAddress.js.map +1 -1
- package/dist/components/Contractor/ContractorList/index.js +29 -28
- 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 +14 -10
- 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 +5 -2
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.d.ts +15 -0
- package/dist/components/Contractor/Payments/Detail/DetailPresentation.d.ts +19 -0
- package/dist/components/Contractor/Payments/Overview/OverviewPresentation.d.ts +18 -0
- package/dist/components/Contractor/Payments/PaymentEdit/PaymentEditPresentation.d.ts +6 -0
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.d.ts +18 -0
- package/dist/components/Contractor/Payments/types.d.ts +4 -0
- package/dist/components/Contractor/Profile/ContractorProfileForm.js +13 -13
- 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 +22 -20
- package/dist/components/Contractor/Submit/Submit.js.map +1 -1
- package/dist/components/Employee/Compensation/Actions.js +14 -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 +25 -23
- package/dist/components/Employee/Compensation/List.js.map +1 -1
- package/dist/components/Employee/Deductions/Deductions.d.ts +1 -1
- package/dist/components/Employee/Deductions/Deductions.js +10 -10
- package/dist/components/Employee/Deductions/Deductions.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsComponents.d.ts +2 -0
- package/dist/components/Employee/Deductions/DeductionsComponents.js +6 -6
- package/dist/components/Employee/Deductions/DeductionsComponents.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +222 -0
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -0
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.module.scss.js +8 -0
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.module.scss.js.map +1 -0
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.d.ts +2 -2
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +165 -0
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -0
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.d.ts +0 -34
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js +90 -126
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.module.scss.js +14 -0
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.module.scss.js.map +1 -0
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +56 -55
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js.map +1 -1
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.d.ts +6 -0
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js +53 -0
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js.map +1 -0
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.module.scss.js +14 -0
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.module.scss.js.map +1 -0
- package/dist/components/Employee/Deductions/stateMachine.js +49 -29
- package/dist/components/Employee/Deductions/stateMachine.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +9 -6
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +13 -9
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js +6 -2
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +6 -4
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +15 -11
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +6 -4
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Employee/EmployeeList/Actions.js +9 -6
- package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
- package/dist/components/Employee/EmployeeList/EmployeeList.js +6 -3
- package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
- package/dist/components/Employee/EmployeeList/Head.js +8 -5
- package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
- package/dist/components/Employee/EmployeeList/List.js +17 -16
- package/dist/components/Employee/EmployeeList/List.js.map +1 -1
- package/dist/components/Employee/EmployeeList/useEmployeeList.js +6 -4
- package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/Actions.js +10 -7
- package/dist/components/Employee/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/FederalForm.js +14 -11
- package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +6 -4
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Employee/Landing/Landing.js +15 -13
- 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 +11 -8
- package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +8 -5
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js +13 -11
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +10 -7
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/Split.js +10 -9
- package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +8 -6
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
- package/dist/components/Employee/Profile/Actions.js +11 -8
- package/dist/components/Employee/Profile/Actions.js.map +1 -1
- package/dist/components/Employee/Profile/AdminPersonalDetails.js +11 -8
- package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
- package/dist/components/Employee/Profile/HomeAddress.js +8 -7
- package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js +31 -28
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
- package/dist/components/Employee/Profile/useProfile.js +6 -4
- package/dist/components/Employee/Profile/useProfile.js.map +1 -1
- package/dist/components/Employee/StateTaxes/Actions.js +11 -8
- package/dist/components/Employee/StateTaxes/Actions.js.map +1 -1
- package/dist/components/Employee/StateTaxes/useStateTaxes.js +6 -4
- package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
- package/dist/components/Employee/Taxes/Actions.js +11 -8
- package/dist/components/Employee/Taxes/Actions.js.map +1 -1
- package/dist/components/Employee/Taxes/FederalForm.js +15 -12
- package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/Taxes/useTaxes.js +6 -4
- package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
- package/dist/components/Flow/Flow.js +30 -27
- package/dist/components/Flow/Flow.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.d.ts +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js +58 -36
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.d.ts +2 -0
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.js +71 -54
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsComponents.d.ts +23 -0
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsComponents.js +27 -15
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsComponents.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.d.ts +25 -2
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +153 -23
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.module.scss.js +10 -0
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.module.scss.js.map +1 -0
- package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.d.ts +9 -1
- package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.js +195 -22
- package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.module.scss.js +18 -0
- package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.module.scss.js.map +1 -0
- package/dist/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.d.ts +10 -2
- package/dist/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.js +39 -25
- package/dist/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/index.d.ts +1 -0
- package/dist/components/Payroll/ConfirmWireDetails/types.d.ts +5 -0
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +16 -13
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +8 -6
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +15 -15
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +27 -27
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +13 -11
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.d.ts +0 -12
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.js +44 -52
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.d.ts +9 -6
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +97 -93
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollList.js +58 -59
- package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.d.ts +4 -6
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +82 -72
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +3 -2
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +11 -10
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchThresholdExceeded.js +8 -5
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchThresholdExceeded.js.map +1 -1
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +3 -2
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollStatusBadges/PayrollStatusBadges.d.ts +7 -0
- package/dist/components/Payroll/PayrollStatusBadges/PayrollStatusBadges.js +19 -0
- package/dist/components/Payroll/PayrollStatusBadges/PayrollStatusBadges.js.map +1 -0
- package/dist/components/Payroll/PayrollStatusBadges/PayrollStatusBadges.module.scss.js +10 -0
- package/dist/components/Payroll/PayrollStatusBadges/PayrollStatusBadges.module.scss.js.map +1 -0
- package/dist/components/Payroll/PayrollStatusBadges/index.d.ts +4 -0
- package/dist/components/Payroll/PayrollStatusBadges/payrollStatusConfig.d.ts +33 -0
- package/dist/components/Payroll/PayrollStatusBadges/payrollStatusConfig.js +161 -0
- package/dist/components/Payroll/PayrollStatusBadges/payrollStatusConfig.js.map +1 -0
- package/dist/components/Payroll/PayrollStatusBadges/usePayrollStatusBadges.d.ts +3 -0
- package/dist/components/Payroll/PayrollStatusBadges/usePayrollStatusBadges.js +17 -0
- package/dist/components/Payroll/PayrollStatusBadges/usePayrollStatusBadges.js.map +1 -0
- package/dist/components/Payroll/PayrollStatusBadges/usePayrollStatusBadges.test.d.ts +1 -0
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfiguration.d.ts +6 -0
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfiguration.js +70 -0
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfiguration.js.map +1 -0
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationContext.d.ts +7 -0
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationContext.js +6 -0
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationContext.js.map +1 -0
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationProvider.d.ts +9 -0
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationProvider.js +40 -0
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationProvider.js.map +1 -0
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/index.d.ts +5 -0
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/usePayrollConfiguration.d.ts +2 -0
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/usePayrollConfiguration.js +12 -0
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/usePayrollConfiguration.js.map +1 -0
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/index.d.ts +2 -0
- package/dist/components/Payroll/helpers.d.ts +0 -5
- package/dist/components/Payroll/helpers.js +106 -112
- package/dist/components/Payroll/helpers.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.js +10 -8
- 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/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 +9 -5
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/helpers/dateFormatting.d.ts +9 -0
- package/dist/helpers/dateFormatting.js +65 -52
- package/dist/helpers/dateFormatting.js.map +1 -1
- package/dist/helpers/formattedStrings.js +12 -11
- package/dist/helpers/formattedStrings.js.map +1 -1
- package/dist/helpers/validations.js +1 -1
- package/dist/helpers/validations.js.map +1 -1
- package/dist/i18n/I18n.js +10 -10
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/ContractorPayment.ContractorPaymentCreatePayment.json.js +32 -0
- package/dist/i18n/en/ContractorPayment.ContractorPaymentCreatePayment.json.js.map +1 -0
- package/dist/i18n/en/ContractorPayment.ContractorPaymentDetail.json.js +24 -0
- package/dist/i18n/en/ContractorPayment.ContractorPaymentDetail.json.js.map +1 -0
- package/dist/i18n/en/ContractorPayment.ContractorPaymentOverview.json.js +32 -0
- package/dist/i18n/en/ContractorPayment.ContractorPaymentOverview.json.js.map +1 -0
- package/dist/i18n/en/ContractorPayment.ContractorPaymentPaymentHistory.json.js +32 -0
- package/dist/i18n/en/ContractorPayment.ContractorPaymentPaymentHistory.json.js.map +1 -0
- package/dist/i18n/en/Payroll.Common.json.js +8 -0
- package/dist/i18n/en/Payroll.Common.json.js.map +1 -0
- package/dist/i18n/en/Payroll.ConfirmWireDetailsForm.json.js +25 -5
- package/dist/i18n/en/Payroll.ConfirmWireDetailsForm.json.js.map +1 -1
- package/dist/i18n/en/Payroll.PayrollList.json.js +14 -16
- package/dist/i18n/en/Payroll.PayrollList.json.js.map +1 -1
- package/dist/i18n/en/Payroll.WireInstructions.json.js +22 -6
- package/dist/i18n/en/Payroll.WireInstructions.json.js.map +1 -1
- package/dist/shared/constants.d.ts +6 -0
- package/dist/shared/constants.js +15 -12
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +183 -8
- package/package.json +13 -9
- package/dist/components/Employee/Deductions/DeductionsForm/UNSTABLE_DeductionsForm.d.ts +0 -7
- package/dist/components/Employee/Deductions/EmptyState/EmptyState.d.ts +0 -6
- package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.d.ts +0 -15
- package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.js +0 -48
- package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.js.map +0 -1
|
@@ -1,30 +1,203 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { jsx as e, jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as v } from "react";
|
|
3
|
+
import { useTranslation as A } from "react-i18next";
|
|
4
|
+
import { useWireInRequestsListSuspense as T } from "@gusto/embedded-api/react-query/wireInRequestsList";
|
|
5
|
+
import { usePayrollsListSuspense as x } from "@gusto/embedded-api/react-query/payrollsList";
|
|
6
|
+
import u from "./WireInstructions.module.scss.js";
|
|
7
|
+
import { BaseComponent as F } from "../../../Base/Base.js";
|
|
4
8
|
import "../../../Base/useBase.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { payrollWireEvents as
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
import { Flex as f } from "../../../Common/Flex/Flex.js";
|
|
10
|
+
import { useComponentContext as g } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
11
|
+
import { useComponentDictionary as _, useI18n as k } from "../../../../i18n/I18n.js";
|
|
12
|
+
import { payrollWireEvents as C } from "../../../../shared/constants.js";
|
|
13
|
+
import { useDateFormatter as w } from "../../../../hooks/useDateFormatter.js";
|
|
14
|
+
import E from "../../../../hooks/useNumberFormatter.js";
|
|
15
|
+
import { useFlow as O } from "../../../Flow/useFlow.js";
|
|
16
|
+
function W(n, a) {
|
|
17
|
+
const { data: i } = T({
|
|
18
|
+
companyUuid: n
|
|
19
|
+
}), { data: d } = x({
|
|
20
|
+
companyId: n,
|
|
21
|
+
processed: !0
|
|
22
|
+
}), l = (i.wireInRequestList || []).filter(
|
|
23
|
+
(o) => o.status === "awaiting_funds"
|
|
24
|
+
), r = l.find((o) => o.uuid === a), t = d.payrollList || [], m = v(
|
|
25
|
+
() => l.map((o) => {
|
|
26
|
+
const h = t.find((b) => b.payrollUuid === o.paymentUuid);
|
|
27
|
+
return {
|
|
28
|
+
wireInRequest: o,
|
|
29
|
+
payroll: h
|
|
30
|
+
};
|
|
31
|
+
}),
|
|
32
|
+
[l, t]
|
|
33
|
+
);
|
|
34
|
+
return {
|
|
35
|
+
selectedInstruction: v(() => r ? {
|
|
36
|
+
id: r.uuid || "",
|
|
37
|
+
trackingCode: r.uniqueTrackingCode || "",
|
|
38
|
+
amount: parseFloat(r.requestedAmount || "0"),
|
|
39
|
+
bankName: r.originationBank || "",
|
|
40
|
+
bankAddress: r.originationBankAddress || "",
|
|
41
|
+
recipientName: r.recipientName || "",
|
|
42
|
+
recipientAddress: r.recipientAddress || "",
|
|
43
|
+
recipientAccountNumber: r.recipientAccountNumber || "",
|
|
44
|
+
recipientRoutingNumber: r.recipientRoutingNumber || ""
|
|
45
|
+
} : null, [r]),
|
|
46
|
+
activeWireInRequestsWithPayrolls: m
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function c({ label: n, value: a }) {
|
|
50
|
+
const { Text: i } = g();
|
|
51
|
+
return /* @__PURE__ */ p(f, { flexDirection: "column", gap: 8, children: [
|
|
52
|
+
/* @__PURE__ */ e(i, { className: u.fieldLabel, children: n }),
|
|
53
|
+
/* @__PURE__ */ e(i, { className: u.fieldValue, children: a })
|
|
54
|
+
] });
|
|
11
55
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
56
|
+
function U(n) {
|
|
57
|
+
return /* @__PURE__ */ e(F, { ...n, children: /* @__PURE__ */ e(B, { ...n, children: n.children }) });
|
|
58
|
+
}
|
|
59
|
+
const B = ({
|
|
60
|
+
companyId: n,
|
|
61
|
+
wireInId: a,
|
|
62
|
+
selectedWireInId: i,
|
|
63
|
+
dictionary: d,
|
|
64
|
+
onEvent: l,
|
|
65
|
+
modalContainerRef: r
|
|
66
|
+
}) => {
|
|
67
|
+
_("Payroll.WireInstructions", d), k("Payroll.WireInstructions");
|
|
68
|
+
const { t } = A("Payroll.WireInstructions"), { Select: m, Card: R, Text: o, UnorderedList: h, Heading: b, Alert: L } = g(), P = w(), q = E("currency"), { selectedInstruction: s, activeWireInRequestsWithPayrolls: I } = W(
|
|
69
|
+
n,
|
|
70
|
+
i
|
|
71
|
+
), S = !a && I.length > 1, D = (N) => {
|
|
72
|
+
l(C.PAYROLL_WIRE_INSTRUCTIONS_SELECT, {
|
|
73
|
+
selectedId: N
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
return I.length === 0 || i && !s ? /* @__PURE__ */ e(f, { flexDirection: "column", gap: 24, children: /* @__PURE__ */ e(o, { children: t("messages.noInstructions") }) }) : /* @__PURE__ */ p(f, { flexDirection: "column", gap: 24, children: [
|
|
77
|
+
/* @__PURE__ */ p("div", { children: [
|
|
78
|
+
/* @__PURE__ */ e(b, { as: "h2", styledAs: "h3", children: t("title") }),
|
|
79
|
+
/* @__PURE__ */ e(o, { className: u.subtitle, children: t("subtitle") })
|
|
80
|
+
] }),
|
|
81
|
+
S && /* @__PURE__ */ e(
|
|
82
|
+
m,
|
|
83
|
+
{
|
|
84
|
+
isRequired: !0,
|
|
85
|
+
portalContainer: r?.current || void 0,
|
|
86
|
+
label: t("selectLabel"),
|
|
87
|
+
value: i || "",
|
|
88
|
+
options: I.map(({ wireInRequest: N, payroll: y }) => ({
|
|
89
|
+
label: y?.payPeriod ? P.formatPayPeriodRange(
|
|
90
|
+
y.payPeriod.startDate,
|
|
91
|
+
y.payPeriod.endDate
|
|
92
|
+
) : t("selectFallback"),
|
|
93
|
+
value: N.uuid || ""
|
|
94
|
+
})),
|
|
95
|
+
onChange: D
|
|
96
|
+
}
|
|
97
|
+
),
|
|
98
|
+
/* @__PURE__ */ e(L, { label: t("requirementsTitle"), disableScrollIntoView: !0, children: /* @__PURE__ */ e(
|
|
99
|
+
h,
|
|
100
|
+
{
|
|
101
|
+
className: u.requirementsList,
|
|
102
|
+
items: [
|
|
103
|
+
t("requirements.trackingCode"),
|
|
104
|
+
t("requirements.amountMatch"),
|
|
105
|
+
t("requirements.usBank"),
|
|
106
|
+
t("requirements.authorized")
|
|
107
|
+
]
|
|
108
|
+
}
|
|
109
|
+
) }),
|
|
110
|
+
s && /* @__PURE__ */ e(f, { flexDirection: "column", gap: 16, children: /* @__PURE__ */ p(R, { className: u.requirementsCard, children: [
|
|
111
|
+
/* @__PURE__ */ e(
|
|
112
|
+
c,
|
|
113
|
+
{
|
|
114
|
+
label: t("fields.trackingCode"),
|
|
115
|
+
value: s.trackingCode
|
|
116
|
+
}
|
|
117
|
+
),
|
|
118
|
+
/* @__PURE__ */ e("hr", {}),
|
|
119
|
+
/* @__PURE__ */ e(
|
|
120
|
+
c,
|
|
121
|
+
{
|
|
122
|
+
label: t("fields.amount"),
|
|
123
|
+
value: q(s.amount)
|
|
124
|
+
}
|
|
125
|
+
),
|
|
126
|
+
/* @__PURE__ */ e("hr", {}),
|
|
127
|
+
/* @__PURE__ */ e(
|
|
128
|
+
c,
|
|
129
|
+
{
|
|
130
|
+
label: t("fields.bankName"),
|
|
131
|
+
value: s.bankName
|
|
132
|
+
}
|
|
133
|
+
),
|
|
134
|
+
/* @__PURE__ */ e("hr", {}),
|
|
135
|
+
/* @__PURE__ */ e(
|
|
136
|
+
c,
|
|
137
|
+
{
|
|
138
|
+
label: t("fields.bankAddress"),
|
|
139
|
+
value: s.bankAddress
|
|
140
|
+
}
|
|
141
|
+
),
|
|
142
|
+
/* @__PURE__ */ e("hr", {}),
|
|
143
|
+
/* @__PURE__ */ e(
|
|
144
|
+
c,
|
|
145
|
+
{
|
|
146
|
+
label: t("fields.recipientName"),
|
|
147
|
+
value: s.recipientName
|
|
148
|
+
}
|
|
149
|
+
),
|
|
150
|
+
/* @__PURE__ */ e("hr", {}),
|
|
151
|
+
/* @__PURE__ */ e(
|
|
152
|
+
c,
|
|
153
|
+
{
|
|
154
|
+
label: t("fields.recipientAddress"),
|
|
155
|
+
value: s.recipientAddress
|
|
156
|
+
}
|
|
157
|
+
),
|
|
158
|
+
/* @__PURE__ */ e("hr", {}),
|
|
159
|
+
/* @__PURE__ */ e(
|
|
160
|
+
c,
|
|
161
|
+
{
|
|
162
|
+
label: t("fields.accountNumber"),
|
|
163
|
+
value: s.recipientAccountNumber
|
|
164
|
+
}
|
|
165
|
+
),
|
|
166
|
+
/* @__PURE__ */ e("hr", {}),
|
|
167
|
+
/* @__PURE__ */ e(
|
|
168
|
+
c,
|
|
169
|
+
{
|
|
170
|
+
label: t("fields.routingNumber"),
|
|
171
|
+
value: s.recipientRoutingNumber
|
|
172
|
+
}
|
|
173
|
+
)
|
|
174
|
+
] }) })
|
|
175
|
+
] });
|
|
176
|
+
}, Y = ({ onEvent: n }) => {
|
|
177
|
+
k("Payroll.WireInstructions");
|
|
178
|
+
const { t: a } = A("Payroll.WireInstructions"), { Button: i } = g(), { companyId: d, wireInId: l } = O(), { selectedInstruction: r } = W(d, l), t = () => {
|
|
179
|
+
const m = l || r?.id;
|
|
180
|
+
n(C.PAYROLL_WIRE_INSTRUCTIONS_DONE, {
|
|
181
|
+
selectedId: m
|
|
182
|
+
});
|
|
18
183
|
};
|
|
19
|
-
return /* @__PURE__ */
|
|
20
|
-
/* @__PURE__ */
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
184
|
+
return /* @__PURE__ */ p("div", { className: u.footer, children: [
|
|
185
|
+
/* @__PURE__ */ e(
|
|
186
|
+
i,
|
|
187
|
+
{
|
|
188
|
+
variant: "secondary",
|
|
189
|
+
onClick: () => {
|
|
190
|
+
n(C.PAYROLL_WIRE_INSTRUCTIONS_CANCEL);
|
|
191
|
+
},
|
|
192
|
+
children: a("cta.close")
|
|
193
|
+
}
|
|
194
|
+
),
|
|
195
|
+
/* @__PURE__ */ e(i, { variant: "primary", onClick: t, isDisabled: !r, children: a("cta.confirm") })
|
|
25
196
|
] });
|
|
26
197
|
};
|
|
198
|
+
U.Footer = Y;
|
|
27
199
|
export {
|
|
28
|
-
|
|
200
|
+
B as Root,
|
|
201
|
+
U as WireInstructions
|
|
29
202
|
};
|
|
30
203
|
//# sourceMappingURL=WireInstructions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WireInstructions.js","sources":["../../../../../src/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { payrollWireEvents, type EventType } from '@/shared/constants'\nimport type { OnEventType } from '@/components/Base/useBase'\n\ninterface WireInstructionsProps extends BaseComponentInterface<'Payroll.WireInstructions'> {\n companyId: string\n wireInId?: string\n onEvent: OnEventType<EventType, unknown>\n}\n\nexport function WireInstructions(props: WireInstructionsProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nconst Root = ({ companyId, wireInId, dictionary, onEvent }: WireInstructionsProps) => {\n useComponentDictionary('Payroll.WireInstructions', dictionary)\n useI18n('Payroll.WireInstructions')\n const { t } = useTranslation('Payroll.WireInstructions')\n const { Button } = useComponentContext()\n\n const handleConfirm = () => {\n onEvent(payrollWireEvents.PAYROLL_WIRE_INSTRUCTIONS_DONE)\n }\n\n const handleClose = () => {\n onEvent(payrollWireEvents.PAYROLL_WIRE_INSTRUCTIONS_CANCEL)\n }\n\n return (\n <Flex flexDirection=\"column\" gap={24}>\n <h2>{t('title')}</h2>\n\n {/* TODO: Wire instructions content will be implemented in subsequent ticket */}\n\n <Flex gap={12} justifyContent=\"flex-end\">\n <Button variant=\"secondary\" onClick={handleClose}>\n {t('cta.close')}\n </Button>\n <Button variant=\"primary\" onClick={handleConfirm}>\n {t('cta.confirm')}\n </Button>\n </Flex>\n </Flex>\n )\n}\n"],"names":["WireInstructions","props","jsx","BaseComponent","Root","companyId","wireInId","dictionary","onEvent","useComponentDictionary","useI18n","t","useTranslation","Button","useComponentContext","handleConfirm","payrollWireEvents","handleClose","jsxs","Flex"],"mappings":";;;;;;;;AAcO,SAASA,EAAiBC,GAA8B;AAC7D,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,MAAMG,IAAO,CAAC,EAAE,WAAAC,GAAW,UAAAC,GAAU,YAAAC,GAAY,SAAAC,QAAqC;AACpF,EAAAC,EAAuB,4BAA4BF,CAAU,GAC7DG,EAAQ,0BAA0B;AAClC,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,0BAA0B,GACjD,EAAE,QAAAC,EAAA,IAAWC,EAAA,GAEbC,IAAgB,MAAM;AAC1B,IAAAP,EAAQQ,EAAkB,8BAA8B;AAAA,EAC1D,GAEMC,IAAc,MAAM;AACxB,IAAAT,EAAQQ,EAAkB,gCAAgC;AAAA,EAC5D;AAEA,SACE,gBAAAE,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,IAAA,gBAAAjB,EAAC,MAAA,EAAI,UAAAS,EAAE,OAAO,EAAA,CAAE;AAAA,IAIhB,gBAAAO,EAACC,GAAA,EAAK,KAAK,IAAI,gBAAe,YAC5B,UAAA;AAAA,MAAA,gBAAAjB,EAACW,KAAO,SAAQ,aAAY,SAASI,GAClC,UAAAN,EAAE,WAAW,GAChB;AAAA,MACA,gBAAAT,EAACW,KAAO,SAAQ,WAAU,SAASE,GAChC,UAAAJ,EAAE,aAAa,EAAA,CAClB;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"WireInstructions.js","sources":["../../../../../src/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { useWireInRequestsListSuspense } from '@gusto/embedded-api/react-query/wireInRequestsList'\nimport { usePayrollsListSuspense } from '@gusto/embedded-api/react-query/payrollsList'\nimport type { ConfirmWireDetailsContextInterface } from '../ConfirmWireDetailsComponents'\nimport styles from './WireInstructions.module.scss'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { payrollWireEvents, type EventType } from '@/shared/constants'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\nimport useNumberFormatter from '@/hooks/useNumberFormatter'\nimport { useFlow } from '@/components/Flow/useFlow'\n\ninterface WireInstructionsProps extends BaseComponentInterface<'Payroll.WireInstructions'> {\n companyId: string\n wireInId?: string\n selectedWireInId?: string\n onEvent: OnEventType<EventType, unknown>\n modalContainerRef?: React.RefObject<HTMLDivElement | null>\n}\n\ninterface WireInstructionFieldProps {\n label: string\n value: string\n onCopy?: () => void\n copyAriaLabel?: string\n showCopiedMessage?: boolean\n copiedMessage?: string\n}\n\nfunction useWireInstructionsState(companyId: string, selectedWireInId?: string) {\n const { data: wireInRequestsData } = useWireInRequestsListSuspense({\n companyUuid: companyId,\n })\n\n const { data: payrollsData } = usePayrollsListSuspense({\n companyId,\n processed: true,\n })\n\n const activeWireInRequests = (wireInRequestsData.wireInRequestList || []).filter(\n r => r.status === 'awaiting_funds',\n )\n\n const wireInInformation = activeWireInRequests.find(r => r.uuid === selectedWireInId)\n\n const payrolls = payrollsData.payrollList || []\n\n const activeWireInRequestsWithPayrolls = useMemo(\n () =>\n activeWireInRequests.map(wireInRequest => {\n const payroll = payrolls.find(p => p.payrollUuid === wireInRequest.paymentUuid)\n return {\n wireInRequest,\n payroll,\n }\n }),\n [activeWireInRequests, payrolls],\n )\n\n const selectedInstruction = useMemo(() => {\n if (!wireInInformation) return null\n\n const instruction = {\n id: wireInInformation.uuid || '',\n trackingCode: wireInInformation.uniqueTrackingCode || '',\n amount: parseFloat(wireInInformation.requestedAmount || '0'),\n bankName: wireInInformation.originationBank || '',\n bankAddress: wireInInformation.originationBankAddress || '',\n recipientName: wireInInformation.recipientName || '',\n recipientAddress: wireInInformation.recipientAddress || '',\n recipientAccountNumber: wireInInformation.recipientAccountNumber || '',\n recipientRoutingNumber: wireInInformation.recipientRoutingNumber || '',\n }\n return instruction\n }, [wireInInformation])\n\n return {\n selectedInstruction,\n activeWireInRequestsWithPayrolls,\n }\n}\n\nfunction WireInstructionField({ label, value }: WireInstructionFieldProps) {\n const { Text } = useComponentContext()\n\n return (\n <Flex flexDirection=\"column\" gap={8}>\n <Text className={styles.fieldLabel}>{label}</Text>\n <Text className={styles.fieldValue}>{value}</Text>\n </Flex>\n )\n}\n\nexport function WireInstructions(props: WireInstructionsProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nexport const Root = ({\n companyId,\n wireInId,\n selectedWireInId,\n dictionary,\n onEvent,\n modalContainerRef,\n}: WireInstructionsProps) => {\n useComponentDictionary('Payroll.WireInstructions', dictionary)\n useI18n('Payroll.WireInstructions')\n const { t } = useTranslation('Payroll.WireInstructions')\n const { Select, Card, Text, UnorderedList, Heading, Alert } = useComponentContext()\n const dateFormatter = useDateFormatter()\n const formatCurrency = useNumberFormatter('currency')\n\n const { selectedInstruction, activeWireInRequestsWithPayrolls } = useWireInstructionsState(\n companyId,\n selectedWireInId,\n )\n\n const shouldShowDropdown = !wireInId && activeWireInRequestsWithPayrolls.length > 1\n\n const handleWireInSelection = (selectedId: string) => {\n onEvent(payrollWireEvents.PAYROLL_WIRE_INSTRUCTIONS_SELECT, {\n selectedId,\n })\n }\n\n if (activeWireInRequestsWithPayrolls.length === 0 || (selectedWireInId && !selectedInstruction)) {\n return (\n <Flex flexDirection=\"column\" gap={24}>\n <Text>{t('messages.noInstructions')}</Text>\n </Flex>\n )\n }\n\n return (\n <Flex flexDirection=\"column\" gap={24}>\n <div>\n <Heading as=\"h2\" styledAs=\"h3\">\n {t('title')}\n </Heading>\n <Text className={styles.subtitle}>{t('subtitle')}</Text>\n </div>\n\n {shouldShowDropdown && (\n <Select\n isRequired\n portalContainer={modalContainerRef?.current || undefined}\n label={t('selectLabel')}\n value={selectedWireInId || ''}\n options={activeWireInRequestsWithPayrolls.map(({ wireInRequest, payroll }) => ({\n label: payroll?.payPeriod\n ? dateFormatter.formatPayPeriodRange(\n payroll.payPeriod.startDate,\n payroll.payPeriod.endDate,\n )\n : t('selectFallback'),\n value: wireInRequest.uuid || '',\n }))}\n onChange={handleWireInSelection}\n />\n )}\n\n <Alert label={t('requirementsTitle')} disableScrollIntoView>\n <UnorderedList\n className={styles.requirementsList}\n items={[\n t('requirements.trackingCode'),\n t('requirements.amountMatch'),\n t('requirements.usBank'),\n t('requirements.authorized'),\n ]}\n />\n </Alert>\n\n {selectedInstruction && (\n <Flex flexDirection=\"column\" gap={16}>\n <Card className={styles.requirementsCard}>\n <WireInstructionField\n label={t('fields.trackingCode')}\n value={selectedInstruction.trackingCode}\n />\n\n <hr />\n\n <WireInstructionField\n label={t('fields.amount')}\n value={formatCurrency(selectedInstruction.amount)}\n />\n\n <hr />\n\n <WireInstructionField\n label={t('fields.bankName')}\n value={selectedInstruction.bankName}\n />\n\n <hr />\n\n <WireInstructionField\n label={t('fields.bankAddress')}\n value={selectedInstruction.bankAddress}\n />\n\n <hr />\n\n <WireInstructionField\n label={t('fields.recipientName')}\n value={selectedInstruction.recipientName}\n />\n\n <hr />\n\n <WireInstructionField\n label={t('fields.recipientAddress')}\n value={selectedInstruction.recipientAddress}\n />\n\n <hr />\n\n <WireInstructionField\n label={t('fields.accountNumber')}\n value={selectedInstruction.recipientAccountNumber}\n />\n\n <hr />\n\n <WireInstructionField\n label={t('fields.routingNumber')}\n value={selectedInstruction.recipientRoutingNumber}\n />\n </Card>\n </Flex>\n )}\n </Flex>\n )\n}\n\nconst Footer = ({ onEvent }: { onEvent: OnEventType<EventType, unknown> }) => {\n useI18n('Payroll.WireInstructions')\n const { t } = useTranslation('Payroll.WireInstructions')\n const { Button } = useComponentContext()\n const { companyId, wireInId } = useFlow<ConfirmWireDetailsContextInterface>()\n const { selectedInstruction } = useWireInstructionsState(companyId, wireInId)\n\n const handleConfirm = () => {\n const selectedId = wireInId || selectedInstruction?.id\n onEvent(payrollWireEvents.PAYROLL_WIRE_INSTRUCTIONS_DONE, {\n selectedId,\n })\n }\n\n return (\n <div className={styles.footer}>\n <Button\n variant=\"secondary\"\n onClick={() => {\n onEvent(payrollWireEvents.PAYROLL_WIRE_INSTRUCTIONS_CANCEL)\n }}\n >\n {t('cta.close')}\n </Button>\n <Button variant=\"primary\" onClick={handleConfirm} isDisabled={!selectedInstruction}>\n {t('cta.confirm')}\n </Button>\n </div>\n )\n}\n\nWireInstructions.Footer = Footer\n"],"names":["useWireInstructionsState","companyId","selectedWireInId","wireInRequestsData","useWireInRequestsListSuspense","payrollsData","usePayrollsListSuspense","activeWireInRequests","r","wireInInformation","payrolls","activeWireInRequestsWithPayrolls","useMemo","wireInRequest","payroll","p","WireInstructionField","label","value","Text","useComponentContext","jsxs","Flex","jsx","styles","WireInstructions","props","BaseComponent","Root","wireInId","dictionary","onEvent","modalContainerRef","useComponentDictionary","useI18n","useTranslation","Select","Card","UnorderedList","Heading","Alert","dateFormatter","useDateFormatter","formatCurrency","useNumberFormatter","selectedInstruction","shouldShowDropdown","handleWireInSelection","selectedId","payrollWireEvents","Footer","t","Button","useFlow","handleConfirm"],"mappings":";;;;;;;;;;;;;;;AAiCA,SAASA,EAAyBC,GAAmBC,GAA2B;AAC9E,QAAM,EAAE,MAAMC,EAAA,IAAuBC,EAA8B;AAAA,IACjE,aAAaH;AAAA,EAAA,CACd,GAEK,EAAE,MAAMI,EAAA,IAAiBC,EAAwB;AAAA,IACrD,WAAAL;AAAA,IACA,WAAW;AAAA,EAAA,CACZ,GAEKM,KAAwBJ,EAAmB,qBAAqB,CAAA,GAAI;AAAA,IACxE,CAAAK,MAAKA,EAAE,WAAW;AAAA,EAAA,GAGdC,IAAoBF,EAAqB,KAAK,CAAAC,MAAKA,EAAE,SAASN,CAAgB,GAE9EQ,IAAWL,EAAa,eAAe,CAAA,GAEvCM,IAAmCC;AAAA,IACvC,MACEL,EAAqB,IAAI,CAAAM,MAAiB;AACxC,YAA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EA,SACE,gBAAA3B,EAAC,OAAA,EAAI,WAAWG,EAAO,QACrB,UAAA;AAAA,IAAA,gBAAAD;AAAA,MAAC6B;AAAA,MAAA;AAAA,QACC,SAAQ;AAAA,QACR,SAAS,MAAM;AACb,UAAArB,EAAQkB,EAAkB,gCAAgC;AAAA,QAC5D;AAAA,QAEC,YAAE,WAAW;AAAA,MAAA;AAAA,IAAA;AAAA,IAEhB,gBAAA1B,EAAC6B,GAAA,EAAO,SAAQ,WAAU,SAASE,GAAe,YAAY,CAACT,GAC5D,UAAAM,EAAE,aAAa,EAAA,CAClB;AAAA,EAAA,GACF;AAEJ;AAEA1B,EAAiB,SAASyB;"}
|
package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.module.scss.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const e = "_subtitle_xw5zx_5", t = "_fieldLabel_xw5zx_10", s = "_fieldValue_xw5zx_17", r = "_requirementsCard_xw5zx_23", i = "_requirementsList_xw5zx_45", _ = "_footer_xw5zx_65", l = {
|
|
2
|
+
subtitle: e,
|
|
3
|
+
fieldLabel: t,
|
|
4
|
+
fieldValue: s,
|
|
5
|
+
requirementsCard: r,
|
|
6
|
+
requirementsList: i,
|
|
7
|
+
footer: _
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
l as default,
|
|
11
|
+
t as fieldLabel,
|
|
12
|
+
s as fieldValue,
|
|
13
|
+
_ as footer,
|
|
14
|
+
r as requirementsCard,
|
|
15
|
+
i as requirementsList,
|
|
16
|
+
e as subtitle
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=WireInstructions.module.scss.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WireInstructions.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -1,8 +1,16 @@
|
|
|
1
|
+
import { ConfirmationAlert } from './types';
|
|
1
2
|
import { payrollWireEvents } from '../../../shared/constants';
|
|
2
3
|
export type EventPayloads = {
|
|
4
|
+
[payrollWireEvents.PAYROLL_WIRE_INSTRUCTIONS_SELECT]: {
|
|
5
|
+
selectedId: string;
|
|
6
|
+
};
|
|
3
7
|
[payrollWireEvents.PAYROLL_WIRE_START_TRANSFER]: undefined;
|
|
4
|
-
[payrollWireEvents.PAYROLL_WIRE_INSTRUCTIONS_DONE]:
|
|
5
|
-
|
|
8
|
+
[payrollWireEvents.PAYROLL_WIRE_INSTRUCTIONS_DONE]: {
|
|
9
|
+
selectedId: string;
|
|
10
|
+
};
|
|
11
|
+
[payrollWireEvents.PAYROLL_WIRE_FORM_DONE]: {
|
|
12
|
+
confirmationAlert: ConfirmationAlert;
|
|
13
|
+
};
|
|
6
14
|
[payrollWireEvents.PAYROLL_WIRE_FORM_CANCEL]: undefined;
|
|
7
15
|
};
|
|
8
16
|
export declare const confirmWireDetailsMachine: {
|
|
@@ -1,32 +1,43 @@
|
|
|
1
|
-
import { state as
|
|
2
|
-
import { ConfirmWireDetailsFormContextual as
|
|
3
|
-
import { payrollWireEvents as
|
|
4
|
-
const
|
|
5
|
-
banner:
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { state as i, transition as e, reduce as o } from "robot3";
|
|
2
|
+
import { ConfirmWireDetailsFormContextual as a, WireInstructionsContextual as c } from "./ConfirmWireDetailsComponents.js";
|
|
3
|
+
import { payrollWireEvents as r } from "../../../shared/constants.js";
|
|
4
|
+
const m = {
|
|
5
|
+
banner: i(
|
|
6
|
+
e(
|
|
7
|
+
r.PAYROLL_WIRE_START_TRANSFER,
|
|
8
8
|
"wireInstructions",
|
|
9
9
|
o(
|
|
10
10
|
(n) => ({
|
|
11
11
|
...n,
|
|
12
|
-
component:
|
|
12
|
+
component: c
|
|
13
13
|
})
|
|
14
14
|
)
|
|
15
15
|
)
|
|
16
16
|
),
|
|
17
|
-
wireInstructions:
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
wireInstructions: i(
|
|
18
|
+
e(
|
|
19
|
+
r.PAYROLL_WIRE_INSTRUCTIONS_SELECT,
|
|
20
|
+
"wireInstructions",
|
|
21
|
+
o(
|
|
22
|
+
(n, t) => ({
|
|
23
|
+
...n,
|
|
24
|
+
selectedWireInId: t.payload.selectedId
|
|
25
|
+
})
|
|
26
|
+
)
|
|
27
|
+
),
|
|
28
|
+
e(
|
|
29
|
+
r.PAYROLL_WIRE_INSTRUCTIONS_DONE,
|
|
20
30
|
"confirmForm",
|
|
21
31
|
o(
|
|
22
|
-
(n) => ({
|
|
32
|
+
(n, t) => ({
|
|
23
33
|
...n,
|
|
24
|
-
component:
|
|
34
|
+
component: a,
|
|
35
|
+
selectedWireInId: t.payload.selectedId
|
|
25
36
|
})
|
|
26
37
|
)
|
|
27
38
|
),
|
|
28
|
-
|
|
29
|
-
|
|
39
|
+
e(
|
|
40
|
+
r.PAYROLL_WIRE_FORM_CANCEL,
|
|
30
41
|
"banner",
|
|
31
42
|
o(
|
|
32
43
|
(n) => ({
|
|
@@ -35,29 +46,32 @@ const s = {
|
|
|
35
46
|
)
|
|
36
47
|
)
|
|
37
48
|
),
|
|
38
|
-
confirmForm:
|
|
39
|
-
|
|
40
|
-
|
|
49
|
+
confirmForm: i(
|
|
50
|
+
e(
|
|
51
|
+
r.PAYROLL_WIRE_FORM_DONE,
|
|
41
52
|
"banner",
|
|
42
53
|
o(
|
|
43
|
-
(n) => ({
|
|
44
|
-
...n
|
|
54
|
+
(n, t) => ({
|
|
55
|
+
...n,
|
|
56
|
+
component: null,
|
|
57
|
+
confirmationAlert: t.payload.confirmationAlert
|
|
45
58
|
})
|
|
46
59
|
)
|
|
47
60
|
),
|
|
48
|
-
|
|
49
|
-
|
|
61
|
+
e(
|
|
62
|
+
r.PAYROLL_WIRE_FORM_CANCEL,
|
|
50
63
|
"banner",
|
|
51
64
|
o(
|
|
52
65
|
(n) => ({
|
|
53
|
-
...n
|
|
66
|
+
...n,
|
|
67
|
+
component: null
|
|
54
68
|
})
|
|
55
69
|
)
|
|
56
70
|
)
|
|
57
71
|
),
|
|
58
|
-
final:
|
|
72
|
+
final: i()
|
|
59
73
|
};
|
|
60
74
|
export {
|
|
61
|
-
|
|
75
|
+
m as confirmWireDetailsMachine
|
|
62
76
|
};
|
|
63
77
|
//# sourceMappingURL=confirmWireDetailsStateMachine.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"confirmWireDetailsStateMachine.js","sources":["../../../../src/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.tsx"],"sourcesContent":["import { state, transition, reduce } from 'robot3'\nimport type { ConfirmWireDetailsContextInterface } from './ConfirmWireDetailsComponents'\nimport {\n WireInstructionsContextual,\n ConfirmWireDetailsFormContextual,\n} from './ConfirmWireDetailsComponents'\nimport { payrollWireEvents } from '@/shared/constants'\nimport type { MachineTransition } from '@/types/Helpers'\n\nexport type EventPayloads = {\n [payrollWireEvents.PAYROLL_WIRE_START_TRANSFER]: undefined\n [payrollWireEvents.PAYROLL_WIRE_INSTRUCTIONS_DONE]:
|
|
1
|
+
{"version":3,"file":"confirmWireDetailsStateMachine.js","sources":["../../../../src/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.tsx"],"sourcesContent":["import { state, transition, reduce } from 'robot3'\nimport type { ConfirmationAlert } from './types'\nimport type { ConfirmWireDetailsContextInterface } from './ConfirmWireDetailsComponents'\nimport {\n WireInstructionsContextual,\n ConfirmWireDetailsFormContextual,\n} from './ConfirmWireDetailsComponents'\nimport { payrollWireEvents } from '@/shared/constants'\nimport type { MachineEventType, MachineTransition } from '@/types/Helpers'\n\nexport type EventPayloads = {\n [payrollWireEvents.PAYROLL_WIRE_INSTRUCTIONS_SELECT]: {\n selectedId: string\n }\n [payrollWireEvents.PAYROLL_WIRE_START_TRANSFER]: undefined\n [payrollWireEvents.PAYROLL_WIRE_INSTRUCTIONS_DONE]: {\n selectedId: string\n }\n [payrollWireEvents.PAYROLL_WIRE_FORM_DONE]: {\n confirmationAlert: ConfirmationAlert\n }\n [payrollWireEvents.PAYROLL_WIRE_FORM_CANCEL]: undefined\n}\n\nexport const confirmWireDetailsMachine = {\n banner: state<MachineTransition>(\n transition(\n payrollWireEvents.PAYROLL_WIRE_START_TRANSFER,\n 'wireInstructions',\n reduce(\n (ctx: ConfirmWireDetailsContextInterface): ConfirmWireDetailsContextInterface => ({\n ...ctx,\n component: WireInstructionsContextual,\n }),\n ),\n ),\n ),\n wireInstructions: state<MachineTransition>(\n transition(\n payrollWireEvents.PAYROLL_WIRE_INSTRUCTIONS_SELECT,\n 'wireInstructions',\n reduce(\n (\n ctx: ConfirmWireDetailsContextInterface,\n ev: MachineEventType<\n EventPayloads,\n typeof payrollWireEvents.PAYROLL_WIRE_INSTRUCTIONS_SELECT\n >,\n ): ConfirmWireDetailsContextInterface => ({\n ...ctx,\n selectedWireInId: ev.payload.selectedId,\n }),\n ),\n ),\n transition(\n payrollWireEvents.PAYROLL_WIRE_INSTRUCTIONS_DONE,\n 'confirmForm',\n reduce(\n (\n ctx: ConfirmWireDetailsContextInterface,\n ev: MachineEventType<\n EventPayloads,\n typeof payrollWireEvents.PAYROLL_WIRE_INSTRUCTIONS_DONE\n >,\n ): ConfirmWireDetailsContextInterface => ({\n ...ctx,\n component: ConfirmWireDetailsFormContextual,\n selectedWireInId: ev.payload.selectedId,\n }),\n ),\n ),\n transition(\n payrollWireEvents.PAYROLL_WIRE_FORM_CANCEL,\n 'banner',\n reduce(\n (ctx: ConfirmWireDetailsContextInterface): ConfirmWireDetailsContextInterface => ({\n ...ctx,\n }),\n ),\n ),\n ),\n confirmForm: state<MachineTransition>(\n transition(\n payrollWireEvents.PAYROLL_WIRE_FORM_DONE,\n 'banner',\n reduce(\n (\n ctx: ConfirmWireDetailsContextInterface,\n ev: MachineEventType<EventPayloads, typeof payrollWireEvents.PAYROLL_WIRE_FORM_DONE>,\n ): ConfirmWireDetailsContextInterface => ({\n ...ctx,\n component: null,\n confirmationAlert: ev.payload.confirmationAlert,\n }),\n ),\n ),\n transition(\n payrollWireEvents.PAYROLL_WIRE_FORM_CANCEL,\n 'banner',\n reduce(\n (ctx: ConfirmWireDetailsContextInterface): ConfirmWireDetailsContextInterface => ({\n ...ctx,\n component: null,\n }),\n ),\n ),\n ),\n final: state<MachineTransition>(),\n}\n"],"names":["confirmWireDetailsMachine","state","transition","payrollWireEvents","reduce","ctx","WireInstructionsContextual","ev","ConfirmWireDetailsFormContextual"],"mappings":";;;AAwBO,MAAMA,IAA4B;AAAA,EACvC,QAAQC;AAAA,IACNC;AAAA,MACEC,EAAkB;AAAA,MAClB;AAAA,MACAC;AAAA,QACE,CAACC,OAAiF;AAAA,UAChF,GAAGA;AAAA,UACH,WAAWC;AAAA,QAAA;AAAA,MACb;AAAA,IACF;AAAA,EACF;AAAA,EAEF,kBAAkBL;AAAA,IAChBC;AAAA,MACEC,EAAkB;AAAA,MAClB;AAAA,MACAC;AAAA,QACE,CACEC,GACAE,OAIwC;AAAA,UACxC,GAAGF;AAAA,UACH,kBAAkBE,EAAG,QAAQ;AAAA,QAAA;AAAA,MAC/B;AAAA,IACF;AAAA,IAEFL;AAAA,MACEC,EAAkB;AAAA,MAClB;AAAA,MACAC;AAAA,QACE,CACEC,GACAE,OAIwC;AAAA,UACxC,GAAGF;AAAA,UACH,WAAWG;AAAA,UACX,kBAAkBD,EAAG,QAAQ;AAAA,QAAA;AAAA,MAC/B;AAAA,IACF;AAAA,IAEFL;AAAA,MACEC,EAAkB;AAAA,MAClB;AAAA,MACAC;AAAA,QACE,CAACC,OAAiF;AAAA,UAChF,GAAGA;AAAA,QAAA;AAAA,MACL;AAAA,IACF;AAAA,EACF;AAAA,EAEF,aAAaJ;AAAA,IACXC;AAAA,MACEC,EAAkB;AAAA,MAClB;AAAA,MACAC;AAAA,QACE,CACEC,GACAE,OACwC;AAAA,UACxC,GAAGF;AAAA,UACH,WAAW;AAAA,UACX,mBAAmBE,EAAG,QAAQ;AAAA,QAAA;AAAA,MAChC;AAAA,IACF;AAAA,IAEFL;AAAA,MACEC,EAAkB;AAAA,MAClB;AAAA,MACAC;AAAA,QACE,CAACC,OAAiF;AAAA,UAChF,GAAGA;AAAA,UACH,WAAW;AAAA,QAAA;AAAA,MACb;AAAA,IACF;AAAA,EACF;AAAA,EAEF,OAAOJ,EAAA;AACT;"}
|
|
@@ -1,25 +1,28 @@
|
|
|
1
|
-
import { jsx as l, jsxs as
|
|
1
|
+
import { jsx as l, jsxs as m } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation as P } from "react-i18next";
|
|
3
3
|
import { getBlockerTranslationKeys as v } from "../payrollHelpers.js";
|
|
4
4
|
import { useComponentContext as A } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
5
|
-
import { Flex as
|
|
5
|
+
import { Flex as d } from "../../../Common/Flex/Flex.js";
|
|
6
|
+
import "classnames";
|
|
7
|
+
import "../../../../shared/constants.js";
|
|
8
|
+
import "react";
|
|
6
9
|
import { useI18n as C } from "../../../../i18n/I18n.js";
|
|
7
|
-
function
|
|
8
|
-
blockers:
|
|
10
|
+
function H({
|
|
11
|
+
blockers: o,
|
|
9
12
|
onMultipleViewClick: i,
|
|
10
13
|
multipleViewLabel: h,
|
|
11
14
|
className: s
|
|
12
15
|
}) {
|
|
13
16
|
C("Payroll.PayrollBlocker");
|
|
14
17
|
const { t: e } = P("Payroll.PayrollBlocker"), { Alert: a, Button: f, Text: c, UnorderedList: x } = A();
|
|
15
|
-
if (
|
|
18
|
+
if (o.length === 0)
|
|
16
19
|
return null;
|
|
17
|
-
const y =
|
|
18
|
-
const
|
|
20
|
+
const y = o.length > 1, p = o.map((r) => {
|
|
21
|
+
const n = v(r.key), B = e(n.titleKey, {
|
|
19
22
|
defaultValue: r.key.replace(/_/g, " ").replace(/\b\w/g, (K) => K.toUpperCase())
|
|
20
|
-
}), T = e(
|
|
23
|
+
}), T = e(n.descriptionKey, {
|
|
21
24
|
defaultValue: r.message || e("defaultBlockerDescription")
|
|
22
|
-
}), k = e(
|
|
25
|
+
}), k = e(n.helpTextKey, { defaultValue: e("defaultBlockerHelp") });
|
|
23
26
|
return {
|
|
24
27
|
...r,
|
|
25
28
|
title: B,
|
|
@@ -28,7 +31,7 @@ function w({
|
|
|
28
31
|
};
|
|
29
32
|
}), t = p[0];
|
|
30
33
|
if (!y && t)
|
|
31
|
-
return /* @__PURE__ */ l(a, { status: "error", label: t.title, className: s, children: /* @__PURE__ */ d
|
|
34
|
+
return /* @__PURE__ */ l(a, { status: "error", label: t.title, className: s, children: /* @__PURE__ */ m(d, { flexDirection: "column", gap: 8, children: [
|
|
32
35
|
/* @__PURE__ */ l(c, { children: t.description }),
|
|
33
36
|
t.helpText && t.helpText !== t.description && /* @__PURE__ */ l(c, { variant: "supporting", size: "sm", children: t.helpText })
|
|
34
37
|
] }) });
|
|
@@ -37,9 +40,9 @@ function w({
|
|
|
37
40
|
a,
|
|
38
41
|
{
|
|
39
42
|
status: "error",
|
|
40
|
-
label: e("multipleIssuesTitle", { count:
|
|
43
|
+
label: e("multipleIssuesTitle", { count: o.length }),
|
|
41
44
|
className: s,
|
|
42
|
-
children: /* @__PURE__ */ d
|
|
45
|
+
children: /* @__PURE__ */ m(d, { flexDirection: "column", gap: 16, children: [
|
|
43
46
|
/* @__PURE__ */ l(x, { items: g }),
|
|
44
47
|
i && /* @__PURE__ */ l("div", { children: /* @__PURE__ */ l(f, { variant: "secondary", onClick: i, title: u, children: u }) })
|
|
45
48
|
] })
|
|
@@ -47,6 +50,6 @@ function w({
|
|
|
47
50
|
);
|
|
48
51
|
}
|
|
49
52
|
export {
|
|
50
|
-
|
|
53
|
+
H as PayrollBlockerAlerts
|
|
51
54
|
};
|
|
52
55
|
//# 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 { 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: blocker.key.replace(/_/g, ' ').replace(/\\b\\w/g, l => l.toUpperCase()),\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","l","description","helpText","singleBlocker","jsx","jsxs","Flex","listItems","defaultMultipleLabel"],"mappings":"
|
|
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: blocker.key.replace(/_/g, ' ').replace(/\\b\\w/g, l => l.toUpperCase()),\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","l","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,GA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AE,iBAAiB;AAErE,SACE,gBAAAiB;AAAA,IAACf;AAAA,IAAA;AAAA,MACC,QAAO;AAAA,MACP,OAAOF,EAAE,uBAAuB,EAAE,OAAOL,EAAS,QAAQ;AAAA,MAC1D,WAAAG;AAAA,MAEA,UAAA,gBAAAoB,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,QAAA,gBAAAF,EAACZ,GAAA,EAAc,OAAOe,EAAA,CAAW;AAAA,QAChCxB,KACC,gBAAAqB,EAAC,OAAA,EACC,UAAA,gBAAAA,EAACd,GAAA,EAAO,SAAQ,aAAY,SAASP,GAAqB,OAAOyB,GAC9D,UAAAA,EAAA,CACH,EAAA,CACF;AAAA,MAAA,EAAA,CAEJ;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { jsx as e, jsxs as a } from "react/jsx-runtime";
|
|
2
|
-
import { useTranslation as
|
|
3
|
-
import
|
|
2
|
+
import { useTranslation as p } from "react-i18next";
|
|
3
|
+
import f from "classnames";
|
|
4
4
|
import u from "./PayrollBlockerList.module.scss.js";
|
|
5
5
|
import { useComponentContext as h } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
6
6
|
import { FlexItem as x, Flex as o } from "../../../Common/Flex/Flex.js";
|
|
7
|
+
import "../../../../shared/constants.js";
|
|
8
|
+
import "react";
|
|
7
9
|
import { DataView as y } from "../../../Common/DataView/DataView.js";
|
|
8
10
|
import { useDataView as g } from "../../../Common/DataView/useDataView.js";
|
|
9
11
|
import { useI18n as b } from "../../../../i18n/I18n.js";
|
|
10
|
-
function
|
|
12
|
+
function V({ blockers: i, className: s }) {
|
|
11
13
|
b("Payroll.PayrollBlocker");
|
|
12
|
-
const { t: l } =
|
|
14
|
+
const { t: l } = p("Payroll.PayrollBlocker"), { Button: c, Text: n, Heading: m } = h(), d = g({
|
|
13
15
|
data: i,
|
|
14
16
|
columns: [
|
|
15
17
|
{
|
|
@@ -28,12 +30,12 @@ function v({ blockers: i, className: s }) {
|
|
|
28
30
|
}
|
|
29
31
|
]
|
|
30
32
|
});
|
|
31
|
-
return i.length === 0 ? null : /* @__PURE__ */ e("div", { className:
|
|
33
|
+
return i.length === 0 ? null : /* @__PURE__ */ e("div", { className: f(u.root, s), children: /* @__PURE__ */ a(o, { flexDirection: "column", gap: 24, children: [
|
|
32
34
|
/* @__PURE__ */ e(m, { as: "h2", styledAs: "h4", children: l("blockersListTitle") }),
|
|
33
35
|
/* @__PURE__ */ e(y, { ...d, label: l("blockersListTitle") })
|
|
34
36
|
] }) });
|
|
35
37
|
}
|
|
36
38
|
export {
|
|
37
|
-
|
|
39
|
+
V as PayrollBlockerList
|
|
38
40
|
};
|
|
39
41
|
//# 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":"
|
|
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,g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