@tesouro/embedded-components-react 0.4.1 → 0.4.4

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.
package/README.md CHANGED
@@ -316,16 +316,16 @@ Details for one credit **or** debit card — status, form factor, program, maske
316
316
 
317
317
  #### Props
318
318
 
319
- | Prop | Type | Default | Description |
320
- | ---------------- | --------------------------------------- | -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
321
- | `cardId` | `string` | **Required** | Id of the card to show. |
322
- | `cardProgram` | `'credit' \| 'debit'` | **Required** | Which issuing program `cardId` belongs to. Selects the endpoint the card is fetched from. |
323
- | `onClose` | `() => void` | `undefined` | Called when the header's close control is pressed. Omit it and no close control is rendered at all. |
324
- | `labels` | `PartialDeep<CardDetailsWidgetLabels>` | English labels | Overrides the panel's own copy — header, card face alt text, row headings, copy-button accessible names, the nickname editor, the lock control and its locked notice, and the loading/error/not-found screens. |
325
- | `activateLabels` | `PartialDeep<ActivateCardPanelLabels>` | English labels | Overrides the Activate Card form's copy — its heading, the two field labels, the security-code explanation, and the validation and status text. |
326
- | `featureLabels` | `PartialDeep<CardDetailsFeatureLabels>` | English labels | Overrides the copy this widget resolves rather than passes through — status, form-factor and program vocabulary, the copy-success and nickname-updated toasts, the activation, lock and nickname conflict toasts, and the refused-reveal sentence. |
327
- | `bankLogoSrc` | `string` | `undefined` | Bank logo for the card face. Omit and the face renders without a logo rather than with a placeholder. |
328
- | `bankLogoAlt` | `string` | `undefined` | Alt text for `bankLogoSrc`. Falls back to `labels.cardFace.bankLogoAlt`. |
319
+ | Prop | Type | Default | Description |
320
+ | ---------------- | --------------------------------------- | -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
321
+ | `cardId` | `string` | **Required** | Id of the card to show. |
322
+ | `cardProgram` | `'credit' \| 'debit'` | **Required** | Which issuing program `cardId` belongs to. Selects the endpoint the card is fetched from. |
323
+ | `onClose` | `() => void` | `undefined` | Called when the reader is finished with the widget: the details panel's close control, and **Done** on the activation success screen. Omit it and neither is rendered. The activation form keeps its own close either way, which returns to the details. |
324
+ | `labels` | `PartialDeep<CardDetailsWidgetLabels>` | English labels | Overrides the panel's own copy — header, card face alt text, row headings, copy-button accessible names, the nickname editor, the lock control and its locked notice, and the loading/error/not-found screens. |
325
+ | `activateLabels` | `PartialDeep<ActivateCardPanelLabels>` | English labels | Overrides the Activate Card form's copy — its heading, the two field labels, the security-code explanation, and the validation and status text. |
326
+ | `featureLabels` | `PartialDeep<CardDetailsFeatureLabels>` | English labels | Overrides the copy this widget resolves rather than passes through — status, form-factor and program vocabulary, the copy-success and nickname-updated toasts, the activation, lock and nickname conflict toasts, and the refused-reveal sentence. |
327
+ | `bankLogoSrc` | `string` | `undefined` | Bank logo for the card face. Omit and the face renders without a logo rather than with a placeholder. |
328
+ | `bankLogoAlt` | `string` | `undefined` | Alt text for `bankLogoSrc`. Falls back to `labels.cardFace.bankLogoAlt`. |
329
329
 
330
330
  ### CounterpartsWidget
331
331
 
package/dist/index.css CHANGED
@@ -2970,6 +2970,9 @@
2970
2970
  .ttw\:pt-8 {
2971
2971
  padding-top: calc(var(--ttw-spacing) * 8);
2972
2972
  }
2973
+ .ttw\:pt-10 {
2974
+ padding-top: calc(var(--ttw-spacing) * 10);
2975
+ }
2973
2976
  .ttw\:pt-12 {
2974
2977
  padding-top: calc(var(--ttw-spacing) * 12);
2975
2978
  }
