@tesouro/embedded-components-react 0.11.114 → 0.11.118

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.css +81 -125
  2. package/dist/index.d.ts +11 -2
  3. package/dist/lib/AcceptDisclosuresWidget.d.ts +4 -0
  4. package/dist/lib/ReceivablesWidget.d.ts +7 -2
  5. package/dist/lib/WidgetSuite.d.ts +7 -2
  6. package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/lib/AcceptDisclosuresWidget/AcceptDisclosuresWidget.js +91 -88
  7. package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/ui/dist/lib/AcceptDisclosuresWidget/AcceptDisclosuresWidget.js +41 -59
  8. package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/ui/dist/lib/AcceptDisclosuresWidget/labels.js +2 -0
  9. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/AdditionalOwnersStep.js +7 -5
  10. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/BankAccountOnboardingWidget.js +163 -160
  11. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/BusinessDetailsStep.js +18 -18
  12. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/PersonalDetailsStep.js +25 -25
  13. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/additionalOwnerDraft.js +34 -31
  14. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/applicationStatusView.js +1 -1
  15. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/fieldInput/maxBirthDate.js +3 -2
  16. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/personalDetailsPanelMapping.js +21 -18
  17. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/testIds.js +3 -0
  18. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index11.js +382 -275
  19. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index12.js +1 -1
  20. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index13.js +2 -2
  21. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index15.js +37 -42
  22. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index19.js +56 -50
  23. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index2.js +32 -69
  24. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index21.js +3 -3
  25. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index22.js +14 -25
  26. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index24.js +36 -39
  27. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index25.js +120 -116
  28. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index26.js +14 -26
  29. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index27.js +2 -2
  30. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index28.js +41 -44
  31. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index29.js +96 -115
  32. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index3.js +14 -14
  33. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index31.js +35 -57
  34. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index33.js +37 -60
  35. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index35.js +28 -42
  36. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index4.js +266 -259
  37. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index5.js +51 -55
  38. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index6.js +42 -48
  39. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index7.js +69 -70
  40. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index9.js +2 -2
  41. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/invoicesFilter.js +85 -50
  42. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/invoicesFilterLabels.js +7 -2
  43. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  44. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/index.js +3 -2
  45. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/ConsentBlock/ConsentBlock.js +51 -0
  46. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/EmptyState/EmptyState.js +5 -3
  47. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/InlineErrorAlert/InlineErrorAlert.js +1 -1
  48. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/OnboardingShell/OnboardingShell.js +84 -87
  49. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/OnboardingShell/OnboardingShellScrollRegion.js +1 -1
  50. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/OnboardingShell/OnboardingShellStepper.js +35 -21
  51. package/dist/packages/shared-ui-shadcn/dist/index.js +38 -101
  52. package/package.json +1 -1
@@ -1,9 +1,10 @@
1
1
  import { InvoicesFilterField as e } from "../../../../ui/dist/index3.js";
2
2
  import "../../../../ui/dist/index.js";
3
- import { INVOICES_DATE_PRESET_GROUPS as t } from "./datePresets.js";
4
- import { addDays as n, formatISO as r, startOfDay as i } from "date-fns";
3
+ import { formatMoney as t } from "./helpers.js";
4
+ import { INVOICES_DATE_PRESET_GROUPS as n } from "./datePresets.js";
5
+ import { addDays as r, format as i, formatISO as a, startOfDay as o } from "date-fns";
5
6
  // ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/invoicesFilter.js
