@tesouro/embedded-components-react 0.2.322 → 0.2.323
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.css +72 -0
- package/dist/index.d.ts +19 -0
- package/dist/lib/CardDetailsWidget.d.ts +19 -0
- package/dist/lib/CardsWidget.d.ts +19 -0
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/index.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardCredentialRow.js +29 -0
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardCredentialsFace.js +38 -0
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsHeader.js +5 -5
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsPanel.js +111 -76
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardFace.js +20 -21
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardFaceFlip.js +27 -0
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardFaceGlow.js +10 -0
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/cardFaceSurface.js +4 -0
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/labels.js +18 -1
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/testIds.js +2 -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.css
CHANGED
|
@@ -1583,6 +1583,10 @@
|
|
|
1583
1583
|
.ttw\:rotate-45 {
|
|
1584
1584
|
rotate: 45deg;
|
|
1585
1585
|
}
|
|
1586
|
+
.ttw\:rotate-y-180 {
|
|
1587
|
+
--tw-rotate-y: rotateY(180deg);
|
|
1588
|
+
transform: var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);
|
|
1589
|
+
}
|
|
1586
1590
|
.ttw\:\[transform\:translateZ\(0\)\] {
|
|
1587
1591
|
transform: translateZ(0);
|
|
1588
1592
|
}
|
|
@@ -3413,6 +3417,12 @@
|
|
|
3413
3417
|
.ttw\:text-white {
|
|
3414
3418
|
color: var(--ttw-color-white);
|
|
3415
3419
|
}
|
|
3420
|
+
.ttw\:text-white\/70 {
|
|
3421
|
+
color: var(--ttw-color-white);
|
|
3422
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
3423
|
+
color: color-mix(in oklab, var(--ttw-color-white) 70%, transparent);
|
|
3424
|
+
}
|
|
3425
|
+
}
|
|
3416
3426
|
.ttw\:text-white\/90 {
|
|
3417
3427
|
color: var(--ttw-color-white);
|
|
3418
3428
|
@supports (color: color-mix(in lab, red, red)) {
|
|
@@ -3449,6 +3459,9 @@
|
|
|
3449
3459
|
.ttw\:normal-case {
|
|
3450
3460
|
text-transform: none;
|
|
3451
3461
|
}
|
|
3462
|
+
.ttw\:uppercase {
|
|
3463
|
+
text-transform: uppercase;
|
|
3464
|
+
}
|
|
3452
3465
|
.ttw\:not-italic {
|
|
3453
3466
|
font-style: normal;
|
|
3454
3467
|
}
|
|
@@ -3738,6 +3751,15 @@
|
|
|
3738
3751
|
.ttw\:\[--cell-size\:--spacing\(8\)\] {
|
|
3739
3752
|
--cell-size: calc(var(--ttw-spacing) * 8);
|
|
3740
3753
|
}
|
|
3754
|
+
.ttw\:backface-hidden {
|
|
3755
|
+
backface-visibility: hidden;
|
|
3756
|
+
}
|
|
3757
|
+
.ttw\:perspective-\[1000px\] {
|
|
3758
|
+
perspective: 1000px;
|
|
3759
|
+
}
|
|
3760
|
+
.ttw\:transform-3d {
|
|
3761
|
+
transform-style: preserve-3d;
|
|
3762
|
+
}
|
|
3741
3763
|
.ttw\:group-focus-within\/menu-item\:opacity-100:is(:where(.ttw\:group\/menu-item):focus-within *) {
|
|
3742
3764
|
opacity: 100%;
|
|
3743
3765
|
}
|
|
@@ -4334,6 +4356,14 @@
|
|
|
4334
4356
|
.ttw\:hover\:bg-transparent:hover {
|
|
4335
4357
|
background-color: transparent;
|
|
4336
4358
|
}
|
|
4359
|
+
.ttw\:hover\:bg-white\/10:hover {
|
|
4360
|
+
background-color: var(--ttw-color-white);
|
|
4361
|
+
}
|
|
4362
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
4363
|
+
.ttw\:hover\:bg-white\/10:hover {
|
|
4364
|
+
background-color: color-mix(in oklab, var(--ttw-color-white) 10%, transparent);
|
|
4365
|
+
}
|
|
4366
|
+
}
|
|
4337
4367
|
.ttw\:hover\:bg-zinc-50:hover {
|
|
4338
4368
|
background-color: var(--ttw-color-zinc-50);
|
|
4339
4369
|
}
|
|
@@ -4511,6 +4541,12 @@
|
|
|
4511
4541
|
--tw-ring-color: color-mix(in oklab, var(--ttw-ring) 50%, transparent);
|
|
4512
4542
|
}
|
|
4513
4543
|
}
|
|
4544
|
+
.ttw\:focus-visible\:ring-white\/70:focus-visible {
|
|
4545
|
+
--tw-ring-color: var(--ttw-color-white);
|
|
4546
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
4547
|
+
--tw-ring-color: color-mix(in oklab, var(--ttw-color-white) 70%, transparent);
|
|
4548
|
+
}
|
|
4549
|
+
}
|
|
4514
4550
|
.ttw\:focus-visible\:ring-zinc-400\/50:focus-visible {
|
|
4515
4551
|
--tw-ring-color: var(--ttw-color-zinc-400);
|
|
4516
4552
|
@supports (color: color-mix(in lab, red, red)) {
|
|
@@ -5379,6 +5415,17 @@
|
|
|
5379
5415
|
.ttw\:nth-last-2\:-mt-1:nth-last-child(2) {
|
|
5380
5416
|
margin-top: calc(var(--ttw-spacing) * -1);
|
|
5381
5417
|
}
|
|
5418
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
5419
|
+
.ttw\:motion-safe\:transition-transform {
|
|
5420
|
+
transition-property: transform, translate, scale, rotate;
|
|
5421
|
+
transition-timing-function: var(--tw-ease, var(--ttw-default-transition-timing-function));
|
|
5422
|
+
transition-duration: var(--tw-duration, var(--ttw-default-transition-duration));
|
|
5423
|
+
}
|
|
5424
|
+
.ttw\:motion-safe\:duration-500 {
|
|
5425
|
+
--tw-duration: 500ms;
|
|
5426
|
+
transition-duration: 500ms;
|
|
5427
|
+
}
|
|
5428
|
+
}
|
|
5382
5429
|
@media (width >= 40rem) {
|
|
5383
5430
|
.ttw\:sm\:flex {
|
|
5384
5431
|
display: flex;
|
|
@@ -6365,6 +6412,26 @@
|
|
|
6365
6412
|
inherits: false;
|
|
6366
6413
|
initial-value: 0;
|
|
6367
6414
|
}
|
|
6415
|
+
@property --tw-rotate-x {
|
|
6416
|
+
syntax: "*";
|
|
6417
|
+
inherits: false;
|
|
6418
|
+
}
|
|
6419
|
+
@property --tw-rotate-y {
|
|
6420
|
+
syntax: "*";
|
|
6421
|
+
inherits: false;
|
|
6422
|
+
}
|
|
6423
|
+
@property --tw-rotate-z {
|
|
6424
|
+
syntax: "*";
|
|
6425
|
+
inherits: false;
|
|
6426
|
+
}
|
|
6427
|
+
@property --tw-skew-x {
|
|
6428
|
+
syntax: "*";
|
|
6429
|
+
inherits: false;
|
|
6430
|
+
}
|
|
6431
|
+
@property --tw-skew-y {
|
|
6432
|
+
syntax: "*";
|
|
6433
|
+
inherits: false;
|
|
6434
|
+
}
|
|
6368
6435
|
@property --tw-space-y-reverse {
|
|
6369
6436
|
syntax: "*";
|
|
6370
6437
|
inherits: false;
|
|
@@ -6641,6 +6708,11 @@
|
|
|
6641
6708
|
--tw-translate-x: 0;
|
|
6642
6709
|
--tw-translate-y: 0;
|
|
6643
6710
|
--tw-translate-z: 0;
|
|
6711
|
+
--tw-rotate-x: initial;
|
|
6712
|
+
--tw-rotate-y: initial;
|
|
6713
|
+
--tw-rotate-z: initial;
|
|
6714
|
+
--tw-skew-x: initial;
|
|
6715
|
+
--tw-skew-y: initial;
|
|
6644
6716
|
--tw-space-y-reverse: 0;
|
|
6645
6717
|
--tw-space-x-reverse: 0;
|
|
6646
6718
|
--tw-divide-y-reverse: 0;
|
package/dist/index.d.ts
CHANGED
|
@@ -2067,6 +2067,24 @@ interface CardDetailsFieldLabels {
|
|
|
2067
2067
|
interface CardDetailsActionLabels {
|
|
2068
2068
|
/** Primary control that opens the Activate Card form. */
|
|
2069
2069
|
activateCard: string;
|
|
2070
|
+
/** Secondary control that asks the owner to reveal the card's credentials. */
|
|
2071
|
+
viewCard: string;
|
|
2072
|
+
/** The same control, once the credentials are on screen. */
|
|
2073
|
+
hideCard: string;
|
|
2074
|
+
}
|
|
2075
|
+
/**
|
|
2076
|
+
* Copy for the revealed card credentials. The values themselves never have a
|
|
2077
|
+
* default here — the panel is handed them or renders the field blank.
|
|
2078
|
+
*/
|
|
2079
|
+
interface CardDetailsCredentialsLabels {
|
|
2080
|
+
cardNumber: string;
|
|
2081
|
+
expirationDate: string;
|
|
2082
|
+
securityCode: string;
|
|
2083
|
+
copyCardNumberAriaLabel: string;
|
|
2084
|
+
copyExpirationDateAriaLabel: string;
|
|
2085
|
+
copySecurityCodeAriaLabel: string;
|
|
2086
|
+
/** Shown next to the control when the reveal failed. */
|
|
2087
|
+
errorDescription: string;
|
|
2070
2088
|
}
|
|
2071
2089
|
/** Copy for the three non-loaded screens. */
|
|
2072
2090
|
interface CardDetailsStatusScreenLabels {
|
|
@@ -2083,6 +2101,7 @@ interface CardDetailsPanelLabels {
|
|
|
2083
2101
|
cardFace: CardDetailsCardFaceLabels;
|
|
2084
2102
|
fields: CardDetailsFieldLabels;
|
|
2085
2103
|
actions: CardDetailsActionLabels;
|
|
2104
|
+
credentials: CardDetailsCredentialsLabels;
|
|
2086
2105
|
status: CardDetailsStatusScreenLabels;
|
|
2087
2106
|
}
|
|
2088
2107
|
|
|
@@ -32,6 +32,24 @@ interface CardDetailsFieldLabels {
|
|
|
32
32
|
interface CardDetailsActionLabels {
|
|
33
33
|
/** Primary control that opens the Activate Card form. */
|
|
34
34
|
activateCard: string;
|
|
35
|
+
/** Secondary control that asks the owner to reveal the card's credentials. */
|
|
36
|
+
viewCard: string;
|
|
37
|
+
/** The same control, once the credentials are on screen. */
|
|
38
|
+
hideCard: string;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Copy for the revealed card credentials. The values themselves never have a
|
|
42
|
+
* default here — the panel is handed them or renders the field blank.
|
|
43
|
+
*/
|
|
44
|
+
interface CardDetailsCredentialsLabels {
|
|
45
|
+
cardNumber: string;
|
|
46
|
+
expirationDate: string;
|
|
47
|
+
securityCode: string;
|
|
48
|
+
copyCardNumberAriaLabel: string;
|
|
49
|
+
copyExpirationDateAriaLabel: string;
|
|
50
|
+
copySecurityCodeAriaLabel: string;
|
|
51
|
+
/** Shown next to the control when the reveal failed. */
|
|
52
|
+
errorDescription: string;
|
|
35
53
|
}
|
|
36
54
|
/** Copy for the three non-loaded screens. */
|
|
37
55
|
interface CardDetailsStatusScreenLabels {
|
|
@@ -48,6 +66,7 @@ interface CardDetailsPanelLabels {
|
|
|
48
66
|
cardFace: CardDetailsCardFaceLabels;
|
|
49
67
|
fields: CardDetailsFieldLabels;
|
|
50
68
|
actions: CardDetailsActionLabels;
|
|
69
|
+
credentials: CardDetailsCredentialsLabels;
|
|
51
70
|
status: CardDetailsStatusScreenLabels;
|
|
52
71
|
}
|
|
53
72
|
|
|
@@ -758,6 +758,24 @@ interface CardDetailsFieldLabels {
|
|
|
758
758
|
interface CardDetailsActionLabels {
|
|
759
759
|
/** Primary control that opens the Activate Card form. */
|
|
760
760
|
activateCard: string;
|
|
761
|
+
/** Secondary control that asks the owner to reveal the card's credentials. */
|
|
762
|
+
viewCard: string;
|
|
763
|
+
/** The same control, once the credentials are on screen. */
|
|
764
|
+
hideCard: string;
|
|
765
|
+
}
|
|
766
|
+
/**
|
|
767
|
+
* Copy for the revealed card credentials. The values themselves never have a
|
|
768
|
+
* default here — the panel is handed them or renders the field blank.
|
|
769
|
+
*/
|
|
770
|
+
interface CardDetailsCredentialsLabels {
|
|
771
|
+
cardNumber: string;
|
|
772
|
+
expirationDate: string;
|
|
773
|
+
securityCode: string;
|
|
774
|
+
copyCardNumberAriaLabel: string;
|
|
775
|
+
copyExpirationDateAriaLabel: string;
|
|
776
|
+
copySecurityCodeAriaLabel: string;
|
|
777
|
+
/** Shown next to the control when the reveal failed. */
|
|
778
|
+
errorDescription: string;
|
|
761
779
|
}
|
|
762
780
|
/** Copy for the three non-loaded screens. */
|
|
763
781
|
interface CardDetailsStatusScreenLabels {
|
|
@@ -774,6 +792,7 @@ interface CardDetailsPanelLabels {
|
|
|
774
792
|
cardFace: CardDetailsCardFaceLabels;
|
|
775
793
|
fields: CardDetailsFieldLabels;
|
|
776
794
|
actions: CardDetailsActionLabels;
|
|
795
|
+
credentials: CardDetailsCredentialsLabels;
|
|
777
796
|
status: CardDetailsStatusScreenLabels;
|
|
778
797
|
}
|
|
779
798
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./lib/CardDetailsPanel/statusBadge.js";
|
|
2
1
|
import "./lib/CardDetailsPanel/testIds.js";
|
|
2
|
+
import "./lib/CardDetailsPanel/statusBadge.js";
|
|
3
3
|
import "./lib/CardDetailsPanel/CardDetailsHeader.js";
|
|
4
4
|
import "./lib/CardDetailsPanel/CardFace.js";
|
|
5
5
|
import "./lib/CardDetailsPanel/DetailCopyRow.js";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
2
|
+
import { CopyIcon as n } from "lucide-react";
|
|
3
|
+
//#region ../../libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardCredentialRow.js
|
|
4
|
+
function r({ label: r, value: i, copyAriaLabel: a, onCopy: o }) {
|
|
5
|
+
return /* @__PURE__ */ t("div", {
|
|
6
|
+
className: "ttw:relative ttw:flex ttw:min-w-0 ttw:items-end ttw:justify-between ttw:gap-2",
|
|
7
|
+
children: [/* @__PURE__ */ t("div", {
|
|
8
|
+
className: "ttw:min-w-0",
|
|
9
|
+
children: [/* @__PURE__ */ e("p", {
|
|
10
|
+
className: "ttw:text-[10px] ttw:font-medium ttw:tracking-wide ttw:text-white/70 ttw:uppercase",
|
|
11
|
+
children: r
|
|
12
|
+
}), /* @__PURE__ */ e("p", {
|
|
13
|
+
className: "ttw:mt-0.5 ttw:truncate ttw:text-base ttw:tracking-wide ttw:text-white",
|
|
14
|
+
children: i
|
|
15
|
+
})]
|
|
16
|
+
}), i && o ? /* @__PURE__ */ e("button", {
|
|
17
|
+
type: "button",
|
|
18
|
+
"aria-label": a,
|
|
19
|
+
onClick: () => o(i),
|
|
20
|
+
className: "ttw:inline-flex ttw:size-7 ttw:shrink-0 ttw:cursor-pointer ttw:items-center ttw:justify-center ttw:rounded-md ttw:text-white/70 ttw:transition-colors ttw:hover:bg-white/10 ttw:hover:text-white ttw:focus-visible:ring-2 ttw:focus-visible:ring-white/70 ttw:focus-visible:outline-none",
|
|
21
|
+
children: /* @__PURE__ */ e(n, {
|
|
22
|
+
className: "ttw:size-3.5",
|
|
23
|
+
"aria-hidden": "true"
|
|
24
|
+
})
|
|
25
|
+
}) : null]
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
export { r as CardCredentialRow };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { cn as e } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
|
+
import { cardDetailsWidgetUiTestIds as t } from "./testIds.js";
|
|
3
|
+
import { CARD_FACE_SURFACE_CLASS_NAME as n } from "./cardFaceSurface.js";
|
|
4
|
+
import { CardFaceGlow as r } from "./CardFaceGlow.js";
|
|
5
|
+
import { CardCredentialRow as i } from "./CardCredentialRow.js";
|
|
6
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
|
+
//#region ../../libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardCredentialsFace.js
|
|
8
|
+
function s({ labels: s, cardNumber: c, expirationDate: l, securityCode: u, onCopy: d, className: f }) {
|
|
9
|
+
return /* @__PURE__ */ o("div", {
|
|
10
|
+
"data-testid": t.credentialsFace,
|
|
11
|
+
className: e(n, "ttw:justify-center ttw:gap-4", f),
|
|
12
|
+
children: [
|
|
13
|
+
/* @__PURE__ */ a(r, {}),
|
|
14
|
+
/* @__PURE__ */ a(i, {
|
|
15
|
+
label: s.cardNumber,
|
|
16
|
+
value: c,
|
|
17
|
+
copyAriaLabel: s.copyCardNumberAriaLabel,
|
|
18
|
+
onCopy: d
|
|
19
|
+
}),
|
|
20
|
+
/* @__PURE__ */ o("div", {
|
|
21
|
+
className: "ttw:relative ttw:grid ttw:grid-cols-2 ttw:gap-3",
|
|
22
|
+
children: [/* @__PURE__ */ a(i, {
|
|
23
|
+
label: s.expirationDate,
|
|
24
|
+
value: l,
|
|
25
|
+
copyAriaLabel: s.copyExpirationDateAriaLabel,
|
|
26
|
+
onCopy: d
|
|
27
|
+
}), /* @__PURE__ */ a(i, {
|
|
28
|
+
label: s.securityCode,
|
|
29
|
+
value: u,
|
|
30
|
+
copyAriaLabel: s.copySecurityCodeAriaLabel,
|
|
31
|
+
onCopy: d
|
|
32
|
+
})]
|
|
33
|
+
})
|
|
34
|
+
]
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
//#endregion
|
|
38
|
+
export { s as CardCredentialsFace };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Badge as e, Button as t, DropdownMenu as n, DropdownMenuContent as r, DropdownMenuTrigger as i, Skeleton as a } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { cardDetailsWidgetUiTestIds as o } from "./testIds.js";
|
|
3
|
+
import { cardStatusToneClassName as s } from "./statusBadge.js";
|
|
4
4
|
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
5
5
|
import { EllipsisVerticalIcon as u, XIcon as d } from "lucide-react";
|
|
6
6
|
//#region ../../libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsHeader.js
|
|
@@ -16,7 +16,7 @@ function f({ labels: f, title: p, isTitlePending: m, statusLabel: h, statusTone:
|
|
|
16
16
|
className: "ttw:truncate ttw:text-2xl ttw:font-semibold ttw:tracking-[-0.6px] ttw:text-foreground",
|
|
17
17
|
children: p
|
|
18
18
|
}) : null, h ? /* @__PURE__ */ c(e, {
|
|
19
|
-
className:
|
|
19
|
+
className: s(g ?? "neutral"),
|
|
20
20
|
children: h
|
|
21
21
|
}) : null]
|
|
22
22
|
}), _ ? /* @__PURE__ */ c("p", {
|
|
@@ -32,7 +32,7 @@ function f({ labels: f, title: p, isTitlePending: m, statusLabel: h, statusTone:
|
|
|
32
32
|
size: "icon",
|
|
33
33
|
className: "ttw:size-8 ttw:shrink-0 ttw:bg-muted",
|
|
34
34
|
"aria-label": f.menuTriggerAriaLabel,
|
|
35
|
-
"data-testid":
|
|
35
|
+
"data-testid": o.menuTrigger,
|
|
36
36
|
children: /* @__PURE__ */ c(u, { className: "ttw:size-4" })
|
|
37
37
|
})
|
|
38
38
|
}), /* @__PURE__ */ c(r, {
|
|
@@ -45,7 +45,7 @@ function f({ labels: f, title: p, isTitlePending: m, statusLabel: h, statusTone:
|
|
|
45
45
|
size: "icon",
|
|
46
46
|
className: "ttw:size-8 ttw:shrink-0",
|
|
47
47
|
"aria-label": f.closeAriaLabel,
|
|
48
|
-
"data-testid":
|
|
48
|
+
"data-testid": o.closeButton,
|
|
49
49
|
onClick: y,
|
|
50
50
|
children: /* @__PURE__ */ c(d, { className: "ttw:size-4" })
|
|
51
51
|
}) : null
|
|
@@ -5,97 +5,132 @@
|
|
|
5
5
|
import { Badge as e, Button as t, Skeleton as n, cn as r } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
6
|
import { EmptyState as i } from "../../../../../shared/ui/dist/lib/EmptyState/EmptyState.js";
|
|
7
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";
|
|
8
9
|
import "../../../../../shared/ui/dist/index.js";
|
|
9
|
-
import { cardDetailsWidgetUiTestIds as
|
|
10
|
-
import { CardDetailsHeader as
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
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";
|
|
17
21
|
//#region ../../libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsPanel.js
|
|
18
|
-
function
|
|
19
|
-
let
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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, billingAddress: F, allowedCategories: I, onCopy: L, onActivate: R, onViewCard: z, onHideCard: B, isViewCardDisabled: V, revealState: H = "hidden", revealedCardNumber: U, revealedExpirationDate: W, revealedSecurityCode: G, onRetry: K, className: q }) {
|
|
23
|
+
let J = h(() => f(S), [S]), Y = !!I?.length, X = H === "revealed", Z = X ? B : z, Q = /* @__PURE__ */ g(u, {
|
|
24
|
+
bankLogoSrc: A,
|
|
25
|
+
bankLogoAlt: j ?? J.cardFace.bankLogoAlt,
|
|
26
|
+
cardholderName: M ?? "",
|
|
27
|
+
maskedCardNumber: N ?? "",
|
|
28
|
+
programLabel: P ?? ""
|
|
29
|
+
});
|
|
30
|
+
return /* @__PURE__ */ _("div", {
|
|
31
|
+
"data-testid": s.panel,
|
|
32
|
+
className: r("ttw:flex ttw:w-full ttw:flex-col", q),
|
|
33
|
+
children: [/* @__PURE__ */ g(c, {
|
|
34
|
+
labels: J.header,
|
|
35
|
+
title: C === "loaded" ? w ?? J.header.untitledCard : void 0,
|
|
36
|
+
isTitlePending: C === "loading",
|
|
37
|
+
statusLabel: C === "loaded" ? T : void 0,
|
|
38
|
+
statusTone: E,
|
|
39
|
+
formFactorLabel: C === "loaded" ? D : void 0,
|
|
40
|
+
cardMenu: C === "loaded" ? O : void 0,
|
|
41
|
+
onClose: k
|
|
42
|
+
}), /* @__PURE__ */ g("div", {
|
|
33
43
|
className: "ttw:px-4 ttw:pb-4",
|
|
34
|
-
children:
|
|
35
|
-
"data-testid":
|
|
44
|
+
children: C === "loading" ? /* @__PURE__ */ _("div", {
|
|
45
|
+
"data-testid": s.loading,
|
|
36
46
|
role: "status",
|
|
37
|
-
"aria-label":
|
|
47
|
+
"aria-label": J.status.loadingAriaLabel,
|
|
38
48
|
className: "ttw:space-y-4",
|
|
39
|
-
children: [/* @__PURE__ */
|
|
40
|
-
}) :
|
|
41
|
-
title:
|
|
42
|
-
description:
|
|
43
|
-
retryLabel:
|
|
44
|
-
onRetry:
|
|
45
|
-
}) :
|
|
46
|
-
icon: /* @__PURE__ */
|
|
47
|
-
title:
|
|
48
|
-
description:
|
|
49
|
-
}) : /* @__PURE__ */
|
|
49
|
+
children: [/* @__PURE__ */ g(n, { className: "ttw:h-8 ttw:w-56" }), /* @__PURE__ */ g(n, { className: "ttw:h-64 ttw:w-full ttw:rounded-xl" })]
|
|
50
|
+
}) : C === "error" ? /* @__PURE__ */ g(a, {
|
|
51
|
+
title: J.status.errorTitle,
|
|
52
|
+
description: J.status.errorDescription,
|
|
53
|
+
retryLabel: J.status.errorRetry,
|
|
54
|
+
onRetry: K
|
|
55
|
+
}) : C === "notFound" ? /* @__PURE__ */ g(i, {
|
|
56
|
+
icon: /* @__PURE__ */ g(v, { className: "ttw:size-6 ttw:text-muted-foreground" }),
|
|
57
|
+
title: J.status.notFoundTitle,
|
|
58
|
+
description: J.status.notFoundDescription
|
|
59
|
+
}) : /* @__PURE__ */ _("div", {
|
|
50
60
|
className: "ttw:flex ttw:flex-col ttw:overflow-hidden ttw:rounded-xl ttw:border ttw:border-border ttw:sm:flex-row",
|
|
51
|
-
children: [/* @__PURE__ */
|
|
61
|
+
children: [/* @__PURE__ */ g("div", {
|
|
52
62
|
className: "ttw:flex ttw:items-center ttw:justify-center ttw:bg-muted ttw:px-4 ttw:py-5",
|
|
53
|
-
children: /* @__PURE__ */
|
|
54
|
-
className: "ttw:flex ttw:flex-col ttw:gap-4",
|
|
55
|
-
children: [/* @__PURE__ */
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
63
|
+
children: /* @__PURE__ */ _("div", {
|
|
64
|
+
className: r("ttw:flex ttw:flex-col ttw:gap-4", l),
|
|
65
|
+
children: [z ? /* @__PURE__ */ g(m, {
|
|
66
|
+
isFlipped: X,
|
|
67
|
+
front: Q,
|
|
68
|
+
back: /* @__PURE__ */ g(p, {
|
|
69
|
+
labels: J.credentials,
|
|
70
|
+
cardNumber: U,
|
|
71
|
+
expirationDate: W,
|
|
72
|
+
securityCode: G,
|
|
73
|
+
onCopy: L
|
|
74
|
+
})
|
|
75
|
+
}) : Q, R || z ? /* @__PURE__ */ _("div", {
|
|
76
|
+
className: "ttw:flex ttw:flex-col ttw:gap-2",
|
|
77
|
+
children: [
|
|
78
|
+
R ? /* @__PURE__ */ _(t, {
|
|
79
|
+
type: "button",
|
|
80
|
+
onClick: R,
|
|
81
|
+
children: [/* @__PURE__ */ g(x, {
|
|
82
|
+
className: "ttw:size-4",
|
|
83
|
+
"aria-hidden": "true"
|
|
84
|
+
}), J.actions.activateCard]
|
|
85
|
+
}) : null,
|
|
86
|
+
z ? /* @__PURE__ */ g("div", {
|
|
87
|
+
className: "ttw:flex ttw:gap-2",
|
|
88
|
+
children: /* @__PURE__ */ _(t, {
|
|
89
|
+
type: "button",
|
|
90
|
+
variant: "outline",
|
|
91
|
+
className: "ttw:flex-1",
|
|
92
|
+
disabled: V || !Z,
|
|
93
|
+
loading: H === "revealing",
|
|
94
|
+
onClick: Z,
|
|
95
|
+
children: [g(X ? b : y, {
|
|
96
|
+
className: "ttw:size-4",
|
|
97
|
+
"aria-hidden": "true"
|
|
98
|
+
}), X ? J.actions.hideCard : J.actions.viewCard]
|
|
99
|
+
})
|
|
100
|
+
}) : null,
|
|
101
|
+
H === "errored" ? /* @__PURE__ */ g(o, { children: J.credentials.errorDescription }) : null
|
|
102
|
+
]
|
|
68
103
|
}) : null]
|
|
69
104
|
})
|
|
70
|
-
}), /* @__PURE__ */
|
|
105
|
+
}), /* @__PURE__ */ _("div", {
|
|
71
106
|
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",
|
|
72
107
|
children: [
|
|
73
|
-
/* @__PURE__ */
|
|
74
|
-
label:
|
|
75
|
-
copyAriaLabel:
|
|
76
|
-
onCopy:
|
|
77
|
-
children:
|
|
108
|
+
/* @__PURE__ */ g(d, {
|
|
109
|
+
label: J.fields.cardholder,
|
|
110
|
+
copyAriaLabel: M && L ? J.fields.copyCardholderAriaLabel : void 0,
|
|
111
|
+
onCopy: M && L ? () => L(M) : void 0,
|
|
112
|
+
children: M ?? J.fields.emptyValue
|
|
78
113
|
}),
|
|
79
|
-
/* @__PURE__ */
|
|
80
|
-
label:
|
|
81
|
-
copyAriaLabel:
|
|
82
|
-
onCopy:
|
|
83
|
-
isLast: !
|
|
84
|
-
children:
|
|
114
|
+
/* @__PURE__ */ g(d, {
|
|
115
|
+
label: J.fields.nickname,
|
|
116
|
+
copyAriaLabel: w && L ? J.fields.copyNicknameAriaLabel : void 0,
|
|
117
|
+
onCopy: w && L ? () => L(w) : void 0,
|
|
118
|
+
isLast: !F && !Y,
|
|
119
|
+
children: w ?? J.fields.emptyValue
|
|
85
120
|
}),
|
|
86
|
-
|
|
87
|
-
label:
|
|
88
|
-
copyAriaLabel:
|
|
89
|
-
onCopy:
|
|
90
|
-
isLast: !
|
|
91
|
-
children:
|
|
121
|
+
F ? /* @__PURE__ */ g(d, {
|
|
122
|
+
label: J.fields.billingAddress,
|
|
123
|
+
copyAriaLabel: L ? J.fields.copyBillingAddressAriaLabel : void 0,
|
|
124
|
+
onCopy: L ? () => L(F) : void 0,
|
|
125
|
+
isLast: !Y,
|
|
126
|
+
children: F
|
|
92
127
|
}) : null,
|
|
93
|
-
|
|
94
|
-
label:
|
|
128
|
+
Y ? /* @__PURE__ */ g(d, {
|
|
129
|
+
label: J.fields.allowedCategories,
|
|
95
130
|
isLast: !0,
|
|
96
|
-
children: /* @__PURE__ */
|
|
131
|
+
children: /* @__PURE__ */ g("div", {
|
|
97
132
|
className: "ttw:flex ttw:flex-wrap ttw:gap-2",
|
|
98
|
-
children:
|
|
133
|
+
children: I?.map((t) => /* @__PURE__ */ g(e, {
|
|
99
134
|
variant: "secondary",
|
|
100
135
|
children: t
|
|
101
136
|
}, t))
|
|
@@ -108,4 +143,4 @@ function g({ labels: g, state: _, nickname: v, statusLabel: y, statusTone: b, fo
|
|
|
108
143
|
});
|
|
109
144
|
}
|
|
110
145
|
//#endregion
|
|
111
|
-
export {
|
|
146
|
+
export { S as CardDetailsPanel };
|
|
@@ -1,39 +1,38 @@
|
|
|
1
1
|
import { cn as e } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
2
|
import { cardDetailsWidgetUiTestIds as t } from "./testIds.js";
|
|
3
|
-
import {
|
|
3
|
+
import { CARD_FACE_SURFACE_CLASS_NAME as n } from "./cardFaceSurface.js";
|
|
4
|
+
import { CardFaceGlow as r } from "./CardFaceGlow.js";
|
|
5
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
4
6
|
//#region ../../libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardFace.js
|
|
5
|
-
function
|
|
6
|
-
return /* @__PURE__ */
|
|
7
|
+
function o({ bankLogoSrc: o, bankLogoAlt: s, cardholderName: c, maskedCardNumber: l, programLabel: u, className: d }) {
|
|
8
|
+
return /* @__PURE__ */ a("div", {
|
|
7
9
|
"data-testid": t.cardFace,
|
|
8
|
-
className: e("ttw:
|
|
10
|
+
className: e(n, "ttw:justify-between", d),
|
|
9
11
|
children: [
|
|
10
|
-
/* @__PURE__ */
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
i ? /* @__PURE__ */ n("img", {
|
|
15
|
-
src: i,
|
|
16
|
-
alt: a,
|
|
12
|
+
/* @__PURE__ */ i(r, {}),
|
|
13
|
+
o ? /* @__PURE__ */ i("img", {
|
|
14
|
+
src: o,
|
|
15
|
+
alt: s,
|
|
17
16
|
className: "ttw:relative ttw:h-8 ttw:w-auto ttw:max-w-[60%] ttw:object-contain ttw:object-left"
|
|
18
|
-
}) : /* @__PURE__ */
|
|
19
|
-
/* @__PURE__ */
|
|
17
|
+
}) : /* @__PURE__ */ i("span", { className: "ttw:relative ttw:h-8" }),
|
|
18
|
+
/* @__PURE__ */ a("div", {
|
|
20
19
|
className: "ttw:relative ttw:flex ttw:items-end ttw:justify-between ttw:gap-3",
|
|
21
|
-
children: [/* @__PURE__ */
|
|
20
|
+
children: [/* @__PURE__ */ a("div", {
|
|
22
21
|
className: "ttw:min-w-0",
|
|
23
|
-
children: [/* @__PURE__ */
|
|
22
|
+
children: [/* @__PURE__ */ i("p", {
|
|
24
23
|
className: "ttw:truncate ttw:text-base ttw:font-medium ttw:text-white",
|
|
25
|
-
children:
|
|
26
|
-
}), /* @__PURE__ */
|
|
24
|
+
children: c
|
|
25
|
+
}), /* @__PURE__ */ i("p", {
|
|
27
26
|
className: "ttw:mt-1 ttw:truncate ttw:text-lg ttw:tracking-wide ttw:text-white/90",
|
|
28
|
-
children:
|
|
27
|
+
children: l
|
|
29
28
|
})]
|
|
30
|
-
}), /* @__PURE__ */
|
|
29
|
+
}), /* @__PURE__ */ i("p", {
|
|
31
30
|
className: "ttw:shrink-0 ttw:text-[10px] ttw:font-medium ttw:text-white/90",
|
|
32
|
-
children:
|
|
31
|
+
children: u
|
|
33
32
|
})]
|
|
34
33
|
})
|
|
35
34
|
]
|
|
36
35
|
});
|
|
37
36
|
}
|
|
38
37
|
//#endregion
|
|
39
|
-
export {
|
|
38
|
+
export { o as CardFace };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { cn as e } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
|
+
import { cardDetailsWidgetUiTestIds as t } from "./testIds.js";
|
|
3
|
+
import { CARD_FACE_HEIGHT_CLASS_NAME as n, CARD_FACE_WIDTH_CLASS_NAME as r } from "./cardFaceSurface.js";
|
|
4
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
|
+
//#region ../../libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardFaceFlip.js
|
|
6
|
+
function o({ isFlipped: o, front: s, back: c, className: l }) {
|
|
7
|
+
return /* @__PURE__ */ i("div", {
|
|
8
|
+
className: e("ttw:perspective-[1000px]", l),
|
|
9
|
+
children: /* @__PURE__ */ a("div", {
|
|
10
|
+
"data-testid": t.cardFaceFlip,
|
|
11
|
+
className: e("ttw:relative ttw:transform-3d", n, r, "ttw:motion-safe:transition-transform ttw:motion-safe:duration-500", o && "ttw:rotate-y-180"),
|
|
12
|
+
children: [/* @__PURE__ */ i("div", {
|
|
13
|
+
className: "ttw:absolute ttw:inset-0 ttw:backface-hidden",
|
|
14
|
+
"aria-hidden": o || void 0,
|
|
15
|
+
inert: o || void 0,
|
|
16
|
+
children: s
|
|
17
|
+
}), /* @__PURE__ */ i("div", {
|
|
18
|
+
className: "ttw:absolute ttw:inset-0 ttw:rotate-y-180 ttw:backface-hidden",
|
|
19
|
+
"aria-hidden": !o || void 0,
|
|
20
|
+
inert: !o || void 0,
|
|
21
|
+
children: c
|
|
22
|
+
})]
|
|
23
|
+
})
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { o as CardFaceFlip };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
//#region ../../libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardFaceGlow.js
|
|
3
|
+
function t() {
|
|
4
|
+
return /* @__PURE__ */ e("div", {
|
|
5
|
+
"aria-hidden": "true",
|
|
6
|
+
className: "ttw:pointer-events-none ttw:absolute ttw:inset-0 ttw:bg-[radial-gradient(120%_120%_at_85%_100%,rgba(45,212,191,0.22)_0%,transparent_55%)]"
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
10
|
+
export { t as CardFaceGlow };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
//#region ../../libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/cardFaceSurface.js
|
|
2
|
+
var e = "ttw:w-[300px]", t = "ttw:h-[190px]", n = `ttw:relative ttw:flex ${t} ${e} ttw:flex-col ttw:overflow-hidden ttw:rounded-xl ttw:bg-[#101317] ttw:p-4`;
|
|
3
|
+
//#endregion
|
|
4
|
+
export { t as CARD_FACE_HEIGHT_CLASS_NAME, n as CARD_FACE_SURFACE_CLASS_NAME, e as CARD_FACE_WIDTH_CLASS_NAME };
|
|
@@ -16,7 +16,20 @@ var e = {
|
|
|
16
16
|
copyNicknameAriaLabel: "Copy nickname",
|
|
17
17
|
copyBillingAddressAriaLabel: "Copy billing address"
|
|
18
18
|
},
|
|
19
|
-
actions: {
|
|
19
|
+
actions: {
|
|
20
|
+
activateCard: "Activate card",
|
|
21
|
+
viewCard: "View card",
|
|
22
|
+
hideCard: "Hide card"
|
|
23
|
+
},
|
|
24
|
+
credentials: {
|
|
25
|
+
cardNumber: "Card number",
|
|
26
|
+
expirationDate: "Expiration date",
|
|
27
|
+
securityCode: "Security code",
|
|
28
|
+
copyCardNumberAriaLabel: "Copy card number",
|
|
29
|
+
copyExpirationDateAriaLabel: "Copy expiration date",
|
|
30
|
+
copySecurityCodeAriaLabel: "Copy security code",
|
|
31
|
+
errorDescription: "We couldn't show this card's details. Please try again."
|
|
32
|
+
},
|
|
20
33
|
status: {
|
|
21
34
|
loadingAriaLabel: "Loading card details",
|
|
22
35
|
errorTitle: "We couldn't load this card",
|
|
@@ -44,6 +57,10 @@ function t(t) {
|
|
|
44
57
|
...e.actions,
|
|
45
58
|
...t?.actions
|
|
46
59
|
},
|
|
60
|
+
credentials: {
|
|
61
|
+
...e.credentials,
|
|
62
|
+
...t?.credentials
|
|
63
|
+
},
|
|
47
64
|
status: {
|
|
48
65
|
...e.status,
|
|
49
66
|
...t?.status
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
var e = {
|
|
3
3
|
panel: "card-details-widget-panel",
|
|
4
4
|
cardFace: "card-details-widget-card-face",
|
|
5
|
+
cardFaceFlip: "card-details-widget-card-face-flip",
|
|
6
|
+
credentialsFace: "card-details-widget-credentials-face",
|
|
5
7
|
loading: "card-details-widget-loading",
|
|
6
8
|
menuTrigger: "card-details-widget-menu-trigger",
|
|
7
9
|
closeButton: "card-details-widget-close-button",
|
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.2.
|
|
2
|
+
var e = "@tesouro/embedded-components-react", t = "0.2.323", n = "bca8b1f1ee001a1b0da8bb03d910813284be7971", r = Object.freeze({
|
|
3
3
|
library_name: e,
|
|
4
4
|
library_version: t,
|
|
5
5
|
library_sha: n
|