@tesouro/embedded-components-react 0.2.305 → 0.2.307
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 +12 -0
- package/dist/index.d.ts +6 -0
- package/dist/lib/CardDetailsWidget.d.ts +6 -0
- package/dist/lib/CardsWidget.d.ts +6 -0
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/index.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/ActivateCardPanel/ActivateCardPanel.js +13 -0
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/ActivateCardPanel/ActivateCardSuccessView.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/ActivateCardPanel/FieldError.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/ActivateCardPanel/PinField.js +5 -0
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsPanel.js +80 -70
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/labels.js +5 -0
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/testIds.js +3 -1
- 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
|
@@ -216,6 +216,9 @@
|
|
|
216
216
|
.ttw\:end-0 {
|
|
217
217
|
inset-inline-end: calc(var(--ttw-spacing) * 0);
|
|
218
218
|
}
|
|
219
|
+
.ttw\:end-1 {
|
|
220
|
+
inset-inline-end: calc(var(--ttw-spacing) * 1);
|
|
221
|
+
}
|
|
219
222
|
.ttw\:\!top-2 {
|
|
220
223
|
top: calc(var(--ttw-spacing) * 2) !important;
|
|
221
224
|
}
|
|
@@ -225,6 +228,9 @@
|
|
|
225
228
|
.ttw\:top-0 {
|
|
226
229
|
top: 0px;
|
|
227
230
|
}
|
|
231
|
+
.ttw\:top-1 {
|
|
232
|
+
top: var(--ttw-spacing);
|
|
233
|
+
}
|
|
228
234
|
.ttw\:top-1\.5 {
|
|
229
235
|
top: calc(var(--ttw-spacing) * 1.5);
|
|
230
236
|
}
|
|
@@ -1214,6 +1220,9 @@
|
|
|
1214
1220
|
.ttw\:w-\[600px\] {
|
|
1215
1221
|
width: 600px;
|
|
1216
1222
|
}
|
|
1223
|
+
.ttw\:w-\[616px\] {
|
|
1224
|
+
width: 616px;
|
|
1225
|
+
}
|
|
1217
1226
|
.ttw\:w-\[672px\] {
|
|
1218
1227
|
width: 672px;
|
|
1219
1228
|
}
|
|
@@ -2823,6 +2832,9 @@
|
|
|
2823
2832
|
.ttw\:py-\[7px\] {
|
|
2824
2833
|
padding-block: 7px;
|
|
2825
2834
|
}
|
|
2835
|
+
.ttw\:pe-10 {
|
|
2836
|
+
padding-inline-end: calc(var(--ttw-spacing) * 10);
|
|
2837
|
+
}
|
|
2826
2838
|
.ttw\:pt-0 {
|
|
2827
2839
|
padding-top: 0px;
|
|
2828
2840
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -2060,6 +2060,11 @@ interface CardDetailsFieldLabels {
|
|
|
2060
2060
|
copyNicknameAriaLabel: string;
|
|
2061
2061
|
copyBillingAddressAriaLabel: string;
|
|
2062
2062
|
}
|
|
2063
|
+
/** Copy for the controls the owner can switch on alongside the details. */
|
|
2064
|
+
interface CardDetailsActionLabels {
|
|
2065
|
+
/** Primary control that opens the Activate Card form. */
|
|
2066
|
+
activateCard: string;
|
|
2067
|
+
}
|
|
2063
2068
|
/** Copy for the three non-loaded screens. */
|
|
2064
2069
|
interface CardDetailsStatusScreenLabels {
|
|
2065
2070
|
/** Accessible name announced while the panel is loading. */
|
|
@@ -2074,6 +2079,7 @@ interface CardDetailsPanelLabels {
|
|
|
2074
2079
|
header: CardDetailsHeaderLabels;
|
|
2075
2080
|
cardFace: CardDetailsCardFaceLabels;
|
|
2076
2081
|
fields: CardDetailsFieldLabels;
|
|
2082
|
+
actions: CardDetailsActionLabels;
|
|
2077
2083
|
status: CardDetailsStatusScreenLabels;
|
|
2078
2084
|
}
|
|
2079
2085
|
|
|
@@ -28,6 +28,11 @@ interface CardDetailsFieldLabels {
|
|
|
28
28
|
copyNicknameAriaLabel: string;
|
|
29
29
|
copyBillingAddressAriaLabel: string;
|
|
30
30
|
}
|
|
31
|
+
/** Copy for the controls the owner can switch on alongside the details. */
|
|
32
|
+
interface CardDetailsActionLabels {
|
|
33
|
+
/** Primary control that opens the Activate Card form. */
|
|
34
|
+
activateCard: string;
|
|
35
|
+
}
|
|
31
36
|
/** Copy for the three non-loaded screens. */
|
|
32
37
|
interface CardDetailsStatusScreenLabels {
|
|
33
38
|
/** Accessible name announced while the panel is loading. */
|
|
@@ -42,6 +47,7 @@ interface CardDetailsPanelLabels {
|
|
|
42
47
|
header: CardDetailsHeaderLabels;
|
|
43
48
|
cardFace: CardDetailsCardFaceLabels;
|
|
44
49
|
fields: CardDetailsFieldLabels;
|
|
50
|
+
actions: CardDetailsActionLabels;
|
|
45
51
|
status: CardDetailsStatusScreenLabels;
|
|
46
52
|
}
|
|
47
53
|
|
|
@@ -754,6 +754,11 @@ interface CardDetailsFieldLabels {
|
|
|
754
754
|
copyNicknameAriaLabel: string;
|
|
755
755
|
copyBillingAddressAriaLabel: string;
|
|
756
756
|
}
|
|
757
|
+
/** Copy for the controls the owner can switch on alongside the details. */
|
|
758
|
+
interface CardDetailsActionLabels {
|
|
759
|
+
/** Primary control that opens the Activate Card form. */
|
|
760
|
+
activateCard: string;
|
|
761
|
+
}
|
|
757
762
|
/** Copy for the three non-loaded screens. */
|
|
758
763
|
interface CardDetailsStatusScreenLabels {
|
|
759
764
|
/** Accessible name announced while the panel is loading. */
|
|
@@ -768,6 +773,7 @@ interface CardDetailsPanelLabels {
|
|
|
768
773
|
header: CardDetailsHeaderLabels;
|
|
769
774
|
cardFace: CardDetailsCardFaceLabels;
|
|
770
775
|
fields: CardDetailsFieldLabels;
|
|
776
|
+
actions: CardDetailsActionLabels;
|
|
771
777
|
status: CardDetailsStatusScreenLabels;
|
|
772
778
|
}
|
|
773
779
|
|
|
@@ -5,4 +5,5 @@ import "./lib/CardDetailsPanel/CardFace.js";
|
|
|
5
5
|
import "./lib/CardDetailsPanel/DetailCopyRow.js";
|
|
6
6
|
import "./lib/CardDetailsPanel/labels.js";
|
|
7
7
|
import { CardDetailsPanel as e } from "./lib/CardDetailsPanel/CardDetailsPanel.js";
|
|
8
|
+
import "./lib/ActivateCardPanel/ActivateCardPanel.js";
|
|
8
9
|
export { e as CardDetailsPanel };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
|
+
import "../../../../../shared/ui/dist/index.js";
|
|
7
|
+
import "../CardDetailsPanel/CardFace.js";
|
|
8
|
+
import "./ActivateCardSuccessView.js";
|
|
9
|
+
import "./FieldError.js";
|
|
10
|
+
import "./PinField.js";
|
|
11
|
+
import "react";
|
|
12
|
+
import "react/jsx-runtime";
|
|
13
|
+
import "lucide-react";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "react/jsx-runtime";
|
|
@@ -2,90 +2,100 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import { Badge as e,
|
|
6
|
-
import { EmptyState as
|
|
7
|
-
import { ErrorState as
|
|
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
8
|
import "../../../../../shared/ui/dist/index.js";
|
|
9
|
-
import { cardDetailsWidgetUiTestIds as
|
|
10
|
-
import { CardDetailsHeader as
|
|
11
|
-
import { CardFace as
|
|
12
|
-
import { DetailCopyRow as
|
|
13
|
-
import { resolveCardDetailsPanelLabels as
|
|
14
|
-
import { useMemo as
|
|
15
|
-
import { jsx as
|
|
16
|
-
import { CreditCardIcon as
|
|
9
|
+
import { cardDetailsWidgetUiTestIds as o } from "./testIds.js";
|
|
10
|
+
import { CardDetailsHeader as s } from "./CardDetailsHeader.js";
|
|
11
|
+
import { CardFace as c } from "./CardFace.js";
|
|
12
|
+
import { DetailCopyRow as l } from "./DetailCopyRow.js";
|
|
13
|
+
import { resolveCardDetailsPanelLabels as u } from "./labels.js";
|
|
14
|
+
import { useMemo as d } from "react";
|
|
15
|
+
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
16
|
+
import { CreditCardIcon as m, PowerIcon as h } from "lucide-react";
|
|
17
17
|
//#region ../../libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsPanel.js
|
|
18
|
-
function
|
|
19
|
-
let
|
|
20
|
-
return /* @__PURE__ */
|
|
21
|
-
"data-testid":
|
|
22
|
-
className:
|
|
23
|
-
children: [/* @__PURE__ */
|
|
24
|
-
labels:
|
|
25
|
-
title:
|
|
26
|
-
isTitlePending:
|
|
27
|
-
statusLabel:
|
|
28
|
-
statusTone:
|
|
29
|
-
formFactorLabel:
|
|
30
|
-
cardMenu:
|
|
31
|
-
onClose:
|
|
32
|
-
}), /* @__PURE__ */
|
|
18
|
+
function g({ labels: g, state: _, nickname: v, statusLabel: y, statusTone: b, formFactorLabel: x, cardMenu: S, onClose: C, bankLogoSrc: w, bankLogoAlt: T, cardholderName: E, maskedCardNumber: D, programLabel: O, billingAddress: k, allowedCategories: A, onCopy: j, onActivate: M, onRetry: N, className: P }) {
|
|
19
|
+
let F = d(() => u(g), [g]), I = !!A?.length;
|
|
20
|
+
return /* @__PURE__ */ p("div", {
|
|
21
|
+
"data-testid": o.panel,
|
|
22
|
+
className: r("ttw:flex ttw:w-full ttw:flex-col", P),
|
|
23
|
+
children: [/* @__PURE__ */ f(s, {
|
|
24
|
+
labels: F.header,
|
|
25
|
+
title: _ === "loaded" ? v ?? F.header.untitledCard : void 0,
|
|
26
|
+
isTitlePending: _ === "loading",
|
|
27
|
+
statusLabel: _ === "loaded" ? y : void 0,
|
|
28
|
+
statusTone: b,
|
|
29
|
+
formFactorLabel: _ === "loaded" ? x : void 0,
|
|
30
|
+
cardMenu: _ === "loaded" ? S : void 0,
|
|
31
|
+
onClose: C
|
|
32
|
+
}), /* @__PURE__ */ f("div", {
|
|
33
33
|
className: "ttw:px-4 ttw:pb-4",
|
|
34
|
-
children:
|
|
35
|
-
"data-testid":
|
|
34
|
+
children: _ === "loading" ? /* @__PURE__ */ p("div", {
|
|
35
|
+
"data-testid": o.loading,
|
|
36
36
|
role: "status",
|
|
37
|
-
"aria-label":
|
|
37
|
+
"aria-label": F.status.loadingAriaLabel,
|
|
38
38
|
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__ */
|
|
39
|
+
children: [/* @__PURE__ */ f(n, { className: "ttw:h-8 ttw:w-56" }), /* @__PURE__ */ f(n, { className: "ttw:h-64 ttw:w-full ttw:rounded-xl" })]
|
|
40
|
+
}) : _ === "error" ? /* @__PURE__ */ f(a, {
|
|
41
|
+
title: F.status.errorTitle,
|
|
42
|
+
description: F.status.errorDescription,
|
|
43
|
+
retryLabel: F.status.errorRetry,
|
|
44
|
+
onRetry: N
|
|
45
|
+
}) : _ === "notFound" ? /* @__PURE__ */ f(i, {
|
|
46
|
+
icon: /* @__PURE__ */ f(m, { className: "ttw:size-6 ttw:text-muted-foreground" }),
|
|
47
|
+
title: F.status.notFoundTitle,
|
|
48
|
+
description: F.status.notFoundDescription
|
|
49
|
+
}) : /* @__PURE__ */ p("div", {
|
|
50
50
|
className: "ttw:flex ttw:flex-col ttw:overflow-hidden ttw:rounded-xl ttw:border ttw:border-border ttw:sm:flex-row",
|
|
51
|
-
children: [/* @__PURE__ */
|
|
51
|
+
children: [/* @__PURE__ */ f("div", {
|
|
52
52
|
className: "ttw:flex ttw:items-center ttw:justify-center ttw:bg-muted ttw:px-4 ttw:py-5",
|
|
53
|
-
children: /* @__PURE__ */
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
53
|
+
children: /* @__PURE__ */ p("div", {
|
|
54
|
+
className: "ttw:flex ttw:flex-col ttw:gap-4",
|
|
55
|
+
children: [/* @__PURE__ */ f(c, {
|
|
56
|
+
bankLogoSrc: w,
|
|
57
|
+
bankLogoAlt: T ?? F.cardFace.bankLogoAlt,
|
|
58
|
+
cardholderName: E ?? "",
|
|
59
|
+
maskedCardNumber: D ?? "",
|
|
60
|
+
programLabel: O ?? ""
|
|
61
|
+
}), M ? /* @__PURE__ */ p(t, {
|
|
62
|
+
type: "button",
|
|
63
|
+
onClick: M,
|
|
64
|
+
children: [/* @__PURE__ */ f(h, {
|
|
65
|
+
className: "ttw:size-4",
|
|
66
|
+
"aria-hidden": "true"
|
|
67
|
+
}), F.actions.activateCard]
|
|
68
|
+
}) : null]
|
|
59
69
|
})
|
|
60
|
-
}), /* @__PURE__ */
|
|
70
|
+
}), /* @__PURE__ */ p("div", {
|
|
61
71
|
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",
|
|
62
72
|
children: [
|
|
63
|
-
/* @__PURE__ */
|
|
64
|
-
label:
|
|
65
|
-
copyAriaLabel:
|
|
66
|
-
onCopy:
|
|
67
|
-
children:
|
|
73
|
+
/* @__PURE__ */ f(l, {
|
|
74
|
+
label: F.fields.cardholder,
|
|
75
|
+
copyAriaLabel: E && j ? F.fields.copyCardholderAriaLabel : void 0,
|
|
76
|
+
onCopy: E && j ? () => j(E) : void 0,
|
|
77
|
+
children: E ?? F.fields.emptyValue
|
|
68
78
|
}),
|
|
69
|
-
/* @__PURE__ */
|
|
70
|
-
label:
|
|
71
|
-
copyAriaLabel:
|
|
72
|
-
onCopy:
|
|
73
|
-
isLast: !
|
|
74
|
-
children:
|
|
79
|
+
/* @__PURE__ */ f(l, {
|
|
80
|
+
label: F.fields.nickname,
|
|
81
|
+
copyAriaLabel: v && j ? F.fields.copyNicknameAriaLabel : void 0,
|
|
82
|
+
onCopy: v && j ? () => j(v) : void 0,
|
|
83
|
+
isLast: !k && !I,
|
|
84
|
+
children: v ?? F.fields.emptyValue
|
|
75
85
|
}),
|
|
76
|
-
|
|
77
|
-
label:
|
|
78
|
-
copyAriaLabel:
|
|
79
|
-
onCopy:
|
|
80
|
-
isLast: !
|
|
81
|
-
children:
|
|
86
|
+
k ? /* @__PURE__ */ f(l, {
|
|
87
|
+
label: F.fields.billingAddress,
|
|
88
|
+
copyAriaLabel: j ? F.fields.copyBillingAddressAriaLabel : void 0,
|
|
89
|
+
onCopy: j ? () => j(k) : void 0,
|
|
90
|
+
isLast: !I,
|
|
91
|
+
children: k
|
|
82
92
|
}) : null,
|
|
83
|
-
|
|
84
|
-
label:
|
|
93
|
+
I ? /* @__PURE__ */ f(l, {
|
|
94
|
+
label: F.fields.allowedCategories,
|
|
85
95
|
isLast: !0,
|
|
86
|
-
children: /* @__PURE__ */
|
|
96
|
+
children: /* @__PURE__ */ f("div", {
|
|
87
97
|
className: "ttw:flex ttw:flex-wrap ttw:gap-2",
|
|
88
|
-
children:
|
|
98
|
+
children: A?.map((t) => /* @__PURE__ */ f(e, {
|
|
89
99
|
variant: "secondary",
|
|
90
100
|
children: t
|
|
91
101
|
}, t))
|
|
@@ -98,4 +108,4 @@ function m({ labels: m, state: h, nickname: g, statusLabel: _, statusTone: v, fo
|
|
|
98
108
|
});
|
|
99
109
|
}
|
|
100
110
|
//#endregion
|
|
101
|
-
export {
|
|
111
|
+
export { g as CardDetailsPanel };
|
|
@@ -16,6 +16,7 @@ var e = {
|
|
|
16
16
|
copyNicknameAriaLabel: "Copy nickname",
|
|
17
17
|
copyBillingAddressAriaLabel: "Copy billing address"
|
|
18
18
|
},
|
|
19
|
+
actions: { activateCard: "Activate Card" },
|
|
19
20
|
status: {
|
|
20
21
|
loadingAriaLabel: "Loading card details",
|
|
21
22
|
errorTitle: "We couldn't load this card",
|
|
@@ -39,6 +40,10 @@ function t(t) {
|
|
|
39
40
|
...e.fields,
|
|
40
41
|
...t?.fields
|
|
41
42
|
},
|
|
43
|
+
actions: {
|
|
44
|
+
...e.actions,
|
|
45
|
+
...t?.actions
|
|
46
|
+
},
|
|
42
47
|
status: {
|
|
43
48
|
...e.status,
|
|
44
49
|
...t?.status
|
|
@@ -4,7 +4,9 @@ var e = {
|
|
|
4
4
|
cardFace: "card-details-widget-card-face",
|
|
5
5
|
loading: "card-details-widget-loading",
|
|
6
6
|
menuTrigger: "card-details-widget-menu-trigger",
|
|
7
|
-
closeButton: "card-details-widget-close-button"
|
|
7
|
+
closeButton: "card-details-widget-close-button",
|
|
8
|
+
activatePanel: "card-details-widget-activate-panel",
|
|
9
|
+
activateSuccess: "card-details-widget-activate-success"
|
|
8
10
|
};
|
|
9
11
|
//#endregion
|
|
10
12
|
export { e as cardDetailsWidgetUiTestIds };
|
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.307", n = "e6190e49468ca4e80ee98046dc93a991cb03537c", r = Object.freeze({
|
|
3
3
|
library_name: e,
|
|
4
4
|
library_version: t,
|
|
5
5
|
library_sha: n
|