@tesouro/embedded-components-react 0.5.17 → 0.5.19
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 +22 -21
- package/dist/index.css +18 -0
- package/dist/index.d.ts +29 -6
- package/dist/lib/CardDetailsWidget.d.ts +20 -2
- package/dist/lib/CreditCardsWidget.d.ts +29 -6
- package/dist/lib/DebitCardsWidget.d.ts +29 -6
- package/dist/lib/WidgetSuite.d.ts +29 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index14.js +8 -14
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +34 -34
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +85 -80
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +186 -179
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index13.js +152 -149
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index3.js +8 -11
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index4.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index6.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index7.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index9.js +81 -79
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/ActivateCardPanel/ActivateCardPanel.js +39 -38
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/AddressLine.js +23 -0
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsPanel.js +142 -118
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardFace.js +24 -14
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/labels.js +4 -1
- package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index9.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/create-card-widget/ui/dist/lib/CreateCardWidget/CardControls/PerTransactionMaximumControl.js +17 -16
- package/dist/libs/tesouro-embedded-components-react/create-card-widget/ui/dist/lib/CreateCardWidget/CardControls/SpendLimitControl.js +25 -24
- package/dist/libs/tesouro-embedded-components-react/create-card-widget/ui/dist/lib/CreateCardWidget/CardControls/limitDecimalPlaces.js +7 -0
- package/dist/libs/tesouro-embedded-components-react/create-card-widget/ui/dist/lib/CreateCardWidget/SetupView.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +4 -1
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/card/cardPresentation.js +1 -1
- package/package.json +1 -1
|
@@ -23,69 +23,70 @@ function O(e, t) {
|
|
|
23
23
|
default: return;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
function k({ labels: p, state: m = "idle", values: k = h, onValuesChange: A, errors: j = D, isSubmitDisabled: M = !0, onSubmit: N, onClose: P, onDone: F,
|
|
27
|
-
let
|
|
26
|
+
function k({ labels: p, state: m = "idle", values: k = h, 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, testIds: H, className: U }) {
|
|
27
|
+
let W = x(() => f(p), [p]), G = b(), K = b(), q = b(), J = b(), Y = m === "submitting", X = O(j.expirationDate, W.validation), Z = O(j.form, W.validation);
|
|
28
28
|
return /* @__PURE__ */ C("div", {
|
|
29
|
-
"data-testid":
|
|
30
|
-
className: l("ttw:flex ttw:w-full ttw:flex-col",
|
|
29
|
+
"data-testid": H?.root,
|
|
30
|
+
className: l("ttw:flex ttw:w-full ttw:flex-col", U),
|
|
31
31
|
children: [/* @__PURE__ */ C("div", {
|
|
32
32
|
className: "ttw:flex ttw:items-start ttw:gap-1.5 ttw:px-4 ttw:pt-4 ttw:pb-3",
|
|
33
33
|
children: [/* @__PURE__ */ S("h2", {
|
|
34
34
|
className: "ttw:min-w-0 ttw:flex-1 ttw:text-2xl ttw:font-semibold ttw:tracking-[-0.6px] ttw:text-foreground",
|
|
35
|
-
children:
|
|
35
|
+
children: W.header.title
|
|
36
36
|
}), P ? /* @__PURE__ */ S(e, {
|
|
37
37
|
type: "button",
|
|
38
38
|
variant: "ghost",
|
|
39
39
|
size: "icon",
|
|
40
40
|
className: "ttw:size-8 ttw:shrink-0",
|
|
41
|
-
"aria-label":
|
|
41
|
+
"aria-label": W.header.closeAriaLabel,
|
|
42
42
|
onClick: P,
|
|
43
43
|
children: /* @__PURE__ */ S(E, { className: "ttw:size-4" })
|
|
44
44
|
}) : null]
|
|
45
45
|
}), m === "succeeded" ? /* @__PURE__ */ S(v, {
|
|
46
|
-
labels:
|
|
46
|
+
labels: W.status,
|
|
47
47
|
onDone: F,
|
|
48
|
-
testIds:
|
|
48
|
+
testIds: H?.successView
|
|
49
49
|
}) : /* @__PURE__ */ C("form", {
|
|
50
50
|
noValidate: !0,
|
|
51
51
|
onSubmit: (e) => {
|
|
52
|
-
e.preventDefault(), !(M ||
|
|
52
|
+
e.preventDefault(), !(M || Y) && N?.();
|
|
53
53
|
},
|
|
54
54
|
className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:px-4 ttw:pb-4",
|
|
55
55
|
children: [
|
|
56
56
|
/* @__PURE__ */ S("div", {
|
|
57
57
|
className: "ttw:flex ttw:justify-center",
|
|
58
58
|
children: /* @__PURE__ */ S(d, {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
59
|
+
cardArtSrc: I,
|
|
60
|
+
bankLogoSrc: L,
|
|
61
|
+
bankLogoAlt: R ?? W.cardFace.bankLogoAlt,
|
|
62
|
+
cardholderName: z ?? "",
|
|
63
|
+
maskedCardNumber: B ?? "",
|
|
64
|
+
programLabel: V ?? "",
|
|
65
|
+
testIds: H?.cardFace
|
|
65
66
|
})
|
|
66
67
|
}),
|
|
67
68
|
/* @__PURE__ */ C("div", {
|
|
68
69
|
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
69
70
|
children: [
|
|
70
71
|
/* @__PURE__ */ S(n, {
|
|
71
|
-
htmlFor:
|
|
72
|
+
htmlFor: G,
|
|
72
73
|
className: "ttw:text-sm ttw:font-medium",
|
|
73
|
-
children:
|
|
74
|
+
children: W.fields.expirationDate
|
|
74
75
|
}),
|
|
75
76
|
/* @__PURE__ */ S(t, {
|
|
76
|
-
id:
|
|
77
|
+
id: G,
|
|
77
78
|
value: k.expirationDate,
|
|
78
|
-
placeholder:
|
|
79
|
-
disabled:
|
|
79
|
+
placeholder: W.fields.expirationDatePlaceholder,
|
|
80
|
+
disabled: Y,
|
|
80
81
|
inputMode: "numeric",
|
|
81
82
|
autoComplete: "off",
|
|
82
|
-
"aria-invalid":
|
|
83
|
-
"aria-describedby":
|
|
83
|
+
"aria-invalid": X ? !0 : void 0,
|
|
84
|
+
"aria-describedby": X ? K : void 0,
|
|
84
85
|
onChange: (e) => A?.({ expirationDate: _(e.target.value) })
|
|
85
86
|
}),
|
|
86
87
|
/* @__PURE__ */ S(y, {
|
|
87
|
-
id:
|
|
88
|
-
message:
|
|
88
|
+
id: K,
|
|
89
|
+
message: X
|
|
89
90
|
})
|
|
90
91
|
]
|
|
91
92
|
}),
|
|
@@ -95,46 +96,46 @@ function k({ labels: p, state: m = "idle", values: k = h, onValuesChange: A, err
|
|
|
95
96
|
/* @__PURE__ */ C("div", {
|
|
96
97
|
className: "ttw:flex ttw:items-center ttw:gap-1.5",
|
|
97
98
|
children: [/* @__PURE__ */ S(n, {
|
|
98
|
-
htmlFor:
|
|
99
|
+
htmlFor: q,
|
|
99
100
|
className: "ttw:text-sm ttw:font-medium",
|
|
100
|
-
children:
|
|
101
|
+
children: W.fields.securityCode
|
|
101
102
|
}), /* @__PURE__ */ S(s, { children: /* @__PURE__ */ C(a, { children: [/* @__PURE__ */ S(c, {
|
|
102
103
|
type: "button",
|
|
103
104
|
className: "ttw:inline-flex ttw:shrink-0 ttw:cursor-help ttw:text-muted-foreground",
|
|
104
|
-
"aria-label":
|
|
105
|
+
"aria-label": W.fields.securityCodeInfoAriaLabel,
|
|
105
106
|
children: /* @__PURE__ */ S(T, { className: "ttw:size-4" })
|
|
106
107
|
}), /* @__PURE__ */ S(o, {
|
|
107
108
|
className: "ttw:max-w-xs",
|
|
108
|
-
children:
|
|
109
|
+
children: W.fields.securityCodeInfo
|
|
109
110
|
})] }) })]
|
|
110
111
|
}),
|
|
111
112
|
/* @__PURE__ */ S(t, {
|
|
112
|
-
id:
|
|
113
|
+
id: q,
|
|
113
114
|
value: k.securityCode,
|
|
114
|
-
placeholder:
|
|
115
|
-
"aria-describedby":
|
|
116
|
-
disabled:
|
|
115
|
+
placeholder: W.fields.securityCodePlaceholder,
|
|
116
|
+
"aria-describedby": J,
|
|
117
|
+
disabled: Y,
|
|
117
118
|
inputMode: "numeric",
|
|
118
119
|
autoComplete: "off",
|
|
119
120
|
maxLength: 4,
|
|
120
121
|
onChange: (e) => A?.({ securityCode: g(e.target.value, 4) })
|
|
121
122
|
}),
|
|
122
123
|
/* @__PURE__ */ S("span", {
|
|
123
|
-
id:
|
|
124
|
+
id: J,
|
|
124
125
|
className: "ttw:sr-only",
|
|
125
|
-
children:
|
|
126
|
+
children: W.fields.securityCodeInfo
|
|
126
127
|
})
|
|
127
128
|
]
|
|
128
129
|
}),
|
|
129
130
|
/* @__PURE__ */ S(r, {}),
|
|
130
|
-
m === "errored" ||
|
|
131
|
+
m === "errored" || Z ? /* @__PURE__ */ S(u, { children: Z ?? W.status.errorDescription }) : null,
|
|
131
132
|
/* @__PURE__ */ C(e, {
|
|
132
133
|
type: "submit",
|
|
133
134
|
className: "ttw:w-full",
|
|
134
|
-
disabled: M ||
|
|
135
|
+
disabled: M || Y,
|
|
135
136
|
children: [
|
|
136
|
-
|
|
137
|
-
|
|
137
|
+
Y ? /* @__PURE__ */ S(i, { "aria-label": W.status.submittingAriaLabel }) : null,
|
|
138
|
+
W.status.submit,
|
|
138
139
|
/* @__PURE__ */ S(w, { className: "ttw:size-4" })
|
|
139
140
|
]
|
|
140
141
|
})
|
|
@@ -0,0 +1,23 @@
|
|
|
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/AddressLine.js
|
|
4
|
+
function r({ value: r, copyAriaLabel: i, onCopy: a }) {
|
|
5
|
+
return /* @__PURE__ */ t("div", {
|
|
6
|
+
className: "ttw:flex ttw:items-center ttw:gap-1",
|
|
7
|
+
children: [/* @__PURE__ */ e("span", {
|
|
8
|
+
className: "ttw:min-w-0 ttw:truncate ttw:text-sm ttw:text-foreground",
|
|
9
|
+
children: r
|
|
10
|
+
}), i && a ? /* @__PURE__ */ e("button", {
|
|
11
|
+
type: "button",
|
|
12
|
+
"aria-label": i,
|
|
13
|
+
onClick: a,
|
|
14
|
+
className: "ttw:inline-flex ttw:size-5 ttw:shrink-0 ttw:cursor-pointer ttw:items-center ttw:justify-center ttw:rounded ttw:text-muted-foreground ttw:transition-colors ttw:hover:bg-accent ttw:hover:text-accent-foreground ttw:focus-visible:ring-2 ttw:focus-visible:ring-ring ttw:focus-visible:outline-none",
|
|
15
|
+
children: /* @__PURE__ */ e(n, {
|
|
16
|
+
className: "ttw:size-3",
|
|
17
|
+
"aria-hidden": "true"
|
|
18
|
+
})
|
|
19
|
+
}) : null]
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { r as AddressLine };
|
|
@@ -3,197 +3,221 @@
|
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
5
|
import { Button as e, Skeleton as t, cn as n } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
|
-
import { EmptyState as
|
|
7
|
-
import { ErrorState as
|
|
6
|
+
import { EmptyState as ee } from "../../../../../shared/ui/dist/lib/EmptyState/EmptyState.js";
|
|
7
|
+
import { ErrorState as r } from "../../../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
|
|
8
8
|
import { InlineErrorAlert as i } from "../../../../../shared/ui/dist/lib/InlineErrorAlert/InlineErrorAlert.js";
|
|
9
9
|
import "../../../../../shared/ui/dist/index.js";
|
|
10
|
-
import { CardDetailsHeader as
|
|
11
|
-
import { CARD_FACE_WIDTH_CLASS_NAME as
|
|
12
|
-
import { CardFace as
|
|
10
|
+
import { CardDetailsHeader as te } from "./CardDetailsHeader.js";
|
|
11
|
+
import { CARD_FACE_WIDTH_CLASS_NAME as ne } from "./cardFaceSurface.js";
|
|
12
|
+
import { CardFace as a } from "./CardFace.js";
|
|
13
13
|
import { DetailCopyRow as o } from "./DetailCopyRow.js";
|
|
14
14
|
import { resolveCardDetailsPanelLabels as s } from "./labels.js";
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
15
|
+
import { AddressLine as c } from "./AddressLine.js";
|
|
16
|
+
import { CardCredentialsFace as re } from "./CardCredentialsFace.js";
|
|
17
|
+
import { CardFaceFlip as ie } from "./CardFaceFlip.js";
|
|
18
|
+
import { NicknameRow as ae } from "./NicknameRow.js";
|
|
19
|
+
import { useMemo as oe } from "react";
|
|
20
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
21
|
+
import { CheckIcon as d, CreditCardIcon as f, EyeIcon as p, EyeOffIcon as m, LockIcon as h, LockOpenIcon as se, PowerIcon as ce } from "lucide-react";
|
|
21
22
|
//#region ../../libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsPanel.js
|
|
22
|
-
function g({ labels: g, state: _, nickname: v, statusLabel:
|
|
23
|
-
let
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
function g({ labels: g, state: _, nickname: v, statusLabel: le, statusTone: ue, formFactorLabel: de, cardMenu: fe, onClose: pe, cardArtSrc: me, bankLogoSrc: he, bankLogoAlt: ge, cardholderName: y, maskedCardNumber: _e, programLabel: ve, cardFaceStatusLabel: ye, billingAddress: b, allowedCategories: x, spendLimitLabels: S, perTransactionMaxLabel: C, onCopy: w, onEditNickname: T, nicknameEditState: E = "closed", nicknameDraft: D, onNicknameDraftChange: O, onSaveNickname: k, onCancelNicknameEdit: A, isNicknameSaveDisabled: j, onActivate: M, onViewCard: N, onHideCard: P, revealState: F = "hidden", revealedCardNumber: be, revealedExpirationDate: xe, revealedSecurityCode: Se, isLocked: I, lockState: L = "idle", onLockCard: R, onUnlockCard: z, onRetry: Ce, testIds: B, className: we }) {
|
|
24
|
+
let V = oe(() => s(g), [g]), H = b?.addressLine1, U = b?.addressLine2, W = b?.cityState, G = b?.postalCode, Te = !!(H || U || W || G), K = !!x?.length, q = !!S?.length, J = !!C, Y = F === "revealed", X = Y ? P : N, Z = !!(R || z), Q = I ? z : R, $ = /* @__PURE__ */ l(a, {
|
|
25
|
+
cardArtSrc: me,
|
|
26
|
+
bankLogoSrc: he,
|
|
27
|
+
bankLogoAlt: ge ?? V.cardFace.bankLogoAlt,
|
|
26
28
|
cardholderName: y ?? "",
|
|
27
|
-
maskedCardNumber:
|
|
28
|
-
programLabel:
|
|
29
|
-
statusLabel:
|
|
30
|
-
isLocked:
|
|
31
|
-
lockedLabel:
|
|
32
|
-
testIds:
|
|
29
|
+
maskedCardNumber: _e ?? "",
|
|
30
|
+
programLabel: ve ?? "",
|
|
31
|
+
statusLabel: ye,
|
|
32
|
+
isLocked: I,
|
|
33
|
+
lockedLabel: V.lock.cardFaceLabel,
|
|
34
|
+
testIds: B?.cardFace
|
|
33
35
|
});
|
|
34
|
-
return /* @__PURE__ */
|
|
35
|
-
"data-testid":
|
|
36
|
-
className: n("ttw:flex ttw:w-full ttw:flex-col",
|
|
37
|
-
children: [/* @__PURE__ */
|
|
38
|
-
testIds:
|
|
39
|
-
labels:
|
|
40
|
-
title: _ === "loaded" ? v ??
|
|
36
|
+
return /* @__PURE__ */ u("div", {
|
|
37
|
+
"data-testid": B?.root,
|
|
38
|
+
className: n("ttw:flex ttw:w-full ttw:flex-col", we),
|
|
39
|
+
children: [/* @__PURE__ */ l(te, {
|
|
40
|
+
testIds: B?.header,
|
|
41
|
+
labels: V.header,
|
|
42
|
+
title: _ === "loaded" ? v ?? V.header.untitledCard : void 0,
|
|
41
43
|
isTitlePending: _ === "loading",
|
|
42
|
-
statusLabel: _ === "loaded" ?
|
|
43
|
-
statusTone:
|
|
44
|
-
formFactorLabel: _ === "loaded" ?
|
|
45
|
-
cardMenu: _ === "loaded" ?
|
|
46
|
-
onClose:
|
|
47
|
-
}), /* @__PURE__ */
|
|
44
|
+
statusLabel: _ === "loaded" ? le : void 0,
|
|
45
|
+
statusTone: ue,
|
|
46
|
+
formFactorLabel: _ === "loaded" ? de : void 0,
|
|
47
|
+
cardMenu: _ === "loaded" ? fe : void 0,
|
|
48
|
+
onClose: pe
|
|
49
|
+
}), /* @__PURE__ */ l("div", {
|
|
48
50
|
className: "ttw:px-4 ttw:pb-4",
|
|
49
|
-
children: _ === "loading" ? /* @__PURE__ */
|
|
50
|
-
"data-testid":
|
|
51
|
+
children: _ === "loading" ? /* @__PURE__ */ u("div", {
|
|
52
|
+
"data-testid": B?.loading,
|
|
51
53
|
role: "status",
|
|
52
|
-
"aria-label":
|
|
54
|
+
"aria-label": V.status.loadingAriaLabel,
|
|
53
55
|
className: "ttw:space-y-4",
|
|
54
|
-
children: [/* @__PURE__ */
|
|
55
|
-
}) : _ === "error" ? /* @__PURE__ */
|
|
56
|
-
title:
|
|
57
|
-
description:
|
|
58
|
-
retryLabel:
|
|
59
|
-
onRetry:
|
|
60
|
-
}) : _ === "notFound" ? /* @__PURE__ */
|
|
61
|
-
icon: /* @__PURE__ */ f
|
|
62
|
-
title:
|
|
63
|
-
description:
|
|
64
|
-
}) : /* @__PURE__ */
|
|
56
|
+
children: [/* @__PURE__ */ l(t, { className: "ttw:h-8 ttw:w-56" }), /* @__PURE__ */ l(t, { className: "ttw:h-64 ttw:w-full ttw:rounded-xl" })]
|
|
57
|
+
}) : _ === "error" ? /* @__PURE__ */ l(r, {
|
|
58
|
+
title: V.status.errorTitle,
|
|
59
|
+
description: V.status.errorDescription,
|
|
60
|
+
retryLabel: V.status.errorRetry,
|
|
61
|
+
onRetry: Ce
|
|
62
|
+
}) : _ === "notFound" ? /* @__PURE__ */ l(ee, {
|
|
63
|
+
icon: /* @__PURE__ */ l(f, { className: "ttw:size-6 ttw:text-muted-foreground" }),
|
|
64
|
+
title: V.status.notFoundTitle,
|
|
65
|
+
description: V.status.notFoundDescription
|
|
66
|
+
}) : /* @__PURE__ */ u("div", {
|
|
65
67
|
className: "ttw:flex ttw:flex-col ttw:gap-4",
|
|
66
|
-
children: [/* @__PURE__ */
|
|
68
|
+
children: [/* @__PURE__ */ u("div", {
|
|
67
69
|
className: "ttw:flex ttw:flex-col ttw:overflow-hidden ttw:rounded-xl ttw:border ttw:border-border ttw:sm:flex-row",
|
|
68
|
-
children: [/* @__PURE__ */
|
|
70
|
+
children: [/* @__PURE__ */ l("div", {
|
|
69
71
|
className: "ttw:flex ttw:items-center ttw:justify-center ttw:bg-muted ttw:px-4 ttw:py-5",
|
|
70
|
-
children: /* @__PURE__ */
|
|
71
|
-
className: n("ttw:flex ttw:flex-col ttw:gap-4",
|
|
72
|
-
children: [
|
|
73
|
-
testIds:
|
|
72
|
+
children: /* @__PURE__ */ u("div", {
|
|
73
|
+
className: n("ttw:flex ttw:flex-col ttw:gap-4", ne),
|
|
74
|
+
children: [N ? /* @__PURE__ */ l(ie, {
|
|
75
|
+
testIds: B?.cardFaceFlip,
|
|
74
76
|
isFlipped: Y,
|
|
75
77
|
front: $,
|
|
76
|
-
back: /* @__PURE__ */
|
|
77
|
-
labels:
|
|
78
|
-
cardNumber:
|
|
79
|
-
expirationDate:
|
|
80
|
-
securityCode:
|
|
81
|
-
isLocked:
|
|
82
|
-
onCopy:
|
|
83
|
-
testIds:
|
|
78
|
+
back: /* @__PURE__ */ l(re, {
|
|
79
|
+
labels: V.credentials,
|
|
80
|
+
cardNumber: be,
|
|
81
|
+
expirationDate: xe,
|
|
82
|
+
securityCode: Se,
|
|
83
|
+
isLocked: I,
|
|
84
|
+
onCopy: w,
|
|
85
|
+
testIds: B?.credentialsFace
|
|
84
86
|
})
|
|
85
|
-
}) : $,
|
|
87
|
+
}) : $, M || N || Z ? /* @__PURE__ */ u("div", {
|
|
86
88
|
className: "ttw:flex ttw:flex-col ttw:gap-2",
|
|
87
89
|
children: [
|
|
88
|
-
|
|
90
|
+
M ? /* @__PURE__ */ u(e, {
|
|
89
91
|
type: "button",
|
|
90
92
|
className: "ttw:self-center",
|
|
91
|
-
onClick:
|
|
92
|
-
children: [/* @__PURE__ */
|
|
93
|
+
onClick: M,
|
|
94
|
+
children: [/* @__PURE__ */ l(ce, {
|
|
93
95
|
className: "ttw:size-4",
|
|
94
96
|
"aria-hidden": "true"
|
|
95
|
-
}),
|
|
97
|
+
}), V.actions.activateCard]
|
|
96
98
|
}) : null,
|
|
97
|
-
|
|
99
|
+
N || Z ? /* @__PURE__ */ u("div", {
|
|
98
100
|
className: "ttw:flex ttw:gap-2",
|
|
99
|
-
children: [
|
|
101
|
+
children: [N ? /* @__PURE__ */ u(e, {
|
|
100
102
|
type: "button",
|
|
101
103
|
variant: "outline",
|
|
102
104
|
className: "ttw:flex-1",
|
|
103
105
|
disabled: !X,
|
|
104
|
-
loading:
|
|
106
|
+
loading: F === "revealing",
|
|
105
107
|
onClick: X,
|
|
106
|
-
children: [
|
|
108
|
+
children: [l(Y ? m : p, {
|
|
107
109
|
className: "ttw:size-4",
|
|
108
110
|
"aria-hidden": "true"
|
|
109
|
-
}), Y ?
|
|
110
|
-
}) : null, Z ? /* @__PURE__ */
|
|
111
|
+
}), Y ? V.actions.hideCard : V.actions.viewCard]
|
|
112
|
+
}) : null, Z ? /* @__PURE__ */ u(e, {
|
|
111
113
|
type: "button",
|
|
112
114
|
variant: "outline",
|
|
113
115
|
className: "ttw:flex-1",
|
|
114
116
|
disabled: !Q,
|
|
115
|
-
loading:
|
|
117
|
+
loading: L === "pending",
|
|
116
118
|
onClick: Q,
|
|
117
|
-
children: [
|
|
119
|
+
children: [l(I ? se : h, {
|
|
118
120
|
className: "ttw:size-4",
|
|
119
121
|
"aria-hidden": "true"
|
|
120
|
-
}),
|
|
122
|
+
}), I ? V.lock.unlockCard : V.lock.lockCard]
|
|
121
123
|
}) : null]
|
|
122
124
|
}) : null,
|
|
123
|
-
|
|
125
|
+
I ? /* @__PURE__ */ l("p", {
|
|
124
126
|
className: "ttw:text-sm ttw:text-destructive",
|
|
125
|
-
children: Z ?
|
|
127
|
+
children: Z ? V.lock.lockedDescription : V.lock.lockedDescriptionWithoutUnlock
|
|
126
128
|
}) : null,
|
|
127
|
-
|
|
128
|
-
|
|
129
|
+
L === "errored" ? /* @__PURE__ */ l(i, { children: V.lock.errorDescription }) : null,
|
|
130
|
+
F === "errored" ? /* @__PURE__ */ l(i, { children: V.credentials.errorDescription }) : null
|
|
129
131
|
]
|
|
130
132
|
}) : null]
|
|
131
133
|
})
|
|
132
|
-
}), /* @__PURE__ */
|
|
134
|
+
}), /* @__PURE__ */ u("div", {
|
|
133
135
|
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",
|
|
134
136
|
children: [
|
|
135
|
-
/* @__PURE__ */
|
|
136
|
-
label:
|
|
137
|
-
copyAriaLabel: y &&
|
|
138
|
-
onCopy: y &&
|
|
139
|
-
children: y ??
|
|
137
|
+
/* @__PURE__ */ l(o, {
|
|
138
|
+
label: V.fields.cardholder,
|
|
139
|
+
copyAriaLabel: y && w ? V.fields.copyCardholderAriaLabel : void 0,
|
|
140
|
+
onCopy: y && w ? () => w(y) : void 0,
|
|
141
|
+
children: y ?? V.fields.emptyValue
|
|
140
142
|
}),
|
|
141
|
-
|
|
142
|
-
label:
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
143
|
+
Te ? /* @__PURE__ */ l(o, {
|
|
144
|
+
label: V.fields.billingAddress,
|
|
145
|
+
children: /* @__PURE__ */ u("div", {
|
|
146
|
+
className: "ttw:flex ttw:flex-col",
|
|
147
|
+
children: [
|
|
148
|
+
H ? /* @__PURE__ */ l(c, {
|
|
149
|
+
value: H,
|
|
150
|
+
copyAriaLabel: w ? V.fields.copyBillingAddressLine1AriaLabel : void 0,
|
|
151
|
+
onCopy: w ? () => w(H) : void 0
|
|
152
|
+
}) : null,
|
|
153
|
+
U ? /* @__PURE__ */ l(c, {
|
|
154
|
+
value: U,
|
|
155
|
+
copyAriaLabel: w ? V.fields.copyBillingAddressLine2AriaLabel : void 0,
|
|
156
|
+
onCopy: w ? () => w(U) : void 0
|
|
157
|
+
}) : null,
|
|
158
|
+
W ? /* @__PURE__ */ l(c, {
|
|
159
|
+
value: W,
|
|
160
|
+
copyAriaLabel: w ? V.fields.copyBillingAddressCityStateAriaLabel : void 0,
|
|
161
|
+
onCopy: w ? () => w(W) : void 0
|
|
162
|
+
}) : null,
|
|
163
|
+
G ? /* @__PURE__ */ l(c, {
|
|
164
|
+
value: G,
|
|
165
|
+
copyAriaLabel: w ? V.fields.copyBillingAddressPostalCodeAriaLabel : void 0,
|
|
166
|
+
onCopy: w ? () => w(G) : void 0
|
|
167
|
+
}) : null
|
|
168
|
+
]
|
|
169
|
+
})
|
|
146
170
|
}) : null,
|
|
147
|
-
/* @__PURE__ */
|
|
148
|
-
fieldLabels:
|
|
149
|
-
labels:
|
|
171
|
+
/* @__PURE__ */ l(ae, {
|
|
172
|
+
fieldLabels: V.fields,
|
|
173
|
+
labels: V.nickname,
|
|
150
174
|
nickname: v,
|
|
151
|
-
editState:
|
|
152
|
-
onEdit:
|
|
153
|
-
draft:
|
|
154
|
-
onDraftChange:
|
|
155
|
-
onSave:
|
|
156
|
-
onCancel:
|
|
157
|
-
isSaveDisabled:
|
|
158
|
-
copyAriaLabel: v &&
|
|
159
|
-
onCopy: v &&
|
|
175
|
+
editState: E,
|
|
176
|
+
onEdit: T,
|
|
177
|
+
draft: D,
|
|
178
|
+
onDraftChange: O,
|
|
179
|
+
onSave: k,
|
|
180
|
+
onCancel: A,
|
|
181
|
+
isSaveDisabled: j,
|
|
182
|
+
copyAriaLabel: v && w ? V.fields.copyNicknameAriaLabel : void 0,
|
|
183
|
+
onCopy: v && w ? () => w(v) : void 0,
|
|
160
184
|
isLast: !0
|
|
161
185
|
})
|
|
162
186
|
]
|
|
163
187
|
})]
|
|
164
|
-
}), K || q || J ? /* @__PURE__ */
|
|
188
|
+
}), K || q || J ? /* @__PURE__ */ u("div", {
|
|
165
189
|
className: "ttw:flex ttw:flex-col ttw:overflow-hidden ttw:rounded-xl ttw:border ttw:border-border",
|
|
166
190
|
children: [
|
|
167
|
-
/* @__PURE__ */
|
|
191
|
+
/* @__PURE__ */ l("h3", {
|
|
168
192
|
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",
|
|
169
|
-
children:
|
|
193
|
+
children: V.fields.cardControlsHeading
|
|
170
194
|
}),
|
|
171
|
-
K ? /* @__PURE__ */
|
|
172
|
-
label:
|
|
195
|
+
K ? /* @__PURE__ */ l(o, {
|
|
196
|
+
label: V.fields.allowedCategories,
|
|
173
197
|
isLast: !q && !J,
|
|
174
|
-
children: /* @__PURE__ */
|
|
198
|
+
children: /* @__PURE__ */ l("div", {
|
|
175
199
|
className: "ttw:mt-2 ttw:flex ttw:flex-wrap ttw:gap-2",
|
|
176
|
-
children:
|
|
200
|
+
children: x?.map((e) => /* @__PURE__ */ u("span", {
|
|
177
201
|
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",
|
|
178
|
-
children: [/* @__PURE__ */
|
|
202
|
+
children: [/* @__PURE__ */ l(d, {
|
|
179
203
|
"aria-hidden": "true",
|
|
180
204
|
className: "ttw:size-3.5"
|
|
181
205
|
}), e]
|
|
182
206
|
}, e))
|
|
183
207
|
})
|
|
184
208
|
}) : null,
|
|
185
|
-
q ? /* @__PURE__ */
|
|
186
|
-
label:
|
|
209
|
+
q ? /* @__PURE__ */ l(o, {
|
|
210
|
+
label: V.fields.spendLimit,
|
|
187
211
|
isLast: !J,
|
|
188
|
-
children: /* @__PURE__ */
|
|
212
|
+
children: /* @__PURE__ */ l("div", {
|
|
189
213
|
className: "ttw:flex ttw:flex-col ttw:gap-1",
|
|
190
|
-
children:
|
|
214
|
+
children: S?.map((e, t) => /* @__PURE__ */ l("div", { children: e }, `${e}-${t}`))
|
|
191
215
|
})
|
|
192
216
|
}) : null,
|
|
193
|
-
J ? /* @__PURE__ */
|
|
194
|
-
label:
|
|
217
|
+
J ? /* @__PURE__ */ l(o, {
|
|
218
|
+
label: V.fields.perTransactionMax,
|
|
195
219
|
isLast: !0,
|
|
196
|
-
children:
|
|
220
|
+
children: C
|
|
197
221
|
}) : null
|
|
198
222
|
]
|
|
199
223
|
}) : null]
|
|
@@ -4,32 +4,42 @@ import { CardFaceGlow as r } from "./CardFaceGlow.js";
|
|
|
4
4
|
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
5
|
import { LockIcon as o } from "lucide-react";
|
|
6
6
|
//#region ../../libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardFace.js
|
|
7
|
-
function s({
|
|
7
|
+
function s({ cardArtSrc: s, bankLogoSrc: c, bankLogoAlt: l, cardholderName: u, maskedCardNumber: d, programLabel: f, statusLabel: p, isLocked: m, lockedLabel: h, testIds: g, className: _ }) {
|
|
8
8
|
return /* @__PURE__ */ a("div", {
|
|
9
|
-
"data-testid":
|
|
10
|
-
className: e(n, "ttw:justify-between",
|
|
9
|
+
"data-testid": g?.root,
|
|
10
|
+
className: e(n, "ttw:justify-between", _),
|
|
11
11
|
children: [
|
|
12
|
-
/* @__PURE__ */ i(r, {}),
|
|
13
12
|
s ? /* @__PURE__ */ i("img", {
|
|
13
|
+
"data-testid": g?.cardArt,
|
|
14
14
|
src: s,
|
|
15
|
-
alt:
|
|
15
|
+
alt: "",
|
|
16
|
+
"aria-hidden": "true",
|
|
17
|
+
className: "ttw:absolute ttw:inset-0 ttw:h-full ttw:w-full ttw:object-cover"
|
|
18
|
+
}) : /* @__PURE__ */ i(r, {}),
|
|
19
|
+
s ? /* @__PURE__ */ i("div", {
|
|
20
|
+
"aria-hidden": "true",
|
|
21
|
+
className: "ttw:pointer-events-none ttw:absolute ttw:inset-x-0 ttw:bottom-0 ttw:h-20 ttw:bg-gradient-to-t ttw:from-black/70 ttw:to-transparent"
|
|
22
|
+
}) : null,
|
|
23
|
+
s ? /* @__PURE__ */ i("span", { className: "ttw:relative ttw:h-8" }) : c ? /* @__PURE__ */ i("img", {
|
|
24
|
+
src: c,
|
|
25
|
+
alt: l,
|
|
16
26
|
className: "ttw:relative ttw:h-8 ttw:w-auto ttw:max-w-[60%] ttw:object-contain ttw:object-left"
|
|
17
27
|
}) : /* @__PURE__ */ i("span", { className: "ttw:relative ttw:h-8" }),
|
|
18
|
-
|
|
19
|
-
"data-testid":
|
|
28
|
+
m ? /* @__PURE__ */ i("div", {
|
|
29
|
+
"data-testid": g?.lockedOverlay,
|
|
20
30
|
className: "ttw:pointer-events-none ttw:absolute ttw:inset-0 ttw:flex ttw:items-center ttw:justify-center ttw:bg-black/55",
|
|
21
|
-
children:
|
|
31
|
+
children: h ? /* @__PURE__ */ a("span", {
|
|
22
32
|
className: e(t, "ttw:inline-flex ttw:items-center ttw:gap-1.5"),
|
|
23
33
|
children: [/* @__PURE__ */ i(o, {
|
|
24
34
|
className: "ttw:size-3.5",
|
|
25
35
|
"aria-hidden": "true"
|
|
26
|
-
}),
|
|
36
|
+
}), h]
|
|
27
37
|
}) : null
|
|
28
|
-
}) :
|
|
38
|
+
}) : p ? /* @__PURE__ */ i("div", {
|
|
29
39
|
className: "ttw:pointer-events-none ttw:absolute ttw:inset-0 ttw:flex ttw:items-center ttw:justify-center",
|
|
30
40
|
children: /* @__PURE__ */ i("span", {
|
|
31
41
|
className: t,
|
|
32
|
-
children:
|
|
42
|
+
children: p
|
|
33
43
|
})
|
|
34
44
|
}) : null,
|
|
35
45
|
/* @__PURE__ */ a("div", {
|
|
@@ -38,14 +48,14 @@ function s({ bankLogoSrc: s, bankLogoAlt: c, cardholderName: l, maskedCardNumber
|
|
|
38
48
|
className: "ttw:min-w-0",
|
|
39
49
|
children: [/* @__PURE__ */ i("p", {
|
|
40
50
|
className: "ttw:truncate ttw:text-base ttw:font-medium ttw:text-white",
|
|
41
|
-
children:
|
|
51
|
+
children: u
|
|
42
52
|
}), /* @__PURE__ */ i("p", {
|
|
43
53
|
className: "ttw:mt-1 ttw:truncate ttw:text-lg ttw:tracking-wide ttw:text-white/90",
|
|
44
|
-
children:
|
|
54
|
+
children: d
|
|
45
55
|
})]
|
|
46
56
|
}), /* @__PURE__ */ i("p", {
|
|
47
57
|
className: "ttw:shrink-0 ttw:text-[10px] ttw:font-medium ttw:text-white/90",
|
|
48
|
-
children:
|
|
58
|
+
children: f
|
|
49
59
|
})]
|
|
50
60
|
})
|
|
51
61
|
]
|
|
@@ -17,7 +17,10 @@ var e = {
|
|
|
17
17
|
emptyValue: "—",
|
|
18
18
|
copyCardholderAriaLabel: "Copy cardholder",
|
|
19
19
|
copyNicknameAriaLabel: "Copy nickname",
|
|
20
|
-
|
|
20
|
+
copyBillingAddressLine1AriaLabel: "Copy street address 1",
|
|
21
|
+
copyBillingAddressLine2AriaLabel: "Copy street address 2",
|
|
22
|
+
copyBillingAddressCityStateAriaLabel: "Copy city and state",
|
|
23
|
+
copyBillingAddressPostalCodeAriaLabel: "Copy ZIP code"
|
|
21
24
|
},
|
|
22
25
|
actions: {
|
|
23
26
|
activateCard: "Activate card",
|