@tesouro/embedded-components-react 0.3.13 → 0.3.14

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.
Files changed (52) hide show
  1. package/dist/index.d.ts +30 -30
  2. package/dist/index.js +1 -1
  3. package/dist/lib/BillPayWidget.js +1 -1
  4. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +6 -6
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +2 -1
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index30.js +23 -205
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index31.js +200 -185
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index32.js +199 -50
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index33.js +105 -13
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js +12 -46
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index35.js +46 -30
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index36.js +26 -158
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index37.js +162 -31
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index38.js +32 -98
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index39.js +102 -13
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js +13 -242
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +247 -4
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +4 -30
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +28 -82
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +76 -137
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +145 -3
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +3 -4
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +2 -43
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +45 -1
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +1 -8
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +6 -9
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +9 -92
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +94 -3
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +3 -9
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +7 -20
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +14 -51
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +59 -3
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +3 -110
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +107 -8
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +8 -40
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +38 -15
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +18 -98
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +92 -173
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +180 -4
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +5 -8
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +6 -112
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +114 -1
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js +0 -24
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +25 -0
  45. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/index.js +9 -9
  46. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +6 -3
  47. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartDetails.js +1 -0
  48. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartForm.js +1 -1
  49. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/zod.gen.js +1028 -1019
  50. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  51. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index7.js +1 -1
  52. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -1779,6 +1779,36 @@ interface GapCoverageAlertProps {
1779
1779
  labels?: Partial<GapCoverageAlertLabels>;
1780
1780
  }
1781
1781
 
1782
+ /**
1783
+ * Overridable validation / error messages produced by the counterparts feature
1784
+ * layer and surfaced through each form's `errors` prop. Consumers override via
1785
+ * the widget's `messageLabels` prop, merged over {@link COUNTERPART_MESSAGE_LABELS_EN}.
1786
+ */
1787
+ interface CounterpartMessageLabels {
1788
+ legalNameRequired: string;
1789
+ firstNameRequired: string;
1790
+ lastNameRequired: string;
1791
+ emailRequired: string;
1792
+ emailInvalid: string;
1793
+ addressLine1Required: string;
1794
+ cityRequired: string;
1795
+ stateRequired: string;
1796
+ postalCodeRequired: string;
1797
+ bankAccountNameRequired: string;
1798
+ bankAccountIdentifierRequired: string;
1799
+ bankAccountCurrencyRequired: string;
1800
+ accountHolderNameRequired: string;
1801
+ routingNumberInvalid: string;
1802
+ accountNumberInvalid: string;
1803
+ vatIdValueRequired: string;
1804
+ /** Shown for a non-field-specific submit failure. */
1805
+ genericError: string;
1806
+ /** Delete confirmation title; `{name}` is replaced with the entity name. */
1807
+ deleteTitle: string;
1808
+ deleteCounterpartMessage: string;
1809
+ deleteSubEntityMessage: string;
1810
+ }
1811
+
1782
1812
  /**
1783
1813
  * Action handlers for custom payment flows in payable operations.
1784
1814
  *
@@ -2584,36 +2614,6 @@ interface CardsWidgetProps extends WidgetProviderProps {
2584
2614
  */
2585
2615
  declare function CardsWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, disclosuresAcceptance, ...innerProps }: CardsWidgetProps): React.JSX.Element;
2586
2616
 
