@gusto/embedded-react-sdk 0.48.2 → 0.49.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 +60 -0
- package/README.md +8 -8
- package/dist/components/Base/Base.d.ts +11 -3
- package/dist/components/Base/Base.js.map +1 -1
- package/dist/components/Base/index.d.ts +1 -1
- package/dist/components/Common/DataView/DataTable/DataTable.js +21 -21
- package/dist/components/Common/DataView/DataTable/DataTable.js.map +1 -1
- package/dist/components/Common/Fields/NumberInputField/NumberInputField.js +16 -15
- package/dist/components/Common/Fields/NumberInputField/NumberInputField.js.map +1 -1
- package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.d.ts +1 -0
- package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.js.map +1 -1
- package/dist/components/Common/FlowBreadcrumbs/breadcrumbTransitionHelpers.js.map +1 -1
- package/dist/components/Common/PaginationControl/PaginationControl.js +9 -8
- package/dist/components/Common/PaginationControl/PaginationControl.js.map +1 -1
- package/dist/components/Common/TaxInputs/TaxInputs.js +104 -102
- package/dist/components/Common/TaxInputs/TaxInputs.js.map +1 -1
- package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js +1 -1
- package/dist/components/Common/UI/FileInput/FileInput.js +1 -1
- package/dist/components/Common/UI/Menu/MenuTypes.js.map +1 -1
- package/dist/components/Common/UI/Modal/Modal.module.scss.js +12 -12
- package/dist/components/Common/UI/NumberInput/NumberInput.d.ts +1 -1
- package/dist/components/Common/UI/NumberInput/NumberInput.js +87 -80
- package/dist/components/Common/UI/NumberInput/NumberInput.js.map +1 -1
- package/dist/components/Common/UI/NumberInput/NumberInputTypes.d.ts +4 -0
- package/dist/components/Common/UI/ProgressBar/ProgressBar.js +4 -4
- package/dist/components/Common/UI/Select/Select.js +28 -28
- package/dist/components/Common/UI/Select/Select.js.map +1 -1
- package/dist/components/Common/UI/Select/SelectTypes.d.ts +3 -2
- package/dist/components/Common/UI/Tabs/Tabs.js +9 -8
- package/dist/components/Common/UI/Tabs/Tabs.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatory.d.ts +34 -2
- package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.d.ts +1 -0
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.d.ts +1 -0
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.d.ts +25 -4
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.d.ts +2 -0
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/Schema.d.ts +1 -0
- package/dist/components/Company/AssignSignatory/CreateSignatory/Schema.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/index.d.ts +2 -2
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.d.ts +10 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +3 -5
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/Head.d.ts +1 -0
- package/dist/components/Company/AssignSignatory/Head.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.d.ts +1 -0
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.d.ts +27 -4
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.d.ts +3 -0
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/index.d.ts +2 -2
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.d.ts +6 -0
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +3 -5
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/SignatoryForm.d.ts +1 -0
- package/dist/components/Company/AssignSignatory/SignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/TitleSelect.d.ts +1 -1
- package/dist/components/Company/AssignSignatory/TitleSelect.js +9 -8
- package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
- package/dist/components/Company/AssignSignatory/index.d.ts +2 -5
- package/dist/components/Company/AssignSignatory/useAssignSignatory.d.ts +9 -0
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +5 -7
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccount.d.ts +27 -0
- package/dist/components/Company/BankAccount/BankAccount.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountComponents.d.ts +8 -0
- package/dist/components/Company/BankAccount/BankAccountComponents.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.d.ts +1 -0
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.d.ts +4 -3
- package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Form.d.ts +3 -0
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Head.d.ts +1 -0
- package/dist/components/Company/BankAccount/BankAccountForm/Head.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +3 -5
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountList/AccountView.d.ts +1 -0
- package/dist/components/Company/BankAccount/BankAccountList/AccountView.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountList/Actions.d.ts +1 -0
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountList/BankAccountList.d.ts +4 -3
- package/dist/components/Company/BankAccount/BankAccountList/BankAccountList.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountList/Head.d.ts +1 -0
- package/dist/components/Company/BankAccount/BankAccountList/Head.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.d.ts +1 -0
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/BankAccountVerify.d.ts +4 -3
- package/dist/components/Company/BankAccount/BankAccountVerify/BankAccountVerify.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.d.ts +3 -0
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Head.d.ts +1 -0
- package/dist/components/Company/BankAccount/BankAccountVerify/Head.js.map +1 -1
- package/dist/components/Company/BankAccount/stateMachine.d.ts +1 -0
- package/dist/components/Company/BankAccount/stateMachine.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.d.ts +1 -0
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.d.ts +34 -2
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/Head.d.ts +1 -0
- package/dist/components/Company/DocumentSigner/DocumentList/Head.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/List.d.ts +1 -0
- package/dist/components/Company/DocumentSigner/DocumentList/List.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/ManageSignatories.d.ts +1 -0
- package/dist/components/Company/DocumentSigner/DocumentList/ManageSignatories.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/index.d.ts +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +3 -5
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentSigner.d.ts +38 -0
- package/dist/components/Company/DocumentSigner/DocumentSigner.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.d.ts +32 -2
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Company/DocumentSigner/assignSignatoryState.d.ts +1 -0
- package/dist/components/Company/DocumentSigner/assignSignatoryState.js +4 -6
- package/dist/components/Company/DocumentSigner/assignSignatoryState.js.map +1 -1
- package/dist/components/Company/DocumentSigner/documentSignerStateMachine.d.ts +4 -0
- package/dist/components/Company/DocumentSigner/documentSignerStateMachine.js.map +1 -1
- package/dist/components/Company/DocumentSigner/index.d.ts +1 -1
- package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/fields.d.ts +41 -0
- package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/fields.js.map +1 -1
- package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/signCompanyFormSchema.d.ts +40 -10
- package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/signCompanyFormSchema.js.map +1 -1
- package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/useSignCompanyForm.d.ts +111 -0
- package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/useSignCompanyForm.js.map +1 -1
- package/dist/components/Company/DocumentSigner/stateMachine.d.ts +1 -0
- package/dist/components/Company/DocumentSigner/stateMachine.js +12 -18
- package/dist/components/Company/DocumentSigner/stateMachine.js.map +1 -1
- package/dist/components/Company/DocumentSigner/useDocumentSigner.d.ts +1 -0
- package/dist/components/Company/FederalTaxes/Actions.d.ts +1 -0
- package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Company/FederalTaxes/FederalTaxes.d.ts +26 -4
- package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Form.d.ts +1 -0
- package/dist/components/Company/FederalTaxes/Form.js +23 -21
- package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Head.d.ts +1 -0
- package/dist/components/Company/FederalTaxes/Head.js.map +1 -1
- package/dist/components/Company/FederalTaxes/index.d.ts +2 -0
- package/dist/components/Company/FederalTaxes/useFederalTaxes.d.ts +12 -5
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +8 -10
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Actions.d.ts +1 -0
- package/dist/components/Company/Industry/Actions.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +6 -8
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Industry/Edit.d.ts +3 -0
- package/dist/components/Company/Industry/Edit.js.map +1 -1
- package/dist/components/Company/Industry/Head.d.ts +1 -0
- package/dist/components/Company/Industry/Head.js.map +1 -1
- package/dist/components/Company/Industry/Industry.d.ts +23 -4
- package/dist/components/Company/Industry/Industry.js.map +1 -1
- package/dist/components/Company/Industry/IndustrySelect.d.ts +1 -0
- package/dist/components/Company/Industry/IndustrySelect.js.map +1 -1
- package/dist/components/Company/Industry/index.d.ts +1 -1
- package/dist/components/Company/Locations/LocationForm/Actions.d.ts +1 -0
- package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Form.d.ts +3 -0
- package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Head.d.ts +1 -0
- package/dist/components/Company/Locations/LocationForm/Head.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/LocationForm.d.ts +27 -4
- package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/index.d.ts +1 -0
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +3 -5
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/Locations.d.ts +27 -0
- package/dist/components/Company/Locations/Locations.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/Actions.d.ts +1 -0
- package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/Head.d.ts +1 -0
- package/dist/components/Company/Locations/LocationsList/Head.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/List.d.ts +1 -1
- package/dist/components/Company/Locations/LocationsList/List.js +20 -20
- package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/List.module.scss.js +1 -1
- package/dist/components/Company/Locations/LocationsList/LocationsList.d.ts +24 -2
- package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/index.d.ts +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +3 -5
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/Locations/locationsStateMachine.d.ts +4 -0
- package/dist/components/Company/Locations/locationsStateMachine.js.map +1 -1
- package/dist/components/Company/Locations/stateMachine.d.ts +1 -1
- package/dist/components/Company/Locations/stateMachine.js +4 -7
- package/dist/components/Company/Locations/stateMachine.js.map +1 -1
- package/dist/components/Company/OnboardingFlow/OnboardingFlow.d.ts +62 -0
- package/dist/components/Company/OnboardingFlow/OnboardingFlow.js.map +1 -1
- package/dist/components/Company/OnboardingFlow/OnboardingFlowComponents.d.ts +30 -1
- package/dist/components/Company/OnboardingFlow/OnboardingFlowComponents.js +30 -23
- package/dist/components/Company/OnboardingFlow/OnboardingFlowComponents.js.map +1 -1
- package/dist/components/Company/OnboardingFlow/onboardingStateMachine.d.ts +1 -0
- package/dist/components/Company/OnboardingFlow/onboardingStateMachine.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/Completed.d.ts +1 -0
- package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/MissingRequirements.d.ts +1 -0
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.d.ts +28 -4
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +3 -5
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/PaySchedule.d.ts +39 -5
- package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
- package/dist/components/Company/PaySchedule/PayScheduleComponents.d.ts +3 -0
- package/dist/components/Company/PaySchedule/PayScheduleComponents.js.map +1 -1
- package/dist/components/Company/PaySchedule/PayScheduleForm.d.ts +1 -0
- package/dist/components/Company/PaySchedule/PayScheduleForm.js +6 -4
- package/dist/components/Company/PaySchedule/PayScheduleForm.js.map +1 -1
- package/dist/components/Company/PaySchedule/PayScheduleList.d.ts +1 -0
- package/dist/components/Company/PaySchedule/PayScheduleList.js.map +1 -1
- package/dist/components/Company/PaySchedule/payScheduleStateMachine.d.ts +1 -0
- package/dist/components/Company/PaySchedule/payScheduleStateMachine.js +10 -14
- package/dist/components/Company/PaySchedule/payScheduleStateMachine.js.map +1 -1
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/fields.d.ts +136 -0
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/fields.js.map +1 -1
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/index.d.ts +2 -1
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/payScheduleSchema.d.ts +48 -26
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/payScheduleSchema.js.map +1 -1
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/usePayScheduleForm.d.ts +134 -0
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/usePayScheduleForm.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxes.d.ts +26 -0
- package/dist/components/Company/StateTaxes/StateTaxes.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesComponents.d.ts +6 -0
- package/dist/components/Company/StateTaxes/StateTaxesComponents.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.d.ts +1 -0
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/Form.d.ts +1 -3
- package/dist/components/Company/StateTaxes/StateTaxesForm/Form.js +30 -28
- package/dist/components/Company/StateTaxes/StateTaxesForm/Form.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/Head.d.ts +1 -0
- package/dist/components/Company/StateTaxes/StateTaxesForm/Head.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.d.ts +42 -4
- package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js +55 -54
- package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/applicableIf.d.ts +10 -0
- package/dist/components/Company/StateTaxes/StateTaxesForm/applicableIf.js +11 -0
- package/dist/components/Company/StateTaxes/StateTaxesForm/applicableIf.js.map +1 -0
- package/dist/components/Company/StateTaxes/StateTaxesForm/applicableIf.test.d.ts +1 -0
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +3 -5
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/index.d.ts +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/rhfKey.d.ts +2 -0
- package/dist/components/Company/StateTaxes/StateTaxesForm/rhfKey.js +2 -3
- package/dist/components/Company/StateTaxes/StateTaxesForm/rhfKey.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.d.ts +1 -0
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/Head.d.ts +1 -0
- package/dist/components/Company/StateTaxes/StateTaxesList/Head.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/List.d.ts +1 -0
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.d.ts +23 -2
- package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +3 -5
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/index.d.ts +1 -1
- package/dist/components/Company/StateTaxes/stateTaxesStateMachine.d.ts +1 -0
- package/dist/components/Company/StateTaxes/stateTaxesStateMachine.js +5 -7
- package/dist/components/Company/StateTaxes/stateTaxesStateMachine.js.map +1 -1
- package/dist/components/Company/exports/companyOnboarding.d.ts +18 -17
- package/dist/components/Company/exports/companyOnboarding.js +18 -16
- package/dist/components/Company/exports/companyOnboarding.js.map +1 -1
- package/dist/components/Company/index.d.ts +1 -17
- package/dist/components/Contractor/Address/Address.d.ts +48 -7
- package/dist/components/Contractor/Address/Address.js +83 -64
- package/dist/components/Contractor/Address/Address.js.map +1 -1
- package/dist/components/Contractor/Address/Address.module.scss.js +8 -0
- package/dist/components/Contractor/Address/Address.module.scss.js.map +1 -0
- package/dist/components/Contractor/Address/index.d.ts +2 -1
- package/dist/components/Contractor/Address/shared/useContractorAddressForm/contractorAddressSchema.d.ts +59 -0
- package/dist/components/Contractor/Address/shared/useContractorAddressForm/contractorAddressSchema.js +32 -0
- package/dist/components/Contractor/Address/shared/useContractorAddressForm/contractorAddressSchema.js.map +1 -0
- package/dist/components/Contractor/Address/shared/useContractorAddressForm/fields.d.ts +111 -0
- package/dist/components/Contractor/Address/shared/useContractorAddressForm/fields.js +26 -0
- package/dist/components/Contractor/Address/shared/useContractorAddressForm/fields.js.map +1 -0
- package/dist/components/Contractor/Address/shared/useContractorAddressForm/index.d.ts +6 -0
- package/dist/components/Contractor/Address/shared/useContractorAddressForm/useContractorAddressForm.d.ts +112 -0
- package/dist/components/Contractor/Address/shared/useContractorAddressForm/useContractorAddressForm.js +133 -0
- package/dist/components/Contractor/Address/shared/useContractorAddressForm/useContractorAddressForm.js.map +1 -0
- package/dist/components/Contractor/Address/types.d.ts +8 -0
- package/dist/components/Contractor/ContractorList/index.d.ts +25 -12
- package/dist/components/Contractor/ContractorList/index.js +1 -3
- package/dist/components/Contractor/ContractorList/index.js.map +1 -1
- package/dist/components/Contractor/ContractorList/useContractorList.d.ts +3 -5
- package/dist/components/Contractor/ContractorList/useContractorList.js.map +1 -1
- package/dist/components/Contractor/Documents/DocumentsList/DocumentsList.d.ts +29 -0
- package/dist/components/Contractor/Documents/DocumentsList/DocumentsList.js +71 -0
- package/dist/components/Contractor/Documents/DocumentsList/DocumentsList.js.map +1 -0
- package/dist/components/Contractor/Documents/DocumentsList/index.d.ts +3 -0
- package/dist/components/Contractor/Documents/DocumentsList/useContractorDocumentsList/index.d.ts +2 -0
- package/dist/components/Contractor/Documents/DocumentsList/useContractorDocumentsList/useContractorDocumentsList.d.ts +59 -0
- package/dist/components/Contractor/Documents/DocumentsList/useContractorDocumentsList/useContractorDocumentsList.js +20 -0
- package/dist/components/Contractor/Documents/DocumentsList/useContractorDocumentsList/useContractorDocumentsList.js.map +1 -0
- package/dist/components/Contractor/Landing/Landing.d.ts +19 -0
- package/dist/components/Contractor/Landing/Landing.js +73 -0
- package/dist/components/Contractor/Landing/Landing.js.map +1 -0
- package/dist/components/Contractor/Landing/index.d.ts +2 -0
- package/dist/components/Contractor/NewHireReport/NewHireReport.d.ts +34 -9
- package/dist/components/Contractor/NewHireReport/NewHireReport.js +7 -7
- package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
- package/dist/components/Contractor/NewHireReport/types.d.ts +7 -0
- package/dist/components/Contractor/OnboardingFlow/OnboardingFlow.d.ts +70 -0
- package/dist/components/Contractor/OnboardingFlow/OnboardingFlow.js.map +1 -1
- package/dist/components/Contractor/OnboardingFlow/OnboardingFlowComponents.d.ts +30 -4
- package/dist/components/Contractor/OnboardingFlow/OnboardingFlowComponents.js.map +1 -1
- package/dist/components/Contractor/OnboardingFlow/onboardingStateMachine.d.ts +1 -0
- package/dist/components/Contractor/OnboardingFlow/onboardingStateMachine.js.map +1 -1
- package/dist/components/Contractor/OnboardingSummary/OnboardingSummary.d.ts +23 -0
- package/dist/components/Contractor/OnboardingSummary/OnboardingSummary.js +36 -0
- package/dist/components/Contractor/OnboardingSummary/OnboardingSummary.js.map +1 -0
- package/dist/components/Contractor/OnboardingSummary/index.d.ts +2 -0
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.d.ts +1 -0
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.d.ts +33 -16
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.d.ts +1 -9
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +11 -15
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/types.d.ts +7 -0
- package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.d.ts +50 -3
- package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js +1 -2
- package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.d.ts +1 -0
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +59 -53
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentFormSchema.d.ts +4 -18
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentFormSchema.js +0 -1
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentFormSchema.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.d.ts +1 -0
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +70 -91
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.d.ts +1 -0
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/GenericBlocker.d.ts +1 -0
- package/dist/components/Contractor/Payments/CreatePayment/GenericBlocker.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.d.ts +1 -0
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +62 -56
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/helpers.d.ts +1 -0
- package/dist/components/Contractor/Payments/CreatePayment/helpers.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlow.d.ts +49 -0
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlow.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.d.ts +14 -1
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.d.ts +2 -0
- package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistory.d.ts +37 -3
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistory.js +1 -2
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistory.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.d.ts +1 -0
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js +54 -51
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatement.d.ts +15 -3
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatement.js +1 -2
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatement.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.d.ts +1 -0
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js +20 -22
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummary.d.ts +33 -2
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummary.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.d.ts +1 -0
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js +109 -102
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentSummary/index.d.ts +1 -2
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.d.ts +28 -3
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js +1 -2
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.d.ts +1 -0
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +86 -65
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/types.d.ts +8 -4
- package/dist/components/Contractor/Profile/BusinessSelfOnboardingProfile.d.ts +8 -0
- package/dist/components/Contractor/Profile/BusinessSelfOnboardingProfile.js +79 -0
- package/dist/components/Contractor/Profile/BusinessSelfOnboardingProfile.js.map +1 -0
- package/dist/components/Contractor/Profile/ContractorProfile.d.ts +74 -8
- package/dist/components/Contractor/Profile/ContractorProfile.js +205 -35
- package/dist/components/Contractor/Profile/ContractorProfile.js.map +1 -1
- package/dist/components/Contractor/Profile/ContractorProfile.module.scss.js +8 -0
- package/dist/components/Contractor/Profile/ContractorProfile.module.scss.js.map +1 -0
- package/dist/components/Contractor/Profile/IndividualSelfOnboardingProfile.d.ts +8 -0
- package/dist/components/Contractor/Profile/IndividualSelfOnboardingProfile.js +96 -0
- package/dist/components/Contractor/Profile/IndividualSelfOnboardingProfile.js.map +1 -0
- package/dist/components/Contractor/Profile/SelfOnboardingContractorProfile.d.ts +22 -0
- package/dist/components/Contractor/Profile/SelfOnboardingContractorProfile.js +40 -0
- package/dist/components/Contractor/Profile/SelfOnboardingContractorProfile.js.map +1 -0
- package/dist/components/Contractor/Profile/index.d.ts +1 -2
- package/dist/components/Contractor/Profile/shared/index.d.ts +2 -0
- package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/contractorDetailsSchema.d.ts +125 -0
- package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/contractorDetailsSchema.js +73 -0
- package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/contractorDetailsSchema.js.map +1 -0
- package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/contractorDetailsSchema.test.d.ts +1 -0
- package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/fields.d.ts +312 -0
- package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/fields.js +87 -0
- package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/fields.js.map +1 -0
- package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/index.d.ts +6 -0
- package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/useContractorDetailsForm.d.ts +151 -0
- package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/useContractorDetailsForm.js +188 -0
- package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/useContractorDetailsForm.js.map +1 -0
- package/dist/components/Contractor/Submit/Submit.d.ts +24 -4
- package/dist/components/Contractor/Submit/Submit.js +1 -2
- package/dist/components/Contractor/Submit/Submit.js.map +1 -1
- package/dist/components/Contractor/Submit/SubmitDone.d.ts +1 -0
- package/dist/components/Contractor/Submit/SubmitDone.js.map +1 -1
- package/dist/components/Contractor/exports/contractorManagement.d.ts +6 -6
- package/dist/components/Contractor/exports/contractorOnboarding.d.ts +12 -4
- package/dist/components/Contractor/exports/contractorOnboarding.js +14 -8
- package/dist/components/Contractor/exports/contractorOnboarding.js.map +1 -1
- package/dist/components/Employee/Compensation/management/Compensation.d.ts +4 -7
- package/dist/components/Employee/Compensation/management/Compensation.js +1 -5
- package/dist/components/Employee/Compensation/management/Compensation.js.map +1 -1
- package/dist/components/Employee/Compensation/management/CompensationAddAnotherJobForm/CompensationAddAnotherJobForm.d.ts +1 -0
- package/dist/components/Employee/Compensation/management/CompensationAddAnotherJobForm/CompensationAddAnotherJobForm.js.map +1 -1
- package/dist/components/Employee/Compensation/management/CompensationAddJobForm/CompensationAddJobForm.d.ts +1 -0
- package/dist/components/Employee/Compensation/management/CompensationAddJobForm/CompensationAddJobForm.js.map +1 -1
- package/dist/components/Employee/Compensation/management/CompensationCard/CompensationCard.d.ts +1 -0
- package/dist/components/Employee/Compensation/management/CompensationCard/CompensationCard.js.map +1 -1
- package/dist/components/Employee/Compensation/management/CompensationEditForm/CompensationEditForm.d.ts +1 -0
- package/dist/components/Employee/Compensation/management/CompensationEditForm/CompensationEditForm.js.map +1 -1
- package/dist/components/Employee/Compensation/management/ManagementCompensationFormBody.js +13 -10
- package/dist/components/Employee/Compensation/management/ManagementCompensationFormBody.js.map +1 -1
- package/dist/components/Employee/Compensation/management/compensationStateMachine.js +23 -31
- package/dist/components/Employee/Compensation/management/compensationStateMachine.js.map +1 -1
- package/dist/components/Employee/Compensation/onboarding/Compensation.d.ts +1 -0
- package/dist/components/Employee/Compensation/onboarding/Compensation.js.map +1 -1
- package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.d.ts +1 -0
- package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.js.map +1 -1
- package/dist/components/Employee/Compensation/onboarding/JobsList/JobsList.d.ts +3 -3
- package/dist/components/Employee/Compensation/onboarding/JobsList/JobsList.js.map +1 -1
- package/dist/components/Employee/Compensation/onboarding/compensationStateMachine.js +20 -28
- package/dist/components/Employee/Compensation/onboarding/compensationStateMachine.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/AddCompensationFormBody.js +13 -10
- package/dist/components/Employee/Compensation/shared/AddCompensationFormBody.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.d.ts +29 -61
- package/dist/components/Employee/Compensation/shared/useCompensationForm/fields.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useJobForm/jobSchema.d.ts +19 -23
- package/dist/components/Employee/Compensation/shared/useJobForm/jobSchema.js +5 -0
- package/dist/components/Employee/Compensation/shared/useJobForm/jobSchema.js.map +1 -1
- package/dist/components/Employee/Dashboard/Dashboard.d.ts +29 -4
- package/dist/components/Employee/Dashboard/Dashboard.js +1 -4
- package/dist/components/Employee/Dashboard/Dashboard.js.map +1 -1
- package/dist/components/Employee/Dashboard/DashboardFlow.d.ts +20 -14
- package/dist/components/Employee/Dashboard/DashboardFlow.js.map +1 -1
- package/dist/components/Employee/Dashboard/dashboardStateMachine.js +78 -108
- package/dist/components/Employee/Dashboard/dashboardStateMachine.js.map +1 -1
- package/dist/components/Employee/Deductions/management/Deductions.d.ts +4 -7
- package/dist/components/Employee/Deductions/management/Deductions.js +1 -5
- package/dist/components/Employee/Deductions/management/Deductions.js.map +1 -1
- package/dist/components/Employee/Deductions/management/DeductionsCard/DeductionsCard.d.ts +1 -0
- package/dist/components/Employee/Deductions/management/DeductionsCard/DeductionsCard.js.map +1 -1
- package/dist/components/Employee/Deductions/management/DeductionsEditForm/DeductionsEditForm.d.ts +4 -3
- package/dist/components/Employee/Deductions/management/DeductionsEditForm/DeductionsEditForm.js +1 -4
- package/dist/components/Employee/Deductions/management/DeductionsEditForm/DeductionsEditForm.js.map +1 -1
- package/dist/components/Employee/Deductions/management/deductionsStateMachine.js +17 -23
- package/dist/components/Employee/Deductions/management/deductionsStateMachine.js.map +1 -1
- package/dist/components/Employee/Deductions/onboarding/Deductions.d.ts +2 -3
- package/dist/components/Employee/Deductions/onboarding/Deductions.js +21 -26
- package/dist/components/Employee/Deductions/onboarding/Deductions.js.map +1 -1
- package/dist/components/Employee/Deductions/onboarding/DeductionsList/DeductionsList.js +55 -50
- package/dist/components/Employee/Deductions/onboarding/DeductionsList/DeductionsList.js.map +1 -1
- package/dist/components/Employee/Deductions/onboarding/deductionsContextualComponents.d.ts +0 -4
- package/dist/components/Employee/Deductions/onboarding/deductionsContextualComponents.js +33 -43
- package/dist/components/Employee/Deductions/onboarding/deductionsContextualComponents.js.map +1 -1
- package/dist/components/Employee/Deductions/onboarding/stateMachine.d.ts +0 -1
- package/dist/components/Employee/Deductions/onboarding/stateMachine.js +51 -85
- package/dist/components/Employee/Deductions/onboarding/stateMachine.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/DeductionsForm/ChildSupportFormView.js +40 -37
- package/dist/components/Employee/Deductions/shared/DeductionsForm/ChildSupportFormView.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/DeductionsForm/DeductionsForm.js +64 -61
- package/dist/components/Employee/Deductions/shared/DeductionsForm/DeductionsForm.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/childSupportGarnishmentFormSchema.d.ts +1 -18
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/useChildSupportGarnishmentForm.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/useDeductionForm/deductionFormSchema.d.ts +2 -25
- package/dist/components/Employee/Deductions/shared/useDeductionForm/useDeductionForm.js.map +1 -1
- package/dist/components/Employee/Documents/management/DocumentManager.d.ts +19 -4
- package/dist/components/Employee/Documents/management/DocumentManager.js +4 -1
- package/dist/components/Employee/Documents/management/DocumentManager.js.map +1 -1
- package/dist/components/Employee/Documents/management/Documents.d.ts +4 -7
- package/dist/components/Employee/Documents/management/Documents.js +1 -5
- package/dist/components/Employee/Documents/management/Documents.js.map +1 -1
- package/dist/components/Employee/Documents/management/documentsStateMachine.js +5 -7
- package/dist/components/Employee/Documents/management/documentsStateMachine.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/DocumentList.d.ts +2 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js +3 -5
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentSigner.d.ts +8 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentSigner.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibility.d.ts +1 -0
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibility.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/I9SignatureForm/I9SignatureForm.d.ts +3 -2
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/I9SignatureForm/I9SignatureForm.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/EmployeeDocuments/EmployeeDocuments.d.ts +1 -4
- package/dist/components/Employee/Documents/onboarding/EmployeeDocuments/EmployeeDocuments.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/EmployeeDocuments/EmployeeDocumentsPresentation.d.ts +1 -4
- package/dist/components/Employee/Documents/shared/SignatureForm/SignatureForm.d.ts +3 -2
- package/dist/components/Employee/Documents/shared/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Employee/Documents/shared/useSignEmployeeForm/signEmployeeFormSchema.d.ts +2 -48
- package/dist/components/Employee/Documents/shared/useSignEmployeeForm/useSignEmployeeForm.d.ts +22 -14
- package/dist/components/Employee/Documents/shared/useSignEmployeeForm/useSignEmployeeForm.js.map +1 -1
- package/dist/components/Employee/EmployeeList/management/ManagementEmployeeList.d.ts +5 -8
- package/dist/components/Employee/EmployeeList/management/ManagementEmployeeList.js.map +1 -1
- package/dist/components/Employee/EmployeeList/onboarding/EmployeeList.d.ts +18 -3
- package/dist/components/Employee/EmployeeList/onboarding/EmployeeList.js +21 -18
- package/dist/components/Employee/EmployeeList/onboarding/EmployeeList.js.map +1 -1
- package/dist/components/Employee/EmployeeList/onboarding/EmployeeListView.d.ts +2 -1
- package/dist/components/Employee/EmployeeList/onboarding/EmployeeListView.js +47 -46
- package/dist/components/Employee/EmployeeList/onboarding/EmployeeListView.js.map +1 -1
- package/dist/components/Employee/EmployeeList/shared/useEmployeeList.js.map +1 -1
- package/dist/components/Employee/EmployeeListFlow/EmployeeListFlow.d.ts +8 -2
- package/dist/components/Employee/EmployeeListFlow/EmployeeListFlow.js.map +1 -1
- package/dist/components/Employee/EmployeeListFlow/EmployeeListFlowComponents.d.ts +1 -1
- package/dist/components/Employee/EmployeeListFlow/EmployeeListFlowComponents.js.map +1 -1
- package/dist/components/Employee/EmployeeListFlow/employeeListStateMachine.js +5 -7
- package/dist/components/Employee/EmployeeListFlow/employeeListStateMachine.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/management/FederalTaxes.d.ts +4 -7
- package/dist/components/Employee/FederalTaxes/management/FederalTaxes.js +1 -5
- package/dist/components/Employee/FederalTaxes/management/FederalTaxes.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/management/FederalTaxesEditForm.d.ts +4 -5
- package/dist/components/Employee/FederalTaxes/management/FederalTaxesEditForm.js +1 -4
- package/dist/components/Employee/FederalTaxes/management/FederalTaxesEditForm.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/management/federalTaxesStateMachine.js +14 -20
- package/dist/components/Employee/FederalTaxes/management/federalTaxesStateMachine.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/onboarding/FederalTaxes.d.ts +4 -3
- package/dist/components/Employee/FederalTaxes/onboarding/FederalTaxes.js +1 -4
- package/dist/components/Employee/FederalTaxes/onboarding/FederalTaxes.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/shared/FederalTaxesView.js +1 -1
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/federalTaxesSchema.d.ts +3 -20
- package/dist/components/Employee/HomeAddress/management/HomeAddress.d.ts +7 -11
- package/dist/components/Employee/HomeAddress/management/HomeAddress.js +1 -5
- package/dist/components/Employee/HomeAddress/management/HomeAddress.js.map +1 -1
- package/dist/components/Employee/HomeAddress/management/HomeAddressCard/HomeAddressCard.d.ts +1 -0
- package/dist/components/Employee/HomeAddress/management/HomeAddressCard/HomeAddressCard.js.map +1 -1
- package/dist/components/Employee/HomeAddress/management/HomeAddressEditForm.d.ts +7 -9
- package/dist/components/Employee/HomeAddress/management/HomeAddressEditForm.js +1 -4
- package/dist/components/Employee/HomeAddress/management/HomeAddressEditForm.js.map +1 -1
- package/dist/components/Employee/HomeAddress/management/HomeAddressView.js +2 -0
- package/dist/components/Employee/HomeAddress/management/HomeAddressView.js.map +1 -1
- package/dist/components/Employee/HomeAddress/management/homeAddressStateMachine.js +8 -12
- package/dist/components/Employee/HomeAddress/management/homeAddressStateMachine.js.map +1 -1
- package/dist/components/Employee/HomeAddress/management/useHomeAddressManagement.js.map +1 -1
- package/dist/components/Employee/Landing/Landing.d.ts +10 -4
- package/dist/components/Employee/Landing/Landing.js.map +1 -1
- package/dist/components/Employee/OnboardingExecutionFlow/OnboardingExecutionFlow.d.ts +19 -5
- package/dist/components/Employee/OnboardingExecutionFlow/OnboardingExecutionFlow.js.map +1 -1
- package/dist/components/Employee/OnboardingExecutionFlow/OnboardingExecutionFlowComponents.d.ts +1 -0
- package/dist/components/Employee/OnboardingExecutionFlow/OnboardingExecutionFlowComponents.js.map +1 -1
- package/dist/components/Employee/OnboardingExecutionFlow/onboardingExecutionStateMachine.js.map +1 -1
- package/dist/components/Employee/OnboardingFlow/OnboardingFlow.d.ts +32 -12
- package/dist/components/Employee/OnboardingFlow/OnboardingFlow.js +19 -17
- package/dist/components/Employee/OnboardingFlow/OnboardingFlow.js.map +1 -1
- package/dist/components/Employee/OnboardingFlow/OnboardingFlowComponents.js +23 -16
- package/dist/components/Employee/OnboardingFlow/OnboardingFlowComponents.js.map +1 -1
- package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.js +11 -15
- package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.js.map +1 -1
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.d.ts +10 -4
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/management/PaymentMethod.d.ts +3 -7
- package/dist/components/Employee/PaymentMethod/management/PaymentMethod.js +1 -5
- package/dist/components/Employee/PaymentMethod/management/PaymentMethod.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/management/PaymentMethodBankForm.d.ts +1 -0
- package/dist/components/Employee/PaymentMethod/management/PaymentMethodBankForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/management/PaymentMethodCard.d.ts +1 -0
- package/dist/components/Employee/PaymentMethod/management/PaymentMethodCard.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/management/PaymentMethodComponents.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/management/PaymentMethodSplitForm.d.ts +1 -0
- package/dist/components/Employee/PaymentMethod/management/PaymentMethodSplitForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/management/paymentMethodStateMachine.js +15 -21
- package/dist/components/Employee/PaymentMethod/management/paymentMethodStateMachine.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethod.d.ts +4 -7
- package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethod.js +1 -5
- package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethod.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/onboarding/paymentMethodStateMachine.js +24 -36
- package/dist/components/Employee/PaymentMethod/onboarding/paymentMethodStateMachine.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankFormSchema.d.ts +3 -15
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/usePaymentMethodFormSchema.d.ts +3 -12
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/splitFieldFactory.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/useSplitPaymentsFormSchema.d.ts +2 -11
- package/dist/components/Employee/Profile/management/Profile.d.ts +5 -8
- package/dist/components/Employee/Profile/management/Profile.js +1 -5
- package/dist/components/Employee/Profile/management/Profile.js.map +1 -1
- package/dist/components/Employee/Profile/management/ProfileCard/ProfileCard.d.ts +1 -0
- package/dist/components/Employee/Profile/management/ProfileCard/ProfileCard.js.map +1 -1
- package/dist/components/Employee/Profile/management/ProfileEditForm.d.ts +5 -6
- package/dist/components/Employee/Profile/management/ProfileEditForm.js +1 -4
- package/dist/components/Employee/Profile/management/ProfileEditForm.js.map +1 -1
- package/dist/components/Employee/Profile/management/profileStateMachine.js +14 -20
- package/dist/components/Employee/Profile/management/profileStateMachine.js.map +1 -1
- package/dist/components/Employee/Profile/onboarding/AdminProfile.js +55 -54
- package/dist/components/Employee/Profile/onboarding/AdminProfile.js.map +1 -1
- package/dist/components/Employee/Profile/onboarding/AdminProfile.module.scss.js +3 -5
- package/dist/components/Employee/Profile/onboarding/AdminProfile.module.scss.js.map +1 -1
- package/dist/components/Employee/Profile/onboarding/Profile.d.ts +11 -12
- package/dist/components/Employee/Profile/onboarding/Profile.js +1 -5
- package/dist/components/Employee/Profile/onboarding/Profile.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/employeeDetailsSchema.d.ts +3 -22
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/fields.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/homeAddressSchema.d.ts +3 -17
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/workAddressSchema.d.ts +3 -10
- package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingComponents.d.ts +1 -1
- package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingComponents.js.map +1 -1
- package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingFlow.d.ts +19 -5
- package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingFlow.js.map +1 -1
- package/dist/components/Employee/SelfOnboardingFlow/selfOnboardingMachine.js +12 -18
- package/dist/components/Employee/SelfOnboardingFlow/selfOnboardingMachine.js.map +1 -1
- package/dist/components/Employee/StateTaxes/management/StateTaxes.d.ts +4 -9
- package/dist/components/Employee/StateTaxes/management/StateTaxes.js +1 -5
- package/dist/components/Employee/StateTaxes/management/StateTaxes.js.map +1 -1
- package/dist/components/Employee/StateTaxes/management/StateTaxesCard/StateTaxesCard.d.ts +1 -0
- package/dist/components/Employee/StateTaxes/management/StateTaxesCard/StateTaxesCard.js.map +1 -1
- package/dist/components/Employee/StateTaxes/management/StateTaxesEditForm.d.ts +5 -8
- package/dist/components/Employee/StateTaxes/management/StateTaxesEditForm.js +1 -4
- package/dist/components/Employee/StateTaxes/management/StateTaxesEditForm.js.map +1 -1
- package/dist/components/Employee/StateTaxes/management/stateTaxesStateMachine.js +14 -20
- package/dist/components/Employee/StateTaxes/management/stateTaxesStateMachine.js.map +1 -1
- package/dist/components/Employee/StateTaxes/onboarding/StateTaxes.d.ts +5 -8
- package/dist/components/Employee/StateTaxes/onboarding/StateTaxes.js +1 -4
- package/dist/components/Employee/StateTaxes/onboarding/StateTaxes.js.map +1 -1
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fieldComponents.js +29 -29
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fieldComponents.js.map +1 -1
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fieldProps.d.ts +1 -1
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/useEmployeeStateTaxesForm.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.d.ts +1 -0
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlow.d.ts +16 -5
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlow.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.d.ts +1 -1
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.js +5 -7
- package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummary.d.ts +1 -0
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummary.js.map +1 -1
- package/dist/components/Employee/WorkAddress/management/WorkAddress.d.ts +7 -11
- package/dist/components/Employee/WorkAddress/management/WorkAddress.js +1 -5
- package/dist/components/Employee/WorkAddress/management/WorkAddress.js.map +1 -1
- package/dist/components/Employee/WorkAddress/management/WorkAddressCard/WorkAddressCard.d.ts +1 -0
- package/dist/components/Employee/WorkAddress/management/WorkAddressCard/WorkAddressCard.js.map +1 -1
- package/dist/components/Employee/WorkAddress/management/WorkAddressEditForm.d.ts +7 -9
- package/dist/components/Employee/WorkAddress/management/WorkAddressEditForm.js +1 -4
- package/dist/components/Employee/WorkAddress/management/WorkAddressEditForm.js.map +1 -1
- package/dist/components/Employee/WorkAddress/management/WorkAddressView.js +97 -95
- package/dist/components/Employee/WorkAddress/management/WorkAddressView.js.map +1 -1
- package/dist/components/Employee/WorkAddress/management/useWorkAddressManagement.js.map +1 -1
- package/dist/components/Employee/WorkAddress/management/workAddressStateMachine.js +8 -12
- package/dist/components/Employee/WorkAddress/management/workAddressStateMachine.js.map +1 -1
- package/dist/components/Employee/WorkAddress/shared/useEmployeeWorkAddressSummary/useEmployeeWorkAddressSummary.js.map +1 -1
- package/dist/components/Employee/exports/employeeOnboarding.d.ts +3 -3
- package/dist/components/Flow/Flow.js +1 -1
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.d.ts +1 -0
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.d.ts +1 -0
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequests.d.ts +26 -1
- package/dist/components/InformationRequests/InformationRequests.js.map +1 -1
- package/dist/components/InformationRequests/informationRequestsStateMachine.js +10 -14
- package/dist/components/InformationRequests/informationRequestsStateMachine.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.d.ts +3 -4
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js +2 -11
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.d.ts +0 -1
- package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.js +1 -0
- package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.js +11 -17
- package/dist/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/types.d.ts +1 -3
- package/dist/components/Payroll/Dismissal/DismissalFlow.d.ts +25 -1
- package/dist/components/Payroll/Dismissal/DismissalFlow.js.map +1 -1
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.d.ts +1 -0
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.js.map +1 -1
- package/dist/components/Payroll/OffCycle/OffCycleFlow.d.ts +18 -4
- package/dist/components/Payroll/OffCycle/OffCycleFlow.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.d.ts +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js.map +1 -1
- package/dist/components/Payroll/OffCycleDeductionsSetting/OffCycleDeductionsSetting.d.ts +1 -0
- package/dist/components/Payroll/OffCycleDeductionsSetting/OffCycleDeductionsSetting.js.map +1 -1
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelection.d.ts +1 -0
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelection.js.map +1 -1
- package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js +21 -20
- package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.d.ts +2 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.d.ts +2 -2
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.d.ts +2 -18
- package/dist/components/Payroll/PayrollExecutionFlow/PayrollExecutionFlow.d.ts +28 -3
- package/dist/components/Payroll/PayrollExecutionFlow/PayrollExecutionFlow.js.map +1 -1
- package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.js +38 -46
- package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/PayrollExecutionFlowContextual.js +25 -24
- package/dist/components/Payroll/PayrollFlow/PayrollExecutionFlowContextual.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/PayrollFlow.d.ts +13 -3
- package/dist/components/Payroll/PayrollFlow/PayrollFlow.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.d.ts +2 -2
- package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js +34 -44
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.d.ts +1 -0
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.js.map +1 -1
- package/dist/components/Payroll/PayrollLanding/PayrollLanding.d.ts +12 -2
- package/dist/components/Payroll/PayrollLanding/PayrollLanding.js.map +1 -1
- package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.js +8 -10
- package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollList.d.ts +2 -1
- package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.d.ts +1 -0
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +149 -136
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.d.ts +3 -3
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +167 -167
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +42 -39
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCases.d.ts +2 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCases.js +5 -9
- package/dist/components/Payroll/RecoveryCases/RecoveryCases.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.d.ts +0 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.d.ts +0 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/recoveryCasesStateMachine.js +10 -14
- package/dist/components/Payroll/RecoveryCases/recoveryCasesStateMachine.js.map +1 -1
- package/dist/components/Payroll/Transition/TransitionFlow.d.ts +27 -1
- package/dist/components/Payroll/Transition/TransitionFlow.js.map +1 -1
- package/dist/components/Payroll/TransitionCreation/TransitionCreation.d.ts +1 -1
- package/dist/components/Payroll/TransitionCreation/TransitionCreation.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.js +8 -10
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/components/TimeOff/AddEmployeesHoliday/AddEmployeesHoliday.d.ts +2 -2
- package/dist/components/TimeOff/AddEmployeesHoliday/AddEmployeesHoliday.js.map +1 -1
- package/dist/components/TimeOff/AddEmployeesToPolicy/AddEmployeesToPolicy.d.ts +2 -1
- package/dist/components/TimeOff/AddEmployeesToPolicy/AddEmployeesToPolicy.js.map +1 -1
- package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetail.d.ts +1 -1
- package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetail.js.map +1 -1
- package/dist/components/TimeOff/HolidaySelectionForm/HolidaySelectionForm.d.ts +2 -2
- package/dist/components/TimeOff/HolidaySelectionForm/HolidaySelectionForm.js.map +1 -1
- package/dist/components/TimeOff/PolicyList/PolicyList.d.ts +1 -1
- package/dist/components/TimeOff/PolicyList/PolicyList.js.map +1 -1
- package/dist/components/TimeOff/PolicySettings/PolicySettings.d.ts +2 -1
- package/dist/components/TimeOff/PolicySettings/PolicySettings.js.map +1 -1
- package/dist/components/TimeOff/PolicyTypeSelector/PolicyTypeSelector.d.ts +1 -0
- package/dist/components/TimeOff/PolicyTypeSelector/PolicyTypeSelector.js.map +1 -1
- package/dist/components/TimeOff/TimeOffFlow/TimeOffFlow.d.ts +28 -1
- package/dist/components/TimeOff/TimeOffFlow/TimeOffFlow.js.map +1 -1
- package/dist/components/TimeOff/TimeOffFlow/TimeOffFlowComponents.d.ts +1 -1
- package/dist/components/TimeOff/TimeOffFlow/TimeOffFlowComponents.js.map +1 -1
- package/dist/components/TimeOff/TimeOffFlow/timeOffPolicyTypes.d.ts +1 -2
- package/dist/components/TimeOff/TimeOffFlow/timeOffStateMachine.js +128 -174
- package/dist/components/TimeOff/TimeOffFlow/timeOffStateMachine.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.d.ts +1 -0
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js +9 -7
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js.map +1 -1
- package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetail.d.ts +2 -1
- package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetail.js.map +1 -1
- package/dist/components/TimeOff/ViewHolidayEmployees/ViewHolidayEmployees.d.ts +2 -1
- package/dist/components/TimeOff/ViewHolidayEmployees/ViewHolidayEmployees.js.map +1 -1
- package/dist/components/TimeOff/ViewHolidayPolicyDetails/ViewHolidayPolicyDetails.d.ts +2 -2
- package/dist/components/TimeOff/ViewHolidayPolicyDetails/ViewHolidayPolicyDetails.js.map +1 -1
- package/dist/components/TimeOff/ViewHolidaySchedule/ViewHolidaySchedule.d.ts +2 -2
- package/dist/components/TimeOff/ViewHolidaySchedule/ViewHolidaySchedule.js.map +1 -1
- package/dist/components/index.d.ts +9 -0
- package/dist/contexts/ThemeProvider/types.d.ts +19 -0
- package/dist/i18n/I18n.js +5 -2
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Company.AssignSignatory.json.js +1 -1
- package/dist/i18n/en/Company.FederalTaxes.json.js +27 -23
- package/dist/i18n/en/Company.FederalTaxes.json.js.map +1 -1
- package/dist/i18n/en/Company.PaySchedule.json.js +1 -1
- package/dist/i18n/en/Contractor.Address.json.js +13 -13
- package/dist/i18n/en/Contractor.DocumentsList.json.js +28 -0
- package/dist/i18n/en/Contractor.DocumentsList.json.js.map +1 -0
- package/dist/i18n/en/Contractor.Landing.json.js +18 -0
- package/dist/i18n/en/Contractor.Landing.json.js.map +1 -0
- package/dist/i18n/en/Contractor.NewHireReport.json.js +12 -10
- package/dist/i18n/en/Contractor.NewHireReport.json.js.map +1 -1
- package/dist/i18n/en/Contractor.OnboardingSummary.json.js +12 -0
- package/dist/i18n/en/Contractor.OnboardingSummary.json.js.map +1 -0
- package/dist/i18n/en/Contractor.Payments.CreatePayment.json.js +13 -13
- package/dist/i18n/en/Contractor.Payments.PaymentHistory.json.js +10 -6
- package/dist/i18n/en/Contractor.Payments.PaymentHistory.json.js.map +1 -1
- package/dist/i18n/en/Contractor.Profile.json.js +8 -6
- package/dist/i18n/en/Contractor.Profile.json.js.map +1 -1
- package/dist/i18n/en/Employee.Compensation.json.js +56 -50
- package/dist/i18n/en/Employee.Compensation.json.js.map +1 -1
- package/dist/i18n/en/Employee.DeductionsForm.json.js +8 -8
- package/dist/i18n/en/Employee.EmploymentEligibility.json.js +1 -1
- package/dist/i18n/en/Employee.Management.Compensation.json.js +48 -42
- package/dist/i18n/en/Employee.Management.Compensation.json.js.map +1 -1
- package/dist/i18n/en/Employee.Management.HomeAddress.json.js +1 -1
- package/dist/i18n/en/Payroll.OffCycleTaxWithholding.json.js +1 -1
- package/dist/i18n/en/Payroll.PayrollOverview.json.js +40 -38
- package/dist/i18n/en/Payroll.PayrollOverview.json.js.map +1 -1
- package/dist/i18n/en/common.json.d.ts +1 -0
- package/dist/i18n/en/common.json.js +34 -32
- package/dist/i18n/en/common.json.js.map +1 -1
- package/dist/index.d.ts +19 -3
- package/dist/index.js +246 -204
- package/dist/index.js.map +1 -1
- package/dist/models/external.d.ts +293 -0
- package/dist/partner-hook-utils/form/FormFieldsMetadataContext.js +3 -3
- package/dist/partner-hook-utils/form/buildFormSchema.d.ts +41 -5
- package/dist/partner-hook-utils/form/buildFormSchema.js +41 -40
- package/dist/partner-hook-utils/form/buildFormSchema.js.map +1 -1
- package/dist/partner-hook-utils/form/composeSubmitHandler.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/SelectHookField.d.ts +5 -2
- package/dist/partner-hook-utils/form/fields/SelectHookField.js.map +1 -1
- package/dist/shared/constants.d.ts +10 -5
- package/dist/shared/constants.js +9 -7
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/Helpers.d.ts +19 -2
- package/dist/types/i18next.d.ts +66 -5
- package/docs/{reference → appendix}/endpoint-inventory.json +38 -4
- package/package.json +25 -26
- package/dist/components/Contractor/Address/Actions.d.ts +0 -1
- package/dist/components/Contractor/Address/Actions.js +0 -13
- package/dist/components/Contractor/Address/Actions.js.map +0 -1
- package/dist/components/Contractor/Address/Form.d.ts +0 -1
- package/dist/components/Contractor/Address/Form.js +0 -51
- package/dist/components/Contractor/Address/Form.js.map +0 -1
- package/dist/components/Contractor/Address/Head.d.ts +0 -1
- package/dist/components/Contractor/Address/Head.js +0 -17
- package/dist/components/Contractor/Address/Head.js.map +0 -1
- package/dist/components/Contractor/Address/useAddress.d.ts +0 -21
- package/dist/components/Contractor/Address/useAddress.js +0 -32
- package/dist/components/Contractor/Address/useAddress.js.map +0 -1
- package/dist/components/Contractor/Profile/ContractorProfileForm.d.ts +0 -7
- package/dist/components/Contractor/Profile/ContractorProfileForm.js +0 -143
- package/dist/components/Contractor/Profile/ContractorProfileForm.js.map +0 -1
- package/dist/components/Contractor/Profile/useContractorProfile.d.ts +0 -191
- package/dist/components/Contractor/Profile/useContractorProfile.js +0 -235
- package/dist/components/Contractor/Profile/useContractorProfile.js.map +0 -1
- package/dist/components/Contractor/index.d.ts +0 -14
- package/dist/components/Employee/Deductions/onboarding/IncludeDeductions/IncludeDeductions.d.ts +0 -8
- package/dist/components/Employee/Deductions/onboarding/IncludeDeductions/IncludeDeductions.js +0 -44
- package/dist/components/Employee/Deductions/onboarding/IncludeDeductions/IncludeDeductions.js.map +0 -1
- package/dist/components/Employee/Deductions/onboarding/IncludeDeductions/IncludeDeductions.module.scss.js +0 -12
- package/dist/components/Employee/Deductions/onboarding/IncludeDeductions/IncludeDeductions.module.scss.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkAddressView.js","sources":["../../../../../src/components/Employee/WorkAddress/management/WorkAddressView.tsx"],"sourcesContent":["import { useLayoutEffect, useMemo, useRef, useState } from 'react'\nimport { Trans, useTranslation } from 'react-i18next'\nimport type { Location } from '@gusto/embedded-api-v-2025-11-15/models/components/location'\nimport type { EmployeeWorkAddress } from '@gusto/embedded-api-v-2025-11-15/models/components/employeeworkaddress'\nimport {\n formatPendingWorkAddressLine,\n getPendingFutureWorkAddress,\n} from './getPendingFutureWorkAddress'\nimport ListIcon from '@/assets/icons/list.svg?react'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport TrashCanSvg from '@/assets/icons/trashcan.svg?react'\nimport {\n ActionsLayout,\n DataView,\n EmptyData,\n Grid,\n HamburgerMenu,\n useDataView,\n} from '@/components/Common'\nimport { Flex, FlexItem } from '@/components/Common/Flex/Flex'\nimport {\n LocationField,\n EffectiveDateField,\n} from '@/components/Employee/Profile/shared/useWorkAddressForm/fields'\nimport { WorkAddressErrorCodes } from '@/components/Employee/Profile/shared/useWorkAddressForm/workAddressSchema'\nimport type { UseWorkAddressFormReady } from '@/components/Employee/Profile/shared/useWorkAddressForm'\nimport { SDKFormProvider } from '@/partner-hook-utils/form/SDKFormProvider'\nimport type { HookSubmitResult } from '@/partner-hook-utils/types'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { addDays, formatDateLongWithYear, normalizeToDate } from '@/helpers/dateFormatting'\nimport { getCityStateZip, getStreet } from '@/helpers/formattedStrings'\n\n/** @internal */\nexport interface WorkAddressViewProps {\n editWorkAddressForm: UseWorkAddressFormReady\n changeWorkAddressForm: UseWorkAddressFormReady\n /** Full list for history table, pending-future alert, and delete-confirmation lookup. */\n workAddresses: EmployeeWorkAddress[] | undefined\n editTargetUuid: string | undefined\n onEditTargetUuidChange: (uuid: string | undefined) => void\n employeeDisplayName: string\n onConfirmDelete: (workAddressUuid: string) => Promise<boolean>\n onWorkAddressSaved: (result: HookSubmitResult<EmployeeWorkAddress>) => void\n onBack: () => void\n isDeletePending?: boolean\n}\n\nfunction resolveLocation(\n row: EmployeeWorkAddress,\n companyLocations: Location[] | undefined,\n): Location | undefined {\n if (!row.locationUuid || !companyLocations?.length) {\n return undefined\n }\n return companyLocations.find(loc => loc.uuid === row.locationUuid)\n}\n\nfunction formatWorkAddressLines(\n row: EmployeeWorkAddress,\n companyLocations: Location[] | undefined,\n): { primary: string; secondary: string } {\n const location = resolveLocation(row, companyLocations)\n if (location) {\n const street = getStreet(location).trim()\n const locality = getCityStateZip(location).trim()\n return { primary: street, secondary: locality }\n }\n const street = getStreet(row).trim()\n const locality = getCityStateZip(row).trim()\n return { primary: street, secondary: locality }\n}\n\n/** @internal */\nexport function WorkAddressView({\n editWorkAddressForm,\n changeWorkAddressForm,\n workAddresses,\n editTargetUuid,\n onEditTargetUuidChange,\n employeeDisplayName,\n onConfirmDelete,\n onWorkAddressSaved,\n onBack,\n isDeletePending = false,\n}: WorkAddressViewProps) {\n const { t } = useTranslation('Employee.Management.WorkAddress')\n const Components = useComponentContext()\n const [addressModal, setAddressModal] = useState<'edit' | 'create' | null>(null)\n const [deleteConfirmUuid, setDeleteConfirmUuid] = useState<string | null>(null)\n const addressModalContainerRef = useRef<HTMLDivElement>(null)\n const [addressModalPortal, setAddressModalPortal] = useState<HTMLElement | undefined>(undefined)\n\n useLayoutEffect(() => {\n if (!addressModal) {\n setAddressModalPortal(undefined)\n return\n }\n const syncPortal = () => {\n setAddressModalPortal(addressModalContainerRef.current ?? undefined)\n }\n syncPortal()\n if (addressModalContainerRef.current == null) {\n const id = requestAnimationFrame(syncPortal)\n return () => {\n cancelAnimationFrame(id)\n }\n }\n }, [addressModal])\n\n const {\n data: { workAddress, companyLocations },\n status: editStatus,\n form: { Fields: editFormFields },\n } = editWorkAddressForm\n\n const editShowsEffectiveDateField = editFormFields.EffectiveDate != null\n\n const { status: createStatus } = changeWorkAddressForm\n\n const locationValidation = {\n [WorkAddressErrorCodes.REQUIRED]: t('form.locationRequired'),\n }\n\n const startDateValidation = {\n [WorkAddressErrorCodes.REQUIRED]: t('form.startDateRequired'),\n }\n\n const pendingFutureAddress = useMemo(\n () => getPendingFutureWorkAddress(workAddresses),\n [workAddresses],\n )\n\n const addressForDeleteModal = useMemo(() => {\n if (!deleteConfirmUuid || !workAddresses) {\n return undefined\n }\n return workAddresses.find(a => a.uuid === deleteConfirmUuid)\n }, [deleteConfirmUuid, workAddresses])\n\n const changePendingPossessiveLabel = useMemo(() => {\n const trimmed = employeeDisplayName.trim()\n return trimmed ? `${trimmed}'s` : t('changePendingPossessiveFallback')\n }, [employeeDisplayName, t])\n\n const chronologicalAsc = useMemo(() => {\n return [...(workAddresses ?? [])].sort((a, b) => {\n const aDate = a.effectiveDate ?? ''\n const bDate = b.effectiveDate ?? ''\n if (!aDate && !bDate) return 0\n if (!aDate) return 1\n if (!bDate) return -1\n return aDate.localeCompare(bDate)\n })\n }, [workAddresses])\n\n const historyAddresses = useMemo(\n () => chronologicalAsc.filter(address => address.active !== true),\n [chronologicalAsc],\n )\n\n const sortedHistory = useMemo(() => [...historyAddresses].reverse(), [historyAddresses])\n\n const historyEndDate = (row: EmployeeWorkAddress) => {\n const idx = chronologicalAsc.findIndex(a => a.uuid === row.uuid)\n if (idx === -1 || idx >= chronologicalAsc.length - 1) return '—'\n const nextStart = chronologicalAsc[idx + 1]?.effectiveDate\n if (!nextStart) return '—'\n const nextDate = normalizeToDate(nextStart)\n if (!nextDate) return '—'\n const endDate = addDays(nextDate, -1)\n const y = endDate.getFullYear()\n const m = String(endDate.getMonth() + 1).padStart(2, '0')\n const d = String(endDate.getDate()).padStart(2, '0')\n return formatDateLongWithYear(`${y}-${m}-${d}`)\n }\n\n const historyDataView = useDataView({\n data: sortedHistory,\n columns: [\n {\n title: t('columns.location'),\n render: (row: EmployeeWorkAddress) => {\n const lines = formatWorkAddressLines(row, companyLocations)\n return (\n <Flex flexDirection=\"column\" gap={0}>\n <Components.Text weight=\"medium\">{lines.primary}</Components.Text>\n <Components.Text variant=\"supporting\">{lines.secondary}</Components.Text>\n </Flex>\n )\n },\n },\n {\n title: t('columns.startDate'),\n render: (row: EmployeeWorkAddress) =>\n row.effectiveDate ? formatDateLongWithYear(row.effectiveDate) : '—',\n },\n {\n title: t('columns.endDate'),\n render: (row: EmployeeWorkAddress) => historyEndDate(row),\n },\n ],\n itemMenu: (row: EmployeeWorkAddress) => (\n <HamburgerMenu\n triggerLabel={t('rowMenuAriaLabel')}\n items={[\n {\n label: t('rowEdit'),\n onClick: () => {\n onEditTargetUuidChange(row.uuid)\n setAddressModal('edit')\n },\n icon: <PencilSvg aria-hidden />,\n },\n {\n label: t('rowDelete'),\n onClick: () => {\n if (row.active === true) {\n return\n }\n setDeleteConfirmUuid(row.uuid)\n },\n icon: <TrashCanSvg aria-hidden />,\n },\n ]}\n />\n ),\n emptyState: () => (\n <div data-testid=\"work-address-history-empty\">\n <EmptyData\n icon={<ListIcon aria-hidden />}\n title={t('historyEmptyTitle')}\n description={t('historyEmptyDescription')}\n />\n </div>\n ),\n })\n\n const closeAddressModal = () => {\n setAddressModal(null)\n onEditTargetUuidChange(undefined)\n }\n\n const handleDeleteModalConfirm = async () => {\n if (!deleteConfirmUuid) {\n return\n }\n const deleted = await onConfirmDelete(deleteConfirmUuid)\n if (deleted) {\n setDeleteConfirmUuid(null)\n }\n }\n\n const handleSave = async () => {\n if (!addressModal) {\n return\n }\n\n if (addressModal === 'edit') {\n const result = await editWorkAddressForm.actions.onSubmit(\n undefined,\n editShowsEffectiveDateField ? undefined : { effectiveDate: workAddress?.effectiveDate },\n )\n if (result) {\n onWorkAddressSaved(result)\n closeAddressModal()\n }\n return\n }\n\n const result = await changeWorkAddressForm.actions.onSubmit()\n if (result) {\n onWorkAddressSaved(result)\n closeAddressModal()\n }\n }\n\n const modalPending = addressModal === 'edit' ? editStatus.isPending : createStatus.isPending\n\n const currentLines = workAddress ? formatWorkAddressLines(workAddress, companyLocations) : null\n const currentLocation =\n workAddress && companyLocations ? resolveLocation(workAddress, companyLocations) : undefined\n\n return (\n <Flex flexDirection=\"column\" gap={24}>\n <Flex flexDirection=\"column\" gap={4} alignItems=\"flex-start\">\n <Components.Heading as=\"h1\" styledAs=\"h2\">\n {t('title')}\n </Components.Heading>\n <Components.Text variant=\"supporting\">{t('description')}</Components.Text>\n </Flex>\n\n <Components.Box\n header={\n <Components.BoxHeader\n title={t('currentSectionTitle')}\n action={\n workAddress ? (\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n onEditTargetUuidChange(undefined)\n setAddressModal('edit')\n }}\n isLoading={editStatus.isPending}\n >\n {t('editCta')}\n </Components.Button>\n ) : undefined\n }\n />\n }\n footer={\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n onEditTargetUuidChange(undefined)\n setAddressModal('create')\n }}\n isLoading={createStatus.isPending}\n >\n {t('changeCta')}\n </Components.Button>\n }\n >\n <Flex flexDirection=\"column\" gap={16}>\n {workAddress && currentLines ? (\n <Flex flexDirection=\"column\" gap={4}>\n <FlexItem>\n {currentLocation ? (\n <>\n <Components.Text weight=\"medium\">\n {getStreet(currentLocation).trim()}\n </Components.Text>\n <Components.Text weight=\"medium\">\n {getCityStateZip(currentLocation)}\n </Components.Text>\n </>\n ) : (\n <>\n <Components.Text weight=\"medium\">{currentLines.primary}</Components.Text>\n <Components.Text weight=\"medium\">{currentLines.secondary}</Components.Text>\n </>\n )}\n </FlexItem>\n {workAddress.effectiveDate ? (\n <Components.Text variant=\"supporting\">\n {t('currentSince', {\n date: formatDateLongWithYear(workAddress.effectiveDate),\n })}\n </Components.Text>\n ) : null}\n </Flex>\n ) : (\n <Components.Text>{t('currentEmpty')}</Components.Text>\n )}\n {pendingFutureAddress ? (\n <Components.Alert status=\"warning\" label={t('changePendingTitle')}>\n <Components.Text variant=\"supporting\">\n {t('changePendingDescription', {\n possessiveLabel: changePendingPossessiveLabel,\n newAddress: formatPendingWorkAddressLine(pendingFutureAddress, companyLocations),\n effectiveDate: pendingFutureAddress.effectiveDate\n ? formatDateLongWithYear(pendingFutureAddress.effectiveDate)\n : '—',\n // Values are inserted into JSX text, so the browser already\n // escapes them. Telling i18next to escape too produces\n // double-encoded entities like `'` showing as text.\n interpolation: { escapeValue: false },\n })}\n </Components.Text>\n </Components.Alert>\n ) : null}\n </Flex>\n </Components.Box>\n\n <Flex flexDirection=\"column\" gap={12}>\n <Components.Heading as=\"h2\" styledAs=\"h4\">\n {t('historySectionTitle')}\n </Components.Heading>\n <DataView label={t('historySectionTitle')} {...historyDataView} />\n </Flex>\n\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={onBack}>\n {t('backCta')}\n </Components.Button>\n </ActionsLayout>\n\n <Components.Modal\n isOpen={addressModal !== null}\n onClose={closeAddressModal}\n shouldCloseOnBackdropClick={false}\n containerRef={addressModalContainerRef}\n footer={\n <Flex flexDirection=\"row\" gap={12} justifyContent=\"flex-end\">\n <Components.Button variant=\"secondary\" onClick={closeAddressModal}>\n {t('cancelCta')}\n </Components.Button>\n <Components.Button\n variant=\"primary\"\n onClick={() => {\n void handleSave()\n }}\n isLoading={modalPending}\n >\n {t('submitCta')}\n </Components.Button>\n </Flex>\n }\n >\n <Flex flexDirection=\"column\" gap={16}>\n <Components.Heading as=\"h2\">\n {addressModal === 'edit' ? t('editModalTitle') : t('changeModalTitle')}\n </Components.Heading>\n <Components.Text variant=\"supporting\">\n {addressModal === 'edit' ? t('editModalDescription') : t('changeModalDescription')}\n </Components.Text>\n {addressModal === 'edit' && editShowsEffectiveDateField ? (\n <Components.Alert status=\"warning\" label={t('editPastAddressAlertTitle')} />\n ) : null}\n {addressModal === 'edit' ? (\n <SDKFormProvider formHookResult={editWorkAddressForm}>\n <Grid\n gridTemplateColumns={{\n base: '1fr',\n small: '1fr',\n }}\n gap={20}\n >\n <LocationField\n label={\n editShowsEffectiveDateField\n ? t('form.editInactiveLocationLabel')\n : t('form.editLocationLabel')\n }\n description={t('form.editLocationDescription')}\n validationMessages={locationValidation}\n portalContainer={addressModalPortal}\n />\n {editShowsEffectiveDateField ? (\n <EffectiveDateField\n label={t('form.startDateLabel')}\n description={t('form.editInactiveStartDateDescription')}\n validationMessages={startDateValidation}\n portalContainer={addressModalPortal}\n />\n ) : null}\n </Grid>\n </SDKFormProvider>\n ) : null}\n {addressModal === 'create' ? (\n <SDKFormProvider formHookResult={changeWorkAddressForm}>\n <Grid\n gridTemplateColumns={{\n base: '1fr',\n small: '1fr',\n }}\n gap={20}\n >\n <LocationField\n label={t('form.newWorkAddressLabel')}\n description={t('form.newWorkAddressDescription')}\n validationMessages={locationValidation}\n portalContainer={addressModalPortal}\n />\n <EffectiveDateField\n label={t('form.startDateLabel')}\n description={t('form.startDateDescription')}\n validationMessages={startDateValidation}\n portalContainer={addressModalPortal}\n />\n </Grid>\n </SDKFormProvider>\n ) : null}\n </Flex>\n </Components.Modal>\n\n <Components.Modal\n isOpen={deleteConfirmUuid !== null}\n onClose={() => {\n setDeleteConfirmUuid(null)\n }}\n shouldCloseOnBackdropClick={false}\n footer={\n <Flex flexDirection=\"row\" gap={12} justifyContent=\"flex-end\">\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n setDeleteConfirmUuid(null)\n }}\n >\n {t('cancelCta')}\n </Components.Button>\n <Components.Button\n variant=\"error\"\n onClick={() => {\n void handleDeleteModalConfirm()\n }}\n isLoading={isDeletePending && deleteConfirmUuid !== null}\n >\n {t('deleteModalConfirmCta')}\n </Components.Button>\n </Flex>\n }\n >\n <Flex flexDirection=\"column\" gap={16}>\n <Components.Heading as=\"h2\">{t('deleteModalTitle')}</Components.Heading>\n <Components.Text variant=\"supporting\">\n {addressForDeleteModal ? (\n <Trans\n t={t}\n i18nKey=\"deleteModalDescription\"\n values={{\n address: formatPendingWorkAddressLine(addressForDeleteModal, companyLocations),\n }}\n components={{\n strong: <Components.Text weight=\"medium\" as=\"span\" />,\n }}\n />\n ) : null}\n </Components.Text>\n </Flex>\n </Components.Modal>\n </Flex>\n )\n}\n"],"names":["resolveLocation","row","companyLocations","loc","formatWorkAddressLines","location","street","getStreet","locality","getCityStateZip","WorkAddressView","editWorkAddressForm","changeWorkAddressForm","workAddresses","editTargetUuid","onEditTargetUuidChange","employeeDisplayName","onConfirmDelete","onWorkAddressSaved","onBack","isDeletePending","useTranslation","Components","useComponentContext","addressModal","setAddressModal","useState","deleteConfirmUuid","setDeleteConfirmUuid","addressModalContainerRef","useRef","addressModalPortal","setAddressModalPortal","useLayoutEffect","syncPortal","id","workAddress","editStatus","editFormFields","editShowsEffectiveDateField","createStatus","locationValidation","WorkAddressErrorCodes","startDateValidation","pendingFutureAddress","useMemo","getPendingFutureWorkAddress","addressForDeleteModal","a","changePendingPossessiveLabel","trimmed","chronologicalAsc","b","aDate","bDate","historyAddresses","address","sortedHistory","historyEndDate","idx","nextStart","nextDate","normalizeToDate","endDate","addDays","y","m","d","formatDateLongWithYear","historyDataView","useDataView","lines","jsxs","Flex","jsx","HamburgerMenu","PencilSvg","TrashCanSvg","EmptyData","ListIcon","closeAddressModal","handleDeleteModalConfirm","handleSave","result","modalPending","currentLines","currentLocation","FlexItem","Fragment","formatPendingWorkAddressLine","DataView","ActionsLayout","SDKFormProvider","Grid","LocationField","EffectiveDateField","Trans"],"mappings":";;;;;;;;;;;;;;;;;;;;AA+CA,SAASA,EACPC,GACAC,GACsB;AACtB,MAAI,GAACD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ACA,WAAW7D,MAAmBO,MAAsB;AAAA,cAEnD,YAAE,uBAAuB;AAAA,YAAA;AAAA,UAAA;AAAA,QAC5B,GACF;AAAA,QAGF,UAAA,gBAAA6C,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,UAAA,gBAAAC,EAACpD,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAA,EAAE,kBAAkB,GAAE;AAAA,4BAClDA,EAAW,MAAX,EAAgB,SAAQ,cACtB,UAAAyB,IACC,gBAAA2B;AAAA,YAACsB;AAAA,YAAA;AAAA,cACC;AAAA,cACA,SAAQ;AAAA,cACR,QAAQ;AAAA,gBACN,SAASP,EAA6B1C,GAAuB7C,CAAgB;AAAA,cAAA;AAAA,cAE/E,YAAY;AAAA,gBACV,0BAASoB,EAAW,MAAX,EAAgB,QAAO,UAAS,IAAG,OAAA,CAAO;AAAA,cAAA;AAAA,YACrD;AAAA,UAAA,IAEA,KAAA,CACN;AAAA,QAAA,EAAA,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EACF,GACF;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"WorkAddressView.js","sources":["../../../../../src/components/Employee/WorkAddress/management/WorkAddressView.tsx"],"sourcesContent":["import { useLayoutEffect, useMemo, useRef, useState } from 'react'\nimport { Trans, useTranslation } from 'react-i18next'\nimport type { Location } from '@gusto/embedded-api-v-2025-11-15/models/components/location'\nimport type { EmployeeWorkAddress } from '@gusto/embedded-api-v-2025-11-15/models/components/employeeworkaddress'\nimport {\n formatPendingWorkAddressLine,\n getPendingFutureWorkAddress,\n} from './getPendingFutureWorkAddress'\nimport ListIcon from '@/assets/icons/list.svg?react'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport TrashCanSvg from '@/assets/icons/trashcan.svg?react'\nimport {\n ActionsLayout,\n DataView,\n EmptyData,\n Grid,\n HamburgerMenu,\n useDataView,\n} from '@/components/Common'\nimport { Flex, FlexItem } from '@/components/Common/Flex/Flex'\nimport {\n LocationField,\n EffectiveDateField,\n} from '@/components/Employee/Profile/shared/useWorkAddressForm/fields'\nimport { WorkAddressErrorCodes } from '@/components/Employee/Profile/shared/useWorkAddressForm/workAddressSchema'\nimport type { UseWorkAddressFormReady } from '@/components/Employee/Profile/shared/useWorkAddressForm'\nimport { SDKFormProvider } from '@/partner-hook-utils/form/SDKFormProvider'\nimport type { HookSubmitResult } from '@/partner-hook-utils/types'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { addDays, formatDateLongWithYear, normalizeToDate } from '@/helpers/dateFormatting'\nimport { getCityStateZip, getStreet } from '@/helpers/formattedStrings'\n\n/** @internal */\nexport interface WorkAddressViewProps {\n editWorkAddressForm: UseWorkAddressFormReady\n changeWorkAddressForm: UseWorkAddressFormReady\n /** Full list for history table, pending-future alert, and delete-confirmation lookup. */\n workAddresses: EmployeeWorkAddress[] | undefined\n editTargetUuid: string | undefined\n onEditTargetUuidChange: (uuid: string | undefined) => void\n employeeDisplayName: string\n onConfirmDelete: (workAddressUuid: string) => Promise<boolean>\n onWorkAddressSaved: (result: HookSubmitResult<EmployeeWorkAddress>) => void\n onBack: () => void\n isDeletePending?: boolean\n}\n\nfunction resolveLocation(\n row: EmployeeWorkAddress,\n companyLocations: Location[] | undefined,\n): Location | undefined {\n if (!row.locationUuid || !companyLocations?.length) {\n return undefined\n }\n return companyLocations.find(loc => loc.uuid === row.locationUuid)\n}\n\nfunction formatWorkAddressLines(\n row: EmployeeWorkAddress,\n companyLocations: Location[] | undefined,\n): { primary: string; secondary: string } {\n const location = resolveLocation(row, companyLocations)\n if (location) {\n const street = getStreet(location).trim()\n const locality = getCityStateZip(location).trim()\n return { primary: street, secondary: locality }\n }\n const street = getStreet(row).trim()\n const locality = getCityStateZip(row).trim()\n return { primary: street, secondary: locality }\n}\n\n/** @internal */\nexport function WorkAddressView({\n editWorkAddressForm,\n changeWorkAddressForm,\n workAddresses,\n editTargetUuid,\n onEditTargetUuidChange,\n employeeDisplayName,\n onConfirmDelete,\n onWorkAddressSaved,\n onBack,\n isDeletePending = false,\n}: WorkAddressViewProps) {\n const { t } = useTranslation('Employee.Management.WorkAddress')\n const Components = useComponentContext()\n const [addressModal, setAddressModal] = useState<'edit' | 'create' | null>(null)\n const [deleteConfirmUuid, setDeleteConfirmUuid] = useState<string | null>(null)\n const addressModalContainerRef = useRef<HTMLDivElement>(null)\n const [addressModalPortal, setAddressModalPortal] = useState<HTMLElement | undefined>(undefined)\n\n useLayoutEffect(() => {\n if (!addressModal) {\n setAddressModalPortal(undefined)\n return\n }\n const syncPortal = () => {\n setAddressModalPortal(addressModalContainerRef.current ?? undefined)\n }\n syncPortal()\n if (addressModalContainerRef.current == null) {\n const id = requestAnimationFrame(syncPortal)\n return () => {\n cancelAnimationFrame(id)\n }\n }\n }, [addressModal])\n\n const {\n data: { workAddress, companyLocations },\n status: editStatus,\n form: { Fields: editFormFields },\n } = editWorkAddressForm\n\n const editShowsEffectiveDateField = editFormFields.EffectiveDate != null\n\n const { status: createStatus } = changeWorkAddressForm\n\n const locationValidation = {\n [WorkAddressErrorCodes.REQUIRED]: t('form.locationRequired'),\n }\n\n const startDateValidation = {\n [WorkAddressErrorCodes.REQUIRED]: t('form.startDateRequired'),\n }\n\n const pendingFutureAddress = useMemo(\n () => getPendingFutureWorkAddress(workAddresses),\n [workAddresses],\n )\n\n const addressForDeleteModal = useMemo(() => {\n if (!deleteConfirmUuid || !workAddresses) {\n return undefined\n }\n return workAddresses.find(a => a.uuid === deleteConfirmUuid)\n }, [deleteConfirmUuid, workAddresses])\n\n const changePendingPossessiveLabel = useMemo(() => {\n const trimmed = employeeDisplayName.trim()\n return trimmed ? `${trimmed}'s` : t('changePendingPossessiveFallback')\n }, [employeeDisplayName, t])\n\n const chronologicalAsc = useMemo(() => {\n return [...(workAddresses ?? [])].sort((a, b) => {\n const aDate = a.effectiveDate ?? ''\n const bDate = b.effectiveDate ?? ''\n if (!aDate && !bDate) return 0\n if (!aDate) return 1\n if (!bDate) return -1\n return aDate.localeCompare(bDate)\n })\n }, [workAddresses])\n\n const historyAddresses = useMemo(\n () => chronologicalAsc.filter(address => address.active !== true),\n [chronologicalAsc],\n )\n\n const sortedHistory = useMemo(() => [...historyAddresses].reverse(), [historyAddresses])\n\n const historyEndDate = (row: EmployeeWorkAddress) => {\n const idx = chronologicalAsc.findIndex(a => a.uuid === row.uuid)\n if (idx === -1 || idx >= chronologicalAsc.length - 1) return '—'\n const nextStart = chronologicalAsc[idx + 1]?.effectiveDate\n if (!nextStart) return '—'\n const nextDate = normalizeToDate(nextStart)\n if (!nextDate) return '—'\n const endDate = addDays(nextDate, -1)\n const y = endDate.getFullYear()\n const m = String(endDate.getMonth() + 1).padStart(2, '0')\n const d = String(endDate.getDate()).padStart(2, '0')\n return formatDateLongWithYear(`${y}-${m}-${d}`)\n }\n\n const historyDataView = useDataView({\n data: sortedHistory,\n columns: [\n {\n title: t('columns.location'),\n render: (row: EmployeeWorkAddress) => {\n const lines = formatWorkAddressLines(row, companyLocations)\n return (\n <Flex flexDirection=\"column\" gap={0}>\n <Components.Text weight=\"medium\">{lines.primary}</Components.Text>\n <Components.Text variant=\"supporting\">{lines.secondary}</Components.Text>\n </Flex>\n )\n },\n },\n {\n title: t('columns.startDate'),\n render: (row: EmployeeWorkAddress) =>\n row.effectiveDate ? formatDateLongWithYear(row.effectiveDate) : '—',\n },\n {\n title: t('columns.endDate'),\n render: (row: EmployeeWorkAddress) => historyEndDate(row),\n },\n ],\n itemMenu: (row: EmployeeWorkAddress) => (\n <HamburgerMenu\n triggerLabel={t('rowMenuAriaLabel')}\n items={[\n {\n label: t('rowEdit'),\n onClick: () => {\n onEditTargetUuidChange(row.uuid)\n setAddressModal('edit')\n },\n icon: <PencilSvg aria-hidden />,\n },\n {\n label: t('rowDelete'),\n onClick: () => {\n if (row.active === true) {\n return\n }\n setDeleteConfirmUuid(row.uuid)\n },\n icon: <TrashCanSvg aria-hidden />,\n },\n ]}\n />\n ),\n emptyState: () => (\n <div data-testid=\"work-address-history-empty\">\n <EmptyData\n icon={<ListIcon aria-hidden />}\n title={t('historyEmptyTitle')}\n description={t('historyEmptyDescription')}\n />\n </div>\n ),\n })\n\n const closeAddressModal = () => {\n setAddressModal(null)\n onEditTargetUuidChange(undefined)\n }\n\n const handleDeleteModalConfirm = async () => {\n if (!deleteConfirmUuid) {\n return\n }\n const deleted = await onConfirmDelete(deleteConfirmUuid)\n if (deleted) {\n setDeleteConfirmUuid(null)\n }\n }\n\n const handleSave = async () => {\n if (!addressModal) {\n return\n }\n\n if (addressModal === 'edit') {\n const result = await editWorkAddressForm.actions.onSubmit(\n undefined,\n editShowsEffectiveDateField ? undefined : { effectiveDate: workAddress?.effectiveDate },\n )\n if (result) {\n onWorkAddressSaved(result)\n closeAddressModal()\n }\n return\n }\n\n const result = await changeWorkAddressForm.actions.onSubmit()\n if (result) {\n onWorkAddressSaved(result)\n closeAddressModal()\n }\n }\n\n const modalPending = addressModal === 'edit' ? editStatus.isPending : createStatus.isPending\n\n const currentLines = workAddress ? formatWorkAddressLines(workAddress, companyLocations) : null\n const currentLocation =\n workAddress && companyLocations ? resolveLocation(workAddress, companyLocations) : undefined\n\n return (\n <Flex flexDirection=\"column\" gap={24}>\n <Flex flexDirection=\"column\" gap={4} alignItems=\"flex-start\">\n <Components.Heading as=\"h1\" styledAs=\"h2\">\n {t('title')}\n </Components.Heading>\n <Components.Text variant=\"supporting\">{t('description')}</Components.Text>\n </Flex>\n\n <Components.Box\n header={\n <Components.BoxHeader\n title={t('currentSectionTitle')}\n action={\n workAddress ? (\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n onEditTargetUuidChange(undefined)\n setAddressModal('edit')\n }}\n isLoading={editStatus.isPending}\n >\n {t('editCta')}\n </Components.Button>\n ) : undefined\n }\n />\n }\n footer={\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n onEditTargetUuidChange(undefined)\n setAddressModal('create')\n }}\n isLoading={createStatus.isPending}\n >\n {t('changeCta')}\n </Components.Button>\n }\n >\n <Flex flexDirection=\"column\" gap={16}>\n {workAddress && currentLines ? (\n <Flex flexDirection=\"column\" gap={4}>\n <FlexItem>\n {currentLocation ? (\n <>\n <Components.Text weight=\"medium\">\n {getStreet(currentLocation).trim()}\n </Components.Text>\n <Components.Text weight=\"medium\">\n {getCityStateZip(currentLocation)}\n </Components.Text>\n </>\n ) : (\n <>\n <Components.Text weight=\"medium\">{currentLines.primary}</Components.Text>\n <Components.Text weight=\"medium\">{currentLines.secondary}</Components.Text>\n </>\n )}\n </FlexItem>\n {workAddress.effectiveDate ? (\n <Components.Text variant=\"supporting\">\n {t('currentSince', {\n date: formatDateLongWithYear(workAddress.effectiveDate),\n })}\n </Components.Text>\n ) : null}\n </Flex>\n ) : (\n <Components.Text>{t('currentEmpty')}</Components.Text>\n )}\n {pendingFutureAddress ? (\n <Components.Alert status=\"warning\" label={t('changePendingTitle')}>\n <Components.Text variant=\"supporting\">\n {t('changePendingDescription', {\n possessiveLabel: changePendingPossessiveLabel,\n newAddress: formatPendingWorkAddressLine(pendingFutureAddress, companyLocations),\n effectiveDate: pendingFutureAddress.effectiveDate\n ? formatDateLongWithYear(pendingFutureAddress.effectiveDate)\n : '—',\n // Values are inserted into JSX text, so the browser already\n // escapes them. Telling i18next to escape too produces\n // double-encoded entities like `'` showing as text.\n interpolation: { escapeValue: false },\n })}\n </Components.Text>\n </Components.Alert>\n ) : null}\n </Flex>\n </Components.Box>\n\n <Flex flexDirection=\"column\" gap={12}>\n <Components.Heading as=\"h2\" styledAs=\"h4\">\n {t('historySectionTitle')}\n </Components.Heading>\n <DataView label={t('historySectionTitle')} {...historyDataView} />\n </Flex>\n\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={onBack}>\n {t('backCta')}\n </Components.Button>\n </ActionsLayout>\n\n <Components.Modal\n isOpen={addressModal !== null}\n onClose={closeAddressModal}\n shouldCloseOnBackdropClick={false}\n containerRef={addressModalContainerRef}\n footer={\n <Flex flexDirection=\"row\" gap={12} justifyContent=\"flex-end\">\n <Components.Button variant=\"secondary\" onClick={closeAddressModal}>\n {t('cancelCta')}\n </Components.Button>\n <Components.Button\n variant=\"primary\"\n onClick={() => {\n void handleSave()\n }}\n isLoading={modalPending}\n >\n {t('submitCta')}\n </Components.Button>\n </Flex>\n }\n >\n <Flex flexDirection=\"column\" gap={16}>\n <Components.Heading as=\"h2\">\n {addressModal === 'edit' ? t('editModalTitle') : t('changeModalTitle')}\n </Components.Heading>\n <Components.Text variant=\"supporting\">\n {addressModal === 'edit' ? t('editModalDescription') : t('changeModalDescription')}\n </Components.Text>\n {addressModal === 'edit' && editShowsEffectiveDateField ? (\n <Components.Alert status=\"warning\" label={t('editPastAddressAlertTitle')} />\n ) : null}\n {addressModal === 'edit' ? (\n <SDKFormProvider formHookResult={editWorkAddressForm}>\n <Grid\n gridTemplateColumns={{\n base: '1fr',\n small: '1fr',\n }}\n gap={20}\n >\n <LocationField\n label={\n editShowsEffectiveDateField\n ? t('form.editInactiveLocationLabel')\n : t('form.editLocationLabel')\n }\n description={t('form.editLocationDescription')}\n placeholder={t('form.selectPlaceholder')}\n validationMessages={locationValidation}\n portalContainer={addressModalPortal}\n />\n {editShowsEffectiveDateField ? (\n <EffectiveDateField\n label={t('form.startDateLabel')}\n description={t('form.editInactiveStartDateDescription')}\n validationMessages={startDateValidation}\n portalContainer={addressModalPortal}\n />\n ) : null}\n </Grid>\n </SDKFormProvider>\n ) : null}\n {addressModal === 'create' ? (\n <SDKFormProvider formHookResult={changeWorkAddressForm}>\n <Grid\n gridTemplateColumns={{\n base: '1fr',\n small: '1fr',\n }}\n gap={20}\n >\n <LocationField\n label={t('form.newWorkAddressLabel')}\n description={t('form.newWorkAddressDescription')}\n placeholder={t('form.selectPlaceholder')}\n validationMessages={locationValidation}\n portalContainer={addressModalPortal}\n />\n <EffectiveDateField\n label={t('form.startDateLabel')}\n description={t('form.startDateDescription')}\n validationMessages={startDateValidation}\n portalContainer={addressModalPortal}\n />\n </Grid>\n </SDKFormProvider>\n ) : null}\n </Flex>\n </Components.Modal>\n\n <Components.Modal\n isOpen={deleteConfirmUuid !== null}\n onClose={() => {\n setDeleteConfirmUuid(null)\n }}\n shouldCloseOnBackdropClick={false}\n footer={\n <Flex flexDirection=\"row\" gap={12} justifyContent=\"flex-end\">\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n setDeleteConfirmUuid(null)\n }}\n >\n {t('cancelCta')}\n </Components.Button>\n <Components.Button\n variant=\"error\"\n onClick={() => {\n void handleDeleteModalConfirm()\n }}\n isLoading={isDeletePending && deleteConfirmUuid !== null}\n >\n {t('deleteModalConfirmCta')}\n </Components.Button>\n </Flex>\n }\n >\n <Flex flexDirection=\"column\" gap={16}>\n <Components.Heading as=\"h2\">{t('deleteModalTitle')}</Components.Heading>\n <Components.Text variant=\"supporting\">\n {addressForDeleteModal ? (\n <Trans\n t={t}\n i18nKey=\"deleteModalDescription\"\n values={{\n address: formatPendingWorkAddressLine(addressForDeleteModal, companyLocations),\n }}\n components={{\n strong: <Components.Text weight=\"medium\" as=\"span\" />,\n }}\n />\n ) : null}\n </Components.Text>\n </Flex>\n </Components.Modal>\n </Flex>\n )\n}\n"],"names":["resolveLocation","row","companyLocations","loc","formatWorkAddressLines","location","street","getStreet","locality","getCityStateZip","WorkAddressView","editWorkAddressForm","changeWorkAddressForm","workAddresses","editTargetUuid","onEditTargetUuidChange","employeeDisplayName","onConfirmDelete","onWorkAddressSaved","onBack","isDeletePending","t","useTranslation","Components","useComponentContext","addressModal","setAddressModal","useState","deleteConfirmUuid","setDeleteConfirmUuid","addressModalContainerRef","useRef","addressModalPortal","setAddressModalPortal","useLayoutEffect","syncPortal","id","workAddress","editStatus","editFormFields","editShowsEffectiveDateField","createStatus","locationValidation","WorkAddressErrorCodes","startDateValidation","pendingFutureAddress","useMemo","getPendingFutureWorkAddress","addressForDeleteModal","a","changePendingPossessiveLabel","trimmed","chronologicalAsc","b","aDate","bDate","historyAddresses","address","sortedHistory","historyEndDate","idx","nextStart","nextDate","normalizeToDate","endDate","addDays","y","m","d","formatDateLongWithYear","historyDataView","useDataView","lines","jsxs","Flex","jsx","HamburgerMenu","PencilSvg","TrashCanSvg","EmptyData","ListIcon","closeAddressModal","handleDeleteModalConfirm","handleSave","result","modalPending","currentLines","currentLocation","FlexItem","Fragment","formatPendingWorkAddressLine","DataView","ActionsLayout","SDKFormProvider","Grid","LocationField","EffectiveDateField","Trans"],"mappings":";;;;;;;;;;;;;;;;;;;;AA+CA,SAASA,EACPC,GACAC,GACsB;AACtB,MAAI,GAACD,EAAI,gBAAgB,CAACC,GAAkB;AAG5C,WAAOA,EAAiB,KAAK,CAAAC,MAAOA,EAAI,SAASF,EAAI,YAAY;AACnE;AAEA,SAASG,EACPH,GACAC,GACwC;AACxC,QAAMG,IAAWL,EAAgBC,GAAKC,CAAgB;AACtD,MAAIG,GAAU;AACZ,UAAMC,IAASC,EAAUF,CAAQ,EAAE,KAAA,GAC7BG,IAAWC,EAAgBJ,CAAQ,EAAE,KAAA;AAC3C,WAAO,EAAE,SAASC,GAAQ,WAAWE,EAAAA;AAAAA,EACvC;AACA,QAAMF,IAASC,EAAUN,CAAG,EAAE,KAAA,GACxBO,IAAWC,EAAgBR,CAAG,EAAE,KAAA;AACtC,SAAO,EAAE,SAASK,GAAQ,WAAWE,EAAA;AACvC;AAGO,SAASE,GAAgB;AAAA,EAC9B,qBAAAC;AAAA,EACA,uBAAAC;AAAA,EACA,eAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,wBAAAC;AAAA,EACA,qBAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,QAAAC;AAAA,EACA,iBAAAC,KAAkB;AACpB,GAAyB;AACvB,QAAM,EAAE,GAAAC,EAAA,IAAMC,GAAe,iCAAiC,GACxDC,IAAaC,GAAA,GACb,CAACC,GAAcC,CAAe,IAAIC,EAAmC,IAAI,GACzE,CAACC,GAAmBC,CAAoB,IAAIF,EAAwB,IAAI,GACxEG,IAA2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js","sources":["../../../../../src/components/Employee/WorkAddress/management/useWorkAddressManagement.tsx"],"sourcesContent":["import { useMemo, useState } from 'react'\nimport type { EmployeeWorkAddress } from '@gusto/embedded-api-v-2025-11-15/models/components/employeeworkaddress'\nimport { useEmployeeAddressesDeleteWorkAddressMutation } from '@gusto/embedded-api-v-2025-11-15/react-query/employeeAddressesDeleteWorkAddress'\nimport { useEmployeeAddressesGetWorkAddresses } from '@gusto/embedded-api-v-2025-11-15/react-query/employeeAddressesGetWorkAddresses'\nimport { useEmployeesGet } from '@gusto/embedded-api-v-2025-11-15/react-query/employeesGet'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport { useBaseSubmit } from '@/components/Base/useBaseSubmit'\nimport { useWorkAddressForm } from '@/components/Employee/Profile/shared/useWorkAddressForm'\nimport type {\n UseWorkAddressFormReady,\n UseWorkAddressFormResult,\n} from '@/components/Employee/Profile/shared/useWorkAddressForm'\nimport { composeErrorHandler } from '@/partner-hook-utils/composeErrorHandler'\nimport type {\n BaseHookReady,\n HookErrorHandling,\n HookLoadingResult,\n} from '@/partner-hook-utils/types'\nimport { firstLastName } from '@/helpers/formattedStrings'\nimport { normalizeToSDKError, SDKInternalError } from '@/types/sdkError'\nimport { componentEvents, type EventType } from '@/shared/constants'\n\n/**\n * Params for {@link useWorkAddressManagement}.\n *\n * @public\n */\nexport interface UseWorkAddressManagementParams {\n /** The associated employee identifier. */\n employeeId: string\n /** Event handler fired when a work address is deleted. */\n onEvent: OnEventType<EventType, unknown>\n}\n\ninterface UseWorkAddressManagementDataPendingForms extends Record<string, unknown> {\n employeeDisplayName: string\n employeeWorkAddresses: EmployeeWorkAddress[] | undefined\n editTargetUuid: string | undefined\n editWorkAddressForm: UseWorkAddressFormResult\n changeWorkAddressForm: UseWorkAddressFormResult\n}\n\ninterface UseWorkAddressManagementDataReady extends Record<string, unknown> {\n employeeDisplayName: string\n employeeWorkAddresses: EmployeeWorkAddress[] | undefined\n editTargetUuid: string | undefined\n editWorkAddressForm: UseWorkAddressFormReady\n changeWorkAddressForm: UseWorkAddressFormReady\n}\n\ninterface UseWorkAddressManagementStatusEmployeeError extends Record<string, unknown> {\n isDeletePending: boolean\n isEmployeeError: true\n}\n\ninterface UseWorkAddressManagementStatusSuccess extends Record<string, unknown> {\n isDeletePending: boolean\n isEmployeeError: false\n}\n\ninterface UseWorkAddressManagementActions {\n setEditTargetUuid: (workAddressUuid: string | undefined) => void\n confirmDeleteWorkAddress: (workAddressUuid: string) => Promise<boolean>\n}\n\ninterface UseWorkAddressManagementReadyEmployeeError extends BaseHookReady<\n UseWorkAddressManagementDataPendingForms,\n UseWorkAddressManagementStatusEmployeeError\n> {\n actions: UseWorkAddressManagementActions\n}\n\n/**\n * Ready state of {@link useWorkAddressManagement} when the employee was fetched successfully.\n *\n * @public\n */\nexport interface UseWorkAddressManagementReadySuccess extends BaseHookReady<\n UseWorkAddressManagementDataReady,\n UseWorkAddressManagementStatusSuccess\n> {\n /** Actions for changing the edit target and confirming work address deletion. */\n actions: UseWorkAddressManagementActions\n}\n\ntype UseWorkAddressManagementReady =\n | UseWorkAddressManagementReadyEmployeeError\n | UseWorkAddressManagementReadySuccess\n\n/**\n * Return type of {@link useWorkAddressManagement}.\n *\n * @public\n */\nexport type UseWorkAddressManagementResult = HookLoadingResult | UseWorkAddressManagementReady\n\n/**\n * Type guard for the success branch of {@link useWorkAddressManagement}.\n *\n * @param value - The hook result to narrow.\n * @returns `true` when the hook has finished loading and the employee fetch succeeded.\n * @public\n */\nexport function isUseWorkAddressManagementSuccess(\n value: UseWorkAddressManagementResult,\n): value is UseWorkAddressManagementReadySuccess {\n if (value.isLoading) {\n return false\n }\n return !value.status.isEmployeeError\n}\n\nfunction workAddressFormsReady(\n editWorkAddressForm: UseWorkAddressFormResult,\n changeWorkAddressForm: UseWorkAddressFormResult,\n): Pick<UseWorkAddressManagementDataReady, 'editWorkAddressForm' | 'changeWorkAddressForm'> {\n if (editWorkAddressForm.isLoading) {\n throw new SDKInternalError('Edit work address form is still loading')\n }\n if (changeWorkAddressForm.isLoading) {\n throw new SDKInternalError('Change work address form is still loading')\n }\n return {\n editWorkAddressForm,\n changeWorkAddressForm,\n }\n}\n\n/**\n * Headless hook for managing an employee's work addresses.\n *\n * @remarks\n * Fetches the employee and their work addresses, exposes edit and change form hooks\n * for the address modal, and provides an action to delete a non-active address.\n * Use {@link isUseWorkAddressManagementSuccess} to narrow the ready state when the\n * employee fetch succeeded.\n *\n * @param params - {@link UseWorkAddressManagementParams}\n * @returns A {@link HookLoadingResult} while loading, or the ready state once data is available.\n * @public\n */\nexport function useWorkAddressManagement({\n employeeId,\n onEvent,\n}: UseWorkAddressManagementParams): UseWorkAddressManagementResult {\n const {\n baseSubmitHandler,\n error: rootSubmitError,\n setError: setRootSubmitError,\n } = useBaseSubmit('Employee.Management.WorkAddress')\n const deleteWorkAddressMutation = useEmployeeAddressesDeleteWorkAddressMutation()\n const [editTargetUuid, setEditTargetUuid] = useState<string | undefined>(undefined)\n\n const employeeQuery = useEmployeesGet({ employeeId }, { enabled: !!employeeId })\n const companyId = employeeQuery.data?.employee?.companyUuid\n\n const workAddressesQuery = useEmployeeAddressesGetWorkAddresses(\n { employeeId },\n { enabled: !!employeeId && !!companyId },\n )\n\n const employeeWorkAddresses = workAddressesQuery.data?.employeeWorkAddressesList\n\n const currentWorkAddress = useMemo<EmployeeWorkAddress | null>(() => {\n if (!employeeWorkAddresses?.length) {\n return null\n }\n return employeeWorkAddresses.find(w => w.active) ?? employeeWorkAddresses[0] ?? null\n }, [employeeWorkAddresses])\n\n const workAddressUuidForEdit = editTargetUuid ?? currentWorkAddress?.uuid\n\n const editInactiveRow = useMemo(() => {\n if (!editTargetUuid || !employeeWorkAddresses) {\n return undefined\n }\n return employeeWorkAddresses.find(w => w.uuid === editTargetUuid)\n }, [editTargetUuid, employeeWorkAddresses])\n\n const editingWorkAddressRow = workAddressUuidForEdit\n ? employeeWorkAddresses?.find(w => w.uuid === workAddressUuidForEdit)\n : undefined\n\n const withEffectiveDateOnEdit = editInactiveRow ? editInactiveRow.active !== true : false\n\n const editWorkAddressForm = useWorkAddressForm({\n companyId,\n employeeId,\n workAddressUuid: workAddressUuidForEdit,\n initialAddress: editingWorkAddressRow,\n withEffectiveDateField: withEffectiveDateOnEdit,\n })\n\n const changeWorkAddressForm = useWorkAddressForm({\n companyId,\n employeeId,\n withEffectiveDateField: true,\n })\n\n const employeeDisplayName = useMemo(() => {\n const employee = employeeQuery.data?.employee\n if (!employee) {\n return ''\n }\n return firstLastName({\n first_name: employee.firstName,\n last_name: employee.lastName,\n }).trim()\n }, [employeeQuery.data?.employee])\n\n const isMissingCompany = !!employeeQuery.data?.employee && !companyId\n\n const errorHandling: HookErrorHandling = composeErrorHandler(\n [\n employeeQuery,\n workAddressesQuery,\n editWorkAddressForm,\n changeWorkAddressForm,\n ...(isMissingCompany\n ? [\n {\n errorHandling: {\n errors: [\n normalizeToSDKError(\n new SDKInternalError(\n 'Employee record is missing companyUuid, which is required to load work address locations.',\n ),\n ),\n ],\n retryQueries: () => {},\n clearSubmitError: () => {},\n },\n },\n ]\n : []),\n ],\n { submitError: rootSubmitError, setSubmitError: setRootSubmitError },\n )\n\n const confirmDeleteWorkAddress = async (workAddressUuid: string): Promise<boolean> => {\n const snapshot = employeeWorkAddresses?.find(w => w.uuid === workAddressUuid) ?? null\n\n let succeeded = false\n await baseSubmitHandler(\n { workAddressUuid, snapshot },\n async ({ workAddressUuid: uuid, snapshot: snap }) => {\n const target = employeeWorkAddresses?.find(w => w.uuid === uuid)\n if (!target) {\n throw new SDKInternalError('Work address not found')\n }\n if (target.active === true) {\n throw new SDKInternalError('Cannot delete the active work address')\n }\n\n await deleteWorkAddressMutation.mutateAsync({\n request: { workAddressUuid: uuid },\n })\n succeeded = true\n if (snap) {\n onEvent(componentEvents.EMPLOYEE_MANAGEMENT_WORK_ADDRESS_DELETED, snap)\n }\n },\n )\n return succeeded\n }\n\n const actions: UseWorkAddressManagementActions = {\n setEditTargetUuid,\n confirmDeleteWorkAddress,\n }\n\n const dataPayloadPendingForms: UseWorkAddressManagementDataPendingForms = {\n employeeDisplayName,\n employeeWorkAddresses,\n editTargetUuid,\n editWorkAddressForm,\n changeWorkAddressForm,\n }\n\n if (employeeQuery.isLoading) {\n return { isLoading: true, errorHandling }\n }\n\n if (employeeQuery.isError || isMissingCompany) {\n return {\n isLoading: false,\n data: dataPayloadPendingForms,\n status: {\n isDeletePending: deleteWorkAddressMutation.isPending,\n isEmployeeError: true,\n },\n errorHandling,\n actions,\n }\n }\n\n if (workAddressesQuery.isLoading) {\n return { isLoading: true, errorHandling }\n }\n\n const isFormsLoading = editWorkAddressForm.isLoading || changeWorkAddressForm.isLoading\n if (isFormsLoading) {\n return { isLoading: true, errorHandling }\n }\n\n const { editWorkAddressForm: editReady, changeWorkAddressForm: changeReady } =\n workAddressFormsReady(editWorkAddressForm, changeWorkAddressForm)\n\n const dataReady: UseWorkAddressManagementDataReady = {\n employeeDisplayName,\n employeeWorkAddresses,\n editTargetUuid,\n editWorkAddressForm: editReady,\n changeWorkAddressForm: changeReady,\n }\n\n return {\n isLoading: false,\n data: dataReady,\n status: {\n isDeletePending: deleteWorkAddressMutation.isPending,\n isEmployeeError: false,\n },\n errorHandling,\n actions,\n }\n}\n"],"names":["isUseWorkAddressManagementSuccess","value","workAddressFormsReady","editWorkAddressForm","changeWorkAddressForm","SDKInternalError","useWorkAddressManagement","employeeId","onEvent","baseSubmitHandler","rootSubmitError","setRootSubmitError","useBaseSubmit","deleteWorkAddressMutation","useEmployeeAddressesDeleteWorkAddressMutation","editTargetUuid","setEditTargetUuid","useState","employeeQuery","useEmployeesGet","companyId","workAddressesQuery","useEmployeeAddressesGetWorkAddresses","employeeWorkAddresses","currentWorkAddress","useMemo","w","workAddressUuidForEdit","editInactiveRow","editingWorkAddressRow","withEffectiveDateOnEdit","useWorkAddressForm","employeeDisplayName","employee","firstLastName","isMissingCompany","errorHandling","composeErrorHandler","normalizeToSDKError","actions","workAddressUuid","snapshot","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,MACA,qBAAqBiC;AAAA,MACrB,uBAAuBC;AAAA,IAAA;AAAA,IAMvB,QAAQ;AAAA,MACN,iBAAiBpC,EAA0B;AAAA,MAC3C,iBAAiB;AAAA,IAAA;AAAA,IAEnB,eAAAuB;AAAA,IACA,SAAAG;AAAA,EAAA;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"useWorkAddressManagement.js","sources":["../../../../../src/components/Employee/WorkAddress/management/useWorkAddressManagement.tsx"],"sourcesContent":["import { useMemo, useState } from 'react'\nimport type { EmployeeWorkAddress } from '@gusto/embedded-api-v-2025-11-15/models/components/employeeworkaddress'\nimport { useEmployeeAddressesDeleteWorkAddressMutation } from '@gusto/embedded-api-v-2025-11-15/react-query/employeeAddressesDeleteWorkAddress'\nimport { useEmployeeAddressesGetWorkAddresses } from '@gusto/embedded-api-v-2025-11-15/react-query/employeeAddressesGetWorkAddresses'\nimport { useEmployeesGet } from '@gusto/embedded-api-v-2025-11-15/react-query/employeesGet'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport { useBaseSubmit } from '@/components/Base/useBaseSubmit'\nimport { useWorkAddressForm } from '@/components/Employee/Profile/shared/useWorkAddressForm'\nimport type {\n UseWorkAddressFormReady,\n UseWorkAddressFormResult,\n} from '@/components/Employee/Profile/shared/useWorkAddressForm'\nimport { composeErrorHandler } from '@/partner-hook-utils/composeErrorHandler'\nimport type {\n BaseHookReady,\n HookErrorHandling,\n HookLoadingResult,\n} from '@/partner-hook-utils/types'\nimport { firstLastName } from '@/helpers/formattedStrings'\nimport { normalizeToSDKError, SDKInternalError } from '@/types/sdkError'\nimport { componentEvents, type EventType } from '@/shared/constants'\n\n/**\n * Params for {@link useWorkAddressManagement}.\n *\n * @public\n */\nexport interface UseWorkAddressManagementParams {\n /** The associated employee identifier. */\n employeeId: string\n /** Event handler fired when a work address is deleted. */\n onEvent: OnEventType<EventType, unknown>\n}\n\ninterface UseWorkAddressManagementDataPendingForms extends Record<string, unknown> {\n employeeDisplayName: string\n employeeWorkAddresses: EmployeeWorkAddress[] | undefined\n editTargetUuid: string | undefined\n editWorkAddressForm: UseWorkAddressFormResult\n changeWorkAddressForm: UseWorkAddressFormResult\n}\n\ninterface UseWorkAddressManagementDataReady extends Record<string, unknown> {\n employeeDisplayName: string\n employeeWorkAddresses: EmployeeWorkAddress[] | undefined\n editTargetUuid: string | undefined\n editWorkAddressForm: UseWorkAddressFormReady\n changeWorkAddressForm: UseWorkAddressFormReady\n}\n\ninterface UseWorkAddressManagementStatusEmployeeError extends Record<string, unknown> {\n isDeletePending: boolean\n isEmployeeError: true\n}\n\ninterface UseWorkAddressManagementStatusSuccess extends Record<string, unknown> {\n isDeletePending: boolean\n isEmployeeError: false\n}\n\ninterface UseWorkAddressManagementActions {\n setEditTargetUuid: (workAddressUuid: string | undefined) => void\n confirmDeleteWorkAddress: (workAddressUuid: string) => Promise<boolean>\n}\n\ninterface UseWorkAddressManagementReadyEmployeeError extends BaseHookReady<\n UseWorkAddressManagementDataPendingForms,\n UseWorkAddressManagementStatusEmployeeError\n> {\n actions: UseWorkAddressManagementActions\n}\n\n/**\n * Ready state of {@link useWorkAddressManagement} when the employee was fetched successfully.\n *\n * @public\n */\nexport interface UseWorkAddressManagementReadySuccess extends BaseHookReady<\n UseWorkAddressManagementDataReady,\n UseWorkAddressManagementStatusSuccess\n> {\n /** Actions for changing the edit target and confirming work address deletion. */\n actions: UseWorkAddressManagementActions\n}\n\ntype UseWorkAddressManagementReady =\n UseWorkAddressManagementReadyEmployeeError | UseWorkAddressManagementReadySuccess\n\n/**\n * Return type of {@link useWorkAddressManagement}.\n *\n * @public\n */\nexport type UseWorkAddressManagementResult = HookLoadingResult | UseWorkAddressManagementReady\n\n/**\n * Type guard for the success branch of {@link useWorkAddressManagement}.\n *\n * @param value - The hook result to narrow.\n * @returns `true` when the hook has finished loading and the employee fetch succeeded.\n * @public\n */\nexport function isUseWorkAddressManagementSuccess(\n value: UseWorkAddressManagementResult,\n): value is UseWorkAddressManagementReadySuccess {\n if (value.isLoading) {\n return false\n }\n return !value.status.isEmployeeError\n}\n\nfunction workAddressFormsReady(\n editWorkAddressForm: UseWorkAddressFormResult,\n changeWorkAddressForm: UseWorkAddressFormResult,\n): Pick<UseWorkAddressManagementDataReady, 'editWorkAddressForm' | 'changeWorkAddressForm'> {\n if (editWorkAddressForm.isLoading) {\n throw new SDKInternalError('Edit work address form is still loading')\n }\n if (changeWorkAddressForm.isLoading) {\n throw new SDKInternalError('Change work address form is still loading')\n }\n return {\n editWorkAddressForm,\n changeWorkAddressForm,\n }\n}\n\n/**\n * Headless hook for managing an employee's work addresses.\n *\n * @remarks\n * Fetches the employee and their work addresses, exposes edit and change form hooks\n * for the address modal, and provides an action to delete a non-active address.\n * Use {@link isUseWorkAddressManagementSuccess} to narrow the ready state when the\n * employee fetch succeeded.\n *\n * @param params - {@link UseWorkAddressManagementParams}\n * @returns A {@link HookLoadingResult} while loading, or the ready state once data is available.\n * @public\n */\nexport function useWorkAddressManagement({\n employeeId,\n onEvent,\n}: UseWorkAddressManagementParams): UseWorkAddressManagementResult {\n const {\n baseSubmitHandler,\n error: rootSubmitError,\n setError: setRootSubmitError,\n } = useBaseSubmit('Employee.Management.WorkAddress')\n const deleteWorkAddressMutation = useEmployeeAddressesDeleteWorkAddressMutation()\n const [editTargetUuid, setEditTargetUuid] = useState<string | undefined>(undefined)\n\n const employeeQuery = useEmployeesGet({ employeeId }, { enabled: !!employeeId })\n const companyId = employeeQuery.data?.employee?.companyUuid\n\n const workAddressesQuery = useEmployeeAddressesGetWorkAddresses(\n { employeeId },\n { enabled: !!employeeId && !!companyId },\n )\n\n const employeeWorkAddresses = workAddressesQuery.data?.employeeWorkAddressesList\n\n const currentWorkAddress = useMemo<EmployeeWorkAddress | null>(() => {\n if (!employeeWorkAddresses?.length) {\n return null\n }\n return employeeWorkAddresses.find(w => w.active) ?? employeeWorkAddresses[0] ?? null\n }, [employeeWorkAddresses])\n\n const workAddressUuidForEdit = editTargetUuid ?? currentWorkAddress?.uuid\n\n const editInactiveRow = useMemo(() => {\n if (!editTargetUuid || !employeeWorkAddresses) {\n return undefined\n }\n return employeeWorkAddresses.find(w => w.uuid === editTargetUuid)\n }, [editTargetUuid, employeeWorkAddresses])\n\n const editingWorkAddressRow = workAddressUuidForEdit\n ? employeeWorkAddresses?.find(w => w.uuid === workAddressUuidForEdit)\n : undefined\n\n const withEffectiveDateOnEdit = editInactiveRow ? editInactiveRow.active !== true : false\n\n const editWorkAddressForm = useWorkAddressForm({\n companyId,\n employeeId,\n workAddressUuid: workAddressUuidForEdit,\n initialAddress: editingWorkAddressRow,\n withEffectiveDateField: withEffectiveDateOnEdit,\n })\n\n const changeWorkAddressForm = useWorkAddressForm({\n companyId,\n employeeId,\n withEffectiveDateField: true,\n })\n\n const employeeDisplayName = useMemo(() => {\n const employee = employeeQuery.data?.employee\n if (!employee) {\n return ''\n }\n return firstLastName({\n first_name: employee.firstName,\n last_name: employee.lastName,\n }).trim()\n }, [employeeQuery.data?.employee])\n\n const isMissingCompany = !!employeeQuery.data?.employee && !companyId\n\n const errorHandling: HookErrorHandling = composeErrorHandler(\n [\n employeeQuery,\n workAddressesQuery,\n editWorkAddressForm,\n changeWorkAddressForm,\n ...(isMissingCompany\n ? [\n {\n errorHandling: {\n errors: [\n normalizeToSDKError(\n new SDKInternalError(\n 'Employee record is missing companyUuid, which is required to load work address locations.',\n ),\n ),\n ],\n retryQueries: () => {},\n clearSubmitError: () => {},\n },\n },\n ]\n : []),\n ],\n { submitError: rootSubmitError, setSubmitError: setRootSubmitError },\n )\n\n const confirmDeleteWorkAddress = async (workAddressUuid: string): Promise<boolean> => {\n const snapshot = employeeWorkAddresses?.find(w => w.uuid === workAddressUuid) ?? null\n\n let succeeded = false\n await baseSubmitHandler(\n { workAddressUuid, snapshot },\n async ({ workAddressUuid: uuid, snapshot: snap }) => {\n const target = employeeWorkAddresses?.find(w => w.uuid === uuid)\n if (!target) {\n throw new SDKInternalError('Work address not found')\n }\n if (target.active === true) {\n throw new SDKInternalError('Cannot delete the active work address')\n }\n\n await deleteWorkAddressMutation.mutateAsync({\n request: { workAddressUuid: uuid },\n })\n succeeded = true\n if (snap) {\n onEvent(componentEvents.EMPLOYEE_MANAGEMENT_WORK_ADDRESS_DELETED, snap)\n }\n },\n )\n return succeeded\n }\n\n const actions: UseWorkAddressManagementActions = {\n setEditTargetUuid,\n confirmDeleteWorkAddress,\n }\n\n const dataPayloadPendingForms: UseWorkAddressManagementDataPendingForms = {\n employeeDisplayName,\n employeeWorkAddresses,\n editTargetUuid,\n editWorkAddressForm,\n changeWorkAddressForm,\n }\n\n if (employeeQuery.isLoading) {\n return { isLoading: true, errorHandling }\n }\n\n if (employeeQuery.isError || isMissingCompany) {\n return {\n isLoading: false,\n data: dataPayloadPendingForms,\n status: {\n isDeletePending: deleteWorkAddressMutation.isPending,\n isEmployeeError: true,\n },\n errorHandling,\n actions,\n }\n }\n\n if (workAddressesQuery.isLoading) {\n return { isLoading: true, errorHandling }\n }\n\n const isFormsLoading = editWorkAddressForm.isLoading || changeWorkAddressForm.isLoading\n if (isFormsLoading) {\n return { isLoading: true, errorHandling }\n }\n\n const { editWorkAddressForm: editReady, changeWorkAddressForm: changeReady } =\n workAddressFormsReady(editWorkAddressForm, changeWorkAddressForm)\n\n const dataReady: UseWorkAddressManagementDataReady = {\n employeeDisplayName,\n employeeWorkAddresses,\n editTargetUuid,\n editWorkAddressForm: editReady,\n changeWorkAddressForm: changeReady,\n }\n\n return {\n isLoading: false,\n data: dataReady,\n status: {\n isDeletePending: deleteWorkAddressMutation.isPending,\n isEmployeeError: false,\n },\n errorHandling,\n actions,\n }\n}\n"],"names":["isUseWorkAddressManagementSuccess","value","workAddressFormsReady","editWorkAddressForm","changeWorkAddressForm","SDKInternalError","useWorkAddressManagement","employeeId","onEvent","baseSubmitHandler","rootSubmitError","setRootSubmitError","useBaseSubmit","deleteWorkAddressMutation","useEmployeeAddressesDeleteWorkAddressMutation","editTargetUuid","setEditTargetUuid","useState","employeeQuery","useEmployeesGet","companyId","workAddressesQuery","useEmployeeAddressesGetWorkAddresses","employeeWorkAddresses","currentWorkAddress","useMemo","w","workAddressUuidForEdit","editInactiveRow","editingWorkAddressRow","withEffectiveDateOnEdit","useWorkAddressForm","employeeDisplayName","employee","firstLastName","isMissingCompany","errorHandling","composeErrorHandler","normalizeToSDKError","actions","workAddressUuid","snapshot","succeeded","uuid","snap","target","componentEvents","dataPayloadPendingForms","editReady","changeReady"],"mappings":";;;;;;;;;;AAsGO,SAASA,GACdC,GAC+C;AAC/C,SAAIA,EAAM,YACD,KAEF,CAACA,EAAM,OAAO;AACvB;AAEA,SAASC,EACPC,GACAC,GAC0F;AAC1F,MAAID,EAAoB;AACtB,UAAM,IAAIE,EAAiB,yCAAyC;AAEtE,MAAID,EAAsB;AACxB,UAAM,IAAIC,EAAiB,2CAA2C;AAExE,SAAO;AAAA,IACL,qBAAAF;AAAA,IACA,uBAAAC;AAAA,EAAA;AAEJ;AAeO,SAASE,GAAyB;AAAA,EACvC,YAAAC;AAAA,EACA,SAAAC;AACF,GAAmE;AACjE,QAAM;AAAA,IACJ,mBAAAC;AAAA,IACA,OAAOC;AAAA,IACP,UAAUC;AAAA,EAAA,IACRC,EAAc,iCAAiC,GAC7CC,IAA4BC,EAAA,GAC5B,CAACC,GAAgBC,CAAiB,IAAIC,EAA6B,MAAS,GAE5EC,IAAgBC,EAAgB,EAAE,YAAAZ,EAAA,GAAc,EAAE,SAAS,CAAC,CAACA,GAAY,GACzEa,IAAYF,EAAc,MAAM,UAAU,aAE1CG,IAAqBC;AAAA,IACzB,EAAE,YAAAf,EAAA;AAAA,IACF,EAAE,SAAS,CAAC,CAACA,KAAc,CAAC,CAACa,EAAA;AAAA,EAAU,GAGnCG,IAAwBF,EAAmB,MAAM,2BAEjDG,IAAqBC,EAAoC,MACxDF,GAAuB,SAGrBA,EAAsB,KAAK,CAAAG,MAAKA,EAAE,MAAM,KAAKH,EAAsB,CAAC,KAAK,OAFvE,MAGR,CAACA,CA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WAAO,EAAE,WAAW,IAAM,eAAAgC,EAAA;AAG5B,QAAM,EAAE,qBAAqBY,GAAW,uBAAuBC,MAC7D/C,EAAsBC,GAAqBC,CAAqB;AAUlE,SAAO;AAAA,IACL,WAAW;AAAA,IACX,MAVmD;AAAA,MACnD,qBAAA4B;AAAA,MACA,uBAAAT;AAAA,MACA,gBAAAR;AAAA,MACA,qBAAqBiC;AAAA,MACrB,uBAAuBC;AAAA,IAAA;AAAA,IAMvB,QAAQ;AAAA,MACN,iBAAiBpC,EAA0B;AAAA,MAC3C,iBAAiB;AAAA,IAAA;AAAA,IAEnB,eAAAuB;AAAA,IACA,SAAAG;AAAA,EAAA;AAEJ;"}
|
|
@@ -1,22 +1,18 @@
|
|
|
1
1
|
import { state as o, transition as t, reduce as e } from "robot3";
|
|
2
2
|
import { WorkAddressEditFormContextual as d, WorkAddressCardContextual as n } from "./WorkAddressComponents.js";
|
|
3
3
|
import { componentEvents as E } from "../../../../shared/constants.js";
|
|
4
|
-
const s = e(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
})
|
|
9
|
-
), _ = {
|
|
4
|
+
const s = e((r) => ({
|
|
5
|
+
...r,
|
|
6
|
+
component: n
|
|
7
|
+
})), _ = {
|
|
10
8
|
card: o(
|
|
11
9
|
t(
|
|
12
10
|
E.EMPLOYEE_MANAGEMENT_WORK_ADDRESS_EDIT_REQUESTED,
|
|
13
11
|
"editWorkAddress",
|
|
14
|
-
e(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
})
|
|
19
|
-
)
|
|
12
|
+
e((r) => ({
|
|
13
|
+
...r,
|
|
14
|
+
component: d
|
|
15
|
+
}))
|
|
20
16
|
)
|
|
21
17
|
),
|
|
22
18
|
// The edit surface is modal-style: editing/changing/deleting a row closes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workAddressStateMachine.js","sources":["../../../../../src/components/Employee/WorkAddress/management/workAddressStateMachine.ts"],"sourcesContent":["import { reduce, state, transition } from 'robot3'\nimport type { ComponentType } from 'react'\nimport type { WorkAddressContextInterface } from './WorkAddressComponents'\nimport { WorkAddressCardContextual, WorkAddressEditFormContextual } from './WorkAddressComponents'\nimport { componentEvents } from '@/shared/constants'\nimport type { MachineTransition } from '@/types/Helpers'\n\nconst returnToCard = reduce(
|
|
1
|
+
{"version":3,"file":"workAddressStateMachine.js","sources":["../../../../../src/components/Employee/WorkAddress/management/workAddressStateMachine.ts"],"sourcesContent":["import { reduce, state, transition } from 'robot3'\nimport type { ComponentType } from 'react'\nimport type { WorkAddressContextInterface } from './WorkAddressComponents'\nimport { WorkAddressCardContextual, WorkAddressEditFormContextual } from './WorkAddressComponents'\nimport { componentEvents } from '@/shared/constants'\nimport type { MachineTransition } from '@/types/Helpers'\n\nconst returnToCard = reduce((ctx: WorkAddressContextInterface): WorkAddressContextInterface => ({\n ...ctx,\n component: WorkAddressCardContextual as ComponentType,\n}))\n\n/** @internal */\nexport const workAddressStateMachine = {\n card: state<MachineTransition>(\n transition(\n componentEvents.EMPLOYEE_MANAGEMENT_WORK_ADDRESS_EDIT_REQUESTED,\n 'editWorkAddress',\n reduce((ctx: WorkAddressContextInterface): WorkAddressContextInterface => ({\n ...ctx,\n component: WorkAddressEditFormContextual as ComponentType,\n })),\n ),\n ),\n // The edit surface is modal-style: editing/changing/deleting a row closes\n // the modal but keeps the user on the edit screen so they can manage\n // additional rows. Only the explicit Back action returns to the card.\n editWorkAddress: state<MachineTransition>(\n transition(\n componentEvents.EMPLOYEE_MANAGEMENT_WORK_ADDRESS_EDIT_CANCELLED,\n 'card',\n returnToCard,\n ),\n ),\n}\n"],"names":["returnToCard","reduce","ctx","WorkAddressCardContextual","workAddressStateMachine","state","transition","componentEvents","WorkAddressEditFormContextual"],"mappings":";;;AAOA,MAAMA,IAAeC,EAAO,CAACC,OAAmE;AAAA,EAC9F,GAAGA;AAAA,EACH,WAAWC;AACb,EAAE,GAGWC,IAA0B;AAAA,EACrC,MAAMC;AAAA,IACJC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAN,EAAO,CAACC,OAAmE;AAAA,QACzE,GAAGA;AAAA,QACH,WAAWM;AAAA,MAAA,EACX;AAAA,IAAA;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA,EAKF,iBAAiBH;AAAA,IACfC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAP;AAAA,IAAA;AAAA,EACF;AAEJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEmployeeWorkAddressSummary.js","sources":["../../../../../../src/components/Employee/WorkAddress/shared/useEmployeeWorkAddressSummary/useEmployeeWorkAddressSummary.tsx"],"sourcesContent":["import { useEmployeeAddressesGetWorkAddresses } from '@gusto/embedded-api-v-2025-11-15/react-query/employeeAddressesGetWorkAddresses'\nimport type { EmployeeWorkAddress } from '@gusto/embedded-api-v-2025-11-15/models/components/employeeworkaddress'\nimport { composeErrorHandler } from '@/partner-hook-utils/composeErrorHandler'\nimport type { BaseHookReady, HookLoadingResult } from '@/partner-hook-utils/types'\n\n/**\n * Params for {@link useEmployeeWorkAddressSummary}.\n *\n * @public\n */\nexport interface UseEmployeeWorkAddressSummaryParams {\n /** The associated employee identifier. */\n employeeId: string\n}\n\ntype UseEmployeeWorkAddressSummaryReady = BaseHookReady<\n { currentWorkAddress: EmployeeWorkAddress | undefined },\n { isFetching: boolean; isPending: boolean }\n>\n\n/**\n * Return type of {@link useEmployeeWorkAddressSummary}.\n *\n * @public\n */\nexport type UseEmployeeWorkAddressSummaryResult =\n
|
|
1
|
+
{"version":3,"file":"useEmployeeWorkAddressSummary.js","sources":["../../../../../../src/components/Employee/WorkAddress/shared/useEmployeeWorkAddressSummary/useEmployeeWorkAddressSummary.tsx"],"sourcesContent":["import { useEmployeeAddressesGetWorkAddresses } from '@gusto/embedded-api-v-2025-11-15/react-query/employeeAddressesGetWorkAddresses'\nimport type { EmployeeWorkAddress } from '@gusto/embedded-api-v-2025-11-15/models/components/employeeworkaddress'\nimport { composeErrorHandler } from '@/partner-hook-utils/composeErrorHandler'\nimport type { BaseHookReady, HookLoadingResult } from '@/partner-hook-utils/types'\n\n/**\n * Params for {@link useEmployeeWorkAddressSummary}.\n *\n * @public\n */\nexport interface UseEmployeeWorkAddressSummaryParams {\n /** The associated employee identifier. */\n employeeId: string\n}\n\ntype UseEmployeeWorkAddressSummaryReady = BaseHookReady<\n { currentWorkAddress: EmployeeWorkAddress | undefined },\n { isFetching: boolean; isPending: boolean }\n>\n\n/**\n * Return type of {@link useEmployeeWorkAddressSummary}.\n *\n * @public\n */\nexport type UseEmployeeWorkAddressSummaryResult =\n HookLoadingResult | UseEmployeeWorkAddressSummaryReady\n\n/**\n * Read-only data hook for the employee work address summary card.\n *\n * @remarks\n * Fetches the employee's work addresses and selects the active row.\n *\n * @param params - {@link UseEmployeeWorkAddressSummaryParams}\n * @returns A {@link HookLoadingResult} while loading, or the ready state with `currentWorkAddress` once data is available.\n * @public\n */\nexport function useEmployeeWorkAddressSummary({\n employeeId,\n}: UseEmployeeWorkAddressSummaryParams): UseEmployeeWorkAddressSummaryResult {\n const workAddressesQuery = useEmployeeAddressesGetWorkAddresses(\n { employeeId },\n { staleTime: Infinity },\n )\n\n const errorHandling = composeErrorHandler([workAddressesQuery])\n\n const workAddressesList = workAddressesQuery.data?.employeeWorkAddressesList\n\n if (workAddressesQuery.isLoading || !workAddressesList) {\n return { isLoading: true, errorHandling }\n }\n\n const currentWorkAddress = workAddressesList.find(address => address.active)\n\n return {\n isLoading: false,\n data: { currentWorkAddress },\n status: {\n isFetching: workAddressesQuery.isFetching,\n isPending: false,\n },\n errorHandling,\n }\n}\n"],"names":["useEmployeeWorkAddressSummary","employeeId","workAddressesQuery","useEmployeeAddressesGetWorkAddresses","errorHandling","composeErrorHandler","workAddressesList","address"],"mappings":";;AAsCO,SAASA,EAA8B;AAAA,EAC5C,YAAAC;AACF,GAA6E;AAC3E,QAAMC,IAAqBC;AAAA,IACzB,EAAE,YAAAF,EAAA;AAAA,IACF,EAAE,WAAW,MAAA;AAAA,EAAS,GAGlBG,IAAgBC,EAAoB,CAACH,CAAkB,CAAC,GAExDI,IAAoBJ,EAAmB,MAAM;AAEnD,SAAIA,EAAmB,aAAa,CAACI,IAC5B,EAAE,WAAW,IAAM,eAAAF,EAAA,IAKrB;AAAA,IACL,WAAW;AAAA,IACX,MAAM,EAAE,oBAJiBE,EAAkB,KAAK,CAAAC,MAAWA,EAAQ,MAAM,EAIjE;AAAA,IACR,QAAQ;AAAA,MACN,YAAYL,EAAmB;AAAA,MAC/B,WAAW;AAAA,IAAA;AAAA,IAEb,eAAAE;AAAA,EAAA;AAEJ;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export { OnboardingFlow, type OnboardingFlowProps } from '../OnboardingFlow/OnboardingFlow';
|
|
2
2
|
export { OnboardingExecutionFlow, type OnboardingExecutionFlowProps, type OnboardingExecutionInitialState, type OnboardingDefaultValues, } from '../OnboardingExecutionFlow';
|
|
3
|
-
export { SelfOnboardingFlow } from '../SelfOnboardingFlow/SelfOnboardingFlow';
|
|
3
|
+
export { SelfOnboardingFlow, type SelfOnboardingFlowProps, } from '../SelfOnboardingFlow/SelfOnboardingFlow';
|
|
4
4
|
export { EmployeeList, type EmployeeListProps } from '../EmployeeList/onboarding/EmployeeList';
|
|
5
|
-
export { OnboardingSummary } from '../OnboardingSummary';
|
|
6
|
-
export { Landing } from '../Landing';
|
|
5
|
+
export { OnboardingSummary, type OnboardingSummaryProps } from '../OnboardingSummary';
|
|
6
|
+
export { Landing, type LandingProps } from '../Landing';
|
|
7
7
|
export { DocumentSigner, type DocumentSignerProps } from '../Documents/onboarding/DocumentSigner';
|
|
8
8
|
export { EmploymentEligibility, type EmploymentEligibilityProps, } from '../Documents/onboarding/DocumentSigner/EmploymentEligibility';
|
|
9
9
|
export { DocumentList, type DocumentListProps, } from '../Documents/onboarding/DocumentSigner/DocumentList';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as n, jsxs as x } from "react/jsx-runtime";
|
|
2
2
|
import { useMachine as h } from "react-robot";
|
|
3
|
+
import { Flex as l } from "../Common/Flex/Flex.js";
|
|
3
4
|
import { FlowContext as u } from "./useFlow.js";
|
|
4
5
|
import { FlowHeader as v } from "./FlowHeader.js";
|
|
5
|
-
import { Flex as l } from "../Common/Flex/Flex.js";
|
|
6
6
|
const E = ({
|
|
7
7
|
onEvent: m,
|
|
8
8
|
machine: s
|
package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.d.ts
CHANGED
|
@@ -32,6 +32,7 @@ export interface InformationRequestFormProps extends BaseComponentInterface<'Inf
|
|
|
32
32
|
* @remarks
|
|
33
33
|
* Events emitted via `onEvent`:
|
|
34
34
|
*
|
|
35
|
+
* @events
|
|
35
36
|
* | Event | Description | Data |
|
|
36
37
|
* | ----- | ----------- | ---- |
|
|
37
38
|
* | `informationRequest/form/done` | Fired when the form is successfully submitted | The `informationRequest` field from the Submit information request response |
|
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 DOMPurify from 'dompurify'\nimport { 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-v-2025-11-15/react-query/informationRequestsGetInformationRequests'\nimport {\n useInformationRequestsSubmitMutation,\n mutationKeyInformationRequestsSubmit,\n} from '@gusto/embedded-api-v-2025-11-15/react-query/informationRequestsSubmit'\nimport type { RequiredQuestions } from '@gusto/embedded-api-v-2025-11-15/models/components/informationrequest'\nimport { ResponseType } from '@gusto/embedded-api-v-2025-11-15/models/components/informationrequest'\nimport { ResponseType as SubmitResponseType } from '@gusto/embedded-api-v-2025-11-15/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']\nconst dompurifyConfig = {\n ALLOWED_TAGS: ['a', 'b', 'strong'],\n ALLOWED_ATTR: ['target', 'href', 'rel'],\n}\n\n/* API does not enforce an upper limit, so set a reasonable character max for a single-line input. */\nconst MAX_TEXT_RESPONSE = 5000\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\n/**\n * Props for {@link InformationRequestForm}.\n *\n * @public\n */\nexport interface InformationRequestFormProps extends BaseComponentInterface<'InformationRequests.InformationRequestForm'> {\n /** The associated company identifier. */\n companyId: string\n /** The identifier of the information request to respond to. */\n requestId: string\n /** Event handler invoked when the form is submitted or cancelled. See the events table in {@link InformationRequestForm}. */\n onEvent: OnEventType<EventType, unknown>\n}\n\n/**\n * Dynamic response form for a single information request.\n *\n * Renders supported question types (text and document upload) based on the request's\n * `requiredQuestions` payload and submits responses to the Submit information request\n * endpoint. Use this component directly when you have built your own list or routing\n * surface and need to host the form — typically inside a modal or page you control.\n *\n * Requests with unsupported response types (e.g. `persona`-driven identity verification)\n * display a guidance message instead of the form; in those cases the user must complete\n * the request through your own integration with the underlying provider.\n *\n * Text inputs accept up to 5,000 characters. Document uploads are restricted to JPEG,\n * PNG, or PDF.\n *\n * @remarks\n * Events emitted via `onEvent`:\n *\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `informationRequest/form/done` | Fired when the form is successfully submitted | The `informationRequest` field from the Submit information request response |\n * | `informationRequest/form/cancel` | Fired when the user cancels the form | — |\n *\n * @param props - See {@link InformationRequestFormProps}.\n * @returns The rendered information request response form.\n * @public\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(question => !SUPPORTED_RESPONSE_TYPES.includes(question.responseType))\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.informationRequests?.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.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 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 size=\"sm\" weight=\"medium\">\n {isDocumentType ? t('questionTypes.document') : t('questionTypes.answer')}\n </Text>\n <Text size=\"sm\" variant=\"supporting\">\n {/* SECURITY: XSS mitigated via DOMPurify with strict allowlist. Pattern matches TaxInputs.tsx */}\n <span\n dangerouslySetInnerHTML={{\n __html: DOMPurify.sanitize(question.questionText, dompurifyConfig),\n }}\n />\n </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 maxLength={MAX_TEXT_RESPONSE}\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.informationRequests?.find(req => req.uuid === selectedRequestId)\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","dompurifyConfig","MAX_TEXT_RESPONSE","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","DOMPurify","TextInputField","FileInputField","unsupportedPlaceholder","Flex","FormProvider","Form","Footer","Button","selectedRequestId","useFlow","isPending","useIsMutating","mutationKeyInformationRequestsSubmit","handleCancel"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAMA,IAA8B,sCAC9BC,KAAsB,CAAC,cAAc,aAAa,iBAAiB,GACnEC,KAAkB;AAAA,EACtB,cAAc,CAAC,KAAK,KAAK,QAAQ;AAAA,EACjC,cAAc,CAAC,UAAU,QAAQ,KAAK;AACxC,GAGMC,KAAoB,KAEpBC,KAA+BC,EAAE;AAAA,EACrCA,EAAE,OAAA;AAAA,EACFA,EAAE,MAAM,CAACA,EAAE,OAAA,EAAS,IAAI,CAAC,GAAGA,EAAE,WAAW,IAAI,CAAC,CAAC;AACjD;AA6CO,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,GACjBC,EAAO,cAAcH,CAAI;AAC3B,CAAC,GAGGI,KAA2C,CAACC,EAAa,MAAMA,EAAa,QAAQ;AAE1F,SAASC,EAA4BC,GAAgC;AACnE,SAAOA,EAAU,KAAK,CAAAC,MAAY,CAACJ,GAAyB,SAASI,EAAS,YAAY,CAAC;AAC7F;AAEA,SAASC,GAAuBF,GAAgC;AAC9D,SAAOA,EAAU,KAAK,CAAAC,MAAYA,EAAS,iBAAiBH,EAAa,OAAO;AAClF;AAEA,SA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SAAIjB,IAEA,gBAAAlC,EAAC8D,GAAA,EAAK,gBAAe,YAAW,KAAK,IACnC,UAAA,gBAAA9D,EAACkE,GAAA,EAAO,SAAQ,aAAY,SAASM,GAClC,UAAArD,EAAE,WAAW,GAChB,GACF,IAKF,gBAAAqC,EAACM,GAAA,EAAK,gBAAe,YAAW,KAAK,IACnC,UAAA;AAAA,IAAA,gBAAA9D,EAACkE,GAAA,EAAO,SAAQ,aAAY,SAASM,GAAc,YAAYH,GAC5D,UAAAlD,EAAE,YAAY,EAAA,CACjB;AAAA,IACA,gBAAAnB;AAAA,MAACkE;AAAA,MAAA;AAAA,QACC,SAAQ;AAAA,QACR,MAAK;AAAA,QACL,MAAM1E;AAAA,QACN,WAAW6E;AAAA,QAEV,YAAE,YAAY;AAAA,MAAA;AAAA,IAAA;AAAA,EACjB,GACF;AAEJ;AAEAvE,GAAuB,SAASmE;"}
|
|
1
|
+
{"version":3,"file":"InformationRequestForm.js","sources":["../../../../src/components/InformationRequests/InformationRequestForm/InformationRequestForm.tsx"],"sourcesContent":["import DOMPurify from 'dompurify'\nimport { 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-v-2025-11-15/react-query/informationRequestsGetInformationRequests'\nimport {\n useInformationRequestsSubmitMutation,\n mutationKeyInformationRequestsSubmit,\n} from '@gusto/embedded-api-v-2025-11-15/react-query/informationRequestsSubmit'\nimport type { RequiredQuestions } from '@gusto/embedded-api-v-2025-11-15/models/components/informationrequest'\nimport { ResponseType } from '@gusto/embedded-api-v-2025-11-15/models/components/informationrequest'\nimport { ResponseType as SubmitResponseType } from '@gusto/embedded-api-v-2025-11-15/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']\nconst dompurifyConfig = {\n ALLOWED_TAGS: ['a', 'b', 'strong'],\n ALLOWED_ATTR: ['target', 'href', 'rel'],\n}\n\n/* API does not enforce an upper limit, so set a reasonable character max for a single-line input. */\nconst MAX_TEXT_RESPONSE = 5000\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\n/**\n * Props for {@link InformationRequestForm}.\n *\n * @public\n */\nexport interface InformationRequestFormProps extends BaseComponentInterface<'InformationRequests.InformationRequestForm'> {\n /** The associated company identifier. */\n companyId: string\n /** The identifier of the information request to respond to. */\n requestId: string\n /** Event handler invoked when the form is submitted or cancelled. See the events table in {@link InformationRequestForm}. */\n onEvent: OnEventType<EventType, unknown>\n}\n\n/**\n * Dynamic response form for a single information request.\n *\n * Renders supported question types (text and document upload) based on the request's\n * `requiredQuestions` payload and submits responses to the Submit information request\n * endpoint. Use this component directly when you have built your own list or routing\n * surface and need to host the form — typically inside a modal or page you control.\n *\n * Requests with unsupported response types (e.g. `persona`-driven identity verification)\n * display a guidance message instead of the form; in those cases the user must complete\n * the request through your own integration with the underlying provider.\n *\n * Text inputs accept up to 5,000 characters. Document uploads are restricted to JPEG,\n * PNG, or PDF.\n *\n * @remarks\n * Events emitted via `onEvent`:\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `informationRequest/form/done` | Fired when the form is successfully submitted | The `informationRequest` field from the Submit information request response |\n * | `informationRequest/form/cancel` | Fired when the user cancels the form | — |\n *\n * @param props - See {@link InformationRequestFormProps}.\n * @returns The rendered information request response form.\n * @public\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(question => !SUPPORTED_RESPONSE_TYPES.includes(question.responseType))\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.informationRequests?.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.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 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 size=\"sm\" weight=\"medium\">\n {isDocumentType ? t('questionTypes.document') : t('questionTypes.answer')}\n </Text>\n <Text size=\"sm\" variant=\"supporting\">\n {/* SECURITY: XSS mitigated via DOMPurify with strict allowlist. Pattern matches TaxInputs.tsx */}\n <span\n dangerouslySetInnerHTML={{\n __html: DOMPurify.sanitize(question.questionText, dompurifyConfig),\n }}\n />\n </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 maxLength={MAX_TEXT_RESPONSE}\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.informationRequests?.find(req => req.uuid === selectedRequestId)\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","dompurifyConfig","MAX_TEXT_RESPONSE","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","DOMPurify","TextInputField","FileInputField","unsupportedPlaceholder","Flex","FormProvider","Form","Footer","Button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AArD,EAAE,WAAW,GAChB,GACF,IAKF,gBAAAqC,EAACM,GAAA,EAAK,gBAAe,YAAW,KAAK,IACnC,UAAA;AAAA,IAAA,gBAAA9D,EAACkE,GAAA,EAAO,SAAQ,aAAY,SAASM,GAAc,YAAYH,GAC5D,UAAAlD,EAAE,YAAY,EAAA,CACjB;AAAA,IACA,gBAAAnB;AAAA,MAACkE;AAAA,MAAA;AAAA,QACC,SAAQ;AAAA,QACR,MAAK;AAAA,QACL,MAAM1E;AAAA,QACN,WAAW6E;AAAA,QAEV,YAAE,YAAY;AAAA,MAAA;AAAA,IAAA;AAAA,EACjB,GACF;AAEJ;AAEAvE,GAAuB,SAASmE;"}
|
package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export interface InformationRequestListProps extends BaseComponentInterface<'Inf
|
|
|
16
16
|
* @remarks
|
|
17
17
|
* Renders status badges for each request and an extra "Payroll blocking" badge when the request is currently blocking payroll. Approved requests are filtered out of the list. Used as the top-level surface of `InformationRequests.InformationRequestsFlow`, but can be rendered directly when you want to host the response form yourself (e.g. in a custom modal or page).
|
|
18
18
|
*
|
|
19
|
+
* @events
|
|
19
20
|
* | Event | Description | Data |
|
|
20
21
|
* | ----- | ----------- | ---- |
|
|
21
22
|
* | `informationRequest/respond` | Fired when the user clicks "Respond" on an open request | `{ requestId: string }` |
|
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 { useInformationRequestsGetInformationRequestsSuspense } from '@gusto/embedded-api-v-2025-11-15/react-query/informationRequestsGetInformationRequests'\nimport type { InformationRequest } from '@gusto/embedded-api-v-2025-11-15/models/components/informationrequest'\nimport {\n InformationRequestStatus,\n InformationRequestType,\n} from '@gusto/embedded-api-v-2025-11-15/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\n/**\n * Props for {@link InformationRequestList}.\n *\n * @public\n */\nexport interface InformationRequestListProps extends BaseComponentInterface<'InformationRequests.InformationRequestList'> {\n /** The associated company identifier. */\n companyId: string\n /** Event callback. See the events table on {@link InformationRequestList} for emitted events. */\n onEvent: BaseComponentInterface['onEvent']\n}\n\n/**\n * Displays the list of outstanding information requests for a company with a \"Respond\" CTA on each open request.\n *\n * @remarks\n * Renders status badges for each request and an extra \"Payroll blocking\" badge when the request is currently blocking payroll. Approved requests are filtered out of the list. Used as the top-level surface of `InformationRequests.InformationRequestsFlow`, but can be rendered directly when you want to host the response form yourself (e.g. in a custom modal or page).\n *\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `informationRequest/respond` | Fired when the user clicks \"Respond\" on an open request | `{ requestId: string }` |\n *\n * @param props - See {@link InformationRequestListProps}.\n * @returns The rendered information request list.\n * @public\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({ companyId, dictionary, onEvent }: 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.informationRequests ?? []\n\n const visibleRequests = informationRequests.filter(\n request => request.status !== InformationRequestStatus.Approved,\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: () => (\n <EmptyData title={t('emptyTableTitle')} description={t('emptyTableDescription')} />\n ),\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 = 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 {visibleRequests.length > 0 && <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","onEvent","useComponentDictionary","useI18n","useTranslation","Heading","Text","Button","Badge","useComponentContext","data","useInformationRequestsGetInformationRequestsSuspense","visibleRequests","request","InformationRequestStatus","getTypeLabel","type","InformationRequestType","getStatusMapping","status","dataViewProps","useDataView","EmptyData","FlexItem","statusMapping","showPayrollBlockingBadge","jsxs","Flex","informationRequestEvents","DataView"],"mappings":";;;;;;;;;;;;;;
|
|
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-v-2025-11-15/react-query/informationRequestsGetInformationRequests'\nimport type { InformationRequest } from '@gusto/embedded-api-v-2025-11-15/models/components/informationrequest'\nimport {\n InformationRequestStatus,\n InformationRequestType,\n} from '@gusto/embedded-api-v-2025-11-15/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\n/**\n * Props for {@link InformationRequestList}.\n *\n * @public\n */\nexport interface InformationRequestListProps extends BaseComponentInterface<'InformationRequests.InformationRequestList'> {\n /** The associated company identifier. */\n companyId: string\n /** Event callback. See the events table on {@link InformationRequestList} for emitted events. */\n onEvent: BaseComponentInterface['onEvent']\n}\n\n/**\n * Displays the list of outstanding information requests for a company with a \"Respond\" CTA on each open request.\n *\n * @remarks\n * Renders status badges for each request and an extra \"Payroll blocking\" badge when the request is currently blocking payroll. Approved requests are filtered out of the list. Used as the top-level surface of `InformationRequests.InformationRequestsFlow`, but can be rendered directly when you want to host the response form yourself (e.g. in a custom modal or page).\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `informationRequest/respond` | Fired when the user clicks \"Respond\" on an open request | `{ requestId: string }` |\n *\n * @param props - See {@link InformationRequestListProps}.\n * @returns The rendered information request list.\n * @public\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({ companyId, dictionary, onEvent }: 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.informationRequests ?? []\n\n const visibleRequests = informationRequests.filter(\n request => request.status !== InformationRequestStatus.Approved,\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: () => (\n <EmptyData title={t('emptyTableTitle')} description={t('emptyTableDescription')} />\n ),\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 = 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 {visibleRequests.length > 0 && <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","onEvent","useComponentDictionary","useI18n","useTranslation","Heading","Text","Button","Badge","useComponentContext","data","useInformationRequestsGetInformationRequestsSuspense","visibleRequests","request","InformationRequestStatus","getTypeLabel","type","InformationRequestType","getStatusMapping","status","dataViewProps","useDataView","EmptyData","FlexItem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,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,IAAA,gBAAAD,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,GAChC,UAAA;AAAA,MAAA,gBAAA/B,EAACS,KAAQ,IAAG,MAAK,UAAS,MACvB,UAAA,EAAE,OAAO,GACZ;AAAA,MACCO,EAAgB,SAAS,uBAAMN,GAAA,EAAM,UAAA,EAAE,aAAa,EAAA,CAAE;AAAA,IAAA,GACzD;AAAA,sBAECuB,GAAA,EAAU,GAAGT,GAAe,OAAO,EAAE,OAAO,EAAA,CAAG;AAAA,EAAA,GAClD;AAEJ;"}
|
|
@@ -16,7 +16,7 @@ export interface InformationRequestsFlowProps extends Omit<BaseComponentInterfac
|
|
|
16
16
|
onEvent?: BaseComponentInterface['onEvent'];
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
19
|
+
* Hub for viewing and responding to outstanding information requests from Gusto.
|
|
20
20
|
*
|
|
21
21
|
* @remarks
|
|
22
22
|
* Renders the list of open and submitted information requests for a company and hosts the response form in a modal.
|
|
@@ -25,14 +25,39 @@ export interface InformationRequestsFlowProps extends Omit<BaseComponentInterfac
|
|
|
25
25
|
* Information requests can also block payroll processing; in that case they are surfaced inline within
|
|
26
26
|
* `Payroll.PayrollBlockerList`, which embeds this flow with `withAlert={false}` so the blocker list owns the alert UX.
|
|
27
27
|
*
|
|
28
|
+
* @events
|
|
28
29
|
* | Event | Description | Data |
|
|
29
30
|
* | ----- | ----------- | ---- |
|
|
30
31
|
* | `informationRequest/respond` | Fired when the user clicks "Respond" on a request and the form modal opens | `{ requestId: string }` |
|
|
31
32
|
* | `informationRequest/form/done` | Fired when an information request is successfully submitted | Response from the Submit information request endpoint |
|
|
32
33
|
* | `informationRequest/form/cancel` | Fired when the user cancels the response form (closes the modal without submitting) | — |
|
|
33
34
|
*
|
|
35
|
+
* Each piece is also exported as a standalone block (see the Sub-components
|
|
36
|
+
* table) for composing a custom workflow when this orchestration is the wrong
|
|
37
|
+
* fit. See the
|
|
38
|
+
* {@link https://sdk.gusto.com/docs/integration-guide/composition | Composition guide}
|
|
39
|
+
* for how to recompose these blocks into your own flow.
|
|
40
|
+
*
|
|
41
|
+
* @components
|
|
42
|
+
* - {@link InformationRequestList}
|
|
43
|
+
* - {@link InformationRequestForm}
|
|
44
|
+
*
|
|
34
45
|
* @param props - See {@link InformationRequestsFlowProps}.
|
|
35
46
|
* @returns The information requests flow surface.
|
|
36
47
|
* @public
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```tsx title="App.tsx"
|
|
51
|
+
* import { InformationRequests } from '@gusto/embedded-react-sdk'
|
|
52
|
+
*
|
|
53
|
+
* function MyApp() {
|
|
54
|
+
* return (
|
|
55
|
+
* <InformationRequests.InformationRequestsFlow
|
|
56
|
+
* companyId="a007e1ab-3595-43c2-ab4b-af7a5af2e365"
|
|
57
|
+
* onEvent={() => {}}
|
|
58
|
+
* />
|
|
59
|
+
* )
|
|
60
|
+
* }
|
|
61
|
+
* ```
|
|
37
62
|
*/
|
|
38
63
|
export declare function InformationRequestsFlow({ companyId, dictionary, withAlert, onEvent, }: InformationRequestsFlowProps): import("react").JSX.Element;
|