@tesouro/embedded-components-react 0.5.170 → 0.5.172

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 (30) hide show
  1. package/dist/index.d.ts +18 -0
  2. package/dist/index.js +1 -1
  3. package/dist/lib/BankAccountOnboardingWidget.d.ts +18 -0
  4. package/dist/lib/BankAccountOnboardingWidget.js +1 -1
  5. package/dist/lib/WidgetSuite.d.ts +18 -0
  6. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index.js +1 -1
  7. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index10.js +82 -184
  8. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index11.js +189 -29
  9. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index12.js +34 -127
  10. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index13.js +83 -175
  11. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index14.js +173 -84
  12. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index15.js +62 -92
  13. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index16.js +86 -115
  14. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index17.js +5 -97
  15. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index18.js +105 -87
  16. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index19.js +99 -5
  17. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index20.js +94 -28
  18. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index21.js +182 -16
  19. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index22.js +5 -423
  20. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index23.js +34 -0
  21. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index24.js +19 -0
  22. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index25.js +580 -0
  23. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index.js +3 -1
  24. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index25.js +10 -0
  25. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index26.js +59 -0
  26. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  27. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/OnboardingShell/OnboardingShell.js +62 -49
  28. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/OnboardingShell/labels.js +1 -0
  29. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index16.js +1 -1
  30. package/package.json +1 -1
@@ -1,129 +1,36 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
5
- import { isIdentifierEnteredOrStored as e, usableStoredTaxIdLast4 as t } from "./index7.js";
6
- import { bankAccountOnboardingTestIds as n } from "./index11.js";
7
- import { isValidWebsiteUrl as r } from "./index8.js";
8
- import { BusinessDetailsPanel as i } from "../../ui/dist/index19.js";
9
- import { BusinessDisclosuresSection as a } from "../../ui/dist/index24.js";
10
- import "../../ui/dist/index.js";
11
- import { buildBusinessDetailsEditFields as o, buildBusinessDetailsPanelLabels as s, buildBusinessDetailsSummaryRows as c, buildTaxIdFieldDisplay as l, isBusinessWebsiteInvalid as u, mergeBusinessDetailsLabels as d } from "./index10.js";
12
- import { useEffect as f, useMemo as p, useRef as m, useState as h } from "react";
13
- import { jsx as g, jsxs as _ } from "react/jsx-runtime";
14
- import { z as v } from "zod";
15
1
  //#region ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index12.js
