@gusto/embedded-react-sdk 0.24.0 → 0.24.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/dist/components/Common/SignatureForm/SignatureForm.js +11 -12
- package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormActions.js +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormFields.js +2 -2
- package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js +1 -1
- package/dist/components/Common/UI/ProgressBar/ProgressBar.js +4 -4
- package/dist/components/Company/AssignSignatory/AssignSignatory.js +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +12 -12
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js +5 -6
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +5 -6
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +2 -2
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +2 -2
- package/dist/components/Company/FederalTaxes/FederalTaxes.js +2 -2
- package/dist/components/Company/FederalTaxes/Form.js +3 -4
- package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Form.js +1 -1
- package/dist/components/Company/Locations/LocationForm/LocationForm.js +2 -2
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +2 -2
- package/dist/components/Company/OnboardingOverview/Completed.js +2 -3
- 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 -2
- package/dist/components/Company/PaySchedule/PaySchedule.js +2 -2
- package/dist/components/Company/PaySchedule/_parts/Edit.js +15 -15
- package/dist/components/Company/PaySchedule/_parts/Head.js +8 -9
- package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/List.js +11 -12
- package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
- package/dist/components/Contractor/Address/Address.js +2 -2
- package/dist/components/Contractor/Address/Form.js +1 -1
- package/dist/components/Contractor/ContractorList/index.js +17 -17
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +2 -2
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +13 -14
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +10 -10
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +9 -10
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js +2 -3
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +12 -13
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
- package/dist/components/Contractor/Profile/ContractorProfileForm.js +15 -15
- package/dist/components/Contractor/Submit/Submit.js +1 -1
- package/dist/components/Employee/Compensation/Edit.js +14 -14
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +8 -8
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +9 -9
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +9 -9
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +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/SignatureForm/SignatureForm.js +1 -1
- package/dist/components/Employee/EmployeeList/EmployeeList.js +3 -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/FederalTaxes/FederalForm.js +7 -7
- package/dist/components/Employee/Landing/Landing.js +8 -8
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +7 -7
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +2 -2
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +1 -1
- package/dist/components/Employee/PaymentMethod/Split.js +8 -8
- package/dist/components/Employee/Profile/AdminPersonalDetails.js +1 -1
- package/dist/components/Employee/Profile/HomeAddress.js +1 -1
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js +2 -2
- package/dist/components/Employee/Taxes/FederalForm.js +7 -7
- package/dist/components/Flow/Flow.js +2 -3
- package/dist/components/Flow/Flow.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +9 -9
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +6 -7
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +2 -3
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +27 -27
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +8 -9
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +17 -18
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +16 -17
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +10 -10
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js +2 -3
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js.map +1 -1
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +2 -3
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
- package/dist/i18n/en/common.json.d.ts +1 -0
- package/dist/i18n/en/common.json.js +1 -1
- package/dist/shared/constants.d.ts +1 -1
- package/dist/shared/constants.js +6 -5
- package/dist/shared/constants.js.map +1 -1
- package/dist/types/i18next.d.ts +1 -0
- package/package.json +3 -3
|
@@ -7,22 +7,22 @@ import l from "./Edit.module.scss.js";
|
|
|
7
7
|
import { Flex as y } from "../../../Common/Flex/Flex.js";
|
|
8
8
|
import { Grid as x } from "../../../Common/Grid/Grid.js";
|
|
9
9
|
import "classnames";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
10
|
+
import { useComponentContext as E } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
11
|
+
import { useDateFormatter as N } from "../../../../hooks/useDateFormatter.js";
|
|
12
|
+
import { TextInputField as F } from "../../../Common/Fields/TextInputField/TextInputField.js";
|
|
13
|
+
import { SelectField as R } from "../../../Common/Fields/SelectField/SelectField.js";
|
|
14
|
+
import { RadioGroupField as O } from "../../../Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
15
|
+
import { NumberInputField as h } from "../../../Common/Fields/NumberInputField/NumberInputField.js";
|
|
16
|
+
import { DatePickerField as f } from "../../../Common/Fields/DatePickerField/DatePickerField.js";
|
|
17
17
|
const K = () => {
|
|
18
|
-
const o =
|
|
18
|
+
const o = E(), { t: e } = C("Company.PaySchedule"), P = N(), { payPeriodPreview: r, mode: u, payPreviewLoading: D } = T(), { setValue: d } = q(), [a, v] = g(0), i = p({ name: "frequency" }), n = p({ name: "customTwicePerMonth" }), b = i === "Twice per month" && n === "custom" || i === "Monthly", w = i === "Twice per month" && n === "custom";
|
|
19
19
|
return S(() => {
|
|
20
20
|
i === "Twice per month" && n === "1st15th" && (d("day1", 15), d("day2", 31));
|
|
21
21
|
}, [i, n, d]), u !== "EDIT_PAY_SCHEDULE" && u !== "ADD_PAY_SCHEDULE" ? null : /* @__PURE__ */ t("div", { className: l.payScheduleContainer, children: /* @__PURE__ */ m(x, { gap: 32, gridTemplateColumns: { base: "1fr", small: "1fr 1fr" }, children: [
|
|
22
22
|
/* @__PURE__ */ t("div", { className: l.payScheduleForm, children: /* @__PURE__ */ m(y, { flexDirection: "column", children: [
|
|
23
|
-
/* @__PURE__ */ t(
|
|
23
|
+
/* @__PURE__ */ t(F, { name: "customName", label: e("labels.name"), isRequired: !0 }),
|
|
24
24
|
/* @__PURE__ */ t(
|
|
25
|
-
|
|
25
|
+
R,
|
|
26
26
|
{
|
|
27
27
|
name: "frequency",
|
|
28
28
|
label: e("labels.frequency"),
|
|
@@ -36,7 +36,7 @@ const K = () => {
|
|
|
36
36
|
}
|
|
37
37
|
),
|
|
38
38
|
i === "Twice per month" && /* @__PURE__ */ t(
|
|
39
|
-
|
|
39
|
+
O,
|
|
40
40
|
{
|
|
41
41
|
name: "customTwicePerMonth",
|
|
42
42
|
label: e("labels.frequencyOptions"),
|
|
@@ -48,7 +48,7 @@ const K = () => {
|
|
|
48
48
|
}
|
|
49
49
|
),
|
|
50
50
|
/* @__PURE__ */ t(
|
|
51
|
-
|
|
51
|
+
f,
|
|
52
52
|
{
|
|
53
53
|
name: "anchorPayDate",
|
|
54
54
|
label: e("labels.firstPayDate"),
|
|
@@ -57,7 +57,7 @@ const K = () => {
|
|
|
57
57
|
}
|
|
58
58
|
),
|
|
59
59
|
/* @__PURE__ */ t(
|
|
60
|
-
|
|
60
|
+
f,
|
|
61
61
|
{
|
|
62
62
|
name: "anchorEndOfPayPeriod",
|
|
63
63
|
label: e("labels.firstPayPeriodEndDate"),
|
|
@@ -65,8 +65,8 @@ const K = () => {
|
|
|
65
65
|
isRequired: !0
|
|
66
66
|
}
|
|
67
67
|
),
|
|
68
|
-
/* @__PURE__ */ t("div", { className: b ? "" : l.visuallyHidden, children: /* @__PURE__ */ t(
|
|
69
|
-
/* @__PURE__ */ t("div", { className: w ? "" : l.visuallyHidden, children: /* @__PURE__ */ t(
|
|
68
|
+
/* @__PURE__ */ t("div", { className: b ? "" : l.visuallyHidden, children: /* @__PURE__ */ t(h, { name: "day1", label: e("labels.firstPayDayOfTheMonth"), isRequired: !0 }) }),
|
|
69
|
+
/* @__PURE__ */ t("div", { className: w ? "" : l.visuallyHidden, children: /* @__PURE__ */ t(h, { name: "day2", label: e("labels.lastPayDayOfTheMonth"), isRequired: !0 }) })
|
|
70
70
|
] }) }),
|
|
71
71
|
/* @__PURE__ */ t(y, { flexDirection: "column", gap: 4, justifyContent: "center", alignItems: "center", children: r && r[a] ? /* @__PURE__ */ m("div", { className: l.calendarContainer, children: [
|
|
72
72
|
!D && /* @__PURE__ */ t(
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
import { jsx as e, jsxs as s, Fragment as o } from "react/jsx-runtime";
|
|
2
|
-
import { useTranslation as c, Trans as
|
|
2
|
+
import { useTranslation as c, Trans as a } from "react-i18next";
|
|
3
3
|
import { usePaySchedule as d } from "../usePaySchedule.js";
|
|
4
4
|
import { Flex as h } from "../../../Common/Flex/Flex.js";
|
|
5
5
|
import "classnames";
|
|
6
|
-
import "../../../../
|
|
7
|
-
import { useComponentContext as m } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
6
|
+
import { useComponentContext as l } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
8
7
|
import "react";
|
|
9
|
-
const
|
|
10
|
-
const { t: i } = c("Company.PaySchedule"), n =
|
|
8
|
+
const L = () => {
|
|
9
|
+
const { t: i } = c("Company.PaySchedule"), n = l(), { mode: r } = d();
|
|
11
10
|
let t = /* @__PURE__ */ e(o, {});
|
|
12
|
-
switch (
|
|
11
|
+
switch (r) {
|
|
13
12
|
case "LIST_PAY_SCHEDULES":
|
|
14
13
|
t = /* @__PURE__ */ s(o, { children: [
|
|
15
14
|
/* @__PURE__ */ e(n.Heading, { as: "h2", children: i("headings.pageTitle") }),
|
|
16
15
|
/* @__PURE__ */ e(n.Text, { children: /* @__PURE__ */ e(
|
|
17
|
-
|
|
16
|
+
a,
|
|
18
17
|
{
|
|
19
18
|
i18nKey: "listDescription",
|
|
20
19
|
t: i,
|
|
@@ -24,7 +23,7 @@ const x = () => {
|
|
|
24
23
|
}
|
|
25
24
|
) }),
|
|
26
25
|
/* @__PURE__ */ e(n.Text, { children: /* @__PURE__ */ e(
|
|
27
|
-
|
|
26
|
+
a,
|
|
28
27
|
{
|
|
29
28
|
i18nKey: "listDescription2",
|
|
30
29
|
t: i,
|
|
@@ -45,6 +44,6 @@ const x = () => {
|
|
|
45
44
|
return /* @__PURE__ */ e(h, { justifyContent: "space-between", flexDirection: "column", gap: 4, children: /* @__PURE__ */ e("header", { children: t }) });
|
|
46
45
|
};
|
|
47
46
|
export {
|
|
48
|
-
|
|
47
|
+
L as Head
|
|
49
48
|
};
|
|
50
49
|
//# sourceMappingURL=Head.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Head.js","sources":["../../../../../src/components/Company/PaySchedule/_parts/Head.tsx"],"sourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport { usePaySchedule } from '../usePaySchedule'\nimport { Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\n// Head slot for PaySchedule component\nexport const Head = () => {\n const { t } = useTranslation('Company.PaySchedule')\n const Components = useComponentContext()\n\n const { mode } = usePaySchedule()\n let headingOutput: React.ReactElement = <></>\n\n switch (mode) {\n case 'LIST_PAY_SCHEDULES':\n headingOutput = (\n <>\n <Components.Heading as=\"h2\">{t('headings.pageTitle')}</Components.Heading>\n <Components.Text>\n <Trans\n i18nKey={'listDescription'}\n t={t}\n components={{\n ScheduleLink: <Components.Link />,\n }}\n />\n </Components.Text>\n <Components.Text>\n <Trans\n i18nKey={'listDescription2'}\n t={t}\n components={{\n PaymentLawLink: <Components.Link />,\n }}\n />\n </Components.Text>\n </>\n )\n break\n case 'ADD_PAY_SCHEDULE':\n headingOutput = (\n <Components.Heading as=\"h2\">{t('headings.addPaySchedule')}</Components.Heading>\n )\n break\n case 'EDIT_PAY_SCHEDULE':\n headingOutput = (\n <Components.Heading as=\"h2\">{t('headings.editPaySchedule')}</Components.Heading>\n )\n break\n default:\n }\n\n return (\n <Flex justifyContent=\"space-between\" flexDirection={'column'} gap={4}>\n <header>{headingOutput}</header>\n </Flex>\n )\n}\n"],"names":["Head","t","useTranslation","Components","useComponentContext","mode","usePaySchedule","headingOutput","jsx","Fragment","jsxs","Trans","Flex"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Head.js","sources":["../../../../../src/components/Company/PaySchedule/_parts/Head.tsx"],"sourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport { usePaySchedule } from '../usePaySchedule'\nimport { Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\n// Head slot for PaySchedule component\nexport const Head = () => {\n const { t } = useTranslation('Company.PaySchedule')\n const Components = useComponentContext()\n\n const { mode } = usePaySchedule()\n let headingOutput: React.ReactElement = <></>\n\n switch (mode) {\n case 'LIST_PAY_SCHEDULES':\n headingOutput = (\n <>\n <Components.Heading as=\"h2\">{t('headings.pageTitle')}</Components.Heading>\n <Components.Text>\n <Trans\n i18nKey={'listDescription'}\n t={t}\n components={{\n ScheduleLink: <Components.Link />,\n }}\n />\n </Components.Text>\n <Components.Text>\n <Trans\n i18nKey={'listDescription2'}\n t={t}\n components={{\n PaymentLawLink: <Components.Link />,\n }}\n />\n </Components.Text>\n </>\n )\n break\n case 'ADD_PAY_SCHEDULE':\n headingOutput = (\n <Components.Heading as=\"h2\">{t('headings.addPaySchedule')}</Components.Heading>\n )\n break\n case 'EDIT_PAY_SCHEDULE':\n headingOutput = (\n <Components.Heading as=\"h2\">{t('headings.editPaySchedule')}</Components.Heading>\n )\n break\n default:\n }\n\n return (\n <Flex justifyContent=\"space-between\" flexDirection={'column'} gap={4}>\n <header>{headingOutput}</header>\n </Flex>\n )\n}\n"],"names":["Head","t","useTranslation","Components","useComponentContext","mode","usePaySchedule","headingOutput","jsx","Fragment","jsxs","Trans","Flex"],"mappings":";;;;;;;AAMO,MAAMA,IAAO,MAAM;AACxB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5CC,IAAaC,EAAA,GAEb,EAAE,MAAAC,EAAA,IAASC,EAAA;AACjB,MAAIC,IAAoC,gBAAAC,EAAAC,GAAA,EAAE;AAE1C,UAAQJ,GAAA;AAAA,IACN,KAAK;AACH,MAAAE,IACE,gBAAAG,EAAAD,GAAA,EACE,UAAA;AAAA,QAAA,gBAAAD,EAACL,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAAF,EAAE,oBAAoB,GAAE;AAAA,QACrD,gBAAAO,EAACL,EAAW,MAAX,EACC,UAAA,gBAAAK;AAAA,UAACG;AAAA,UAAA;AAAA,YACC,SAAS;AAAA,YACT,GAAAV;AAAA,YACA,YAAY;AAAA,cACV,cAAc,gBAAAO,EAACL,EAAW,MAAX,CAAA,CAAgB;AAAA,YAAA;AAAA,UACjC;AAAA,QAAA,GAEJ;AAAA,QACA,gBAAAK,EAACL,EAAW,MAAX,EACC,UAAA,gBAAAK;AAAA,UAACG;AAAA,UAAA;AAAA,YACC,SAAS;AAAA,YACT,GAAAV;AAAA,YACA,YAAY;AAAA,cACV,gBAAgB,gBAAAO,EAACL,EAAW,MAAX,CAAA,CAAgB;AAAA,YAAA;AAAA,UACnC;AAAA,QAAA,EACF,CACF;AAAA,MAAA,GACF;AAEF;AAAA,IACF,KAAK;AACH,MAAAI,IACE,gBAAAC,EAACL,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAAF,EAAE,yBAAyB,GAAE;AAE5D;AAAA,IACF,KAAK;AACH,MAAAM,IACE,gBAAAC,EAACL,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAAF,EAAE,0BAA0B,GAAE;AAE7D;AAAA,EACF;AAGF,SACE,gBAAAO,EAACI,GAAA,EAAK,gBAAe,iBAAgB,eAAe,UAAU,KAAK,GACjE,UAAA,gBAAAJ,EAAC,UAAA,EAAQ,UAAAD,EAAA,CAAc,GACzB;AAEJ;"}
|
|
@@ -1,38 +1,37 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
1
|
+
import { jsx as e, jsxs as p } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation as h } from "react-i18next";
|
|
3
3
|
import { usePaySchedule as y } from "../usePaySchedule.js";
|
|
4
4
|
import o from "./List.module.scss.js";
|
|
5
5
|
import { Flex as s } from "../../../Common/Flex/Flex.js";
|
|
6
6
|
import "classnames";
|
|
7
|
-
import "../../../../shared/constants.js";
|
|
8
7
|
import { HamburgerMenu as f } from "../../../Common/HamburgerMenu/HamburgerMenu.js";
|
|
9
8
|
import S from "../../../../assets/icons/pencil.svg.js";
|
|
10
9
|
import { useComponentContext as v } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
11
10
|
import { VisuallyHidden as g } from "../../../Common/VisuallyHidden/VisuallyHidden.js";
|
|
12
11
|
import { useDataView as L } from "../../../Common/DataView/useDataView.js";
|
|
13
12
|
import { DataView as C } from "../../../Common/DataView/DataView.js";
|
|
14
|
-
const
|
|
15
|
-
const { t:
|
|
13
|
+
const B = () => {
|
|
14
|
+
const { t: n } = h("Company.PaySchedule"), r = v(), { paySchedules: m, mode: c, handleEdit: l } = y(), { ...d } = L({
|
|
16
15
|
data: m || [],
|
|
17
16
|
columns: [
|
|
18
17
|
{
|
|
19
|
-
title:
|
|
18
|
+
title: n("payScheduleList.name"),
|
|
20
19
|
key: "customName",
|
|
21
20
|
render: (t) => {
|
|
22
21
|
const a = !!t.name;
|
|
23
22
|
let i = a ? t.name : t.customName;
|
|
24
23
|
i && i.length > 1 ? i = i.charAt(0).toUpperCase() + i.slice(1) : i = t.customName;
|
|
25
|
-
const
|
|
26
|
-
return /* @__PURE__ */ e(s, { flexDirection: "column", gap: 0, children: /* @__PURE__ */
|
|
24
|
+
const u = t.customName;
|
|
25
|
+
return /* @__PURE__ */ e(s, { flexDirection: "column", gap: 0, children: /* @__PURE__ */ p("div", { className: o.content, children: [
|
|
27
26
|
/* @__PURE__ */ e("div", { children: i }),
|
|
28
|
-
a && /* @__PURE__ */ e("div", { children:
|
|
27
|
+
a && /* @__PURE__ */ e("div", { children: u })
|
|
29
28
|
] }) });
|
|
30
29
|
}
|
|
31
30
|
},
|
|
32
31
|
{
|
|
33
|
-
title: /* @__PURE__ */ e(g, { children:
|
|
32
|
+
title: /* @__PURE__ */ e(g, { children: n("payScheduleList.active") }),
|
|
34
33
|
key: "active",
|
|
35
|
-
render: (t) => /* @__PURE__ */ e(s, { alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ e("div", { className: o.content, children: t.active ? /* @__PURE__ */ e(
|
|
34
|
+
render: (t) => /* @__PURE__ */ e(s, { alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ e("div", { className: o.content, children: t.active ? /* @__PURE__ */ e(r.Badge, { status: "success", children: n("payScheduleList.active") }) : /* @__PURE__ */ e(r.Badge, { status: "info", children: n("payScheduleList.inactive") }) }) })
|
|
36
35
|
}
|
|
37
36
|
],
|
|
38
37
|
itemMenu: (t) => /* @__PURE__ */ e(
|
|
@@ -41,7 +40,7 @@ const F = () => {
|
|
|
41
40
|
triggerLabel: "Actions",
|
|
42
41
|
items: [
|
|
43
42
|
{
|
|
44
|
-
label:
|
|
43
|
+
label: n("payScheduleList.edit"),
|
|
45
44
|
onClick: () => {
|
|
46
45
|
l(t);
|
|
47
46
|
},
|
|
@@ -54,6 +53,6 @@ const F = () => {
|
|
|
54
53
|
return c !== "LIST_PAY_SCHEDULES" ? null : /* @__PURE__ */ e(C, { label: "test", ...d });
|
|
55
54
|
};
|
|
56
55
|
export {
|
|
57
|
-
|
|
56
|
+
B as List
|
|
58
57
|
};
|
|
59
58
|
//# sourceMappingURL=List.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"List.js","sources":["../../../../../src/components/Company/PaySchedule/_parts/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { usePaySchedule } from '../usePaySchedule'\nimport styles from './List.module.scss'\nimport { useDataView, DataView, Flex, VisuallyHidden } from '@/components/Common'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\n\nexport const List = () => {\n const { t } = useTranslation('Company.PaySchedule')\n const Components = useComponentContext()\n const { paySchedules, mode, handleEdit } = usePaySchedule()\n\n const { ...dataViewProps } = useDataView({\n data: paySchedules || [],\n columns: [\n {\n title: t('payScheduleList.name'),\n key: 'customName',\n render: schedule => {\n const hasName = !!schedule.name\n let displayName = hasName ? schedule.name : schedule.customName\n if (displayName && displayName.length > 1) {\n displayName = displayName.charAt(0).toUpperCase() + displayName.slice(1)\n } else {\n displayName = schedule.customName\n }\n const displayFrequency = schedule.customName\n return (\n <Flex flexDirection={'column'} gap={0}>\n <div className={styles.content}>\n <div>{displayName}</div>\n {hasName && <div>{displayFrequency}</div>}\n </div>\n </Flex>\n )\n },\n },\n {\n title: <VisuallyHidden>{t('payScheduleList.active')}</VisuallyHidden>,\n key: 'active',\n render: schedule => (\n <Flex alignItems={'center'} justifyContent={'center'}>\n <div className={styles.content}>\n {schedule.active ? (\n <Components.Badge status=\"success\">{t('payScheduleList.active')}</Components.Badge>\n ) : (\n <Components.Badge status=\"info\">{t('payScheduleList.inactive')}</Components.Badge>\n )}\n </div>\n </Flex>\n ),\n },\n ],\n itemMenu: schedule => {\n return (\n <HamburgerMenu\n triggerLabel=\"Actions\"\n items={[\n {\n label: t('payScheduleList.edit'),\n onClick: () => {\n handleEdit(schedule)\n },\n icon: <PencilSvg aria-hidden />,\n },\n ]}\n />\n )\n },\n })\n\n if (mode !== 'LIST_PAY_SCHEDULES') {\n return null\n }\n\n return <DataView label=\"test\" {...dataViewProps} />\n}\n"],"names":["List","t","useTranslation","Components","useComponentContext","paySchedules","mode","handleEdit","usePaySchedule","dataViewProps","useDataView","schedule","hasName","displayName","displayFrequency","jsx","Flex","jsxs","styles","VisuallyHidden","HamburgerMenu","PencilSvg","DataView"],"mappings":"
|
|
1
|
+
{"version":3,"file":"List.js","sources":["../../../../../src/components/Company/PaySchedule/_parts/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { usePaySchedule } from '../usePaySchedule'\nimport styles from './List.module.scss'\nimport { useDataView, DataView, Flex, VisuallyHidden } from '@/components/Common'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\n\nexport const List = () => {\n const { t } = useTranslation('Company.PaySchedule')\n const Components = useComponentContext()\n const { paySchedules, mode, handleEdit } = usePaySchedule()\n\n const { ...dataViewProps } = useDataView({\n data: paySchedules || [],\n columns: [\n {\n title: t('payScheduleList.name'),\n key: 'customName',\n render: schedule => {\n const hasName = !!schedule.name\n let displayName = hasName ? schedule.name : schedule.customName\n if (displayName && displayName.length > 1) {\n displayName = displayName.charAt(0).toUpperCase() + displayName.slice(1)\n } else {\n displayName = schedule.customName\n }\n const displayFrequency = schedule.customName\n return (\n <Flex flexDirection={'column'} gap={0}>\n <div className={styles.content}>\n <div>{displayName}</div>\n {hasName && <div>{displayFrequency}</div>}\n </div>\n </Flex>\n )\n },\n },\n {\n title: <VisuallyHidden>{t('payScheduleList.active')}</VisuallyHidden>,\n key: 'active',\n render: schedule => (\n <Flex alignItems={'center'} justifyContent={'center'}>\n <div className={styles.content}>\n {schedule.active ? (\n <Components.Badge status=\"success\">{t('payScheduleList.active')}</Components.Badge>\n ) : (\n <Components.Badge status=\"info\">{t('payScheduleList.inactive')}</Components.Badge>\n )}\n </div>\n </Flex>\n ),\n },\n ],\n itemMenu: schedule => {\n return (\n <HamburgerMenu\n triggerLabel=\"Actions\"\n items={[\n {\n label: t('payScheduleList.edit'),\n onClick: () => {\n handleEdit(schedule)\n },\n icon: <PencilSvg aria-hidden />,\n },\n ]}\n />\n )\n },\n })\n\n if (mode !== 'LIST_PAY_SCHEDULES') {\n return null\n }\n\n return <DataView label=\"test\" {...dataViewProps} />\n}\n"],"names":["List","t","useTranslation","Components","useComponentContext","paySchedules","mode","handleEdit","usePaySchedule","dataViewProps","useDataView","schedule","hasName","displayName","displayFrequency","jsx","Flex","jsxs","styles","VisuallyHidden","HamburgerMenu","PencilSvg","DataView"],"mappings":";;;;;;;;;;;;AAQO,MAAMA,IAAO,MAAM;AACxB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5CC,IAAaC,EAAA,GACb,EAAE,cAAAC,GAAc,MAAAC,GAAM,YAAAC,EAAA,IAAeC,EAAA,GAErC,EAAE,GAAGC,EAAA,IAAkBC,EAAY;AAAA,IACvC,MAAML,KAAgB,CAAA;AAAA,IACtB,SAAS;AAAA,MACP;AAAA,QACE,OAAOJ,EAAE,sBAAsB;AAAA,QAC/B,KAAK;A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AA,YACA,MAAM,gBAAAI,EAACM,GAAA,EAAU,eAAW,GAAA,CAAC;AAAA,UAAA;AAAA,QAC/B;AAAA,MACF;AAAA,IAAA;AAAA,EAGN,CACD;AAED,SAAIf,MAAS,uBACJ,OAGF,gBAAAS,EAACO,GAAA,EAAS,OAAM,QAAQ,GAAGb,GAAe;AACnD;"}
|
|
@@ -11,13 +11,13 @@ import { Actions as B } from "./Actions.js";
|
|
|
11
11
|
import { Form as N } from "../../Common/Form/Form.js";
|
|
12
12
|
import { useComponentDictionary as j, useI18n as q } from "../../../i18n/I18n.js";
|
|
13
13
|
import { Flex as w } from "../../Common/Flex/Flex.js";
|
|
14
|
-
import "classnames";
|
|
15
|
-
import { contractorEvents as d } from "../../../shared/constants.js";
|
|
16
14
|
import "react-i18next";
|
|
15
|
+
import "classnames";
|
|
17
16
|
import "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
18
17
|
import "react";
|
|
19
18
|
import { BaseComponent as G } from "../../Base/Base.js";
|
|
20
19
|
import { useBase as H } from "../../Base/useBase.js";
|
|
20
|
+
import { contractorEvents as d } from "../../../shared/constants.js";
|
|
21
21
|
function mt(r) {
|
|
22
22
|
return /* @__PURE__ */ t(G, { ...r, children: /* @__PURE__ */ t(M, { ...r, children: r.children }) });
|
|
23
23
|
}
|
|
@@ -3,9 +3,9 @@ import { useTranslation as s } from "react-i18next";
|
|
|
3
3
|
import { STATES_ABBR as o } from "../../../shared/constants.js";
|
|
4
4
|
import { Grid as l } from "../../Common/Grid/Grid.js";
|
|
5
5
|
import "classnames";
|
|
6
|
-
import { TextInputField as t } from "../../Common/Fields/TextInputField/TextInputField.js";
|
|
7
6
|
import "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
8
7
|
import "react";
|
|
8
|
+
import { TextInputField as t } from "../../Common/Fields/TextInputField/TextInputField.js";
|
|
9
9
|
import { SelectField as m } from "../../Common/Fields/SelectField/SelectField.js";
|
|
10
10
|
function T() {
|
|
11
11
|
const { t: e } = s("Contractor.Address");
|
|
@@ -4,17 +4,17 @@ import { useContractorsDeleteMutation as w } from "@gusto/embedded-api/react-que
|
|
|
4
4
|
import { useContractors as H } from "./useContractorList.js";
|
|
5
5
|
import { Flex as p } from "../../Common/Flex/Flex.js";
|
|
6
6
|
import "classnames";
|
|
7
|
-
import {
|
|
8
|
-
import { EmptyData as U } from "../../Common/EmptyData/EmptyData.js";
|
|
7
|
+
import { EmptyData as k } from "../../Common/EmptyData/EmptyData.js";
|
|
9
8
|
import { ActionsLayout as f } from "../../Common/ActionsLayout/ActionsLayout.js";
|
|
10
|
-
import { HamburgerMenu as
|
|
11
|
-
import { firstLastName as
|
|
12
|
-
import
|
|
9
|
+
import { HamburgerMenu as U } from "../../Common/HamburgerMenu/HamburgerMenu.js";
|
|
10
|
+
import { firstLastName as j } from "../../../helpers/formattedStrings.js";
|
|
11
|
+
import M from "../../../assets/icons/pencil.svg.js";
|
|
13
12
|
import { useComponentContext as u } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
14
|
-
import { ContractorOnboardingStatusBadge as
|
|
15
|
-
import { useI18n as
|
|
16
|
-
import { BaseComponent as
|
|
17
|
-
import { useBase as
|
|
13
|
+
import { ContractorOnboardingStatusBadge as V } from "../../Common/OnboardingStatusBadge/index.js";
|
|
14
|
+
import { useI18n as F } from "../../../i18n/I18n.js";
|
|
15
|
+
import { BaseComponent as q } from "../../Base/Base.js";
|
|
16
|
+
import { useBase as G } from "../../Base/useBase.js";
|
|
17
|
+
import { CONTRACTOR_TYPE as Y, componentEvents as m } from "../../../shared/constants.js";
|
|
18
18
|
import z from "../../../assets/icons/trashcan.svg.js";
|
|
19
19
|
import { useDataView as J } from "../../Common/DataView/useDataView.js";
|
|
20
20
|
import { DataView as K } from "../../Common/DataView/DataView.js";
|
|
@@ -27,14 +27,14 @@ function Q({ count: o, handleAdd: a }) {
|
|
|
27
27
|
}
|
|
28
28
|
function W({ handleAdd: o }) {
|
|
29
29
|
const { Button: a } = u(), { t: r } = d("Contractor.ContractorList");
|
|
30
|
-
return /* @__PURE__ */ t(
|
|
30
|
+
return /* @__PURE__ */ t(k, { title: r("emptyTableTitle"), description: r("emptyTableDescription"), children: /* @__PURE__ */ t(f, { justifyContent: "center", children: /* @__PURE__ */ t(a, { onClick: o, children: r("addContractorCta") }) }) });
|
|
31
31
|
}
|
|
32
32
|
function Tt(o) {
|
|
33
|
-
return /* @__PURE__ */ t(
|
|
33
|
+
return /* @__PURE__ */ t(q, { ...o, children: /* @__PURE__ */ t(X, { ...o, children: o.children }) });
|
|
34
34
|
}
|
|
35
35
|
function X({ companyId: o, className: a, dictionary: r, successMessage: i }) {
|
|
36
|
-
|
|
37
|
-
const { t: n } = d("Contractor.ContractorList"), { onEvent: s, baseSubmitHandler: h } =
|
|
36
|
+
F("Contractor.ContractorList");
|
|
37
|
+
const { t: n } = d("Contractor.ContractorList"), { onEvent: s, baseSubmitHandler: h } = G(), { Alert: g, Button: T } = u(), {
|
|
38
38
|
contractors: P,
|
|
39
39
|
totalCount: L,
|
|
40
40
|
handleNextPage: N,
|
|
@@ -49,12 +49,12 @@ function X({ companyId: o, className: a, dictionary: r, successMessage: i }) {
|
|
|
49
49
|
columns: [
|
|
50
50
|
{
|
|
51
51
|
title: n("listHeaders.name"),
|
|
52
|
-
render: (e) => e.type ===
|
|
52
|
+
render: (e) => e.type === Y.BUSINESS ? e.businessName : j({ first_name: e.firstName, last_name: e.lastName })
|
|
53
53
|
},
|
|
54
54
|
{
|
|
55
55
|
title: n("listHeaders.status"),
|
|
56
56
|
render: ({ onboarded: e, onboardingStatus: c }) => /* @__PURE__ */ t(
|
|
57
|
-
|
|
57
|
+
V,
|
|
58
58
|
{
|
|
59
59
|
onboarded: e,
|
|
60
60
|
onboardingStatus: c
|
|
@@ -64,12 +64,12 @@ function X({ companyId: o, className: a, dictionary: r, successMessage: i }) {
|
|
|
64
64
|
],
|
|
65
65
|
data: P,
|
|
66
66
|
itemMenu: (e) => /* @__PURE__ */ t(
|
|
67
|
-
|
|
67
|
+
U,
|
|
68
68
|
{
|
|
69
69
|
items: [
|
|
70
70
|
{
|
|
71
71
|
label: n("editCta"),
|
|
72
|
-
icon: /* @__PURE__ */ t(
|
|
72
|
+
icon: /* @__PURE__ */ t(M, { "aria-hidden": !0 }),
|
|
73
73
|
onClick: () => {
|
|
74
74
|
_(e.uuid);
|
|
75
75
|
}
|
|
@@ -2,10 +2,10 @@ import { jsxs as a, Fragment as t, jsx as r } from "react/jsx-runtime";
|
|
|
2
2
|
import { useTranslation as n } from "react-i18next";
|
|
3
3
|
import "../../../shared/constants.js";
|
|
4
4
|
import "classnames";
|
|
5
|
-
import { RadioGroupField as i } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
6
|
-
import { TextInputField as o } from "../../Common/Fields/TextInputField/TextInputField.js";
|
|
7
5
|
import "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
8
6
|
import "react";
|
|
7
|
+
import { TextInputField as o } from "../../Common/Fields/TextInputField/TextInputField.js";
|
|
8
|
+
import { RadioGroupField as i } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
9
9
|
function N({ bankAccount: u }) {
|
|
10
10
|
const { t: e } = n("Contractor.PaymentMethod", { keyPrefix: "bankAccountForm" });
|
|
11
11
|
return /* @__PURE__ */ a(t, { children: [
|
|
@@ -3,9 +3,9 @@ import { useTranslation as r } from "react-i18next";
|
|
|
3
3
|
import { z as t } from "zod";
|
|
4
4
|
import { PAYMENT_METHODS as o } from "../../../shared/constants.js";
|
|
5
5
|
import "classnames";
|
|
6
|
-
import { RadioGroupField as p } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
7
6
|
import "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
8
7
|
import "react";
|
|
8
|
+
import { RadioGroupField as p } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
9
9
|
t.object({
|
|
10
10
|
type: t.enum(["Check", "Direct Deposit"])
|
|
11
11
|
});
|
|
@@ -2,16 +2,15 @@ import { jsxs as c, jsx as r } from "react/jsx-runtime";
|
|
|
2
2
|
import { useTranslation as R } from "react-i18next";
|
|
3
3
|
import { useMemo as A } from "react";
|
|
4
4
|
import { getContractorDisplayName as F } from "./helpers.js";
|
|
5
|
-
import { Flex as
|
|
5
|
+
import { Flex as i, FlexItem as M } from "../../../Common/Flex/Flex.js";
|
|
6
6
|
import "classnames";
|
|
7
|
-
import "../../../../shared/constants.js";
|
|
8
7
|
import { HamburgerMenu as N } from "../../../Common/HamburgerMenu/HamburgerMenu.js";
|
|
9
8
|
import { useComponentContext as j } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
10
9
|
import { useI18n as v } from "../../../../i18n/I18n.js";
|
|
11
10
|
import { formatHoursDisplay as I } from "../../../Payroll/helpers.js";
|
|
12
11
|
import O from "../../../../hooks/useNumberFormatter.js";
|
|
13
12
|
import { DataView as S } from "../../../Common/DataView/DataView.js";
|
|
14
|
-
const U = "0.000",
|
|
13
|
+
const U = "0.000", J = ({
|
|
15
14
|
contractors: u,
|
|
16
15
|
paymentDate: p,
|
|
17
16
|
contractorPayments: m,
|
|
@@ -28,14 +27,14 @@ const U = "0.000", K = ({
|
|
|
28
27
|
() => m.map((e) => ({
|
|
29
28
|
...e,
|
|
30
29
|
contractorDetails: u.find(
|
|
31
|
-
(
|
|
30
|
+
(a) => a.uuid === e.contractorUuid
|
|
32
31
|
)
|
|
33
32
|
})),
|
|
34
33
|
[m, u]
|
|
35
34
|
);
|
|
36
|
-
return /* @__PURE__ */ c(
|
|
37
|
-
/* @__PURE__ */ c(
|
|
38
|
-
/* @__PURE__ */ c(
|
|
35
|
+
return /* @__PURE__ */ c(i, { flexDirection: "column", gap: 32, children: [
|
|
36
|
+
/* @__PURE__ */ c(i, { justifyContent: "flex-end", gap: 16, children: [
|
|
37
|
+
/* @__PURE__ */ c(i, { flexDirection: "column", gap: 16, children: [
|
|
39
38
|
/* @__PURE__ */ r(s, { as: "h2", children: t("title") }),
|
|
40
39
|
/* @__PURE__ */ r(n, { variant: "supporting", children: t("paymentSpeedNotice") })
|
|
41
40
|
] }),
|
|
@@ -51,7 +50,7 @@ const U = "0.000", K = ({
|
|
|
51
50
|
},
|
|
52
51
|
e.title
|
|
53
52
|
)),
|
|
54
|
-
/* @__PURE__ */ r(
|
|
53
|
+
/* @__PURE__ */ r(i, { flexDirection: "column", gap: 8, children: /* @__PURE__ */ r(
|
|
55
54
|
C,
|
|
56
55
|
{
|
|
57
56
|
type: "date",
|
|
@@ -61,7 +60,7 @@ const U = "0.000", K = ({
|
|
|
61
60
|
isRequired: !0
|
|
62
61
|
}
|
|
63
62
|
) }),
|
|
64
|
-
/* @__PURE__ */ c(
|
|
63
|
+
/* @__PURE__ */ c(i, { flexDirection: "column", gap: 16, children: [
|
|
65
64
|
/* @__PURE__ */ r(s, { as: "h3", children: t("hoursAndPaymentsLabel") }),
|
|
66
65
|
/* @__PURE__ */ r(
|
|
67
66
|
S,
|
|
@@ -86,8 +85,8 @@ const U = "0.000", K = ({
|
|
|
86
85
|
{
|
|
87
86
|
title: t("contractorTableHeaders.wage"),
|
|
88
87
|
render: (e) => {
|
|
89
|
-
const
|
|
90
|
-
return /* @__PURE__ */ r(n, { children: o(
|
|
88
|
+
const a = e.contractorDetails?.wageType === "Fixed" && e.wage ? e.wage : 0;
|
|
89
|
+
return /* @__PURE__ */ r(n, { children: o(a) });
|
|
91
90
|
}
|
|
92
91
|
},
|
|
93
92
|
{
|
|
@@ -100,8 +99,8 @@ const U = "0.000", K = ({
|
|
|
100
99
|
},
|
|
101
100
|
{
|
|
102
101
|
title: t("contractorTableHeaders.total"),
|
|
103
|
-
render: ({ bonus: e, reimbursement:
|
|
104
|
-
const L = (e ?? 0) + (
|
|
102
|
+
render: ({ bonus: e, reimbursement: a, wage: P, hours: d, contractorDetails: h }) => {
|
|
103
|
+
const L = (e ?? 0) + (a ?? 0) + (P ?? 0) + (h?.wageType === "Hourly" && d ? d * Number(h.hourlyRate ?? 0) : 0);
|
|
105
104
|
return /* @__PURE__ */ r(n, { children: o(L) });
|
|
106
105
|
}
|
|
107
106
|
}
|
|
@@ -135,6 +134,6 @@ const U = "0.000", K = ({
|
|
|
135
134
|
] });
|
|
136
135
|
};
|
|
137
136
|
export {
|
|
138
|
-
|
|
137
|
+
J as CreatePaymentPresentation
|
|
139
138
|
};
|
|
140
139
|
//# sourceMappingURL=CreatePaymentPresentation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreatePaymentPresentation.js","sources":["../../../../../src/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type { Contractor } from '@gusto/embedded-api/models/components/contractor'\nimport type { ContractorPayments } from '@gusto/embedded-api/models/operations/postv1companiescompanyidcontractorpaymentgroups'\nimport { useMemo } from 'react'\nimport type { InternalAlert } from '../types'\nimport { getContractorDisplayName } from './helpers'\nimport { DataView, Flex, FlexItem } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\nimport { useI18n } from '@/i18n'\nimport { formatHoursDisplay } from '@/components/Payroll/helpers'\nimport useNumberFormatter from '@/hooks/useNumberFormatter'\n\nconst ZERO_HOURS_DISPLAY = '0.000'\n\ninterface ContractorPaymentCreatePaymentPresentationProps {\n contractors: Contractor[]\n contractorPayments: ContractorPayments[]\n paymentDate: string\n onPaymentDateChange: (date: string) => void\n onSaveAndContinue: () => void\n onEditContractor: (contractorUuid: string) => void\n totals: {\n wage: number\n bonus: number\n reimbursement: number\n total: number\n }\n alerts: Record<string, InternalAlert>\n isLoading: boolean\n}\n\nexport const CreatePaymentPresentation = ({\n contractors,\n paymentDate,\n contractorPayments,\n onPaymentDateChange,\n onSaveAndContinue,\n onEditContractor,\n totals,\n alerts,\n isLoading,\n}: ContractorPaymentCreatePaymentPresentationProps) => {\n const { Button, Text, Heading, TextInput, Alert } = useComponentContext()\n useI18n('Contractor.Payments.CreatePayment')\n const { t } = useTranslation('Contractor.Payments.CreatePayment')\n const currencyFormatter = useNumberFormatter('currency')\n\n const formatWageType = (contractor?: Contractor) => {\n if (!contractor) {\n return ''\n }\n if (contractor.wageType === 'Hourly' && contractor.hourlyRate) {\n return `${t('wageTypes.hourly')} ${currencyFormatter(Number(contractor.hourlyRate))}${t('perHour')}`\n }\n return contractor.wageType\n }\n\n const tableData = useMemo(\n () =>\n contractorPayments.map(payment => {\n return {\n ...payment,\n contractorDetails: contractors.find(\n contractor => contractor.uuid === payment.contractorUuid,\n ),\n }\n }),\n [contractorPayments, contractors],\n )\n\n return (\n <Flex flexDirection=\"column\" gap={32}>\n <Flex justifyContent=\"flex-end\" gap={16}>\n <Flex flexDirection=\"column\" gap={16}>\n <Heading as=\"h2\">{t('title')}</Heading>\n <Text variant=\"supporting\">{t('paymentSpeedNotice')}</Text>\n </Flex>\n <FlexItem>\n <Button onClick={onSaveAndContinue} variant=\"primary\" isLoading={isLoading}>\n {t('continueCta')}\n </Button>\n </FlexItem>\n </Flex>\n\n {Object.values(alerts).map(alert => (\n <Alert\n key={alert.title}\n label={alert.title}\n onDismiss={alert.onDismiss}\n status={alert.type}\n >\n {alert.content ?? null}\n </Alert>\n ))}\n\n <Flex flexDirection=\"column\" gap={8}>\n <TextInput\n type=\"date\"\n value={paymentDate}\n onChange={onPaymentDateChange}\n label={t('dateLabel')}\n isRequired\n />\n </Flex>\n\n <Flex flexDirection=\"column\" gap={16}>\n <Heading as=\"h3\">{t('hoursAndPaymentsLabel')}</Heading>\n {/* //TODO: add empty state */}\n <DataView\n columns={[\n {\n title: t('contractorTableHeaders.contractor'),\n render: paymentData => (\n <Text>{getContractorDisplayName(paymentData.contractorDetails)}</Text>\n ),\n },\n {\n title: t('contractorTableHeaders.wageType'),\n render: paymentData => <Text>{formatWageType(paymentData.contractorDetails)}</Text>,\n },\n {\n title: t('contractorTableHeaders.paymentMethod'),\n render: paymentData => <Text>{paymentData.paymentMethod || t('na')}</Text>,\n },\n {\n title: t('contractorTableHeaders.hours'),\n render: paymentData => (\n <Text>\n {paymentData.contractorDetails?.wageType === 'Hourly' && paymentData.hours\n ? formatHoursDisplay(paymentData.hours)\n : ZERO_HOURS_DISPLAY}\n </Text>\n ),\n },\n {\n title: t('contractorTableHeaders.wage'),\n render: paymentData => {\n const amount =\n paymentData.contractorDetails?.wageType === 'Fixed' && paymentData.wage\n ? paymentData.wage\n : 0\n return <Text>{currencyFormatter(amount)}</Text>\n },\n },\n {\n title: t('contractorTableHeaders.bonus'),\n render: paymentData => <Text>{currencyFormatter(paymentData.bonus || 0)}</Text>,\n },\n {\n title: t('contractorTableHeaders.reimbursement'),\n render: paymentData => (\n <Text>{currencyFormatter(paymentData.reimbursement || 0)}</Text>\n ),\n },\n {\n title: t('contractorTableHeaders.total'),\n render: ({ bonus, reimbursement, wage, hours, contractorDetails }) => {\n const totalAmount =\n (bonus ?? 0) +\n (reimbursement ?? 0) +\n (wage ?? 0) +\n (contractorDetails?.wageType === 'Hourly' && hours\n ? hours * Number(contractorDetails.hourlyRate ?? 0)\n : 0)\n return <Text>{currencyFormatter(totalAmount)}</Text>\n },\n },\n ]}\n data={tableData}\n footer={() => ({\n 'column-0': <Text weight=\"bold\">{t('totalsLabel')}</Text>,\n 'column-4': <Text>{currencyFormatter(totals.wage)}</Text>,\n 'column-5': <Text>{currencyFormatter(totals.bonus)}</Text>,\n 'column-6': <Text>{currencyFormatter(totals.reimbursement)}</Text>,\n 'column-7': <Text>{currencyFormatter(totals.total)}</Text>,\n })}\n label={t('hoursAndPaymentsLabel')}\n itemMenu={paymentData => (\n <HamburgerMenu\n items={[\n {\n label: t('editContractor'),\n onClick: () => {\n onEditContractor(paymentData.contractorUuid!)\n },\n },\n ]}\n triggerLabel={t('editContractor')}\n />\n )}\n />\n </Flex>\n </Flex>\n )\n}\n"],"names":["ZERO_HOURS_DISPLAY","CreatePaymentPresentation","contractors","paymentDate","contractorPayments","onPaymentDateChange","onSaveAndContinue","onEditContractor","totals","alerts","isLoading","Button","Text","Heading","TextInput","Alert","useComponentContext","useI18n","useTranslation","currencyFormatter","useNumberFormatter","formatWageType","contractor","tableData","useMemo","payment","jsxs","Flex","jsx","FlexItem","alert","DataView","paymentData","getContractorDisplayName","formatHoursDisplay","amount","bonus","reimbursement","wage","hours","contractorDetails","totalAmount","HamburgerMenu"],"mappings":";;;;;;;;;;;;;AAaA,MAAMA,IAAqB,SAmBdC,IAA4B,CAAC;AAAA,EACxC,aAAAC;AAAA,EACA,aAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,qBAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,QAAAC;AAAA,EACA,QAAAC;AAAA,EACA,WAAAC;AACF,MAAuD;AACrD,QAAM,EAAE,QAAAC,GAAQ,MAAAC,GAAM,SAAAC,GAAS,WAAAC,GAAW,OAAAC,EAAA,IAAUC,EAAA;AACpD,EAAAC,EAAQ,mCAAmC;AAC3C,QAAM,EAAE,EAAA,IAAMC,EAAe,mCAAmC,GAC1DC,IAAoBC,EAAmB,UAAU,GAEjDC,IAAiB,CAACC,MACjBA,IAGDA,EAAW,aAAa,YAAYA,EAAW,aAC1C,GAAG,EAAE,kBAAkB,CAAC,IAAIH,EAAkB,OAAOG,EAAW,UAAU,CAAC,CAAC,GAAG,EAAE,SAAS,CAAC,KAE7FA,EAAW,WALT,IAQLC,IAAYC;AAAA,IAChB,MACEpB,EAAmB,IAAI,CAAAqB,OACd;AAAA,MACL,GAAGA;AAAA,MACH,mBAAmBvB,EAAY;AAAA,QAC7B,CAAAoB,MAAcA,EAAW,SAASG,EAAQ;AAAA,MAAA;AAAA,IAC5C,EAEH;AAAA,IACH,CAACrB,GAAoBF,CAAW;AAAA,EAAA;AAGlC,SACE,gBAAAwB,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,IAAA,gBAAAD,EAACC,GAAA,EAAK,gBAAe,YAAW,KAAK,IACnC,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C,KAAiB,MACjBC,KAAQ,MACRE,GAAmB,aAAa,YAAYD,IACzCA,IAAQ,OAAOC,EAAkB,cAAc,CAAC,IAChD;AACN,uBAAO,gBAAAZ,EAAChB,GAAA,EAAM,UAAAO,EAAkBsB,CAAW,GAAE;AAAA,cAC/C;AAAA,YAAA;AAAA,UACF;AAAA,UAEF,MAAMlB;AAAA,UACN,QAAQ,OAAO;AAAA,YACb,YAAY,gBAAAK,EAAChB,GAAA,EAAK,QAAO,QAAQ,UAAA,EAAE,aAAa,GAAE;AAAA,YAClD,YAAY,gBAAAgB,EAAChB,GAAA,EAAM,UAAAO,EAAkBX,EAAO,IAAI,GAAE;AAAA,YAClD,YAAY,gBAAAoB,EAAChB,GAAA,EAAM,UAAAO,EAAkBX,EAAO,KAAK,GAAE;AAAA,YACnD,YAAY,gBAAAoB,EAAChB,GAAA,EAAM,UAAAO,EAAkBX,EAAO,aAAa,GAAE;AAAA,YAC3D,YAAY,gBAAAoB,EAAChB,GAAA,EAAM,UAAAO,EAAkBX,EAAO,KAAK,EAAA,CAAE;AAAA,UAAA;AAAA,UAErD,OAAO,EAAE,uBAAuB;AAAA,UAChC,UAAU,CAAAwB,MACR,gBAAAJ;AAAA,YAACc;AAAA,YAAA;AAAA,cACC,OAAO;AAAA,gBACL;AAAA,kBACE,OAAO,EAAE,gBAAgB;AAAA,kBACzB,SAAS,MAAM;AACb,oBAAAnC,EAAiByB,EAAY,cAAe;AAAA,kBAC9C;AAAA,gBAAA;AAAA,cACF;AAAA,cAEF,cAAc,EAAE,gBAAgB;AAAA,YAAA;AAAA,UAAA;AAAA,QAClC;AAAA,MAAA;AAAA,IAEJ,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"CreatePaymentPresentation.js","sources":["../../../../../src/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type { Contractor } from '@gusto/embedded-api/models/components/contractor'\nimport type { ContractorPayments } from '@gusto/embedded-api/models/operations/postv1companiescompanyidcontractorpaymentgroups'\nimport { useMemo } from 'react'\nimport type { InternalAlert } from '../types'\nimport { getContractorDisplayName } from './helpers'\nimport { DataView, Flex, FlexItem } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\nimport { useI18n } from '@/i18n'\nimport { formatHoursDisplay } from '@/components/Payroll/helpers'\nimport useNumberFormatter from '@/hooks/useNumberFormatter'\n\nconst ZERO_HOURS_DISPLAY = '0.000'\n\ninterface ContractorPaymentCreatePaymentPresentationProps {\n contractors: Contractor[]\n contractorPayments: ContractorPayments[]\n paymentDate: string\n onPaymentDateChange: (date: string) => void\n onSaveAndContinue: () => void\n onEditContractor: (contractorUuid: string) => void\n totals: {\n wage: number\n bonus: number\n reimbursement: number\n total: number\n }\n alerts: Record<string, InternalAlert>\n isLoading: boolean\n}\n\nexport const CreatePaymentPresentation = ({\n contractors,\n paymentDate,\n contractorPayments,\n onPaymentDateChange,\n onSaveAndContinue,\n onEditContractor,\n totals,\n alerts,\n isLoading,\n}: ContractorPaymentCreatePaymentPresentationProps) => {\n const { Button, Text, Heading, TextInput, Alert } = useComponentContext()\n useI18n('Contractor.Payments.CreatePayment')\n const { t } = useTranslation('Contractor.Payments.CreatePayment')\n const currencyFormatter = useNumberFormatter('currency')\n\n const formatWageType = (contractor?: Contractor) => {\n if (!contractor) {\n return ''\n }\n if (contractor.wageType === 'Hourly' && contractor.hourlyRate) {\n return `${t('wageTypes.hourly')} ${currencyFormatter(Number(contractor.hourlyRate))}${t('perHour')}`\n }\n return contractor.wageType\n }\n\n const tableData = useMemo(\n () =>\n contractorPayments.map(payment => {\n return {\n ...payment,\n contractorDetails: contractors.find(\n contractor => contractor.uuid === payment.contractorUuid,\n ),\n }\n }),\n [contractorPayments, contractors],\n )\n\n return (\n <Flex flexDirection=\"column\" gap={32}>\n <Flex justifyContent=\"flex-end\" gap={16}>\n <Flex flexDirection=\"column\" gap={16}>\n <Heading as=\"h2\">{t('title')}</Heading>\n <Text variant=\"supporting\">{t('paymentSpeedNotice')}</Text>\n </Flex>\n <FlexItem>\n <Button onClick={onSaveAndContinue} variant=\"primary\" isLoading={isLoading}>\n {t('continueCta')}\n </Button>\n </FlexItem>\n </Flex>\n\n {Object.values(alerts).map(alert => (\n <Alert\n key={alert.title}\n label={alert.title}\n onDismiss={alert.onDismiss}\n status={alert.type}\n >\n {alert.content ?? null}\n </Alert>\n ))}\n\n <Flex flexDirection=\"column\" gap={8}>\n <TextInput\n type=\"date\"\n value={paymentDate}\n onChange={onPaymentDateChange}\n label={t('dateLabel')}\n isRequired\n />\n </Flex>\n\n <Flex flexDirection=\"column\" gap={16}>\n <Heading as=\"h3\">{t('hoursAndPaymentsLabel')}</Heading>\n {/* //TODO: add empty state */}\n <DataView\n columns={[\n {\n title: t('contractorTableHeaders.contractor'),\n render: paymentData => (\n <Text>{getContractorDisplayName(paymentData.contractorDetails)}</Text>\n ),\n },\n {\n title: t('contractorTableHeaders.wageType'),\n render: paymentData => <Text>{formatWageType(paymentData.contractorDetails)}</Text>,\n },\n {\n title: t('contractorTableHeaders.paymentMethod'),\n render: paymentData => <Text>{paymentData.paymentMethod || t('na')}</Text>,\n },\n {\n title: t('contractorTableHeaders.hours'),\n render: paymentData => (\n <Text>\n {paymentData.contractorDetails?.wageType === 'Hourly' && paymentData.hours\n ? formatHoursDisplay(paymentData.hours)\n : ZERO_HOURS_DISPLAY}\n </Text>\n ),\n },\n {\n title: t('contractorTableHeaders.wage'),\n render: paymentData => {\n const amount =\n paymentData.contractorDetails?.wageType === 'Fixed' && paymentData.wage\n ? paymentData.wage\n : 0\n return <Text>{currencyFormatter(amount)}</Text>\n },\n },\n {\n title: t('contractorTableHeaders.bonus'),\n render: paymentData => <Text>{currencyFormatter(paymentData.bonus || 0)}</Text>,\n },\n {\n title: t('contractorTableHeaders.reimbursement'),\n render: paymentData => (\n <Text>{currencyFormatter(paymentData.reimbursement || 0)}</Text>\n ),\n },\n {\n title: t('contractorTableHeaders.total'),\n render: ({ bonus, reimbursement, wage, hours, contractorDetails }) => {\n const totalAmount =\n (bonus ?? 0) +\n (reimbursement ?? 0) +\n (wage ?? 0) +\n (contractorDetails?.wageType === 'Hourly' && hours\n ? hours * Number(contractorDetails.hourlyRate ?? 0)\n : 0)\n return <Text>{currencyFormatter(totalAmount)}</Text>\n },\n },\n ]}\n data={tableData}\n footer={() => ({\n 'column-0': <Text weight=\"bold\">{t('totalsLabel')}</Text>,\n 'column-4': <Text>{currencyFormatter(totals.wage)}</Text>,\n 'column-5': <Text>{currencyFormatter(totals.bonus)}</Text>,\n 'column-6': <Text>{currencyFormatter(totals.reimbursement)}</Text>,\n 'column-7': <Text>{currencyFormatter(totals.total)}</Text>,\n })}\n label={t('hoursAndPaymentsLabel')}\n itemMenu={paymentData => (\n <HamburgerMenu\n items={[\n {\n label: t('editContractor'),\n onClick: () => {\n onEditContractor(paymentData.contractorUuid!)\n },\n },\n ]}\n triggerLabel={t('editContractor')}\n />\n )}\n />\n </Flex>\n </Flex>\n )\n}\n"],"names":["ZERO_HOURS_DISPLAY","CreatePaymentPresentation","contractors","paymentDate","contractorPayments","onPaymentDateChange","onSaveAndContinue","onEditContractor","totals","alerts","isLoading","Button","Text","Heading","TextInput","Alert","useComponentContext","useI18n","useTranslation","currencyFormatter","useNumberFormatter","formatWageType","contractor","tableData","useMemo","payment","jsxs","Flex","jsx","FlexItem","alert","DataView","paymentData","getContractorDisplayName","formatHoursDisplay","amount","bonus","reimbursement","wage","hours","contractorDetails","totalAmount","HamburgerMenu"],"mappings":";;;;;;;;;;;;AAaA,MAAMA,IAAqB,SAmBdC,IAA4B,CAAC;AAAA,EACxC,aAAAC;AAAA,EACA,aAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,qBAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,QAAAC;AAAA,EACA,QAAAC;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,EAAM,UAAAO,EAAkBX,EAAO,KAAK,GAAE;AAAA,YACnD,YAAY,gBAAAoB,EAAChB,GAAA,EAAM,UAAAO,EAAkBX,EAAO,aAAa,GAAE;AAAA,YAC3D,YAAY,gBAAAoB,EAAChB,GAAA,EAAM,UAAAO,EAAkBX,EAAO,KAAK,EAAA,CAAE;AAAA,UAAA;AAAA,UAErD,OAAO,EAAE,uBAAuB;AAAA,UAChC,UAAU,CAAAwB,MACR,gBAAAJ;AAAA,YAACc;AAAA,YAAA;AAAA,cACC,OAAO;AAAA,gBACL;AAAA,kBACE,OAAO,EAAE,gBAAgB;AAAA,kBACzB,SAAS,MAAM;AACb,oBAAAnC,EAAiByB,EAAY,cAAe;AAAA,kBAC9C;AAAA,gBAAA;AAAA,cACF;AAAA,cAEF,cAAc,EAAE,gBAAgB;AAAA,YAAA;AAAA,UAAA;AAAA,QAClC;AAAA,MAAA;AAAA,IAEJ,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;"}
|
package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js
CHANGED
|
@@ -7,12 +7,12 @@ import { useComponentContext as L } from "../../../../contexts/ComponentAdapter/
|
|
|
7
7
|
import { Flex as i } from "../../../Common/Flex/Flex.js";
|
|
8
8
|
import { Grid as R } from "../../../Common/Grid/Grid.js";
|
|
9
9
|
import "classnames";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
10
|
+
import { ActionsLayout as S } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
11
|
+
import { Form as T } from "../../../Common/Form/Form.js";
|
|
12
|
+
import { useI18n as E } from "../../../../i18n/I18n.js";
|
|
13
|
+
import I from "../../../../hooks/useNumberFormatter.js";
|
|
12
14
|
import { NumberInputField as c } from "../../../Common/Fields/NumberInputField/NumberInputField.js";
|
|
13
|
-
import {
|
|
14
|
-
import { useI18n as I } from "../../../../i18n/I18n.js";
|
|
15
|
-
import j from "../../../../hooks/useNumberFormatter.js";
|
|
15
|
+
import { RadioGroupField as j } from "../../../Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
16
16
|
const Y = t.object({
|
|
17
17
|
wageType: t.enum(["Hourly", "Fixed"]),
|
|
18
18
|
hours: t.number().nonnegative().max(2e4).optional(),
|
|
@@ -29,10 +29,10 @@ const Y = t.object({
|
|
|
29
29
|
onSubmit: s
|
|
30
30
|
}) => {
|
|
31
31
|
const d = w();
|
|
32
|
-
|
|
32
|
+
E("Contractor.Payments.CreatePayment");
|
|
33
33
|
const { t: e } = H("Contractor.Payments.CreatePayment", {
|
|
34
34
|
keyPrefix: "editContractorPayment"
|
|
35
|
-
}), { Modal: b, Button: p, Text: h, Heading: l } = L(), g =
|
|
35
|
+
}), { Modal: b, Button: p, Text: h, Heading: l } = L(), g = I("currency"), m = a({
|
|
36
36
|
name: "wageType",
|
|
37
37
|
control: o.control
|
|
38
38
|
}), f = a({
|
|
@@ -60,7 +60,7 @@ const Y = t.object({
|
|
|
60
60
|
{
|
|
61
61
|
isOpen: y,
|
|
62
62
|
onClose: u,
|
|
63
|
-
footer: /* @__PURE__ */ r(
|
|
63
|
+
footer: /* @__PURE__ */ r(S, { children: [
|
|
64
64
|
/* @__PURE__ */ n(p, { variant: "secondary", onClick: u, children: e("cancelCta") }),
|
|
65
65
|
/* @__PURE__ */ n(
|
|
66
66
|
p,
|
|
@@ -73,7 +73,7 @@ const Y = t.object({
|
|
|
73
73
|
}
|
|
74
74
|
)
|
|
75
75
|
] }),
|
|
76
|
-
children: /* @__PURE__ */ n(k, { ...o, children: /* @__PURE__ */ n(
|
|
76
|
+
children: /* @__PURE__ */ n(k, { ...o, children: /* @__PURE__ */ n(T, { id: d, onSubmit: o.handleSubmit(s), children: /* @__PURE__ */ r(i, { flexDirection: "column", gap: 32, children: [
|
|
77
77
|
/* @__PURE__ */ r(i, { flexDirection: "column", gap: 16, children: [
|
|
78
78
|
/* @__PURE__ */ n(l, { as: "h2", children: e("title") }),
|
|
79
79
|
/* @__PURE__ */ n(h, { children: e("subtitle") }),
|
|
@@ -114,7 +114,7 @@ const Y = t.object({
|
|
|
114
114
|
] })
|
|
115
115
|
] }),
|
|
116
116
|
/* @__PURE__ */ n(i, { flexDirection: "column", gap: 16, children: /* @__PURE__ */ n(
|
|
117
|
-
|
|
117
|
+
j,
|
|
118
118
|
{
|
|
119
119
|
name: "paymentMethod",
|
|
120
120
|
options: F,
|