@tesouro/embedded-components-react 0.11.116 → 0.11.119

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 (48) hide show
  1. package/dist/index.css +81 -120
  2. package/dist/index.d.ts +4 -0
  3. package/dist/lib/AcceptDisclosuresWidget.d.ts +4 -0
  4. package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/lib/AcceptDisclosuresWidget/AcceptDisclosuresWidget.js +91 -88
  5. package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/ui/dist/lib/AcceptDisclosuresWidget/AcceptDisclosuresWidget.js +41 -59
  6. package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/ui/dist/lib/AcceptDisclosuresWidget/labels.js +2 -0
  7. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/AdditionalOwnersStep.js +7 -5
  8. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/BankAccountOnboardingWidget.js +163 -160
  9. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/BusinessDetailsStep.js +18 -18
  10. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/PersonalDetailsStep.js +25 -25
  11. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/additionalOwnerDraft.js +34 -31
  12. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/applicationStatusView.js +1 -1
  13. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/fieldInput/maxBirthDate.js +3 -2
  14. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/personalDetailsPanelMapping.js +21 -18
  15. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/testIds.js +3 -0
  16. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index11.js +382 -275
  17. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index12.js +1 -1
  18. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index13.js +2 -2
  19. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index15.js +37 -42
  20. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index19.js +56 -50
  21. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index2.js +32 -69
  22. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index21.js +3 -3
  23. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index22.js +14 -25
  24. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index24.js +36 -39
  25. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index25.js +120 -116
  26. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index26.js +14 -26
  27. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index27.js +2 -2
  28. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index28.js +41 -44
  29. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index29.js +96 -115
  30. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index3.js +14 -14
  31. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index31.js +35 -57
  32. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index33.js +37 -60
  33. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index35.js +28 -42
  34. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index4.js +266 -259
  35. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index5.js +51 -55
  36. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index6.js +42 -48
  37. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index7.js +69 -70
  38. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index9.js +2 -2
  39. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  40. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/index.js +3 -2
  41. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/ConsentBlock/ConsentBlock.js +51 -0
  42. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/EmptyState/EmptyState.js +5 -3
  43. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/InlineErrorAlert/InlineErrorAlert.js +1 -1
  44. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/OnboardingShell/OnboardingShell.js +84 -87
  45. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/OnboardingShell/OnboardingShellScrollRegion.js +1 -1
  46. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/OnboardingShell/OnboardingShellStepper.js +35 -21
  47. package/dist/packages/shared-ui-shadcn/dist/index.js +29 -85
  48. package/package.json +1 -1
@@ -1,425 +1,532 @@
1
- import { Button as e, Label as t, RadioGroup as n, RadioGroupItem as r, Table as i, TableBody as a, TableCell as o, TableHead as s, TableHeader as ee, TableRow as c, Tooltip as l, TooltipContent as te, TooltipProvider as ne, TooltipTrigger as u, Typography as d } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { ADDITIONAL_OWNERS_LABELS_EN as re } from "./index9.js";
3
- import { AdditionalOwnerRowStatus as f } from "./index10.js";
4
- import { AdditionalOwnerDeleteConfirmation as ie } from "./index2.js";
5
- import { FieldError as ae, fieldErrorAria as oe } from "./index3.js";
6
- import { AdditionalOwnerInlineEditor as p } from "./index5.js";
7
- import { AdditionalOwnerReviewPanel as se } from "./index6.js";
8
- import { ApplicantOwnerInlineEditor as ce } from "./index7.js";
9
- import { useEffect as le, useId as ue, useRef as m } from "react";
10
- import { Fragment as de, jsx as h, jsxs as g } from "react/jsx-runtime";
11
- import { CircleAlertIcon as _, CircleCheckIcon as v, PencilIcon as y, PlusIcon as b, Trash2Icon as x, UserIcon as S, UsersIcon as C } from "lucide-react";
1
+ import { Badge as e, Button as t, DataTable as n, Heading as r, Label as i, RadioGroup as a, RadioGroupItem as o, Table as s, TableBody as c, TableCell as l, TableHead as u, TableHeader as d, TableRow as f, Tooltip as p, TooltipContent as m, TooltipProvider as h, TooltipTrigger as g, Typography as ee } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { EmptyState as _ } from "../../../shared/ui/dist/lib/EmptyState/EmptyState.js";
3
+ import { InlineErrorAlert as v } from "../../../shared/ui/dist/lib/InlineErrorAlert/InlineErrorAlert.js";
4
+ import "../../../shared/ui/dist/index.js";
5
+ import { ADDITIONAL_OWNERS_LABELS_EN as te } from "./index9.js";
6
+ import { AdditionalOwnerRowStatus as y } from "./index10.js";
7
+ import { AdditionalOwnerDeleteConfirmation as ne } from "./index2.js";
8
+ import { FieldError as re, fieldErrorAria as ie } from "./index3.js";
9
+ import { AdditionalOwnerInlineEditor as b } from "./index5.js";
10
+ import { AdditionalOwnerReviewPanel as ae } from "./index6.js";
11
+ import { ApplicantOwnerInlineEditor as oe } from "./index7.js";
12
+ import { useEffect as se, useId as ce, useRef as x } from "react";
13
+ import { Fragment as S, jsx as C, jsxs as w } from "react/jsx-runtime";
14
+ import { Trash2Icon as T, UsersIcon as le } from "lucide-react";
12
15
  // ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index11.js