@@ -17,16 +17,12 @@ function n({ apiStatus: n, dueDate: r, scheduledPaymentDate: i, hasScheduledPaym
17
17
  };
18
18
  let s = !!(e.has(n) && r && t(r, o));
19
19
  switch (n) {
20
- case "draft": return {
20
+ case "draft":
21
+ case "new": return {
21
22
  status: "draft",
22
23
  tone: "neutral",
23
24
  isOverdue: s
24
25
  };
25
- case "new": return {
26
- status: "finalized",
27
- tone: "warning",
28
- isOverdue: s
29
- };
30
26
  case "approve_in_progress": return {
31
27
  status: "pending_approval",
32
28
  tone: "warning",
@@ -16,8 +16,8 @@ var e = {
16
16
  e.Rejected,
17
17
  e.Canceled
18
18
  ], n = {
19
- [e.Draft]: ["draft"],
20
- [e.PendingApproval]: ["new", "approve_in_progress"],
19
+ [e.Draft]: ["draft", "new"],
20
+ [e.PendingApproval]: ["approve_in_progress"],
21
21
  [e.ReadyToPay]: ["waiting_to_be_paid"],
22
22
  [e.PartiallyPaid]: ["partially_paid"],
23
23
  [e.Paid]: ["paid"],
@@ -61,6 +61,7 @@ function u({ open: u, onOpenChange: d, enabled: f = !0, canManageDuplicates: p =
61
61
  id: e.id,
62
62
  status: e.status,
63
63
  statusTone: e.statusTone,
64
+ removalOutcome: e.removeBy === "delete" || e.removeBy === "cancel" ? e.removeBy : void 0,
64
65
  invoiceNumberLabel: e.invoiceNumberLabel,
65
66
  amountLabel: e.amountLabel,
66
67
  invoiceDateLabel: e.invoiceDateLabel,
@@ -1,7 +1,6 @@
1
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index18.js
2
2
  var e = {
3
3
  draft: "Draft",
4
- finalized: "Finalized",
5
4
  pending_approval: "Pending approval",
6
5
  ready_to_pay: "Ready to pay",
7
6
  scheduled: "Scheduled",
@@ -53,11 +53,17 @@ function v({ group: v, isBusy: y, labels: b }) {
53
53
  }),
54
54
  /* @__PURE__ */ l(i, {
55
55
  className: m,
56
- children: n.status && n.statusTone ? /* @__PURE__ */ l(c, {
57
- status: n.status,
58
- tone: n.statusTone,
59
- labels: b.statusBadge
60
- }) : null
56
+ children: /* @__PURE__ */ u("div", {
57
+ className: "ttw:flex ttw:flex-col ttw:items-start ttw:gap-0.5",
58
+ children: [n.status && n.statusTone ? /* @__PURE__ */ l(c, {
59
+ status: n.status,
60
+ tone: n.statusTone,
61
+ labels: b.statusBadge
62
+ }) : null, n.removalOutcome ? /* @__PURE__ */ l("span", {
63
+ className: "ttw:text-xs ttw:text-muted-foreground",
64
+ children: n.removalOutcome === "delete" ? b.removalOutcomeDelete : b.removalOutcomeCancel
65
+ }) : null]
66
+ })
61
67
  }),
62
68
  /* @__PURE__ */ l(i, {
63
69
  className: m,
@@ -86,17 +92,17 @@ function v({ group: v, isBusy: y, labels: b }) {
86
92
  children: [/* @__PURE__ */ u("p", {
87
93
  className: "ttw:text-right ttw:text-sm ttw:text-muted-foreground",
88
94
  children: [
89
- b.removalHelperBeforeDraft,
95
+ b.removalHelperBeforeUnsubmitted,
90
96
  /* @__PURE__ */ l("span", {
91
97
  className: "ttw:font-semibold",
92
- children: b.removalHelperDraft
98
+ children: b.removalHelperUnsubmitted
93
99
  }),
94
100
  b.removalHelperBetween,
95
101
  /* @__PURE__ */ l("span", {
96
102
  className: "ttw:font-semibold",
97
- children: b.removalHelperFinalized
103
+ children: b.removalHelperSubmitted
98
104
  }),
99
- b.removalHelperAfterFinalized
105
+ b.removalHelperAfterSubmitted
100
106
  ]
101
107
  }), S ? /* @__PURE__ */ u("div", {
102
108
  className: `ttw:flex ttw:flex-wrap ttw:justify-end ${_}`,
@@ -12,11 +12,13 @@ var t = {
12
12
  columnAmount: "Amount",
13
13
  columnActions: "Actions",
14
14
  statusBadge: e,
15
- removalHelperBeforeDraft: "Removing duplicates deletes ",
16
- removalHelperDraft: "Draft",
17
- removalHelperBetween: " bills, and cancels ",
18
- removalHelperFinalized: "Finalized bills",
19
- removalHelperAfterFinalized: ". This action cannot be undone.",
15
+ removalHelperBeforeUnsubmitted: "Removing duplicates deletes ",
16
+ removalHelperUnsubmitted: "bills not yet submitted",
17
+ removalHelperBetween: ", and cancels ",
18
+ removalHelperSubmitted: "ones already submitted",
19
+ removalHelperAfterSubmitted: ". This action cannot be undone.",
20
+ removalOutcomeDelete: "Deletes this bill",
21
+ removalOutcomeCancel: "Cancels this bill",
20
22
  keepSelectedButton: "Keep selected files as their own file",
21
23
  removeDuplicatesButton: "Remove selected duplicates",
22
24
  emptyState: "No possible duplicates left to review.",
@@ -17,187 +17,190 @@ import { CardProgramValidity as m, resolveCanRevealCredentials as h, resolveCard
17
17
  import { activateCardPanelTestIds as ie, cardDetailsPanelTestIds as ae } from "./index6.js";
18
18
  import { useCreditCardDetailsQuery as oe } from "../../data-access/dist/index6.js";
19
19
  import { useDebitCardCredentialsQuery as se } from "../../data-access/dist/index7.js";
20
- import { useDebitCardDetailsQuery as ce } from "../../data-access/dist/index8.js";
20
+ import { useDebitCardDetailsQuery as g } from "../../data-access/dist/index8.js";
21
21
  import "../../data-access/dist/index.js";
22
- import { CardDetailsPanel as le } from "../../ui/dist/lib/CardDetailsPanel/CardDetailsPanel.js";
23
- import { ActivateCardPanel as g } from "../../ui/dist/lib/ActivateCardPanel/ActivateCardPanel.js";
22
+ import { CardDetailsPanel as ce } from "../../ui/dist/lib/CardDetailsPanel/CardDetailsPanel.js";
23
+ import { ActivateCardPanel as le } from "../../ui/dist/lib/ActivateCardPanel/ActivateCardPanel.js";
24
24
  import "../../ui/dist/index.js";
25
25
  import { useActivateCard as ue } from "./index9.js";
26
- import { useCardLock as _ } from "./index11.js";
27
- import { useEditCardNickname as de } from "./index12.js";
28
- import { useCallback as v, useEffect as y, useMemo as b, useState as x } from "react";
29
- import { Fragment as fe, jsx as S, jsxs as pe } from "react/jsx-runtime";
26
+ import { useCardLock as de } from "./index11.js";
27
+ import { useEditCardNickname as fe } from "./index12.js";
28
+ import { useCallback as _, useEffect as v, useMemo as y, useState as pe } from "react";
29
+ import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
30
30
  //#region ../../libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index13.js
31
- function C({ cardId: r, cardProgram: u, onClose: C, labels: w, activateLabels: T, featureLabels: E, bankLogoSrc: D, bankLogoAlt: O }) {
32
- let k = n(), A = o(), j = i(), { initResponse: M } = a();
33
- y(() => {
34
- k(l.Mounted);
35
- }, [k]);
36
- let N = b(() => c(E), [E]), P = re(u), F = u === s.Credit, I = u === s.Debit, L = oe({
31
+ function C({ cardId: r, cardProgram: u, onClose: C, labels: w, activateLabels: me, featureLabels: T, bankLogoSrc: E, bankLogoAlt: D }) {
32
+ let O = n(), k = o(), A = i(), { initResponse: j } = a();
33
+ v(() => {
34
+ O(l.Mounted);
35
+ }, [O]);
36
+ let M = y(() => c(T), [T]), N = re(u), P = u === s.Credit, F = u === s.Debit, I = oe({
37
37
  cardId: r,
38
- enabled: F
39
- }), R = ce({
38
+ enabled: P
39
+ }), L = g({
40
40
  cardId: r,
41
- enabled: I
42
- }), { data: z, isError: me, isNotFound: he, refetch: B } = F ? L : R, V = ee({
43
- programValidity: P,
44
- isNotFound: he,
45
- isError: !!A || me,
46
- hasCard: !!z
41
+ enabled: F
42
+ }), { data: R, isError: he, isNotFound: ge, refetch: z } = P ? I : L, B = ee({
43
+ programValidity: N,
44
+ isNotFound: ge,
45
+ isError: !!k || he,
46
+ hasCard: !!R
47
47
  });
48
- y(() => {
49
- if (P === m.Supported) return;
48
+ v(() => {
49
+ if (N === m.Supported) return;
50
50
  let e = `"${s.Credit}" or "${s.Debit}"`;
51
- console.error(P === m.Missing ? `[CardDetailsWidget] cardProgram is required and was not set. Pass ${e} — it selects which card program to read, so there is no default. No card was fetched.` : `[CardDetailsWidget] cardProgram must be ${e}, received ${JSON.stringify(u)}. No card was fetched.`);
52
- }, [u, P]);
53
- let [ge, H] = x(), U = ge === r;
54
- y(() => {
55
- H(void 0);
51
+ console.error(N === m.Missing ? `[CardDetailsWidget] cardProgram is required and was not set. Pass ${e} — it selects which card program to read, so there is no default. No card was fetched.` : `[CardDetailsWidget] cardProgram must be ${e}, received ${JSON.stringify(u)}. No card was fetched.`);
52
+ }, [u, N]);
53
+ let [_e, V] = pe(), H = _e === r;
54
+ v(() => {
55
+ V(void 0);
56
56
  }, [r]);
57
- let W = h({
58
- panelState: V,
57
+ let U = h({
58
+ panelState: B,
59
59
  cardProgram: u,
60
- cardStatus: z?.cardStatus
60
+ cardStatus: R?.cardStatus
61
61
  });
62
- y(() => {
63
- U && !W && H(void 0);
64
- }, [U, W]);
65
- let G = se({
62
+ v(() => {
63
+ H && !U && V(void 0);
64
+ }, [H, U]);
65
+ let W = se({
66
66
  cardId: r,
67
- enabled: W && U
68
- }), K = ne({
69
- isRevealRequested: U,
70
- isError: G.isError,
71
- hasCredentials: !!G.data
72
- }), q = b(() => V === "loaded" && z ? te({
73
- card: z,
67
+ enabled: U && H
68
+ }), G = ne({
69
+ isRevealRequested: H,
70
+ isError: W.isError,
71
+ hasCredentials: !!W.data
72
+ }), K = y(() => B === "loaded" && R ? te({
73
+ card: R,
74
74
  cardProgram: u,
75
- labels: N
75
+ labels: M
76
76
  }) : void 0, [
77
- z,
77
+ R,
78
78
  u,
79
- N,
80
- V
81
- ]), _e = v(async (t) => {
82
- await d(t) && (e.success(N.copySuccessToast), k(l.ValueCopied));
83
- }, [N.copySuccessToast, k]), J = V === "loaded" ? z : void 0, Y = ue({
79
+ M,
80
+ B
81
+ ]), ve = _(async (t) => {
82
+ await d(t) && (e.success(M.copySuccessToast), O(l.ValueCopied));
83
+ }, [M.copySuccessToast, O]), q = B === "loaded" ? R : void 0, J = ue({
84
84
  cardId: r,
85
85
  cardProgram: u,
86
- card: J,
87
- scopes: M?.scopes,
88
- conflictToast: N.activationConflictToast
89
- }), X = _({
86
+ card: q,
87
+ scopes: j?.scopes,
88
+ conflictToast: M.activationConflictToast
89
+ }), Y = de({
90
90
  cardId: r,
91
91
  cardProgram: u,
92
- card: J,
93
- scopes: M?.scopes,
94
- conflictToast: N.lockConflictToast
95
- }), Z = de({
92
+ card: q,
93
+ scopes: j?.scopes,
94
+ conflictToast: M.lockConflictToast
95
+ }), X = fe({
96
96
  cardId: r,
97
97
  cardProgram: u,
98
- card: J,
99
- nickname: q?.nickname,
100
- scopes: M?.scopes,
101
- conflictToast: N.nicknameConflictToast,
102
- successToast: N.nicknameUpdatedToast
103
- }), { refetch: Q } = G, ve = v(() => {
104
- if (U) {
105
- Q();
98
+ card: q,
99
+ nickname: K?.nickname,
100
+ scopes: j?.scopes,
101
+ conflictToast: M.nicknameConflictToast,
102
+ successToast: M.nicknameUpdatedToast
103
+ }), { refetch: Z } = W, ye = _(() => {
104
+ if (H) {
105
+ Z();
106
106
  return;
107
107
  }
108
- H(r);
108
+ V(r);
109
109
  }, [
110
110
  r,
111
- U,
112
- Q
113
- ]), ye = v(() => {
114
- H(void 0);
115
- }, []), be = v(() => {
116
- H(void 0), C?.();
117
- }, [C]), xe = b(() => G.isForbidden ? {
111
+ H,
112
+ Z
113
+ ]), be = _(() => {
114
+ V(void 0);
115
+ }, []), Q = _(() => {
116
+ V(void 0), C?.();
117
+ }, [C]), xe = _(() => {
118
+ J.close(), Q();
119
+ }, [J.close, Q]), Se = y(() => W.isForbidden ? {
118
120
  ...w,
119
121
  credentials: {
120
122
  ...w?.credentials,
121
- errorDescription: N.revealNotPermittedDescription
123
+ errorDescription: M.revealNotPermittedDescription
122
124
  }
123
125
  } : w, [
124
- G.isForbidden,
126
+ W.isForbidden,
125
127
  w,
126
- N.revealNotPermittedDescription
127
- ]), $ = b(() => {
128
- if (!(K !== "revealed" || !G.data)) return {
129
- cardNumber: f(G.data.pan),
130
- expirationDate: p(G.data.expirationDate),
131
- securityCode: G.data.cvv
128
+ M.revealNotPermittedDescription
129
+ ]), $ = y(() => {
130
+ if (!(G !== "revealed" || !W.data)) return {
131
+ cardNumber: f(W.data.pan),
132
+ expirationDate: p(W.data.expirationDate),
133
+ securityCode: W.data.cvv
132
134
  };
133
- }, [G.data, K]), Se = v(() => {
134
- if (A) {
135
- j();
135
+ }, [W.data, G]), Ce = _(() => {
136
+ if (k) {
137
+ A();
136
138
  return;
137
139
  }
138
- B();
140
+ z();
139
141
  }, [
140
- B,
141
- j,
142
- A
142
+ z,
143
+ A,
144
+ k
143
145
  ]);
144
- return /* @__PURE__ */ pe(fe, { children: [/* @__PURE__ */ S(t, {}), Y.isOpen ? /* @__PURE__ */ S(g, {
146
+ return /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x(t, {}), J.isOpen ? /* @__PURE__ */ x(le, {
145
147
  testIds: ie,
146
- labels: T,
147
- state: Y.state,
148
- values: Y.values,
149
- errors: Y.errors,
150
- isSubmitDisabled: Y.isSubmitDisabled,
151
- onValuesChange: Y.onValuesChange,
152
- onSubmit: Y.onSubmit,
153
- onClose: Y.close,
154
- bankLogoSrc: D,
155
- bankLogoAlt: O,
156
- cardholderName: q?.cardholderName,
157
- maskedCardNumber: q?.maskedCardNumber,
158
- programLabel: q?.programLabel
159
- }) : /* @__PURE__ */ S(le, {
148
+ labels: me,
149
+ state: J.state,
150
+ values: J.values,
151
+ errors: J.errors,
152
+ isSubmitDisabled: J.isSubmitDisabled,
153
+ onValuesChange: J.onValuesChange,
154
+ onSubmit: J.onSubmit,
155
+ onClose: J.close,
156
+ onDone: C ? xe : void 0,
157
+ bankLogoSrc: E,
158
+ bankLogoAlt: D,
159
+ cardholderName: K?.cardholderName,
160
+ maskedCardNumber: K?.maskedCardNumber,
161
+ programLabel: K?.programLabel
162
+ }) : /* @__PURE__ */ x(ce, {
160
163
  testIds: ae,
161
- labels: xe,
162
- state: V,
163
- nickname: q?.nickname,
164
- statusLabel: q?.statusLabel,
165
- statusTone: q?.statusTone,
166
- formFactorLabel: q?.formFactorLabel,
167
- onClose: C ? be : void 0,
168
- bankLogoSrc: D,
169
- bankLogoAlt: O,
170
- cardholderName: q?.cardholderName,
171
- maskedCardNumber: q?.maskedCardNumber,
172
- programLabel: q?.programLabel,
173
- billingAddress: q?.billingAddress,
174
- allowedCategories: q?.allowedCategories,
175
- spendLimitLabels: q?.spendLimitLabels,
176
- perTransactionMaxLabel: q?.perTransactionMaxLabel,
177
- onCopy: _e,
178
- onEditNickname: Z.onEditNickname,
179
- nicknameEditState: Z.editState,
180
- nicknameDraft: Z.draft,
181
- onNicknameDraftChange: Z.onDraftChange,
182
- onSaveNickname: Z.onSave,
183
- onCancelNicknameEdit: Z.onCancel,
184
- isNicknameSaveDisabled: Z.isSaveDisabled,
185
- onActivate: Y.canActivate ? Y.open : void 0,
186
- onViewCard: W ? ve : void 0,
187
- onHideCard: W ? ye : void 0,
188
- revealState: K,
164
+ labels: Se,
165
+ state: B,
166
+ nickname: K?.nickname,
167
+ statusLabel: K?.statusLabel,
168
+ statusTone: K?.statusTone,
169
+ formFactorLabel: K?.formFactorLabel,
170
+ onClose: C ? Q : void 0,
171
+ bankLogoSrc: E,
172
+ bankLogoAlt: D,
173
+ cardholderName: K?.cardholderName,
174
+ maskedCardNumber: K?.maskedCardNumber,
175
+ programLabel: K?.programLabel,
176
+ billingAddress: K?.billingAddress,
177
+ allowedCategories: K?.allowedCategories,
178
+ spendLimitLabels: K?.spendLimitLabels,
179
+ perTransactionMaxLabel: K?.perTransactionMaxLabel,
180
+ onCopy: ve,
181
+ onEditNickname: X.onEditNickname,
182
+ nicknameEditState: X.editState,
183
+ nicknameDraft: X.draft,
184
+ onNicknameDraftChange: X.onDraftChange,
185
+ onSaveNickname: X.onSave,
186
+ onCancelNicknameEdit: X.onCancel,
187
+ isNicknameSaveDisabled: X.isSaveDisabled,
188
+ onActivate: J.canActivate ? J.open : void 0,
189
+ onViewCard: U ? ye : void 0,
190
+ onHideCard: U ? be : void 0,
191
+ revealState: G,
189
192
  revealedCardNumber: $?.cardNumber,
190
193
  revealedExpirationDate: $?.expirationDate,
191
194
  revealedSecurityCode: $?.securityCode,
192
- isLocked: X.isLocked,
193
- lockState: X.lockState,
194
- onLockCard: X.onLockCard,
195
- onUnlockCard: X.onUnlockCard,
196
- onRetry: P === m.Supported ? Se : void 0
195
+ isLocked: Y.isLocked,
196
+ lockState: Y.lockState,
197
+ onLockCard: Y.onLockCard,
198
+ onUnlockCard: Y.onUnlockCard,
199
+ onRetry: N === m.Supported ? Ce : void 0
197
200
  })] });
198
201
  }
199
202
  function w({ baseUrl: e, widgetToken: t, organizationId: n, configClient: i, gatewayRouting: a, linkComponent: o, implementation: s, uiFramework: c, errorFallback: l, onError: d, analytics: f, disclosuresAcceptance: p, providerLabels: m, ...h }) {
200
- return /* @__PURE__ */ S(r, {
203
+ return /* @__PURE__ */ x(r, {
201
204
  widgetName: u,
202
205
  baseUrl: e,
203
206
  widgetToken: t,
@@ -212,7 +215,7 @@ function w({ baseUrl: e, widgetToken: t, organizationId: n, configClient: i, gat
212
215
  analytics: f,
213
216
  disclosuresAcceptance: p,
214
217
  providerLabels: m,
215
- children: /* @__PURE__ */ S(C, { ...h })
218
+ children: /* @__PURE__ */ x(C, { ...h })
216
219
  });
217
220
  }
218
221
  //#endregion
@@ -23,68 +23,69 @@ function O(e, t) {
23
23
  default: return;
24
24
  }
25
25
  }
26
- function k({ labels: p, state: m = "idle", values: k = h, onValuesChange: A, errors: j = D, isSubmitDisabled: M = !0, onSubmit: N, onClose: P, bankLogoSrc: F, bankLogoAlt: I, cardholderName: L, maskedCardNumber: R, programLabel: z, testIds: B, className: V }) {
27
- let H = x(() => f(p), [p]), U = b(), W = b(), G = b(), K = b(), q = m === "submitting", J = O(j.expirationDate, H.validation), Y = O(j.form, H.validation);
26
+ function k({ labels: p, state: m = "idle", values: k = h, onValuesChange: A, errors: j = D, isSubmitDisabled: M = !0, onSubmit: N, onClose: P, onDone: F, bankLogoSrc: I, bankLogoAlt: L, cardholderName: R, maskedCardNumber: z, programLabel: B, testIds: V, className: H }) {
27
+ let U = x(() => f(p), [p]), W = b(), G = b(), K = b(), q = b(), J = m === "submitting", Y = O(j.expirationDate, U.validation), X = O(j.form, U.validation);
28
28
  return /* @__PURE__ */ C("div", {
29
- "data-testid": B?.root,
30
- className: l("ttw:flex ttw:w-full ttw:flex-col", V),
29
+ "data-testid": V?.root,
30
+ className: l("ttw:flex ttw:w-full ttw:flex-col", H),
31
31
  children: [/* @__PURE__ */ C("div", {
32
32
  className: "ttw:flex ttw:items-start ttw:gap-1.5 ttw:px-4 ttw:pt-4 ttw:pb-3",
33
33
  children: [/* @__PURE__ */ S("h2", {
34
34
  className: "ttw:min-w-0 ttw:flex-1 ttw:text-2xl ttw:font-semibold ttw:tracking-[-0.6px] ttw:text-foreground",
35
- children: H.header.title
35
+ children: U.header.title
36
36
  }), P ? /* @__PURE__ */ S(e, {
37
37
  type: "button",
38
38
  variant: "ghost",
39
39
  size: "icon",
40
40
  className: "ttw:size-8 ttw:shrink-0",
41
- "aria-label": H.header.closeAriaLabel,
41
+ "aria-label": U.header.closeAriaLabel,
42
42
  onClick: P,
43
43
  children: /* @__PURE__ */ S(E, { className: "ttw:size-4" })
44
44
  }) : null]
45
45
  }), m === "succeeded" ? /* @__PURE__ */ S(v, {
46
- labels: H.status,
47
- testIds: B?.successView
46
+ labels: U.status,
47
+ onDone: F,
48
+ testIds: V?.successView
48
49
  }) : /* @__PURE__ */ C("form", {
49
50
  noValidate: !0,
50
51
  onSubmit: (e) => {
51
- e.preventDefault(), !(M || q) && N?.();
52
+ e.preventDefault(), !(M || J) && N?.();
52
53
  },
53
54
  className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:px-4 ttw:pb-4",
54
55
  children: [
55
56
  /* @__PURE__ */ S("div", {
56
57
  className: "ttw:flex ttw:justify-center",
57
58
  children: /* @__PURE__ */ S(d, {
58
- bankLogoSrc: F,
59
- bankLogoAlt: I ?? H.cardFace.bankLogoAlt,
60
- cardholderName: L ?? "",
61
- maskedCardNumber: R ?? "",
62
- programLabel: z ?? "",
63
- testIds: B?.cardFace
59
+ bankLogoSrc: I,
60
+ bankLogoAlt: L ?? U.cardFace.bankLogoAlt,
61
+ cardholderName: R ?? "",
62
+ maskedCardNumber: z ?? "",
63
+ programLabel: B ?? "",
64
+ testIds: V?.cardFace
64
65
  })
65
66
  }),
66
67
  /* @__PURE__ */ C("div", {
67
68
  className: "ttw:flex ttw:flex-col ttw:gap-1.5",
68
69
  children: [
69
70
  /* @__PURE__ */ S(n, {
70
- htmlFor: U,
71
+ htmlFor: W,
71
72
  className: "ttw:text-sm ttw:font-medium",
72
- children: H.fields.expirationDate
73
+ children: U.fields.expirationDate
73
74
  }),
74
75
  /* @__PURE__ */ S(t, {
75
- id: U,
76
+ id: W,
76
77
  value: k.expirationDate,
77
- placeholder: H.fields.expirationDatePlaceholder,
78
- disabled: q,
78
+ placeholder: U.fields.expirationDatePlaceholder,
79
+ disabled: J,
79
80
  inputMode: "numeric",
80
81
  autoComplete: "off",
81
- "aria-invalid": J ? !0 : void 0,
82
- "aria-describedby": J ? W : void 0,
82
+ "aria-invalid": Y ? !0 : void 0,
83
+ "aria-describedby": Y ? G : void 0,
83
84
  onChange: (e) => A?.({ expirationDate: _(e.target.value) })
84
85
  }),
85
86
  /* @__PURE__ */ S(y, {
86
- id: W,
87
- message: J
87
+ id: G,
88
+ message: Y
88
89
  })
89
90
  ]
90
91
  }),
@@ -94,46 +95,46 @@ function k({ labels: p, state: m = "idle", values: k = h, onValuesChange: A, err
94
95
  /* @__PURE__ */ C("div", {
95
96
  className: "ttw:flex ttw:items-center ttw:gap-1.5",
96
97
  children: [/* @__PURE__ */ S(n, {
97
- htmlFor: G,
98
+ htmlFor: K,
98
99
  className: "ttw:text-sm ttw:font-medium",
99
- children: H.fields.securityCode
100
+ children: U.fields.securityCode
100
101
  }), /* @__PURE__ */ S(s, { children: /* @__PURE__ */ C(a, { children: [/* @__PURE__ */ S(c, {
101
102
  type: "button",
102
103
  className: "ttw:inline-flex ttw:shrink-0 ttw:cursor-help ttw:text-muted-foreground",
103
- "aria-label": H.fields.securityCodeInfoAriaLabel,
104
+ "aria-label": U.fields.securityCodeInfoAriaLabel,
104
105
  children: /* @__PURE__ */ S(T, { className: "ttw:size-4" })
105
106
  }), /* @__PURE__ */ S(o, {
106
107
  className: "ttw:max-w-xs",
107
- children: H.fields.securityCodeInfo
108
+ children: U.fields.securityCodeInfo
108
109
  })] }) })]
109
110
  }),
110
111
  /* @__PURE__ */ S(t, {
111
- id: G,
112
+ id: K,
112
113
  value: k.securityCode,
113
- placeholder: H.fields.securityCodePlaceholder,
114
- "aria-describedby": K,
115
- disabled: q,
114
+ placeholder: U.fields.securityCodePlaceholder,
115
+ "aria-describedby": q,
116
+ disabled: J,
116
117
  inputMode: "numeric",
117
118
  autoComplete: "off",
118
119
  maxLength: 4,
119
120
  onChange: (e) => A?.({ securityCode: g(e.target.value, 4) })
120
121
  }),
121
122
  /* @__PURE__ */ S("span", {
122
- id: K,
123
+ id: q,
123
124
  className: "ttw:sr-only",
124
- children: H.fields.securityCodeInfo
125
+ children: U.fields.securityCodeInfo
125
126
  })
126
127
  ]
127
128
  }),
128
129
  /* @__PURE__ */ S(r, {}),
129
- m === "errored" || Y ? /* @__PURE__ */ S(u, { children: Y ?? H.status.errorDescription }) : null,
130
+ m === "errored" || X ? /* @__PURE__ */ S(u, { children: X ?? U.status.errorDescription }) : null,
130
131
  /* @__PURE__ */ C(e, {
131
132
  type: "submit",
132
133
  className: "ttw:w-full",
133
- disabled: M || q,
134
+ disabled: M || J,
134
135
  children: [
135
- q ? /* @__PURE__ */ S(i, { "aria-label": H.status.submittingAriaLabel }) : null,
136
- H.status.submit,
136
+ J ? /* @__PURE__ */ S(i, { "aria-label": U.status.submittingAriaLabel }) : null,
137
+ U.status.submit,
137
138
  /* @__PURE__ */ S(w, { className: "ttw:size-4" })
138
139
  ]
139
140
  })
@@ -1,26 +1,38 @@
1
- import { jsx as e, jsxs as t } from "react/jsx-runtime";
2
- import { CheckIcon as n } from "lucide-react";
1
+ import { Button as e } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
+ import { CheckIcon as r, ChevronRightIcon as i } from "lucide-react";
3
4
  //#region ../../libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/ActivateCardPanel/ActivateCardSuccessView.js
4
- function r({ labels: r, testIds: i }) {
5
- return /* @__PURE__ */ t("div", {
6
- "data-testid": i?.root,
7
- className: "ttw:flex ttw:flex-col ttw:items-center ttw:gap-3 ttw:px-4 ttw:py-10 ttw:text-center",
8
- children: [
9
- /* @__PURE__ */ e("div", {
10
- "aria-hidden": "true",
11
- className: "ttw:flex ttw:size-10 ttw:items-center ttw:justify-center ttw:rounded-lg ttw:bg-emerald-700 ttw:text-white",
12
- children: /* @__PURE__ */ e(n, { className: "ttw:size-5" })
13
- }),
14
- /* @__PURE__ */ e("h3", {
15
- className: "ttw:text-lg ttw:font-semibold ttw:text-foreground",
16
- children: r.successTitle
17
- }),
18
- /* @__PURE__ */ e("p", {
19
- className: "ttw:max-w-sm ttw:text-sm ttw:text-muted-foreground",
20
- children: r.successDescription
5
+ function a({ labels: a, onDone: o, testIds: s }) {
6
+ return /* @__PURE__ */ n("div", {
7
+ "data-testid": s?.root,
8
+ className: "ttw:flex ttw:flex-col",
9
+ children: [/* @__PURE__ */ n("div", {
10
+ className: "ttw:flex ttw:flex-col ttw:items-center ttw:gap-3 ttw:px-4 ttw:pt-10 ttw:pb-8 ttw:text-center",
11
+ children: [
12
+ /* @__PURE__ */ t("div", {
13
+ "aria-hidden": "true",
14
+ className: "ttw:flex ttw:size-10 ttw:items-center ttw:justify-center ttw:rounded-lg ttw:bg-emerald-700 ttw:text-white",
15
+ children: /* @__PURE__ */ t(r, { className: "ttw:size-5" })
16
+ }),
17
+ /* @__PURE__ */ t("h3", {
18
+ className: "ttw:text-lg ttw:font-semibold ttw:text-foreground",
19
+ children: a.successTitle
20
+ }),
21
+ /* @__PURE__ */ t("p", {
22
+ className: "ttw:max-w-sm ttw:text-sm ttw:text-muted-foreground",
23
+ children: a.successDescription
24
+ })
25
+ ]
26
+ }), o ? /* @__PURE__ */ t("div", {
27
+ className: "ttw:px-4 ttw:pb-4",
28
+ children: /* @__PURE__ */ n(e, {
29
+ type: "button",
30
+ className: "ttw:w-full",
31
+ onClick: o,
32
+ children: [a.done, /* @__PURE__ */ t(i, { className: "ttw:size-4" })]
21
33
  })
22
- ]
34
+ }) : null]
23
35
  });
24
36
  }
25
37
  //#endregion
26
- export { r as ActivateCardSuccessView };
38
+ export { a as ActivateCardSuccessView };
@@ -40,7 +40,7 @@ var v = ({ inlineLineItems: v, title: y, onClose: b }) => {
40
40
  children: [/* @__PURE__ */ h("div", {
41
41
  className: "ttw:flex ttw:items-start ttw:justify-between ttw:gap-1.5",
42
42
  children: [/* @__PURE__ */ h("div", {
43
- className: "ttw:flex ttw:flex-col ttw:gap-1",
43
+ className: "ttw:flex ttw:min-w-0 ttw:flex-col ttw:gap-1",
44
44
  children: [/* @__PURE__ */ m(o, {
45
45
  variant: "h4",
46
46
  children: x._("Do you want to also save these items?")
@@ -52,7 +52,7 @@ var v = ({ inlineLineItems: v, title: y, onClose: b }) => {
52
52
  }), /* @__PURE__ */ m(n, {
53
53
  type: "button",
54
54
  variant: "ghost",
55
- className: "ttw:text-primary ttw:hover:text-primary",
55
+ className: "ttw:shrink-0 ttw:text-primary ttw:hover:text-primary",
56
56
  disabled: A,
57
57
  onClick: N ? F : P,
58
58
  children: N ? x._("Deselect all") : x._("Select all")
@@ -82,13 +82,16 @@ var v = ({ inlineLineItems: v, title: y, onClose: b }) => {
82
82
  disabled: A,
83
83
  "aria-label": t.product.name
84
84
  }), /* @__PURE__ */ h("div", {
85
- className: "ttw:flex ttw:flex-col ttw:gap-1",
85
+ className: "ttw:flex ttw:min-w-0 ttw:flex-1 ttw:flex-col ttw:gap-1",
86
86
  children: [/* @__PURE__ */ m(o, {
87
87
  variant: "caption",
88
+ className: "ttw:truncate",
89
+ title: t.product.name,
88
90
  children: t.product.name
89
91
  }), /* @__PURE__ */ m(o, {
90
92
  variant: "caption",
91
93
  color: "muted",
94
+ className: "ttw:truncate",
92
95
  children: L(t)
93
96
  })]
94
97
  })]
@@ -1,5 +1,5 @@
1
1
  //#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
2
- var e = "@tesouro/embedded-components-react", t = "0.4.1", n = "d57ee0d8bb5b762f890ffc20d4293be04981e232", r = Object.freeze({
2
+ var e = "@tesouro/embedded-components-react", t = "0.4.4", n = "5f9f94fa0e8bab712971e7f419dae870c303fbff", r = Object.freeze({
3
3
  library_name: e,
4
4
  library_version: t,
5
5
  library_sha: n
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tesouro/embedded-components-react",
3
- "version": "0.4.1",
3
+ "version": "0.4.4",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "packageDepSync": {