@gusto/embedded-react-sdk 0.35.0-rc.3 → 0.36.0-rc.1
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 +20 -11
- package/README.md +2 -0
- package/dist/UNSTABLE_Hooks.d.ts +1 -1
- package/dist/UNSTABLE_Hooks.js +48 -6
- package/dist/UNSTABLE_Hooks.js.map +1 -1
- package/dist/components/Base/Base.d.ts +8 -9
- package/dist/components/Base/Base.js +123 -102
- package/dist/components/Base/Base.js.map +1 -1
- package/dist/components/Base/index.d.ts +1 -1
- package/dist/components/Base/useBase.d.ts +3 -7
- package/dist/components/Base/useBase.js.map +1 -1
- package/dist/components/Base/useBaseSubmit.d.ts +3 -5
- package/dist/components/Base/useBaseSubmit.js +27 -50
- package/dist/components/Base/useBaseSubmit.js.map +1 -1
- package/dist/components/Common/Fields/CheckboxField/CheckboxField.d.ts +2 -0
- package/dist/components/Common/Fields/CheckboxField/CheckboxField.js +17 -16
- package/dist/components/Common/Fields/CheckboxField/CheckboxField.js.map +1 -1
- package/dist/components/Common/Fields/DatePickerField/DatePickerField.d.ts +5 -3
- package/dist/components/Common/Fields/DatePickerField/DatePickerField.js +46 -36
- package/dist/components/Common/Fields/DatePickerField/DatePickerField.js.map +1 -1
- package/dist/components/Common/Fields/NumberInputField/NumberInputField.d.ts +2 -0
- package/dist/components/Common/Fields/NumberInputField/NumberInputField.js +21 -20
- package/dist/components/Common/Fields/NumberInputField/NumberInputField.js.map +1 -1
- package/dist/components/Common/Fields/RadioGroupField/RadioGroupField.d.ts +3 -1
- package/dist/components/Common/Fields/RadioGroupField/RadioGroupField.js +20 -19
- package/dist/components/Common/Fields/RadioGroupField/RadioGroupField.js.map +1 -1
- package/dist/components/Common/Fields/SelectField/SelectField.d.ts +3 -1
- package/dist/components/Common/Fields/SelectField/SelectField.js +19 -18
- package/dist/components/Common/Fields/SelectField/SelectField.js.map +1 -1
- package/dist/components/Common/Fields/SwitchField/SwitchField.d.ts +2 -0
- package/dist/components/Common/Fields/SwitchField/SwitchField.js +19 -18
- package/dist/components/Common/Fields/SwitchField/SwitchField.js.map +1 -1
- package/dist/components/Common/Fields/TextInputField/TextInputField.d.ts +2 -0
- package/dist/components/Common/Fields/TextInputField/TextInputField.js +10 -9
- package/dist/components/Common/Fields/TextInputField/TextInputField.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureForm.js +10 -15
- package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormActions.js +10 -14
- package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormFields.js +14 -19
- package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
- package/dist/components/Common/UI/DescriptionList/DescriptionList.module.scss.js +2 -2
- package/dist/components/Company/AssignSignatory/AssignSignatory.js +7 -11
- package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +6 -10
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +8 -11
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +60 -62
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +13 -14
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +5 -5
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +6 -9
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +20 -23
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +13 -14
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +5 -5
- package/dist/components/Company/AssignSignatory/TitleSelect.js +2 -5
- package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +5 -5
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +9 -11
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js +9 -13
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +5 -5
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js +10 -13
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +12 -15
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/BankAccountVerify.js +17 -13
- package/dist/components/Company/BankAccount/BankAccountVerify/BankAccountVerify.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +4 -8
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +5 -8
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +12 -16
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +5 -5
- package/dist/components/Company/DocumentSigner/DocumentSigner.js +5 -5
- package/dist/components/Company/DocumentSigner/DocumentSigner.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +11 -15
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +5 -5
- package/dist/components/Company/FederalTaxes/Actions.js +8 -11
- package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Company/FederalTaxes/FederalTaxes.js +15 -19
- package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Form.js +6 -8
- package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +5 -5
- package/dist/components/Company/Industry/Actions.js +8 -11
- package/dist/components/Company/Industry/Actions.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +5 -5
- package/dist/components/Company/Industry/Edit.js +10 -14
- package/dist/components/Company/Industry/Edit.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Actions.js +8 -11
- package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Form.js +5 -7
- package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/LocationForm.js +15 -19
- package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +5 -5
- package/dist/components/Company/Locations/LocationsList/Actions.js +6 -9
- package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/List.js +17 -19
- package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +6 -10
- package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +5 -5
- package/dist/components/Company/OnboardingOverview/Completed.js +12 -15
- package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js +9 -12
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +6 -10
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +5 -5
- package/dist/components/Company/PaySchedule/PaySchedule.js +60 -63
- package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Actions.js +10 -13
- package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Edit.js +15 -15
- package/dist/components/Company/PaySchedule/_parts/Head.js +11 -14
- package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/List.js +19 -21
- package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
- package/dist/components/Company/PaySchedule/usePaySchedule.js +5 -5
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +5 -8
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +5 -5
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +6 -9
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js +5 -8
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +5 -5
- package/dist/components/Contractor/Address/Address.js +3 -7
- package/dist/components/Contractor/Address/Address.js.map +1 -1
- package/dist/components/Contractor/Address/Form.js +6 -8
- package/dist/components/Contractor/Address/Form.js.map +1 -1
- package/dist/components/Contractor/Address/useAddress.js +5 -5
- package/dist/components/Contractor/ContractorList/index.js +29 -30
- package/dist/components/Contractor/ContractorList/index.js.map +1 -1
- package/dist/components/Contractor/NewHireReport/NewHireReport.js +2 -3
- package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +10 -14
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +2 -3
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +2 -5
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +12 -14
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +10 -10
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js +18 -21
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +3 -4
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js +17 -19
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js +6 -8
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js +2 -4
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +2 -5
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
- package/dist/components/Contractor/Profile/ContractorProfileForm.js +15 -15
- package/dist/components/Contractor/Profile/useContractorProfile.js +33 -31
- package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
- package/dist/components/Contractor/Submit/Submit.js +20 -22
- package/dist/components/Contractor/Submit/Submit.js.map +1 -1
- package/dist/components/Employee/Compensation/Actions.js +12 -14
- package/dist/components/Employee/Compensation/Actions.js.map +1 -1
- package/dist/components/Employee/Compensation/Compensation.js +21 -21
- package/dist/components/Employee/Compensation/Compensation.js.map +1 -1
- package/dist/components/Employee/Compensation/Edit.js +27 -28
- package/dist/components/Employee/Compensation/Edit.js.map +1 -1
- package/dist/components/Employee/Compensation/List.js +23 -25
- package/dist/components/Employee/Compensation/List.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +12 -12
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +13 -13
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +13 -13
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +18 -19
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js.map +1 -1
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js +6 -7
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +6 -9
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +10 -14
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js +2 -6
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +5 -5
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js +24 -26
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.js +9 -11
- package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +11 -15
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +5 -5
- package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.js +6 -9
- package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.js.map +1 -1
- package/dist/components/Employee/EmployeeList/Actions.js +6 -9
- package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
- package/dist/components/Employee/EmployeeList/EmployeeList.js +3 -7
- package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
- package/dist/components/Employee/EmployeeList/Head.js +5 -8
- package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
- package/dist/components/Employee/EmployeeList/List.js +16 -17
- package/dist/components/Employee/EmployeeList/List.js.map +1 -1
- package/dist/components/Employee/EmployeeList/useEmployeeList.js +5 -5
- package/dist/components/Employee/FederalTaxes/Actions.js +7 -10
- package/dist/components/Employee/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/FederalForm.d.ts +2 -8
- package/dist/components/Employee/FederalTaxes/FederalForm.js +29 -87
- package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/FederalTaxes.js +58 -63
- package/dist/components/Employee/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +5 -5
- package/dist/components/Employee/Landing/Landing.js +14 -15
- package/dist/components/Employee/Landing/Landing.js.map +1 -1
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +7 -7
- package/dist/components/Employee/PaymentMethod/Actions.js +8 -11
- package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +5 -8
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js +9 -10
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +7 -10
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/Split.js +9 -10
- package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +5 -5
- package/dist/components/Employee/Profile/Actions.js +8 -11
- package/dist/components/Employee/Profile/Actions.js.map +1 -1
- package/dist/components/Employee/Profile/AdminPersonalDetails.js +14 -17
- package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
- package/dist/components/Employee/Profile/HomeAddress.d.ts +3 -3
- package/dist/components/Employee/Profile/HomeAddress.js +45 -44
- package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js +10 -13
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
- package/dist/components/Employee/Profile/Profile.js +30 -29
- package/dist/components/Employee/Profile/Profile.js.map +1 -1
- package/dist/components/Employee/Profile/useProfile.js +5 -5
- package/dist/components/Employee/StateTaxes/Actions.js +8 -11
- package/dist/components/Employee/StateTaxes/Actions.js.map +1 -1
- package/dist/components/Employee/StateTaxes/StateTaxes.js +50 -50
- package/dist/components/Employee/StateTaxes/StateTaxes.js.map +1 -1
- package/dist/components/Employee/StateTaxes/useStateTaxes.js +5 -5
- package/dist/components/Employee/Taxes/Actions.js +8 -11
- package/dist/components/Employee/Taxes/Actions.js.map +1 -1
- package/dist/components/Employee/Taxes/FederalForm.d.ts +2 -8
- package/dist/components/Employee/Taxes/FederalForm.js +27 -85
- package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/Taxes/Taxes.js +83 -88
- package/dist/components/Employee/Taxes/Taxes.js.map +1 -1
- package/dist/components/Employee/Taxes/useTaxes.js +5 -5
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.d.ts +11 -0
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.js +123 -0
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.js.map +1 -0
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.d.ts +11 -0
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js +89 -0
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js.map +1 -0
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlow.d.ts +2 -0
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlow.js +30 -0
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlow.js.map +1 -0
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.d.ts +23 -0
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.js +70 -0
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.js.map +1 -0
- package/dist/components/Employee/Terminations/TerminationFlow/index.d.ts +3 -0
- package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.d.ts +7 -0
- package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.js +165 -0
- package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.js.map +1 -0
- package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.test.d.ts +1 -0
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummary.d.ts +9 -0
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummary.js +86 -0
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummary.js.map +1 -0
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.d.ts +20 -0
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.js +100 -0
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.js.map +1 -0
- package/dist/components/Employee/Terminations/TerminationsData.d.ts +6 -0
- package/dist/components/Employee/Terminations/index.d.ts +8 -0
- package/dist/components/Employee/Terminations/types.d.ts +1 -0
- package/dist/components/Employee/index.d.ts +7 -0
- package/dist/components/Employee/index.js +34 -28
- package/dist/components/Employee/index.js.map +1 -1
- package/dist/components/Flow/Flow.js +20 -23
- package/dist/components/Flow/Flow.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js +16 -18
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js +18 -20
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequests.js +34 -35
- package/dist/components/InformationRequests/InformationRequests.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js +41 -41
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +8 -10
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js.map +1 -1
- package/dist/components/Payroll/Dismissal/DismissalFlow.d.ts +2 -0
- package/dist/components/Payroll/Dismissal/DismissalFlow.js +32 -0
- package/dist/components/Payroll/Dismissal/DismissalFlow.js.map +1 -0
- package/dist/components/Payroll/Dismissal/DismissalFlowComponents.d.ts +16 -0
- package/dist/components/Payroll/Dismissal/DismissalFlowComponents.js +52 -0
- package/dist/components/Payroll/Dismissal/DismissalFlowComponents.js.map +1 -0
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.d.ts +6 -0
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.js +69 -0
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.js.map +1 -0
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.d.ts +9 -0
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.js +50 -0
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.js.map +1 -0
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/index.d.ts +3 -0
- package/dist/components/Payroll/Dismissal/dismissalStateMachine.d.ts +6 -0
- package/dist/components/Payroll/Dismissal/dismissalStateMachine.js +51 -0
- package/dist/components/Payroll/Dismissal/dismissalStateMachine.js.map +1 -0
- package/dist/components/Payroll/Dismissal/dismissalStateMachine.test.d.ts +1 -0
- package/dist/components/Payroll/Dismissal/index.d.ts +3 -0
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +25 -23
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
- package/dist/components/Payroll/OffCycle/OffCycleFlow.d.ts +1 -1
- package/dist/components/Payroll/OffCycle/OffCycleFlow.js +19 -18
- package/dist/components/Payroll/OffCycle/OffCycleFlow.js.map +1 -1
- package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.d.ts +3 -0
- package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js +32 -24
- package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js +50 -50
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.d.ts +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js +75 -68
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.module.scss.js +8 -0
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.module.scss.js.map +1 -0
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationTypes.d.ts +0 -1
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js +5 -9
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.module.scss.js +4 -4
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.js +2 -2
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.js.map +1 -1
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.d.ts +1 -0
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.js +1 -0
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.js.map +1 -1
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js +6 -9
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js +12 -14
- package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +11 -14
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +22 -22
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +187 -160
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.d.ts +3 -3
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +71 -71
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/grossUpHelpers.d.ts +3 -2
- package/dist/components/Payroll/PayrollConfiguration/grossUpHelpers.js +8 -8
- package/dist/components/Payroll/PayrollConfiguration/grossUpHelpers.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.d.ts +5 -3
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js +76 -70
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js +47 -42
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.d.ts +4 -2
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +235 -196
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +19 -21
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/OffCycleFlowContextual.d.ts +1 -0
- package/dist/components/Payroll/PayrollFlow/OffCycleFlowContextual.js +12 -0
- package/dist/components/Payroll/PayrollFlow/OffCycleFlowContextual.js.map +1 -0
- package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.d.ts +3 -0
- package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/TransitionFlowContextual.d.ts +1 -0
- package/dist/components/Payroll/PayrollFlow/TransitionFlowContextual.js +21 -0
- package/dist/components/Payroll/PayrollFlow/TransitionFlowContextual.js.map +1 -0
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.d.ts +2 -0
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js +95 -64
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.js +53 -47
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +38 -40
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js +28 -24
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollList.js +43 -33
- package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.d.ts +2 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +110 -95
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js +12 -8
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +2 -3
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +4 -4
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js +7 -10
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js.map +1 -1
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +2 -3
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js +2 -4
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js +11 -13
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js +2 -5
- package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js.map +1 -1
- package/dist/components/Payroll/Transition/TransitionFlow.d.ts +2 -0
- package/dist/components/Payroll/Transition/TransitionFlow.js +38 -0
- package/dist/components/Payroll/Transition/TransitionFlow.js.map +1 -0
- package/dist/components/Payroll/Transition/TransitionFlowComponents.d.ts +19 -0
- package/dist/components/Payroll/Transition/TransitionFlowComponents.js +54 -0
- package/dist/components/Payroll/Transition/TransitionFlowComponents.js.map +1 -0
- package/dist/components/Payroll/Transition/index.d.ts +3 -0
- package/dist/components/Payroll/Transition/transitionStateMachine.d.ts +6 -0
- package/dist/components/Payroll/Transition/transitionStateMachine.js +58 -0
- package/dist/components/Payroll/Transition/transitionStateMachine.js.map +1 -0
- package/dist/components/Payroll/Transition/transitionStateMachine.test.d.ts +1 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreation.d.ts +2 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreation.js +92 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreation.js.map +1 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.d.ts +2 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.js +109 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.js.map +1 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.module.scss.js +8 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.module.scss.js.map +1 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreationTypes.d.ts +28 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreationTypes.js +21 -0
- package/dist/components/Payroll/TransitionCreation/TransitionCreationTypes.js.map +1 -0
- package/dist/components/Payroll/TransitionCreation/index.d.ts +3 -0
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.d.ts +8 -0
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.js +83 -0
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.js.map +1 -0
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.d.ts +16 -0
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.js +100 -0
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.js.map +1 -0
- package/dist/components/Payroll/TransitionPayrollAlert/index.d.ts +2 -0
- package/dist/components/Payroll/helpers.d.ts +3 -2
- package/dist/components/Payroll/helpers.js +98 -87
- package/dist/components/Payroll/helpers.js.map +1 -1
- package/dist/components/Payroll/index.d.ts +6 -0
- package/dist/components/Payroll/index.js +32 -26
- package/dist/components/Payroll/index.js.map +1 -1
- package/dist/components/Payroll/payrollTypes.d.ts +21 -0
- package/dist/components/Payroll/payrollTypes.js +27 -0
- package/dist/components/Payroll/payrollTypes.js.map +1 -0
- package/dist/components/Payroll/usePreparedPayrollData.js +6 -7
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/collectErrors.d.ts +6 -0
- package/dist/components/UNSTABLE_Hooks/collectErrors.js +9 -0
- package/dist/components/UNSTABLE_Hooks/collectErrors.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataContext.d.ts +8 -0
- package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataContext.js +13 -0
- package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataContext.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataProvider.d.ts +10 -0
- package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataProvider.js +13 -0
- package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataProvider.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/SDKFormProvider.d.ts +23 -0
- package/dist/components/UNSTABLE_Hooks/form/SDKFormProvider.js +24 -0
- package/dist/components/UNSTABLE_Hooks/form/SDKFormProvider.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/composeFormSchema.d.ts +26 -0
- package/dist/components/UNSTABLE_Hooks/form/composeFormSchema.js +24 -0
- package/dist/components/UNSTABLE_Hooks/form/composeFormSchema.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/composeSubmitHandler.d.ts +53 -0
- package/dist/components/UNSTABLE_Hooks/form/composeSubmitHandler.js +34 -0
- package/dist/components/UNSTABLE_Hooks/form/composeSubmitHandler.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/composeSubmitHandler.test.d.ts +1 -0
- package/dist/components/UNSTABLE_Hooks/form/deriveFieldsMetadata.d.ts +3 -0
- package/dist/components/UNSTABLE_Hooks/form/deriveFieldsMetadata.js +14 -0
- package/dist/components/UNSTABLE_Hooks/form/deriveFieldsMetadata.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/deriveFieldsMetadata.test.d.ts +1 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/CheckboxHookField.d.ts +9 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/CheckboxHookField.js +29 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/CheckboxHookField.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/DatePickerHookField.d.ts +9 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/DatePickerHookField.js +29 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/DatePickerHookField.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/NumberInputHookField.d.ts +12 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/NumberInputHookField.js +35 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/NumberInputHookField.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/RadioGroupHookField.d.ts +10 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/RadioGroupHookField.js +35 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/RadioGroupHookField.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/SelectHookField.d.ts +10 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/SelectHookField.js +35 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/SelectHookField.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/SwitchHookField.d.ts +9 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/SwitchHookField.js +29 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/SwitchHookField.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/TextInputHookField.d.ts +11 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/TextInputHookField.js +33 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/TextInputHookField.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/fields/index.d.ts +15 -0
- package/dist/components/UNSTABLE_Hooks/form/getFieldWithOptions.d.ts +2 -0
- package/dist/components/UNSTABLE_Hooks/form/getFieldWithOptions.js +8 -0
- package/dist/components/UNSTABLE_Hooks/form/getFieldWithOptions.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/getFormSubmissionValues.d.ts +18 -0
- package/dist/components/UNSTABLE_Hooks/form/getFormSubmissionValues.js +10 -0
- package/dist/components/UNSTABLE_Hooks/form/getFormSubmissionValues.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/getFormSubmissionValues.test.d.ts +1 -0
- package/dist/components/UNSTABLE_Hooks/form/index.d.ts +14 -0
- package/dist/components/UNSTABLE_Hooks/form/resolveRequiredFields.d.ts +6 -0
- package/dist/components/UNSTABLE_Hooks/form/resolveRequiredFields.js +14 -0
- package/dist/components/UNSTABLE_Hooks/form/resolveRequiredFields.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/types.d.ts +27 -0
- package/dist/components/UNSTABLE_Hooks/form/useFieldErrorMessage.d.ts +2 -0
- package/dist/components/UNSTABLE_Hooks/form/useFieldErrorMessage.js +17 -0
- package/dist/components/UNSTABLE_Hooks/form/useFieldErrorMessage.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/useFieldsMetadata.d.ts +4 -0
- package/dist/components/UNSTABLE_Hooks/form/useFieldsMetadata.js +9 -0
- package/dist/components/UNSTABLE_Hooks/form/useFieldsMetadata.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/form/withOptions.d.ts +5 -0
- package/dist/components/UNSTABLE_Hooks/form/withOptions.js +7 -0
- package/dist/components/UNSTABLE_Hooks/form/withOptions.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/CompensationForm.d.ts +5 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/CompensationForm.js +149 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/CompensationForm.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/compensationSchema.d.ts +97 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/compensationSchema.js +121 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/compensationSchema.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/fields.d.ts +34 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/fields.js +50 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/fields.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/index.d.ts +7 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.d.ts +104 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.js +259 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/EmployeeDetailsForm.d.ts +5 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/EmployeeDetailsForm.js +112 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/EmployeeDetailsForm.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/employeeDetailsSchema.d.ts +39 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/employeeDetailsSchema.js +45 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/employeeDetailsSchema.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/fields.d.ts +23 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/fields.js +46 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/fields.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/index.d.ts +7 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/useEmployeeDetailsForm.d.ts +77 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/useEmployeeDetailsForm.js +153 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/useEmployeeDetailsForm.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/WorkAddressForm.d.ts +5 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/WorkAddressForm.js +69 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/WorkAddressForm.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/fields.d.ts +10 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/fields.js +14 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/fields.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/index.d.ts +7 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/useWorkAddressForm.d.ts +68 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/useWorkAddressForm.js +129 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/useWorkAddressForm.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/workAddressSchema.d.ts +25 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/workAddressSchema.js +24 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/workAddressSchema.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/index.d.ts +9 -0
- package/dist/components/UNSTABLE_Hooks/types.d.ts +49 -0
- package/dist/components/UNSTABLE_Hooks/useErrorHandling.d.ts +9 -0
- package/dist/components/UNSTABLE_Hooks/useErrorHandling.js +12 -0
- package/dist/components/UNSTABLE_Hooks/useErrorHandling.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/useErrorHandling.test.d.ts +1 -0
- package/dist/contexts/ApiProvider/ApiProvider.js +11 -11
- package/dist/contexts/ApiProvider/ApiProvider.js.map +1 -1
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +43 -50
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/contexts/ObservabilityProvider/index.d.ts +1 -1
- package/dist/contexts/ObservabilityProvider/sanitization.d.ts +0 -14
- package/dist/contexts/ObservabilityProvider/sanitization.js +51 -51
- package/dist/contexts/ObservabilityProvider/sanitization.js.map +1 -1
- package/dist/contexts/ObservabilityProvider/useSanitizedObservability.d.ts +0 -3
- package/dist/contexts/ObservabilityProvider/useSanitizedObservability.js.map +1 -1
- package/dist/helpers/requiredIf.d.ts +13 -0
- package/dist/helpers/requiredIf.js +8 -0
- package/dist/helpers/requiredIf.js.map +1 -0
- package/dist/i18n/I18n.js +13 -13
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Employee.Terminations.TerminateEmployee.json.js +18 -0
- package/dist/i18n/en/Employee.Terminations.TerminateEmployee.json.js.map +1 -0
- package/dist/i18n/en/Employee.Terminations.TerminationFlow.json.js +12 -0
- package/dist/i18n/en/Employee.Terminations.TerminationFlow.json.js.map +1 -0
- package/dist/i18n/en/Employee.Terminations.TerminationSummary.json.js +20 -0
- package/dist/i18n/en/Employee.Terminations.TerminationSummary.json.js.map +1 -0
- package/dist/i18n/en/Payroll.Dismissal.json.js +22 -0
- package/dist/i18n/en/Payroll.Dismissal.json.js.map +1 -0
- package/dist/i18n/en/Payroll.OffCycleCreation.json.js +15 -11
- package/dist/i18n/en/Payroll.OffCycleCreation.json.js.map +1 -1
- package/dist/i18n/en/Payroll.OffCyclePayPeriodDateForm.json.js +1 -1
- package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js +20 -18
- package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js.map +1 -1
- package/dist/i18n/en/Payroll.PayrollList.json.js +20 -18
- package/dist/i18n/en/Payroll.PayrollList.json.js.map +1 -1
- package/dist/i18n/en/Payroll.Transition.json.js +8 -0
- package/dist/i18n/en/Payroll.Transition.json.js.map +1 -0
- package/dist/i18n/en/Payroll.TransitionCreation.json.js +26 -0
- package/dist/i18n/en/Payroll.TransitionCreation.json.js.map +1 -0
- package/dist/i18n/en/Payroll.TransitionPayrollAlert.json.js +18 -0
- package/dist/i18n/en/Payroll.TransitionPayrollAlert.json.js.map +1 -0
- package/dist/i18n/en/UNSTABLE.CompensationForm.json.js +58 -0
- package/dist/i18n/en/UNSTABLE.CompensationForm.json.js.map +1 -0
- package/dist/i18n/en/UNSTABLE.EmployeeDetailsForm.json.js +34 -0
- package/dist/i18n/en/UNSTABLE.EmployeeDetailsForm.json.js.map +1 -0
- package/dist/i18n/en/UNSTABLE.WorkAddressForm.json.js +24 -0
- package/dist/i18n/en/UNSTABLE.WorkAddressForm.json.js.map +1 -0
- package/dist/i18n/en/common.json.d.ts +2 -1
- package/dist/i18n/en/common.json.js +9 -9
- package/dist/index.d.ts +3 -2
- package/dist/index.js +14 -13
- package/dist/models/WA_RISK_CODES.d.ts +5 -2866
- package/dist/models/WA_RISK_CODES.js.map +1 -1
- package/dist/shared/constants.d.ts +32 -0
- package/dist/shared/constants.js +83 -65
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +279 -1
- package/dist/types/observability.d.ts +31 -65
- package/dist/types/sdkError.d.ts +97 -0
- package/dist/types/sdkError.js +95 -0
- package/dist/types/sdkError.js.map +1 -0
- package/dist/types/sdkError.test.d.ts +1 -0
- package/docs/reference/endpoint-inventory.json +212 -14
- package/package.json +18 -18
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfiguration.d.ts +0 -6
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfiguration.js +0 -70
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfiguration.js.map +0 -1
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationContext.d.ts +0 -7
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationContext.js +0 -6
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationContext.js.map +0 -1
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationProvider.d.ts +0 -9
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationProvider.js +0 -40
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationProvider.js.map +0 -1
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/index.d.ts +0 -5
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/usePayrollConfiguration.d.ts +0 -2
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/usePayrollConfiguration.js +0 -12
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/usePayrollConfiguration.js.map +0 -1
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/index.d.ts +0 -2
- package/dist/contexts/ObservabilityProvider/observabilityUtils.d.ts +0 -5
- package/dist/contexts/ObservabilityProvider/observabilityUtils.js +0 -45
- package/dist/contexts/ObservabilityProvider/observabilityUtils.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## 0.
|
|
3
|
+
## 0.36.0
|
|
4
4
|
|
|
5
5
|
### Features & Enhancements
|
|
6
6
|
|
|
7
7
|
- Integrate tax withholding config into off-cycle payroll creation
|
|
8
8
|
- Add gross up modal to PayrollConfiguration kebab menu
|
|
9
|
+
- Add observability hooks with PII protection
|
|
9
10
|
|
|
10
11
|
### Fixes
|
|
11
12
|
|
|
@@ -14,9 +15,12 @@
|
|
|
14
15
|
- Updated to use correct translation keys
|
|
15
16
|
- Handle date field serialization in state taxes form
|
|
16
17
|
- Preset payment date based on company payment speed
|
|
18
|
+
- Revert react-aria upgrade and block in dependabot
|
|
17
19
|
|
|
18
20
|
### Chores & Maintenance
|
|
19
21
|
|
|
22
|
+
- Update embedded api to 0.12.4
|
|
23
|
+
- Convert Cursor commands to Claude Code skills
|
|
20
24
|
- Add comprehensive tests for rem conversion utilities
|
|
21
25
|
- Improve Cursor configuration for team productivity
|
|
22
26
|
- Upgrade vitest to v4, coverage-v8 to v4, and plugin-react-swc to v4
|
|
@@ -25,17 +29,22 @@
|
|
|
25
29
|
- Bump dompurify from 3.3.2 to 3.3.3
|
|
26
30
|
- Bump react-aria from 3.45.0 to 3.47.0
|
|
27
31
|
- Bump sass-embedded from 1.97.3 to 1.98.0
|
|
28
|
-
- Bump typescript-eslint from 8.56.1 to 8.57.
|
|
29
|
-
- Bump eslint-plugin-storybook from 10.2.15 to 10.2.
|
|
30
|
-
- Bump @storybook/react-vite from 10.2.15 to 10.2.
|
|
31
|
-
- Bump @storybook/addon-docs from 10.2.14 to 10.2.
|
|
32
|
-
- Bump @storybook/addon-a11y from 10.2.16 to 10.2.
|
|
33
|
-
- Bump @storybook/addon-onboarding from 10.2.15 to 10.2.
|
|
34
|
-
- Bump storybook from 10.2.16 to 10.2.
|
|
35
|
-
- Bump lint-staged from 16.3.2 to 16.
|
|
32
|
+
- Bump typescript-eslint from 8.56.1 to 8.57.1
|
|
33
|
+
- Bump eslint-plugin-storybook from 10.2.15 to 10.2.19
|
|
34
|
+
- Bump @storybook/react-vite from 10.2.15 to 10.2.19
|
|
35
|
+
- Bump @storybook/addon-docs from 10.2.14 to 10.2.19
|
|
36
|
+
- Bump @storybook/addon-a11y from 10.2.16 to 10.2.19
|
|
37
|
+
- Bump @storybook/addon-onboarding from 10.2.15 to 10.2.19
|
|
38
|
+
- Bump storybook from 10.2.16 to 10.2.19
|
|
39
|
+
- Bump lint-staged from 16.3.2 to 16.4.0
|
|
40
|
+
- Bump msw from 2.12.10 to 2.12.12
|
|
36
41
|
- Bump eslint from 9.39.3 to 9.39.4
|
|
37
|
-
- Bump @commitlint/cli from 20.4.3 to 20.
|
|
38
|
-
- Bump @commitlint/config-conventional from 20.4.3 to 20.
|
|
42
|
+
- Bump @commitlint/cli from 20.4.3 to 20.5.0
|
|
43
|
+
- Bump @commitlint/config-conventional from 20.4.3 to 20.5.0
|
|
44
|
+
|
|
45
|
+
## 0.35.0 (unpublished)
|
|
46
|
+
|
|
47
|
+
> This version was unpublished from NPM due to a critical bug caused by a react-aria upgrade that required a rollback. All changes are included in 0.36.0.
|
|
39
48
|
|
|
40
49
|
## 0.34.0
|
|
41
50
|
|
package/README.md
CHANGED
package/dist/UNSTABLE_Hooks.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { useCompensationForm, CompensationForm, CompensationErrorCodes, type CompensationFormProps, type CompensationSubmitCallbacks, type CompensationSubmitOptions, type CompensationRequiredFields, type UseCompensationFormProps, type UseCompensationFormResult, type UseCompensationFormReady, type CompensationFieldsMetadata, type CompensationFormFields, type CompensationErrorCode, type CompensationField, type CompensationFormData, type CompensationFormOutputs, type RequiredValidation, type RateValidation, type StartDateFieldProps, type JobTitleFieldProps, type FlsaStatusFieldProps, type RateFieldProps, type PaymentUnitFieldProps, type AdjustForMinimumWageFieldProps, type MinimumWageIdFieldProps, type TwoPercentShareholderFieldProps, type StateWcCoveredFieldProps, type StateWcClassCodeFieldProps, SDKFormProvider, FormFieldsMetadataProvider, composeSubmitHandler, useFieldsMetadata, useFieldErrorMessage, withOptions, deriveFieldsMetadata, collectErrors, TextInputHookField, SelectHookField, CheckboxHookField, NumberInputHookField, DatePickerHookField, RadioGroupHookField, useErrorHandling, type HookFormInternals, type HookLoadingResult, type HookSubmitResult, type HookErrorHandling, type BaseHookReady, type BaseFormHookReady, type FieldMetadata, type FieldMetadataWithOptions, type FieldsMetadata, type FormFieldsMetadataContextValue, type ValidationMessages, type BaseFieldProps, type TextInputHookFieldProps, type SelectHookFieldProps, type CheckboxHookFieldProps, type NumberInputHookFieldProps, type DatePickerHookFieldProps, type RadioGroupHookFieldProps, type TextInputProps, type SelectProps, type SelectOption, type CheckboxProps, type NumberInputProps, type DatePickerProps, type RadioGroupProps, type RadioGroupOption, useEmployeeDetailsForm, EmployeeDetailsForm, EmployeeDetailsErrorCodes, type EmployeeDetailsFormProps, type EmployeeDetailsSubmitCallbacks, type EmployeeDetailsRequiredFields, type UseEmployeeDetailsFormProps, type UseEmployeeDetailsFormResult, type UseEmployeeDetailsFormReady, type EmployeeDetailsFieldsMetadata, type EmployeeDetailsFormFields, type EmployeeDetailsErrorCode, type EmployeeDetailsFormData, type EmployeeDetailsFormOutputs, type EmployeeDetailsField, type EmployeeDetailsRequiredValidation, type EmailValidation, type SsnValidation, type FirstNameFieldProps, type MiddleInitialFieldProps, type LastNameFieldProps, type EmailFieldProps, type DateOfBirthFieldProps, type SsnFieldProps, type SelfOnboardingFieldProps, useWorkAddressForm, WorkAddressForm, WorkAddressErrorCodes, type WorkAddressFormProps, type WorkAddressSubmitCallbacks, type WorkAddressSubmitOptions, type WorkAddressRequiredFields, type UseWorkAddressFormProps, type UseWorkAddressFormResult, type UseWorkAddressFormReady, type WorkAddressFieldsMetadata, type WorkAddressFormFields, type WorkAddressErrorCode, type WorkAddressFormData, type WorkAddressFormOutputs, type WorkAddressField, type WorkAddressRequiredValidation, type LocationFieldProps, type EffectiveDateFieldProps, } from './components/UNSTABLE_Hooks';
|
package/dist/UNSTABLE_Hooks.js
CHANGED
|
@@ -1,9 +1,51 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { useErrorHandling as e } from "./components/UNSTABLE_Hooks/useErrorHandling.js";
|
|
2
|
+
import { collectErrors as m } from "./components/UNSTABLE_Hooks/collectErrors.js";
|
|
3
|
+
import { CheckboxHookField as s } from "./components/UNSTABLE_Hooks/form/fields/CheckboxHookField.js";
|
|
4
|
+
import { CompensationErrorCodes as x } from "./components/UNSTABLE_Hooks/hooks/useCompensationForm/compensationSchema.js";
|
|
5
|
+
import { CompensationForm as f } from "./components/UNSTABLE_Hooks/hooks/useCompensationForm/CompensationForm.js";
|
|
6
|
+
import { DatePickerHookField as a } from "./components/UNSTABLE_Hooks/form/fields/DatePickerHookField.js";
|
|
7
|
+
import { EmployeeDetailsErrorCodes as n } from "./components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/employeeDetailsSchema.js";
|
|
8
|
+
import { EmployeeDetailsForm as u } from "./components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/EmployeeDetailsForm.js";
|
|
9
|
+
import { FormFieldsMetadataProvider as H } from "./components/UNSTABLE_Hooks/form/FormFieldsMetadataProvider.js";
|
|
10
|
+
import { NumberInputHookField as c } from "./components/UNSTABLE_Hooks/form/fields/NumberInputHookField.js";
|
|
11
|
+
import { RadioGroupHookField as M } from "./components/UNSTABLE_Hooks/form/fields/RadioGroupHookField.js";
|
|
12
|
+
import { SDKFormProvider as v } from "./components/UNSTABLE_Hooks/form/SDKFormProvider.js";
|
|
13
|
+
import { SelectHookField as A } from "./components/UNSTABLE_Hooks/form/fields/SelectHookField.js";
|
|
14
|
+
import { TextInputHookField as S } from "./components/UNSTABLE_Hooks/form/fields/TextInputHookField.js";
|
|
15
|
+
import { WorkAddressErrorCodes as g } from "./components/UNSTABLE_Hooks/hooks/useWorkAddressForm/workAddressSchema.js";
|
|
16
|
+
import { WorkAddressForm as I } from "./components/UNSTABLE_Hooks/hooks/useWorkAddressForm/WorkAddressForm.js";
|
|
17
|
+
import { composeSubmitHandler as G } from "./components/UNSTABLE_Hooks/form/composeSubmitHandler.js";
|
|
18
|
+
import { deriveFieldsMetadata as N } from "./components/UNSTABLE_Hooks/form/deriveFieldsMetadata.js";
|
|
19
|
+
import { useCompensationForm as R } from "./components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.js";
|
|
20
|
+
import { useEmployeeDetailsForm as j } from "./components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/useEmployeeDetailsForm.js";
|
|
21
|
+
import { useFieldErrorMessage as z } from "./components/UNSTABLE_Hooks/form/useFieldErrorMessage.js";
|
|
22
|
+
import { useFieldsMetadata as J } from "./components/UNSTABLE_Hooks/form/useFieldsMetadata.js";
|
|
23
|
+
import { useWorkAddressForm as Q } from "./components/UNSTABLE_Hooks/hooks/useWorkAddressForm/useWorkAddressForm.js";
|
|
24
|
+
import { withOptions as V } from "./components/UNSTABLE_Hooks/form/withOptions.js";
|
|
4
25
|
export {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
26
|
+
s as CheckboxHookField,
|
|
27
|
+
x as CompensationErrorCodes,
|
|
28
|
+
f as CompensationForm,
|
|
29
|
+
a as DatePickerHookField,
|
|
30
|
+
n as EmployeeDetailsErrorCodes,
|
|
31
|
+
u as EmployeeDetailsForm,
|
|
32
|
+
H as FormFieldsMetadataProvider,
|
|
33
|
+
c as NumberInputHookField,
|
|
34
|
+
M as RadioGroupHookField,
|
|
35
|
+
v as SDKFormProvider,
|
|
36
|
+
A as SelectHookField,
|
|
37
|
+
S as TextInputHookField,
|
|
38
|
+
g as WorkAddressErrorCodes,
|
|
39
|
+
I as WorkAddressForm,
|
|
40
|
+
m as collectErrors,
|
|
41
|
+
G as composeSubmitHandler,
|
|
42
|
+
N as deriveFieldsMetadata,
|
|
43
|
+
R as useCompensationForm,
|
|
44
|
+
j as useEmployeeDetailsForm,
|
|
45
|
+
e as useErrorHandling,
|
|
46
|
+
z as useFieldErrorMessage,
|
|
47
|
+
J as useFieldsMetadata,
|
|
48
|
+
Q as useWorkAddressForm,
|
|
49
|
+
V as withOptions
|
|
8
50
|
};
|
|
9
51
|
//# sourceMappingURL=UNSTABLE_Hooks.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UNSTABLE_Hooks.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UNSTABLE_Hooks.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ReactNode, JSX, ErrorInfo } from 'react';
|
|
2
2
|
import { FallbackProps } from 'react-error-boundary';
|
|
3
|
-
import {
|
|
4
|
-
import { KnownErrors, OnEventType } from './useBase';
|
|
3
|
+
import { OnEventType } from './useBase';
|
|
5
4
|
import { EventType } from '../../shared/constants';
|
|
6
5
|
import { ResourceDictionary, Resources } from '../../types/Helpers';
|
|
7
6
|
import { LoadingIndicatorContextProps } from '../../contexts/LoadingIndicatorProvider/useLoadingIndicator';
|
|
7
|
+
import { SDKError } from '../../types/sdkError';
|
|
8
8
|
export interface CommonComponentInterface<TResourceKey extends keyof Resources = keyof Resources> {
|
|
9
9
|
children?: ReactNode;
|
|
10
10
|
className?: string;
|
|
@@ -13,25 +13,24 @@ export interface CommonComponentInterface<TResourceKey extends keyof Resources =
|
|
|
13
13
|
}
|
|
14
14
|
export interface BaseComponentInterface<TResourceKey extends keyof Resources = keyof Resources> extends CommonComponentInterface<TResourceKey> {
|
|
15
15
|
FallbackComponent?: BaseBoundariesProps['FallbackComponent'];
|
|
16
|
-
LoaderComponent?:
|
|
16
|
+
LoaderComponent?: LoadingIndicatorContextProps['LoadingIndicator'];
|
|
17
17
|
onEvent: OnEventType<EventType, unknown>;
|
|
18
18
|
}
|
|
19
19
|
interface InternalBaseComponentProps {
|
|
20
20
|
componentName?: string;
|
|
21
21
|
}
|
|
22
22
|
export declare const BaseComponent: <TResourceKey extends keyof Resources = keyof Resources>({ children, FallbackComponent, LoaderComponent: LoadingIndicatorFromProps, onEvent, componentName, }: BaseComponentInterface<TResourceKey> & InternalBaseComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
-
interface BaseLayoutProps {
|
|
23
|
+
export interface BaseLayoutProps {
|
|
24
24
|
children?: ReactNode;
|
|
25
|
-
error
|
|
26
|
-
|
|
25
|
+
error?: SDKError | SDKError[] | null;
|
|
26
|
+
isLoading?: boolean;
|
|
27
27
|
}
|
|
28
|
-
export declare const BaseLayout: ({ children, error,
|
|
28
|
+
export declare const BaseLayout: ({ children, error, isLoading }: BaseLayoutProps) => import("react/jsx-runtime").JSX.Element;
|
|
29
29
|
export interface BaseBoundariesProps {
|
|
30
30
|
children?: ReactNode;
|
|
31
31
|
FallbackComponent?: (props: FallbackProps) => JSX.Element;
|
|
32
|
-
LoaderComponent?: LoadingIndicatorContextProps['LoadingIndicator'];
|
|
33
32
|
onErrorBoundaryError?: (error: unknown, info: ErrorInfo) => void;
|
|
34
33
|
componentName?: string;
|
|
35
34
|
}
|
|
36
|
-
export declare const BaseBoundaries: ({ children, FallbackComponent,
|
|
35
|
+
export declare const BaseBoundaries: ({ children, FallbackComponent, onErrorBoundaryError, componentName, }: BaseBoundariesProps) => import("react/jsx-runtime").JSX.Element;
|
|
37
36
|
export {};
|
|
@@ -1,126 +1,147 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Suspense as
|
|
1
|
+
import { jsx as e, jsxs as m } from "react/jsx-runtime";
|
|
2
|
+
import { Suspense as k, useRef as c, useEffect as u } from "react";
|
|
3
3
|
import { ErrorBoundary as B } from "react-error-boundary";
|
|
4
|
-
import { useTranslation as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import "
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
LoaderComponent: n,
|
|
22
|
-
onEvent: e,
|
|
23
|
-
componentName: o
|
|
4
|
+
import { useTranslation as p } from "react-i18next";
|
|
5
|
+
import { QueryErrorResetBoundary as S } from "@tanstack/react-query";
|
|
6
|
+
import { FadeIn as I } from "../Common/FadeIn/FadeIn.js";
|
|
7
|
+
import { BaseContext as R } from "./useBase.js";
|
|
8
|
+
import { useBaseSubmit as x } from "./useBaseSubmit.js";
|
|
9
|
+
import { componentEvents as D } from "../../shared/constants.js";
|
|
10
|
+
import { InternalError as f } from "../Common/InternalError/InternalError.js";
|
|
11
|
+
import { useComponentContext as g } from "../../contexts/ComponentAdapter/useComponentContext.js";
|
|
12
|
+
import { useLoadingIndicator as d } from "../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
13
|
+
import { useObservability as E } from "../../contexts/ObservabilityProvider/useObservability.js";
|
|
14
|
+
import { normalizeToSDKError as F } from "../../types/sdkError.js";
|
|
15
|
+
const $ = ({
|
|
16
|
+
children: r,
|
|
17
|
+
FallbackComponent: t = f,
|
|
18
|
+
LoaderComponent: s,
|
|
19
|
+
onEvent: o,
|
|
20
|
+
componentName: n
|
|
24
21
|
}) => {
|
|
25
|
-
const { error:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
},
|
|
34
|
-
originalError: c,
|
|
35
|
-
timestamp: Date.now()
|
|
22
|
+
const { error: i, baseSubmitHandler: a, setError: h } = x(n), { observability: y } = E(), { LoadingIndicator: L } = d(), b = s ?? L, w = (l, C) => {
|
|
23
|
+
o(D.ERROR, l);
|
|
24
|
+
const v = F(l);
|
|
25
|
+
y?.onError?.({
|
|
26
|
+
...v,
|
|
27
|
+
timestamp: Date.now(),
|
|
28
|
+
componentName: n,
|
|
29
|
+
componentStack: C.componentStack ?? void 0
|
|
36
30
|
});
|
|
37
31
|
};
|
|
38
|
-
return /* @__PURE__ */
|
|
39
|
-
|
|
32
|
+
return /* @__PURE__ */ e(
|
|
33
|
+
R.Provider,
|
|
40
34
|
{
|
|
41
35
|
value: {
|
|
42
|
-
error:
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
componentName: o
|
|
36
|
+
error: i,
|
|
37
|
+
setError: h,
|
|
38
|
+
onEvent: o,
|
|
39
|
+
baseSubmitHandler: a,
|
|
40
|
+
LoadingIndicator: b,
|
|
41
|
+
componentName: n
|
|
49
42
|
},
|
|
50
|
-
children: /* @__PURE__ */
|
|
51
|
-
|
|
43
|
+
children: /* @__PURE__ */ e(
|
|
44
|
+
_,
|
|
52
45
|
{
|
|
53
|
-
FallbackComponent:
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
children: /* @__PURE__ */ s(M, { error: t, fieldErrors: a, children: i })
|
|
46
|
+
FallbackComponent: t,
|
|
47
|
+
onErrorBoundaryError: w,
|
|
48
|
+
componentName: n,
|
|
49
|
+
children: /* @__PURE__ */ e(j, { error: i, children: r })
|
|
58
50
|
}
|
|
59
51
|
)
|
|
60
52
|
}
|
|
61
53
|
);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
54
|
+
};
|
|
55
|
+
function T({ error: r }) {
|
|
56
|
+
const t = g(), { t: s } = p(), o = r.fieldErrors.length > 0;
|
|
57
|
+
return /* @__PURE__ */ m(t.Alert, { label: s("status.errorEncountered"), status: "error", children: [
|
|
58
|
+
o && /* @__PURE__ */ e(
|
|
59
|
+
t.UnorderedList,
|
|
60
|
+
{
|
|
61
|
+
items: r.fieldErrors.filter((n) => n.message).map((n) => /* @__PURE__ */ e("span", { children: n.message }, n.field))
|
|
62
|
+
}
|
|
63
|
+
),
|
|
64
|
+
!o && r.category === "validation_error" && /* @__PURE__ */ e(t.Text, { as: "pre", children: r.raw && typeof r.raw == "object" && "pretty" in r.raw && typeof r.raw.pretty == "function" ? r.raw.pretty() : r.message }),
|
|
65
|
+
!o && r.category !== "validation_error" && /* @__PURE__ */ e(t.Text, { children: r.message || s("errors.unknownError") })
|
|
71
66
|
] });
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
67
|
+
}
|
|
68
|
+
function A({ errors: r }) {
|
|
69
|
+
const t = g(), { t: s } = p();
|
|
70
|
+
return /* @__PURE__ */ e(t.Alert, { label: s("status.multipleErrorsEncountered"), status: "error", children: /* @__PURE__ */ e(
|
|
71
|
+
t.UnorderedList,
|
|
72
|
+
{
|
|
73
|
+
items: r.filter((o) => o.message || o.fieldErrors.length > 0).map((o, n) => {
|
|
74
|
+
const i = o.fieldErrors.filter((a) => a.message);
|
|
75
|
+
return i.length === 0 ? /* @__PURE__ */ e("span", { children: o.message || s("errors.unknownError") }, n) : /* @__PURE__ */ m("span", { children: [
|
|
76
|
+
o.message || s("errors.unknownError"),
|
|
77
|
+
/* @__PURE__ */ e(
|
|
78
|
+
t.UnorderedList,
|
|
79
|
+
{
|
|
80
|
+
items: i.map((a) => /* @__PURE__ */ e("span", { children: a.message }, a.field))
|
|
81
|
+
}
|
|
82
|
+
)
|
|
83
|
+
] }, n);
|
|
84
|
+
})
|
|
85
|
+
}
|
|
86
|
+
) });
|
|
87
|
+
}
|
|
88
|
+
const j = ({ children: r, error: t, isLoading: s }) => {
|
|
89
|
+
const { LoadingIndicator: o } = d(), n = Array.isArray(t) ? t : t ? [t] : [], i = n.length > 0;
|
|
90
|
+
if (s && !i)
|
|
91
|
+
return /* @__PURE__ */ e(o, {});
|
|
92
|
+
const [a] = n;
|
|
93
|
+
return /* @__PURE__ */ m(I, { children: [
|
|
94
|
+
n.length > 1 && /* @__PURE__ */ e(A, { errors: n }),
|
|
95
|
+
n.length === 1 && a && /* @__PURE__ */ e(T, { error: a }),
|
|
96
|
+
r
|
|
97
|
+
] });
|
|
98
|
+
}, M = ({
|
|
99
|
+
LoaderComponent: r,
|
|
100
|
+
observability: t,
|
|
101
|
+
componentName: s
|
|
76
102
|
}) => {
|
|
77
|
-
const
|
|
78
|
-
return
|
|
79
|
-
|
|
80
|
-
}, [
|
|
81
|
-
const a = Date.now() -
|
|
82
|
-
|
|
103
|
+
const o = c(Date.now()), n = c(t), i = c(s);
|
|
104
|
+
return u(() => {
|
|
105
|
+
n.current = t, i.current = s;
|
|
106
|
+
}, [t, s]), u(() => () => {
|
|
107
|
+
const a = Date.now() - o.current;
|
|
108
|
+
n.current?.onMetric?.({
|
|
83
109
|
name: "sdk.component.loading_duration",
|
|
84
110
|
value: a,
|
|
85
111
|
unit: "ms",
|
|
86
|
-
tags:
|
|
112
|
+
tags: i.current ? { component: i.current } : void 0,
|
|
87
113
|
timestamp: Date.now()
|
|
88
114
|
});
|
|
89
|
-
}, []), /* @__PURE__ */
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
componentName: o
|
|
96
|
-
}) => {
|
|
97
|
-
const { LoadingIndicator: t } = L(), a = n ?? t, { observability: m } = g();
|
|
98
|
-
return /* @__PURE__ */ s(R, { children: ({ reset: d }) => /* @__PURE__ */ s(
|
|
99
|
-
B,
|
|
115
|
+
}, []), /* @__PURE__ */ e(r, {});
|
|
116
|
+
};
|
|
117
|
+
function U({ componentName: r }) {
|
|
118
|
+
const { LoadingIndicator: t } = d(), { observability: s } = E();
|
|
119
|
+
return /* @__PURE__ */ e(
|
|
120
|
+
M,
|
|
100
121
|
{
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
children: /* @__PURE__ */ s(
|
|
105
|
-
x,
|
|
106
|
-
{
|
|
107
|
-
fallback: /* @__PURE__ */ s(
|
|
108
|
-
O,
|
|
109
|
-
{
|
|
110
|
-
LoaderComponent: a,
|
|
111
|
-
observability: m,
|
|
112
|
-
componentName: o
|
|
113
|
-
}
|
|
114
|
-
),
|
|
115
|
-
children: i
|
|
116
|
-
}
|
|
117
|
-
)
|
|
122
|
+
LoaderComponent: t,
|
|
123
|
+
observability: s,
|
|
124
|
+
componentName: r
|
|
118
125
|
}
|
|
119
|
-
)
|
|
120
|
-
}
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
const _ = ({
|
|
129
|
+
children: r,
|
|
130
|
+
FallbackComponent: t = f,
|
|
131
|
+
onErrorBoundaryError: s,
|
|
132
|
+
componentName: o
|
|
133
|
+
}) => /* @__PURE__ */ e(S, { children: ({ reset: n }) => /* @__PURE__ */ e(
|
|
134
|
+
B,
|
|
135
|
+
{
|
|
136
|
+
FallbackComponent: t,
|
|
137
|
+
onReset: n,
|
|
138
|
+
onError: s,
|
|
139
|
+
children: /* @__PURE__ */ e(k, { fallback: /* @__PURE__ */ e(U, { componentName: o }), children: r })
|
|
140
|
+
}
|
|
141
|
+
) });
|
|
121
142
|
export {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
143
|
+
_ as BaseBoundaries,
|
|
144
|
+
$ as BaseComponent,
|
|
145
|
+
j as BaseLayout
|
|
125
146
|
};
|
|
126
147
|
//# sourceMappingURL=Base.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Base.js","sources":["../../../src/components/Base/Base.tsx"],"sourcesContent":["import type { ReactNode, JSX, ErrorInfo } from 'react'\nimport { Suspense, useEffect, useRef } from 'react'\nimport type { FallbackProps } from 'react-error-boundary'\nimport { ErrorBoundary } from 'react-error-boundary'\nimport { useTranslation } from 'react-i18next'\nimport { GustoEmbeddedError } from '@gusto/embedded-api/models/errors/gustoembeddederror'\nimport { SDKValidationError } from '@gusto/embedded-api/models/errors/sdkvalidationerror'\nimport { QueryErrorResetBoundary } from '@tanstack/react-query'\nimport type { EntityErrorObject } from '@gusto/embedded-api/models/components/entityerrorobject'\nimport { FadeIn } from '../Common/FadeIn/FadeIn'\nimport { BaseContext, type KnownErrors, type OnEventType } from './useBase'\nimport { useBaseSubmit } from './useBaseSubmit'\nimport { componentEvents, type EventType } from '@/shared/constants'\nimport { InternalError } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport type { ResourceDictionary, Resources } from '@/types/Helpers'\nimport { useLoadingIndicator } from '@/contexts/LoadingIndicatorProvider/useLoadingIndicator'\nimport type { LoadingIndicatorContextProps } from '@/contexts/LoadingIndicatorProvider/useLoadingIndicator'\nimport { useObservability } from '@/contexts/ObservabilityProvider/useObservability'\nimport { renderErrorList } from '@/helpers/apiErrorToList'\n\nexport interface CommonComponentInterface<TResourceKey extends keyof Resources = keyof Resources> {\n children?: ReactNode\n className?: string\n defaultValues?: unknown\n dictionary?: ResourceDictionary<TResourceKey>\n}\n\n// Base component wrapper with error and suspense handling\nexport interface BaseComponentInterface<\n TResourceKey extends keyof Resources = keyof Resources,\n> extends CommonComponentInterface<TResourceKey> {\n FallbackComponent?: BaseBoundariesProps['FallbackComponent']\n LoaderComponent?: BaseBoundariesProps['LoaderComponent']\n onEvent: OnEventType<EventType, unknown>\n}\n\n// Internal prop for SDK components to set their component name\ninterface InternalBaseComponentProps {\n componentName?: string\n}\n\nexport const BaseComponent = <TResourceKey extends keyof Resources = keyof Resources>({\n children,\n FallbackComponent = InternalError,\n LoaderComponent: LoadingIndicatorFromProps,\n onEvent,\n componentName,\n}: BaseComponentInterface<TResourceKey> & InternalBaseComponentProps) => {\n const { error, fieldErrors, baseSubmitHandler, setError } = useBaseSubmit(componentName)\n const { observability } = useObservability()\n\n const { LoadingIndicator: LoadingIndicatorFromContext } = useLoadingIndicator()\n const LoaderComponent = LoadingIndicatorFromProps ?? LoadingIndicatorFromContext\n\n const onErrorBoundaryError = (error: unknown, errorInfo: ErrorInfo) => {\n onEvent(componentEvents.ERROR, error)\n\n observability?.onError?.({\n type: 'boundary_error',\n message: error instanceof Error ? error.message : 'Unknown error',\n stack: error instanceof Error ? error.stack : undefined,\n context: {\n componentName,\n componentStack: errorInfo.componentStack ?? undefined,\n },\n originalError: error,\n timestamp: Date.now(),\n })\n }\n\n return (\n <BaseContext.Provider\n value={{\n error,\n fieldErrors,\n setError,\n onEvent,\n baseSubmitHandler,\n LoadingIndicator: LoaderComponent,\n componentName,\n }}\n >\n <BaseBoundaries\n FallbackComponent={FallbackComponent}\n LoaderComponent={LoaderComponent}\n onErrorBoundaryError={onErrorBoundaryError}\n componentName={componentName}\n >\n <BaseLayout error={error} fieldErrors={fieldErrors}>\n {children}\n </BaseLayout>\n </BaseBoundaries>\n </BaseContext.Provider>\n )\n}\n\ninterface BaseLayoutProps {\n children?: ReactNode\n error: KnownErrors | null\n fieldErrors: Array<EntityErrorObject> | null\n}\n\nexport const BaseLayout = ({ children, error, fieldErrors }: BaseLayoutProps) => {\n const Components = useComponentContext()\n const { t } = useTranslation()\n const hasDisplayableFieldErrors = Boolean(fieldErrors?.length)\n\n return (\n <FadeIn>\n {(error || fieldErrors) && (\n <Components.Alert label={t('status.errorEncountered')} status=\"error\">\n {hasDisplayableFieldErrors && (\n <Components.UnorderedList items={renderErrorList(fieldErrors!)} />\n )}\n {!hasDisplayableFieldErrors && error instanceof GustoEmbeddedError && (\n <Components.Text>{t('errors.unknownError')}</Components.Text>\n )}\n {!hasDisplayableFieldErrors && error instanceof SDKValidationError && (\n <Components.Text as=\"pre\">{error.pretty()}</Components.Text>\n )}\n </Components.Alert>\n )}\n {children}\n </FadeIn>\n )\n}\n\ninterface LoaderWithMetricsProps {\n LoaderComponent: LoadingIndicatorContextProps['LoadingIndicator']\n observability: ReturnType<typeof useObservability>['observability']\n componentName?: string\n}\n\nconst LoaderWithMetrics = ({\n LoaderComponent,\n observability,\n componentName,\n}: LoaderWithMetricsProps) => {\n const loadingStartTime = useRef(Date.now())\n const observabilityRef = useRef(observability)\n const componentNameRef = useRef(componentName)\n\n useEffect(() => {\n observabilityRef.current = observability\n componentNameRef.current = componentName\n }, [observability, componentName])\n\n useEffect(() => {\n return () => {\n const duration = Date.now() - loadingStartTime.current\n observabilityRef.current?.onMetric?.({\n name: 'sdk.component.loading_duration',\n value: duration,\n unit: 'ms',\n tags: componentNameRef.current ? { component: componentNameRef.current } : undefined,\n timestamp: Date.now(),\n })\n }\n }, [])\n\n return <LoaderComponent />\n}\n\nexport interface BaseBoundariesProps {\n children?: ReactNode\n FallbackComponent?: (props: FallbackProps) => JSX.Element\n LoaderComponent?: LoadingIndicatorContextProps['LoadingIndicator']\n onErrorBoundaryError?: (error: unknown, info: ErrorInfo) => void\n componentName?: string\n}\n\nexport const BaseBoundaries = ({\n children,\n FallbackComponent = InternalError,\n LoaderComponent: LoadingIndicatorFromProps,\n onErrorBoundaryError,\n componentName,\n}: BaseBoundariesProps) => {\n const { LoadingIndicator: LoadingIndicatorFromContext } = useLoadingIndicator()\n const LoaderComponent = LoadingIndicatorFromProps ?? LoadingIndicatorFromContext\n const { observability } = useObservability()\n\n return (\n <QueryErrorResetBoundary>\n {({ reset: resetQueries }) => (\n <ErrorBoundary\n FallbackComponent={FallbackComponent}\n onReset={resetQueries}\n onError={onErrorBoundaryError}\n >\n <Suspense\n fallback={\n <LoaderWithMetrics\n LoaderComponent={LoaderComponent}\n observability={observability}\n componentName={componentName}\n />\n }\n >\n {children}\n </Suspense>\n </ErrorBoundary>\n )}\n </QueryErrorResetBoundary>\n )\n}\n"],"names":["BaseComponent","children","FallbackComponent","InternalError","LoadingIndicatorFromProps","onEvent","componentName","error","fieldErrors","baseSubmitHandler","setError","useBaseSubmit","observability","useObservability","LoadingIndicatorFromContext","useLoadingIndicator","LoaderComponent","onErrorBoundaryError","errorInfo","componentEvents","jsx","BaseContext","BaseBoundaries","BaseLayout","Components","useComponentContext","t","useTranslation","hasDisplayableFieldErrors","FadeIn","jsxs","renderErrorList","GustoEmbeddedError","SDKValidationError","LoaderWithMetrics","loadingStartTime","useRef","observabilityRef","componentNameRef","useEffect","duration","QueryErrorResetBoundary","resetQueries","ErrorBoundary","Suspense"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"Base.js","sources":["../../../src/components/Base/Base.tsx"],"sourcesContent":["import type { ReactNode, JSX, ErrorInfo } from 'react'\nimport { Suspense, useEffect, useRef } from 'react'\nimport type { FallbackProps } from 'react-error-boundary'\nimport { ErrorBoundary } from 'react-error-boundary'\nimport { useTranslation } from 'react-i18next'\nimport { QueryErrorResetBoundary } from '@tanstack/react-query'\nimport { FadeIn } from '../Common/FadeIn/FadeIn'\nimport { BaseContext, type OnEventType } from './useBase'\nimport { useBaseSubmit } from './useBaseSubmit'\nimport { componentEvents, type EventType } from '@/shared/constants'\nimport { InternalError } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport type { ResourceDictionary, Resources } from '@/types/Helpers'\nimport { useLoadingIndicator } from '@/contexts/LoadingIndicatorProvider/useLoadingIndicator'\nimport type { LoadingIndicatorContextProps } from '@/contexts/LoadingIndicatorProvider/useLoadingIndicator'\nimport { useObservability } from '@/contexts/ObservabilityProvider/useObservability'\nimport { normalizeToSDKError, type SDKError } from '@/types/sdkError'\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\nexport interface BaseComponentInterface<\n TResourceKey extends keyof Resources = keyof Resources,\n> extends CommonComponentInterface<TResourceKey> {\n FallbackComponent?: BaseBoundariesProps['FallbackComponent']\n LoaderComponent?: LoadingIndicatorContextProps['LoadingIndicator']\n onEvent: OnEventType<EventType, unknown>\n}\n\ninterface InternalBaseComponentProps {\n componentName?: string\n}\n\nexport const BaseComponent = <TResourceKey extends keyof Resources = keyof Resources>({\n children,\n FallbackComponent = InternalError,\n LoaderComponent: LoadingIndicatorFromProps,\n onEvent,\n componentName,\n}: BaseComponentInterface<TResourceKey> & InternalBaseComponentProps) => {\n const { error, baseSubmitHandler, setError } = useBaseSubmit(componentName)\n const { observability } = useObservability()\n\n const { LoadingIndicator: LoadingIndicatorFromContext } = useLoadingIndicator()\n const LoaderComponent = LoadingIndicatorFromProps ?? LoadingIndicatorFromContext\n\n const onErrorBoundaryError = (boundaryError: unknown, errorInfo: ErrorInfo) => {\n onEvent(componentEvents.ERROR, boundaryError)\n\n const sdkError = normalizeToSDKError(boundaryError)\n\n observability?.onError?.({\n ...sdkError,\n timestamp: Date.now(),\n componentName,\n componentStack: errorInfo.componentStack ?? undefined,\n })\n }\n\n return (\n <BaseContext.Provider\n value={{\n error,\n setError,\n onEvent,\n baseSubmitHandler,\n LoadingIndicator: LoaderComponent,\n componentName,\n }}\n >\n <BaseBoundaries\n FallbackComponent={FallbackComponent}\n onErrorBoundaryError={onErrorBoundaryError}\n componentName={componentName}\n >\n <BaseLayout error={error}>{children}</BaseLayout>\n </BaseBoundaries>\n </BaseContext.Provider>\n )\n}\n\nexport interface BaseLayoutProps {\n children?: ReactNode\n error?: SDKError | SDKError[] | null\n isLoading?: boolean\n}\n\nfunction SingleErrorContent({ error }: { error: SDKError }) {\n const Components = useComponentContext()\n const { t } = useTranslation()\n const hasFieldErrors = error.fieldErrors.length > 0\n\n return (\n <Components.Alert label={t('status.errorEncountered')} status=\"error\">\n {hasFieldErrors && (\n <Components.UnorderedList\n items={error.fieldErrors\n .filter(fieldError => fieldError.message)\n .map(fieldError => (\n <span key={fieldError.field}>{fieldError.message}</span>\n ))}\n />\n )}\n {!hasFieldErrors && error.category === 'validation_error' && (\n <Components.Text as=\"pre\">\n {error.raw &&\n typeof error.raw === 'object' &&\n 'pretty' in error.raw &&\n typeof (error.raw as { pretty: unknown }).pretty === 'function'\n ? (error.raw as { pretty: () => string }).pretty()\n : error.message}\n </Components.Text>\n )}\n {!hasFieldErrors && error.category !== 'validation_error' && (\n <Components.Text>{error.message || t('errors.unknownError')}</Components.Text>\n )}\n </Components.Alert>\n )\n}\n\nfunction MultipleErrorsContent({ errors }: { errors: SDKError[] }) {\n const Components = useComponentContext()\n const { t } = useTranslation()\n\n return (\n <Components.Alert label={t('status.multipleErrorsEncountered')} status=\"error\">\n <Components.UnorderedList\n items={errors\n .filter(error => error.message || error.fieldErrors.length > 0)\n .map((error, index) => {\n const visibleFieldErrors = error.fieldErrors.filter(fieldError => fieldError.message)\n\n if (visibleFieldErrors.length === 0) {\n return <span key={index}>{error.message || t('errors.unknownError')}</span>\n }\n\n return (\n <span key={index}>\n {error.message || t('errors.unknownError')}\n <Components.UnorderedList\n items={visibleFieldErrors.map(fieldError => (\n <span key={fieldError.field}>{fieldError.message}</span>\n ))}\n />\n </span>\n )\n })}\n />\n </Components.Alert>\n )\n}\n\nexport const BaseLayout = ({ children, error, isLoading }: BaseLayoutProps) => {\n const { LoadingIndicator } = useLoadingIndicator()\n\n const errors = Array.isArray(error) ? error : error ? [error] : []\n const hasErrors = errors.length > 0\n\n if (isLoading && !hasErrors) {\n return <LoadingIndicator />\n }\n\n const [firstError] = errors\n\n return (\n <FadeIn>\n {errors.length > 1 && <MultipleErrorsContent errors={errors} />}\n {errors.length === 1 && firstError && <SingleErrorContent error={firstError} />}\n {children}\n </FadeIn>\n )\n}\n\ninterface LoaderWithMetricsProps {\n LoaderComponent: LoadingIndicatorContextProps['LoadingIndicator']\n observability: ReturnType<typeof useObservability>['observability']\n componentName?: string\n}\n\nconst LoaderWithMetrics = ({\n LoaderComponent,\n observability,\n componentName,\n}: LoaderWithMetricsProps) => {\n const loadingStartTime = useRef(Date.now())\n const observabilityRef = useRef(observability)\n const componentNameRef = useRef(componentName)\n\n useEffect(() => {\n observabilityRef.current = observability\n componentNameRef.current = componentName\n }, [observability, componentName])\n\n useEffect(() => {\n return () => {\n const duration = Date.now() - loadingStartTime.current\n observabilityRef.current?.onMetric?.({\n name: 'sdk.component.loading_duration',\n value: duration,\n unit: 'ms',\n tags: componentNameRef.current ? { component: componentNameRef.current } : undefined,\n timestamp: Date.now(),\n })\n }\n }, [])\n\n return <LoaderComponent />\n}\n\nfunction SuspenseFallback({ componentName }: { componentName?: string }) {\n const { LoadingIndicator } = useLoadingIndicator()\n const { observability } = useObservability()\n return (\n <LoaderWithMetrics\n LoaderComponent={LoadingIndicator}\n observability={observability}\n componentName={componentName}\n />\n )\n}\n\nexport interface BaseBoundariesProps {\n children?: ReactNode\n FallbackComponent?: (props: FallbackProps) => JSX.Element\n onErrorBoundaryError?: (error: unknown, info: ErrorInfo) => void\n componentName?: string\n}\n\nexport const BaseBoundaries = ({\n children,\n FallbackComponent = InternalError,\n onErrorBoundaryError,\n componentName,\n}: BaseBoundariesProps) => {\n return (\n <QueryErrorResetBoundary>\n {({ reset: resetQueries }) => (\n <ErrorBoundary\n FallbackComponent={FallbackComponent}\n onReset={resetQueries}\n onError={onErrorBoundaryError}\n >\n <Suspense fallback={<SuspenseFallback componentName={componentName} />}>\n {children}\n </Suspense>\n </ErrorBoundary>\n )}\n </QueryErrorResetBoundary>\n )\n}\n"],"names":["BaseComponent","children","FallbackComponent","InternalError","LoadingIndicatorFromProps","onEvent","componentName","error","baseSubmitHandler","setError","useBaseSubmit","observability","useObservability","LoadingIndicatorFromContext","useLoadingIndicator","LoaderComponent","onErrorBoundaryError","boundaryError","errorInfo","componentEvents","sdkError","normalizeToSDKError","jsx","BaseContext","BaseBoundaries","BaseLayout","SingleErrorContent","Components","useComponentContext","t","useTranslation","hasFieldErrors","jsxs","fieldError","MultipleErrorsContent","errors","index","visibleFieldErrors","isLoading","LoadingIndicator","hasErrors","firstError","FadeIn","LoaderWithMetrics","loadingStartTime","useRef","observabilityRef","componentNameRef","useEffect","duration","SuspenseFallback","QueryErrorResetBoundary","resetQueries","ErrorBoundary","Suspense"],"mappings":"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"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "./types/i18next.d.ts"
|
|
2
|
-
export { BaseComponent, BaseBoundaries, type BaseComponentInterface, type CommonComponentInterface, } from './Base';
|
|
2
|
+
export { BaseComponent, BaseBoundaries, BaseLayout, type BaseComponentInterface, type BaseLayoutProps, type BaseBoundariesProps, type CommonComponentInterface, } from './Base';
|
|
3
3
|
export { createCompoundContext } from './createCompoundContext';
|
|
4
4
|
export { useBase } from './useBase';
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
import { GustoEmbeddedError } from '@gusto/embedded-api/models/errors/gustoembeddederror';
|
|
2
|
-
import { SDKValidationError } from '@gusto/embedded-api/models/errors/sdkvalidationerror';
|
|
3
|
-
import { EntityErrorObject } from '@gusto/embedded-api/models/components/entityerrorobject';
|
|
4
1
|
import { EventType } from '../../shared/constants';
|
|
5
2
|
import { LoadingIndicatorContextProps } from '../../contexts/LoadingIndicatorProvider/useLoadingIndicator';
|
|
3
|
+
import { SDKError } from '../../types/sdkError';
|
|
6
4
|
export type OnEventType<K, T> = (type: K, data?: T) => void;
|
|
7
|
-
export type KnownErrors = GustoEmbeddedError | SDKValidationError;
|
|
8
5
|
interface BaseContextProps {
|
|
9
|
-
error:
|
|
10
|
-
|
|
11
|
-
setError: (err: KnownErrors | null) => void;
|
|
6
|
+
error: SDKError | null;
|
|
7
|
+
setError: (err: SDKError | null) => void;
|
|
12
8
|
onEvent: OnEventType<EventType, unknown>;
|
|
13
9
|
baseSubmitHandler: <T>(formData: T, componentHandler: (payload: T) => Promise<void>) => Promise<void>;
|
|
14
10
|
LoadingIndicator: LoadingIndicatorContextProps['LoadingIndicator'];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useBase.js","sources":["../../../src/components/Base/useBase.tsx"],"sourcesContent":["import { createContext, useContext } from 'react'\nimport
|
|
1
|
+
{"version":3,"file":"useBase.js","sources":["../../../src/components/Base/useBase.tsx"],"sourcesContent":["import { createContext, useContext } from 'react'\nimport { type EventType } from '@/shared/constants'\nimport type { LoadingIndicatorContextProps } from '@/contexts/LoadingIndicatorProvider/useLoadingIndicator'\nimport type { SDKError } from '@/types/sdkError'\n\nexport type OnEventType<K, T> = (type: K, data?: T) => void\n\ninterface BaseContextProps {\n error: SDKError | null\n setError: (err: SDKError | null) => void\n onEvent: OnEventType<EventType, unknown>\n baseSubmitHandler: <T>(\n formData: T,\n componentHandler: (payload: T) => Promise<void>,\n ) => Promise<void>\n LoadingIndicator: LoadingIndicatorContextProps['LoadingIndicator']\n componentName?: string\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":";AAmBO,MAAMA,IAAcC,EAA4C,MAAS,GAEnEC,IAAU,MAAM;AAC3B,QAAMC,IAAUC,EAAWJ,CAAW;AACtC,MAAI,CAACG;AACH,UAAM,IAAI,MAAM,4CAA4C;AAE9D,SAAOA;AACT;"}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { KnownErrors } from './useBase';
|
|
1
|
+
import { SDKError } from '../../types/sdkError';
|
|
3
2
|
type SubmitHandler<T> = (data: T) => Promise<void>;
|
|
4
3
|
export declare const useBaseSubmit: (componentName?: string) => {
|
|
5
4
|
baseSubmitHandler: <T>(data: T, componentHandler: SubmitHandler<T>) => Promise<void>;
|
|
6
|
-
error:
|
|
7
|
-
|
|
8
|
-
setError: (error: KnownErrors | null) => void;
|
|
5
|
+
error: SDKError | null;
|
|
6
|
+
setError: import('react').Dispatch<import('react').SetStateAction<SDKError | null>>;
|
|
9
7
|
};
|
|
10
8
|
export {};
|