@gusto/embedded-react-sdk 0.12.0 → 0.12.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/dist/components/Base/Base.js +18 -19
- package/dist/components/Base/Base.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureForm.js +4 -6
- package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormActions.js +10 -12
- package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormFields.js +6 -8
- package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
- package/dist/components/Common/UI/ProgressBar/ProgressBar.d.ts +1 -1
- package/dist/components/Common/UI/ProgressBar/ProgressBar.js +19 -9
- package/dist/components/Common/UI/ProgressBar/ProgressBar.js.map +1 -1
- package/dist/components/Common/UI/ProgressBar/ProgressBarTypes.d.ts +4 -0
- package/dist/components/Company/AssignSignatory/AssignSignatory.js +6 -8
- package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +6 -7
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +8 -9
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +2 -3
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +2 -3
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +6 -7
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +5 -6
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +9 -10
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +1 -1
- package/dist/components/Company/AssignSignatory/TitleSelect.js +7 -8
- package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +1 -1
- package/dist/components/Company/BankAccount/BankAccount.js +6 -6
- package/dist/components/Company/BankAccount/BankAccount.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +2 -3
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.js +7 -7
- package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js +7 -8
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +1 -1
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js +6 -7
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountList/BankAccountList.js +3 -3
- package/dist/components/Company/BankAccount/BankAccountList/BankAccountList.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +7 -8
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +4 -5
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +5 -6
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +10 -12
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +6 -8
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +1 -1
- package/dist/components/Company/FederalTaxes/Actions.js +6 -7
- package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Company/FederalTaxes/FederalTaxes.js +15 -17
- package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Form.js +2 -3
- package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +1 -1
- package/dist/components/Company/Industry/Actions.js +5 -6
- package/dist/components/Company/Industry/Actions.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +1 -1
- package/dist/components/Company/Industry/Edit.js +10 -11
- package/dist/components/Company/Industry/Edit.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Actions.js +2 -3
- package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Form.js +4 -5
- package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/LocationForm.js +9 -11
- package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +1 -1
- package/dist/components/Company/Locations/LocationsList/Actions.js +2 -3
- package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/List.js +2 -3
- package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +12 -14
- package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +1 -1
- package/dist/components/Company/OnboardingOverview/Completed.js +5 -6
- package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js +2 -3
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +2 -4
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +1 -1
- package/dist/components/Company/PaySchedule/PaySchedule.js +32 -34
- package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Actions.js +10 -11
- package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Edit.js +2 -3
- package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Head.js +2 -3
- package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/List.js +5 -6
- package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
- package/dist/components/Company/PaySchedule/usePaySchedule.js +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +5 -6
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +6 -7
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js +5 -6
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +1 -1
- package/dist/components/Contractor/Address/Address.js +3 -5
- package/dist/components/Contractor/Address/Address.js.map +1 -1
- package/dist/components/Contractor/Address/Form.js +2 -3
- package/dist/components/Contractor/Address/Form.js.map +1 -1
- package/dist/components/Contractor/Address/useAddress.js +1 -1
- package/dist/components/Contractor/ContractorList/index.js +8 -9
- package/dist/components/Contractor/ContractorList/index.js.map +1 -1
- package/dist/components/Contractor/NewHireReport/NewHireReport.js +16 -17
- package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
- package/dist/components/Contractor/OnboardingFlow/OnboardingFlow.js +12 -11
- package/dist/components/Contractor/OnboardingFlow/OnboardingFlow.js.map +1 -1
- package/dist/components/Contractor/OnboardingFlow/OnboardingFlowComponents.d.ts +1 -0
- package/dist/components/Contractor/OnboardingFlow/OnboardingFlowComponents.js +42 -22
- package/dist/components/Contractor/OnboardingFlow/OnboardingFlowComponents.js.map +1 -1
- package/dist/components/Contractor/OnboardingFlow/onboardingStateMachine.d.ts +5 -5
- package/dist/components/Contractor/OnboardingFlow/onboardingStateMachine.js +34 -16
- package/dist/components/Contractor/OnboardingFlow/onboardingStateMachine.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +2 -3
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +2 -3
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +2 -3
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Contractor/Profile/ContractorProfile.js +22 -15
- package/dist/components/Contractor/Profile/ContractorProfile.js.map +1 -1
- package/dist/components/Contractor/Profile/ContractorProfileForm.d.ts +3 -1
- package/dist/components/Contractor/Profile/ContractorProfileForm.js +68 -65
- package/dist/components/Contractor/Profile/ContractorProfileForm.js.map +1 -1
- package/dist/components/Contractor/Profile/useContractorProfile.d.ts +16 -16
- package/dist/components/Contractor/Profile/useContractorProfile.js +101 -94
- package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
- package/dist/components/Contractor/Submit/Submit.js +36 -37
- package/dist/components/Contractor/Submit/Submit.js.map +1 -1
- package/dist/components/Employee/Compensation/Actions.js +4 -5
- package/dist/components/Employee/Compensation/Actions.js.map +1 -1
- package/dist/components/Employee/Compensation/Edit.js +2 -3
- package/dist/components/Employee/Compensation/Edit.js.map +1 -1
- package/dist/components/Employee/Compensation/List.js +5 -6
- package/dist/components/Employee/Compensation/List.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js +2 -3
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +6 -7
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js.map +1 -1
- package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.js +2 -3
- package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +4 -5
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +9 -11
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js +2 -3
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +11 -13
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +1 -1
- package/dist/components/Employee/EmployeeList/Actions.js +4 -5
- package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
- package/dist/components/Employee/EmployeeList/EmployeeList.js +2 -4
- package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
- package/dist/components/Employee/EmployeeList/Head.js +2 -3
- package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
- package/dist/components/Employee/EmployeeList/List.js +2 -3
- package/dist/components/Employee/EmployeeList/List.js.map +1 -1
- package/dist/components/Employee/EmployeeList/useEmployeeList.js +1 -1
- package/dist/components/Employee/Landing/Landing.js +6 -7
- package/dist/components/Employee/Landing/Landing.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/Actions.js +5 -6
- package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +4 -5
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js +2 -3
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +2 -3
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/Split.js +2 -3
- package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +1 -1
- package/dist/components/Employee/Profile/Actions.js +6 -7
- package/dist/components/Employee/Profile/Actions.js.map +1 -1
- package/dist/components/Employee/Profile/AdminPersonalDetails.d.ts +6 -6
- package/dist/components/Employee/Profile/AdminPersonalDetails.js +9 -10
- package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
- package/dist/components/Employee/Profile/HomeAddress.js +4 -5
- package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
- package/dist/components/Employee/Profile/PersonalDetailsInputs.d.ts +2 -2
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js +20 -21
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
- package/dist/components/Employee/Profile/useProfile.js +1 -1
- package/dist/components/Employee/Taxes/Actions.js +7 -8
- package/dist/components/Employee/Taxes/Actions.js.map +1 -1
- package/dist/components/Employee/Taxes/FederalForm.js +4 -5
- package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/Taxes/useTaxes.js +1 -1
- package/dist/components/Flow/Flow.js +15 -13
- package/dist/components/Flow/Flow.js.map +1 -1
- package/dist/components/Flow/useFlow.d.ts +1 -0
- package/dist/components/Flow/useFlow.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.d.ts +6 -0
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +41 -0
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -0
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.d.ts +11 -0
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +78 -0
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -0
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.d.ts +6 -0
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js +19 -0
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js.map +1 -0
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.d.ts +5 -0
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +21 -0
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -0
- package/dist/components/Payroll/PayrollList/PayrollList.d.ts +6 -0
- package/dist/components/Payroll/PayrollList/PayrollList.js +17 -0
- package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -0
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.d.ts +9 -0
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +49 -0
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -0
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.d.ts +7 -0
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +32 -0
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -0
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.d.ts +6 -0
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +68 -0
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -0
- package/dist/components/Payroll/RunPayrollFlow/RunPayroll.d.ts +16 -0
- package/dist/components/Payroll/RunPayrollFlow/RunPayroll.js +55 -0
- package/dist/components/Payroll/RunPayrollFlow/RunPayroll.js.map +1 -0
- package/dist/components/Payroll/RunPayrollFlow/RunPayrollFlow.d.ts +6 -0
- package/dist/components/Payroll/RunPayrollFlow/RunPayrollFlow.js +20 -0
- package/dist/components/Payroll/RunPayrollFlow/RunPayrollFlow.js.map +1 -0
- package/dist/components/Payroll/index.d.ts +6 -0
- package/dist/components/Payroll/index.js +13 -0
- package/dist/components/Payroll/index.js.map +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +5 -6
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/i18n/en/Contractor.ContractorList.json.js +13 -11
- package/dist/i18n/en/Contractor.ContractorList.json.js.map +1 -1
- package/dist/i18n/en/Contractor.Profile.json.js +1 -1
- package/dist/index.js +11 -9
- package/dist/index.js.map +1 -1
- package/dist/shared/constants.d.ts +26 -0
- package/dist/shared/constants.js +72 -45
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +2 -3
- package/package.json +8 -8
|
@@ -3,11 +3,10 @@ import { z as t } from "zod";
|
|
|
3
3
|
import { useFormContext as c } from "react-hook-form";
|
|
4
4
|
import { useTranslation as o } from "react-i18next";
|
|
5
5
|
import { Grid as b } from "../../Common/Grid/Grid.js";
|
|
6
|
-
import "classnames";
|
|
7
6
|
import { removeNonDigits as S, addressInline as g } from "../../../helpers/formattedStrings.js";
|
|
8
7
|
import { usePlaceholderSSN as h, normalizeSSN as N } from "../../../helpers/ssn.js";
|
|
9
8
|
import { SSN_REGEX as D, nameValidation as m } from "../../../helpers/validations.js";
|
|
10
|
-
import { TextInputField as
|
|
9
|
+
import { TextInputField as i } from "../../Common/Fields/TextInputField/TextInputField.js";
|
|
11
10
|
import { SelectField as I } from "../../Common/Fields/SelectField/SelectField.js";
|
|
12
11
|
import { DatePickerField as u } from "../../Common/Fields/DatePickerField/DatePickerField.js";
|
|
13
12
|
const v = t.object({
|
|
@@ -15,12 +14,12 @@ const v = t.object({
|
|
|
15
14
|
middleInitial: t.string().optional(),
|
|
16
15
|
lastName: m
|
|
17
16
|
});
|
|
18
|
-
function
|
|
17
|
+
function B() {
|
|
19
18
|
const { t: e } = o("Employee.Profile");
|
|
20
19
|
return /* @__PURE__ */ l(d, { children: [
|
|
21
20
|
/* @__PURE__ */ l(b, { gap: { base: 20, small: 8 }, gridTemplateColumns: { base: "1fr", small: ["1fr", 200] }, children: [
|
|
22
21
|
/* @__PURE__ */ a(
|
|
23
|
-
|
|
22
|
+
i,
|
|
24
23
|
{
|
|
25
24
|
name: "firstName",
|
|
26
25
|
isRequired: !0,
|
|
@@ -28,10 +27,10 @@ function C() {
|
|
|
28
27
|
errorMessage: e("validations.firstName")
|
|
29
28
|
}
|
|
30
29
|
),
|
|
31
|
-
/* @__PURE__ */ a(
|
|
30
|
+
/* @__PURE__ */ a(i, { name: "middleInitial", label: e("middleInitial") })
|
|
32
31
|
] }),
|
|
33
32
|
/* @__PURE__ */ a(
|
|
34
|
-
|
|
33
|
+
i,
|
|
35
34
|
{
|
|
36
35
|
name: "lastName",
|
|
37
36
|
isRequired: !0,
|
|
@@ -46,7 +45,7 @@ const O = t.object({
|
|
|
46
45
|
startDate: t.date().transform((e) => e.toISOString().split("T")[0]),
|
|
47
46
|
email: t.string().email()
|
|
48
47
|
});
|
|
49
|
-
function
|
|
48
|
+
function C({ companyLocations: e }) {
|
|
50
49
|
const { t: r } = o("Employee.Profile"), {
|
|
51
50
|
formState: { errors: n }
|
|
52
51
|
} = c();
|
|
@@ -55,9 +54,9 @@ function L({ companyLocations: e }) {
|
|
|
55
54
|
I,
|
|
56
55
|
{
|
|
57
56
|
name: "workAddress",
|
|
58
|
-
options: e.map((
|
|
59
|
-
value:
|
|
60
|
-
label: g(
|
|
57
|
+
options: e.map((s) => ({
|
|
58
|
+
value: s.uuid,
|
|
59
|
+
label: g(s)
|
|
61
60
|
})),
|
|
62
61
|
label: r("workAddress"),
|
|
63
62
|
description: r("workAddressDescription"),
|
|
@@ -77,7 +76,7 @@ function L({ companyLocations: e }) {
|
|
|
77
76
|
}
|
|
78
77
|
),
|
|
79
78
|
/* @__PURE__ */ a(
|
|
80
|
-
|
|
79
|
+
i,
|
|
81
80
|
{
|
|
82
81
|
name: "email",
|
|
83
82
|
label: r("email"),
|
|
@@ -93,15 +92,15 @@ const R = t.object({
|
|
|
93
92
|
ssn: t.string().transform((e) => S(e)).refine((e) => D.test(e)),
|
|
94
93
|
enableSsn: t.boolean()
|
|
95
94
|
});
|
|
96
|
-
function
|
|
97
|
-
const { setValue: n } = c(), { t:
|
|
95
|
+
function L({ employee: e, onChange: r }) {
|
|
96
|
+
const { setValue: n } = c(), { t: s } = o("Employee.Profile"), p = h(e?.hasSsn);
|
|
98
97
|
return /* @__PURE__ */ a(
|
|
99
|
-
|
|
98
|
+
i,
|
|
100
99
|
{
|
|
101
100
|
isRequired: !0,
|
|
102
101
|
name: "ssn",
|
|
103
|
-
label:
|
|
104
|
-
errorMessage:
|
|
102
|
+
label: s("ssnLabel"),
|
|
103
|
+
errorMessage: s("validations.ssn", { ns: "common" }),
|
|
105
104
|
placeholder: p,
|
|
106
105
|
transform: N,
|
|
107
106
|
onChange: (f) => {
|
|
@@ -113,7 +112,7 @@ function z({ employee: e, onChange: r }) {
|
|
|
113
112
|
const y = t.object({
|
|
114
113
|
dateOfBirth: t.date().transform((e) => e.toISOString().split("T")[0])
|
|
115
114
|
});
|
|
116
|
-
function
|
|
115
|
+
function z() {
|
|
117
116
|
const { t: e } = o("Employee.Profile");
|
|
118
117
|
return /* @__PURE__ */ a(
|
|
119
118
|
u,
|
|
@@ -130,13 +129,13 @@ v.merge(O).merge(R).merge(y).extend({
|
|
|
130
129
|
enableSsn: t.boolean()
|
|
131
130
|
});
|
|
132
131
|
export {
|
|
133
|
-
|
|
132
|
+
C as AdminInputs,
|
|
134
133
|
O as AdminInputsSchema,
|
|
135
|
-
|
|
134
|
+
z as DateOfBirthInput,
|
|
136
135
|
y as DateOfBirthSchema,
|
|
137
|
-
|
|
136
|
+
B as NameInputs,
|
|
138
137
|
v as NameInputsSchema,
|
|
139
|
-
|
|
138
|
+
L as SocialSecurityNumberInput,
|
|
140
139
|
R as SocialSecurityNumberSchema
|
|
141
140
|
};
|
|
142
141
|
//# sourceMappingURL=PersonalDetailsInputs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PersonalDetailsInputs.js","sources":["../../../../src/components/Employee/Profile/PersonalDetailsInputs.tsx"],"sourcesContent":["import { z } from 'zod'\nimport { useFormContext } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport { type Location } from '@gusto/embedded-api/models/components/location'\nimport { type Employee } from '@gusto/embedded-api/models/components/employee'\nimport { SelectField, TextInputField, Grid, DatePickerField } from '@/components/Common'\nimport { addressInline, removeNonDigits } from '@/helpers/formattedStrings'\nimport { normalizeSSN, usePlaceholderSSN } from '@/helpers/ssn'\nimport { nameValidation, SSN_REGEX } from '@/helpers/validations'\n\nexport const NameInputsSchema = z.object({\n firstName: nameValidation,\n middleInitial: z.string().optional(),\n lastName: nameValidation,\n})\n\nexport function NameInputs() {\n const { t } = useTranslation('Employee.Profile')\n\n return (\n <>\n <Grid gap={{ base: 20, small: 8 }} gridTemplateColumns={{ base: '1fr', small: ['1fr', 200] }}>\n <TextInputField\n name=\"firstName\"\n isRequired\n label={t('firstName')}\n errorMessage={t('validations.firstName')}\n />\n <TextInputField name=\"middleInitial\" label={t('middleInitial')} />\n </Grid>\n <TextInputField\n name=\"lastName\"\n isRequired\n label={t('lastName')}\n errorMessage={t('validations.lastName')}\n />\n </>\n )\n}\n\nexport const AdminInputsSchema = z.object({\n workAddress: z.string().min(1),\n startDate: z.date().transform(date => date.toISOString().split('T')[0]),\n email: z.string().email(),\n})\n\ntype AdminInputsSchemaType = z.infer<typeof AdminInputsSchema>\n\ninterface AdminInputsProps {\n companyLocations: Location[]\n}\n\nexport function AdminInputs({ companyLocations }: AdminInputsProps) {\n const { t } = useTranslation('Employee.Profile')\n const {\n formState: { errors },\n } = useFormContext<AdminInputsSchemaType>()\n\n return (\n <>\n <SelectField\n name=\"workAddress\"\n options={companyLocations.map(location => ({\n value: location.uuid,\n label: addressInline(location),\n }))}\n label={t('workAddress')}\n description={t('workAddressDescription')}\n placeholder={t('workAddressPlaceholder')}\n errorMessage={t('validations.location', { ns: 'common' })}\n isRequired\n />\n <DatePickerField\n name=\"startDate\"\n label={t('startDateLabel')}\n description={t('startDateDescription')}\n isRequired\n errorMessage={\n errors.startDate?.type === 'custom'\n ? t('validations.startDateOutOfRange')\n : t('validations.startDate')\n }\n />\n <TextInputField\n name=\"email\"\n label={t('email')}\n description={t('emailDescription')}\n errorMessage={t('validations.email')}\n isRequired\n type=\"email\"\n />\n </>\n )\n}\n\nexport const SocialSecurityNumberSchema = z.object({\n ssn: z\n .string()\n .transform(input => removeNonDigits(input))\n .refine(input => SSN_REGEX.test(input)),\n enableSsn: z.boolean(),\n})\n\ntype SocialSecurityNumberSchemaType = z.infer<typeof SocialSecurityNumberSchema>\n\ninterface SocialSecurityNumberInputProps {\n employee?: Employee\n onChange?: (updatedValue: string) => void\n}\n\nexport function SocialSecurityNumberInput({ employee, onChange }: SocialSecurityNumberInputProps) {\n const { setValue } = useFormContext<SocialSecurityNumberSchemaType>()\n const { t } = useTranslation('Employee.Profile')\n const placeholderSSN = usePlaceholderSSN(employee?.hasSsn)\n return (\n <TextInputField\n isRequired\n name=\"ssn\"\n label={t('ssnLabel')}\n errorMessage={t('validations.ssn', { ns: 'common' })}\n placeholder={placeholderSSN}\n transform={normalizeSSN}\n onChange={updatedValue => {\n setValue('enableSsn', true)\n onChange?.(updatedValue)\n }}\n />\n )\n}\n\nexport const DateOfBirthSchema = z.object({\n dateOfBirth: z.date().transform(date => date.toISOString().split('T')[0]),\n})\n\nexport function DateOfBirthInput() {\n const { t } = useTranslation('Employee.Profile')\n return (\n <DatePickerField\n name=\"dateOfBirth\"\n label={t('dobLabel')}\n isRequired\n errorMessage={t('validations.dob', { ns: 'common' })}\n />\n )\n}\n\n// All possible inputs for PersonalDetails forms\nconst PersonalDetailsTotalSchema = NameInputsSchema.merge(AdminInputsSchema)\n .merge(SocialSecurityNumberSchema)\n .merge(DateOfBirthSchema)\n .extend({\n selfOnboarding: z.boolean(),\n enableSsn: z.boolean(),\n })\n\ntype NullableDatesMapper<Source> = {\n [Property in keyof Source]: Source[Property] extends Date\n ? Source[Property] | null\n : Source[Property]\n}\n\nexport type PersonalDetailsPayload = z.infer<typeof PersonalDetailsTotalSchema>\n\n//Typescript magic to mark date fields as nullable for correct defaultvalues\nexport type PersonalDetailsInputs = NullableDatesMapper<z.input<typeof PersonalDetailsTotalSchema>>\n"],"names":["NameInputsSchema","z","nameValidation","NameInputs","t","useTranslation","jsxs","Fragment","Grid","jsx","TextInputField","AdminInputsSchema","date","AdminInputs","companyLocations","errors","useFormContext","SelectField","location","addressInline","DatePickerField","SocialSecurityNumberSchema","input","removeNonDigits","SSN_REGEX","SocialSecurityNumberInput","employee","onChange","setValue","placeholderSSN","usePlaceholderSSN","normalizeSSN","updatedValue","DateOfBirthSchema","DateOfBirthInput"],"mappings":"
|
|
1
|
+
{"version":3,"file":"PersonalDetailsInputs.js","sources":["../../../../src/components/Employee/Profile/PersonalDetailsInputs.tsx"],"sourcesContent":["import { z } from 'zod'\nimport { useFormContext } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport { type Location } from '@gusto/embedded-api/models/components/location'\nimport { type Employee } from '@gusto/embedded-api/models/components/employee'\nimport { SelectField, TextInputField, Grid, DatePickerField } from '@/components/Common'\nimport { addressInline, removeNonDigits } from '@/helpers/formattedStrings'\nimport { normalizeSSN, usePlaceholderSSN } from '@/helpers/ssn'\nimport { nameValidation, SSN_REGEX } from '@/helpers/validations'\n\nexport const NameInputsSchema = z.object({\n firstName: nameValidation,\n middleInitial: z.string().optional(),\n lastName: nameValidation,\n})\n\nexport function NameInputs() {\n const { t } = useTranslation('Employee.Profile')\n\n return (\n <>\n <Grid gap={{ base: 20, small: 8 }} gridTemplateColumns={{ base: '1fr', small: ['1fr', 200] }}>\n <TextInputField\n name=\"firstName\"\n isRequired\n label={t('firstName')}\n errorMessage={t('validations.firstName')}\n />\n <TextInputField name=\"middleInitial\" label={t('middleInitial')} />\n </Grid>\n <TextInputField\n name=\"lastName\"\n isRequired\n label={t('lastName')}\n errorMessage={t('validations.lastName')}\n />\n </>\n )\n}\n\nexport const AdminInputsSchema = z.object({\n workAddress: z.string().min(1),\n startDate: z.date().transform(date => date.toISOString().split('T')[0]),\n email: z.string().email(),\n})\n\ntype AdminInputsSchemaType = z.infer<typeof AdminInputsSchema>\n\ninterface AdminInputsProps {\n companyLocations: Location[]\n}\n\nexport function AdminInputs({ companyLocations }: AdminInputsProps) {\n const { t } = useTranslation('Employee.Profile')\n const {\n formState: { errors },\n } = useFormContext<AdminInputsSchemaType>()\n\n return (\n <>\n <SelectField\n name=\"workAddress\"\n options={companyLocations.map(location => ({\n value: location.uuid,\n label: addressInline(location),\n }))}\n label={t('workAddress')}\n description={t('workAddressDescription')}\n placeholder={t('workAddressPlaceholder')}\n errorMessage={t('validations.location', { ns: 'common' })}\n isRequired\n />\n <DatePickerField\n name=\"startDate\"\n label={t('startDateLabel')}\n description={t('startDateDescription')}\n isRequired\n errorMessage={\n errors.startDate?.type === 'custom'\n ? t('validations.startDateOutOfRange')\n : t('validations.startDate')\n }\n />\n <TextInputField\n name=\"email\"\n label={t('email')}\n description={t('emailDescription')}\n errorMessage={t('validations.email')}\n isRequired\n type=\"email\"\n />\n </>\n )\n}\n\nexport const SocialSecurityNumberSchema = z.object({\n ssn: z\n .string()\n .transform(input => removeNonDigits(input))\n .refine(input => SSN_REGEX.test(input)),\n enableSsn: z.boolean(),\n})\n\ntype SocialSecurityNumberSchemaType = z.infer<typeof SocialSecurityNumberSchema>\n\ninterface SocialSecurityNumberInputProps {\n employee?: Employee\n onChange?: (updatedValue: string) => void\n}\n\nexport function SocialSecurityNumberInput({ employee, onChange }: SocialSecurityNumberInputProps) {\n const { setValue } = useFormContext<SocialSecurityNumberSchemaType>()\n const { t } = useTranslation('Employee.Profile')\n const placeholderSSN = usePlaceholderSSN(employee?.hasSsn)\n return (\n <TextInputField\n isRequired\n name=\"ssn\"\n label={t('ssnLabel')}\n errorMessage={t('validations.ssn', { ns: 'common' })}\n placeholder={placeholderSSN}\n transform={normalizeSSN}\n onChange={updatedValue => {\n setValue('enableSsn', true)\n onChange?.(updatedValue)\n }}\n />\n )\n}\n\nexport const DateOfBirthSchema = z.object({\n dateOfBirth: z.date().transform(date => date.toISOString().split('T')[0]),\n})\n\nexport function DateOfBirthInput() {\n const { t } = useTranslation('Employee.Profile')\n return (\n <DatePickerField\n name=\"dateOfBirth\"\n label={t('dobLabel')}\n isRequired\n errorMessage={t('validations.dob', { ns: 'common' })}\n />\n )\n}\n\n// All possible inputs for PersonalDetails forms\nconst PersonalDetailsTotalSchema = NameInputsSchema.merge(AdminInputsSchema)\n .merge(SocialSecurityNumberSchema)\n .merge(DateOfBirthSchema)\n .extend({\n selfOnboarding: z.boolean(),\n enableSsn: z.boolean(),\n })\n\ntype NullableDatesMapper<Source> = {\n [Property in keyof Source]: Source[Property] extends Date\n ? Source[Property] | null\n : Source[Property]\n}\n\nexport type PersonalDetailsPayload = z.infer<typeof PersonalDetailsTotalSchema>\n\n//Typescript magic to mark date fields as nullable for correct defaultvalues\nexport type PersonalDetailsInputs = NullableDatesMapper<z.input<typeof PersonalDetailsTotalSchema>>\n"],"names":["NameInputsSchema","z","nameValidation","NameInputs","t","useTranslation","jsxs","Fragment","Grid","jsx","TextInputField","AdminInputsSchema","date","AdminInputs","companyLocations","errors","useFormContext","SelectField","location","addressInline","DatePickerField","SocialSecurityNumberSchema","input","removeNonDigits","SSN_REGEX","SocialSecurityNumberInput","employee","onChange","setValue","placeholderSSN","usePlaceholderSSN","normalizeSSN","updatedValue","DateOfBirthSchema","DateOfBirthInput"],"mappings":"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"}
|
|
@@ -8,9 +8,9 @@ import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
|
|
|
8
8
|
import "@tanstack/react-query";
|
|
9
9
|
import "../../Base/useBase.js";
|
|
10
10
|
import "../../../shared/constants.js";
|
|
11
|
-
import "classnames";
|
|
12
11
|
import "dompurify";
|
|
13
12
|
import "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
13
|
+
import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
14
14
|
import { createCompoundContext as o } from "../../Base/createCompoundContext.js";
|
|
15
15
|
const [s, u] = o("ProfileContext");
|
|
16
16
|
export {
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { useTranslation as
|
|
3
|
-
import { useTaxes as
|
|
4
|
-
import "
|
|
5
|
-
import { ActionsLayout as e } from "../../Common/ActionsLayout/ActionsLayout.js";
|
|
2
|
+
import { useTranslation as e } from "react-i18next";
|
|
3
|
+
import { useTaxes as i } from "./useTaxes.js";
|
|
4
|
+
import { ActionsLayout as r } from "../../Common/ActionsLayout/ActionsLayout.js";
|
|
6
5
|
import { useComponentContext as m } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
7
|
-
const
|
|
8
|
-
const { t } =
|
|
9
|
-
return /* @__PURE__ */ o(
|
|
6
|
+
const x = () => {
|
|
7
|
+
const { t } = e("Employee.Taxes"), { isPending: n } = i(), s = m();
|
|
8
|
+
return /* @__PURE__ */ o(r, { children: /* @__PURE__ */ o(s.Button, { type: "submit", isLoading: n, children: t("submitCta") }) });
|
|
10
9
|
};
|
|
11
10
|
export {
|
|
12
|
-
|
|
11
|
+
x as Actions
|
|
13
12
|
};
|
|
14
13
|
//# sourceMappingURL=Actions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Actions.js","sources":["../../../../src/components/Employee/Taxes/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useTaxes } from './useTaxes'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { t } = useTranslation('Employee.Taxes')\n const { isPending } = useTaxes()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t('submitCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","useTranslation","isPending","useTaxes","Components","useComponentContext","jsx","ActionsLayout"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Actions.js","sources":["../../../../src/components/Employee/Taxes/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useTaxes } from './useTaxes'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { t } = useTranslation('Employee.Taxes')\n const { isPending } = useTaxes()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t('submitCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","useTranslation","isPending","useTaxes","Components","useComponentContext","jsx","ActionsLayout"],"mappings":";;;;;AAKO,MAAMA,IAAU,MAAM;AAC3B,QAAM,EAAE,EAAA,IAAMC,EAAe,gBAAgB,GACvC,EAAE,WAAAC,EAAA,IAAcC,EAAA,GAChBC,IAAaC,EAAA;AAEnB,SACE,gBAAAC,EAACC,GAAA,EACC,UAAA,gBAAAD,EAACF,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWF,GACzC,UAAA,EAAE,WAAW,GAChB,GACF;AAEJ;"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { jsxs as l, Fragment as a, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation as s, Trans as u } from "react-i18next";
|
|
3
3
|
import { z as t } from "zod";
|
|
4
|
-
import "classnames";
|
|
5
4
|
import { useComponentContext as m } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
6
5
|
import { SelectField as d } from "../../Common/Fields/SelectField/SelectField.js";
|
|
7
6
|
import { RadioGroupField as f } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
8
7
|
import { NumberInputField as i } from "../../Common/Fields/NumberInputField/NumberInputField.js";
|
|
9
|
-
const
|
|
8
|
+
const F = t.object({
|
|
10
9
|
filingStatus: t.string().min(1),
|
|
11
10
|
twoJobs: t.string().min(1),
|
|
12
11
|
dependentsAmount: t.number().transform(String),
|
|
@@ -15,7 +14,7 @@ const R = t.object({
|
|
|
15
14
|
extraWithholding: t.number().transform(String),
|
|
16
15
|
w4DataType: t.enum(["pre_2020_w4", "rev_2020_w4"])
|
|
17
16
|
});
|
|
18
|
-
function
|
|
17
|
+
function R() {
|
|
19
18
|
const { t: e } = s("Employee.Taxes"), o = m(), n = [
|
|
20
19
|
{ value: "Single", label: e("filingStatusSingle") },
|
|
21
20
|
{ value: "Married", label: e("filingStatusMarried") },
|
|
@@ -102,7 +101,7 @@ function q() {
|
|
|
102
101
|
] });
|
|
103
102
|
}
|
|
104
103
|
export {
|
|
105
|
-
|
|
106
|
-
|
|
104
|
+
R as FederalForm,
|
|
105
|
+
F as FederalFormSchema
|
|
107
106
|
};
|
|
108
107
|
//# sourceMappingURL=FederalForm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FederalForm.js","sources":["../../../../src/components/Employee/Taxes/FederalForm.tsx"],"sourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport { z } from 'zod'\nimport { NumberInputField, RadioGroupField, SelectField } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const FederalFormSchema = z.object({\n filingStatus: z.string().min(1),\n twoJobs: z.string().min(1),\n dependentsAmount: z.number().transform(String),\n otherIncome: z.number().transform(String),\n deductions: z.number().transform(String),\n extraWithholding: z.number().transform(String),\n w4DataType: z.enum(['pre_2020_w4', 'rev_2020_w4']),\n})\n\nexport type FederalFormInputs = z.input<typeof FederalFormSchema>\nexport type FederalFormPayload = z.output<typeof FederalFormSchema>\n\nexport function FederalForm() {\n const { t } = useTranslation('Employee.Taxes')\n const Components = useComponentContext()\n\n const filingStatusCategories = [\n { value: 'Single', label: t('filingStatusSingle') },\n { value: 'Married', label: t('filingStatusMarried') },\n { value: 'Head of Household', label: t('filingStatusHeadOfHousehold') },\n { value: 'Exempt from withholding', label: t('filingStatusExemptFromWithholding') },\n ]\n\n return (\n <>\n <SelectField\n name=\"filingStatus\"\n label={t('federalFilingStatus1c')}\n placeholder={t('federalFillingStatusPlaceholder')}\n options={filingStatusCategories}\n isRequired\n errorMessage={t('validations.federalFilingStatus')}\n />\n <RadioGroupField\n name=\"twoJobs\"\n isRequired\n label={t('multipleJobs2c')}\n errorMessage={t('validations.federalTwoJobs')}\n description={\n <Components.Text>\n <Trans\n i18nKey={'includesSpouseExplanation'}\n t={t}\n components={{\n irs_link: <Components.Link />,\n }}\n />\n </Components.Text>\n }\n options={[\n { value: 'true', label: t('twoJobYesLabel') },\n { value: 'false', label: t('twoJobNoLabel') },\n ]}\n />\n <NumberInputField\n name=\"dependentsAmount\"\n isRequired\n label={t('dependentsTotalIfApplicable')}\n errorMessage={t('fieldIsRequired')}\n />\n <NumberInputField\n name=\"otherIncome\"\n isRequired\n label={t('otherIncome')}\n format=\"currency\"\n min={0}\n errorMessage={t('fieldIsRequired')}\n />\n <NumberInputField\n name=\"deductions\"\n isRequired\n label={t('deductions')}\n format=\"currency\"\n min={0}\n errorMessage={t('fieldIsRequired')}\n />\n <NumberInputField\n name=\"extraWithholding\"\n isRequired\n label={t('extraWithholding')}\n format=\"currency\"\n min={0}\n errorMessage={t('fieldIsRequired')}\n />\n </>\n )\n}\n"],"names":["FederalFormSchema","z","FederalForm","t","useTranslation","Components","useComponentContext","filingStatusCategories","jsxs","Fragment","jsx","SelectField","RadioGroupField","Trans","NumberInputField"],"mappings":"
|
|
1
|
+
{"version":3,"file":"FederalForm.js","sources":["../../../../src/components/Employee/Taxes/FederalForm.tsx"],"sourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport { z } from 'zod'\nimport { NumberInputField, RadioGroupField, SelectField } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const FederalFormSchema = z.object({\n filingStatus: z.string().min(1),\n twoJobs: z.string().min(1),\n dependentsAmount: z.number().transform(String),\n otherIncome: z.number().transform(String),\n deductions: z.number().transform(String),\n extraWithholding: z.number().transform(String),\n w4DataType: z.enum(['pre_2020_w4', 'rev_2020_w4']),\n})\n\nexport type FederalFormInputs = z.input<typeof FederalFormSchema>\nexport type FederalFormPayload = z.output<typeof FederalFormSchema>\n\nexport function FederalForm() {\n const { t } = useTranslation('Employee.Taxes')\n const Components = useComponentContext()\n\n const filingStatusCategories = [\n { value: 'Single', label: t('filingStatusSingle') },\n { value: 'Married', label: t('filingStatusMarried') },\n { value: 'Head of Household', label: t('filingStatusHeadOfHousehold') },\n { value: 'Exempt from withholding', label: t('filingStatusExemptFromWithholding') },\n ]\n\n return (\n <>\n <SelectField\n name=\"filingStatus\"\n label={t('federalFilingStatus1c')}\n placeholder={t('federalFillingStatusPlaceholder')}\n options={filingStatusCategories}\n isRequired\n errorMessage={t('validations.federalFilingStatus')}\n />\n <RadioGroupField\n name=\"twoJobs\"\n isRequired\n label={t('multipleJobs2c')}\n errorMessage={t('validations.federalTwoJobs')}\n description={\n <Components.Text>\n <Trans\n i18nKey={'includesSpouseExplanation'}\n t={t}\n components={{\n irs_link: <Components.Link />,\n }}\n />\n </Components.Text>\n }\n options={[\n { value: 'true', label: t('twoJobYesLabel') },\n { value: 'false', label: t('twoJobNoLabel') },\n ]}\n />\n <NumberInputField\n name=\"dependentsAmount\"\n isRequired\n label={t('dependentsTotalIfApplicable')}\n errorMessage={t('fieldIsRequired')}\n />\n <NumberInputField\n name=\"otherIncome\"\n isRequired\n label={t('otherIncome')}\n format=\"currency\"\n min={0}\n errorMessage={t('fieldIsRequired')}\n />\n <NumberInputField\n name=\"deductions\"\n isRequired\n label={t('deductions')}\n format=\"currency\"\n min={0}\n errorMessage={t('fieldIsRequired')}\n />\n <NumberInputField\n name=\"extraWithholding\"\n isRequired\n label={t('extraWithholding')}\n format=\"currency\"\n min={0}\n errorMessage={t('fieldIsRequired')}\n />\n </>\n )\n}\n"],"names":["FederalFormSchema","z","FederalForm","t","useTranslation","Components","useComponentContext","filingStatusCategories","jsxs","Fragment","jsx","SelectField","RadioGroupField","Trans","NumberInputField"],"mappings":"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"}
|
|
@@ -8,9 +8,9 @@ import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
|
|
|
8
8
|
import "@tanstack/react-query";
|
|
9
9
|
import "../../Base/useBase.js";
|
|
10
10
|
import "../../../shared/constants.js";
|
|
11
|
-
import "classnames";
|
|
12
11
|
import "dompurify";
|
|
13
12
|
import "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
13
|
+
import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
14
14
|
import { createCompoundContext as o } from "../../Base/createCompoundContext.js";
|
|
15
15
|
const [u, f] = o("TaxesContext");
|
|
16
16
|
export {
|
|
@@ -1,29 +1,31 @@
|
|
|
1
1
|
import { jsx as s, Fragment as d, jsxs as f } from "react/jsx-runtime";
|
|
2
2
|
import { useMachine as h } from "react-robot";
|
|
3
3
|
import { useTranslation as g } from "react-i18next";
|
|
4
|
-
import { FlowContext as
|
|
5
|
-
import { useComponentContext as
|
|
6
|
-
const
|
|
7
|
-
const p =
|
|
4
|
+
import { FlowContext as C } from "./useFlow.js";
|
|
5
|
+
import { useComponentContext as v } from "../../contexts/ComponentAdapter/useComponentContext.js";
|
|
6
|
+
const b = ({ onEvent: l, machine: a }) => {
|
|
7
|
+
const p = v(), { t: m } = g(), [o, i, c] = h(a, {
|
|
8
8
|
onEvent: x,
|
|
9
|
-
component: null
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
component: null,
|
|
10
|
+
progressBarCta: null
|
|
11
|
+
}), u = o.context.showProgress ?? !1, t = o.context.totalSteps ?? null, e = o.context.currentStep ?? null;
|
|
12
|
+
function x(n, r) {
|
|
13
|
+
c.child ? c.child.send({ type: n, payload: r }) : i({ type: n, payload: r }), l(n, r);
|
|
13
14
|
}
|
|
14
15
|
return /* @__PURE__ */ s(d, { children: /* @__PURE__ */ f(
|
|
15
|
-
|
|
16
|
+
C.Provider,
|
|
16
17
|
{
|
|
17
18
|
value: {
|
|
18
19
|
...o.context
|
|
19
20
|
},
|
|
20
21
|
children: [
|
|
21
|
-
u &&
|
|
22
|
+
u && e && t && /* @__PURE__ */ s(
|
|
22
23
|
p.ProgressBar,
|
|
23
24
|
{
|
|
24
25
|
totalSteps: t,
|
|
25
|
-
currentStep:
|
|
26
|
-
label:
|
|
26
|
+
currentStep: e,
|
|
27
|
+
label: m("progressBarLabel", { totalSteps: t, currentStep: e }),
|
|
28
|
+
cta: o.context.progressBarCta
|
|
27
29
|
}
|
|
28
30
|
),
|
|
29
31
|
o.context.component && /* @__PURE__ */ s(o.context.component, {})
|
|
@@ -32,6 +34,6 @@ const j = ({ onEvent: l, machine: m }) => {
|
|
|
32
34
|
) });
|
|
33
35
|
};
|
|
34
36
|
export {
|
|
35
|
-
|
|
37
|
+
b as Flow
|
|
36
38
|
};
|
|
37
39
|
//# sourceMappingURL=Flow.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Flow.js","sources":["../../../src/components/Flow/Flow.tsx"],"sourcesContent":["import { useMachine } from 'react-robot'\nimport { type Machine } from 'robot3'\nimport { useTranslation } from 'react-i18next'\nimport type { OnEventType } from '../Base/useBase'\nimport type { FlowContextInterface } from './useFlow'\nimport { FlowContext } from './useFlow'\nimport { type EventType } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\ntype FlowProps = {\n machine: Machine<object, FlowContextInterface>\n onEvent: OnEventType<EventType, unknown>\n}\n\nexport const Flow = ({ onEvent, machine }: FlowProps) => {\n const Components = useComponentContext()\n const { t } = useTranslation()\n const [current, send, service] = useMachine(machine, {\n onEvent: handleEvent,\n component: null,\n })\n\n const showProgress = current.context.showProgress ?? false\n const totalSteps = current.context.totalSteps ?? null\n const currentStep = current.context.currentStep ?? null\n\n function handleEvent(type: EventType, data: unknown): void {\n //When dealing with nested state machine, correct machine needs to recieve an event\n if (service.child) {\n //@ts-expect-error: not sure why 'type' type is incorrectly derived here\n service.child.send({ type: type, payload: data })\n } else {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n send({ type: type, payload: data })\n }\n // Pass event upstream - onEvent can be optional on Flow component\n onEvent(type, data)\n }\n\n return (\n <>\n <FlowContext.Provider\n value={{\n ...current.context,\n }}\n >\n {showProgress && currentStep && totalSteps && (\n <Components.ProgressBar\n totalSteps={totalSteps}\n currentStep={currentStep}\n label={t('progressBarLabel', { totalSteps, currentStep })}\n />\n )}\n {current.context.component && <current.context.component />}\n </FlowContext.Provider>\n </>\n )\n}\n"],"names":["Flow","onEvent","machine","Components","useComponentContext","t","useTranslation","current","send","service","useMachine","handleEvent","showProgress","totalSteps","currentStep","type","data","jsx","Fragment","jsxs","FlowContext"],"mappings":";;;;;AAcO,MAAMA,IAAO,CAAC,EAAE,SAAAC,GAAS,SAAAC,QAAyB;AACvD,QAAMC,IAAaC,EAAA,GACb,EAAE,GAAAC,EAAA,IAAMC,EAAA,GACR,CAACC,GAASC,GAAMC,CAAO,IAAIC,EAAWR,GAAS;AAAA,IACnD,SAASS;AAAA,IACT,WAAW;AAAA,EAAA,
|
|
1
|
+
{"version":3,"file":"Flow.js","sources":["../../../src/components/Flow/Flow.tsx"],"sourcesContent":["import { useMachine } from 'react-robot'\nimport { type Machine } from 'robot3'\nimport { useTranslation } from 'react-i18next'\nimport type { OnEventType } from '../Base/useBase'\nimport type { FlowContextInterface } from './useFlow'\nimport { FlowContext } from './useFlow'\nimport { type EventType } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\ntype FlowProps = {\n machine: Machine<object, FlowContextInterface>\n onEvent: OnEventType<EventType, unknown>\n}\n\nexport const Flow = ({ onEvent, machine }: FlowProps) => {\n const Components = useComponentContext()\n const { t } = useTranslation()\n const [current, send, service] = useMachine(machine, {\n onEvent: handleEvent,\n component: null,\n progressBarCta: null,\n })\n\n const showProgress = current.context.showProgress ?? false\n const totalSteps = current.context.totalSteps ?? null\n const currentStep = current.context.currentStep ?? null\n\n function handleEvent(type: EventType, data: unknown): void {\n //When dealing with nested state machine, correct machine needs to recieve an event\n if (service.child) {\n //@ts-expect-error: not sure why 'type' type is incorrectly derived here\n service.child.send({ type: type, payload: data })\n } else {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n send({ type: type, payload: data })\n }\n // Pass event upstream - onEvent can be optional on Flow component\n onEvent(type, data)\n }\n\n return (\n <>\n <FlowContext.Provider\n value={{\n ...current.context,\n }}\n >\n {showProgress && currentStep && totalSteps && (\n <Components.ProgressBar\n totalSteps={totalSteps}\n currentStep={currentStep}\n label={t('progressBarLabel', { totalSteps, currentStep })}\n cta={current.context.progressBarCta}\n />\n )}\n {current.context.component && <current.context.component />}\n </FlowContext.Provider>\n </>\n )\n}\n"],"names":["Flow","onEvent","machine","Components","useComponentContext","t","useTranslation","current","send","service","useMachine","handleEvent","showProgress","totalSteps","currentStep","type","data","jsx","Fragment","jsxs","FlowContext"],"mappings":";;;;;AAcO,MAAMA,IAAO,CAAC,EAAE,SAAAC,GAAS,SAAAC,QAAyB;AACvD,QAAMC,IAAaC,EAAA,GACb,EAAE,GAAAC,EAAA,IAAMC,EAAA,GACR,CAACC,GAASC,GAAMC,CAAO,IAAIC,EAAWR,GAAS;AAAA,IACnD,SAASS;AAAA,IACT,WAAW;AAAA,IACX,gBAAgB;AAAA,EAAA,CACjB,GAEKC,IAAeL,EAAQ,QAAQ,gBAAgB,IAC/CM,IAAaN,EAAQ,QAAQ,cAAc,MAC3CO,IAAcP,EAAQ,QAAQ,eAAe;AAEnD,WAASI,EAAYI,GAAiBC,GAAqB;AAEzD,IAAIP,EAAQ,QAEVA,EAAQ,MAAM,KAAK,EAAE,MAAAM,GAAY,SAASC,GAAM,IAGhDR,EAAK,EAAE,MAAAO,GAAY,SAASC,EAAA,CAAM,GAGpCf,EAAQc,GAAMC,CAAI;AAAA,EACpB;AAEA,SACE,gBAAAC,EAAAC,GAAA,EACE,UAAA,gBAAAC;AAAA,IAACC,EAAY;AAAA,IAAZ;AAAA,MACC,OAAO;AAAA,QACL,GAAGb,EAAQ;AAAA,MAAA;AAAA,MAGZ,UAAA;AAAA,QAAAK,KAAgBE,KAAeD,KAC9B,gBAAAI;AAAA,UAACd,EAAW;AAAA,UAAX;AAAA,YACC,YAAAU;AAAA,YACA,aAAAC;AAAA,YACA,OAAOT,EAAE,oBAAoB,EAAE,YAAAQ,GAAY,aAAAC,GAAa;AAAA,YACxD,KAAKP,EAAQ,QAAQ;AAAA,UAAA;AAAA,QAAA;AAAA,QAGxBA,EAAQ,QAAQ,+BAAcA,EAAQ,QAAQ,WAAhB,CAAA,CAA0B;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,GAE7D;AAEJ;"}
|
|
@@ -8,6 +8,7 @@ export interface FlowContextInterface {
|
|
|
8
8
|
totalSteps?: number;
|
|
9
9
|
currentStep?: number | null;
|
|
10
10
|
defaultValues?: Record<string, unknown>;
|
|
11
|
+
progressBarCta?: React.ComponentType | null;
|
|
11
12
|
}
|
|
12
13
|
export declare const FlowContext: import('react').Context<FlowContextInterface | null>;
|
|
13
14
|
export declare function useFlow<C extends FlowContextInterface>(): C;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFlow.js","sources":["../../../src/components/Flow/useFlow.ts"],"sourcesContent":["import { createContext, useContext } from 'react'\nimport type { OnEventType } from '../Base/useBase'\nimport type { CommonComponentInterface } from '../Base'\nimport type { EventType } from '@/shared/constants'\n\nexport interface FlowContextInterface {\n component: React.ComponentType<CommonComponentInterface> | null\n onEvent: OnEventType<EventType, unknown>\n showProgress?: boolean\n totalSteps?: number\n currentStep?: number | null\n defaultValues?: Record<string, unknown>\n}\n\nexport const FlowContext = createContext<FlowContextInterface | null>(null)\n\n//TODO: This is hiding the fact that the callsite for useFlow\n// destructures a `companyId` that doesn't seem to exist\n// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters\nexport function useFlow<C extends FlowContextInterface>() {\n // When used outside provider, this is expected to return undefined - consumers must fallback to params\n const values = useContext<C>(FlowContext as unknown as React.Context<C>)\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (!values) {\n throw new Error('useFlow used outside provider')\n }\n return values\n}\n"],"names":["FlowContext","createContext","useFlow","values","useContext"],"mappings":";
|
|
1
|
+
{"version":3,"file":"useFlow.js","sources":["../../../src/components/Flow/useFlow.ts"],"sourcesContent":["import { createContext, useContext } from 'react'\nimport type { OnEventType } from '../Base/useBase'\nimport type { CommonComponentInterface } from '../Base'\nimport type { EventType } from '@/shared/constants'\n\nexport interface FlowContextInterface {\n component: React.ComponentType<CommonComponentInterface> | null\n onEvent: OnEventType<EventType, unknown>\n showProgress?: boolean\n totalSteps?: number\n currentStep?: number | null\n defaultValues?: Record<string, unknown>\n progressBarCta?: React.ComponentType | null\n}\n\nexport const FlowContext = createContext<FlowContextInterface | null>(null)\n\n//TODO: This is hiding the fact that the callsite for useFlow\n// destructures a `companyId` that doesn't seem to exist\n// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters\nexport function useFlow<C extends FlowContextInterface>() {\n // When used outside provider, this is expected to return undefined - consumers must fallback to params\n const values = useContext<C>(FlowContext as unknown as React.Context<C>)\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (!values) {\n throw new Error('useFlow used outside provider')\n }\n return values\n}\n"],"names":["FlowContext","createContext","useFlow","values","useContext"],"mappings":";AAeO,MAAMA,IAAcC,EAA2C,IAAI;AAKnE,SAASC,IAA0C;AAExD,QAAMC,IAASC,EAAcJ,CAA0C;AAEvE,MAAI,CAACG;AACH,UAAM,IAAI,MAAM,+BAA+B;AAEjD,SAAOA;AACT;"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { BaseComponentInterface } from '../../Base/Base';
|
|
2
|
+
interface PayrollConfigurationProps extends BaseComponentInterface {
|
|
3
|
+
payrollId: string;
|
|
4
|
+
}
|
|
5
|
+
export declare const PayrollConfiguration: ({ onEvent, payrollId, ...baseProps }: PayrollConfigurationProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { useState as s } from "react";
|
|
3
|
+
import { PayrollEditEmployee as d } from "../PayrollEditEmployee/PayrollEditEmployee.js";
|
|
4
|
+
import { PayrollConfigurationPresentation as E } from "./PayrollConfigurationPresentation.js";
|
|
5
|
+
import { BaseComponent as y } from "../../Base/Base.js";
|
|
6
|
+
import { componentEvents as e } from "../../../shared/constants.js";
|
|
7
|
+
const u = ({ payrollId: o }) => ({
|
|
8
|
+
data: {
|
|
9
|
+
employees: [{ employeeId: "cdef" }]
|
|
10
|
+
}
|
|
11
|
+
}), P = ({ payrollId: o }) => ({ mutate: async () => {
|
|
12
|
+
} }), D = ({
|
|
13
|
+
onEvent: o,
|
|
14
|
+
payrollId: n,
|
|
15
|
+
...i
|
|
16
|
+
}) => {
|
|
17
|
+
const {
|
|
18
|
+
data: { employees: m }
|
|
19
|
+
} = u({ payrollId: n }), { mutate: c } = P({ payrollId: n }), [r, l] = s(void 0);
|
|
20
|
+
return /* @__PURE__ */ a(y, { ...i, onEvent: o, children: r ? /* @__PURE__ */ a(d, { onEvent: (t, p) => {
|
|
21
|
+
t === e.RUN_PAYROLL_EMPLOYEE_SAVED && l(void 0), o(t, p);
|
|
22
|
+
}, employeeId: r }) : /* @__PURE__ */ a(
|
|
23
|
+
E,
|
|
24
|
+
{
|
|
25
|
+
employees: m,
|
|
26
|
+
onBack: () => {
|
|
27
|
+
o(e.RUN_PAYROLL_BACK);
|
|
28
|
+
},
|
|
29
|
+
onCalculatePayroll: async () => {
|
|
30
|
+
await c(), o(e.RUN_PAYROLL_CALCULATED);
|
|
31
|
+
},
|
|
32
|
+
onEdit: ({ employeeId: t }) => {
|
|
33
|
+
l(t), o(e.RUN_PAYROLL_EMPLOYEE_EDITED, { employeeId: t });
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
) });
|
|
37
|
+
};
|
|
38
|
+
export {
|
|
39
|
+
D as PayrollConfiguration
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=PayrollConfiguration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PayrollConfiguration.js","sources":["../../../../src/components/Payroll/PayrollConfiguration/PayrollConfiguration.tsx"],"sourcesContent":["import { useState } from 'react'\nimport { PayrollEditEmployee } from '../PayrollEditEmployee/PayrollEditEmployee'\nimport { PayrollConfigurationPresentation } from './PayrollConfigurationPresentation'\nimport type { BaseComponentInterface } from '@/components/Base/Base'\nimport { BaseComponent } from '@/components/Base/Base'\nimport type { EventType } from '@/shared/constants'\nimport { componentEvents } from '@/shared/constants'\nimport type { OnEventType } from '@/components/Base/useBase'\n\n//TODO: Use Speakeasy type\ninterface PayrollItem {\n payrollId: string\n}\n\n// TODO: Replace this hook with call to Speakeasy instead\nconst usePayrollApi = ({ payrollId }: PayrollItem) => {\n return {\n data: {\n employees: [{ employeeId: 'cdef' }],\n },\n }\n}\n// TODO: Replace this hook with call to Speakeasy instead\nconst useCalculatePayrollApi = ({ payrollId }: PayrollItem) => {\n const mutate = async () => {}\n return { mutate }\n}\n\ninterface PayrollConfigurationProps extends BaseComponentInterface {\n payrollId: string\n}\nexport const PayrollConfiguration = ({\n onEvent,\n payrollId,\n ...baseProps\n}: PayrollConfigurationProps) => {\n const {\n data: { employees },\n } = usePayrollApi({ payrollId })\n const { mutate } = useCalculatePayrollApi({ payrollId })\n const [editedEmployeeId, setEditedEmployeeId] = useState<string | undefined>(undefined)\n const onBack = () => {\n onEvent(componentEvents.RUN_PAYROLL_BACK)\n }\n const onCalculatePayroll = async () => {\n await mutate()\n onEvent(componentEvents.RUN_PAYROLL_CALCULATED)\n }\n const onEdit = ({ employeeId }: { employeeId: string }) => {\n setEditedEmployeeId(employeeId)\n onEvent(componentEvents.RUN_PAYROLL_EMPLOYEE_EDITED, { employeeId })\n }\n\n const wrappedOnEvent: OnEventType<string, unknown> = (event, payload) => {\n if (event === componentEvents.RUN_PAYROLL_EMPLOYEE_SAVED) {\n setEditedEmployeeId(undefined)\n }\n onEvent(event as EventType, payload)\n }\n\n const childComponent = editedEmployeeId ? (\n <PayrollEditEmployee onEvent={wrappedOnEvent} employeeId={editedEmployeeId} />\n ) : (\n <PayrollConfigurationPresentation\n employees={employees}\n onBack={onBack}\n onCalculatePayroll={onCalculatePayroll}\n onEdit={onEdit}\n />\n )\n\n return (\n <BaseComponent {...baseProps} onEvent={onEvent}>\n {childComponent}\n </BaseComponent>\n )\n}\n"],"names":["usePayrollApi","payrollId","useCalculatePayrollApi","PayrollConfiguration","onEvent","baseProps","employees","mutate","editedEmployeeId","setEditedEmployeeId","useState","jsx","BaseComponent","PayrollEditEmployee","event","payload","componentEvents","PayrollConfigurationPresentation","employeeId"],"mappings":";;;;;;AAeA,MAAMA,IAAgB,CAAC,EAAE,WAAAC,SAChB;AAAA,EACL,MAAM;AAAA,IACJ,WAAW,CAAC,EAAE,YAAY,QAAQ;AAAA,EAAA;AACpC,IAIEC,IAAyB,CAAC,EAAE,WAAAD,SAEzB,EAAE,QADM,YAAY;AAAC,EACnB,IAMEE,IAAuB,CAAC;AAAA,EACnC,SAAAC;AAAA,EACA,WAAAH;AAAA,EACA,GAAGI;AACL,MAAiC;AAC/B,QAAM;AAAA,IACJ,MAAM,EAAE,WAAAC,EAAA;AAAA,EAAU,IAChBN,EAAc,EAAE,WAAAC,GAAW,GACzB,EAAE,QAAAM,EAAA,IAAWL,EAAuB,EAAE,WAAAD,GAAW,GACjD,CAACO,GAAkBC,CAAmB,IAAIC,EAA6B,MAAS;AA+BtF,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGP,GAAW,SAAAD,GAC3B,UAbkBI,IACrB,gBAAAG,EAACE,GAAA,EAAoB,SAR8B,CAACC,GAAOC,MAAY;AACvE,IAAID,MAAUE,EAAgB,8BAC5BP,EAAoB,MAAS,GAE/BL,EAAQU,GAAoBC,CAAO;AAAA,EACrC,GAGgD,YAAYP,GAAkB,IAE5E,gBAAAG;AAAA,IAACM;AAAA,IAAA;AAAA,MACC,WAAAX;AAAA,MACA,QAxBW,MAAM;AACnB,QAAAF,EAAQY,EAAgB,gBAAgB;AAAA,MAC1C;AAAA,MAuBI,oBAtBuB,YAAY;AACrC,cAAMT,EAAA,GACNH,EAAQY,EAAgB,sBAAsB;AAAA,MAChD;AAAA,MAoBI,QAnBW,CAAC,EAAE,YAAAE,QAAyC;AACzD,QAAAT,EAAoBS,CAAU,GAC9Bd,EAAQY,EAAgB,6BAA6B,EAAE,YAAAE,EAAA,CAAY;AAAA,MACrE;AAAA,IAgBI;AAAA,EAAA,GAOF;AAEJ;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface Employee {
|
|
2
|
+
employeeId: string;
|
|
3
|
+
}
|
|
4
|
+
interface PayrollConfigurationPresentationProps {
|
|
5
|
+
employees: Employee[];
|
|
6
|
+
onBack: () => void;
|
|
7
|
+
onCalculatePayroll: () => void;
|
|
8
|
+
onEdit: (employee: Employee) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare const PayrollConfigurationPresentation: ({ employees, onBack, onEdit, onCalculatePayroll, }: PayrollConfigurationPresentationProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Flex as r } from "../../Common/Flex/Flex.js";
|
|
3
|
+
import { useComponentContext as h } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
4
|
+
import { HamburgerMenu as m } from "../../Common/HamburgerMenu/HamburgerMenu.js";
|
|
5
|
+
import p from "../../../assets/icons/pencil.svg.js";
|
|
6
|
+
import { DataView as y } from "../../Common/DataView/DataView.js";
|
|
7
|
+
const J = ({
|
|
8
|
+
employees: a,
|
|
9
|
+
onBack: d,
|
|
10
|
+
onEdit: c,
|
|
11
|
+
onCalculatePayroll: s
|
|
12
|
+
}) => {
|
|
13
|
+
const { Alert: n, Button: o, Heading: t, Text: l } = h();
|
|
14
|
+
return /* @__PURE__ */ i(r, { flexDirection: "column", children: [
|
|
15
|
+
/* @__PURE__ */ i(r, { justifyContent: "space-between", children: [
|
|
16
|
+
/* @__PURE__ */ e(t, { as: "h1", children: "Run payroll for Jul 5 - Jul 18, 2025" }),
|
|
17
|
+
/* @__PURE__ */ e(o, { title: "Calculate payroll", onClick: s, children: "Calculate payroll" })
|
|
18
|
+
] }),
|
|
19
|
+
/* @__PURE__ */ e(l, { children: "Regular payroll" }),
|
|
20
|
+
/* @__PURE__ */ i(r, { flexDirection: "column", alignItems: "stretch", children: [
|
|
21
|
+
/* @__PURE__ */ e(
|
|
22
|
+
n,
|
|
23
|
+
{
|
|
24
|
+
label: "To pay your employees with direct deposit on Fri, Jul 25, you'll need to run payroll by 7:00 PM EDT on Wed, Jul 23",
|
|
25
|
+
status: "info",
|
|
26
|
+
children: "If you miss this deadline, your employees' direct deposit will be delayed."
|
|
27
|
+
}
|
|
28
|
+
),
|
|
29
|
+
/* @__PURE__ */ e(n, { label: "2 employees will be skipped this payroll", status: "warning", children: /* @__PURE__ */ i("ul", { children: [
|
|
30
|
+
/* @__PURE__ */ e("li", { children: "John Smith - Employee address not verified" }),
|
|
31
|
+
/* @__PURE__ */ e("li", { children: "Jensen Cooper - Employee address not verified" })
|
|
32
|
+
] }) })
|
|
33
|
+
] }),
|
|
34
|
+
/* @__PURE__ */ e(t, { as: "h3", children: "Hours and additional earnings" }),
|
|
35
|
+
/* @__PURE__ */ e(l, { children: "Review and update..." }),
|
|
36
|
+
/* @__PURE__ */ e(
|
|
37
|
+
y,
|
|
38
|
+
{
|
|
39
|
+
label: "Configuration",
|
|
40
|
+
columns: [
|
|
41
|
+
{
|
|
42
|
+
title: "Employees",
|
|
43
|
+
render: () => /* @__PURE__ */ i(r, { flexDirection: "column", children: [
|
|
44
|
+
/* @__PURE__ */ e(l, { children: "John Smith" }),
|
|
45
|
+
/* @__PURE__ */ e(l, { children: "$22.00/hr" })
|
|
46
|
+
] })
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
title: "Hours",
|
|
50
|
+
render: () => /* @__PURE__ */ e(l, { children: "40" })
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
data: a,
|
|
54
|
+
itemMenu: ({ employeeId: u }) => /* @__PURE__ */ e(
|
|
55
|
+
m,
|
|
56
|
+
{
|
|
57
|
+
items: [
|
|
58
|
+
{
|
|
59
|
+
label: "Edit",
|
|
60
|
+
icon: /* @__PURE__ */ e(p, { "aria-hidden": !0 }),
|
|
61
|
+
onClick: () => {
|
|
62
|
+
c({ employeeId: u });
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
],
|
|
66
|
+
triggerLabel: "Edit",
|
|
67
|
+
isLoading: !1
|
|
68
|
+
}
|
|
69
|
+
)
|
|
70
|
+
}
|
|
71
|
+
),
|
|
72
|
+
/* @__PURE__ */ e(o, { title: "Back", onClick: d, children: "Back" })
|
|
73
|
+
] });
|
|
74
|
+
};
|
|
75
|
+
export {
|
|
76
|
+
J as PayrollConfigurationPresentation
|
|
77
|
+
};
|
|
78
|
+
//# sourceMappingURL=PayrollConfigurationPresentation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PayrollConfigurationPresentation.js","sources":["../../../../src/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.tsx"],"sourcesContent":["import { DataView, Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\n\n//TODO: Use Speakeasy type\ninterface Employee {\n employeeId: string\n}\n\ninterface PayrollConfigurationPresentationProps {\n employees: Employee[]\n onBack: () => void\n onCalculatePayroll: () => void\n onEdit: (employee: Employee) => void\n}\n\nexport const PayrollConfigurationPresentation = ({\n employees,\n onBack,\n onEdit,\n onCalculatePayroll,\n}: PayrollConfigurationPresentationProps) => {\n const { Alert, Button, Heading, Text } = useComponentContext()\n\n return (\n <Flex flexDirection=\"column\">\n <Flex justifyContent=\"space-between\">\n <Heading as=\"h1\">Run payroll for Jul 5 - Jul 18, 2025</Heading>\n <Button title=\"Calculate payroll\" onClick={onCalculatePayroll}>\n Calculate payroll\n </Button>\n </Flex>\n <Text>Regular payroll</Text>\n <Flex flexDirection=\"column\" alignItems=\"stretch\">\n <Alert\n label=\"To pay your employees with direct deposit on Fri, Jul 25, you'll need to run payroll by 7:00 PM EDT on Wed, Jul 23\"\n status=\"info\"\n >\n {\"If you miss this deadline, your employees' direct deposit will be delayed.\"}\n </Alert>\n <Alert label=\"2 employees will be skipped this payroll\" status=\"warning\">\n <ul>\n <li>John Smith - Employee address not verified</li>\n <li>Jensen Cooper - Employee address not verified</li>\n </ul>\n </Alert>\n </Flex>\n\n <Heading as=\"h3\">Hours and additional earnings</Heading>\n <Text>Review and update...</Text>\n <DataView\n label=\"Configuration\"\n columns={[\n {\n title: 'Employees',\n render: () => (\n <Flex flexDirection=\"column\">\n <Text>John Smith</Text>\n <Text>$22.00/hr</Text>\n </Flex>\n ),\n },\n {\n title: 'Hours',\n render: () => <Text>40</Text>,\n },\n ]}\n data={employees}\n itemMenu={({ employeeId }) => (\n <HamburgerMenu\n items={[\n {\n label: 'Edit',\n icon: <PencilSvg aria-hidden />,\n onClick: () => {\n onEdit({ employeeId })\n },\n },\n ]}\n triggerLabel=\"Edit\"\n isLoading={false}\n />\n )}\n />\n <Button title=\"Back\" onClick={onBack}>\n Back\n </Button>\n </Flex>\n )\n}\n"],"names":["PayrollConfigurationPresentation","employees","onBack","onEdit","onCalculatePayroll","Alert","Button","Heading","Text","useComponentContext","jsxs","Flex","jsx","DataView","employeeId","HamburgerMenu","PencilSvg"],"mappings":";;;;;;AAiBO,MAAMA,IAAmC,CAAC;AAAA,EAC/C,WAAAC;AAAA,EACA,QAAAC;AAAA,EACA,QAAAC;AAAA,EACA,oBAAAC;AACF,MAA6C;AAC3C,QAAM,EAAE,OAAAC,GAAO,QAAAC,GAAQ,SAAAC,GAAS,MAAAC,EAAA,IAASC,EAAA;AAEzC,SACE,gBAAAC,EAACC,GAAA,EAAK,eAAc,UAClB,UAAA;AAAA,IAAA,gBAAAD,EAACC,GAAA,EAAK,gBAAe,iBACnB,UAAA;AAAA,MAAA,gBAAAC,EAACL,GAAA,EAAQ,IAAG,MAAK,UAAA,wCAAoC;AAAA,wBACpDD,GAAA,EAAO,OAAM,qBAAoB,SAASF,GAAoB,UAAA,oBAAA,CAE/D;AAAA,IAAA,GACF;AAAA,IACA,gBAAAQ,EAACJ,KAAK,UAAA,kBAAA,CAAe;AAAA,IACrB,gBAAAE,EAACC,GAAA,EAAK,eAAc,UAAS,YAAW,WACtC,UAAA;AAAA,MAAA,gBAAAC;AAAA,QAACP;AAAA,QAAA;AAAA,UACC,OAAM;AAAA,UACN,QAAO;AAAA,UAEN,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,wBAEFA,GAAA,EAAM,OAAM,4CAA2C,QAAO,WAC7D,4BAAC,MAAA,EACC,UAAA;AAAA,QAAA,gBAAAO,EAAC,QAAG,UAAA,6CAAA,CAA0C;AAAA,QAC9C,gBAAAA,EAAC,QAAG,UAAA,gDAAA,CAA6C;AAAA,MAAA,EAAA,CACnD,EAAA,CACF;AAAA,IAAA,GACF;AAAA,IAEA,gBAAAA,EAACL,GAAA,EAAQ,IAAG,MAAK,UAAA,iCAA6B;AAAA,IAC9C,gBAAAK,EAACJ,KAAK,UAAA,uBAAA,CAAoB;AAAA,IAC1B,gBAAAI;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,OAAM;AAAA,QACN,SAAS;AAAA,UACP;AAAA,YACE,OAAO;AAAA,YACP,QAAQ,MACN,gBAAAH,EAACC,GAAA,EAAK,eAAc,UAClB,UAAA;AAAA,cAAA,gBAAAC,EAACJ,KAAK,UAAA,aAAA,CAAU;AAAA,cAChB,gBAAAI,EAACJ,KAAK,UAAA,YAAA,CAAS;AAAA,YAAA,EAAA,CACjB;AAAA,UAAA;AAAA,UAGJ;AAAA,YACE,OAAO;AAAA,YACP,QAAQ,MAAM,gBAAAI,EAACJ,GAAA,EAAK,UAAA,KAAA,CAAE;AAAA,UAAA;AAAA,QACxB;AAAA,QAEF,MAAMP;AAAA,QACN,UAAU,CAAC,EAAE,YAAAa,EAAA,MACX,gBAAAF;AAAA,UAACG;AAAA,UAAA;AAAA,YACC,OAAO;AAAA,cACL;AAAA,gBACE,OAAO;AAAA,gBACP,MAAM,gBAAAH,EAACI,GAAA,EAAU,eAAW,GAAA,CAAC;AAAA,gBAC7B,SAAS,MAAM;AACb,kBAAAb,EAAO,EAAE,YAAAW,GAAY;AAAA,gBACvB;AAAA,cAAA;AAAA,YACF;AAAA,YAEF,cAAa;AAAA,YACb,WAAW;AAAA,UAAA;AAAA,QAAA;AAAA,MACb;AAAA,IAAA;AAAA,sBAGHR,GAAA,EAAO,OAAM,QAAO,SAASJ,GAAQ,UAAA,OAAA,CAEtC;AAAA,EAAA,GACF;AAEJ;"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { BaseComponentInterface } from '../../Base/Base';
|
|
2
|
+
interface PayrollEditEmployeeProps extends BaseComponentInterface {
|
|
3
|
+
employeeId: string;
|
|
4
|
+
}
|
|
5
|
+
export declare const PayrollEditEmployee: ({ employeeId, onEvent, ...baseProps }: PayrollEditEmployeeProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { PayrollEditEmployeePresentation as r } from "./PayrollEditEmployeePresentation.js";
|
|
3
|
+
import { componentEvents as p } from "../../../shared/constants.js";
|
|
4
|
+
import { BaseComponent as s } from "../../Base/Base.js";
|
|
5
|
+
const a = ({ employeeId: t }) => ({ mutate: async () => {
|
|
6
|
+
} }), u = ({
|
|
7
|
+
employeeId: t,
|
|
8
|
+
onEvent: o,
|
|
9
|
+
...n
|
|
10
|
+
}) => {
|
|
11
|
+
const { mutate: m } = a({ employeeId: t });
|
|
12
|
+
return /* @__PURE__ */ e(s, { ...n, onEvent: o, children: /* @__PURE__ */ e(r, { onDone: async () => {
|
|
13
|
+
await m(), o(p.RUN_PAYROLL_EMPLOYEE_SAVED);
|
|
14
|
+
} }) });
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
u as PayrollEditEmployee
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=PayrollEditEmployee.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PayrollEditEmployee.js","sources":["../../../../src/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.tsx"],"sourcesContent":["import { PayrollEditEmployeePresentation } from './PayrollEditEmployeePresentation'\nimport { componentEvents } from '@/shared/constants'\nimport type { BaseComponentInterface } from '@/components/Base/Base'\nimport { BaseComponent } from '@/components/Base/Base'\n\n//TODO: Use Speakeasy type\ninterface Employee {\n employeeId: string\n}\n\n// TODO: Replace this hook with call to Speakeasy instead\nconst useEditEmployeeApi = ({ employeeId }: Employee) => {\n const mutate = async () => {}\n return { mutate }\n}\n\ninterface PayrollEditEmployeeProps extends BaseComponentInterface {\n employeeId: string\n}\n\nexport const PayrollEditEmployee = ({\n employeeId,\n onEvent,\n ...baseProps\n}: PayrollEditEmployeeProps) => {\n const { mutate } = useEditEmployeeApi({ employeeId })\n const onDone = async () => {\n await mutate()\n onEvent(componentEvents.RUN_PAYROLL_EMPLOYEE_SAVED)\n }\n return (\n <BaseComponent {...baseProps} onEvent={onEvent}>\n <PayrollEditEmployeePresentation onDone={onDone} />\n </BaseComponent>\n )\n}\n"],"names":["useEditEmployeeApi","employeeId","PayrollEditEmployee","onEvent","baseProps","mutate","jsx","BaseComponent","PayrollEditEmployeePresentation","componentEvents"],"mappings":";;;;AAWA,MAAMA,IAAqB,CAAC,EAAE,YAAAC,SAErB,EAAE,QADM,YAAY;AAAC,EACnB,IAOEC,IAAsB,CAAC;AAAA,EAClC,YAAAD;AAAA,EACA,SAAAE;AAAA,EACA,GAAGC;AACL,MAAgC;AAC9B,QAAM,EAAE,QAAAC,EAAA,IAAWL,EAAmB,EAAE,YAAAC,GAAY;AAKpD,SACE,gBAAAK,EAACC,KAAe,GAAGH,GAAW,SAAAD,GAC5B,UAAA,gBAAAG,EAACE,GAAA,EAAgC,QANtB,YAAY;AACzB,UAAMH,EAAA,GACNF,EAAQM,EAAgB,0BAA0B;AAAA,EACpD,GAGqD,EAAA,CACnD;AAEJ;"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsxs as l, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useForm as m, FormProvider as s } from "react-hook-form";
|
|
3
|
+
import { Flex as a } from "../../Common/Flex/Flex.js";
|
|
4
|
+
import { useComponentContext as d } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
5
|
+
import { Form as u } from "../../Common/Form/Form.js";
|
|
6
|
+
import { NumberInputField as c } from "../../Common/Fields/NumberInputField/NumberInputField.js";
|
|
7
|
+
const H = ({ onDone: o }) => {
|
|
8
|
+
const { Button: n, Heading: e, Text: t } = d(), i = m();
|
|
9
|
+
return /* @__PURE__ */ l(a, { flexDirection: "column", gap: 20, children: [
|
|
10
|
+
/* @__PURE__ */ r(e, { as: "h2", children: "Edit Hannah Arendt's payroll" }),
|
|
11
|
+
/* @__PURE__ */ r(e, { as: "h1", children: "$1,173.08" }),
|
|
12
|
+
/* @__PURE__ */ r(t, { children: "Gross pay" }),
|
|
13
|
+
/* @__PURE__ */ r(e, { as: "h3", children: "Regular hours" }),
|
|
14
|
+
/* @__PURE__ */ r(s, { ...i, children: /* @__PURE__ */ r(u, { children: /* @__PURE__ */ r(c, { defaultValue: 40, isRequired: !0, label: "Hours", name: "hours" }) }) }),
|
|
15
|
+
/* @__PURE__ */ r(n, { onClick: o, title: "Done", children: "Done" })
|
|
16
|
+
] });
|
|
17
|
+
};
|
|
18
|
+
export {
|
|
19
|
+
H as PayrollEditEmployeePresentation
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=PayrollEditEmployeePresentation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PayrollEditEmployeePresentation.js","sources":["../../../../src/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.tsx"],"sourcesContent":["import { FormProvider, useForm } from 'react-hook-form'\nimport { Flex, NumberInputField } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { Form } from '@/components/Common/Form'\n\ninterface PayrollEditEmployeeProps {\n onDone: () => void\n}\n\nexport const PayrollEditEmployeePresentation = ({ onDone }: PayrollEditEmployeeProps) => {\n const { Button, Heading, Text } = useComponentContext()\n const formHandlers = useForm()\n return (\n <Flex flexDirection=\"column\" gap={20}>\n <Heading as=\"h2\">{`Edit Hannah Arendt's payroll`}</Heading>\n <Heading as=\"h1\">$1,173.08</Heading>\n <Text>Gross pay</Text>\n <Heading as=\"h3\">Regular hours</Heading>\n <FormProvider {...formHandlers}>\n <Form>\n <NumberInputField defaultValue={40} isRequired label=\"Hours\" name=\"hours\" />\n </Form>\n </FormProvider>\n\n <Button onClick={onDone} title=\"Done\">\n Done\n </Button>\n </Flex>\n )\n}\n"],"names":["PayrollEditEmployeePresentation","onDone","Button","Heading","Text","useComponentContext","formHandlers","useForm","jsxs","Flex","jsx","FormProvider","Form","NumberInputField"],"mappings":";;;;;;AASO,MAAMA,IAAkC,CAAC,EAAE,QAAAC,QAAuC;AACvF,QAAM,EAAE,QAAAC,GAAQ,SAAAC,GAAS,MAAAC,EAAA,IAASC,EAAA,GAC5BC,IAAeC,EAAA;AACrB,SACE,gBAAAC,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,IAAA,gBAAAC,EAACP,GAAA,EAAQ,IAAG,MAAM,UAAA,gCAA+B;AAAA,IACjD,gBAAAO,EAACP,GAAA,EAAQ,IAAG,MAAK,UAAA,aAAS;AAAA,IAC1B,gBAAAO,EAACN,KAAK,UAAA,YAAA,CAAS;AAAA,IACf,gBAAAM,EAACP,GAAA,EAAQ,IAAG,MAAK,UAAA,iBAAa;AAAA,sBAC7BQ,GAAA,EAAc,GAAGL,GAChB,UAAA,gBAAAI,EAACE,KACC,UAAA,gBAAAF,EAACG,GAAA,EAAiB,cAAc,IAAI,YAAU,IAAC,OAAM,SAAQ,MAAK,QAAA,CAAQ,GAC5E,GACF;AAAA,sBAECX,GAAA,EAAO,SAASD,GAAQ,OAAM,QAAO,UAAA,OAAA,CAEtC;AAAA,EAAA,GACF;AAEJ;"}
|