@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 +16 -0
- package/dist/lib/CardDetailsWidget.d.ts +16 -0
- package/dist/lib/CardsWidget.d.ts +16 -0
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index3.js +19 -8
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index4.js +31 -15
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index5.js +12 -1
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index6.js +3 -0
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsPanel.js +151 -124
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/labels.js +3 -0
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
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 {
|
package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index3.js
CHANGED
|
@@ -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
|
|
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
|
|
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
|
|
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 {
|
|
46
|
+
export { a as copyTextToClipboard, r as formatCardNumber, i as formatExpirationDate, o as formatVelocityControlAmount, n as maskCardNumber };
|
package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index4.js
CHANGED
|
@@ -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 {
|
|
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
|
|
6
|
+
var i = {
|
|
7
7
|
Supported: "supported",
|
|
8
8
|
Missing: "missing",
|
|
9
9
|
Unsupported: "unsupported"
|
|
10
10
|
};
|
|
11
|
-
function
|
|
12
|
-
return t === e.Credit || t === e.Debit ?
|
|
11
|
+
function a(t) {
|
|
12
|
+
return t === e.Credit || t === e.Debit ? i.Supported : t == null ? i.Missing : i.Unsupported;
|
|
13
13
|
}
|
|
14
|
-
function
|
|
15
|
-
return e ===
|
|
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
|
|
18
|
-
function
|
|
19
|
-
return t !== "loaded" || n !== e.Debit || r === void 0 ? !1 : r !==
|
|
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
|
|
21
|
+
function l({ isRevealRequested: e, isError: t, hasCredentials: n }) {
|
|
22
22
|
return e ? t ? "errored" : n ? "revealed" : "revealing" : "hidden";
|
|
23
23
|
}
|
|
24
|
-
function
|
|
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[
|
|
31
|
-
maskedCardNumber:
|
|
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 {
|
|
53
|
+
export { i as CardProgramValidity, c as resolveCanRevealCredentials, o as resolveCardDetailsPanelState, u as resolveCardDetailsPresentation, l as resolveCardDetailsRevealState, a as resolveCardProgramValidity };
|
package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index5.js
CHANGED
|
@@ -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
|
}
|
package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index6.js
CHANGED
|
@@ -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 {
|
|
6
|
-
import { EmptyState as
|
|
7
|
-
import { ErrorState as
|
|
8
|
-
import { InlineErrorAlert as
|
|
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
|
|
11
|
-
import { CardDetailsHeader as
|
|
12
|
-
import { CARD_FACE_WIDTH_CLASS_NAME as
|
|
13
|
-
import { CardFace as
|
|
14
|
-
import { DetailCopyRow as
|
|
15
|
-
import { resolveCardDetailsPanelLabels as
|
|
16
|
-
import { CardCredentialsFace as
|
|
17
|
-
import { CardFaceFlip as
|
|
18
|
-
import { useMemo as
|
|
19
|
-
import { jsx as
|
|
20
|
-
import { CreditCardIcon as
|
|
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
|
|
23
|
-
let
|
|
24
|
-
bankLogoSrc:
|
|
25
|
-
bankLogoAlt:
|
|
26
|
-
cardholderName:
|
|
27
|
-
maskedCardNumber:
|
|
28
|
-
programLabel:
|
|
29
|
-
statusLabel:
|
|
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__ */
|
|
32
|
-
"data-testid":
|
|
33
|
-
className:
|
|
34
|
-
children: [/* @__PURE__ */
|
|
35
|
-
labels:
|
|
36
|
-
title:
|
|
37
|
-
isTitlePending:
|
|
38
|
-
statusLabel:
|
|
39
|
-
statusTone:
|
|
40
|
-
formFactorLabel:
|
|
41
|
-
cardMenu:
|
|
42
|
-
onClose:
|
|
43
|
-
}), /* @__PURE__ */
|
|
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:
|
|
46
|
-
"data-testid":
|
|
45
|
+
children: S === "loading" ? /* @__PURE__ */ h("div", {
|
|
46
|
+
"data-testid": o.loading,
|
|
47
47
|
role: "status",
|
|
48
|
-
"aria-label":
|
|
48
|
+
"aria-label": q.status.loadingAriaLabel,
|
|
49
49
|
className: "ttw:space-y-4",
|
|
50
|
-
children: [/* @__PURE__ */
|
|
51
|
-
}) :
|
|
52
|
-
title:
|
|
53
|
-
description:
|
|
54
|
-
retryLabel:
|
|
55
|
-
onRetry:
|
|
56
|
-
}) :
|
|
57
|
-
icon: /* @__PURE__ */
|
|
58
|
-
title:
|
|
59
|
-
description:
|
|
60
|
-
}) : /* @__PURE__ */
|
|
61
|
-
className: "ttw:flex ttw:flex-col ttw:
|
|
62
|
-
children: [/* @__PURE__ */
|
|
63
|
-
className: "ttw:flex ttw:
|
|
64
|
-
children: /* @__PURE__ */
|
|
65
|
-
className:
|
|
66
|
-
children:
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
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
|
-
|
|
93
|
-
|
|
94
|
-
|
|
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
|
-
}),
|
|
101
|
-
})
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
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__ */
|
|
111
|
-
|
|
112
|
-
|
|
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
|
-
|
|
124
|
-
label:
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
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__ */
|
|
131
|
-
label:
|
|
132
|
-
isLast: !
|
|
133
|
-
children: /* @__PURE__ */
|
|
134
|
-
className: "ttw:flex ttw:flex-
|
|
135
|
-
children:
|
|
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 {
|
|
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",
|
package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
CHANGED
|
@@ -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.
|
|
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
|