16
- function y(e) {
17
- return v.object({
18
- companyLegalName: v.string().min(1),
19
- companyDbaName: v.string(),
20
- businessAddress: v.string().min(1),
21
- city: v.string().min(1),
22
- state: v.string().min(2),
23
- zipCode: v.string().min(5),
24
- companyPhoneNumber: v.string().refine((e) => e.replace(/\D/g, "").length === 10, { message: e.companyPhoneNumberInvalid }),
25
- companyStructure: x,
26
- website: v.string().refine((e) => !e || r(e), { message: e.websiteInvalid }),
27
- taxId: v.string(),
28
- taxIdOnFileLast4: v.string().optional(),
29
- taxIdOnFileStructure: x.optional(),
30
- naicsCode: v.string().min(1)
31
- });
32
- }
33
- var b = (n) => e(n.taxId, t(n)), x = v.enum([
34
- "CORPORATION_PUBLIC",
35
- "CORPORATION_PRIVATE",
36
- "CORPORATION_NOT_FOR_PROFIT",
37
- "LLC",
38
- "LLP",
39
- "PARTNERSHIP",
40
- "SOLE_PROPRIETORSHIP",
41
- "GOVERNMENT",
42
- "COOPERATIVE",
43
- "ASSOCIATION",
44
- "OTHER"
45
- ]);
46
- function S(e) {
47
- return y(e).extend({
48
- isAuthorized: v.literal(!0),
49
- isCheckboxChecked: v.literal(!0)
50
- }).refine(b, {
51
- message: e.taxIdInvalid,
52
- path: ["taxId"]
53
- });
54
- }
55
- function C({ value: e, onValueChange: t, onSnapshotChange: r, naicsOptions: v, stateOptions: x, isSubmitting: C, labels: w, bankName: T, termsHref: E, privacyHref: D, electronicCommunicationHref: O, patriotActHref: k }) {
56
- let A = p(() => d(w), [w]), j = p(() => ({
57
- panelFields: y(A).refine(b, {
58
- message: A.taxIdInvalid,
59
- path: ["taxId"]
60
- }),
61
- full: S(A)
62
- }), [A]), M = j.full.safeParse(e), N = M.success ? M.data : null, P = j.panelFields.safeParse(e).success, F = JSON.stringify(N), I = m(r);
63
- I.current = r, f(() => {
64
- I.current(N);
65
- }, [F]);
66
- let [L, R] = h(() => !P);
67
- f(() => {
68
- P || R(!0);
69
- }, [P]);
70
- let z = p(() => ({
71
- stateOptions: x,
72
- naicsOptions: v,
73
- labels: w
74
- }), [
75
- x,
76
- v,
77
- w
78
- ]), B = p(() => s(w), [w]), V = p(() => c(e, z), [e, z]), H = p(() => o(e, t, z), [
79
- e,
80
- t,
81
- z
82
- ]), U = u(e.website), W = p(() => l(e, w), [e, w]);
83
- return /* @__PURE__ */ _("div", {
84
- className: "ttw:flex ttw:flex-col ttw:gap-6",
85
- children: [/* @__PURE__ */ g(i, {
86
- isEditing: L,
87
- onEditClick: () => R(!0),
88
- summaryRows: V,
89
- editFields: H,
90
- labels: B,
91
- isDisabled: C,
92
- websiteInvalid: U,
93
- taxIdRequired: W.required,
94
- taxIdPlaceholder: W.placeholder,
95
- taxIdHelpText: W.helpText,
96
- testIds: {
97
- root: n.businessDetailsPanel,
98
- editButton: n.businessDetailsEditButton,
99
- summary: { root: n.businessDetailsSummary },
100
- editForm: {
101
- root: n.businessDetailsEditForm,
102
- naicsCombobox: n.businessDetailsNaicsCombobox
103
- }
104
- }
105
- }), /* @__PURE__ */ g(a, {
106
- value: {
107
- isAuthorized: e.isAuthorized,
108
- isCheckboxChecked: e.isCheckboxChecked
109
- },
110
- onChange: (n) => t({
111
- ...e,
112
- ...n
113
- }),
114
- isSubmitting: C,
115
- labels: w,
116
- bankName: T,
117
- termsHref: E,
118
- privacyHref: D,
119
- electronicCommunicationHref: O,
120
- patriotActHref: k,
121
- testIds: {
122
- authorizationCheckbox: n.authorizationCheckbox,
123
- disclosureCheckbox: n.disclosureCheckbox
124
- }
125
- })]
126
- });
127
- }
2
+ var e = {
3
+ shell: "onboarding-shell",
4
+ shellDismiss: "onboarding-shell-dismiss",
5
+ shellBack: "onboarding-shell-back",
6
+ shellCancel: "onboarding-shell-cancel",
7
+ shellSaveAndClose: "onboarding-shell-save-and-close",
8
+ shellNext: "onboarding-shell-next",
9
+ shellScrollRegion: "onboarding-shell-scroll-region",
10
+ shellScrollFade: "onboarding-shell-scroll-fade",
11
+ shellScrollHint: "onboarding-shell-scroll-hint",
12
+ shellOverlay: "onboarding-shell-overlay",
13
+ unsavedDialog: "unsaved-application-dialog",
14
+ unsavedDialogSaveDraft: "unsaved-application-dialog-save-draft",
15
+ unsavedDialogDiscard: "unsaved-application-dialog-discard",
16
+ unsavedDialogClose: "unsaved-application-dialog-close",
17
+ businessDetailsPanel: "business-details-panel",
18
+ businessDetailsEditButton: "business-details-edit-button",
19
+ businessDetailsSummary: "business-details-summary",
20
+ businessDetailsEditForm: "business-details-edit-form",
21
+ businessDetailsNaicsCombobox: "business-details-naics-combobox",
22
+ authorizationCheckbox: "bank-account-onboarding-authorization-checkbox",
23
+ disclosureCheckbox: "bank-account-onboarding-disclosure-checkbox",
24
+ aboutYouPanel: "about-you-panel",
25
+ aboutYouEditButton: "about-you-edit-button",
26
+ aboutYouSummary: "about-you-summary",
27
+ aboutYouEditForm: "about-you-edit-form",
28
+ aboutYouOwnsOver25Question: "about-you-owns-over-25-question",
29
+ addOwnerButton: "bank-account-onboarding-add-owner-button",
30
+ ownerDeleteOverlay: "additional-owner-delete-overlay",
31
+ ownerDeleteContent: "additional-owner-delete-content",
32
+ resultProcessing: "bank-account-onboarding-result-processing",
33
+ resultDashboardButton: "bank-account-onboarding-result-dashboard-button"
34
+ };
128
35
  //#endregion
