@tesouro/embedded-components-react 0.11.58 → 0.11.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -16
- package/dist/index.css +40 -70
- package/dist/index.d.ts +19 -6
- package/dist/lib/CardDetailsWidget.d.ts +11 -3
- package/dist/lib/CreditCardsWidget.d.ts +19 -6
- package/dist/lib/DebitCardsWidget.d.ts +19 -6
- package/dist/lib/WidgetSuite.d.ts +19 -6
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/lib/CardDetailsWidget.js +112 -110
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/lib/cardDetailsView.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/index.js +0 -2
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/ActivateCardPanel/ActivateCardPanel.js +94 -83
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/ActivateCardPanel/ActivateCardSuccessView.js +32 -31
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/ActivateCardPanel/labels.js +5 -2
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardCredentialRow.js +41 -23
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardCredentialsFace.js +3 -0
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsHeader.js +30 -25
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsPanel.js +162 -190
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardFace.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CopyButton.js +35 -0
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CopyableValue.js +18 -0
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/NicknameEditor.js +43 -0
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/cardFaceSurface.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/labels.js +12 -8
- package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/feature/dist/index5.js +3 -3
- package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/feature/dist/index8.js +110 -104
- package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/ui/dist/lib/CreateCardWidget/CreateCardWidget.js +74 -68
- package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/ui/dist/lib/CreateCardWidget/PreparingView.js +19 -18
- package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/ui/dist/lib/CreateCardWidget/SetupView.js +110 -108
- package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/ui/dist/lib/CreateCardWidget/SuccessView.js +33 -42
- package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/ui/dist/lib/CreateCardWidget/labels.js +10 -7
- package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/lib/labels.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/lib/testIds.js +2 -6
- package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/lib/useCardsWidget.js +159 -145
- package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/index.js +0 -1
- package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardsList.js +255 -112
- package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardsListDetailsSheet.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/labels.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/AddressLine.js +0 -22
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/DetailCopyRow.js +0 -28
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/NicknameRow.js +0 -64
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/statusBadge.js +0 -11
- package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardFaceSwatch.js +0 -11
- package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardsListRow.js +0 -103
- package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/statusBadge.js +0 -11
|
@@ -2,142 +2,153 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import { Button as e,
|
|
6
|
-
import { InlineErrorAlert as
|
|
5
|
+
import { Button as e, Heading as t, Input as n, Label as r, Separator as i, Spinner as a, Tooltip as o, TooltipContent as s, TooltipProvider as c, TooltipTrigger as l, cn as u } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
|
+
import { InlineErrorAlert as d } from "../../../../../shared/ui/dist/lib/InlineErrorAlert/InlineErrorAlert.js";
|
|
7
7
|
import "../../../../../shared/ui/dist/index.js";
|
|
8
|
-
import { CardFace as
|
|
9
|
-
import { resolveActivateCardPanelLabels as
|
|
10
|
-
import { ActivateCardFieldError as
|
|
11
|
-
import { ActivateCardSuccessView as
|
|
12
|
-
import { FieldError as
|
|
13
|
-
import { useId as
|
|
14
|
-
import { jsx as
|
|
15
|
-
import {
|
|
8
|
+
import { CardFace as f } from "../CardDetailsPanel/CardFace.js";
|
|
9
|
+
import { resolveActivateCardPanelLabels as p } from "./labels.js";
|
|
10
|
+
import { ActivateCardFieldError as m, ActivateCardFormError as h, EMPTY_ACTIVATE_CARD_FORM_VALUES as g, formatDigitsInput as _, formatExpirationDateInput as v } from "./validation.js";
|
|
11
|
+
import { ActivateCardSuccessView as y } from "./ActivateCardSuccessView.js";
|
|
12
|
+
import { FieldError as b } from "./FieldError.js";
|
|
13
|
+
import { useId as x, useMemo as S } from "react";
|
|
14
|
+
import { jsx as C, jsxs as w } from "react/jsx-runtime";
|
|
15
|
+
import { InfoIcon as T, XIcon as E } from "lucide-react";
|
|
16
16
|
// ../../libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/ActivateCardPanel/ActivateCardPanel.js
|
|
17
17
|
var D = {};
|
|
18
18
|
function O(e, t) {
|
|
19
19
|
switch (e) {
|
|
20
|
-
case
|
|
21
|
-
case
|
|
22
|
-
case
|
|
20
|
+
case m.ImpossibleMonth: return t.impossibleMonth;
|
|
21
|
+
case m.PastExpiration: return t.pastExpiration;
|
|
22
|
+
case h.VerificationRejected: return t.verificationRejected;
|
|
23
23
|
default: return;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
function k({ labels:
|
|
27
|
-
let
|
|
28
|
-
return /* @__PURE__ */
|
|
29
|
-
"data-testid":
|
|
30
|
-
className:
|
|
31
|
-
children: [/* @__PURE__ */
|
|
32
|
-
className: "ttw:flex ttw:items-start ttw:gap-
|
|
33
|
-
children: [/* @__PURE__ */
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
26
|
+
function k({ labels: m, state: h = "idle", values: k = g, onValuesChange: A, errors: j = D, isSubmitDisabled: M = !0, onSubmit: N, onClose: P, onDone: F, cardArtSrc: I, bankLogoSrc: L, bankLogoAlt: R, cardholderName: z, maskedCardNumber: B, programLabel: V, lastFour: H, formFactorLabel: U, testIds: W, className: G }) {
|
|
27
|
+
let K = S(() => p(m), [m]), q = x(), J = x(), Y = x(), X = x(), Z = h === "submitting", Q = O(j.expirationDate, K.validation), $ = O(j.form, K.validation);
|
|
28
|
+
return /* @__PURE__ */ w("div", {
|
|
29
|
+
"data-testid": W?.root,
|
|
30
|
+
className: u("ttw:flex ttw:w-full ttw:flex-col", G),
|
|
31
|
+
children: [/* @__PURE__ */ w("div", {
|
|
32
|
+
className: "ttw:flex ttw:items-start ttw:gap-2 ttw:px-6 ttw:pt-5 ttw:pb-4",
|
|
33
|
+
children: [/* @__PURE__ */ C(t, {
|
|
34
|
+
variant: "sheet",
|
|
35
|
+
level: 2,
|
|
36
|
+
className: "ttw:min-w-0 ttw:flex-1 ttw:text-foreground",
|
|
37
|
+
children: K.header.title
|
|
38
|
+
}), P ? /* @__PURE__ */ C(e, {
|
|
37
39
|
type: "button",
|
|
38
40
|
variant: "ghost",
|
|
39
|
-
size: "icon",
|
|
40
|
-
className: "ttw:
|
|
41
|
-
"aria-label":
|
|
41
|
+
size: "icon-sm",
|
|
42
|
+
className: "ttw:shrink-0 ttw:text-muted-foreground",
|
|
43
|
+
"aria-label": K.header.closeAriaLabel,
|
|
42
44
|
onClick: P,
|
|
43
|
-
children: /* @__PURE__ */
|
|
45
|
+
children: /* @__PURE__ */ C(E, { className: "ttw:size-4" })
|
|
44
46
|
}) : null]
|
|
45
|
-
}),
|
|
46
|
-
labels:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
}), h === "succeeded" ? /* @__PURE__ */ C(y, {
|
|
48
|
+
labels: K.status,
|
|
49
|
+
cardFace: /* @__PURE__ */ C(f, {
|
|
50
|
+
cardArtSrc: I,
|
|
51
|
+
bankLogoSrc: L,
|
|
52
|
+
bankLogoAlt: R ?? K.cardFace.bankLogoAlt,
|
|
53
|
+
cardholderName: z ?? "",
|
|
54
|
+
maskedCardNumber: B ?? "",
|
|
55
|
+
programLabel: V ?? ""
|
|
56
|
+
}),
|
|
57
|
+
cardholderName: z,
|
|
58
|
+
lastFour: H,
|
|
59
|
+
formFactorLabel: U,
|
|
60
|
+
onDone: F ?? P,
|
|
61
|
+
testIds: W?.successView
|
|
62
|
+
}) : /* @__PURE__ */ w("form", {
|
|
50
63
|
noValidate: !0,
|
|
51
64
|
onSubmit: (e) => {
|
|
52
|
-
e.preventDefault(), !(M ||
|
|
65
|
+
e.preventDefault(), !(M || Z) && N?.();
|
|
53
66
|
},
|
|
54
|
-
className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:px-
|
|
67
|
+
className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:px-6 ttw:pb-6",
|
|
55
68
|
children: [
|
|
56
|
-
/* @__PURE__ */
|
|
69
|
+
/* @__PURE__ */ C("div", {
|
|
57
70
|
className: "ttw:flex ttw:justify-center",
|
|
58
|
-
children: /* @__PURE__ */
|
|
71
|
+
children: /* @__PURE__ */ C(f, {
|
|
59
72
|
cardArtSrc: I,
|
|
60
73
|
bankLogoSrc: L,
|
|
61
|
-
bankLogoAlt: R ??
|
|
74
|
+
bankLogoAlt: R ?? K.cardFace.bankLogoAlt,
|
|
62
75
|
cardholderName: z ?? "",
|
|
63
76
|
maskedCardNumber: B ?? "",
|
|
64
77
|
programLabel: V ?? "",
|
|
65
|
-
testIds:
|
|
78
|
+
testIds: W?.cardFace
|
|
66
79
|
})
|
|
67
80
|
}),
|
|
68
|
-
/* @__PURE__ */
|
|
81
|
+
/* @__PURE__ */ w("div", {
|
|
69
82
|
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
70
83
|
children: [
|
|
71
|
-
/* @__PURE__ */
|
|
72
|
-
htmlFor:
|
|
84
|
+
/* @__PURE__ */ C(r, {
|
|
85
|
+
htmlFor: q,
|
|
73
86
|
className: "ttw:text-sm ttw:font-medium",
|
|
74
|
-
children:
|
|
87
|
+
children: K.fields.expirationDate
|
|
75
88
|
}),
|
|
76
|
-
/* @__PURE__ */
|
|
77
|
-
id:
|
|
89
|
+
/* @__PURE__ */ C(n, {
|
|
90
|
+
id: q,
|
|
78
91
|
value: k.expirationDate,
|
|
79
|
-
placeholder:
|
|
80
|
-
disabled:
|
|
92
|
+
placeholder: K.fields.expirationDatePlaceholder,
|
|
93
|
+
disabled: Z,
|
|
81
94
|
inputMode: "numeric",
|
|
82
95
|
autoComplete: "off",
|
|
83
|
-
"aria-invalid":
|
|
84
|
-
"aria-describedby":
|
|
85
|
-
onChange: (e) => A?.({ expirationDate:
|
|
96
|
+
"aria-invalid": Q ? !0 : void 0,
|
|
97
|
+
"aria-describedby": Q ? J : void 0,
|
|
98
|
+
onChange: (e) => A?.({ expirationDate: v(e.target.value) })
|
|
86
99
|
}),
|
|
87
|
-
/* @__PURE__ */
|
|
88
|
-
id:
|
|
89
|
-
message:
|
|
100
|
+
/* @__PURE__ */ C(b, {
|
|
101
|
+
id: J,
|
|
102
|
+
message: Q
|
|
90
103
|
})
|
|
91
104
|
]
|
|
92
105
|
}),
|
|
93
|
-
/* @__PURE__ */
|
|
106
|
+
/* @__PURE__ */ w("div", {
|
|
94
107
|
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
95
108
|
children: [
|
|
96
|
-
/* @__PURE__ */
|
|
109
|
+
/* @__PURE__ */ w("div", {
|
|
97
110
|
className: "ttw:flex ttw:items-center ttw:gap-1.5",
|
|
98
|
-
children: [/* @__PURE__ */
|
|
99
|
-
htmlFor:
|
|
111
|
+
children: [/* @__PURE__ */ C(r, {
|
|
112
|
+
htmlFor: Y,
|
|
100
113
|
className: "ttw:text-sm ttw:font-medium",
|
|
101
|
-
children:
|
|
102
|
-
}), /* @__PURE__ */
|
|
114
|
+
children: K.fields.securityCode
|
|
115
|
+
}), /* @__PURE__ */ C(c, { children: /* @__PURE__ */ w(o, { children: [/* @__PURE__ */ C(l, {
|
|
103
116
|
type: "button",
|
|
104
117
|
className: "ttw:inline-flex ttw:shrink-0 ttw:cursor-help ttw:text-muted-foreground",
|
|
105
|
-
"aria-label":
|
|
106
|
-
children: /* @__PURE__ */
|
|
107
|
-
}), /* @__PURE__ */
|
|
118
|
+
"aria-label": K.fields.securityCodeInfoAriaLabel,
|
|
119
|
+
children: /* @__PURE__ */ C(T, { className: "ttw:size-4" })
|
|
120
|
+
}), /* @__PURE__ */ C(s, {
|
|
108
121
|
className: "ttw:max-w-xs",
|
|
109
|
-
children:
|
|
122
|
+
children: K.fields.securityCodeInfo
|
|
110
123
|
})] }) })]
|
|
111
124
|
}),
|
|
112
|
-
/* @__PURE__ */
|
|
113
|
-
id:
|
|
125
|
+
/* @__PURE__ */ C(n, {
|
|
126
|
+
id: Y,
|
|
114
127
|
value: k.securityCode,
|
|
115
|
-
placeholder:
|
|
116
|
-
"aria-describedby":
|
|
117
|
-
disabled:
|
|
128
|
+
placeholder: K.fields.securityCodePlaceholder,
|
|
129
|
+
"aria-describedby": X,
|
|
130
|
+
disabled: Z,
|
|
118
131
|
inputMode: "numeric",
|
|
119
132
|
autoComplete: "off",
|
|
120
133
|
maxLength: 4,
|
|
121
|
-
onChange: (e) => A?.({ securityCode:
|
|
134
|
+
onChange: (e) => A?.({ securityCode: _(e.target.value, 4) })
|
|
122
135
|
}),
|
|
123
|
-
/* @__PURE__ */
|
|
124
|
-
id:
|
|
136
|
+
/* @__PURE__ */ C("span", {
|
|
137
|
+
id: X,
|
|
125
138
|
className: "ttw:sr-only",
|
|
126
|
-
children:
|
|
139
|
+
children: K.fields.securityCodeInfo
|
|
127
140
|
})
|
|
128
141
|
]
|
|
129
142
|
}),
|
|
130
|
-
/* @__PURE__ */
|
|
131
|
-
|
|
132
|
-
/* @__PURE__ */ C(
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
/* @__PURE__ */ S(w, { className: "ttw:size-4" })
|
|
140
|
-
]
|
|
143
|
+
/* @__PURE__ */ C(i, {}),
|
|
144
|
+
h === "errored" || $ ? /* @__PURE__ */ C(d, { children: $ ?? K.status.errorDescription }) : null,
|
|
145
|
+
/* @__PURE__ */ C("div", {
|
|
146
|
+
className: "ttw:flex ttw:justify-end",
|
|
147
|
+
children: /* @__PURE__ */ w(e, {
|
|
148
|
+
type: "submit",
|
|
149
|
+
disabled: M || Z,
|
|
150
|
+
children: [Z ? /* @__PURE__ */ C(a, { "aria-label": K.status.submittingAriaLabel }) : null, K.status.submit]
|
|
151
|
+
})
|
|
141
152
|
})
|
|
142
153
|
]
|
|
143
154
|
})]
|
|
@@ -1,37 +1,38 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ResultScreen as e } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
2
|
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
-
import { CheckIcon as r
|
|
3
|
+
import { CheckIcon as r } from "lucide-react";
|
|
4
4
|
// ../../libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/ActivateCardPanel/ActivateCardSuccessView.js
|
|
5
|
-
|
|
5
|
+
var i = () => void 0;
|
|
6
|
+
function a({ labels: a, cardFace: o, cardholderName: s, lastFour: c, formFactorLabel: l, onDone: u, testIds: d }) {
|
|
7
|
+
let f = [
|
|
8
|
+
{
|
|
9
|
+
label: a.successCardholderLabel,
|
|
10
|
+
value: s
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
label: a.successLastFourLabel,
|
|
14
|
+
value: c
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
label: a.successFormatLabel,
|
|
18
|
+
value: l
|
|
19
|
+
}
|
|
20
|
+
].filter((e) => !!e.value);
|
|
6
21
|
return /* @__PURE__ */ n("div", {
|
|
7
|
-
"data-testid":
|
|
8
|
-
className: "ttw:flex ttw:flex-col",
|
|
9
|
-
children: [/* @__PURE__ */
|
|
10
|
-
className: "ttw:flex ttw:
|
|
11
|
-
children:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
/* @__PURE__ */ t("p", {
|
|
22
|
-
className: "ttw:max-w-sm ttw:text-sm ttw:text-muted-foreground",
|
|
23
|
-
children: a.successDescription
|
|
24
|
-
})
|
|
25
|
-
]
|
|
26
|
-
}), o ? /* @__PURE__ */ t("div", {
|
|
27
|
-
className: "ttw:px-4 ttw:pb-4",
|
|
28
|
-
children: /* @__PURE__ */ n(e, {
|
|
29
|
-
type: "button",
|
|
30
|
-
className: "ttw:w-full",
|
|
31
|
-
onClick: o,
|
|
32
|
-
children: [a.done, /* @__PURE__ */ t(i, { className: "ttw:size-4" })]
|
|
33
|
-
})
|
|
34
|
-
}) : null]
|
|
22
|
+
"data-testid": d?.root,
|
|
23
|
+
className: "ttw:flex ttw:flex-col ttw:gap-6 ttw:px-6 ttw:pb-6",
|
|
24
|
+
children: [/* @__PURE__ */ t("div", {
|
|
25
|
+
className: "ttw:flex ttw:justify-center ttw:rounded-lg ttw:bg-muted ttw:p-4",
|
|
26
|
+
children: o
|
|
27
|
+
}), /* @__PURE__ */ t(e, {
|
|
28
|
+
icon: /* @__PURE__ */ t(r, {}),
|
|
29
|
+
title: a.successTitle,
|
|
30
|
+
description: a.successDescription,
|
|
31
|
+
details: f,
|
|
32
|
+
onDone: u ?? i,
|
|
33
|
+
labels: { done: a.done },
|
|
34
|
+
className: u ? void 0 : "ttw:[&>[data-slot=modal-footer]]:hidden"
|
|
35
|
+
})]
|
|
35
36
|
});
|
|
36
37
|
}
|
|
37
38
|
export { a as ActivateCardSuccessView };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// ../../libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/ActivateCardPanel/labels.js
|
|
2
2
|
var e = {
|
|
3
3
|
header: {
|
|
4
|
-
title: "Activate
|
|
4
|
+
title: "Activate card",
|
|
5
5
|
closeAriaLabel: "Close activate card"
|
|
6
6
|
},
|
|
7
7
|
cardFace: { bankLogoAlt: "Bank logo" },
|
|
@@ -23,8 +23,11 @@ var e = {
|
|
|
23
23
|
submittingAriaLabel: "Activating card",
|
|
24
24
|
successTitle: "Card activated",
|
|
25
25
|
successDescription: "This card is ready to use.",
|
|
26
|
+
successCardholderLabel: "Cardholder",
|
|
27
|
+
successLastFourLabel: "Last four",
|
|
28
|
+
successFormatLabel: "Format",
|
|
26
29
|
done: "Done",
|
|
27
|
-
errorDescription: "
|
|
30
|
+
errorDescription: "Couldn't activate this card. Check the details and try again."
|
|
28
31
|
}
|
|
29
32
|
};
|
|
30
33
|
function t(t) {
|
|
@@ -1,28 +1,46 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { useEffect as e, useState as t } from "react";
|
|
2
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
3
|
+
import { CheckIcon as i, CopyIcon as a } from "lucide-react";
|
|
3
4
|
// ../../libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardCredentialRow.js
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
var o = 2e3;
|
|
6
|
+
function s({ label: s, value: c, copyAriaLabel: l, copiedLabel: u, onCopy: d }) {
|
|
7
|
+
let [f, p] = t(!1);
|
|
8
|
+
return e(() => {
|
|
9
|
+
if (!f) return;
|
|
10
|
+
let e = setTimeout(() => p(!1), o);
|
|
11
|
+
return () => clearTimeout(e);
|
|
12
|
+
}, [f]), /* @__PURE__ */ r("div", {
|
|
6
13
|
className: "ttw:relative ttw:flex ttw:min-w-0 ttw:items-end ttw:justify-between ttw:gap-2",
|
|
7
|
-
children: [
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
14
|
+
children: [
|
|
15
|
+
/* @__PURE__ */ r("div", {
|
|
16
|
+
className: "ttw:min-w-0",
|
|
17
|
+
children: [/* @__PURE__ */ n("p", {
|
|
18
|
+
className: "ttw:text-[10px] ttw:font-medium ttw:tracking-wide ttw:text-white/70 ttw:uppercase",
|
|
19
|
+
children: s
|
|
20
|
+
}), /* @__PURE__ */ n("p", {
|
|
21
|
+
className: "ttw:mt-0.5 ttw:truncate ttw:text-base ttw:tracking-wide ttw:text-white",
|
|
22
|
+
children: c
|
|
23
|
+
})]
|
|
24
|
+
}),
|
|
25
|
+
c && d ? /* @__PURE__ */ n("button", {
|
|
26
|
+
type: "button",
|
|
27
|
+
"aria-label": l,
|
|
28
|
+
title: f ? u : l,
|
|
29
|
+
onClick: async () => {
|
|
30
|
+
await d(c) !== !1 && p(!0);
|
|
31
|
+
},
|
|
32
|
+
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",
|
|
33
|
+
children: n(f ? i : a, {
|
|
34
|
+
className: "ttw:size-3.5",
|
|
35
|
+
"aria-hidden": "true"
|
|
36
|
+
})
|
|
37
|
+
}) : null,
|
|
38
|
+
/* @__PURE__ */ n("span", {
|
|
39
|
+
role: "status",
|
|
40
|
+
className: "ttw:sr-only",
|
|
41
|
+
children: f ? u : ""
|
|
24
42
|
})
|
|
25
|
-
|
|
43
|
+
]
|
|
26
44
|
});
|
|
27
45
|
}
|
|
28
|
-
export {
|
|
46
|
+
export { s as CardCredentialRow };
|
|
@@ -18,6 +18,7 @@ function o({ labels: o, cardNumber: s, expirationDate: c, securityCode: l, isLoc
|
|
|
18
18
|
label: o.cardNumber,
|
|
19
19
|
value: s,
|
|
20
20
|
copyAriaLabel: o.copyCardNumberAriaLabel,
|
|
21
|
+
copiedLabel: o.copiedLabel,
|
|
21
22
|
onCopy: d
|
|
22
23
|
}),
|
|
23
24
|
/* @__PURE__ */ a("div", {
|
|
@@ -26,11 +27,13 @@ function o({ labels: o, cardNumber: s, expirationDate: c, securityCode: l, isLoc
|
|
|
26
27
|
label: o.expirationDate,
|
|
27
28
|
value: c,
|
|
28
29
|
copyAriaLabel: o.copyExpirationDateAriaLabel,
|
|
30
|
+
copiedLabel: o.copiedLabel,
|
|
29
31
|
onCopy: d
|
|
30
32
|
}), /* @__PURE__ */ i(r, {
|
|
31
33
|
label: o.securityCode,
|
|
32
34
|
value: l,
|
|
33
35
|
copyAriaLabel: o.copySecurityCodeAriaLabel,
|
|
36
|
+
copiedLabel: o.copiedLabel,
|
|
34
37
|
onCopy: d
|
|
35
38
|
})]
|
|
36
39
|
})
|
|
@@ -1,51 +1,56 @@
|
|
|
1
|
-
import { Badge as e, Button as t, DropdownMenu as n, DropdownMenuContent as r, DropdownMenuTrigger as i,
|
|
2
|
-
import { cardStatusToneClassName as o } from "./statusBadge.js";
|
|
1
|
+
import { Badge as e, Button as t, DropdownMenu as n, DropdownMenuContent as r, DropdownMenuTrigger as i, Heading as a, Skeleton as o } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
3
2
|
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
4
3
|
import { EllipsisVerticalIcon as l, XIcon as u } from "lucide-react";
|
|
5
4
|
// ../../libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsHeader.js
|
|
6
|
-
function d({ labels: d, title: f,
|
|
5
|
+
function d({ labels: d, title: f, titleAction: p, isTitlePending: m, statusLabel: h, statusTone: g, formFactorLabel: _, cardMenu: v, onClose: y, testIds: b }) {
|
|
7
6
|
return /* @__PURE__ */ c("div", {
|
|
8
|
-
className: "ttw:flex ttw:items-start ttw:gap-
|
|
7
|
+
className: "ttw:flex ttw:items-start ttw:gap-2 ttw:px-4 ttw:pt-5 ttw:@md/card-details:px-6 ttw:pb-4",
|
|
9
8
|
children: [
|
|
10
9
|
/* @__PURE__ */ c("div", {
|
|
11
|
-
className: "ttw:flex ttw:min-w-0 ttw:flex-1 ttw:flex-col ttw:gap-1
|
|
10
|
+
className: "ttw:flex ttw:min-w-0 ttw:flex-1 ttw:flex-col ttw:gap-1",
|
|
12
11
|
children: [/* @__PURE__ */ c("div", {
|
|
13
|
-
className: "ttw:flex ttw:items-center ttw:gap-
|
|
14
|
-
children: [
|
|
15
|
-
className: "ttw:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
12
|
+
className: "ttw:flex ttw:flex-wrap ttw:items-center ttw:gap-2",
|
|
13
|
+
children: [
|
|
14
|
+
m ? /* @__PURE__ */ s(o, { className: "ttw:h-7 ttw:w-48" }) : f ? /* @__PURE__ */ s(a, {
|
|
15
|
+
variant: "sheet",
|
|
16
|
+
level: 2,
|
|
17
|
+
className: "ttw:truncate ttw:text-foreground",
|
|
18
|
+
children: f
|
|
19
|
+
}) : null,
|
|
20
|
+
p,
|
|
21
|
+
h ? /* @__PURE__ */ s(e, {
|
|
22
|
+
tone: g ?? "neutral",
|
|
23
|
+
children: h
|
|
24
|
+
}) : null
|
|
25
|
+
]
|
|
26
|
+
}), _ ? /* @__PURE__ */ s("p", {
|
|
22
27
|
className: "ttw:text-sm ttw:text-muted-foreground",
|
|
23
|
-
children:
|
|
28
|
+
children: _
|
|
24
29
|
}) : null]
|
|
25
30
|
}),
|
|
26
|
-
|
|
31
|
+
v ? /* @__PURE__ */ c(n, { children: [/* @__PURE__ */ s(i, {
|
|
27
32
|
asChild: !0,
|
|
28
33
|
children: /* @__PURE__ */ s(t, {
|
|
29
34
|
type: "button",
|
|
30
35
|
variant: "ghost",
|
|
31
|
-
size: "icon",
|
|
32
|
-
className: "ttw:
|
|
36
|
+
size: "icon-sm",
|
|
37
|
+
className: "ttw:shrink-0",
|
|
33
38
|
"aria-label": d.menuTriggerAriaLabel,
|
|
34
|
-
"data-testid":
|
|
39
|
+
"data-testid": b?.menuTrigger,
|
|
35
40
|
children: /* @__PURE__ */ s(l, { className: "ttw:size-4" })
|
|
36
41
|
})
|
|
37
42
|
}), /* @__PURE__ */ s(r, {
|
|
38
43
|
align: "end",
|
|
39
|
-
children:
|
|
44
|
+
children: v
|
|
40
45
|
})] }) : null,
|
|
41
|
-
|
|
46
|
+
y ? /* @__PURE__ */ s(t, {
|
|
42
47
|
type: "button",
|
|
43
48
|
variant: "ghost",
|
|
44
|
-
size: "icon",
|
|
45
|
-
className: "ttw:
|
|
49
|
+
size: "icon-sm",
|
|
50
|
+
className: "ttw:shrink-0 ttw:text-muted-foreground",
|
|
46
51
|
"aria-label": d.closeAriaLabel,
|
|
47
|
-
"data-testid":
|
|
48
|
-
onClick:
|
|
52
|
+
"data-testid": b?.closeButton,
|
|
53
|
+
onClick: y,
|
|
49
54
|
children: /* @__PURE__ */ s(u, { className: "ttw:size-4" })
|
|
50
55
|
}) : null
|
|
51
56
|
]
|