@tesouro/embedded-components-react 0.5.285 → 0.5.288
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/index.css +11 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index25.js +9 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index27.js +39 -22
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index28.js +102 -77
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index29.js +267 -248
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index33.js +20 -19
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index37.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index24.js +119 -88
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index13.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/index.js +11 -11
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartForm.js +62 -55
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index7.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index9.js +27 -22
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/util/dist/lib/usStates.js +4 -1
- package/dist/packages/shared-ui-shadcn/dist/index.js +4 -4
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -3793,6 +3793,9 @@
|
|
|
3793
3793
|
.ttw\:text-destructive {
|
|
3794
3794
|
color: var(--ttw-destructive);
|
|
3795
3795
|
}
|
|
3796
|
+
.ttw\:text-destructive-foreground {
|
|
3797
|
+
color: var(--ttw-destructive-foreground);
|
|
3798
|
+
}
|
|
3796
3799
|
.ttw\:text-emerald-600 {
|
|
3797
3800
|
color: var(--ttw-color-emerald-600);
|
|
3798
3801
|
}
|
|
@@ -6479,6 +6482,12 @@
|
|
|
6479
6482
|
.ttw\:\[\&_\[cmdk-item\]_svg\]\:w-5 [cmdk-item] svg {
|
|
6480
6483
|
width: calc(var(--ttw-spacing) * 5);
|
|
6481
6484
|
}
|
|
6485
|
+
.ttw\:\[\&_\[data-slot\=input\]\]\:bg-background [data-slot=input] {
|
|
6486
|
+
background-color: var(--ttw-background);
|
|
6487
|
+
}
|
|
6488
|
+
.ttw\:\[\&_\[data-slot\=select-trigger\]\]\:bg-background [data-slot=select-trigger] {
|
|
6489
|
+
background-color: var(--ttw-background);
|
|
6490
|
+
}
|
|
6482
6491
|
.ttw\:\[\&_li\]\:pb-2 li {
|
|
6483
6492
|
padding-bottom: calc(var(--ttw-spacing) * 2);
|
|
6484
6493
|
}
|
|
@@ -6929,6 +6938,7 @@
|
|
|
6929
6938
|
--ttw-accent: oklch(0.97 0 0);
|
|
6930
6939
|
--ttw-accent-foreground: oklch(0.205 0 0);
|
|
6931
6940
|
--ttw-destructive: #dc2626;
|
|
6941
|
+
--ttw-destructive-foreground: #fff;
|
|
6932
6942
|
--ttw-border: oklch(0.922 0 0);
|
|
6933
6943
|
--ttw-input: oklch(0.922 0 0);
|
|
6934
6944
|
--ttw-ring: oklch(0.708 0 0);
|
|
@@ -6963,6 +6973,7 @@
|
|
|
6963
6973
|
--ttw-accent: oklch(0.269 0 0);
|
|
6964
6974
|
--ttw-accent-foreground: oklch(0.985 0 0);
|
|
6965
6975
|
--ttw-destructive: #dc2626;
|
|
6976
|
+
--ttw-destructive-foreground: #fff;
|
|
6966
6977
|
--ttw-border: oklch(1 0 0 / 10%);
|
|
6967
6978
|
--ttw-input: oklch(1 0 0 / 15%);
|
|
6968
6979
|
--ttw-ring: oklch(0.556 0 0);
|
|
@@ -41,6 +41,7 @@ var g = {
|
|
|
41
41
|
searchFailed: "We could not load vendors. Try again.",
|
|
42
42
|
vendorDetailsFailed: "We could not load this vendor. Try again.",
|
|
43
43
|
pendingVendorDescription: "Will be created when submitted",
|
|
44
|
+
pendingVendorIncompleteDescription: "Add the missing vendor details before submitting",
|
|
44
45
|
bankAccountSaveFailed: "We could not save these payment instructions. Try again."
|
|
45
46
|
}, v = {
|
|
46
47
|
attachFailed: "We could not attach that file. Try again.",
|
|
@@ -155,11 +156,17 @@ function x(e) {
|
|
|
155
156
|
};
|
|
156
157
|
}
|
|
157
158
|
var S = {
|
|
158
|
-
createTitle: "New vendor",
|
|
159
|
+
createTitle: "New vendor details",
|
|
159
160
|
editTitle: "Edit vendor",
|
|
160
161
|
switchVendorFieldLabel: "Switch to a different vendor",
|
|
162
|
+
vendorFieldLabel: "Vendor",
|
|
163
|
+
newVendorBadge: "New vendor",
|
|
164
|
+
unmatchedVendorHelper: "We couldn't match this vendor to your list. Search to choose an existing vendor, or finish adding a new one below.",
|
|
165
|
+
resultsHeading: "Your vendors",
|
|
166
|
+
addAsNewVendor: (e) => `Add "${e}" as a new vendor`,
|
|
167
|
+
addAsNewVendorDescription: "Uses the details extracted from this bill",
|
|
168
|
+
fieldsNeedAttention: (e) => `${e} ${e === 1 ? "field needs" : "fields need"} attention`,
|
|
161
169
|
nameLabel: "Business name",
|
|
162
|
-
addAddress: "Add address (optional)",
|
|
163
170
|
cancel: "Cancel",
|
|
164
171
|
save: "Save",
|
|
165
172
|
cancelAriaLabel: "Cancel vendor",
|
|
@@ -1,35 +1,52 @@
|
|
|
1
|
+
import { isStateValid as e } from "../../../../shared/util/dist/lib/usStates.js";
|
|
2
|
+
import { emptyCounterpartFormValues as t, hasCounterpartFormErrors as n, validateCounterpartForm as r } from "../../../../shared/counterpart-management/feature/dist/lib/helpers.js";
|
|
3
|
+
import "../../../../shared/counterpart-management/feature/dist/index.js";
|
|
1
4
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index27.js
|
|
2
|
-
function
|
|
5
|
+
function i(e) {
|
|
3
6
|
return e?.trim() ?? "";
|
|
4
7
|
}
|
|
5
|
-
function
|
|
6
|
-
let n =
|
|
7
|
-
return n
|
|
8
|
+
function a(t) {
|
|
9
|
+
let n = i(t).toUpperCase();
|
|
10
|
+
return e(n) ? n : "";
|
|
8
11
|
}
|
|
9
|
-
function
|
|
10
|
-
let n = e
|
|
11
|
-
if (n || r) return {
|
|
12
|
-
accountHolderName:
|
|
12
|
+
function o(e) {
|
|
13
|
+
let t = i(e.bank_account?.account_holder_name), n = i(e.bank_account?.routing_number), r = i(e.bank_account?.account_number);
|
|
14
|
+
if (t || n || r) return {
|
|
15
|
+
accountHolderName: t || i(e.name),
|
|
13
16
|
routingNumber: n,
|
|
14
17
|
accountNumber: r
|
|
15
18
|
};
|
|
16
19
|
}
|
|
17
|
-
function
|
|
18
|
-
if (!
|
|
19
|
-
let
|
|
20
|
-
legalName: e
|
|
21
|
-
email: e
|
|
22
|
-
phone: e
|
|
20
|
+
function s(e) {
|
|
21
|
+
if (!e) return;
|
|
22
|
+
let t = {
|
|
23
|
+
legalName: i(e.name),
|
|
24
|
+
email: i(e.email),
|
|
25
|
+
phone: i(e.phone),
|
|
23
26
|
address: {
|
|
24
|
-
line1: e
|
|
25
|
-
line2: e
|
|
26
|
-
city: e
|
|
27
|
-
state:
|
|
28
|
-
postalCode: e
|
|
27
|
+
line1: i(e.address?.line1),
|
|
28
|
+
line2: i(e.address?.line2),
|
|
29
|
+
city: i(e.address?.city),
|
|
30
|
+
state: a(e.address?.state),
|
|
31
|
+
postalCode: i(e.address?.postal_code)
|
|
29
32
|
},
|
|
30
|
-
bankAccount:
|
|
33
|
+
bankAccount: o(e)
|
|
31
34
|
};
|
|
32
|
-
return
|
|
35
|
+
return t.legalName || t.email || t.phone || Object.values(t.address).some(Boolean) || t.bankAccount ? t : void 0;
|
|
36
|
+
}
|
|
37
|
+
function c(e) {
|
|
38
|
+
let a = s(e);
|
|
39
|
+
if (!a || i(e?.address?.country).toUpperCase() !== "US") return !1;
|
|
40
|
+
let o = t("organization", "vendor");
|
|
41
|
+
return !n(r({
|
|
42
|
+
...o,
|
|
43
|
+
...a,
|
|
44
|
+
bankAccount: {
|
|
45
|
+
accountHolderName: i(e?.bank_account?.account_holder_name),
|
|
46
|
+
routingNumber: i(e?.bank_account?.routing_number),
|
|
47
|
+
accountNumber: i(e?.bank_account?.account_number)
|
|
48
|
+
}
|
|
49
|
+
}, "create", void 0, "vendor"));
|
|
33
50
|
}
|
|
34
51
|
//#endregion
|
|
35
|
-
export {
|
|
52
|
+
export { s as buildVendorPrefill, c as canAutoCreateVendor };
|
|
@@ -5,88 +5,113 @@
|
|
|
5
5
|
import { Button as e } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
6
|
import { getStateOptions as t } from "../../../../shared/util/dist/lib/usStates.js";
|
|
7
7
|
import { AchFieldGroup as n } from "../../../../shared/counterpart-management/ui/dist/index5.js";
|
|
8
|
-
import { CounterpartFormFields as r,
|
|
8
|
+
import { CounterpartFormFields as r, countErrors as i, useFocusFirstInvalidField as a } from "../../../../shared/counterpart-management/ui/dist/index9.js";
|
|
9
9
|
import "../../../../shared/counterpart-management/ui/dist/index.js";
|
|
10
|
-
import { VendorSearchCombobox as
|
|
10
|
+
import { VendorSearchCombobox as o } from "../../ui/dist/index24.js";
|
|
11
11
|
import "../../ui/dist/index.js";
|
|
12
|
-
import { mergeVendorInlineFormLabels as
|
|
12
|
+
import { mergeVendorInlineFormLabels as s } from "./index25.js";
|
|
13
13
|
import "../../../../shared/counterpart-management/feature/dist/index.js";
|
|
14
|
-
import { useMemo as
|
|
15
|
-
import { jsx as
|
|
14
|
+
import { useMemo as c } from "react";
|
|
15
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
16
16
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index28.js
|
|
17
|
-
function
|
|
18
|
-
let
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
17
|
+
function d({ mode: d, values: f, errors: p, onChange: m, onAddressChange: h, sectionsToExpand: g, onAddressExpand: _, onCancel: v, onSave: y, isSaving: b = !1, search: x, paymentInstructions: S, labels: C }) {
|
|
18
|
+
let w = c(() => s(C), [C]), T = c(() => t(), []), E = a(p ?? {}), D = i({
|
|
19
|
+
...p,
|
|
20
|
+
form: void 0,
|
|
21
|
+
bankAccount: void 0
|
|
22
|
+
}) + i(S?.errors), O = x?.query.trim() ?? "", k = f.entityType === "individual" ? `${f.firstName} ${f.lastName}`.trim() : f.legalName, A = x && d === "create" ? /* @__PURE__ */ l(o, {
|
|
23
|
+
...x,
|
|
24
|
+
selectedLabel: k,
|
|
25
|
+
badge: w.newVendorBadge,
|
|
26
|
+
helperText: w.unmatchedVendorHelper,
|
|
27
|
+
resultsHeading: w.resultsHeading,
|
|
28
|
+
addVendorDescription: w.addAsNewVendorDescription,
|
|
29
|
+
labels: {
|
|
30
|
+
fieldLabel: w.vendorFieldLabel,
|
|
31
|
+
addVendorAction: w.addAsNewVendor(O || k)
|
|
32
|
+
}
|
|
33
|
+
}) : null;
|
|
34
|
+
return /* @__PURE__ */ u("div", {
|
|
35
|
+
ref: E,
|
|
36
|
+
className: "ttw:flex ttw:flex-col ttw:gap-4",
|
|
37
|
+
children: [A, /* @__PURE__ */ u("div", {
|
|
38
|
+
className: "ttw:flex ttw:flex-col ttw:gap-6 ttw:rounded-lg ttw:border ttw:border-primary ttw:bg-surface-subtle ttw:p-6 ttw:[&_[data-slot=input]]:bg-background ttw:[&_[data-slot=select-trigger]]:bg-background",
|
|
39
|
+
children: [
|
|
40
|
+
/* @__PURE__ */ u("div", {
|
|
41
|
+
className: "ttw:flex ttw:items-baseline ttw:justify-between ttw:gap-2",
|
|
42
|
+
children: [/* @__PURE__ */ l("p", {
|
|
43
|
+
className: "ttw:text-base ttw:font-semibold ttw:text-foreground",
|
|
44
|
+
children: d === "edit" ? w.editTitle : w.createTitle
|
|
45
|
+
}), D > 0 ? /* @__PURE__ */ l("p", {
|
|
46
|
+
className: "ttw:text-sm ttw:text-destructive",
|
|
47
|
+
children: w.fieldsNeedAttention(D)
|
|
48
|
+
}) : null]
|
|
49
|
+
}),
|
|
50
|
+
x && d === "edit" ? /* @__PURE__ */ l(o, {
|
|
51
|
+
...x,
|
|
52
|
+
labels: { fieldLabel: w.switchVendorFieldLabel }
|
|
53
|
+
}) : null,
|
|
54
|
+
/* @__PURE__ */ l(r, {
|
|
55
|
+
mode: d,
|
|
56
|
+
counterpartMode: "vendor",
|
|
57
|
+
values: f,
|
|
58
|
+
errors: p,
|
|
59
|
+
stateOptions: T,
|
|
60
|
+
onChange: m,
|
|
61
|
+
onAddressChange: h,
|
|
62
|
+
sections: {
|
|
63
|
+
entityType: !0,
|
|
64
|
+
profileHeading: !1,
|
|
65
|
+
addressHeading: !1,
|
|
66
|
+
title: !1,
|
|
67
|
+
taxId: !1,
|
|
68
|
+
address: d !== "edit" || "collapsible",
|
|
69
|
+
bankAccount: !1
|
|
70
|
+
},
|
|
71
|
+
sectionsToExpand: g,
|
|
72
|
+
onAddressExpand: _,
|
|
73
|
+
labels: { businessNameLabel: w.nameLabel }
|
|
74
|
+
}),
|
|
75
|
+
S ? /* @__PURE__ */ u("div", {
|
|
76
|
+
className: "ttw:flex ttw:flex-col ttw:gap-3",
|
|
77
|
+
children: [/* @__PURE__ */ u("div", {
|
|
78
|
+
className: "ttw:flex ttw:flex-col ttw:gap-1",
|
|
79
|
+
children: [/* @__PURE__ */ l("p", {
|
|
80
|
+
className: "ttw:text-sm ttw:font-semibold ttw:text-foreground",
|
|
81
|
+
children: w.paymentInstructionsHeading
|
|
82
|
+
}), /* @__PURE__ */ l("p", {
|
|
83
|
+
className: "ttw:text-sm ttw:text-muted-foreground",
|
|
84
|
+
children: S.isExtracted ? w.paymentInstructionsExtracted : w.paymentInstructionsDescription
|
|
85
|
+
})]
|
|
86
|
+
}), /* @__PURE__ */ l(n, {
|
|
87
|
+
idPrefix: "vendor-inline-ach",
|
|
88
|
+
values: S.values,
|
|
89
|
+
errors: S.errors,
|
|
90
|
+
onChange: S.onChange,
|
|
91
|
+
labels: w.ach
|
|
61
92
|
})]
|
|
62
|
-
})
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
loading: y,
|
|
84
|
-
disabled: y,
|
|
85
|
-
children: C.save
|
|
86
|
-
}) : null]
|
|
87
|
-
})
|
|
88
|
-
]
|
|
93
|
+
}) : null,
|
|
94
|
+
/* @__PURE__ */ u("div", {
|
|
95
|
+
className: "ttw:flex ttw:justify-end ttw:gap-2",
|
|
96
|
+
children: [/* @__PURE__ */ l(e, {
|
|
97
|
+
type: "button",
|
|
98
|
+
variant: "outline",
|
|
99
|
+
onClick: v,
|
|
100
|
+
"aria-label": w.cancelAriaLabel,
|
|
101
|
+
disabled: b,
|
|
102
|
+
children: w.cancel
|
|
103
|
+
}), y ? /* @__PURE__ */ l(e, {
|
|
104
|
+
type: "button",
|
|
105
|
+
onClick: y,
|
|
106
|
+
"aria-label": w.saveAriaLabel,
|
|
107
|
+
loading: b,
|
|
108
|
+
disabled: b,
|
|
109
|
+
children: w.save
|
|
110
|
+
}) : null]
|
|
111
|
+
})
|
|
112
|
+
]
|
|
113
|
+
})]
|
|
89
114
|
});
|
|
90
115
|
}
|
|
91
116
|
//#endregion
|
|
92
|
-
export {
|
|
117
|
+
export { d as VendorInlineForm, d as default };
|