129
- export { C as BusinessDetailsStep };
36
+ export { e as bankAccountOnboardingTestIds };
@@ -1,180 +1,88 @@
1
- import { maskIdentifierLast4 as e } from "./index6.js";
2
- import { storedIdentifierFieldDisplay as t } from "./index7.js";
3
- import { formatPhoneNumberInput as n } from "./index2.js";
4
- import { sanitizeZipCodeInput as r } from "./index3.js";
5
- import { PERSONAL_DETAILS_LABELS_EN as i } from "../../ui/dist/index8.js";
6
- import { ABOUT_YOU_PANEL_LABELS_EN as a } from "../../ui/dist/index22.js";
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { bankAccountOnboardingTestIds as e } from "./index12.js";
6
+ import { buildBusinessDetailsPanelFieldsSchema as t, buildBusinessDetailsSchema as n, isTaxIdSatisfied as r } from "./index10.js";
7
+ import { BusinessDetailsPanel as i } from "../../ui/dist/index19.js";
8
+ import { BusinessDisclosuresSection as a } from "../../ui/dist/index24.js";
7
9
  import "../../ui/dist/index.js";
8
- import { formatSsnInput as o, maskSsn as s, sanitizeSsnDigits as c } from "./index4.js";
10
+ import { buildBusinessDetailsEditFields as o, buildBusinessDetailsPanelLabels as s, buildBusinessDetailsSummaryRows as c, buildTaxIdFieldDisplay as l, isBusinessWebsiteInvalid as u, mergeBusinessDetailsLabels as d } from "./index11.js";
11
+ import { useEffect as f, useMemo as p, useRef as m, useState as h } from "react";
12
+ import { jsx as g, jsxs as _ } from "react/jsx-runtime";
9
13
  //#region ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index13.js
