@tesouro/embedded-components-react 0.11.66 → 0.11.68

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
@@ -507,7 +507,7 @@ Lists an organization's **credit** cards one page at a time, with a "Show my car
507
507
  | `defaultSelectedCardId` | `string \| null` | `undefined` | Initial selection when uncontrolled. Ignored when `selectedCardId` is supplied. |
508
508
  | `onSelectedCardIdChange` | `(cardId: string \| null) => void` | `undefined` | Fires whenever the open card changes, including on close (`null`). Supplying it does **not** change what renders. |
509
509
  | `cardDetailsLabels` | `PartialDeep<CardDetailsWidgetLabels>` | English labels | Label overrides forwarded into the details panel. |
510
- | `cardDetailsFeatureLabels` | `PartialDeep<CardDetailsFeatureLabels>` | English labels | Overrides the details panel's status, form-factor and program copy. |
510
+ | `cardDetailsFeatureLabels` | `PartialDeep<CardDetailsFeatureLabels>` | English labels | Overrides the details panel's status and form-factor copy. |
511
511
  | `cardDetailsActivateLabels` | `PartialDeep<ActivateCardPanelLabels>` | English labels | Overrides the copy of the Activate card form the details panel opens. |
512
512
  | `bankLogoSrc` | `string` | `undefined` | Bank logo for the details panel's card face. Omit it and the face renders no logo. |
513
513
  | `bankLogoAlt` | `string` | `undefined` | Alt text for `bankLogoSrc`. |
@@ -532,7 +532,7 @@ Lists an organization's **debit** cards one page at a time, with a "Show my card
532
532
  | `defaultSelectedCardId` | `string \| null` | `undefined` | Initial selection when uncontrolled. Ignored when `selectedCardId` is supplied. |
533
533
  | `onSelectedCardIdChange` | `(cardId: string \| null) => void` | `undefined` | Fires whenever the open card changes, including on close (`null`). Supplying it does **not** change what renders. |
534
534
  | `cardDetailsLabels` | `PartialDeep<CardDetailsWidgetLabels>` | English labels | Label overrides forwarded into the details panel. |
535
- | `cardDetailsFeatureLabels` | `PartialDeep<CardDetailsFeatureLabels>` | English labels | Overrides the details panel's status, form-factor and program copy. |
535
+ | `cardDetailsFeatureLabels` | `PartialDeep<CardDetailsFeatureLabels>` | English labels | Overrides the details panel's status and form-factor copy. |
536
536
  | `cardDetailsActivateLabels` | `PartialDeep<ActivateCardPanelLabels>` | English labels | Overrides the copy of the Activate card form the details panel opens. |
537
537
  | `bankLogoSrc` | `string` | `undefined` | Bank logo for the details panel's card face, ignored when `cardArtSrc` is set. Omit both and the face renders no logo. |
538
538
  | `bankLogoAlt` | `string` | `undefined` | Alt text for `bankLogoSrc`. |
@@ -546,21 +546,21 @@ Lists an organization's **debit** cards one page at a time, with a "Show my card
546
546
 
547
547
  ### CardDetailsWidget
548
548
 
549
- Details for one credit or debit card: status, form factor, program, masked number, and cardholder on the card face, nickname in the heading, and one copy action for the full billing address. It renders panel content rather than its own drawer, so it fits on a page of your own or inside chrome you already have.
549
+ Details for one credit or debit card: status, form factor, masked number, and cardholder on the card face, nickname in the heading, and one copy action for the full billing address. It renders panel content rather than its own drawer, so it fits on a page of your own or inside chrome you already have.
550
550
 
551
551
  #### Props
552
552
 
553
- | Prop | Type | Default | Description |
554
- | ---------------- | --------------------------------------- | -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
555
- | `cardId` | `string` | **Required** | Id of the card to show. |
556
- | `cardProgram` | `'credit' \| 'debit'` | **Required** | Which issuing program `cardId` belongs to. |
557
- | `onClose` | `() => void` | `undefined` | Called by the panel's close control and the activation **Done** button. Omit it and the panel renders no close control, and Done returns to the details. |
558
- | `labels` | `PartialDeep<CardDetailsWidgetLabels>` | English labels | Overrides the panel's copy. See the exported `CardDetailsWidgetLabels` type for every key. |
559
- | `activateLabels` | `PartialDeep<ActivateCardPanelLabels>` | English labels | Overrides the Activate card form's copy, including its result screen. See the exported `ActivateCardPanelLabels` type for every key. |
560
- | `featureLabels` | `PartialDeep<CardDetailsFeatureLabels>` | English labels | Overrides status, form-factor and program wording, toasts, and the refused-reveal sentence. Copy buttons confirm themselves; `copySuccessToast` is no longer shown. See `CardDetailsFeatureLabels`. |
561
- | `cardArtSrc` | `string` | `undefined` | Full plastic art for the card face (the same asset you pass `CreateCardWidget`). Takes priority over `bankLogoSrc`. |
562
- | `bankLogoSrc` | `string` | `undefined` | Bank logo for the card face; ignored when `cardArtSrc` is set. The widget ships no bank artwork, so omit it and no logo shows. |
563
- | `bankLogoAlt` | `string` | `undefined` | Alt text for `bankLogoSrc`. Falls back to `labels.cardFace.bankLogoAlt`. |
553
+ | Prop | Type | Default | Description |
554
+ | ---------------- | --------------------------------------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
555
+ | `cardId` | `string` | **Required** | Id of the card to show. |
556
+ | `cardProgram` | `'credit' \| 'debit'` | **Required** | Which issuing program `cardId` belongs to. |
557
+ | `onClose` | `() => void` | `undefined` | Called by the panel's close control and the activation **Done** button. Omit it and the panel renders no close control, and Done returns to the details. |
558
+ | `labels` | `PartialDeep<CardDetailsWidgetLabels>` | English labels | Overrides the panel's copy. See the exported `CardDetailsWidgetLabels` type for every key. |
559
+ | `activateLabels` | `PartialDeep<ActivateCardPanelLabels>` | English labels | Overrides the Activate card form's copy, including its result screen. See the exported `ActivateCardPanelLabels` type for every key. |
560
+ | `featureLabels` | `PartialDeep<CardDetailsFeatureLabels>` | English labels | Overrides status and form-factor wording, toasts, and the refused-reveal sentence. Copy buttons confirm themselves; `copySuccessToast` is no longer shown. See `CardDetailsFeatureLabels`. |
561
+ | `cardArtSrc` | `string` | `undefined` | Full plastic art for the card face (the same asset you pass `CreateCardWidget`). Takes priority over `bankLogoSrc`. |
562
+ | `bankLogoSrc` | `string` | `undefined` | Bank logo for the card face; ignored when `cardArtSrc` is set. The widget ships no bank artwork, so omit it and no logo shows. |
563
+ | `bankLogoAlt` | `string` | `undefined` | Alt text for `bankLogoSrc`. Falls back to `labels.cardFace.bankLogoAlt`. |
564
564
 
