@gusto/embedded-react-sdk 0.26.0 → 0.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +70 -0
- package/dist/assets/icons/plus-circle.svg.js +5 -5
- package/dist/assets/icons/plus-circle.svg.js.map +1 -1
- package/dist/components/Base/Base.js +13 -12
- package/dist/components/Base/Base.js.map +1 -1
- package/dist/components/Common/DocumentList/DocumentList.js +23 -23
- package/dist/components/Common/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Common/DocumentList/DocumentList.module.scss.js +6 -10
- package/dist/components/Common/DocumentList/DocumentList.module.scss.js.map +1 -1
- package/dist/components/Common/DocumentViewer/DocumentViewer.module.scss.js +12 -12
- package/dist/components/Common/InlineSpinner/InlineSpinner.module.scss.js +1 -1
- package/dist/components/Common/InternalError/InternalError.module.scss.js +4 -4
- package/dist/components/Common/ReorderableList/ReorderableList.module.scss.js +8 -8
- package/dist/components/Common/RequirementsList/RequirementsList.module.scss.js +1 -1
- package/dist/components/Common/SignatureForm/SignatureForm.js +12 -10
- package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormActions.js +3 -2
- package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormFields.js +7 -6
- package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
- package/dist/components/Common/UI/Alert/Alert.module.scss.js +9 -9
- package/dist/components/Common/UI/Banner/Banner.module.scss.js +1 -1
- package/dist/components/Common/UI/Button/Button.module.scss.js +1 -1
- package/dist/components/Common/UI/CalendarPreview/CalendarPreview.module.scss.js +4 -4
- package/dist/components/Common/UI/Card/Card.module.scss.js +1 -1
- package/dist/components/Common/UI/Checkbox/Checkbox.module.scss.js +1 -1
- package/dist/components/Common/UI/ComboBox/ComboBox.module.scss.js +3 -3
- package/dist/components/Common/UI/DatePicker/DatePicker.module.scss.js +4 -4
- package/dist/components/Common/UI/DescriptionList/DescriptionList.module.scss.js +1 -1
- package/dist/components/Common/UI/Dialog/Dialog.module.scss.js +2 -2
- package/dist/components/Common/UI/FileInput/FileInput.module.scss.js +26 -26
- package/dist/components/Common/UI/Input/Input.module.scss.js +8 -8
- package/dist/components/Common/UI/Modal/Modal.module.scss.js +12 -12
- package/dist/components/Common/UI/Radio/Radio.module.scss.js +6 -6
- package/dist/components/Common/UI/Select/Select.module.scss.js +4 -4
- package/dist/components/Common/UI/Table/Table.js +1 -1
- package/dist/components/Common/UI/Table/Table.js.map +1 -1
- package/dist/components/Common/UI/Table/Table.module.scss.js +1 -1
- package/dist/components/Common/UI/Tabs/Tabs.module.scss.js +1 -1
- package/dist/components/Common/UI/Text/Text.module.scss.js +17 -15
- package/dist/components/Common/UI/Text/Text.module.scss.js.map +1 -1
- package/dist/components/Common/UI/TextArea/TextArea.module.scss.js +4 -4
- package/dist/components/Company/AssignSignatory/AssignSignatory.js +3 -2
- package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +4 -3
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +3 -2
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +12 -12
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +4 -3
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +3 -2
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +4 -3
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/TitleSelect.js +4 -3
- package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +6 -5
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +9 -8
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js +7 -5
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +4 -3
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js +3 -2
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +7 -6
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +7 -5
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +3 -2
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +9 -8
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +4 -3
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +4 -3
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +4 -3
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Actions.js +7 -6
- package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Company/FederalTaxes/FederalTaxes.js +4 -3
- package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Form.js +5 -3
- package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +6 -5
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Actions.js +8 -7
- package/dist/components/Company/Industry/Actions.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +7 -6
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Industry/Edit.js +3 -2
- package/dist/components/Company/Industry/Edit.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Actions.js +7 -6
- package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Form.js +1 -1
- package/dist/components/Company/Locations/LocationForm/LocationForm.js +4 -3
- package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +4 -3
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/Actions.js +3 -2
- package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/List.js +7 -6
- package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +8 -7
- package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +4 -3
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/Completed.js +12 -10
- package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js +8 -6
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +8 -7
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +4 -3
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/PaySchedule.js +4 -3
- package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Actions.js +3 -2
- 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 +13 -11
- package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/List.js +15 -13
- package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
- package/dist/components/Company/PaySchedule/usePaySchedule.js +6 -5
- package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +3 -2
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +4 -3
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +3 -2
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js +3 -2
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +4 -3
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Contractor/Address/Address.js +5 -4
- package/dist/components/Contractor/Address/Address.js.map +1 -1
- package/dist/components/Contractor/Address/Form.js +1 -1
- package/dist/components/Contractor/Address/useAddress.js +6 -5
- package/dist/components/Contractor/Address/useAddress.js.map +1 -1
- package/dist/components/Contractor/ContractorList/index.js +32 -31
- package/dist/components/Contractor/ContractorList/index.js.map +1 -1
- package/dist/components/Contractor/NewHireReport/NewHireReport.js +14 -13
- package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +12 -11
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +3 -2
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +4 -3
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +4 -2
- 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 +9 -7
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +9 -8
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js +11 -9
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js +8 -6
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.module.scss.js +14 -14
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js +4 -2
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +4 -2
- 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/ContractorProfileForm.module.scss.js +1 -1
- package/dist/components/Contractor/Profile/useContractorProfile.js +3 -2
- package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
- package/dist/components/Contractor/Submit/Submit.js +21 -20
- package/dist/components/Contractor/Submit/Submit.js.map +1 -1
- package/dist/components/Employee/Compensation/Actions.js +13 -12
- package/dist/components/Employee/Compensation/Actions.js.map +1 -1
- package/dist/components/Employee/Compensation/Edit.js +17 -16
- package/dist/components/Employee/Compensation/Edit.js.map +1 -1
- package/dist/components/Employee/Compensation/List.js +23 -22
- package/dist/components/Employee/Compensation/List.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.d.ts +3 -1
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +145 -137
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.d.ts +2 -1
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +106 -101
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js +90 -87
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.d.ts +2 -1
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +110 -104
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +51 -45
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js.map +1 -1
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js +31 -30
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js.map +1 -1
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.module.scss.js +4 -8
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.module.scss.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +3 -2
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +3 -2
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js +4 -2
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +4 -3
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +3 -2
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +4 -3
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Employee/EmployeeList/Actions.js +7 -6
- package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
- package/dist/components/Employee/EmployeeList/EmployeeList.js +4 -3
- package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
- package/dist/components/Employee/EmployeeList/Head.js +7 -5
- package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
- package/dist/components/Employee/EmployeeList/List.js +3 -2
- package/dist/components/Employee/EmployeeList/List.js.map +1 -1
- package/dist/components/Employee/EmployeeList/useEmployeeList.js +4 -3
- package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/Actions.js +6 -5
- package/dist/components/Employee/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/FederalForm.js +12 -11
- package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +4 -3
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Employee/Landing/Landing.js +11 -10
- package/dist/components/Employee/Landing/Landing.js.map +1 -1
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +7 -7
- package/dist/components/Employee/PaymentMethod/Actions.js +6 -5
- package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +5 -4
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js +3 -2
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +7 -6
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/Split.js +11 -10
- package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +6 -5
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
- package/dist/components/Employee/Profile/Actions.js +6 -5
- package/dist/components/Employee/Profile/Actions.js.map +1 -1
- package/dist/components/Employee/Profile/AdminPersonalDetails.js +6 -5
- package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
- package/dist/components/Employee/Profile/AdminPersonalDetails.module.scss.js +1 -1
- package/dist/components/Employee/Profile/HomeAddress.js +1 -1
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js +2 -2
- package/dist/components/Employee/Profile/useProfile.js +4 -3
- package/dist/components/Employee/Profile/useProfile.js.map +1 -1
- package/dist/components/Employee/StateTaxes/Actions.js +6 -5
- package/dist/components/Employee/StateTaxes/Actions.js.map +1 -1
- package/dist/components/Employee/StateTaxes/useStateTaxes.js +4 -3
- package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
- package/dist/components/Employee/Taxes/Actions.js +7 -6
- package/dist/components/Employee/Taxes/Actions.js.map +1 -1
- package/dist/components/Employee/Taxes/FederalForm.js +14 -13
- package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/Taxes/useTaxes.js +4 -3
- package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
- package/dist/components/Flow/Flow.js +9 -7
- package/dist/components/Flow/Flow.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js +17 -16
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.module.scss.js +4 -4
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js +38 -36
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequests.d.ts +7 -2
- package/dist/components/InformationRequests/InformationRequests.js +78 -45
- package/dist/components/InformationRequests/InformationRequests.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +10 -9
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.module.scss.js +10 -10
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelection.d.ts +2 -0
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelection.js +33 -0
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelection.js.map +1 -0
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.d.ts +7 -0
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js +39 -0
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js.map +1 -0
- package/dist/components/Payroll/OffCycleReasonSelection/index.d.ts +5 -0
- package/dist/components/Payroll/OffCycleReasonSelection/types.d.ts +15 -0
- package/dist/components/Payroll/OffCycleReasonSelection/types.js +14 -0
- package/dist/components/Payroll/OffCycleReasonSelection/types.js.map +1 -0
- package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateForm.d.ts +2 -0
- package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateForm.js +35 -0
- package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateForm.js.map +1 -0
- package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateFormPresentation.d.ts +2 -0
- package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateFormPresentation.js +65 -0
- package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateFormPresentation.js.map +1 -0
- package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateFormPresentation.module.scss.js +18 -0
- package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateFormPresentation.module.scss.js.map +1 -0
- package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateFormTypes.d.ts +53 -0
- package/dist/components/Payroll/PayPeriodDateForm/index.d.ts +3 -0
- package/dist/components/Payroll/PayPeriodDateForm/usePayPeriodDateValidation.d.ts +5 -0
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +4 -2
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +19 -18
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +36 -36
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.module.scss.js +5 -5
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +21 -19
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +17 -15
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +26 -24
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +30 -29
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js +4 -2
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js.map +1 -1
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +3 -2
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.module.scss.js +18 -18
- package/dist/components/Payroll/RecoveryCases/RecoveryCases.d.ts +4 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCases.js +34 -28
- package/dist/components/Payroll/RecoveryCases/RecoveryCases.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js +29 -29
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js +12 -11
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js +4 -2
- package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js.map +1 -1
- package/dist/components/Payroll/index.d.ts +4 -0
- package/dist/components/Payroll/index.js +12 -8
- package/dist/components/Payroll/index.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.js +3 -2
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +3 -2
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/contexts/ThemeProvider/theme.d.ts +8 -3
- package/dist/contexts/ThemeProvider/theme.js +29 -24
- package/dist/contexts/ThemeProvider/theme.js.map +1 -1
- package/dist/helpers/dateFormatting.d.ts +3 -0
- package/dist/helpers/dateFormatting.js.map +1 -1
- package/dist/i18n/I18n.js +1 -1
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Employee.Deductions.json.js +157 -161
- package/dist/i18n/en/Employee.Deductions.json.js.map +1 -1
- package/dist/i18n/en/InformationRequests.InformationRequestList.json.js +12 -10
- package/dist/i18n/en/InformationRequests.InformationRequestList.json.js.map +1 -1
- package/dist/i18n/en/InformationRequests.json.js +8 -0
- package/dist/i18n/en/InformationRequests.json.js.map +1 -0
- package/dist/i18n/en/Payroll.OffCycleReasonSelection.json.js +12 -0
- package/dist/i18n/en/Payroll.OffCycleReasonSelection.json.js.map +1 -0
- package/dist/i18n/en/Payroll.PayPeriodDateForm.json.js +32 -0
- package/dist/i18n/en/Payroll.PayPeriodDateForm.json.js.map +1 -0
- package/dist/shared/constants.d.ts +4 -0
- package/dist/shared/constants.js +10 -8
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +51 -3
- package/package.json +11 -11
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.module.scss.js +0 -8
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.module.scss.js.map +0 -1
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.module.scss.js +0 -14
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.module.scss.js.map +0 -1
package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js
CHANGED
|
@@ -12,14 +12,15 @@ import r from "./InformationRequestForm.module.scss.js";
|
|
|
12
12
|
import { BaseComponent as G } from "../../Base/Base.js";
|
|
13
13
|
import { useBase as $ } from "../../Base/useBase.js";
|
|
14
14
|
import { Flex as y } from "../../Common/Flex/Flex.js";
|
|
15
|
-
import
|
|
15
|
+
import "classnames";
|
|
16
|
+
import { informationRequestEvents as C } from "../../../shared/constants.js";
|
|
17
|
+
import { TextInputField as J } from "../../Common/Fields/TextInputField/TextInputField.js";
|
|
18
|
+
import { useComponentContext as w } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
16
19
|
import "react";
|
|
17
|
-
import { FileInputField as
|
|
18
|
-
import { Form as
|
|
19
|
-
import { useComponentDictionary as
|
|
20
|
-
import {
|
|
21
|
-
import { useFlow as ee } from "../../Flow/useFlow.js";
|
|
22
|
-
import { TextInputField as ne } from "../../Common/Fields/TextInputField/TextInputField.js";
|
|
20
|
+
import { FileInputField as X } from "../../Common/Fields/FileInputField/FileInputField.js";
|
|
21
|
+
import { Form as Z } from "../../Common/Form/Form.js";
|
|
22
|
+
import { useComponentDictionary as ee, useI18n as M } from "../../../i18n/I18n.js";
|
|
23
|
+
import { useFlow as ne } from "../../Flow/useFlow.js";
|
|
23
24
|
const _ = "gusto-sdk-information-request-form", te = ["image/jpeg", "image/png", "application/pdf"], oe = f.record(
|
|
24
25
|
f.string(),
|
|
25
26
|
f.union([f.string().min(1), f.instanceof(File)])
|
|
@@ -42,8 +43,8 @@ function ae(o) {
|
|
|
42
43
|
return o.some((s) => s.responseType === u.Persona);
|
|
43
44
|
}
|
|
44
45
|
function ue({ companyId: o, requestId: s, dictionary: i }) {
|
|
45
|
-
|
|
46
|
-
const { t: n } = D("InformationRequests.InformationRequestForm"), { Alert: q, Heading: T, Text: c } =
|
|
46
|
+
ee("InformationRequests.InformationRequestForm", i), M("InformationRequests.InformationRequestForm");
|
|
47
|
+
const { t: n } = D("InformationRequests.InformationRequestForm"), { Alert: q, Heading: T, Text: c } = w(), { onEvent: I, baseSubmitHandler: g } = $(), { data: N } = P({
|
|
47
48
|
companyUuid: o
|
|
48
49
|
}), l = N.informationRequestList?.find((t) => t.uuid === s), a = l?.requiredQuestions ?? [], F = l?.blockingPayroll ?? !1, O = A(a), b = ae(a), { mutateAsync: Q } = W(), v = {}, U = [];
|
|
49
50
|
a.forEach((t) => {
|
|
@@ -82,7 +83,7 @@ function ue({ companyId: o, requestId: s, dictionary: i }) {
|
|
|
82
83
|
}
|
|
83
84
|
}
|
|
84
85
|
});
|
|
85
|
-
I(
|
|
86
|
+
I(C.INFORMATION_REQUEST_FORM_DONE, x.informationRequest);
|
|
86
87
|
});
|
|
87
88
|
}, L = (t) => {
|
|
88
89
|
if (!t.questionUuid || !t.responseType) return null;
|
|
@@ -94,7 +95,7 @@ function ue({ companyId: o, requestId: s, dictionary: i }) {
|
|
|
94
95
|
] }),
|
|
95
96
|
/* @__PURE__ */ e("hr", { className: r.divider }),
|
|
96
97
|
x && /* @__PURE__ */ e("div", { className: r.textInputWrapper, children: /* @__PURE__ */ e(
|
|
97
|
-
|
|
98
|
+
J,
|
|
98
99
|
{
|
|
99
100
|
name: R,
|
|
100
101
|
label: n("fields.textAnswer.label"),
|
|
@@ -104,7 +105,7 @@ function ue({ companyId: o, requestId: s, dictionary: i }) {
|
|
|
104
105
|
}
|
|
105
106
|
) }),
|
|
106
107
|
h && /* @__PURE__ */ e("div", { className: r.fileInputWrapper, children: /* @__PURE__ */ e(
|
|
107
|
-
|
|
108
|
+
X,
|
|
108
109
|
{
|
|
109
110
|
name: R,
|
|
110
111
|
label: n("fields.fileUpload.label"),
|
|
@@ -127,19 +128,19 @@ function ue({ companyId: o, requestId: s, dictionary: i }) {
|
|
|
127
128
|
return /* @__PURE__ */ e("div", { className: r.root, children: /* @__PURE__ */ m(y, { flexDirection: "column", gap: 16, children: [
|
|
128
129
|
/* @__PURE__ */ e(T, { as: "h2", children: n("title") }),
|
|
129
130
|
F && /* @__PURE__ */ e(q, { status: "error", label: n("blockingAlert.title"), disableScrollIntoView: !0, children: n("blockingAlert.description") }),
|
|
130
|
-
O ? j : /* @__PURE__ */ e(H, { ...E, children: /* @__PURE__ */ e(
|
|
131
|
+
O ? j : /* @__PURE__ */ e(H, { ...E, children: /* @__PURE__ */ e(Z, { id: _, onSubmit: E.handleSubmit(k), children: /* @__PURE__ */ e(y, { flexDirection: "column", gap: 16, children: a.map(L) }) }) })
|
|
131
132
|
] }) });
|
|
132
133
|
}
|
|
133
134
|
const ce = ({ onEvent: o }) => {
|
|
134
|
-
|
|
135
|
-
const { t: s } = D("InformationRequests.InformationRequestForm"), { Button: i } =
|
|
135
|
+
M("InformationRequests.InformationRequestForm");
|
|
136
|
+
const { t: s } = D("InformationRequests.InformationRequestForm"), { Button: i } = w(), { companyId: n, selectedRequestId: q } = ne(), { data: T } = P({
|
|
136
137
|
companyUuid: n
|
|
137
138
|
}), I = T.informationRequestList?.find(
|
|
138
139
|
(F) => F.uuid === q
|
|
139
140
|
)?.requiredQuestions ?? [], g = A(I), l = V({
|
|
140
141
|
mutationKey: Y()
|
|
141
142
|
}) > 0, a = () => {
|
|
142
|
-
o(
|
|
143
|
+
o(C.INFORMATION_REQUEST_FORM_CANCEL);
|
|
143
144
|
};
|
|
144
145
|
return g ? /* @__PURE__ */ e(y, { justifyContent: "flex-end", gap: 12, children: /* @__PURE__ */ e(i, { variant: "secondary", onClick: a, children: s("cta.close") }) }) : /* @__PURE__ */ m(y, { justifyContent: "flex-end", gap: 12, children: [
|
|
145
146
|
/* @__PURE__ */ e(i, { variant: "secondary", onClick: a, isDisabled: l, children: s("cta.cancel") }),
|
package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InformationRequestForm.js","sources":["../../../../src/components/InformationRequests/InformationRequestForm/InformationRequestForm.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { z } from 'zod'\nimport { useIsMutating } from '@tanstack/react-query'\nimport { useInformationRequestsGetInformationRequestsSuspense } from '@gusto/embedded-api/react-query/informationRequestsGetInformationRequests'\nimport {\n useInformationRequestsSubmitMutation,\n mutationKeyInformationRequestsSubmit,\n} from '@gusto/embedded-api/react-query/informationRequestsSubmit'\nimport type { RequiredQuestions } from '@gusto/embedded-api/models/components/informationrequest'\nimport { ResponseType } from '@gusto/embedded-api/models/components/informationrequest'\nimport { ResponseType as SubmitResponseType } from '@gusto/embedded-api/models/operations/submitinformationrequest'\nimport type { InformationRequestsContextInterface } from '../InformationRequestsComponents'\nimport styles from './InformationRequestForm.module.scss'\nimport { BaseComponent, useBase, type BaseComponentInterface } from '@/components/Base'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport { Flex, TextInputField } from '@/components/Common'\nimport { FileInputField } from '@/components/Common/Fields/FileInputField'\nimport { Form } from '@/components/Common/Form'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { informationRequestEvents, type EventType } from '@/shared/constants'\nimport { useFlow } from '@/components/Flow/useFlow'\n\nconst INFORMATION_REQUEST_FORM_ID = 'gusto-sdk-information-request-form'\nconst ACCEPTED_FILE_TYPES = ['image/jpeg', 'image/png', 'application/pdf']\n\nconst InformationRequestFormSchema = z.record(\n z.string(),\n z.union([z.string().min(1), z.instanceof(File)]),\n)\n\ntype InformationRequestFormValues = z.infer<typeof InformationRequestFormSchema>\n\ninterface InformationRequestFormProps extends BaseComponentInterface<'InformationRequests.InformationRequestForm'> {\n companyId: string\n requestId: string\n onEvent: OnEventType<EventType, unknown>\n}\n\nexport function InformationRequestForm(props: InformationRequestFormProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nconst convertFileToDataUrl = (file: File) => {\n return new Promise<string>((resolve, reject) => {\n const reader = new FileReader()\n reader.onload = () => {\n resolve(reader.result as string)\n }\n reader.onerror = reject\n reader.readAsDataURL(file)\n })\n}\n\nconst SUPPORTED_RESPONSE_TYPES: ResponseType[] = [ResponseType.Text, ResponseType.Document]\n\nfunction hasUnsupportedQuestionTypes(questions: RequiredQuestions[]) {\n return questions.some(\n question => question.responseType && !SUPPORTED_RESPONSE_TYPES.includes(question.responseType),\n )\n}\n\nfunction hasPersonaQuestionType(questions: RequiredQuestions[]) {\n return questions.some(question => question.responseType === ResponseType.Persona)\n}\n\nfunction Root({ companyId, requestId, dictionary }: InformationRequestFormProps) {\n useComponentDictionary('InformationRequests.InformationRequestForm', dictionary)\n useI18n('InformationRequests.InformationRequestForm')\n const { t } = useTranslation('InformationRequests.InformationRequestForm')\n const { Alert, Heading, Text } = useComponentContext()\n const { onEvent, baseSubmitHandler } = useBase()\n\n const { data } = useInformationRequestsGetInformationRequestsSuspense({\n companyUuid: companyId,\n })\n\n const informationRequest = data.informationRequestList?.find(req => req.uuid === requestId)\n const requiredQuestions = informationRequest?.requiredQuestions ?? []\n const isBlockingPayroll = informationRequest?.blockingPayroll ?? false\n const hasUnsupportedTypes = hasUnsupportedQuestionTypes(requiredQuestions)\n const hasPersonaType = hasPersonaQuestionType(requiredQuestions)\n\n const { mutateAsync: submitInformationRequest } = useInformationRequestsSubmitMutation()\n\n const defaultValues: Record<string, string | File | undefined> = {}\n const questionUuids: string[] = []\n\n requiredQuestions.forEach(question => {\n if (!question.questionUuid || !question.responseType) return\n\n if (question.responseType === ResponseType.Text) {\n questionUuids.push(question.questionUuid)\n defaultValues[question.questionUuid] = ''\n } else if (question.responseType === ResponseType.Document) {\n questionUuids.push(question.questionUuid)\n defaultValues[question.questionUuid] = undefined\n }\n })\n\n const formMethods = useForm<InformationRequestFormValues>({\n resolver: zodResolver(InformationRequestFormSchema),\n defaultValues,\n })\n\n const onSubmit = async (formData: InformationRequestFormValues) => {\n await baseSubmitHandler(formData, async () => {\n const questionResponses = await Promise.all(\n questionUuids.map(async uuid => {\n const value = formData[uuid]\n\n if (typeof value === 'string') {\n return {\n questionUuid: uuid,\n responseType: SubmitResponseType.Text,\n textResponse: value,\n }\n }\n\n if (value instanceof File) {\n const fileResponse = await convertFileToDataUrl(value)\n return {\n questionUuid: uuid,\n responseType: SubmitResponseType.Document,\n fileResponse,\n fileName: value.name,\n }\n }\n\n return null\n }),\n )\n\n const validResponses = questionResponses.filter(response => response !== null)\n\n const response = await submitInformationRequest({\n request: {\n informationRequestUuid: requestId,\n requestBody: {\n requiredQuestions: validResponses,\n },\n },\n })\n\n onEvent(informationRequestEvents.INFORMATION_REQUEST_FORM_DONE, response.informationRequest)\n })\n }\n\n const renderQuestion = (question: RequiredQuestions) => {\n if (!question.questionUuid || !question.responseType) return null\n\n const fieldName = question.questionUuid\n const isDocumentType = question.responseType === ResponseType.Document\n const isTextType = question.responseType === ResponseType.Text\n\n return (\n <div key={fieldName} className={styles.questionCard}>\n <div className={styles.questionDescription}>\n <Text weight=\"medium\">\n {isDocumentType ? t('questionTypes.document') : t('questionTypes.answer')}\n </Text>\n <Text>{question.questionText}</Text>\n </div>\n\n <hr className={styles.divider} />\n\n {isTextType && (\n <div className={styles.textInputWrapper}>\n <TextInputField\n name={fieldName}\n label={t('fields.textAnswer.label')}\n placeholder={t('fields.textAnswer.placeholder')}\n isRequired\n errorMessage={t('validation.required')}\n />\n </div>\n )}\n\n {isDocumentType && (\n <div className={styles.fileInputWrapper}>\n <FileInputField\n name={fieldName}\n label={t('fields.fileUpload.label')}\n accept={ACCEPTED_FILE_TYPES}\n isRequired\n errorMessage={t('validation.required')}\n />\n </div>\n )}\n </div>\n )\n }\n\n const unsupportedPlaceholder = (\n <div className={styles.questionCard}>\n <div className={styles.questionDescription}>\n <Text weight=\"medium\">\n {t(hasPersonaType ? 'unsupported.persona.title' : 'unsupported.generic.title')}\n </Text>\n <Text>\n {t(\n hasPersonaType ? 'unsupported.persona.description' : 'unsupported.generic.description',\n )}\n </Text>\n </div>\n\n <hr className={styles.divider} />\n\n <div className={styles.contactSupport}>\n <Text variant=\"supporting\">{t('unsupported.contactSupport')}</Text>\n </div>\n </div>\n )\n\n return (\n <div className={styles.root}>\n <Flex flexDirection=\"column\" gap={16}>\n <Heading as=\"h2\">{t('title')}</Heading>\n\n {isBlockingPayroll && (\n <Alert status=\"error\" label={t('blockingAlert.title')} disableScrollIntoView>\n {t('blockingAlert.description')}\n </Alert>\n )}\n\n {hasUnsupportedTypes ? (\n unsupportedPlaceholder\n ) : (\n <FormProvider {...formMethods}>\n <Form id={INFORMATION_REQUEST_FORM_ID} onSubmit={formMethods.handleSubmit(onSubmit)}>\n <Flex flexDirection=\"column\" gap={16}>\n {requiredQuestions.map(renderQuestion)}\n </Flex>\n </Form>\n </FormProvider>\n )}\n </Flex>\n </div>\n )\n}\n\nconst Footer = ({ onEvent }: { onEvent: OnEventType<EventType, unknown> }) => {\n useI18n('InformationRequests.InformationRequestForm')\n const { t } = useTranslation('InformationRequests.InformationRequestForm')\n const { Button } = useComponentContext()\n const { companyId, selectedRequestId } = useFlow<InformationRequestsContextInterface>()\n\n const { data } = useInformationRequestsGetInformationRequestsSuspense({\n companyUuid: companyId,\n })\n\n const informationRequest = data.informationRequestList?.find(\n req => req.uuid === selectedRequestId,\n )\n const requiredQuestions = informationRequest?.requiredQuestions ?? []\n const hasUnsupportedTypes = hasUnsupportedQuestionTypes(requiredQuestions)\n\n const isMutating = useIsMutating({\n mutationKey: mutationKeyInformationRequestsSubmit(),\n })\n const isPending = isMutating > 0\n\n const handleCancel = () => {\n onEvent(informationRequestEvents.INFORMATION_REQUEST_FORM_CANCEL)\n }\n\n if (hasUnsupportedTypes) {\n return (\n <Flex justifyContent=\"flex-end\" gap={12}>\n <Button variant=\"secondary\" onClick={handleCancel}>\n {t('cta.close')}\n </Button>\n </Flex>\n )\n }\n\n return (\n <Flex justifyContent=\"flex-end\" gap={12}>\n <Button variant=\"secondary\" onClick={handleCancel} isDisabled={isPending}>\n {t('cta.cancel')}\n </Button>\n <Button\n variant=\"primary\"\n type=\"submit\"\n form={INFORMATION_REQUEST_FORM_ID}\n isLoading={isPending}\n >\n {t('cta.submit')}\n </Button>\n </Flex>\n )\n}\n\nInformationRequestForm.Footer = Footer\n"],"names":["INFORMATION_REQUEST_FORM_ID","ACCEPTED_FILE_TYPES","InformationRequestFormSchema","z","InformationRequestForm","props","jsx","BaseComponent","Root","convertFileToDataUrl","file","resolve","reject","reader","SUPPORTED_RESPONSE_TYPES","ResponseType","hasUnsupportedQuestionTypes","questions","question","hasPersonaQuestionType","companyId","requestId","dictionary","useComponentDictionary","useI18n","t","useTranslation","Alert","Heading","Text","useComponentContext","onEvent","baseSubmitHandler","useBase","data","useInformationRequestsGetInformationRequestsSuspense","informationRequest","req","requiredQuestions","isBlockingPayroll","hasUnsupportedTypes","hasPersonaType","submitInformationRequest","useInformationRequestsSubmitMutation","defaultValues","questionUuids","formMethods","useForm","zodResolver","onSubmit","formData","validResponses","uuid","value","SubmitResponseType","fileResponse","response","informationRequestEvents","renderQuestion","fieldName","isDocumentType","isTextType","jsxs","styles","TextInputField","FileInputField","unsupportedPlaceholder","Flex","FormProvider","Form","Footer","Button","selectedRequestId","useFlow","isPending","useIsMutating","mutationKeyInformationRequestsSubmit","handleCancel"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAyBA,MAAMA,IAA8B,sCAC9BC,KAAsB,CAAC,cAAc,aAAa,iBAAiB,GAEnEC,KAA+BC,EAAE;AAAA,EACrCA,EAAE,OAAA;AAAA,EACFA,EAAE,MAAM,CAACA,EAAE,OAAA,EAAS,IAAI,CAAC,GAAGA,EAAE,WAAW,IAAI,CAAC,CAAC;AACjD;AAUO,SAASC,GAAuBC,GAAoC;AACzE,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,MAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,MAAMI,KAAuB,CAACC,MACrB,IAAI,QAAgB,CAACC,GAASC,MAAW;AAC9C,QA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C,EAAE,MAAAvC,EAAA,IAASC,EAAqD;AAAA,IACpE,aAAaf;AAAA,EAAA,CACd,GAKKkB,IAHqBJ,EAAK,wBAAwB;AAAA,IACtD,CAAAG,MAAOA,EAAI,SAASmC;AAAA,EAAA,GAEwB,qBAAqB,CAAA,GAC7DhC,IAAsBxB,EAA4BsB,CAAiB,GAKnEoC,IAHaC,EAAc;AAAA,IAC/B,aAAaC,EAAA;AAAA,EAAqC,CACnD,IAC8B,GAEzBC,IAAe,MAAM;AACzB,IAAA9C,EAAQ0B,EAAyB,+BAA+B;AAAA,EAClE;AAEA,SAAIjB,IAEA,gBAAAlC,EAAC6D,GAAA,EAAK,gBAAe,YAAW,KAAK,IACnC,UAAA,gBAAA7D,EAACiE,GAAA,EAAO,SAAQ,aAAY,SAASM,GAClC,UAAApD,EAAE,WAAW,GAChB,GACF,IAKF,gBAAAqC,EAACK,GAAA,EAAK,gBAAe,YAAW,KAAK,IACnC,UAAA;AAAA,IAAA,gBAAA7D,EAACiE,GAAA,EAAO,SAAQ,aAAY,SAASM,GAAc,YAAYH,GAC5D,UAAAjD,EAAE,YAAY,EAAA,CACjB;AAAA,IACA,gBAAAnB;AAAA,MAACiE;AAAA,MAAA;AAAA,QACC,SAAQ;AAAA,QACR,MAAK;AAAA,QACL,MAAMvE;AAAA,QACN,WAAW0E;AAAA,QAEV,YAAE,YAAY;AAAA,MAAA;AAAA,IAAA;AAAA,EACjB,GACF;AAEJ;AAEAtE,GAAuB,SAASkE;"}
|
|
1
|
+
{"version":3,"file":"InformationRequestForm.js","sources":["../../../../src/components/InformationRequests/InformationRequestForm/InformationRequestForm.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { z } from 'zod'\nimport { useIsMutating } from '@tanstack/react-query'\nimport { useInformationRequestsGetInformationRequestsSuspense } from '@gusto/embedded-api/react-query/informationRequestsGetInformationRequests'\nimport {\n useInformationRequestsSubmitMutation,\n mutationKeyInformationRequestsSubmit,\n} from '@gusto/embedded-api/react-query/informationRequestsSubmit'\nimport type { RequiredQuestions } from '@gusto/embedded-api/models/components/informationrequest'\nimport { ResponseType } from '@gusto/embedded-api/models/components/informationrequest'\nimport { ResponseType as SubmitResponseType } from '@gusto/embedded-api/models/operations/submitinformationrequest'\nimport type { InformationRequestsContextInterface } from '../InformationRequestsComponents'\nimport styles from './InformationRequestForm.module.scss'\nimport { BaseComponent, useBase, type BaseComponentInterface } from '@/components/Base'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport { Flex, TextInputField } from '@/components/Common'\nimport { FileInputField } from '@/components/Common/Fields/FileInputField'\nimport { Form } from '@/components/Common/Form'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { informationRequestEvents, type EventType } from '@/shared/constants'\nimport { useFlow } from '@/components/Flow/useFlow'\n\nconst INFORMATION_REQUEST_FORM_ID = 'gusto-sdk-information-request-form'\nconst ACCEPTED_FILE_TYPES = ['image/jpeg', 'image/png', 'application/pdf']\n\nconst InformationRequestFormSchema = z.record(\n z.string(),\n z.union([z.string().min(1), z.instanceof(File)]),\n)\n\ntype InformationRequestFormValues = z.infer<typeof InformationRequestFormSchema>\n\ninterface InformationRequestFormProps extends BaseComponentInterface<'InformationRequests.InformationRequestForm'> {\n companyId: string\n requestId: string\n onEvent: OnEventType<EventType, unknown>\n}\n\nexport function InformationRequestForm(props: InformationRequestFormProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nconst convertFileToDataUrl = (file: File) => {\n return new Promise<string>((resolve, reject) => {\n const reader = new FileReader()\n reader.onload = () => {\n resolve(reader.result as string)\n }\n reader.onerror = reject\n reader.readAsDataURL(file)\n })\n}\n\nconst SUPPORTED_RESPONSE_TYPES: ResponseType[] = [ResponseType.Text, ResponseType.Document]\n\nfunction hasUnsupportedQuestionTypes(questions: RequiredQuestions[]) {\n return questions.some(\n question => question.responseType && !SUPPORTED_RESPONSE_TYPES.includes(question.responseType),\n )\n}\n\nfunction hasPersonaQuestionType(questions: RequiredQuestions[]) {\n return questions.some(question => question.responseType === ResponseType.Persona)\n}\n\nfunction Root({ companyId, requestId, dictionary }: InformationRequestFormProps) {\n useComponentDictionary('InformationRequests.InformationRequestForm', dictionary)\n useI18n('InformationRequests.InformationRequestForm')\n const { t } = useTranslation('InformationRequests.InformationRequestForm')\n const { Alert, Heading, Text } = useComponentContext()\n const { onEvent, baseSubmitHandler } = useBase()\n\n const { data } = useInformationRequestsGetInformationRequestsSuspense({\n companyUuid: companyId,\n })\n\n const informationRequest = data.informationRequestList?.find(req => req.uuid === requestId)\n const requiredQuestions = informationRequest?.requiredQuestions ?? []\n const isBlockingPayroll = informationRequest?.blockingPayroll ?? false\n const hasUnsupportedTypes = hasUnsupportedQuestionTypes(requiredQuestions)\n const hasPersonaType = hasPersonaQuestionType(requiredQuestions)\n\n const { mutateAsync: submitInformationRequest } = useInformationRequestsSubmitMutation()\n\n const defaultValues: Record<string, string | File | undefined> = {}\n const questionUuids: string[] = []\n\n requiredQuestions.forEach(question => {\n if (!question.questionUuid || !question.responseType) return\n\n if (question.responseType === ResponseType.Text) {\n questionUuids.push(question.questionUuid)\n defaultValues[question.questionUuid] = ''\n } else if (question.responseType === ResponseType.Document) {\n questionUuids.push(question.questionUuid)\n defaultValues[question.questionUuid] = undefined\n }\n })\n\n const formMethods = useForm<InformationRequestFormValues>({\n resolver: zodResolver(InformationRequestFormSchema),\n defaultValues,\n })\n\n const onSubmit = async (formData: InformationRequestFormValues) => {\n await baseSubmitHandler(formData, async () => {\n const questionResponses = await Promise.all(\n questionUuids.map(async uuid => {\n const value = formData[uuid]\n\n if (typeof value === 'string') {\n return {\n questionUuid: uuid,\n responseType: SubmitResponseType.Text,\n textResponse: value,\n }\n }\n\n if (value instanceof File) {\n const fileResponse = await convertFileToDataUrl(value)\n return {\n questionUuid: uuid,\n responseType: SubmitResponseType.Document,\n fileResponse,\n fileName: value.name,\n }\n }\n\n return null\n }),\n )\n\n const validResponses = questionResponses.filter(response => response !== null)\n\n const response = await submitInformationRequest({\n request: {\n informationRequestUuid: requestId,\n requestBody: {\n requiredQuestions: validResponses,\n },\n },\n })\n\n onEvent(informationRequestEvents.INFORMATION_REQUEST_FORM_DONE, response.informationRequest)\n })\n }\n\n const renderQuestion = (question: RequiredQuestions) => {\n if (!question.questionUuid || !question.responseType) return null\n\n const fieldName = question.questionUuid\n const isDocumentType = question.responseType === ResponseType.Document\n const isTextType = question.responseType === ResponseType.Text\n\n return (\n <div key={fieldName} className={styles.questionCard}>\n <div className={styles.questionDescription}>\n <Text weight=\"medium\">\n {isDocumentType ? t('questionTypes.document') : t('questionTypes.answer')}\n </Text>\n <Text>{question.questionText}</Text>\n </div>\n\n <hr className={styles.divider} />\n\n {isTextType && (\n <div className={styles.textInputWrapper}>\n <TextInputField\n name={fieldName}\n label={t('fields.textAnswer.label')}\n placeholder={t('fields.textAnswer.placeholder')}\n isRequired\n errorMessage={t('validation.required')}\n />\n </div>\n )}\n\n {isDocumentType && (\n <div className={styles.fileInputWrapper}>\n <FileInputField\n name={fieldName}\n label={t('fields.fileUpload.label')}\n accept={ACCEPTED_FILE_TYPES}\n isRequired\n errorMessage={t('validation.required')}\n />\n </div>\n )}\n </div>\n )\n }\n\n const unsupportedPlaceholder = (\n <div className={styles.questionCard}>\n <div className={styles.questionDescription}>\n <Text weight=\"medium\">\n {t(hasPersonaType ? 'unsupported.persona.title' : 'unsupported.generic.title')}\n </Text>\n <Text>\n {t(\n hasPersonaType ? 'unsupported.persona.description' : 'unsupported.generic.description',\n )}\n </Text>\n </div>\n\n <hr className={styles.divider} />\n\n <div className={styles.contactSupport}>\n <Text variant=\"supporting\">{t('unsupported.contactSupport')}</Text>\n </div>\n </div>\n )\n\n return (\n <div className={styles.root}>\n <Flex flexDirection=\"column\" gap={16}>\n <Heading as=\"h2\">{t('title')}</Heading>\n\n {isBlockingPayroll && (\n <Alert status=\"error\" label={t('blockingAlert.title')} disableScrollIntoView>\n {t('blockingAlert.description')}\n </Alert>\n )}\n\n {hasUnsupportedTypes ? (\n unsupportedPlaceholder\n ) : (\n <FormProvider {...formMethods}>\n <Form id={INFORMATION_REQUEST_FORM_ID} onSubmit={formMethods.handleSubmit(onSubmit)}>\n <Flex flexDirection=\"column\" gap={16}>\n {requiredQuestions.map(renderQuestion)}\n </Flex>\n </Form>\n </FormProvider>\n )}\n </Flex>\n </div>\n )\n}\n\nconst Footer = ({ onEvent }: { onEvent: OnEventType<EventType, unknown> }) => {\n useI18n('InformationRequests.InformationRequestForm')\n const { t } = useTranslation('InformationRequests.InformationRequestForm')\n const { Button } = useComponentContext()\n const { companyId, selectedRequestId } = useFlow<InformationRequestsContextInterface>()\n\n const { data } = useInformationRequestsGetInformationRequestsSuspense({\n companyUuid: companyId,\n })\n\n const informationRequest = data.informationRequestList?.find(\n req => req.uuid === selectedRequestId,\n )\n const requiredQuestions = informationRequest?.requiredQuestions ?? []\n const hasUnsupportedTypes = hasUnsupportedQuestionTypes(requiredQuestions)\n\n const isMutating = useIsMutating({\n mutationKey: mutationKeyInformationRequestsSubmit(),\n })\n const isPending = isMutating > 0\n\n const handleCancel = () => {\n onEvent(informationRequestEvents.INFORMATION_REQUEST_FORM_CANCEL)\n }\n\n if (hasUnsupportedTypes) {\n return (\n <Flex justifyContent=\"flex-end\" gap={12}>\n <Button variant=\"secondary\" onClick={handleCancel}>\n {t('cta.close')}\n </Button>\n </Flex>\n )\n }\n\n return (\n <Flex justifyContent=\"flex-end\" gap={12}>\n <Button variant=\"secondary\" onClick={handleCancel} isDisabled={isPending}>\n {t('cta.cancel')}\n </Button>\n <Button\n variant=\"primary\"\n type=\"submit\"\n form={INFORMATION_REQUEST_FORM_ID}\n isLoading={isPending}\n >\n {t('cta.submit')}\n </Button>\n </Flex>\n )\n}\n\nInformationRequestForm.Footer = Footer\n"],"names":["INFORMATION_REQUEST_FORM_ID","ACCEPTED_FILE_TYPES","InformationRequestFormSchema","z","InformationRequestForm","props","jsx","BaseComponent","Root","convertFileToDataUrl","file","resolve","reject","reader","SUPPORTED_RESPONSE_TYPES","ResponseType","hasUnsupportedQuestionTypes","questions","question","hasPersonaQuestionType","companyId","requestId","dictionary","useComponentDictionary","useI18n","t","useTranslation","Alert","Heading","Text","useComponentContext","onEvent","baseSubmitHandler","useBase","data","useInformationRequestsGetInformationRequestsSuspense","informationRequest","req","requiredQuestions","isBlockingPayroll","hasUnsupportedTypes","hasPersonaType","submitInformationRequest","useInformationRequestsSubmitMutation","defaultValues","questionUuids","formMethods","useForm","zodResolver","onSubmit","formData","validResponses","uuid","value","SubmitResponseType","fileResponse","response","informationRequestEvents","renderQuestion","fieldName","isDocumentType","isTextType","jsxs","styles","TextInputField","FileInputField","unsupportedPlaceholder","Flex","FormProvider","Form","Footer","Button","selectedRequestId","useFlow","isPending","useIsMutating","mutationKeyInformationRequestsSubmit","handleCancel"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAyBA,MAAMA,IAA8B,sCAC9BC,KAAsB,CAAC,cAAc,aAAa,iBAAiB,GAEnEC,KAA+BC,EAAE;AAAA,EACrCA,EAAE,OAAA;AAAA,EACFA,EAAE,MAAM,CAACA,EAAE,OAAA,EAAS,IAAI,CAAC,GAAGA,EAAE,WAAW,IAAI,CAAC,CAAC;AACjD;AAUO,SAASC,GAAuBC,GAAoC;AACzE,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,MAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,MAAMI,KAAuB,CAACC,MACrB,IAAI,QAAgB,CAACC,GAASC,MAAW;AAC9C,QAAMC,IAAS,IAAI,WAAA;AACnB,EAAAA,EAAO,SAAS,MAAM;AACpB,IAAAF,EAAQE,EAAO,MAAgB;AAAA,EACjC,GACAA,EAAO,UAAUD,G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AG,MAAOA,EAAI,SAASmC;AAAA,EAAA,GAEwB,qBAAqB,CAAA,GAC7DhC,IAAsBxB,EAA4BsB,CAAiB,GAKnEoC,IAHaC,EAAc;AAAA,IAC/B,aAAaC,EAAA;AAAA,EAAqC,CACnD,IAC8B,GAEzBC,IAAe,MAAM;AACzB,IAAA9C,EAAQ0B,EAAyB,+BAA+B;AAAA,EAClE;AAEA,SAAIjB,IAEA,gBAAAlC,EAAC6D,GAAA,EAAK,gBAAe,YAAW,KAAK,IACnC,UAAA,gBAAA7D,EAACiE,GAAA,EAAO,SAAQ,aAAY,SAASM,GAClC,UAAApD,EAAE,WAAW,GAChB,GACF,IAKF,gBAAAqC,EAACK,GAAA,EAAK,gBAAe,YAAW,KAAK,IACnC,UAAA;AAAA,IAAA,gBAAA7D,EAACiE,GAAA,EAAO,SAAQ,aAAY,SAASM,GAAc,YAAYH,GAC5D,UAAAjD,EAAE,YAAY,EAAA,CACjB;AAAA,IACA,gBAAAnB;AAAA,MAACiE;AAAA,MAAA;AAAA,QACC,SAAQ;AAAA,QACR,MAAK;AAAA,QACL,MAAMvE;AAAA,QACN,WAAW0E;AAAA,QAEV,YAAE,YAAY;AAAA,MAAA;AAAA,IAAA;AAAA,EACjB,GACF;AAEJ;AAEAtE,GAAuB,SAASkE;"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
const t = "
|
|
1
|
+
const t = "_root_1vcmu_1", o = "_questionCard_1vcmu_5", p = "_questionDescription_1vcmu_15", r = "_textInputWrapper_1vcmu_22", e = "_fileInputWrapper_1vcmu_26", n = "_divider_1vcmu_31", c = "_contactSupport_1vcmu_38", u = {
|
|
2
2
|
root: t,
|
|
3
3
|
questionCard: o,
|
|
4
4
|
questionDescription: p,
|
|
5
5
|
textInputWrapper: r,
|
|
6
6
|
fileInputWrapper: e,
|
|
7
7
|
divider: n,
|
|
8
|
-
contactSupport:
|
|
8
|
+
contactSupport: c
|
|
9
9
|
};
|
|
10
10
|
export {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
c as contactSupport,
|
|
12
|
+
u as default,
|
|
13
13
|
n as divider,
|
|
14
14
|
e as fileInputWrapper,
|
|
15
15
|
o as questionCard,
|
package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js
CHANGED
|
@@ -1,32 +1,34 @@
|
|
|
1
1
|
import { jsx as n, jsxs as a } from "react/jsx-runtime";
|
|
2
|
-
import { useTranslation as
|
|
3
|
-
import {
|
|
4
|
-
import { InformationRequestStatus as
|
|
5
|
-
import { BaseComponent as
|
|
2
|
+
import { useTranslation as P } from "react-i18next";
|
|
3
|
+
import { useInformationRequestsGetInformationRequestsSuspense as w } from "@gusto/embedded-api/react-query/informationRequestsGetInformationRequests";
|
|
4
|
+
import { InformationRequestStatus as s, InformationRequestType as i } from "@gusto/embedded-api/models/components/informationrequest";
|
|
5
|
+
import { BaseComponent as x } from "../../Base/Base.js";
|
|
6
6
|
import "../../Base/useBase.js";
|
|
7
|
-
import { useComponentContext as
|
|
8
|
-
import { useComponentDictionary as
|
|
9
|
-
import { DataView as
|
|
10
|
-
import { useDataView as
|
|
11
|
-
import { FlexItem as
|
|
7
|
+
import { useComponentContext as S } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
8
|
+
import { useComponentDictionary as T, useI18n as k } from "../../../i18n/I18n.js";
|
|
9
|
+
import { DataView as v } from "../../Common/DataView/DataView.js";
|
|
10
|
+
import { useDataView as D } from "../../Common/DataView/useDataView.js";
|
|
11
|
+
import { FlexItem as E, Flex as u } from "../../Common/Flex/Flex.js";
|
|
12
|
+
import "classnames";
|
|
13
|
+
import { informationRequestEvents as C } from "../../../shared/constants.js";
|
|
14
|
+
import { EmptyData as L } from "../../Common/EmptyData/EmptyData.js";
|
|
12
15
|
import "react";
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
return /* @__PURE__ */ n(k, { ...s, children: /* @__PURE__ */ n(A, { ...s, children: s.children }) });
|
|
16
|
+
function X(r) {
|
|
17
|
+
return /* @__PURE__ */ n(x, { ...r, children: /* @__PURE__ */ n(A, { ...r, children: r.children }) });
|
|
16
18
|
}
|
|
17
19
|
function A({
|
|
18
|
-
companyId:
|
|
20
|
+
companyId: r,
|
|
19
21
|
dictionary: d,
|
|
20
|
-
filterByPayrollBlocking:
|
|
22
|
+
filterByPayrollBlocking: m = !1,
|
|
21
23
|
onEvent: f
|
|
22
24
|
}) {
|
|
23
|
-
|
|
24
|
-
const { t } =
|
|
25
|
-
companyUuid:
|
|
26
|
-
}),
|
|
27
|
-
const o = e.status !==
|
|
28
|
-
return
|
|
29
|
-
}),
|
|
25
|
+
T("InformationRequests.InformationRequestList", d), k("InformationRequests.InformationRequestList");
|
|
26
|
+
const { t } = P("InformationRequests.InformationRequestList"), { Heading: R, Text: l, Button: y, Badge: c } = S(), { data: g } = w({
|
|
27
|
+
companyUuid: r
|
|
28
|
+
}), h = (g.informationRequestList ?? []).filter((e) => {
|
|
29
|
+
const o = e.status !== s.Approved;
|
|
30
|
+
return m ? e.blockingPayroll && o : o;
|
|
31
|
+
}), I = (e) => {
|
|
30
32
|
switch (e) {
|
|
31
33
|
case i.CompanyOnboarding:
|
|
32
34
|
return t("types.companyOnboarding");
|
|
@@ -39,42 +41,42 @@ function A({
|
|
|
39
41
|
default:
|
|
40
42
|
return t("types.unknown");
|
|
41
43
|
}
|
|
42
|
-
},
|
|
44
|
+
}, q = (e) => {
|
|
43
45
|
switch (e) {
|
|
44
|
-
case
|
|
46
|
+
case s.PendingResponse:
|
|
45
47
|
return { label: t("status.incomplete"), badgeStatus: "info" };
|
|
46
|
-
case
|
|
48
|
+
case s.PendingReview:
|
|
47
49
|
return { label: t("status.underReview"), badgeStatus: "warning" };
|
|
48
50
|
default:
|
|
49
51
|
return null;
|
|
50
52
|
}
|
|
51
|
-
},
|
|
52
|
-
data:
|
|
53
|
-
|
|
53
|
+
}, b = D({
|
|
54
|
+
data: h,
|
|
55
|
+
emptyState: () => /* @__PURE__ */ n(L, { title: t("emptyTableTitle") }),
|
|
54
56
|
columns: [
|
|
55
57
|
{
|
|
56
58
|
key: "type",
|
|
57
59
|
title: t("columns.type"),
|
|
58
|
-
render: (e) => /* @__PURE__ */ n(
|
|
60
|
+
render: (e) => /* @__PURE__ */ n(E, { flexGrow: 1, children: /* @__PURE__ */ n(l, { weight: "medium", children: I(e.type) }) })
|
|
59
61
|
},
|
|
60
62
|
{
|
|
61
63
|
key: "status",
|
|
62
64
|
title: t("columns.status"),
|
|
63
65
|
render: (e) => {
|
|
64
|
-
const o =
|
|
66
|
+
const o = q(e.status), p = !m && e.blockingPayroll;
|
|
65
67
|
return !o && !p ? null : /* @__PURE__ */ a(u, { gap: 8, alignItems: "center", children: [
|
|
66
|
-
o && /* @__PURE__ */ n(
|
|
67
|
-
p && /* @__PURE__ */ n(
|
|
68
|
+
o && /* @__PURE__ */ n(c, { status: o.badgeStatus, children: o.label }),
|
|
69
|
+
p && /* @__PURE__ */ n(c, { status: "error", children: t("status.payrollBlocking") })
|
|
68
70
|
] });
|
|
69
71
|
}
|
|
70
72
|
}
|
|
71
73
|
],
|
|
72
|
-
itemMenu: (e) => e.status ===
|
|
73
|
-
|
|
74
|
+
itemMenu: (e) => e.status === s.PendingResponse ? /* @__PURE__ */ n(
|
|
75
|
+
y,
|
|
74
76
|
{
|
|
75
77
|
variant: "secondary",
|
|
76
78
|
onClick: () => {
|
|
77
|
-
f(
|
|
79
|
+
f(C.INFORMATION_REQUEST_RESPOND, {
|
|
78
80
|
requestId: e.uuid
|
|
79
81
|
});
|
|
80
82
|
},
|
|
@@ -87,10 +89,10 @@ function A({
|
|
|
87
89
|
/* @__PURE__ */ n(R, { as: "h2", styledAs: "h4", children: t("title") }),
|
|
88
90
|
/* @__PURE__ */ n(l, { children: t("description") })
|
|
89
91
|
] }),
|
|
90
|
-
/* @__PURE__ */ n(
|
|
92
|
+
/* @__PURE__ */ n(v, { ...b, label: t("title") })
|
|
91
93
|
] });
|
|
92
94
|
}
|
|
93
95
|
export {
|
|
94
|
-
|
|
96
|
+
X as InformationRequestList
|
|
95
97
|
};
|
|
96
98
|
//# sourceMappingURL=InformationRequestList.js.map
|
package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InformationRequestList.js","sources":["../../../../src/components/InformationRequests/InformationRequestList/InformationRequestList.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport {
|
|
1
|
+
{"version":3,"file":"InformationRequestList.js","sources":["../../../../src/components/InformationRequests/InformationRequestList/InformationRequestList.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useInformationRequestsGetInformationRequestsSuspense } from '@gusto/embedded-api/react-query/informationRequestsGetInformationRequests'\nimport type { InformationRequest } from '@gusto/embedded-api/models/components/informationrequest'\nimport {\n InformationRequestStatus,\n InformationRequestType,\n} from '@gusto/embedded-api/models/components/informationrequest'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { DataView } from '@/components/Common/DataView/DataView'\nimport { useDataView } from '@/components/Common/DataView/useDataView'\nimport { EmptyData, Flex, FlexItem } from '@/components/Common'\nimport { informationRequestEvents } from '@/shared/constants'\nimport type { BadgeProps } from '@/components/Common/UI/Badge/BadgeTypes'\n\ninterface InformationRequestListProps extends BaseComponentInterface<'InformationRequests.InformationRequestList'> {\n companyId: string\n filterByPayrollBlocking?: boolean\n onEvent: BaseComponentInterface['onEvent']\n}\n\nexport function InformationRequestList(props: InformationRequestListProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\ntype StatusMapping = {\n label: string\n badgeStatus: BadgeProps['status']\n} | null\n\nfunction Root({\n companyId,\n dictionary,\n filterByPayrollBlocking = false,\n onEvent,\n}: InformationRequestListProps) {\n useComponentDictionary('InformationRequests.InformationRequestList', dictionary)\n useI18n('InformationRequests.InformationRequestList')\n const { t } = useTranslation('InformationRequests.InformationRequestList')\n const { Heading, Text, Button, Badge } = useComponentContext()\n\n const { data } = useInformationRequestsGetInformationRequestsSuspense({\n companyUuid: companyId,\n })\n\n const informationRequests = data.informationRequestList ?? []\n\n const visibleRequests = informationRequests.filter(request => {\n const isNotApproved = request.status !== InformationRequestStatus.Approved\n\n if (filterByPayrollBlocking) {\n return request.blockingPayroll && isNotApproved\n }\n\n return isNotApproved\n })\n\n const getTypeLabel = (type: InformationRequest['type']): string => {\n switch (type) {\n case InformationRequestType.CompanyOnboarding:\n return t('types.companyOnboarding')\n case InformationRequestType.AccountProtection:\n return t('types.accountProtection')\n case InformationRequestType.PaymentRequest:\n return t('types.paymentRequest')\n case InformationRequestType.PaymentError:\n return t('types.paymentError')\n default:\n return t('types.unknown')\n }\n }\n\n const getStatusMapping = (status: InformationRequest['status']): StatusMapping => {\n switch (status) {\n case InformationRequestStatus.PendingResponse:\n return { label: t('status.incomplete'), badgeStatus: 'info' }\n case InformationRequestStatus.PendingReview:\n return { label: t('status.underReview'), badgeStatus: 'warning' }\n default:\n return null\n }\n }\n\n const dataViewProps = useDataView({\n data: visibleRequests,\n emptyState: () => <EmptyData title={t('emptyTableTitle')} />,\n columns: [\n {\n key: 'type',\n title: t('columns.type'),\n render: request => (\n <FlexItem flexGrow={1}>\n <Text weight=\"medium\">{getTypeLabel(request.type)}</Text>\n </FlexItem>\n ),\n },\n {\n key: 'status',\n title: t('columns.status'),\n render: request => {\n const statusMapping = getStatusMapping(request.status)\n const showPayrollBlockingBadge = !filterByPayrollBlocking && request.blockingPayroll\n\n if (!statusMapping && !showPayrollBlockingBadge) {\n return null\n }\n\n return (\n <Flex gap={8} alignItems=\"center\">\n {statusMapping && (\n <Badge status={statusMapping.badgeStatus}>{statusMapping.label}</Badge>\n )}\n {showPayrollBlockingBadge && (\n <Badge status=\"error\">{t('status.payrollBlocking')}</Badge>\n )}\n </Flex>\n )\n },\n },\n ],\n itemMenu: request => {\n const isPendingResponse = request.status === InformationRequestStatus.PendingResponse\n if (!isPendingResponse) {\n return null\n }\n return (\n <Button\n variant=\"secondary\"\n onClick={() => {\n onEvent(informationRequestEvents.INFORMATION_REQUEST_RESPOND, {\n requestId: request.uuid,\n })\n }}\n >\n {t('cta.respond')}\n </Button>\n )\n },\n })\n\n return (\n <Flex flexDirection=\"column\" gap={20}>\n <Flex flexDirection=\"column\" gap={2}>\n <Heading as=\"h2\" styledAs=\"h4\">\n {t('title')}\n </Heading>\n <Text>{t('description')}</Text>\n </Flex>\n\n <DataView {...dataViewProps} label={t('title')} />\n </Flex>\n )\n}\n"],"names":["InformationRequestList","props","jsx","BaseComponent","Root","companyId","dictionary","filterByPayrollBlocking","onEvent","useComponentDictionary","useI18n","useTranslation","Heading","Text","Button","Badge","useComponentContext","data","useInformationRequestsGetInformationRequestsSuspense","visibleRequests","request","isNotApproved","InformationRequestStatus","getTypeLabel","type","InformationRequestType","getStatusMapping","status","dataViewProps","useDataView","EmptyData","FlexItem","statusMapping","showPayrollBlockingBadge","jsxs","Flex","informationRequestEvents","DataView"],"mappings":";;;;;;;;;;;;;;;AAsBO,SAASA,EAAuBC,GAAoC;AACzE,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAOA,SAASG,EAAK;AAAA,EACZ,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,yBAAAC,IAA0B;AAAA,EAC1B,SAAAC;AACF,GAAgC;AAC9B,EAAAC,EAAuB,8CAA8CH,CAAU,GAC/EI,EAAQ,4CAA4C;AACpD,QAAM,EAAE,EAAA,IAAMC,EAAe,4CAA4C,GACnE,EAAE,SAAAC,GAAS,MAAAC,GAAM,QAAAC,GAAQ,OAAAC,EAAA,IAAUC,EAAA,GAEnC,EAAE,MAAAC,EAAA,IAASC,EAAqD;AAAA,IACpE,aAAab;A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,gBAAMY,IAAgBN,EAAiBN,EAAQ,MAAM,GAC/Ca,IAA2B,CAAC1B,KAA2Ba,EAAQ;AAErE,iBAAI,CAACY,KAAiB,CAACC,IACd,OAIP,gBAAAC,EAACC,GAAA,EAAK,KAAK,GAAG,YAAW,UACtB,UAAA;AAAA,YAAAH,uBACEjB,GAAA,EAAM,QAAQiB,EAAc,aAAc,YAAc,OAAM;AAAA,YAEhEC,KACC,gBAAA/B,EAACa,GAAA,EAAM,QAAO,SAAS,UAAA,EAAE,wBAAwB,EAAA,CAAE;AAAA,UAAA,GAEvD;AAAA,QAEJ;AAAA,MAAA;AAAA,IACF;AAAA,IAEF,UAAU,CAAAK,MACkBA,EAAQ,WAAWE,EAAyB,kBAKpE,gBAAApB;AAAA,MAACY;AAAA,MAAA;AAAA,QACC,SAAQ;AAAA,QACR,SAAS,MAAM;AACb,UAAAN,EAAQ4B,EAAyB,6BAA6B;AAAA,YAC5D,WAAWhB,EAAQ;AAAA,UAAA,CACpB;AAAA,QACH;AAAA,QAEC,YAAE,aAAa;AAAA,MAAA;AAAA,IAAA,IAXX;AAAA,EAcX,CACD;AAED,SACE,gBAAAc,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,IAAA,gBAAAD,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,GAChC,UAAA;AAAA,MAAA,gBAAAjC,EAACU,KAAQ,IAAG,MAAK,UAAS,MACvB,UAAA,EAAE,OAAO,GACZ;AAAA,MACA,gBAAAV,EAACW,GAAA,EAAM,UAAA,EAAE,aAAa,EAAA,CAAE;AAAA,IAAA,GAC1B;AAAA,sBAECwB,GAAA,EAAU,GAAGT,GAAe,OAAO,EAAE,OAAO,EAAA,CAAG;AAAA,EAAA,GAClD;AAEJ;"}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { BaseComponentInterface } from '../Base';
|
|
2
|
-
export interface InformationRequestsFlowProps {
|
|
2
|
+
export interface InformationRequestsFlowProps extends Omit<BaseComponentInterface<'InformationRequests'>, 'onEvent'> {
|
|
3
3
|
companyId: string;
|
|
4
4
|
filterByPayrollBlocking?: boolean;
|
|
5
|
+
/**
|
|
6
|
+
* When true (default), the submission success alert is rendered at the top of this component.
|
|
7
|
+
* Set to false when embedding in a parent (e.g. PayrollBlockerList) that renders the alert elsewhere.
|
|
8
|
+
*/
|
|
9
|
+
withAlert?: boolean;
|
|
5
10
|
onEvent?: BaseComponentInterface['onEvent'];
|
|
6
11
|
}
|
|
7
|
-
export declare function InformationRequestsFlow({ companyId, filterByPayrollBlocking, onEvent, }: InformationRequestsFlowProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare function InformationRequestsFlow({ companyId, dictionary, filterByPayrollBlocking, withAlert, onEvent, }: InformationRequestsFlowProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,68 +1,101 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { createMachine as
|
|
3
|
-
import { useMachine as
|
|
4
|
-
import { useState as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { jsx as t, jsxs as v } from "react/jsx-runtime";
|
|
2
|
+
import { createMachine as L } from "robot3";
|
|
3
|
+
import { useMachine as b } from "react-robot";
|
|
4
|
+
import { useState as R, useCallback as p, useMemo as Q, Suspense as U } from "react";
|
|
5
|
+
import { useTranslation as P } from "react-i18next";
|
|
6
|
+
import { informationRequestsMachine as g } from "./informationRequestsStateMachine.js";
|
|
7
|
+
import { BaseBoundaries as j } from "../Base/Base.js";
|
|
7
8
|
import "../Base/useBase.js";
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import { informationRequestEvents as
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
import { Flex as k } from "../Common/Flex/Flex.js";
|
|
10
|
+
import "classnames";
|
|
11
|
+
import { informationRequestEvents as s } from "../../shared/constants.js";
|
|
12
|
+
import { useComponentContext as B } from "../../contexts/ComponentAdapter/useComponentContext.js";
|
|
13
|
+
import { FlowContext as $ } from "../Flow/useFlow.js";
|
|
14
|
+
import { useComponentDictionary as w, useI18n as z } from "../../i18n/I18n.js";
|
|
15
|
+
import { InformationRequestList as Y } from "./InformationRequestList/InformationRequestList.js";
|
|
16
|
+
const E = "informationRequestResponded";
|
|
17
|
+
function ie({
|
|
18
|
+
companyId: r,
|
|
19
|
+
dictionary: I,
|
|
20
|
+
filterByPayrollBlocking: O = !1,
|
|
21
|
+
withAlert: a = !0,
|
|
22
|
+
onEvent: M = () => {
|
|
16
23
|
}
|
|
17
24
|
}) {
|
|
18
|
-
|
|
19
|
-
|
|
25
|
+
w("InformationRequests", I), z("InformationRequests");
|
|
26
|
+
const { t: m } = P("InformationRequests"), { Modal: x, LoadingSpinner: c, Alert: h, Text: A } = B(), [C, i] = R(!1), [F, f] = R({
|
|
27
|
+
nextAlertId: 0,
|
|
28
|
+
alerts: []
|
|
29
|
+
}), N = p((e) => {
|
|
30
|
+
f((o) => ({
|
|
31
|
+
...o,
|
|
32
|
+
alerts: o.alerts.filter((D) => D.id !== e)
|
|
33
|
+
}));
|
|
34
|
+
}, []), T = p(() => {
|
|
35
|
+
f((e) => ({
|
|
36
|
+
nextAlertId: e.nextAlertId + 1,
|
|
37
|
+
alerts: [{ id: e.nextAlertId }, ...e.alerts]
|
|
38
|
+
}));
|
|
39
|
+
}, []), _ = Q(
|
|
40
|
+
() => L(
|
|
20
41
|
"list",
|
|
21
|
-
|
|
42
|
+
g,
|
|
22
43
|
() => ({
|
|
23
44
|
component: null,
|
|
24
|
-
companyId:
|
|
25
|
-
onEvent:
|
|
45
|
+
companyId: r,
|
|
46
|
+
onEvent: n
|
|
26
47
|
})
|
|
27
48
|
),
|
|
28
|
-
[
|
|
29
|
-
), [
|
|
30
|
-
function e
|
|
31
|
-
|
|
49
|
+
[r]
|
|
50
|
+
), [u, S] = b(_);
|
|
51
|
+
function n(e, o) {
|
|
52
|
+
S({ type: e, payload: o }), e === s.INFORMATION_REQUEST_RESPOND && i(!0), (e === s.INFORMATION_REQUEST_FORM_CANCEL || e === s.INFORMATION_REQUEST_FORM_DONE) && i(!1), e === s.INFORMATION_REQUEST_FORM_DONE && a && T(), M(e, o);
|
|
32
53
|
}
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
},
|
|
36
|
-
return /* @__PURE__ */
|
|
37
|
-
|
|
54
|
+
const q = () => {
|
|
55
|
+
i(!1);
|
|
56
|
+
}, l = u.context.component, d = l?.Footer || void 0;
|
|
57
|
+
return /* @__PURE__ */ t(
|
|
58
|
+
$.Provider,
|
|
38
59
|
{
|
|
39
60
|
value: {
|
|
40
|
-
...
|
|
41
|
-
onEvent:
|
|
61
|
+
...u.context,
|
|
62
|
+
onEvent: n
|
|
42
63
|
},
|
|
43
|
-
children: [
|
|
44
|
-
/* @__PURE__ */
|
|
45
|
-
|
|
64
|
+
children: /* @__PURE__ */ v(k, { flexDirection: "column", gap: 32, children: [
|
|
65
|
+
a && F.alerts.map((e) => /* @__PURE__ */ t(
|
|
66
|
+
h,
|
|
46
67
|
{
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
68
|
+
status: "success",
|
|
69
|
+
label: m(`alerts.${E}.title`),
|
|
70
|
+
onDismiss: () => {
|
|
71
|
+
N(e.id);
|
|
72
|
+
},
|
|
73
|
+
children: /* @__PURE__ */ t(A, { children: m(`alerts.${E}.description`) })
|
|
74
|
+
},
|
|
75
|
+
e.id
|
|
76
|
+
)),
|
|
77
|
+
/* @__PURE__ */ t(U, { fallback: /* @__PURE__ */ t(c, {}), children: /* @__PURE__ */ t(
|
|
78
|
+
Y,
|
|
79
|
+
{
|
|
80
|
+
companyId: r,
|
|
81
|
+
filterByPayrollBlocking: O,
|
|
82
|
+
onEvent: n
|
|
50
83
|
}
|
|
51
|
-
),
|
|
52
|
-
/* @__PURE__ */
|
|
53
|
-
|
|
84
|
+
) }),
|
|
85
|
+
/* @__PURE__ */ t(
|
|
86
|
+
x,
|
|
54
87
|
{
|
|
55
|
-
isOpen:
|
|
56
|
-
onClose:
|
|
57
|
-
footer:
|
|
58
|
-
children:
|
|
88
|
+
isOpen: C,
|
|
89
|
+
onClose: q,
|
|
90
|
+
footer: d && /* @__PURE__ */ t(j, { LoaderComponent: () => /* @__PURE__ */ t(c, { size: "sm" }), children: /* @__PURE__ */ t(d, { onEvent: n }) }),
|
|
91
|
+
children: l && /* @__PURE__ */ t(l, {})
|
|
59
92
|
}
|
|
60
93
|
)
|
|
61
|
-
]
|
|
94
|
+
] })
|
|
62
95
|
}
|
|
63
96
|
);
|
|
64
97
|
}
|
|
65
98
|
export {
|
|
66
|
-
|
|
99
|
+
ie as InformationRequestsFlow
|
|
67
100
|
};
|
|
68
101
|
//# sourceMappingURL=InformationRequests.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InformationRequests.js","sources":["../../../src/components/InformationRequests/InformationRequests.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMachine } from 'react-robot'\nimport { useMemo, useState } from 'react'\nimport { InformationRequestList } from './InformationRequestList'\nimport { informationRequestsMachine } from './informationRequestsStateMachine'\nimport { type InformationRequestsContextInterface } from './InformationRequestsComponents'\nimport { BaseBoundaries, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { FlowContext } from '@/components/Flow/useFlow'\nimport { informationRequestEvents, type EventType } from '@/shared/constants'\n\nexport interface InformationRequestsFlowProps {\n companyId: string\n filterByPayrollBlocking?: boolean\n onEvent?: BaseComponentInterface['onEvent']\n}\n\nexport function InformationRequestsFlow({\n companyId,\n filterByPayrollBlocking = false,\n onEvent = () => {},\n}: InformationRequestsFlowProps) {\n const { Modal, LoadingSpinner } = useComponentContext()\n const [isModalOpen, setIsModalOpen] = useState(false)\n\n const informationRequestsMachineInstance = useMemo(\n () =>\n createMachine(\n 'list',\n informationRequestsMachine,\n (): InformationRequestsContextInterface => ({\n component: null,\n companyId,\n onEvent: handleEvent,\n }),\n ),\n [companyId],\n )\n const [current, send] = useMachine(informationRequestsMachineInstance)\n\n function handleEvent(type: EventType, data?: unknown) {\n send({ type, payload: data })\n\n if (type === informationRequestEvents.INFORMATION_REQUEST_RESPOND) {\n setIsModalOpen(true)\n }\n\n if (\n type === informationRequestEvents.INFORMATION_REQUEST_FORM_CANCEL ||\n type === informationRequestEvents.INFORMATION_REQUEST_FORM_DONE\n ) {\n setIsModalOpen(false)\n }\n\n onEvent(type, data)\n }\n\n const handleCloseModal = () => {\n setIsModalOpen(false)\n }\n\n const CurrentComponent = current.context.component\n const Footer = CurrentComponent?.Footer || undefined\n\n return (\n <FlowContext.Provider\n value={{\n ...current.context,\n onEvent: handleEvent,\n }}\n >\n <InformationRequestList\n
|
|
1
|
+
{"version":3,"file":"InformationRequests.js","sources":["../../../src/components/InformationRequests/InformationRequests.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMachine } from 'react-robot'\nimport { Suspense, useCallback, useMemo, useState } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { InformationRequestList } from './InformationRequestList'\nimport { informationRequestsMachine } from './informationRequestsStateMachine'\nimport { type InformationRequestsContextInterface } from './InformationRequestsComponents'\nimport { BaseBoundaries, type BaseComponentInterface } from '@/components/Base'\nimport { Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { FlowContext } from '@/components/Flow/useFlow'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { informationRequestEvents, type EventType } from '@/shared/constants'\n\ninterface SubmissionAlert {\n id: number\n}\n\ninterface SubmissionAlertState {\n nextAlertId: number\n alerts: SubmissionAlert[]\n}\n\nexport interface InformationRequestsFlowProps extends Omit<\n BaseComponentInterface<'InformationRequests'>,\n 'onEvent'\n> {\n companyId: string\n filterByPayrollBlocking?: boolean\n /**\n * When true (default), the submission success alert is rendered at the top of this component.\n * Set to false when embedding in a parent (e.g. PayrollBlockerList) that renders the alert elsewhere.\n */\n withAlert?: boolean\n onEvent?: BaseComponentInterface['onEvent']\n}\n\nconst ALERT_TYPE = 'informationRequestResponded' as const\n\nexport function InformationRequestsFlow({\n companyId,\n dictionary,\n filterByPayrollBlocking = false,\n withAlert = true,\n onEvent = () => {},\n}: InformationRequestsFlowProps) {\n useComponentDictionary('InformationRequests', dictionary)\n useI18n('InformationRequests')\n const { t } = useTranslation('InformationRequests')\n const { Modal, LoadingSpinner, Alert, Text } = useComponentContext()\n const [isModalOpen, setIsModalOpen] = useState(false)\n const [alertState, setAlertState] = useState<SubmissionAlertState>({\n nextAlertId: 0,\n alerts: [],\n })\n\n const handleDismissAlert = useCallback((alertId: number) => {\n setAlertState(prev => ({\n ...prev,\n alerts: prev.alerts.filter(alert => alert.id !== alertId),\n }))\n }, [])\n\n const addSubmissionAlert = useCallback(() => {\n setAlertState(prev => ({\n nextAlertId: prev.nextAlertId + 1,\n alerts: [{ id: prev.nextAlertId }, ...prev.alerts],\n }))\n }, [])\n\n const informationRequestsMachineInstance = useMemo(\n () =>\n createMachine(\n 'list',\n informationRequestsMachine,\n (): InformationRequestsContextInterface => ({\n component: null,\n companyId,\n onEvent: handleEvent,\n }),\n ),\n [companyId],\n )\n const [current, send] = useMachine(informationRequestsMachineInstance)\n\n function handleEvent(type: EventType, data?: unknown) {\n send({ type, payload: data })\n\n if (type === informationRequestEvents.INFORMATION_REQUEST_RESPOND) {\n setIsModalOpen(true)\n }\n\n if (\n type === informationRequestEvents.INFORMATION_REQUEST_FORM_CANCEL ||\n type === informationRequestEvents.INFORMATION_REQUEST_FORM_DONE\n ) {\n setIsModalOpen(false)\n }\n\n if (type === informationRequestEvents.INFORMATION_REQUEST_FORM_DONE && withAlert) {\n addSubmissionAlert()\n }\n\n onEvent(type, data)\n }\n\n const handleCloseModal = () => {\n setIsModalOpen(false)\n }\n\n const CurrentComponent = current.context.component\n const Footer = CurrentComponent?.Footer || undefined\n\n return (\n <FlowContext.Provider\n value={{\n ...current.context,\n onEvent: handleEvent,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {withAlert &&\n alertState.alerts.map(alert => (\n <Alert\n key={alert.id}\n status=\"success\"\n label={t(`alerts.${ALERT_TYPE}.title`)}\n onDismiss={() => {\n handleDismissAlert(alert.id)\n }}\n >\n <Text>{t(`alerts.${ALERT_TYPE}.description`)}</Text>\n </Alert>\n ))}\n\n <Suspense fallback={<LoadingSpinner />}>\n <InformationRequestList\n companyId={companyId}\n filterByPayrollBlocking={filterByPayrollBlocking}\n onEvent={handleEvent}\n />\n </Suspense>\n <Modal\n isOpen={isModalOpen}\n onClose={handleCloseModal}\n footer={\n Footer && (\n <BaseBoundaries LoaderComponent={() => <LoadingSpinner size=\"sm\" />}>\n <Footer onEvent={handleEvent} />\n </BaseBoundaries>\n )\n }\n >\n {CurrentComponent && <CurrentComponent />}\n </Modal>\n </Flex>\n </FlowContext.Provider>\n )\n}\n"],"names":["ALERT_TYPE","InformationRequestsFlow","companyId","dictionary","filterByPayrollBlocking","withAlert","onEvent","useComponentDictionary","useI18n","t","useTranslation","Modal","LoadingSpinner","Alert","Text","useComponentContext","isModalOpen","setIsModalOpen","useState","alertState","setAlertState","handleDismissAlert","useCallback","alertId","prev","alert","addSubmissionAlert","informationRequestsMachineInstance","useMemo","createMachine","informationRequestsMachine","handleEvent","current","send","useMachine","type","data","informationRequestEvents","handleCloseModal","CurrentComponent","Footer","jsx","FlowContext","jsxs","Flex","Suspense","InformationRequestList","BaseBoundaries"],"mappings":";;;;;;;;;;;;;;;AAqCA,MAAMA,IAAa;AAEZ,SAASC,GAAwB;AAAA,EACtC,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,yBAAAC,IAA0B;AAAA,EAC1B,WAAAC,IAAY;AAAA,EACZ,SAAAC,IAAU,MAAM;AAAA,EAAC;AACnB,GAAiC;AAC/B,EAAAC,EAAuB,uBAAuBJ,CAAU,GACxDK,EAAQ,qBAAqB;AAC7B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAA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