10
- function l(e) {
11
- return e ? e.toLocaleDateString("en-US", {
12
- month: "short",
13
- day: "numeric",
14
- year: "numeric"
15
- }) : "";
16
- }
17
- function u(e) {
18
- return {
19
- ...i,
20
- ...e
21
- };
22
- }
23
- function d(e) {
24
- let t = u(e);
25
- return {
26
- ...a,
27
- firstName: t.firstName,
28
- lastName: t.lastName,
29
- dateOfBirth: t.dateOfBirth,
30
- dateOfBirthPlaceholder: t.dateOfBirthPlaceholder,
31
- ssn: t.ssn,
32
- ssnShow: t.ssnShow,
33
- ssnHide: t.ssnHide,
34
- homeAddress: t.homeAddress,
35
- city: t.city,
36
- state: t.state,
37
- statePlaceholder: t.statePlaceholder,
38
- zipCode: t.zipCode,
39
- mobilePhoneNumber: t.mobilePhoneNumber,
40
- workEmail: t.workEmail,
41
- ownsOver25Question: t.ownsOver25Question,
42
- ownsOver25SummaryLabel: t.ownsOver25SummaryLabel,
43
- ownsOver25Yes: t.ownsOver25Yes,
44
- ownsOver25No: t.ownsOver25No,
45
- ownershipPercentage: t.ownershipPercentage,
46
- ownershipPercentagePlaceholder: t.ownershipPercentagePlaceholder
47
- };
48
- }
49
- function f(t, n) {
50
- let r = d(n.labels), i = n.stateOptions.find((e) => e.value === t.state)?.label ?? t.state;
51
- return [
52
- {
53
- label: r.firstName,
54
- value: t.firstName,
55
- testId: "about-you-summary-first-name"
56
- },
57
- {
58
- label: r.lastName,
59
- value: t.lastName,
60
- testId: "about-you-summary-last-name"
61
- },
62
- {
63
- label: r.dateOfBirth,
64
- value: l(t.dateOfBirth),
65
- testId: "about-you-summary-dob"
66
- },
67
- {
68
- label: r.ssn,
69
- value: t.ssn ? s(t.ssn) : t.ssnOnFileLast4 ? e(t.ssnOnFileLast4) : "",
70
- testId: "about-you-summary-ssn",
71
- valueMonospace: !0
72
- },
73
- {
74
- label: r.homeAddress,
75
- value: t.homeAddress,
76
- testId: "about-you-summary-home-address"
77
- },
78
- {
79
- label: r.city,
80
- value: t.city,
81
- testId: "about-you-summary-city"
82
- },
83
- {
84
- label: r.state,
85
- value: i,
86
- testId: "about-you-summary-state"
87
- },
88
- {
89
- label: r.zipCode,
90
- value: t.zipCode,
91
- testId: "about-you-summary-zip-code"
92
- },
93
- {
94
- label: r.mobilePhoneNumber,
95
- value: t.mobilePhoneNumber,
96
- testId: "about-you-summary-mobile-phone"
97
- },
98
- {
99
- label: r.workEmail,
100
- value: t.workEmail,
101
- testId: "about-you-summary-email"
102
- },
103
- {
104
- label: r.ownershipPercentage,
105
- value: t.ownershipPercentage === null ? "" : `${t.ownershipPercentage}%`,
106
- testId: "about-you-summary-ownership-percentage"
107
- }
108
- ];
109
- }
110
- function p(e, t, i) {
111
- let a = (n) => (r) => t({
112
- ...e,
113
- [n]: r
14
+ function v({ value: v, onValueChange: y, onSnapshotChange: b, naicsOptions: x, stateOptions: S, isSubmitting: C, labels: w, bankName: T, termsHref: E, privacyHref: D, electronicCommunicationHref: O, patriotActHref: k }) {
15
+ let A = p(() => d(w), [w]), j = p(() => ({
16
+ panelFields: t(A).refine(r, {
17
+ message: A.taxIdInvalid,
18
+ path: ["taxId"]
19
+ }),
20
+ full: n(A)
21
+ }), [A]), M = j.full.safeParse(v), N = M.success ? M.data : null, P = j.panelFields.safeParse(v).success, F = JSON.stringify(N), I = m(b);
22
+ I.current = b, f(() => {
23
+ I.current(N);
24
+ }, [F]);
25
+ let [L, R] = h(() => !P);
26
+ f(() => {
27
+ P || R(!0);
28
+ }, [P]);
29
+ let z = p(() => ({
30
+ stateOptions: S,
31
+ naicsOptions: x,
32
+ labels: w
33
+ }), [
34
+ S,
35
+ x,
36
+ w
37
+ ]), B = p(() => s(w), [w]), V = p(() => c(v, z), [v, z]), H = p(() => o(v, y, z), [
38
+ v,
39
+ y,
40
+ z
41
+ ]), U = u(v.website), W = p(() => l(v, w), [v, w]);
42
+ return /* @__PURE__ */ _("div", {
43
+ className: "ttw:flex ttw:flex-col ttw:gap-6",
44
+ children: [/* @__PURE__ */ g(i, {
45
+ isEditing: L,
46
+ onEditClick: () => R(!0),
47
+ summaryRows: V,
48
+ editFields: H,
49
+ labels: B,
50
+ isDisabled: C,
51
+ websiteInvalid: U,
52
+ taxIdRequired: W.required,
53
+ taxIdPlaceholder: W.placeholder,
54
+ taxIdHelpText: W.helpText,
55
+ testIds: {
56
+ root: e.businessDetailsPanel,
57
+ editButton: e.businessDetailsEditButton,
58
+ summary: { root: e.businessDetailsSummary },
59
+ editForm: {
60
+ root: e.businessDetailsEditForm,
61
+ naicsCombobox: e.businessDetailsNaicsCombobox
62
+ }
63
+ }
64
+ }), /* @__PURE__ */ g(a, {
65
+ value: {
66
+ isAuthorized: v.isAuthorized,
67
+ isCheckboxChecked: v.isCheckboxChecked
68
+ },
69
+ onChange: (e) => y({
70
+ ...v,
71
+ ...e
72
+ }),
73
+ isSubmitting: C,
74
+ labels: w,
75
+ bankName: T,
76
+ termsHref: E,
77
+ privacyHref: D,
78
+ electronicCommunicationHref: O,
79
+ patriotActHref: k,
80
+ testIds: {
81
+ authorizationCheckbox: e.authorizationCheckbox,
82
+ disclosureCheckbox: e.disclosureCheckbox
83
+ }
84
+ })]
114
85
  });
115
- return {
116
- firstName: {
117
- value: e.firstName,
118
- onValueChange: a("firstName")
119
- },
120
- lastName: {
121
- value: e.lastName,
122
- onValueChange: a("lastName")
123
- },
124
- dateOfBirth: {
125
- value: e.dateOfBirth,
126
- onValueChange: a("dateOfBirth")
127
- },
128
- ssn: {
129
- value: e.ssn,
130
- onValueChange: (e) => a("ssn")(c(e))
131
- },
132
- homeAddress: {
133
- value: e.homeAddress,
134
- onValueChange: a("homeAddress")
135
- },
136
- city: {
137
- value: e.city,
138
- onValueChange: a("city")
139
- },
140
- state: {
141
- value: e.state,
142
- onValueChange: a("state"),
143
- options: i.stateOptions
144
- },
145
- zipCode: {
146
- value: e.zipCode,
147
- onValueChange: (e) => a("zipCode")(r(e))
148
- },
149
- mobilePhoneNumber: {
150
- value: e.mobilePhoneNumber,
151
- onValueChange: (e) => a("mobilePhoneNumber")(n(e))
152
- },
153
- workEmail: {
154
- value: e.workEmail,
155
- onValueChange: a("workEmail")
156
- },
157
- ownsOver25Percent: {
158
- value: e.ownsOver25Percent === null ? "" : e.ownsOver25Percent ? "yes" : "no",
159
- onValueChange: (n) => t({
160
- ...e,
161
- ownsOver25Percent: n === "" ? null : n === "yes",
162
- ownershipPercentage: n === "yes" ? e.ownershipPercentage : null
163
- })
164
- },
165
- ownershipPercentage: {
166
- value: e.ownershipPercentage,
167
- onValueChange: a("ownershipPercentage")
168
- }
169
- };
170
- }
171
- function m(e, n, r) {
172
- let i = u(r);
173
- return {
174
- masked: s(e),
175
- formatted: o(e),
176
- ...t(n, i.ssnOnFileTemplate)
177
- };
178
86
  }
179
87
  //#endregion
180
- export { p as buildAboutYouEditFields, d as buildAboutYouPanelLabels, f as buildAboutYouSummaryRows, m as buildSsnDisplayValues, u as mergePersonalDetailsLabels };
88
+ export { v as BusinessDetailsStep };