@gusto/embedded-react-sdk 0.12.1 → 0.12.3
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 +133 -0
- package/dist/_virtual/dynamic-import-helper.js +1 -8
- package/dist/_virtual/dynamic-import-helper.js.map +1 -1
- package/dist/components/Base/Base.js +23 -22
- package/dist/components/Base/Base.js.map +1 -1
- package/dist/components/Common/ReorderableList/DropZone.js +1 -1
- package/dist/components/Common/ReorderableList/DropZone.js.map +1 -1
- package/dist/components/Common/ReorderableList/ReorderableItem.js +1 -1
- package/dist/components/Common/ReorderableList/ReorderableItem.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureForm.js +7 -5
- package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormActions.js +12 -10
- package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormFields.js +8 -6
- package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
- package/dist/components/Common/UI/CalendarPreview/CalendarPreview.js +1 -1
- package/dist/components/Common/UI/DatePicker/DatePicker.js +1 -1
- package/dist/components/Common/hooks/useNumberFormatter.js +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatory.js +4 -3
- package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +8 -6
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +10 -8
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +5 -5
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +11 -11
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +4 -8
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +8 -6
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +4 -4
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +4 -8
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/TitleSelect.js +8 -7
- package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +6 -10
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccount.js +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +9 -8
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.js +2 -2
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js +11 -9
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +4 -8
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js +12 -10
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountList/BankAccountList.js +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +13 -11
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/BankAccountVerify.js +2 -2
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +6 -4
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +7 -5
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +9 -8
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +4 -8
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentSigner.js +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +6 -5
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +4 -8
- 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 +10 -9
- package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Form.js +6 -4
- package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +12 -16
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Actions.js +7 -5
- package/dist/components/Company/Industry/Actions.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +7 -11
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Industry/Edit.js +12 -10
- package/dist/components/Company/Industry/Edit.js.map +1 -1
- package/dist/components/Company/Industry/Industry.js +2 -2
- package/dist/components/Company/Locations/LocationForm/Actions.js +8 -6
- package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Form.js +1 -1
- package/dist/components/Company/Locations/LocationForm/LocationForm.js +8 -7
- package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +4 -8
- 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 +4 -2
- package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +10 -9
- package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +4 -8
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/Completed.js +14 -12
- package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js +8 -6
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +4 -3
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +4 -8
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/PaySchedule.js +9 -8
- package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Actions.js +12 -10
- package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Edit.js +14 -14
- package/dist/components/Company/PaySchedule/_parts/Head.js +8 -6
- package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/List.js +15 -13
- package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
- package/dist/components/Company/PaySchedule/usePaySchedule.js +7 -11
- package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +7 -5
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js +3 -3
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +4 -8
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +8 -6
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js +7 -5
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +4 -8
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Contractor/Address/Address.js +9 -8
- package/dist/components/Contractor/Address/Address.js.map +1 -1
- package/dist/components/Contractor/Address/Form.js +1 -1
- package/dist/components/Contractor/Address/useAddress.js +6 -10
- package/dist/components/Contractor/Address/useAddress.js.map +1 -1
- package/dist/components/Contractor/ContractorList/index.js +26 -25
- package/dist/components/Contractor/ContractorList/index.js.map +1 -1
- package/dist/components/Contractor/ContractorList/useContractorList.js +1 -1
- package/dist/components/Contractor/NewHireReport/NewHireReport.js +20 -19
- package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +7 -5
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +87 -85
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +3 -2
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Contractor/Profile/ContractorProfile.js +1 -1
- package/dist/components/Contractor/Profile/ContractorProfileForm.js +13 -13
- package/dist/components/Contractor/Profile/useContractorProfile.js +36 -40
- package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
- package/dist/components/Contractor/Submit/Submit.js +7 -6
- package/dist/components/Contractor/Submit/Submit.js.map +1 -1
- package/dist/components/Employee/Compensation/Actions.js +6 -5
- package/dist/components/Employee/Compensation/Actions.js.map +1 -1
- package/dist/components/Employee/Compensation/Compensation.js +10 -10
- package/dist/components/Employee/Compensation/Compensation.js.map +1 -1
- package/dist/components/Employee/Compensation/Edit.js +15 -14
- package/dist/components/Employee/Compensation/Edit.js.map +1 -1
- package/dist/components/Employee/Compensation/List.js +25 -23
- package/dist/components/Employee/Compensation/List.js.map +1 -1
- package/dist/components/Employee/Compensation/useCompensation.js +1 -1
- package/dist/components/Employee/Compensation/useCompensation.js.map +1 -1
- package/dist/components/Employee/Deductions/Deductions.js +1 -1
- package/dist/components/Employee/Deductions/Deductions.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js +15 -14
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +10 -9
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js.map +1 -1
- package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.js +12 -11
- package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.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 +8 -7
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js +4 -2
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +4 -8
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +11 -10
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +4 -8
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Employee/EmployeeList/Actions.js +6 -4
- package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
- package/dist/components/Employee/EmployeeList/EmployeeList.js +7 -6
- 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 +15 -14
- package/dist/components/Employee/EmployeeList/List.js.map +1 -1
- package/dist/components/Employee/EmployeeList/useEmployeeList.js +4 -8
- package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/Actions.d.ts +1 -0
- package/dist/components/Employee/FederalTaxes/Actions.js +15 -0
- package/dist/components/Employee/FederalTaxes/Actions.js.map +1 -0
- package/dist/components/Employee/FederalTaxes/FederalForm.d.ts +29 -0
- package/dist/components/Employee/FederalTaxes/FederalForm.js +110 -0
- package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -0
- package/dist/components/Employee/FederalTaxes/FederalTaxes.d.ts +6 -0
- package/dist/components/Employee/FederalTaxes/FederalTaxes.js +72 -0
- package/dist/components/Employee/FederalTaxes/FederalTaxes.js.map +1 -0
- package/dist/components/Employee/FederalTaxes/Head.d.ts +1 -0
- package/dist/components/Employee/FederalTaxes/Head.js +24 -0
- package/dist/components/Employee/FederalTaxes/Head.js.map +1 -0
- package/dist/components/Employee/FederalTaxes/index.d.ts +2 -0
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.d.ts +5 -0
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +16 -0
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -0
- package/dist/components/Employee/Landing/Landing.js +15 -14
- package/dist/components/Employee/Landing/Landing.js.map +1 -1
- package/dist/components/Employee/OnboardingFlow/OnboardingFlow.d.ts +1 -19
- package/dist/components/Employee/OnboardingFlow/OnboardingFlow.js.map +1 -1
- package/dist/components/Employee/OnboardingFlow/OnboardingFlowComponents.d.ts +22 -0
- package/dist/components/Employee/OnboardingFlow/OnboardingFlowComponents.js +18 -0
- package/dist/components/Employee/OnboardingFlow/OnboardingFlowComponents.js.map +1 -0
- package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.d.ts +2 -1
- package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.js +72 -63
- package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.js.map +1 -1
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +9 -9
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/Actions.js +9 -7
- package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +6 -5
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js +10 -8
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/PaymentMethod.js +8 -8
- package/dist/components/Employee/PaymentMethod/PaymentMethod.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +3 -2
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/Split.js +12 -11
- package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +10 -14
- 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 -9
- package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
- package/dist/components/Employee/Profile/HomeAddress.js +1 -1
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js +2 -2
- package/dist/components/Employee/Profile/Profile.js +13 -13
- package/dist/components/Employee/Profile/Profile.js.map +1 -1
- package/dist/components/Employee/Profile/useProfile.js +4 -8
- package/dist/components/Employee/Profile/useProfile.js.map +1 -1
- package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingComponents.d.ts +2 -1
- package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingComponents.js +37 -24
- package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingComponents.js.map +1 -1
- package/dist/components/Employee/SelfOnboardingFlow/selfOnboardingMachine.d.ts +2 -1
- package/dist/components/Employee/SelfOnboardingFlow/selfOnboardingMachine.js +31 -19
- package/dist/components/Employee/SelfOnboardingFlow/selfOnboardingMachine.js.map +1 -1
- package/dist/components/Employee/StateTaxes/Actions.d.ts +1 -0
- package/dist/components/Employee/StateTaxes/Actions.js +15 -0
- package/dist/components/Employee/StateTaxes/Actions.js.map +1 -0
- package/dist/components/Employee/StateTaxes/StateForm.d.ts +10 -0
- package/dist/components/Employee/StateTaxes/StateForm.js +34 -0
- package/dist/components/Employee/StateTaxes/StateForm.js.map +1 -0
- package/dist/components/Employee/StateTaxes/StateTaxes.d.ts +7 -0
- package/dist/components/Employee/StateTaxes/StateTaxes.js +90 -0
- package/dist/components/Employee/StateTaxes/StateTaxes.js.map +1 -0
- package/dist/components/Employee/StateTaxes/index.d.ts +2 -0
- package/dist/components/Employee/StateTaxes/useStateTaxes.d.ts +8 -0
- package/dist/components/Employee/StateTaxes/useStateTaxes.js +16 -0
- package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -0
- 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/Taxes.d.ts +5 -0
- package/dist/components/Employee/Taxes/Taxes.js +73 -85
- package/dist/components/Employee/Taxes/Taxes.js.map +1 -1
- package/dist/components/Employee/Taxes/useTaxes.js +4 -8
- package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
- package/dist/components/Employee/index.d.ts +3 -1
- package/dist/components/Employee/index.js +16 -12
- package/dist/components/Employee/index.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +8 -6
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +12 -10
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +10 -8
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +11 -9
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
- package/dist/contexts/ApiProvider/ApiProvider.js +4 -4
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +7 -5
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/contexts/ThemeProvider/ThemeProvider.js +7 -7
- package/dist/contexts/ThemeProvider/ThemeProvider.js.map +1 -1
- package/dist/i18n/I18n.js +1 -1
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Employee.FederalTaxes.json.js +46 -0
- package/dist/i18n/en/Employee.FederalTaxes.json.js.map +1 -0
- package/dist/i18n/en/Employee.StateTaxes.json.js +6 -10
- package/dist/i18n/en/Employee.StateTaxes.json.js.map +1 -1
- package/dist/i18n/en/Employee.Taxes.json.js +7 -7
- package/dist/shared/constants.d.ts +4 -2
- package/dist/shared/constants.js +10 -9
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +27 -4
- package/package.json +5 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,138 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.12.3
|
|
4
|
+
|
|
5
|
+
### Features & Enhancements
|
|
6
|
+
|
|
7
|
+
- Separate `Employee.Taxes` into separate `Employee.StateTaxes` and `Employee.FederalTaxes` components and deprecate `Employee.Taxes` (See upgrade guide below)
|
|
8
|
+
- Add CTA (Call to Action) functionality to ProgressBar component
|
|
9
|
+
- Expose Payroll components as UNSTABLE for early access
|
|
10
|
+
- Add Payroll Submit API call functionality
|
|
11
|
+
|
|
12
|
+
### Fixes
|
|
13
|
+
|
|
14
|
+
- Fix documentation links ending with .md extension
|
|
15
|
+
|
|
16
|
+
### Chores & Maintenance
|
|
17
|
+
|
|
18
|
+
- Upgrade various development dependencies for improved stability
|
|
19
|
+
- Update embedded API to latest version
|
|
20
|
+
|
|
21
|
+
### Migrating `Employee.Taxes` to `Employee.StateTaxes` and `Employee.FederalTaxes`
|
|
22
|
+
|
|
23
|
+
We have split the `Employee.Taxes` component into dedicated `Employee.StateTaxes` and `Employee.FederalTaxes` components. The `Employee.Taxes` component is now deprecated and will be removed in a future version.
|
|
24
|
+
|
|
25
|
+
#### Component Usage
|
|
26
|
+
|
|
27
|
+
**Before (using combined Employee.Taxes):**
|
|
28
|
+
|
|
29
|
+
```tsx
|
|
30
|
+
import { Employee } from '@gusto/embedded-react-sdk'
|
|
31
|
+
|
|
32
|
+
// In employee onboarding flow
|
|
33
|
+
<Employee.Taxes
|
|
34
|
+
employeeId="employee-id"
|
|
35
|
+
isAdmin
|
|
36
|
+
onEvent={(eventType) => {
|
|
37
|
+
if (eventType === componentEvents.EMPLOYEE_TAXES_DONE) {
|
|
38
|
+
// called when taxes is done
|
|
39
|
+
}
|
|
40
|
+
}}
|
|
41
|
+
/>
|
|
42
|
+
|
|
43
|
+
// In self-onboarding flow
|
|
44
|
+
<Employee.Taxes
|
|
45
|
+
employeeId="employee-id"
|
|
46
|
+
isAdmin={false}
|
|
47
|
+
onEvent={(eventType) => {
|
|
48
|
+
if (eventType === componentEvents.EMPLOYEE_TAXES_DONE) {
|
|
49
|
+
// called when taxes is done
|
|
50
|
+
}
|
|
51
|
+
}}
|
|
52
|
+
/>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
**After (using separate components):**
|
|
56
|
+
|
|
57
|
+
```tsx
|
|
58
|
+
import { Employee } from '@gusto/embedded-react-sdk'
|
|
59
|
+
|
|
60
|
+
// In employee onboarding flow - Federal Taxes step
|
|
61
|
+
<Employee.FederalTaxes
|
|
62
|
+
employeeId="employee-id"
|
|
63
|
+
onEvent={(eventType) => {
|
|
64
|
+
if (eventType === componentEvents.EMPLOYEE_FEDERAL_TAXES_DONE) {
|
|
65
|
+
// called when federal taxes is done
|
|
66
|
+
}
|
|
67
|
+
}}
|
|
68
|
+
/>
|
|
69
|
+
|
|
70
|
+
// In employee onboarding flow - State Taxes step
|
|
71
|
+
<Employee.StateTaxes
|
|
72
|
+
employeeId="employee-id"
|
|
73
|
+
isAdmin
|
|
74
|
+
onEvent={(eventType) => {
|
|
75
|
+
if (eventType === componentEvents.EMPLOYEE_STATE_TAXES_DONE) {
|
|
76
|
+
// called when state taxes is done
|
|
77
|
+
}
|
|
78
|
+
}}
|
|
79
|
+
/>
|
|
80
|
+
|
|
81
|
+
// In self-onboarding flow - Federal Taxes step
|
|
82
|
+
<Employee.FederalTaxes
|
|
83
|
+
employeeId="employee-id"
|
|
84
|
+
onEvent={(eventType) => {
|
|
85
|
+
if (eventType === componentEvents.EMPLOYEE_FEDERAL_TAXES_DONE) {
|
|
86
|
+
// called when federal taxes is done
|
|
87
|
+
}
|
|
88
|
+
}}
|
|
89
|
+
/>
|
|
90
|
+
|
|
91
|
+
// In self-onboarding flow - State Taxes step
|
|
92
|
+
<Employee.StateTaxes
|
|
93
|
+
employeeId="employee-id"
|
|
94
|
+
isAdmin={false}
|
|
95
|
+
onEvent={(eventType) => {
|
|
96
|
+
if (eventType === componentEvents.EMPLOYEE_STATE_TAXES_DONE) {
|
|
97
|
+
// called when state taxes is done
|
|
98
|
+
}
|
|
99
|
+
}}
|
|
100
|
+
/>
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## 0.12.2
|
|
104
|
+
|
|
105
|
+
### Features & Enhancements
|
|
106
|
+
|
|
107
|
+
- Add CTA (Call to Action) functionality to ProgressBar component
|
|
108
|
+
- Expose Payroll components as UNSTABLE for early access
|
|
109
|
+
- Add Payroll Submit API call functionality
|
|
110
|
+
|
|
111
|
+
### Fixes
|
|
112
|
+
|
|
113
|
+
- Fix contractor payment details validation and display
|
|
114
|
+
- Fix contractor ID not being passed correctly from profile to submit
|
|
115
|
+
- Fix self onboarding switch with correct onboarding status
|
|
116
|
+
|
|
117
|
+
### Chores & Maintenance
|
|
118
|
+
|
|
119
|
+
- Upgrade react-i18next from 15.6.0 to 15.7.0
|
|
120
|
+
- Upgrade react-hook-form from 7.60.0 to 7.62.0
|
|
121
|
+
- Update embedded API to latest version
|
|
122
|
+
|
|
123
|
+
## 0.12.1
|
|
124
|
+
|
|
125
|
+
### Fixes
|
|
126
|
+
|
|
127
|
+
- Fix contractor payment details validation and display
|
|
128
|
+
- Fix contractor ID not being passed correctly from profile to submit
|
|
129
|
+
|
|
130
|
+
### Chores & Maintenance
|
|
131
|
+
|
|
132
|
+
- Upgrade react-i18next from 15.6.0 to 15.7.0
|
|
133
|
+
- Upgrade react-hook-form from 7.60.0 to 7.62.0
|
|
134
|
+
- Update embedded API to latest version
|
|
135
|
+
|
|
3
136
|
## 0.12.0
|
|
4
137
|
|
|
5
138
|
### Updated theming
|
|
@@ -1,14 +1,7 @@
|
|
|
1
1
|
const l = (r, n, t) => {
|
|
2
2
|
const e = r[n];
|
|
3
3
|
return e ? typeof e == "function" ? e() : Promise.resolve(e) : new Promise((i, o) => {
|
|
4
|
-
(typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(
|
|
5
|
-
o.bind(
|
|
6
|
-
null,
|
|
7
|
-
new Error(
|
|
8
|
-
"Unknown variable dynamic import: " + n + (n.split("/").length !== t ? ". Note that variables only represent file names one level deep." : "")
|
|
9
|
-
)
|
|
10
|
-
)
|
|
11
|
-
);
|
|
4
|
+
(typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(o.bind(null, /* @__PURE__ */ new Error("Unknown variable dynamic import: " + n + (n.split("/").length !== t ? ". Note that variables only represent file names one level deep." : ""))));
|
|
12
5
|
});
|
|
13
6
|
};
|
|
14
7
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamic-import-helper.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dynamic-import-helper.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
|
|
@@ -2,47 +2,48 @@ import { jsx as o, jsxs as u } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState as y, useCallback as E, Suspense as R } from "react";
|
|
3
3
|
import { ErrorBoundary as S } from "react-error-boundary";
|
|
4
4
|
import { useTranslation as B } from "react-i18next";
|
|
5
|
-
import { APIError as g } from "
|
|
6
|
-
import { SDKValidationError as C } from "
|
|
7
|
-
import { UnprocessableEntityErrorObject as h } from "
|
|
8
|
-
import { QueryErrorResetBoundary as T } from "
|
|
5
|
+
import { APIError as g } from "/home/runner/work/embedded-react-sdk/embedded-react-sdk/node_modules/@gusto/embedded-api/esm/models/errors/apierror.js";
|
|
6
|
+
import { SDKValidationError as C } from "/home/runner/work/embedded-react-sdk/embedded-react-sdk/node_modules/@gusto/embedded-api/esm/models/errors/sdkvalidationerror.js";
|
|
7
|
+
import { UnprocessableEntityErrorObject as h } from "/home/runner/work/embedded-react-sdk/embedded-react-sdk/node_modules/@gusto/embedded-api/esm/models/errors/unprocessableentityerrorobject.js";
|
|
8
|
+
import { QueryErrorResetBoundary as T } from "/home/runner/work/embedded-react-sdk/embedded-react-sdk/node_modules/@tanstack/react-query/build/modern/index.js";
|
|
9
9
|
import { FadeIn as _ } from "../Common/FadeIn/FadeIn.js";
|
|
10
10
|
import { BaseContext as j } from "./useBase.js";
|
|
11
11
|
import { componentEvents as F } from "../../shared/constants.js";
|
|
12
12
|
import { useAsyncError as K } from "../Common/hooks/useAsyncError.js";
|
|
13
|
+
import "classnames";
|
|
13
14
|
import { InternalError as P } from "../Common/InternalError/InternalError.js";
|
|
14
15
|
import { snakeCaseToCamelCase as w } from "../../helpers/formattedStrings.js";
|
|
15
16
|
import { useComponentContext as M } from "../../contexts/ComponentAdapter/useComponentContext.js";
|
|
16
17
|
import { useLoadingIndicator as O } from "../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
17
|
-
const U = (
|
|
18
|
+
const U = (t) => t.map((n) => n.message ? /* @__PURE__ */ o("li", { children: n.message }, n.key) : null), k = (t, n) => {
|
|
18
19
|
const m = n ? n + "." : "";
|
|
19
|
-
if (
|
|
20
|
+
if (t.category === "invalid_attribute_value" || t.category === "invalid_operation")
|
|
20
21
|
return [
|
|
21
22
|
{
|
|
22
|
-
key: w(m +
|
|
23
|
-
message:
|
|
23
|
+
key: w(m + t.errorKey),
|
|
24
|
+
message: t.message ?? ""
|
|
24
25
|
}
|
|
25
26
|
];
|
|
26
|
-
if (
|
|
27
|
+
if (t.category === "nested_errors" && t.errors !== void 0) {
|
|
27
28
|
let s = "";
|
|
28
|
-
return
|
|
29
|
+
return t.metadata?.key && typeof t.metadata.key == "string" ? s = t.metadata.key : t.metadata?.state && typeof t.metadata.state == "string" ? s = t.metadata.state : t.errorKey && (s = t.errorKey), t.errors.flatMap((r) => k(r, m + s));
|
|
29
30
|
}
|
|
30
31
|
return [];
|
|
31
|
-
},
|
|
32
|
-
children:
|
|
32
|
+
}, ot = ({
|
|
33
|
+
children: t,
|
|
33
34
|
FallbackComponent: n = P,
|
|
34
35
|
LoaderComponent: m,
|
|
35
36
|
onEvent: s
|
|
36
37
|
}) => {
|
|
37
|
-
const [r, l] = y(null), [c, f] = y(null), p = K(), { t: x } = B(), d = M(), { LoadingIndicator: b } = O(), v = m ?? b, I = E((
|
|
38
|
-
l(
|
|
39
|
-
}, []), A = (
|
|
40
|
-
l(
|
|
38
|
+
const [r, l] = y(null), [c, f] = y(null), p = K(), { t: x } = B(), d = M(), { LoadingIndicator: b } = O(), v = m ?? b, I = E((e) => {
|
|
39
|
+
l(e), e || f(null);
|
|
40
|
+
}, []), A = (e) => {
|
|
41
|
+
l(e), e instanceof h && Array.isArray(e.errors) && f(e.errors.flatMap((a) => k(a)));
|
|
41
42
|
}, L = E(
|
|
42
|
-
async (
|
|
43
|
+
async (e, a) => {
|
|
43
44
|
l(null), f(null);
|
|
44
45
|
try {
|
|
45
|
-
await a(
|
|
46
|
+
await a(e);
|
|
46
47
|
} catch (i) {
|
|
47
48
|
i instanceof g || i instanceof C || i instanceof h ? A(i) : p(i);
|
|
48
49
|
}
|
|
@@ -59,11 +60,11 @@ const U = (e) => e.map((n) => n.message ? /* @__PURE__ */ o("li", { children: n.
|
|
|
59
60
|
throwError: p,
|
|
60
61
|
baseSubmitHandler: L
|
|
61
62
|
},
|
|
62
|
-
children: /* @__PURE__ */ o(T, { children: ({ reset:
|
|
63
|
+
children: /* @__PURE__ */ o(T, { children: ({ reset: e }) => /* @__PURE__ */ u(
|
|
63
64
|
S,
|
|
64
65
|
{
|
|
65
66
|
FallbackComponent: n,
|
|
66
|
-
onReset:
|
|
67
|
+
onReset: e,
|
|
67
68
|
onError: (a) => {
|
|
68
69
|
s(F.ERROR, a);
|
|
69
70
|
},
|
|
@@ -73,7 +74,7 @@ const U = (e) => e.map((n) => n.message ? /* @__PURE__ */ o("li", { children: n.
|
|
|
73
74
|
r && r instanceof g && /* @__PURE__ */ o(d.Text, { children: r.message }),
|
|
74
75
|
r && r instanceof C && /* @__PURE__ */ o(d.Text, { as: "pre", children: r.pretty() })
|
|
75
76
|
] }),
|
|
76
|
-
/* @__PURE__ */ o(R, { fallback: /* @__PURE__ */ o(v, {}), children: /* @__PURE__ */ o(_, { children:
|
|
77
|
+
/* @__PURE__ */ o(R, { fallback: /* @__PURE__ */ o(v, {}), children: /* @__PURE__ */ o(_, { children: t }) })
|
|
77
78
|
]
|
|
78
79
|
}
|
|
79
80
|
) })
|
|
@@ -81,6 +82,6 @@ const U = (e) => e.map((n) => n.message ? /* @__PURE__ */ o("li", { children: n.
|
|
|
81
82
|
);
|
|
82
83
|
};
|
|
83
84
|
export {
|
|
84
|
-
|
|
85
|
+
ot as BaseComponent
|
|
85
86
|
};
|
|
86
87
|
//# 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 }}\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,IA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,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,MAAA;AAAA,MAGF,4BAACM,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 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 }}\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,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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;"}
|
|
@@ -21,7 +21,7 @@ const Y = H(function({
|
|
|
21
21
|
r.listId !== t || !x.getClientOffset() || !s.current || f.current || (f.current = !0, e.current && clearTimeout(e.current), a());
|
|
22
22
|
},
|
|
23
23
|
collect: (r) => ({
|
|
24
|
-
isOver:
|
|
24
|
+
isOver: r.isOver()
|
|
25
25
|
}),
|
|
26
26
|
drop: (r) => {
|
|
27
27
|
if (r.listId === t)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropZone.js","sources":["../../../../src/components/Common/ReorderableList/DropZone.tsx"],"sourcesContent":["import { useRef, useEffect, memo } from 'react'\nimport classnames from 'classnames'\nimport { useDrop } from 'react-dnd'\nimport { useTranslation } from 'react-i18next'\nimport styles from './ReorderableList.module.scss'\nimport { ITEM_TYPE } from './constants'\n\ninterface DropZoneProps {\n position: number\n isActive: boolean\n onActivate: () => void\n onDeactivate: () => void\n onDrop: (fromPosition: number) => void\n listId: string\n className?: string\n}\n\nexport const DropZone = memo(function DropZone({\n position,\n isActive,\n onActivate,\n onDeactivate,\n onDrop,\n listId,\n className,\n}: DropZoneProps) {\n const ref = useRef<HTMLDivElement>(null)\n const { t } = useTranslation()\n\n // Add a debounce timer for hover state changes to prevent flickering\n const debounceTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null)\n const isHoveringRef = useRef(false)\n\n const [{ isOver }, drop] = useDrop(\n () => ({\n accept: ITEM_TYPE,\n hover: (item: { index: number; listId: string }, monitor) => {\n if (item.listId !== listId) return\n\n const clientOffset = monitor.getClientOffset()\n if (!clientOffset || !ref.current) return\n\n if (isHoveringRef.current) return\n\n isHoveringRef.current = true\n\n if (debounceTimerRef.current) {\n clearTimeout(debounceTimerRef.current)\n }\n\n onActivate()\n },\n collect: monitor => ({\n isOver:
|
|
1
|
+
{"version":3,"file":"DropZone.js","sources":["../../../../src/components/Common/ReorderableList/DropZone.tsx"],"sourcesContent":["import { useRef, useEffect, memo } from 'react'\nimport classnames from 'classnames'\nimport { useDrop } from 'react-dnd'\nimport { useTranslation } from 'react-i18next'\nimport styles from './ReorderableList.module.scss'\nimport { ITEM_TYPE } from './constants'\n\ninterface DropZoneProps {\n position: number\n isActive: boolean\n onActivate: () => void\n onDeactivate: () => void\n onDrop: (fromPosition: number) => void\n listId: string\n className?: string\n}\n\nexport const DropZone = memo(function DropZone({\n position,\n isActive,\n onActivate,\n onDeactivate,\n onDrop,\n listId,\n className,\n}: DropZoneProps) {\n const ref = useRef<HTMLDivElement>(null)\n const { t } = useTranslation()\n\n // Add a debounce timer for hover state changes to prevent flickering\n const debounceTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null)\n const isHoveringRef = useRef(false)\n\n const [{ isOver }, drop] = useDrop(\n () => ({\n accept: ITEM_TYPE,\n hover: (item: { index: number; listId: string }, monitor) => {\n if (item.listId !== listId) return\n\n const clientOffset = monitor.getClientOffset()\n if (!clientOffset || !ref.current) return\n\n if (isHoveringRef.current) return\n\n isHoveringRef.current = true\n\n if (debounceTimerRef.current) {\n clearTimeout(debounceTimerRef.current)\n }\n\n onActivate()\n },\n collect: monitor => ({\n isOver: monitor.isOver(),\n }),\n drop: (item: { index: number; listId: string }) => {\n if (item.listId !== listId) return\n onDeactivate()\n onDrop(item.index)\n return { dropped: true }\n },\n canDrop: (item: { index: number; listId: string }) => {\n if (item.listId !== listId) return false\n return item.index !== position && item.index !== position - 1\n },\n }),\n [listId, onActivate, onDeactivate, onDrop, position],\n )\n\n // Connect the drop ref to the DOM element\n useEffect(() => {\n if (ref.current) {\n drop(ref.current)\n }\n }, [drop])\n\n // Handle deactivation when item is no longer being hovered\n useEffect(() => {\n if (!isOver && isActive) {\n if (debounceTimerRef.current) {\n clearTimeout(debounceTimerRef.current)\n }\n\n debounceTimerRef.current = setTimeout(() => {\n isHoveringRef.current = false\n onDeactivate()\n debounceTimerRef.current = null\n }, 100)\n }\n\n return () => {\n if (debounceTimerRef.current) {\n clearTimeout(debounceTimerRef.current)\n }\n }\n }, [isOver, isActive, onDeactivate])\n\n const isHighlighted = isActive || isOver\n\n const dropZoneClass = classnames(\n styles.dropZone,\n isActive || isOver ? styles.activeDropZone : '',\n isHighlighted ? styles.isHighlighted : '',\n className,\n )\n\n return (\n <div className={styles.dropZoneContainer}>\n <div\n ref={ref}\n className={dropZoneClass}\n data-position={position}\n data-list-id={listId}\n aria-hidden=\"true\"\n aria-label={t('reorderableList.dropItemHere')}\n />\n </div>\n )\n})\n"],"names":["DropZone","memo","position","isActive","onActivate","onDeactivate","onDrop","listId","className","ref","useRef","t","useTranslation","debounceTimerRef","isHoveringRef","isOver","drop","useDrop","ITEM_TYPE","item","monitor","useEffect","isHighlighted","dropZoneClass","classnames","styles","jsx"],"mappings":";;;;;;;AAiBO,MAAMA,IAAWC,EAAK,SAAkB;AAAA,EAC7C,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,YAAAC;AAAA,EACA,cAAAC;AAAA,EACA,QAAAC;AAAA,EACA,QAAAC;AAAA,EACA,WAAAC;AACF,GAAkB;AAChB,QAAMC,IAAMC,EAAuB,IAAI,GACjC,EAAE,GAAAC,EAAA,IAAMC,EAAA,GAGRC,IAAmBH,EAA6C,IAAI,GACpEI,IAAgBJ,EAAO,EAAK,GAE5B,CAAC,EAAE,QAAAK,KAAUC,CAAI,IAAIC;AAAA,IACzB,OAAO;AAAA,MACL,QAAQC;AAAA,MACR,OAAO,CAACC,GAAyCC,MAAY;AAI3D,QAHID,EAAK,WAAWZ,KAGhB,CADiBa,EAAQ,gB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ACA,WAAWc;AAAA,MACX,iBAAerB;AAAA,MACf,gBAAcK;AAAA,MACd,eAAY;AAAA,MACZ,cAAYI,EAAE,8BAA8B;AAAA,IAAA;AAAA,EAAA,GAEhD;AAEJ,CAAC;"}
|
|
@@ -33,7 +33,7 @@ const I = z(function({
|
|
|
33
33
|
type: V,
|
|
34
34
|
item: () => (k.current = !0, d(!0), { index: a, listId: p }),
|
|
35
35
|
collect: (r) => ({
|
|
36
|
-
isDragging:
|
|
36
|
+
isDragging: r.isDragging()
|
|
37
37
|
}),
|
|
38
38
|
end: () => {
|
|
39
39
|
k.current = !1, d(!1), l.current && l.current.blur();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReorderableItem.js","sources":["../../../../src/components/Common/ReorderableList/ReorderableItem.tsx"],"sourcesContent":["import { useRef, useEffect, useCallback, memo } from 'react'\nimport classnames from 'classnames'\nimport { useTranslation } from 'react-i18next'\nimport { useDrag } from 'react-dnd'\nimport type { ReactElement } from 'react'\nimport { VisuallyHidden } from '../VisuallyHidden'\nimport type { ReorderableListItem } from './ReorderableListTypes'\nimport styles from './ReorderableList.module.scss'\nimport { ITEM_TYPE } from './constants'\nimport ListIcon from '@/assets/icons/list.svg?react'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\ninterface ReorderableItemProps {\n item: ReorderableListItem\n index: number\n moveItem: (fromIndex: number, toIndex: number, source?: 'keyboard' | 'dragdrop') => void\n itemCount: number\n itemIndex: number\n listId: string\n isDraggingAny: boolean\n setIsDragging: (isDragging: boolean) => void\n isReorderingActive: boolean\n setIsReorderingActive: (isReorderingActive: boolean) => void\n isCurrentlyReordering: boolean\n setReorderingItemIndex: (reorderingItemIndex: number | null) => void\n renderDragHandle?: (props: {\n id: string | number\n label: string\n isReordering: boolean\n isDragging: boolean\n }) => ReactElement\n className?: string\n}\n\n/**\n * Component for an individual reorderable item\n */\nexport const ReorderableItem = memo(function ReorderableItem({\n item,\n index,\n moveItem,\n itemCount,\n itemIndex,\n listId,\n isDraggingAny,\n setIsDragging,\n isReorderingActive,\n setIsReorderingActive,\n isCurrentlyReordering,\n setReorderingItemIndex,\n renderDragHandle,\n className,\n}: ReorderableItemProps) {\n const ref = useRef<HTMLDivElement>(null)\n const buttonRef = useRef<HTMLButtonElement>(null)\n const { t } = useTranslation('common')\n const Components = useComponentContext()\n\n // Format the accessible item name\n const accessibleItemName = item.label\n\n // Add a ref to track if this specific item is being dragged\n const isBeingDraggedRef = useRef(false)\n\n // When this item becomes the reordering item, focus on it\n useEffect(() => {\n if (isCurrentlyReordering && buttonRef.current) {\n buttonRef.current.focus()\n }\n }, [isCurrentlyReordering])\n\n // React DnD - Drag source\n const [{ isDragging }, drag, dragPreview] = useDrag(\n () => ({\n type: ITEM_TYPE,\n item: () => {\n isBeingDraggedRef.current = true\n setIsDragging(true)\n return { index, listId }\n },\n collect: monitor => ({\n isDragging: !!monitor.isDragging(),\n }),\n end: () => {\n isBeingDraggedRef.current = false\n\n setIsDragging(false)\n\n if (buttonRef.current) {\n buttonRef.current.blur()\n }\n },\n canDrag: () => !isDraggingAny || isBeingDraggedRef.current,\n }),\n [index, listId, setIsDragging, isDraggingAny],\n )\n\n /**\n * Handles keyboard interactions for reordering\n */\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n let newReorderingState: boolean\n\n switch (e.key) {\n case 'ArrowUp':\n if (isReorderingActive && index > 0) {\n e.preventDefault()\n setReorderingItemIndex(index)\n moveItem(index, index - 1, 'keyboard')\n }\n break\n case 'ArrowDown':\n if (isReorderingActive && index < itemCount - 1) {\n e.preventDefault()\n setReorderingItemIndex(index)\n moveItem(index, index + 1, 'keyboard')\n }\n break\n case 'Escape':\n if (isReorderingActive) {\n e.preventDefault()\n setIsReorderingActive(false)\n setReorderingItemIndex(null)\n }\n break\n case 'Tab':\n if (isReorderingActive) {\n setIsReorderingActive(false)\n setReorderingItemIndex(null)\n }\n break\n case ' ':\n case 'Enter':\n e.preventDefault()\n newReorderingState = !isReorderingActive\n setIsReorderingActive(newReorderingState)\n\n if (newReorderingState) {\n setReorderingItemIndex(index)\n } else {\n setReorderingItemIndex(null)\n }\n break\n default:\n break\n }\n },\n [isReorderingActive, index, itemCount, setReorderingItemIndex, moveItem, setIsReorderingActive],\n )\n\n // Set up drag preview and drag source\n useEffect(() => {\n if (ref.current) {\n dragPreview(ref.current)\n }\n }, [dragPreview])\n\n const itemClasses = classnames(\n styles.reorderableItem,\n isDragging ? styles.dragging : '',\n isReorderingActive ? styles.reordering : '',\n className,\n )\n\n return (\n <div\n ref={ref}\n role=\"listitem\"\n aria-posinset={index + 1}\n aria-setsize={itemCount}\n className={itemClasses}\n data-position={index}\n data-item-index={itemIndex}\n data-list-id={listId}\n data-testid={`reorderable-item-${index}`}\n data-dragging={isDragging ? 'true' : 'false'}\n data-reordering={isReorderingActive ? 'true' : 'false'}\n >\n <VisuallyHidden>\n {t('reorderableList.draggablePosition', {\n item: accessibleItemName,\n position: String(index + 1),\n total: String(itemCount),\n })}\n </VisuallyHidden>\n <span className={styles.dragHandle}>\n {renderDragHandle ? (\n renderDragHandle({\n id: item.id || index,\n label: accessibleItemName,\n isReordering: isReorderingActive,\n isDragging: isDragging,\n })\n ) : (\n <Components.ButtonIcon\n data-index={index}\n data-item-index={itemIndex}\n data-reordering={isReorderingActive ? 'true' : 'false'}\n data-focus-visible={true}\n data-testid=\"drag-handle-button\"\n tabIndex={0}\n onFocus={e => {\n e.currentTarget.setAttribute('data-focus-visible', 'true')\n }}\n onBlur={e => {\n e.currentTarget.removeAttribute('data-focus-visible')\n }}\n aria-label={\n isReorderingActive\n ? t('reorderableList.draggableLabelActive', {\n item: accessibleItemName,\n })\n : t('reorderableList.draggableLabel', {\n item: accessibleItemName,\n })\n }\n aria-roledescription={t('reorderableList.draggableItem')}\n aria-grabbed={isDragging}\n onKeyDown={handleKeyDown}\n buttonRef={node => {\n if (node) {\n buttonRef.current = node\n drag(node)\n }\n }}\n >\n <ListIcon />\n </Components.ButtonIcon>\n )}\n </span>\n <div className={styles.contentContainer}>{item.content}</div>\n </div>\n )\n})\n"],"names":["ReorderableItem","memo","item","index","moveItem","itemCount","itemIndex","listId","isDraggingAny","setIsDragging","isReorderingActive","setIsReorderingActive","isCurrentlyReordering","setReorderingItemIndex","renderDragHandle","className","ref","useRef","buttonRef","t","useTranslation","Components","useComponentContext","accessibleItemName","isBeingDraggedRef","useEffect","isDragging","drag","dragPreview","useDrag","ITEM_TYPE","monitor","handleKeyDown","useCallback","e","newReorderingState","itemClasses","classnames","styles","jsxs","jsx","VisuallyHidden","node","ListIcon"],"mappings":";;;;;;;;;;AAqCO,MAAMA,IAAkBC,EAAK,SAAyB;AAAA,EAC3D,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,QAAAC;AAAA,EACA,eAAAC;AAAA,EACA,eAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,uBAAAC;AAAA,EACA,uBAAAC;AAAA,EACA,wBAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,WAAAC;AACF,GAAyB;AACvB,QAAMC,IAAMC,EAAuB,IAAI,GACjCC,IAAYD,EAA0B,IAAI,GAC1C,EAAE,GAAAE,EAAA,IAAMC,EAAe,QAAQ,GAC/BC,IAAaC,EAAA,GAGbC,IAAqBrB,EAAK,OAG1BsB,IAAoBP,EAAO,EAAK;AAGtC,EAAAQ,EAAU,MAAM;AACd,IAAIb,KAAyBM,EAAU,WACrCA,EAAU,QAAQ,MAAA;AAAA,EAEtB,GAAG,CAACN,CAAqB,CAAC;AAG1B,QAAM,CAAC,EAAE,YAAAc,EAAA,GAAcC,GAAMC,CAAW,IAAIC;AAAA,IAC1C,OAAO;AAAA,MACL,MAAMC;AAAA,MACN,MAAM,OACJN,EAAkB,UAAU,IAC5Bf,EAAc,EAAI,GACX,EAAE,OAAAN,GAAO,QAAAI,EAAA;AAAA,MAElB,SAAS,CAAAwB,OAAY;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AAA,CACP;AAAA,YAEP,wBAAsBJ,EAAE,+BAA+B;AAAA,YACvD,gBAAcO;AAAA,YACd,WAAWM;AAAA,YACX,WAAW,CAAAU,MAAQ;AACjB,cAAIA,MACFxB,EAAU,UAAUwB,GACpBf,EAAKe,CAAI;AAAA,YAEb;AAAA,YAEA,4BAACC,GAAA,CAAA,CAAS;AAAA,UAAA;AAAA,QAAA,GAGhB;AAAA,0BACC,OAAA,EAAI,WAAWL,EAAO,kBAAmB,YAAK,QAAA,CAAQ;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAG7D,CAAC;"}
|
|
1
|
+
{"version":3,"file":"ReorderableItem.js","sources":["../../../../src/components/Common/ReorderableList/ReorderableItem.tsx"],"sourcesContent":["import { useRef, useEffect, useCallback, memo } from 'react'\nimport classnames from 'classnames'\nimport { useTranslation } from 'react-i18next'\nimport { useDrag } from 'react-dnd'\nimport type { ReactElement } from 'react'\nimport { VisuallyHidden } from '../VisuallyHidden'\nimport type { ReorderableListItem } from './ReorderableListTypes'\nimport styles from './ReorderableList.module.scss'\nimport { ITEM_TYPE } from './constants'\nimport ListIcon from '@/assets/icons/list.svg?react'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\ninterface ReorderableItemProps {\n item: ReorderableListItem\n index: number\n moveItem: (fromIndex: number, toIndex: number, source?: 'keyboard' | 'dragdrop') => void\n itemCount: number\n itemIndex: number\n listId: string\n isDraggingAny: boolean\n setIsDragging: (isDragging: boolean) => void\n isReorderingActive: boolean\n setIsReorderingActive: (isReorderingActive: boolean) => void\n isCurrentlyReordering: boolean\n setReorderingItemIndex: (reorderingItemIndex: number | null) => void\n renderDragHandle?: (props: {\n id: string | number\n label: string\n isReordering: boolean\n isDragging: boolean\n }) => ReactElement\n className?: string\n}\n\n/**\n * Component for an individual reorderable item\n */\nexport const ReorderableItem = memo(function ReorderableItem({\n item,\n index,\n moveItem,\n itemCount,\n itemIndex,\n listId,\n isDraggingAny,\n setIsDragging,\n isReorderingActive,\n setIsReorderingActive,\n isCurrentlyReordering,\n setReorderingItemIndex,\n renderDragHandle,\n className,\n}: ReorderableItemProps) {\n const ref = useRef<HTMLDivElement>(null)\n const buttonRef = useRef<HTMLButtonElement>(null)\n const { t } = useTranslation('common')\n const Components = useComponentContext()\n\n // Format the accessible item name\n const accessibleItemName = item.label\n\n // Add a ref to track if this specific item is being dragged\n const isBeingDraggedRef = useRef(false)\n\n // When this item becomes the reordering item, focus on it\n useEffect(() => {\n if (isCurrentlyReordering && buttonRef.current) {\n buttonRef.current.focus()\n }\n }, [isCurrentlyReordering])\n\n // React DnD - Drag source\n const [{ isDragging }, drag, dragPreview] = useDrag(\n () => ({\n type: ITEM_TYPE,\n item: () => {\n isBeingDraggedRef.current = true\n setIsDragging(true)\n return { index, listId }\n },\n collect: monitor => ({\n isDragging: monitor.isDragging(),\n }),\n end: () => {\n isBeingDraggedRef.current = false\n\n setIsDragging(false)\n\n if (buttonRef.current) {\n buttonRef.current.blur()\n }\n },\n canDrag: () => !isDraggingAny || isBeingDraggedRef.current,\n }),\n [index, listId, setIsDragging, isDraggingAny],\n )\n\n /**\n * Handles keyboard interactions for reordering\n */\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n let newReorderingState: boolean\n\n switch (e.key) {\n case 'ArrowUp':\n if (isReorderingActive && index > 0) {\n e.preventDefault()\n setReorderingItemIndex(index)\n moveItem(index, index - 1, 'keyboard')\n }\n break\n case 'ArrowDown':\n if (isReorderingActive && index < itemCount - 1) {\n e.preventDefault()\n setReorderingItemIndex(index)\n moveItem(index, index + 1, 'keyboard')\n }\n break\n case 'Escape':\n if (isReorderingActive) {\n e.preventDefault()\n setIsReorderingActive(false)\n setReorderingItemIndex(null)\n }\n break\n case 'Tab':\n if (isReorderingActive) {\n setIsReorderingActive(false)\n setReorderingItemIndex(null)\n }\n break\n case ' ':\n case 'Enter':\n e.preventDefault()\n newReorderingState = !isReorderingActive\n setIsReorderingActive(newReorderingState)\n\n if (newReorderingState) {\n setReorderingItemIndex(index)\n } else {\n setReorderingItemIndex(null)\n }\n break\n default:\n break\n }\n },\n [isReorderingActive, index, itemCount, setReorderingItemIndex, moveItem, setIsReorderingActive],\n )\n\n // Set up drag preview and drag source\n useEffect(() => {\n if (ref.current) {\n dragPreview(ref.current)\n }\n }, [dragPreview])\n\n const itemClasses = classnames(\n styles.reorderableItem,\n isDragging ? styles.dragging : '',\n isReorderingActive ? styles.reordering : '',\n className,\n )\n\n return (\n <div\n ref={ref}\n role=\"listitem\"\n aria-posinset={index + 1}\n aria-setsize={itemCount}\n className={itemClasses}\n data-position={index}\n data-item-index={itemIndex}\n data-list-id={listId}\n data-testid={`reorderable-item-${index}`}\n data-dragging={isDragging ? 'true' : 'false'}\n data-reordering={isReorderingActive ? 'true' : 'false'}\n >\n <VisuallyHidden>\n {t('reorderableList.draggablePosition', {\n item: accessibleItemName,\n position: String(index + 1),\n total: String(itemCount),\n })}\n </VisuallyHidden>\n <span className={styles.dragHandle}>\n {renderDragHandle ? (\n renderDragHandle({\n id: item.id || index,\n label: accessibleItemName,\n isReordering: isReorderingActive,\n isDragging: isDragging,\n })\n ) : (\n <Components.ButtonIcon\n data-index={index}\n data-item-index={itemIndex}\n data-reordering={isReorderingActive ? 'true' : 'false'}\n data-focus-visible={true}\n data-testid=\"drag-handle-button\"\n tabIndex={0}\n onFocus={e => {\n e.currentTarget.setAttribute('data-focus-visible', 'true')\n }}\n onBlur={e => {\n e.currentTarget.removeAttribute('data-focus-visible')\n }}\n aria-label={\n isReorderingActive\n ? t('reorderableList.draggableLabelActive', {\n item: accessibleItemName,\n })\n : t('reorderableList.draggableLabel', {\n item: accessibleItemName,\n })\n }\n aria-roledescription={t('reorderableList.draggableItem')}\n aria-grabbed={isDragging}\n onKeyDown={handleKeyDown}\n buttonRef={node => {\n if (node) {\n buttonRef.current = node\n drag(node)\n }\n }}\n >\n <ListIcon />\n </Components.ButtonIcon>\n )}\n </span>\n <div className={styles.contentContainer}>{item.content}</div>\n </div>\n )\n})\n"],"names":["ReorderableItem","memo","item","index","moveItem","itemCount","itemIndex","listId","isDraggingAny","setIsDragging","isReorderingActive","setIsReorderingActive","isCurrentlyReordering","setReorderingItemIndex","renderDragHandle","className","ref","useRef","buttonRef","t","useTranslation","Components","useComponentContext","accessibleItemName","isBeingDraggedRef","useEffect","isDragging","drag","dragPreview","useDrag","ITEM_TYPE","monitor","handleKeyDown","useCallback","e","newReorderingState","itemClasses","classnames","styles","jsxs","jsx","VisuallyHidden","node","ListIcon"],"mappings":";;;;;;;;;;AAqCO,MAAMA,IAAkBC,EAAK,SAAyB;AAAA,EAC3D,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,QAAAC;AAAA,EACA,eAAAC;AAAA,EACA,eAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,uBAAAC;AAAA,EACA,uBAAAC;AAAA,EACA,wBAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,WAAAC;AACF,GAAyB;AACvB,QAAMC,IAAMC,EAAuB,IAAI,GACjCC,IAAYD,EAA0B,IAAI,GAC1C,EAAE,GAAAE,EAAA,IAAMC,EAAe,QAAQ,GAC/BC,IAAaC,EAAA,GAGbC,IAAqBrB,EAAK,OAG1BsB,IAAoBP,EAAO,EAAK;AAGtC,EAAAQ,EAAU,MAAM;AACd,IAAIb,KAAyBM,EAAU,WACrCA,EAAU,QAAQ,MAAA;AAAA,EAEtB,GAAG,CAACN,CAAqB,CAAC;AAG1B,QAAM,CAAC,EAAE,YAAAc,EAAA,GAAcC,GAAMC,CAAW,IAAIC;AAAA,IAC1C,OAAO;AAAA,MACL,MAAMC;AAAA,MACN,MAAM,OACJN,EAAkB,UAAU,IAC5Bf,EAAc,EAAI,GACX,EAAE,OAAAN,GAAO,QAAAI,EAAA;AAAA,MAElB,SAAS,CAAAwB,OAAY;AAAA,QACnB,YAAYA,EAAQ,WAAA;AAAA,MAAW;AAAA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BAAcO;AAAA,YACd,WAAWM;AAAA,YACX,WAAW,CAAAU,MAAQ;AACjB,cAAIA,MACFxB,EAAU,UAAUwB,GACpBf,EAAKe,CAAI;AAAA,YAEb;AAAA,YAEA,4BAACC,GAAA,CAAA,CAAS;AAAA,UAAA;AAAA,QAAA,GAGhB;AAAA,0BACC,OAAA,EAAI,WAAWL,EAAO,kBAAmB,YAAK,QAAA,CAAQ;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAG7D,CAAC;"}
|
|
@@ -1,26 +1,28 @@
|
|
|
1
1
|
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
|
-
import { zodResolver as l } from "
|
|
4
|
+
import { zodResolver as l } from "/home/runner/work/embedded-react-sdk/embedded-react-sdk/node_modules/@hookform/resolvers/zod/dist/zod.mjs";
|
|
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 "classnames";
|
|
9
|
+
import "../../../shared/constants.js";
|
|
8
10
|
const f = o.object({
|
|
9
11
|
signature: o.string().min(1),
|
|
10
12
|
confirmSignature: o.literal(!0)
|
|
11
|
-
}),
|
|
13
|
+
}), p = {
|
|
12
14
|
signature: ""
|
|
13
15
|
};
|
|
14
|
-
function
|
|
16
|
+
function z({ onSubmit: m, children: i, formProps: n }) {
|
|
15
17
|
const e = s({
|
|
16
18
|
resolver: l(f),
|
|
17
|
-
defaultValues:
|
|
19
|
+
defaultValues: p,
|
|
18
20
|
...n
|
|
19
21
|
});
|
|
20
22
|
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 }) }) }) });
|
|
21
23
|
}
|
|
22
24
|
export {
|
|
23
|
-
|
|
25
|
+
z as SignatureForm,
|
|
24
26
|
f as SignatureFormSchema
|
|
25
27
|
};
|
|
26
28
|
//# 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,19 +1,21 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
1
|
+
import { jsxs as m, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import "classnames";
|
|
3
|
+
import "../../../shared/constants.js";
|
|
4
|
+
import { ActionsLayout as s } from "../ActionsLayout/ActionsLayout.js";
|
|
5
|
+
import { useComponentContext as p } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
6
|
+
function d({
|
|
5
7
|
onBack: t,
|
|
6
8
|
backLabel: r,
|
|
7
|
-
submitLabel:
|
|
8
|
-
isLoading:
|
|
9
|
+
submitLabel: i,
|
|
10
|
+
isLoading: e = !1
|
|
9
11
|
}) {
|
|
10
|
-
const o =
|
|
11
|
-
return /* @__PURE__ */ s
|
|
12
|
+
const o = p();
|
|
13
|
+
return /* @__PURE__ */ m(s, { children: [
|
|
12
14
|
t && /* @__PURE__ */ n(o.Button, { variant: "secondary", type: "button", onClick: t, children: r }),
|
|
13
|
-
/* @__PURE__ */ n(o.Button, { type: "submit", isLoading:
|
|
15
|
+
/* @__PURE__ */ n(o.Button, { type: "submit", isLoading: e, children: i })
|
|
14
16
|
] });
|
|
15
17
|
}
|
|
16
18
|
export {
|
|
17
|
-
|
|
19
|
+
d as SignatureFormActions
|
|
18
20
|
};
|
|
19
21
|
//# 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;"}
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as n, Fragment as s, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import "classnames";
|
|
3
|
+
import "../../../shared/constants.js";
|
|
2
4
|
import { TextInputField as a } from "../Fields/TextInputField/TextInputField.js";
|
|
3
5
|
import { CheckboxField as u } from "../Fields/CheckboxField/CheckboxField.js";
|
|
4
|
-
function
|
|
6
|
+
function f({
|
|
5
7
|
signatureLabel: r,
|
|
6
8
|
signatureDescription: i = "",
|
|
7
9
|
signatureError: t = "",
|
|
8
10
|
confirmationLabel: o,
|
|
9
|
-
confirmationError:
|
|
11
|
+
confirmationError: m = ""
|
|
10
12
|
}) {
|
|
11
|
-
return /* @__PURE__ */ s
|
|
13
|
+
return /* @__PURE__ */ n(s, { children: [
|
|
12
14
|
/* @__PURE__ */ e(
|
|
13
15
|
a,
|
|
14
16
|
{
|
|
@@ -25,12 +27,12 @@ function p({
|
|
|
25
27
|
name: "confirmSignature",
|
|
26
28
|
isRequired: !0,
|
|
27
29
|
label: o,
|
|
28
|
-
errorMessage:
|
|
30
|
+
errorMessage: m
|
|
29
31
|
}
|
|
30
32
|
)
|
|
31
33
|
] });
|
|
32
34
|
}
|
|
33
35
|
export {
|
|
34
|
-
|
|
36
|
+
f as SignatureFormFields
|
|
35
37
|
};
|
|
36
38
|
//# sourceMappingURL=SignatureFormFields.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignatureFormFields.js","sources":["../../../../src/components/Common/SignatureForm/SignatureFormFields.tsx"],"sourcesContent":["import { TextInputField, CheckboxField } from '@/components/Common'\n\ninterface SignatureFormFieldsProps {\n signatureLabel: string\n signatureDescription?: string\n signatureError?: string\n confirmationLabel: string\n confirmationError?: string\n}\n\nexport function SignatureFormFields({\n signatureLabel,\n signatureDescription = '',\n signatureError = '',\n confirmationLabel,\n confirmationError = '',\n}: SignatureFormFieldsProps) {\n return (\n <>\n <TextInputField\n name=\"signature\"\n label={signatureLabel}\n description={signatureDescription}\n errorMessage={signatureError}\n isRequired\n />\n <CheckboxField\n name=\"confirmSignature\"\n isRequired\n label={confirmationLabel}\n errorMessage={confirmationError}\n />\n </>\n )\n}\n"],"names":["SignatureFormFields","signatureLabel","signatureDescription","signatureError","confirmationLabel","confirmationError","jsxs","Fragment","jsx","TextInputField","CheckboxField"],"mappings":"
|
|
1
|
+
{"version":3,"file":"SignatureFormFields.js","sources":["../../../../src/components/Common/SignatureForm/SignatureFormFields.tsx"],"sourcesContent":["import { TextInputField, CheckboxField } from '@/components/Common'\n\ninterface SignatureFormFieldsProps {\n signatureLabel: string\n signatureDescription?: string\n signatureError?: string\n confirmationLabel: string\n confirmationError?: string\n}\n\nexport function SignatureFormFields({\n signatureLabel,\n signatureDescription = '',\n signatureError = '',\n confirmationLabel,\n confirmationError = '',\n}: SignatureFormFieldsProps) {\n return (\n <>\n <TextInputField\n name=\"signature\"\n label={signatureLabel}\n description={signatureDescription}\n errorMessage={signatureError}\n isRequired\n />\n <CheckboxField\n name=\"confirmSignature\"\n isRequired\n label={confirmationLabel}\n errorMessage={confirmationError}\n />\n </>\n )\n}\n"],"names":["SignatureFormFields","signatureLabel","signatureDescription","signatureError","confirmationLabel","confirmationError","jsxs","Fragment","jsx","TextInputField","CheckboxField"],"mappings":";;;;;AAUO,SAASA,EAAoB;AAAA,EAClC,gBAAAC;AAAA,EACA,sBAAAC,IAAuB;AAAA,EACvB,gBAAAC,IAAiB;AAAA,EACjB,mBAAAC;AAAA,EACA,mBAAAC,IAAoB;AACtB,GAA6B;AAC3B,SACE,gBAAAC,EAAAC,GAAA,EACE,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOR;AAAA,QACP,aAAaC;AAAA,QACb,cAAcC;AAAA,QACd,YAAU;AAAA,MAAA;AAAA,IAAA;AAAA,IAEZ,gBAAAK;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,YAAU;AAAA,QACV,OAAON;AAAA,QACP,cAAcC;AAAA,MAAA;AAAA,IAAA;AAAA,EAChB,GACF;AAEJ;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as r, jsxs as l } from "react/jsx-runtime";
|
|
2
2
|
import { Text as m, RangeCalendar as D, CalendarGrid as x, CalendarGridHeader as N, CalendarHeaderCell as I, CalendarGridBody as S, CalendarCell as F } from "react-aria-components";
|
|
3
|
-
import { parseDate as p } from "
|
|
3
|
+
import { parseDate as p } from "/home/runner/work/embedded-react-sdk/embedded-react-sdk/node_modules/@internationalized/date/dist/import.mjs";
|
|
4
4
|
import { useMemo as u } from "react";
|
|
5
5
|
import { CalendarLegend as g } from "./CalendarLegend.js";
|
|
6
6
|
import d from "./CalendarPreview.module.scss.js";
|
|
@@ -2,7 +2,7 @@ import { jsx as r, jsxs as o } from "react/jsx-runtime";
|
|
|
2
2
|
import { DatePicker as b, Group as k, DateInput as A, DateSegment as B, Button as c, Popover as F, Dialog as L, Calendar as j, Heading as E, CalendarGrid as G, CalendarCell as M } from "react-aria-components";
|
|
3
3
|
import { useTranslation as z } from "react-i18next";
|
|
4
4
|
import u from "classnames";
|
|
5
|
-
import { parseDate as H } from "
|
|
5
|
+
import { parseDate as H } from "/home/runner/work/embedded-react-sdk/embedded-react-sdk/node_modules/@internationalized/date/dist/import.mjs";
|
|
6
6
|
import { useFieldIds as R } from "../hooks/useFieldIds.js";
|
|
7
7
|
import i from "./DatePicker.module.scss.js";
|
|
8
8
|
import { FieldLayout as U } from "../../FieldLayout/FieldLayout.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useMemo as e } from "react";
|
|
2
|
-
import { NumberFormatter as t } from "
|
|
2
|
+
import { NumberFormatter as t } from "/home/runner/work/embedded-react-sdk/embedded-react-sdk/node_modules/@internationalized/number/dist/import.mjs";
|
|
3
3
|
import { useLocale as n } from "../../../contexts/LocaleProvider/useLocale.js";
|
|
4
4
|
const f = (r = "currency") => {
|
|
5
5
|
const { locale: m, currency: o } = n();
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { jsx as o, jsxs as y, Fragment as f } from "react/jsx-runtime";
|
|
2
2
|
import { z as e } from "zod";
|
|
3
3
|
import { useForm as d, FormProvider as N } from "react-hook-form";
|
|
4
|
-
import { zodResolver as p } from "
|
|
4
|
+
import { zodResolver as p } from "/home/runner/work/embedded-react-sdk/embedded-react-sdk/node_modules/@hookform/resolvers/zod/dist/zod.mjs";
|
|
5
5
|
import { SignatoryForm as _ } from "./SignatoryForm.js";
|
|
6
6
|
import { Head as O } from "./Head.js";
|
|
7
7
|
import { AssignSignatorySelection as u } from "./AssignSignatorySelection.js";
|
|
8
8
|
import { SignatoryAssignmentMode as m, AssignSignatoryProvider as E } from "./useAssignSignatory.js";
|
|
9
9
|
import { companyEvents as i } from "../../../shared/constants.js";
|
|
10
10
|
import { Flex as C } from "../../Common/Flex/Flex.js";
|
|
11
|
+
import "classnames";
|
|
11
12
|
import { BaseComponent as M } from "../../Base/Base.js";
|
|
12
13
|
import { useBase as h } from "../../Base/useBase.js";
|
|
13
14
|
import { useI18n as I, useComponentDictionary as Y } from "../../../i18n/I18n.js";
|
|
14
|
-
function
|
|
15
|
+
function J(n) {
|
|
15
16
|
return /* @__PURE__ */ o(M, { ...n, children: /* @__PURE__ */ o(v, { ...n, children: n.children }) });
|
|
16
17
|
}
|
|
17
18
|
const D = e.object({
|
|
@@ -58,6 +59,6 @@ function v({
|
|
|
58
59
|
) });
|
|
59
60
|
}
|
|
60
61
|
export {
|
|
61
|
-
|
|
62
|
+
J as AssignSignatory
|
|
62
63
|
};
|
|
63
64
|
//# sourceMappingURL=AssignSignatory.js.map
|