@gusto/embedded-react-sdk 0.24.0 → 0.25.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 +80 -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.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/SignatureFormFields.js +1 -1
- package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js +1 -1
- package/dist/components/Common/UI/FileInput/FileInput.d.ts +2 -0
- package/dist/components/Common/UI/FileInput/FileInput.js +151 -0
- package/dist/components/Common/UI/FileInput/FileInput.js.map +1 -0
- package/dist/components/Common/UI/FileInput/FileInput.module.scss.js +34 -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/ProgressBar/ProgressBar.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/AssignSignatorySelection.js +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +12 -12
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +4 -3
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +4 -3
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +6 -5
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +4 -3
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +4 -3
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +4 -3
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Form.js +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +9 -8
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +7 -6
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Form.js +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +4 -3
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/List.js +35 -33
- package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +29 -28
- 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 +4 -3
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +4 -3
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Edit.js +15 -15
- package/dist/components/Company/PaySchedule/usePaySchedule.js +6 -5
- package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +4 -3
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +4 -3
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Contractor/Address/Form.js +1 -1
- package/dist/components/Contractor/Address/useAddress.js +6 -5
- package/dist/components/Contractor/Address/useAddress.js.map +1 -1
- package/dist/components/Contractor/ContractorList/index.js +16 -15
- package/dist/components/Contractor/ContractorList/index.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +2 -2
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js +61 -59
- package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +24 -22
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +38 -19
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.d.ts +3 -1
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +26 -25
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.d.ts +2 -0
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js +25 -19
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.d.ts +1 -0
- package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js +86 -56
- 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 -99
- 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 +157 -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/PaymentsList/PaymentsListPresentation.js +40 -43
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
- package/dist/components/Contractor/Profile/ContractorProfileForm.js +15 -15
- package/dist/components/Contractor/Profile/useContractorProfile.js +3 -2
- package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
- package/dist/components/Employee/Compensation/Edit.js +14 -14
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +10 -9
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +11 -10
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +11 -10
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +4 -3
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +4 -3
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Employee/EmployeeList/EmployeeList.js +57 -56
- package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
- package/dist/components/Employee/EmployeeList/List.js +34 -32
- 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 +4 -3
- package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/FederalForm.js +7 -7
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +4 -3
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +2 -2
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +1 -1
- package/dist/components/Employee/PaymentMethod/Split.js +8 -8
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +6 -5
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
- package/dist/components/Employee/Profile/AdminPersonalDetails.js +1 -1
- package/dist/components/Employee/Profile/HomeAddress.js +1 -1
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js +2 -2
- package/dist/components/Employee/Profile/useProfile.js +4 -3
- package/dist/components/Employee/Profile/useProfile.js.map +1 -1
- package/dist/components/Employee/StateTaxes/useStateTaxes.js +4 -3
- package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
- package/dist/components/Employee/Taxes/FederalForm.js +7 -7
- package/dist/components/Employee/Taxes/useTaxes.js +4 -3
- package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +9 -9
- package/dist/components/Payroll/InformationRequests/InformationRequestForm/InformationRequestForm.d.ts +15 -0
- package/dist/components/Payroll/InformationRequests/InformationRequestForm/InformationRequestForm.js +142 -0
- package/dist/components/Payroll/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -0
- package/dist/components/Payroll/InformationRequests/InformationRequestForm/InformationRequestForm.module.scss.js +18 -0
- package/dist/components/Payroll/InformationRequests/InformationRequestForm/InformationRequestForm.module.scss.js.map +1 -0
- package/dist/components/Payroll/InformationRequests/InformationRequestForm/index.d.ts +2 -0
- package/dist/components/Payroll/InformationRequests/InformationRequestList/InformationRequestList.d.ts +7 -0
- package/dist/components/Payroll/InformationRequests/InformationRequestList/InformationRequestList.js +88 -0
- package/dist/components/Payroll/InformationRequests/InformationRequestList/InformationRequestList.js.map +1 -0
- package/dist/components/Payroll/InformationRequests/InformationRequestList/index.d.ts +2 -0
- package/dist/components/Payroll/InformationRequests/InformationRequests.d.ts +6 -0
- package/dist/components/Payroll/InformationRequests/InformationRequests.js +55 -0
- package/dist/components/Payroll/InformationRequests/InformationRequests.js.map +1 -0
- package/dist/components/Payroll/InformationRequests/InformationRequestsComponents.d.ts +19 -0
- package/dist/components/Payroll/InformationRequests/InformationRequestsComponents.js +20 -0
- package/dist/components/Payroll/InformationRequests/InformationRequestsComponents.js.map +1 -0
- package/dist/components/Payroll/InformationRequests/index.d.ts +3 -0
- package/dist/components/Payroll/InformationRequests/informationRequestsStateMachine.d.ts +13 -0
- package/dist/components/Payroll/InformationRequests/informationRequestsStateMachine.js +47 -0
- package/dist/components/Payroll/InformationRequests/informationRequestsStateMachine.js.map +1 -0
- 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 +5 -2
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +107 -99
- 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 +137 -131
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +16 -15
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.d.ts +2 -0
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js +174 -106
- 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 +85 -104
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollLanding/PayrollLanding.js +24 -20
- package/dist/components/Payroll/PayrollLanding/PayrollLanding.js.map +1 -1
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.d.ts +2 -0
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js +51 -46
- 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 +111 -45
- package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +136 -125
- 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 +117 -110
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.d.ts +4 -2
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +282 -278
- 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/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 +73 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js.map +1 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.module.scss.js +10 -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 +46 -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/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 -0
- package/dist/components/Payroll/index.js +18 -14
- package/dist/components/Payroll/index.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.d.ts +4 -1
- package/dist/components/Payroll/usePreparedPayrollData.js +43 -31
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- 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/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 +23 -18
- 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 +3 -3
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Contractor.Payments.CreatePayment.json.js +36 -32
- 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.PaymentsList.json.js +14 -14
- package/dist/i18n/en/Payroll.InformationRequestForm.json.js +18 -0
- package/dist/i18n/en/Payroll.InformationRequestForm.json.js.map +1 -0
- package/dist/i18n/en/Payroll.InformationRequestList.json.js +18 -0
- package/dist/i18n/en/Payroll.InformationRequestList.json.js.map +1 -0
- 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 +5 -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 +14 -0
- package/dist/i18n/en/Payroll.RecoveryCasesList.json.js.map +1 -0
- package/dist/i18n/en/Payroll.RecoveryCasesResubmit.json.js +8 -0
- package/dist/i18n/en/Payroll.RecoveryCasesResubmit.json.js.map +1 -0
- package/dist/i18n/en/common.json.d.ts +6 -0
- package/dist/i18n/en/common.json.js +4 -2
- package/dist/i18n/en/common.json.js.map +1 -1
- package/dist/shared/constants.d.ts +25 -1
- package/dist/shared/constants.js +72 -55
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +120 -3
- package/package.json +31 -20
package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaymentHistoryPresentation.js","sources":["../../../../../src/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { DataView, Flex, EmptyData, ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\nimport { useI18n } from '@/i18n'\nimport { formatNumberAsCurrency } from '@/helpers/formattedStrings'\nimport { useLocale } from '@/contexts/LocaleProvider/useLocale'\nimport { formatHoursDisplay } from '@/components/Payroll/helpers'\n\ninterface PaymentData {\n id: string\n name: string\n wageType: string\n paymentMethod: string\n hours: number\n wage: string\n bonus: number\n reimbursement: number\n total: number\n}\n\ninterface PaymentHistoryPresentationProps {\n date: string\n payments: PaymentData[]\n onBack: () => void\n onViewPayment: (paymentId: string) => void\n onCancelPayment: (paymentId: string) => void\n}\n\nexport const PaymentHistoryPresentation = ({\n date,\n payments,\n onBack,\n onViewPayment,\n onCancelPayment,\n}: PaymentHistoryPresentationProps) => {\n const { Button, Text, Heading } = useComponentContext()\n useI18n('Contractor.Payments.PaymentHistory')\n const { t } = useTranslation('Contractor.Payments.PaymentHistory')\n const { locale } = useLocale()\n\n return (\n <Flex flexDirection=\"column\" gap={32}>\n <Flex flexDirection=\"column\" gap={8}>\n <Heading as=\"h1\">{t('title')}</Heading>\n <Text>{t('subtitle', { date })}</Text>\n </Flex>\n\n <Flex flexDirection=\"column\" gap={16}>\n <Heading as=\"h2\">{t('paymentsSection')}</Heading>\n\n {payments.length === 0 ? (\n <EmptyData title={t('noPaymentsFound')} description={t('noPaymentsDescription')}>\n <ActionsLayout justifyContent=\"center\">\n <Button variant=\"primary\" onClick={onBack}>\n {t('backButton')}\n </Button>\n </ActionsLayout>\n </EmptyData>\n ) : (\n <>\n <DataView\n columns={[\n {\n title: t('tableHeaders.contractor'),\n render: ({ name, id }) => (\n <Button\n variant=\"tertiary\"\n onClick={() => {\n onViewPayment(id)\n }}\n >\n {name}\n </Button>\n ),\n },\n {\n title: t('tableHeaders.wageType'),\n render: ({ wageType }) => <Text>{wageType}</Text>,\n },\n {\n title: t('tableHeaders.paymentMethod'),\n render: ({ paymentMethod }) => <Text>{paymentMethod}</Text>,\n },\n {\n title: t('tableHeaders.hours'),\n render: ({ hours }) => <Text>{hours ? formatHoursDisplay(hours) : '–'}</Text>,\n },\n {\n title: t('tableHeaders.wage'),\n render: ({ wage }) => <Text>{wage || '–'}</Text>,\n },\n {\n title: t('tableHeaders.bonus'),\n render: ({ bonus }) => (\n <Text>{bonus ? formatNumberAsCurrency(bonus, locale) : '–'}</Text>\n ),\n },\n {\n title: t('tableHeaders.reimbursements'),\n render: ({ reimbursement }) => (\n <Text>{formatNumberAsCurrency(reimbursement, locale)}</Text>\n ),\n },\n {\n title: t('tableHeaders.total'),\n render: ({ total }) => <Text>{formatNumberAsCurrency(total, locale)}</Text>,\n },\n {\n title: t('tableHeaders.action'),\n render: ({ id, name }) => (\n <HamburgerMenu\n items={[\n {\n label: t('actions.view'),\n onClick: () => {\n onViewPayment(id)\n },\n },\n {\n label: t('actions.cancel'),\n onClick: () => {\n onCancelPayment(id)\n },\n },\n ]}\n triggerLabel={t('tableHeaders.action')}\n />\n ),\n },\n ]}\n data={payments}\n label={t('title')}\n />\n\n <Flex>\n <Button onClick={onBack} variant=\"secondary\">\n {t('backButton')}\n </Button>\n </Flex>\n </>\n )}\n </Flex>\n </Flex>\n )\n}\n"],"names":["PaymentHistoryPresentation","date","payments","onBack","onViewPayment","onCancelPayment","Button","Text","Heading","useComponentContext","useI18n","t","useTranslation","locale","useLocale","jsxs","Flex","jsx","EmptyData","ActionsLayout","Fragment","DataView","name","id","wageType","paymentMethod","hours","formatHoursDisplay","wage","bonus","formatNumberAsCurrency","reimbursement","total","HamburgerMenu"],"mappings":";;;;;;;;;;;;;;AA6BO,MAAMA,IAA6B,CAAC;AAAA,EACzC,MAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,eAAAC;AAAA,EACA,iBAAAC;AACF,MAAuC;AACrC,QAAM,EAAE,QAAAC,GAAQ,MAAAC,GAAM,SAAAC,EAAA,IAAYC,EAAA;AAClC,EAAAC,EAAQ,oC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I,MAAAD,QACb,gBAAAL;AAAA,kBAACgB;AAAA,kBAAA;AAAA,oBACC,OAAO;AAAA,sBACL;AAAA,wBACE,OAAOtB,EAAE,cAAc;AAAA,wBACvB,SAAS,MAAM;AACb,0BAAAP,EAAcmB,CAAE;AAAA,wBAClB;AAAA,sBAAA;AAAA,sBAEF;AAAA,wBACE,OAAOZ,EAAE,gBAAgB;AAAA,wBACzB,SAAS,MAAM;AACb,0BAAAN,EAAgBkB,CAAE;AAAA,wBACpB;AAAA,sBAAA;AAAA,oBACF;AAAA,oBAEF,cAAcZ,EAAE,qBAAqB;AAAA,kBAAA;AAAA,gBAAA;AAAA,cACvC;AAAA,YAEJ;AAAA,YAEF,MAAMT;AAAA,YACN,OAAOS,EAAE,OAAO;AAAA,UAAA;AAAA,QAAA;AAAA,QAGlB,gBAAAM,EAACD,GAAA,EACC,UAAA,gBAAAC,EAACX,GAAA,EAAO,SAASH,GAAQ,SAAQ,aAC9B,UAAAQ,EAAE,YAAY,EAAA,CACjB,EAAA,CACF;AAAA,MAAA,EAAA,CACF;AAAA,IAAA,EAAA,CAEJ;AAAA,EAAA,GACF;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"PaymentHistoryPresentation.js","sources":["../../../../../src/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.tsx"],"sourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport type { ContractorPaymentGroup } from '@gusto/embedded-api/models/components/contractorpaymentgroup'\nimport type { Contractor } from '@gusto/embedded-api/models/components/contractor'\nimport { getContractorDisplayName } from '../CreatePayment/helpers'\nimport styles from './PaymentHistoryPresentation.module.scss'\nimport { DataView, Flex, EmptyData } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\nimport { useI18n } from '@/i18n'\nimport { formatHoursDisplay } from '@/components/Payroll/helpers'\nimport useNumberFormatter from '@/hooks/useNumberFormatter'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\nimport EyeIcon from '@/assets/icons/eye.svg?react'\nimport CancelIcon from '@/assets/icons/slash-circle.svg?react'\n\ninterface PaymentHistoryPresentationProps {\n paymentGroup: ContractorPaymentGroup\n contractors: Contractor[]\n onViewPayment: (paymentId: string) => void\n onCancelPayment: (paymentId: string) => void\n isCancelling: boolean\n}\n\nexport const PaymentHistoryPresentation = ({\n paymentGroup,\n contractors,\n onViewPayment,\n onCancelPayment,\n isCancelling,\n}: PaymentHistoryPresentationProps) => {\n const { Button, Text, Heading } = useComponentContext()\n useI18n('Contractor.Payments.PaymentHistory')\n const { t } = useTranslation('Contractor.Payments.PaymentHistory')\n const currencyFormatter = useNumberFormatter('currency')\n const { formatLongWithYear } = useDateFormatter()\n\n const payments = paymentGroup.contractorPayments || []\n\n return (\n <Flex flexDirection=\"column\" gap={32}>\n <Flex flexDirection=\"column\" gap={8}>\n <Heading as=\"h2\">{t('title')}</Heading>\n <Text>\n <Trans\n i18nKey={'subtitle'}\n t={t}\n values={{ date: formatLongWithYear(paymentGroup.debitDate) }}\n components={{\n strong: <Text weight=\"bold\" as=\"span\" />,\n }}\n />\n </Text>\n </Flex>\n\n <Flex flexDirection=\"column\" gap={16}>\n <Heading as=\"h2\">{t('paymentsSection')}</Heading>\n\n {payments.length === 0 ? (\n <EmptyData title={t('noPaymentsFound')} description={t('noPaymentsDescription')} />\n ) : (\n <>\n <DataView\n columns={[\n {\n title: t('tableHeaders.contractor'),\n render: ({ contractorUuid }) => (\n <Button\n variant=\"tertiary\"\n onClick={() => {\n onViewPayment(contractorUuid!)\n }}\n >\n {getContractorDisplayName(\n contractors.find(contractor => contractor.uuid === contractorUuid),\n )}\n </Button>\n ),\n },\n {\n title: t('tableHeaders.wageType'),\n render: ({ wageType }) => <Text>{wageType}</Text>,\n },\n {\n title: t('tableHeaders.paymentMethod'),\n render: ({ paymentMethod }) => <Text>{paymentMethod}</Text>,\n },\n {\n title: t('tableHeaders.hours'),\n render: ({ hours }) => (\n <Text>{hours ? formatHoursDisplay(Number(hours)) : '–'}</Text>\n ),\n },\n {\n title: t('tableHeaders.wage'),\n render: ({ wage }) => <Text>{wage || '–'}</Text>,\n },\n {\n title: t('tableHeaders.bonus'),\n render: ({ bonus }) => (\n <Text>{bonus ? currencyFormatter(Number(bonus)) : '–'}</Text>\n ),\n },\n {\n title: t('tableHeaders.reimbursements'),\n render: ({ reimbursement }) => (\n <Text>{reimbursement ? currencyFormatter(Number(reimbursement)) : '–'}</Text>\n ),\n },\n {\n title: t('tableHeaders.total'),\n render: ({ wageTotal, reimbursement, bonus }) => (\n <Text>\n {wageTotal\n ? currencyFormatter(\n Number(wageTotal) + Number(reimbursement) + Number(bonus),\n )\n : '–'}\n </Text>\n ),\n },\n ]}\n itemMenu={({ contractorUuid, mayCancel, uuid }) => {\n const items = [\n {\n label: t('actions.view'),\n onClick: () => {\n onViewPayment(contractorUuid!)\n },\n icon: (\n <span className={styles.icon}>\n <EyeIcon aria-hidden />\n </span>\n ),\n },\n ]\n if (mayCancel) {\n items.push({\n label: t('actions.cancel'),\n onClick: () => {\n onCancelPayment(uuid!)\n },\n icon: (\n <span className={styles.icon}>\n <CancelIcon aria-hidden />\n </span>\n ),\n })\n }\n return (\n <HamburgerMenu\n items={items}\n triggerLabel={t('tableHeaders.action')}\n isLoading={isCancelling}\n />\n )\n }}\n data={payments}\n label={t('title')}\n />\n </>\n )}\n </Flex>\n </Flex>\n )\n}\n"],"names":["PaymentHistoryPresentation","paymentGroup","contractors","onViewPayment","onCancelPayment","isCancelling","Button","Text","Heading","useComponentContext","useI18n","t","useTranslation","currencyFormatter","useNumberFormatter","formatLongWithYear","useDateFormatter","payments","jsxs","Flex","jsx","Trans","EmptyData","Fragment","DataView","contractorUuid","getContractorDisplayName","contractor","wageType","paymentMethod","hours","formatHoursDisplay","wage","bonus","reimbursement","wageTotal","mayCancel","uuid","items","styles","EyeIcon","CancelIcon","HamburgerMenu"],"mappings":";;;;;;;;;;;;;;;;;AAuBO,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AAA,YAAA;AAAA,UAGjB;AAAA,UACA,MAAMY;AAAA,UACN,OAAON,EAAE,OAAO;AAAA,QAAA;AAAA,MAAA,EAClB,CACF;AAAA,IAAA,EAAA,CAEJ;AAAA,EAAA,GACF;AAEJ;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PaymentHistoryPresentation.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BaseComponentInterface } from '../../../Base';
|
|
2
|
+
interface PaymentStatementProps extends BaseComponentInterface<'Contractor.Payments.PaymentStatement'> {
|
|
3
|
+
paymentGroupId: string;
|
|
4
|
+
contractorUuid: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function PaymentStatement(props: PaymentStatementProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare const Root: ({ paymentGroupId, contractorUuid, dictionary }: PaymentStatementProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { useContractorPaymentGroupsGetSuspense as f } from "@gusto/embedded-api/react-query/contractorPaymentGroupsGet";
|
|
3
|
+
import { useContractorsListSuspense as d } from "@gusto/embedded-api/react-query/contractorsList";
|
|
4
|
+
import { useContractorPaymentsGetReceipt as P } from "@gusto/embedded-api/react-query/contractorPaymentsGetReceipt";
|
|
5
|
+
import { APIError as h } from "@gusto/embedded-api/models/errors/apierror";
|
|
6
|
+
import { useTranslation as G } from "react-i18next";
|
|
7
|
+
import { PaymentStatementPresentation as w } from "./PaymentStatementPresentation.js";
|
|
8
|
+
import { useComponentDictionary as C } from "../../../../i18n/I18n.js";
|
|
9
|
+
import { BaseComponent as l } from "../../../Base/Base.js";
|
|
10
|
+
import "../../../Base/useBase.js";
|
|
11
|
+
function j(o) {
|
|
12
|
+
return /* @__PURE__ */ a(l, { ...o, children: /* @__PURE__ */ a(R, { ...o, children: o.children }) });
|
|
13
|
+
}
|
|
14
|
+
const R = ({ paymentGroupId: o, contractorUuid: c, dictionary: s }) => {
|
|
15
|
+
C("Contractor.Payments.PaymentStatement", s);
|
|
16
|
+
const { t: n } = G("Contractor.Payments.PaymentStatement"), { data: r } = f({
|
|
17
|
+
contractorPaymentGroupUuid: o
|
|
18
|
+
});
|
|
19
|
+
if (!r.contractorPaymentGroup)
|
|
20
|
+
throw new Error(n("errors.paymentGroupNotFound"));
|
|
21
|
+
const i = r.contractorPaymentGroup.companyUuid, { data: p } = d({ companyUuid: i }), u = p.contractorList || [], e = r.contractorPaymentGroup.contractorPayments?.find(
|
|
22
|
+
(t) => t.contractorUuid === c
|
|
23
|
+
);
|
|
24
|
+
if (!e)
|
|
25
|
+
throw new Error(n("errors.paymentNotFound"));
|
|
26
|
+
const { data: y } = P(
|
|
27
|
+
{
|
|
28
|
+
contractorPaymentUuid: e.uuid
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
retry: !1,
|
|
32
|
+
throwOnError: (t) => !(t instanceof h && t.httpMeta.response.status === 404)
|
|
33
|
+
}
|
|
34
|
+
), m = u.find((t) => t.uuid === c);
|
|
35
|
+
if (!m)
|
|
36
|
+
throw new Error(n("errors.contractorNotFound"));
|
|
37
|
+
return /* @__PURE__ */ a(
|
|
38
|
+
w,
|
|
39
|
+
{
|
|
40
|
+
payment: e,
|
|
41
|
+
contractor: m,
|
|
42
|
+
paymentReceipt: y?.contractorPaymentReceipt,
|
|
43
|
+
checkDate: r.contractorPaymentGroup.checkDate || ""
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
};
|
|
47
|
+
export {
|
|
48
|
+
j as PaymentStatement,
|
|
49
|
+
R as Root
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=PaymentStatement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PaymentStatement.js","sources":["../../../../../src/components/Contractor/Payments/PaymentStatement/PaymentStatement.tsx"],"sourcesContent":["import { useContractorPaymentGroupsGetSuspense } from '@gusto/embedded-api/react-query/contractorPaymentGroupsGet'\nimport { useContractorsListSuspense } from '@gusto/embedded-api/react-query/contractorsList'\nimport { useContractorPaymentsGetReceipt } from '@gusto/embedded-api/react-query/contractorPaymentsGetReceipt'\nimport { APIError } from '@gusto/embedded-api/models/errors/apierror'\nimport { useTranslation } from 'react-i18next'\nimport { PaymentStatementPresentation } from './PaymentStatementPresentation'\nimport { useComponentDictionary } from '@/i18n'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\n\ninterface PaymentStatementProps extends BaseComponentInterface<'Contractor.Payments.PaymentStatement'> {\n paymentGroupId: string\n contractorUuid: string\n}\n\nexport function PaymentStatement(props: PaymentStatementProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nexport const Root = ({ paymentGroupId, contractorUuid, dictionary }: PaymentStatementProps) => {\n useComponentDictionary('Contractor.Payments.PaymentStatement', dictionary)\n const { t } = useTranslation('Contractor.Payments.PaymentStatement')\n // Fetching entire payment\n const { data: paymentGroupResponse } = useContractorPaymentGroupsGetSuspense({\n contractorPaymentGroupUuid: paymentGroupId,\n })\n\n if (!paymentGroupResponse.contractorPaymentGroup) {\n throw new Error(t('errors.paymentGroupNotFound'))\n }\n\n const companyId = paymentGroupResponse.contractorPaymentGroup.companyUuid!\n // Fetching all contractors for the company\n const { data: contractorList } = useContractorsListSuspense({ companyUuid: companyId })\n const contractors = contractorList.contractorList || []\n // Locating the payment for the selectedcontractor\n const payment = paymentGroupResponse.contractorPaymentGroup.contractorPayments?.find(\n p => p.contractorUuid === contractorUuid,\n )\n\n if (!payment) {\n throw new Error(t('errors.paymentNotFound'))\n }\n // Attempting to fetch the payment receipt\n // Note: 404 is expected for receipts that aren't available (e.g., non-direct deposit or not yet funded)\n const { data: paymentResponse } = useContractorPaymentsGetReceipt(\n {\n contractorPaymentUuid: payment.uuid!,\n },\n {\n retry: false,\n throwOnError: (error: Error) => {\n // Ignore 404 errors (receipt not available), but throw other errors\n if (error instanceof APIError && error.httpMeta.response.status === 404) {\n return false\n }\n return true\n },\n },\n )\n const contractor = contractors.find(c => c.uuid === contractorUuid)\n if (!contractor) {\n throw new Error(t('errors.contractorNotFound'))\n }\n\n return (\n <PaymentStatementPresentation\n payment={payment}\n contractor={contractor}\n paymentReceipt={paymentResponse?.contractorPaymentReceipt}\n checkDate={paymentGroupResponse.contractorPaymentGroup.checkDate || ''}\n />\n )\n}\n"],"names":["PaymentStatement","props","jsx","BaseComponent","Root","paymentGroupId","contractorUuid","dictionary","useComponentDictionary","t","useTranslation","paymentGroupResponse","useContractorPaymentGroupsGetSuspense","companyId","contractorList","useContractorsListSuspense","contractors","payment","p","paymentResponse","useContractorPaymentsGetReceipt","error","APIError","contractor","c","PaymentStatementPresentation"],"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;AAEO,MAAMG,IAAO,CAAC,EAAE,gBAAAC,GAAgB,gBAAAC,GAAgB,YAAAC,QAAwC;AAC7F,EAAAC,EAAuB,wCAAwCD,CAAU;AACzE,QAAM,EAAE,GAAAE,EAAA,IAAMC,EAAe,sCAAsC,GAE7D,EAAE,MAAMC,EAAA,IAAyBC,EAAsC;AAAA,IAC3E,4BAA4BP;AAAA,EAAA,CAC7B;AAED,MAAI,CAACM,EAAqB;AACxB,UAAM,IAAI,MAAMF,EAAE,6BAA6B,CAAC;AAGlD,QAAMI,IAAYF,EAAqB,uBAAuB,aAExD,EAAE,MAAMG,EAAA,IAAmBC,EAA2B,EAAE,aAAaF,GAAW,GAChFG,IAAcF,EAAe,kBAAkB,CAAA,GAE/CG,IAAUN,EAAqB,uBAAuB,oBAAoB;AAAA,IAC9E,CAAAO,MAAKA,EAAE,mBAAmBZ;AAAA,EAAA;AAG5B,MAAI,CAACW;AACH,UAAM,IAAI,MAAMR,EAAE,wBAAwB,CAAC;AAI7C,QAAM,EAAE,MAAMU,EAAA,IAAoBC;AAAA,IAChC;AAAA,MACE,uBAAuBH,EAAQ;AAAA,IAAA;AAAA,IAEjC;AAAA,MACE,OAAO;AAAA,MACP,cAAc,CAACI,MAET,EAAAA,aAAiBC,KAAYD,EAAM,SAAS,SAAS,WAAW;AAAA,IAItE;AAAA,EACF,GAEIE,IAAaP,EAAY,KAAK,CAAAQ,MAAKA,EAAE,SAASlB,CAAc;AAClE,MAAI,CAACiB;AACH,UAAM,IAAI,MAAMd,EAAE,2BAA2B,CAAC;AAGhD,SACE,gBAAAP;AAAA,IAACuB;AAAA,IAAA;AAAA,MACC,SAAAR;AAAA,MACA,YAAAM;AAAA,MACA,gBAAgBJ,GAAiB;AAAA,MACjC,WAAWR,EAAqB,uBAAuB,aAAa;AAAA,IAAA;AAAA,EAAA;AAG1E;"}
|
package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ContractorPaymentForGroup } from '@gusto/embedded-api/models/components/contractorpaymentforgroup';
|
|
2
|
+
import { Contractor } from '@gusto/embedded-api/models/components/contractor';
|
|
3
|
+
import { ContractorPaymentReceipt } from '@gusto/embedded-api/models/components/contractorpaymentreceipt';
|
|
4
|
+
interface PaymentStatementPresentationProps {
|
|
5
|
+
payment: ContractorPaymentForGroup;
|
|
6
|
+
contractor: Contractor;
|
|
7
|
+
paymentReceipt?: ContractorPaymentReceipt;
|
|
8
|
+
checkDate: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const PaymentStatementPresentation: ({ payment, contractor, checkDate, paymentReceipt, }: PaymentStatementPresentationProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { jsxs as a, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation as S, Trans as F } from "react-i18next";
|
|
3
|
+
import { useMemo as v } from "react";
|
|
4
|
+
import { getContractorDisplayName as x } from "../CreatePayment/helpers.js";
|
|
5
|
+
import i from "./PaymentStatementPresentation.module.scss.js";
|
|
6
|
+
import { Flex as m } from "../../../Common/Flex/Flex.js";
|
|
7
|
+
import "classnames";
|
|
8
|
+
import "../../../../shared/constants.js";
|
|
9
|
+
import { useComponentContext as C } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
10
|
+
import { useI18n as A } from "../../../../i18n/I18n.js";
|
|
11
|
+
import { formatHoursDisplay as H } from "../../../Payroll/helpers.js";
|
|
12
|
+
import M from "../../../../hooks/useNumberFormatter.js";
|
|
13
|
+
import { useDateFormatter as j } from "../../../../hooks/useDateFormatter.js";
|
|
14
|
+
import { addressInline as B, formatPhoneNumber as K } from "../../../../helpers/formattedStrings.js";
|
|
15
|
+
import O from "../../../../assets/icons/receipt-check.svg.js";
|
|
16
|
+
import { DataView as w } from "../../../Common/DataView/DataView.js";
|
|
17
|
+
const re = ({
|
|
18
|
+
payment: s,
|
|
19
|
+
contractor: c,
|
|
20
|
+
checkDate: k,
|
|
21
|
+
paymentReceipt: t
|
|
22
|
+
}) => {
|
|
23
|
+
const { Text: n, Heading: h } = C();
|
|
24
|
+
A("Contractor.Payments.PaymentStatement");
|
|
25
|
+
const { t: r } = S("Contractor.Payments.PaymentStatement"), l = M("currency"), { formatLongWithYear: u } = j(), { Link: I } = C(), b = x(c), f = s.wageType === "Hourly", d = Number(s.hours || 0), p = Number(s.hourlyRate || 0), g = Number(s.bonus || 0), N = Number(s.reimbursement || 0), D = Number(s.wageTotal || 0), T = !!(t && s.status === "Funded" && s.paymentMethod === "Direct Deposit"), z = t?.totals?.companyDebit || "0", L = v(() => t ? [
|
|
26
|
+
{
|
|
27
|
+
label: r("receipt.from"),
|
|
28
|
+
value: t.nameOfSender || ""
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
label: r("receipt.to"),
|
|
32
|
+
value: x(c)
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
label: r("receipt.debitDate"),
|
|
36
|
+
value: t.debitDate ? u(String(t.debitDate)) : ""
|
|
37
|
+
}
|
|
38
|
+
] : [], [t, c, r, u]), P = v(() => {
|
|
39
|
+
const o = [
|
|
40
|
+
{
|
|
41
|
+
label: s.paymentMethod || "",
|
|
42
|
+
amount: l(D)
|
|
43
|
+
}
|
|
44
|
+
];
|
|
45
|
+
return f && d > 0 ? o.push({
|
|
46
|
+
label: r("hoursLabel"),
|
|
47
|
+
amount: r("hoursAmount", {
|
|
48
|
+
hours: H(d),
|
|
49
|
+
rate: l(p)
|
|
50
|
+
})
|
|
51
|
+
}) : o.push({
|
|
52
|
+
label: r("wageLabel"),
|
|
53
|
+
amount: l(Number(s.wage || 0))
|
|
54
|
+
}), o.push({
|
|
55
|
+
label: r("bonus"),
|
|
56
|
+
amount: l(g)
|
|
57
|
+
}), o.push({
|
|
58
|
+
label: r("reimbursement"),
|
|
59
|
+
amount: l(N)
|
|
60
|
+
}), o;
|
|
61
|
+
}, [
|
|
62
|
+
s.paymentMethod,
|
|
63
|
+
D,
|
|
64
|
+
f,
|
|
65
|
+
d,
|
|
66
|
+
p,
|
|
67
|
+
g,
|
|
68
|
+
N,
|
|
69
|
+
r,
|
|
70
|
+
l,
|
|
71
|
+
s.wage
|
|
72
|
+
]);
|
|
73
|
+
return /* @__PURE__ */ a(m, { flexDirection: "column", gap: 32, children: [
|
|
74
|
+
/* @__PURE__ */ e(m, { flexDirection: "column", gap: 16, children: /* @__PURE__ */ a(m, { flexDirection: "column", gap: 8, children: [
|
|
75
|
+
/* @__PURE__ */ e(h, { as: "h2", children: r("title", { contractorName: b }) }),
|
|
76
|
+
/* @__PURE__ */ e(n, { children: u(k) })
|
|
77
|
+
] }) }),
|
|
78
|
+
T && /* @__PURE__ */ e("div", { className: i.receiptCard, children: /* @__PURE__ */ a(m, { flexDirection: "column", gap: 24, children: [
|
|
79
|
+
/* @__PURE__ */ a(m, { flexDirection: "column", alignItems: "center", gap: 16, children: [
|
|
80
|
+
/* @__PURE__ */ e("div", { className: i.receiptIcon, "aria-hidden": !0, children: /* @__PURE__ */ e(O, { className: i.checkmarkIcon }) }),
|
|
81
|
+
/* @__PURE__ */ a(m, { flexDirection: "column", alignItems: "center", gap: 8, children: [
|
|
82
|
+
/* @__PURE__ */ e(n, { size: "sm", variant: "supporting", children: r("receipt.totalLabel") }),
|
|
83
|
+
/* @__PURE__ */ e(h, { as: "h1", styledAs: "h2", className: i.totalAmount, children: l(Number(z)) })
|
|
84
|
+
] })
|
|
85
|
+
] }),
|
|
86
|
+
/* @__PURE__ */ e("div", { className: i.receiptDetailsTable, children: /* @__PURE__ */ e(
|
|
87
|
+
w,
|
|
88
|
+
{
|
|
89
|
+
label: r("receipt.detailsLabel"),
|
|
90
|
+
variant: "minimal",
|
|
91
|
+
breakAt: "small",
|
|
92
|
+
breakpoints: {
|
|
93
|
+
base: "0rem",
|
|
94
|
+
small: "22rem"
|
|
95
|
+
},
|
|
96
|
+
columns: [
|
|
97
|
+
{
|
|
98
|
+
title: "",
|
|
99
|
+
render: (o) => /* @__PURE__ */ e(n, { size: "sm", variant: "supporting", children: o.label })
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
title: "",
|
|
103
|
+
render: (o) => /* @__PURE__ */ e(n, { size: "sm", children: o.value })
|
|
104
|
+
}
|
|
105
|
+
],
|
|
106
|
+
data: L
|
|
107
|
+
}
|
|
108
|
+
) }),
|
|
109
|
+
/* @__PURE__ */ e("hr", {}),
|
|
110
|
+
/* @__PURE__ */ a(m, { flexDirection: "column", alignItems: "center", gap: 12, children: [
|
|
111
|
+
/* @__PURE__ */ e(n, { size: "sm", variant: "supporting", className: i.disclaimer, children: /* @__PURE__ */ e(
|
|
112
|
+
F,
|
|
113
|
+
{
|
|
114
|
+
i18nKey: "receipt.disclaimer",
|
|
115
|
+
t: r,
|
|
116
|
+
components: {
|
|
117
|
+
licensesLink: /* @__PURE__ */ e(I, { href: t?.licenseUri || "", target: "_blank" })
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
) }),
|
|
121
|
+
/* @__PURE__ */ e("hr", {}),
|
|
122
|
+
/* @__PURE__ */ e(n, { size: "sm", variant: "supporting", className: i.companyInfo, children: t?.licensee?.name || "" }),
|
|
123
|
+
/* @__PURE__ */ a(n, { size: "sm", variant: "supporting", className: i.address, children: [
|
|
124
|
+
B({
|
|
125
|
+
street1: t?.licensee?.address || "",
|
|
126
|
+
city: t?.licensee?.city || "",
|
|
127
|
+
state: t?.licensee?.state || "",
|
|
128
|
+
zip: t?.licensee?.postalCode || ""
|
|
129
|
+
}),
|
|
130
|
+
" | ",
|
|
131
|
+
K(t?.licensee?.phoneNumber)
|
|
132
|
+
] })
|
|
133
|
+
] })
|
|
134
|
+
] }) }),
|
|
135
|
+
/* @__PURE__ */ e(
|
|
136
|
+
w,
|
|
137
|
+
{
|
|
138
|
+
columns: [
|
|
139
|
+
{
|
|
140
|
+
title: r("debitedColumn"),
|
|
141
|
+
render: ({ label: o }) => /* @__PURE__ */ e(n, { children: o })
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
title: r("amountColumn"),
|
|
145
|
+
render: ({ amount: o }) => /* @__PURE__ */ e(n, { children: o || "" })
|
|
146
|
+
}
|
|
147
|
+
],
|
|
148
|
+
data: P,
|
|
149
|
+
label: r("title", { contractorName: b })
|
|
150
|
+
}
|
|
151
|
+
)
|
|
152
|
+
] });
|
|
153
|
+
};
|
|
154
|
+
export {
|
|
155
|
+
re as PaymentStatementPresentation
|
|
156
|
+
};
|
|
157
|
+
//# sourceMappingURL=PaymentStatementPresentation.js.map
|
package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PaymentStatementPresentation.js","sources":["../../../../../src/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.tsx"],"sourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport type { ContractorPaymentForGroup } from '@gusto/embedded-api/models/components/contractorpaymentforgroup'\nimport type { Contractor } from '@gusto/embedded-api/models/components/contractor'\nimport { useMemo } from 'react'\nimport type { ContractorPaymentReceipt } from '@gusto/embedded-api/models/components/contractorpaymentreceipt'\nimport { getContractorDisplayName } from '../CreatePayment/helpers'\nimport styles from './PaymentStatementPresentation.module.scss'\nimport { DataView, Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\nimport { formatHoursDisplay } from '@/components/Payroll/helpers'\nimport useNumberFormatter from '@/hooks/useNumberFormatter'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\nimport { addressInline, formatPhoneNumber } from '@/helpers/formattedStrings'\nimport ReceiptCheck from '@/assets/icons/receipt-check.svg?react'\n\ninterface PaymentStatementPresentationProps {\n payment: ContractorPaymentForGroup\n contractor: Contractor\n paymentReceipt?: ContractorPaymentReceipt\n checkDate: string\n}\n\ntype PaymentStatementRow = {\n label: string\n amount: string | null\n}\n\nexport const PaymentStatementPresentation = ({\n payment,\n contractor,\n checkDate,\n paymentReceipt,\n}: PaymentStatementPresentationProps) => {\n const { Text, Heading } = useComponentContext()\n useI18n('Contractor.Payments.PaymentStatement')\n const { t } = useTranslation('Contractor.Payments.PaymentStatement')\n const currencyFormatter = useNumberFormatter('currency')\n const { formatLongWithYear } = useDateFormatter()\n const { Link } = useComponentContext()\n\n const contractorName = getContractorDisplayName(contractor)\n const isHourly = payment.wageType === 'Hourly'\n const hours = Number(payment.hours || 0)\n const hourlyRate = Number(payment.hourlyRate || 0)\n const bonus = Number(payment.bonus || 0)\n const reimbursement = Number(payment.reimbursement || 0)\n const wageTotal = Number(payment.wageTotal || 0)\n\n const shouldShowReceipt = Boolean(\n paymentReceipt && payment.status === 'Funded' && payment.paymentMethod === 'Direct Deposit',\n )\n\n const receiptTotal = paymentReceipt?.totals?.companyDebit || '0'\n\n const receiptDetailsConfig = useMemo(() => {\n if (!paymentReceipt) return []\n\n return [\n {\n label: t('receipt.from'),\n value: paymentReceipt.nameOfSender || '',\n },\n {\n label: t('receipt.to'),\n value: getContractorDisplayName(contractor),\n },\n {\n label: t('receipt.debitDate'),\n value: paymentReceipt.debitDate ? formatLongWithYear(String(paymentReceipt.debitDate)) : '',\n },\n ]\n }, [paymentReceipt, contractor, t, formatLongWithYear])\n\n const statementRows = useMemo<PaymentStatementRow[]>(() => {\n const rows: PaymentStatementRow[] = [\n {\n label: payment.paymentMethod || '',\n amount: currencyFormatter(wageTotal),\n },\n ]\n\n if (isHourly && hours > 0) {\n rows.push({\n label: t('hoursLabel'),\n amount: t('hoursAmount', {\n hours: formatHoursDisplay(hours),\n rate: currencyFormatter(hourlyRate),\n }),\n })\n } else {\n rows.push({\n label: t('wageLabel'),\n amount: currencyFormatter(Number(payment.wage || 0)),\n })\n }\n\n rows.push({\n label: t('bonus'),\n amount: currencyFormatter(bonus),\n })\n\n rows.push({\n label: t('reimbursement'),\n amount: currencyFormatter(reimbursement),\n })\n\n return rows\n }, [\n payment.paymentMethod,\n wageTotal,\n isHourly,\n hours,\n hourlyRate,\n bonus,\n reimbursement,\n t,\n currencyFormatter,\n payment.wage,\n ])\n\n return (\n <Flex flexDirection=\"column\" gap={32}>\n <Flex flexDirection=\"column\" gap={16}>\n <Flex flexDirection=\"column\" gap={8}>\n <Heading as=\"h2\">{t('title', { contractorName })}</Heading>\n <Text>{formatLongWithYear(checkDate)}</Text>\n </Flex>\n </Flex>\n\n {shouldShowReceipt && (\n <div className={styles.receiptCard}>\n <Flex flexDirection=\"column\" gap={24}>\n <Flex flexDirection=\"column\" alignItems=\"center\" gap={16}>\n <div className={styles.receiptIcon} aria-hidden>\n <ReceiptCheck className={styles.checkmarkIcon} />\n </div>\n\n <Flex flexDirection=\"column\" alignItems=\"center\" gap={8}>\n <Text size=\"sm\" variant=\"supporting\">\n {t('receipt.totalLabel')}\n </Text>\n <Heading as=\"h1\" styledAs=\"h2\" className={styles.totalAmount}>\n {currencyFormatter(Number(receiptTotal))}\n </Heading>\n </Flex>\n </Flex>\n\n <div className={styles.receiptDetailsTable}>\n <DataView\n label={t('receipt.detailsLabel')}\n variant=\"minimal\"\n breakAt=\"small\"\n breakpoints={{\n base: '0rem',\n small: '22rem',\n }}\n columns={[\n {\n title: '',\n render: (item: { label: string; value: string }) => (\n <Text size=\"sm\" variant=\"supporting\">\n {item.label}\n </Text>\n ),\n },\n {\n title: '',\n render: (item: { label: string; value: string }) => (\n <Text size=\"sm\">{item.value}</Text>\n ),\n },\n ]}\n data={receiptDetailsConfig}\n />\n </div>\n <hr />\n <Flex flexDirection=\"column\" alignItems=\"center\" gap={12}>\n <Text size=\"sm\" variant=\"supporting\" className={styles.disclaimer}>\n <Trans\n i18nKey=\"receipt.disclaimer\"\n t={t}\n components={{\n licensesLink: <Link href={paymentReceipt?.licenseUri || ''} target=\"_blank\" />,\n }}\n />\n </Text>\n <hr />\n\n <Text size=\"sm\" variant=\"supporting\" className={styles.companyInfo}>\n {paymentReceipt?.licensee?.name || ''}\n </Text>\n <Text size=\"sm\" variant=\"supporting\" className={styles.address}>\n {addressInline({\n street1: paymentReceipt?.licensee?.address || '',\n city: paymentReceipt?.licensee?.city || '',\n state: paymentReceipt?.licensee?.state || '',\n zip: paymentReceipt?.licensee?.postalCode || '',\n country: '',\n uuid: '',\n })}\n {' | '}\n {formatPhoneNumber(paymentReceipt?.licensee?.phoneNumber)}\n </Text>\n </Flex>\n </Flex>\n </div>\n )}\n\n <DataView\n columns={[\n {\n title: t('debitedColumn'),\n render: ({ label }) => <Text>{label}</Text>,\n },\n {\n title: t('amountColumn'),\n render: ({ amount }) => <Text>{amount || ''}</Text>,\n },\n ]}\n data={statementRows}\n label={t('title', { contractorName })}\n />\n </Flex>\n )\n}\n"],"names":["PaymentStatementPresentation","payment","contractor","checkDate","paymentReceipt","Text","Heading","useComponentContext","useI18n","t","useTranslation","currencyFormatter","useNumberFormatter","formatLongWithYear","useDateFormatter","Link","contractorName","getContractorDisplayName","isHourly","hours","hourlyRate","bonus","reimbursement","wageTotal","shouldShowReceipt","receiptTotal","receiptDetailsConfig","useMemo","statementRows","rows","formatHoursDisplay","jsxs","Flex","jsx","styles","ReceiptCheck","DataView","item","Trans","addressInline","formatPhoneNumber","label","amount"],"mappings":";;;;;;;;;;;;;;;;AA4BO,MAAMA,KAA+B,CAAC;AAAA,EAC3C,SAAAC;AAAA,EACA,YAAAC;AAAA,EACA,WAAAC;AAAA,EACA,gBAAAC;AACF,MAAyC;AACvC,QAAM,EAAE,MAAAC,GAAM,SAAAC,EAAA,IAAYC,EAAA;AAC1B,EAAAC,EAAQ,sCAAsC;AAC9C,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,sCAAsC,GAC7DC,IAAoBC,EAAmB,UAAU,GACjD,EAAE,oBAAAC,EAAA,IAAuBC,EAAA,GACzB,EAAE,MAAAC,EAAA,IAASR,EAAA,GAEXS,IAAiBC,EAAyBf,CAAU,GACpDgB,IAAWjB,EAAQ,aAAa,UAChCkB,IAAQ,OAAOlB,EAAQ,SAAS,CAAC,GACjCmB,IAAa,OAAOnB,EAAQ,cAAc,CAAC,GAC3CoB,IAAQ,OAAOpB,EAAQ,SAAS,CAAC,GACjCqB,IAAgB,OAAOrB,EAAQ,iBAAiB,CAAC,GACjDsB,IAAY,OAAOtB,EAAQ,aAAa,CAAC,GAEzCuB,IAAoB,GACxBpB,KAAkBH,EAAQ,WAAW,YAAYA,EAAQ,kBAAkB,mBAGvEwB,IAAerB,GAAgB,QAAQ,gBAAgB,KAEvDsB,IAAuBC,EAAQ,MAC9BvB,IAEE;AAAA,IACL;AAAA,MACE,OAAOK,EAAE,cAAc;AAAA,MACvB,OAAOL,EAAe,gBAAgB;AAAA,IAAA;AAAA,IAExC;AAAA,MACE,OAAOK,EAAE,YAAY;AAAA,MACrB,OA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,IAAA,EAAA,CACF,EAAA,CACF;AAAA,IAGF,gBAAA6B;AAAA,MAACG;AAAA,MAAA;AAAA,QACC,SAAS;AAAA,UACP;AAAA,YACE,OAAO3B,EAAE,eAAe;AAAA,YACxB,QAAQ,CAAC,EAAE,OAAAgC,QAAY,gBAAAR,EAAC5B,KAAM,UAAAoC,EAAA,CAAM;AAAA,UAAA;AAAA,UAEtC;AAAA,YACE,OAAOhC,EAAE,cAAc;AAAA,YACvB,QAAQ,CAAC,EAAE,QAAAiC,QAAa,gBAAAT,EAAC5B,GAAA,EAAM,eAAU,GAAA,CAAG;AAAA,UAAA;AAAA,QAC9C;AAAA,QAEF,MAAMuB;AAAA,QACN,OAAOnB,EAAE,SAAS,EAAE,gBAAAO,GAAgB;AAAA,MAAA;AAAA,IAAA;AAAA,EACtC,GACF;AAEJ;"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const c = "_receiptCard_1rpnl_1", e = "_receiptIcon_1rpnl_12", t = "_checkmarkIcon_1rpnl_23", n = "_totalAmount_1rpnl_29", r = "_receiptDetailsTable_1rpnl_34", o = "_disclaimer_1rpnl_58", a = "_companyInfo_1rpnl_63", s = "_address_1rpnl_67", _ = {
|
|
2
|
+
receiptCard: c,
|
|
3
|
+
receiptIcon: e,
|
|
4
|
+
checkmarkIcon: t,
|
|
5
|
+
totalAmount: n,
|
|
6
|
+
receiptDetailsTable: r,
|
|
7
|
+
disclaimer: o,
|
|
8
|
+
companyInfo: a,
|
|
9
|
+
address: s
|
|
10
|
+
};
|
|
11
|
+
export {
|
|
12
|
+
s as address,
|
|
13
|
+
t as checkmarkIcon,
|
|
14
|
+
a as companyInfo,
|
|
15
|
+
_ as default,
|
|
16
|
+
o as disclaimer,
|
|
17
|
+
c as receiptCard,
|
|
18
|
+
r as receiptDetailsTable,
|
|
19
|
+
e as receiptIcon,
|
|
20
|
+
n as totalAmount
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=PaymentStatementPresentation.module.scss.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PaymentStatementPresentation.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
|
|
@@ -12,65 +12,62 @@ import { useI18n as A } from "../../../../i18n/I18n.js";
|
|
|
12
12
|
import F from "../../../../hooks/useNumberFormatter.js";
|
|
13
13
|
import R from "../../../../assets/icons/eye.svg.js";
|
|
14
14
|
import { useDateFormatter as j } from "../../../../hooks/useDateFormatter.js";
|
|
15
|
-
import { useDataView as
|
|
16
|
-
import { DataView as
|
|
15
|
+
import { useDataView as M } from "../../../Common/DataView/useDataView.js";
|
|
16
|
+
import { DataView as S } from "../../../Common/DataView/DataView.js";
|
|
17
17
|
const Q = ({
|
|
18
18
|
contractorPayments: d,
|
|
19
19
|
numberOfMonths: p,
|
|
20
20
|
onCreatePayment: o,
|
|
21
21
|
onDateRangeChange: h,
|
|
22
22
|
onViewPayment: y,
|
|
23
|
-
alerts:
|
|
23
|
+
alerts: s = []
|
|
24
24
|
}) => {
|
|
25
|
-
const { Button:
|
|
25
|
+
const { Button: l, Text: r, Heading: m, Select: b, ButtonIcon: f, Alert: g } = N();
|
|
26
26
|
A("Contractor.Payments.PaymentsList");
|
|
27
|
-
const { t } = x("Contractor.Payments.PaymentsList"), c = F("currency"), { formatLongWithYear: C } = j(), D = [
|
|
28
|
-
{ value: "3", label:
|
|
29
|
-
{ value: "6", label:
|
|
30
|
-
{ value: "12", label:
|
|
31
|
-
], { ...P } =
|
|
27
|
+
const { t: e } = x("Contractor.Payments.PaymentsList"), c = F("currency"), { formatLongWithYear: C } = j(), D = [
|
|
28
|
+
{ value: "3", label: e("dateRanges.last3Months") },
|
|
29
|
+
{ value: "6", label: e("dateRanges.last6Months") },
|
|
30
|
+
{ value: "12", label: e("dateRanges.last12Months") }
|
|
31
|
+
], { ...P } = M({
|
|
32
32
|
data: d,
|
|
33
33
|
columns: [
|
|
34
34
|
{
|
|
35
|
-
title:
|
|
36
|
-
render: ({ checkDate:
|
|
35
|
+
title: e("paymentDateColumnLabel"),
|
|
36
|
+
render: ({ checkDate: t }) => /* @__PURE__ */ n(r, { weight: "semibold", variant: "supporting", children: C(t) || "N/A" })
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
|
-
title:
|
|
40
|
-
render: ({ totals:
|
|
39
|
+
title: e("wageTotalColumnLabel"),
|
|
40
|
+
render: ({ totals: t }) => /* @__PURE__ */ n(r, { children: c(Number(t?.wageAmount || 0)) })
|
|
41
41
|
},
|
|
42
42
|
{
|
|
43
|
-
title:
|
|
44
|
-
render: ({ totals:
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
title: t("actionColumnLabel"),
|
|
48
|
-
render: ({ uuid: e }) => /* @__PURE__ */ n(r, { children: /* @__PURE__ */ n(
|
|
49
|
-
f,
|
|
50
|
-
{
|
|
51
|
-
"aria-label": t("viewPaymentCta"),
|
|
52
|
-
variant: "tertiary",
|
|
53
|
-
onClick: () => {
|
|
54
|
-
y(e || "");
|
|
55
|
-
},
|
|
56
|
-
children: /* @__PURE__ */ n(R, { "aria-hidden": !0 })
|
|
57
|
-
}
|
|
58
|
-
) })
|
|
43
|
+
title: e("reimbursementTotalColumnLabel"),
|
|
44
|
+
render: ({ totals: t }) => /* @__PURE__ */ n(r, { children: c(Number(t?.reimbursementAmount) || 0) })
|
|
59
45
|
}
|
|
60
46
|
],
|
|
61
|
-
|
|
47
|
+
itemMenu: ({ uuid: t }) => /* @__PURE__ */ n(
|
|
48
|
+
f,
|
|
49
|
+
{
|
|
50
|
+
"aria-label": e("viewPaymentCta"),
|
|
51
|
+
variant: "tertiary",
|
|
52
|
+
onClick: () => {
|
|
53
|
+
y(t || "");
|
|
54
|
+
},
|
|
55
|
+
children: /* @__PURE__ */ n(R, { "aria-hidden": !0 })
|
|
56
|
+
}
|
|
57
|
+
),
|
|
58
|
+
emptyState: () => /* @__PURE__ */ n(w, { title: e("noPaymentsFound"), description: e("noPaymentsDescription"), children: /* @__PURE__ */ n(L, { justifyContent: "center", children: /* @__PURE__ */ n(l, { variant: "primary", onClick: o, children: e("createPaymentCta") }) }) })
|
|
62
59
|
});
|
|
63
60
|
return /* @__PURE__ */ i(a, { flexDirection: "column", gap: 24, children: [
|
|
64
|
-
/* @__PURE__ */ n(a, { flexDirection: "column", gap: 16, children: /* @__PURE__ */ n(m, { as: "h1", children:
|
|
65
|
-
|
|
61
|
+
/* @__PURE__ */ n(a, { flexDirection: "column", gap: 16, children: /* @__PURE__ */ n(m, { as: "h1", children: e("title") }) }),
|
|
62
|
+
s.length > 0 && /* @__PURE__ */ n(a, { flexDirection: "column", gap: 16, children: s.map((t, v) => /* @__PURE__ */ n(
|
|
66
63
|
g,
|
|
67
64
|
{
|
|
68
|
-
label:
|
|
69
|
-
status:
|
|
70
|
-
onDismiss:
|
|
71
|
-
children:
|
|
65
|
+
label: e(`alerts.${t.title}`, t.translationParams),
|
|
66
|
+
status: t.type,
|
|
67
|
+
onDismiss: t.onDismiss,
|
|
68
|
+
children: t.content ?? null
|
|
72
69
|
},
|
|
73
|
-
`${
|
|
70
|
+
`${t.type}-${t.title}-${v}`
|
|
74
71
|
)) }),
|
|
75
72
|
/* @__PURE__ */ i(
|
|
76
73
|
a,
|
|
@@ -86,28 +83,28 @@ const Q = ({
|
|
|
86
83
|
},
|
|
87
84
|
justifyContent: "space-between",
|
|
88
85
|
children: [
|
|
89
|
-
/* @__PURE__ */ n(m, { as: "h2", children:
|
|
86
|
+
/* @__PURE__ */ n(m, { as: "h2", children: e("subtitle") }),
|
|
90
87
|
/* @__PURE__ */ i("div", { className: u.actionsContainer, children: [
|
|
91
88
|
/* @__PURE__ */ n(
|
|
92
89
|
b,
|
|
93
90
|
{
|
|
94
91
|
id: "date-range-select",
|
|
95
92
|
value: p.toString(),
|
|
96
|
-
onChange: (
|
|
97
|
-
h(Number(
|
|
93
|
+
onChange: (t) => {
|
|
94
|
+
h(Number(t));
|
|
98
95
|
},
|
|
99
96
|
options: D,
|
|
100
97
|
isRequired: !0,
|
|
101
|
-
label:
|
|
98
|
+
label: e("startDate"),
|
|
102
99
|
shouldVisuallyHideLabel: !0
|
|
103
100
|
}
|
|
104
101
|
),
|
|
105
|
-
/* @__PURE__ */ n(
|
|
102
|
+
/* @__PURE__ */ n(l, { onClick: o, variant: "secondary", className: u.nowrap, children: e("createPaymentCta") })
|
|
106
103
|
] })
|
|
107
104
|
]
|
|
108
105
|
}
|
|
109
106
|
),
|
|
110
|
-
/* @__PURE__ */ n(
|
|
107
|
+
/* @__PURE__ */ n(S, { label: e("subtitle"), ...P })
|
|
111
108
|
] });
|
|
112
109
|
};
|
|
113
110
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaymentsListPresentation.js","sources":["../../../../../src/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type { ContractorPaymentGroupWithBlockers } from '@gusto/embedded-api/models/components/contractorpaymentgroupwithblockers'\nimport type { InternalAlert } from '../types'\nimport styles from './PaymentsListPresentation.module.scss'\nimport { DataView, Flex, EmptyData, ActionsLayout, useDataView } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\nimport useNumberFormatter from '@/hooks/useNumberFormatter'\nimport EyeIcon from '@/assets/icons/eye.svg?react'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\n\ninterface ContractorPaymentPaymentsListPresentationProps {\n numberOfMonths: number\n contractorPayments: ContractorPaymentGroupWithBlockers[]\n onCreatePayment: () => void\n onDateRangeChange: (numberOfMonths: number) => void\n onViewPayment: (paymentId: string) => void\n alerts?: InternalAlert[]\n}\n\nexport const PaymentsListPresentation = ({\n contractorPayments,\n numberOfMonths,\n onCreatePayment,\n onDateRangeChange,\n onViewPayment,\n alerts = [],\n}: ContractorPaymentPaymentsListPresentationProps) => {\n const { Button, Text, Heading, Select, ButtonIcon, Alert } = useComponentContext()\n useI18n('Contractor.Payments.PaymentsList')\n const { t } = useTranslation('Contractor.Payments.PaymentsList')\n const currencyFormatter = useNumberFormatter('currency')\n const { formatLongWithYear } = useDateFormatter()\n\n const dateRangeOptions = [\n { value: '3', label: t('dateRanges.last3Months') },\n { value: '6', label: t('dateRanges.last6Months') },\n { value: '12', label: t('dateRanges.last12Months') },\n ]\n const { ...dataViewProps } = useDataView({\n data: contractorPayments,\n columns: [\n {\n title: t('paymentDateColumnLabel'),\n render: ({ checkDate }) => (\n <Text weight=\"semibold\" variant=\"supporting\">\n {formatLongWithYear(checkDate) || 'N/A'}\n </Text>\n ),\n },\n {\n title: t('
|
|
1
|
+
{"version":3,"file":"PaymentsListPresentation.js","sources":["../../../../../src/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type { ContractorPaymentGroupWithBlockers } from '@gusto/embedded-api/models/components/contractorpaymentgroupwithblockers'\nimport type { InternalAlert } from '../types'\nimport styles from './PaymentsListPresentation.module.scss'\nimport { DataView, Flex, EmptyData, ActionsLayout, useDataView } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\nimport useNumberFormatter from '@/hooks/useNumberFormatter'\nimport EyeIcon from '@/assets/icons/eye.svg?react'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\n\ninterface ContractorPaymentPaymentsListPresentationProps {\n numberOfMonths: number\n contractorPayments: ContractorPaymentGroupWithBlockers[]\n onCreatePayment: () => void\n onDateRangeChange: (numberOfMonths: number) => void\n onViewPayment: (paymentId: string) => void\n alerts?: InternalAlert[]\n}\n\nexport const PaymentsListPresentation = ({\n contractorPayments,\n numberOfMonths,\n onCreatePayment,\n onDateRangeChange,\n onViewPayment,\n alerts = [],\n}: ContractorPaymentPaymentsListPresentationProps) => {\n const { Button, Text, Heading, Select, ButtonIcon, Alert } = useComponentContext()\n useI18n('Contractor.Payments.PaymentsList')\n const { t } = useTranslation('Contractor.Payments.PaymentsList')\n const currencyFormatter = useNumberFormatter('currency')\n const { formatLongWithYear } = useDateFormatter()\n\n const dateRangeOptions = [\n { value: '3', label: t('dateRanges.last3Months') },\n { value: '6', label: t('dateRanges.last6Months') },\n { value: '12', label: t('dateRanges.last12Months') },\n ]\n const { ...dataViewProps } = useDataView({\n data: contractorPayments,\n columns: [\n {\n title: t('paymentDateColumnLabel'),\n render: ({ checkDate }) => (\n <Text weight=\"semibold\" variant=\"supporting\">\n {formatLongWithYear(checkDate) || 'N/A'}\n </Text>\n ),\n },\n {\n title: t('wageTotalColumnLabel'),\n render: ({ totals }) => <Text>{currencyFormatter(Number(totals?.wageAmount || 0))}</Text>,\n },\n {\n title: t('reimbursementTotalColumnLabel'),\n render: ({ totals }) => (\n <Text>{currencyFormatter(Number(totals?.reimbursementAmount) || 0)}</Text>\n ),\n },\n ],\n itemMenu: ({ uuid }) => (\n <ButtonIcon\n aria-label={t('viewPaymentCta')}\n variant=\"tertiary\"\n onClick={() => {\n onViewPayment(uuid || '')\n }}\n >\n <EyeIcon aria-hidden />\n </ButtonIcon>\n ),\n emptyState: () => (\n <EmptyData title={t('noPaymentsFound')} description={t('noPaymentsDescription')}>\n <ActionsLayout justifyContent=\"center\">\n <Button variant=\"primary\" onClick={onCreatePayment}>\n {t('createPaymentCta')}\n </Button>\n </ActionsLayout>\n </EmptyData>\n ),\n })\n\n return (\n <Flex flexDirection=\"column\" gap={24}>\n <Flex flexDirection=\"column\" gap={16}>\n <Heading as=\"h1\">{t('title')}</Heading>\n </Flex>\n\n {alerts.length > 0 && (\n <Flex flexDirection=\"column\" gap={16}>\n {alerts.map((alert, index) => (\n <Alert\n key={`${alert.type}-${alert.title}-${index}`}\n label={t(`alerts.${alert.title}` as never, alert.translationParams)}\n status={alert.type}\n onDismiss={alert.onDismiss}\n >\n {alert.content ?? null}\n </Alert>\n ))}\n </Flex>\n )}\n\n <Flex\n flexDirection={{\n base: 'column',\n small: 'row',\n }}\n gap={16}\n alignItems={{\n base: 'stretch',\n small: 'flex-end',\n }}\n justifyContent=\"space-between\"\n >\n <Heading as=\"h2\">{t('subtitle')}</Heading>\n <div className={styles.actionsContainer}>\n <Select\n id=\"date-range-select\"\n value={numberOfMonths.toString()}\n onChange={value => {\n onDateRangeChange(Number(value))\n }}\n options={dateRangeOptions}\n isRequired\n label={t('startDate')}\n shouldVisuallyHideLabel\n />\n <Button onClick={onCreatePayment} variant=\"secondary\" className={styles.nowrap}>\n {t('createPaymentCta')}\n </Button>\n </div>\n </Flex>\n\n <DataView label={t('subtitle')} {...dataViewProps} />\n </Flex>\n )\n}\n"],"names":["PaymentsListPresentation","contractorPayments","numberOfMonths","onCreatePayment","onDateRangeChange","onViewPayment","alerts","Button","Text","Heading","Select","ButtonIcon","Alert","useComponentContext","useI18n","t","useTranslation","currencyFormatter","useNumberFormatter","formatLongWithYear","useDateFormatter","dateRangeOptions","dataViewProps","useDataView","checkDate","jsx","totals","uuid","EyeIcon","EmptyData","ActionsLayout","jsxs","Flex","alert","index","styles","value","DataView"],"mappings":";;;;;;;;;;;;;;;;AAoBO,MAAMA,IAA2B,CAAC;AAAA,EACvC,oBAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,eAAAC;AAAA,EACA,QAAAC,IAAS,CAAA;AACX,MAAsD;AACpD,QAAM,EAAE,QAAAC,GAAQ,MAAAC,GAAM,SAAAC,GAAS,QAAAC,GAAQ,YAAAC,GAAY,OAAAC,EAAA,IAAUC,EAAA;AAC7D,EAAAC,EAAQ,kCAAkC;AAC1C,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,kCAAkC,GACzDC,IAAoBC,EAAmB,UAAU,GACjD,EAAE,oBAAAC,EAAA,IAAuBC,EAAA,GAEzBC,IAAmB;AAAA,IACvB,EAAE,OAAO,KAAK,OAAON,EAAE,wBAAwB,EAAA;AAAA,IAC/C,EAAE,OAAO,KAAK,OAAOA,EAA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