@tesouro/embedded-components-react 0.10.9 → 0.10.10

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 (56) hide show
  1. package/dist/index.css +9 -0
  2. package/dist/index.d.ts +46 -7
  3. package/dist/index.js +4 -4
  4. package/dist/lib/BankAccountOnboardingWidget.d.ts +46 -7
  5. package/dist/lib/BankAccountOnboardingWidget.js +4 -4
  6. package/dist/lib/WidgetSuite.d.ts +46 -7
  7. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/AdditionalOwnersStep.js +175 -98
  8. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/BankAccountOnboardingWidget.js +365 -343
  9. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/BusinessDetailsStep.js +1 -1
  10. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/PersonalDetailsStep.js +3 -9
  11. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/ReviewStep.js +24 -23
  12. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/TermsStep.js +1 -1
  13. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/additionalOwnerDraft.js +1 -1
  14. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/apiMapping.js +15 -10
  15. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/applicantOwnerSummary.js +11 -0
  16. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/applicationStatusView.js +2 -2
  17. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/businessDetailsPanelMapping.js +2 -2
  18. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/draftApplicationMapping.js +3 -3
  19. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/labels.js +1 -1
  20. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/personalDetailsPanelMapping.js +3 -26
  21. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/stepSchemas.js +2 -6
  22. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/testIds.js +3 -1
  23. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index.js +20 -20
  24. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index10.js +5 -340
  25. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index11.js +422 -58
  26. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index12.js +50 -30
  27. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index13.js +39 -6
  28. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index14.js +6 -58
  29. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index15.js +62 -31
  30. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index16.js +31 -38
  31. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index17.js +27 -26
  32. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index18.js +34 -91
  33. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index19.js +96 -12
  34. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index20.js +12 -276
  35. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index21.js +294 -25
  36. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index22.js +28 -23
  37. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index23.js +23 -53
  38. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index24.js +46 -343
  39. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index25.js +268 -26
  40. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index26.js +29 -29
  41. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index27.js +29 -59
  42. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index28.js +53 -118
  43. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index29.js +123 -5
  44. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index30.js +5 -80
  45. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index31.js +80 -10
  46. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index32.js +10 -64
  47. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index33.js +64 -6
  48. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index34.js +6 -44
  49. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index35.js +45 -0
  50. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index7.js +110 -2
  51. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index8.js +2 -77
  52. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index9.js +89 -5
  53. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  54. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/OnboardingShell/OnboardingShell.js +67 -61
  55. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/OnboardingShell/OnboardingShellStepper.js +16 -19
  56. package/package.json +1 -1
@@ -1,342 +1,7 @@
1
- import { Button as e, Table as t, TableBody as n, TableCell as r, TableHead as i, TableHeader as a, TableRow as o, Tooltip as s, TooltipContent as c, TooltipProvider as ee, TooltipTrigger as l, Typography as u } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { ADDITIONAL_OWNERS_LABELS_EN as d } from "./index8.js";
3
- import { AdditionalOwnerRowStatus as f } from "./index9.js";
4
- import { AdditionalOwnerDeleteConfirmation as te } from "./index2.js";
5
- import { AdditionalOwnerInlineEditor as p } from "./index5.js";
6
- import { AdditionalOwnerReviewPanel as ne } from "./index6.js";
7
- import { useEffect as re, useRef as m } from "react";
8
- import { Fragment as ie, jsx as h, jsxs as g } from "react/jsx-runtime";
9
- import { CircleAlertIcon as _, CircleCheckIcon as v, PencilIcon as y, PlusIcon as b, Trash2Icon as x, UserIcon as S, UsersIcon as C } from "lucide-react";
10
1
  // ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index10.js
