@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,30 +2,71 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import { EmptyState as
|
|
7
|
-
import { ErrorState as
|
|
8
|
-
import {
|
|
5
|
+
import { Alert as e, AlertDescription as t, Badge as n, Button as r, DescriptionList as i, Heading as a, Skeleton as o, cn as s } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
|
+
import { EmptyState as c } from "../../../../../shared/ui/dist/lib/EmptyState/EmptyState.js";
|
|
7
|
+
import { ErrorState as l } from "../../../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
|
|
8
|
+
import { LoadingRegion as u } from "../../../../../shared/ui/dist/lib/LoadingRegion/LoadingRegion.js";
|
|
9
|
+
import { InlineErrorAlert as d } from "../../../../../shared/ui/dist/lib/InlineErrorAlert/InlineErrorAlert.js";
|
|
9
10
|
import "../../../../../shared/ui/dist/index.js";
|
|
10
|
-
import { CardDetailsHeader as
|
|
11
|
-
import { CARD_FACE_WIDTH_CLASS_NAME as
|
|
12
|
-
import { CardFace as
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
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";
|
|
11
|
+
import { CardDetailsHeader as ee } from "./CardDetailsHeader.js";
|
|
12
|
+
import { CARD_FACE_WIDTH_CLASS_NAME as te } from "./cardFaceSurface.js";
|
|
13
|
+
import { CardFace as ne } from "./CardFace.js";
|
|
14
|
+
import { resolveCardDetailsPanelLabels as re } from "./labels.js";
|
|
15
|
+
import { CardCredentialsFace as ie } from "./CardCredentialsFace.js";
|
|
16
|
+
import { CardFaceFlip as ae } from "./CardFaceFlip.js";
|
|
17
|
+
import { CopyableValue as f } from "./CopyableValue.js";
|
|
18
|
+
import { NicknameEditor as oe } from "./NicknameEditor.js";
|
|
19
|
+
import { useMemo as se } from "react";
|
|
20
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
21
|
+
import { CircleAlertIcon as h, CreditCardIcon as g } from "lucide-react";
|
|
22
22
|
// ../../libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsPanel.js
|
|
23
|
-
function
|
|
24
|
-
let V =
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
function _({ labels: _, state: v, nickname: y, statusLabel: ce, statusTone: le, formFactorLabel: ue, cardMenu: de, onClose: fe, cardArtSrc: pe, bankLogoSrc: me, bankLogoAlt: he, cardholderName: ge, 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 = se(() => re(_), [_]), H = b?.addressLine1, U = b?.addressLine2, W = b?.cityState, G = b?.postalCode, Te = !!(H || U || W || G), Ee = !!x?.length, De = !!S?.length, Oe = !!C, K = F === "revealed", q = K ? P : N, J = !!(R || z), Y = I ? z : R, ke = V.fields.copiedLabel, X = [
|
|
25
|
+
H,
|
|
26
|
+
U,
|
|
27
|
+
W,
|
|
28
|
+
G
|
|
29
|
+
].filter((e) => !!e), Z = Te ? [{
|
|
30
|
+
label: V.fields.billingAddress,
|
|
31
|
+
value: /* @__PURE__ */ p(f, {
|
|
32
|
+
copyLabel: V.fields.copyBillingAddressAriaLabel,
|
|
33
|
+
copiedLabel: ke,
|
|
34
|
+
onCopy: w ? () => w(X.join("\n")) : void 0,
|
|
35
|
+
children: /* @__PURE__ */ p("span", {
|
|
36
|
+
className: "ttw:flex ttw:flex-col",
|
|
37
|
+
children: X.map((e, t) => /* @__PURE__ */ p("span", { children: e }, t))
|
|
38
|
+
})
|
|
39
|
+
})
|
|
40
|
+
}] : [], Q = [
|
|
41
|
+
...Ee ? [{
|
|
42
|
+
label: V.fields.allowedCategories,
|
|
43
|
+
value: /* @__PURE__ */ p("span", {
|
|
44
|
+
className: "ttw:flex ttw:flex-wrap ttw:gap-2",
|
|
45
|
+
children: x?.map((e) => /* @__PURE__ */ p(n, {
|
|
46
|
+
tone: "neutral",
|
|
47
|
+
children: e
|
|
48
|
+
}, e))
|
|
49
|
+
})
|
|
50
|
+
}] : [],
|
|
51
|
+
...De ? [{
|
|
52
|
+
label: V.fields.spendLimit,
|
|
53
|
+
value: /* @__PURE__ */ p("span", {
|
|
54
|
+
className: "ttw:flex ttw:flex-col ttw:gap-1 ttw:tabular-nums",
|
|
55
|
+
children: S?.map((e, t) => /* @__PURE__ */ p("span", { children: e }, `${e}-${t}`))
|
|
56
|
+
})
|
|
57
|
+
}] : [],
|
|
58
|
+
...Oe ? [{
|
|
59
|
+
label: V.fields.perTransactionMax,
|
|
60
|
+
value: /* @__PURE__ */ p("span", {
|
|
61
|
+
className: "ttw:tabular-nums",
|
|
62
|
+
children: C
|
|
63
|
+
})
|
|
64
|
+
}] : []
|
|
65
|
+
], $ = /* @__PURE__ */ p(ne, {
|
|
66
|
+
cardArtSrc: pe,
|
|
67
|
+
bankLogoSrc: me,
|
|
68
|
+
bankLogoAlt: he ?? V.cardFace.bankLogoAlt,
|
|
69
|
+
cardholderName: ge ?? "",
|
|
29
70
|
maskedCardNumber: _e ?? "",
|
|
30
71
|
programLabel: ve ?? "",
|
|
31
72
|
statusLabel: ye,
|
|
@@ -33,196 +74,127 @@ function g({ labels: g, state: _, nickname: v, statusLabel: le, statusTone: ue,
|
|
|
33
74
|
lockedLabel: V.lock.cardFaceLabel,
|
|
34
75
|
testIds: B?.cardFace
|
|
35
76
|
});
|
|
36
|
-
return /* @__PURE__ */
|
|
77
|
+
return /* @__PURE__ */ m("div", {
|
|
37
78
|
"data-testid": B?.root,
|
|
38
|
-
className:
|
|
39
|
-
children: [/* @__PURE__ */
|
|
79
|
+
className: s("ttw:@container/card-details ttw:flex ttw:w-full ttw:max-w-[720px] ttw:flex-col", we),
|
|
80
|
+
children: [/* @__PURE__ */ p(ee, {
|
|
40
81
|
testIds: B?.header,
|
|
41
82
|
labels: V.header,
|
|
42
|
-
title:
|
|
43
|
-
isTitlePending:
|
|
44
|
-
statusLabel:
|
|
45
|
-
statusTone:
|
|
46
|
-
formFactorLabel:
|
|
47
|
-
cardMenu:
|
|
48
|
-
onClose:
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
83
|
+
title: v === "loaded" ? y ?? V.header.untitledCard : void 0,
|
|
84
|
+
isTitlePending: v === "loading",
|
|
85
|
+
statusLabel: v === "loaded" ? ce : void 0,
|
|
86
|
+
statusTone: le,
|
|
87
|
+
formFactorLabel: v === "loaded" ? ue : void 0,
|
|
88
|
+
cardMenu: v === "loaded" ? de : void 0,
|
|
89
|
+
onClose: fe,
|
|
90
|
+
titleAction: v === "loaded" && T && E === "closed" ? /* @__PURE__ */ p(r, {
|
|
91
|
+
type: "button",
|
|
92
|
+
variant: "link",
|
|
93
|
+
size: "sm",
|
|
94
|
+
className: "ttw:shrink-0",
|
|
95
|
+
"aria-label": V.nickname.editAriaLabel,
|
|
96
|
+
onClick: T,
|
|
97
|
+
children: V.nickname.edit
|
|
98
|
+
}) : void 0
|
|
99
|
+
}), /* @__PURE__ */ p("div", {
|
|
100
|
+
className: "ttw:px-4 ttw:pb-6 ttw:@md/card-details:px-6",
|
|
101
|
+
children: v === "loading" ? /* @__PURE__ */ m(u, {
|
|
102
|
+
isLoading: !0,
|
|
103
|
+
loadingLabel: V.status.loadingAriaLabel,
|
|
52
104
|
"data-testid": B?.loading,
|
|
53
|
-
role: "status",
|
|
54
|
-
"aria-label": V.status.loadingAriaLabel,
|
|
55
105
|
className: "ttw:space-y-4",
|
|
56
|
-
children: [/* @__PURE__ */
|
|
57
|
-
}) :
|
|
106
|
+
children: [/* @__PURE__ */ p(o, { className: "ttw:h-8 ttw:w-56" }), /* @__PURE__ */ p(o, { className: "ttw:h-64 ttw:w-full ttw:rounded-lg" })]
|
|
107
|
+
}) : v === "error" ? /* @__PURE__ */ p(l, {
|
|
58
108
|
title: V.status.errorTitle,
|
|
59
109
|
description: V.status.errorDescription,
|
|
60
110
|
retryLabel: V.status.errorRetry,
|
|
61
111
|
onRetry: Ce
|
|
62
|
-
}) :
|
|
63
|
-
icon: /* @__PURE__ */
|
|
112
|
+
}) : v === "notFound" ? /* @__PURE__ */ p(c, {
|
|
113
|
+
icon: /* @__PURE__ */ p(g, {}),
|
|
64
114
|
title: V.status.notFoundTitle,
|
|
65
115
|
description: V.status.notFoundDescription
|
|
66
|
-
}) : /* @__PURE__ */
|
|
116
|
+
}) : /* @__PURE__ */ m("div", {
|
|
67
117
|
className: "ttw:flex ttw:flex-col ttw:gap-4",
|
|
68
|
-
children: [
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
testIds: B?.credentialsFace
|
|
86
|
-
})
|
|
87
|
-
}) : $, M || N || Z ? /* @__PURE__ */ u("div", {
|
|
88
|
-
className: "ttw:flex ttw:flex-col ttw:gap-2",
|
|
118
|
+
children: [
|
|
119
|
+
T && E !== "closed" ? /* @__PURE__ */ p(oe, {
|
|
120
|
+
labels: V.nickname,
|
|
121
|
+
editState: E,
|
|
122
|
+
onEdit: T,
|
|
123
|
+
draft: D,
|
|
124
|
+
onDraftChange: O,
|
|
125
|
+
onSave: k,
|
|
126
|
+
onCancel: A,
|
|
127
|
+
isSaveDisabled: j
|
|
128
|
+
}) : null,
|
|
129
|
+
/* @__PURE__ */ m("div", {
|
|
130
|
+
className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:@xl/card-details:flex-row ttw:@xl/card-details:items-start",
|
|
131
|
+
children: [/* @__PURE__ */ p("div", {
|
|
132
|
+
className: "ttw:flex ttw:justify-center ttw:rounded-lg ttw:bg-muted ttw:p-4 ttw:@xl/card-details:shrink-0",
|
|
133
|
+
children: /* @__PURE__ */ m("div", {
|
|
134
|
+
className: s("ttw:flex ttw:flex-col ttw:gap-2", te),
|
|
89
135
|
children: [
|
|
90
|
-
|
|
136
|
+
N ? /* @__PURE__ */ p(ae, {
|
|
137
|
+
testIds: B?.cardFaceFlip,
|
|
138
|
+
isFlipped: K,
|
|
139
|
+
front: $,
|
|
140
|
+
back: /* @__PURE__ */ p(ie, {
|
|
141
|
+
labels: V.credentials,
|
|
142
|
+
cardNumber: be,
|
|
143
|
+
expirationDate: xe,
|
|
144
|
+
securityCode: Se,
|
|
145
|
+
isLocked: I,
|
|
146
|
+
onCopy: w,
|
|
147
|
+
testIds: B?.credentialsFace
|
|
148
|
+
})
|
|
149
|
+
}) : $,
|
|
150
|
+
M ? /* @__PURE__ */ p(r, {
|
|
91
151
|
type: "button",
|
|
92
|
-
className: "ttw:
|
|
152
|
+
className: "ttw:mt-2 ttw:w-full",
|
|
93
153
|
onClick: M,
|
|
94
|
-
children:
|
|
95
|
-
className: "ttw:size-4",
|
|
96
|
-
"aria-hidden": "true"
|
|
97
|
-
}), V.actions.activateCard]
|
|
154
|
+
children: V.actions.activateCard
|
|
98
155
|
}) : null,
|
|
99
|
-
N
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
onClick: X,
|
|
108
|
-
children: [l(Y ? m : p, {
|
|
109
|
-
className: "ttw:size-4",
|
|
110
|
-
"aria-hidden": "true"
|
|
111
|
-
}), Y ? V.actions.hideCard : V.actions.viewCard]
|
|
112
|
-
}) : null, Z ? /* @__PURE__ */ u(e, {
|
|
113
|
-
type: "button",
|
|
114
|
-
variant: "outline",
|
|
115
|
-
className: "ttw:flex-1",
|
|
116
|
-
disabled: !Q,
|
|
117
|
-
loading: L === "pending",
|
|
118
|
-
onClick: Q,
|
|
119
|
-
children: [l(I ? se : h, {
|
|
120
|
-
className: "ttw:size-4",
|
|
121
|
-
"aria-hidden": "true"
|
|
122
|
-
}), I ? V.lock.unlockCard : V.lock.lockCard]
|
|
123
|
-
}) : null]
|
|
156
|
+
N ? /* @__PURE__ */ p(r, {
|
|
157
|
+
type: "button",
|
|
158
|
+
variant: "ghost",
|
|
159
|
+
className: "ttw:w-full",
|
|
160
|
+
disabled: !q,
|
|
161
|
+
loading: F === "revealing",
|
|
162
|
+
onClick: q,
|
|
163
|
+
children: K ? V.actions.hideCard : V.actions.viewCard
|
|
124
164
|
}) : null,
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
165
|
+
J ? /* @__PURE__ */ p(r, {
|
|
166
|
+
type: "button",
|
|
167
|
+
variant: "outline",
|
|
168
|
+
className: "ttw:w-full",
|
|
169
|
+
disabled: !Y,
|
|
170
|
+
loading: L === "pending",
|
|
171
|
+
onClick: Y,
|
|
172
|
+
children: I ? V.lock.unlockCard : V.lock.lockCard
|
|
173
|
+
}) : null,
|
|
174
|
+
I ? /* @__PURE__ */ m(e, {
|
|
175
|
+
variant: "destructive",
|
|
176
|
+
children: [/* @__PURE__ */ p(h, { "aria-hidden": "true" }), /* @__PURE__ */ p(t, { children: J ? V.lock.lockedDescription : V.lock.lockedDescriptionWithoutUnlock })]
|
|
128
177
|
}) : null,
|
|
129
|
-
L === "errored" ? /* @__PURE__ */
|
|
130
|
-
F === "errored" ? /* @__PURE__ */
|
|
178
|
+
L === "errored" ? /* @__PURE__ */ p(d, { children: V.lock.errorDescription }) : null,
|
|
179
|
+
F === "errored" ? /* @__PURE__ */ p(d, { children: V.credentials.errorDescription }) : null
|
|
131
180
|
]
|
|
132
|
-
}) : null]
|
|
133
|
-
})
|
|
134
|
-
}), /* @__PURE__ */ u("div", {
|
|
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",
|
|
136
|
-
children: [
|
|
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
|
|
142
|
-
}),
|
|
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
|
-
})
|
|
170
|
-
}) : null,
|
|
171
|
-
/* @__PURE__ */ l(ae, {
|
|
172
|
-
fieldLabels: V.fields,
|
|
173
|
-
labels: V.nickname,
|
|
174
|
-
nickname: 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,
|
|
184
|
-
isLast: !0
|
|
185
181
|
})
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
182
|
+
}), Z.length > 0 ? /* @__PURE__ */ p("div", {
|
|
183
|
+
className: "ttw:min-w-0 ttw:flex-1",
|
|
184
|
+
children: /* @__PURE__ */ p(i, { items: Z })
|
|
185
|
+
}) : null]
|
|
186
|
+
}),
|
|
187
|
+
Q.length > 0 ? /* @__PURE__ */ m("section", {
|
|
188
|
+
className: "ttw:flex ttw:flex-col ttw:gap-2",
|
|
189
|
+
children: [/* @__PURE__ */ p(a, {
|
|
190
|
+
variant: "card",
|
|
191
|
+
level: 3,
|
|
193
192
|
children: V.fields.cardControlsHeading
|
|
194
|
-
}),
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
isLast: !q && !J,
|
|
198
|
-
children: /* @__PURE__ */ l("div", {
|
|
199
|
-
className: "ttw:mt-2 ttw:flex ttw:flex-wrap ttw:gap-2",
|
|
200
|
-
children: x?.map((e) => /* @__PURE__ */ u("span", {
|
|
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",
|
|
202
|
-
children: [/* @__PURE__ */ l(d, {
|
|
203
|
-
"aria-hidden": "true",
|
|
204
|
-
className: "ttw:size-3.5"
|
|
205
|
-
}), e]
|
|
206
|
-
}, e))
|
|
207
|
-
})
|
|
208
|
-
}) : null,
|
|
209
|
-
q ? /* @__PURE__ */ l(o, {
|
|
210
|
-
label: V.fields.spendLimit,
|
|
211
|
-
isLast: !J,
|
|
212
|
-
children: /* @__PURE__ */ l("div", {
|
|
213
|
-
className: "ttw:flex ttw:flex-col ttw:gap-1",
|
|
214
|
-
children: S?.map((e, t) => /* @__PURE__ */ l("div", { children: e }, `${e}-${t}`))
|
|
215
|
-
})
|
|
216
|
-
}) : null,
|
|
217
|
-
J ? /* @__PURE__ */ l(o, {
|
|
218
|
-
label: V.fields.perTransactionMax,
|
|
219
|
-
isLast: !0,
|
|
220
|
-
children: C
|
|
221
|
-
}) : null
|
|
222
|
-
]
|
|
223
|
-
}) : null]
|
|
193
|
+
}), /* @__PURE__ */ p(i, { items: Q })]
|
|
194
|
+
}) : null
|
|
195
|
+
]
|
|
224
196
|
})
|
|
225
197
|
})]
|
|
226
198
|
});
|
|
227
199
|
}
|
|
228
|
-
export {
|
|
200
|
+
export { _ as CardDetailsPanel };
|
|
@@ -43,9 +43,9 @@ function s({ cardArtSrc: s, bankLogoSrc: c, bankLogoAlt: l, cardholderName: u, m
|
|
|
43
43
|
})
|
|
44
44
|
}) : null,
|
|
45
45
|
/* @__PURE__ */ a("div", {
|
|
46
|
-
className: "ttw:relative ttw:flex ttw:items-end ttw:justify-between ttw:gap-3",
|
|
46
|
+
className: "ttw:relative ttw:flex ttw:flex-wrap ttw:items-end ttw:justify-between ttw:gap-x-3 ttw:gap-y-1",
|
|
47
47
|
children: [/* @__PURE__ */ a("div", {
|
|
48
|
-
className: "ttw:min-w-0",
|
|
48
|
+
className: "ttw:min-w-0 ttw:max-w-full ttw:flex-auto",
|
|
49
49
|
children: [/* @__PURE__ */ i("p", {
|
|
50
50
|
className: "ttw:truncate ttw:text-base ttw:font-medium ttw:text-white",
|
|
51
51
|
children: u
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Button as e, Tooltip as t, TooltipContent as n, TooltipProvider as r, TooltipTrigger as i, cn as a } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
|
+
import { useEffect as o, useState as s } from "react";
|
|
3
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
4
|
+
import { CheckIcon as u, CopyIcon as d } from "lucide-react";
|
|
5
|
+
// ../../libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CopyButton.js
|
|
6
|
+
var f = 2e3;
|
|
7
|
+
function p({ label: p, copiedLabel: m, onCopy: h, className: g }) {
|
|
8
|
+
let [_, v] = s(!1);
|
|
9
|
+
return o(() => {
|
|
10
|
+
if (!_) return;
|
|
11
|
+
let e = setTimeout(() => v(!1), f);
|
|
12
|
+
return () => clearTimeout(e);
|
|
13
|
+
}, [_]), /* @__PURE__ */ l(r, { children: [/* @__PURE__ */ l(t, { children: [/* @__PURE__ */ c(i, {
|
|
14
|
+
asChild: !0,
|
|
15
|
+
children: /* @__PURE__ */ c(e, {
|
|
16
|
+
type: "button",
|
|
17
|
+
variant: "ghost",
|
|
18
|
+
size: "icon-sm",
|
|
19
|
+
"aria-label": p,
|
|
20
|
+
className: a("ttw:shrink-0 ttw:text-muted-foreground", g),
|
|
21
|
+
onClick: async () => {
|
|
22
|
+
await h() !== !1 && v(!0);
|
|
23
|
+
},
|
|
24
|
+
children: c(_ ? u : d, {
|
|
25
|
+
"aria-hidden": !0,
|
|
26
|
+
className: "ttw:size-4"
|
|
27
|
+
})
|
|
28
|
+
})
|
|
29
|
+
}), /* @__PURE__ */ c(n, { children: _ ? m : p })] }), /* @__PURE__ */ c("span", {
|
|
30
|
+
role: "status",
|
|
31
|
+
className: "ttw:sr-only",
|
|
32
|
+
children: _ ? m : ""
|
|
33
|
+
})] });
|
|
34
|
+
}
|
|
35
|
+
export { p as CopyButton };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { CopyButton as e } from "./CopyButton.js";
|
|
2
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
+
// ../../libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CopyableValue.js
|
|
4
|
+
function r({ children: r, copyLabel: i, copiedLabel: a, onCopy: o }) {
|
|
5
|
+
return /* @__PURE__ */ n("span", {
|
|
6
|
+
className: "ttw:flex ttw:min-w-0 ttw:items-center ttw:gap-1",
|
|
7
|
+
children: [/* @__PURE__ */ t("span", {
|
|
8
|
+
className: "ttw:min-w-0 ttw:break-words",
|
|
9
|
+
children: r
|
|
10
|
+
}), i && o ? /* @__PURE__ */ t(e, {
|
|
11
|
+
label: i,
|
|
12
|
+
copiedLabel: a,
|
|
13
|
+
onCopy: o,
|
|
14
|
+
className: "ttw:-my-1.5"
|
|
15
|
+
}) : null]
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
export { r as CopyableValue };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Button as e, Input as t } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
|
+
import { InlineErrorAlert as n } from "../../../../../shared/ui/dist/lib/InlineErrorAlert/InlineErrorAlert.js";
|
|
3
|
+
import "../../../../../shared/ui/dist/index.js";
|
|
4
|
+
import { useEffect as r, useRef as i } from "react";
|
|
5
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
|
+
// ../../libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/NicknameEditor.js
|
|
7
|
+
function s({ labels: s, editState: c, onEdit: l, draft: u = "", onDraftChange: d, onSave: f, onCancel: p, isSaveDisabled: m }) {
|
|
8
|
+
let h = c !== "closed", g = i(null);
|
|
9
|
+
return r(() => {
|
|
10
|
+
h && g.current?.focus();
|
|
11
|
+
}, [h]), l && h ? /* @__PURE__ */ o("span", {
|
|
12
|
+
className: "ttw:flex ttw:flex-col ttw:gap-2",
|
|
13
|
+
children: [
|
|
14
|
+
/* @__PURE__ */ a(t, {
|
|
15
|
+
ref: g,
|
|
16
|
+
value: u,
|
|
17
|
+
"aria-label": s.inputAriaLabel,
|
|
18
|
+
disabled: c === "saving",
|
|
19
|
+
onChange: (e) => d?.(e.target.value)
|
|
20
|
+
}),
|
|
21
|
+
/* @__PURE__ */ o("span", {
|
|
22
|
+
className: "ttw:flex ttw:justify-end ttw:gap-2",
|
|
23
|
+
children: [/* @__PURE__ */ a(e, {
|
|
24
|
+
type: "button",
|
|
25
|
+
size: "sm",
|
|
26
|
+
variant: "ghost",
|
|
27
|
+
disabled: c === "saving",
|
|
28
|
+
onClick: p,
|
|
29
|
+
children: s.cancel
|
|
30
|
+
}), /* @__PURE__ */ a(e, {
|
|
31
|
+
type: "button",
|
|
32
|
+
size: "sm",
|
|
33
|
+
disabled: m,
|
|
34
|
+
loading: c === "saving",
|
|
35
|
+
onClick: f,
|
|
36
|
+
children: s.save
|
|
37
|
+
})]
|
|
38
|
+
}),
|
|
39
|
+
c === "errored" ? /* @__PURE__ */ a(n, { children: s.errorDescription }) : null
|
|
40
|
+
]
|
|
41
|
+
}) : null;
|
|
42
|
+
}
|
|
43
|
+
export { s as NicknameEditor };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// ../../libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/cardFaceSurface.js
|
|
2
|
-
var e = "ttw:w-[300px]", t = "ttw:h-[190px]", n = `ttw:relative ttw:flex ${t} ${e} ttw:flex-col ttw:overflow-hidden ttw:rounded-xl ttw:bg-[#101317] ttw:p-4`, r = "ttw:rounded-full ttw:bg-white/90 ttw:px-4 ttw:py-2 ttw:text-sm ttw:font-medium ttw:text-[#101317]";
|
|
2
|
+
var e = "ttw:w-[300px] ttw:max-w-full", t = "ttw:h-[190px]", n = `ttw:relative ttw:flex ${t} ${e} ttw:flex-col ttw:overflow-hidden ttw:rounded-xl ttw:bg-[#101317] ttw:p-4`, r = "ttw:rounded-full ttw:bg-white/90 ttw:px-4 ttw:py-2 ttw:text-sm ttw:font-medium ttw:text-[#101317]";
|
|
3
3
|
export { t as CARD_FACE_HEIGHT_CLASS_NAME, r as CARD_FACE_STATUS_PILL_CLASS_NAME, n as CARD_FACE_SURFACE_CLASS_NAME, e as CARD_FACE_WIDTH_CLASS_NAME };
|
|
@@ -17,22 +17,25 @@ var e = {
|
|
|
17
17
|
emptyValue: "—",
|
|
18
18
|
copyCardholderAriaLabel: "Copy cardholder",
|
|
19
19
|
copyNicknameAriaLabel: "Copy nickname",
|
|
20
|
+
copyBillingAddressAriaLabel: "Copy billing address",
|
|
20
21
|
copyBillingAddressLine1AriaLabel: "Copy street address 1",
|
|
21
22
|
copyBillingAddressLine2AriaLabel: "Copy street address 2",
|
|
22
23
|
copyBillingAddressCityStateAriaLabel: "Copy city and state",
|
|
23
|
-
copyBillingAddressPostalCodeAriaLabel: "Copy ZIP code"
|
|
24
|
+
copyBillingAddressPostalCodeAriaLabel: "Copy ZIP code",
|
|
25
|
+
copiedLabel: "Copied"
|
|
24
26
|
},
|
|
25
27
|
actions: {
|
|
26
28
|
activateCard: "Activate card",
|
|
27
|
-
viewCard: "
|
|
28
|
-
hideCard: "Hide card"
|
|
29
|
+
viewCard: "Show card details",
|
|
30
|
+
hideCard: "Hide card details"
|
|
29
31
|
},
|
|
30
32
|
nickname: {
|
|
33
|
+
edit: "Edit",
|
|
31
34
|
editAriaLabel: "Edit nickname",
|
|
32
35
|
inputAriaLabel: "Nickname",
|
|
33
36
|
save: "Save",
|
|
34
37
|
cancel: "Cancel",
|
|
35
|
-
errorDescription: "
|
|
38
|
+
errorDescription: "Couldn't update the nickname. Try again."
|
|
36
39
|
},
|
|
37
40
|
lock: {
|
|
38
41
|
lockCard: "Lock card",
|
|
@@ -40,7 +43,7 @@ var e = {
|
|
|
40
43
|
cardFaceLabel: "Card is locked",
|
|
41
44
|
lockedDescription: "Your card is locked. New transactions will automatically decline. You can unlock the card at any time.",
|
|
42
45
|
lockedDescriptionWithoutUnlock: "Your card is locked. New transactions will automatically decline.",
|
|
43
|
-
errorDescription: "
|
|
46
|
+
errorDescription: "Couldn't change this card's lock. Try again."
|
|
44
47
|
},
|
|
45
48
|
credentials: {
|
|
46
49
|
cardNumber: "Card number",
|
|
@@ -49,12 +52,13 @@ var e = {
|
|
|
49
52
|
copyCardNumberAriaLabel: "Copy card number",
|
|
50
53
|
copyExpirationDateAriaLabel: "Copy expiration date",
|
|
51
54
|
copySecurityCodeAriaLabel: "Copy security code",
|
|
52
|
-
|
|
55
|
+
copiedLabel: "Copied",
|
|
56
|
+
errorDescription: "Couldn't show this card's details. Try again."
|
|
53
57
|
},
|
|
54
58
|
status: {
|
|
55
59
|
loadingAriaLabel: "Loading card details",
|
|
56
|
-
errorTitle: "
|
|
57
|
-
errorDescription: "
|
|
60
|
+
errorTitle: "Couldn't load this card",
|
|
61
|
+
errorDescription: "Check your connection, then try again.",
|
|
58
62
|
errorRetry: "Try again",
|
|
59
63
|
notFoundTitle: "Card not found",
|
|
60
64
|
notFoundDescription: "This card may have been closed, or you may not have access to it."
|
package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/feature/dist/index5.js
CHANGED
|
@@ -3,12 +3,12 @@ var e = {
|
|
|
3
3
|
toast: {
|
|
4
4
|
creating: "Creating your card…",
|
|
5
5
|
success: "Card created successfully.",
|
|
6
|
-
error: "
|
|
6
|
+
error: "Couldn't create this card. Try again.",
|
|
7
7
|
controlsWarning: "Card created, but spend controls could not be applied.",
|
|
8
8
|
companyAdminAccessWarning: "Card created, but some admins could not be granted access to it.",
|
|
9
9
|
controlsAndAccessWarning: "Card created, but spend controls could not be applied and some admins could not be granted access to it.",
|
|
10
|
-
debitCardIssuersError: "
|
|
11
|
-
retry: "
|
|
10
|
+
debitCardIssuersError: "Couldn't load the admins to grant access to this card.",
|
|
11
|
+
retry: "Try again"
|
|
12
12
|
},
|
|
13
13
|
untitledFundingAccount: "Bank account",
|
|
14
14
|
velocityControlNames: {
|