@gusto/embedded-react-sdk 0.16.0 → 0.18.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 +54 -0
- package/dist/components/Base/Base.js +50 -65
- package/dist/components/Base/Base.js.map +1 -1
- package/dist/components/Base/useBase.d.ts +2 -5
- package/dist/components/Base/useBase.js.map +1 -1
- package/dist/components/Common/EmptyData/EmptyData.js +10 -10
- package/dist/components/Common/EmptyData/EmptyData.js.map +1 -1
- package/dist/components/Common/EmptyData/EmptyData.module.scss.js +5 -3
- package/dist/components/Common/EmptyData/EmptyData.module.scss.js.map +1 -1
- package/dist/components/Common/FieldDescription/FieldDescription.module.scss.js +1 -1
- package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.js +41 -33
- package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.js.map +1 -1
- package/dist/components/Common/HamburgerMenu/HamburgerMenu.js +1 -1
- package/dist/components/Common/HamburgerMenu/HamburgerMenu.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureForm.js +4 -6
- package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormActions.js +10 -12
- package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormFields.js +6 -8
- package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
- package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.d.ts +1 -1
- package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js +32 -18
- package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js.map +1 -1
- package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.module.scss.js +12 -12
- package/dist/components/Common/UI/Breadcrumbs/BreadcrumbsTypes.d.ts +14 -0
- package/dist/components/Common/UI/Breadcrumbs/BreadcrumbsTypes.js +8 -0
- package/dist/components/Common/UI/Breadcrumbs/BreadcrumbsTypes.js.map +1 -0
- package/dist/components/Common/UI/DatePicker/DatePicker.module.scss.js +8 -8
- package/dist/components/Common/UI/DescriptionList/DescriptionList.d.ts +2 -0
- package/dist/components/Common/UI/DescriptionList/DescriptionList.js +16 -0
- package/dist/components/Common/UI/DescriptionList/DescriptionList.js.map +1 -0
- package/dist/components/Common/UI/DescriptionList/DescriptionList.module.scss.js +10 -0
- package/dist/components/Common/UI/DescriptionList/DescriptionList.module.scss.js.map +1 -0
- package/dist/components/Common/UI/DescriptionList/DescriptionListTypes.d.ts +10 -0
- package/dist/components/Common/UI/DescriptionList/DescriptionListTypes.js +5 -0
- package/dist/components/Common/UI/DescriptionList/DescriptionListTypes.js.map +1 -0
- package/dist/components/Common/UI/DescriptionList/index.d.ts +3 -0
- package/dist/components/Common/UI/Dialog/Dialog.js +50 -76
- package/dist/components/Common/UI/Dialog/Dialog.js.map +1 -1
- package/dist/components/Common/UI/Dialog/Dialog.module.scss.js +8 -14
- package/dist/components/Common/UI/Dialog/Dialog.module.scss.js.map +1 -1
- package/dist/components/Common/UI/Link/LinkTypes.d.ts +7 -6
- package/dist/components/Common/UI/Modal/Modal.d.ts +2 -0
- package/dist/components/Common/UI/Modal/Modal.js +90 -0
- package/dist/components/Common/UI/Modal/Modal.js.map +1 -0
- package/dist/components/Common/UI/Modal/Modal.module.scss.js +26 -0
- package/dist/components/Common/UI/Modal/Modal.module.scss.js.map +1 -0
- package/dist/components/Common/UI/Modal/ModalTypes.d.ts +34 -0
- package/dist/components/Common/UI/Modal/ModalTypes.js +8 -0
- package/dist/components/Common/UI/Modal/ModalTypes.js.map +1 -0
- package/dist/components/Common/UI/Modal/index.d.ts +3 -0
- package/dist/components/Common/UI/Tabs/Tabs.d.ts +0 -5
- package/dist/components/Common/UI/Tabs/Tabs.js +45 -16
- package/dist/components/Common/UI/Tabs/Tabs.js.map +1 -1
- package/dist/components/Common/UI/Tabs/Tabs.module.scss.js +8 -4
- package/dist/components/Common/UI/Tabs/Tabs.module.scss.js.map +1 -1
- package/dist/components/Common/UI/Tabs/TabsTypes.d.ts +7 -0
- package/dist/components/Common/index.d.ts +0 -1
- package/dist/components/Company/AssignSignatory/AssignSignatory.js +6 -8
- package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +6 -7
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +8 -9
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +2 -3
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +2 -3
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +4 -6
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +6 -7
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +5 -6
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +9 -10
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +4 -6
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/TitleSelect.js +7 -8
- package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +6 -8
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +2 -3
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js +7 -8
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +4 -6
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountList/AccountView.js +22 -17
- package/dist/components/Company/BankAccount/BankAccountList/AccountView.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js +6 -7
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +7 -8
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +4 -5
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +5 -6
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +11 -13
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +4 -6
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +6 -8
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +4 -6
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Actions.js +6 -7
- package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Company/FederalTaxes/FederalTaxes.js +15 -17
- package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Form.js +2 -3
- package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +9 -11
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Actions.js +5 -6
- package/dist/components/Company/Industry/Actions.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +7 -9
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Industry/Edit.js +10 -11
- package/dist/components/Company/Industry/Edit.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Actions.js +2 -3
- package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Form.js +4 -5
- package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/LocationForm.js +9 -11
- package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +4 -6
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/Actions.js +2 -3
- package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/List.js +2 -3
- package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +12 -14
- package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +4 -6
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/Completed.js +5 -6
- package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js +2 -3
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +2 -4
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +4 -6
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/PaySchedule.js +39 -41
- package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Actions.js +10 -11
- package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Edit.js +35 -37
- package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Head.js +18 -19
- package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/List.js +5 -6
- package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
- package/dist/components/Company/PaySchedule/usePaySchedule.js +6 -8
- package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +5 -6
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +4 -6
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +6 -7
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js +5 -6
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +4 -6
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Contractor/Address/Address.js +3 -5
- package/dist/components/Contractor/Address/Address.js.map +1 -1
- package/dist/components/Contractor/Address/Form.js +2 -3
- package/dist/components/Contractor/Address/Form.js.map +1 -1
- package/dist/components/Contractor/Address/useAddress.js +6 -8
- package/dist/components/Contractor/Address/useAddress.js.map +1 -1
- package/dist/components/Contractor/ContractorList/index.js +15 -16
- package/dist/components/Contractor/ContractorList/index.js.map +1 -1
- package/dist/components/Contractor/NewHireReport/NewHireReport.js +13 -14
- package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +2 -3
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +2 -3
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +2 -3
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Contractor/Profile/useContractorProfile.js +3 -4
- package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
- package/dist/components/Contractor/Submit/Submit.js +2 -3
- package/dist/components/Contractor/Submit/Submit.js.map +1 -1
- package/dist/components/Employee/Compensation/Actions.js +4 -5
- package/dist/components/Employee/Compensation/Actions.js.map +1 -1
- package/dist/components/Employee/Compensation/Edit.js +10 -9
- package/dist/components/Employee/Compensation/Edit.js.map +1 -1
- package/dist/components/Employee/Compensation/List.js +5 -6
- package/dist/components/Employee/Compensation/List.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsComponents.js +1 -1
- package/dist/components/Employee/Deductions/DeductionsComponents.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.d.ts +6 -6
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.d.ts +2 -2
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js +2 -3
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +44 -40
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js.map +1 -1
- package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.js +2 -3
- package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.js.map +1 -1
- package/dist/components/Employee/Deductions/useDeductions.d.ts +2 -2
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +4 -5
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +9 -11
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js +2 -3
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +4 -6
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +11 -13
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +4 -6
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Employee/EmployeeList/Actions.js +4 -5
- package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
- package/dist/components/Employee/EmployeeList/Head.js +2 -3
- package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
- package/dist/components/Employee/EmployeeList/List.js +9 -10
- package/dist/components/Employee/EmployeeList/List.js.map +1 -1
- package/dist/components/Employee/EmployeeList/useEmployeeList.js +4 -6
- package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/Actions.js +2 -3
- package/dist/components/Employee/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/FederalForm.js +5 -6
- package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/FederalTaxes.js +8 -8
- package/dist/components/Employee/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/Head.js +6 -6
- package/dist/components/Employee/FederalTaxes/Head.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +4 -6
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Employee/Landing/Landing.js +6 -7
- package/dist/components/Employee/Landing/Landing.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/Actions.js +5 -6
- package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +4 -5
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js +3 -4
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/PaymentMethod.d.ts +1 -0
- package/dist/components/Employee/PaymentMethod/PaymentMethod.js +79 -78
- package/dist/components/Employee/PaymentMethod/PaymentMethod.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +12 -13
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/Split.js +2 -3
- package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.d.ts +1 -0
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +6 -8
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
- package/dist/components/Employee/Profile/Actions.js +6 -7
- package/dist/components/Employee/Profile/Actions.js.map +1 -1
- package/dist/components/Employee/Profile/AdminPersonalDetails.js +38 -35
- package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
- package/dist/components/Employee/Profile/HomeAddress.d.ts +52 -0
- package/dist/components/Employee/Profile/HomeAddress.js +63 -44
- package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js +20 -21
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
- package/dist/components/Employee/Profile/Profile.js +150 -143
- package/dist/components/Employee/Profile/Profile.js.map +1 -1
- package/dist/components/Employee/Profile/useProfile.d.ts +1 -0
- package/dist/components/Employee/Profile/useProfile.js +4 -6
- package/dist/components/Employee/Profile/useProfile.js.map +1 -1
- package/dist/components/Employee/StateTaxes/Actions.js +6 -7
- package/dist/components/Employee/StateTaxes/Actions.js.map +1 -1
- package/dist/components/Employee/StateTaxes/StateTaxes.js +4 -4
- package/dist/components/Employee/StateTaxes/StateTaxes.js.map +1 -1
- package/dist/components/Employee/StateTaxes/useStateTaxes.js +4 -6
- package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
- package/dist/components/Employee/Taxes/Actions.js +7 -8
- package/dist/components/Employee/Taxes/Actions.js.map +1 -1
- package/dist/components/Employee/Taxes/FederalForm.js +5 -6
- package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/Taxes/FederalHead.js +6 -6
- package/dist/components/Employee/Taxes/FederalHead.js.map +1 -1
- package/dist/components/Employee/Taxes/Taxes.js +5 -5
- package/dist/components/Employee/Taxes/Taxes.js.map +1 -1
- package/dist/components/Employee/Taxes/useTaxes.js +4 -6
- package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
- package/dist/components/Flow/Flow.js +9 -10
- package/dist/components/Flow/Flow.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +9 -10
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +101 -90
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.d.ts +5 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +135 -133
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.module.scss.js +5 -3
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.module.scss.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +127 -119
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +5 -6
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.d.ts +3 -1
- package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js +22 -22
- package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js +40 -27
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.js +50 -72
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +2 -3
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.d.ts +1 -1
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js +4 -4
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js.map +1 -1
- package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.js +20 -20
- package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollList.js +24 -21
- package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.d.ts +3 -9
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +117 -128
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js +6 -6
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +89 -78
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +195 -214
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.module.scss.js +8 -0
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.module.scss.js.map +1 -0
- package/dist/components/Payroll/usePreparedPayrollData.js +8 -10
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js +49 -45
- package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js.map +1 -1
- package/dist/contexts/ComponentAdapter/componentAdapterTypes.d.ts +2 -0
- package/dist/contexts/ComponentAdapter/useComponentContext.d.ts +4 -0
- package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +5 -7
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/helpers/apiErrorToList.d.ts +7 -0
- package/dist/helpers/apiErrorToList.js +23 -0
- package/dist/helpers/apiErrorToList.js.map +1 -0
- package/dist/helpers/breadcrumbHelpers.js +30 -30
- package/dist/helpers/breadcrumbHelpers.js.map +1 -1
- package/dist/helpers/dateFormatting.d.ts +18 -6
- package/dist/helpers/dateFormatting.js +93 -24
- package/dist/helpers/dateFormatting.js.map +1 -1
- package/dist/helpers/formattedStrings.js +11 -12
- package/dist/helpers/formattedStrings.js.map +1 -1
- package/dist/hooks/useAsyncError.js.map +1 -0
- package/dist/hooks/useDateFormatter.d.ts +19 -0
- package/dist/hooks/useDateFormatter.js +24 -0
- package/dist/hooks/useDateFormatter.js.map +1 -0
- package/dist/hooks/useMenu.js.map +1 -0
- package/dist/{components/Common/hooks → hooks}/useNumberFormatter.js +1 -1
- package/dist/hooks/useNumberFormatter.js.map +1 -0
- package/dist/hooks/useOverflowDetection/index.d.ts +3 -0
- package/dist/hooks/useOverflowDetection/useOverflowDetection.d.ts +7 -0
- package/dist/hooks/useOverflowDetection/useOverflowDetection.js +28 -0
- package/dist/hooks/useOverflowDetection/useOverflowDetection.js.map +1 -0
- package/dist/i18n/en/Company.PaySchedule.json.js +9 -9
- package/dist/i18n/en/Employee.Compensation.json.js +15 -15
- package/dist/i18n/en/Employee.Deductions.json.js +131 -105
- package/dist/i18n/en/Employee.Deductions.json.js.map +1 -1
- package/dist/i18n/en/Employee.FederalTaxes.json.js +9 -9
- package/dist/i18n/en/Employee.HomeAddress.json.js +1 -1
- package/dist/i18n/en/Employee.PaymentMethod.json.js +70 -66
- package/dist/i18n/en/Employee.PaymentMethod.json.js.map +1 -1
- package/dist/i18n/en/Employee.Taxes.json.js +25 -27
- package/dist/i18n/en/Employee.Taxes.json.js.map +1 -1
- package/dist/i18n/en/Payroll.PayrollConfiguration.json.js +17 -17
- package/dist/i18n/en/Payroll.PayrollOverview.json.js +23 -23
- package/dist/i18n/en/common.json.d.ts +2 -1
- package/dist/i18n/en/common.json.js +4 -4
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +20 -1
- package/package.json +10 -10
- package/dist/components/Common/hooks/useAsyncError.js.map +0 -1
- package/dist/components/Common/hooks/useMenu.js.map +0 -1
- package/dist/components/Common/hooks/useNumberFormatter.js.map +0 -1
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +0 -221
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +0 -1
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.module.scss.js +0 -8
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.module.scss.js.map +0 -1
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +0 -132
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +0 -1
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.module.scss.js +0 -14
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.module.scss.js.map +0 -1
- package/dist/components/Employee/Deductions/DeductionsForm/UNSTABLE_DeductionsForm.js +0 -98
- package/dist/components/Employee/Deductions/DeductionsForm/UNSTABLE_DeductionsForm.js.map +0 -1
- /package/dist/{components/Common/hooks → hooks}/useAsyncError.d.ts +0 -0
- /package/dist/{components/Common/hooks → hooks}/useAsyncError.js +0 -0
- /package/dist/{components/Common/hooks → hooks}/useMenu.d.ts +0 -0
- /package/dist/{components/Common/hooks → hooks}/useMenu.js +0 -0
- /package/dist/{components/Common/hooks → hooks}/useNumberFormatter.d.ts +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,59 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.18.0
|
|
4
|
+
|
|
5
|
+
### Features & Enhancements
|
|
6
|
+
|
|
7
|
+
- Add Modal component
|
|
8
|
+
- Update Tabs to allow for responsive behavior
|
|
9
|
+
- Update to provide all profile fields on admin review
|
|
10
|
+
- Updates UI for deductions v2
|
|
11
|
+
- Update autogenerated component adapter props docs
|
|
12
|
+
- Add error handling for payroll processing
|
|
13
|
+
|
|
14
|
+
### Fixes
|
|
15
|
+
|
|
16
|
+
- Update to restore translations in federal taxes
|
|
17
|
+
- Fix responsive layouts in payroll components
|
|
18
|
+
- Fix clearing alerts when leaving overview step
|
|
19
|
+
|
|
20
|
+
### Refactoring
|
|
21
|
+
|
|
22
|
+
- Normalize date formatting and consolidate hooks into single location
|
|
23
|
+
|
|
24
|
+
### Chores & Maintenance
|
|
25
|
+
|
|
26
|
+
- Bump react-hook-form from 7.65.0 to 7.66.0
|
|
27
|
+
- Bump typescript-eslint from 8.46.2 to 8.46.3
|
|
28
|
+
- Bump @ladle/react from 5.1.0 to 5.1.1
|
|
29
|
+
- Bump react-i18next from 16.2.3 to 16.2.4
|
|
30
|
+
- Bump eslint from 9.39.0 to 9.39.1
|
|
31
|
+
- Bump @eslint/js from 9.39.0 to 9.39.1
|
|
32
|
+
- Bump eslint from 9.38.0 to 9.39.0
|
|
33
|
+
- Bump sass-embedded from 1.93.2 to 1.93.3
|
|
34
|
+
- Bump globals from 16.4.0 to 16.5.0
|
|
35
|
+
- Bump @eslint/js from 9.38.0 to 9.39.0
|
|
36
|
+
- Bump react-i18next from 16.2.1 to 16.2.3
|
|
37
|
+
|
|
38
|
+
## 0.17.0
|
|
39
|
+
|
|
40
|
+
### Features & Enhancements
|
|
41
|
+
|
|
42
|
+
- Add payroll deadline alert to payroll configuration
|
|
43
|
+
- Enable responsive breadcrumb behavior
|
|
44
|
+
- Add DescriptionList component with flexible term/description support
|
|
45
|
+
- Update payment method copy for self onboarding
|
|
46
|
+
|
|
47
|
+
### Fixes
|
|
48
|
+
|
|
49
|
+
- Remove base image styles in favor of emptydata styles
|
|
50
|
+
- Remove unused style from base.scss
|
|
51
|
+
|
|
52
|
+
### Chores & Maintenance
|
|
53
|
+
|
|
54
|
+
- Bump react-i18next from 16.1.0 to 16.2.1
|
|
55
|
+
- Bump lint-staged from 16.2.5 to 16.2.6
|
|
56
|
+
|
|
3
57
|
## 0.16.0
|
|
4
58
|
|
|
5
59
|
### Features & Enhancements
|
|
@@ -1,81 +1,66 @@
|
|
|
1
|
-
import { jsx as o, jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { ErrorBoundary as
|
|
4
|
-
import { useTranslation as
|
|
5
|
-
import { APIError as
|
|
1
|
+
import { jsx as o, jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import { useState as f, useCallback as u, Suspense as R } from "react";
|
|
3
|
+
import { ErrorBoundary as B } from "react-error-boundary";
|
|
4
|
+
import { useTranslation as S } from "react-i18next";
|
|
5
|
+
import { APIError as E } from "@gusto/embedded-api/models/errors/apierror";
|
|
6
6
|
import { SDKValidationError as h } from "@gusto/embedded-api/models/errors/sdkvalidationerror";
|
|
7
|
-
import { UnprocessableEntityErrorObject as
|
|
8
|
-
import { QueryErrorResetBoundary as
|
|
9
|
-
import { FadeIn as
|
|
10
|
-
import { BaseContext as
|
|
11
|
-
import { componentEvents as
|
|
12
|
-
import {
|
|
13
|
-
import "
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
{
|
|
23
|
-
key: w(m + t.errorKey),
|
|
24
|
-
message: t.message ?? ""
|
|
25
|
-
}
|
|
26
|
-
];
|
|
27
|
-
if (t.category === "nested_errors" && t.errors !== void 0) {
|
|
28
|
-
let a = "";
|
|
29
|
-
return t.metadata?.key && typeof t.metadata.key == "string" ? a = t.metadata.key : t.metadata?.state && typeof t.metadata.state == "string" ? a = t.metadata.state : t.errorKey && (a = t.errorKey), t.errors.flatMap((r) => x(r, m + a));
|
|
30
|
-
}
|
|
31
|
-
return [];
|
|
32
|
-
}, ot = ({
|
|
33
|
-
children: t,
|
|
34
|
-
FallbackComponent: n = P,
|
|
35
|
-
LoaderComponent: m,
|
|
36
|
-
onEvent: a
|
|
7
|
+
import { UnprocessableEntityErrorObject as y } from "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
|
|
8
|
+
import { QueryErrorResetBoundary as j } from "@tanstack/react-query";
|
|
9
|
+
import { FadeIn as T } from "../Common/FadeIn/FadeIn.js";
|
|
10
|
+
import { BaseContext as k } from "./useBase.js";
|
|
11
|
+
import { componentEvents as v } from "../../shared/constants.js";
|
|
12
|
+
import { InternalError as w } from "../Common/InternalError/InternalError.js";
|
|
13
|
+
import { useComponentContext as O } from "../../contexts/ComponentAdapter/useComponentContext.js";
|
|
14
|
+
import { useLoadingIndicator as P } from "../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
15
|
+
import { renderErrorList as U, getFieldErrors as D } from "../../helpers/apiErrorToList.js";
|
|
16
|
+
import { useAsyncError as H } from "../../hooks/useAsyncError.js";
|
|
17
|
+
const or = ({
|
|
18
|
+
children: C,
|
|
19
|
+
FallbackComponent: x = w,
|
|
20
|
+
LoaderComponent: L,
|
|
21
|
+
onEvent: l
|
|
37
22
|
}) => {
|
|
38
|
-
const [
|
|
39
|
-
|
|
40
|
-
}, []),
|
|
41
|
-
|
|
42
|
-
},
|
|
43
|
-
async (
|
|
44
|
-
|
|
23
|
+
const [t, s] = f(null), [i, m] = f(null), c = H(), { t: b } = S(), a = O(), { LoadingIndicator: I } = P(), d = L ?? I, g = u((r) => {
|
|
24
|
+
s(r), r || m(null);
|
|
25
|
+
}, []), A = (r) => {
|
|
26
|
+
s(r), r instanceof y && Array.isArray(r.errors) && m(r.errors.flatMap((e) => D(e)));
|
|
27
|
+
}, F = u(
|
|
28
|
+
async (r, e) => {
|
|
29
|
+
s(null), m(null);
|
|
45
30
|
try {
|
|
46
|
-
await
|
|
47
|
-
} catch (
|
|
48
|
-
|
|
31
|
+
await e(r);
|
|
32
|
+
} catch (n) {
|
|
33
|
+
n instanceof E || n instanceof h || n instanceof y ? A(n) : c(n);
|
|
49
34
|
}
|
|
50
35
|
},
|
|
51
|
-
[
|
|
36
|
+
[s, c]
|
|
52
37
|
);
|
|
53
38
|
return /* @__PURE__ */ o(
|
|
54
|
-
|
|
39
|
+
k.Provider,
|
|
55
40
|
{
|
|
56
41
|
value: {
|
|
57
|
-
fieldErrors:
|
|
58
|
-
setError:
|
|
59
|
-
onEvent:
|
|
60
|
-
throwError:
|
|
61
|
-
baseSubmitHandler:
|
|
62
|
-
LoadingIndicator:
|
|
42
|
+
fieldErrors: i,
|
|
43
|
+
setError: g,
|
|
44
|
+
onEvent: l,
|
|
45
|
+
throwError: c,
|
|
46
|
+
baseSubmitHandler: F,
|
|
47
|
+
LoadingIndicator: d
|
|
63
48
|
},
|
|
64
|
-
children: /* @__PURE__ */ o(
|
|
65
|
-
|
|
49
|
+
children: /* @__PURE__ */ o(j, { children: ({ reset: r }) => /* @__PURE__ */ p(
|
|
50
|
+
B,
|
|
66
51
|
{
|
|
67
|
-
FallbackComponent:
|
|
68
|
-
onReset:
|
|
69
|
-
onError: (
|
|
70
|
-
|
|
52
|
+
FallbackComponent: x,
|
|
53
|
+
onReset: r,
|
|
54
|
+
onError: (e) => {
|
|
55
|
+
l(v.ERROR, e);
|
|
71
56
|
},
|
|
72
57
|
children: [
|
|
73
|
-
(
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
58
|
+
(t || i) && /* @__PURE__ */ p(a.Alert, { label: b("status.errorEncountered"), status: "error", children: [
|
|
59
|
+
i && /* @__PURE__ */ o(a.UnorderedList, { items: U(i) }),
|
|
60
|
+
t && t instanceof E && /* @__PURE__ */ o(a.Text, { children: t.message }),
|
|
61
|
+
t && t instanceof h && /* @__PURE__ */ o(a.Text, { as: "pre", children: t.pretty() })
|
|
77
62
|
] }),
|
|
78
|
-
/* @__PURE__ */ o(R, { fallback: /* @__PURE__ */ o(
|
|
63
|
+
/* @__PURE__ */ o(R, { fallback: /* @__PURE__ */ o(d, {}), children: /* @__PURE__ */ o(T, { children: C }) })
|
|
79
64
|
]
|
|
80
65
|
}
|
|
81
66
|
) })
|
|
@@ -83,6 +68,6 @@ const U = (t) => t.map((n) => n.message ? /* @__PURE__ */ o("li", { children: n.
|
|
|
83
68
|
);
|
|
84
69
|
};
|
|
85
70
|
export {
|
|
86
|
-
|
|
71
|
+
or as BaseComponent
|
|
87
72
|
};
|
|
88
73
|
//# 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, useState, useCallback } 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 { UnprocessableEntityErrorObject } from '@gusto/embedded-api/models/errors/unprocessableentityerrorobject'\nimport type { EntityErrorObject } from '@gusto/embedded-api/models/components/entityerrorobject'\nimport { QueryErrorResetBoundary } from '@tanstack/react-query'\nimport { FadeIn } from '../Common/FadeIn/FadeIn'\nimport { BaseContext, type FieldError, type KnownErrors, type OnEventType } from './useBase'\nimport { componentEvents, type EventType } from '@/shared/constants'\nimport { InternalError, useAsyncError } from '@/components/Common'\nimport { snakeCaseToCamelCase } from '@/helpers/formattedStrings'\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'\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?: (props: FallbackProps) => JSX.Element\n LoaderComponent?: LoadingIndicatorContextProps['LoadingIndicator']\n onEvent: OnEventType<EventType, unknown>\n}\n\n/**Traverses errorList and finds items with message properties */\nconst renderErrorList = (errorList: FieldError[]): React.ReactNode[] => {\n return errorList.map(errorFromList => {\n if (errorFromList.message) {\n return <li key={errorFromList.key}>{errorFromList.message}</li>\n }\n return null\n })\n}\n/**Recuresively parses error list and constructs an array of objects containing attribute value error messages associated with form fields. Nested errors construct '.' separated keys\n * metadata.state is a special case for state taxes validation errors\n */\nconst getFieldErrors = (\n error: EntityErrorObject,\n parentKey?: string,\n): { key: string; message: string }[] => {\n const keyPrefix = parentKey ? parentKey + '.' : ''\n if (error.category === 'invalid_attribute_value' || error.category === 'invalid_operation') {\n return [\n {\n key: snakeCaseToCamelCase(keyPrefix + error.errorKey),\n message: error.message ?? '',\n },\n ]\n }\n if (error.category === 'nested_errors' && error.errors !== undefined) {\n //TODO: clean this up once Metadata type is fixed in openapi spec\n let keySuffix = ''\n //@ts-expect-error: Metadata in speakeasy is incorrectly typed\n if (error.metadata?.key && typeof error.metadata.key === 'string') {\n //@ts-expect-error: Metadata in speakeasy is incorrectly typed\n keySuffix = error.metadata.key as string\n //@ts-expect-error: Metadata in speakeasy is incorrectly typed\n } else if (error.metadata?.state && typeof error.metadata.state === 'string') {\n //@ts-expect-error: Metadata in speakeasy is incorrectly typed\n keySuffix = error.metadata.state as string\n } else if (error.errorKey) {\n keySuffix = error.errorKey\n }\n return error.errors.flatMap(err => getFieldErrors(err, keyPrefix + keySuffix))\n }\n return []\n}\n\ntype SubmitHandler<T> = (data: T) => Promise<void>\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, setError] = useState<KnownErrors | null>(null)\n const [fieldErrors, setFieldErrors] = useState<FieldError[] | null>(null)\n const throwError = useAsyncError()\n const { t } = useTranslation()\n const Components = useComponentContext()\n\n const { LoadingIndicator: LoadingIndicatorFromContext } = useLoadingIndicator()\n\n const LoaderComponent = LoadingIndicatorFromProps ?? LoadingIndicatorFromContext\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 <BaseContext.Provider\n value={{\n fieldErrors,\n setError: setErrorWithFieldsClear,\n onEvent,\n throwError,\n baseSubmitHandler,\n LoadingIndicator: LoaderComponent,\n }}\n >\n <QueryErrorResetBoundary>\n {({ reset: resetQueries }) => (\n <ErrorBoundary\n FallbackComponent={FallbackComponent}\n onReset={resetQueries}\n onError={err => {\n onEvent(componentEvents.ERROR, err)\n }}\n >\n {(error || fieldErrors) && (\n <Components.Alert label={t('status.errorEncountered')} status=\"error\">\n {fieldErrors && <Components.UnorderedList items={renderErrorList(fieldErrors)} />}\n {error && error instanceof APIError && (\n <Components.Text>{error.message}</Components.Text>\n )}\n {error && error instanceof SDKValidationError && (\n <Components.Text as=\"pre\">{error.pretty()}</Components.Text>\n )}\n </Components.Alert>\n )}\n <Suspense fallback={<LoaderComponent />}>\n <FadeIn>{children}</FadeIn>\n </Suspense>\n </ErrorBoundary>\n )}\n </QueryErrorResetBoundary>\n </BaseContext.Provider>\n )\n}\n"],"names":["renderErrorList","errorList","errorFromList","jsx","getFieldErrors","error","parentKey","keyPrefix","snakeCaseToCamelCase","keySuffix","err","BaseComponent","children","FallbackComponent","InternalError","LoadingIndicatorFromProps","onEvent","setError","useState","fieldErrors","setFieldErrors","throwError","useAsyncError","t","useTranslation","Components","useComponentContext","LoadingIndicatorFromContext","useLoadingIndicator","LoaderComponent","setErrorWithFieldsClear","useCallback","processError","UnprocessableEntityErrorObject","baseSubmitHandler","data","componentHandler","APIError","SDKValidationError","BaseContext","QueryErrorResetBoundary","resetQueries","jsxs","ErrorBoundary","componentEvents","Suspense","FadeIn"],"mappings":";;;;;;;;;;;;;;;;;AAoCA,MAAMA,IAAkB,CAACC,MAChBA,EAAU,IAAI,CAAAC,MACfA,EAAc,UACT,gBAAAC,EAAC,MAAA,EAA4B,UAAAD,EAAc,QAAA,GAAlCA,EAAc,GAA4B,IAErD,IACR,GAKGE,IAAiB,CACrBC,GACAC,MACuC;AACvC,QAAMC,IAAYD,IAAYA,IAAY,MAAM;AAChD,MAAID,EAAM,aAAa,6BAA6BA,EAAM,aAAa;AACrE,WAAO;AAAA,MACL;AAAA,QACE,KAAKG,EAAqBD,IAAYF,EAAM,QAAQ;AAAA,QACpD,SAASA,EAAM,WAAW;AAAA,MAAA;AAAA,IAC5B;AAGJ,MAAIA,EAAM,aAAa,mBAAmBA,EAAM,WAAW,QAAW;AAEpE,QAAII,IAAY;AAEhB,WAAIJ,EAAM,UAAU,OAAO,OAAOA,EAAM,SAAS,OAAQ,WAEvDI,IAAYJ,EAAM,SAAS,MAElBA,EAAM,UAAU,SAAS,OAAOA,EAAM,SAAS,SAAU,WAElEI,IAAYJ,EAAM,SAAS,QAClBA,EAAM,aACfI,IAAYJ,EAAM,WAEbA,EAAM,OAAO,QAAQ,CAAAK,MAAON,EAAeM,GAAKH,IAAYE,CAAS,CAAC;AAAA,EAC/E;AACA,SAAO,CAAA;AACT,GAIaE,KAAgB,CAAyD;AAAA,EACpF,UAAAC;AAAA,EACA,mBAAAC,IAAoBC;AAAA,EACpB,iBAAiBC;AAAA,EACjB,SAAAC;AACF,MAA4C;AAC1C,QAAM,CAACX,GAAOY,CAAQ,IAAIC,EAA6B,IAAI,GACrD,CAACC,GAAaC,CAAc,IAAIF,EAA8B,IAAI,GAClEG,IAAaC,EAAA,GACb,EAAE,GAAAC,EAAA,IAAMC,EAAA,GACRC,IAAaC,EAAA,GAEb,EAAE,kBAAkBC,EAAA,IAAgCC,EAAA,GAEpDC,IAAkBd,KAA6BY,GAG/CG,IAA0BC,EAAY,CAAC1B,MAA8B;AACzE,IAAAY,EAASZ,CAAK,GACTA,KACHe,EAAe,IAAI;AAAA,EAEvB,GAAG,CAAA,CAAE,GAECY,IAAe,CAAC3B,MAAuB;AAC3C,IAAAY,EAASZ,CAAK,GAEVA,aAAiB4B,KAAkC,MAAM,QAAQ5B,EAAM,MAAM,KAC/Ee,EAAef,EAAM,OAAO,QAAQ,OAAOD,EAAeM,CAAG,CAAC,CAAC;AAAA,EAEnE,GAEMwB,IAAoBH;AAAA,IACxB,OAAWI,GAASC,MAAuC;AACzD,MAAAnB,EAAS,IAAI,GACbG,EAAe,IAAI;AACnB,UAAI;AACF,cAAMgB,EAAiBD,CAAI;AAAA,MAC7B,SAASzB,GAAK;AACZ,QACEA,aAAe2B,KACf3B,aAAe4B,KACf5B,aAAeuB,IAEfD,EAAatB,CAAG,MACAA,CAAG;AAAA,MACvB;AAAA,IACF;AAAA,IACA,CAACO,GAAUI,CAAU;AAAA,EAAA;AAGvB,SACE,gBAAAlB;AAAA,IAACoC,EAAY;AAAA,IAAZ;AAAA,MACC,OAAO;AAAA,QACL,aAAApB;AAAA,QACA,UAAUW;AAAA,QACV,SAAAd;AAAA,QACA,YAAAK;AAAA,QACA,mBAAAa;AAAA,QACA,kBAAkBL;AAAA,MAAA;AAAA,MAGpB,4BAACW,GAAA,EACE,UAAA,CAAC,EAAE,OAAOC,QACT,gBAAAC;AAAA,QAACC;AAAA,QAAA;AAAA,UACC,mBAAA9B;AAAA,UACA,SAAS4B;AAAA,UACT,SAAS,CAAA/B,MAAO;AACd,YAAAM,EAAQ4B,EAAgB,OAAOlC,CAAG;AAAA,UACpC;AAAA,UAEE,UAAA;AAAA,aAAAL,KAASc,MACT,gBAAAuB,EAACjB,EAAW,OAAX,EAAiB,OAAOF,EAAE,yBAAyB,GAAG,QAAO,SAC3D,UAAA;AAAA,cAAAJ,uBAAgBM,EAAW,eAAX,EAAyB,OAAOzB,EAAgBmB,CAAW,GAAG;AAAA,cAC9Ed,KAASA,aAAiBgC,KACzB,gBAAAlC,EAACsB,EAAW,MAAX,EAAiB,YAAM,SAAQ;AAAA,cAEjCpB,KAASA,aAAiBiC,KACzB,gBAAAnC,EAACsB,EAAW,MAAX,EAAgB,IAAG,OAAO,UAAApB,EAAM,OAAA,EAAO,CAAE;AAAA,YAAA,GAE9C;AAAA,YAEF,gBAAAF,EAAC0C,KAAS,UAAU,gBAAA1C,EAAC0B,KAAgB,GACnC,UAAA,gBAAA1B,EAAC2C,GAAA,EAAQ,UAAAlC,EAAA,CAAS,EAAA,CACpB;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA,EACF,CAEJ;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
1
|
+
{"version":3,"file":"Base.js","sources":["../../../src/components/Base/Base.tsx"],"sourcesContent":["import type { ReactNode, JSX } from 'react'\nimport { Suspense, useState, useCallback } 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 { UnprocessableEntityErrorObject } from '@gusto/embedded-api/models/errors/unprocessableentityerrorobject'\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 { 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 { getFieldErrors, renderErrorList } from '@/helpers/apiErrorToList'\nimport { useAsyncError } from '@/hooks/useAsyncError'\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?: (props: FallbackProps) => JSX.Element\n LoaderComponent?: LoadingIndicatorContextProps['LoadingIndicator']\n onEvent: OnEventType<EventType, unknown>\n}\n\ntype SubmitHandler<T> = (data: T) => Promise<void>\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, setError] = useState<KnownErrors | null>(null)\n const [fieldErrors, setFieldErrors] = useState<EntityErrorObject[] | null>(null)\n const throwError = useAsyncError()\n const { t } = useTranslation()\n const Components = useComponentContext()\n\n const { LoadingIndicator: LoadingIndicatorFromContext } = useLoadingIndicator()\n\n const LoaderComponent = LoadingIndicatorFromProps ?? LoadingIndicatorFromContext\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 <BaseContext.Provider\n value={{\n fieldErrors,\n setError: setErrorWithFieldsClear,\n onEvent,\n throwError,\n baseSubmitHandler,\n LoadingIndicator: LoaderComponent,\n }}\n >\n <QueryErrorResetBoundary>\n {({ reset: resetQueries }) => (\n <ErrorBoundary\n FallbackComponent={FallbackComponent}\n onReset={resetQueries}\n onError={err => {\n onEvent(componentEvents.ERROR, err)\n }}\n >\n {(error || fieldErrors) && (\n <Components.Alert label={t('status.errorEncountered')} status=\"error\">\n {fieldErrors && <Components.UnorderedList items={renderErrorList(fieldErrors)} />}\n {error && error instanceof APIError && (\n <Components.Text>{error.message}</Components.Text>\n )}\n {error && error instanceof SDKValidationError && (\n <Components.Text as=\"pre\">{error.pretty()}</Components.Text>\n )}\n </Components.Alert>\n )}\n <Suspense fallback={<LoaderComponent />}>\n <FadeIn>{children}</FadeIn>\n </Suspense>\n </ErrorBoundary>\n )}\n </QueryErrorResetBoundary>\n </BaseContext.Provider>\n )\n}\n"],"names":["BaseComponent","children","FallbackComponent","InternalError","LoadingIndicatorFromProps","onEvent","error","setError","useState","fieldErrors","setFieldErrors","throwError","useAsyncError","t","useTranslation","Components","useComponentContext","LoadingIndicatorFromContext","useLoadingIndicator","LoaderComponent","setErrorWithFieldsClear","useCallback","processError","UnprocessableEntityErrorObject","getFieldErrors","err","baseSubmitHandler","data","componentHandler","APIError","SDKValidationError","jsx","BaseContext","QueryErrorResetBoundary","resetQueries","jsxs","ErrorBoundary","componentEvents","renderErrorList","Suspense","FadeIn"],"mappings":";;;;;;;;;;;;;;;;AAsCO,MAAMA,KAAgB,CAAyD;AAAA,EACpF,UAAAC;AAAA,EACA,mBAAAC,IAAoBC;AAAA,EACpB,iBAAiBC;AAAA,EACjB,SAAAC;AACF,MAA4C;AAC1C,QAAM,CAACC,GAAOC,CAAQ,IAAIC,EAA6B,IAAI,GACrD,CAACC,GAAaC,CAAc,IAAIF,EAAqC,IAAI,GACzEG,IAAaC,EAAA,GACb,EAAE,GAAAC,EAAA,IAAMC,EAAA,GACRC,IAAaC,EAAA,GAEb,EAAE,kBAAkBC,EAAA,IAAgCC,EAAA,GAEpDC,IAAkBf,KAA6Ba,GAG/CG,IAA0BC,EAAY,CAACf,MAA8B;AACzE,IAAAC,EAASD,CAAK,GACTA,KACHI,EAAe,IAAI;AAAA,EAEvB,GAAG,CAAA,CAAE,GAECY,IAAe,CAAChB,MAAuB;AAC3C,IAAAC,EAASD,CAAK,GAEVA,aAAiBiB,KAAkC,MAAM,QAAQjB,EAAM,MAAM,KAC/EI,EAAeJ,EAAM,OAAO,QAAQ,OAAOkB,EAAeC,CAAG,CAAC,CAAC;AAAA,EAEnE,GAEMC,IAAoBL;AAAA,IACxB,OAAWM,GAASC,MAAuC;AACzD,MAAArB,EAAS,IAAI,GACbG,EAAe,IAAI;AACnB,UAAI;AACF,cAAMkB,EAAiBD,CAAI;AAAA,MAC7B,SAASF,GAAK;AACZ,QACEA,aAAeI,KACfJ,aAAeK,KACfL,aAAeF,IAEfD,EAAaG,CAAG,MACAA,CAAG;AAAA,MACvB;AAAA,IACF;AAAA,IACA,CAAClB,GAAUI,CAAU;AAAA,EAAA;AAGvB,SACE,gBAAAoB;AAAA,IAACC,EAAY;AAAA,IAAZ;AAAA,MACC,OAAO;AAAA,QACL,aAAAvB;AAAA,QACA,UAAUW;AAAA,QACV,SAAAf;AAAA,QACA,YAAAM;AAAA,QACA,mBAAAe;AAAA,QACA,kBAAkBP;AAAA,MAAA;AAAA,MAGpB,4BAACc,GAAA,EACE,UAAA,CAAC,EAAE,OAAOC,QACT,gBAAAC;AAAA,QAACC;AAAA,QAAA;AAAA,UACC,mBAAAlC;AAAA,UACA,SAASgC;AAAA,UACT,SAAS,CAAAT,MAAO;AACd,YAAApB,EAAQgC,EAAgB,OAAOZ,CAAG;AAAA,UACpC;AAAA,UAEE,UAAA;AAAA,aAAAnB,KAASG,MACT,gBAAA0B,EAACpB,EAAW,OAAX,EAAiB,OAAOF,EAAE,yBAAyB,GAAG,QAAO,SAC3D,UAAA;AAAA,cAAAJ,uBAAgBM,EAAW,eAAX,EAAyB,OAAOuB,EAAgB7B,CAAW,GAAG;AAAA,cAC9EH,KAASA,aAAiBuB,KACzB,gBAAAE,EAAChB,EAAW,MAAX,EAAiB,YAAM,SAAQ;AAAA,cAEjCT,KAASA,aAAiBwB,KACzB,gBAAAC,EAAChB,EAAW,MAAX,EAAgB,IAAG,OAAO,UAAAT,EAAM,OAAA,EAAO,CAAE;AAAA,YAAA,GAE9C;AAAA,YAEF,gBAAAyB,EAACQ,KAAS,UAAU,gBAAAR,EAACZ,KAAgB,GACnC,UAAA,gBAAAY,EAACS,GAAA,EAAQ,UAAAvC,EAAA,CAAS,EAAA,CACpB;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA,EACF,CAEJ;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import { APIError } from '@gusto/embedded-api/models/errors/apierror';
|
|
2
2
|
import { SDKValidationError } from '@gusto/embedded-api/models/errors/sdkvalidationerror';
|
|
3
3
|
import { UnprocessableEntityErrorObject } from '@gusto/embedded-api/models/errors/unprocessableentityerrorobject';
|
|
4
|
+
import { EntityErrorObject } from '@gusto/embedded-api/models/components/entityerrorobject';
|
|
4
5
|
import { EventType } from '../../shared/constants';
|
|
5
6
|
import { LoadingIndicatorContextProps } from '../../contexts/LoadingIndicatorProvider/useLoadingIndicator';
|
|
6
7
|
export type OnEventType<K, T> = (type: K, data?: T) => void;
|
|
7
8
|
export type KnownErrors = APIError | SDKValidationError | UnprocessableEntityErrorObject;
|
|
8
|
-
export type FieldError = {
|
|
9
|
-
key: string;
|
|
10
|
-
message: string;
|
|
11
|
-
};
|
|
12
9
|
interface BaseContextProps {
|
|
13
|
-
fieldErrors:
|
|
10
|
+
fieldErrors: Array<EntityErrorObject> | null;
|
|
14
11
|
setError: (err: KnownErrors | null) => void;
|
|
15
12
|
onEvent: OnEventType<EventType, unknown>;
|
|
16
13
|
throwError: (e: unknown) => void;
|
|
@@ -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 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\
|
|
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 throwError: (e: unknown) => void\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;"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import { useTranslation as
|
|
1
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation as r } from "react-i18next";
|
|
3
3
|
import { Flex as l } from "../Flex/Flex.js";
|
|
4
|
-
import
|
|
4
|
+
import m from "./EmptyData.module.scss.js";
|
|
5
5
|
import c from "../../../assets/icons/magnifyingGlass.png.js";
|
|
6
6
|
import { useComponentContext as f } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
7
|
-
function h({ title:
|
|
8
|
-
const { t:
|
|
9
|
-
return /* @__PURE__ */ t("div", { className:
|
|
10
|
-
/* @__PURE__ */ t("img", { src: c, alt:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
function h({ title: e, description: a, children: o }) {
|
|
8
|
+
const { t: i } = r(), { Text: s } = f();
|
|
9
|
+
return /* @__PURE__ */ t("div", { className: m.emptyData, "data-testid": "emptydata", children: /* @__PURE__ */ n(l, { flexDirection: "column", alignItems: "center", children: [
|
|
10
|
+
/* @__PURE__ */ t("img", { src: c, alt: i("icons.magnifyingGlass"), className: m.image }),
|
|
11
|
+
e && /* @__PURE__ */ t(s, { weight: "bold", className: m.title, children: e }),
|
|
12
|
+
a && /* @__PURE__ */ t(s, { children: a }),
|
|
13
|
+
o && o
|
|
14
14
|
] }) });
|
|
15
15
|
}
|
|
16
16
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmptyData.js","sources":["../../../../src/components/Common/EmptyData/EmptyData.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { Flex } from '../Flex/Flex'\nimport styles from './EmptyData.module.scss'\nimport magnifyingGlass from '@/assets/icons/magnifyingGlass.png'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\ntype EmptyDataProps = {\n title?: string\n description?: string\n children?: React.ReactNode\n}\nexport function EmptyData({ title, description, children }: EmptyDataProps) {\n const { t } = useTranslation()\n const { Text } = useComponentContext()\n return (\n <div className={styles.emptyData} data-testid=\"emptydata\">\n <Flex flexDirection=\"column\" alignItems=\"center\">\n <img src={magnifyingGlass} alt={t('icons.magnifyingGlass')} />\n {title && (\n <Text weight=\"bold\" className={styles.title}>\n {title}\n </Text>\n )}\n {description && <Text>{description}</Text>}\n {children && children}\n </Flex>\n </div>\n )\n}\n"],"names":["EmptyData","title","description","children","t","useTranslation","Text","useComponentContext","jsx","styles","jsxs","Flex","magnifyingGlass"],"mappings":";;;;;;AAWO,SAASA,EAAU,EAAE,OAAAC,GAAO,aAAAC,GAAa,UAAAC,KAA4B;AAC1E,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAA,GACR,EAAE,MAAAC,EAAA,IAASC,EAAA;AACjB,SACE,gBAAAC,EAAC,OAAA,EAAI,WAAWC,EAAO,WAAW,eAAY,aAC5C,UAAA,gBAAAC,EAACC,GAAA,EAAK,eAAc,UAAS,YAAW,UACtC,UAAA;AAAA,IAAA,gBAAAH,EAAC,
|
|
1
|
+
{"version":3,"file":"EmptyData.js","sources":["../../../../src/components/Common/EmptyData/EmptyData.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { Flex } from '../Flex/Flex'\nimport styles from './EmptyData.module.scss'\nimport magnifyingGlass from '@/assets/icons/magnifyingGlass.png'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\ntype EmptyDataProps = {\n title?: string\n description?: string\n children?: React.ReactNode\n}\nexport function EmptyData({ title, description, children }: EmptyDataProps) {\n const { t } = useTranslation()\n const { Text } = useComponentContext()\n return (\n <div className={styles.emptyData} data-testid=\"emptydata\">\n <Flex flexDirection=\"column\" alignItems=\"center\">\n <img src={magnifyingGlass} alt={t('icons.magnifyingGlass')} className={styles.image} />\n {title && (\n <Text weight=\"bold\" className={styles.title}>\n {title}\n </Text>\n )}\n {description && <Text>{description}</Text>}\n {children && children}\n </Flex>\n </div>\n )\n}\n"],"names":["EmptyData","title","description","children","t","useTranslation","Text","useComponentContext","jsx","styles","jsxs","Flex","magnifyingGlass"],"mappings":";;;;;;AAWO,SAASA,EAAU,EAAE,OAAAC,GAAO,aAAAC,GAAa,UAAAC,KAA4B;AAC1E,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAA,GACR,EAAE,MAAAC,EAAA,IAASC,EAAA;AACjB,SACE,gBAAAC,EAAC,OAAA,EAAI,WAAWC,EAAO,WAAW,eAAY,aAC5C,UAAA,gBAAAC,EAACC,GAAA,EAAK,eAAc,UAAS,YAAW,UACtC,UAAA;AAAA,IAAA,gBAAAH,EAAC,OAAA,EAAI,KAAKI,GAAiB,KAAKR,EAAE,uBAAuB,GAAG,WAAWK,EAAO,MAAA,CAAO;AAAA,IACpFR,uBACEK,GAAA,EAAK,QAAO,QAAO,WAAWG,EAAO,OACnC,UAAAR,EAAA,CACH;AAAA,IAEDC,KAAe,gBAAAM,EAACF,GAAA,EAAM,UAAAJ,EAAA,CAAY;AAAA,IAClCC,KAAYA;AAAA,EAAA,EAAA,CACf,EAAA,CACF;AAEJ;"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
const t = "
|
|
1
|
+
const t = "_emptyData_19niy_1", e = "_title_19niy_11", a = "_image_19niy_17", i = {
|
|
2
2
|
emptyData: t,
|
|
3
|
-
title: e
|
|
3
|
+
title: e,
|
|
4
|
+
image: a
|
|
4
5
|
};
|
|
5
6
|
export {
|
|
6
|
-
|
|
7
|
+
i as default,
|
|
7
8
|
t as emptyData,
|
|
9
|
+
a as image,
|
|
8
10
|
e as title
|
|
9
11
|
};
|
|
10
12
|
//# sourceMappingURL=EmptyData.module.scss.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmptyData.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"EmptyData.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -1,52 +1,60 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useTranslation as
|
|
3
|
-
import { useMemo as
|
|
1
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation as h } from "react-i18next";
|
|
3
|
+
import { useRef as C, useMemo as d } from "react";
|
|
4
4
|
import { useComponentContext as u } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
5
5
|
import { componentEvents as B } from "../../../shared/constants.js";
|
|
6
|
-
import { useI18n as
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
import { useI18n as k } from "../../../i18n/I18n.js";
|
|
7
|
+
import { useLocale as g } from "../../../contexts/LocaleProvider/useLocale.js";
|
|
8
|
+
import { useContainerBreakpoints as R } from "../../../hooks/useContainerBreakpoints/useContainerBreakpoints.js";
|
|
9
|
+
import { useDateFormatter as V } from "../../../hooks/useDateFormatter.js";
|
|
10
|
+
function Y({
|
|
11
|
+
breadcrumbs: a,
|
|
12
|
+
currentBreadcrumbId: f,
|
|
13
|
+
onEvent: s
|
|
11
14
|
}) {
|
|
12
|
-
const {
|
|
13
|
-
(
|
|
15
|
+
const i = C(null), m = R({ ref: i }).length === 1, { Breadcrumbs: c } = u(), { locale: v } = g(), r = V(), l = a.reduce(
|
|
16
|
+
(t, e) => (e.namespace && t.push(e.namespace), t),
|
|
14
17
|
[]
|
|
15
18
|
);
|
|
16
|
-
|
|
17
|
-
const { t } =
|
|
18
|
-
() =>
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
k(l);
|
|
20
|
+
const { t: o } = h(l), D = d(
|
|
21
|
+
() => a.map((t) => {
|
|
22
|
+
const e = t.variables ? {
|
|
23
|
+
...t.variables,
|
|
24
|
+
startDate: typeof t.variables.startDate == "string" ? r.formatShortWithYear(t.variables.startDate) : t.variables.startDate,
|
|
25
|
+
endDate: typeof t.variables.endDate == "string" ? r.formatShortWithYear(t.variables.endDate) : t.variables.endDate
|
|
26
|
+
} : void 0, n = t.namespace ? o(t.label, {
|
|
27
|
+
ns: t.namespace,
|
|
28
|
+
defaultValue: t.label,
|
|
29
|
+
...e
|
|
30
|
+
}) : o(t.label, {
|
|
31
|
+
defaultValue: t.label,
|
|
32
|
+
...e
|
|
26
33
|
});
|
|
27
34
|
return {
|
|
28
|
-
id:
|
|
35
|
+
id: t.id,
|
|
29
36
|
label: n
|
|
30
37
|
};
|
|
31
38
|
}),
|
|
32
|
-
[o,
|
|
39
|
+
[a, o, v]
|
|
33
40
|
);
|
|
34
|
-
return /* @__PURE__ */
|
|
35
|
-
|
|
41
|
+
return /* @__PURE__ */ p("div", { ref: i, children: /* @__PURE__ */ p(
|
|
42
|
+
c,
|
|
36
43
|
{
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
+
isSmallContainer: m,
|
|
45
|
+
breadcrumbs: D,
|
|
46
|
+
currentBreadcrumbId: f,
|
|
47
|
+
onClick: (t) => {
|
|
48
|
+
const e = a.find((n) => n.id === t);
|
|
49
|
+
s && e && s(B.BREADCRUMB_NAVIGATE, {
|
|
50
|
+
key: t,
|
|
51
|
+
onNavigate: e.onNavigate
|
|
44
52
|
});
|
|
45
53
|
}
|
|
46
54
|
}
|
|
47
|
-
);
|
|
55
|
+
) });
|
|
48
56
|
}
|
|
49
57
|
export {
|
|
50
|
-
|
|
58
|
+
Y as FlowBreadcrumbs
|
|
51
59
|
};
|
|
52
60
|
//# sourceMappingURL=FlowBreadcrumbs.js.map
|
|
@@ -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 } from 'react'\nimport type { FlowBreadcrumbsProps } from './FlowBreadcrumbsTypes'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { componentEvents } from '@/shared/constants'\nimport { useI18n } from '@/i18n/I18n'\n\nexport function FlowBreadcrumbs({\n breadcrumbs,\n currentBreadcrumbId,\n onEvent,\n}: FlowBreadcrumbsProps) {\n const { Breadcrumbs } = useComponentContext()\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(namespaces)\n
|
|
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(namespaces)\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,EAAeL,CAAU,GACjCM,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,7 +2,7 @@ import { jsxs as f, Fragment as b, jsx as o } from "react/jsx-runtime";
|
|
|
2
2
|
import { useTranslation as g } from "react-i18next";
|
|
3
3
|
import { useComponentContext as C } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
4
4
|
import x from "../../../assets/icons/hamburger.svg.js";
|
|
5
|
-
import { useMenu as M } from "
|
|
5
|
+
import { useMenu as M } from "../../../hooks/useMenu.js";
|
|
6
6
|
function T({
|
|
7
7
|
items: t,
|
|
8
8
|
triggerLabel: s,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HamburgerMenu.js","sources":["../../../../src/components/Common/HamburgerMenu/HamburgerMenu.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { type HamburgerMenuProps } from './HamburgerMenuTypes'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport HamburgerIcon from '@/assets/icons/hamburger.svg?react'\nimport { useMenu } from '@/
|
|
1
|
+
{"version":3,"file":"HamburgerMenu.js","sources":["../../../../src/components/Common/HamburgerMenu/HamburgerMenu.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { type HamburgerMenuProps } from './HamburgerMenuTypes'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport HamburgerIcon from '@/assets/icons/hamburger.svg?react'\nimport { useMenu } from '@/hooks/useMenu'\n\nexport function HamburgerMenu({\n items,\n triggerLabel,\n menuLabel,\n onClose,\n isLoading = false,\n ...props\n}: HamburgerMenuProps) {\n const { t } = useTranslation('common')\n const Components = useComponentContext()\n const { triggerProps, menuProps } = useMenu()\n\n const { ref, ...restTriggerProps } = triggerProps\n\n return (\n <>\n <Components.ButtonIcon\n isLoading={isLoading}\n aria-label={triggerLabel || t('labels.openMenu')}\n buttonRef={ref}\n {...restTriggerProps}\n >\n <HamburgerIcon />\n </Components.ButtonIcon>\n <Components.Menu\n {...menuProps}\n items={items}\n aria-label={menuLabel || t('labels.menuLabel')}\n onClose={onClose || menuProps.onClose}\n {...props}\n />\n </>\n )\n}\n"],"names":["HamburgerMenu","items","triggerLabel","menuLabel","onClose","isLoading","props","t","useTranslation","Components","useComponentContext","triggerProps","menuProps","useMenu","ref","restTriggerProps","jsxs","Fragment","jsx","HamburgerIcon"],"mappings":";;;;;AAMO,SAASA,EAAc;AAAA,EAC5B,OAAAC;AAAA,EACA,cAAAC;AAAA,EACA,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,GAAGC;AACL,GAAuB;AACrB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,QAAQ,GAC/BC,IAAaC,EAAA,GACb,EAAE,cAAAC,GAAc,WAAAC,EAAA,IAAcC,EAAA,GAE9B,EAAE,KAAAC,GAAK,GAAGC,EAAA,IAAqBJ;AAErC,SACE,gBAAAK,EAAAC,GAAA,EACE,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAACT,EAAW;AAAA,MAAX;AAAA,QACC,WAAAJ;AAAA,QACA,cAAYH,KAAgBK,EAAE,iBAAiB;AAAA,QAC/C,WAAWO;AAAA,QACV,GAAGC;AAAA,QAEJ,4BAACI,GAAA,CAAA,CAAc;AAAA,MAAA;AAAA,IAAA;AAAA,IAEjB,gBAAAD;AAAA,MAACT,EAAW;AAAA,MAAX;AAAA,QACE,GAAGG;AAAA,QACJ,OAAAX;AAAA,QACA,cAAYE,KAAaI,EAAE,kBAAkB;AAAA,QAC7C,SAASH,KAAWQ,EAAU;AAAA,QAC7B,GAAGN;AAAA,MAAA;AAAA,IAAA;AAAA,EACN,GACF;AAEJ;"}
|
|
@@ -5,24 +5,22 @@ import { zodResolver as l } from "@hookform/resolvers/zod";
|
|
|
5
5
|
import t 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
|
-
import "classnames";
|
|
10
8
|
const f = o.object({
|
|
11
9
|
signature: o.string().min(1),
|
|
12
10
|
confirmSignature: o.literal(!0)
|
|
13
|
-
}),
|
|
11
|
+
}), d = {
|
|
14
12
|
signature: ""
|
|
15
13
|
};
|
|
16
|
-
function
|
|
14
|
+
function b({ onSubmit: m, children: i, formProps: n }) {
|
|
17
15
|
const e = s({
|
|
18
16
|
resolver: l(f),
|
|
19
|
-
defaultValues:
|
|
17
|
+
defaultValues: d,
|
|
20
18
|
...n
|
|
21
19
|
});
|
|
22
20
|
return /* @__PURE__ */ r(a, { ...e, children: /* @__PURE__ */ r(u, { onSubmit: e.handleSubmit(m), className: t.container, children: /* @__PURE__ */ r("div", { className: t.formFields, children: /* @__PURE__ */ r(c, { flexDirection: "column", gap: 20, children: i }) }) }) });
|
|
23
21
|
}
|
|
24
22
|
export {
|
|
25
|
-
|
|
23
|
+
b as SignatureForm,
|
|
26
24
|
f as SignatureFormSchema
|
|
27
25
|
};
|
|
28
26
|
//# 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,19 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import "
|
|
3
|
-
import "
|
|
4
|
-
|
|
5
|
-
import { useComponentContext as p } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
6
|
-
function d({
|
|
1
|
+
import { jsxs as s, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { ActionsLayout as m } from "../ActionsLayout/ActionsLayout.js";
|
|
3
|
+
import { useComponentContext as u } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
4
|
+
function f({
|
|
7
5
|
onBack: t,
|
|
8
6
|
backLabel: r,
|
|
9
|
-
submitLabel:
|
|
10
|
-
isLoading:
|
|
7
|
+
submitLabel: e,
|
|
8
|
+
isLoading: i = !1
|
|
11
9
|
}) {
|
|
12
|
-
const o =
|
|
13
|
-
return /* @__PURE__ */ m
|
|
10
|
+
const o = u();
|
|
11
|
+
return /* @__PURE__ */ s(m, { children: [
|
|
14
12
|
t && /* @__PURE__ */ n(o.Button, { variant: "secondary", type: "button", onClick: t, children: r }),
|
|
15
|
-
/* @__PURE__ */ n(o.Button, { type: "submit", isLoading:
|
|
13
|
+
/* @__PURE__ */ n(o.Button, { type: "submit", isLoading: i, children: e })
|
|
16
14
|
] });
|
|
17
15
|
}
|
|
18
16
|
export {
|
|
19
|
-
|
|
17
|
+
f as SignatureFormActions
|
|
20
18
|
};
|
|
21
19
|
//# sourceMappingURL=SignatureFormActions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignatureFormActions.js","sources":["../../../../src/components/Common/SignatureForm/SignatureFormActions.tsx"],"sourcesContent":["import { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\ninterface SignatureFormActionsProps {\n onBack?: () => void\n backLabel: string\n submitLabel: string\n isLoading?: boolean\n}\n\nexport function SignatureFormActions({\n onBack,\n backLabel,\n submitLabel,\n isLoading = false,\n}: SignatureFormActionsProps) {\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n {onBack && (\n <Components.Button variant=\"secondary\" type=\"button\" onClick={onBack}>\n {backLabel}\n </Components.Button>\n )}\n <Components.Button type=\"submit\" isLoading={isLoading}>\n {submitLabel}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["SignatureFormActions","onBack","backLabel","submitLabel","isLoading","Components","useComponentContext","ActionsLayout","jsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"SignatureFormActions.js","sources":["../../../../src/components/Common/SignatureForm/SignatureFormActions.tsx"],"sourcesContent":["import { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\ninterface SignatureFormActionsProps {\n onBack?: () => void\n backLabel: string\n submitLabel: string\n isLoading?: boolean\n}\n\nexport function SignatureFormActions({\n onBack,\n backLabel,\n submitLabel,\n isLoading = false,\n}: SignatureFormActionsProps) {\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n {onBack && (\n <Components.Button variant=\"secondary\" type=\"button\" onClick={onBack}>\n {backLabel}\n </Components.Button>\n )}\n <Components.Button type=\"submit\" isLoading={isLoading}>\n {submitLabel}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["SignatureFormActions","onBack","backLabel","submitLabel","isLoading","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;AAUO,SAASA,EAAqB;AAAA,EACnC,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,WAAAC,IAAY;AACd,GAA8B;AAC5B,QAAMC,IAAaC,EAAA;AAEnB,2BACGC,GAAA,EACE,UAAA;AAAA,IAAAN,KACC,gBAAAO,EAACH,EAAW,QAAX,EAAkB,SAAQ,aAAY,MAAK,UAAS,SAASJ,GAC3D,UAAAC,EAAA,CACH;AAAA,sBAEDG,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAAD,GAC9B,UAAAD,EAAA,CACH;AAAA,EAAA,GACF;AAEJ;"}
|