@gusto/embedded-react-sdk 0.51.2 → 0.52.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 +28 -0
- 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/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/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.d.ts +1 -2
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.d.ts +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Form.d.ts +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.d.ts +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/Locations/LocationForm/Form.d.ts +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/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/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.js +95 -92
- 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/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/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/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/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/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.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 +6 -0
- package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
- package/dist/contexts/GustoProvider/GustoProvider.d.ts +4 -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 +7 -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/index.d.ts +2 -6
- package/dist/i18n/en/Contractor.ContractorList.json.js +18 -16
- 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/Employee.OnboardingSummary.json.js +24 -20
- package/dist/i18n/en/Employee.OnboardingSummary.json.js.map +1 -1
- package/dist/i18n/types.d.ts +8 -0
- 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 +5 -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 +9 -4
- package/dist/partner-hook-utils/composeErrorHandler.js.map +1 -1
- package/dist/partner-hook-utils/form/SDKFormProvider.d.ts +10 -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 +7 -4
- package/dist/partner-hook-utils/form/composeSubmitHandler.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 +7 -3
- package/dist/shared/constants.d.ts +2 -2
- package/dist/shared/constants.js +4 -4
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/Helpers.d.ts +11 -0
- package/dist/types/hooks.d.ts +1 -1
- package/docs/guides/endpoint-inventory.json +379 -379
- package/package.json +7 -7
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsxs as i, jsx as s } from "react/jsx-runtime";
|
|
2
|
-
import { useTranslation as
|
|
2
|
+
import { useTranslation as l } from "react-i18next";
|
|
3
3
|
import { SetupStatus as t } from "@gusto/embedded-api/models/components/taxrequirementstateslist";
|
|
4
|
-
import { useStateTaxesList as
|
|
5
|
-
import { Flex as
|
|
6
|
-
import { EmptyData as
|
|
7
|
-
import { useComponentContext as
|
|
4
|
+
import { useStateTaxesList as g } from "./context.js";
|
|
5
|
+
import { Flex as p } from "../../../Common/Flex/Flex.js";
|
|
6
|
+
import { EmptyData as f } from "../../../Common/EmptyData/EmptyData.js";
|
|
7
|
+
import { useComponentContext as x } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
8
8
|
import "react";
|
|
9
|
-
import { useDataView as
|
|
10
|
-
import { DataView as
|
|
11
|
-
const
|
|
9
|
+
import { useDataView as S } from "../../../Common/DataView/useDataView.js";
|
|
10
|
+
import { DataView as T } from "../../../Common/DataView/DataView.js";
|
|
11
|
+
const y = {
|
|
12
12
|
[t.NotStarted]: "info",
|
|
13
13
|
[t.InProgress]: "warning",
|
|
14
14
|
[t.Complete]: "success"
|
|
15
|
-
},
|
|
15
|
+
}, C = {
|
|
16
16
|
[t.NotStarted]: "notStartedBadge",
|
|
17
17
|
[t.InProgress]: "inProgressBadge",
|
|
18
18
|
[t.Complete]: "completeBadge"
|
|
@@ -21,49 +21,49 @@ const T = {
|
|
|
21
21
|
[t.InProgress]: "continueStateTaxSetupCta",
|
|
22
22
|
[t.Complete]: "editStateTaxCta"
|
|
23
23
|
};
|
|
24
|
-
function m(
|
|
25
|
-
return
|
|
24
|
+
function m(n) {
|
|
25
|
+
return n.setupStatus ?? t.InProgress;
|
|
26
26
|
}
|
|
27
27
|
const N = () => {
|
|
28
|
-
const { stateTaxRequirements:
|
|
29
|
-
data:
|
|
28
|
+
const { stateTaxRequirements: n, handleChange: c } = g(), o = x(), { t: e } = l("Company.StateTaxes", { keyPrefix: "list" }), { t: u } = l("common", { keyPrefix: "statesHash" }), { ...d } = S({
|
|
29
|
+
data: n,
|
|
30
30
|
columns: [
|
|
31
31
|
{
|
|
32
32
|
key: "state",
|
|
33
33
|
title: e("requirementsListCol1"),
|
|
34
|
-
render: (a) => /* @__PURE__ */ i(
|
|
35
|
-
/* @__PURE__ */ s(
|
|
36
|
-
a.defaultRatesApplied && /* @__PURE__ */ s(
|
|
34
|
+
render: (a) => /* @__PURE__ */ i(p, { flexDirection: "column", gap: 4, children: [
|
|
35
|
+
/* @__PURE__ */ s(o.Text, { as: "span", children: u(a.state) }),
|
|
36
|
+
a.defaultRatesApplied && /* @__PURE__ */ s(o.Text, { size: "sm", children: e("defaultRatesAppliedText") })
|
|
37
37
|
] })
|
|
38
38
|
},
|
|
39
39
|
{
|
|
40
40
|
key: "status",
|
|
41
41
|
title: e("requirementsListCol2"),
|
|
42
42
|
render: (a) => {
|
|
43
|
-
const
|
|
44
|
-
return /* @__PURE__ */ i(
|
|
45
|
-
/* @__PURE__ */ s(
|
|
46
|
-
a.readyToRunPayroll && /* @__PURE__ */ s(
|
|
43
|
+
const r = m(a);
|
|
44
|
+
return /* @__PURE__ */ i(p, { gap: 8, alignItems: "center", flexWrap: "wrap", children: [
|
|
45
|
+
/* @__PURE__ */ s(o.Badge, { status: y[r], children: e(C[r]) }),
|
|
46
|
+
a.readyToRunPayroll && /* @__PURE__ */ s(o.Badge, { status: "success", children: e("readyToRunPayrollBadge") })
|
|
47
47
|
] });
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
],
|
|
51
51
|
itemMenu: (a) => {
|
|
52
|
-
const
|
|
52
|
+
const r = m(a);
|
|
53
53
|
return /* @__PURE__ */ s(
|
|
54
|
-
|
|
54
|
+
o.Button,
|
|
55
55
|
{
|
|
56
56
|
variant: "secondary",
|
|
57
57
|
onClick: () => {
|
|
58
|
-
a.state &&
|
|
58
|
+
a.state && c(a.state);
|
|
59
59
|
},
|
|
60
|
-
children: e(h[
|
|
60
|
+
children: e(h[r])
|
|
61
61
|
}
|
|
62
62
|
);
|
|
63
63
|
},
|
|
64
|
-
emptyState: () => /* @__PURE__ */ s(
|
|
64
|
+
emptyState: () => /* @__PURE__ */ s(f, { title: e("emptyTableTitle"), description: e("emptyTableDescription") })
|
|
65
65
|
});
|
|
66
|
-
return /* @__PURE__ */ s(
|
|
66
|
+
return /* @__PURE__ */ s(T, { label: e("requirementsListLabel"), ...d });
|
|
67
67
|
};
|
|
68
68
|
export {
|
|
69
69
|
N as List
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"List.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesList/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport {\n SetupStatus,\n type TaxRequirementStatesList,\n} from '@gusto/embedded-api/models/components/taxrequirementstateslist'\nimport { useStateTaxesList } from './context'\nimport { DataView, EmptyData, Flex, useDataView } from '@/components/Common'\nimport type { STATES_ABBR } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\ntype BadgeStatus = 'success' | 'warning' | 'info'\n\nconst badgeStatusMap: Record<SetupStatus, BadgeStatus> = {\n [SetupStatus.NotStarted]: 'info',\n [SetupStatus.InProgress]: 'warning',\n [SetupStatus.Complete]: 'success',\n}\n\nconst badgeLabelMap = {\n [SetupStatus.NotStarted]: 'notStartedBadge',\n [SetupStatus.InProgress]: 'inProgressBadge',\n [SetupStatus.Complete]: 'completeBadge',\n} as const satisfies Record<SetupStatus, string>\n\nconst ctaLabelMap = {\n [SetupStatus.NotStarted]: 'startStateTaxSetupCta',\n [SetupStatus.InProgress]: 'continueStateTaxSetupCta',\n [SetupStatus.Complete]: 'editStateTaxCta',\n} as const satisfies Record<SetupStatus, string>\n\nfunction getSetupStatus(req: TaxRequirementStatesList): SetupStatus {\n
|
|
1
|
+
{"version":3,"file":"List.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesList/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport {\n SetupStatus,\n type TaxRequirementStatesList,\n} from '@gusto/embedded-api/models/components/taxrequirementstateslist'\nimport { useStateTaxesList } from './context'\nimport { DataView, EmptyData, Flex, useDataView } from '@/components/Common'\nimport type { STATES_ABBR } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\ntype BadgeStatus = 'success' | 'warning' | 'info'\n\nconst badgeStatusMap: Record<SetupStatus, BadgeStatus> = {\n [SetupStatus.NotStarted]: 'info',\n [SetupStatus.InProgress]: 'warning',\n [SetupStatus.Complete]: 'success',\n}\n\nconst badgeLabelMap = {\n [SetupStatus.NotStarted]: 'notStartedBadge',\n [SetupStatus.InProgress]: 'inProgressBadge',\n [SetupStatus.Complete]: 'completeBadge',\n} as const satisfies Record<SetupStatus, string>\n\nconst ctaLabelMap = {\n [SetupStatus.NotStarted]: 'startStateTaxSetupCta',\n [SetupStatus.InProgress]: 'continueStateTaxSetupCta',\n [SetupStatus.Complete]: 'editStateTaxCta',\n} as const satisfies Record<SetupStatus, string>\n\nfunction getSetupStatus(req: TaxRequirementStatesList): SetupStatus {\n return req.setupStatus ?? SetupStatus.InProgress\n}\n\n/** @internal */\nexport const List = () => {\n const { stateTaxRequirements, handleChange } = useStateTaxesList()\n const Components = useComponentContext()\n\n const { t } = useTranslation('Company.StateTaxes', { keyPrefix: 'list' })\n const { t: statesHash } = useTranslation('common', { keyPrefix: 'statesHash' })\n\n const { ...dataViewProps } = useDataView({\n data: stateTaxRequirements,\n columns: [\n {\n key: 'state',\n title: t('requirementsListCol1'),\n render: requirement => (\n <Flex flexDirection=\"column\" gap={4}>\n <Components.Text as=\"span\">\n {statesHash(requirement.state as (typeof STATES_ABBR)[number])}\n </Components.Text>\n {requirement.defaultRatesApplied && (\n <Components.Text size=\"sm\">{t('defaultRatesAppliedText')}</Components.Text>\n )}\n </Flex>\n ),\n },\n {\n key: 'status',\n title: t('requirementsListCol2'),\n render: requirement => {\n const status = getSetupStatus(requirement)\n return (\n <Flex gap={8} alignItems=\"center\" flexWrap=\"wrap\">\n <Components.Badge status={badgeStatusMap[status]}>\n {t(badgeLabelMap[status])}\n </Components.Badge>\n {requirement.readyToRunPayroll && (\n <Components.Badge status=\"success\">{t('readyToRunPayrollBadge')}</Components.Badge>\n )}\n </Flex>\n )\n },\n },\n ],\n itemMenu: requirement => {\n const status = getSetupStatus(requirement)\n return (\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n if (requirement.state) handleChange(requirement.state)\n }}\n >\n {t(ctaLabelMap[status])}\n </Components.Button>\n )\n },\n\n emptyState: () => (\n <EmptyData title={t('emptyTableTitle')} description={t('emptyTableDescription')} />\n ),\n })\n return <DataView label={t('requirementsListLabel')} {...dataViewProps} />\n}\n"],"names":["badgeStatusMap","SetupStatus","badgeLabelMap","ctaLabelMap","getSetupStatus","req","List","stateTaxRequirements","handleChange","useStateTaxesList","Components","useComponentContext","t","useTranslation","statesHash","dataViewProps","useDataView","requirement","jsxs","Flex","jsx","status","EmptyData","DataView"],"mappings":";;;;;;;;;;AAYA,MAAMA,IAAmD;AAAA,EACvD,CAACC,EAAY,UAAU,GAAG;AAAA,EAC1B,CAACA,EAAY,UAAU,GAAG;AAAA,EAC1B,CAACA,EAAY,QAAQ,GAAG;AAC1B,GAEMC,IAAgB;AAAA,EACpB,CAACD,EAAY,UAAU,GAAG;AAAA,EAC1B,CAACA,EAAY,UAAU,GAAG;AAAA,EAC1B,CAACA,EAAY,QAAQ,GAAG;AAC1B,GAEME,IAAc;AAAA,EAClB,CAACF,EAAY,UAAU,GAAG;AAAA,EAC1B,CAACA,EAAY,UAAU,GAAG;AAAA,EAC1B,CAACA,EAAY,QAAQ,GAAG;AAC1B;AAEA,SAASG,EAAeC,GAA4C;AAClE,SAAOA,EAAI,eAAeJ,EAAY;AACxC;AAGO,MAAMK,IAAO,MAAM;AACxB,QAAM,EAAE,sBAAAC,GAAsB,cAAAC,EAAA,IAAiBC,EAAA,GACzCC,IAAaC,EAAA,GAEb,EAAE,GAAAC,MAAMC,EAAe,sBAAsB,EAAE,WAAW,QAAQ,GAClE,EAAE,GAAGC,MAAeD,EAAe,UAAU,EAAE,WAAW,cAAc,GAExE,EAAE,GAAGE,EAAA,IAAkBC,EAAY;AAAA,IACvC,MAAMT;AAAA,IACN,SAAS;AAAA,MACP;AAAA,QACE,KAAK;AAAA,QACL,OAAOK,EAAE,sBAAsB;AAAA,QAC/B,QAAQ,CAAAK,MACN,gBAAAC,EAACC,KAAK,eAAc,UAAS,KAAK,GAChC,UAAA;AAAA,UAAA,gBAAAC,EAACV,EAAW,MAAX,EAAgB,IAAG,QACjB,UAAAI,EAAWG,EAAY,KAAqC,GAC/D;AAAA,UACCA,EAAY,uBACX,gBAAAG,EAACV,EAAW,MAAX,EAAgB,MAAK,MAAM,UAAAE,EAAE,yBAAyB,EAAA,CAAE;AAAA,QAAA,EAAA,CAE7D;AAAA,MAAA;AAAA,MAGJ;AAAA,QACE,KAAK;AAAA,QACL,OAAOA,EAAE,sBAAsB;AAAA,QAC/B,QAAQ,CAAAK,MAAe;AACrB,gBAAMI,IAASjB,EAAea,CAAW;AACzC,mCACGE,GAAA,EAAK,KAAK,GAAG,YAAW,UAAS,UAAS,QACzC,UAAA;AAAA,YAAA,gBAAAC,EAACV,EAAW,OAAX,EAAiB,QAAQV,EAAeqB,CAAM,GAC5C,UAAAT,EAAEV,EAAcmB,CAAM,CAAC,EAAA,CAC1B;AAAA,YACCJ,EAAY,qBACX,gBAAAG,EAACV,EAAW,OAAX,EAAiB,QAAO,WAAW,UAAAE,EAAE,wBAAwB,EAAA,CAAE;AAAA,UAAA,GAEpE;AAAA,QAEJ;AAAA,MAAA;AAAA,IACF;AAAA,IAEF,UAAU,CAAAK,MAAe;AACvB,YAAMI,IAASjB,EAAea,CAAW;AACzC,aACE,gBAAAG;AAAA,QAACV,EAAW;AAAA,QAAX;AAAA,UACC,SAAQ;AAAA,UACR,SAAS,MAAM;AACb,YAAIO,EAAY,SAAOT,EAAaS,EAAY,KAAK;AAAA,UACvD;AAAA,UAEC,UAAAL,EAAET,EAAYkB,CAAM,CAAC;AAAA,QAAA;AAAA,MAAA;AAAA,IAG5B;AAAA,IAEA,YAAY,MACV,gBAAAD,EAACE,GAAA,EAAU,OAAOV,EAAE,iBAAiB,GAAG,aAAaA,EAAE,uBAAuB,EAAA,CAAG;AAAA,EAAA,CAEpF;AACD,2BAAQW,GAAA,EAAS,OAAOX,EAAE,uBAAuB,GAAI,GAAGG,GAAe;AACzE;"}
|
|
@@ -7,6 +7,15 @@ import { BaseComponentInterface } from '../../../Base/Base';
|
|
|
7
7
|
export interface StateTaxesListProps extends BaseComponentInterface<'Company.StateTaxes'> {
|
|
8
8
|
/** The associated company identifier. */
|
|
9
9
|
companyId: string;
|
|
10
|
+
/**
|
|
11
|
+
* Controls visibility of the Continue button below the state tax list.
|
|
12
|
+
*
|
|
13
|
+
* When `false`, hides the Continue button. Use this when the list is embedded
|
|
14
|
+
* as one step inside a larger flow that provides its own navigation.
|
|
15
|
+
*
|
|
16
|
+
* @defaultValue `true`
|
|
17
|
+
*/
|
|
18
|
+
showContinueButton?: boolean;
|
|
10
19
|
}
|
|
11
20
|
/**
|
|
12
21
|
* Displays the list of state tax requirements for a company with their setup status.
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { useTaxRequirementsGetAllSuspense as
|
|
3
|
-
import { Head as
|
|
4
|
-
import { StateTaxesListProvider as
|
|
5
|
-
import { Actions as
|
|
6
|
-
import { List as
|
|
7
|
-
import { BaseComponent as
|
|
8
|
-
import { useI18n as
|
|
9
|
-
import { Flex as
|
|
1
|
+
import { jsx as e, jsxs as l, Fragment as u } from "react/jsx-runtime";
|
|
2
|
+
import { useTaxRequirementsGetAllSuspense as d } from "@gusto/embedded-api/react-query/taxRequirementsGetAll";
|
|
3
|
+
import { Head as f } from "./Head.js";
|
|
4
|
+
import { StateTaxesListProvider as p } from "./context.js";
|
|
5
|
+
import { Actions as h } from "./Actions.js";
|
|
6
|
+
import { List as T } from "./List.js";
|
|
7
|
+
import { BaseComponent as x } from "../../../Base/Base.js";
|
|
8
|
+
import { useI18n as A } from "../../../../i18n/I18n.js";
|
|
9
|
+
import { Flex as C } from "../../../Common/Flex/Flex.js";
|
|
10
10
|
import { componentEvents as r } from "../../../../shared/constants.js";
|
|
11
|
-
import { useBase as
|
|
12
|
-
function
|
|
13
|
-
return /* @__PURE__ */ e(
|
|
11
|
+
import { useBase as S } from "../../../Base/useBase.js";
|
|
12
|
+
function F(t) {
|
|
13
|
+
return /* @__PURE__ */ e(x, { ...t, children: /* @__PURE__ */ e(E, { ...t, children: t.children }) });
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
|
|
17
|
-
const { onEvent: o } =
|
|
15
|
+
function E({ className: t, children: n, companyId: i, showContinueButton: m = !0 }) {
|
|
16
|
+
A("Company.StateTaxes");
|
|
17
|
+
const { onEvent: o } = S(), { data: s } = d({ companyUuid: i }), a = s.taxRequirementStatesList;
|
|
18
18
|
return /* @__PURE__ */ e("section", { className: t, children: /* @__PURE__ */ e(
|
|
19
|
-
|
|
19
|
+
p,
|
|
20
20
|
{
|
|
21
21
|
value: {
|
|
22
22
|
isPending: !1,
|
|
23
|
-
stateTaxRequirements:
|
|
23
|
+
stateTaxRequirements: a,
|
|
24
24
|
handleContinue: () => {
|
|
25
25
|
o(r.COMPANY_STATE_TAX_DONE);
|
|
26
26
|
},
|
|
27
|
-
handleChange: (
|
|
28
|
-
o(r.COMPANY_STATE_TAX_EDIT, { state:
|
|
27
|
+
handleChange: (c) => {
|
|
28
|
+
o(r.COMPANY_STATE_TAX_EDIT, { state: c });
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
|
-
children: /* @__PURE__ */ e(
|
|
32
|
-
/* @__PURE__ */ e(
|
|
33
|
-
/* @__PURE__ */ e(
|
|
34
|
-
/* @__PURE__ */ e(
|
|
31
|
+
children: /* @__PURE__ */ e(C, { flexDirection: "column", gap: 32, children: n || /* @__PURE__ */ l(u, { children: [
|
|
32
|
+
/* @__PURE__ */ e(f, {}),
|
|
33
|
+
/* @__PURE__ */ e(T, {}),
|
|
34
|
+
m && /* @__PURE__ */ e(h, {})
|
|
35
35
|
] }) })
|
|
36
36
|
}
|
|
37
37
|
) });
|
|
38
38
|
}
|
|
39
39
|
export {
|
|
40
|
-
|
|
40
|
+
F as StateTaxesList
|
|
41
41
|
};
|
|
42
42
|
//# sourceMappingURL=StateTaxesList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StateTaxesList.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesList/StateTaxesList.tsx"],"sourcesContent":["import { useTaxRequirementsGetAllSuspense } from '@gusto/embedded-api/react-query/taxRequirementsGetAll'\nimport { Head } from './Head'\nimport { StateTaxesListProvider } from './context'\nimport { Actions } from './Actions'\nimport { List } from './List'\nimport type { BaseComponentInterface } from '@/components/Base/Base'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { useI18n } from '@/i18n/I18n'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { componentEvents } from '@/shared/constants'\nimport { useBase } from '@/components/Base'\n\n/**\n * Props for the {@link StateTaxesList} component.\n *\n * @public\n */\nexport interface StateTaxesListProps extends BaseComponentInterface<'Company.StateTaxes'> {\n /** The associated company identifier. */\n companyId: string\n}\n\n/**\n * Displays the list of state tax requirements for a company with their setup status.\n *\n * @remarks\n * Standalone building block used internally by the orchestrated `StateTaxes` component for its list view. Use this directly when you need full control over navigation between the list and form views.\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `company/stateTaxes/edit` | A user chose to edit requirements for a specific state | `{ state: string }` |\n * | `company/stateTaxes/done` | The user chose to proceed to the next step | — |\n *\n * @param props - Component props including the `companyId` whose state tax requirements should be listed.\n * @returns The rendered state taxes list section.\n * @public\n */\nexport function StateTaxesList(props: StateTaxesListProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ className, children, companyId }: StateTaxesListProps) {\n useI18n('Company.StateTaxes')\n const { onEvent } = useBase()\n const { data } = useTaxRequirementsGetAllSuspense({ companyUuid: companyId })\n const stateTaxRequirements = data.taxRequirementStatesList!\n\n const handleContinue = () => {\n onEvent(componentEvents.COMPANY_STATE_TAX_DONE)\n }\n\n const handleChange = (state: string) => {\n onEvent(componentEvents.COMPANY_STATE_TAX_EDIT, { state })\n }\n\n return (\n <section className={className}>\n <StateTaxesListProvider\n value={{\n isPending: false,\n stateTaxRequirements,\n handleContinue,\n handleChange,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <List />\n <Actions
|
|
1
|
+
{"version":3,"file":"StateTaxesList.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesList/StateTaxesList.tsx"],"sourcesContent":["import { useTaxRequirementsGetAllSuspense } from '@gusto/embedded-api/react-query/taxRequirementsGetAll'\nimport { Head } from './Head'\nimport { StateTaxesListProvider } from './context'\nimport { Actions } from './Actions'\nimport { List } from './List'\nimport type { BaseComponentInterface } from '@/components/Base/Base'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { useI18n } from '@/i18n/I18n'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { componentEvents } from '@/shared/constants'\nimport { useBase } from '@/components/Base'\n\n/**\n * Props for the {@link StateTaxesList} component.\n *\n * @public\n */\nexport interface StateTaxesListProps extends BaseComponentInterface<'Company.StateTaxes'> {\n /** The associated company identifier. */\n companyId: string\n /**\n * Controls visibility of the Continue button below the state tax list.\n *\n * When `false`, hides the Continue button. Use this when the list is embedded\n * as one step inside a larger flow that provides its own navigation.\n *\n * @defaultValue `true`\n */\n showContinueButton?: boolean\n}\n\n/**\n * Displays the list of state tax requirements for a company with their setup status.\n *\n * @remarks\n * Standalone building block used internally by the orchestrated `StateTaxes` component for its list view. Use this directly when you need full control over navigation between the list and form views.\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `company/stateTaxes/edit` | A user chose to edit requirements for a specific state | `{ state: string }` |\n * | `company/stateTaxes/done` | The user chose to proceed to the next step | — |\n *\n * @param props - Component props including the `companyId` whose state tax requirements should be listed.\n * @returns The rendered state taxes list section.\n * @public\n */\nexport function StateTaxesList(props: StateTaxesListProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ className, children, companyId, showContinueButton = true }: StateTaxesListProps) {\n useI18n('Company.StateTaxes')\n const { onEvent } = useBase()\n const { data } = useTaxRequirementsGetAllSuspense({ companyUuid: companyId })\n const stateTaxRequirements = data.taxRequirementStatesList!\n\n const handleContinue = () => {\n onEvent(componentEvents.COMPANY_STATE_TAX_DONE)\n }\n\n const handleChange = (state: string) => {\n onEvent(componentEvents.COMPANY_STATE_TAX_EDIT, { state })\n }\n\n return (\n <section className={className}>\n <StateTaxesListProvider\n value={{\n isPending: false,\n stateTaxRequirements,\n handleContinue,\n handleChange,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <List />\n {showContinueButton && <Actions />}\n </>\n )}\n </Flex>\n </StateTaxesListProvider>\n </section>\n )\n}\n"],"names":["StateTaxesList","props","jsx","BaseComponent","Root","className","children","companyId","showContinueButton","useI18n","onEvent","useBase","data","useTaxRequirementsGetAllSuspense","stateTaxRequirements","StateTaxesListProvider","componentEvents","state","Flex","jsxs","Fragment","Head","List","Actions"],"mappings":";;;;;;;;;;;AA+CO,SAASA,EAAeC,GAA4B;AACzD,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,SAASG,EAAK,EAAE,WAAAC,GAAW,UAAAC,GAAU,WAAAC,GAAW,oBAAAC,IAAqB,MAA6B;AAChG,EAAAC,EAAQ,oBAAoB;AAC5B,QAAM,EAAE,SAAAC,EAAA,IAAYC,EAAA,GACd,EAAE,MAAAC,EAAA,IAASC,EAAiC,EAAE,aAAaN,GAAW,GACtEO,IAAuBF,EAAK;AAUlC,SACE,gBAAAV,EAAC,aAAQ,WAAAG,GACP,UAAA,gBAAAH;AAAA,IAACa;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,WAAW;AAAA,QACX,sBAAAD;AAAA,QACA,gBAde,MAAM;AAC3B,UAAAJ,EAAQM,EAAgB,sBAAsB;AAAA,QAChD;AAAA,QAaQ,cAXa,CAACC,MAAkB;AACtC,UAAAP,EAAQM,EAAgB,wBAAwB,EAAE,OAAAC,EAAA,CAAO;AAAA,QAC3D;AAAA,MASQ;AAAA,MAGF,UAAA,gBAAAf,EAACgB,KAAK,eAAc,UAAS,KAAK,IAC/B,UAAAZ,KAGC,gBAAAa,EAAAC,GAAA,EACE,UAAA;AAAA,QAAA,gBAAAlB,EAACmB,GAAA,EAAK;AAAA,0BACLC,GAAA,EAAK;AAAA,QACLd,uBAAuBe,GAAA,CAAA,CAAQ;AAAA,MAAA,EAAA,CAClC,EAAA,CAEJ;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { JSX } from 'react';
|
|
2
|
+
import { FallbackProps } from 'react-error-boundary';
|
|
1
3
|
import { AddressDefaultValues } from './types';
|
|
2
|
-
import { BaseBoundariesProps } from '../../Base/Base';
|
|
3
4
|
import { ResourceDictionary } from '../../../types/Helpers';
|
|
4
5
|
import { EventType } from '../../../shared/constants';
|
|
5
6
|
import { OnEventType } from '../../Base/useBase';
|
|
@@ -20,7 +21,7 @@ export interface AddressProps {
|
|
|
20
21
|
/** Optional class applied to the wrapping `<section>`. */
|
|
21
22
|
className?: string;
|
|
22
23
|
/** Custom React component rendered when an unhandled error is caught by the component-level error boundary. */
|
|
23
|
-
FallbackComponent?:
|
|
24
|
+
FallbackComponent?: (props: FallbackProps) => JSX.Element;
|
|
24
25
|
}
|
|
25
26
|
/**
|
|
26
27
|
* Form for collecting and updating a contractor's mailing address. Renders a business or home address title based on the contractor type.
|
|
@@ -49,4 +50,4 @@ export interface AddressProps {
|
|
|
49
50
|
* }
|
|
50
51
|
* ```
|
|
51
52
|
*/
|
|
52
|
-
export declare function Address({ onEvent, FallbackComponent, ...rootProps }: AddressProps):
|
|
53
|
+
export declare function Address({ onEvent, FallbackComponent, ...rootProps }: AddressProps): JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Address.js","sources":["../../../../src/components/Contractor/Address/Address.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport classNames from 'classnames'\nimport styles from './Address.module.scss'\nimport { useContractorAddressForm } from './shared/useContractorAddressForm'\nimport type { ContractorAddressOptionalFieldsToRequire } from './shared/useContractorAddressForm'\nimport type { AddressDefaultValues } from './types'\nimport { BaseBoundaries, BaseLayout } from '@/components/Base'\nimport
|
|
1
|
+
{"version":3,"file":"Address.js","sources":["../../../../src/components/Contractor/Address/Address.tsx"],"sourcesContent":["import type { JSX } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport classNames from 'classnames'\nimport type { FallbackProps } from 'react-error-boundary'\nimport styles from './Address.module.scss'\nimport { useContractorAddressForm } from './shared/useContractorAddressForm'\nimport type { ContractorAddressOptionalFieldsToRequire } from './shared/useContractorAddressForm'\nimport type { AddressDefaultValues } from './types'\nimport { BaseBoundaries, BaseLayout } from '@/components/Base'\nimport { SDKFormProvider } from '@/partner-hook-utils/form/SDKFormProvider'\nimport { Form } from '@/components/Common/Form'\nimport { Flex, Grid, ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n, useComponentDictionary } from '@/i18n'\nimport type { ResourceDictionary } from '@/types/Helpers'\nimport { contractorEvents, type EventType } from '@/shared/constants'\nimport type { OnEventType } from '@/components/Base/useBase'\n\n// The hook defaults to the API contract, which treats every address field as\n// optional. The SDK's address form has always required a complete mailing\n// address, so it opts those fields back into being required here.\nconst SDK_REQUIRED_ADDRESS_FIELDS: ContractorAddressOptionalFieldsToRequire = {\n update: ['street1', 'city', 'state', 'zip'],\n}\n\n/**\n * Props for {@link Address}.\n *\n * @public\n */\nexport interface AddressProps {\n /** The associated contractor identifier. */\n contractorId: string\n /** Pre-fill values for address fields. Server data takes precedence when the contractor already has an address on file. */\n defaultValues?: AddressDefaultValues\n /** Callback invoked each time the component emits an event. */\n onEvent: OnEventType<EventType, unknown>\n /** Overrides for the component's i18n strings. */\n dictionary?: ResourceDictionary<'Contractor.Address'>\n /** Optional class applied to the wrapping `<section>`. */\n className?: string\n /** Custom React component rendered when an unhandled error is caught by the component-level error boundary. */\n FallbackComponent?: (props: FallbackProps) => JSX.Element\n}\n\n/**\n * Form for collecting and updating a contractor's mailing address. Renders a business or home address title based on the contractor type.\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `contractor/address/updated` | Fired after the address is saved | The updated `ContractorAddress` entity |\n * | `contractor/address/done` | Fired after a successful save so the parent flow can advance | — |\n *\n * @param props - See {@link AddressProps}.\n * @returns The contractor address form.\n * @public\n *\n * @example\n * ```tsx\n * import { ContractorOnboarding } from '@gusto/embedded-react-sdk'\n *\n * function MyComponent() {\n * return (\n * <ContractorOnboarding.Address\n * contractorId=\"contractor-uuid\"\n * onEvent={() => {}}\n * />\n * )\n * }\n * ```\n */\nexport function Address({ onEvent, FallbackComponent, ...rootProps }: AddressProps) {\n return (\n <BaseBoundaries componentName=\"Contractor.Address\" FallbackComponent={FallbackComponent}>\n <AddressRoot onEvent={onEvent} {...rootProps} />\n </BaseBoundaries>\n )\n}\n\nfunction AddressRoot({\n contractorId,\n defaultValues,\n onEvent,\n dictionary,\n className,\n}: Omit<AddressProps, 'FallbackComponent'>) {\n useComponentDictionary('Contractor.Address', dictionary)\n useI18n('Contractor.Address')\n const { t } = useTranslation('Contractor.Address')\n const { t: tCommon } = useTranslation('common')\n const Components = useComponentContext()\n\n const contractorAddress = useContractorAddressForm({\n contractorId,\n optionalFieldsToRequire: SDK_REQUIRED_ADDRESS_FIELDS,\n defaultValues,\n })\n\n if (contractorAddress.isLoading) {\n return <BaseLayout isLoading error={contractorAddress.errorHandling.errors} />\n }\n\n const { Fields } = contractorAddress.form\n const isBusiness = contractorAddress.data.contractorType === 'Business'\n\n const handleSubmit = async () => {\n const result = await contractorAddress.actions.onSubmit()\n if (result) {\n onEvent(contractorEvents.CONTRACTOR_ADDRESS_UPDATED, result.data)\n onEvent(contractorEvents.CONTRACTOR_ADDRESS_DONE)\n }\n }\n\n return (\n <section className={classNames(styles.container, className)}>\n <BaseLayout error={contractorAddress.errorHandling.errors}>\n <SDKFormProvider formHookResult={contractorAddress}>\n <Form onSubmit={() => void handleSubmit()}>\n <Flex flexDirection=\"column\" gap={32} alignItems=\"stretch\">\n <header>\n <Flex flexDirection=\"column\" gap={4}>\n <Components.Heading as=\"h2\">\n {isBusiness ? t('businessAddressTitle') : t('homeAddressTitle')}\n </Components.Heading>\n <Components.Text variant=\"supporting\">\n {isBusiness ? t('businessAddressDescription') : t('homeAddressDescription')}\n </Components.Text>\n </Flex>\n </header>\n\n <Grid gridTemplateColumns={{ base: '1fr', small: ['1fr', '1fr'] }} gap={20}>\n <Fields.Street1\n label={t('street1')}\n validationMessages={{ REQUIRED: t('validations.street1') }}\n />\n <Fields.Street2 label={t('street2')} />\n <Fields.City\n label={t('city')}\n validationMessages={{ REQUIRED: t('validations.city') }}\n />\n <Fields.State\n label={t('state')}\n placeholder={t('statePlaceholder')}\n validationMessages={{ REQUIRED: t('validations.state') }}\n getOptionLabel={(abbr: string) =>\n tCommon(`statesHash.${abbr}`, { defaultValue: abbr })\n }\n />\n <Fields.Zip\n label={t('zip')}\n validationMessages={{\n REQUIRED: t('validations.zip'),\n INVALID_ZIP: t('validations.zipInvalid'),\n }}\n />\n </Grid>\n\n <ActionsLayout>\n <Components.Button type=\"submit\" isDisabled={contractorAddress.status.isPending}>\n {contractorAddress.status.isPending ? t('submitting') : t('submit')}\n </Components.Button>\n </ActionsLayout>\n </Flex>\n </Form>\n </SDKFormProvider>\n </BaseLayout>\n </section>\n )\n}\n"],"names":["SDK_REQUIRED_ADDRESS_FIELDS","Address","onEvent","FallbackComponent","rootProps","jsx","BaseBoundaries","AddressRoot","contractorId","defaultValues","dictionary","className","useComponentDictionary","useI18n","useTranslation","tCommon","Components","useComponentContext","contractorAddress","useContractorAddressForm","BaseLayout","Fields","isBusiness","handleSubmit","result","contractorEvents","classNames","styles","SDKFormProvider","Form","jsxs","Flex","Grid","abbr","ActionsLayout"],"mappings":"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"}
|
|
@@ -23,7 +23,7 @@ export type ContractorAddressErrorCode = (typeof ContractorAddressErrorCodes)[ke
|
|
|
23
23
|
*
|
|
24
24
|
* @public
|
|
25
25
|
*/
|
|
26
|
-
export type ContractorAddressField = "
|
|
26
|
+
export type ContractorAddressField = "city" | "state" | "street1" | "street2" | "zip";
|
|
27
27
|
/**
|
|
28
28
|
* Shape of the values managed by the contractor address form.
|
|
29
29
|
*
|
|
@@ -39,7 +39,7 @@ export type ContractorAddressFormOutputs = ContractorAddressFormData;
|
|
|
39
39
|
*
|
|
40
40
|
* @public
|
|
41
41
|
*/
|
|
42
|
-
export type ContractorAddressOptionalFieldsToRequire = { create?: ("
|
|
42
|
+
export type ContractorAddressOptionalFieldsToRequire = { create?: ("city" | "state" | "street1" | "street2" | "zip")[] | undefined; update?: ("city" | "state" | "street1" | "street2" | "zip")[] | undefined; };
|
|
43
43
|
/** @internal */
|
|
44
44
|
interface ContractorAddressSchemaOptions {
|
|
45
45
|
optionalFieldsToRequire?: ContractorAddressOptionalFieldsToRequire;
|
|
@@ -148,4 +148,4 @@ export type UseContractorAddressFormResult = HookLoadingResult | UseContractorAd
|
|
|
148
148
|
*
|
|
149
149
|
* @public
|
|
150
150
|
*/
|
|
151
|
-
export type ContractorAddressFieldsMetadata = { street1: FieldMetadata; street2: FieldMetadata; city: FieldMetadata; state: import("../../../../../partner-hook-utils/types").FieldMetadataWithOptions<"
|
|
151
|
+
export type ContractorAddressFieldsMetadata = { street1: FieldMetadata; street2: FieldMetadata; city: FieldMetadata; state: import("../../../../../partner-hook-utils/types").FieldMetadataWithOptions<"AK" | "AL" | "AR" | "AZ" | "CA" | "CO" | "CT" | "DC" | "DE" | "FL" | "GA" | "HI" | "IA" | "ID" | "IL" | "IN" | "KS" | "KY" | "LA" | "MA" | "MD" | "ME" | "MI" | "MN" | "MO" | "MS" | "MT" | "NC" | "ND" | "NE" | "NH" | "NJ" | "NM" | "NV" | "NY" | "OH" | "OK" | "OR" | "PA" | "RI" | "SC" | "SD" | "TN" | "TX" | "UT" | "VA" | "VT" | "WA" | "WI" | "WV" | "WY">; zip: FieldMetadata; };
|
|
@@ -1,125 +1,128 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
1
|
+
import { jsx as t, jsxs as m } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation as d } from "react-i18next";
|
|
3
|
-
import { useContractorsDeleteMutation as
|
|
4
|
-
import { useContractors as
|
|
5
|
-
import { Flex as
|
|
6
|
-
import { EmptyData as
|
|
7
|
-
import { ActionsLayout as
|
|
8
|
-
import { HamburgerMenu as
|
|
9
|
-
import { firstLastName as
|
|
10
|
-
import
|
|
3
|
+
import { useContractorsDeleteMutation as H } from "@gusto/embedded-api/react-query/contractorsDelete";
|
|
4
|
+
import { useContractors as k } from "./useContractorList.js";
|
|
5
|
+
import { Flex as h } from "../../Common/Flex/Flex.js";
|
|
6
|
+
import { EmptyData as U } from "../../Common/EmptyData/EmptyData.js";
|
|
7
|
+
import { ActionsLayout as g } from "../../Common/ActionsLayout/ActionsLayout.js";
|
|
8
|
+
import { HamburgerMenu as j } from "../../Common/HamburgerMenu/HamburgerMenu.js";
|
|
9
|
+
import { firstLastName as V } from "../../../helpers/formattedStrings.js";
|
|
10
|
+
import F from "../../../assets/icons/pencil.svg.js";
|
|
11
11
|
import { useComponentContext as u } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
12
|
-
import { ContractorOnboardingStatusBadge as
|
|
13
|
-
import { useI18n as
|
|
14
|
-
import { BaseComponent as
|
|
12
|
+
import { ContractorOnboardingStatusBadge as M } from "../../Common/OnboardingStatusBadge/index.js";
|
|
13
|
+
import { useI18n as G, useComponentDictionary as q } from "../../../i18n/I18n.js";
|
|
14
|
+
import { BaseComponent as W } from "../../Base/Base.js";
|
|
15
15
|
import { useBase as Y } from "../../Base/useBase.js";
|
|
16
|
-
import { CONTRACTOR_TYPE as z, componentEvents as
|
|
17
|
-
import
|
|
18
|
-
import { useDataView as
|
|
19
|
-
import { DataView as
|
|
20
|
-
function
|
|
21
|
-
const { Button: r, Heading:
|
|
22
|
-
return /* @__PURE__ */
|
|
23
|
-
/* @__PURE__ */ t(
|
|
24
|
-
o !== 0 && /* @__PURE__ */ t(r, { variant: "secondary", onClick:
|
|
16
|
+
import { CONTRACTOR_TYPE as z, componentEvents as l, ContractorOnboardingStatus as J } from "../../../shared/constants.js";
|
|
17
|
+
import K from "../../../assets/icons/trashcan.svg.js";
|
|
18
|
+
import { useDataView as Q } from "../../Common/DataView/useDataView.js";
|
|
19
|
+
import { DataView as X } from "../../Common/DataView/DataView.js";
|
|
20
|
+
function Z({ count: o, handleAdd: i }) {
|
|
21
|
+
const { Button: r, Heading: s } = u(), { t: n } = d("Contractor.ContractorList");
|
|
22
|
+
return /* @__PURE__ */ m(h, { alignItems: "center", justifyContent: "space-between", children: [
|
|
23
|
+
/* @__PURE__ */ t(s, { as: "h2", children: n("title") }),
|
|
24
|
+
o !== 0 && /* @__PURE__ */ t(r, { variant: "secondary", onClick: i, children: n("addAnotherCta") })
|
|
25
25
|
] });
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
const { Button:
|
|
29
|
-
return /* @__PURE__ */ t(
|
|
27
|
+
function $({ handleAdd: o }) {
|
|
28
|
+
const { Button: i } = u(), { t: r } = d("Contractor.ContractorList");
|
|
29
|
+
return /* @__PURE__ */ t(U, { title: r("emptyTableTitle"), description: r("emptyTableDescription"), children: /* @__PURE__ */ t(g, { justifyContent: "center", children: /* @__PURE__ */ t(i, { onClick: o, children: r("addContractorCta") }) }) });
|
|
30
30
|
}
|
|
31
|
-
function
|
|
32
|
-
return /* @__PURE__ */ t(
|
|
31
|
+
function Lt(o) {
|
|
32
|
+
return /* @__PURE__ */ t(W, { ...o, children: /* @__PURE__ */ t(tt, { ...o, children: o.children }) });
|
|
33
33
|
}
|
|
34
|
-
function
|
|
35
|
-
|
|
36
|
-
const { t: n } = d("Contractor.ContractorList"), { onEvent:
|
|
37
|
-
contractors:
|
|
34
|
+
function tt({ companyId: o, className: i, dictionary: r, successMessage: s }) {
|
|
35
|
+
G("Contractor.ContractorList"), q("Contractor.ContractorList", r);
|
|
36
|
+
const { t: n } = d("Contractor.ContractorList"), { onEvent: c, baseSubmitHandler: T } = Y(), { Alert: b, Button: L } = u(), {
|
|
37
|
+
contractors: O,
|
|
38
38
|
totalCount: C,
|
|
39
|
-
handleNextPage:
|
|
40
|
-
handleFirstPage:
|
|
41
|
-
handleLastPage:
|
|
42
|
-
handlePreviousPage:
|
|
43
|
-
handleItemsPerPageChange:
|
|
44
|
-
currentPage:
|
|
45
|
-
totalPages:
|
|
46
|
-
itemsPerPage:
|
|
47
|
-
} =
|
|
39
|
+
handleNextPage: E,
|
|
40
|
+
handleFirstPage: N,
|
|
41
|
+
handleLastPage: P,
|
|
42
|
+
handlePreviousPage: R,
|
|
43
|
+
handleItemsPerPageChange: A,
|
|
44
|
+
currentPage: D,
|
|
45
|
+
totalPages: y,
|
|
46
|
+
itemsPerPage: S
|
|
47
|
+
} = k({ companyUuid: o }), { mutateAsync: I, isPending: _ } = H(), v = Q({
|
|
48
48
|
columns: [
|
|
49
49
|
{
|
|
50
50
|
title: n("listHeaders.name"),
|
|
51
|
-
render: (e) => e.type === z.BUSINESS ? e.businessName :
|
|
51
|
+
render: (e) => e.type === z.BUSINESS ? e.businessName : V({ first_name: e.firstName, last_name: e.lastName })
|
|
52
52
|
},
|
|
53
53
|
{
|
|
54
54
|
title: n("listHeaders.status"),
|
|
55
|
-
render: ({ onboarded: e, onboardingStatus:
|
|
56
|
-
|
|
55
|
+
render: ({ onboarded: e, onboardingStatus: a }) => /* @__PURE__ */ t(
|
|
56
|
+
M,
|
|
57
57
|
{
|
|
58
58
|
onboarded: e,
|
|
59
|
-
onboardingStatus:
|
|
59
|
+
onboardingStatus: a
|
|
60
60
|
}
|
|
61
61
|
)
|
|
62
62
|
}
|
|
63
63
|
],
|
|
64
|
-
data:
|
|
65
|
-
itemMenu: (e) =>
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
64
|
+
data: O,
|
|
65
|
+
itemMenu: (e) => {
|
|
66
|
+
const a = e.onboardingStatus === J.SELF_ONBOARDING_REVIEW, p = n(a ? "reviewCta" : "editCta");
|
|
67
|
+
return /* @__PURE__ */ t(
|
|
68
|
+
j,
|
|
69
|
+
{
|
|
70
|
+
items: [
|
|
71
|
+
{
|
|
72
|
+
label: p,
|
|
73
|
+
icon: /* @__PURE__ */ t(F, { "aria-hidden": !0 }),
|
|
74
|
+
onClick: () => {
|
|
75
|
+
w(e.uuid);
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
label: n("deleteCta"),
|
|
80
|
+
icon: /* @__PURE__ */ t(K, { "aria-hidden": !0 }),
|
|
81
|
+
onClick: () => {
|
|
82
|
+
x(e.uuid);
|
|
83
|
+
}
|
|
81
84
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
emptyState: () => /* @__PURE__ */ t(
|
|
85
|
+
],
|
|
86
|
+
triggerLabel: p,
|
|
87
|
+
isLoading: _
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
},
|
|
91
|
+
emptyState: () => /* @__PURE__ */ t($, { handleAdd: f }),
|
|
89
92
|
pagination: {
|
|
90
|
-
handleNextPage:
|
|
91
|
-
handleFirstPage:
|
|
92
|
-
handleLastPage:
|
|
93
|
-
handlePreviousPage:
|
|
94
|
-
handleItemsPerPageChange:
|
|
95
|
-
currentPage:
|
|
96
|
-
totalPages:
|
|
93
|
+
handleNextPage: E,
|
|
94
|
+
handleFirstPage: N,
|
|
95
|
+
handleLastPage: P,
|
|
96
|
+
handlePreviousPage: R,
|
|
97
|
+
handleItemsPerPageChange: A,
|
|
98
|
+
currentPage: D,
|
|
99
|
+
totalPages: y,
|
|
97
100
|
totalCount: C,
|
|
98
|
-
itemsPerPage:
|
|
101
|
+
itemsPerPage: S
|
|
99
102
|
}
|
|
100
|
-
}),
|
|
101
|
-
|
|
102
|
-
},
|
|
103
|
-
|
|
104
|
-
},
|
|
105
|
-
|
|
103
|
+
}), f = () => {
|
|
104
|
+
c(l.CONTRACTOR_CREATE);
|
|
105
|
+
}, w = (e) => {
|
|
106
|
+
c(l.CONTRACTOR_UPDATE, { contractorId: e });
|
|
107
|
+
}, B = () => {
|
|
108
|
+
c(l.CONTRACTOR_ONBOARDING_CONTINUE);
|
|
106
109
|
}, x = async (e) => {
|
|
107
|
-
await
|
|
108
|
-
await
|
|
109
|
-
request: { contractorUuid:
|
|
110
|
-
}),
|
|
110
|
+
await T(e, async (a) => {
|
|
111
|
+
await I({
|
|
112
|
+
request: { contractorUuid: a }
|
|
113
|
+
}), c(l.CONTRACTOR_DELETED, { contractorId: a });
|
|
111
114
|
});
|
|
112
115
|
};
|
|
113
|
-
return /* @__PURE__ */
|
|
114
|
-
|
|
115
|
-
/* @__PURE__ */
|
|
116
|
-
/* @__PURE__ */ t(
|
|
117
|
-
/* @__PURE__ */ t(
|
|
118
|
-
/* @__PURE__ */ t(
|
|
116
|
+
return /* @__PURE__ */ m("section", { className: i, children: [
|
|
117
|
+
s && /* @__PURE__ */ t(b, { label: s, status: "success" }),
|
|
118
|
+
/* @__PURE__ */ m(h, { flexDirection: "column", children: [
|
|
119
|
+
/* @__PURE__ */ t(Z, { count: C, handleAdd: f }),
|
|
120
|
+
/* @__PURE__ */ t(X, { label: n("contractorListLabel"), ...v }),
|
|
121
|
+
/* @__PURE__ */ t(g, { children: /* @__PURE__ */ t(L, { onClick: B, isLoading: !1, children: n("continueCta") }) })
|
|
119
122
|
] })
|
|
120
123
|
] });
|
|
121
124
|
}
|
|
122
125
|
export {
|
|
123
|
-
|
|
126
|
+
Lt as ContractorList
|
|
124
127
|
};
|
|
125
128
|
//# sourceMappingURL=index.js.map
|