13
- function w({ ownerRows: _, primaryOwnerName: v, primaryOwnerShareDisplay: S, businessName: C, applicantOwnsAnswer: w, onApplicantOwnsAnswerChange: E, applicantQuestionError: O, applicantEditor: k, onEditApplicant: A, onEditPersonalDetails: me, totalOwnershipError: j, reviewError: M = null, addOwnerDisabled: N, onAddOwner: P, onEditOwner: F, onStartReview: he, onDeleteOwnerRequest: I, deletingOwnerIndex: L, onDeleteOwnerConfirm: ge, onDeleteOwnerCancel: _e, editingOverlay: R, reviewingOwner: z = null, isSubmitting: B, labels: ve, testIds: V }) {
14
- let H = {
15
- ...re,
16
- ...ve
17
- }, U = k !== null || R !== null || L !== null || z !== null, W = B || U, G = R !== null && R.rowIndex !== null ? R : null, K = R !== null && R.rowIndex === null ? R : null, q = w === "yes", ye = w !== "" || _.length > 0, be = !q && _.length === 0, J = ue(), Y = m(null), X = m(null), xe = () => {
18
- X.current = L, _e();
19
- }, Z = k === null ? G?.rowIndex ?? z?.rowIndex : "applicant", Q = L === null ? k === null ? K === null ? G === null ? z === null ? null : `review:${z.rowIndex}` : `edit:${G.rowIndex}` : "add" : "applicant" : null, $ = m({
20
- key: Q,
21
- index: Z
16
+ function E({ ownerRows: e, primaryOwnerName: n, primaryOwnerShareDisplay: p, businessName: m, applicantOwnsAnswer: h, onApplicantOwnsAnswerChange: g, applicantQuestionError: _, applicantEditor: v, onEditApplicant: T, onEditPersonalDetails: le, totalOwnershipError: E, reviewError: M = null, addOwnerDisabled: N, onAddOwner: P, onEditOwner: F, onStartReview: I, onDeleteOwnerRequest: L, deletingOwnerIndex: R, onDeleteOwnerConfirm: fe, onDeleteOwnerCancel: pe, editingOverlay: z, reviewingOwner: B = null, isSubmitting: V, labels: me, testIds: H }) {
17
+ let U = {
18
+ ...te,
19
+ ...me
20
+ }, W = v !== null || z !== null || R !== null || B !== null, G = V || W, K = z !== null && z.rowIndex !== null ? z : null, q = z !== null && z.rowIndex === null ? z : null, J = h === "yes", he = h !== "" || e.length > 0, ge = !J && e.length === 0, Y = ce(), X = x(null), Z = x(null), _e = () => {
21
+ Z.current = R, pe();
22
+ }, Q = v === null ? K?.rowIndex ?? B?.rowIndex : "applicant", $ = R === null ? v === null ? q === null ? K === null ? B === null ? null : `review:${B.rowIndex}` : `edit:${K.rowIndex}` : "add" : "applicant" : null, ve = x({
23
+ key: $,
24
+ index: Q
22
25
  });
23
- le(() => {
24
- let e = $.current;
25
- $.current = {
26
- key: Q,
27
- index: Z
26
+ se(() => {
27
+ let e = ve.current;
28
+ ve.current = {
29
+ key: $,
30
+ index: Q
28
31
  };
29
- let t = (e, t) => Y.current?.querySelector(`[data-owner-row="${e}"] ${t}`)?.focus(), n = X.current;
30
- if (n !== null && L === null) X.current = null, t(n, "[data-owner-delete-trigger]");
31
- else if (L === null && e.key !== Q) {
32
- if (Q === "add") Y.current?.querySelector("[data-owner-add-editor] [data-owner-panel-heading]")?.focus();
33
- else if (Q !== null && Z != null) t(Z, "[data-owner-panel-heading]");
34
- else if (e.key === "add") Y.current?.querySelector("[data-owner-add-trigger]")?.focus();
32
+ let t = (e) => {
33
+ let t = Array.from(X.current?.querySelectorAll(e) ?? []);
34
+ return t.find((e) => e.getClientRects().length > 0) ?? t.at(-1);
35
+ }, n = (e, n) => t(`[data-owner-row="${e}"] ${n}`)?.focus(), r = Z.current;
36
+ if (r !== null && R === null) Z.current = null, n(r, "[data-owner-delete-trigger]");
37
+ else if (R === null && e.key !== $) {
38
+ if ($ === "add") X.current?.querySelector("[data-owner-add-editor] [data-owner-panel-heading]")?.focus();
39
+ else if ($ !== null && Q != null) n(Q, "[data-owner-panel-heading]");
40
+ else if (e.key === "add") X.current?.querySelector("[data-owner-add-trigger] button, button[data-owner-add-trigger]")?.focus();
35
41
  else if (e.index != null) {
36
- let t = Y.current?.querySelector(`[data-owner-row="${e.index}"] [data-owner-row-action]`);
37
- if (t) t.focus();
38
- else if (e.index === "applicant" && !Y.current?.matches(":focus-within")) {
39
- let e = Y.current?.querySelector("[data-applicant-question]");
42
+ let n = t(`[data-owner-row="${e.index}"] [data-owner-row-action]`);
43
+ if (n) n.focus();
44
+ else if (e.index === "applicant" && !X.current?.matches(":focus-within")) {
45
+ let e = X.current?.querySelector("[data-applicant-question]");
40
46
  (e?.querySelector("[role=\"radio\"][aria-checked=\"true\"]") ?? e?.querySelector("[role=\"radio\"]"))?.focus();
41
47
  }
42
48
  }
43
49
  }
44
50
  }, [
51
+ $,
45
52
  Q,
46
- Z,
47
- L
53
+ R
48
54
  ]);
49
- let Se = K ? /* @__PURE__ */ h("div", {
55
+ let ye = q ? /* @__PURE__ */ C("div", {
50
56
  "data-owner-add-editor": "",
51
- children: /* @__PURE__ */ h(p, {
52
- heading: H.formHeadingAdd,
53
- submitLabel: H.addOwnerSubmit,
54
- editor: K,
55
- isDisabled: B,
56
- labels: H,
57
- testIds: V?.addOwnerEditor
57
+ children: /* @__PURE__ */ C(b, {
58
+ heading: U.formHeadingAdd,
59
+ submitLabel: U.addOwnerSubmit,
60
+ editor: q,
61
+ isDisabled: V,
62
+ labels: U,
63
+ testIds: H?.addOwnerEditor
58
64
  })
59
65
  }) : null;
60
- return /* @__PURE__ */ g("div", {
61
- ref: Y,
62
- className: "ttw:relative ttw:flex ttw:flex-col ttw:gap-6",
66
+ return /* @__PURE__ */ w("div", {
67
+ ref: X,
68
+ className: "ttw:relative ttw:flex ttw:max-w-[720px] ttw:flex-col ttw:gap-6",
63
69
  children: [
64
- /* @__PURE__ */ g("div", {
70
+ /* @__PURE__ */ w("div", {
65
71
  className: "ttw:flex ttw:flex-col ttw:gap-1",
66
- children: [/* @__PURE__ */ h(d, {
67
- component: "h3",
68
- variant: "h6",
69
- className: "ttw:font-semibold ttw:text-foreground",
70
- children: H.heading
71
- }), /* @__PURE__ */ h(d, {
72
+ children: [/* @__PURE__ */ C(r, {
73
+ variant: "section",
74
+ level: 3,
75
+ children: U.heading
76
+ }), /* @__PURE__ */ C(ee, {
72
77
  variant: "body2",
73
78
  className: "ttw:text-muted-foreground",
74
- children: H.subheading
79
+ children: U.subheading
75
80
  })]
76
81
  }),
77
- /* @__PURE__ */ g("fieldset", {
78
- "data-testid": V?.applicantQuestion,
82
+ /* @__PURE__ */ w("fieldset", {
83
+ "data-testid": H?.applicantQuestion,
79
84
  "data-applicant-question": "",
80
85
  children: [
81
- /* @__PURE__ */ g("legend", {
82
- id: J,
86
+ /* @__PURE__ */ w("legend", {
87
+ id: Y,
83
88
  className: "ttw:mb-2 ttw:text-sm ttw:font-medium",
84
- children: [H.applicantOwnsQuestionTemplate(C), H.requiredFieldMarker]
89
+ children: [U.applicantOwnsQuestionTemplate(m), U.requiredFieldMarker]
85
90
  }),
86
- /* @__PURE__ */ g(n, {
87
- value: w,
88
- onValueChange: (e) => E(e === "yes" ? "yes" : "no"),
91
+ /* @__PURE__ */ w(a, {
92
+ value: h,
93
+ onValueChange: (e) => g(e === "yes" ? "yes" : "no"),
89
94
  className: "ttw:flex ttw:gap-4",
90
- disabled: B || R !== null || z !== null || L !== null,
91
- "aria-labelledby": J,
92
- "aria-describedby": oe(J, O)["aria-describedby"],
93
- children: [/* @__PURE__ */ g("div", {
95
+ disabled: V || z !== null || B !== null || R !== null,
96
+ "aria-labelledby": Y,
97
+ "aria-describedby": ie(Y, _)["aria-describedby"],
98
+ children: [/* @__PURE__ */ w("div", {
94
99
  className: "ttw:flex ttw:cursor-pointer ttw:items-center ttw:gap-2",
95
- children: [/* @__PURE__ */ h(r, {
100
+ children: [/* @__PURE__ */ C(o, {
96
101
  value: "yes",
97
- id: `${J}-yes`,
98
- "aria-invalid": O ? !0 : void 0,
99
- "data-needs-attention": O ? "" : void 0,
102
+ id: `${Y}-yes`,
103
+ "aria-invalid": _ ? !0 : void 0,
104
+ "data-needs-attention": _ ? "" : void 0,
100
105
  className: "ttw:cursor-pointer"
101
- }), /* @__PURE__ */ h(t, {
102
- htmlFor: `${J}-yes`,
106
+ }), /* @__PURE__ */ C(i, {
107
+ htmlFor: `${Y}-yes`,
103
108
  className: "ttw:cursor-pointer",
104
- children: H.applicantOwnsYes
109
+ children: U.applicantOwnsYes
105
110
  })]
106
- }), /* @__PURE__ */ g("div", {
111
+ }), /* @__PURE__ */ w("div", {
107
112
  className: "ttw:flex ttw:cursor-pointer ttw:items-center ttw:gap-2",
108
- children: [/* @__PURE__ */ h(r, {
113
+ children: [/* @__PURE__ */ C(o, {
109
114
  value: "no",
110
- id: `${J}-no`,
111
- "aria-invalid": O ? !0 : void 0,
115
+ id: `${Y}-no`,
116
+ "aria-invalid": _ ? !0 : void 0,
112
117
  className: "ttw:cursor-pointer"
113
- }), /* @__PURE__ */ h(t, {
114
- htmlFor: `${J}-no`,
118
+ }), /* @__PURE__ */ C(i, {
119
+ htmlFor: `${Y}-no`,
115
120
  className: "ttw:cursor-pointer",
116
- children: H.applicantOwnsNo
121
+ children: U.applicantOwnsNo
117
122
  })]
118
123
  })]
119
124
  }),
120
- /* @__PURE__ */ h(ae, {
121
- fieldId: J,
122
- error: O
125
+ /* @__PURE__ */ C(re, {
126
+ fieldId: Y,
127
+ error: _
123
128
  })
124
129
  ]
125
130
  }),
126
- M ? /* @__PURE__ */ h(T, { message: M }) : null,
127
- ye ? K ? Se : be ? /* @__PURE__ */ h(fe, {
128
- labels: H,
129
- businessName: C,
131
+ M ? /* @__PURE__ */ C(k, { message: M }) : null,
132
+ he ? q ? ye : ge ? /* @__PURE__ */ C(de, {
133
+ labels: U,
134
+ businessName: m,
130
135
  onAddOwner: P,
131
- disabled: N || B || U,
132
- addOwnerButtonTestId: V?.addOwnerButton
133
- }) : /* @__PURE__ */ g("div", {
136
+ disabled: N || V || W,
137
+ addOwnerButtonTestId: H?.addOwnerButton
138
+ }) : /* @__PURE__ */ w("div", {
134
139
  className: "ttw:flex ttw:flex-col ttw:gap-2",
135
- children: [/* @__PURE__ */ h("div", {
140
+ children: [W ? /* @__PURE__ */ C("div", {
136
141
  className: "ttw:border-b ttw:border-border",
137
- children: /* @__PURE__ */ g(i, { children: [/* @__PURE__ */ h(ee, { children: /* @__PURE__ */ g(c, {
142
+ children: /* @__PURE__ */ w(s, { children: [/* @__PURE__ */ C(d, { children: /* @__PURE__ */ w(f, {
138
143
  className: "ttw:hover:bg-transparent",
139
144
  children: [
140
- /* @__PURE__ */ h(s, {
145
+ /* @__PURE__ */ C(u, {
141
146
  className: "ttw:px-4 ttw:py-3",
142
- children: H.ownerNameColumn
147
+ children: U.ownerNameColumn
143
148
  }),
144
- /* @__PURE__ */ h(s, {
149
+ /* @__PURE__ */ C(u, {
145
150
  className: "ttw:px-4 ttw:py-3",
146
- children: H.ownerShareColumn
151
+ children: U.ownerShareColumn
147
152
  }),
148
- /* @__PURE__ */ h(s, {
153
+ /* @__PURE__ */ C(u, {
149
154
  className: "ttw:px-4 ttw:py-3",
150
- children: /* @__PURE__ */ h("span", {
155
+ children: /* @__PURE__ */ C("span", {
151
156
  className: "ttw:sr-only",
152
- children: H.ownerActionsColumn
157
+ children: U.ownerActionsColumn
153
158
  })
154
159
  })
155
160
  ]
156
- }) }), /* @__PURE__ */ g(a, { children: [q && k !== null ? /* @__PURE__ */ h(c, {
161
+ }) }), /* @__PURE__ */ w(c, { children: [J && v !== null ? /* @__PURE__ */ C(f, {
157
162
  "data-owner-row": "applicant",
158
163
  className: "ttw:hover:bg-transparent",
159
- children: /* @__PURE__ */ h(o, {
164
+ children: /* @__PURE__ */ C(l, {
160
165
  colSpan: 3,
161
166
  className: "ttw:p-2 ttw:whitespace-normal",
162
- children: /* @__PURE__ */ h(ce, {
163
- applicantName: v,
164
- editor: k,
165
- onEditPersonalDetails: me,
166
- isDisabled: B,
167
- labels: H,
168
- testIds: V?.applicantEditor
167
+ children: /* @__PURE__ */ C(oe, {
168
+ applicantName: n,
169
+ editor: v,
170
+ onEditPersonalDetails: le,
171
+ isDisabled: V,
172
+ labels: U,
173
+ testIds: H?.applicantEditor
169
174
  })
170
175
  })
171
- }) : q ? /* @__PURE__ */ g(c, {
176
+ }) : J ? /* @__PURE__ */ w(f, {
172
177
  "data-owner-row": "applicant",
173
178
  className: "ttw:hover:bg-transparent",
174
179
  children: [
175
- /* @__PURE__ */ h(o, {
180
+ /* @__PURE__ */ C(l, {
176
181
  className: "ttw:px-4 ttw:whitespace-normal",
177
- children: /* @__PURE__ */ h(D, {
178
- status: f.Complete,
179
- statusText: H.statusComplete,
180
- children: v
182
+ children: /* @__PURE__ */ C(j, {
183
+ status: y.Complete,
184
+ statusText: U.statusComplete,
185
+ children: n
181
186
  })
182
187
  }),
183
- /* @__PURE__ */ h(o, {
188
+ /* @__PURE__ */ C(l, {
184
189
  className: "ttw:px-4",
185
- children: S
190
+ children: p
186
191
  }),
187
- /* @__PURE__ */ h(o, {
192
+ /* @__PURE__ */ C(l, {
188
193
  className: "ttw:px-4 ttw:text-right",
189
- children: /* @__PURE__ */ g("div", {
194
+ children: /* @__PURE__ */ w("div", {
190
195
  className: "ttw:flex ttw:justify-end ttw:gap-2",
191
- children: [/* @__PURE__ */ h(e, {
196
+ children: [/* @__PURE__ */ C(O, { labels: U }), /* @__PURE__ */ C(t, {
192
197
  type: "button",
193
- variant: "ghost",
194
- size: "icon-sm",
195
- "aria-label": H.editApplicantOwnership,
196
- onClick: A,
197
- disabled: W,
198
+ variant: "secondary",
199
+ size: "sm",
200
+ "aria-label": U.editApplicantOwnership,
201
+ onClick: T,
202
+ disabled: G,
198
203
  "data-owner-row-action": "",
199
- children: /* @__PURE__ */ h(y, { className: "ttw:size-4" })
200
- }), /* @__PURE__ */ h(ne, { children: /* @__PURE__ */ g(l, { children: [/* @__PURE__ */ h(u, {
201
- asChild: !0,
202
- children: /* @__PURE__ */ h(e, {
203
- type: "button",
204
- variant: "ghost",
205
- size: "icon-sm",
206
- "aria-label": H.removePrimaryOwnerDisabled,
207
- "aria-disabled": "true",
208
- className: "ttw:cursor-not-allowed ttw:opacity-50",
209
- children: /* @__PURE__ */ h(x, { className: "ttw:size-4" })
210
- })
211
- }), /* @__PURE__ */ h(te, {
212
- className: "ttw:max-w-60",
213
- children: H.removePrimaryOwnerTooltip
214
- })] }) })]
204
+ children: U.edit
205
+ })]
215
206
  })
216
207
  })
217
208
  ]
218
- }) : null, _.map((t, n) => {
219
- if (L === n) return /* @__PURE__ */ h(c, {
209
+ }) : null, e.map((e, n) => {
210
+ if (R === n) return /* @__PURE__ */ C(f, {
220
211
  "data-owner-row": n,
221
212
  className: "ttw:hover:bg-transparent",
222
- children: /* @__PURE__ */ h(o, {
213
+ children: /* @__PURE__ */ C(l, {
223
214
  colSpan: 3,
224
215
  className: "ttw:p-2 ttw:whitespace-normal",
225
- children: /* @__PURE__ */ h(ie, {
226
- ownerName: t.name,
227
- labels: H,
228
- isDisabled: B,
229
- onCancel: xe,
230
- onConfirm: ge,
231
- testIds: V?.deleteConfirmation
216
+ children: /* @__PURE__ */ C(ne, {
217
+ ownerName: e.name,
218
+ labels: U,
219
+ isDisabled: V,
220
+ onCancel: _e,
221
+ onConfirm: fe,
222
+ testIds: H?.deleteConfirmation
232
223
  })
233
224
  })
234
225
  }, n);
235
- if (G?.rowIndex === n) return /* @__PURE__ */ h(c, {
226
+ if (K?.rowIndex === n) return /* @__PURE__ */ C(f, {
236
227
  "data-owner-row": n,
237
228
  className: "ttw:hover:bg-transparent",
238
- children: /* @__PURE__ */ h(o, {
229
+ children: /* @__PURE__ */ C(l, {
239
230
  colSpan: 3,
240
231
  className: "ttw:p-2 ttw:whitespace-normal",
241
- children: /* @__PURE__ */ h(p, {
242
- heading: H.inlineEditHeadingTemplate(t.name),
243
- submitLabel: H.saveOwnerSubmit,
244
- editor: G,
245
- isDisabled: B,
246
- labels: H,
247
- onDelete: () => I(n),
248
- testIds: V?.inlineEditor
232
+ children: /* @__PURE__ */ C(b, {
233
+ heading: U.inlineEditHeadingTemplate(e.name),
234
+ submitLabel: U.saveOwnerSubmit,
235
+ editor: K,
236
+ isDisabled: V,
237
+ labels: U,
238
+ onDelete: () => L(n),
239
+ testIds: H?.inlineEditor
249
240
  })
250
241
  })
251
242
  }, n);
252
- if (z?.rowIndex === n) return /* @__PURE__ */ h(c, {
243
+ if (B?.rowIndex === n) return /* @__PURE__ */ C(f, {
253
244
  "data-owner-row": n,
254
245
  className: "ttw:hover:bg-transparent",
255
- children: /* @__PURE__ */ h(o, {
246
+ children: /* @__PURE__ */ C(l, {
256
247
  colSpan: 3,
257
248
  className: "ttw:p-2 ttw:whitespace-normal",
258
- children: /* @__PURE__ */ h(se, {
259
- ownerName: t.name,
260
- shareDisplay: t.shareDisplay,
261
- review: z,
262
- isDisabled: B,
263
- labels: H,
264
- onDelete: () => I(n),
265
- testIds: V?.reviewCard
249
+ children: /* @__PURE__ */ C(ae, {
250
+ ownerName: e.name,
251
+ shareDisplay: e.shareDisplay,
252
+ review: B,
253
+ isDisabled: V,
254
+ labels: U,
255
+ onDelete: () => L(n),
256
+ testIds: H?.reviewCard
266
257
  })
267
258
  })
268
259
  }, n);
269
260
  let r = `additional-owner-${n}-status`;
270
- return /* @__PURE__ */ g(c, {
261
+ return /* @__PURE__ */ w(f, {
271
262
  "data-owner-row": n,
272
263
  className: "ttw:hover:bg-transparent",
273
264
  children: [
274
- /* @__PURE__ */ h(o, {
265
+ /* @__PURE__ */ C(l, {
275
266
  className: "ttw:px-4 ttw:whitespace-normal",
276
- children: /* @__PURE__ */ h(D, {
277
- status: t.status,
267
+ children: /* @__PURE__ */ C(j, {
268
+ status: e.status,
278
269
  statusId: r,
279
- statusText: pe(t, H),
280
- children: t.name
270
+ statusText: A(e, U),
271
+ children: e.name
281
272
  })
282
273
  }),
283
- /* @__PURE__ */ h(o, {
274
+ /* @__PURE__ */ C(l, {
284
275
  className: "ttw:px-4",
285
- children: t.shareDisplay
276
+ children: e.shareDisplay
286
277
  }),
287
- /* @__PURE__ */ h(o, {
278
+ /* @__PURE__ */ C(l, {
288
279
  className: "ttw:px-4 ttw:text-right",
289
- children: /* @__PURE__ */ h("div", {
280
+ children: /* @__PURE__ */ C("div", {
290
281
  className: "ttw:flex ttw:justify-end ttw:gap-2",
291
- children: t.status === f.Missing ? /* @__PURE__ */ h(e, {
282
+ children: e.status === y.Missing ? /* @__PURE__ */ C(t, {
292
283
  type: "button",
293
284
  size: "sm",
294
285
  "aria-describedby": r,
295
286
  onClick: () => F(n),
296
- disabled: W,
297
- "data-testid": V?.completeDetailsButton,
287
+ disabled: G,
288
+ "data-testid": H?.completeDetailsButton,
298
289
  "data-owner-row-action": "",
299
290
  "data-needs-attention": "",
300
- children: H.completeDetails
301
- }) : t.status === f.Unreviewed ? /* @__PURE__ */ h(e, {
291
+ children: U.completeDetails
292
+ }) : e.status === y.Unreviewed ? /* @__PURE__ */ C(t, {
302
293
  type: "button",
303
294
  variant: "secondary",
304
295
  size: "sm",
305
296
  "aria-describedby": r,
306
- onClick: () => he(n),
307
- disabled: W,
308
- "data-testid": V?.startReviewButton,
297
+ onClick: () => I(n),
298
+ disabled: G,
299
+ "data-testid": H?.startReviewButton,
309
300
  "data-owner-row-action": "",
310
301
  "data-needs-attention": "",
311
- children: H.startReview
312
- }) : /* @__PURE__ */ g(de, { children: [/* @__PURE__ */ h(e, {
302
+ children: U.startReview
303
+ }) : /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C(D, {
304
+ labels: U,
305
+ disabled: G,
306
+ onClick: () => L(n)
307
+ }), /* @__PURE__ */ C(t, {
313
308
  type: "button",
314
- variant: "ghost",
315
- size: "icon-sm",
316
- "aria-label": H.edit,
309
+ variant: "secondary",
310
+ size: "sm",
317
311
  onClick: () => F(n),
318
- disabled: W,
312
+ disabled: G,
319
313
  "data-owner-row-action": "",
320
- children: /* @__PURE__ */ h(y, { className: "ttw:size-4" })
321
- }), /* @__PURE__ */ h(e, {
322
- type: "button",
323
- variant: "ghost",
324
- size: "icon-sm",
325
- "aria-label": H.remove,
326
- onClick: () => I(n),
327
- disabled: W,
328
- "data-owner-delete-trigger": "",
329
- children: /* @__PURE__ */ h(x, { className: "ttw:size-4" })
314
+ children: U.edit
330
315
  })] })
331
316
  })
332
317
  })
333
318
  ]
334
319
  }, n);
335
320
  })] })] })
336
- }), U ? null : /* @__PURE__ */ g(e, {
321
+ }) : /* @__PURE__ */ C(ue, {
322
+ ownerRows: e,
323
+ showPrimaryOwner: J,
324
+ primaryOwnerName: n,
325
+ primaryOwnerShareDisplay: p,
326
+ labels: U,
327
+ disabled: !!G,
328
+ onEditApplicant: T,
329
+ onEditOwner: F,
330
+ onStartReview: I,
331
+ onDeleteOwnerRequest: L,
332
+ testIds: H
333
+ }), W ? null : /* @__PURE__ */ C(t, {
337
334
  type: "button",
338
335
  variant: "ghost",
339
336
  onClick: P,
340
- disabled: N || B,
341
- "data-testid": V?.addOwnerButton,
337
+ disabled: N || V,
338
+ "data-testid": H?.addOwnerButton,
342
339
  "data-owner-add-trigger": "",
343
340
  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",
344
- children: [/* @__PURE__ */ h(b, { className: "ttw:size-4" }), H.addOwner]
341
+ children: U.addOwner
345
342
  })]
346
343
  }) : null,
347
- j ? /* @__PURE__ */ h(T, { message: j }) : null
344
+ E ? /* @__PURE__ */ C(k, { message: E }) : null
348
345
  ]
349
346
  });
350
347
  }
351
- function T({ message: e }) {
352
- return /* @__PURE__ */ g("div", {
353
- role: "alert",
354
- 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",
355
- children: [/* @__PURE__ */ h(_, {
356
- "aria-hidden": !0,
357
- className: "ttw:size-5 ttw:shrink-0"
358
- }), /* @__PURE__ */ h("span", { children: e })]
359
- });
360
- }
361
- function fe({ labels: t, businessName: n, onAddOwner: r, disabled: i, addOwnerButtonTestId: a }) {
362
- return /* @__PURE__ */ g("div", {
363
- 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",
364
- children: [
365
- /* @__PURE__ */ h("div", {
366
- "aria-hidden": !0,
367
- className: "ttw:flex ttw:size-16 ttw:items-center ttw:justify-center ttw:rounded-full ttw:bg-muted",
368
- children: /* @__PURE__ */ h(C, { className: "ttw:size-6 ttw:text-foreground" })
348
+ function ue({ ownerRows: e, showPrimaryOwner: r, primaryOwnerName: i, primaryOwnerShareDisplay: a, labels: o, disabled: s, onEditApplicant: c, onEditOwner: l, onStartReview: u, onDeleteOwnerRequest: d, testIds: f }) {
349
+ let p = [...r ? [{
350
+ index: "applicant",
351
+ name: i,
352
+ shareDisplay: a,
353
+ status: y.Complete
354
+ }] : [], ...e.map((e, t) => ({
355
+ ...e,
356
+ index: t
357
+ }))], m = (e, t) => /* @__PURE__ */ C(j, {
358
+ status: e.status,
359
+ statusId: e.index === "applicant" ? void 0 : `additional-owner-${e.index}-${t}-status`,
360
+ statusText: e.index === "applicant" ? o.statusComplete : A(e, o),
361
+ children: e.name
362
+ }), h = (e, n) => {
363
+ if (e.index === "applicant") return /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C(O, { labels: o }), /* @__PURE__ */ C(t, {
364
+ type: "button",
365
+ variant: "secondary",
366
+ size: "sm",
367
+ "aria-label": o.editApplicantOwnership,
368
+ onClick: c,
369
+ disabled: s,
370
+ "data-owner-row-action": "",
371
+ children: o.edit
372
+ })] });
373
+ let r = e.index, i = `additional-owner-${r}-${n}-status`;
374
+ return e.status === y.Missing ? /* @__PURE__ */ C(t, {
375
+ type: "button",
376
+ size: "sm",
377
+ "aria-describedby": i,
378
+ onClick: () => l(r),
379
+ disabled: s,
380
+ "data-testid": f?.completeDetailsButton,
381
+ "data-owner-row-action": "",
382
+ "data-needs-attention": "",
383
+ children: o.completeDetails
384
+ }) : e.status === y.Unreviewed ? /* @__PURE__ */ C(t, {
385
+ type: "button",
386
+ variant: "secondary",
387
+ size: "sm",
388
+ "aria-describedby": i,
389
+ onClick: () => u(r),
390
+ disabled: s,
391
+ "data-testid": f?.startReviewButton,
392
+ "data-owner-row-action": "",
393
+ "data-needs-attention": "",
394
+ children: o.startReview
395
+ }) : /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C(D, {
396
+ labels: o,
397
+ disabled: s,
398
+ onClick: () => d(r)
399
+ }), /* @__PURE__ */ C(t, {
400
+ type: "button",
401
+ variant: "secondary",
402
+ size: "sm",
403
+ onClick: () => l(r),
404
+ disabled: s,
405
+ "data-owner-row-action": "",
406
+ children: o.edit
407
+ })] });
408
+ }, g = [
409
+ {
410
+ id: "name",
411
+ header: o.ownerNameColumn,
412
+ cell: ({ row: e }) => m(e.original, "table")
413
+ },
414
+ {
415
+ id: "share",
416
+ header: o.ownerShareColumn,
417
+ cell: ({ row: e }) => e.original.shareDisplay,
418
+ meta: { fitContent: !0 }
419
+ },
420
+ {
421
+ id: "actions",
422
+ header: () => /* @__PURE__ */ C("span", {
423
+ className: "ttw:sr-only",
424
+ children: o.ownerActionsColumn
369
425
  }),
370
- /* @__PURE__ */ g("div", {
371
- className: "ttw:flex ttw:max-w-md ttw:flex-col ttw:gap-1",
372
- children: [/* @__PURE__ */ h(d, {
373
- component: "h4",
374
- variant: "h6",
375
- className: "ttw:font-medium ttw:text-foreground",
376
- children: t.emptyOwnersText
377
- }), /* @__PURE__ */ h(d, {
378
- variant: "body2",
379
- className: "ttw:text-muted-foreground",
380
- children: t.emptyOwnersBodyTemplate(n)
381
- })]
426
+ cell: ({ row: e }) => /* @__PURE__ */ C("div", {
427
+ "data-owner-row": e.original.index,
428
+ className: "ttw:flex ttw:justify-end ttw:gap-2",
429
+ children: h(e.original, "table")
382
430
  }),
383
- /* @__PURE__ */ g(e, {
384
- type: "button",
385
- variant: "link",
386
- onClick: r,
387
- disabled: i,
388
- "data-testid": a,
389
- "data-owner-add-trigger": "",
390
- children: [/* @__PURE__ */ h(b, { className: "ttw:size-4" }), t.emptyOwnersAddOwner]
391
- })
392
- ]
431
+ meta: { fitContent: !0 }
432
+ }
433
+ ];
434
+ return /* @__PURE__ */ C(n, {
435
+ columns: g,
436
+ data: p,
437
+ sorting: [],
438
+ onSortingChange: () => void 0,
439
+ pageSize: p.length,
440
+ onPageSizeChange: () => void 0,
441
+ onNextPage: () => void 0,
442
+ onPrevPage: () => void 0,
443
+ pageSizeOptions: [],
444
+ showPagination: !1,
445
+ renderCard: (e) => /* @__PURE__ */ w("div", {
446
+ "data-owner-row": e.index,
447
+ className: "ttw:flex ttw:flex-col ttw:gap-2",
448
+ children: [
449
+ m(e, "card"),
450
+ /* @__PURE__ */ w("div", {
451
+ className: "ttw:text-sm",
452
+ children: [
453
+ o.ownerShareColumn,
454
+ ": ",
455
+ e.shareDisplay
456
+ ]
457
+ }),
458
+ /* @__PURE__ */ C("div", {
459
+ className: "ttw:flex ttw:justify-end ttw:gap-2",
460
+ children: h(e, "card")
461
+ })
462
+ ]
463
+ })
464
+ });
465
+ }
466
+ function D({ labels: e, disabled: n, onClick: r }) {
467
+ return /* @__PURE__ */ C(h, { children: /* @__PURE__ */ w(p, { children: [/* @__PURE__ */ C(g, {
468
+ asChild: !0,
469
+ children: /* @__PURE__ */ C(t, {
470
+ type: "button",
471
+ variant: "ghost",
472
+ size: "icon-sm",
473
+ "aria-label": e.remove,
474
+ onClick: r,
475
+ disabled: n,
476
+ "data-owner-delete-trigger": "",
477
+ children: /* @__PURE__ */ C(T, {})
478
+ })
479
+ }), /* @__PURE__ */ C(m, { children: e.remove })] }) });
480
+ }
481
+ function O({ labels: e }) {
482
+ return /* @__PURE__ */ C(h, { children: /* @__PURE__ */ w(p, { children: [/* @__PURE__ */ C(g, {
483
+ asChild: !0,
484
+ children: /* @__PURE__ */ C(t, {
485
+ type: "button",
486
+ variant: "ghost",
487
+ size: "icon-sm",
488
+ "aria-label": e.removePrimaryOwnerDisabled,
489
+ "aria-disabled": "true",
490
+ className: "ttw:cursor-not-allowed ttw:opacity-50",
491
+ children: /* @__PURE__ */ C(T, {})
492
+ })
493
+ }), /* @__PURE__ */ C(m, {
494
+ className: "ttw:max-w-60",
495
+ children: e.removePrimaryOwnerTooltip
496
+ })] }) });
497
+ }
498
+ function k({ message: e }) {
499
+ return /* @__PURE__ */ C(v, { children: e });
500
+ }
501
+ function de({ labels: e, businessName: t, onAddOwner: n, disabled: r, addOwnerButtonTestId: i }) {
502
+ return /* @__PURE__ */ C("div", {
503
+ "data-owner-add-trigger": "",
504
+ children: /* @__PURE__ */ C(_, {
505
+ icon: /* @__PURE__ */ C(le, {}),
506
+ title: e.emptyOwnersText,
507
+ description: e.emptyOwnersBodyTemplate(t),
508
+ actionLabel: e.emptyOwnersAddOwner,
509
+ onAction: n,
510
+ actionDisabled: r,
511
+ actionTestId: i
512
+ })
393
513
  });
394
514
  }
395
- var E = {
396
- [f.Complete]: /* @__PURE__ */ h(v, { className: "ttw:size-4 ttw:shrink-0 ttw:text-emerald-600" }),
397
- [f.Missing]: /* @__PURE__ */ h(_, { className: "ttw:size-4 ttw:shrink-0 ttw:text-destructive" }),
398
- [f.Unreviewed]: /* @__PURE__ */ h(S, { className: "ttw:size-4 ttw:shrink-0 ttw:text-muted-foreground" })
399
- };
400
- function pe(e, t) {
515
+ function A(e, t) {
401
516
  switch (e.status) {
402
- case f.Missing: return e.error ?? t.statusMissing;
403
- case f.Unreviewed: return t.statusUnreviewed;
517
+ case y.Missing: return e.error ?? t.statusMissing;
518
+ case y.Unreviewed: return t.statusUnreviewed;
404
519
  default: return t.statusComplete;
405
520
  }
406
521
  }
407
- function D({ status: e, statusId: t, statusText: n, children: r }) {
408
- return /* @__PURE__ */ g("span", {
522
+ function j({ status: t, statusId: n, statusText: r, children: i }) {
523
+ return /* @__PURE__ */ w("span", {
409
524
  className: "ttw:flex ttw:items-center ttw:gap-2",
410
- children: [
411
- /* @__PURE__ */ h("span", {
412
- "aria-hidden": !0,
413
- className: "ttw:flex",
414
- children: E[e]
415
- }),
416
- /* @__PURE__ */ h("span", { children: r }),
417
- /* @__PURE__ */ h("span", {
418
- id: t,
419
- className: "ttw:sr-only",
420
- children: n
421
- })
422
- ]
525
+ children: [/* @__PURE__ */ C("span", { children: i }), /* @__PURE__ */ C(e, {
526
+ id: n,
527
+ tone: t === y.Complete ? "success" : t === y.Missing ? "destructive" : "neutral",
528
+ children: r
529
+ })]
423
530
  });
424
531
  }
425
- export { f as AdditionalOwnerRowStatus, w as AdditionalOwnersForm };
532
+ export { y as AdditionalOwnerRowStatus, E as AdditionalOwnersForm };