6
- var a = [
7
+ var s = [
7
8
  "draft",
8
9
  "issued",
9
10
  "overdue",
@@ -12,32 +13,32 @@ var a = [
12
13
  "uncollectible",
13
14
  "canceled",
14
15
  "recurring"
15
- ], o = [
16
+ ], c = [
16
17
  "draft",
17
18
  "issued",
18
19
  "overdue",
19
20
  "partially_paid",
20
21
  "paid",
21
22
  "uncollectible"
22
- ], s = [
23
+ ], l = [
23
24
  e.DueDate,
24
25
  e.CreatedAt,
25
26
  e.IssueDate,
26
27
  e.Status,
27
28
  e.Amount,
28
29
  e.Customer
29
- ], c = {
30
+ ], u = {
30
31
  dueDate: "due_date",
31
32
  createdAt: "created_at",
32
33
  issueDate: "issue_date"
33
- }, l = {
34
+ }, d = {
34
35
  Status: "status",
35
36
  Customer: "customer",
36
37
  Counterpart: "counterpart",
37
38
  Amount: "amount",
38
39
  Search: "search"
39
- }, u = "date_";
40
- function d(e) {
40
+ }, f = "date_";
41
+ function p(e) {
41
42
  return {
42
43
  dateRanges: {},
43
44
  statuses: [],
@@ -48,71 +49,105 @@ function d(e) {
48
49
  customerId: e
49
50
  };
50
51
  }
51
- function f(e) {
52
+ function m(e) {
52
53
  return !!(e?.from || e?.to || e?.preset);
53
54
  }
54
- function p(e) {
55
+ function h(e) {
55
56
  return Object.entries(e.dateRanges);
56
57
  }
57
- function m(e) {
58
+ function g(e) {
58
59
  let t = Number.parseFloat(e);
59
60
  return Number.isNaN(t) ? void 0 : Math.round(t * 100);
60
61
  }
61
- function h(e) {
62
+ function _(e) {
63
+ if (e.amountMode === "any") return {};
64
+ let t = g(e.amountMin);
65
+ return e.amountMode === "exact" ? {
66
+ min: t,
67
+ max: t
68
+ } : {
69
+ min: t,
70
+ max: g(e.amountMax)
71
+ };
72
+ }
73
+ function v(e) {
74
+ let { min: t, max: n } = _(e);
75
+ return t !== void 0 || n !== void 0;
76
+ }
77
+ function y(e) {
62
78
  let t = {};
63
- for (let [a, o] of p(e)) {
64
- let e = c[a];
65
- e === "due_date" ? (o?.from && (t.due_date__gte = r(o.from, { representation: "date" })), o?.to && (t.due_date__lte = r(o.to, { representation: "date" }))) : (o?.from && (t[`${e}__gte`] = i(o.from).toISOString()), o?.to && (t[`${e}__lt`] = n(i(o.to), 1).toISOString()));
66
- }
67
- if (t.status__in = e.statuses.length > 0 ? e.statuses : o, e.customerName && (t.counterpart_name__icontains = e.customerName), e.customerId && (t.counterpart_id = e.customerId), e.amountMode !== "any") {
68
- let n = m(e.amountMin), r = m(e.amountMax);
69
- e.amountMode === "exact" ? n !== void 0 && (t.total_amount__gte = n, t.total_amount__lte = n) : (n !== void 0 && (t.total_amount__gte = n), r !== void 0 && (t.total_amount__lte = r));
79
+ for (let [n, i] of h(e)) {
80
+ let e = u[n];
81
+ e === "due_date" ? (i?.from && (t.due_date__gte = a(i.from, { representation: "date" })), i?.to && (t.due_date__lte = a(i.to, { representation: "date" }))) : (i?.from && (t[`${e}__gte`] = o(i.from).toISOString()), i?.to && (t[`${e}__lt`] = r(o(i.to), 1).toISOString()));
70
82
  }
71
- return t;
83
+ t.status__in = e.statuses.length > 0 ? e.statuses : c, e.customerName && (t.counterpart_name__icontains = e.customerName), e.customerId && (t.counterpart_id = e.customerId);
84
+ let { min: n, max: i } = _(e);
85
+ return n !== void 0 && (t.total_amount__gte = n), i !== void 0 && (t.total_amount__lte = i), t;
72
86
  }
73
- function g(e, t) {
87
+ function b(e, t) {
74
88
  return [
75
- Object.values(e.dateRanges).some(f),
89
+ Object.values(e.dateRanges).some(m),
76
90
  e.statuses.length > 0,
77
91
  !!e.customerName,
78
92
  !!e.customerId,
79
- e.amountMode !== "any",
93
+ v(e),
80
94
  !!t
81
95
  ].filter(Boolean).length;
82
96
  }
83
- function _({ state: e, search: t, counterpartName: n, labels: r, statusLabels: i }) {
97
+ var x = "MMM d, yyyy";
98
+ function S(e, t) {
99
+ if (e?.preset && e.preset in t.presets) return t.presets[e.preset];
100
+ let n = e?.from && i(e.from, x), r = e?.to && i(e.to, x);
101
+ if (n && r) return t.dateRange(n, r);
102
+ if (n) return t.dateFrom(n);
103
+ if (r) return t.dateTo(r);
104
+ }
105
+ var C = (e) => e === void 0 ? void 0 : t({
106
+ amount: e,
107
+ currency: "USD",
108
+ fallback: ""
109
+ });
110
+ function w(e, t) {
111
+ let n = _(e), r = C(n.min), i = C(n.max);
112
+ if (e.amountMode === "exact") return r;
113
+ if (r && i) return t.amountBetween(r, i);
114
+ if (r) return t.amountAtLeast(r);
115
+ if (i) return t.amountAtMost(i);
116
+ }
117
+ function T({ state: e, search: t, counterpartName: n, labels: r, statusLabels: i }) {
84
118
  let a = [], o = new Map(Object.entries(i));
85
- for (let [t, n] of p(e)) {
86
- if (!f(n)) continue;
87
- let e = n?.preset && n.preset in r.presets ? r.presets[n.preset] : void 0;
88
- a.push({
89
- key: `${u}${t}`,
90
- label: r.dateChip(r.dateFieldNames[t], e ?? r.customRange)
119
+ for (let [t, n] of h(e)) {
120
+ let e = S(n, r);
121
+ e && a.push({
122
+ key: `${f}${t}`,
123
+ label: r.dateChip(r.dateFieldNames[t], e)
91
124
  });
92
125
  }
93
126
  if (e.statuses.length > 0) {
94
127
  let [t, ...n] = e.statuses.map((e) => o.get(e) ?? e);
95
128
  a.push({
96
- key: l.Status,
129
+ key: d.Status,
97
130
  label: r.statusChip(n.length === 0 ? t : r.moreSelected(t, n.length))
98
131
  });
99
132
  }
100
- return e.customerName && a.push({
101
- key: l.Customer,
133
+ e.customerName && a.push({
134
+ key: d.Customer,
102
135
  label: r.customerChip(e.customerName)
103
136
  }), e.customerId && a.push({
104
- key: l.Counterpart,
137
+ key: d.Counterpart,
105
138
  label: r.customerChip(n || e.customerId)
106
- }), e.amountMode !== "any" && a.push({
107
- key: l.Amount,
108
- label: r.amountChip
139
+ });
140
+ let s = w(e, r);
141
+ return s && a.push({
142
+ key: d.Amount,
143
+ label: r.amountChip(s)
109
144
  }), t && a.push({
110
- key: l.Search,
145
+ key: d.Search,
111
146
  label: r.searchChip(t)
112
147
  }), a;
113
148
  }
114
- function v(e, t) {
115
- if (t.startsWith(u)) {
149
+ function E(e, t) {
150
+ if (t.startsWith(f)) {
116
151
  let n = t.slice(5), r = { ...e.dateRanges };
117
152
  return delete r[n], {
118
153
  ...e,
@@ -120,19 +155,19 @@ function v(e, t) {
120
155
  };
121
156
  }
122
157
  switch (t) {
123
- case l.Status: return {
158
+ case d.Status: return {
124
159
  ...e,
125
160
  statuses: []
126
161
  };
127
- case l.Customer: return {
162
+ case d.Customer: return {
128
163
  ...e,
129
164
  customerName: ""
130
165
  };
131
- case l.Counterpart: return {
166
+ case d.Counterpart: return {
132
167
  ...e,
133
168
  customerId: void 0
134
169
  };
135
- case l.Amount: return {
170
+ case d.Amount: return {
136
171
  ...e,
137
172
  amountMode: "any",
138
173
  amountMin: "",
@@ -141,18 +176,18 @@ function v(e, t) {
141
176
  default: return e;
142
177
  }
143
178
  }
144
- function y(e, t) {
145
- return a.map((n) => ({
179
+ function D(e, t) {
180
+ return s.map((n) => ({
146
181
  value: n,
147
182
  label: e[n],
148
183
  description: t.statusDescriptions[n]
149
184
  }));
150
185
  }
151
- function b(e) {
152
- return Object.entries(t).map(([t, n]) => ({
186
+ function O(e) {
187
+ return Object.entries(n).map(([t, n]) => ({
153
188
  value: t,
154
189
  label: e.presets[t],
155
190
  group: n === "current" ? e.presetGroupCurrent : e.presetGroupPast
156
191
  }));
157
192
  }
158
- export { s as INVOICES_FILTER_FIELDS, o as INVOICE_DEFAULT_STATUSES, a as INVOICE_FILTER_STATUSES, l as InvoicesFilterChipKey, b as buildInvoicesDatePresetOptions, _ as buildInvoicesFilterChips, h as buildInvoicesFilterQuery, y as buildInvoicesStatusOptions, v as clearInvoicesFilter, g as countActiveInvoiceFilters, d as emptyInvoicesFilterState };
193
+ export { l as INVOICES_FILTER_FIELDS, c as INVOICE_DEFAULT_STATUSES, s as INVOICE_FILTER_STATUSES, d as InvoicesFilterChipKey, O as buildInvoicesDatePresetOptions, T as buildInvoicesFilterChips, y as buildInvoicesFilterQuery, D as buildInvoicesStatusOptions, E as clearInvoicesFilter, b as countActiveInvoiceFilters, p as emptyInvoicesFilterState };
@@ -22,7 +22,9 @@ var t = {
22
22
  createdAt: "Created on",
23
23
  issueDate: "Issue date"
24
24
  },
25
- customRange: "Custom range",
25
+ dateRange: (e, t) => `${e} - ${t}`,
26
+ dateFrom: (e) => `From ${e}`,
27
+ dateTo: (e) => `Until ${e}`,
26
28
  statusDescriptions: {
27
29
  draft: "Created but not yet sent",
28
30
  overdue: "Past due date",
@@ -33,7 +35,10 @@ var t = {
33
35
  statusChip: (e) => `Status: ${e}`,
34
36
  moreSelected: (e, t) => `${e} + ${t} more`,
35
37
  customerChip: (e) => `Customer: ${e}`,
36
- amountChip: "Amount",
38
+ amountChip: (e) => `Amount: ${e}`,
39
+ amountAtLeast: (e) => `${e} or more`,
40
+ amountAtMost: (e) => `${e} or less`,
41
+ amountBetween: (e, t) => `${e} - ${t}`,
37
42
  searchChip: (e) => `Search: ${e}`
38
43
  };
39
44
  function n(e) {
@@ -1,5 +1,5 @@
1
1
  // ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
2
- var e = "@tesouro/embedded-components-react", t = "0.11.114", n = "b089b33296d067e9fd82f1a0e3ec90c8e6491423", r = Object.freeze({
2
+ var e = "@tesouro/embedded-components-react", t = "0.11.118", n = "413556c820e5def7f1563b02bfc2ecd0463e9ee1", r = Object.freeze({
3
3
  library_name: e,
4
4
  library_version: t,
5
5
  library_sha: n
@@ -30,5 +30,6 @@ import "./lib/OnboardingShell/OnboardingShellStepper.js";
30
30
  import "./lib/OnboardingShell/OnboardingShellOverlayPortal.js";
31
31
  import { OnboardingShell as T } from "./lib/OnboardingShell/OnboardingShell.js";
32
32
  import { SectionHeading as E } from "./lib/SectionHeading/SectionHeading.js";
33
- import { FileDropZone as D } from "./lib/FileDropZone/FileDropZone.js";
34
- export { p as AddTile, y as AmountInput, g as ERROR_STATE_ID, e as EmbeddedToaster, h as EmptyState, _ as ErrorState, D as FileDropZone, l as HostIsolationScope, S as InlineErrorAlert, u as Link, b as LoadingRegion, x as MaskedAccountNumber, v as NoAccessState, T as OnboardingShell, C as PAGINATION_FOOTER_LABELS_EN, w as PaginationFooter, E as SectionHeading, m as StatePanel, t as ToastNameMessage, n as UIFramework, i as UIProvider, f as WidgetContainer, d as WidgetFrame, a as registerDesignSystemEnsurer, o as registerUIRenderers, r as resolveUIFramework, s as useDesignSystemEnsurer, c as useFrameworkRenderer };
33
+ import { ConsentBlock as D } from "./lib/ConsentBlock/ConsentBlock.js";
34
+ import { FileDropZone as O } from "./lib/FileDropZone/FileDropZone.js";
35
+ export { p as AddTile, y as AmountInput, D as ConsentBlock, g as ERROR_STATE_ID, e as EmbeddedToaster, h as EmptyState, _ as ErrorState, O as FileDropZone, l as HostIsolationScope, S as InlineErrorAlert, u as Link, b as LoadingRegion, x as MaskedAccountNumber, v as NoAccessState, T as OnboardingShell, C as PAGINATION_FOOTER_LABELS_EN, w as PaginationFooter, E as SectionHeading, m as StatePanel, t as ToastNameMessage, n as UIFramework, i as UIProvider, f as WidgetContainer, d as WidgetFrame, a as registerDesignSystemEnsurer, o as registerUIRenderers, r as resolveUIFramework, s as useDesignSystemEnsurer, c as useFrameworkRenderer };
@@ -0,0 +1,51 @@
1
+ import { Checkbox as e, FieldError as t } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { useId as n } from "react";
3
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
4
+ // ../../libs/tesouro-embedded-components-react/shared/ui/dist/lib/ConsentBlock/ConsentBlock.js
5
+ function a({ links: a, agreement: o, checked: s, onCheckedChange: c, disabled: l, error: u, checkboxAriaLabel: d, testIds: f }) {
6
+ let p = n(), m = `${p}-agreement`, h = `${p}-error`;
7
+ return /* @__PURE__ */ i("div", {
8
+ className: "ttw:flex ttw:flex-col ttw:gap-4",
9
+ children: [a.length > 0 ? /* @__PURE__ */ r("ul", {
10
+ "data-testid": f?.links,
11
+ className: "ttw:list-disc ttw:space-y-2 ttw:pl-5",
12
+ children: a.map((e, t) => /* @__PURE__ */ r("li", { children: e.href ? /* @__PURE__ */ r("a", {
13
+ href: e.href,
14
+ target: "_blank",
15
+ rel: "noopener noreferrer",
16
+ className: "ttw:text-sm ttw:text-primary ttw:underline ttw:underline-offset-2",
17
+ children: e.label
18
+ }) : /* @__PURE__ */ r("span", {
19
+ className: "ttw:text-sm",
20
+ children: e.label
21
+ }) }, `${e.label}-${t}`))
22
+ }) : null, /* @__PURE__ */ i("div", {
23
+ className: "ttw:flex ttw:items-start ttw:gap-2",
24
+ children: [/* @__PURE__ */ r(e, {
25
+ id: p,
26
+ "data-testid": f?.checkbox,
27
+ checked: s,
28
+ disabled: l,
29
+ onCheckedChange: (e) => c(e === !0),
30
+ "aria-label": d,
31
+ "aria-labelledby": d ? void 0 : m,
32
+ "aria-describedby": [d ? m : void 0, u ? h : void 0].filter(Boolean).join(" ") || void 0,
33
+ "aria-invalid": u ? !0 : void 0,
34
+ className: "ttw:mt-1 ttw:shrink-0"
35
+ }), /* @__PURE__ */ i("div", {
36
+ className: "ttw:flex ttw:flex-col ttw:gap-1",
37
+ children: [/* @__PURE__ */ r("label", {
38
+ htmlFor: p,
39
+ id: m,
40
+ "data-testid": f?.agreement,
41
+ className: "ttw:text-sm ttw:leading-relaxed ttw:text-foreground",
42
+ children: o
43
+ }), u ? /* @__PURE__ */ r(t, {
44
+ id: h,
45
+ children: u
46
+ }) : null]
47
+ })]
48
+ })]
49
+ });
50
+ }
51
+ export { a as ConsentBlock };
@@ -2,16 +2,18 @@ import { Button as e } from "../../../../../../../packages/shared-ui-shadcn/dist
2
2
  import { StatePanel as t } from "../StatePanel/StatePanel.js";
3
3
  import { jsx as n, jsxs as r } from "react/jsx-runtime";
4
4
  // ../../libs/tesouro-embedded-components-react/shared/ui/dist/lib/EmptyState/EmptyState.js
5
- function i({ icon: i, title: a, description: o, actionLabel: s, actionIcon: c, onAction: l, className: u, testId: d }) {
5
+ function i({ icon: i, title: a, description: o, actionLabel: s, actionIcon: c, onAction: l, actionDisabled: u, actionTestId: d, className: f, testId: p }) {
6
6
  return /* @__PURE__ */ n(t, {
7
7
  kind: "empty",
8
8
  icon: i,
9
9
  title: a,
10
10
  description: o,
11
- className: u,
12
- testId: d,
11
+ className: f,
12
+ testId: p,
13
13
  action: s && l ? /* @__PURE__ */ r(e, {
14
14
  onClick: l,
15
+ disabled: u,
16
+ "data-testid": d,
15
17
  children: [c, s]
16
18
  }) : void 0
17
19
  });
@@ -3,7 +3,7 @@ import { jsx as e } from "react/jsx-runtime";
3
3
  function t({ children: t, className: n }) {
4
4
  return /* @__PURE__ */ e("div", {
5
5
  role: "alert",
6
- className: "ttw:rounded-md ttw:border ttw:border-destructive/30 ttw:p-3 ttw:text-sm ttw:text-destructive" + (n ? ` ${n}` : ""),
6
+ className: "ttw:rounded-md ttw:border ttw:border-destructive/30 ttw:bg-destructive-subtle ttw:p-3 ttw:text-sm ttw:text-destructive-subtle-foreground" + (n ? ` ${n}` : ""),
7
7
  children: t
8
8
  });
9
9
  }
@@ -1,13 +1,13 @@
1
- import { Button as e, Separator as t, cn as n } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { InlineErrorAlert as r } from "../InlineErrorAlert/InlineErrorAlert.js";
3
- import { ONBOARDING_SHELL_LABELS_EN as i } from "./labels.js";
4
- import { OnboardingShellStepper as a } from "./OnboardingShellStepper.js";
5
- import { OnboardingShellOverlayContainerContext as o } from "./OnboardingShellOverlayPortal.js";
6
- import { FdicLogo as s } from "./FdicLogo.js";
7
- import { OnboardingShellScrollRegion as c } from "./OnboardingShellScrollRegion.js";
8
- import * as l from "react";
9
- import { jsx as u, jsxs as d } from "react/jsx-runtime";
10
- import { Check as f, Trash2 as p } from "lucide-react";
1
+ import { Button as e, Heading as t, Separator as n, cn as r } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { InlineErrorAlert as i } from "../InlineErrorAlert/InlineErrorAlert.js";
3
+ import { ONBOARDING_SHELL_LABELS_EN as a } from "./labels.js";
4
+ import { OnboardingShellStepper as o } from "./OnboardingShellStepper.js";
5
+ import { OnboardingShellOverlayContainerContext as s } from "./OnboardingShellOverlayPortal.js";
6
+ import { FdicLogo as c } from "./FdicLogo.js";
7
+ import { OnboardingShellScrollRegion as l } from "./OnboardingShellScrollRegion.js";
8
+ import * as u from "react";
9
+ import { jsx as d, jsxs as f } from "react/jsx-runtime";
10
+ import { Trash2 as p } from "lucide-react";
11
11
  // ../../libs/tesouro-embedded-components-react/shared/ui/dist/lib/OnboardingShell/OnboardingShell.js
12
12
  function m(e) {
13
13
  let t = e.ownerDocument.documentElement, n = (e) => Number.parseFloat(getComputedStyle(e).scrollPaddingTop) || 0, r = n(t);
@@ -17,124 +17,121 @@ function m(e) {
17
17
  }
18
18
  return r;
19
19
  }
20
- function h({ title: h, subtitle: g, isTitleVisuallyHidden: _ = !1, focusTitleOnMount: v = !1, stepLabels: y, activeStep: b, disclaimerText: x, onBack: S, onNext: C, onCancel: w, onSaveAndClose: T, isSaveAndCloseDisabled: E = !1, isSaveAndCloseLoading: D = !1, onDelete: O, isBackDisabled: k = !1, showBackButton: A = !0, backAriaLabel: j, isNextDisabled: M = !1, isNextLoading: N = !1, nextLabel: P, nextIcon: F, nextTone: I = "primary", errorMessage: L, children: R, labels: z, testIds: B }) {
21
- let V = {
22
- ...i,
23
- ...z
24
- }, [H, U] = l.useState(null), W = l.useCallback((e) => {
25
- U(e);
26
- }, []), G = l.useRef(b);
27
- l.useEffect(() => {
28
- G.current !== b && (G.current = b, H && H.getBoundingClientRect().top < m(H) && H.scrollIntoView({ block: "start" }));
29
- }, [b, H]);
30
- let K = l.useRef(null), q = l.useRef(v);
31
- l.useEffect(() => {
32
- q.current && K.current?.focus();
20
+ function h({ title: h, subtitle: g, isTitleVisuallyHidden: _ = !1, focusTitleOnMount: v = !1, stepLabels: y, activeStep: b, onStepClick: x, disclaimerText: S, onBack: C, onNext: w, onCancel: T, onSaveAndClose: E, isSaveAndCloseDisabled: D = !1, isSaveAndCloseLoading: O = !1, onDelete: k, isBackDisabled: A = !1, showBackButton: j = !0, backAriaLabel: M, isNextDisabled: N = !1, isNextLoading: P = !1, nextLabel: F, errorMessage: I, children: L, labels: R, testIds: z }) {
21
+ let B = {
22
+ ...a,
23
+ ...R
24
+ }, [V, H] = u.useState(null), U = u.useCallback((e) => {
25
+ H(e);
26
+ }, []), W = u.useRef(b);
27
+ u.useEffect(() => {
28
+ W.current !== b && (W.current = b, V && V.getBoundingClientRect().top < m(V) && V.scrollIntoView({ block: "start" }));
29
+ }, [b, V]);
30
+ let G = u.useRef(null), K = u.useRef(v);
31
+ u.useEffect(() => {
32
+ K.current && G.current?.focus();
33
33
  }, []);
34
- let J = l.useMemo(() => ({ container: H }), [H]), Y = N || D, X = !N && (F === void 0 ? /* @__PURE__ */ u(f, {
35
- className: "ttw:size-5",
36
- "aria-hidden": !0
37
- }) : F), Z = A ? /* @__PURE__ */ u(e, {
34
+ let q = u.useMemo(() => ({ container: V }), [V]), J = P || O, Y = j ? /* @__PURE__ */ d(e, {
38
35
  type: "button",
39
36
  variant: "outline",
40
- disabled: k || Y,
41
- onClick: S,
42
- "aria-label": j,
43
- className: "ttw:h-auto ttw:rounded-2xl ttw:border-border ttw:px-5 ttw:py-3 ttw:text-base ttw:font-medium ttw:text-foreground ttw:hover:bg-muted ttw:hover:text-foreground",
44
- "data-testid": B?.back,
45
- children: V.backButton
37
+ disabled: A || J,
38
+ onClick: C,
39
+ "aria-label": M,
40
+ "data-testid": z?.back,
41
+ children: B.backButton
46
42
  }) : null;
47
- return /* @__PURE__ */ u(o.Provider, {
48
- value: J,
49
- children: /* @__PURE__ */ d("div", {
50
- ref: W,
43
+ return /* @__PURE__ */ d(s.Provider, {
44
+ value: q,
45
+ children: /* @__PURE__ */ f("div", {
46
+ ref: U,
51
47
  className: "ttw:relative ttw:grid ttw:max-h-full ttw:w-full ttw:min-h-0 ttw:grid-rows-[auto_1fr_auto] ttw:gap-0 ttw:overflow-hidden ttw:bg-background",
52
- "data-testid": B?.root,
48
+ "data-testid": z?.root,
53
49
  children: [
54
- /* @__PURE__ */ d("header", {
50
+ /* @__PURE__ */ f("header", {
55
51
  className: "ttw:px-8 ttw:pt-8",
56
52
  children: [
57
- /* @__PURE__ */ u("h2", {
58
- ref: K,
53
+ /* @__PURE__ */ d(t, {
54
+ variant: "page",
55
+ ref: G,
59
56
  tabIndex: -1,
60
- className: n("ttw:outline-none", _ ? "ttw:sr-only" : "ttw:text-2xl ttw:font-bold ttw:leading-tight ttw:text-foreground"),
57
+ className: r("ttw:outline-none", _ ? "ttw:sr-only" : "ttw:text-foreground"),
61
58
  children: h
62
59
  }),
63
- /* @__PURE__ */ u("p", {
60
+ /* @__PURE__ */ d("p", {
64
61
  className: _ ? "ttw:sr-only" : "ttw:mt-1 ttw:mb-4 ttw:text-sm ttw:text-muted-foreground",
65
62
  children: g
66
63
  }),
67
- /* @__PURE__ */ u(a, {
64
+ /* @__PURE__ */ d(o, {
68
65
  stepLabels: y,
69
66
  activeStep: b,
70
- labels: z
67
+ labels: R,
68
+ onStepClick: x,
69
+ isStepClickDisabled: J,
70
+ stepButtonTestIdPrefix: z?.stepButton
71
71
  })
72
72
  ]
73
73
  }),
74
- /* @__PURE__ */ u(c, {
74
+ /* @__PURE__ */ d(l, {
75
75
  activeStep: b,
76
- testIds: B?.scrollRegion,
77
- children: R
76
+ testIds: z?.scrollRegion,
77
+ children: L
78
78
  }),
79
- /* @__PURE__ */ d("footer", {
79
+ /* @__PURE__ */ f("footer", {
80
80
  className: "ttw:px-8 ttw:pb-8",
81
81
  children: [
82
- /* @__PURE__ */ u(t, { className: "ttw:mb-3" }),
83
- /* @__PURE__ */ d("div", {
82
+ /* @__PURE__ */ d(n, { className: "ttw:mb-3" }),
83
+ /* @__PURE__ */ f("div", {
84
84
  className: "ttw:mb-4 ttw:flex ttw:items-center ttw:gap-1",
85
- children: [/* @__PURE__ */ u("p", {
85
+ children: [/* @__PURE__ */ d("p", {
86
86
  className: "ttw:text-sm ttw:text-muted-foreground",
87
- children: x
88
- }), /* @__PURE__ */ u(s, {})]
87
+ children: S
88
+ }), /* @__PURE__ */ d(c, {})]
89
89
  }),
90
- L ? /* @__PURE__ */ u(r, {
90
+ I ? /* @__PURE__ */ d(i, {
91
91
  className: "ttw:mb-3",
92
- children: L
92
+ children: I
93
93
  }) : null,
94
- /* @__PURE__ */ d("div", {
94
+ /* @__PURE__ */ f("div", {
95
95
  className: "ttw:flex ttw:flex-wrap ttw:items-center ttw:justify-between ttw:gap-3",
96
- children: [O ? /* @__PURE__ */ d(e, {
96
+ children: [k ? /* @__PURE__ */ f(e, {
97
97
  type: "button",
98
98
  variant: "ghost",
99
- disabled: Y,
100
- onClick: O,
101
- className: "ttw:h-auto ttw:max-w-full ttw:whitespace-normal ttw:rounded-2xl ttw:px-3 ttw:py-3 ttw:text-base ttw:font-medium ttw:text-foreground ttw:hover:bg-destructive/10 ttw:hover:text-[color-mix(in_srgb,var(--ttw-destructive),black_10%)]",
102
- "data-testid": B?.delete,
103
- children: [/* @__PURE__ */ u(p, {
99
+ disabled: J,
100
+ onClick: k,
101
+ className: "ttw:max-w-full ttw:whitespace-normal ttw:text-destructive ttw:hover:text-destructive",
102
+ "data-testid": z?.delete,
103
+ children: [/* @__PURE__ */ d(p, {
104
104
  className: "ttw:size-4",
105
105
  "aria-hidden": !0
106
- }), V.deleteButton]
107
- }) : Z, /* @__PURE__ */ d("div", {
106
+ }), B.deleteButton]
107
+ }) : Y, /* @__PURE__ */ f("div", {
108
108
  className: "ttw:ml-auto ttw:flex ttw:min-w-0 ttw:max-w-full ttw:flex-wrap ttw:items-center ttw:justify-end ttw:gap-3",
109
109
  children: [
110
- O ? Z : null,
111
- w ? /* @__PURE__ */ u(e, {
110
+ k ? Y : null,
111
+ T ? /* @__PURE__ */ d(e, {
112
112
  type: "button",
113
- variant: "outline",
114
- disabled: Y,
115
- onClick: w,
116
- className: "ttw:h-auto ttw:rounded-2xl ttw:border-border ttw:px-5 ttw:py-3 ttw:text-base ttw:font-medium ttw:text-foreground ttw:hover:bg-muted ttw:hover:text-foreground",
117
- "data-testid": B?.cancel,
118
- children: V.cancelButton
113
+ variant: "ghost",
114
+ disabled: J,
115
+ onClick: T,
116
+ "data-testid": z?.cancel,
117
+ children: B.cancelButton
119
118
  }) : null,
120
- T ? /* @__PURE__ */ u(e, {
119
+ E ? /* @__PURE__ */ d(e, {
121
120
  type: "button",
122
121
  variant: "secondary",
123
- disabled: E || Y,
124
- loading: D,
125
- onClick: T,
126
- className: "ttw:h-auto ttw:rounded-2xl ttw:px-5 ttw:py-3 ttw:text-base ttw:font-medium",
127
- "data-testid": B?.saveAndClose,
128
- children: V.saveAndCloseButton
122
+ disabled: D || J,
123
+ loading: O,
124
+ onClick: E,
125
+ "data-testid": z?.saveAndClose,
126
+ children: B.saveAndCloseButton
129
127
  }) : null,
130
128
  /* @__PURE__ */ d(e, {
131
129
  type: "button",
132
- disabled: M || Y,
133
- loading: N,
134
- onClick: C,
135
- className: n("ttw:h-auto ttw:rounded-2xl ttw:px-5 ttw:py-3 ttw:text-base ttw:font-medium", I === "success" && "ttw:bg-green-600! ttw:text-white! ttw:hover:bg-green-700!"),
136
- "data-testid": B?.next,
137
- children: [P, X]
130
+ disabled: N || J,
131
+ loading: P,
132
+ onClick: w,
133
+ "data-testid": z?.next,
134
+ children: F
138
135
  })
139
136
  ]
140
137
  })]
@@ -145,4 +142,4 @@ function h({ title: h, subtitle: g, isTitleVisuallyHidden: _ = !1, focusTitleOnM
145
142
  })
146
143
  });
147
144
  }
148
- export { i as ONBOARDING_SHELL_LABELS_EN, h as OnboardingShell, a as OnboardingShellStepper };
145
+ export { a as ONBOARDING_SHELL_LABELS_EN, h as OnboardingShell, o as OnboardingShellStepper };
@@ -41,7 +41,7 @@ function o({ activeStep: o, children: s, testIds: c }) {
41
41
  marginTop: `-${f}px`,
42
42
  opacity: +!!h,
43
43
  transitionDuration: `${i}ms`,
44
- background: "linear-gradient(to bottom, rgba(0,0,0,0) 0%, var(--ttw-background) 85%, var(--ttw-background) 100%)"
44
+ background: "linear-gradient(to bottom, transparent 0%, var(--ttw-background) 85%, var(--ttw-background) 100%)"
45
45
  }
46
46
  }) : null]
47
47
  });