11
- function w({ ownerRows: _, primaryOwnerName: v, primaryOwnerShareDisplay: S, showPrimaryOwner: C = !0, totalOwnershipError: w, reviewError: D = null, addOwnerDisabled: A, onAddOwner: j, onEditOwner: M, onStartReview: N, onDeleteOwnerRequest: P, deletingOwnerIndex: F, onDeleteOwnerConfirm: I, onDeleteOwnerCancel: L, editingOverlay: R, reviewingOwner: z = null, isSubmitting: B, labels: V, testIds: H }) {
12
- let U = {
13
- ...d,
14
- ...V
15
- }, W = R !== null || F !== null || z !== null, G = B || W, K = R !== null && R.rowIndex !== null ? R : null, q = R !== null && R.rowIndex === null ? R : null, J = !C && _.length === 0, Y = m(null), X = m(null), ae = () => {
16
- X.current = F, L();
17
- }, Z = K?.rowIndex ?? z?.rowIndex, Q = F === null ? q === null ? K === null ? z === null ? null : `review:${z.rowIndex}` : `edit:${K.rowIndex}` : "add" : null, $ = m({
18
- key: Q,
19
- index: Z
20
- });
21
- re(() => {
22
- let e = $.current;
23
- $.current = {
24
- key: Q,
25
- index: Z
26
- };
27
- let t = (e, t) => Y.current?.querySelector(`[data-owner-row="${e}"] ${t}`)?.focus(), n = X.current;
28
- n !== null && F === null ? (X.current = null, t(n, "[data-owner-delete-trigger]")) : F === null && e.key !== Q && (Q === "add" ? Y.current?.querySelector("[data-owner-add-editor] [data-owner-panel-heading]")?.focus() : Q !== null && Z != null ? t(Z, "[data-owner-panel-heading]") : e.key === "add" ? Y.current?.querySelector("[data-owner-add-trigger]")?.focus() : e.index != null && t(e.index, "[data-owner-row-action]"));
29
- }, [
30
- Q,
31
- Z,
32
- F
33
- ]);
34
- let oe = q ? /* @__PURE__ */ h("div", {
35
- "data-owner-add-editor": "",
36
- children: /* @__PURE__ */ h(p, {
37
- heading: U.formHeadingAdd,
38
- submitLabel: U.addOwnerSubmit,
39
- editor: q,
40
- isDisabled: B,
41
- labels: U,
42
- testIds: H?.addOwnerEditor
43
- })
44
- }) : null;
45
- return /* @__PURE__ */ g("div", {
46
- ref: Y,
47
- className: "ttw:relative ttw:flex ttw:flex-col ttw:gap-6",
48
- children: [
49
- /* @__PURE__ */ g("div", {
50
- className: "ttw:flex ttw:flex-col ttw:gap-1",
51
- children: [/* @__PURE__ */ h(u, {
52
- component: "h3",
53
- variant: "h6",
54
- className: "ttw:font-semibold ttw:text-foreground",
55
- children: U.heading
56
- }), /* @__PURE__ */ h(u, {
57
- variant: "body2",
58
- className: "ttw:text-muted-foreground",
59
- children: J ? U.emptySubheading : U.subheading
60
- })]
61
- }),
62
- D ? /* @__PURE__ */ h(T, { message: D }) : null,
63
- q ? oe : J ? /* @__PURE__ */ h(E, {
64
- labels: U,
65
- onAddOwner: j,
66
- disabled: A || B || W,
67
- addOwnerButtonTestId: H?.addOwnerButton
68
- }) : /* @__PURE__ */ g("div", {
69
- className: "ttw:flex ttw:flex-col ttw:gap-2",
70
- children: [/* @__PURE__ */ h("div", {
71
- className: "ttw:border-b ttw:border-border",
72
- children: /* @__PURE__ */ g(t, { children: [/* @__PURE__ */ h(a, { children: /* @__PURE__ */ g(o, {
73
- className: "ttw:hover:bg-transparent",
74
- children: [
75
- /* @__PURE__ */ h(i, {
76
- className: "ttw:px-4 ttw:py-3",
77
- children: U.ownerNameColumn
78
- }),
79
- /* @__PURE__ */ h(i, {
80
- className: "ttw:px-4 ttw:py-3",
81
- children: U.ownerShareColumn
82
- }),
83
- /* @__PURE__ */ h(i, {
84
- className: "ttw:px-4 ttw:py-3",
85
- children: /* @__PURE__ */ h("span", {
86
- className: "ttw:sr-only",
87
- children: U.ownerActionsColumn
88
- })
89
- })
90
- ]
91
- }) }), /* @__PURE__ */ g(n, { children: [C ? /* @__PURE__ */ g(o, {
92
- className: "ttw:hover:bg-transparent",
93
- children: [
94
- /* @__PURE__ */ h(r, {
95
- className: "ttw:px-4 ttw:whitespace-normal",
96
- children: /* @__PURE__ */ h(k, {
97
- status: f.Complete,
98
- statusText: U.statusComplete,
99
- children: v
100
- })
101
- }),
102
- /* @__PURE__ */ h(r, {
103
- className: "ttw:px-4",
104
- children: S
105
- }),
106
- /* @__PURE__ */ h(r, {
107
- className: "ttw:px-4 ttw:text-right",
108
- children: /* @__PURE__ */ h("div", {
109
- className: "ttw:flex ttw:justify-end ttw:gap-2",
110
- children: /* @__PURE__ */ g(ee, { children: [/* @__PURE__ */ g(s, { children: [/* @__PURE__ */ h(l, {
111
- asChild: !0,
112
- children: /* @__PURE__ */ h(e, {
113
- type: "button",
114
- variant: "ghost",
115
- size: "icon-sm",
116
- "aria-label": U.editPrimaryOwnerDisabled,
117
- "aria-disabled": "true",
118
- className: "ttw:cursor-not-allowed ttw:opacity-50",
119
- children: /* @__PURE__ */ h(y, { className: "ttw:size-4" })
120
- })
121
- }), /* @__PURE__ */ h(c, {
122
- className: "ttw:max-w-60",
123
- children: U.editPrimaryOwnerTooltip
124
- })] }), /* @__PURE__ */ g(s, { children: [/* @__PURE__ */ h(l, {
125
- asChild: !0,
126
- children: /* @__PURE__ */ h(e, {
127
- type: "button",
128
- variant: "ghost",
129
- size: "icon-sm",
130
- "aria-label": U.removePrimaryOwnerDisabled,
131
- "aria-disabled": "true",
132
- className: "ttw:cursor-not-allowed ttw:opacity-50",
133
- children: /* @__PURE__ */ h(x, { className: "ttw:size-4" })
134
- })
135
- }), /* @__PURE__ */ h(c, {
136
- className: "ttw:max-w-60",
137
- children: U.removePrimaryOwnerTooltip
138
- })] })] })
139
- })
140
- })
141
- ]
142
- }) : null, _.map((t, n) => {
143
- if (F === n) return /* @__PURE__ */ h(o, {
144
- "data-owner-row": n,
145
- className: "ttw:hover:bg-transparent",
146
- children: /* @__PURE__ */ h(r, {
147
- colSpan: 3,
148
- className: "ttw:p-2 ttw:whitespace-normal",
149
- children: /* @__PURE__ */ h(te, {
150
- ownerName: t.name,
151
- labels: U,
152
- isDisabled: B,
153
- onCancel: ae,
154
- onConfirm: I,
155
- testIds: H?.deleteConfirmation
156
- })
157
- })
158
- }, n);
159
- if (K?.rowIndex === n) return /* @__PURE__ */ h(o, {
160
- "data-owner-row": n,
161
- className: "ttw:hover:bg-transparent",
162
- children: /* @__PURE__ */ h(r, {
163
- colSpan: 3,
164
- className: "ttw:p-2 ttw:whitespace-normal",
165
- children: /* @__PURE__ */ h(p, {
166
- heading: U.inlineEditHeadingTemplate(t.name),
167
- submitLabel: U.saveOwnerSubmit,
168
- editor: K,
169
- isDisabled: B,
170
- labels: U,
171
- onDelete: () => P(n),
172
- testIds: H?.inlineEditor
173
- })
174
- })
175
- }, n);
176
- if (z?.rowIndex === n) return /* @__PURE__ */ h(o, {
177
- "data-owner-row": n,
178
- className: "ttw:hover:bg-transparent",
179
- children: /* @__PURE__ */ h(r, {
180
- colSpan: 3,
181
- className: "ttw:p-2 ttw:whitespace-normal",
182
- children: /* @__PURE__ */ h(ne, {
183
- ownerName: t.name,
184
- shareDisplay: t.shareDisplay,
185
- review: z,
186
- isDisabled: B,
187
- labels: U,
188
- onDelete: () => P(n),
189
- testIds: H?.reviewCard
190
- })
191
- })
192
- }, n);
193
- let i = `additional-owner-${n}-status`;
194
- return /* @__PURE__ */ g(o, {
195
- "data-owner-row": n,
196
- className: "ttw:hover:bg-transparent",
197
- children: [
198
- /* @__PURE__ */ h(r, {
199
- className: "ttw:px-4 ttw:whitespace-normal",
200
- children: /* @__PURE__ */ h(k, {
201
- status: t.status,
202
- statusId: i,
203
- statusText: O(t, U),
204
- children: t.name
205
- })
206
- }),
207
- /* @__PURE__ */ h(r, {
208
- className: "ttw:px-4",
209
- children: t.shareDisplay
210
- }),
211
- /* @__PURE__ */ h(r, {
212
- className: "ttw:px-4 ttw:text-right",
213
- children: /* @__PURE__ */ h("div", {
214
- className: "ttw:flex ttw:justify-end ttw:gap-2",
215
- children: t.status === f.Missing ? /* @__PURE__ */ h(e, {
216
- type: "button",
217
- size: "sm",
218
- "aria-describedby": i,
219
- onClick: () => M(n),
220
- disabled: G,
221
- "data-testid": H?.completeDetailsButton,
222
- "data-owner-row-action": "",
223
- "data-needs-attention": "",
224
- children: U.completeDetails
225
- }) : t.status === f.Unreviewed ? /* @__PURE__ */ h(e, {
226
- type: "button",
227
- variant: "secondary",
228
- size: "sm",
229
- "aria-describedby": i,
230
- onClick: () => N(n),
231
- disabled: G,
232
- "data-testid": H?.startReviewButton,
233
- "data-owner-row-action": "",
234
- "data-needs-attention": "",
235
- children: U.startReview
236
- }) : /* @__PURE__ */ g(ie, { children: [/* @__PURE__ */ h(e, {
237
- type: "button",
238
- variant: "ghost",
239
- size: "icon-sm",
240
- "aria-label": U.edit,
241
- onClick: () => M(n),
242
- disabled: G,
243
- "data-owner-row-action": "",
244
- children: /* @__PURE__ */ h(y, { className: "ttw:size-4" })
245
- }), /* @__PURE__ */ h(e, {
246
- type: "button",
247
- variant: "ghost",
248
- size: "icon-sm",
249
- "aria-label": U.remove,
250
- onClick: () => P(n),
251
- disabled: G,
252
- "data-owner-delete-trigger": "",
253
- children: /* @__PURE__ */ h(x, { className: "ttw:size-4" })
254
- })] })
255
- })
256
- })
257
- ]
258
- }, n);
259
- })] })] })
260
- }), W ? null : /* @__PURE__ */ g(e, {
261
- type: "button",
262
- variant: "ghost",
263
- onClick: j,
264
- disabled: A || B,
265
- "data-testid": H?.addOwnerButton,
266
- "data-owner-add-trigger": "",
267
- className: "ttw:h-auto ttw:w-fit ttw:justify-start ttw:gap-1.5 ttw:px-0 ttw:has-[>svg]:px-0 ttw:pl-4 ttw:font-normal ttw:text-primary ttw:hover:bg-transparent ttw:hover:text-primary/90",
268
- children: [/* @__PURE__ */ h(b, { className: "ttw:size-4" }), U.addOwner]
269
- })]
270
- }),
271
- w ? /* @__PURE__ */ h(T, { message: w }) : null
272
- ]
273
- });
274
- }
275
- function T({ message: e }) {
276
- return /* @__PURE__ */ g("div", {
277
- role: "alert",
278
- className: "ttw:flex ttw:items-center ttw:gap-3 ttw:rounded-xl ttw:border ttw:border-destructive/30 ttw:bg-destructive/15 ttw:px-6 ttw:py-4 ttw:text-sm ttw:text-destructive",
279
- children: [/* @__PURE__ */ h(_, {
280
- "aria-hidden": !0,
281
- className: "ttw:size-5 ttw:shrink-0"
282
- }), /* @__PURE__ */ h("span", { children: e })]
283
- });
284
- }
285
- function E({ labels: t, onAddOwner: n, disabled: r, addOwnerButtonTestId: i }) {
286
- return /* @__PURE__ */ g("div", {
287
- className: "ttw:flex ttw:flex-col ttw:items-center ttw:gap-4 ttw:rounded-xl ttw:border ttw:border-dashed ttw:border-border ttw:px-6 ttw:py-12 ttw:text-center",
288
- children: [
289
- /* @__PURE__ */ h("div", {
290
- "aria-hidden": !0,
291
- className: "ttw:flex ttw:size-16 ttw:items-center ttw:justify-center ttw:rounded-full ttw:bg-muted",
292
- children: /* @__PURE__ */ h(C, { className: "ttw:size-6 ttw:text-foreground" })
293
- }),
294
- /* @__PURE__ */ h(u, {
295
- component: "h4",
296
- variant: "h6",
297
- className: "ttw:font-medium ttw:text-foreground",
298
- children: t.emptyOwnersText
299
- }),
300
- /* @__PURE__ */ g(e, {
301
- type: "button",
302
- variant: "link",
303
- onClick: n,
304
- disabled: r,
305
- "data-testid": i,
306
- "data-owner-add-trigger": "",
307
- children: [/* @__PURE__ */ h(b, { className: "ttw:size-4" }), t.emptyOwnersAddOwner]
308
- })
309
- ]
310
- });
311
- }
312
- var D = {
313
- [f.Complete]: /* @__PURE__ */ h(v, { className: "ttw:size-4 ttw:shrink-0 ttw:text-emerald-600" }),
314
- [f.Missing]: /* @__PURE__ */ h(_, { className: "ttw:size-4 ttw:shrink-0 ttw:text-destructive" }),
315
- [f.Unreviewed]: /* @__PURE__ */ h(S, { className: "ttw:size-4 ttw:shrink-0 ttw:text-muted-foreground" })
2
+ var e = {
3
+ Complete: "complete",
4
+ Missing: "missing",
5
+ Unreviewed: "unreviewed"
316
6
  };
317
- function O(e, t) {
318
- switch (e.status) {
319
- case f.Missing: return e.error ?? t.statusMissing;
320
- case f.Unreviewed: return t.statusUnreviewed;
321
- default: return t.statusComplete;
322
- }
323
- }
324
- function k({ status: e, statusId: t, statusText: n, children: r }) {
325
- return /* @__PURE__ */ g("span", {
326
- className: "ttw:flex ttw:items-center ttw:gap-2",
327
- children: [
328
- /* @__PURE__ */ h("span", {
329
- "aria-hidden": !0,
330
- className: "ttw:flex",
331
- children: D[e]
332
- }),
333
- /* @__PURE__ */ h("span", { children: r }),
334
- /* @__PURE__ */ h("span", {
335
- id: t,
336
- className: "ttw:sr-only",
337
- children: n
338
- })
339
- ]
340
- });
341
- }
342
- export { f as AdditionalOwnerRowStatus, w as AdditionalOwnersForm };
7
+ export { e as AdditionalOwnerRowStatus };