@gusto/embedded-react-sdk 0.36.0 → 0.37.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +58 -0
- package/README.md +6 -0
- package/dist/UNSTABLE_Hooks.d.ts +1 -1
- package/dist/UNSTABLE_Hooks.js +50 -6
- package/dist/UNSTABLE_Hooks.js.map +1 -1
- package/dist/components/Base/Base.d.ts +8 -9
- package/dist/components/Base/Base.js +123 -102
- package/dist/components/Base/Base.js.map +1 -1
- package/dist/components/Base/createCompoundContext.js.map +1 -1
- package/dist/components/Base/index.d.ts +1 -1
- package/dist/components/Base/useBase.d.ts +3 -7
- package/dist/components/Base/useBase.js.map +1 -1
- package/dist/components/Base/useBaseSubmit.d.ts +3 -5
- package/dist/components/Base/useBaseSubmit.js +27 -50
- package/dist/components/Base/useBaseSubmit.js.map +1 -1
- package/dist/components/Common/DataView/DataCards/DataCards.js +42 -36
- package/dist/components/Common/DataView/DataCards/DataCards.js.map +1 -1
- package/dist/components/Common/Fields/CheckboxField/CheckboxField.d.ts +2 -0
- package/dist/components/Common/Fields/CheckboxField/CheckboxField.js +22 -19
- package/dist/components/Common/Fields/CheckboxField/CheckboxField.js.map +1 -1
- package/dist/components/Common/Fields/CheckboxGroupField/CheckboxGroupField.d.ts +1 -1
- package/dist/components/Common/Fields/CheckboxGroupField/CheckboxGroupField.js +32 -30
- package/dist/components/Common/Fields/CheckboxGroupField/CheckboxGroupField.js.map +1 -1
- package/dist/components/Common/Fields/ComboBoxField/ComboBoxField.d.ts +1 -1
- package/dist/components/Common/Fields/ComboBoxField/ComboBoxField.js +36 -34
- package/dist/components/Common/Fields/ComboBoxField/ComboBoxField.js.map +1 -1
- package/dist/components/Common/Fields/DatePickerField/DatePickerField.d.ts +5 -3
- package/dist/components/Common/Fields/DatePickerField/DatePickerField.js +52 -40
- package/dist/components/Common/Fields/DatePickerField/DatePickerField.js.map +1 -1
- package/dist/components/Common/Fields/FileInputField/FileInputField.js +24 -22
- package/dist/components/Common/Fields/FileInputField/FileInputField.js.map +1 -1
- package/dist/components/Common/Fields/MultiSelectComboBoxField/MultiSelectComboBoxField.js +24 -22
- package/dist/components/Common/Fields/MultiSelectComboBoxField/MultiSelectComboBoxField.js.map +1 -1
- package/dist/components/Common/Fields/NumberInputField/NumberInputField.d.ts +2 -0
- package/dist/components/Common/Fields/NumberInputField/NumberInputField.js +31 -28
- package/dist/components/Common/Fields/NumberInputField/NumberInputField.js.map +1 -1
- package/dist/components/Common/Fields/RadioGroupField/RadioGroupField.d.ts +3 -1
- package/dist/components/Common/Fields/RadioGroupField/RadioGroupField.js +30 -27
- package/dist/components/Common/Fields/RadioGroupField/RadioGroupField.js.map +1 -1
- package/dist/components/Common/Fields/SelectField/SelectField.d.ts +3 -1
- package/dist/components/Common/Fields/SelectField/SelectField.js +31 -28
- package/dist/components/Common/Fields/SelectField/SelectField.js.map +1 -1
- package/dist/components/Common/Fields/SwitchField/SwitchField.d.ts +2 -0
- package/dist/components/Common/Fields/SwitchField/SwitchField.js +24 -21
- package/dist/components/Common/Fields/SwitchField/SwitchField.js.map +1 -1
- package/dist/components/Common/Fields/TextAreaField/TextAreaField.js +24 -22
- package/dist/components/Common/Fields/TextAreaField/TextAreaField.js.map +1 -1
- package/dist/components/Common/Fields/TextInputField/TextInputField.d.ts +2 -0
- package/dist/components/Common/Fields/TextInputField/TextInputField.js +26 -23
- package/dist/components/Common/Fields/TextInputField/TextInputField.js.map +1 -1
- package/dist/components/Common/Fields/hooks/useField.d.ts +3 -2
- package/dist/components/Common/Fields/hooks/useField.js +37 -33
- package/dist/components/Common/Fields/hooks/useField.js.map +1 -1
- package/dist/components/Common/ReorderableList/ReorderableList.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureForm.js +10 -15
- package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormActions.js +10 -14
- package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormFields.js +14 -19
- package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
- package/dist/components/Common/UI/Button/Button.js +33 -29
- package/dist/components/Common/UI/Button/Button.js.map +1 -1
- package/dist/components/Common/UI/Button/Button.module.scss.js +5 -3
- package/dist/components/Common/UI/Button/Button.module.scss.js.map +1 -1
- package/dist/components/Common/UI/Button/ButtonTypes.d.ts +4 -0
- package/dist/components/Common/UI/Button/ButtonTypes.js.map +1 -1
- package/dist/components/Common/UI/DescriptionList/DescriptionList.module.scss.js +1 -1
- package/dist/components/Common/UI/MultiSelectComboBox/MultiSelectComboBox.js +94 -80
- package/dist/components/Common/UI/MultiSelectComboBox/MultiSelectComboBox.js.map +1 -1
- package/dist/components/Common/UI/NumberInput/NumberInput.js +1 -1
- package/dist/components/Common/UI/NumberInput/NumberInput.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatory.js +7 -11
- package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +6 -10
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +8 -11
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +6 -9
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +13 -14
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +8 -9
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +6 -9
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +5 -8
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +13 -14
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +8 -9
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/TitleSelect.js +2 -5
- package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +10 -11
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +9 -11
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js +9 -13
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +8 -9
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js +10 -13
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +12 -15
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +4 -8
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +5 -8
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +11 -15
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +8 -9
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +11 -15
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +8 -9
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Actions.js +8 -11
- package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Company/FederalTaxes/FederalTaxes.js +15 -19
- package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Form.js +6 -8
- package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +10 -11
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Actions.js +8 -11
- package/dist/components/Company/Industry/Actions.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +11 -12
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Industry/Edit.js +10 -14
- package/dist/components/Company/Industry/Edit.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Actions.js +8 -11
- package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Form.js +5 -7
- package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/LocationForm.js +15 -19
- package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +8 -9
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/Actions.js +6 -9
- package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/List.js +17 -19
- package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +6 -10
- package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +8 -9
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/Completed.js +12 -15
- package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js +9 -12
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +6 -10
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +8 -9
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/PaySchedule.js +60 -63
- package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Actions.js +10 -13
- 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/Edit.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Head.js +11 -14
- package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/List.js +19 -21
- package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
- package/dist/components/Company/PaySchedule/usePaySchedule.js +10 -11
- package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +5 -8
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +8 -9
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +6 -9
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js +5 -8
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +8 -9
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Contractor/Address/Address.js +3 -7
- package/dist/components/Contractor/Address/Address.js.map +1 -1
- package/dist/components/Contractor/Address/Form.js +6 -8
- package/dist/components/Contractor/Address/Form.js.map +1 -1
- package/dist/components/Contractor/Address/useAddress.js +10 -11
- package/dist/components/Contractor/Address/useAddress.js.map +1 -1
- package/dist/components/Contractor/ContractorList/index.js +29 -30
- package/dist/components/Contractor/ContractorList/index.js.map +1 -1
- package/dist/components/Contractor/NewHireReport/NewHireReport.js +2 -3
- package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +10 -14
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +2 -3
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +2 -5
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +12 -14
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +10 -10
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js +18 -21
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +3 -4
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js +17 -19
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js +6 -8
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js +2 -4
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +2 -5
- 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 +33 -32
- package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
- package/dist/components/Contractor/Submit/Submit.js +20 -22
- package/dist/components/Contractor/Submit/Submit.js.map +1 -1
- package/dist/components/Employee/Compensation/Actions.js +12 -14
- package/dist/components/Employee/Compensation/Actions.js.map +1 -1
- package/dist/components/Employee/Compensation/Compensation.js.map +1 -1
- package/dist/components/Employee/Compensation/Edit.js +27 -28
- package/dist/components/Employee/Compensation/Edit.js.map +1 -1
- package/dist/components/Employee/Compensation/List.js +23 -25
- package/dist/components/Employee/Compensation/List.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +61 -57
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +15 -16
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +15 -16
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +18 -19
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js.map +1 -1
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js +6 -7
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +6 -9
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +10 -14
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js +2 -6
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +8 -9
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js +24 -26
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.js +9 -11
- package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +11 -15
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +8 -9
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.js +6 -9
- package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.js.map +1 -1
- package/dist/components/Employee/EmployeeList/Actions.js +6 -9
- package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
- package/dist/components/Employee/EmployeeList/EmployeeList.js +3 -7
- package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
- package/dist/components/Employee/EmployeeList/Head.js +5 -8
- package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
- package/dist/components/Employee/EmployeeList/List.js +16 -17
- package/dist/components/Employee/EmployeeList/List.js.map +1 -1
- package/dist/components/Employee/EmployeeList/useEmployeeList.js +8 -9
- package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/Actions.js +7 -10
- package/dist/components/Employee/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/FederalForm.js +10 -13
- package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/FederalTaxes.js +42 -42
- package/dist/components/Employee/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +8 -9
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Employee/Landing/Landing.js +14 -15
- 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 +8 -11
- package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +5 -8
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js +9 -10
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +7 -10
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/Split.js +9 -10
- package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +10 -11
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
- package/dist/components/Employee/Profile/Actions.js +8 -11
- package/dist/components/Employee/Profile/Actions.js.map +1 -1
- package/dist/components/Employee/Profile/AdminPersonalDetails.js +14 -17
- package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
- package/dist/components/Employee/Profile/HomeAddress.d.ts +3 -3
- package/dist/components/Employee/Profile/HomeAddress.js +45 -44
- package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js +10 -13
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
- package/dist/components/Employee/Profile/Profile.js +30 -29
- package/dist/components/Employee/Profile/Profile.js.map +1 -1
- package/dist/components/Employee/Profile/useProfile.js +8 -9
- package/dist/components/Employee/Profile/useProfile.js.map +1 -1
- package/dist/components/Employee/StateTaxes/Actions.js +8 -11
- package/dist/components/Employee/StateTaxes/Actions.js.map +1 -1
- package/dist/components/Employee/StateTaxes/StateTaxes.js +50 -50
- package/dist/components/Employee/StateTaxes/StateTaxes.js.map +1 -1
- package/dist/components/Employee/StateTaxes/useStateTaxes.js +8 -9
- package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
- package/dist/components/Employee/Taxes/Actions.js +8 -11
- package/dist/components/Employee/Taxes/Actions.js.map +1 -1
- package/dist/components/Employee/Taxes/FederalForm.js +10 -13
- package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/Taxes/Taxes.js +53 -53
- package/dist/components/Employee/Taxes/Taxes.js.map +1 -1
- package/dist/components/Employee/Taxes/useTaxes.js +8 -9
- package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.d.ts +11 -0
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.js +123 -0
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.js.map +1 -0
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.d.ts +11 -0
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js +89 -0
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js.map +1 -0
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlow.d.ts +2 -0
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlow.js +30 -0
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlow.js.map +1 -0
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.d.ts +24 -0
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.js +76 -0
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.js.map +1 -0
- package/dist/components/Employee/Terminations/TerminationFlow/index.d.ts +3 -0
- package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.d.ts +8 -0
- package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.js +177 -0
- package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.js.map +1 -0
- package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.test.d.ts +1 -0
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummary.d.ts +9 -0
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummary.js +86 -0
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummary.js.map +1 -0
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.d.ts +20 -0
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.js +100 -0
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.js.map +1 -0
- package/dist/components/Employee/Terminations/TerminationsData.d.ts +6 -0
- package/dist/components/Employee/Terminations/index.d.ts +8 -0
- package/dist/components/Employee/Terminations/types.d.ts +1 -0
- package/dist/components/Employee/index.d.ts +7 -0
- package/dist/components/Employee/index.js +34 -28
- package/dist/components/Employee/index.js.map +1 -1
- package/dist/components/Flow/Flow.js +20 -23
- package/dist/components/Flow/Flow.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js +16 -18
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js +18 -20
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequests.js +34 -35
- package/dist/components/InformationRequests/InformationRequests.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js +41 -41
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +8 -10
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js.map +1 -1
- package/dist/components/Payroll/Dismissal/DismissalFlow.d.ts +2 -0
- package/dist/components/Payroll/Dismissal/DismissalFlow.js +32 -0
- package/dist/components/Payroll/Dismissal/DismissalFlow.js.map +1 -0
- package/dist/components/Payroll/Dismissal/DismissalFlowComponents.d.ts +16 -0
- package/dist/components/Payroll/Dismissal/DismissalFlowComponents.js +52 -0
- package/dist/components/Payroll/Dismissal/DismissalFlowComponents.js.map +1 -0
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.d.ts +7 -0
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.js +73 -0
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.js.map +1 -0
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.d.ts +9 -0
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.js +50 -0
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.js.map +1 -0
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/index.d.ts +3 -0
- package/dist/components/Payroll/Dismissal/dismissalStateMachine.d.ts +6 -0
- package/dist/components/Payroll/Dismissal/dismissalStateMachine.js +51 -0
- package/dist/components/Payroll/Dismissal/dismissalStateMachine.js.map +1 -0
- package/dist/components/Payroll/Dismissal/dismissalStateMachine.test.d.ts +1 -0
- package/dist/components/Payroll/Dismissal/index.d.ts +3 -0
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.d.ts +1 -1
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +89 -76
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.module.scss.js +6 -6
- package/dist/components/Payroll/GrossUpModal/GrossUpModalTypes.d.ts +0 -1
- package/dist/components/Payroll/OffCycle/OffCycleFlow.d.ts +1 -1
- package/dist/components/Payroll/OffCycle/OffCycleFlow.js +25 -18
- package/dist/components/Payroll/OffCycle/OffCycleFlow.js.map +1 -1
- package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.d.ts +5 -0
- package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js +31 -24
- package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js +78 -75
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.d.ts +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js +75 -68
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.module.scss.js +8 -0
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.module.scss.js.map +1 -0
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationTypes.d.ts +0 -1
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js +18 -26
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.module.scss.js +4 -4
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.js +4 -4
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.js.map +1 -1
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.d.ts +1 -0
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.js +1 -0
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.js.map +1 -1
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js +6 -9
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js +12 -14
- package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +11 -14
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +12 -12
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +174 -148
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.d.ts +3 -3
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +71 -71
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/grossUpHelpers.d.ts +3 -2
- package/dist/components/Payroll/PayrollConfiguration/grossUpHelpers.js +8 -8
- package/dist/components/Payroll/PayrollConfiguration/grossUpHelpers.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.d.ts +5 -3
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js +76 -70
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js +47 -42
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.d.ts +5 -3
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +256 -219
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +19 -21
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/OffCycleFlowContextual.d.ts +1 -0
- package/dist/components/Payroll/PayrollFlow/OffCycleFlowContextual.js +19 -0
- package/dist/components/Payroll/PayrollFlow/OffCycleFlowContextual.js.map +1 -0
- package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.d.ts +3 -0
- package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/TransitionFlowContextual.d.ts +1 -0
- package/dist/components/Payroll/PayrollFlow/TransitionFlowContextual.js +21 -0
- package/dist/components/Payroll/PayrollFlow/TransitionFlowContextual.js.map +1 -0
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.d.ts +2 -0
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js +95 -64
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.js +53 -47
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +38 -40
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js +25 -23
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollList.js +55 -43
- package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.d.ts +2 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +110 -95
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js +12 -8
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +15 -15
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +59 -59
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js +7 -10
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js.map +1 -1
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +2 -3
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js +2 -4
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js +11 -13
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js +2 -5
- package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js.map +1 -1
- package/dist/components/Payroll/Transition/TransitionFlow.d.ts +2 -0
- package/dist/components/Payroll/Transition/TransitionFlow.js +38 -0
- package/dist/components/Payroll/Transition/TransitionFlow.js.map +1 -0
- package/dist/components/Payroll/Transition/TransitionFlowComponents.d.ts +19 -0
- package/dist/components/Payroll/Transition/TransitionFlowComponents.js +54 -0
- package/dist/components/Payroll/Transition/TransitionFlowComponents.js.map +1 -0
- package/dist/components/Payroll/Transition/index.d.ts +3 -0
- package/dist/components/Payroll/Transition/transitionStateMachine.d.ts +6 -0
- package/dist/components/Payroll/Transition/transitionStateMachine.js +58 -0
- package/dist/components/Payroll/Transition/transitionStateMachine.js.map +1 -0
- package/dist/components/Payroll/Transition/transitionStateMachine.test.d.ts +1 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreation.d.ts +2 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreation.js +92 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreation.js.map +1 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.d.ts +2 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.js +109 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.js.map +1 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.module.scss.js +8 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.module.scss.js.map +1 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreationTypes.d.ts +28 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreationTypes.js +21 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreationTypes.js.map +1 -0
- package/dist/components/Payroll/TransitionCreation/index.d.ts +3 -0
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.d.ts +8 -0
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.js +83 -0
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.js.map +1 -0
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.d.ts +16 -0
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.js +100 -0
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.js.map +1 -0
- package/dist/components/Payroll/TransitionPayrollAlert/index.d.ts +2 -0
- package/dist/components/Payroll/helpers.d.ts +6 -1
- package/dist/components/Payroll/helpers.js +100 -84
- package/dist/components/Payroll/helpers.js.map +1 -1
- package/dist/components/Payroll/index.d.ts +6 -0
- package/dist/components/Payroll/index.js +32 -26
- package/dist/components/Payroll/index.js.map +1 -1
- package/dist/components/Payroll/payrollTypes.d.ts +21 -0
- package/dist/components/Payroll/payrollTypes.js +27 -0
- package/dist/components/Payroll/payrollTypes.js.map +1 -0
- package/dist/components/Payroll/usePreparedPayrollData.js +6 -8
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/collectErrors.d.ts +6 -0
- package/dist/components/UNSTABLE_Hooks/collectErrors.js +9 -0
- package/dist/components/UNSTABLE_Hooks/collectErrors.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataContext.d.ts +8 -0
- package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataContext.js +10 -0
- package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataContext.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataProvider.d.ts +10 -0
- package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataProvider.js +13 -0
- package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataProvider.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/SDKFormProvider.d.ts +23 -0
- package/dist/components/UNSTABLE_Hooks/form/SDKFormProvider.js +24 -0
- package/dist/components/UNSTABLE_Hooks/form/SDKFormProvider.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/composeFormSchema.d.ts +26 -0
- package/dist/components/UNSTABLE_Hooks/form/composeFormSchema.js +24 -0
- package/dist/components/UNSTABLE_Hooks/form/composeFormSchema.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/composeSubmitHandler.d.ts +53 -0
- package/dist/components/UNSTABLE_Hooks/form/composeSubmitHandler.js +34 -0
- package/dist/components/UNSTABLE_Hooks/form/composeSubmitHandler.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/composeSubmitHandler.test.d.ts +1 -0
- package/dist/components/UNSTABLE_Hooks/form/deriveFieldsMetadata.d.ts +3 -0
- package/dist/components/UNSTABLE_Hooks/form/deriveFieldsMetadata.js +14 -0
- package/dist/components/UNSTABLE_Hooks/form/deriveFieldsMetadata.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/deriveFieldsMetadata.test.d.ts +1 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/CheckboxHookField.d.ts +11 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/CheckboxHookField.js +34 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/CheckboxHookField.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/DatePickerHookField.d.ts +11 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/DatePickerHookField.js +34 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/DatePickerHookField.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/NumberInputHookField.d.ts +14 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/NumberInputHookField.js +40 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/NumberInputHookField.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/RadioGroupHookField.d.ts +12 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/RadioGroupHookField.js +40 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/RadioGroupHookField.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/SelectHookField.d.ts +12 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/SelectHookField.js +40 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/SelectHookField.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/SwitchHookField.d.ts +11 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/SwitchHookField.js +34 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/SwitchHookField.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/TextInputHookField.d.ts +13 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/TextInputHookField.js +38 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/TextInputHookField.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/index.d.ts +15 -0
- package/dist/components/UNSTABLE_Hooks/form/getFieldWithOptions.d.ts +2 -0
- package/dist/components/UNSTABLE_Hooks/form/getFieldWithOptions.js +8 -0
- package/dist/components/UNSTABLE_Hooks/form/getFieldWithOptions.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/getFormSubmissionValues.d.ts +18 -0
- package/dist/components/UNSTABLE_Hooks/form/getFormSubmissionValues.js +10 -0
- package/dist/components/UNSTABLE_Hooks/form/getFormSubmissionValues.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/getFormSubmissionValues.test.d.ts +1 -0
- package/dist/components/UNSTABLE_Hooks/form/index.d.ts +16 -0
- package/dist/components/UNSTABLE_Hooks/form/resolveFieldError.d.ts +4 -0
- package/dist/components/UNSTABLE_Hooks/form/resolveFieldError.js +13 -0
- package/dist/components/UNSTABLE_Hooks/form/resolveFieldError.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/resolveRequiredFields.d.ts +6 -0
- package/dist/components/UNSTABLE_Hooks/form/resolveRequiredFields.js +14 -0
- package/dist/components/UNSTABLE_Hooks/form/resolveRequiredFields.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/types.d.ts +27 -0
- package/dist/components/UNSTABLE_Hooks/form/useFieldErrorMessage.d.ts +2 -0
- package/dist/components/UNSTABLE_Hooks/form/useFieldErrorMessage.js +17 -0
- package/dist/components/UNSTABLE_Hooks/form/useFieldErrorMessage.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/useFieldsMetadata.d.ts +4 -0
- package/dist/components/UNSTABLE_Hooks/form/useFieldsMetadata.js +8 -0
- package/dist/components/UNSTABLE_Hooks/form/useFieldsMetadata.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/useHookFieldResolution.d.ts +23 -0
- package/dist/components/UNSTABLE_Hooks/form/useHookFieldResolution.js +11 -0
- package/dist/components/UNSTABLE_Hooks/form/useHookFieldResolution.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/withOptions.d.ts +5 -0
- package/dist/components/UNSTABLE_Hooks/form/withOptions.js +7 -0
- package/dist/components/UNSTABLE_Hooks/form/withOptions.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/CompensationForm.d.ts +5 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/CompensationForm.js +149 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/CompensationForm.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/compensationSchema.d.ts +97 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/compensationSchema.js +121 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/compensationSchema.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/fields.d.ts +34 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/fields.js +50 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/fields.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/index.d.ts +7 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.d.ts +104 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.js +259 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/EmployeeDetailsForm.d.ts +5 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/EmployeeDetailsForm.js +112 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/EmployeeDetailsForm.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/employeeDetailsSchema.d.ts +39 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/employeeDetailsSchema.js +45 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/employeeDetailsSchema.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/fields.d.ts +23 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/fields.js +46 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/fields.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/index.d.ts +7 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/useEmployeeDetailsForm.d.ts +77 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/useEmployeeDetailsForm.js +153 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/useEmployeeDetailsForm.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/WorkAddressForm.d.ts +5 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/WorkAddressForm.js +69 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/WorkAddressForm.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/fields.d.ts +10 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/fields.js +14 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/fields.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/index.d.ts +7 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/useWorkAddressForm.d.ts +68 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/useWorkAddressForm.js +129 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/useWorkAddressForm.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/workAddressSchema.d.ts +25 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/workAddressSchema.js +24 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/workAddressSchema.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/index.d.ts +9 -0
- package/dist/components/UNSTABLE_Hooks/types.d.ts +49 -0
- package/dist/components/UNSTABLE_Hooks/useErrorHandling.d.ts +9 -0
- package/dist/components/UNSTABLE_Hooks/useErrorHandling.js +12 -0
- package/dist/components/UNSTABLE_Hooks/useErrorHandling.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/useErrorHandling.test.d.ts +1 -0
- package/dist/contexts/ApiProvider/ApiProvider.js +11 -11
- package/dist/contexts/ApiProvider/ApiProvider.js.map +1 -1
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +43 -50
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/contexts/LoadingIndicatorProvider/useLoadingIndicator.d.ts +10 -2
- package/dist/contexts/LoadingIndicatorProvider/useLoadingIndicator.js.map +1 -1
- package/dist/contexts/ObservabilityProvider/index.d.ts +1 -1
- package/dist/contexts/ObservabilityProvider/sanitization.d.ts +0 -14
- package/dist/contexts/ObservabilityProvider/sanitization.js +51 -51
- package/dist/contexts/ObservabilityProvider/sanitization.js.map +1 -1
- package/dist/contexts/ObservabilityProvider/useSanitizedObservability.d.ts +0 -3
- package/dist/contexts/ObservabilityProvider/useSanitizedObservability.js.map +1 -1
- package/dist/contexts/ThemeProvider/useTheme.js.map +1 -1
- package/dist/helpers/requiredIf.d.ts +13 -0
- package/dist/helpers/requiredIf.js +8 -0
- package/dist/helpers/requiredIf.js.map +1 -0
- package/dist/i18n/I18n.js +7 -7
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Company.TimeOff.CreateTimeOffPolicy.json.js +26 -0
- package/dist/i18n/en/Company.TimeOff.CreateTimeOffPolicy.json.js.map +1 -0
- package/dist/i18n/en/Company.TimeOff.HolidayPolicy.json.js +24 -0
- package/dist/i18n/en/Company.TimeOff.HolidayPolicy.json.js.map +1 -0
- package/dist/i18n/en/Company.TimeOff.TimeOffPolicies.json.js +32 -0
- package/dist/i18n/en/Company.TimeOff.TimeOffPolicies.json.js.map +1 -0
- package/dist/i18n/en/Company.TimeOff.TimeOffPolicyDetails.json.js +52 -0
- package/dist/i18n/en/Company.TimeOff.TimeOffPolicyDetails.json.js.map +1 -0
- package/dist/i18n/en/Company.TimeOff.TimeOffRequests.json.js +21 -0
- package/dist/i18n/en/Company.TimeOff.TimeOffRequests.json.js.map +1 -0
- package/dist/i18n/en/Employee.Terminations.TerminateEmployee.json.js +18 -0
- package/dist/i18n/en/Employee.Terminations.TerminateEmployee.json.js.map +1 -0
- package/dist/i18n/en/Employee.Terminations.TerminationFlow.json.js +12 -0
- package/dist/i18n/en/Employee.Terminations.TerminationFlow.json.js.map +1 -0
- package/dist/i18n/en/Employee.Terminations.TerminationSummary.json.js +20 -0
- package/dist/i18n/en/Employee.Terminations.TerminationSummary.json.js.map +1 -0
- package/dist/i18n/en/Payroll.Dismissal.json.js +22 -0
- package/dist/i18n/en/Payroll.Dismissal.json.js.map +1 -0
- package/dist/i18n/en/Payroll.GrossUpModal.json.js +16 -14
- package/dist/i18n/en/Payroll.GrossUpModal.json.js.map +1 -1
- package/dist/i18n/en/Payroll.OffCycleCreation.json.js +15 -11
- package/dist/i18n/en/Payroll.OffCycleCreation.json.js.map +1 -1
- package/dist/i18n/en/Payroll.OffCyclePayPeriodDateForm.json.js +1 -1
- package/dist/i18n/en/Payroll.OffCycleTaxWithholding.json.js +5 -5
- package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js +31 -25
- package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js.map +1 -1
- package/dist/i18n/en/Payroll.PayrollList.json.js +20 -18
- package/dist/i18n/en/Payroll.PayrollList.json.js.map +1 -1
- package/dist/i18n/en/Payroll.Transition.json.js +8 -0
- package/dist/i18n/en/Payroll.Transition.json.js.map +1 -0
- package/dist/i18n/en/Payroll.TransitionCreation.json.js +26 -0
- package/dist/i18n/en/Payroll.TransitionCreation.json.js.map +1 -0
- package/dist/i18n/en/Payroll.TransitionPayrollAlert.json.js +18 -0
- package/dist/i18n/en/Payroll.TransitionPayrollAlert.json.js.map +1 -0
- package/dist/i18n/en/UNSTABLE.CompensationForm.json.js +58 -0
- package/dist/i18n/en/UNSTABLE.CompensationForm.json.js.map +1 -0
- package/dist/i18n/en/UNSTABLE.EmployeeDetailsForm.json.js +34 -0
- package/dist/i18n/en/UNSTABLE.EmployeeDetailsForm.json.js.map +1 -0
- package/dist/i18n/en/UNSTABLE.WorkAddressForm.json.js +24 -0
- package/dist/i18n/en/UNSTABLE.WorkAddressForm.json.js.map +1 -0
- package/dist/i18n/en/common.json.d.ts +2 -1
- package/dist/i18n/en/common.json.js +9 -9
- package/dist/index.d.ts +3 -2
- package/dist/index.js +14 -13
- package/dist/models/WA_RISK_CODES.d.ts +5 -2866
- package/dist/models/WA_RISK_CODES.js.map +1 -1
- package/dist/shared/constants.d.ts +32 -0
- package/dist/shared/constants.js +83 -65
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +707 -1
- package/dist/types/observability.d.ts +31 -65
- package/dist/types/sdkError.d.ts +97 -0
- package/dist/types/sdkError.js +95 -0
- package/dist/types/sdkError.js.map +1 -0
- package/dist/types/sdkError.test.d.ts +1 -0
- package/docs/reference/endpoint-inventory.json +212 -14
- package/package.json +17 -17
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfiguration.d.ts +0 -6
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfiguration.js +0 -70
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfiguration.js.map +0 -1
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationContext.d.ts +0 -7
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationContext.js +0 -6
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationContext.js.map +0 -1
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationProvider.d.ts +0 -9
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationProvider.js +0 -40
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationProvider.js.map +0 -1
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/index.d.ts +0 -5
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/usePayrollConfiguration.d.ts +0 -2
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/usePayrollConfiguration.js +0 -12
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/usePayrollConfiguration.js.map +0 -1
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/index.d.ts +0 -2
- package/dist/contexts/ObservabilityProvider/observabilityUtils.d.ts +0 -5
- package/dist/contexts/ObservabilityProvider/observabilityUtils.js +0 -45
- package/dist/contexts/ObservabilityProvider/observabilityUtils.js.map +0 -1
package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js.map
CHANGED
|
@@ -1 +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,IAA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AAAA,YACb,SAASnC,GAAgB,UAAU,WAAW;AAAA,YAC9C,MAAMA,GAAgB,UAAU,QAAQ;AAAA,YACxC,OAAOA,GAAgB,UAAU,SAAS;AAAA,YAC1C,KAAKA,GAAgB,UAAU,cAAc;AAAA,UAG/C,CAAC;AAAA,UACA;AAAA,UACAoC,EAAkBpC,GAAgB,UAAU,WAAW;AAAA,QAAA,EAAA,CAC1D;AAAA,MAAA,EAAA,CACF;AAAA,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;"}
|
|
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,IAA+B,CAAC;AAAA,EAC3C,SAAAC;AAAA,EACA,YAAAC;AAAA,EACA,WAAAC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,UAAA;AAAA,QAC9C;AAAA,QAEF,MAAMuB;AAAA,QACN,OAAOnB,EAAE,SAAS,EAAE,gBAAAO,GAAgB;AAAA,MAAA;AAAA,IAAA;AAAA,EACtC,GACF;AAEJ;"}
|
|
@@ -3,15 +3,13 @@ import { useTranslation as T } from "react-i18next";
|
|
|
3
3
|
import { useMemo as x } from "react";
|
|
4
4
|
import { getContractorDisplayName as C } from "../CreatePayment/helpers.js";
|
|
5
5
|
import { Flex as s } from "../../../Common/Flex/Flex.js";
|
|
6
|
-
import "classnames";
|
|
7
|
-
import "../../../../shared/constants.js";
|
|
8
6
|
import { useComponentContext as M } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
9
7
|
import { useI18n as S } from "../../../../i18n/I18n.js";
|
|
10
8
|
import { formatHoursDisplay as v } from "../../../Payroll/helpers.js";
|
|
11
9
|
import H from "../../../../hooks/useNumberFormatter.js";
|
|
12
10
|
import { ConfirmWireDetails as $ } from "../../../Payroll/ConfirmWireDetails/ConfirmWireDetails.js";
|
|
13
11
|
import { DataView as b } from "../../../Common/DataView/DataView.js";
|
|
14
|
-
const k = "0.000",
|
|
12
|
+
const k = "0.000", U = ({
|
|
15
13
|
contractorPaymentGroup: m,
|
|
16
14
|
contractors: p,
|
|
17
15
|
bankAccount: y,
|
|
@@ -133,6 +131,6 @@ const k = "0.000", Y = ({
|
|
|
133
131
|
] });
|
|
134
132
|
};
|
|
135
133
|
export {
|
|
136
|
-
|
|
134
|
+
U as PaymentSummaryPresentation
|
|
137
135
|
};
|
|
138
136
|
//# sourceMappingURL=PaymentSummaryPresentation.js.map
|
package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaymentSummaryPresentation.js","sources":["../../../../../src/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type { ContractorPaymentGroup } from '@gusto/embedded-api/models/components/contractorpaymentgroup'\nimport type { ContractorPaymentForGroup } from '@gusto/embedded-api/models/components/contractorpaymentforgroup'\nimport { useMemo } from 'react'\nimport type { Contractor } from '@gusto/embedded-api/models/components/contractor'\nimport type { CompanyBankAccount } from '@gusto/embedded-api/models/components/companybankaccount'\nimport type { InternalAlert } from '../types'\nimport { getContractorDisplayName } from '../CreatePayment/helpers'\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 { ConfirmWireDetails } from '@/components/Payroll/ConfirmWireDetails'\nimport type { EventType } from '@/shared/constants'\n\nconst ZERO_HOURS_DISPLAY = '0.000'\n\ninterface PaymentSummaryPresentationProps {\n contractorPaymentGroup: ContractorPaymentGroup\n contractors: Contractor[]\n bankAccount?: CompanyBankAccount\n companyId: string\n wireInRequestUuid?: string\n onEvent: (type: EventType, data?: unknown) => void\n onDone: () => void\n alerts?: InternalAlert[]\n}\n\nexport const PaymentSummaryPresentation = ({\n contractorPaymentGroup,\n contractors,\n bankAccount,\n companyId,\n wireInRequestUuid,\n onEvent,\n onDone,\n alerts = [],\n}: PaymentSummaryPresentationProps) => {\n const { Button, Text, Heading, Alert } = useComponentContext()\n useI18n('Contractor.Payments.PaymentSummary')\n const { t } = useTranslation('Contractor.Payments.PaymentSummary')\n const currencyFormatter = useNumberFormatter()\n\n const formatWageType = (contractor: ContractorPaymentForGroup) => {\n if (contractor.wageType === 'Hourly' && contractor.hourlyRate) {\n return `Hourly ${currencyFormatter(Number(contractor.hourlyRate))}/hr`\n }\n return contractor.wageType\n }\n\n const contractorPayments = contractorPaymentGroup.contractorPayments || []\n\n const totals = useMemo(() => {\n if (contractorPayments.length === 0) {\n return { wageAmount: 0, bonusAmount: 0, reimbursementAmount: 0, totalAmount: 0 }\n }\n return contractorPayments.reduce(\n (acc, contractor) => {\n acc.wageAmount += Number(contractor.wage || '0')\n acc.bonusAmount += Number(contractor.bonus || '0')\n acc.reimbursementAmount += Number(contractor.reimbursement || '0')\n acc.totalAmount += Number(contractor.wageTotal || '0')\n return acc\n },\n { wageAmount: 0, bonusAmount: 0, reimbursementAmount: 0, totalAmount: 0 },\n )\n }, [contractorPayments])\n\n return (\n <Flex flexDirection=\"column\" gap={32}>\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 {typeof alert.content === 'string'\n ? t(`alerts.${alert.content}` as never)\n : (alert.content ?? null)}\n </Alert>\n ))}\n </Flex>\n )}\n\n <Alert status=\"success\" label={t('successTitle')}>\n <Text>\n {t('successMessage', {\n count: contractorPayments.length,\n })}\n </Text>\n </Alert>\n\n {wireInRequestUuid && (\n <ConfirmWireDetails companyId={companyId} wireInId={wireInRequestUuid} onEvent={onEvent} />\n )}\n\n <Flex justifyContent=\"space-between\" alignItems=\"flex-start\">\n <Flex flexDirection=\"column\" gap={2}>\n <Heading as=\"h2\">{t('summaryTitle')}</Heading>\n <Text variant=\"supporting\">\n {t('summarySubtitle', { debitDate: contractorPaymentGroup.debitDate })}\n </Text>\n </Flex>\n <Button onClick={onDone} variant=\"primary\">\n {t('doneCta')}\n </Button>\n </Flex>\n\n {/* Payment Summary Table */}\n <DataView\n columns={[\n {\n title: t('totalAmount'),\n render: () => (\n <Text>{currencyFormatter(Number(contractorPaymentGroup.totals?.amount || '0'))}</Text>\n ),\n },\n {\n title: t('debitAmount'),\n render: () => (\n <Text>\n {currencyFormatter(Number(contractorPaymentGroup.totals?.debitAmount || '0'))}\n </Text>\n ),\n },\n {\n title: t('debitAccount'),\n render: () => <Text>{bankAccount?.hiddenAccountNumber ?? t('notAvailable')}</Text>,\n },\n {\n title: t('debitDate'),\n render: () => <Text>{contractorPaymentGroup.debitDate || t('notAvailable')}</Text>,\n },\n {\n title: t('contractorPayDate'),\n render: () => <Text>{contractorPaymentGroup.checkDate || t('notAvailable')}</Text>,\n },\n ]}\n data={[contractorPaymentGroup]}\n label={t('paymentSummaryTitle')}\n />\n\n {/* Contractor Payments Table */}\n {contractorPayments.length > 0 && (\n <DataView\n columns={[\n {\n title: t('contractor'),\n render: contractorPayment => (\n <Text>\n {getContractorDisplayName(\n contractors.find(\n contractor => contractor.uuid === contractorPayment.contractorUuid,\n ),\n )}\n </Text>\n ),\n },\n {\n title: t('wageType'),\n render: contractorPayment => <Text>{formatWageType(contractorPayment)}</Text>,\n },\n {\n title: t('paymentMethod'),\n render: contractorPayment => (\n <Text>\n {contractorPayment.paymentMethod === 'Direct Deposit'\n ? t('paymentMethods.directDeposit')\n : contractorPayment.paymentMethod === 'Check'\n ? t('paymentMethods.check')\n : contractorPayment.paymentMethod || t('notAvailable')}\n </Text>\n ),\n },\n {\n title: t('hours'),\n render: contractorPayment => (\n <Text>\n {contractorPayment.wageType === 'Hourly' && contractorPayment.hours\n ? formatHoursDisplay(parseFloat(contractorPayment.hours))\n : ZERO_HOURS_DISPLAY}\n </Text>\n ),\n },\n {\n title: t('wage'),\n render: contractorPayment => (\n <Text>{currencyFormatter(Number(contractorPayment.wage || '0'))}</Text>\n ),\n },\n {\n title: t('bonus'),\n render: contractorPayment => (\n <Text>{currencyFormatter(Number(contractorPayment.bonus || '0'))}</Text>\n ),\n },\n {\n title: t('reimbursement'),\n render: contractorPayment => (\n <Text>{currencyFormatter(Number(contractorPayment.reimbursement || '0'))}</Text>\n ),\n },\n {\n title: t('total'),\n render: contractorPayment => (\n <Text>{currencyFormatter(Number(contractorPayment.wageTotal || '0'))}</Text>\n ),\n },\n ]}\n data={contractorPayments}\n footer={() => ({\n 'column-0': <Text weight=\"bold\">{t('totalsLabel')}</Text>,\n 'column-4': <Text>{currencyFormatter(totals.wageAmount || 0)}</Text>,\n 'column-5': <Text>{currencyFormatter(totals.bonusAmount || 0)}</Text>,\n 'column-6': <Text>{currencyFormatter(totals.reimbursementAmount || 0)}</Text>,\n 'column-7': <Text>{currencyFormatter(totals.totalAmount || 0)}</Text>,\n })}\n label={t('contractorPaymentsTitle')}\n />\n )}\n </Flex>\n )\n}\n"],"names":["ZERO_HOURS_DISPLAY","PaymentSummaryPresentation","contractorPaymentGroup","contractors","bankAccount","companyId","wireInRequestUuid","onEvent","onDone","alerts","Button","Text","Heading","Alert","useComponentContext","useI18n","useTranslation","currencyFormatter","useNumberFormatter","formatWageType","contractor","contractorPayments","totals","useMemo","acc","jsxs","Flex","jsx","alert","index","ConfirmWireDetails","DataView","contractorPayment","getContractorDisplayName","formatHoursDisplay"],"mappings":";;;;;;;;;;;;;AAgBA,MAAMA,IAAqB,SAadC,IAA6B,CAAC;AAAA,EACzC,wBAAAC;AAAA,EACA,aAAAC;AAAA,EACA,aAAAC;AAAA,EACA,WAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,SAAAC;AAAA,EACA,QAAAC;AAAA,EACA,QAAAC,IAAS,CAAA;AACX,MAAuC;AACrC,QAAM,EAAE,QAAAC,GAAQ,MAAAC,GAAM,SAAAC,GAAS,OAAAC,EAAA,IAAUC,EAAA;AACzC,EAAAC,EAAQ,oCAAoC;AAC5C,QAAM,EAAE,EAAA,IAAMC,EAAe,oCAAoC,GAC3DC,IAAoBC,EAAA,GAEpBC,IAAiB,CAACC,MAClBA,EAAW,aAAa,YAAYA,EAAW,aAC1C,UAAUH,EAAkB,OAAOG,EAAW,UAAU,CAAC,CAAC,QAE5DA,EAAW,UAGdC,IAAqBnB,EAAuB,sBAAsB,CAAA,GAElEoB,IAASC,EAAQ,MACjBF,EAAmB,WAAW,IACzB,EAAE,YAAY,GAAG,aAAa,GAAG,qBAAqB,GAAG,aAAa,EAAA,IAExEA,EAAmB;AAAA,IACxB,CAACG,GAAKJ,OACJI,EAAI,cAAc,OAAOJ,EAAW,QAAQ,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CAAC,EAAA,CAAE;AAAA,UAAA;AAAA,UAGrE;AAAA,YACE,OAAO,EAAE,eAAe;AAAA,YACxB,QAAQ,CAAAA,MACN,gBAAAL,EAAChB,GAAA,EAAM,UAAAM,EAAkB,OAAOe,EAAkB,iBAAiB,GAAG,CAAC,EAAA,CAAE;AAAA,UAAA;AAAA,UAG7E;AAAA,YACE,OAAO,EAAE,OAAO;AAAA,YAChB,QAAQ,CAAAA,MACN,gBAAAL,EAAChB,GAAA,EAAM,UAAAM,EAAkB,OAAOe,EAAkB,aAAa,GAAG,CAAC,EAAA,CAAE;AAAA,UAAA;AAAA,QAEzE;AAAA,QAEF,MAAMX;AAAA,QACN,QAAQ,OAAO;AAAA,UACb,YAAY,gBAAAM,EAAChB,GAAA,EAAK,QAAO,QAAQ,UAAA,EAAE,aAAa,GAAE;AAAA,UAClD,YAAY,gBAAAgB,EAAChB,GAAA,EAAM,YAAkBW,EAAO,cAAc,CAAC,GAAE;AAAA,UAC7D,YAAY,gBAAAK,EAAChB,GAAA,EAAM,YAAkBW,EAAO,eAAe,CAAC,GAAE;AAAA,UAC9D,YAAY,gBAAAK,EAAChB,GAAA,EAAM,YAAkBW,EAAO,uBAAuB,CAAC,GAAE;AAAA,UACtE,YAAY,gBAAAK,EAAChB,GAAA,EAAM,YAAkBW,EAAO,eAAe,CAAC,EAAA,CAAE;AAAA,QAAA;AAAA,QAEhE,OAAO,EAAE,yBAAyB;AAAA,MAAA;AAAA,IAAA;AAAA,EACpC,GAEJ;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"PaymentSummaryPresentation.js","sources":["../../../../../src/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type { ContractorPaymentGroup } from '@gusto/embedded-api/models/components/contractorpaymentgroup'\nimport type { ContractorPaymentForGroup } from '@gusto/embedded-api/models/components/contractorpaymentforgroup'\nimport { useMemo } from 'react'\nimport type { Contractor } from '@gusto/embedded-api/models/components/contractor'\nimport type { CompanyBankAccount } from '@gusto/embedded-api/models/components/companybankaccount'\nimport type { InternalAlert } from '../types'\nimport { getContractorDisplayName } from '../CreatePayment/helpers'\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 { ConfirmWireDetails } from '@/components/Payroll/ConfirmWireDetails'\nimport type { EventType } from '@/shared/constants'\n\nconst ZERO_HOURS_DISPLAY = '0.000'\n\ninterface PaymentSummaryPresentationProps {\n contractorPaymentGroup: ContractorPaymentGroup\n contractors: Contractor[]\n bankAccount?: CompanyBankAccount\n companyId: string\n wireInRequestUuid?: string\n onEvent: (type: EventType, data?: unknown) => void\n onDone: () => void\n alerts?: InternalAlert[]\n}\n\nexport const PaymentSummaryPresentation = ({\n contractorPaymentGroup,\n contractors,\n bankAccount,\n companyId,\n wireInRequestUuid,\n onEvent,\n onDone,\n alerts = [],\n}: PaymentSummaryPresentationProps) => {\n const { Button, Text, Heading, Alert } = useComponentContext()\n useI18n('Contractor.Payments.PaymentSummary')\n const { t } = useTranslation('Contractor.Payments.PaymentSummary')\n const currencyFormatter = useNumberFormatter()\n\n const formatWageType = (contractor: ContractorPaymentForGroup) => {\n if (contractor.wageType === 'Hourly' && contractor.hourlyRate) {\n return `Hourly ${currencyFormatter(Number(contractor.hourlyRate))}/hr`\n }\n return contractor.wageType\n }\n\n const contractorPayments = contractorPaymentGroup.contractorPayments || []\n\n const totals = useMemo(() => {\n if (contractorPayments.length === 0) {\n return { wageAmount: 0, bonusAmount: 0, reimbursementAmount: 0, totalAmount: 0 }\n }\n return contractorPayments.reduce(\n (acc, contractor) => {\n acc.wageAmount += Number(contractor.wage || '0')\n acc.bonusAmount += Number(contractor.bonus || '0')\n acc.reimbursementAmount += Number(contractor.reimbursement || '0')\n acc.totalAmount += Number(contractor.wageTotal || '0')\n return acc\n },\n { wageAmount: 0, bonusAmount: 0, reimbursementAmount: 0, totalAmount: 0 },\n )\n }, [contractorPayments])\n\n return (\n <Flex flexDirection=\"column\" gap={32}>\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 {typeof alert.content === 'string'\n ? t(`alerts.${alert.content}` as never)\n : (alert.content ?? null)}\n </Alert>\n ))}\n </Flex>\n )}\n\n <Alert status=\"success\" label={t('successTitle')}>\n <Text>\n {t('successMessage', {\n count: contractorPayments.length,\n })}\n </Text>\n </Alert>\n\n {wireInRequestUuid && (\n <ConfirmWireDetails companyId={companyId} wireInId={wireInRequestUuid} onEvent={onEvent} />\n )}\n\n <Flex justifyContent=\"space-between\" alignItems=\"flex-start\">\n <Flex flexDirection=\"column\" gap={2}>\n <Heading as=\"h2\">{t('summaryTitle')}</Heading>\n <Text variant=\"supporting\">\n {t('summarySubtitle', { debitDate: contractorPaymentGroup.debitDate })}\n </Text>\n </Flex>\n <Button onClick={onDone} variant=\"primary\">\n {t('doneCta')}\n </Button>\n </Flex>\n\n {/* Payment Summary Table */}\n <DataView\n columns={[\n {\n title: t('totalAmount'),\n render: () => (\n <Text>{currencyFormatter(Number(contractorPaymentGroup.totals?.amount || '0'))}</Text>\n ),\n },\n {\n title: t('debitAmount'),\n render: () => (\n <Text>\n {currencyFormatter(Number(contractorPaymentGroup.totals?.debitAmount || '0'))}\n </Text>\n ),\n },\n {\n title: t('debitAccount'),\n render: () => <Text>{bankAccount?.hiddenAccountNumber ?? t('notAvailable')}</Text>,\n },\n {\n title: t('debitDate'),\n render: () => <Text>{contractorPaymentGroup.debitDate || t('notAvailable')}</Text>,\n },\n {\n title: t('contractorPayDate'),\n render: () => <Text>{contractorPaymentGroup.checkDate || t('notAvailable')}</Text>,\n },\n ]}\n data={[contractorPaymentGroup]}\n label={t('paymentSummaryTitle')}\n />\n\n {/* Contractor Payments Table */}\n {contractorPayments.length > 0 && (\n <DataView\n columns={[\n {\n title: t('contractor'),\n render: contractorPayment => (\n <Text>\n {getContractorDisplayName(\n contractors.find(\n contractor => contractor.uuid === contractorPayment.contractorUuid,\n ),\n )}\n </Text>\n ),\n },\n {\n title: t('wageType'),\n render: contractorPayment => <Text>{formatWageType(contractorPayment)}</Text>,\n },\n {\n title: t('paymentMethod'),\n render: contractorPayment => (\n <Text>\n {contractorPayment.paymentMethod === 'Direct Deposit'\n ? t('paymentMethods.directDeposit')\n : contractorPayment.paymentMethod === 'Check'\n ? t('paymentMethods.check')\n : contractorPayment.paymentMethod || t('notAvailable')}\n </Text>\n ),\n },\n {\n title: t('hours'),\n render: contractorPayment => (\n <Text>\n {contractorPayment.wageType === 'Hourly' && contractorPayment.hours\n ? formatHoursDisplay(parseFloat(contractorPayment.hours))\n : ZERO_HOURS_DISPLAY}\n </Text>\n ),\n },\n {\n title: t('wage'),\n render: contractorPayment => (\n <Text>{currencyFormatter(Number(contractorPayment.wage || '0'))}</Text>\n ),\n },\n {\n title: t('bonus'),\n render: contractorPayment => (\n <Text>{currencyFormatter(Number(contractorPayment.bonus || '0'))}</Text>\n ),\n },\n {\n title: t('reimbursement'),\n render: contractorPayment => (\n <Text>{currencyFormatter(Number(contractorPayment.reimbursement || '0'))}</Text>\n ),\n },\n {\n title: t('total'),\n render: contractorPayment => (\n <Text>{currencyFormatter(Number(contractorPayment.wageTotal || '0'))}</Text>\n ),\n },\n ]}\n data={contractorPayments}\n footer={() => ({\n 'column-0': <Text weight=\"bold\">{t('totalsLabel')}</Text>,\n 'column-4': <Text>{currencyFormatter(totals.wageAmount || 0)}</Text>,\n 'column-5': <Text>{currencyFormatter(totals.bonusAmount || 0)}</Text>,\n 'column-6': <Text>{currencyFormatter(totals.reimbursementAmount || 0)}</Text>,\n 'column-7': <Text>{currencyFormatter(totals.totalAmount || 0)}</Text>,\n })}\n label={t('contractorPaymentsTitle')}\n />\n )}\n </Flex>\n )\n}\n"],"names":["ZERO_HOURS_DISPLAY","PaymentSummaryPresentation","contractorPaymentGroup","contractors","bankAccount","companyId","wireInRequestUuid","onEvent","onDone","alerts","Button","Text","Heading","Alert","useComponentContext","useI18n","useTranslation","currencyFormatter","useNumberFormatter","formatWageType","contractor","contractorPayments","totals","useMemo","acc","jsxs","Flex","jsx","alert","index","ConfirmWireDetails","DataView","contractorPayment","getContractorDisplayName","formatHoursDisplay"],"mappings":";;;;;;;;;;;AAgBA,MAAMA,IAAqB,SAadC,IAA6B,CAAC;AAAA,EACzC,wBAAAC;AAAA,EACA,aAAAC;AAAA,EACA,aAAAC;AAAA,EACA,WAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,SAAAC;AAAA,EACA,QAAAC;AAAA,EACA,QAAAC,IAAS,CAAA;AACX,MAAuC;AACrC,QAAM,EAAE,QAAAC,GAAQ,MAAAC,GAAM,SAAAC,GAAS,OAAAC,EAAA,IAAUC,EAAA;AACzC,EAAAC,EAAQ,oCAAoC;AAC5C,QAAM,EAAE,EAAA,IAAMC,EAAe,oCAAoC,GAC3DC,IAAoBC,EAAA,GAEpBC,IAAiB,CAACC,MAClBA,EAAW,aAAa,YAAYA,EAAW,aAC1C,UAAUH,EAAkB,OAAOG,EAAW,UAAU,CAAC,CAAC,QAE5DA,EAAW,UAGdC,IAAqBnB,EAAuB,sBAAsB,CAAA,GAElEoB,IAASC,EAAQ,MACjBF,EAAmB,WAAW,IACzB,EAAE,YAAY,GAAG,aAAa,GAAG,qBAAqB,GAAG,aAAa,EAAA,IAExEA,EAAmB;AAAA,IACxB,CAACG,GAAKJ,OACJI,EAAI,cAAc,OAAOJ,EAAW,QAAQ,GAAG,GAC/CI,EAAI,eAAe,OAAOJ,EAAW,SAAS,GAAG,GACjDI,EAAI,uBAAuB,OAAOJ,EAAW,iBAAiB,GAAG,GACjEI,EAAI,eAAe,OAAOJ,EAA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AM,EAAkB,OAAOe,EAAkB,iBAAiB,GAAG,CAAC,EAAA,CAAE;AAAA,UAAA;AAAA,UAG7E;AAAA,YACE,OAAO,EAAE,OAAO;AAAA,YAChB,QAAQ,CAAAA,MACN,gBAAAL,EAAChB,GAAA,EAAM,UAAAM,EAAkB,OAAOe,EAAkB,aAAa,GAAG,CAAC,EAAA,CAAE;AAAA,UAAA;AAAA,QAEzE;AAAA,QAEF,MAAMX;AAAA,QACN,QAAQ,OAAO;AAAA,UACb,YAAY,gBAAAM,EAAChB,GAAA,EAAK,QAAO,QAAQ,UAAA,EAAE,aAAa,GAAE;AAAA,UAClD,YAAY,gBAAAgB,EAAChB,GAAA,EAAM,YAAkBW,EAAO,cAAc,CAAC,GAAE;AAAA,UAC7D,YAAY,gBAAAK,EAAChB,GAAA,EAAM,YAAkBW,EAAO,eAAe,CAAC,GAAE;AAAA,UAC9D,YAAY,gBAAAK,EAAChB,GAAA,EAAM,YAAkBW,EAAO,uBAAuB,CAAC,GAAE;AAAA,UACtE,YAAY,gBAAAK,EAAChB,GAAA,EAAM,YAAkBW,EAAO,eAAe,CAAC,EAAA,CAAE;AAAA,QAAA;AAAA,QAEhE,OAAO,EAAE,yBAAyB;AAAA,MAAA;AAAA,IAAA;AAAA,EACpC,GAEJ;AAEJ;"}
|
|
@@ -2,12 +2,9 @@ import { jsx as e, jsxs as o } from "react/jsx-runtime";
|
|
|
2
2
|
import { useTranslation as N } from "react-i18next";
|
|
3
3
|
import u from "./PaymentsListPresentation.module.scss.js";
|
|
4
4
|
import { Flex as i } from "../../../Common/Flex/Flex.js";
|
|
5
|
-
import "classnames";
|
|
6
|
-
import "../../../../shared/constants.js";
|
|
7
5
|
import { EmptyData as $ } from "../../../Common/EmptyData/EmptyData.js";
|
|
8
6
|
import { ActionsLayout as F } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
9
7
|
import { useComponentContext as j } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
10
|
-
import "react";
|
|
11
8
|
import { useI18n as k } from "../../../../i18n/I18n.js";
|
|
12
9
|
import R from "../../../../hooks/useNumberFormatter.js";
|
|
13
10
|
import S from "../../../../assets/icons/eye.svg.js";
|
|
@@ -15,7 +12,7 @@ import { useDateFormatter as T } from "../../../../hooks/useDateFormatter.js";
|
|
|
15
12
|
import { ConfirmWireDetails as V } from "../../../Payroll/ConfirmWireDetails/ConfirmWireDetails.js";
|
|
16
13
|
import { useDataView as I } from "../../../Common/DataView/useDataView.js";
|
|
17
14
|
import { DataView as M } from "../../../Common/DataView/DataView.js";
|
|
18
|
-
const
|
|
15
|
+
const Z = ({
|
|
19
16
|
contractorPayments: d,
|
|
20
17
|
numberOfMonths: p,
|
|
21
18
|
onCreatePayment: s,
|
|
@@ -117,6 +114,6 @@ const et = ({
|
|
|
117
114
|
] });
|
|
118
115
|
};
|
|
119
116
|
export {
|
|
120
|
-
|
|
117
|
+
Z as PaymentsListPresentation
|
|
121
118
|
};
|
|
122
119
|
//# sourceMappingURL=PaymentsListPresentation.js.map
|
|
@@ -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'\nimport { ConfirmWireDetails } from '@/components/Payroll/ConfirmWireDetails'\nimport type { EventType } from '@/shared/constants'\nimport type { PaginationControlProps } from '@/components/Common/PaginationControl/PaginationControlTypes'\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 companyId: string\n hasUnresolvedWireInRequests: boolean\n onEvent: (type: EventType, data?: unknown) => void\n paginationProps?: PaginationControlProps\n}\n\nexport const PaymentsListPresentation = ({\n contractorPayments,\n numberOfMonths,\n onCreatePayment,\n onDateRangeChange,\n onViewPayment,\n alerts = [],\n companyId,\n hasUnresolvedWireInRequests,\n onEvent,\n paginationProps,\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 ]\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 pagination: paginationProps,\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 {hasUnresolvedWireInRequests && (\n <ConfirmWireDetails companyId={companyId} onEvent={onEvent} />\n )}\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 <Flex flexDirection=\"column\" gap={12}>\n {typeof alert.content === 'string'\n ? t(`alerts.${alert.content}` as never)\n : (alert.content ?? null)}\n {alert.onAction && alert.actionLabel && (\n <div>\n <Button variant=\"secondary\" onClick={alert.onAction}>\n {t(`alerts.${alert.actionLabel}` as never)}\n </Button>\n </div>\n )}\n </Flex>\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","companyId","hasUnresolvedWireInRequests","onEvent","paginationProps","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","ConfirmWireDetails","alert","index","styles","value","DataView"],"mappings":"
|
|
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'\nimport { ConfirmWireDetails } from '@/components/Payroll/ConfirmWireDetails'\nimport type { EventType } from '@/shared/constants'\nimport type { PaginationControlProps } from '@/components/Common/PaginationControl/PaginationControlTypes'\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 companyId: string\n hasUnresolvedWireInRequests: boolean\n onEvent: (type: EventType, data?: unknown) => void\n paginationProps?: PaginationControlProps\n}\n\nexport const PaymentsListPresentation = ({\n contractorPayments,\n numberOfMonths,\n onCreatePayment,\n onDateRangeChange,\n onViewPayment,\n alerts = [],\n companyId,\n hasUnresolvedWireInRequests,\n onEvent,\n paginationProps,\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 ]\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 pagination: paginationProps,\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 {hasUnresolvedWireInRequests && (\n <ConfirmWireDetails companyId={companyId} onEvent={onEvent} />\n )}\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 <Flex flexDirection=\"column\" gap={12}>\n {typeof alert.content === 'string'\n ? t(`alerts.${alert.content}` as never)\n : (alert.content ?? null)}\n {alert.onAction && alert.actionLabel && (\n <div>\n <Button variant=\"secondary\" onClick={alert.onAction}>\n {t(`alerts.${alert.actionLabel}` as never)}\n </Button>\n </div>\n )}\n </Flex>\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","companyId","hasUnresolvedWireInRequests","onEvent","paginationProps","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","ConfirmWireDetails","alert","index","styles","value","DataView"],"mappings":";;;;;;;;;;;;;;AA2BO,MAAMA,IAA2B,CAAC;AAAA,EACvC,oBAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,eAAAC;AAAA,EACA,QAAAC,IAAS,CAAA;AAAA,EACT,WAAAC;A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A,CAAe;AAAA,EAAA,GACrD;AAEJ;"}
|
|
@@ -6,15 +6,15 @@ import { useComponentContext as D } from "../../../contexts/ComponentAdapter/use
|
|
|
6
6
|
import { useI18n as I } from "../../../i18n/I18n.js";
|
|
7
7
|
import { Form as O } from "../../Common/Form/Form.js";
|
|
8
8
|
import { Grid as n } from "../../Common/Grid/Grid.js";
|
|
9
|
+
import { usePlaceholderSSN as x, normalizeSSN as w } from "../../../helpers/ssn.js";
|
|
10
|
+
import { usePlaceholderEin as E, normalizeEin as j } from "../../../helpers/federalEin.js";
|
|
11
|
+
import { ContractorOnboardingStatus as v } from "../../../shared/constants.js";
|
|
9
12
|
import { TextInputField as l } from "../../Common/Fields/TextInputField/TextInputField.js";
|
|
10
|
-
import { NumberInputField as x } from "../../Common/Fields/NumberInputField/NumberInputField.js";
|
|
11
13
|
import { RadioGroupField as d } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import { ContractorOnboardingStatus as A } from "../../../shared/constants.js";
|
|
17
|
-
import { Flex as B } from "../../Common/Flex/Flex.js";
|
|
14
|
+
import { NumberInputField as G } from "../../Common/Fields/NumberInputField/NumberInputField.js";
|
|
15
|
+
import { Flex as z } from "../../Common/Flex/Flex.js";
|
|
16
|
+
import { SwitchField as A } from "../../Common/Fields/SwitchField/SwitchField.js";
|
|
17
|
+
import { DatePickerField as B } from "../../Common/Fields/DatePickerField/DatePickerField.js";
|
|
18
18
|
function re({
|
|
19
19
|
formMethods: u,
|
|
20
20
|
handleSubmit: f,
|
|
@@ -33,7 +33,7 @@ function re({
|
|
|
33
33
|
}) {
|
|
34
34
|
const a = D();
|
|
35
35
|
I("Contractor.Profile");
|
|
36
|
-
const { t: e } = T("Contractor.Profile"), q =
|
|
36
|
+
const { t: e } = T("Contractor.Profile"), q = x(t?.hasSsn ?? !1), P = E(t?.hasEin ?? !1);
|
|
37
37
|
return /* @__PURE__ */ i("section", { className: F, children: /* @__PURE__ */ i(S, { ...u, children: /* @__PURE__ */ r(O, { onSubmit: f, children: [
|
|
38
38
|
/* @__PURE__ */ r(n, { gridTemplateColumns: "1fr", gap: 24, className: "mb-8", children: [
|
|
39
39
|
/* @__PURE__ */ r("header", { children: [
|
|
@@ -42,12 +42,12 @@ function re({
|
|
|
42
42
|
] }),
|
|
43
43
|
/* @__PURE__ */ i("div", { className: C.switchFieldContainer, children: /* @__PURE__ */ r(n, { gap: 16, children: [
|
|
44
44
|
/* @__PURE__ */ i(
|
|
45
|
-
|
|
45
|
+
A,
|
|
46
46
|
{
|
|
47
47
|
name: "selfOnboarding",
|
|
48
48
|
label: e("fields.selfOnboarding.label"),
|
|
49
49
|
description: e("fields.selfOnboarding.description"),
|
|
50
|
-
isDisabled: t && t.onboardingStatus !==
|
|
50
|
+
isDisabled: t && t.onboardingStatus !== v.ADMIN_ONBOARDING_INCOMPLETE
|
|
51
51
|
}
|
|
52
52
|
),
|
|
53
53
|
p && /* @__PURE__ */ i(
|
|
@@ -81,7 +81,7 @@ function re({
|
|
|
81
81
|
name: "ssn",
|
|
82
82
|
label: e("fields.ssn.label"),
|
|
83
83
|
placeholder: q,
|
|
84
|
-
transform:
|
|
84
|
+
transform: w,
|
|
85
85
|
isRequired: !0
|
|
86
86
|
}
|
|
87
87
|
)
|
|
@@ -101,7 +101,7 @@ function re({
|
|
|
101
101
|
name: "ein",
|
|
102
102
|
label: e("fields.ein.label"),
|
|
103
103
|
placeholder: P,
|
|
104
|
-
transform:
|
|
104
|
+
transform: j,
|
|
105
105
|
isRequired: !0
|
|
106
106
|
}
|
|
107
107
|
)
|
|
@@ -116,7 +116,7 @@ function re({
|
|
|
116
116
|
}
|
|
117
117
|
),
|
|
118
118
|
h && /* @__PURE__ */ i(
|
|
119
|
-
|
|
119
|
+
G,
|
|
120
120
|
{
|
|
121
121
|
name: "hourlyRate",
|
|
122
122
|
label: e("fields.hourlyRate.label"),
|
|
@@ -126,7 +126,7 @@ function re({
|
|
|
126
126
|
}
|
|
127
127
|
),
|
|
128
128
|
/* @__PURE__ */ i(
|
|
129
|
-
|
|
129
|
+
B,
|
|
130
130
|
{
|
|
131
131
|
name: "startDate",
|
|
132
132
|
label: e("fields.startDate.label"),
|
|
@@ -135,7 +135,7 @@ function re({
|
|
|
135
135
|
}
|
|
136
136
|
)
|
|
137
137
|
] }),
|
|
138
|
-
/* @__PURE__ */ i(
|
|
138
|
+
/* @__PURE__ */ i(z, { gap: 12, justifyContent: "flex-end", children: /* @__PURE__ */ i(a.Button, { type: "submit", variant: "primary", isDisabled: o.isSubmitting, children: o.isSubmitting ? e(s ? "buttons.updating" : "buttons.creating") : e(s ? "buttons.update" : "buttons.create") }) })
|
|
139
139
|
] }) }) });
|
|
140
140
|
}
|
|
141
141
|
export {
|
|
@@ -3,25 +3,26 @@ import { useTranslation as X } from "react-i18next";
|
|
|
3
3
|
import { zodResolver as $ } from "@hookform/resolvers/zod";
|
|
4
4
|
import { useForm as j, useWatch as v } from "react-hook-form";
|
|
5
5
|
import { z as s } from "zod";
|
|
6
|
-
import { useContractorsCreateMutation as
|
|
7
|
-
import { useContractorsUpdateMutation as
|
|
8
|
-
import { ContractorWageType as
|
|
6
|
+
import { useContractorsCreateMutation as K } from "@gusto/embedded-api/react-query/contractorsCreate";
|
|
7
|
+
import { useContractorsUpdateMutation as L } from "@gusto/embedded-api/react-query/contractorsUpdate";
|
|
8
|
+
import { ContractorWageType as k, ContractorType as J } from "@gusto/embedded-api/models/components/contractor";
|
|
9
9
|
import "react/jsx-runtime";
|
|
10
10
|
import "react-error-boundary";
|
|
11
|
-
import "@gusto/embedded-api/models/errors/gustoembeddederror";
|
|
12
|
-
import "@gusto/embedded-api/models/errors/sdkvalidationerror";
|
|
13
11
|
import "@tanstack/react-query";
|
|
14
12
|
import { useBase as Q } from "../../Base/useBase.js";
|
|
15
|
-
import
|
|
16
|
-
import "
|
|
13
|
+
import "@gusto/embedded-api/models/errors/apierror";
|
|
14
|
+
import "@gusto/embedded-api/models/errors/gustoembeddederror";
|
|
15
|
+
import "@gusto/embedded-api/models/errors/sdkvalidationerror";
|
|
16
|
+
import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
|
|
17
|
+
import { SDKInternalError as Y } from "../../../types/sdkError.js";
|
|
18
|
+
import { ContractorSelfOnboardingStatuses as x, componentEvents as b, ContractorOnboardingStatus as ee } from "../../../shared/constants.js";
|
|
17
19
|
import "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
18
|
-
import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
19
|
-
import { removeNonDigits as ee } from "../../../helpers/formattedStrings.js";
|
|
20
20
|
import { useI18n as oe } from "../../../i18n/I18n.js";
|
|
21
|
-
import { SSN_REGEX as se, NAME_REGEX as
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
|
|
21
|
+
import { SSN_REGEX as se, NAME_REGEX as N } from "../../../helpers/validations.js";
|
|
22
|
+
import { removeNonDigits as ae } from "../../../helpers/formattedStrings.js";
|
|
23
|
+
import { formatDateToStringDate as te } from "../../../helpers/dateFormatting.js";
|
|
24
|
+
import { normalizeEin as ne } from "../../../helpers/federalEin.js";
|
|
25
|
+
const i = k, a = J, ie = s.object({
|
|
25
26
|
// Self-onboarding toggle
|
|
26
27
|
selfOnboarding: s.boolean(),
|
|
27
28
|
email: s.string().email().optional(),
|
|
@@ -30,16 +31,16 @@ const i = J, a = K, ne = s.object({
|
|
|
30
31
|
wageType: s.enum([i.Hourly, i.Fixed]),
|
|
31
32
|
startDate: s.date(),
|
|
32
33
|
// Individual contractor fields
|
|
33
|
-
firstName: s.string().min(1).regex(
|
|
34
|
+
firstName: s.string().min(1).regex(N).optional(),
|
|
34
35
|
middleInitial: s.string().optional(),
|
|
35
|
-
lastName: s.string().min(1).regex(
|
|
36
|
+
lastName: s.string().min(1).regex(N).optional(),
|
|
36
37
|
ssn: s.string().optional(),
|
|
37
38
|
// Business contractor fields
|
|
38
39
|
businessName: s.string().optional(),
|
|
39
40
|
ein: s.string().optional(),
|
|
40
41
|
// Wage fields
|
|
41
42
|
hourlyRate: s.number().min(0).optional()
|
|
42
|
-
}),
|
|
43
|
+
}), re = (t, f, m) => ie.superRefine(
|
|
43
44
|
(e, n) => {
|
|
44
45
|
if (e.selfOnboarding && !e.email && n.addIssue({
|
|
45
46
|
code: s.ZodIssueCode.custom,
|
|
@@ -61,7 +62,7 @@ const i = J, a = K, ne = s.object({
|
|
|
61
62
|
message: t("validations.ssn")
|
|
62
63
|
});
|
|
63
64
|
else {
|
|
64
|
-
const l =
|
|
65
|
+
const l = ae(e.ssn);
|
|
65
66
|
se.test(l) || n.addIssue({
|
|
66
67
|
code: s.ZodIssueCode.custom,
|
|
67
68
|
path: ["ssn"],
|
|
@@ -80,7 +81,7 @@ const i = J, a = K, ne = s.object({
|
|
|
80
81
|
message: t("validations.ein")
|
|
81
82
|
});
|
|
82
83
|
else {
|
|
83
|
-
const l =
|
|
84
|
+
const l = ne(e.ein);
|
|
84
85
|
/^\d{2}-\d{7}$/.test(l) || n.addIssue({
|
|
85
86
|
code: s.ZodIssueCode.custom,
|
|
86
87
|
path: ["ein"],
|
|
@@ -94,18 +95,18 @@ const i = J, a = K, ne = s.object({
|
|
|
94
95
|
});
|
|
95
96
|
}
|
|
96
97
|
);
|
|
97
|
-
function
|
|
98
|
+
function Be({
|
|
98
99
|
companyId: t,
|
|
99
100
|
contractorId: f,
|
|
100
101
|
defaultValues: m,
|
|
101
102
|
existingContractor: e
|
|
102
103
|
}) {
|
|
103
104
|
oe("Contractor.Profile");
|
|
104
|
-
const { t: n } = X("Contractor.Profile"), { onEvent: l, baseSubmitHandler:
|
|
105
|
+
const { t: n } = X("Contractor.Profile"), { onEvent: l, baseSubmitHandler: g } = Q(), T = re(
|
|
105
106
|
n,
|
|
106
107
|
e?.hasSsn ?? !1,
|
|
107
108
|
e?.hasEin ?? !1
|
|
108
|
-
), { mutateAsync:
|
|
109
|
+
), { mutateAsync: S, isPending: R } = K(), { mutateAsync: w, isPending: O } = L(), D = V(
|
|
109
110
|
() => ({
|
|
110
111
|
selfOnboarding: !1,
|
|
111
112
|
contractorType: a.Business,
|
|
@@ -116,7 +117,7 @@ function Pe({
|
|
|
116
117
|
...e && {
|
|
117
118
|
selfOnboarding: e.onboardingStatus ? (
|
|
118
119
|
// @ts-expect-error: onboarding_status during runtime can be one of self onboarding statuses
|
|
119
|
-
|
|
120
|
+
x.has(e.onboardingStatus)
|
|
120
121
|
) : !1,
|
|
121
122
|
contractorType: e.type || a.Business,
|
|
122
123
|
wageType: e.wageType || i.Fixed,
|
|
@@ -139,11 +140,11 @@ function Pe({
|
|
|
139
140
|
}), { handleSubmit: E, formState: F } = d, u = v({ control: d.control, name: "contractorType" }), P = v({ control: d.control, name: "wageType" }), y = v({
|
|
140
141
|
control: d.control,
|
|
141
142
|
name: "selfOnboarding"
|
|
142
|
-
}),
|
|
143
|
+
}), I = (o) => {
|
|
143
144
|
const r = {
|
|
144
145
|
type: o.contractorType,
|
|
145
146
|
wageType: o.wageType,
|
|
146
|
-
startDate:
|
|
147
|
+
startDate: te(o.startDate) || "",
|
|
147
148
|
selfOnboarding: o.selfOnboarding,
|
|
148
149
|
email: o.selfOnboarding ? o.email : void 0,
|
|
149
150
|
hourlyRate: o.wageType === i.Hourly ? String(o.hourlyRate) : void 0,
|
|
@@ -165,14 +166,14 @@ function Pe({
|
|
|
165
166
|
ein: o.ein?.replace(/-/g, "")
|
|
166
167
|
};
|
|
167
168
|
}, C = (o, r) => ({
|
|
168
|
-
...
|
|
169
|
+
...I(o),
|
|
169
170
|
version: r
|
|
170
171
|
}), B = async (o) => {
|
|
171
|
-
await
|
|
172
|
+
await g(o, async (r) => {
|
|
172
173
|
let c = e?.uuid;
|
|
173
174
|
if (e) {
|
|
174
175
|
if (!e.version)
|
|
175
|
-
throw new
|
|
176
|
+
throw new Y("Contractor version is required for updates");
|
|
176
177
|
const h = e.version, p = C(r, h), G = await w({
|
|
177
178
|
request: {
|
|
178
179
|
contractorUuid: c,
|
|
@@ -181,7 +182,7 @@ function Pe({
|
|
|
181
182
|
});
|
|
182
183
|
l(b.CONTRACTOR_UPDATED, G.contractor);
|
|
183
184
|
} else {
|
|
184
|
-
const h =
|
|
185
|
+
const h = I(r), p = await S({
|
|
185
186
|
request: {
|
|
186
187
|
companyUuid: t,
|
|
187
188
|
contractorCreateRequestBody: h
|
|
@@ -190,7 +191,7 @@ function Pe({
|
|
|
190
191
|
c = p.contractor?.uuid, l(b.CONTRACTOR_CREATED, p.contractor);
|
|
191
192
|
}
|
|
192
193
|
l(b.CONTRACTOR_PROFILE_DONE, {
|
|
193
|
-
selfOnboarding: r.selfOnboarding && e?.onboardingStatus !==
|
|
194
|
+
selfOnboarding: r.selfOnboarding && e?.onboardingStatus !== ee.ADMIN_ONBOARDING_REVIEW,
|
|
194
195
|
contractorId: c
|
|
195
196
|
});
|
|
196
197
|
});
|
|
@@ -200,7 +201,7 @@ function Pe({
|
|
|
200
201
|
], W = [
|
|
201
202
|
{ label: "Hourly", value: i.Hourly },
|
|
202
203
|
{ label: "Fixed", value: i.Fixed }
|
|
203
|
-
], z =
|
|
204
|
+
], z = R || O;
|
|
204
205
|
return {
|
|
205
206
|
// Form methods and submission
|
|
206
207
|
formMethods: d,
|
|
@@ -226,7 +227,7 @@ function Pe({
|
|
|
226
227
|
export {
|
|
227
228
|
a as ContractorType,
|
|
228
229
|
i as WageType,
|
|
229
|
-
|
|
230
|
-
|
|
230
|
+
re as createContractorProfileValidationSchema,
|
|
231
|
+
Be as useContractorProfile
|
|
231
232
|
};
|
|
232
233
|
//# sourceMappingURL=useContractorProfile.js.map
|