565
565
  ### CounterpartsWidget
566
566
 
package/dist/index.css CHANGED
@@ -1396,9 +1396,6 @@
1396
1396
  .ttw\:flex-1\/2 {
1397
1397
  flex: calc(1/2 * 100%);
1398
1398
  }
1399
- .ttw\:flex-auto {
1400
- flex: auto;
1401
- }
1402
1399
  .ttw\:flex-shrink-0 {
1403
1400
  flex-shrink: 0;
1404
1401
  }
package/dist/index.d.ts CHANGED
@@ -2917,7 +2917,7 @@ interface CardDetailsFeatureLabels {
2917
2917
  * refused for this session, which asking an admin for a role will not fix.
2918
2918
  */
2919
2919
  revealNotPermittedDescription: string;
2920
- /** Program wording on the card face, keyed on the widget's `cardProgram`. */
2920
+ /** @deprecated Unused: the card face no longer shows program wording. */
2921
2921
  programLabels: Record<CardProgram, string>;
2922
2922
  /** Status badge wording, keyed on the generated card status. */
2923
2923
  statusLabels: Record<CardStatus, string>;
@@ -3321,7 +3321,7 @@ interface CardsWidgetProps extends WidgetProviderProps {
3321
3321
  cardDetailsLabels?: CardDetailsWidgetProps['labels'];
3322
3322
  /**
3323
3323
  * Overrides for the copy the panel's *feature* layer resolves — its status
3324
- * vocabulary, form-factor wording, program label and copy-success toast.
3324
+ * vocabulary, form-factor wording and toasts.
3325
3325
  *
3326
3326
  * Distinct from `featureLabels`, which covers the list's own vocabulary.
3327
3327
  * Without this prop the panel is unreachable for that copy, so a host that
@@ -874,7 +874,7 @@ interface CardDetailsFeatureLabels {
874
874
  * refused for this session, which asking an admin for a role will not fix.
875
875
  */
876
876
  revealNotPermittedDescription: string;
877
- /** Program wording on the card face, keyed on the widget's `cardProgram`. */
877
+ /** @deprecated Unused: the card face no longer shows program wording. */
878
878
  programLabels: Record<CardProgram, string>;
879
879
  /** Status badge wording, keyed on the generated card status. */
880
880
  statusLabels: Record<CardStatus, string>;
@@ -955,7 +955,7 @@ interface CardDetailsFeatureLabels {
955
955
  * refused for this session, which asking an admin for a role will not fix.
956
956
  */
957
957
  revealNotPermittedDescription: string;
958
- /** Program wording on the card face, keyed on the widget's `cardProgram`. */
958
+ /** @deprecated Unused: the card face no longer shows program wording. */
959
959
  programLabels: Record<CardProgram, string>;
960
960
  /** Status badge wording, keyed on the generated card status. */
961
961
  statusLabels: Record<CardStatus, string>;
@@ -1344,7 +1344,7 @@ interface CardsWidgetProps extends WidgetProviderProps {
1344
1344
  cardDetailsLabels?: CardDetailsWidgetProps['labels'];
1345
1345
  /**
1346
1346
  * Overrides for the copy the panel's *feature* layer resolves — its status
1347
- * vocabulary, form-factor wording, program label and copy-success toast.
1347
+ * vocabulary, form-factor wording and toasts.
1348
1348
  *
1349
1349
  * Distinct from `featureLabels`, which covers the list's own vocabulary.
1350
1350
  * Without this prop the panel is unreachable for that copy, so a host that
@@ -955,7 +955,7 @@ interface CardDetailsFeatureLabels {
955
955
  * refused for this session, which asking an admin for a role will not fix.
956
956
  */
957
957
  revealNotPermittedDescription: string;
958
- /** Program wording on the card face, keyed on the widget's `cardProgram`. */
958
+ /** @deprecated Unused: the card face no longer shows program wording. */
959
959
  programLabels: Record<CardProgram, string>;
960
960
  /** Status badge wording, keyed on the generated card status. */
961
961
  statusLabels: Record<CardStatus, string>;
@@ -1344,7 +1344,7 @@ interface CardsWidgetProps extends WidgetProviderProps {
1344
1344
  cardDetailsLabels?: CardDetailsWidgetProps['labels'];
1345
1345
  /**
1346
1346
  * Overrides for the copy the panel's *feature* layer resolves — its status
1347
- * vocabulary, form-factor wording, program label and copy-success toast.
1347
+ * vocabulary, form-factor wording and toasts.
1348
1348
  *
1349
1349
  * Distinct from `featureLabels`, which covers the list's own vocabulary.
1350
1350
  * Without this prop the panel is unreachable for that copy, so a host that
@@ -1914,7 +1914,7 @@ interface CardDetailsFeatureLabels {
1914
1914
  * refused for this session, which asking an admin for a role will not fix.
1915
1915
  */
1916
1916
  revealNotPermittedDescription: string;
1917
- /** Program wording on the card face, keyed on the widget's `cardProgram`. */
1917
+ /** @deprecated Unused: the card face no longer shows program wording. */
1918
1918
  programLabels: Record<CardProgram, string>;
1919
1919
  /** Status badge wording, keyed on the generated card status. */
1920
1920
  statusLabels: Record<CardStatus, string>;
@@ -2303,7 +2303,7 @@ interface CardsWidgetProps extends WidgetProviderProps {
2303
2303
  cardDetailsLabels?: CardDetailsWidgetProps['labels'];
2304
2304
  /**
2305
2305
  * Overrides for the copy the panel's *feature* layer resolves — its status
2306
- * vocabulary, form-factor wording, program label and copy-success toast.
2306
+ * vocabulary, form-factor wording and toasts.
2307
2307
  *
2308
2308
  * Distinct from `featureLabels`, which covers the list's own vocabulary.
2309
2309
  * Without this prop the panel is unreachable for that copy, so a host that
@@ -73,11 +73,9 @@ function C({ cardId: i, cardProgram: f, onClose: C, labels: w, activateLabels: g
73
73
  hasCredentials: !!W.data
74
74
  }), K = y(() => B === "loaded" && I ? re({
75
75
  card: I,
76
- cardProgram: f,
77
76
  labels: N
78
77
  }) : void 0, [
79
78
  I,
80
- f,
81
79
  N,
82
80
  B
83
81
  ]), we = _(async (e) => {
@@ -156,7 +154,6 @@ function C({ cardId: i, cardProgram: f, onClose: C, labels: w, activateLabels: g
156
154
  bankLogoAlt: O,
157
155
  cardholderName: K?.cardholderName,
158
156
  maskedCardNumber: K?.maskedCardNumber,
159
- programLabel: K?.programLabel,
160
157
  lastFour: K?.lastFour,
161
158
  formFactorLabel: K?.formFactorLabel
162
159
  }) : /* @__PURE__ */ x(ue, {
@@ -173,7 +170,6 @@ function C({ cardId: i, cardProgram: f, onClose: C, labels: w, activateLabels: g
173
170
  bankLogoAlt: O,
174
171
  cardholderName: K?.cardholderName,
175
172
  maskedCardNumber: K?.maskedCardNumber,
176
- programLabel: K?.programLabel,
177
173
  billingAddress: K?.billingAddress,
178
174
  allowedCategories: K?.allowedCategories,
179
175
  spendLimitLabels: K?.spendLimitLabels,
@@ -21,20 +21,19 @@ function l({ panelState: t, cardProgram: n, cardStatus: r }) {
21
21
  function u({ isRevealRequested: e, isError: t, hasCredentials: n }) {
22
22
  return e ? t ? "errored" : n ? "revealed" : "revealing" : "hidden";
23
23
  }
24
- function d({ card: e, cardProgram: r, labels: a }) {
25
- let o = e.cardholderName.trim(), s = e.nickname?.trim();
24
+ function d({ card: e, labels: r }) {
25
+ let a = e.cardholderName.trim(), o = e.nickname?.trim();
26
26
  return {
27
- statusLabel: a.statusLabels[e.cardStatus],
27
+ statusLabel: r.statusLabels[e.cardStatus],
28
28
  statusTone: t[e.cardStatus],
29
- formFactorLabel: a.formFactorLabels[e.cardType],
30
- programLabel: a.programLabels[r],
29
+ formFactorLabel: r.formFactorLabels[e.cardType],
31
30
  maskedCardNumber: i(e.lastFourDigits),
32
31
  lastFour: e.lastFourDigits,
33
- cardholderName: o || void 0,
34
- nickname: s || void 0,
32
+ cardholderName: a || void 0,
33
+ nickname: o || void 0,
35
34
  billingAddress: n(e.billingAddress),
36
35
  allowedCategories: f(e.mccGroups),
37
- ...p(e.velocityControls, a)
36
+ ...p(e.velocityControls, r)
38
37
  };
39
38
  }
40
39
  function f(e) {
@@ -23,46 +23,45 @@ function O(e, t) {
23
23
  default: return;
24
24
  }
25
25
  }
26
- function k({ labels: m, state: h = "idle", values: k = g, onValuesChange: A, errors: j = D, isSubmitDisabled: M = !0, onSubmit: N, onClose: P, onDone: F, cardArtSrc: I, bankLogoSrc: L, bankLogoAlt: R, cardholderName: z, maskedCardNumber: B, programLabel: V, lastFour: H, formFactorLabel: U, testIds: W, className: G }) {
27
- let K = S(() => p(m), [m]), q = x(), J = x(), Y = x(), X = x(), Z = h === "submitting", Q = O(j.expirationDate, K.validation), $ = O(j.form, K.validation);
26
+ function k({ labels: m, state: h = "idle", values: k = g, onValuesChange: A, errors: j = D, isSubmitDisabled: M = !0, onSubmit: N, onClose: P, onDone: F, cardArtSrc: I, bankLogoSrc: L, bankLogoAlt: R, cardholderName: z, maskedCardNumber: B, lastFour: V, formFactorLabel: H, testIds: U, className: W }) {
27
+ let G = S(() => p(m), [m]), K = x(), q = x(), J = x(), Y = x(), X = h === "submitting", Z = O(j.expirationDate, G.validation), Q = O(j.form, G.validation);
28
28
  return /* @__PURE__ */ w("div", {
29
- "data-testid": W?.root,
30
- className: u("ttw:flex ttw:w-full ttw:flex-col", G),
29
+ "data-testid": U?.root,
30
+ className: u("ttw:flex ttw:w-full ttw:flex-col", W),
31
31
  children: [/* @__PURE__ */ w("div", {
32
32
  className: "ttw:flex ttw:items-start ttw:gap-2 ttw:px-6 ttw:pt-5 ttw:pb-4",
33
33
  children: [/* @__PURE__ */ C(t, {
34
34
  variant: "sheet",
35
35
  level: 2,
36
36
  className: "ttw:min-w-0 ttw:flex-1 ttw:text-foreground",
37
- children: K.header.title
37
+ children: G.header.title
38
38
  }), P ? /* @__PURE__ */ C(e, {
39
39
  type: "button",
40
40
  variant: "ghost",
41
41
  size: "icon-sm",
42
42
  className: "ttw:shrink-0 ttw:text-muted-foreground",
43
- "aria-label": K.header.closeAriaLabel,
43
+ "aria-label": G.header.closeAriaLabel,
44
44
  onClick: P,
45
45
  children: /* @__PURE__ */ C(E, { className: "ttw:size-4" })
46
46
  }) : null]
47
47
  }), h === "succeeded" ? /* @__PURE__ */ C(y, {
48
- labels: K.status,
48
+ labels: G.status,
49
49
  cardFace: /* @__PURE__ */ C(f, {
50
50
  cardArtSrc: I,
51
51
  bankLogoSrc: L,
52
- bankLogoAlt: R ?? K.cardFace.bankLogoAlt,
52
+ bankLogoAlt: R ?? G.cardFace.bankLogoAlt,
53
53
  cardholderName: z ?? "",
54
- maskedCardNumber: B ?? "",
55
- programLabel: V ?? ""
54
+ maskedCardNumber: B ?? ""
56
55
  }),
57
56
  cardholderName: z,
58
- lastFour: H,
59
- formFactorLabel: U,
57
+ lastFour: V,
58
+ formFactorLabel: H,
60
59
  onDone: F ?? P,
61
- testIds: W?.successView
60
+ testIds: U?.successView
62
61
  }) : /* @__PURE__ */ w("form", {
63
62
  noValidate: !0,
64
63
  onSubmit: (e) => {
65
- e.preventDefault(), !(M || Z) && N?.();
64
+ e.preventDefault(), !(M || X) && N?.();
66
65
  },
67
66
  className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:px-6 ttw:pb-6",
68
67
  children: [
@@ -71,35 +70,34 @@ function k({ labels: m, state: h = "idle", values: k = g, onValuesChange: A, err
71
70
  children: /* @__PURE__ */ C(f, {
72
71
  cardArtSrc: I,
73
72
  bankLogoSrc: L,
74
- bankLogoAlt: R ?? K.cardFace.bankLogoAlt,
73
+ bankLogoAlt: R ?? G.cardFace.bankLogoAlt,
75
74
  cardholderName: z ?? "",
76
75
  maskedCardNumber: B ?? "",
77
- programLabel: V ?? "",
78
- testIds: W?.cardFace
76
+ testIds: U?.cardFace
79
77
  })
80
78
  }),
81
79
  /* @__PURE__ */ w("div", {
82
80
  className: "ttw:flex ttw:flex-col ttw:gap-1.5",
83
81
  children: [
84
82
  /* @__PURE__ */ C(r, {
85
- htmlFor: q,
83
+ htmlFor: K,
86
84
  className: "ttw:text-sm ttw:font-medium",
87
- children: K.fields.expirationDate
85
+ children: G.fields.expirationDate
88
86
  }),
89
87
  /* @__PURE__ */ C(n, {
90
- id: q,
88
+ id: K,
91
89
  value: k.expirationDate,
92
- placeholder: K.fields.expirationDatePlaceholder,
93
- disabled: Z,
90
+ placeholder: G.fields.expirationDatePlaceholder,
91
+ disabled: X,
94
92
  inputMode: "numeric",
95
93
  autoComplete: "off",
96
- "aria-invalid": Q ? !0 : void 0,
97
- "aria-describedby": Q ? J : void 0,
94
+ "aria-invalid": Z ? !0 : void 0,
95
+ "aria-describedby": Z ? q : void 0,
98
96
  onChange: (e) => A?.({ expirationDate: v(e.target.value) })
99
97
  }),
100
98
  /* @__PURE__ */ C(b, {
101
- id: J,
102
- message: Q
99
+ id: q,
100
+ message: Z
103
101
  })
104
102
  ]
105
103
  }),
@@ -109,45 +107,45 @@ function k({ labels: m, state: h = "idle", values: k = g, onValuesChange: A, err
109
107
  /* @__PURE__ */ w("div", {
110
108
  className: "ttw:flex ttw:items-center ttw:gap-1.5",
111
109
  children: [/* @__PURE__ */ C(r, {
112
- htmlFor: Y,
110
+ htmlFor: J,
113
111
  className: "ttw:text-sm ttw:font-medium",
114
- children: K.fields.securityCode
112
+ children: G.fields.securityCode
115
113
  }), /* @__PURE__ */ C(c, { children: /* @__PURE__ */ w(o, { children: [/* @__PURE__ */ C(l, {
116
114
  type: "button",
117
115
  className: "ttw:inline-flex ttw:shrink-0 ttw:cursor-help ttw:text-muted-foreground",
118
- "aria-label": K.fields.securityCodeInfoAriaLabel,
116
+ "aria-label": G.fields.securityCodeInfoAriaLabel,
119
117
  children: /* @__PURE__ */ C(T, { className: "ttw:size-4" })
120
118
  }), /* @__PURE__ */ C(s, {
121
119
  className: "ttw:max-w-xs",
122
- children: K.fields.securityCodeInfo
120
+ children: G.fields.securityCodeInfo
123
121
  })] }) })]
124
122
  }),
125
123
  /* @__PURE__ */ C(n, {
126
- id: Y,
124
+ id: J,
127
125
  value: k.securityCode,
128
- placeholder: K.fields.securityCodePlaceholder,
129
- "aria-describedby": X,
130
- disabled: Z,
126
+ placeholder: G.fields.securityCodePlaceholder,
127
+ "aria-describedby": Y,
128
+ disabled: X,
131
129
  inputMode: "numeric",
132
130
  autoComplete: "off",
133
131
  maxLength: 4,
134
132
  onChange: (e) => A?.({ securityCode: _(e.target.value, 4) })
135
133
  }),
136
134
  /* @__PURE__ */ C("span", {
137
- id: X,
135
+ id: Y,
138
136
  className: "ttw:sr-only",
139
- children: K.fields.securityCodeInfo
137
+ children: G.fields.securityCodeInfo
140
138
  })
141
139
  ]
142
140
  }),
143
141
  /* @__PURE__ */ C(i, {}),
144
- h === "errored" || $ ? /* @__PURE__ */ C(d, { children: $ ?? K.status.errorDescription }) : null,
142
+ h === "errored" || Q ? /* @__PURE__ */ C(d, { children: Q ?? G.status.errorDescription }) : null,
145
143
  /* @__PURE__ */ C("div", {
146
144
  className: "ttw:flex ttw:justify-end",
147
145
  children: /* @__PURE__ */ w(e, {
148
146
  type: "submit",
149
- disabled: M || Z,
150
- children: [Z ? /* @__PURE__ */ C(a, { "aria-label": K.status.submittingAriaLabel }) : null, K.status.submit]
147
+ disabled: M || X,
148
+ children: [X ? /* @__PURE__ */ C(a, { "aria-label": G.status.submittingAriaLabel }) : null, G.status.submit]
151
149
  })
152
150
  })
153
151
  ]
@@ -3,91 +3,90 @@
3
3
  "use client";
4
4
  "use client";
5
5
  import { Alert as e, AlertDescription as t, Badge as n, Button as r, DescriptionList as i, Heading as a, Skeleton as o, cn as s } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
6
- import { EmptyState as c } from "../../../../../shared/ui/dist/lib/EmptyState/EmptyState.js";
7
- import { ErrorState as l } from "../../../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
8
- import { LoadingRegion as u } from "../../../../../shared/ui/dist/lib/LoadingRegion/LoadingRegion.js";
9
- import { InlineErrorAlert as d } from "../../../../../shared/ui/dist/lib/InlineErrorAlert/InlineErrorAlert.js";
6
+ import { EmptyState as ee } from "../../../../../shared/ui/dist/lib/EmptyState/EmptyState.js";
7
+ import { ErrorState as c } from "../../../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
8
+ import { LoadingRegion as l } from "../../../../../shared/ui/dist/lib/LoadingRegion/LoadingRegion.js";
9
+ import { InlineErrorAlert as u } from "../../../../../shared/ui/dist/lib/InlineErrorAlert/InlineErrorAlert.js";
10
10
  import "../../../../../shared/ui/dist/index.js";
11
- import { CardDetailsHeader as ee } from "./CardDetailsHeader.js";
12
- import { CARD_FACE_WIDTH_CLASS_NAME as te } from "./cardFaceSurface.js";
13
- import { CardFace as ne } from "./CardFace.js";
14
- import { resolveCardDetailsPanelLabels as re } from "./labels.js";
15
- import { CardCredentialsFace as ie } from "./CardCredentialsFace.js";
16
- import { CardFaceFlip as ae } from "./CardFaceFlip.js";
17
- import { CopyableValue as f } from "./CopyableValue.js";
18
- import { NicknameEditor as oe } from "./NicknameEditor.js";
19
- import { useMemo as se } from "react";
20
- import { jsx as p, jsxs as m } from "react/jsx-runtime";
21
- import { CircleAlertIcon as h, CreditCardIcon as g } from "lucide-react";
11
+ import { CardDetailsHeader as d } from "./CardDetailsHeader.js";
12
+ import { CARD_FACE_WIDTH_CLASS_NAME as f } from "./cardFaceSurface.js";
13
+ import { CardFace as te } from "./CardFace.js";
14
+ import { resolveCardDetailsPanelLabels as ne } from "./labels.js";
15
+ import { CardCredentialsFace as re } from "./CardCredentialsFace.js";
16
+ import { CardFaceFlip as ie } from "./CardFaceFlip.js";
17
+ import { CopyableValue as p } from "./CopyableValue.js";
18
+ import { NicknameEditor as ae } from "./NicknameEditor.js";
19
+ import { useMemo as oe } from "react";
20
+ import { jsx as m, jsxs as h } from "react/jsx-runtime";
21
+ import { CircleAlertIcon as g, CreditCardIcon as _ } from "lucide-react";
22
22
  // ../../libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsPanel.js
23
- function _({ labels: _, state: v, nickname: y, statusLabel: ce, statusTone: le, formFactorLabel: ue, cardMenu: de, onClose: fe, cardArtSrc: pe, bankLogoSrc: me, bankLogoAlt: he, cardholderName: ge, maskedCardNumber: _e, programLabel: ve, cardFaceStatusLabel: ye, billingAddress: b, allowedCategories: x, spendLimitLabels: S, perTransactionMaxLabel: C, onCopy: w, onEditNickname: T, nicknameEditState: E = "closed", nicknameDraft: D, onNicknameDraftChange: O, onSaveNickname: k, onCancelNicknameEdit: A, isNicknameSaveDisabled: j, onActivate: M, onViewCard: N, onHideCard: P, revealState: F = "hidden", revealedCardNumber: be, revealedExpirationDate: xe, revealedSecurityCode: Se, isLocked: I, lockState: L = "idle", onLockCard: R, onUnlockCard: z, onRetry: Ce, testIds: B, className: we }) {
24
- let V = se(() => re(_), [_]), H = b?.addressLine1, U = b?.addressLine2, W = b?.cityState, G = b?.postalCode, Te = !!(H || U || W || G), Ee = !!x?.length, De = !!S?.length, Oe = !!C, K = F === "revealed", q = K ? P : N, J = !!(R || z), Y = I ? z : R, ke = V.fields.copiedLabel, X = [
23
+ function v({ labels: v, state: y, nickname: se, statusLabel: ce, statusTone: le, formFactorLabel: ue, cardMenu: de, onClose: fe, cardArtSrc: pe, bankLogoSrc: me, bankLogoAlt: he, cardholderName: ge, maskedCardNumber: _e, cardFaceStatusLabel: ve, billingAddress: b, allowedCategories: x, spendLimitLabels: S, perTransactionMaxLabel: C, onCopy: w, onEditNickname: T, nicknameEditState: E = "closed", nicknameDraft: D, onNicknameDraftChange: O, onSaveNickname: k, onCancelNicknameEdit: A, isNicknameSaveDisabled: j, onActivate: M, onViewCard: N, onHideCard: P, revealState: F = "hidden", revealedCardNumber: ye, revealedExpirationDate: be, revealedSecurityCode: xe, isLocked: I, lockState: L = "idle", onLockCard: R, onUnlockCard: z, onRetry: Se, testIds: B, className: Ce }) {
24
+ let V = oe(() => ne(v), [v]), H = b?.addressLine1, U = b?.addressLine2, W = b?.cityState, G = b?.postalCode, we = !!(H || U || W || G), Te = !!x?.length, Ee = !!S?.length, De = !!C, K = F === "revealed", q = K ? P : N, J = !!(R || z), Y = I ? z : R, Oe = V.fields.copiedLabel, X = [
25
25
  H,
26
26
  U,
27
27
  W,
28
28
  G
29
- ].filter((e) => !!e), Z = Te ? [{
29
+ ].filter((e) => !!e), Z = we ? [{
30
30
  label: V.fields.billingAddress,
31
- value: /* @__PURE__ */ p(f, {
31
+ value: /* @__PURE__ */ m(p, {
32
32
  copyLabel: V.fields.copyBillingAddressAriaLabel,
33
- copiedLabel: ke,
33
+ copiedLabel: Oe,
34
34
  onCopy: w ? () => w(X.join("\n")) : void 0,
35
- children: /* @__PURE__ */ p("span", {
35
+ children: /* @__PURE__ */ m("span", {
36
36
  className: "ttw:flex ttw:flex-col",
37
- children: X.map((e, t) => /* @__PURE__ */ p("span", { children: e }, t))
37
+ children: X.map((e, t) => /* @__PURE__ */ m("span", { children: e }, t))
38
38
  })
39
39
  })
40
40
  }] : [], Q = [
41
- ...Ee ? [{
41
+ ...Te ? [{
42
42
  label: V.fields.allowedCategories,
43
- value: /* @__PURE__ */ p("span", {
43
+ value: /* @__PURE__ */ m("span", {
44
44
  className: "ttw:flex ttw:flex-wrap ttw:gap-2",
45
- children: x?.map((e) => /* @__PURE__ */ p(n, {
45
+ children: x?.map((e) => /* @__PURE__ */ m(n, {
46
46
  tone: "neutral",
47
47
  children: e
48
48
  }, e))
49
49
  })
50
50
  }] : [],
51
- ...De ? [{
51
+ ...Ee ? [{
52
52
  label: V.fields.spendLimit,
53
- value: /* @__PURE__ */ p("span", {
53
+ value: /* @__PURE__ */ m("span", {
54
54
  className: "ttw:flex ttw:flex-col ttw:gap-1 ttw:tabular-nums",
55
- children: S?.map((e, t) => /* @__PURE__ */ p("span", { children: e }, `${e}-${t}`))
55
+ children: S?.map((e, t) => /* @__PURE__ */ m("span", { children: e }, `${e}-${t}`))
56
56
  })
57
57
  }] : [],
58
- ...Oe ? [{
58
+ ...De ? [{
59
59
  label: V.fields.perTransactionMax,
60
- value: /* @__PURE__ */ p("span", {
60
+ value: /* @__PURE__ */ m("span", {
61
61
  className: "ttw:tabular-nums",
62
62
  children: C
63
63
  })
64
64
  }] : []
65
- ], $ = /* @__PURE__ */ p(ne, {
65
+ ], $ = /* @__PURE__ */ m(te, {
66
66
  cardArtSrc: pe,
67
67
  bankLogoSrc: me,
68
68
  bankLogoAlt: he ?? V.cardFace.bankLogoAlt,
69
69
  cardholderName: ge ?? "",
70
70
  maskedCardNumber: _e ?? "",
71
- programLabel: ve ?? "",
72
- statusLabel: ye,
71
+ statusLabel: ve,
73
72
  isLocked: I,
74
73
  lockedLabel: V.lock.cardFaceLabel,
75
74
  testIds: B?.cardFace
76
75
  });
77
- return /* @__PURE__ */ m("div", {
76
+ return /* @__PURE__ */ h("div", {
78
77
  "data-testid": B?.root,
79
- className: s("ttw:@container/card-details ttw:flex ttw:w-full ttw:max-w-[720px] ttw:flex-col", we),
80
- children: [/* @__PURE__ */ p(ee, {
78
+ className: s("ttw:@container/card-details ttw:flex ttw:w-full ttw:max-w-[720px] ttw:flex-col", Ce),
79
+ children: [/* @__PURE__ */ m(d, {
81
80
  testIds: B?.header,
82
81
  labels: V.header,
83
- title: v === "loaded" ? y ?? V.header.untitledCard : void 0,
84
- isTitlePending: v === "loading",
85
- statusLabel: v === "loaded" ? ce : void 0,
82
+ title: y === "loaded" ? se ?? V.header.untitledCard : void 0,
83
+ isTitlePending: y === "loading",
84
+ statusLabel: y === "loaded" ? ce : void 0,
86
85
  statusTone: le,
87
- formFactorLabel: v === "loaded" ? ue : void 0,
88
- cardMenu: v === "loaded" ? de : void 0,
86
+ formFactorLabel: y === "loaded" ? ue : void 0,
87
+ cardMenu: y === "loaded" ? de : void 0,
89
88
  onClose: fe,
90
- titleAction: v === "loaded" && T && E === "closed" ? /* @__PURE__ */ p(r, {
89
+ titleAction: y === "loaded" && T && E === "closed" ? /* @__PURE__ */ m(r, {
91
90
  type: "button",
92
91
  variant: "link",
93
92
  size: "sm",
@@ -96,27 +95,27 @@ function _({ labels: _, state: v, nickname: y, statusLabel: ce, statusTone: le,
96
95
  onClick: T,
97
96
  children: V.nickname.edit
98
97
  }) : void 0
99
- }), /* @__PURE__ */ p("div", {
98
+ }), /* @__PURE__ */ m("div", {
100
99
  className: "ttw:px-4 ttw:pb-6 ttw:@md/card-details:px-6",
101
- children: v === "loading" ? /* @__PURE__ */ m(u, {
100
+ children: y === "loading" ? /* @__PURE__ */ h(l, {
102
101
  isLoading: !0,
103
102
  loadingLabel: V.status.loadingAriaLabel,
104
103
  "data-testid": B?.loading,
105
104
  className: "ttw:space-y-4",
106
- children: [/* @__PURE__ */ p(o, { className: "ttw:h-8 ttw:w-56" }), /* @__PURE__ */ p(o, { className: "ttw:h-64 ttw:w-full ttw:rounded-lg" })]
107
- }) : v === "error" ? /* @__PURE__ */ p(l, {
105
+ children: [/* @__PURE__ */ m(o, { className: "ttw:h-8 ttw:w-56" }), /* @__PURE__ */ m(o, { className: "ttw:h-64 ttw:w-full ttw:rounded-lg" })]
106
+ }) : y === "error" ? /* @__PURE__ */ m(c, {
108
107
  title: V.status.errorTitle,
109
108
  description: V.status.errorDescription,
110
109
  retryLabel: V.status.errorRetry,
111
- onRetry: Ce
112
- }) : v === "notFound" ? /* @__PURE__ */ p(c, {
113
- icon: /* @__PURE__ */ p(g, {}),
110
+ onRetry: Se
111
+ }) : y === "notFound" ? /* @__PURE__ */ m(ee, {
112
+ icon: /* @__PURE__ */ m(_, {}),
114
113
  title: V.status.notFoundTitle,
115
114
  description: V.status.notFoundDescription
116
- }) : /* @__PURE__ */ m("div", {
115
+ }) : /* @__PURE__ */ h("div", {
117
116
  className: "ttw:flex ttw:flex-col ttw:gap-4",
118
117
  children: [
119
- T && E !== "closed" ? /* @__PURE__ */ p(oe, {
118
+ T && E !== "closed" ? /* @__PURE__ */ m(ae, {
120
119
  labels: V.nickname,
121
120
  editState: E,
122
121
  onEdit: T,
@@ -126,34 +125,34 @@ function _({ labels: _, state: v, nickname: y, statusLabel: ce, statusTone: le,
126
125
  onCancel: A,
127
126
  isSaveDisabled: j
128
127
  }) : null,
129
- /* @__PURE__ */ m("div", {
128
+ /* @__PURE__ */ h("div", {
130
129
  className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:@xl/card-details:flex-row ttw:@xl/card-details:items-start",
131
- children: [/* @__PURE__ */ p("div", {
130
+ children: [/* @__PURE__ */ m("div", {
132
131
  className: "ttw:flex ttw:justify-center ttw:rounded-lg ttw:bg-muted ttw:p-4 ttw:@xl/card-details:shrink-0",
133
- children: /* @__PURE__ */ m("div", {
134
- className: s("ttw:flex ttw:flex-col ttw:gap-2", te),
132
+ children: /* @__PURE__ */ h("div", {
133
+ className: s("ttw:flex ttw:flex-col ttw:gap-2", f),
135
134
  children: [
136
- N ? /* @__PURE__ */ p(ae, {
135
+ N ? /* @__PURE__ */ m(ie, {
137
136
  testIds: B?.cardFaceFlip,
138
137
  isFlipped: K,
139
138
  front: $,
140
- back: /* @__PURE__ */ p(ie, {
139
+ back: /* @__PURE__ */ m(re, {
141
140
  labels: V.credentials,
142
- cardNumber: be,
143
- expirationDate: xe,
144
- securityCode: Se,
141
+ cardNumber: ye,
142
+ expirationDate: be,
143
+ securityCode: xe,
145
144
  isLocked: I,
146
145
  onCopy: w,
147
146
  testIds: B?.credentialsFace
148
147
  })
149
148
  }) : $,
150
- M ? /* @__PURE__ */ p(r, {
149
+ M ? /* @__PURE__ */ m(r, {
151
150
  type: "button",
152
151
  className: "ttw:mt-2 ttw:w-full",
153
152
  onClick: M,
154
153
  children: V.actions.activateCard
155
154
  }) : null,
156
- N ? /* @__PURE__ */ p(r, {
155
+ N ? /* @__PURE__ */ m(r, {
157
156
  type: "button",
158
157
  variant: "ghost",
159
158
  className: "ttw:w-full",
@@ -162,7 +161,7 @@ function _({ labels: _, state: v, nickname: y, statusLabel: ce, statusTone: le,
162
161
  onClick: q,
163
162
  children: K ? V.actions.hideCard : V.actions.viewCard
164
163
  }) : null,
165
- J ? /* @__PURE__ */ p(r, {
164
+ J ? /* @__PURE__ */ m(r, {
166
165
  type: "button",
167
166
  variant: "outline",
168
167
  className: "ttw:w-full",
@@ -171,30 +170,30 @@ function _({ labels: _, state: v, nickname: y, statusLabel: ce, statusTone: le,
171
170
  onClick: Y,
172
171
  children: I ? V.lock.unlockCard : V.lock.lockCard
173
172
  }) : null,
174
- I ? /* @__PURE__ */ m(e, {
173
+ I ? /* @__PURE__ */ h(e, {
175
174
  variant: "destructive",
176
- children: [/* @__PURE__ */ p(h, { "aria-hidden": "true" }), /* @__PURE__ */ p(t, { children: J ? V.lock.lockedDescription : V.lock.lockedDescriptionWithoutUnlock })]
175
+ children: [/* @__PURE__ */ m(g, { "aria-hidden": "true" }), /* @__PURE__ */ m(t, { children: J ? V.lock.lockedDescription : V.lock.lockedDescriptionWithoutUnlock })]
177
176
  }) : null,
178
- L === "errored" ? /* @__PURE__ */ p(d, { children: V.lock.errorDescription }) : null,
179
- F === "errored" ? /* @__PURE__ */ p(d, { children: V.credentials.errorDescription }) : null
177
+ L === "errored" ? /* @__PURE__ */ m(u, { children: V.lock.errorDescription }) : null,
178
+ F === "errored" ? /* @__PURE__ */ m(u, { children: V.credentials.errorDescription }) : null
180
179
  ]
181
180
  })
182
- }), Z.length > 0 ? /* @__PURE__ */ p("div", {
181
+ }), Z.length > 0 ? /* @__PURE__ */ m("div", {
183
182
  className: "ttw:min-w-0 ttw:flex-1",
184
- children: /* @__PURE__ */ p(i, { items: Z })
183
+ children: /* @__PURE__ */ m(i, { items: Z })
185
184
  }) : null]
186
185
  }),
187
- Q.length > 0 ? /* @__PURE__ */ m("section", {
186
+ Q.length > 0 ? /* @__PURE__ */ h("section", {
188
187
  className: "ttw:flex ttw:flex-col ttw:gap-2",
189
- children: [/* @__PURE__ */ p(a, {
188
+ children: [/* @__PURE__ */ m(a, {
190
189
  variant: "card",
191
190
  level: 3,
192
191
  children: V.fields.cardControlsHeading
193
- }), /* @__PURE__ */ p(i, { items: Q })]
192
+ }), /* @__PURE__ */ m(i, { items: Q })]
194
193
  }) : null
195
194
  ]
196
195
  })
197
196
  })]
198
197
  });
199
198
  }
200
- export { _ as CardDetailsPanel };
199
+ export { v as CardDetailsPanel };
@@ -4,13 +4,13 @@ import { CardFaceGlow as r } from "./CardFaceGlow.js";
4
4
  import { jsx as i, jsxs as a } from "react/jsx-runtime";
5
5
  import { LockIcon as o } from "lucide-react";
6
6
  // ../../libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardFace.js
7
- function s({ cardArtSrc: s, bankLogoSrc: c, bankLogoAlt: l, cardholderName: u, maskedCardNumber: d, programLabel: f, statusLabel: p, isLocked: m, lockedLabel: h, testIds: g, className: _ }) {
7
+ function s({ cardArtSrc: s, bankLogoSrc: c, bankLogoAlt: l, cardholderName: u, maskedCardNumber: d, statusLabel: f, isLocked: p, lockedLabel: m, testIds: h, className: g }) {
8
8
  return /* @__PURE__ */ a("div", {
9
- "data-testid": g?.root,
10
- className: e(n, "ttw:justify-between", _),
9
+ "data-testid": h?.root,
10
+ className: e(n, "ttw:justify-between", g),
11
11
  children: [
12
12
  s ? /* @__PURE__ */ i("img", {
13
- "data-testid": g?.cardArt,
13
+ "data-testid": h?.cardArt,
14
14
  src: s,
15
15
  alt: "",
16
16
  "aria-hidden": "true",
@@ -25,37 +25,31 @@ function s({ cardArtSrc: s, bankLogoSrc: c, bankLogoAlt: l, cardholderName: u, m
25
25
  alt: l,
26
26
  className: "ttw:relative ttw:h-8 ttw:w-auto ttw:max-w-[60%] ttw:object-contain ttw:object-left"
27
27
  }) : /* @__PURE__ */ i("span", { className: "ttw:relative ttw:h-8" }),
28
- m ? /* @__PURE__ */ i("div", {
29
- "data-testid": g?.lockedOverlay,
28
+ p ? /* @__PURE__ */ i("div", {
29
+ "data-testid": h?.lockedOverlay,
30
30
  className: "ttw:pointer-events-none ttw:absolute ttw:inset-0 ttw:flex ttw:items-center ttw:justify-center ttw:bg-black/55",
31
- children: h ? /* @__PURE__ */ a("span", {
31
+ children: m ? /* @__PURE__ */ a("span", {
32
32
  className: e(t, "ttw:inline-flex ttw:items-center ttw:gap-1.5"),
33
33
  children: [/* @__PURE__ */ i(o, {
34
34
  className: "ttw:size-3.5",
35
35
  "aria-hidden": "true"
36
- }), h]
36
+ }), m]
37
37
  }) : null
38
- }) : p ? /* @__PURE__ */ i("div", {
38
+ }) : f ? /* @__PURE__ */ i("div", {
39
39
  className: "ttw:pointer-events-none ttw:absolute ttw:inset-0 ttw:flex ttw:items-center ttw:justify-center",
40
40
  children: /* @__PURE__ */ i("span", {
41
41
  className: t,
42
- children: p
42
+ children: f
43
43
  })
44
44
  }) : null,
45
45
  /* @__PURE__ */ a("div", {
46
- className: "ttw:relative ttw:flex ttw:flex-wrap ttw:items-end ttw:justify-between ttw:gap-x-3 ttw:gap-y-1",
47
- children: [/* @__PURE__ */ a("div", {
48
- className: "ttw:min-w-0 ttw:max-w-full ttw:flex-auto",
49
- children: [/* @__PURE__ */ i("p", {
50
- className: "ttw:truncate ttw:text-base ttw:font-medium ttw:text-white",
51
- children: u
52
- }), /* @__PURE__ */ i("p", {
53
- className: "ttw:mt-1 ttw:truncate ttw:text-lg ttw:tracking-wide ttw:text-white/90",
54
- children: d
55
- })]
46
+ className: "ttw:relative ttw:min-w-0",
47
+ children: [/* @__PURE__ */ i("p", {
48
+ className: "ttw:truncate ttw:text-base ttw:font-medium ttw:text-white",
49
+ children: u
56
50
  }), /* @__PURE__ */ i("p", {
57
- className: "ttw:shrink-0 ttw:text-[10px] ttw:font-medium ttw:text-white/90",
58
- children: f
51
+ className: "ttw:mt-1 ttw:truncate ttw:text-lg ttw:tracking-wide ttw:text-white/90",
52
+ children: d
59
53
  })]
60
54
  })
61
55
  ]
@@ -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.66", n = "b829d4ea8d64cc62ff415f41fe095a106ccea514", r = Object.freeze({
2
+ var e = "@tesouro/embedded-components-react", t = "0.11.68", n = "1468a37a3e34161d7c068bff6667dddd9937ea52", 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.11.66",
3
+ "version": "0.11.68",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "sideEffects": [