@tesouro/embedded-components-react 0.3.61 → 0.3.63
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 +11 -11
- package/dist/index.css +6 -0
- package/dist/index.d.ts +44 -0
- package/dist/index.js +1 -1
- package/dist/lib/CardDetailsWidget.d.ts +44 -0
- package/dist/lib/CardDetailsWidget.js +1 -1
- package/dist/lib/CreditCardsWidget.d.ts +44 -0
- package/dist/lib/DebitCardsWidget.d.ts +44 -0
- package/dist/lib/WidgetSuite.d.ts +44 -0
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index.js +4 -2
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index10.js +32 -0
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index11.js +27 -0
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index9.js +17 -12
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index10.js +26 -0
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index11.js +63 -0
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index12.js +79 -0
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index13.js +219 -0
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index3.js +18 -2
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index4.js +29 -28
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index5.js +3 -0
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index6.js +33 -19
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index7.js +17 -102
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index8.js +14 -181
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index9.js +113 -0
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/ActivateCardPanel/ActivateCardPanel.js +58 -55
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/ActivateCardPanel/ActivateCardSuccessView.js +12 -13
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardCredentialsFace.js +27 -24
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsHeader.js +26 -27
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsPanel.js +140 -110
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardFace.js +29 -19
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardFaceFlip.js +16 -17
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/DetailCopyRow.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/NicknameRow.js +65 -0
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/labels.js +23 -0
- package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index9.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +22 -22
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +165 -151
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +164 -132
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/zod.gen.js +2325 -2315
- 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/testIds.js +0 -14
|
@@ -1,56 +1,55 @@
|
|
|
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
2
|
import { cardStatusToneClassName as o } from "./statusBadge.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { EllipsisVerticalIcon as u, XIcon as d } from "lucide-react";
|
|
3
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
4
|
+
import { EllipsisVerticalIcon as l, XIcon as u } from "lucide-react";
|
|
6
5
|
//#region ../../libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsHeader.js
|
|
7
|
-
function
|
|
8
|
-
return /* @__PURE__ */
|
|
6
|
+
function d({ labels: d, title: f, isTitlePending: p, statusLabel: m, statusTone: h, formFactorLabel: g, cardMenu: _, onClose: v, testIds: y }) {
|
|
7
|
+
return /* @__PURE__ */ c("div", {
|
|
9
8
|
className: "ttw:flex ttw:items-start ttw:gap-1.5 ttw:px-4 ttw:pt-4 ttw:pb-3",
|
|
10
9
|
children: [
|
|
11
|
-
/* @__PURE__ */
|
|
10
|
+
/* @__PURE__ */ c("div", {
|
|
12
11
|
className: "ttw:flex ttw:min-w-0 ttw:flex-1 ttw:flex-col ttw:gap-1.5",
|
|
13
|
-
children: [/* @__PURE__ */
|
|
12
|
+
children: [/* @__PURE__ */ c("div", {
|
|
14
13
|
className: "ttw:flex ttw:items-center ttw:gap-1.5",
|
|
15
|
-
children: [
|
|
14
|
+
children: [p ? /* @__PURE__ */ s(a, { className: "ttw:h-8 ttw:w-48" }) : f ? /* @__PURE__ */ s("h2", {
|
|
16
15
|
className: "ttw:truncate ttw:text-2xl ttw:font-semibold ttw:tracking-[-0.6px] ttw:text-foreground",
|
|
17
|
-
children:
|
|
18
|
-
}) : null,
|
|
19
|
-
className: o(
|
|
20
|
-
children:
|
|
16
|
+
children: f
|
|
17
|
+
}) : null, m ? /* @__PURE__ */ s(e, {
|
|
18
|
+
className: o(h ?? "neutral"),
|
|
19
|
+
children: m
|
|
21
20
|
}) : null]
|
|
22
|
-
}),
|
|
21
|
+
}), g ? /* @__PURE__ */ s("p", {
|
|
23
22
|
className: "ttw:text-sm ttw:text-muted-foreground",
|
|
24
|
-
children:
|
|
23
|
+
children: g
|
|
25
24
|
}) : null]
|
|
26
25
|
}),
|
|
27
|
-
|
|
26
|
+
_ ? /* @__PURE__ */ c(n, { children: [/* @__PURE__ */ s(i, {
|
|
28
27
|
asChild: !0,
|
|
29
|
-
children: /* @__PURE__ */
|
|
28
|
+
children: /* @__PURE__ */ s(t, {
|
|
30
29
|
type: "button",
|
|
31
30
|
variant: "ghost",
|
|
32
31
|
size: "icon",
|
|
33
32
|
className: "ttw:size-8 ttw:shrink-0 ttw:bg-muted",
|
|
34
|
-
"aria-label":
|
|
35
|
-
"data-testid":
|
|
36
|
-
children: /* @__PURE__ */
|
|
33
|
+
"aria-label": d.menuTriggerAriaLabel,
|
|
34
|
+
"data-testid": y?.menuTrigger,
|
|
35
|
+
children: /* @__PURE__ */ s(l, { className: "ttw:size-4" })
|
|
37
36
|
})
|
|
38
|
-
}), /* @__PURE__ */
|
|
37
|
+
}), /* @__PURE__ */ s(r, {
|
|
39
38
|
align: "end",
|
|
40
|
-
children:
|
|
39
|
+
children: _
|
|
41
40
|
})] }) : null,
|
|
42
|
-
|
|
41
|
+
v ? /* @__PURE__ */ s(t, {
|
|
43
42
|
type: "button",
|
|
44
43
|
variant: "ghost",
|
|
45
44
|
size: "icon",
|
|
46
45
|
className: "ttw:size-8 ttw:shrink-0",
|
|
47
|
-
"aria-label":
|
|
48
|
-
"data-testid":
|
|
49
|
-
onClick:
|
|
50
|
-
children: /* @__PURE__ */
|
|
46
|
+
"aria-label": d.closeAriaLabel,
|
|
47
|
+
"data-testid": y?.closeButton,
|
|
48
|
+
onClick: v,
|
|
49
|
+
children: /* @__PURE__ */ s(u, { className: "ttw:size-4" })
|
|
51
50
|
}) : null
|
|
52
51
|
]
|
|
53
52
|
});
|
|
54
53
|
}
|
|
55
54
|
//#endregion
|
|
56
|
-
export {
|
|
55
|
+
export { d as CardDetailsHeader };
|
|
@@ -4,166 +4,196 @@
|
|
|
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
6
|
import { EmptyState as r } from "../../../../../shared/ui/dist/lib/EmptyState/EmptyState.js";
|
|
7
|
-
import { ErrorState as
|
|
8
|
-
import { InlineErrorAlert as
|
|
7
|
+
import { ErrorState as ee } from "../../../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
|
|
8
|
+
import { InlineErrorAlert as i } from "../../../../../shared/ui/dist/lib/InlineErrorAlert/InlineErrorAlert.js";
|
|
9
9
|
import "../../../../../shared/ui/dist/index.js";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import { useMemo as
|
|
19
|
-
import { jsx as
|
|
20
|
-
import { CheckIcon as
|
|
10
|
+
import { CardDetailsHeader as a } from "./CardDetailsHeader.js";
|
|
11
|
+
import { CARD_FACE_WIDTH_CLASS_NAME as te } from "./cardFaceSurface.js";
|
|
12
|
+
import { CardFace as ne } from "./CardFace.js";
|
|
13
|
+
import { DetailCopyRow as o } from "./DetailCopyRow.js";
|
|
14
|
+
import { resolveCardDetailsPanelLabels as s } from "./labels.js";
|
|
15
|
+
import { CardCredentialsFace as c } from "./CardCredentialsFace.js";
|
|
16
|
+
import { CardFaceFlip as l } from "./CardFaceFlip.js";
|
|
17
|
+
import { NicknameRow as u } from "./NicknameRow.js";
|
|
18
|
+
import { useMemo as d } from "react";
|
|
19
|
+
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
20
|
+
import { CheckIcon as re, CreditCardIcon as m, EyeIcon as h, EyeOffIcon as ie, LockIcon as ae, LockOpenIcon as oe, PowerIcon as se } from "lucide-react";
|
|
21
21
|
//#region ../../libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsPanel.js
|
|
22
|
-
function
|
|
23
|
-
let
|
|
24
|
-
bankLogoSrc:
|
|
25
|
-
bankLogoAlt:
|
|
26
|
-
cardholderName:
|
|
27
|
-
maskedCardNumber:
|
|
28
|
-
programLabel:
|
|
29
|
-
statusLabel:
|
|
22
|
+
function g({ labels: g, state: _, nickname: v, statusLabel: ce, statusTone: le, formFactorLabel: ue, cardMenu: de, onClose: fe, bankLogoSrc: pe, bankLogoAlt: me, cardholderName: y, maskedCardNumber: b, programLabel: x, cardFaceStatusLabel: S, billingAddress: C, allowedCategories: w, spendLimitLabels: T, perTransactionMaxLabel: E, onCopy: D, onEditNickname: O, nicknameEditState: k = "closed", nicknameDraft: A, onNicknameDraftChange: j, onSaveNickname: M, onCancelNicknameEdit: N, isNicknameSaveDisabled: P, onActivate: F, onViewCard: I, onHideCard: L, revealState: R = "hidden", revealedCardNumber: z, revealedExpirationDate: he, revealedSecurityCode: ge, isLocked: B, lockState: V = "idle", onLockCard: H, onUnlockCard: U, onRetry: _e, testIds: W, className: ve }) {
|
|
23
|
+
let G = d(() => s(g), [g]), K = !!w?.length, q = !!T?.length, J = !!E, Y = R === "revealed", X = Y ? L : I, Z = !!(H || U), Q = B ? U : H, $ = /* @__PURE__ */ f(ne, {
|
|
24
|
+
bankLogoSrc: pe,
|
|
25
|
+
bankLogoAlt: me ?? G.cardFace.bankLogoAlt,
|
|
26
|
+
cardholderName: y ?? "",
|
|
27
|
+
maskedCardNumber: b ?? "",
|
|
28
|
+
programLabel: x ?? "",
|
|
29
|
+
statusLabel: S,
|
|
30
|
+
isLocked: B,
|
|
31
|
+
lockedLabel: G.lock.cardFaceLabel,
|
|
32
|
+
testIds: W?.cardFace
|
|
30
33
|
});
|
|
31
|
-
return /* @__PURE__ */
|
|
32
|
-
"data-testid":
|
|
33
|
-
className: n("ttw:flex ttw:w-full ttw:flex-col",
|
|
34
|
-
children: [/* @__PURE__ */
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
34
|
+
return /* @__PURE__ */ p("div", {
|
|
35
|
+
"data-testid": W?.root,
|
|
36
|
+
className: n("ttw:flex ttw:w-full ttw:flex-col", ve),
|
|
37
|
+
children: [/* @__PURE__ */ f(a, {
|
|
38
|
+
testIds: W?.header,
|
|
39
|
+
labels: G.header,
|
|
40
|
+
title: _ === "loaded" ? v ?? G.header.untitledCard : void 0,
|
|
41
|
+
isTitlePending: _ === "loading",
|
|
42
|
+
statusLabel: _ === "loaded" ? ce : void 0,
|
|
43
|
+
statusTone: le,
|
|
44
|
+
formFactorLabel: _ === "loaded" ? ue : void 0,
|
|
45
|
+
cardMenu: _ === "loaded" ? de : void 0,
|
|
46
|
+
onClose: fe
|
|
47
|
+
}), /* @__PURE__ */ f("div", {
|
|
44
48
|
className: "ttw:px-4 ttw:pb-4",
|
|
45
|
-
children:
|
|
46
|
-
"data-testid":
|
|
49
|
+
children: _ === "loading" ? /* @__PURE__ */ p("div", {
|
|
50
|
+
"data-testid": W?.loading,
|
|
47
51
|
role: "status",
|
|
48
|
-
"aria-label":
|
|
52
|
+
"aria-label": G.status.loadingAriaLabel,
|
|
49
53
|
className: "ttw:space-y-4",
|
|
50
|
-
children: [/* @__PURE__ */
|
|
51
|
-
}) :
|
|
52
|
-
title:
|
|
53
|
-
description:
|
|
54
|
-
retryLabel:
|
|
55
|
-
onRetry:
|
|
56
|
-
}) :
|
|
57
|
-
icon: /* @__PURE__ */ m
|
|
58
|
-
title:
|
|
59
|
-
description:
|
|
60
|
-
}) : /* @__PURE__ */
|
|
54
|
+
children: [/* @__PURE__ */ f(t, { className: "ttw:h-8 ttw:w-56" }), /* @__PURE__ */ f(t, { className: "ttw:h-64 ttw:w-full ttw:rounded-xl" })]
|
|
55
|
+
}) : _ === "error" ? /* @__PURE__ */ f(ee, {
|
|
56
|
+
title: G.status.errorTitle,
|
|
57
|
+
description: G.status.errorDescription,
|
|
58
|
+
retryLabel: G.status.errorRetry,
|
|
59
|
+
onRetry: _e
|
|
60
|
+
}) : _ === "notFound" ? /* @__PURE__ */ f(r, {
|
|
61
|
+
icon: /* @__PURE__ */ f(m, { className: "ttw:size-6 ttw:text-muted-foreground" }),
|
|
62
|
+
title: G.status.notFoundTitle,
|
|
63
|
+
description: G.status.notFoundDescription
|
|
64
|
+
}) : /* @__PURE__ */ p("div", {
|
|
61
65
|
className: "ttw:flex ttw:flex-col ttw:gap-4",
|
|
62
|
-
children: [/* @__PURE__ */
|
|
66
|
+
children: [/* @__PURE__ */ p("div", {
|
|
63
67
|
className: "ttw:flex ttw:flex-col ttw:overflow-hidden ttw:rounded-xl ttw:border ttw:border-border ttw:sm:flex-row",
|
|
64
|
-
children: [/* @__PURE__ */
|
|
68
|
+
children: [/* @__PURE__ */ f("div", {
|
|
65
69
|
className: "ttw:flex ttw:items-center ttw:justify-center ttw:bg-muted ttw:px-4 ttw:py-5",
|
|
66
|
-
children: /* @__PURE__ */
|
|
67
|
-
className: n("ttw:flex ttw:flex-col ttw:gap-4",
|
|
68
|
-
children: [
|
|
69
|
-
|
|
70
|
+
children: /* @__PURE__ */ p("div", {
|
|
71
|
+
className: n("ttw:flex ttw:flex-col ttw:gap-4", te),
|
|
72
|
+
children: [I ? /* @__PURE__ */ f(l, {
|
|
73
|
+
testIds: W?.cardFaceFlip,
|
|
74
|
+
isFlipped: Y,
|
|
70
75
|
front: $,
|
|
71
|
-
back: /* @__PURE__ */
|
|
72
|
-
labels:
|
|
73
|
-
cardNumber:
|
|
74
|
-
expirationDate:
|
|
75
|
-
securityCode:
|
|
76
|
-
|
|
76
|
+
back: /* @__PURE__ */ f(c, {
|
|
77
|
+
labels: G.credentials,
|
|
78
|
+
cardNumber: z,
|
|
79
|
+
expirationDate: he,
|
|
80
|
+
securityCode: ge,
|
|
81
|
+
isLocked: B,
|
|
82
|
+
onCopy: D,
|
|
83
|
+
testIds: W?.credentialsFace
|
|
77
84
|
})
|
|
78
|
-
}) : $,
|
|
85
|
+
}) : $, F || I || Z ? /* @__PURE__ */ p("div", {
|
|
79
86
|
className: "ttw:flex ttw:flex-col ttw:gap-2",
|
|
80
87
|
children: [
|
|
81
|
-
|
|
88
|
+
F ? /* @__PURE__ */ p(e, {
|
|
82
89
|
type: "button",
|
|
83
90
|
className: "ttw:self-center",
|
|
84
|
-
onClick:
|
|
85
|
-
children: [/* @__PURE__ */
|
|
91
|
+
onClick: F,
|
|
92
|
+
children: [/* @__PURE__ */ f(se, {
|
|
86
93
|
className: "ttw:size-4",
|
|
87
94
|
"aria-hidden": "true"
|
|
88
|
-
}),
|
|
95
|
+
}), G.actions.activateCard]
|
|
89
96
|
}) : null,
|
|
90
|
-
|
|
97
|
+
I || Z ? /* @__PURE__ */ p("div", {
|
|
91
98
|
className: "ttw:flex ttw:gap-2",
|
|
92
|
-
children: /* @__PURE__ */
|
|
99
|
+
children: [I ? /* @__PURE__ */ p(e, {
|
|
100
|
+
type: "button",
|
|
101
|
+
variant: "outline",
|
|
102
|
+
className: "ttw:flex-1",
|
|
103
|
+
disabled: !X,
|
|
104
|
+
loading: R === "revealing",
|
|
105
|
+
onClick: X,
|
|
106
|
+
children: [f(Y ? ie : h, {
|
|
107
|
+
className: "ttw:size-4",
|
|
108
|
+
"aria-hidden": "true"
|
|
109
|
+
}), Y ? G.actions.hideCard : G.actions.viewCard]
|
|
110
|
+
}) : null, Z ? /* @__PURE__ */ p(e, {
|
|
93
111
|
type: "button",
|
|
94
112
|
variant: "outline",
|
|
95
113
|
className: "ttw:flex-1",
|
|
96
114
|
disabled: !Q,
|
|
97
|
-
loading: V === "
|
|
115
|
+
loading: V === "pending",
|
|
98
116
|
onClick: Q,
|
|
99
|
-
children: [
|
|
117
|
+
children: [f(B ? oe : ae, {
|
|
100
118
|
className: "ttw:size-4",
|
|
101
119
|
"aria-hidden": "true"
|
|
102
|
-
}),
|
|
103
|
-
})
|
|
120
|
+
}), B ? G.lock.unlockCard : G.lock.lockCard]
|
|
121
|
+
}) : null]
|
|
122
|
+
}) : null,
|
|
123
|
+
B ? /* @__PURE__ */ f("p", {
|
|
124
|
+
className: "ttw:text-sm ttw:text-destructive",
|
|
125
|
+
children: Z ? G.lock.lockedDescription : G.lock.lockedDescriptionWithoutUnlock
|
|
104
126
|
}) : null,
|
|
105
|
-
V === "errored" ? /* @__PURE__ */
|
|
127
|
+
V === "errored" ? /* @__PURE__ */ f(i, { children: G.lock.errorDescription }) : null,
|
|
128
|
+
R === "errored" ? /* @__PURE__ */ f(i, { children: G.credentials.errorDescription }) : null
|
|
106
129
|
]
|
|
107
130
|
}) : null]
|
|
108
131
|
})
|
|
109
|
-
}), /* @__PURE__ */
|
|
132
|
+
}), /* @__PURE__ */ p("div", {
|
|
110
133
|
className: "ttw:flex ttw:min-w-0 ttw:flex-1 ttw:flex-col ttw:border-t ttw:border-border ttw:sm:border-t-0 ttw:sm:border-l",
|
|
111
134
|
children: [
|
|
112
|
-
/* @__PURE__ */
|
|
113
|
-
label:
|
|
114
|
-
copyAriaLabel:
|
|
115
|
-
onCopy:
|
|
116
|
-
children:
|
|
135
|
+
/* @__PURE__ */ f(o, {
|
|
136
|
+
label: G.fields.cardholder,
|
|
137
|
+
copyAriaLabel: y && D ? G.fields.copyCardholderAriaLabel : void 0,
|
|
138
|
+
onCopy: y && D ? () => D(y) : void 0,
|
|
139
|
+
children: y ?? G.fields.emptyValue
|
|
117
140
|
}),
|
|
118
|
-
/* @__PURE__ */
|
|
119
|
-
label:
|
|
120
|
-
copyAriaLabel:
|
|
121
|
-
onCopy:
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
141
|
+
C ? /* @__PURE__ */ f(o, {
|
|
142
|
+
label: G.fields.billingAddress,
|
|
143
|
+
copyAriaLabel: D ? G.fields.copyBillingAddressAriaLabel : void 0,
|
|
144
|
+
onCopy: D ? () => D(C) : void 0,
|
|
145
|
+
children: C
|
|
146
|
+
}) : null,
|
|
147
|
+
/* @__PURE__ */ f(u, {
|
|
148
|
+
fieldLabels: G.fields,
|
|
149
|
+
labels: G.nickname,
|
|
150
|
+
nickname: v,
|
|
151
|
+
editState: k,
|
|
152
|
+
onEdit: O,
|
|
153
|
+
draft: A,
|
|
154
|
+
onDraftChange: j,
|
|
155
|
+
onSave: M,
|
|
156
|
+
onCancel: N,
|
|
157
|
+
isSaveDisabled: P,
|
|
158
|
+
copyAriaLabel: v && D ? G.fields.copyNicknameAriaLabel : void 0,
|
|
159
|
+
onCopy: v && D ? () => D(v) : void 0,
|
|
160
|
+
isLast: !0
|
|
161
|
+
})
|
|
132
162
|
]
|
|
133
163
|
})]
|
|
134
|
-
}),
|
|
164
|
+
}), K || q || J ? /* @__PURE__ */ p("div", {
|
|
135
165
|
className: "ttw:flex ttw:flex-col ttw:overflow-hidden ttw:rounded-xl ttw:border ttw:border-border",
|
|
136
166
|
children: [
|
|
137
|
-
/* @__PURE__ */
|
|
167
|
+
/* @__PURE__ */ f("h3", {
|
|
138
168
|
className: "ttw:border-b ttw:border-border ttw:px-4 ttw:pt-4 ttw:pb-3 ttw:text-base ttw:font-semibold ttw:text-foreground",
|
|
139
|
-
children:
|
|
169
|
+
children: G.fields.cardControlsHeading
|
|
140
170
|
}),
|
|
141
|
-
|
|
142
|
-
label:
|
|
143
|
-
isLast: !
|
|
144
|
-
children: /* @__PURE__ */
|
|
171
|
+
K ? /* @__PURE__ */ f(o, {
|
|
172
|
+
label: G.fields.allowedCategories,
|
|
173
|
+
isLast: !q && !J,
|
|
174
|
+
children: /* @__PURE__ */ f("div", {
|
|
145
175
|
className: "ttw:mt-2 ttw:flex ttw:flex-wrap ttw:gap-2",
|
|
146
|
-
children:
|
|
176
|
+
children: w?.map((e) => /* @__PURE__ */ p("span", {
|
|
147
177
|
className: "ttw:inline-flex ttw:items-center ttw:gap-1.5 ttw:rounded-full ttw:border ttw:border-primary ttw:bg-primary/5 ttw:px-4 ttw:py-2 ttw:text-sm ttw:font-semibold ttw:text-primary",
|
|
148
|
-
children: [/* @__PURE__ */
|
|
178
|
+
children: [/* @__PURE__ */ f(re, {
|
|
149
179
|
"aria-hidden": "true",
|
|
150
180
|
className: "ttw:size-3.5"
|
|
151
181
|
}), e]
|
|
152
182
|
}, e))
|
|
153
183
|
})
|
|
154
184
|
}) : null,
|
|
155
|
-
|
|
156
|
-
label:
|
|
157
|
-
isLast: !
|
|
158
|
-
children: /* @__PURE__ */
|
|
185
|
+
q ? /* @__PURE__ */ f(o, {
|
|
186
|
+
label: G.fields.spendLimit,
|
|
187
|
+
isLast: !J,
|
|
188
|
+
children: /* @__PURE__ */ f("div", {
|
|
159
189
|
className: "ttw:flex ttw:flex-col ttw:gap-1",
|
|
160
|
-
children:
|
|
190
|
+
children: T?.map((e, t) => /* @__PURE__ */ f("div", { children: e }, `${e}-${t}`))
|
|
161
191
|
})
|
|
162
192
|
}) : null,
|
|
163
|
-
|
|
164
|
-
label:
|
|
193
|
+
J ? /* @__PURE__ */ f(o, {
|
|
194
|
+
label: G.fields.perTransactionMax,
|
|
165
195
|
isLast: !0,
|
|
166
|
-
children:
|
|
196
|
+
children: E
|
|
167
197
|
}) : null
|
|
168
198
|
]
|
|
169
199
|
}) : null]
|
|
@@ -172,4 +202,4 @@ function x({ labels: x, state: S, nickname: C, statusLabel: te, statusTone: ne,
|
|
|
172
202
|
});
|
|
173
203
|
}
|
|
174
204
|
//#endregion
|
|
175
|
-
export {
|
|
205
|
+
export { g as CardDetailsPanel };
|
|
@@ -1,39 +1,49 @@
|
|
|
1
1
|
import { cn as e } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { CARD_FACE_STATUS_PILL_CLASS_NAME as t, CARD_FACE_SURFACE_CLASS_NAME as n } from "./cardFaceSurface.js";
|
|
3
|
+
import { CardFaceGlow as r } from "./CardFaceGlow.js";
|
|
4
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
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({ bankLogoSrc: s, bankLogoAlt: c, cardholderName: l, maskedCardNumber: u, programLabel: d, statusLabel: f,
|
|
8
|
-
return /* @__PURE__ */
|
|
9
|
-
"data-testid":
|
|
10
|
-
className: e(
|
|
7
|
+
function s({ bankLogoSrc: s, bankLogoAlt: c, cardholderName: l, maskedCardNumber: u, programLabel: d, statusLabel: f, isLocked: p, lockedLabel: m, testIds: h, className: g }) {
|
|
8
|
+
return /* @__PURE__ */ a("div", {
|
|
9
|
+
"data-testid": h?.root,
|
|
10
|
+
className: e(n, "ttw:justify-between", g),
|
|
11
11
|
children: [
|
|
12
|
-
/* @__PURE__ */
|
|
13
|
-
s ? /* @__PURE__ */
|
|
12
|
+
/* @__PURE__ */ i(r, {}),
|
|
13
|
+
s ? /* @__PURE__ */ i("img", {
|
|
14
14
|
src: s,
|
|
15
15
|
alt: c,
|
|
16
16
|
className: "ttw:relative ttw:h-8 ttw:w-auto ttw:max-w-[60%] ttw:object-contain ttw:object-left"
|
|
17
|
-
}) : /* @__PURE__ */
|
|
18
|
-
|
|
17
|
+
}) : /* @__PURE__ */ i("span", { className: "ttw:relative ttw:h-8" }),
|
|
18
|
+
p ? /* @__PURE__ */ i("div", {
|
|
19
|
+
"data-testid": h?.lockedOverlay,
|
|
20
|
+
className: "ttw:pointer-events-none ttw:absolute ttw:inset-0 ttw:flex ttw:items-center ttw:justify-center ttw:bg-black/55",
|
|
21
|
+
children: m ? /* @__PURE__ */ a("span", {
|
|
22
|
+
className: e(t, "ttw:inline-flex ttw:items-center ttw:gap-1.5"),
|
|
23
|
+
children: [/* @__PURE__ */ i(o, {
|
|
24
|
+
className: "ttw:size-3.5",
|
|
25
|
+
"aria-hidden": "true"
|
|
26
|
+
}), m]
|
|
27
|
+
}) : null
|
|
28
|
+
}) : f ? /* @__PURE__ */ i("div", {
|
|
19
29
|
className: "ttw:pointer-events-none ttw:absolute ttw:inset-0 ttw:flex ttw:items-center ttw:justify-center",
|
|
20
|
-
children: /* @__PURE__ */
|
|
21
|
-
className:
|
|
30
|
+
children: /* @__PURE__ */ i("span", {
|
|
31
|
+
className: t,
|
|
22
32
|
children: f
|
|
23
33
|
})
|
|
24
34
|
}) : null,
|
|
25
|
-
/* @__PURE__ */
|
|
35
|
+
/* @__PURE__ */ a("div", {
|
|
26
36
|
className: "ttw:relative ttw:flex ttw:items-end ttw:justify-between ttw:gap-3",
|
|
27
|
-
children: [/* @__PURE__ */
|
|
37
|
+
children: [/* @__PURE__ */ a("div", {
|
|
28
38
|
className: "ttw:min-w-0",
|
|
29
|
-
children: [/* @__PURE__ */
|
|
39
|
+
children: [/* @__PURE__ */ i("p", {
|
|
30
40
|
className: "ttw:truncate ttw:text-base ttw:font-medium ttw:text-white",
|
|
31
41
|
children: l
|
|
32
|
-
}), /* @__PURE__ */
|
|
42
|
+
}), /* @__PURE__ */ i("p", {
|
|
33
43
|
className: "ttw:mt-1 ttw:truncate ttw:text-lg ttw:tracking-wide ttw:text-white/90",
|
|
34
44
|
children: u
|
|
35
45
|
})]
|
|
36
|
-
}), /* @__PURE__ */
|
|
46
|
+
}), /* @__PURE__ */ i("p", {
|
|
37
47
|
className: "ttw:shrink-0 ttw:text-[10px] ttw:font-medium ttw:text-white/90",
|
|
38
48
|
children: d
|
|
39
49
|
})]
|
|
@@ -1,27 +1,26 @@
|
|
|
1
1
|
import { cn as e } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
2
|
+
import { CARD_FACE_HEIGHT_CLASS_NAME as t, CARD_FACE_WIDTH_CLASS_NAME as n } from "./cardFaceSurface.js";
|
|
3
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
4
|
//#region ../../libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardFaceFlip.js
|
|
6
|
-
function
|
|
7
|
-
return /* @__PURE__ */
|
|
5
|
+
function a({ isFlipped: a, front: o, back: s, testIds: c, className: l }) {
|
|
6
|
+
return /* @__PURE__ */ r("div", {
|
|
8
7
|
className: e("ttw:perspective-[1000px]", l),
|
|
9
|
-
children: /* @__PURE__ */
|
|
10
|
-
"data-testid":
|
|
11
|
-
className: e("ttw:relative ttw:transform-3d",
|
|
12
|
-
children: [/* @__PURE__ */
|
|
8
|
+
children: /* @__PURE__ */ i("div", {
|
|
9
|
+
"data-testid": c?.root,
|
|
10
|
+
className: e("ttw:relative ttw:transform-3d", t, n, "ttw:motion-safe:transition-transform ttw:motion-safe:duration-500", a && "ttw:rotate-y-180"),
|
|
11
|
+
children: [/* @__PURE__ */ r("div", {
|
|
13
12
|
className: "ttw:absolute ttw:inset-0 ttw:backface-hidden",
|
|
14
|
-
"aria-hidden":
|
|
15
|
-
inert:
|
|
16
|
-
children:
|
|
17
|
-
}), /* @__PURE__ */
|
|
13
|
+
"aria-hidden": a || void 0,
|
|
14
|
+
inert: a || void 0,
|
|
15
|
+
children: o
|
|
16
|
+
}), /* @__PURE__ */ r("div", {
|
|
18
17
|
className: "ttw:absolute ttw:inset-0 ttw:rotate-y-180 ttw:backface-hidden",
|
|
19
|
-
"aria-hidden": !
|
|
20
|
-
inert: !
|
|
21
|
-
children:
|
|
18
|
+
"aria-hidden": !a || void 0,
|
|
19
|
+
inert: !a || void 0,
|
|
20
|
+
children: s
|
|
22
21
|
})]
|
|
23
22
|
})
|
|
24
23
|
});
|
|
25
24
|
}
|
|
26
25
|
//#endregion
|
|
27
|
-
export {
|
|
26
|
+
export { a as CardFaceFlip };
|
|
@@ -2,9 +2,9 @@ import { Button as e } from "../../../../../../../packages/shared-ui-shadcn/dist
|
|
|
2
2
|
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
3
|
import { CopyIcon as r } from "lucide-react";
|
|
4
4
|
//#region ../../libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/DetailCopyRow.js
|
|
5
|
-
function i({ label: i, children: a, copyAriaLabel: o, onCopy: s,
|
|
5
|
+
function i({ label: i, children: a, copyAriaLabel: o, onCopy: s, trailing: c, isLast: l }) {
|
|
6
6
|
return /* @__PURE__ */ n("div", {
|
|
7
|
-
className: "ttw:flex ttw:items-start ttw:justify-between ttw:gap-3 ttw:px-4 ttw:py-3" + (
|
|
7
|
+
className: "ttw:flex ttw:items-start ttw:justify-between ttw:gap-3 ttw:px-4 ttw:py-3" + (l ? "" : " ttw:border-b ttw:border-border"),
|
|
8
8
|
children: [/* @__PURE__ */ n("div", {
|
|
9
9
|
className: "ttw:min-w-0 ttw:space-y-1",
|
|
10
10
|
children: [/* @__PURE__ */ t("p", {
|
|
@@ -14,7 +14,7 @@ function i({ label: i, children: a, copyAriaLabel: o, onCopy: s, isLast: c }) {
|
|
|
14
14
|
className: "ttw:text-sm ttw:text-foreground",
|
|
15
15
|
children: a
|
|
16
16
|
})]
|
|
17
|
-
}), o && s ? /* @__PURE__ */ t(e, {
|
|
17
|
+
}), c ?? (o && s ? /* @__PURE__ */ t(e, {
|
|
18
18
|
type: "button",
|
|
19
19
|
variant: "ghost",
|
|
20
20
|
size: "icon",
|
|
@@ -22,7 +22,7 @@ function i({ label: i, children: a, copyAriaLabel: o, onCopy: s, isLast: c }) {
|
|
|
22
22
|
"aria-label": o,
|
|
23
23
|
onClick: s,
|
|
24
24
|
children: /* @__PURE__ */ t(r, { className: "ttw:size-4" })
|
|
25
|
-
}) : null]
|
|
25
|
+
}) : null)]
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
28
|
//#endregion
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { Button as e, Input as t, cn as n } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
|
+
import { InlineErrorAlert as r } from "../../../../../shared/ui/dist/lib/InlineErrorAlert/InlineErrorAlert.js";
|
|
3
|
+
import "../../../../../shared/ui/dist/index.js";
|
|
4
|
+
import { DetailCopyRow as i } from "./DetailCopyRow.js";
|
|
5
|
+
import { useEffect as a, useRef as o } from "react";
|
|
6
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
7
|
+
import { SquarePenIcon as l } from "lucide-react";
|
|
8
|
+
//#region ../../libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/NicknameRow.js
|
|
9
|
+
function u({ fieldLabels: u, labels: d, nickname: f, editState: p, onEdit: m, draft: h = "", onDraftChange: g, onSave: _, onCancel: v, isSaveDisabled: y, onCopy: b, copyAriaLabel: x, isLast: S }) {
|
|
10
|
+
let C = p !== "closed", w = o(null);
|
|
11
|
+
return a(() => {
|
|
12
|
+
C && w.current?.focus();
|
|
13
|
+
}, [C]), m && C ? /* @__PURE__ */ c("div", {
|
|
14
|
+
className: n("ttw:flex ttw:flex-col ttw:gap-2 ttw:px-4 ttw:py-3", !S && "ttw:border-b ttw:border-border"),
|
|
15
|
+
children: [
|
|
16
|
+
/* @__PURE__ */ s("p", {
|
|
17
|
+
className: "ttw:text-sm ttw:font-medium ttw:text-foreground",
|
|
18
|
+
children: u.nickname
|
|
19
|
+
}),
|
|
20
|
+
/* @__PURE__ */ s(t, {
|
|
21
|
+
ref: w,
|
|
22
|
+
value: h,
|
|
23
|
+
"aria-label": d.inputAriaLabel,
|
|
24
|
+
disabled: p === "saving",
|
|
25
|
+
onChange: (e) => g?.(e.target.value)
|
|
26
|
+
}),
|
|
27
|
+
/* @__PURE__ */ c("div", {
|
|
28
|
+
className: "ttw:flex ttw:gap-2",
|
|
29
|
+
children: [/* @__PURE__ */ s(e, {
|
|
30
|
+
type: "button",
|
|
31
|
+
size: "sm",
|
|
32
|
+
disabled: y,
|
|
33
|
+
loading: p === "saving",
|
|
34
|
+
onClick: _,
|
|
35
|
+
children: d.save
|
|
36
|
+
}), /* @__PURE__ */ s(e, {
|
|
37
|
+
type: "button",
|
|
38
|
+
size: "sm",
|
|
39
|
+
variant: "outline",
|
|
40
|
+
disabled: p === "saving",
|
|
41
|
+
onClick: v,
|
|
42
|
+
children: d.cancel
|
|
43
|
+
})]
|
|
44
|
+
}),
|
|
45
|
+
p === "errored" ? /* @__PURE__ */ s(r, { children: d.errorDescription }) : null
|
|
46
|
+
]
|
|
47
|
+
}) : /* @__PURE__ */ s(i, {
|
|
48
|
+
label: u.nickname,
|
|
49
|
+
copyAriaLabel: x,
|
|
50
|
+
onCopy: b,
|
|
51
|
+
trailing: m ? /* @__PURE__ */ s(e, {
|
|
52
|
+
type: "button",
|
|
53
|
+
variant: "ghost",
|
|
54
|
+
size: "icon",
|
|
55
|
+
className: "ttw:size-8 ttw:shrink-0 ttw:text-muted-foreground",
|
|
56
|
+
"aria-label": d.editAriaLabel,
|
|
57
|
+
onClick: m,
|
|
58
|
+
children: /* @__PURE__ */ s(l, { className: "ttw:size-4" })
|
|
59
|
+
}) : void 0,
|
|
60
|
+
isLast: S,
|
|
61
|
+
children: f ?? u.emptyValue
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
//#endregion
|
|
65
|
+
export { u as NicknameRow };
|