2587
- /**
2588
- * Overridable validation / error messages produced by the counterparts feature
2589
- * layer and surfaced through each form's `errors` prop. Consumers override via
2590
- * the widget's `messageLabels` prop, merged over {@link COUNTERPART_MESSAGE_LABELS_EN}.
2591
- */
2592
- interface CounterpartMessageLabels {
2593
- legalNameRequired: string;
2594
- firstNameRequired: string;
2595
- lastNameRequired: string;
2596
- emailRequired: string;
2597
- emailInvalid: string;
2598
- addressLine1Required: string;
2599
- cityRequired: string;
2600
- stateRequired: string;
2601
- postalCodeRequired: string;
2602
- bankAccountNameRequired: string;
2603
- bankAccountIdentifierRequired: string;
2604
- bankAccountCurrencyRequired: string;
2605
- accountHolderNameRequired: string;
2606
- routingNumberInvalid: string;
2607
- accountNumberInvalid: string;
2608
- vatIdValueRequired: string;
2609
- /** Shown for a non-field-specific submit failure. */
2610
- genericError: string;
2611
- /** Delete confirmation title; `{name}` is replaced with the entity name. */
2612
- deleteTitle: string;
2613
- deleteCounterpartMessage: string;
2614
- deleteSubEntityMessage: string;
2615
- }
2616
-
2617
2617
  /**
2618
2618
  * Co-located user-facing strings for the counterparts widget UI. Each component
2619
2619
  * takes a `labels?: Partial<...Labels>` prop merged over the matching
package/dist/index.js CHANGED
@@ -16,7 +16,7 @@ import "./lib/AcceptDisclosuresWidget.js";
16
16
  import { BankAccountsWidget as C } from "./libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/index8.js";
17
17
  import "./lib/BankAccountsWidget.js";
18
18
  import { CounterpartsWidget as w } from "./libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index8.js";
19
- import { BillPayWidget as T } from "./libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js";
19
+ import { BillPayWidget as T } from "./libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js";
20
20
  import "./lib/BillPayWidget.js";
21
21
  import { CardDetailsWidget as E } from "./libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index6.js";
22
22
  import { CardFormatValue as D } from "./libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index3.js";
@@ -1,3 +1,3 @@
1
- import { BillPayWidget as e } from "../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js";
1
+ import { BillPayWidget as e } from "../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js";
2
2
  import "../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js";
3
3
  export { e as BillPayWidget };
@@ -2,15 +2,14 @@ import "./index10.js";
2
2
  import "./index11.js";
3
3
  import "./index22.js";
4
4
  import "./index28.js";
5
- import "./index36.js";
6
- import "./index38.js";
7
- import "./index40.js";
5
+ import "./index37.js";
6
+ import "./index39.js";
8
7
  import "./index41.js";
9
8
  import "./index42.js";
10
9
  import "./index43.js";
11
10
  import "./index44.js";
12
11
  import "./index45.js";
13
- import "./index49.js";
12
+ import "./index46.js";
14
13
  import "./index50.js";
15
14
  import "./index51.js";
16
15
  import "./index52.js";
@@ -19,10 +18,11 @@ import "./index54.js";
19
18
  import "./index55.js";
20
19
  import "./index56.js";
21
20
  import "./index57.js";
22
- import "./index59.js";
21
+ import "./index58.js";
23
22
  import "./index60.js";
24
23
  import "./index61.js";
25
24
  import "./index62.js";
26
25
  import "./index63.js";
27
- import { BillPayWidget as e } from "./index67.js";
26
+ import "./index64.js";
27
+ import { BillPayWidget as e } from "./index68.js";
28
28
  export { e as BillPayWidget };
@@ -41,7 +41,8 @@ var s = {
41
41
  taxRow: "Tax",
42
42
  discountRow: "Discounts",
43
43
  totalRow: "Total",
44
- paymentInstructionsSaveError: "Couldn't save payment instructions. Try again."
44
+ paymentInstructionsSaveError: "Couldn't save payment instructions. Try again.",
45
+ paymentInstructionsLinkError: "Payment instructions were saved to the vendor, but couldn't be added to this bill. Try again."
45
46
  }, d = {
46
47
  dateLabel: (e) => new Date(e).toLocaleString("en-US", {
47
48
  month: "short",
@@ -1,208 +1,26 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
5
- import { Button as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
6
- import { getStateOptions as t } from "../../../shared/util/dist/lib/usStates.js";
7
- import { AchFieldGroup as n } from "../../../shared/counterpart-management/ui/dist/index5.js";
8
- import { CounterpartFormFields as r, useFocusFirstInvalidField as i } from "../../../shared/counterpart-management/ui/dist/index9.js";
9
- import { VENDOR_INLINE_FORM_LABELS_EN as a } from "./index28.js";
10
- import { COUNTERPART_MESSAGE_LABELS_EN as o } from "../../../shared/counterpart-management/feature/dist/lib/labels.js";
11
- import { useCounterpartForm as s } from "../../../shared/counterpart-management/feature/dist/lib/useCounterpartForm.js";
12
- import "../../../shared/counterpart-management/feature/dist/index.js";
13
- import { useCallback as c, useEffect as l, useMemo as u, useRef as d, useState as f } from "react";
14
- import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
15
- import { Landmark as g, Plus as _, X as v } from "lucide-react";
16
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index30.js
17
- function y({ mode: y, counterpart: b, primaryAddress: x, bankAccounts: S, isBankAccountsLoading: C, isBankAccountsError: w, initialName: T, onSaved: E, onCancel: D, onDirtyChange: O, labels: k }) {
18
- let A = {
19
- ...a,
20
- ...k
21
- }, [j, M] = f("none"), [N, P] = f(b?.id), [F, I] = f(!1), [L, R] = f(!1);
22
- l(() => {
23
- O?.(L);
24
- }, [L, O]);
25
- let z = u(() => t(), []), B = d(j), V = d(!1), H = s({
26
- view: j,
27
- setView: M,
28
- selectedId: N,
29
- setSelectedId: P,
30
- messages: o,
31
- counterpartType: "vendor",
32
- counterpart: b,
33
- primaryAddress: x,
34
- bankAccounts: S,
35
- isBankAccountsLoading: C,
36
- isBankAccountsError: w
37
- }), { openCreate: U, openEdit: W, setValues: G } = H, K = i(H.errors);
38
- l(() => {
39
- y === "edit" ? W() : U();
40
- }, [
41
- y,
42
- U,
43
- W
44
- ]), l(() => {
45
- B.current !== "none" && j === "none" && N && E(N), B.current = j;
46
- }, [
47
- j,
48
- N,
49
- E
50
- ]), l(() => {
51
- y !== "create" || V.current || (V.current = !0, G((e) => ({
52
- ...e,
53
- entityType: "organization",
54
- legalName: T?.trim() || e.legalName
55
- })));
56
- }, [
57
- y,
58
- T,
59
- G
60
- ]), l(() => {
61
- y === "edit" && (H.values.bankAccount.routingNumber || H.values.bankAccount.accountNumber) && I(!0);
62
- }, [
63
- y,
64
- H.values.bankAccount.accountNumber,
65
- H.values.bankAccount.routingNumber
66
- ]), l(() => {
67
- H.sectionsToExpand.bankAccount && I(!0);
68
- }, [H.sectionsToExpand.bankAccount]);
69
- let q = c((e) => {
70
- R(!0), G((t) => e.entityType === "individual" && t.entityType !== "individual" ? {
71
- ...t,
72
- ...e,
73
- firstName: t.firstName || t.legalName,
74
- legalName: t.legalName
75
- } : e.entityType === "organization" && t.entityType !== "organization" ? {
76
- ...t,
77
- ...e,
78
- legalName: t.legalName || [t.firstName, t.lastName].filter(Boolean).join(" ")
79
- } : {
80
- ...t,
81
- ...e
82
- });
83
- }, [G]);
84
- return /* @__PURE__ */ h("div", {
85
- ref: K,
86
- className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:rounded-lg ttw:border ttw:border-border ttw:bg-card ttw:p-4",
87
- children: [
88
- /* @__PURE__ */ h("div", {
89
- className: "ttw:flex ttw:items-start ttw:justify-between ttw:gap-2",
90
- children: [/* @__PURE__ */ m("p", {
91
- className: "ttw:text-base ttw:font-semibold ttw:text-foreground",
92
- children: y === "edit" ? A.editTitle : A.createTitle
93
- }), /* @__PURE__ */ m(e, {
94
- type: "button",
95
- variant: "ghost",
96
- size: "icon",
97
- "aria-label": A.close,
98
- onClick: D,
99
- children: /* @__PURE__ */ m(v, { className: "ttw:size-4" })
100
- })]
101
- }),
102
- /* @__PURE__ */ m(r, {
103
- mode: y,
104
- counterpartMode: "vendor",
105
- values: H.values,
106
- errors: H.errors,
107
- stateOptions: z,
108
- onChange: q,
109
- onAddressChange: (e) => {
110
- R(!0), G((t) => ({
111
- ...t,
112
- address: {
113
- ...t.address,
114
- ...e
115
- }
116
- }));
117
- },
118
- sections: {
119
- entityType: !0,
120
- profileHeading: !1,
121
- title: !1,
122
- taxId: !1,
123
- address: "collapsible",
124
- bankAccount: !1
125
- },
126
- sectionsToExpand: H.sectionsToExpand,
127
- onAddressExpand: H.expandAddress,
128
- labels: { businessNameLabel: A.nameLabel }
129
- }),
130
- /* @__PURE__ */ h("div", {
131
- className: "ttw:flex ttw:flex-col ttw:gap-1",
132
- children: [/* @__PURE__ */ m("p", {
133
- className: "ttw:text-sm ttw:font-semibold ttw:text-foreground",
134
- children: A.paymentMethodsHeading
135
- }), /* @__PURE__ */ m("p", {
136
- className: "ttw:text-sm ttw:text-muted-foreground",
137
- children: A.paymentMethodsDescription
138
- })]
139
- }),
140
- /* @__PURE__ */ h("div", {
141
- className: "ttw:flex ttw:gap-3 ttw:rounded-lg ttw:border ttw:border-border ttw:p-3",
142
- children: [/* @__PURE__ */ m("span", {
143
- className: "ttw:flex ttw:size-8 ttw:shrink-0 ttw:items-center ttw:justify-center ttw:rounded-md ttw:bg-primary",
144
- children: /* @__PURE__ */ m(g, {
145
- "aria-hidden": !0,
146
- className: "ttw:size-4 ttw:text-white"
147
- })
148
- }), /* @__PURE__ */ h("div", {
149
- className: "ttw:flex ttw:flex-1 ttw:flex-col ttw:gap-3",
150
- children: [/* @__PURE__ */ h("div", {
151
- className: "ttw:flex ttw:flex-col ttw:gap-0.5",
152
- children: [/* @__PURE__ */ m("p", {
153
- className: "ttw:text-sm ttw:font-medium ttw:text-foreground",
154
- children: A.achTitle
155
- }), /* @__PURE__ */ m("p", {
156
- className: "ttw:text-sm ttw:text-muted-foreground",
157
- children: A.achDescription
158
- })]
159
- }), F ? /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(n, {
160
- idPrefix: "vendor-inline-ach",
161
- values: H.values.bankAccount,
162
- errors: H.errors?.bankAccount,
163
- onChange: (e) => {
164
- R(!0), G((t) => ({
165
- ...t,
166
- bankAccount: {
167
- ...t.bankAccount,
168
- ...e
169
- }
170
- }));
171
- },
172
- labels: {
173
- accountHolderName: A.accountHolderNameLabel,
174
- routingNumber: A.routingNumberLabel,
175
- accountNumber: A.accountNumberLabel
176
- }
177
- }), /* @__PURE__ */ m("p", {
178
- className: "ttw:text-sm ttw:text-muted-foreground",
179
- children: A.achHelp
180
- })] }) : /* @__PURE__ */ h(e, {
181
- type: "button",
182
- variant: "link",
183
- className: "ttw:w-fit ttw:px-0",
184
- onClick: () => I(!0),
185
- children: [/* @__PURE__ */ m(_, { className: "ttw:size-4" }), A.addBankAccount]
186
- })]
187
- })]
188
- }),
189
- /* @__PURE__ */ h("div", {
190
- className: "ttw:flex ttw:justify-end ttw:gap-2",
191
- children: [/* @__PURE__ */ m(e, {
192
- type: "button",
193
- variant: "outline",
194
- onClick: D,
195
- children: A.cancel
196
- }), /* @__PURE__ */ m(e, {
197
- type: "button",
198
- onClick: H.submit,
199
- loading: H.isSubmitting,
200
- disabled: H.isSubmitting,
201
- children: A.save
202
- })]
203
- })
204
- ]
205
- });
2
+ function e(e) {
3
+ return e?.trim() ?? "";
4
+ }
5
+ function t(t) {
6
+ let n = e(t);
7
+ return n.length === 2 ? n.toUpperCase() : "";
8
+ }
9
+ function n(n) {
10
+ if (!n) return;
11
+ let r = {
12
+ legalName: e(n.name),
13
+ email: e(n.email),
14
+ phone: e(n.phone),
15
+ address: {
16
+ line1: e(n.address?.line1),
17
+ line2: e(n.address?.line2),
18
+ city: e(n.address?.city),
19
+ state: t(n.address?.state),
20
+ postalCode: e(n.address?.postal_code)
21
+ }
22
+ };
23
+ return r.legalName || r.email || r.phone || Object.values(r.address).some(Boolean) ? r : void 0;
206
24
  }
207
25
  //#endregion
208
- export { y as VendorInlineForm, y as default };
26
+ export { n as buildVendorPrefill };