@gusto/embedded-react-sdk 0.20.0 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +31 -0
- package/dist/UNSTABLE_Hooks.d.ts +1 -0
- package/dist/UNSTABLE_Hooks.js +9 -0
- package/dist/UNSTABLE_Hooks.js.map +1 -0
- package/dist/assets/icons/coins-hand.svg.js +10 -0
- package/dist/assets/icons/coins-hand.svg.js.map +1 -0
- package/dist/components/Base/Base.d.ts +19 -4
- package/dist/components/Base/Base.js +67 -61
- package/dist/components/Base/Base.js.map +1 -1
- package/dist/components/Base/useBase.d.ts +1 -1
- package/dist/components/Base/useBase.js.map +1 -1
- package/dist/components/Base/useBaseSubmit.d.ts +10 -0
- package/dist/components/Base/useBaseSubmit.js +33 -0
- package/dist/components/Base/useBaseSubmit.js.map +1 -0
- package/dist/components/Common/Fields/TextAreaField/TextAreaField.d.ts +5 -0
- package/dist/components/Common/Fields/TextAreaField/TextAreaField.js +34 -0
- package/dist/components/Common/Fields/TextAreaField/TextAreaField.js.map +1 -0
- package/dist/components/Common/Fields/TextAreaField/index.d.ts +3 -0
- package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.js +10 -10
- package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureForm.js +14 -11
- package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormActions.js +9 -7
- package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormFields.js +15 -12
- package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
- package/dist/components/Common/UI/Alert/Alert.js +23 -22
- package/dist/components/Common/UI/Alert/Alert.js.map +1 -1
- package/dist/components/Common/UI/Alert/AlertTypes.d.ts +4 -0
- package/dist/components/Common/UI/Alert/AlertTypes.js.map +1 -1
- package/dist/components/Common/UI/DatePicker/DatePicker.d.ts +1 -1
- package/dist/components/Common/UI/DatePicker/DatePicker.js +38 -37
- package/dist/components/Common/UI/DatePicker/DatePicker.js.map +1 -1
- package/dist/components/Common/UI/DatePicker/DatePickerTypes.d.ts +4 -0
- package/dist/components/Common/UI/Modal/Modal.module.scss.js +17 -17
- package/dist/components/Common/UI/Select/Select.d.ts +1 -1
- package/dist/components/Common/UI/Select/Select.js +27 -26
- package/dist/components/Common/UI/Select/Select.js.map +1 -1
- package/dist/components/Common/UI/Select/SelectTypes.d.ts +4 -0
- package/dist/components/Common/UI/TextArea/TextArea.d.ts +2 -0
- package/dist/components/Common/UI/TextArea/TextArea.js +79 -0
- package/dist/components/Common/UI/TextArea/TextArea.js.map +1 -0
- package/dist/components/Common/UI/TextArea/TextArea.module.scss.js +12 -0
- package/dist/components/Common/UI/TextArea/TextArea.module.scss.js.map +1 -0
- package/dist/components/Common/UI/TextArea/TextAreaTypes.d.ts +37 -0
- package/dist/components/Common/UI/TextArea/TextAreaTypes.js +9 -0
- package/dist/components/Common/UI/TextArea/TextAreaTypes.js.map +1 -0
- package/dist/components/Common/UI/TextArea/index.d.ts +4 -0
- package/dist/components/Company/AssignSignatory/AssignSignatory.js +8 -6
- package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +5 -2
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +4 -2
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +9 -7
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +12 -12
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +5 -4
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +4 -2
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +12 -10
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +6 -6
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +5 -4
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/TitleSelect.js +6 -4
- package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +7 -6
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +10 -9
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js +11 -8
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +5 -4
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js +10 -8
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +10 -8
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +7 -4
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +4 -2
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +11 -9
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +5 -4
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +10 -8
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +5 -4
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Actions.js +9 -7
- package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Company/FederalTaxes/FederalTaxes.js +5 -3
- package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Form.js +7 -6
- package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +7 -6
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Actions.js +9 -7
- package/dist/components/Company/Industry/Actions.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +8 -7
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Industry/Edit.js +7 -4
- package/dist/components/Company/Industry/Edit.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Actions.js +10 -8
- package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Form.js +7 -6
- package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/LocationForm.js +12 -10
- package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +5 -4
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/Actions.js +8 -6
- package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/List.js +16 -15
- package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +4 -3
- package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +5 -4
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/Completed.js +12 -10
- package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js +11 -9
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +9 -7
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +5 -4
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/PaySchedule.js +5 -4
- package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Actions.js +11 -9
- package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Edit.js +23 -24
- package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Head.js +13 -11
- package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/List.js +18 -17
- package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
- package/dist/components/Company/PaySchedule/usePaySchedule.js +7 -6
- package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +4 -2
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +5 -4
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +4 -2
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js +4 -2
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +5 -4
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Contractor/Address/Address.js +7 -5
- package/dist/components/Contractor/Address/Address.js.map +1 -1
- package/dist/components/Contractor/Address/Form.js +8 -7
- package/dist/components/Contractor/Address/Form.js.map +1 -1
- package/dist/components/Contractor/Address/useAddress.js +7 -6
- package/dist/components/Contractor/Address/useAddress.js.map +1 -1
- package/dist/components/Contractor/ContractorList/index.js +15 -15
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +13 -10
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +5 -3
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.d.ts +15 -0
- package/dist/components/Contractor/Payments/Detail/DetailPresentation.d.ts +19 -0
- package/dist/components/Contractor/Payments/Overview/OverviewPresentation.d.ts +18 -0
- package/dist/components/Contractor/Payments/PaymentEdit/PaymentEditPresentation.d.ts +6 -0
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.d.ts +18 -0
- package/dist/components/Contractor/Payments/types.d.ts +4 -0
- package/dist/components/Contractor/Profile/ContractorProfileForm.js +13 -13
- package/dist/components/Contractor/Profile/useContractorProfile.js +1 -1
- package/dist/components/Contractor/Submit/Submit.js +21 -20
- package/dist/components/Contractor/Submit/Submit.js.map +1 -1
- package/dist/components/Employee/Compensation/Actions.js +14 -13
- package/dist/components/Employee/Compensation/Actions.js.map +1 -1
- package/dist/components/Employee/Compensation/Edit.js +14 -14
- package/dist/components/Employee/Compensation/List.js +23 -22
- package/dist/components/Employee/Compensation/List.js.map +1 -1
- package/dist/components/Employee/Deductions/Deductions.d.ts +1 -1
- package/dist/components/Employee/Deductions/Deductions.js +10 -10
- package/dist/components/Employee/Deductions/Deductions.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsComponents.d.ts +2 -0
- package/dist/components/Employee/Deductions/DeductionsComponents.js +6 -6
- package/dist/components/Employee/Deductions/DeductionsComponents.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +222 -0
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -0
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.module.scss.js +8 -0
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.module.scss.js.map +1 -0
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.d.ts +2 -2
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +165 -0
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -0
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.d.ts +0 -34
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js +90 -127
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.module.scss.js +14 -0
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.module.scss.js.map +1 -0
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +55 -55
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js.map +1 -1
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.d.ts +6 -0
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js +53 -0
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js.map +1 -0
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.module.scss.js +14 -0
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.module.scss.js.map +1 -0
- package/dist/components/Employee/Deductions/stateMachine.js +49 -29
- package/dist/components/Employee/Deductions/stateMachine.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +8 -6
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +5 -3
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js +5 -2
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +5 -4
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +5 -3
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +5 -4
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Employee/EmployeeList/Actions.js +8 -6
- package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
- package/dist/components/Employee/EmployeeList/EmployeeList.js +6 -3
- package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
- package/dist/components/Employee/EmployeeList/Head.js +7 -5
- package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
- package/dist/components/Employee/EmployeeList/List.js +14 -14
- package/dist/components/Employee/EmployeeList/useEmployeeList.js +5 -4
- package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/Actions.js +9 -7
- package/dist/components/Employee/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/FederalForm.js +13 -11
- package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +5 -4
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Employee/Landing/Landing.js +11 -10
- 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 -6
- package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +6 -4
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js +12 -11
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +8 -6
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/Split.js +8 -8
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +7 -6
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
- package/dist/components/Employee/Profile/Actions.js +9 -7
- package/dist/components/Employee/Profile/Actions.js.map +1 -1
- package/dist/components/Employee/Profile/AdminPersonalDetails.js +10 -8
- package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
- package/dist/components/Employee/Profile/HomeAddress.js +2 -2
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js +26 -24
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
- package/dist/components/Employee/Profile/useProfile.js +5 -4
- package/dist/components/Employee/Profile/useProfile.js.map +1 -1
- package/dist/components/Employee/StateTaxes/Actions.js +10 -8
- package/dist/components/Employee/StateTaxes/Actions.js.map +1 -1
- package/dist/components/Employee/StateTaxes/useStateTaxes.js +5 -4
- package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
- package/dist/components/Employee/Taxes/Actions.js +10 -8
- package/dist/components/Employee/Taxes/Actions.js.map +1 -1
- package/dist/components/Employee/Taxes/FederalForm.js +14 -12
- package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/Taxes/useTaxes.js +5 -4
- package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
- package/dist/components/Flow/Flow.js +23 -21
- package/dist/components/Flow/Flow.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.d.ts +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js +58 -36
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.d.ts +2 -0
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.js +71 -54
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsComponents.d.ts +23 -0
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsComponents.js +27 -15
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsComponents.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.d.ts +25 -2
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +153 -23
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.module.scss.js +10 -0
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.module.scss.js.map +1 -0
- package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.d.ts +9 -1
- package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.js +195 -22
- package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.module.scss.js +18 -0
- package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.module.scss.js.map +1 -0
- package/dist/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.d.ts +10 -2
- package/dist/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.js +39 -25
- package/dist/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/index.d.ts +1 -0
- package/dist/components/Payroll/ConfirmWireDetails/types.d.ts +5 -0
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +8 -6
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +8 -6
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +27 -28
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +56 -57
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +9 -8
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.d.ts +0 -12
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.js +44 -52
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.d.ts +9 -6
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +96 -93
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollList.js +58 -59
- package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.d.ts +4 -6
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +81 -72
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +8 -8
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchThresholdExceeded.js +4 -2
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchThresholdExceeded.js.map +1 -1
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +3 -2
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollStatusBadges/PayrollStatusBadges.d.ts +7 -0
- package/dist/components/Payroll/PayrollStatusBadges/PayrollStatusBadges.js +19 -0
- package/dist/components/Payroll/PayrollStatusBadges/PayrollStatusBadges.js.map +1 -0
- package/dist/components/Payroll/PayrollStatusBadges/PayrollStatusBadges.module.scss.js +10 -0
- package/dist/components/Payroll/PayrollStatusBadges/PayrollStatusBadges.module.scss.js.map +1 -0
- package/dist/components/Payroll/PayrollStatusBadges/index.d.ts +4 -0
- package/dist/components/Payroll/PayrollStatusBadges/payrollStatusConfig.d.ts +33 -0
- package/dist/components/Payroll/PayrollStatusBadges/payrollStatusConfig.js +161 -0
- package/dist/components/Payroll/PayrollStatusBadges/payrollStatusConfig.js.map +1 -0
- package/dist/components/Payroll/PayrollStatusBadges/usePayrollStatusBadges.d.ts +3 -0
- package/dist/components/Payroll/PayrollStatusBadges/usePayrollStatusBadges.js +17 -0
- package/dist/components/Payroll/PayrollStatusBadges/usePayrollStatusBadges.js.map +1 -0
- package/dist/components/Payroll/PayrollStatusBadges/usePayrollStatusBadges.test.d.ts +1 -0
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfiguration.d.ts +6 -0
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfiguration.js +70 -0
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfiguration.js.map +1 -0
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationContext.d.ts +7 -0
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationContext.js +6 -0
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationContext.js.map +1 -0
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationProvider.d.ts +9 -0
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationProvider.js +40 -0
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationProvider.js.map +1 -0
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/index.d.ts +5 -0
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/usePayrollConfiguration.d.ts +2 -0
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/usePayrollConfiguration.js +12 -0
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/usePayrollConfiguration.js.map +1 -0
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/index.d.ts +2 -0
- package/dist/components/Payroll/helpers.d.ts +0 -5
- package/dist/components/Payroll/helpers.js +106 -112
- package/dist/components/Payroll/helpers.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.js +8 -7
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js +48 -46
- package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js.map +1 -1
- package/dist/contexts/ComponentAdapter/useComponentContext.d.ts +2 -0
- package/dist/contexts/ComponentAdapter/useComponentContext.js +3 -3
- package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +8 -5
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/helpers/dateFormatting.d.ts +9 -0
- package/dist/helpers/dateFormatting.js +65 -52
- package/dist/helpers/dateFormatting.js.map +1 -1
- package/dist/helpers/formattedStrings.js +12 -11
- package/dist/helpers/formattedStrings.js.map +1 -1
- package/dist/i18n/I18n.js +10 -10
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/ContractorPayment.ContractorPaymentCreatePayment.json.js +32 -0
- package/dist/i18n/en/ContractorPayment.ContractorPaymentCreatePayment.json.js.map +1 -0
- package/dist/i18n/en/ContractorPayment.ContractorPaymentDetail.json.js +24 -0
- package/dist/i18n/en/ContractorPayment.ContractorPaymentDetail.json.js.map +1 -0
- package/dist/i18n/en/ContractorPayment.ContractorPaymentOverview.json.js +32 -0
- package/dist/i18n/en/ContractorPayment.ContractorPaymentOverview.json.js.map +1 -0
- package/dist/i18n/en/ContractorPayment.ContractorPaymentPaymentHistory.json.js +32 -0
- package/dist/i18n/en/ContractorPayment.ContractorPaymentPaymentHistory.json.js.map +1 -0
- package/dist/i18n/en/Payroll.Common.json.js +8 -0
- package/dist/i18n/en/Payroll.Common.json.js.map +1 -0
- package/dist/i18n/en/Payroll.ConfirmWireDetailsForm.json.js +25 -5
- package/dist/i18n/en/Payroll.ConfirmWireDetailsForm.json.js.map +1 -1
- package/dist/i18n/en/Payroll.PayrollList.json.js +14 -16
- package/dist/i18n/en/Payroll.PayrollList.json.js.map +1 -1
- package/dist/i18n/en/Payroll.WireInstructions.json.js +22 -6
- package/dist/i18n/en/Payroll.WireInstructions.json.js.map +1 -1
- package/dist/shared/constants.d.ts +6 -0
- package/dist/shared/constants.js +15 -12
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +183 -8
- package/package.json +11 -7
- package/dist/components/Employee/Deductions/DeductionsForm/UNSTABLE_DeductionsForm.d.ts +0 -7
- package/dist/components/Employee/Deductions/EmptyState/EmptyState.d.ts +0 -6
- package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.d.ts +0 -15
- package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.js +0 -49
- package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.21.0
|
|
4
|
+
|
|
5
|
+
### Features & Enhancements
|
|
6
|
+
|
|
7
|
+
- Update base submit to separate UI portions
|
|
8
|
+
- Implement advance payroll status badges
|
|
9
|
+
- Add wire transfer confirmation flow for payroll
|
|
10
|
+
- Add infrastructure for experimental payroll hooks
|
|
11
|
+
- Update wire in form to use selected wire in id
|
|
12
|
+
- Add Contractor Payment Create component
|
|
13
|
+
- Add Contractor Payment Detail component
|
|
14
|
+
- Add Contractor Payment Overview component
|
|
15
|
+
- Add Contractor Payment Edit component
|
|
16
|
+
- Add Contractor Payment History component
|
|
17
|
+
|
|
18
|
+
### Fixes
|
|
19
|
+
|
|
20
|
+
- Fixed modal button styling
|
|
21
|
+
- Update footer to right-align when single button
|
|
22
|
+
|
|
23
|
+
### Chores & Maintenance
|
|
24
|
+
|
|
25
|
+
- Swap in new deductions/child support form components
|
|
26
|
+
- Bump msw from 2.12.2 to 2.12.3
|
|
27
|
+
- Bump @types/react from 19.2.6 to 19.2.7
|
|
28
|
+
- Bump typescript-eslint from 8.47.0 to 8.48.0
|
|
29
|
+
- Bump react-hook-form from 7.66.1 to 7.67.0
|
|
30
|
+
- Bump i18next from 25.6.3 to 25.7.1
|
|
31
|
+
- Bump mdast-util-to-hast from 13.2.0 to 13.2.1
|
|
32
|
+
- Bump tsx from 4.20.6 to 4.21.0
|
|
33
|
+
|
|
3
34
|
## 0.20.0
|
|
4
35
|
|
|
5
36
|
### Features & Enhancements
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PayrollConfiguration, PayrollConfigurationProvider, usePayrollConfiguration, type PayrollConfigurationContextValue, } from './components/Payroll/UNSTABLE_PayrollHooks';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PayrollConfiguration as i } from "./components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfiguration.js";
|
|
2
|
+
import { PayrollConfigurationProvider as f } from "./components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationProvider.js";
|
|
3
|
+
import { usePayrollConfiguration as n } from "./components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/usePayrollConfiguration.js";
|
|
4
|
+
export {
|
|
5
|
+
i as PayrollConfiguration,
|
|
6
|
+
f as PayrollConfigurationProvider,
|
|
7
|
+
n as usePayrollConfiguration
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=UNSTABLE_Hooks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UNSTABLE_Hooks.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as C from "react";
|
|
2
|
+
const o = ({
|
|
3
|
+
title: e,
|
|
4
|
+
titleId: t,
|
|
5
|
+
...n
|
|
6
|
+
}) => /* @__PURE__ */ C.createElement("svg", { width: 24, height: 25, viewBox: "0 0 24 25", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-labelledby": t, ...n }, e ? /* @__PURE__ */ C.createElement("title", { id: t }, e) : null, /* @__PURE__ */ C.createElement("path", { d: "M13.5295 8.85186C12.9571 9.25995 12.2566 9.5 11.5 9.5C9.567 9.5 8 7.933 8 6C8 4.067 9.567 2.5 11.5 2.5C12.753 2.5 13.8522 3.15842 14.4705 4.14814M6 20.5872H8.61029C8.95063 20.5872 9.28888 20.6277 9.61881 20.7086L12.3769 21.3789C12.9753 21.5247 13.5988 21.5388 14.2035 21.4214L17.253 20.8281C18.0585 20.6712 18.7996 20.2854 19.3803 19.7205L21.5379 17.6217C22.154 17.0234 22.154 16.0524 21.5379 15.4531C20.9832 14.9134 20.1047 14.8527 19.4771 15.3103L16.9626 17.1449C16.6025 17.4081 16.1643 17.5498 15.7137 17.5498H13.2855L14.8311 17.5498C15.7022 17.5498 16.4079 16.8633 16.4079 16.0159V15.7091C16.4079 15.0055 15.9156 14.392 15.2141 14.2219L12.8286 13.6417C12.4404 13.5476 12.0428 13.5 11.6431 13.5C10.6783 13.5 8.93189 14.2988 8.93189 14.2988L6 15.5249M20 7C20 8.933 18.433 10.5 16.5 10.5C14.567 10.5 13 8.933 13 7C13 5.067 14.567 3.5 16.5 3.5C18.433 3.5 20 5.067 20 7ZM2 15.1L2 20.9C2 21.4601 2 21.7401 2.10899 21.954C2.20487 22.1422 2.35785 22.2951 2.54601 22.391C2.75992 22.5 3.03995 22.5 3.6 22.5H4.4C4.96005 22.5 5.24008 22.5 5.45399 22.391C5.64215 22.2951 5.79513 22.1422 5.89101 21.954C6 21.7401 6 21.4601 6 20.9V15.1C6 14.5399 6 14.2599 5.89101 14.046C5.79513 13.8578 5.64215 13.7049 5.45399 13.609C5.24008 13.5 4.96005 13.5 4.4 13.5L3.6 13.5C3.03995 13.5 2.75992 13.5 2.54601 13.609C2.35785 13.7049 2.20487 13.8578 2.10899 14.046C2 14.2599 2 14.5399 2 15.1Z", stroke: "#414651", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }));
|
|
7
|
+
export {
|
|
8
|
+
o as default
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=coins-hand.svg.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coins-hand.svg.js","sources":["../../../src/assets/icons/coins-hand.svg?react"],"sourcesContent":["import * as React from \"react\";\nconst SvgCoinsHand = ({\n title,\n titleId,\n ...props\n}) => /* @__PURE__ */ React.createElement(\"svg\", { width: 24, height: 25, viewBox: \"0 0 24 25\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", \"aria-labelledby\": titleId, ...props }, title ? /* @__PURE__ */ React.createElement(\"title\", { id: titleId }, title) : null, /* @__PURE__ */ React.createElement(\"path\", { d: \"M13.5295 8.85186C12.9571 9.25995 12.2566 9.5 11.5 9.5C9.567 9.5 8 7.933 8 6C8 4.067 9.567 2.5 11.5 2.5C12.753 2.5 13.8522 3.15842 14.4705 4.14814M6 20.5872H8.61029C8.95063 20.5872 9.28888 20.6277 9.61881 20.7086L12.3769 21.3789C12.9753 21.5247 13.5988 21.5388 14.2035 21.4214L17.253 20.8281C18.0585 20.6712 18.7996 20.2854 19.3803 19.7205L21.5379 17.6217C22.154 17.0234 22.154 16.0524 21.5379 15.4531C20.9832 14.9134 20.1047 14.8527 19.4771 15.3103L16.9626 17.1449C16.6025 17.4081 16.1643 17.5498 15.7137 17.5498H13.2855L14.8311 17.5498C15.7022 17.5498 16.4079 16.8633 16.4079 16.0159V15.7091C16.4079 15.0055 15.9156 14.392 15.2141 14.2219L12.8286 13.6417C12.4404 13.5476 12.0428 13.5 11.6431 13.5C10.6783 13.5 8.93189 14.2988 8.93189 14.2988L6 15.5249M20 7C20 8.933 18.433 10.5 16.5 10.5C14.567 10.5 13 8.933 13 7C13 5.067 14.567 3.5 16.5 3.5C18.433 3.5 20 5.067 20 7ZM2 15.1L2 20.9C2 21.4601 2 21.7401 2.10899 21.954C2.20487 22.1422 2.35785 22.2951 2.54601 22.391C2.75992 22.5 3.03995 22.5 3.6 22.5H4.4C4.96005 22.5 5.24008 22.5 5.45399 22.391C5.64215 22.2951 5.79513 22.1422 5.89101 21.954C6 21.7401 6 21.4601 6 20.9V15.1C6 14.5399 6 14.2599 5.89101 14.046C5.79513 13.8578 5.64215 13.7049 5.45399 13.609C5.24008 13.5 4.96005 13.5 4.4 13.5L3.6 13.5C3.03995 13.5 2.75992 13.5 2.54601 13.609C2.35785 13.7049 2.20487 13.8578 2.10899 14.046C2 14.2599 2 14.5399 2 15.1Z\", stroke: \"#414651\", strokeWidth: 2, strokeLinecap: \"round\", strokeLinejoin: \"round\" }));\nexport default SvgCoinsHand;\n"],"names":["SvgCoinsHand","title","titleId","props","React"],"mappings":";AACK,MAACA,IAAe,CAAC;AAAA,EACpB,OAAAC;AAAA,EACA,SAAAC;AAAA,EACA,GAAGC;AACL,MAAsB,gBAAAC,EAAM,cAAc,OAAO,EAAE,OAAO,IAAI,QAAQ,IAAI,SAAS,aAAa,MAAM,QAAQ,OAAO,8BAA8B,mBAAmBF,GAAS,GAAGC,EAAK,GAAIF,IAAwB,gBAAAG,EAAM,cAAc,SAAS,EAAE,IAAIF,KAAWD,CAAK,IAAI,MAAsB,gBAAAG,EAAM,cAAc,QAAQ,EAAE,GAAG,01CAA01C,QAAQ,WAAW,aAAa,GAAG,eAAe,SAAS,gBAAgB,SAAS,CAAC;"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { ReactNode, JSX } from 'react';
|
|
1
|
+
import { ReactNode, JSX, ErrorInfo } from 'react';
|
|
2
2
|
import { FallbackProps } from 'react-error-boundary';
|
|
3
|
-
import {
|
|
3
|
+
import { EntityErrorObject } from '@gusto/embedded-api/models/components/entityerrorobject';
|
|
4
|
+
import { KnownErrors, OnEventType } from './useBase';
|
|
4
5
|
import { EventType } from '../../shared/constants';
|
|
5
6
|
import { ResourceDictionary, Resources } from '../../types/Helpers';
|
|
6
7
|
import { LoadingIndicatorContextProps } from '../../contexts/LoadingIndicatorProvider/useLoadingIndicator';
|
|
@@ -11,8 +12,22 @@ export interface CommonComponentInterface<TResourceKey extends keyof Resources =
|
|
|
11
12
|
dictionary?: ResourceDictionary<TResourceKey>;
|
|
12
13
|
}
|
|
13
14
|
export interface BaseComponentInterface<TResourceKey extends keyof Resources = keyof Resources> extends CommonComponentInterface<TResourceKey> {
|
|
14
|
-
FallbackComponent?:
|
|
15
|
-
LoaderComponent?:
|
|
15
|
+
FallbackComponent?: BaseBoundariesProps['FallbackComponent'];
|
|
16
|
+
LoaderComponent?: BaseBoundariesProps['LoaderComponent'];
|
|
16
17
|
onEvent: OnEventType<EventType, unknown>;
|
|
17
18
|
}
|
|
18
19
|
export declare const BaseComponent: <TResourceKey extends keyof Resources = keyof Resources>({ children, FallbackComponent, LoaderComponent: LoadingIndicatorFromProps, onEvent, }: BaseComponentInterface<TResourceKey>) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
interface BaseLayoutProps {
|
|
21
|
+
children?: ReactNode;
|
|
22
|
+
error: KnownErrors | null;
|
|
23
|
+
fieldErrors: Array<EntityErrorObject> | null;
|
|
24
|
+
}
|
|
25
|
+
export declare const BaseLayout: ({ children, error, fieldErrors }: BaseLayoutProps) => import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export interface BaseBoundariesProps {
|
|
27
|
+
children?: ReactNode;
|
|
28
|
+
FallbackComponent?: (props: FallbackProps) => JSX.Element;
|
|
29
|
+
LoaderComponent?: LoadingIndicatorContextProps['LoadingIndicator'];
|
|
30
|
+
onErrorBoundaryError?: (error: Error, info: ErrorInfo) => void;
|
|
31
|
+
}
|
|
32
|
+
export declare const BaseBoundaries: ({ children, FallbackComponent, LoaderComponent: LoadingIndicatorFromProps, onErrorBoundaryError, }: BaseBoundariesProps) => import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
export {};
|
|
@@ -1,74 +1,80 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import { ErrorBoundary as
|
|
4
|
-
import { useTranslation as
|
|
5
|
-
import { APIError as
|
|
6
|
-
import { SDKValidationError as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { componentEvents as
|
|
1
|
+
import { jsx as r, jsxs as d } from "react/jsx-runtime";
|
|
2
|
+
import { Suspense as C } from "react";
|
|
3
|
+
import { ErrorBoundary as E } from "react-error-boundary";
|
|
4
|
+
import { useTranslation as x } from "react-i18next";
|
|
5
|
+
import { APIError as B } from "@gusto/embedded-api/models/errors/apierror";
|
|
6
|
+
import { SDKValidationError as I } from "@gusto/embedded-api/models/errors/sdkvalidationerror";
|
|
7
|
+
import { QueryErrorResetBoundary as h } from "@tanstack/react-query";
|
|
8
|
+
import { FadeIn as g } from "../Common/FadeIn/FadeIn.js";
|
|
9
|
+
import { BaseContext as y } from "./useBase.js";
|
|
10
|
+
import { useBaseSubmit as b } from "./useBaseSubmit.js";
|
|
11
|
+
import { componentEvents as R } from "../../shared/constants.js";
|
|
12
12
|
import "classnames";
|
|
13
|
-
import { InternalError as
|
|
14
|
-
import { useComponentContext as
|
|
15
|
-
import { useLoadingIndicator as
|
|
16
|
-
import { renderErrorList as
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
onEvent: l
|
|
13
|
+
import { InternalError as c } from "../Common/InternalError/InternalError.js";
|
|
14
|
+
import { useComponentContext as S } from "../../contexts/ComponentAdapter/useComponentContext.js";
|
|
15
|
+
import { useLoadingIndicator as p } from "../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
16
|
+
import { renderErrorList as F } from "../../helpers/apiErrorToList.js";
|
|
17
|
+
const M = ({
|
|
18
|
+
children: i,
|
|
19
|
+
FallbackComponent: o = c,
|
|
20
|
+
LoaderComponent: n,
|
|
21
|
+
onEvent: t
|
|
23
22
|
}) => {
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
async (r, e) => {
|
|
30
|
-
s(null), m(null);
|
|
31
|
-
try {
|
|
32
|
-
await e(r);
|
|
33
|
-
} catch (n) {
|
|
34
|
-
n instanceof E || n instanceof h || n instanceof y ? A(n) : c(n);
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
[s, c]
|
|
38
|
-
);
|
|
39
|
-
return /* @__PURE__ */ o(
|
|
40
|
-
k.Provider,
|
|
23
|
+
const { error: e, fieldErrors: m, baseSubmitHandler: s, setError: u } = b(), { LoadingIndicator: f } = p(), a = n ?? f, l = (L) => {
|
|
24
|
+
t(R.ERROR, L);
|
|
25
|
+
};
|
|
26
|
+
return /* @__PURE__ */ r(
|
|
27
|
+
y.Provider,
|
|
41
28
|
{
|
|
42
29
|
value: {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
baseSubmitHandler:
|
|
48
|
-
LoadingIndicator:
|
|
30
|
+
error: e,
|
|
31
|
+
fieldErrors: m,
|
|
32
|
+
setError: u,
|
|
33
|
+
onEvent: t,
|
|
34
|
+
baseSubmitHandler: s,
|
|
35
|
+
LoadingIndicator: a
|
|
49
36
|
},
|
|
50
|
-
children: /* @__PURE__ */
|
|
51
|
-
|
|
37
|
+
children: /* @__PURE__ */ r(
|
|
38
|
+
j,
|
|
52
39
|
{
|
|
53
|
-
FallbackComponent:
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
},
|
|
58
|
-
children: [
|
|
59
|
-
(t || i) && /* @__PURE__ */ p(a.Alert, { label: b("status.errorEncountered"), status: "error", children: [
|
|
60
|
-
i && /* @__PURE__ */ o(a.UnorderedList, { items: U(i) }),
|
|
61
|
-
t && t instanceof E && /* @__PURE__ */ o(a.Text, { children: t.message }),
|
|
62
|
-
t && t instanceof h && /* @__PURE__ */ o(a.Text, { as: "pre", children: t.pretty() })
|
|
63
|
-
] }),
|
|
64
|
-
/* @__PURE__ */ o(R, { fallback: /* @__PURE__ */ o(d, {}), children: /* @__PURE__ */ o(T, { children: C }) })
|
|
65
|
-
]
|
|
40
|
+
FallbackComponent: o,
|
|
41
|
+
LoaderComponent: a,
|
|
42
|
+
onErrorBoundaryError: l,
|
|
43
|
+
children: /* @__PURE__ */ r(T, { error: e, fieldErrors: m, children: i })
|
|
66
44
|
}
|
|
67
|
-
)
|
|
45
|
+
)
|
|
68
46
|
}
|
|
69
47
|
);
|
|
48
|
+
}, T = ({ children: i, error: o, fieldErrors: n }) => {
|
|
49
|
+
const t = S(), { t: e } = x();
|
|
50
|
+
return /* @__PURE__ */ d(g, { children: [
|
|
51
|
+
(o || n) && /* @__PURE__ */ d(t.Alert, { label: e("status.errorEncountered"), status: "error", children: [
|
|
52
|
+
n && /* @__PURE__ */ r(t.UnorderedList, { items: F(n) }),
|
|
53
|
+
o && o instanceof B && /* @__PURE__ */ r(t.Text, { children: o.message }),
|
|
54
|
+
o && o instanceof I && /* @__PURE__ */ r(t.Text, { as: "pre", children: o.pretty() })
|
|
55
|
+
] }),
|
|
56
|
+
i
|
|
57
|
+
] });
|
|
58
|
+
}, j = ({
|
|
59
|
+
children: i,
|
|
60
|
+
FallbackComponent: o = c,
|
|
61
|
+
LoaderComponent: n,
|
|
62
|
+
onErrorBoundaryError: t
|
|
63
|
+
}) => {
|
|
64
|
+
const { LoadingIndicator: e } = p(), m = n ?? e;
|
|
65
|
+
return /* @__PURE__ */ r(h, { children: ({ reset: s }) => /* @__PURE__ */ r(
|
|
66
|
+
E,
|
|
67
|
+
{
|
|
68
|
+
FallbackComponent: o,
|
|
69
|
+
onReset: s,
|
|
70
|
+
onError: t,
|
|
71
|
+
children: /* @__PURE__ */ r(C, { fallback: /* @__PURE__ */ r(m, {}), children: i })
|
|
72
|
+
}
|
|
73
|
+
) });
|
|
70
74
|
};
|
|
71
75
|
export {
|
|
72
|
-
|
|
76
|
+
j as BaseBoundaries,
|
|
77
|
+
M as BaseComponent,
|
|
78
|
+
T as BaseLayout
|
|
73
79
|
};
|
|
74
80
|
//# sourceMappingURL=Base.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Base.js","sources":["../../../src/components/Base/Base.tsx"],"sourcesContent":["import type { ReactNode, JSX } from 'react'\nimport { Suspense
|
|
1
|
+
{"version":3,"file":"Base.js","sources":["../../../src/components/Base/Base.tsx"],"sourcesContent":["import type { ReactNode, JSX, ErrorInfo } from 'react'\nimport { Suspense } from 'react'\nimport type { FallbackProps } from 'react-error-boundary'\nimport { ErrorBoundary } from 'react-error-boundary'\nimport { useTranslation } from 'react-i18next'\nimport { APIError } from '@gusto/embedded-api/models/errors/apierror'\nimport { SDKValidationError } from '@gusto/embedded-api/models/errors/sdkvalidationerror'\nimport { QueryErrorResetBoundary } from '@tanstack/react-query'\nimport type { EntityErrorObject } from '@gusto/embedded-api/models/components/entityerrorobject'\nimport { FadeIn } from '../Common/FadeIn/FadeIn'\nimport { BaseContext, type KnownErrors, type OnEventType } from './useBase'\nimport { useBaseSubmit } from './useBaseSubmit'\nimport { componentEvents, type EventType } from '@/shared/constants'\nimport { InternalError } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport type { ResourceDictionary, Resources } from '@/types/Helpers'\nimport { useLoadingIndicator } from '@/contexts/LoadingIndicatorProvider/useLoadingIndicator'\nimport type { LoadingIndicatorContextProps } from '@/contexts/LoadingIndicatorProvider/useLoadingIndicator'\nimport { renderErrorList } from '@/helpers/apiErrorToList'\n\nexport interface CommonComponentInterface<TResourceKey extends keyof Resources = keyof Resources> {\n children?: ReactNode\n className?: string\n defaultValues?: unknown\n dictionary?: ResourceDictionary<TResourceKey>\n}\n\n// Base component wrapper with error and suspense handling\nexport interface BaseComponentInterface<TResourceKey extends keyof Resources = keyof Resources>\n extends CommonComponentInterface<TResourceKey> {\n FallbackComponent?: BaseBoundariesProps['FallbackComponent']\n LoaderComponent?: BaseBoundariesProps['LoaderComponent']\n onEvent: OnEventType<EventType, unknown>\n}\n\nexport const BaseComponent = <TResourceKey extends keyof Resources = keyof Resources>({\n children,\n FallbackComponent = InternalError,\n LoaderComponent: LoadingIndicatorFromProps,\n onEvent,\n}: BaseComponentInterface<TResourceKey>) => {\n const { error, fieldErrors, baseSubmitHandler, setError } = useBaseSubmit()\n\n const { LoadingIndicator: LoadingIndicatorFromContext } = useLoadingIndicator()\n const LoaderComponent = LoadingIndicatorFromProps ?? LoadingIndicatorFromContext\n\n const onErrorBoundaryError = (error: Error) => {\n onEvent(componentEvents.ERROR, error)\n }\n\n return (\n <BaseContext.Provider\n value={{\n error,\n fieldErrors,\n setError,\n onEvent,\n baseSubmitHandler,\n LoadingIndicator: LoaderComponent,\n }}\n >\n <BaseBoundaries\n FallbackComponent={FallbackComponent}\n LoaderComponent={LoaderComponent}\n onErrorBoundaryError={onErrorBoundaryError}\n >\n <BaseLayout error={error} fieldErrors={fieldErrors}>\n {children}\n </BaseLayout>\n </BaseBoundaries>\n </BaseContext.Provider>\n )\n}\n\ninterface BaseLayoutProps {\n children?: ReactNode\n error: KnownErrors | null\n fieldErrors: Array<EntityErrorObject> | null\n}\n\nexport const BaseLayout = ({ children, error, fieldErrors }: BaseLayoutProps) => {\n const Components = useComponentContext()\n const { t } = useTranslation()\n\n return (\n <FadeIn>\n {(error || fieldErrors) && (\n <Components.Alert label={t('status.errorEncountered')} status=\"error\">\n {fieldErrors && <Components.UnorderedList items={renderErrorList(fieldErrors)} />}\n {error && error instanceof APIError && <Components.Text>{error.message}</Components.Text>}\n {error && error instanceof SDKValidationError && (\n <Components.Text as=\"pre\">{error.pretty()}</Components.Text>\n )}\n </Components.Alert>\n )}\n {children}\n </FadeIn>\n )\n}\n\nexport interface BaseBoundariesProps {\n children?: ReactNode\n FallbackComponent?: (props: FallbackProps) => JSX.Element\n LoaderComponent?: LoadingIndicatorContextProps['LoadingIndicator']\n onErrorBoundaryError?: (error: Error, info: ErrorInfo) => void\n}\n\nexport const BaseBoundaries = ({\n children,\n FallbackComponent = InternalError,\n LoaderComponent: LoadingIndicatorFromProps,\n onErrorBoundaryError,\n}: BaseBoundariesProps) => {\n const { LoadingIndicator: LoadingIndicatorFromContext } = useLoadingIndicator()\n const LoaderComponent = LoadingIndicatorFromProps ?? LoadingIndicatorFromContext\n\n return (\n <QueryErrorResetBoundary>\n {({ reset: resetQueries }) => (\n <ErrorBoundary\n FallbackComponent={FallbackComponent}\n onReset={resetQueries}\n onError={onErrorBoundaryError}\n >\n <Suspense fallback={<LoaderComponent />}>{children}</Suspense>\n </ErrorBoundary>\n )}\n </QueryErrorResetBoundary>\n )\n}\n"],"names":["BaseComponent","children","FallbackComponent","InternalError","LoadingIndicatorFromProps","onEvent","error","fieldErrors","baseSubmitHandler","setError","useBaseSubmit","LoadingIndicatorFromContext","useLoadingIndicator","LoaderComponent","onErrorBoundaryError","componentEvents","jsx","BaseContext","BaseBoundaries","BaseLayout","Components","useComponentContext","t","useTranslation","FadeIn","jsxs","renderErrorList","APIError","SDKValidationError","QueryErrorResetBoundary","resetQueries","ErrorBoundary","Suspense"],"mappings":";;;;;;;;;;;;;;;;AAmCO,MAAMA,IAAgB,CAAyD;AAAA,EACpF,UAAAC;AAAA,EACA,mBAAAC,IAAoBC;AAAA,EACpB,iBAAiBC;AAAA,EACjB,SAAAC;AACF,MAA4C;AAC1C,QAAM,EAAE,OAAAC,GAAO,aAAAC,GAAa,mBAAAC,GAAmB,UAAAC,EAAA,IAAaC,EAAA,GAEtD,EAAE,kBAAkBC,EAAA,IAAgCC,EAAA,GACpDC,IAAkBT,KAA6BO,GAE/CG,IAAuB,CAACR,MAAiB;AAC7C,IAAAD,EAAQU,EAAgB,OAAOT,CAAK;AAAA,EACtC;AAEA,SACE,gBAAAU;AAAA,IAACC,EAAY;AAAA,IAAZ;AAAA,MACC,OAAO;AAAA,QACL,OAAAX;AAAA,QACA,aAAAC;AAAA,QACA,UAAAE;AAAA,QACA,SAAAJ;AAAA,QACA,mBAAAG;AAAA,QACA,kBAAkBK;AAAA,MAAA;AAAA,MAGpB,UAAA,gBAAAG;AAAA,QAACE;AAAA,QAAA;AAAA,UACC,mBAAAhB;AAAA,UACA,iBAAAW;AAAA,UACA,sBAAAC;AAAA,UAEA,UAAA,gBAAAE,EAACG,GAAA,EAAW,OAAAb,GAAc,aAAAC,GACvB,UAAAN,EAAA,CACH;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,EAAA;AAGN,GAQakB,IAAa,CAAC,EAAE,UAAAlB,GAAU,OAAAK,GAAO,aAAAC,QAAmC;AAC/E,QAAMa,IAAaC,EAAA,GACb,EAAE,GAAAC,EAAA,IAAMC,EAAA;AAEd,2BACGC,GAAA,EACG,UAAA;AAAA,KAAAlB,KAASC,MACT,gBAAAkB,EAACL,EAAW,OAAX,EAAiB,OAAOE,EAAE,yBAAyB,GAAG,QAAO,SAC3D,UAAA;AAAA,MAAAf,uBAAgBa,EAAW,eAAX,EAAyB,OAAOM,EAAgBnB,CAAW,GAAG;AAAA,MAC9ED,KAASA,aAAiBqB,KAAY,gBAAAX,EAACI,EAAW,MAAX,EAAiB,YAAM,SAAQ;AAAA,MACtEd,KAASA,aAAiBsB,KACzB,gBAAAZ,EAACI,EAAW,MAAX,EAAgB,IAAG,OAAO,UAAAd,EAAM,OAAA,EAAO,CAAE;AAAA,IAAA,GAE9C;AAAA,IAEDL;AAAA,EAAA,GACH;AAEJ,GASaiB,IAAiB,CAAC;AAAA,EAC7B,UAAAjB;AAAA,EACA,mBAAAC,IAAoBC;AAAA,EACpB,iBAAiBC;AAAA,EACjB,sBAAAU;AACF,MAA2B;AACzB,QAAM,EAAE,kBAAkBH,EAAA,IAAgCC,EAAA,GACpDC,IAAkBT,KAA6BO;AAErD,2BACGkB,GAAA,EACE,UAAA,CAAC,EAAE,OAAOC,QACT,gBAAAd;AAAA,IAACe;AAAA,IAAA;AAAA,MACC,mBAAA7B;AAAA,MACA,SAAS4B;AAAA,MACT,SAAShB;AAAA,MAET,4BAACkB,GAAA,EAAS,UAAU,gBAAAhB,EAACH,GAAA,EAAgB,GAAK,UAAAZ,EAAA,CAAS;AAAA,IAAA;AAAA,EAAA,GAGzD;AAEJ;"}
|
|
@@ -7,10 +7,10 @@ import { LoadingIndicatorContextProps } from '../../contexts/LoadingIndicatorPro
|
|
|
7
7
|
export type OnEventType<K, T> = (type: K, data?: T) => void;
|
|
8
8
|
export type KnownErrors = APIError | SDKValidationError | UnprocessableEntityErrorObject;
|
|
9
9
|
interface BaseContextProps {
|
|
10
|
+
error: KnownErrors | null;
|
|
10
11
|
fieldErrors: Array<EntityErrorObject> | null;
|
|
11
12
|
setError: (err: KnownErrors | null) => void;
|
|
12
13
|
onEvent: OnEventType<EventType, unknown>;
|
|
13
|
-
throwError: (e: unknown) => void;
|
|
14
14
|
baseSubmitHandler: <T>(formData: T, componentHandler: (payload: T) => Promise<void>) => Promise<void>;
|
|
15
15
|
LoadingIndicator: LoadingIndicatorContextProps['LoadingIndicator'];
|
|
16
16
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useBase.js","sources":["../../../src/components/Base/useBase.tsx"],"sourcesContent":["import { createContext, useContext } from 'react'\nimport type { APIError } from '@gusto/embedded-api/models/errors/apierror'\nimport type { SDKValidationError } from '@gusto/embedded-api/models/errors/sdkvalidationerror'\nimport type { UnprocessableEntityErrorObject } from '@gusto/embedded-api/models/errors/unprocessableentityerrorobject'\nimport type { EntityErrorObject } from '@gusto/embedded-api/models/components/entityerrorobject'\nimport { type EventType } from '@/shared/constants'\nimport type { LoadingIndicatorContextProps } from '@/contexts/LoadingIndicatorProvider/useLoadingIndicator'\n\nexport type OnEventType<K, T> = (type: K, data?: T) => void\n\nexport type KnownErrors = APIError | SDKValidationError | UnprocessableEntityErrorObject\n\ninterface BaseContextProps {\n fieldErrors: Array<EntityErrorObject> | null\n setError: (err: KnownErrors | null) => void\n onEvent: OnEventType<EventType, unknown>\n
|
|
1
|
+
{"version":3,"file":"useBase.js","sources":["../../../src/components/Base/useBase.tsx"],"sourcesContent":["import { createContext, useContext } from 'react'\nimport type { APIError } from '@gusto/embedded-api/models/errors/apierror'\nimport type { SDKValidationError } from '@gusto/embedded-api/models/errors/sdkvalidationerror'\nimport type { UnprocessableEntityErrorObject } from '@gusto/embedded-api/models/errors/unprocessableentityerrorobject'\nimport type { EntityErrorObject } from '@gusto/embedded-api/models/components/entityerrorobject'\nimport { type EventType } from '@/shared/constants'\nimport type { LoadingIndicatorContextProps } from '@/contexts/LoadingIndicatorProvider/useLoadingIndicator'\n\nexport type OnEventType<K, T> = (type: K, data?: T) => void\n\nexport type KnownErrors = APIError | SDKValidationError | UnprocessableEntityErrorObject\n\ninterface BaseContextProps {\n error: KnownErrors | null\n fieldErrors: Array<EntityErrorObject> | null\n setError: (err: KnownErrors | null) => void\n onEvent: OnEventType<EventType, unknown>\n baseSubmitHandler: <T>(\n formData: T,\n componentHandler: (payload: T) => Promise<void>,\n ) => Promise<void>\n LoadingIndicator: LoadingIndicatorContextProps['LoadingIndicator']\n}\n\nexport const BaseContext = createContext<BaseContextProps | undefined>(undefined)\n\nexport const useBase = () => {\n const context = useContext(BaseContext)\n if (!context) {\n throw new Error('useBase must be used within a BaseProvider')\n }\n return context\n}\n"],"names":["BaseContext","createContext","useBase","context","useContext"],"mappings":";AAwBO,MAAMA,IAAcC,EAA4C,MAAS,GAEnEC,IAAU,MAAM;AAC3B,QAAMC,IAAUC,EAAWJ,CAAW;AACtC,MAAI,CAACG;AACH,UAAM,IAAI,MAAM,4CAA4C;AAE9D,SAAOA;AACT;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { EntityErrorObject } from '@gusto/embedded-api/models/components/entityerrorobject';
|
|
2
|
+
import { KnownErrors } from './useBase';
|
|
3
|
+
type SubmitHandler<T> = (data: T) => Promise<void>;
|
|
4
|
+
export declare const useBaseSubmit: () => {
|
|
5
|
+
baseSubmitHandler: <T>(data: T, componentHandler: SubmitHandler<T>) => Promise<void>;
|
|
6
|
+
error: KnownErrors | null;
|
|
7
|
+
fieldErrors: EntityErrorObject[] | null;
|
|
8
|
+
setError: (error: KnownErrors | null) => void;
|
|
9
|
+
};
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { useState as i, useCallback as a } from "react";
|
|
2
|
+
import { APIError as E } from "@gusto/embedded-api/models/errors/apierror";
|
|
3
|
+
import { SDKValidationError as p } from "@gusto/embedded-api/models/errors/sdkvalidationerror";
|
|
4
|
+
import { UnprocessableEntityErrorObject as l } from "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
|
|
5
|
+
import { useAsyncError as b } from "../../hooks/useAsyncError.js";
|
|
6
|
+
import { getFieldErrors as d } from "../../helpers/apiErrorToList.js";
|
|
7
|
+
const H = () => {
|
|
8
|
+
const [c, t] = i(null), [f, s] = i(null), n = b(), m = a((r) => {
|
|
9
|
+
t(r), r || s(null);
|
|
10
|
+
}, []), u = (r) => {
|
|
11
|
+
t(r), r instanceof l && Array.isArray(r.errors) && s(r.errors.flatMap((e) => d(e)));
|
|
12
|
+
};
|
|
13
|
+
return {
|
|
14
|
+
baseSubmitHandler: a(
|
|
15
|
+
async (r, e) => {
|
|
16
|
+
t(null), s(null);
|
|
17
|
+
try {
|
|
18
|
+
await e(r);
|
|
19
|
+
} catch (o) {
|
|
20
|
+
o instanceof E || o instanceof p || o instanceof l ? u(o) : n(o);
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
[t, n]
|
|
24
|
+
),
|
|
25
|
+
error: c,
|
|
26
|
+
fieldErrors: f,
|
|
27
|
+
setError: m
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export {
|
|
31
|
+
H as useBaseSubmit
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=useBaseSubmit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useBaseSubmit.js","sources":["../../../src/components/Base/useBaseSubmit.ts"],"sourcesContent":["import { useState, useCallback } from 'react'\nimport type { EntityErrorObject } from '@gusto/embedded-api/models/components/entityerrorobject'\nimport { APIError } from '@gusto/embedded-api/models/errors/apierror'\nimport { SDKValidationError } from '@gusto/embedded-api/models/errors/sdkvalidationerror'\nimport { UnprocessableEntityErrorObject } from '@gusto/embedded-api/models/errors/unprocessableentityerrorobject'\nimport type { KnownErrors } from './useBase'\nimport { useAsyncError } from '@/hooks/useAsyncError'\nimport { getFieldErrors } from '@/helpers/apiErrorToList'\n\ntype SubmitHandler<T> = (data: T) => Promise<void>\n\nexport const useBaseSubmit = () => {\n const [error, setError] = useState<KnownErrors | null>(null)\n const [fieldErrors, setFieldErrors] = useState<EntityErrorObject[] | null>(null)\n const throwError = useAsyncError()\n\n // Enhanced setError that also clears fieldErrors when error is cleared\n const setErrorWithFieldsClear = useCallback((error: KnownErrors | null) => {\n setError(error)\n if (!error) {\n setFieldErrors(null)\n }\n }, [])\n\n const processError = (error: KnownErrors) => {\n setError(error)\n //422\tapplication/json - content relaited error\n if (error instanceof UnprocessableEntityErrorObject && Array.isArray(error.errors)) {\n setFieldErrors(error.errors.flatMap(err => getFieldErrors(err)))\n }\n }\n\n const baseSubmitHandler = useCallback(\n async <T>(data: T, componentHandler: SubmitHandler<T>) => {\n setError(null)\n setFieldErrors(null)\n try {\n await componentHandler(data)\n } catch (err) {\n if (\n err instanceof APIError ||\n err instanceof SDKValidationError ||\n err instanceof UnprocessableEntityErrorObject\n ) {\n processError(err)\n } else throwError(err)\n }\n },\n [setError, throwError],\n )\n\n return {\n baseSubmitHandler,\n error,\n fieldErrors,\n setError: setErrorWithFieldsClear,\n }\n}\n"],"names":["useBaseSubmit","error","setError","useState","fieldErrors","setFieldErrors","throwError","useAsyncError","setErrorWithFieldsClear","useCallback","processError","UnprocessableEntityErrorObject","getFieldErrors","err","data","componentHandler","APIError","SDKValidationError"],"mappings":";;;;;;AAWO,MAAMA,IAAgB,MAAM;AACjC,QAAM,CAACC,GAAOC,CAAQ,IAAIC,EAA6B,IAAI,GACrD,CAACC,GAAaC,CAAc,IAAIF,EAAqC,IAAI,GACzEG,IAAaC,EAAA,GAGbC,IAA0BC,EAAY,CAACR,MAA8B;AACzE,IAAAC,EAASD,CAAK,GACTA,KACHI,EAAe,IAAI;AAAA,EAEvB,GAAG,CAAA,CAAE,GAECK,IAAe,CAACT,MAAuB;AAC3C,IAAAC,EAASD,CAAK,GAEVA,aAAiBU,KAAkC,MAAM,QAAQV,EAAM,MAAM,KAC/EI,EAAeJ,EAAM,OAAO,QAAQ,OAAOW,EAAeC,CAAG,CAAC,CAAC;AAAA,EAEnE;AAqBA,SAAO;AAAA,IACL,mBApBwBJ;AAAA,MACxB,OAAUK,GAASC,MAAuC;AACxD,QAAAb,EAAS,IAAI,GACbG,EAAe,IAAI;AACnB,YAAI;AACF,gBAAMU,EAAiBD,CAAI;AAAA,QAC7B,SAASD,GAAK;AACZ,UACEA,aAAeG,KACfH,aAAeI,KACfJ,aAAeF,IAEfD,EAAaG,CAAG,MACAA,CAAG;AAAA,QACvB;AAAA,MACF;AAAA,MACA,CAACX,GAAUI,CAAU;AAAA,IAAA;AAAA,IAKrB,OAAAL;AAAA,IACA,aAAAG;AAAA,IACA,UAAUI;AAAA,EAAA;AAEd;"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { UseFieldProps } from '../hooks/useField';
|
|
2
|
+
import { TextAreaProps } from '../../UI/TextArea/TextAreaTypes';
|
|
3
|
+
export interface TextAreaFieldProps extends Omit<TextAreaProps, 'name' | 'value' | 'isInvalid'>, UseFieldProps<string, HTMLTextAreaElement> {
|
|
4
|
+
}
|
|
5
|
+
export declare const TextAreaField: React.FC<TextAreaFieldProps>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { useField as u } from "../hooks/useField.js";
|
|
3
|
+
import { useComponentContext as C } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
4
|
+
const T = ({
|
|
5
|
+
rules: o,
|
|
6
|
+
defaultValue: e,
|
|
7
|
+
name: t,
|
|
8
|
+
errorMessage: r,
|
|
9
|
+
isRequired: n,
|
|
10
|
+
onChange: m,
|
|
11
|
+
transform: s,
|
|
12
|
+
description: p,
|
|
13
|
+
onBlur: i,
|
|
14
|
+
inputRef: x,
|
|
15
|
+
...f
|
|
16
|
+
}) => {
|
|
17
|
+
const c = C(), d = u({
|
|
18
|
+
name: t,
|
|
19
|
+
rules: o,
|
|
20
|
+
defaultValue: e,
|
|
21
|
+
errorMessage: r,
|
|
22
|
+
isRequired: n,
|
|
23
|
+
onChange: m,
|
|
24
|
+
transform: s,
|
|
25
|
+
description: p,
|
|
26
|
+
onBlur: i,
|
|
27
|
+
inputRef: x
|
|
28
|
+
});
|
|
29
|
+
return /* @__PURE__ */ l(c.TextArea, { ...f, ...d });
|
|
30
|
+
};
|
|
31
|
+
export {
|
|
32
|
+
T as TextAreaField
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=TextAreaField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextAreaField.js","sources":["../../../../../src/components/Common/Fields/TextAreaField/TextAreaField.tsx"],"sourcesContent":["import { useField, type UseFieldProps } from '@/components/Common/Fields/hooks/useField'\nimport type { TextAreaProps } from '@/components/Common/UI/TextArea/TextAreaTypes'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport interface TextAreaFieldProps\n extends Omit<TextAreaProps, 'name' | 'value' | 'isInvalid'>,\n UseFieldProps<string, HTMLTextAreaElement> {}\n\nexport const TextAreaField: React.FC<TextAreaFieldProps> = ({\n rules,\n defaultValue,\n name,\n errorMessage,\n isRequired,\n onChange,\n transform,\n description,\n onBlur,\n inputRef,\n ...textAreaProps\n}: TextAreaFieldProps) => {\n const Components = useComponentContext()\n const fieldProps = useField({\n name,\n rules,\n defaultValue,\n errorMessage,\n isRequired,\n onChange,\n transform,\n description,\n onBlur,\n inputRef,\n })\n\n return <Components.TextArea {...textAreaProps} {...fieldProps} />\n}\n"],"names":["TextAreaField","rules","defaultValue","name","errorMessage","isRequired","onChange","transform","description","onBlur","inputRef","textAreaProps","Components","useComponentContext","fieldProps","useField"],"mappings":";;;AAQO,MAAMA,IAA8C,CAAC;AAAA,EAC1D,OAAAC;AAAA,EACA,cAAAC;AAAA,EACA,MAAAC;AAAA,EACA,cAAAC;AAAA,EACA,YAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,QAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACL,MAA0B;AACxB,QAAMC,IAAaC,EAAA,GACbC,IAAaC,EAAS;AAAA,IAC1B,MAAAZ;AAAA,IACA,OAAAF;AAAA,IACA,cAAAC;AAAA,IACA,cAAAE;AAAA,IACA,YAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,aAAAC;AAAA,IACA,QAAAC;AAAA,IACA,UAAAC;AAAA,EAAA,CACD;AAED,2BAAQE,EAAW,UAAX,EAAqB,GAAGD,GAAgB,GAAGG,GAAY;AACjE;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation as h } from "react-i18next";
|
|
3
3
|
import { useRef as C, useMemo as d } from "react";
|
|
4
4
|
import { useComponentContext as u } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
@@ -9,15 +9,15 @@ import { useContainerBreakpoints as R } from "../../../hooks/useContainerBreakpo
|
|
|
9
9
|
import { useDateFormatter as V } from "../../../hooks/useDateFormatter.js";
|
|
10
10
|
function Y({
|
|
11
11
|
breadcrumbs: a,
|
|
12
|
-
currentBreadcrumbId:
|
|
12
|
+
currentBreadcrumbId: p,
|
|
13
13
|
onEvent: s
|
|
14
14
|
}) {
|
|
15
|
-
const i = C(null),
|
|
15
|
+
const i = C(null), f = R({ ref: i }).length === 1, { Breadcrumbs: m } = u(), { locale: c } = g(), r = V(), v = a.reduce(
|
|
16
16
|
(t, e) => (e.namespace && t.push(e.namespace), t),
|
|
17
17
|
[]
|
|
18
18
|
);
|
|
19
|
-
k(
|
|
20
|
-
const { t: o } = h(
|
|
19
|
+
k(v);
|
|
20
|
+
const { t: o } = h(), D = d(
|
|
21
21
|
() => a.map((t) => {
|
|
22
22
|
const e = t.variables ? {
|
|
23
23
|
...t.variables,
|
|
@@ -36,14 +36,14 @@ function Y({
|
|
|
36
36
|
label: n
|
|
37
37
|
};
|
|
38
38
|
}),
|
|
39
|
-
[a, o,
|
|
39
|
+
[a, o, c]
|
|
40
40
|
);
|
|
41
|
-
return /* @__PURE__ */
|
|
42
|
-
|
|
41
|
+
return /* @__PURE__ */ l("div", { ref: i, children: /* @__PURE__ */ l(
|
|
42
|
+
m,
|
|
43
43
|
{
|
|
44
|
-
isSmallContainer:
|
|
44
|
+
isSmallContainer: f,
|
|
45
45
|
breadcrumbs: D,
|
|
46
|
-
currentBreadcrumbId:
|
|
46
|
+
currentBreadcrumbId: p,
|
|
47
47
|
onClick: (t) => {
|
|
48
48
|
const e = a.find((n) => n.id === t);
|
|
49
49
|
s && e && s(B.BREADCRUMB_NAVIGATE, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlowBreadcrumbs.js","sources":["../../../../src/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.tsx"],"sourcesContent":["import type { CustomTypeOptions } from 'i18next'\nimport { useTranslation } from 'react-i18next'\nimport { useMemo, useRef } from 'react'\nimport type { FlowBreadcrumbsProps } from './FlowBreadcrumbsTypes'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { componentEvents } from '@/shared/constants'\nimport { useI18n } from '@/i18n/I18n'\nimport { useLocale } from '@/contexts/LocaleProvider/useLocale'\nimport { useContainerBreakpoints } from '@/hooks/useContainerBreakpoints/useContainerBreakpoints'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\n\nexport function FlowBreadcrumbs({\n breadcrumbs,\n currentBreadcrumbId,\n onEvent,\n}: FlowBreadcrumbsProps) {\n const breadcrumbContainerRef = useRef<HTMLDivElement | null>(null)\n const breakpoints = useContainerBreakpoints({ ref: breadcrumbContainerRef })\n // Small if we only contain the base breakpoint\n const isSmallContainer = breakpoints.length === 1\n\n const { Breadcrumbs } = useComponentContext()\n const { locale } = useLocale()\n const dateFormatter = useDateFormatter()\n const namespaces = breadcrumbs.reduce<Array<keyof CustomTypeOptions['resources']>>(\n (acc, breadcrumb) => {\n if (breadcrumb.namespace) {\n acc.push(breadcrumb.namespace as keyof CustomTypeOptions['resources'])\n }\n return acc\n },\n [],\n )\n useI18n(namespaces)\n const { t } = useTranslation(
|
|
1
|
+
{"version":3,"file":"FlowBreadcrumbs.js","sources":["../../../../src/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.tsx"],"sourcesContent":["import type { CustomTypeOptions } from 'i18next'\nimport { useTranslation } from 'react-i18next'\nimport { useMemo, useRef } from 'react'\nimport type { FlowBreadcrumbsProps } from './FlowBreadcrumbsTypes'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { componentEvents } from '@/shared/constants'\nimport { useI18n } from '@/i18n/I18n'\nimport { useLocale } from '@/contexts/LocaleProvider/useLocale'\nimport { useContainerBreakpoints } from '@/hooks/useContainerBreakpoints/useContainerBreakpoints'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\n\nexport function FlowBreadcrumbs({\n breadcrumbs,\n currentBreadcrumbId,\n onEvent,\n}: FlowBreadcrumbsProps) {\n const breadcrumbContainerRef = useRef<HTMLDivElement | null>(null)\n const breakpoints = useContainerBreakpoints({ ref: breadcrumbContainerRef })\n // Small if we only contain the base breakpoint\n const isSmallContainer = breakpoints.length === 1\n\n const { Breadcrumbs } = useComponentContext()\n const { locale } = useLocale()\n const dateFormatter = useDateFormatter()\n const namespaces = breadcrumbs.reduce<Array<keyof CustomTypeOptions['resources']>>(\n (acc, breadcrumb) => {\n if (breadcrumb.namespace) {\n acc.push(breadcrumb.namespace as keyof CustomTypeOptions['resources'])\n }\n return acc\n },\n [],\n )\n useI18n(namespaces)\n const { t } = useTranslation()\n const parsedBreadcrumbs = useMemo(\n () =>\n breadcrumbs.map(breadcrumb => {\n const formattedVariables = breadcrumb.variables\n ? {\n ...breadcrumb.variables,\n startDate:\n typeof breadcrumb.variables.startDate === 'string'\n ? dateFormatter.formatShortWithYear(breadcrumb.variables.startDate)\n : breadcrumb.variables.startDate,\n endDate:\n typeof breadcrumb.variables.endDate === 'string'\n ? dateFormatter.formatShortWithYear(breadcrumb.variables.endDate)\n : breadcrumb.variables.endDate,\n }\n : undefined\n\n const translatedLabel = breadcrumb.namespace\n ? (t(breadcrumb.label, {\n ns: breadcrumb.namespace,\n defaultValue: breadcrumb.label,\n ...formattedVariables,\n } as never) as unknown as string)\n : (t(breadcrumb.label, {\n defaultValue: breadcrumb.label,\n ...formattedVariables,\n } as never) as unknown as string)\n return {\n id: breadcrumb.id,\n label: translatedLabel,\n }\n }),\n [breadcrumbs, t, locale],\n )\n\n const handleBreadcrumbClick = (breadcrumbId: string) => {\n const breadcrumb = breadcrumbs.find(breadcrumb => breadcrumb.id === breadcrumbId)\n if (onEvent && breadcrumb) {\n onEvent(componentEvents.BREADCRUMB_NAVIGATE, {\n key: breadcrumbId,\n onNavigate: breadcrumb.onNavigate,\n })\n }\n }\n return (\n <div ref={breadcrumbContainerRef}>\n <Breadcrumbs\n isSmallContainer={isSmallContainer}\n breadcrumbs={parsedBreadcrumbs}\n currentBreadcrumbId={currentBreadcrumbId}\n onClick={handleBreadcrumbClick}\n />\n </div>\n )\n}\n"],"names":["FlowBreadcrumbs","breadcrumbs","currentBreadcrumbId","onEvent","breadcrumbContainerRef","useRef","isSmallContainer","useContainerBreakpoints","Breadcrumbs","useComponentContext","locale","useLocale","dateFormatter","useDateFormatter","namespaces","acc","breadcrumb","useI18n","t","useTranslation","parsedBreadcrumbs","useMemo","formattedVariables","translatedLabel","jsx","breadcrumbId","componentEvents"],"mappings":";;;;;;;;;AAWO,SAASA,EAAgB;AAAA,EAC9B,aAAAC;AAAA,EACA,qBAAAC;AAAA,EACA,SAAAC;AACF,GAAyB;AACvB,QAAMC,IAAyBC,EAA8B,IAAI,GAG3DC,IAFcC,EAAwB,EAAE,KAAKH,GAAwB,EAEtC,WAAW,GAE1C,EAAE,aAAAI,EAAA,IAAgBC,EAAA,GAClB,EAAE,QAAAC,EAAA,IAAWC,EAAA,GACbC,IAAgBC,EAAA,GAChBC,IAAab,EAAY;AAAA,IAC7B,CAACc,GAAKC,OACAA,EAAW,aACbD,EAAI,KAAKC,EAAW,SAAiD,GAEhED;AAAA,IAET,CAAA;AAAA,EAAC;AAEH,EAAAE,EAAQH,CAAU;AAClB,QAAM,EAAE,GAAAI,EAAA,IAAMC,EAAA,GACRC,IAAoBC;AAAA,IACxB,MACEpB,EAAY,IAAI,CAAAe,MAAc;AAC5B,YAAMM,IAAqBN,EAAW,YAClC;AAAA,QACE,GAAGA,EAAW;AAAA,QACd,WACE,OAAOA,EAAW,UAAU,aAAc,WACtCJ,EAAc,oBAAoBI,EAAW,UAAU,SAAS,IAChEA,EAAW,UAAU;AAAA,QAC3B,SACE,OAAOA,EAAW,UAAU,WAAY,WACpCJ,EAAc,oBAAoBI,EAAW,UAAU,OAAO,IAC9DA,EAAW,UAAU;AAAA,MAAA,IAE7B,QAEEO,IAAkBP,EAAW,YAC9BE,EAAEF,EAAW,OAAO;AAAA,QACnB,IAAIA,EAAW;AAAA,QACf,cAAcA,EAAW;AAAA,QACzB,GAAGM;AAAA,MAAA,CACK,IACTJ,EAAEF,EAAW,OAAO;AAAA,QACnB,cAAcA,EAAW;AAAA,QACzB,GAAGM;AAAA,MAAA,CACK;AACd,aAAO;AAAA,QACL,IAAIN,EAAW;AAAA,QACf,OAAOO;AAAA,MAAA;AAAA,IAEX,CAAC;AAAA,IACH,CAACtB,GAAaiB,GAAGR,CAAM;AAAA,EAAA;AAYzB,SACE,gBAAAc,EAAC,OAAA,EAAI,KAAKpB,GACR,UAAA,gBAAAoB;AAAA,IAAChB;AAAA,IAAA;AAAA,MACC,kBAAAF;AAAA,MACA,aAAac;AAAA,MACb,qBAAAlB;AAAA,MACA,SAfwB,CAACuB,MAAyB;AACtD,cAAMT,IAAaf,EAAY,KAAK,CAAAe,MAAcA,EAAW,OAAOS,CAAY;AAChF,QAAItB,KAAWa,KACbb,EAAQuB,EAAgB,qBAAqB;AAAA,UAC3C,KAAKD;AAAA,UACL,YAAYT,EAAW;AAAA,QAAA,CACxB;AAAA,MAEL;AAAA,IAOe;AAAA,EAAA,GAEb;AAEJ;"}
|
|
@@ -2,27 +2,30 @@ import { jsx as r } from "react/jsx-runtime";
|
|
|
2
2
|
import { z as o } from "zod";
|
|
3
3
|
import { useForm as s, FormProvider as a } from "react-hook-form";
|
|
4
4
|
import { zodResolver as l } from "@hookform/resolvers/zod";
|
|
5
|
-
import
|
|
5
|
+
import e from "./SignatureForm.module.scss.js";
|
|
6
6
|
import { Form as u } from "../Form/Form.js";
|
|
7
7
|
import { Flex as c } from "../Flex/Flex.js";
|
|
8
|
-
import "react-i18next";
|
|
9
8
|
import "classnames";
|
|
10
|
-
|
|
9
|
+
import "../../../shared/constants.js";
|
|
10
|
+
import "react-i18next";
|
|
11
|
+
import "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
12
|
+
import "react";
|
|
13
|
+
const p = o.object({
|
|
11
14
|
signature: o.string().min(1),
|
|
12
15
|
confirmSignature: o.literal(!0)
|
|
13
|
-
}),
|
|
16
|
+
}), f = {
|
|
14
17
|
signature: ""
|
|
15
18
|
};
|
|
16
|
-
function
|
|
17
|
-
const
|
|
18
|
-
resolver: l(
|
|
19
|
-
defaultValues:
|
|
19
|
+
function V({ onSubmit: m, children: i, formProps: n }) {
|
|
20
|
+
const t = s({
|
|
21
|
+
resolver: l(p),
|
|
22
|
+
defaultValues: f,
|
|
20
23
|
...n
|
|
21
24
|
});
|
|
22
|
-
return /* @__PURE__ */ r(a, { ...
|
|
25
|
+
return /* @__PURE__ */ r(a, { ...t, children: /* @__PURE__ */ r(u, { onSubmit: t.handleSubmit(m), className: e.container, children: /* @__PURE__ */ r("div", { className: e.formFields, children: /* @__PURE__ */ r(c, { flexDirection: "column", gap: 20, children: i }) }) }) });
|
|
23
26
|
}
|
|
24
27
|
export {
|
|
25
|
-
|
|
26
|
-
|
|
28
|
+
V as SignatureForm,
|
|
29
|
+
p as SignatureFormSchema
|
|
27
30
|
};
|
|
28
31
|
//# sourceMappingURL=SignatureForm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignatureForm.js","sources":["../../../../src/components/Common/SignatureForm/SignatureForm.tsx"],"sourcesContent":["import { z } from 'zod'\nimport { FormProvider, useForm, type UseFormProps } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport styles from './SignatureForm.module.scss'\nimport { Form } from '@/components/Common/Form'\nimport { Flex } from '@/components/Common'\n\nexport const SignatureFormSchema = z.object({\n signature: z.string().min(1),\n confirmSignature: z.literal(true),\n})\n\nconst signatureFormDefaultValues = {\n signature: '',\n}\n\nexport type SignatureFormInputs = z.infer<typeof SignatureFormSchema>\n\ninterface SignatureFormProps {\n onSubmit: (data: SignatureFormInputs) => void | Promise<void>\n children?: React.ReactNode\n formProps?: Partial<UseFormProps<SignatureFormInputs>>\n}\n\nexport function SignatureForm({ onSubmit, children, formProps }: SignatureFormProps) {\n const methods = useForm<SignatureFormInputs>({\n resolver: zodResolver(SignatureFormSchema),\n defaultValues: signatureFormDefaultValues,\n ...formProps,\n })\n\n return (\n <FormProvider {...methods}>\n <Form onSubmit={methods.handleSubmit(onSubmit)} className={styles.container}>\n <div className={styles.formFields}>\n <Flex flexDirection=\"column\" gap={20}>\n {children}\n </Flex>\n </div>\n </Form>\n </FormProvider>\n )\n}\n"],"names":["SignatureFormSchema","z","signatureFormDefaultValues","SignatureForm","onSubmit","children","formProps","methods","useForm","zodResolver","jsx","FormProvider","Form","styles","Flex"],"mappings":"
|
|
1
|
+
{"version":3,"file":"SignatureForm.js","sources":["../../../../src/components/Common/SignatureForm/SignatureForm.tsx"],"sourcesContent":["import { z } from 'zod'\nimport { FormProvider, useForm, type UseFormProps } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport styles from './SignatureForm.module.scss'\nimport { Form } from '@/components/Common/Form'\nimport { Flex } from '@/components/Common'\n\nexport const SignatureFormSchema = z.object({\n signature: z.string().min(1),\n confirmSignature: z.literal(true),\n})\n\nconst signatureFormDefaultValues = {\n signature: '',\n}\n\nexport type SignatureFormInputs = z.infer<typeof SignatureFormSchema>\n\ninterface SignatureFormProps {\n onSubmit: (data: SignatureFormInputs) => void | Promise<void>\n children?: React.ReactNode\n formProps?: Partial<UseFormProps<SignatureFormInputs>>\n}\n\nexport function SignatureForm({ onSubmit, children, formProps }: SignatureFormProps) {\n const methods = useForm<SignatureFormInputs>({\n resolver: zodResolver(SignatureFormSchema),\n defaultValues: signatureFormDefaultValues,\n ...formProps,\n })\n\n return (\n <FormProvider {...methods}>\n <Form onSubmit={methods.handleSubmit(onSubmit)} className={styles.container}>\n <div className={styles.formFields}>\n <Flex flexDirection=\"column\" gap={20}>\n {children}\n </Flex>\n </div>\n </Form>\n </FormProvider>\n )\n}\n"],"names":["SignatureFormSchema","z","signatureFormDefaultValues","SignatureForm","onSubmit","children","formProps","methods","useForm","zodResolver","jsx","FormProvider","Form","styles","Flex"],"mappings":";;;;;;;;;;;;AAOO,MAAMA,IAAsBC,EAAE,OAAO;AAAA,EAC1C,WAAWA,EAAE,SAAS,IAAI,CAAC;AAAA,EAC3B,kBAAkBA,EAAE,QAAQ,EAAI;AAClC,CAAC,GAEKC,IAA6B;AAAA,EACjC,WAAW;AACb;AAUO,SAASC,EAAc,EAAE,UAAAC,GAAU,UAAAC,GAAU,WAAAC,KAAiC;AACnF,QAAMC,IAAUC,EAA6B;AAAA,IAC3C,UAAUC,EAAYT,CAAmB;AAAA,IACzC,eAAeE;AAAA,IACf,GAAGI;AAAA,EAAA,CACJ;AAED,SACE,gBAAAI,EAACC,GAAA,EAAc,GAAGJ,GAChB,UAAA,gBAAAG,EAACE,GAAA,EAAK,UAAUL,EAAQ,aAAaH,CAAQ,GAAG,WAAWS,EAAO,WAChE,UAAA,gBAAAH,EAAC,OAAA,EAAI,WAAWG,EAAO,YACrB,UAAA,gBAAAH,EAACI,GAAA,EAAK,eAAc,UAAS,KAAK,IAC/B,UAAAT,EAAA,CACH,EAAA,CACF,EAAA,CACF,GACF;AAEJ;"}
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import { jsxs as m, jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import "
|
|
2
|
+
import "../../../shared/constants.js";
|
|
3
3
|
import "classnames";
|
|
4
|
-
import { ActionsLayout as
|
|
5
|
-
import
|
|
6
|
-
|
|
4
|
+
import { ActionsLayout as p } from "../ActionsLayout/ActionsLayout.js";
|
|
5
|
+
import "react-i18next";
|
|
6
|
+
import { useComponentContext as s } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
7
|
+
import "react";
|
|
8
|
+
function y({
|
|
7
9
|
onBack: t,
|
|
8
10
|
backLabel: r,
|
|
9
11
|
submitLabel: i,
|
|
10
12
|
isLoading: e = !1
|
|
11
13
|
}) {
|
|
12
|
-
const o =
|
|
13
|
-
return /* @__PURE__ */ m(
|
|
14
|
+
const o = s();
|
|
15
|
+
return /* @__PURE__ */ m(p, { children: [
|
|
14
16
|
t && /* @__PURE__ */ n(o.Button, { variant: "secondary", type: "button", onClick: t, children: r }),
|
|
15
17
|
/* @__PURE__ */ n(o.Button, { type: "submit", isLoading: e, children: i })
|
|
16
18
|
] });
|
|
17
19
|
}
|
|
18
20
|
export {
|
|
19
|
-
|
|
21
|
+
y as SignatureFormActions
|
|
20
22
|
};
|
|
21
23
|
//# sourceMappingURL=SignatureFormActions.js.map
|