@gusto/embedded-react-sdk 0.51.2 → 0.52.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +44 -0
- package/dist/components/Base/Base.d.ts +2 -0
- package/dist/components/Base/Base.js.map +1 -1
- package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbsTypes.d.ts +1 -1
- package/dist/components/Common/OnboardingStatusBadge/index.d.ts +1 -1
- package/dist/components/Common/OnboardingStatusBadge/index.js.map +1 -1
- package/dist/components/Common/PaginationControl/PaginationControlTypes.d.ts +4 -1
- package/dist/components/Common/UI/Breadcrumbs/BreadcrumbsTypes.d.ts +1 -1
- package/dist/components/Common/UI/Breadcrumbs/BreadcrumbsTypes.js.map +1 -1
- package/dist/components/Common/UI/CheckboxGroup/CheckboxGroupTypes.d.ts +1 -1
- package/dist/components/Common/UI/CheckboxGroup/CheckboxGroupTypes.js.map +1 -1
- package/dist/components/Common/UI/ComboBox/ComboBoxTypes.d.ts +2 -2
- package/dist/components/Common/UI/DateRangePicker/DateRangePickerTypes.d.ts +3 -2
- package/dist/components/Common/UI/DescriptionList/DescriptionListTypes.d.ts +1 -1
- package/dist/components/Common/UI/DescriptionList/DescriptionListTypes.js.map +1 -1
- package/dist/components/Common/UI/FormBox/FormBox.d.ts +9 -0
- package/dist/components/Common/UI/FormBox/FormBox.js +13 -0
- package/dist/components/Common/UI/FormBox/FormBox.js.map +1 -0
- package/dist/components/Common/UI/FormBox/FormBox.module.scss.js +14 -0
- package/dist/components/Common/UI/FormBox/FormBox.module.scss.js.map +1 -0
- package/dist/components/Common/UI/FormBox/FormBoxTypes.d.ts +26 -0
- package/dist/components/Common/UI/FormBoxHeader/FormBoxHeader.d.ts +9 -0
- package/dist/components/Common/UI/FormBoxHeader/FormBoxHeader.js +23 -0
- package/dist/components/Common/UI/FormBoxHeader/FormBoxHeader.js.map +1 -0
- package/dist/components/Common/UI/FormBoxHeader/FormBoxHeader.module.scss.js +8 -0
- package/dist/components/Common/UI/FormBoxHeader/FormBoxHeader.module.scss.js.map +1 -0
- package/dist/components/Common/UI/FormBoxHeader/FormBoxHeaderTypes.d.ts +36 -0
- package/dist/components/Common/UI/FormBoxHeader/FormBoxHeaderTypes.js +7 -0
- package/dist/components/Common/UI/FormBoxHeader/FormBoxHeaderTypes.js.map +1 -0
- package/dist/components/Common/UI/FormBoxHeader/index.d.ts +1 -0
- package/dist/components/Common/UI/Input/InputTypes.d.ts +1 -0
- package/dist/components/Common/UI/Input/InputTypes.js.map +1 -1
- package/dist/components/Common/UI/Menu/MenuTypes.d.ts +3 -3
- package/dist/components/Common/UI/Menu/MenuTypes.js.map +1 -1
- package/dist/components/Common/UI/MultiSelectComboBox/MultiSelectComboBoxTypes.d.ts +2 -2
- package/dist/components/Common/UI/RadioGroup/RadioGroupTypes.d.ts +2 -2
- package/dist/components/Common/UI/RadioGroup/RadioGroupTypes.js.map +1 -1
- package/dist/components/Common/UI/Select/SelectTypes.d.ts +2 -2
- package/dist/components/Common/UI/Table/TableTypes.d.ts +4 -4
- package/dist/components/Common/UI/Table/TableTypes.js.map +1 -1
- package/dist/components/Common/UI/Tabs/TabsTypes.d.ts +2 -2
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.d.ts +1 -2
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +5 -3
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.d.ts +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +5 -3
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +7 -5
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Form.d.ts +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +5 -3
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.d.ts +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +5 -3
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/signCompanyFormSchema.d.ts +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.d.ts +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +10 -8
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +8 -6
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Form.d.ts +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +5 -3
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +5 -3
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +5 -3
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/payScheduleSchema.d.ts +3 -3
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/usePayScheduleForm.d.ts +1 -1
- package/dist/components/Company/StateTaxes/StateTaxes.d.ts +10 -1
- package/dist/components/Company/StateTaxes/StateTaxes.js +23 -17
- package/dist/components/Company/StateTaxes/StateTaxes.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesComponents.d.ts +2 -0
- package/dist/components/Company/StateTaxes/StateTaxesComponents.js +17 -10
- package/dist/components/Company/StateTaxes/StateTaxesComponents.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +5 -3
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js +26 -26
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.d.ts +9 -0
- package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js +24 -24
- package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +5 -3
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Contractor/Address/Address.d.ts +4 -3
- package/dist/components/Contractor/Address/Address.js.map +1 -1
- package/dist/components/Contractor/Address/shared/useContractorAddressForm/contractorAddressSchema.d.ts +2 -2
- package/dist/components/Contractor/Address/shared/useContractorAddressForm/useContractorAddressForm.d.ts +1 -1
- package/dist/components/Contractor/ContractorList/index.d.ts +2 -1
- package/dist/components/Contractor/ContractorList/index.js +123 -98
- package/dist/components/Contractor/ContractorList/index.js.map +1 -1
- package/dist/components/Contractor/Documents/SignatureForm/SignatureForm.js +22 -19
- package/dist/components/Contractor/Documents/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/contractorSignatureFormSchema.d.ts +1 -1
- package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/useContractorSignatureForm.d.ts +1 -1
- package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/w9Fields.d.ts +1 -1
- package/dist/components/Contractor/OnboardingFlow/OnboardingFlow.d.ts +1 -1
- package/dist/components/Contractor/OnboardingFlow/OnboardingFlow.js.map +1 -1
- package/dist/components/Contractor/OnboardingFlow/OnboardingFlowComponents.d.ts +2 -0
- package/dist/components/Contractor/OnboardingFlow/OnboardingFlowComponents.js.map +1 -1
- package/dist/components/Contractor/OnboardingFlow/onboardingStateMachine.js +150 -80
- package/dist/components/Contractor/OnboardingFlow/onboardingStateMachine.js.map +1 -1
- package/dist/components/Contractor/OnboardingFlow/onboardingStateMachine.test.d.ts +1 -0
- package/dist/components/Contractor/PaymentMethod/shared/useContractorBankAccountForm/useContractorBankAccountFormSchema.d.ts +1 -1
- package/dist/components/Contractor/PaymentMethod/shared/useContractorPaymentMethodForm/contractorPaymentMethodSchema.d.ts +1 -1
- package/dist/components/Contractor/PaymentMethod/shared/useContractorPaymentMethodForm/contractorPaymentMethodSchema.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/shared/useContractorPaymentMethodForm/useContractorPaymentMethodForm.d.ts +2 -2
- package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.d.ts +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js +2 -2
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummary.d.ts +17 -5
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummary.js +32 -31
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummary.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.d.ts +16 -4
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js +33 -29
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +1 -1
- package/dist/components/Contractor/Profile/BusinessSelfOnboardingProfile.js +19 -18
- package/dist/components/Contractor/Profile/BusinessSelfOnboardingProfile.js.map +1 -1
- package/dist/components/Contractor/Profile/ContractorProfile.d.ts +1 -1
- package/dist/components/Contractor/Profile/ContractorProfile.js +114 -110
- package/dist/components/Contractor/Profile/ContractorProfile.js.map +1 -1
- package/dist/components/Contractor/Profile/IndividualSelfOnboardingProfile.js +27 -26
- package/dist/components/Contractor/Profile/IndividualSelfOnboardingProfile.js.map +1 -1
- package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/contractorDetailsSchema.d.ts +1 -1
- package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/contractorDetailsSchema.js +6 -6
- package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/contractorDetailsSchema.js.map +1 -1
- package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/useContractorDetailsForm.d.ts +1 -1
- package/dist/components/Contractor/Submit/Submit.js +106 -63
- package/dist/components/Contractor/Submit/Submit.js.map +1 -1
- package/dist/components/Employee/Compensation/onboarding/Compensation.d.ts +0 -4
- package/dist/components/Employee/Compensation/onboarding/Compensation.js +38 -42
- package/dist/components/Employee/Compensation/onboarding/Compensation.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.d.ts +2 -2
- package/dist/components/Employee/Compensation/shared/useJobForm/jobSchema.d.ts +1 -1
- package/dist/components/Employee/Dashboard/index.d.ts +1 -1
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/childSupportGarnishmentFormSchema.d.ts +1 -1
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/useChildSupportGarnishmentForm.d.ts +1 -1
- package/dist/components/Employee/Deductions/shared/useDeductionForm/deductionFormSchema.d.ts +2 -2
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js +5 -3
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilitySchema.d.ts +2 -2
- package/dist/components/Employee/Documents/onboarding/EmployeeDocuments/EmployeeDocuments.js +1 -4
- package/dist/components/Employee/Documents/onboarding/EmployeeDocuments/EmployeeDocuments.js.map +1 -1
- package/dist/components/Employee/Documents/shared/useSignEmployeeForm/signEmployeeFormSchema.d.ts +2 -2
- package/dist/components/Employee/Documents/shared/useSignEmployeeForm/signEmployeeFormSchema.js +27 -32
- package/dist/components/Employee/Documents/shared/useSignEmployeeForm/signEmployeeFormSchema.js.map +1 -1
- package/dist/components/Employee/EmployeeList/shared/useEmployeeList.js +1 -2
- package/dist/components/Employee/EmployeeList/shared/useEmployeeList.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/federalTaxesSchema.d.ts +2 -2
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/useFederalTaxesForm.d.ts +1 -1
- package/dist/components/Employee/OnboardingExecutionFlow/onboardingExecutionStateMachine.d.ts +1 -1
- package/dist/components/Employee/OnboardingExecutionFlow/onboardingExecutionStateMachine.js +1 -3
- package/dist/components/Employee/OnboardingExecutionFlow/onboardingExecutionStateMachine.js.map +1 -1
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +55 -49
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankFormSchema.d.ts +1 -1
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/useSplitPaymentsFormSchema.d.ts +1 -1
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/employeeDetailsSchema.d.ts +2 -2
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/homeAddressSchema.d.ts +1 -1
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/useHomeAddressForm.d.ts +1 -1
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fields.d.ts +2 -2
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fields.js.map +1 -1
- package/dist/components/Employee/exports/employeeManagement.d.ts +1 -1
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.d.ts +4 -5
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js +101 -125
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestsComponents.d.ts +0 -5
- package/dist/components/InformationRequests/InformationRequestsComponents.js +12 -13
- package/dist/components/InformationRequests/InformationRequestsComponents.js.map +1 -1
- package/dist/components/Payroll/Dismissal/DismissalFlowComponents.js +4 -4
- package/dist/components/Payroll/Dismissal/DismissalFlowComponents.js.map +1 -1
- package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.d.ts +1 -1
- package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js +8 -8
- package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js.map +1 -1
- package/dist/components/Payroll/OffCycle/index.d.ts +1 -1
- package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes.d.ts +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +97 -92
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.d.ts +2 -3
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.d.ts +2 -2
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js +1 -1
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js +57 -56
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollExecutionFlow/PayrollExecutionFlow.d.ts +23 -6
- package/dist/components/Payroll/PayrollExecutionFlow/PayrollExecutionFlow.js +37 -33
- package/dist/components/Payroll/PayrollExecutionFlow/PayrollExecutionFlow.js.map +1 -1
- package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.js +2 -2
- package/dist/components/Payroll/PayrollFlow/PayrollExecutionFlowContextual.js +6 -6
- package/dist/components/Payroll/PayrollFlow/PayrollExecutionFlowContextual.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.js +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.d.ts +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.d.ts +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.d.ts +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +31 -31
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCases.d.ts +9 -5
- package/dist/components/Payroll/RecoveryCases/RecoveryCases.js.map +1 -1
- package/dist/components/Payroll/Transition/TransitionFlowComponents.d.ts +1 -1
- package/dist/components/Payroll/Transition/TransitionFlowComponents.js +1 -1
- package/dist/components/Payroll/Transition/TransitionFlowComponents.js.map +1 -1
- package/dist/components/Payroll/Transition/index.d.ts +1 -1
- package/dist/components/Payroll/helpers.d.ts +22 -8
- package/dist/components/Payroll/helpers.js +1 -1
- package/dist/components/Payroll/helpers.js.map +1 -1
- package/dist/components/Payroll/index.d.ts +3 -2
- package/dist/components/Payroll/payrollTypes.d.ts +1 -1
- package/dist/components/Payroll/payrollTypes.js +1 -1
- package/dist/components/Payroll/payrollTypes.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.d.ts +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.js +10 -8
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/components/TimeOff/TimeOffFlow/timeOffPolicyTypes.d.ts +1 -1
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/useSelectEmployeesData.js +19 -19
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/useSelectEmployeesData.js.map +1 -1
- package/dist/contexts/ApiProvider/ApiProvider.d.ts +5 -5
- package/dist/contexts/ApiProvider/ApiProvider.js.map +1 -1
- package/dist/contexts/ApiProvider/apiVersion.d.ts +2 -2
- package/dist/contexts/ApiProvider/apiVersion.js +1 -1
- package/dist/contexts/ApiProvider/apiVersion.js.map +1 -1
- package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js +40 -36
- package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js.map +1 -1
- package/dist/contexts/ComponentAdapter/componentAdapterTypes.d.ts +2 -0
- package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.d.ts +5 -0
- package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.js +18 -16
- package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.js.map +1 -1
- package/dist/contexts/ComponentAdapter/useComponentContext.d.ts +7 -1
- package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
- package/dist/contexts/GustoProvider/GustoProvider.d.ts +5 -5
- package/dist/contexts/GustoProvider/GustoProvider.js +6 -6
- package/dist/contexts/GustoProvider/GustoProvider.js.map +1 -1
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.d.ts +8 -7
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +8 -8
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/contexts/GustoProvider/index.d.ts +1 -1
- package/dist/contexts/ThemeProvider/types.d.ts +2 -2
- package/dist/contexts/index.d.ts +2 -6
- package/dist/i18n/en/Contractor.ContractorList.json.js +22 -18
- package/dist/i18n/en/Contractor.ContractorList.json.js.map +1 -1
- package/dist/i18n/en/Contractor.SignatureForm.json.js +5 -5
- package/dist/i18n/en/Contractor.Submit.json.js +11 -11
- package/dist/i18n/en/Employee.OnboardingSummary.json.js +24 -20
- package/dist/i18n/en/Employee.OnboardingSummary.json.js.map +1 -1
- package/dist/i18n/types.d.ts +15 -3
- package/dist/index.d.ts +8 -7
- package/dist/index.js +121 -134
- package/dist/index.js.map +1 -1
- package/dist/models/WA_RISK_CODES.d.ts +6 -2
- package/dist/models/WA_RISK_CODES.js.map +1 -1
- package/dist/models/external.d.ts +67 -57
- package/dist/partner-hook-utils/composeErrorHandler.d.ts +13 -4
- package/dist/partner-hook-utils/composeErrorHandler.js.map +1 -1
- package/dist/partner-hook-utils/form/SDKFormProvider.d.ts +11 -2
- package/dist/partner-hook-utils/form/SDKFormProvider.js +7 -1
- package/dist/partner-hook-utils/form/SDKFormProvider.js.map +1 -1
- package/dist/partner-hook-utils/form/composeSubmitHandler.d.ts +11 -4
- package/dist/partner-hook-utils/form/composeSubmitHandler.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/CheckboxHookField.d.ts +1 -0
- package/dist/partner-hook-utils/form/fields/CheckboxHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/DatePickerHookField.d.ts +1 -0
- package/dist/partner-hook-utils/form/fields/DatePickerHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/NumberInputHookField.d.ts +1 -0
- package/dist/partner-hook-utils/form/fields/NumberInputHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/RadioGroupHookField.d.ts +1 -0
- package/dist/partner-hook-utils/form/fields/RadioGroupHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/SelectHookField.d.ts +1 -0
- package/dist/partner-hook-utils/form/fields/SelectHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/SwitchHookField.d.ts +1 -0
- package/dist/partner-hook-utils/form/fields/SwitchHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/TextInputHookField.d.ts +1 -0
- package/dist/partner-hook-utils/form/fields/TextInputHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/index.d.ts +1 -0
- package/dist/partner-hook-utils/form/index.d.ts +3 -3
- package/dist/partner-hook-utils/form/useHookFieldResolution.js.map +1 -1
- package/dist/partner-hook-utils/index.d.ts +1 -1
- package/dist/partner-hook-utils/types.d.ts +16 -3
- package/dist/shared/constants.d.ts +12 -2
- package/dist/shared/constants.js +11 -10
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/Helpers.d.ts +13 -0
- package/dist/types/hooks.d.ts +2 -1
- package/dist/types/observability.d.ts +1 -0
- package/docs/guides/endpoint-inventory.json +396 -380
- package/package.json +17 -17
|
@@ -1,125 +1,150 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useTranslation as
|
|
3
|
-
import { useContractorsDeleteMutation as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
import { jsx as n, jsxs as C } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation as g } from "react-i18next";
|
|
3
|
+
import { useContractorsDeleteMutation as V } from "@gusto/embedded-api/react-query/contractorsDelete";
|
|
4
|
+
import { useContractorsUpdateOnboardingStatusMutation as j } from "@gusto/embedded-api/react-query/contractorsUpdateOnboardingStatus";
|
|
5
|
+
import { useContractors as q } from "./useContractorList.js";
|
|
6
|
+
import { Flex as N } from "../../Common/Flex/Flex.js";
|
|
7
|
+
import { EmptyData as W } from "../../Common/EmptyData/EmptyData.js";
|
|
8
|
+
import { ActionsLayout as b } from "../../Common/ActionsLayout/ActionsLayout.js";
|
|
9
|
+
import { HamburgerMenu as X } from "../../Common/HamburgerMenu/HamburgerMenu.js";
|
|
10
|
+
import { firstLastName as Y } from "../../../helpers/formattedStrings.js";
|
|
11
|
+
import z from "../../../assets/icons/pencil.svg.js";
|
|
12
|
+
import { useComponentContext as p } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
13
|
+
import { ContractorOnboardingStatusBadge as J } from "../../Common/OnboardingStatusBadge/index.js";
|
|
14
|
+
import { useI18n as K, useComponentDictionary as Q } from "../../../i18n/I18n.js";
|
|
15
|
+
import { BaseComponent as Z } from "../../Base/Base.js";
|
|
16
|
+
import { useBase as $ } from "../../Base/useBase.js";
|
|
17
|
+
import { CONTRACTOR_TYPE as tt, componentEvents as c, ContractorOnboardingStatus as u } from "../../../shared/constants.js";
|
|
18
|
+
import nt from "../../../assets/icons/trashcan.svg.js";
|
|
19
|
+
import et from "../../../assets/icons/x-circle.svg.js";
|
|
20
|
+
import { useDataView as ot } from "../../Common/DataView/useDataView.js";
|
|
21
|
+
import { DataView as at } from "../../Common/DataView/DataView.js";
|
|
22
|
+
function rt({ count: o, handleAdd: i }) {
|
|
23
|
+
const { Button: r, Heading: d } = p(), { t: e } = g("Contractor.ContractorList");
|
|
24
|
+
return /* @__PURE__ */ C(N, { alignItems: "center", justifyContent: "space-between", children: [
|
|
25
|
+
/* @__PURE__ */ n(d, { as: "h2", children: e("title") }),
|
|
26
|
+
o !== 0 && /* @__PURE__ */ n(r, { variant: "secondary", onClick: i, children: e("addAnotherCta") })
|
|
25
27
|
] });
|
|
26
28
|
}
|
|
27
|
-
function
|
|
28
|
-
const { Button:
|
|
29
|
-
return /* @__PURE__ */
|
|
29
|
+
function it({ handleAdd: o }) {
|
|
30
|
+
const { Button: i } = p(), { t: r } = g("Contractor.ContractorList");
|
|
31
|
+
return /* @__PURE__ */ n(W, { title: r("emptyTableTitle"), description: r("emptyTableDescription"), children: /* @__PURE__ */ n(b, { justifyContent: "center", children: /* @__PURE__ */ n(i, { onClick: o, children: r("addContractorCta") }) }) });
|
|
30
32
|
}
|
|
31
|
-
function
|
|
32
|
-
return /* @__PURE__ */
|
|
33
|
+
function It(o) {
|
|
34
|
+
return /* @__PURE__ */ n(Z, { ...o, children: /* @__PURE__ */ n(st, { ...o, children: o.children }) });
|
|
33
35
|
}
|
|
34
|
-
function
|
|
35
|
-
|
|
36
|
-
const { t:
|
|
37
|
-
contractors:
|
|
38
|
-
totalCount:
|
|
39
|
-
handleNextPage:
|
|
40
|
-
handleFirstPage:
|
|
41
|
-
handleLastPage:
|
|
36
|
+
function st({ companyId: o, className: i, dictionary: r, successMessage: d }) {
|
|
37
|
+
K("Contractor.ContractorList"), Q("Contractor.ContractorList", r);
|
|
38
|
+
const { t: e } = g("Contractor.ContractorList"), { onEvent: s, baseSubmitHandler: f } = $(), { Alert: S, Button: E } = p(), {
|
|
39
|
+
contractors: T,
|
|
40
|
+
totalCount: O,
|
|
41
|
+
handleNextPage: A,
|
|
42
|
+
handleFirstPage: L,
|
|
43
|
+
handleLastPage: R,
|
|
42
44
|
handlePreviousPage: D,
|
|
43
|
-
handleItemsPerPageChange:
|
|
44
|
-
currentPage:
|
|
45
|
-
totalPages:
|
|
46
|
-
itemsPerPage:
|
|
47
|
-
} =
|
|
45
|
+
handleItemsPerPageChange: P,
|
|
46
|
+
currentPage: I,
|
|
47
|
+
totalPages: _,
|
|
48
|
+
itemsPerPage: y
|
|
49
|
+
} = q({ companyUuid: o }), { mutateAsync: B, isPending: v } = V(), { mutateAsync: w, isPending: U } = j(), x = ot({
|
|
48
50
|
columns: [
|
|
49
51
|
{
|
|
50
|
-
title:
|
|
51
|
-
render: (
|
|
52
|
+
title: e("listHeaders.name"),
|
|
53
|
+
render: (t) => t.type === tt.BUSINESS ? t.businessName : Y({ first_name: t.firstName, last_name: t.lastName })
|
|
52
54
|
},
|
|
53
55
|
{
|
|
54
|
-
title:
|
|
55
|
-
render: ({ onboarded:
|
|
56
|
-
|
|
56
|
+
title: e("listHeaders.status"),
|
|
57
|
+
render: ({ onboarded: t, onboardingStatus: a }) => /* @__PURE__ */ n(
|
|
58
|
+
J,
|
|
57
59
|
{
|
|
58
|
-
onboarded:
|
|
59
|
-
onboardingStatus:
|
|
60
|
+
onboarded: t,
|
|
61
|
+
onboardingStatus: a
|
|
60
62
|
}
|
|
61
63
|
)
|
|
62
64
|
}
|
|
63
65
|
],
|
|
64
|
-
data:
|
|
65
|
-
itemMenu: (
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
{
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
onClick: () => {
|
|
73
|
-
_(e.uuid);
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
label: n("deleteCta"),
|
|
78
|
-
icon: /* @__PURE__ */ t(J, { "aria-hidden": !0 }),
|
|
79
|
-
onClick: () => {
|
|
80
|
-
x(e.uuid);
|
|
81
|
-
}
|
|
66
|
+
data: T,
|
|
67
|
+
itemMenu: (t) => {
|
|
68
|
+
const a = t.onboardingStatus === u.SELF_ONBOARDING_REVIEW, l = e(a ? "reviewCta" : "editCta"), H = t.onboardingStatus === u.SELF_ONBOARDING_INVITED || t.onboardingStatus === u.SELF_ONBOARDING_STARTED, m = [
|
|
69
|
+
{
|
|
70
|
+
label: l,
|
|
71
|
+
icon: /* @__PURE__ */ n(z, { "aria-hidden": !0 }),
|
|
72
|
+
onClick: () => {
|
|
73
|
+
M(t.uuid);
|
|
82
74
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
75
|
+
}
|
|
76
|
+
];
|
|
77
|
+
return H && m.push({
|
|
78
|
+
label: e("cancelSelfOnboardingCta"),
|
|
79
|
+
icon: /* @__PURE__ */ n(et, { "aria-hidden": !0 }),
|
|
80
|
+
onClick: () => {
|
|
81
|
+
G(t.uuid);
|
|
82
|
+
}
|
|
83
|
+
}), m.push({
|
|
84
|
+
label: e("deleteCta"),
|
|
85
|
+
icon: /* @__PURE__ */ n(nt, { "aria-hidden": !0 }),
|
|
86
|
+
onClick: () => {
|
|
87
|
+
F(t.uuid);
|
|
88
|
+
}
|
|
89
|
+
}), /* @__PURE__ */ n(
|
|
90
|
+
X,
|
|
91
|
+
{
|
|
92
|
+
items: m,
|
|
93
|
+
triggerLabel: l,
|
|
94
|
+
isLoading: v || U
|
|
95
|
+
}
|
|
96
|
+
);
|
|
97
|
+
},
|
|
98
|
+
emptyState: () => /* @__PURE__ */ n(it, { handleAdd: h }),
|
|
89
99
|
pagination: {
|
|
90
|
-
handleNextPage:
|
|
91
|
-
handleFirstPage:
|
|
92
|
-
handleLastPage:
|
|
100
|
+
handleNextPage: A,
|
|
101
|
+
handleFirstPage: L,
|
|
102
|
+
handleLastPage: R,
|
|
93
103
|
handlePreviousPage: D,
|
|
94
|
-
handleItemsPerPageChange:
|
|
95
|
-
currentPage:
|
|
96
|
-
totalPages:
|
|
97
|
-
totalCount:
|
|
98
|
-
itemsPerPage:
|
|
104
|
+
handleItemsPerPageChange: P,
|
|
105
|
+
currentPage: I,
|
|
106
|
+
totalPages: _,
|
|
107
|
+
totalCount: O,
|
|
108
|
+
itemsPerPage: y
|
|
99
109
|
}
|
|
100
|
-
}),
|
|
101
|
-
s(
|
|
102
|
-
},
|
|
103
|
-
s(
|
|
104
|
-
},
|
|
105
|
-
s(
|
|
106
|
-
},
|
|
107
|
-
await
|
|
110
|
+
}), h = () => {
|
|
111
|
+
s(c.CONTRACTOR_CREATE);
|
|
112
|
+
}, M = (t) => {
|
|
113
|
+
s(c.CONTRACTOR_UPDATE, { contractorId: t });
|
|
114
|
+
}, k = () => {
|
|
115
|
+
s(c.CONTRACTOR_ONBOARDING_CONTINUE);
|
|
116
|
+
}, F = async (t) => {
|
|
117
|
+
await f(t, async (a) => {
|
|
108
118
|
await B({
|
|
109
|
-
request: { contractorUuid:
|
|
110
|
-
}), s(
|
|
119
|
+
request: { contractorUuid: a }
|
|
120
|
+
}), s(c.CONTRACTOR_DELETED, { contractorId: a });
|
|
121
|
+
});
|
|
122
|
+
}, G = async (t) => {
|
|
123
|
+
await f(t, async (a) => {
|
|
124
|
+
const l = await w({
|
|
125
|
+
request: {
|
|
126
|
+
contractorUuid: a,
|
|
127
|
+
contractorOnboardingStatusUpdateRequestBody: {
|
|
128
|
+
onboardingStatus: u.ADMIN_ONBOARDING_INCOMPLETE
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
s(
|
|
133
|
+
c.CONTRACTOR_SELF_ONBOARDING_CANCELLED,
|
|
134
|
+
l.contractorOnboardingStatus
|
|
135
|
+
);
|
|
111
136
|
});
|
|
112
137
|
};
|
|
113
|
-
return /* @__PURE__ */
|
|
114
|
-
|
|
115
|
-
/* @__PURE__ */
|
|
116
|
-
/* @__PURE__ */
|
|
117
|
-
/* @__PURE__ */
|
|
118
|
-
/* @__PURE__ */
|
|
138
|
+
return /* @__PURE__ */ C("section", { className: i, children: [
|
|
139
|
+
d && /* @__PURE__ */ n(S, { label: d, status: "success" }),
|
|
140
|
+
/* @__PURE__ */ C(N, { flexDirection: "column", children: [
|
|
141
|
+
/* @__PURE__ */ n(rt, { count: O, handleAdd: h }),
|
|
142
|
+
/* @__PURE__ */ n(at, { label: e("contractorListLabel"), ...x }),
|
|
143
|
+
/* @__PURE__ */ n(b, { children: /* @__PURE__ */ n(E, { onClick: k, isLoading: !1, children: e("continueCta") }) })
|
|
119
144
|
] })
|
|
120
145
|
] });
|
|
121
146
|
}
|
|
122
147
|
export {
|
|
123
|
-
|
|
148
|
+
It as ContractorList
|
|
124
149
|
};
|
|
125
150
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/Contractor/ContractorList/index.tsx"],"sourcesContent":["import { type Contractor } from '@gusto/embedded-api/models/components/contractor'\nimport { useTranslation } from 'react-i18next'\nimport { useContractorsDeleteMutation } from '@gusto/embedded-api/react-query/contractorsDelete'\nimport { useContractors } from './useContractorList'\nimport { ActionsLayout, DataView, EmptyData, Flex, useDataView } from '@/components/Common'\nimport { firstLastName } from '@/helpers/formattedStrings'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu/HamburgerMenu'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { ContractorOnboardingStatusBadge } from '@/components/Common/OnboardingStatusBadge'\nimport { useI18n, useComponentDictionary } from '@/i18n'\nimport { BaseComponent, useBase, type BaseComponentInterface } from '@/components/Base'\nimport { componentEvents, CONTRACTOR_TYPE } from '@/shared/constants'\nimport TrashCanSvg from '@/assets/icons/trashcan.svg?react'\n\ninterface HeadProps {\n count: number\n handleAdd: () => void\n}\nfunction Head({ count, handleAdd }: HeadProps) {\n const { Button, Heading } = useComponentContext()\n const { t } = useTranslation('Contractor.ContractorList')\n\n return (\n <Flex alignItems=\"center\" justifyContent=\"space-between\">\n <Heading as=\"h2\">{t('title')}</Heading>\n\n {count !== 0 && (\n <Button variant=\"secondary\" onClick={handleAdd}>\n {t('addAnotherCta')}\n </Button>\n )}\n </Flex>\n )\n}\n\ninterface EmptyDataContractorsListProps {\n handleAdd: () => void\n}\nfunction EmptyDataContractorsList({ handleAdd }: EmptyDataContractorsListProps) {\n const { Button } = useComponentContext()\n const { t } = useTranslation('Contractor.ContractorList')\n\n return (\n <EmptyData title={t('emptyTableTitle')} description={t('emptyTableDescription')}>\n <ActionsLayout justifyContent=\"center\">\n <Button onClick={handleAdd}>{t('addContractorCta')}</Button>\n </ActionsLayout>\n </EmptyData>\n )\n}\n\n/**\n * Props for {@link ContractorList}.\n *\n * @public\n */\nexport interface ContractorListProps extends BaseComponentInterface<'Contractor.ContractorList'> {\n /** UUID of the company whose contractors should be listed. */\n companyId: string\n /** Success message to display in an alert above the list, typically after a create, update, or delete action. */\n successMessage?: string\n}\n\n/**\n * Lists a company's contractors with controls to add, edit, delete, and continue onboarding.\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `contractor/create` | The add-contractor action was triggered. | — |\n * | `contractor/update` | A contractor row's edit action was triggered. | `{ contractorId: string }` |\n * | `contractor/deleted` | A contractor was successfully deleted. | `{ contractorId: string }` |\n * | `contractor/onboarding/continue` | The continue action was triggered to advance onboarding. | — |\n *\n * @param props - See {@link ContractorListProps}.\n * @returns The rendered contractor list.\n * @public\n */\nexport function ContractorList(props: ContractorListProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ companyId, className, dictionary, successMessage }: ContractorListProps) {\n useI18n('Contractor.ContractorList')\n useComponentDictionary('Contractor.ContractorList', dictionary)\n const { t } = useTranslation('Contractor.ContractorList')\n const { onEvent, baseSubmitHandler } = useBase()\n const { Alert, Button } = useComponentContext()\n const {\n contractors,\n totalCount,\n handleNextPage,\n handleFirstPage,\n handleLastPage,\n handlePreviousPage,\n handleItemsPerPageChange,\n currentPage,\n totalPages,\n itemsPerPage,\n } = useContractors({ companyUuid: companyId })\n const { mutateAsync: deleteContractorMutation, isPending: isPendingDelete } =\n useContractorsDeleteMutation()\n\n const dataViewProps = useDataView<Contractor>({\n columns: [\n {\n title: t('listHeaders.name'),\n render: contractor =>\n contractor.type === CONTRACTOR_TYPE.BUSINESS\n ? contractor.businessName\n : firstLastName({ first_name: contractor.firstName, last_name: contractor.lastName }),\n },\n {\n title: t('listHeaders.status'),\n render: ({ onboarded, onboardingStatus }) => (\n <ContractorOnboardingStatusBadge\n onboarded={onboarded}\n onboardingStatus={onboardingStatus}\n />\n ),\n },\n ],\n data: contractors,\n itemMenu: contractor => (\n <HamburgerMenu\n items={[\n {\n label: t('editCta'),\n icon: <PencilSvg aria-hidden />,\n onClick: () => {\n handleEdit(contractor.uuid)\n },\n },\n {\n label: t('deleteCta'),\n icon: <TrashCanSvg aria-hidden />,\n onClick: () => {\n void handleDelete(contractor.uuid)\n },\n },\n ]}\n triggerLabel={t('editCta')}\n isLoading={isPendingDelete}\n />\n ),\n emptyState: () => <EmptyDataContractorsList handleAdd={handleAdd} />,\n pagination: {\n handleNextPage,\n handleFirstPage,\n handleLastPage,\n handlePreviousPage,\n handleItemsPerPageChange,\n currentPage,\n totalPages,\n totalCount,\n itemsPerPage,\n },\n })\n\n const handleAdd = () => {\n onEvent(componentEvents.CONTRACTOR_CREATE)\n }\n\n const handleEdit = (uuid: string) => {\n onEvent(componentEvents.CONTRACTOR_UPDATE, { contractorId: uuid })\n }\n\n const handleContinue = () => {\n onEvent(componentEvents.CONTRACTOR_ONBOARDING_CONTINUE)\n }\n\n const handleDelete = async (uuid: string) => {\n await baseSubmitHandler(uuid, async payload => {\n await deleteContractorMutation({\n request: { contractorUuid: payload },\n })\n\n onEvent(componentEvents.CONTRACTOR_DELETED, { contractorId: payload })\n })\n }\n\n return (\n <section className={className}>\n {successMessage && <Alert label={successMessage} status=\"success\" />}\n <Flex flexDirection=\"column\">\n <Head count={totalCount} handleAdd={handleAdd} />\n <DataView label={t('contractorListLabel')} {...dataViewProps} />\n <ActionsLayout>\n <Button onClick={handleContinue} isLoading={false}>\n {t('continueCta')}\n </Button>\n </ActionsLayout>\n </Flex>\n </section>\n )\n}\n"],"names":["Head","count","handleAdd","Button","Heading","useComponentContext","t","useTranslation","jsxs","Flex","jsx","EmptyDataContractorsList","EmptyData","ActionsLayout","ContractorList","props","BaseComponent","Root","companyId","className","dictionary","successMessage","useI18n","useComponentDictionary","onEvent","baseSubmitHandler","useBase","Alert","contractors","totalCount","handleNextPage","handleFirstPage","handleLastPage","handlePreviousPage","handleItemsPerPageChange","currentPage","totalPages","itemsPerPage","useContractors","deleteContractorMutation","isPendingDelete","useContractorsDeleteMutation","dataViewProps","useDataView","contractor","CONTRACTOR_TYPE","firstLastName","onboarded","onboardingStatus","ContractorOnboardingStatusBadge","HamburgerMenu","PencilSvg","handleEdit","TrashCanSvg","handleDelete","componentEvents","uuid","handleContinue","payload","DataView"],"mappings":";;;;;;;;;;;;;;;;;;;AAmBA,SAASA,EAAK,EAAE,OAAAC,GAAO,WAAAC,KAAwB;AAC7C,QAA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,IACzC,UAAAnD,EAAE,aAAa,EAAA,CAClB,EAAA,CACF;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/Contractor/ContractorList/index.tsx"],"sourcesContent":["import { type Contractor } from '@gusto/embedded-api/models/components/contractor'\nimport { useTranslation } from 'react-i18next'\nimport { useContractorsDeleteMutation } from '@gusto/embedded-api/react-query/contractorsDelete'\nimport { useContractorsUpdateOnboardingStatusMutation } from '@gusto/embedded-api/react-query/contractorsUpdateOnboardingStatus'\nimport { useContractors } from './useContractorList'\nimport { ActionsLayout, DataView, EmptyData, Flex, useDataView } from '@/components/Common'\nimport { firstLastName } from '@/helpers/formattedStrings'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu/HamburgerMenu'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { ContractorOnboardingStatusBadge } from '@/components/Common/OnboardingStatusBadge'\nimport { useI18n, useComponentDictionary } from '@/i18n'\nimport { BaseComponent, useBase, type BaseComponentInterface } from '@/components/Base'\nimport { componentEvents, CONTRACTOR_TYPE, ContractorOnboardingStatus } from '@/shared/constants'\nimport TrashCanSvg from '@/assets/icons/trashcan.svg?react'\nimport XCircleSvg from '@/assets/icons/x-circle.svg?react'\n\ninterface HeadProps {\n count: number\n handleAdd: () => void\n}\nfunction Head({ count, handleAdd }: HeadProps) {\n const { Button, Heading } = useComponentContext()\n const { t } = useTranslation('Contractor.ContractorList')\n\n return (\n <Flex alignItems=\"center\" justifyContent=\"space-between\">\n <Heading as=\"h2\">{t('title')}</Heading>\n\n {count !== 0 && (\n <Button variant=\"secondary\" onClick={handleAdd}>\n {t('addAnotherCta')}\n </Button>\n )}\n </Flex>\n )\n}\n\ninterface EmptyDataContractorsListProps {\n handleAdd: () => void\n}\nfunction EmptyDataContractorsList({ handleAdd }: EmptyDataContractorsListProps) {\n const { Button } = useComponentContext()\n const { t } = useTranslation('Contractor.ContractorList')\n\n return (\n <EmptyData title={t('emptyTableTitle')} description={t('emptyTableDescription')}>\n <ActionsLayout justifyContent=\"center\">\n <Button onClick={handleAdd}>{t('addContractorCta')}</Button>\n </ActionsLayout>\n </EmptyData>\n )\n}\n\n/**\n * Props for {@link ContractorList}.\n *\n * @public\n */\nexport interface ContractorListProps extends BaseComponentInterface<'Contractor.ContractorList'> {\n /** UUID of the company whose contractors should be listed. */\n companyId: string\n /** Success message to display in an alert above the list, typically after a create, update, or delete action. */\n successMessage?: string\n}\n\n/**\n * Lists a company's contractors with controls to add, edit, delete, cancel self-onboarding, and continue onboarding.\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `contractor/create` | The add-contractor action was triggered. | — |\n * | `contractor/update` | A contractor row's edit action was triggered. | `{ contractorId: string }` |\n * | `contractor/deleted` | A contractor was successfully deleted. | `{ contractorId: string }` |\n * | `contractor/selfOnboarding/cancelled` | A contractor's self-onboarding was cancelled, reverting them to admin onboarding. | The updated `contractorOnboardingStatus` returned by the API. |\n * | `contractor/onboarding/continue` | The continue action was triggered to advance onboarding. | — |\n *\n * @param props - See {@link ContractorListProps}.\n * @returns The rendered contractor list.\n * @public\n */\nexport function ContractorList(props: ContractorListProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ companyId, className, dictionary, successMessage }: ContractorListProps) {\n useI18n('Contractor.ContractorList')\n useComponentDictionary('Contractor.ContractorList', dictionary)\n const { t } = useTranslation('Contractor.ContractorList')\n const { onEvent, baseSubmitHandler } = useBase()\n const { Alert, Button } = useComponentContext()\n const {\n contractors,\n totalCount,\n handleNextPage,\n handleFirstPage,\n handleLastPage,\n handlePreviousPage,\n handleItemsPerPageChange,\n currentPage,\n totalPages,\n itemsPerPage,\n } = useContractors({ companyUuid: companyId })\n const { mutateAsync: deleteContractorMutation, isPending: isPendingDelete } =\n useContractorsDeleteMutation()\n const { mutateAsync: updateOnboardingStatusMutation, isPending: isPendingCancel } =\n useContractorsUpdateOnboardingStatusMutation()\n\n const dataViewProps = useDataView<Contractor>({\n columns: [\n {\n title: t('listHeaders.name'),\n render: contractor =>\n contractor.type === CONTRACTOR_TYPE.BUSINESS\n ? contractor.businessName\n : firstLastName({ first_name: contractor.firstName, last_name: contractor.lastName }),\n },\n {\n title: t('listHeaders.status'),\n render: ({ onboarded, onboardingStatus }) => (\n <ContractorOnboardingStatusBadge\n onboarded={onboarded}\n onboardingStatus={onboardingStatus}\n />\n ),\n },\n ],\n data: contractors,\n itemMenu: contractor => {\n const isAwaitingSelfOnboardingReview =\n contractor.onboardingStatus === ContractorOnboardingStatus.SELF_ONBOARDING_REVIEW\n const editLabel = isAwaitingSelfOnboardingReview ? t('reviewCta') : t('editCta')\n const canCancelSelfOnboarding =\n contractor.onboardingStatus === ContractorOnboardingStatus.SELF_ONBOARDING_INVITED ||\n contractor.onboardingStatus === ContractorOnboardingStatus.SELF_ONBOARDING_STARTED\n\n const menuItems = [\n {\n label: editLabel,\n icon: <PencilSvg aria-hidden />,\n onClick: () => {\n handleEdit(contractor.uuid)\n },\n },\n ]\n\n if (canCancelSelfOnboarding) {\n menuItems.push({\n label: t('cancelSelfOnboardingCta'),\n icon: <XCircleSvg aria-hidden />,\n onClick: () => {\n void handleCancelSelfOnboarding(contractor.uuid)\n },\n })\n }\n\n menuItems.push({\n label: t('deleteCta'),\n icon: <TrashCanSvg aria-hidden />,\n onClick: () => {\n void handleDelete(contractor.uuid)\n },\n })\n\n return (\n <HamburgerMenu\n items={menuItems}\n triggerLabel={editLabel}\n isLoading={isPendingDelete || isPendingCancel}\n />\n )\n },\n emptyState: () => <EmptyDataContractorsList handleAdd={handleAdd} />,\n pagination: {\n handleNextPage,\n handleFirstPage,\n handleLastPage,\n handlePreviousPage,\n handleItemsPerPageChange,\n currentPage,\n totalPages,\n totalCount,\n itemsPerPage,\n },\n })\n\n const handleAdd = () => {\n onEvent(componentEvents.CONTRACTOR_CREATE)\n }\n\n const handleEdit = (uuid: string) => {\n onEvent(componentEvents.CONTRACTOR_UPDATE, { contractorId: uuid })\n }\n\n const handleContinue = () => {\n onEvent(componentEvents.CONTRACTOR_ONBOARDING_CONTINUE)\n }\n\n const handleDelete = async (uuid: string) => {\n await baseSubmitHandler(uuid, async payload => {\n await deleteContractorMutation({\n request: { contractorUuid: payload },\n })\n\n onEvent(componentEvents.CONTRACTOR_DELETED, { contractorId: payload })\n })\n }\n\n const handleCancelSelfOnboarding = async (uuid: string) => {\n await baseSubmitHandler(uuid, async payload => {\n const response = await updateOnboardingStatusMutation({\n request: {\n contractorUuid: payload,\n contractorOnboardingStatusUpdateRequestBody: {\n onboardingStatus: ContractorOnboardingStatus.ADMIN_ONBOARDING_INCOMPLETE,\n },\n },\n })\n\n onEvent(\n componentEvents.CONTRACTOR_SELF_ONBOARDING_CANCELLED,\n response.contractorOnboardingStatus,\n )\n })\n }\n\n return (\n <section className={className}>\n {successMessage && <Alert label={successMessage} status=\"success\" />}\n <Flex flexDirection=\"column\">\n <Head count={totalCount} handleAdd={handleAdd} />\n <DataView label={t('contractorListLabel')} {...dataViewProps} />\n <ActionsLayout>\n <Button onClick={handleContinue} isLoading={false}>\n {t('continueCta')}\n </Button>\n </ActionsLayout>\n </Flex>\n </section>\n )\n}\n"],"names":["Head","count","handleAdd","Button","Heading","useComponentContext","t","useTranslation","jsxs","Flex","jsx","EmptyDataContractorsList","EmptyData","ActionsLayout","ContractorList","props","BaseComponent","Root","companyId","className","dictionary","successMessage","useI18n","useComponentDictionary","onEvent","baseSubmitHandler","useBase","Alert","contractors","totalCount","handleNextPage","handleFirstPage","handleLastPage","handlePreviousPage","handleItemsPerPageChange","currentPage","totalPages","itemsPerPage","useContractors","deleteContractorMutation","isPendingDelete","useContractorsDeleteMutation","updateOnboardingStatusMutation","isPendingCancel","useContractorsUpdateOnboardingStatusMutation","dataViewProps","useDataView","contractor","CONTRACTOR_TYPE","firstLastName","onboarded","onboardingStatus","ContractorOnboardingStatusBadge","isAwaitingSelfOnboardingReview","ContractorOnboardingStatus","editLabel","canCancelSelfOnboarding","menuItems","PencilSvg","handleEdit","XCircleSvg","handleCancelSelfOnboarding","TrashCanSvg","handleDelete","HamburgerMenu","componentEvents","uuid","handleContinue","payload","response","DataView"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAqBA,SAASA,GAAK,EAAE,OAAAC,GAAO,WAAAC,KAAwB;AAC7C,QAAM,EAAE,QAAAC,GAAQ,SAAAC,EAAA,IAAYC,EAAA,GACtB,EAAE,GAAAC,EAAA,IAAMC,EAAe,2BAA2B;AAExD,SACE,gBAAAC,EAACC,GAAA,EAAK,YAAW,UAAS,gBAAe,iBACvC,UAAA;AAAA,IAAA,gBAAAC,EAACN,GAAA,EAAQ,IAAG,MAAM,UAAAE,EAAE,OAAO,GAAE;AAAA,IAE5BL,MAAU,KACT,gBAAAS,EAACP,GAAA,EAAO,SAAQ,aAAY,SAASD,GAClC,UAAAI,EAAE,eAAe,EAAA,CACpB;AAAA,EAAA,GAEJ;AAEJ;AAKA,SAASK,GAAyB,EAAE,WAAAT,KAA4C;AAC9E,QAAM,EAAE,QAAAC,EAAA,IAAWE,EAAA,GACb,EAAE,GAAAC,EAAA,IAAMC,EAAe,2BAA2B;AAExD,SACE,gBAAAG,EAACE,KAAU,OAAON,EAAE,iBAAiB,GAAG,aAAaA,EAAE,uBAAuB,GAC5E,UAAA,gBAAAI,EAACG,KAAc,gBAAe,UAC5B,4BAACV,GAAA,EAAO,SAASD,GAAY,UAAAI,EAAE,kBAAkB,EAAA,CAAE,EAAA,CACrD,EAAA,CACF;AAEJ;AA8BO,SAASQ,GAAeC,GAA4B;AACzD,SACE,gBAAAL,EAACM,GAAA,EAAe,GAAGD,GACjB,UAAA,gBAAAL,EAACO,MAAM,GAAGF,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,SAASE,GAAK,EAAE,WAAAC,G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ragment as _ } from "react/jsx-runtime";
|
|
|
2
2
|
import { useTranslation as p, Trans as v } from "react-i18next";
|
|
3
3
|
import { useContractorSignatureForm as S } from "./useContractorSignatureForm/useContractorSignatureForm.js";
|
|
4
4
|
import { useComponentDictionary as F, useI18n as y } from "../../../../i18n/I18n.js";
|
|
5
|
-
import { BaseComponent as
|
|
6
|
-
import { useBase as
|
|
5
|
+
import { BaseComponent as T, BaseLayout as h } from "../../../Base/Base.js";
|
|
6
|
+
import { useBase as E } from "../../../Base/useBase.js";
|
|
7
7
|
import { Flex as l } from "../../../Common/Flex/Flex.js";
|
|
8
8
|
import { ActionsLayout as A } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
9
9
|
import { useComponentContext as f } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
@@ -13,11 +13,11 @@ import { SDKFormProvider as M } from "../../../../partner-hook-utils/form/SDKFor
|
|
|
13
13
|
import { contractorEvents as I, componentEvents as H } from "../../../../shared/constants.js";
|
|
14
14
|
const L = "https://www.irs.gov/forms-pubs/about-form-w-9";
|
|
15
15
|
function $(o) {
|
|
16
|
-
return /* @__PURE__ */ e(
|
|
16
|
+
return /* @__PURE__ */ e(T, { ...o, children: /* @__PURE__ */ e(N, { ...o }) });
|
|
17
17
|
}
|
|
18
18
|
function N({ documentUuid: o, dictionary: i }) {
|
|
19
19
|
F("Contractor.SignatureForm", i), y("Contractor.SignatureForm");
|
|
20
|
-
const { t: n } = p("Contractor.SignatureForm"), { onEvent: t } =
|
|
20
|
+
const { t: n } = p("Contractor.SignatureForm"), { onEvent: t } = E(), c = f(), r = S({ documentUuid: o });
|
|
21
21
|
if (r.isLoading)
|
|
22
22
|
return /* @__PURE__ */ e(h, { isLoading: !0, error: r.errorHandling.errors });
|
|
23
23
|
const { document: a, pdfUrl: d, hasFields: u } = r.data, { isPending: m } = r.status, { Agree: C } = r.form.Fields, x = async () => {
|
|
@@ -57,7 +57,7 @@ function N({ documentUuid: o, dictionary: i }) {
|
|
|
57
57
|
}
|
|
58
58
|
) })
|
|
59
59
|
] }),
|
|
60
|
-
u ? /* @__PURE__ */ e(
|
|
60
|
+
u ? /* @__PURE__ */ e(P, { hookResult: r }) : /* @__PURE__ */ e(
|
|
61
61
|
C,
|
|
62
62
|
{
|
|
63
63
|
label: n("agreeLabel"),
|
|
@@ -70,7 +70,7 @@ function N({ documentUuid: o, dictionary: i }) {
|
|
|
70
70
|
] })
|
|
71
71
|
] }) }) }) });
|
|
72
72
|
}
|
|
73
|
-
function
|
|
73
|
+
function P({ hookResult: o }) {
|
|
74
74
|
const { t: i } = p("Contractor.SignatureForm"), n = f(), { Fields: t, fieldsMetadata: c } = o.form, r = k(), a = {
|
|
75
75
|
REQUIRED: i("validation.required")
|
|
76
76
|
};
|
|
@@ -257,7 +257,7 @@ function R({ hookResult: o }) {
|
|
|
257
257
|
/* @__PURE__ */ e(n.Text, { variant: "supporting", children: i("sectionInstructions.certification") })
|
|
258
258
|
] }),
|
|
259
259
|
children: /* @__PURE__ */ s(l, { flexDirection: "column", gap: 16, children: [
|
|
260
|
-
/* @__PURE__ */ e(
|
|
260
|
+
/* @__PURE__ */ e(R, {}),
|
|
261
261
|
t.SignatureText && /* @__PURE__ */ e(
|
|
262
262
|
t.SignatureText,
|
|
263
263
|
{
|
|
@@ -277,21 +277,24 @@ function R({ hookResult: o }) {
|
|
|
277
277
|
)
|
|
278
278
|
] });
|
|
279
279
|
}
|
|
280
|
-
function
|
|
280
|
+
function R() {
|
|
281
281
|
const { t: o } = p("Contractor.SignatureForm"), i = f();
|
|
282
282
|
return /* @__PURE__ */ s(l, { flexDirection: "column", gap: 8, children: [
|
|
283
283
|
/* @__PURE__ */ e(i.Text, { weight: "medium", children: o("certificationIntro") }),
|
|
284
|
-
/* @__PURE__ */
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
284
|
+
/* @__PURE__ */ s(l, { flexDirection: "column", gap: 16, children: [
|
|
285
|
+
/* @__PURE__ */ e(
|
|
286
|
+
i.OrderedList,
|
|
287
|
+
{
|
|
288
|
+
items: [
|
|
289
|
+
/* @__PURE__ */ e(i.Text, { children: o("certificationPoints.taxpayerId") }, "taxpayerId"),
|
|
290
|
+
/* @__PURE__ */ e(i.Text, { children: o("certificationPoints.backupWithholding") }, "backupWithholding"),
|
|
291
|
+
/* @__PURE__ */ e(i.Text, { children: o("certificationPoints.usPerson") }, "usPerson"),
|
|
292
|
+
/* @__PURE__ */ e(i.Text, { children: o("certificationPoints.fatca") }, "fatca")
|
|
293
|
+
]
|
|
294
|
+
}
|
|
295
|
+
),
|
|
296
|
+
/* @__PURE__ */ e(i.Text, { variant: "supporting", size: "sm", children: o("certificationPoints.usPersonDefinition") })
|
|
297
|
+
] })
|
|
295
298
|
] });
|
|
296
299
|
}
|
|
297
300
|
function k() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignatureForm.js","sources":["../../../../../src/components/Contractor/Documents/SignatureForm/SignatureForm.tsx"],"sourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport {\n useContractorSignatureForm,\n type UseContractorSignatureFormReady,\n} from './useContractorSignatureForm'\nimport { useI18n, useComponentDictionary } from '@/i18n'\nimport type { BaseComponentInterface } from '@/components/Base/Base'\nimport { BaseComponent, BaseLayout } from '@/components/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { ActionsLayout, Flex } from '@/components/Common'\nimport { Form as FormLayout } from '@/components/Common/Form'\nimport { SDKFormProvider } from '@/partner-hook-utils/form/SDKFormProvider'\nimport { contractorEvents, componentEvents } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\n/** IRS instructions page for completing Form W-9. */\nconst W9_INSTRUCTIONS_URL = 'https://www.irs.gov/forms-pubs/about-form-w-9'\n\n/**\n * Props for {@link SignatureForm}.\n *\n * @public\n */\nexport interface SignatureFormProps extends BaseComponentInterface<'Contractor.SignatureForm'> {\n /** The UUID of the contractor document to sign. */\n documentUuid: string\n /** The associated contractor identifier. */\n contractorId: string\n}\n\n/**\n * Standalone form for signing an individual contractor document (W-9).\n *\n * @remarks\n * Lower-level building block used internally by `ContractorDocumentSigner` for\n * its signing view. Use this component directly when you need full control over\n * navigation between the document list and the signature form.\n *\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `contractor/documents/sign` | Fired when the document is successfully signed | The signed document |\n * | `CANCEL` | Fired when the user navigates back from the signature form | — |\n *\n * @param props - See {@link SignatureFormProps}.\n * @returns The rendered signature form.\n * @public\n */\nexport function SignatureForm(props: SignatureFormProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nfunction Root({ documentUuid, dictionary }: SignatureFormProps) {\n useComponentDictionary('Contractor.SignatureForm', dictionary)\n useI18n('Contractor.SignatureForm')\n const { t } = useTranslation('Contractor.SignatureForm')\n const { onEvent } = useBase()\n const Components = useComponentContext()\n\n const hookResult = useContractorSignatureForm({ documentUuid })\n\n if (hookResult.isLoading) {\n return <BaseLayout isLoading error={hookResult.errorHandling.errors} />\n }\n\n const { document, pdfUrl, hasFields } = hookResult.data\n const { isPending } = hookResult.status\n const { Agree } = hookResult.form.Fields\n\n const handleFormSubmit = async () => {\n const result = await hookResult.actions.onSubmit()\n if (result) {\n onEvent(contractorEvents.CONTRACTOR_SIGN_DOCUMENT, result.data)\n }\n }\n\n const handleBack = () => {\n onEvent(componentEvents.CANCEL)\n }\n\n return (\n <BaseLayout error={hookResult.errorHandling.errors}>\n <SDKFormProvider formHookResult={hookResult}>\n <FormLayout onSubmit={handleFormSubmit}>\n <Flex flexDirection=\"column\" gap={32} alignItems=\"stretch\">\n <Flex flexDirection=\"column\" gap={4}>\n <Components.Heading as=\"h2\">\n {document.title ?? t('signatureRequired')}\n </Components.Heading>\n <Components.Text variant=\"supporting\">\n <Components.Link\n href={W9_INSTRUCTIONS_URL}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n {t('instructions')}\n </Components.Link>\n </Components.Text>\n {pdfUrl && (\n <Components.Text variant=\"supporting\">\n <Trans\n t={t}\n i18nKey=\"downloadPrompt\"\n components={{\n downloadLink: (\n <Components.Link\n href={pdfUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n download={`${document.title || 'document'}.pdf`}\n />\n ),\n }}\n />\n </Components.Text>\n )}\n </Flex>\n\n {hasFields ? (\n <W9Fields hookResult={hookResult} />\n ) : (\n <Agree\n label={t('agreeLabel')}\n validationMessages={{ AGREE_REQUIRED: t('validation.agreeRequired') }}\n />\n )}\n\n <ActionsLayout>\n <Components.Button variant=\"secondary\" type=\"button\" onClick={handleBack}>\n {t('backCta')}\n </Components.Button>\n <Components.Button type=\"submit\" isDisabled={isPending}>\n {hasFields\n ? isPending\n ? t('signingCta')\n : t('signCta')\n : isPending\n ? t('acknowledgingCta')\n : t('acknowledgeCta')}\n </Components.Button>\n </ActionsLayout>\n </Flex>\n </FormLayout>\n </SDKFormProvider>\n </BaseLayout>\n )\n}\n\ninterface W9FieldsProps {\n hookResult: UseContractorSignatureFormReady\n}\n\nfunction W9Fields({ hookResult }: W9FieldsProps) {\n const { t } = useTranslation('Contractor.SignatureForm')\n const Components = useComponentContext()\n const { Fields, fieldsMetadata } = hookResult.form\n const copy = useSignatureFormCopy()\n\n const requiredMessages = {\n REQUIRED: t('validation.required'),\n }\n\n return (\n <>\n {/* Classification */}\n <Components.Box>\n <Flex flexDirection=\"column\" gap={16}>\n {Fields.Name && (\n <Fields.Name\n label={t('fields.name.label')}\n description={t('fields.name.description')}\n validationMessages={requiredMessages}\n />\n )}\n {Fields.BusinessName && (\n <Fields.BusinessName\n label={t('fields.business_name.label')}\n description={t('fields.business_name.description')}\n validationMessages={requiredMessages}\n />\n )}\n {Fields.TaxClassification && (\n <Fields.TaxClassification\n label={t('fields.taxClassification.label')}\n description={t('fields.taxClassification.description')}\n validationMessages={requiredMessages}\n getOptionLabel={value => copy.taxClassificationOptions[value] ?? value}\n />\n )}\n {Fields.LlcClassificationCode && (\n <Fields.LlcClassificationCode\n label={t('fields.llcClassificationCode.label')}\n description={t('fields.llcClassificationCode.description')}\n validationMessages={requiredMessages}\n placeholder={copy.llcPlaceholder}\n getOptionLabel={value => copy.llcClassificationOptions[value] ?? value}\n />\n )}\n {Fields.OtherText && (\n <Fields.OtherText\n label={t('fields.other_text.label')}\n validationMessages={requiredMessages}\n />\n )}\n {Fields.ForeignPartners && (\n <Fields.ForeignPartners\n label={t('fields.foreign_partners.label')}\n description={t('fields.foreign_partners.description')}\n />\n )}\n </Flex>\n </Components.Box>\n\n {/* Exemptions */}\n {(Fields.ExemptPayeeCode || Fields.ExemptionFromFatca) && (\n <Components.Box\n header={\n <Flex flexDirection=\"column\" gap={2}>\n <Components.Heading as=\"h3\">{t('sections.exemptions')}</Components.Heading>\n <Components.Text variant=\"supporting\">\n {t('sectionInstructions.exemptions')}\n </Components.Text>\n </Flex>\n }\n >\n <Flex flexDirection=\"column\" gap={16}>\n {Fields.ExemptPayeeCode && (\n <Fields.ExemptPayeeCode\n label={t('fields.exempt_payee_code.label')}\n validationMessages={requiredMessages}\n />\n )}\n {Fields.ExemptionFromFatca && (\n <Fields.ExemptionFromFatca\n label={t('fields.exemption_from_FATCA.label')}\n description={t('fields.exemption_from_FATCA.description')}\n validationMessages={requiredMessages}\n />\n )}\n </Flex>\n </Components.Box>\n )}\n\n {/* Address */}\n <Components.Box\n header={\n <Flex flexDirection=\"column\" gap={2}>\n <Components.Heading as=\"h3\">{t('sections.address')}</Components.Heading>\n <Components.Text variant=\"supporting\">\n {t('sectionInstructions.address')}\n </Components.Text>\n </Flex>\n }\n >\n <Flex flexDirection=\"column\" gap={16}>\n {Fields.HomeAddressStreet1 && (\n <Fields.HomeAddressStreet1\n label={t('fields.home_address_street_1.label')}\n validationMessages={requiredMessages}\n />\n )}\n {Fields.HomeAddressStreet2 && (\n <Fields.HomeAddressStreet2\n label={t('fields.home_address_street_2.label')}\n validationMessages={requiredMessages}\n />\n )}\n {Fields.HomeAddressCity && (\n <Fields.HomeAddressCity\n label={t('fields.home_address_city.label')}\n validationMessages={requiredMessages}\n />\n )}\n {Fields.HomeAddressState && (\n <Fields.HomeAddressState\n label={t('fields.home_address_state.label')}\n validationMessages={requiredMessages}\n />\n )}\n {Fields.HomeAddressZip && (\n <Fields.HomeAddressZip\n label={t('fields.home_address_zip.label')}\n validationMessages={requiredMessages}\n />\n )}\n {Fields.AccountNumber && (\n <Fields.AccountNumber\n label={t('fields.account_number.label')}\n validationMessages={requiredMessages}\n />\n )}\n {Fields.CompanyName && (\n <Fields.CompanyName\n label={t('fields.company_name.label')}\n validationMessages={requiredMessages}\n />\n )}\n </Flex>\n </Components.Box>\n\n {/* Taxpayer Identification Number */}\n {(Fields.Ssn || Fields.Ein) && (\n <Components.Box\n header={\n <Flex flexDirection=\"column\" gap={2}>\n <Components.Heading as=\"h3\">{t('sections.tin')}</Components.Heading>\n <Components.Text variant=\"supporting\">\n {t('sectionInstructions.tin')} {t('sectionInstructions.tinSecondary')}\n </Components.Text>\n </Flex>\n }\n >\n <Flex flexDirection=\"column\" gap={16}>\n {Fields.Ssn && (\n <Fields.Ssn\n label={t('fields.ssn.label')}\n validationMessages={{\n ...requiredMessages,\n INVALID_SSN: t('validation.invalidSsn'),\n }}\n placeholder={fieldsMetadata.ssn.placeholder}\n />\n )}\n {Fields.Ein && (\n <Fields.Ein\n label={t('fields.ein.label')}\n validationMessages={{\n ...requiredMessages,\n INVALID_EIN: t('validation.invalidEin'),\n }}\n placeholder={fieldsMetadata.ein.placeholder}\n />\n )}\n </Flex>\n </Components.Box>\n )}\n\n {/* Certification */}\n <Components.Box\n header={\n <Flex flexDirection=\"column\" gap={2}>\n <Components.Heading as=\"h3\">{t('sections.certification')}</Components.Heading>\n <Components.Text variant=\"supporting\">\n {t('sectionInstructions.certification')}\n </Components.Text>\n </Flex>\n }\n >\n <Flex flexDirection=\"column\" gap={16}>\n <CertificationDeclaration />\n {Fields.SignatureText && (\n <Fields.SignatureText\n label={t('fields.signature_text.label')}\n validationMessages={requiredMessages}\n />\n )}\n <Fields.Agree\n label={t('agreeLabel')}\n validationMessages={{ AGREE_REQUIRED: t('validation.agreeRequired') }}\n />\n </Flex>\n </Components.Box>\n </>\n )\n}\n\nfunction CertificationDeclaration() {\n const { t } = useTranslation('Contractor.SignatureForm')\n const Components = useComponentContext()\n\n return (\n <Flex flexDirection=\"column\" gap={8}>\n <Components.Text weight=\"medium\">{t('certificationIntro')}</Components.Text>\n <Components.OrderedList\n items={[\n <Components.Text key=\"taxpayerId\">{t('certificationPoints.taxpayerId')}</Components.Text>,\n <Components.Text key=\"backupWithholding\">\n {t('certificationPoints.backupWithholding')}\n </Components.Text>,\n <Components.Text key=\"usPerson\">{t('certificationPoints.usPerson')}</Components.Text>,\n <Components.Text key=\"fatca\">{t('certificationPoints.fatca')}</Components.Text>,\n ]}\n />\n </Flex>\n )\n}\n\n/**\n * Resolves the W-9 classification option copy into lookup maps keyed by option\n * value. Each entry uses a static translation key so the typed `t` surface stays\n * sound.\n */\nfunction useSignatureFormCopy() {\n const { t } = useTranslation('Contractor.SignatureForm')\n\n const taxClassificationOptions: Record<string, string> = {\n individual_proprietor: t('options.taxClassification.individual_proprietor'),\n c_corporation: t('options.taxClassification.c_corporation'),\n s_corporation: t('options.taxClassification.s_corporation'),\n partnership: t('options.taxClassification.partnership'),\n trust_estate: t('options.taxClassification.trust_estate'),\n limited_liability_company: t('options.taxClassification.limited_liability_company'),\n other: t('options.taxClassification.other'),\n }\n\n const llcClassificationOptions: Record<string, string> = {\n c: t('options.llcClassificationCode.c'),\n s: t('options.llcClassificationCode.s'),\n p: t('options.llcClassificationCode.p'),\n }\n\n return {\n taxClassificationOptions,\n llcClassificationOptions,\n llcPlaceholder: t('options.llcClassificationCode.placeholder'),\n }\n}\n"],"names":["W9_INSTRUCTIONS_URL","SignatureForm","props","jsx","BaseComponent","Root","documentUuid","dictionary","useComponentDictionary","useI18n","t","useTranslation","onEvent","useBase","Components","useComponentContext","hookResult","useContractorSignatureForm","BaseLayout","document","pdfUrl","hasFields","isPending","Agree","handleFormSubmit","result","contractorEvents","handleBack","componentEvents","SDKFormProvider","FormLayout","jsxs","Flex","Trans","W9Fields","ActionsLayout","Fields","fieldsMetadata","copy","useSignatureFormCopy","requiredMessages","Fragment","value","CertificationDeclaration","taxClassificationOptions","llcClassificationOptions"],"mappings":";;;;;;;;;;;;;AAgBA,MAAMA,IAAsB;AA+BrB,SAASC,EAAcC,GAA2B;AACvD,SACE,gBAAAC,EAACC,KAAe,GAAGF,GACjB,4BAACG,GAAA,EAAM,GAAGH,GAAO,EAAA,CACnB;AAEJ;AAEA,SAASG,EAAK,EAAE,cAAAC,GAAc,YAAAC,KAAkC;AAC9D,EAAAC,EAAuB,4BAA4BD,CAAU,GAC7DE,EAAQ,0BAA0B;AAClC,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,0BAA0B,GACjD,EAAE,SAAAC,EAAA,IAAYC,EAAA,GACdC,IAAaC,EAAA,GAEbC,IAAaC,EAA2B,EAAE,cAAAX,GAAc;AAE9D,MAAIU,EAAW;AACb,6BAAQE,GAAA,EAAW,WAAS,IAAC,OAAOF,EAAW,cAAc,QAAQ;AAGvE,QAAM,EAAE,UAAAG,GAAU,QAAAC,GAAQ,WAAAC,EAAA,IAAcL,EAAW,MAC7C,EAAE,WAAAM,MAAcN,EAAW,QAC3B,EAAE,OAAAO,EAAA,IAAUP,EAAW,KAAK,QAE5BQ,IAAmB,YAAY;AACnC,UAAMC,IAAS,MAAMT,EAAW,QAAQ,SAAA;AACxC,IAAIS,KACFb,EAAQc,EAAiB,0BAA0BD,EAAO,IAAI;AAAA,EAElE,GAEME,IAAa,MAAM;AACvB,IAAAf,EAAQgB,EAAgB,MAAM;AAAA,EAChC;AAEA,SACE,gBAAAzB,EAACe,KAAW,OAAOF,EAAW,cAAc,QAC1C,UAAA,gBAAA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m/SignatureForm.tsx"],"sourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport {\n useContractorSignatureForm,\n type UseContractorSignatureFormReady,\n} from './useContractorSignatureForm'\nimport { useI18n, useComponentDictionary } from '@/i18n'\nimport type { BaseComponentInterface } from '@/components/Base/Base'\nimport { BaseComponent, BaseLayout } from '@/components/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { ActionsLayout, Flex } from '@/components/Common'\nimport { Form as FormLayout } from '@/components/Common/Form'\nimport { SDKFormProvider } from '@/partner-hook-utils/form/SDKFormProvider'\nimport { contractorEvents, componentEvents } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\n/** IRS instructions page for completing Form W-9. */\nconst W9_INSTRUCTIONS_URL = 'https://www.irs.gov/forms-pubs/about-form-w-9'\n\n/**\n * Props for {@link SignatureForm}.\n *\n * @public\n */\nexport interface SignatureFormProps extends BaseComponentInterface<'Contractor.SignatureForm'> {\n /** The UUID of the contractor document to sign. */\n documentUuid: string\n /** The associated contractor identifier. */\n contractorId: string\n}\n\n/**\n * Standalone form for signing an individual contractor document (W-9).\n *\n * @remarks\n * Lower-level building block used internally by `ContractorDocumentSigner` for\n * its signing view. Use this component directly when you need full control over\n * navigation between the document list and the signature form.\n *\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `contractor/documents/sign` | Fired when the document is successfully signed | The signed document |\n * | `CANCEL` | Fired when the user navigates back from the signature form | — |\n *\n * @param props - See {@link SignatureFormProps}.\n * @returns The rendered signature form.\n * @public\n */\nexport function SignatureForm(props: SignatureFormProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nfunction Root({ documentUuid, dictionary }: SignatureFormProps) {\n useComponentDictionary('Contractor.SignatureForm', dictionary)\n useI18n('Contractor.SignatureForm')\n const { t } = useTranslation('Contractor.SignatureForm')\n const { onEvent } = useBase()\n const Components = useComponentContext()\n\n const hookResult = useContractorSignatureForm({ documentUuid })\n\n if (hookResult.isLoading) {\n return <BaseLayout isLoading error={hookResult.errorHandling.errors} />\n }\n\n const { document, pdfUrl, hasFields } = hookResult.data\n const { isPending } = hookResult.status\n const { Agree } = hookResult.form.Fields\n\n const handleFormSubmit = async () => {\n const result = await hookResult.actions.onSubmit()\n if (result) {\n onEvent(contractorEvents.CONTRACTOR_SIGN_DOCUMENT, result.data)\n }\n }\n\n const handleBack = () => {\n onEvent(componentEvents.CANCEL)\n }\n\n return (\n <BaseLayout error={hookResult.errorHandling.errors}>\n <SDKFormProvider formHookResult={hookResult}>\n <FormLayout onSubmit={handleFormSubmit}>\n <Flex flexDirection=\"column\" gap={32} alignItems=\"stretch\">\n <Flex flexDirection=\"column\" gap={4}>\n <Components.Heading as=\"h2\">\n {document.title ?? t('signatureRequired')}\n </Components.Heading>\n <Components.Text variant=\"supporting\">\n <Components.Link\n href={W9_INSTRUCTIONS_URL}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n {t('instructions')}\n </Components.Link>\n </Components.Text>\n {pdfUrl && (\n <Components.Text variant=\"supporting\">\n <Trans\n t={t}\n i18nKey=\"downloadPrompt\"\n components={{\n downloadLink: (\n <Components.Link\n href={pdfUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n download={`${document.title || 'document'}.pdf`}\n />\n ),\n }}\n />\n </Components.Text>\n )}\n </Flex>\n\n {hasFields ? (\n <W9Fields hookResult={hookResult} />\n ) : (\n <Agree\n label={t('agreeLabel')}\n validationMessages={{ AGREE_REQUIRED: t('validation.agreeRequired') }}\n />\n )}\n\n <ActionsLayout>\n <Components.Button variant=\"secondary\" type=\"button\" onClick={handleBack}>\n {t('backCta')}\n </Components.Button>\n <Components.Button type=\"submit\" isDisabled={isPending}>\n {hasFields\n ? isPending\n ? t('signingCta')\n : t('signCta')\n : isPending\n ? t('acknowledgingCta')\n : t('acknowledgeCta')}\n </Components.Button>\n </ActionsLayout>\n </Flex>\n </FormLayout>\n </SDKFormProvider>\n </BaseLayout>\n )\n}\n\ninterface W9FieldsProps {\n hookResult: UseContractorSignatureFormReady\n}\n\nfunction W9Fields({ hookResult }: W9FieldsProps) {\n const { t } = useTranslation('Contractor.SignatureForm')\n const Components = useComponentContext()\n const { Fields, fieldsMetadata } = hookResult.form\n const copy = useSignatureFormCopy()\n\n const requiredMessages = {\n REQUIRED: t('validation.required'),\n }\n\n return (\n <>\n {/* Classification */}\n <Components.Box>\n <Flex flexDirection=\"column\" gap={16}>\n {Fields.Name && (\n <Fields.Name\n label={t('fields.name.label')}\n description={t('fields.name.description')}\n validationMessages={requiredMessages}\n />\n )}\n {Fields.BusinessName && (\n <Fields.BusinessName\n label={t('fields.business_name.label')}\n description={t('fields.business_name.description')}\n validationMessages={requiredMessages}\n />\n )}\n {Fields.TaxClassification && (\n <Fields.TaxClassification\n label={t('fields.taxClassification.label')}\n description={t('fields.taxClassification.description')}\n validationMessages={requiredMessages}\n getOptionLabel={value => copy.taxClassificationOptions[value] ?? value}\n />\n )}\n {Fields.LlcClassificationCode && (\n <Fields.LlcClassificationCode\n label={t('fields.llcClassificationCode.label')}\n description={t('fields.llcClassificationCode.description')}\n validationMessages={requiredMessages}\n placeholder={copy.llcPlaceholder}\n getOptionLabel={value => copy.llcClassificationOptions[value] ?? value}\n />\n )}\n {Fields.OtherText && (\n <Fields.OtherText\n label={t('fields.other_text.label')}\n validationMessages={requiredMessages}\n />\n )}\n {Fields.ForeignPartners && (\n <Fields.ForeignPartners\n label={t('fields.foreign_partners.label')}\n description={t('fields.foreign_partners.description')}\n />\n )}\n </Flex>\n </Components.Box>\n\n {/* Exemptions */}\n {(Fields.ExemptPayeeCode || Fields.ExemptionFromFatca) && (\n <Components.Box\n header={\n <Flex flexDirection=\"column\" gap={2}>\n <Components.Heading as=\"h3\">{t('sections.exemptions')}</Components.Heading>\n <Components.Text variant=\"supporting\">\n {t('sectionInstructions.exemptions')}\n </Components.Text>\n </Flex>\n }\n >\n <Flex flexDirection=\"column\" gap={16}>\n {Fields.ExemptPayeeCode && (\n <Fields.ExemptPayeeCode\n label={t('fields.exempt_payee_code.label')}\n validationMessages={requiredMessages}\n />\n )}\n {Fields.ExemptionFromFatca && (\n <Fields.ExemptionFromFatca\n label={t('fields.exemption_from_FATCA.label')}\n description={t('fields.exemption_from_FATCA.description')}\n validationMessages={requiredMessages}\n />\n )}\n </Flex>\n </Components.Box>\n )}\n\n {/* Address */}\n <Components.Box\n header={\n <Flex flexDirection=\"column\" gap={2}>\n <Components.Heading as=\"h3\">{t('sections.address')}</Components.Heading>\n <Components.Text variant=\"supporting\">\n {t('sectionInstructions.address')}\n </Components.Text>\n </Flex>\n }\n >\n <Flex flexDirection=\"column\" gap={16}>\n {Fields.HomeAddressStreet1 && (\n <Fields.HomeAddressStreet1\n label={t('fields.home_address_street_1.label')}\n validationMessages={requiredMessages}\n />\n )}\n {Fields.HomeAddressStreet2 && (\n <Fields.HomeAddressStreet2\n label={t('fields.home_address_street_2.label')}\n validationMessages={requiredMessages}\n />\n )}\n {Fields.HomeAddressCity && (\n <Fields.HomeAddressCity\n label={t('fields.home_address_city.label')}\n validationMessages={requiredMessages}\n />\n )}\n {Fields.HomeAddressState && (\n <Fields.HomeAddressState\n label={t('fields.home_address_state.label')}\n validationMessages={requiredMessages}\n />\n )}\n {Fields.HomeAddressZip && (\n <Fields.HomeAddressZip\n label={t('fields.home_address_zip.label')}\n validationMessages={requiredMessages}\n />\n )}\n {Fields.AccountNumber && (\n <Fields.AccountNumber\n label={t('fields.account_number.label')}\n validationMessages={requiredMessages}\n />\n )}\n {Fields.CompanyName && (\n <Fields.CompanyName\n label={t('fields.company_name.label')}\n validationMessages={requiredMessages}\n />\n )}\n </Flex>\n </Components.Box>\n\n {/* Taxpayer Identification Number */}\n {(Fields.Ssn || Fields.Ein) && (\n <Components.Box\n header={\n <Flex flexDirection=\"column\" gap={2}>\n <Components.Heading as=\"h3\">{t('sections.tin')}</Components.Heading>\n <Components.Text variant=\"supporting\">\n {t('sectionInstructions.tin')} {t('sectionInstructions.tinSecondary')}\n </Components.Text>\n </Flex>\n }\n >\n <Flex flexDirection=\"column\" gap={16}>\n {Fields.Ssn && (\n <Fields.Ssn\n label={t('fields.ssn.label')}\n validationMessages={{\n ...requiredMessages,\n INVALID_SSN: t('validation.invalidSsn'),\n }}\n placeholder={fieldsMetadata.ssn.placeholder}\n />\n )}\n {Fields.Ein && (\n <Fields.Ein\n label={t('fields.ein.label')}\n validationMessages={{\n ...requiredMessages,\n INVALID_EIN: t('validation.invalidEin'),\n }}\n placeholder={fieldsMetadata.ein.placeholder}\n />\n )}\n </Flex>\n </Components.Box>\n )}\n\n {/* Certification */}\n <Components.Box\n header={\n <Flex flexDirection=\"column\" gap={2}>\n <Components.Heading as=\"h3\">{t('sections.certification')}</Components.Heading>\n <Components.Text variant=\"supporting\">\n {t('sectionInstructions.certification')}\n </Components.Text>\n </Flex>\n }\n >\n <Flex flexDirection=\"column\" gap={16}>\n <CertificationDeclaration />\n {Fields.SignatureText && (\n <Fields.SignatureText\n label={t('fields.signature_text.label')}\n validationMessages={requiredMessages}\n />\n )}\n <Fields.Agree\n label={t('agreeLabel')}\n validationMessages={{ AGREE_REQUIRED: t('validation.agreeRequired') }}\n />\n </Flex>\n </Components.Box>\n </>\n )\n}\n\nfunction CertificationDeclaration() {\n const { t } = useTranslation('Contractor.SignatureForm')\n const Components = useComponentContext()\n\n return (\n <Flex flexDirection=\"column\" gap={8}>\n <Components.Text weight=\"medium\">{t('certificationIntro')}</Components.Text>\n <Flex flexDirection=\"column\" gap={16}>\n <Components.OrderedList\n items={[\n <Components.Text key=\"taxpayerId\">\n {t('certificationPoints.taxpayerId')}\n </Components.Text>,\n <Components.Text key=\"backupWithholding\">\n {t('certificationPoints.backupWithholding')}\n </Components.Text>,\n <Components.Text key=\"usPerson\">{t('certificationPoints.usPerson')}</Components.Text>,\n <Components.Text key=\"fatca\">{t('certificationPoints.fatca')}</Components.Text>,\n ]}\n />\n <Components.Text variant=\"supporting\" size=\"sm\">\n {t('certificationPoints.usPersonDefinition')}\n </Components.Text>\n </Flex>\n </Flex>\n )\n}\n\n/**\n * Resolves the W-9 classification option copy into lookup maps keyed by option\n * value. Each entry uses a static translation key so the typed `t` surface stays\n * sound.\n */\nfunction useSignatureFormCopy() {\n const { t } = useTranslation('Contractor.SignatureForm')\n\n const taxClassificationOptions: Record<string, string> = {\n individual_proprietor: t('options.taxClassification.individual_proprietor'),\n c_corporation: t('options.taxClassification.c_corporation'),\n s_corporation: t('options.taxClassification.s_corporation'),\n partnership: t('options.taxClassification.partnership'),\n trust_estate: t('options.taxClassification.trust_estate'),\n limited_liability_company: t('options.taxClassification.limited_liability_company'),\n other: t('options.taxClassification.other'),\n }\n\n const llcClassificationOptions: Record<string, string> = {\n c: t('options.llcClassificationCode.c'),\n s: t('options.llcClassificationCode.s'),\n p: t('options.llcClassificationCode.p'),\n }\n\n return {\n taxClassificationOptions,\n llcClassificationOptions,\n llcPlaceholder: t('options.llcClassificationCode.placeholder'),\n }\n}\n"],"names":["W9_INSTRUCTIONS_URL","SignatureForm","props","jsx","BaseComponent","Root","documentUuid","dictionary","useComponentDictionary","useI18n","t","useTranslation","onEvent","useBase","Components","useComponentContext","hookResult","useContractorSignatureForm","BaseLayout","document","pdfUrl","hasFields","isPending","Agree","handleFormSubmit","result","contractorEvents","handleBack","componentEvents","SDKFormProvider","FormLayout","jsxs","Flex","Trans","W9Fields","ActionsLayout","Fields","fieldsMetadata","copy","useSignatureFormCopy","requiredMessages","Fragment","value","CertificationDeclaration","taxClassificationOptions","llcClassificationOptions"],"mappings":";;;;;;;;;;;;;AAgBA,MAAMA,IAAsB;AA+BrB,SAASC,EAAcC,GAA2B;AACvD,SACE,gBAAAC,EAACC,KAAe,GAAGF,GACjB,4BAACG,GAAA,EAAM,GAAGH,GAAO,EAAA,CACnB;AAEJ;AAEA,SAASG,EAAK,EAAE,cAAAC,GAAc,YAAAC,KAAkC;AAC9D,EAAAC,EAAuB,4BAA4BD,CAAU,GAC7DE,EAAQ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KAAtC,OAAwC;AAAA,UAAA;AAAA,QAC/D;AAAA,MAAA;AAAA,MAEF,gBAAAP,EAACW,EAAW,MAAX,EAAgB,SAAQ,cAAa,MAAK,MACxC,UAAAJ,EAAE,wCAAwC,EAAA,CAC7C;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;AAOA,SAAS6B,IAAuB;AAC9B,QAAM,EAAE,GAAA7B,EAAA,IAAMC,EAAe,0BAA0B,GAEjDiC,IAAmD;AAAA,IACvD,uBAAuBlC,EAAE,iDAAiD;AAAA,IAC1E,eAAeA,EAAE,yCAAyC;AAAA,IAC1D,eAAeA,EAAE,yCAAyC;AAAA,IAC1D,aAAaA,EAAE,uCAAuC;AAAA,IACtD,cAAcA,EAAE,wCAAwC;AAAA,IACxD,2BAA2BA,EAAE,qDAAqD;AAAA,IAClF,OAAOA,EAAE,iCAAiC;AAAA,EAAA,GAGtCmC,IAAmD;AAAA,IACvD,GAAGnC,EAAE,iCAAiC;AAAA,IACtC,GAAGA,EAAE,iCAAiC;AAAA,IACtC,GAAGA,EAAE,iCAAiC;AAAA,EAAA;AAGxC,SAAO;AAAA,IACL,0BAAAkC;AAAA,IACA,0BAAAC;AAAA,IACA,gBAAgBnC,EAAE,2CAA2C;AAAA,EAAA;AAEjE;"}
|
|
@@ -97,7 +97,7 @@ export type ContractorSignatureFormOutputs = ContractorSignatureFormData;
|
|
|
97
97
|
*
|
|
98
98
|
* @public
|
|
99
99
|
*/
|
|
100
|
-
export type ContractorSignatureOptionalFieldsToRequire = { create?: ("
|
|
100
|
+
export type ContractorSignatureOptionalFieldsToRequire = { create?: ("accountNumber" | "businessName" | "companyName" | "exemptPayeeCode" | "exemptionFromFatca" | "foreignPartners" | "homeAddressStreet2" | "llcClassificationCode" | "otherText")[] | undefined; update?: ("accountNumber" | "businessName" | "companyName" | "exemptPayeeCode" | "exemptionFromFatca" | "foreignPartners" | "homeAddressStreet2" | "llcClassificationCode" | "otherText")[] | undefined; };
|
|
101
101
|
/**
|
|
102
102
|
* Options for {@link createContractorSignatureFormSchema}.
|
|
103
103
|
*
|
|
@@ -63,7 +63,7 @@ export type UseContractorSignatureFormResult = HookLoadingResult | UseContractor
|
|
|
63
63
|
*
|
|
64
64
|
* @public
|
|
65
65
|
*/
|
|
66
|
-
export type ContractorSignatureFieldsMetadata = { name: FieldMetadata; businessName: FieldMetadata; taxClassification: import("../../../../../partner-hook-utils/types").FieldMetadataWithOptions<"
|
|
66
|
+
export type ContractorSignatureFieldsMetadata = { name: FieldMetadata; businessName: FieldMetadata; taxClassification: import("../../../../../partner-hook-utils/types").FieldMetadataWithOptions<"c_corporation" | "individual_proprietor" | "limited_liability_company" | "other" | "partnership" | "s_corporation" | "trust_estate">; llcClassificationCode: import("../../../../../partner-hook-utils/types").FieldMetadataWithOptions<"c" | "p" | "s">; otherText: FieldMetadata; foreignPartners: FieldMetadata; exemptPayeeCode: FieldMetadata; exemptionFromFatca: FieldMetadata; homeAddressStreet1: FieldMetadata; homeAddressStreet2: FieldMetadata; homeAddressCity: FieldMetadata; homeAddressState: FieldMetadata; homeAddressZip: FieldMetadata; accountNumber: FieldMetadata; companyName: FieldMetadata; ssn: FieldMetadata; ein: FieldMetadata; signatureText: FieldMetadata; agree: FieldMetadata; };
|
|
67
67
|
/**
|
|
68
68
|
* Headless hook for signing a contractor document — collects the document's
|
|
69
69
|
* fields plus a typed signature and consent.
|
package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/w9Fields.d.ts
CHANGED
|
@@ -79,7 +79,7 @@ export declare const TAX_CLASSIFICATION_OPTION_KEYS: readonly ["individual_propr
|
|
|
79
79
|
*
|
|
80
80
|
* @internal
|
|
81
81
|
*/
|
|
82
|
-
export type TaxClassificationOptionKey =
|
|
82
|
+
export type TaxClassificationOptionKey = "c_corporation" | "individual_proprietor" | "limited_liability_company" | "other" | "partnership" | "s_corporation" | "trust_estate";
|
|
83
83
|
/**
|
|
84
84
|
* The classification option that reveals the LLC tax classification select.
|
|
85
85
|
*
|
|
@@ -27,7 +27,7 @@ import { OnboardingFlowProps } from './OnboardingFlowComponents';
|
|
|
27
27
|
* | `contractor/onboarding/continue` | Fired when the user chooses to continue onboarding a contractor | — |
|
|
28
28
|
* | `contractor/created` | Fired when a new contractor is created successfully | Create contractor API response |
|
|
29
29
|
* | `contractor/updated` | Fired when an existing contractor is updated | Update contractor API response |
|
|
30
|
-
* | `contractor/profile/done` | Fired when the contractor profile step is complete | `{ contractorId: string, selfOnboarding: boolean }` |
|
|
30
|
+
* | `contractor/profile/done` | Fired when the contractor profile step is complete | `{ contractorId: string, onboardingStatus?: string, selfOnboarding: boolean }` |
|
|
31
31
|
* | `contractor/address/updated` | Fired when the contractor address is updated | Create or update contractor address API response |
|
|
32
32
|
* | `contractor/address/done` | Fired when the address step is complete | — |
|
|
33
33
|
* | `contractor/bankAccount/created` | Fired when a bank account is created for the contractor | Create contractor bank account API response |
|