@tesouro/embedded-components-react 0.3.37 → 0.3.38

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/dist/index.d.ts CHANGED
@@ -456,6 +456,11 @@ type CreditCardStatus = 'PENDING_ACTIVATION' | 'ACTIVE' | 'LOCKED' | 'CLOSED';
456
456
  type CreditCardType = 'DIGITAL' | 'PHYSICAL';
457
457
  type DisclosureRequirement = 'NOT_REQUIRED' | 'REQUIRED';
458
458
  type OrganizationType = 'BANK' | 'EMBEDDED' | 'PLATFORM' | 'TRANSACTOR' | 'VERTICAL_SOFTWARE_PROVIDER';
459
+ /**
460
+ * The rolling period a velocity control's amount and usage limits are evaluated over.
461
+ * `TRANSACTION` applies the limit per-transaction and therefore carries no usage limit.
462
+ */
463
+ type VelocityWindow = 'DAY' | 'LIFETIME' | 'MONTH' | 'TRANSACTION' | 'WEEK';
459
464
  type WidgetInitResponse = {
460
465
  bankName?: null | string;
461
466
  /**
@@ -2160,7 +2165,11 @@ interface CardDetailsFieldLabels {
2160
2165
  cardholder: string;
2161
2166
  nickname: string;
2162
2167
  billingAddress: string;
2168
+ /** Sub-header over the merchant categories / velocity control rows. */
2169
+ cardControlsHeading: string;
2163
2170
  allowedCategories: string;
2171
+ spendLimit: string;
2172
+ perTransactionMax: string;
2164
2173
  /** Stands in for a row whose value the card does not carry. */
2165
2174
  emptyValue: string;
2166
2175
  copyCardholderAriaLabel: string;
@@ -2256,6 +2265,13 @@ interface CardDetailsFeatureLabels {
2256
2265
  statusLabels: Record<CardStatus, string>;
2257
2266
  /** Form-factor subtitle wording, keyed on the generated card type. */
2258
2267
  formFactorLabels: Record<CardType, string>;
2268
+ /**
2269
+ * A velocity control's reset-period wording, keyed on the generated
2270
+ * `velocityWindow`. Used to build the spend limit row, e.g. "$500 / month".
2271
+ * `TRANSACTION` is unused there (it drives the separate per-transaction max
2272
+ * row instead) but is still a real enum member, so it stays in the map.
2273
+ */
2274
+ velocityWindowLabels: Record<VelocityWindow, string>;
2259
2275
  }
2260
2276
 
2261
2277
  interface CardDetailsWidgetProps extends WidgetProviderProps {
@@ -21,7 +21,11 @@ interface CardDetailsFieldLabels {
21
21
  cardholder: string;
22
22
  nickname: string;
23
23
  billingAddress: string;
24
+ /** Sub-header over the merchant categories / velocity control rows. */
25
+ cardControlsHeading: string;
24
26
  allowedCategories: string;
27
+ spendLimit: string;
28
+ perTransactionMax: string;
25
29
  /** Stands in for a row whose value the card does not carry. */
26
30
  emptyValue: string;
27
31
  copyCardholderAriaLabel: string;
@@ -396,6 +400,11 @@ type ClientOptions = {
396
400
  };
397
401
  type CreditCardStatus = 'PENDING_ACTIVATION' | 'ACTIVE' | 'LOCKED' | 'CLOSED';
398
402
  type CreditCardType = 'DIGITAL' | 'PHYSICAL';
403
+ /**
404
+ * The rolling period a velocity control's amount and usage limits are evaluated over.
405
+ * `TRANSACTION` applies the limit per-transaction and therefore carries no usage limit.
406
+ */
407
+ type VelocityWindow = 'DAY' | 'LIFETIME' | 'MONTH' | 'TRANSACTION' | 'WEEK';
399
408
 
400
409
  type EmbeddedClient = Client;
401
410
  type ExtractLiterals<T> = T extends string ? string extends T ? never : T : never;
@@ -785,6 +794,13 @@ interface CardDetailsFeatureLabels {
785
794
  statusLabels: Record<CardStatus, string>;
786
795
  /** Form-factor subtitle wording, keyed on the generated card type. */
787
796
  formFactorLabels: Record<CardType, string>;
797
+ /**
798
+ * A velocity control's reset-period wording, keyed on the generated
799
+ * `velocityWindow`. Used to build the spend limit row, e.g. "$500 / month".
800
+ * `TRANSACTION` is unused there (it drives the separate per-transaction max
801
+ * row instead) but is still a real enum member, so it stays in the map.
802
+ */
803
+ velocityWindowLabels: Record<VelocityWindow, string>;
788
804
  }
789
805
 
790
806
  interface CardDetailsWidgetProps extends WidgetProviderProps {
@@ -436,6 +436,11 @@ type ClientOptions = {
436
436
  };
437
437
  type CreditCardStatus = 'PENDING_ACTIVATION' | 'ACTIVE' | 'LOCKED' | 'CLOSED';
438
438
  type CreditCardType = 'DIGITAL' | 'PHYSICAL';
439
+ /**
440
+ * The rolling period a velocity control's amount and usage limits are evaluated over.
441
+ * `TRANSACTION` applies the limit per-transaction and therefore carries no usage limit.
442
+ */
443
+ type VelocityWindow = 'DAY' | 'LIFETIME' | 'MONTH' | 'TRANSACTION' | 'WEEK';
439
444
 
440
445
  type EmbeddedClient = Client;
441
446
  type ExtractLiterals<T> = T extends string ? string extends T ? never : T : never;
@@ -776,7 +781,11 @@ interface CardDetailsFieldLabels {
776
781
  cardholder: string;
777
782
  nickname: string;
778
783
  billingAddress: string;
784
+ /** Sub-header over the merchant categories / velocity control rows. */
785
+ cardControlsHeading: string;
779
786
  allowedCategories: string;
787
+ spendLimit: string;
788
+ perTransactionMax: string;
780
789
  /** Stands in for a row whose value the card does not carry. */
781
790
  emptyValue: string;
782
791
  copyCardholderAriaLabel: string;
@@ -872,6 +881,13 @@ interface CardDetailsFeatureLabels {
872
881
  statusLabels: Record<CardStatus, string>;
873
882
  /** Form-factor subtitle wording, keyed on the generated card type. */
874
883
  formFactorLabels: Record<CardType, string>;
884
+ /**
885
+ * A velocity control's reset-period wording, keyed on the generated
886
+ * `velocityWindow`. Used to build the spend limit row, e.g. "$500 / month".
887
+ * `TRANSACTION` is unused there (it drives the separate per-transaction max
888
+ * row instead) but is still a real enum member, so it stays in the map.
889
+ */
890
+ velocityWindowLabels: Record<VelocityWindow, string>;
875
891
  }
876
892
 
877
893
  interface CardDetailsWidgetProps extends WidgetProviderProps {
@@ -1,14 +1,15 @@
1
+ import { amountOutputToMajorUnits as e } from "../../../shared/util/dist/lib/amountOutputToMajorUnits.js";
1
2
  //#region ../../libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index3.js
2
- var e = "••••";
3
- function t(t) {
4
- let n = t.trim().slice(-4);
5
- return n ? `${e} ${e} ${e} ${n}` : "";
6
- }
3
+ var t = "••••";
7
4
  function n(e) {
5
+ let n = e.trim().slice(-4);
6
+ return n ? `${t} ${t} ${t} ${n}` : "";
7
+ }
8
+ function r(e) {
8
9
  let t = e.replace(/\s+/g, "");
9
10
  return t ? (t.match(/.{1,4}/g) ?? []).join(" ") : "";
10
11
  }
11
- function r(e) {
12
+ function i(e) {
12
13
  let t = e.trim();
13
14
  if (!t) return "";
14
15
  let n = /^(\d{4})-(\d{2})(?:\D|$)/.exec(t);
@@ -23,7 +24,7 @@ function r(e) {
23
24
  }
24
25
  return t;
25
26
  }
26
- async function i(e) {
27
+ async function a(e) {
27
28
  if (!e.trim()) return !1;
28
29
  try {
29
30
  return await navigator.clipboard.writeText(e), !0;
@@ -31,5 +32,15 @@ async function i(e) {
31
32
  return !1;
32
33
  }
33
34
  }
35
+ function o({ amountLimit: t, currencyCode: n }) {
36
+ let r = e({
37
+ value: t,
38
+ currencyCode: n
39
+ });
40
+ if (Number.isFinite(r)) return new Intl.NumberFormat(void 0, {
41
+ style: "currency",
42
+ currency: n
43
+ }).format(r);
44
+ }
34
45
  //#endregion
35
- export { i as copyTextToClipboard, n as formatCardNumber, r as formatExpirationDate, t as maskCardNumber };
46
+ export { a as copyTextToClipboard, r as formatCardNumber, i as formatExpirationDate, o as formatVelocityControlAmount, n as maskCardNumber };
@@ -1,37 +1,53 @@
1
1
  import { CardProgram as e } from "../../../shared/feature/dist/lib/card/cardProgram.js";
2
2
  import { CARD_STATUS_TONE as t } from "../../../shared/feature/dist/lib/card/cardPresentation.js";
3
3
  import "../../../shared/feature/dist/index.js";
4
- import { maskCardNumber as n } from "./index3.js";
4
+ import { formatVelocityControlAmount as n, maskCardNumber as r } from "./index3.js";
5
5
  //#region ../../libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index4.js
6
- var r = {
6
+ var i = {
7
7
  Supported: "supported",
8
8
  Missing: "missing",
9
9
  Unsupported: "unsupported"
10
10
  };
11
- function i(t) {
12
- return t === e.Credit || t === e.Debit ? r.Supported : t == null ? r.Missing : r.Unsupported;
11
+ function a(t) {
12
+ return t === e.Credit || t === e.Debit ? i.Supported : t == null ? i.Missing : i.Unsupported;
13
13
  }
14
- function a({ programValidity: e, isNotFound: t, isError: n, hasCard: i }) {
15
- return e === r.Supported ? t ? "notFound" : i ? "loaded" : n ? "error" : "loading" : "error";
14
+ function o({ programValidity: e, isNotFound: t, isError: n, hasCard: r }) {
15
+ return e === i.Supported ? t ? "notFound" : r ? "loaded" : n ? "error" : "loading" : "error";
16
16
  }
17
- var o = "PENDING_ACTIVATION";
18
- function s({ panelState: t, cardProgram: n, cardStatus: r }) {
19
- return t !== "loaded" || n !== e.Debit || r === void 0 ? !1 : r !== o;
17
+ var s = "PENDING_ACTIVATION";
18
+ function c({ panelState: t, cardProgram: n, cardStatus: r }) {
19
+ return t !== "loaded" || n !== e.Debit || r === void 0 ? !1 : r !== s;
20
20
  }
21
- function c({ isRevealRequested: e, isError: t, hasCredentials: n }) {
21
+ function l({ isRevealRequested: e, isError: t, hasCredentials: n }) {
22
22
  return e ? t ? "errored" : n ? "revealed" : "revealing" : "hidden";
23
23
  }
24
- function l({ card: e, cardProgram: r, labels: i }) {
24
+ function u({ card: e, cardProgram: n, labels: i }) {
25
25
  let a = e.cardholderName.trim(), o = e.nickname?.trim();
26
26
  return {
27
27
  statusLabel: i.statusLabels[e.cardStatus],
28
28
  statusTone: t[e.cardStatus],
29
29
  formFactorLabel: i.formFactorLabels[e.cardType],
30
- programLabel: i.programLabels[r],
31
- maskedCardNumber: n(e.lastFourDigits),
30
+ programLabel: i.programLabels[n],
31
+ maskedCardNumber: r(e.lastFourDigits),
32
32
  cardholderName: a || void 0,
33
- nickname: o || void 0
33
+ nickname: o || void 0,
34
+ allowedCategories: d(e.mccGroups),
35
+ ...f(e.velocityControls, i)
36
+ };
37
+ }
38
+ function d(e) {
39
+ let t = (e ?? []).filter((e) => e.active).map((e) => e.name);
40
+ return t.length ? t : void 0;
41
+ }
42
+ function f(e, t) {
43
+ let r = (e ?? []).filter((e) => e.active && !e.mcc && !e.mccGroup), i = r.filter((e) => e.velocityWindow !== "TRANSACTION").map((e) => {
44
+ let r = n(e);
45
+ return r ? `${r} / ${t.velocityWindowLabels[e.velocityWindow]}` : void 0;
46
+ }).filter((e) => !!e), a = r.find((e) => e.velocityWindow === "TRANSACTION");
47
+ return {
48
+ spendLimitLabels: i.length ? i : void 0,
49
+ perTransactionMaxLabel: a ? n(a) : void 0
34
50
  };
35
51
  }
36
52
  //#endregion
37
- export { r as CardProgramValidity, s as resolveCanRevealCredentials, a as resolveCardDetailsPanelState, l as resolveCardDetailsPresentation, c as resolveCardDetailsRevealState, i as resolveCardProgramValidity };
53
+ export { i as CardProgramValidity, c as resolveCanRevealCredentials, o as resolveCardDetailsPanelState, u as resolveCardDetailsPresentation, l as resolveCardDetailsRevealState, a as resolveCardProgramValidity };
@@ -10,7 +10,14 @@ var r = {
10
10
  [e.Debit]: "Business debit"
11
11
  },
12
12
  statusLabels: t,
13
- formFactorLabels: n
13
+ formFactorLabels: n,
14
+ velocityWindowLabels: {
15
+ DAY: "day",
16
+ WEEK: "week",
17
+ MONTH: "month",
18
+ LIFETIME: "lifetime",
19
+ TRANSACTION: "transaction"
20
+ }
14
21
  };
15
22
  function i(e) {
16
23
  return {
@@ -27,6 +34,10 @@ function i(e) {
27
34
  formFactorLabels: {
28
35
  ...r.formFactorLabels,
29
36
  ...e?.formFactorLabels
37
+ },
38
+ velocityWindowLabels: {
39
+ ...r.velocityWindowLabels,
40
+ ...e?.velocityWindowLabels
30
41
  }
31
42
  };
32
43
  }
@@ -129,6 +129,9 @@ function E({ cardId: r, cardProgram: l, onClose: E, labels: D, featureLabels: O,
129
129
  cardholderName: Z?.cardholderName,
130
130
  maskedCardNumber: Z?.maskedCardNumber,
131
131
  programLabel: Z?.programLabel,
132
+ allowedCategories: Z?.allowedCategories,
133
+ spendLimitLabels: Z?.spendLimitLabels,
134
+ perTransactionMaxLabel: Z?.perTransactionMaxLabel,
132
135
  onCopy: ie,
133
136
  onViewCard: J ? ae : void 0,
134
137
  onHideCard: J ? oe : void 0,
@@ -2,147 +2,174 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { Badge as e, Button as t, Skeleton as n, cn as r } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
6
- import { EmptyState as i } from "../../../../../shared/ui/dist/lib/EmptyState/EmptyState.js";
7
- import { ErrorState as a } from "../../../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
8
- import { InlineErrorAlert as o } from "../../../../../shared/ui/dist/lib/InlineErrorAlert/InlineErrorAlert.js";
5
+ import { Button as e, Skeleton as t, cn as n } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
6
+ import { EmptyState as r } from "../../../../../shared/ui/dist/lib/EmptyState/EmptyState.js";
7
+ import { ErrorState as i } from "../../../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
8
+ import { InlineErrorAlert as a } from "../../../../../shared/ui/dist/lib/InlineErrorAlert/InlineErrorAlert.js";
9
9
  import "../../../../../shared/ui/dist/index.js";
10
- import { cardDetailsWidgetUiTestIds as s } from "./testIds.js";
11
- import { CardDetailsHeader as c } from "./CardDetailsHeader.js";
12
- import { CARD_FACE_WIDTH_CLASS_NAME as l } from "./cardFaceSurface.js";
13
- import { CardFace as u } from "./CardFace.js";
14
- import { DetailCopyRow as d } from "./DetailCopyRow.js";
15
- import { resolveCardDetailsPanelLabels as f } from "./labels.js";
16
- import { CardCredentialsFace as p } from "./CardCredentialsFace.js";
17
- import { CardFaceFlip as m } from "./CardFaceFlip.js";
18
- import { useMemo as h } from "react";
19
- import { jsx as g, jsxs as _ } from "react/jsx-runtime";
20
- import { CreditCardIcon as v, EyeIcon as y, EyeOffIcon as b, PowerIcon as x } from "lucide-react";
10
+ import { cardDetailsWidgetUiTestIds as o } from "./testIds.js";
11
+ import { CardDetailsHeader as s } from "./CardDetailsHeader.js";
12
+ import { CARD_FACE_WIDTH_CLASS_NAME as c } from "./cardFaceSurface.js";
13
+ import { CardFace as ee } from "./CardFace.js";
14
+ import { DetailCopyRow as l } from "./DetailCopyRow.js";
15
+ import { resolveCardDetailsPanelLabels as u } from "./labels.js";
16
+ import { CardCredentialsFace as d } from "./CardCredentialsFace.js";
17
+ import { CardFaceFlip as f } from "./CardFaceFlip.js";
18
+ import { useMemo as p } from "react";
19
+ import { jsx as m, jsxs as h } from "react/jsx-runtime";
20
+ import { CheckIcon as g, CreditCardIcon as _, EyeIcon as v, EyeOffIcon as y, PowerIcon as b } from "lucide-react";
21
21
  //#region ../../libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsPanel.js
22
- function S({ labels: S, state: C, nickname: w, statusLabel: T, statusTone: E, formFactorLabel: D, cardMenu: O, onClose: k, bankLogoSrc: A, bankLogoAlt: j, cardholderName: M, maskedCardNumber: N, programLabel: P, cardFaceStatusLabel: F, billingAddress: I, allowedCategories: L, onCopy: R, onActivate: z, onViewCard: B, onHideCard: V, revealState: H = "hidden", revealedCardNumber: U, revealedExpirationDate: W, revealedSecurityCode: G, onRetry: K, className: q }) {
23
- let J = h(() => f(S), [S]), Y = !!L?.length, X = H === "revealed", Z = X ? V : B, Q = /* @__PURE__ */ g(u, {
24
- bankLogoSrc: A,
25
- bankLogoAlt: j ?? J.cardFace.bankLogoAlt,
26
- cardholderName: M ?? "",
27
- maskedCardNumber: N ?? "",
28
- programLabel: P ?? "",
29
- statusLabel: F
22
+ function x({ labels: x, state: S, nickname: C, statusLabel: te, statusTone: ne, formFactorLabel: w, cardMenu: T, onClose: E, bankLogoSrc: D, bankLogoAlt: O, cardholderName: k, maskedCardNumber: A, programLabel: j, cardFaceStatusLabel: M, billingAddress: N, allowedCategories: P, spendLimitLabels: F, perTransactionMaxLabel: I, onCopy: L, onActivate: R, onViewCard: z, onHideCard: B, revealState: V = "hidden", revealedCardNumber: H, revealedExpirationDate: U, revealedSecurityCode: W, onRetry: G, className: K }) {
23
+ let q = p(() => u(x), [x]), J = !!P?.length, Y = !!F?.length, X = !!I, Z = V === "revealed", Q = Z ? B : z, $ = /* @__PURE__ */ m(ee, {
24
+ bankLogoSrc: D,
25
+ bankLogoAlt: O ?? q.cardFace.bankLogoAlt,
26
+ cardholderName: k ?? "",
27
+ maskedCardNumber: A ?? "",
28
+ programLabel: j ?? "",
29
+ statusLabel: M
30
30
  });
31
- return /* @__PURE__ */ _("div", {
32
- "data-testid": s.panel,
33
- className: r("ttw:flex ttw:w-full ttw:flex-col", q),
34
- children: [/* @__PURE__ */ g(c, {
35
- labels: J.header,
36
- title: C === "loaded" ? w ?? J.header.untitledCard : void 0,
37
- isTitlePending: C === "loading",
38
- statusLabel: C === "loaded" ? T : void 0,
39
- statusTone: E,
40
- formFactorLabel: C === "loaded" ? D : void 0,
41
- cardMenu: C === "loaded" ? O : void 0,
42
- onClose: k
43
- }), /* @__PURE__ */ g("div", {
31
+ return /* @__PURE__ */ h("div", {
32
+ "data-testid": o.panel,
33
+ className: n("ttw:flex ttw:w-full ttw:flex-col", K),
34
+ children: [/* @__PURE__ */ m(s, {
35
+ labels: q.header,
36
+ title: S === "loaded" ? C ?? q.header.untitledCard : void 0,
37
+ isTitlePending: S === "loading",
38
+ statusLabel: S === "loaded" ? te : void 0,
39
+ statusTone: ne,
40
+ formFactorLabel: S === "loaded" ? w : void 0,
41
+ cardMenu: S === "loaded" ? T : void 0,
42
+ onClose: E
43
+ }), /* @__PURE__ */ m("div", {
44
44
  className: "ttw:px-4 ttw:pb-4",
45
- children: C === "loading" ? /* @__PURE__ */ _("div", {
46
- "data-testid": s.loading,
45
+ children: S === "loading" ? /* @__PURE__ */ h("div", {
46
+ "data-testid": o.loading,
47
47
  role: "status",
48
- "aria-label": J.status.loadingAriaLabel,
48
+ "aria-label": q.status.loadingAriaLabel,
49
49
  className: "ttw:space-y-4",
50
- children: [/* @__PURE__ */ g(n, { className: "ttw:h-8 ttw:w-56" }), /* @__PURE__ */ g(n, { className: "ttw:h-64 ttw:w-full ttw:rounded-xl" })]
51
- }) : C === "error" ? /* @__PURE__ */ g(a, {
52
- title: J.status.errorTitle,
53
- description: J.status.errorDescription,
54
- retryLabel: J.status.errorRetry,
55
- onRetry: K
56
- }) : C === "notFound" ? /* @__PURE__ */ g(i, {
57
- icon: /* @__PURE__ */ g(v, { className: "ttw:size-6 ttw:text-muted-foreground" }),
58
- title: J.status.notFoundTitle,
59
- description: J.status.notFoundDescription
60
- }) : /* @__PURE__ */ _("div", {
61
- className: "ttw:flex ttw:flex-col ttw:overflow-hidden ttw:rounded-xl ttw:border ttw:border-border ttw:sm:flex-row",
62
- children: [/* @__PURE__ */ g("div", {
63
- className: "ttw:flex ttw:items-center ttw:justify-center ttw:bg-muted ttw:px-4 ttw:py-5",
64
- children: /* @__PURE__ */ _("div", {
65
- className: r("ttw:flex ttw:flex-col ttw:gap-4", l),
66
- children: [B ? /* @__PURE__ */ g(m, {
67
- isFlipped: X,
68
- front: Q,
69
- back: /* @__PURE__ */ g(p, {
70
- labels: J.credentials,
71
- cardNumber: U,
72
- expirationDate: W,
73
- securityCode: G,
74
- onCopy: R
75
- })
76
- }) : Q, z || B ? /* @__PURE__ */ _("div", {
77
- className: "ttw:flex ttw:flex-col ttw:gap-2",
78
- children: [
79
- z ? /* @__PURE__ */ _(t, {
80
- type: "button",
81
- className: "ttw:self-center",
82
- onClick: z,
83
- children: [/* @__PURE__ */ g(x, {
84
- className: "ttw:size-4",
85
- "aria-hidden": "true"
86
- }), J.actions.activateCard]
87
- }) : null,
88
- B ? /* @__PURE__ */ g("div", {
89
- className: "ttw:flex ttw:gap-2",
90
- children: /* @__PURE__ */ _(t, {
50
+ children: [/* @__PURE__ */ m(t, { className: "ttw:h-8 ttw:w-56" }), /* @__PURE__ */ m(t, { className: "ttw:h-64 ttw:w-full ttw:rounded-xl" })]
51
+ }) : S === "error" ? /* @__PURE__ */ m(i, {
52
+ title: q.status.errorTitle,
53
+ description: q.status.errorDescription,
54
+ retryLabel: q.status.errorRetry,
55
+ onRetry: G
56
+ }) : S === "notFound" ? /* @__PURE__ */ m(r, {
57
+ icon: /* @__PURE__ */ m(_, { className: "ttw:size-6 ttw:text-muted-foreground" }),
58
+ title: q.status.notFoundTitle,
59
+ description: q.status.notFoundDescription
60
+ }) : /* @__PURE__ */ h("div", {
61
+ className: "ttw:flex ttw:flex-col ttw:gap-4",
62
+ children: [/* @__PURE__ */ h("div", {
63
+ className: "ttw:flex ttw:flex-col ttw:overflow-hidden ttw:rounded-xl ttw:border ttw:border-border ttw:sm:flex-row",
64
+ children: [/* @__PURE__ */ m("div", {
65
+ className: "ttw:flex ttw:items-center ttw:justify-center ttw:bg-muted ttw:px-4 ttw:py-5",
66
+ children: /* @__PURE__ */ h("div", {
67
+ className: n("ttw:flex ttw:flex-col ttw:gap-4", c),
68
+ children: [z ? /* @__PURE__ */ m(f, {
69
+ isFlipped: Z,
70
+ front: $,
71
+ back: /* @__PURE__ */ m(d, {
72
+ labels: q.credentials,
73
+ cardNumber: H,
74
+ expirationDate: U,
75
+ securityCode: W,
76
+ onCopy: L
77
+ })
78
+ }) : $, R || z ? /* @__PURE__ */ h("div", {
79
+ className: "ttw:flex ttw:flex-col ttw:gap-2",
80
+ children: [
81
+ R ? /* @__PURE__ */ h(e, {
91
82
  type: "button",
92
- variant: "outline",
93
- className: "ttw:flex-1",
94
- disabled: !Z,
95
- loading: H === "revealing",
96
- onClick: Z,
97
- children: [g(X ? b : y, {
83
+ className: "ttw:self-center",
84
+ onClick: R,
85
+ children: [/* @__PURE__ */ m(b, {
98
86
  className: "ttw:size-4",
99
87
  "aria-hidden": "true"
100
- }), X ? J.actions.hideCard : J.actions.viewCard]
101
- })
102
- }) : null,
103
- H === "errored" ? /* @__PURE__ */ g(o, { children: J.credentials.errorDescription }) : null
104
- ]
105
- }) : null]
106
- })
107
- }), /* @__PURE__ */ _("div", {
108
- className: "ttw:flex ttw:min-w-0 ttw:flex-1 ttw:flex-col ttw:border-t ttw:border-border ttw:sm:border-t-0 ttw:sm:border-l",
88
+ }), q.actions.activateCard]
89
+ }) : null,
90
+ z ? /* @__PURE__ */ m("div", {
91
+ className: "ttw:flex ttw:gap-2",
92
+ children: /* @__PURE__ */ h(e, {
93
+ type: "button",
94
+ variant: "outline",
95
+ className: "ttw:flex-1",
96
+ disabled: !Q,
97
+ loading: V === "revealing",
98
+ onClick: Q,
99
+ children: [m(Z ? y : v, {
100
+ className: "ttw:size-4",
101
+ "aria-hidden": "true"
102
+ }), Z ? q.actions.hideCard : q.actions.viewCard]
103
+ })
104
+ }) : null,
105
+ V === "errored" ? /* @__PURE__ */ m(a, { children: q.credentials.errorDescription }) : null
106
+ ]
107
+ }) : null]
108
+ })
109
+ }), /* @__PURE__ */ h("div", {
110
+ className: "ttw:flex ttw:min-w-0 ttw:flex-1 ttw:flex-col ttw:border-t ttw:border-border ttw:sm:border-t-0 ttw:sm:border-l",
111
+ children: [
112
+ /* @__PURE__ */ m(l, {
113
+ label: q.fields.cardholder,
114
+ copyAriaLabel: k && L ? q.fields.copyCardholderAriaLabel : void 0,
115
+ onCopy: k && L ? () => L(k) : void 0,
116
+ children: k ?? q.fields.emptyValue
117
+ }),
118
+ /* @__PURE__ */ m(l, {
119
+ label: q.fields.nickname,
120
+ copyAriaLabel: C && L ? q.fields.copyNicknameAriaLabel : void 0,
121
+ onCopy: C && L ? () => L(C) : void 0,
122
+ isLast: !N,
123
+ children: C ?? q.fields.emptyValue
124
+ }),
125
+ N ? /* @__PURE__ */ m(l, {
126
+ label: q.fields.billingAddress,
127
+ copyAriaLabel: L ? q.fields.copyBillingAddressAriaLabel : void 0,
128
+ onCopy: L ? () => L(N) : void 0,
129
+ isLast: !0,
130
+ children: N
131
+ }) : null
132
+ ]
133
+ })]
134
+ }), J || Y || X ? /* @__PURE__ */ h("div", {
135
+ className: "ttw:flex ttw:flex-col ttw:overflow-hidden ttw:rounded-xl ttw:border ttw:border-border",
109
136
  children: [
110
- /* @__PURE__ */ g(d, {
111
- label: J.fields.cardholder,
112
- copyAriaLabel: M && R ? J.fields.copyCardholderAriaLabel : void 0,
113
- onCopy: M && R ? () => R(M) : void 0,
114
- children: M ?? J.fields.emptyValue
115
- }),
116
- /* @__PURE__ */ g(d, {
117
- label: J.fields.nickname,
118
- copyAriaLabel: w && R ? J.fields.copyNicknameAriaLabel : void 0,
119
- onCopy: w && R ? () => R(w) : void 0,
120
- isLast: !I && !Y,
121
- children: w ?? J.fields.emptyValue
137
+ /* @__PURE__ */ m("h3", {
138
+ className: "ttw:border-b ttw:border-border ttw:px-4 ttw:pt-4 ttw:pb-3 ttw:text-base ttw:font-semibold ttw:text-foreground",
139
+ children: q.fields.cardControlsHeading
122
140
  }),
123
- I ? /* @__PURE__ */ g(d, {
124
- label: J.fields.billingAddress,
125
- copyAriaLabel: R ? J.fields.copyBillingAddressAriaLabel : void 0,
126
- onCopy: R ? () => R(I) : void 0,
127
- isLast: !Y,
128
- children: I
141
+ J ? /* @__PURE__ */ m(l, {
142
+ label: q.fields.allowedCategories,
143
+ isLast: !Y && !X,
144
+ children: /* @__PURE__ */ m("div", {
145
+ className: "ttw:mt-2 ttw:flex ttw:flex-wrap ttw:gap-2",
146
+ children: P?.map((e) => /* @__PURE__ */ h("span", {
147
+ className: "ttw:inline-flex ttw:items-center ttw:gap-1.5 ttw:rounded-full ttw:border ttw:border-primary ttw:bg-primary/5 ttw:px-4 ttw:py-2 ttw:text-sm ttw:font-semibold ttw:text-primary",
148
+ children: [/* @__PURE__ */ m(g, {
149
+ "aria-hidden": "true",
150
+ className: "ttw:size-3.5"
151
+ }), e]
152
+ }, e))
153
+ })
129
154
  }) : null,
130
- Y ? /* @__PURE__ */ g(d, {
131
- label: J.fields.allowedCategories,
132
- isLast: !0,
133
- children: /* @__PURE__ */ g("div", {
134
- className: "ttw:flex ttw:flex-wrap ttw:gap-2",
135
- children: L?.map((t) => /* @__PURE__ */ g(e, {
136
- variant: "secondary",
137
- children: t
138
- }, t))
155
+ Y ? /* @__PURE__ */ m(l, {
156
+ label: q.fields.spendLimit,
157
+ isLast: !X,
158
+ children: /* @__PURE__ */ m("div", {
159
+ className: "ttw:flex ttw:flex-col ttw:gap-1",
160
+ children: F?.map((e, t) => /* @__PURE__ */ m("div", { children: e }, `${e}-${t}`))
139
161
  })
162
+ }) : null,
163
+ X ? /* @__PURE__ */ m(l, {
164
+ label: q.fields.perTransactionMax,
165
+ isLast: !0,
166
+ children: I
140
167
  }) : null
141
168
  ]
142
- })]
169
+ }) : null]
143
170
  })
144
171
  })]
145
172
  });
146
173
  }
147
174
  //#endregion
148
- export { S as CardDetailsPanel };
175
+ export { x as CardDetailsPanel };
@@ -10,7 +10,10 @@ var e = {
10
10
  cardholder: "Cardholder",
11
11
  nickname: "Nickname",
12
12
  billingAddress: "Billing address",
13
+ cardControlsHeading: "Card controls",
13
14
  allowedCategories: "Allowed categories",
15
+ spendLimit: "Spend limit",
16
+ perTransactionMax: "Per-transaction max",
14
17
  emptyValue: "—",
15
18
  copyCardholderAriaLabel: "Copy cardholder",
16
19
  copyNicknameAriaLabel: "Copy nickname",
@@ -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.3.37", n = "8beb54f0f2b2664f6714ea6ff9dcdd3b10246180", r = Object.freeze({
2
+ var e = "@tesouro/embedded-components-react", t = "0.3.38", n = "7a64fdfcc04902cd65bace1dd767edac043debe5", 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.3.37",
3
+ "version": "0.3.38",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "packageDepSync": {