@tesouro/embedded-components-react 0.11.101 → 0.11.104
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +21 -17
- package/dist/index.d.ts +10 -6
- package/dist/lib/CardDetailsWidget.d.ts +6 -4
- package/dist/lib/CreditCardsWidget.d.ts +6 -4
- package/dist/lib/DebitCardsWidget.d.ts +6 -4
- package/dist/lib/SettingsWidget.d.ts +2 -1
- package/dist/lib/WidgetSuite.d.ts +8 -5
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsPanel.js +199 -168
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/labels.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardsList.js +44 -43
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartsWidget.js +56 -52
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index3.js +68 -63
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/feature/dist/index.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/feature/dist/index3.js +9 -9
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/feature/dist/index4.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/feature/dist/index6.js +25 -284
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/feature/dist/index7.js +291 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/ui/dist/index.js +3 -3
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/ui/dist/index3.js +28 -17
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/ui/dist/index5.js +21 -34
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/ui/dist/index6.js +71 -78
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/ui/dist/index7.js +71 -77
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/ui/dist/index8.js +43 -49
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index2.js +8 -1
- package/dist/libs/tesouro-embedded-components-react/settings-widget/chart-of-accounts/ui/dist/index3.js +98 -91
- package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/lib/ExpenseSettingsTabs/ExpenseSettingsTabs.js +24 -21
- package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/lib/SettingsWidget/SettingsWidget.js +14 -8
- package/dist/libs/tesouro-embedded-components-react/settings-widget/help/ui/shadcn/dist/index3.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/feature/dist/index10.js +87 -81
- package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/ui/dist/index3.js +63 -44
- package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/ui/dist/index6.js +9 -6
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/feature/dist/index17.js +302 -276
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/ui/dist/index.js +10 -10
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/ui/dist/index12.js +36 -36
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/ui/dist/index17.js +27 -13
- package/dist/libs/tesouro-embedded-components-react/settings-widget/ui/dist/lib/SettingsWidgetUi/SettingsSectionContent.js +22 -0
- package/dist/libs/tesouro-embedded-components-react/settings-widget/ui/dist/lib/SettingsWidgetUi/SettingsWidgetUi.js +6 -7
- package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/feature/dist/lib/ApprovalPoliciesSettings.js +39 -37
- package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index.js +9 -9
- package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index11.js +39 -35
- package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index16.js +59 -61
- package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index4.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index6.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index7.js +3 -3
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +114 -103
- 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/util/dist/index.js +12 -12
- package/dist/packages/shared-ui-shadcn/dist/index.js +18 -15
- package/package.json +1 -1
|
@@ -2,198 +2,229 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import { Alert as e, AlertDescription as t, Badge as
|
|
6
|
-
import { EmptyState as
|
|
7
|
-
import { ErrorState as
|
|
8
|
-
import { LoadingRegion as
|
|
9
|
-
import { InlineErrorAlert as
|
|
5
|
+
import { Alert as e, AlertDescription as t, Badge as ee, Button as n, DescriptionList as r, Heading as i, Skeleton as a, cn as o } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
|
+
import { EmptyState as te } from "../../../../../shared/ui/dist/lib/EmptyState/EmptyState.js";
|
|
7
|
+
import { ErrorState as ne } from "../../../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
|
|
8
|
+
import { LoadingRegion as re } from "../../../../../shared/ui/dist/lib/LoadingRegion/LoadingRegion.js";
|
|
9
|
+
import { InlineErrorAlert as s } from "../../../../../shared/ui/dist/lib/InlineErrorAlert/InlineErrorAlert.js";
|
|
10
10
|
import "../../../../../shared/ui/dist/index.js";
|
|
11
|
-
import { CardDetailsHeader as
|
|
12
|
-
import { CARD_FACE_WIDTH_CLASS_NAME as
|
|
13
|
-
import { CardFace as
|
|
14
|
-
import { resolveCardDetailsPanelLabels as
|
|
15
|
-
import { CardCredentialsFace as
|
|
16
|
-
import { CardFaceFlip as
|
|
17
|
-
import { CopyableValue as
|
|
18
|
-
import { NicknameEditor as
|
|
19
|
-
import { useMemo as
|
|
20
|
-
import { jsx as
|
|
21
|
-
import { CircleAlertIcon as
|
|
11
|
+
import { CardDetailsHeader as ie } from "./CardDetailsHeader.js";
|
|
12
|
+
import { CARD_FACE_WIDTH_CLASS_NAME as ae } from "./cardFaceSurface.js";
|
|
13
|
+
import { CardFace as c } from "./CardFace.js";
|
|
14
|
+
import { resolveCardDetailsPanelLabels as l } from "./labels.js";
|
|
15
|
+
import { CardCredentialsFace as oe } from "./CardCredentialsFace.js";
|
|
16
|
+
import { CardFaceFlip as se } from "./CardFaceFlip.js";
|
|
17
|
+
import { CopyableValue as u } from "./CopyableValue.js";
|
|
18
|
+
import { NicknameEditor as ce } from "./NicknameEditor.js";
|
|
19
|
+
import { useMemo as le } from "react";
|
|
20
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
21
|
+
import { CircleAlertIcon as ue, CreditCardIcon as de } from "lucide-react";
|
|
22
22
|
// ../../libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsPanel.js
|
|
23
|
-
function
|
|
24
|
-
let
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
].filter((e) => !!e), Z = we ? [{
|
|
30
|
-
label: V.fields.billingAddress,
|
|
31
|
-
value: /* @__PURE__ */ m(p, {
|
|
32
|
-
copyLabel: V.fields.copyBillingAddressAriaLabel,
|
|
33
|
-
copiedLabel: Oe,
|
|
34
|
-
onCopy: w ? () => w(X.join("\n")) : void 0,
|
|
35
|
-
children: /* @__PURE__ */ m("span", {
|
|
36
|
-
className: "ttw:flex ttw:flex-col",
|
|
37
|
-
children: X.map((e, t) => /* @__PURE__ */ m("span", { children: e }, t))
|
|
38
|
-
})
|
|
39
|
-
})
|
|
40
|
-
}] : [], Q = [
|
|
23
|
+
function p({ labels: p, state: m, nickname: h, statusLabel: fe, statusTone: pe, formFactorLabel: g, cardMenu: _, onClose: me, cardArtSrc: he, bankLogoSrc: ge, bankLogoAlt: _e, cardholderName: v, maskedCardNumber: ve, cardFaceStatusLabel: ye, billingAddress: y, allowedCategories: b, spendLimitLabels: x, perTransactionMaxLabel: S, onCopy: C, onEditNickname: w, nicknameEditState: T = "closed", nicknameDraft: E, onNicknameDraftChange: D, onSaveNickname: O, onCancelNicknameEdit: k, isNicknameSaveDisabled: A, onActivate: j, onViewCard: M, onHideCard: N, revealState: P = "hidden", revealedCardNumber: be, revealedExpirationDate: xe, revealedSecurityCode: Se, isLocked: F, lockState: I = "idle", onLockCard: L, onUnlockCard: R, onRetry: Ce, testIds: z, className: we }) {
|
|
24
|
+
let B = le(() => l(p), [p]), V = y?.addressLine1, H = y?.addressLine2, U = y?.cityState, W = y?.postalCode, Te = !!(V || H || U || W), Ee = !!b?.length, De = !!x?.length, G = !!S, K = P === "revealed", q = K ? N : M, J = !!(L || R), Y = F ? R : L, X = B.fields.copiedLabel, Z = [
|
|
25
|
+
...v ? [{
|
|
26
|
+
label: B.fields.cardholder,
|
|
27
|
+
value: v
|
|
28
|
+
}] : [],
|
|
41
29
|
...Te ? [{
|
|
42
|
-
label:
|
|
43
|
-
value: /* @__PURE__ */
|
|
30
|
+
label: B.fields.billingAddress,
|
|
31
|
+
value: /* @__PURE__ */ f("div", {
|
|
32
|
+
className: "ttw:flex ttw:flex-col ttw:gap-3",
|
|
33
|
+
children: [
|
|
34
|
+
V ? /* @__PURE__ */ d(u, {
|
|
35
|
+
copyLabel: B.fields.copyBillingAddressLine1AriaLabel,
|
|
36
|
+
copiedLabel: X,
|
|
37
|
+
onCopy: C ? () => C(V) : void 0,
|
|
38
|
+
children: V
|
|
39
|
+
}) : null,
|
|
40
|
+
H ? /* @__PURE__ */ d(u, {
|
|
41
|
+
copyLabel: B.fields.copyBillingAddressLine2AriaLabel,
|
|
42
|
+
copiedLabel: X,
|
|
43
|
+
onCopy: C ? () => C(H) : void 0,
|
|
44
|
+
children: H
|
|
45
|
+
}) : null,
|
|
46
|
+
U ? /* @__PURE__ */ d(u, {
|
|
47
|
+
copyLabel: B.fields.copyBillingAddressCityStateAriaLabel,
|
|
48
|
+
copiedLabel: X,
|
|
49
|
+
onCopy: C ? () => C(U) : void 0,
|
|
50
|
+
children: U
|
|
51
|
+
}) : null,
|
|
52
|
+
W ? /* @__PURE__ */ d(u, {
|
|
53
|
+
copyLabel: B.fields.copyBillingAddressPostalCodeAriaLabel,
|
|
54
|
+
copiedLabel: X,
|
|
55
|
+
onCopy: C ? () => C(W) : void 0,
|
|
56
|
+
children: W
|
|
57
|
+
}) : null
|
|
58
|
+
]
|
|
59
|
+
})
|
|
60
|
+
}] : [],
|
|
61
|
+
...h || w ? [{
|
|
62
|
+
label: B.fields.nickname,
|
|
63
|
+
value: T !== "closed" && w ? /* @__PURE__ */ d(ce, {
|
|
64
|
+
labels: B.nickname,
|
|
65
|
+
editState: T,
|
|
66
|
+
onEdit: w,
|
|
67
|
+
draft: E,
|
|
68
|
+
onDraftChange: D,
|
|
69
|
+
onSave: O,
|
|
70
|
+
onCancel: k,
|
|
71
|
+
isSaveDisabled: A
|
|
72
|
+
}) : /* @__PURE__ */ f("span", {
|
|
73
|
+
className: "ttw:flex ttw:items-center ttw:justify-between ttw:gap-2",
|
|
74
|
+
children: [/* @__PURE__ */ d("span", {
|
|
75
|
+
className: "ttw:min-w-0 ttw:flex-1 ttw:break-words",
|
|
76
|
+
children: h ?? B.fields.emptyValue
|
|
77
|
+
}), w ? /* @__PURE__ */ d(n, {
|
|
78
|
+
type: "button",
|
|
79
|
+
variant: "link",
|
|
80
|
+
size: "sm",
|
|
81
|
+
className: "ttw:shrink-0",
|
|
82
|
+
"aria-label": B.nickname.editAriaLabel,
|
|
83
|
+
onClick: w,
|
|
84
|
+
children: B.nickname.edit
|
|
85
|
+
}) : null]
|
|
86
|
+
})
|
|
87
|
+
}] : []
|
|
88
|
+
], Q = [
|
|
89
|
+
...Ee ? [{
|
|
90
|
+
label: B.fields.allowedCategories,
|
|
91
|
+
value: /* @__PURE__ */ d("span", {
|
|
44
92
|
className: "ttw:flex ttw:flex-wrap ttw:gap-2",
|
|
45
|
-
children:
|
|
93
|
+
children: b?.map((e) => /* @__PURE__ */ d(ee, {
|
|
46
94
|
tone: "neutral",
|
|
47
95
|
children: e
|
|
48
96
|
}, e))
|
|
49
97
|
})
|
|
50
98
|
}] : [],
|
|
51
|
-
...
|
|
52
|
-
label:
|
|
53
|
-
value: /* @__PURE__ */
|
|
99
|
+
...De ? [{
|
|
100
|
+
label: B.fields.spendLimit,
|
|
101
|
+
value: /* @__PURE__ */ d("span", {
|
|
54
102
|
className: "ttw:flex ttw:flex-col ttw:gap-1 ttw:tabular-nums",
|
|
55
|
-
children:
|
|
103
|
+
children: x?.map((e, t) => /* @__PURE__ */ d("span", { children: e }, `${e}-${t}`))
|
|
56
104
|
})
|
|
57
105
|
}] : [],
|
|
58
|
-
...
|
|
59
|
-
label:
|
|
60
|
-
value: /* @__PURE__ */
|
|
106
|
+
...G ? [{
|
|
107
|
+
label: B.fields.perTransactionMax,
|
|
108
|
+
value: /* @__PURE__ */ d("span", {
|
|
61
109
|
className: "ttw:tabular-nums",
|
|
62
|
-
children:
|
|
110
|
+
children: S
|
|
63
111
|
})
|
|
64
112
|
}] : []
|
|
65
|
-
], $ = /* @__PURE__ */
|
|
66
|
-
cardArtSrc:
|
|
67
|
-
bankLogoSrc:
|
|
68
|
-
bankLogoAlt:
|
|
69
|
-
cardholderName:
|
|
70
|
-
maskedCardNumber:
|
|
71
|
-
statusLabel:
|
|
72
|
-
isLocked:
|
|
73
|
-
lockedLabel:
|
|
74
|
-
testIds:
|
|
113
|
+
], $ = /* @__PURE__ */ d(c, {
|
|
114
|
+
cardArtSrc: he,
|
|
115
|
+
bankLogoSrc: ge,
|
|
116
|
+
bankLogoAlt: _e ?? B.cardFace.bankLogoAlt,
|
|
117
|
+
cardholderName: v ?? "",
|
|
118
|
+
maskedCardNumber: ve ?? "",
|
|
119
|
+
statusLabel: ye,
|
|
120
|
+
isLocked: F,
|
|
121
|
+
lockedLabel: B.lock.cardFaceLabel,
|
|
122
|
+
testIds: z?.cardFace
|
|
75
123
|
});
|
|
76
|
-
return /* @__PURE__ */
|
|
77
|
-
"data-testid":
|
|
78
|
-
className:
|
|
79
|
-
children: [/* @__PURE__ */
|
|
80
|
-
testIds:
|
|
81
|
-
labels:
|
|
82
|
-
title:
|
|
83
|
-
isTitlePending:
|
|
84
|
-
statusLabel:
|
|
85
|
-
statusTone:
|
|
86
|
-
formFactorLabel:
|
|
87
|
-
cardMenu:
|
|
88
|
-
onClose:
|
|
89
|
-
|
|
90
|
-
type: "button",
|
|
91
|
-
variant: "link",
|
|
92
|
-
size: "sm",
|
|
93
|
-
className: "ttw:shrink-0",
|
|
94
|
-
"aria-label": V.nickname.editAriaLabel,
|
|
95
|
-
onClick: T,
|
|
96
|
-
children: V.nickname.edit
|
|
97
|
-
}) : void 0
|
|
98
|
-
}), /* @__PURE__ */ m("div", {
|
|
124
|
+
return /* @__PURE__ */ f("div", {
|
|
125
|
+
"data-testid": z?.root,
|
|
126
|
+
className: o("ttw:@container/card-details ttw:flex ttw:w-full ttw:max-w-[720px] ttw:flex-col", we),
|
|
127
|
+
children: [/* @__PURE__ */ d(ie, {
|
|
128
|
+
testIds: z?.header,
|
|
129
|
+
labels: B.header,
|
|
130
|
+
title: m === "loaded" ? h ?? B.header.untitledCard : void 0,
|
|
131
|
+
isTitlePending: m === "loading",
|
|
132
|
+
statusLabel: m === "loaded" ? fe : void 0,
|
|
133
|
+
statusTone: pe,
|
|
134
|
+
formFactorLabel: m === "loaded" ? g : void 0,
|
|
135
|
+
cardMenu: m === "loaded" ? _ : void 0,
|
|
136
|
+
onClose: me
|
|
137
|
+
}), /* @__PURE__ */ d("div", {
|
|
99
138
|
className: "ttw:px-4 ttw:pb-6 ttw:@md/card-details:px-6",
|
|
100
|
-
children:
|
|
139
|
+
children: m === "loading" ? /* @__PURE__ */ f(re, {
|
|
101
140
|
isLoading: !0,
|
|
102
|
-
loadingLabel:
|
|
103
|
-
"data-testid":
|
|
141
|
+
loadingLabel: B.status.loadingAriaLabel,
|
|
142
|
+
"data-testid": z?.loading,
|
|
104
143
|
className: "ttw:space-y-4",
|
|
105
|
-
children: [/* @__PURE__ */
|
|
106
|
-
}) :
|
|
107
|
-
title:
|
|
108
|
-
description:
|
|
109
|
-
retryLabel:
|
|
110
|
-
onRetry:
|
|
111
|
-
}) :
|
|
112
|
-
icon: /* @__PURE__ */
|
|
113
|
-
title:
|
|
114
|
-
description:
|
|
115
|
-
}) : /* @__PURE__ */
|
|
144
|
+
children: [/* @__PURE__ */ d(a, { className: "ttw:h-8 ttw:w-56" }), /* @__PURE__ */ d(a, { className: "ttw:h-64 ttw:w-full ttw:rounded-lg" })]
|
|
145
|
+
}) : m === "error" ? /* @__PURE__ */ d(ne, {
|
|
146
|
+
title: B.status.errorTitle,
|
|
147
|
+
description: B.status.errorDescription,
|
|
148
|
+
retryLabel: B.status.errorRetry,
|
|
149
|
+
onRetry: Ce
|
|
150
|
+
}) : m === "notFound" ? /* @__PURE__ */ d(te, {
|
|
151
|
+
icon: /* @__PURE__ */ d(de, {}),
|
|
152
|
+
title: B.status.notFoundTitle,
|
|
153
|
+
description: B.status.notFoundDescription
|
|
154
|
+
}) : /* @__PURE__ */ f("div", {
|
|
116
155
|
className: "ttw:flex ttw:flex-col ttw:gap-4",
|
|
117
|
-
children: [
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
}) : null,
|
|
173
|
-
I ? /* @__PURE__ */ h(e, {
|
|
174
|
-
variant: "destructive",
|
|
175
|
-
children: [/* @__PURE__ */ m(g, { "aria-hidden": "true" }), /* @__PURE__ */ m(t, { children: J ? V.lock.lockedDescription : V.lock.lockedDescriptionWithoutUnlock })]
|
|
176
|
-
}) : null,
|
|
177
|
-
L === "errored" ? /* @__PURE__ */ m(u, { children: V.lock.errorDescription }) : null,
|
|
178
|
-
F === "errored" ? /* @__PURE__ */ m(u, { children: V.credentials.errorDescription }) : null
|
|
179
|
-
]
|
|
180
|
-
})
|
|
181
|
-
}), Z.length > 0 ? /* @__PURE__ */ m("div", {
|
|
182
|
-
className: "ttw:min-w-0 ttw:flex-1",
|
|
183
|
-
children: /* @__PURE__ */ m(i, { items: Z })
|
|
184
|
-
}) : null]
|
|
185
|
-
}),
|
|
186
|
-
Q.length > 0 ? /* @__PURE__ */ h("section", {
|
|
156
|
+
children: [/* @__PURE__ */ f("div", {
|
|
157
|
+
className: "ttw:flex ttw:flex-col ttw:gap-4",
|
|
158
|
+
children: [/* @__PURE__ */ d("div", {
|
|
159
|
+
className: "ttw:flex ttw:justify-center ttw:rounded-lg ttw:bg-muted ttw:p-4",
|
|
160
|
+
children: /* @__PURE__ */ f("div", {
|
|
161
|
+
className: o("ttw:flex ttw:flex-col ttw:gap-2", ae),
|
|
162
|
+
children: [
|
|
163
|
+
M ? /* @__PURE__ */ d(se, {
|
|
164
|
+
testIds: z?.cardFaceFlip,
|
|
165
|
+
isFlipped: K,
|
|
166
|
+
front: $,
|
|
167
|
+
back: /* @__PURE__ */ d(oe, {
|
|
168
|
+
labels: B.credentials,
|
|
169
|
+
cardNumber: be,
|
|
170
|
+
expirationDate: xe,
|
|
171
|
+
securityCode: Se,
|
|
172
|
+
isLocked: F,
|
|
173
|
+
onCopy: C,
|
|
174
|
+
testIds: z?.credentialsFace
|
|
175
|
+
})
|
|
176
|
+
}) : $,
|
|
177
|
+
j ? /* @__PURE__ */ d(n, {
|
|
178
|
+
type: "button",
|
|
179
|
+
className: "ttw:mt-2 ttw:w-full",
|
|
180
|
+
onClick: j,
|
|
181
|
+
children: B.actions.activateCard
|
|
182
|
+
}) : null,
|
|
183
|
+
M ? /* @__PURE__ */ d(n, {
|
|
184
|
+
type: "button",
|
|
185
|
+
variant: "outline",
|
|
186
|
+
className: "ttw:w-full",
|
|
187
|
+
disabled: !q,
|
|
188
|
+
loading: P === "revealing",
|
|
189
|
+
onClick: q,
|
|
190
|
+
children: K ? B.actions.hideCard : B.actions.viewCard
|
|
191
|
+
}) : null,
|
|
192
|
+
J ? /* @__PURE__ */ d(n, {
|
|
193
|
+
type: "button",
|
|
194
|
+
variant: "outline",
|
|
195
|
+
className: "ttw:w-full",
|
|
196
|
+
disabled: !Y,
|
|
197
|
+
loading: I === "pending",
|
|
198
|
+
onClick: Y,
|
|
199
|
+
children: F ? B.lock.unlockCard : B.lock.lockCard
|
|
200
|
+
}) : null,
|
|
201
|
+
F ? /* @__PURE__ */ f(e, {
|
|
202
|
+
variant: "destructive",
|
|
203
|
+
children: [/* @__PURE__ */ d(ue, { "aria-hidden": "true" }), /* @__PURE__ */ d(t, { children: J ? B.lock.lockedDescription : B.lock.lockedDescriptionWithoutUnlock })]
|
|
204
|
+
}) : null,
|
|
205
|
+
I === "errored" ? /* @__PURE__ */ d(s, { children: B.lock.errorDescription }) : null,
|
|
206
|
+
P === "errored" ? /* @__PURE__ */ d(s, { children: B.credentials.errorDescription }) : null
|
|
207
|
+
]
|
|
208
|
+
})
|
|
209
|
+
}), Z.length > 0 ? /* @__PURE__ */ f("section", {
|
|
210
|
+
"aria-label": B.fields.detailsHeading,
|
|
187
211
|
className: "ttw:flex ttw:flex-col ttw:gap-2",
|
|
188
|
-
children: [/* @__PURE__ */
|
|
212
|
+
children: [/* @__PURE__ */ d(i, {
|
|
189
213
|
variant: "card",
|
|
190
214
|
level: 3,
|
|
191
|
-
children:
|
|
192
|
-
}), /* @__PURE__ */
|
|
193
|
-
}) : null
|
|
194
|
-
|
|
215
|
+
children: B.fields.detailsHeading
|
|
216
|
+
}), /* @__PURE__ */ d(r, { items: Z })]
|
|
217
|
+
}) : null]
|
|
218
|
+
}), Q.length > 0 ? /* @__PURE__ */ f("section", {
|
|
219
|
+
className: "ttw:flex ttw:flex-col ttw:gap-2",
|
|
220
|
+
children: [/* @__PURE__ */ d(i, {
|
|
221
|
+
variant: "card",
|
|
222
|
+
level: 3,
|
|
223
|
+
children: B.fields.cardControlsHeading
|
|
224
|
+
}), /* @__PURE__ */ d(r, { items: Q })]
|
|
225
|
+
}) : null]
|
|
195
226
|
})
|
|
196
227
|
})]
|
|
197
228
|
});
|
|
198
229
|
}
|
|
199
|
-
export {
|
|
230
|
+
export { p as CardDetailsPanel };
|
package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardsList.js
CHANGED
|
@@ -15,11 +15,8 @@ var m = [
|
|
|
15
15
|
10,
|
|
16
16
|
25,
|
|
17
17
|
50
|
|
18
|
-
], h = [], g = () => void 0
|
|
19
|
-
|
|
20
|
-
fundingAccount: 220
|
|
21
|
-
};
|
|
22
|
-
function v({ row: e, labels: t, isClickable: n }) {
|
|
18
|
+
], h = [], g = () => void 0;
|
|
19
|
+
function _({ row: e, labels: t, isClickable: n }) {
|
|
23
20
|
return /* @__PURE__ */ f("span", {
|
|
24
21
|
className: "ttw:flex ttw:min-w-0 ttw:flex-col ttw:gap-0.5",
|
|
25
22
|
children: [/* @__PURE__ */ f("span", {
|
|
@@ -45,11 +42,12 @@ function v({ row: e, labels: t, isClickable: n }) {
|
|
|
45
42
|
})]
|
|
46
43
|
});
|
|
47
44
|
}
|
|
48
|
-
function
|
|
45
|
+
function v({ row: e, labels: t }) {
|
|
49
46
|
return /* @__PURE__ */ f("span", {
|
|
50
47
|
className: "ttw:flex ttw:min-w-0 ttw:items-baseline ttw:gap-1 ttw:text-sm ttw:font-normal",
|
|
51
48
|
children: [/* @__PURE__ */ d("span", {
|
|
52
|
-
className: "ttw:truncate ttw:text-foreground",
|
|
49
|
+
className: "ttw:max-w-50 ttw:truncate ttw:text-foreground",
|
|
50
|
+
title: e.fundingAccount,
|
|
53
51
|
children: e.fundingAccount
|
|
54
52
|
}), e.fundingAccountLastFour && /* @__PURE__ */ f("span", {
|
|
55
53
|
className: "ttw:shrink-0 ttw:text-muted-foreground",
|
|
@@ -61,7 +59,7 @@ function y({ row: e, labels: t }) {
|
|
|
61
59
|
})]
|
|
62
60
|
});
|
|
63
61
|
}
|
|
64
|
-
function
|
|
62
|
+
function y({ row: e, labels: t }) {
|
|
65
63
|
return e.limit ? /* @__PURE__ */ f("span", {
|
|
66
64
|
className: "ttw:text-sm ttw:tabular-nums",
|
|
67
65
|
children: [/* @__PURE__ */ d("span", {
|
|
@@ -76,13 +74,13 @@ function b({ row: e, labels: t }) {
|
|
|
76
74
|
children: t.noLimit
|
|
77
75
|
});
|
|
78
76
|
}
|
|
79
|
-
function
|
|
77
|
+
function b({ row: t }) {
|
|
80
78
|
return /* @__PURE__ */ d(e, {
|
|
81
79
|
tone: t.statusTone,
|
|
82
80
|
children: t.statusLabel
|
|
83
81
|
});
|
|
84
82
|
}
|
|
85
|
-
function
|
|
83
|
+
function x({ row: e, labels: n }) {
|
|
86
84
|
return e.onActivate ? /* @__PURE__ */ d(t, {
|
|
87
85
|
size: "sm",
|
|
88
86
|
variant: "outline",
|
|
@@ -93,25 +91,26 @@ function S({ row: e, labels: n }) {
|
|
|
93
91
|
children: n.activateButton
|
|
94
92
|
}) : null;
|
|
95
93
|
}
|
|
96
|
-
function
|
|
97
|
-
let
|
|
98
|
-
cardName: (e) => /* @__PURE__ */ d(
|
|
94
|
+
function S(e, t, n, r) {
|
|
95
|
+
let i = {
|
|
96
|
+
cardName: (e) => /* @__PURE__ */ d(_, {
|
|
99
97
|
row: e,
|
|
100
98
|
labels: t,
|
|
101
99
|
isClickable: n
|
|
102
100
|
}),
|
|
103
|
-
fundingAccount: (e) => /* @__PURE__ */ d(
|
|
101
|
+
fundingAccount: (e) => /* @__PURE__ */ d(v, {
|
|
104
102
|
row: e,
|
|
105
103
|
labels: t
|
|
106
104
|
}),
|
|
107
105
|
cardholder: (e) => /* @__PURE__ */ d("span", {
|
|
108
|
-
className: "ttw:text-sm ttw:font-normal ttw:text-foreground",
|
|
106
|
+
className: "ttw:block ttw:max-w-50 ttw:truncate ttw:text-sm ttw:font-normal ttw:text-foreground",
|
|
107
|
+
title: e.cardholder,
|
|
109
108
|
children: e.cardholder
|
|
110
109
|
}),
|
|
111
|
-
status: (e) => /* @__PURE__ */ d(
|
|
110
|
+
status: (e) => /* @__PURE__ */ d(b, { row: e }),
|
|
112
111
|
limit: (e) => /* @__PURE__ */ d("div", {
|
|
113
112
|
className: "ttw:text-right",
|
|
114
|
-
children: /* @__PURE__ */ d(
|
|
113
|
+
children: /* @__PURE__ */ d(y, {
|
|
115
114
|
row: e,
|
|
116
115
|
labels: t
|
|
117
116
|
})
|
|
@@ -119,53 +118,54 @@ function C(e, t, n) {
|
|
|
119
118
|
};
|
|
120
119
|
return [...e.map((e) => ({
|
|
121
120
|
id: e,
|
|
122
|
-
|
|
121
|
+
meta: { fitContent: e === "status" || e === "limit" },
|
|
123
122
|
header: () => e === "limit" ? /* @__PURE__ */ d("div", {
|
|
124
123
|
className: "ttw:text-right",
|
|
125
124
|
children: t.columnHeaders[e]
|
|
126
125
|
}) : t.columnHeaders[e],
|
|
127
|
-
cell: ({ row: t }) =>
|
|
128
|
-
})), {
|
|
126
|
+
cell: ({ row: t }) => i[e](t.original)
|
|
127
|
+
})), ...r ? [{
|
|
129
128
|
id: "actions",
|
|
129
|
+
meta: { fitContent: !0 },
|
|
130
130
|
header: () => /* @__PURE__ */ d("span", {
|
|
131
131
|
className: "ttw:sr-only",
|
|
132
132
|
children: t.rowActionsColumn
|
|
133
133
|
}),
|
|
134
134
|
cell: ({ row: e }) => /* @__PURE__ */ d("div", {
|
|
135
135
|
className: "ttw:text-right",
|
|
136
|
-
children: /* @__PURE__ */ d(
|
|
136
|
+
children: /* @__PURE__ */ d(x, {
|
|
137
137
|
row: e.original,
|
|
138
138
|
labels: t
|
|
139
139
|
})
|
|
140
140
|
})
|
|
141
|
-
}];
|
|
141
|
+
}] : []];
|
|
142
142
|
}
|
|
143
|
-
function
|
|
143
|
+
function C({ row: e, columns: t, labels: n, isClickable: r }) {
|
|
144
144
|
return /* @__PURE__ */ f("div", {
|
|
145
145
|
className: "ttw:flex ttw:flex-col ttw:gap-2",
|
|
146
146
|
children: [
|
|
147
147
|
/* @__PURE__ */ f("div", {
|
|
148
148
|
className: "ttw:flex ttw:items-start ttw:justify-between ttw:gap-2",
|
|
149
|
-
children: [/* @__PURE__ */ d(
|
|
149
|
+
children: [/* @__PURE__ */ d(_, {
|
|
150
150
|
row: e,
|
|
151
151
|
labels: n,
|
|
152
152
|
isClickable: r
|
|
153
|
-
}), t.includes("status") && /* @__PURE__ */ d(
|
|
153
|
+
}), t.includes("status") && /* @__PURE__ */ d(b, { row: e })]
|
|
154
154
|
}),
|
|
155
155
|
t.includes("cardholder") && /* @__PURE__ */ d("span", {
|
|
156
156
|
className: "ttw:text-sm ttw:text-foreground",
|
|
157
157
|
children: e.cardholder
|
|
158
158
|
}),
|
|
159
|
-
t.includes("fundingAccount") && /* @__PURE__ */ d(
|
|
159
|
+
t.includes("fundingAccount") && /* @__PURE__ */ d(v, {
|
|
160
160
|
row: e,
|
|
161
161
|
labels: n
|
|
162
162
|
}),
|
|
163
163
|
/* @__PURE__ */ f("div", {
|
|
164
164
|
className: "ttw:flex ttw:items-center ttw:justify-between ttw:gap-2",
|
|
165
|
-
children: [t.includes("limit") ? /* @__PURE__ */ d(
|
|
165
|
+
children: [t.includes("limit") ? /* @__PURE__ */ d(y, {
|
|
166
166
|
row: e,
|
|
167
167
|
labels: n
|
|
168
|
-
}) : null, /* @__PURE__ */ d(
|
|
168
|
+
}) : null, /* @__PURE__ */ d(x, {
|
|
169
169
|
row: e,
|
|
170
170
|
labels: n
|
|
171
171
|
})]
|
|
@@ -173,12 +173,13 @@ function w({ row: e, columns: t, labels: n, isClickable: r }) {
|
|
|
173
173
|
]
|
|
174
174
|
});
|
|
175
175
|
}
|
|
176
|
-
function
|
|
177
|
-
let z = l(), B = u(() => c(L), [L]), V = e.length > 0 && e.every((e) => e.onSelect !== void 0), H = u(() =>
|
|
176
|
+
function w({ rows: e, columns: a, isLoading: _ = !1, isError: v = !1, canToggleShowMyCards: y = !1, isShowingMyCards: b = !0, onShowMyCardsChange: x, canCreateCard: w = !1, onCreateCardClick: T, headerStart: E, onRetry: D, isPaginationVisible: O = !1, pageSize: k = 10, pageSizeOptions: A = m, rangeLabel: j = "", isPreviousPageDisabled: M = !1, isNextPageDisabled: N = !1, onPageSizeChange: P, onPreviousPageClick: F, onNextPageClick: I, labels: L, testIds: R }) {
|
|
177
|
+
let z = l(), B = u(() => c(L), [L]), V = e.length > 0 && e.every((e) => e.onSelect !== void 0), H = e.some((e) => !!e.onActivate), U = u(() => S(a, B, V, H), [
|
|
178
178
|
a,
|
|
179
179
|
B,
|
|
180
|
-
V
|
|
181
|
-
|
|
180
|
+
V,
|
|
181
|
+
H
|
|
182
|
+
]), W = !!(w && T), G = !_ && !v && e.length === 0, K = W && !G, q = !!(O && P && F && I), J = V ? {
|
|
182
183
|
onRowClick: (e) => e.onSelect?.(),
|
|
183
184
|
rowAriaLabel: (e) => `${B.selectCardButton} ${e.nickname} ${e.lastFour} ${e.typeLabel}`
|
|
184
185
|
} : {};
|
|
@@ -188,9 +189,9 @@ function T({ rows: e, columns: a, isLoading: _ = !1, isError: v = !1, canToggleS
|
|
|
188
189
|
"data-testid": R?.root,
|
|
189
190
|
className: "ttw:flex ttw:flex-col ttw:gap-4",
|
|
190
191
|
children: [
|
|
191
|
-
(
|
|
192
|
+
(K || E) && /* @__PURE__ */ f("header", {
|
|
192
193
|
className: "ttw:flex ttw:items-center ttw:gap-4",
|
|
193
|
-
children: [E,
|
|
194
|
+
children: [E, K && /* @__PURE__ */ d(t, {
|
|
194
195
|
size: "sm",
|
|
195
196
|
disabled: _,
|
|
196
197
|
onClick: T,
|
|
@@ -211,7 +212,7 @@ function T({ rows: e, columns: a, isLoading: _ = !1, isError: v = !1, canToggleS
|
|
|
211
212
|
children: B.showMyCardsToggle
|
|
212
213
|
})]
|
|
213
214
|
}),
|
|
214
|
-
v ||
|
|
215
|
+
v || G ? /* @__PURE__ */ f("div", {
|
|
215
216
|
className: "ttw:rounded-xl ttw:border ttw:border-border ttw:bg-card",
|
|
216
217
|
children: [v ? /* @__PURE__ */ d(s, {
|
|
217
218
|
title: B.errorTitle,
|
|
@@ -223,10 +224,10 @@ function T({ rows: e, columns: a, isLoading: _ = !1, isError: v = !1, canToggleS
|
|
|
223
224
|
icon: /* @__PURE__ */ d(p, {}),
|
|
224
225
|
title: B.emptyTitle,
|
|
225
226
|
description: B.emptyDescription,
|
|
226
|
-
actionLabel:
|
|
227
|
-
onAction:
|
|
227
|
+
actionLabel: W ? B.createCardButton : void 0,
|
|
228
|
+
onAction: W ? T : void 0,
|
|
228
229
|
testId: R?.empty
|
|
229
|
-
}), !v &&
|
|
230
|
+
}), !v && q ? /* @__PURE__ */ d(i, {
|
|
230
231
|
pageSize: k,
|
|
231
232
|
pageSizeOptions: A,
|
|
232
233
|
onPageSizeChange: P,
|
|
@@ -242,14 +243,14 @@ function T({ rows: e, columns: a, isLoading: _ = !1, isError: v = !1, canToggleS
|
|
|
242
243
|
}
|
|
243
244
|
}) : null]
|
|
244
245
|
}) : /* @__PURE__ */ d(n, {
|
|
245
|
-
columns:
|
|
246
|
+
columns: U,
|
|
246
247
|
data: e,
|
|
247
248
|
getRowId: (e) => e.key,
|
|
248
249
|
rowTestId: R?.row,
|
|
249
250
|
sorting: h,
|
|
250
251
|
onSortingChange: g,
|
|
251
252
|
isLoading: _,
|
|
252
|
-
showPagination:
|
|
253
|
+
showPagination: q,
|
|
253
254
|
pageSize: k,
|
|
254
255
|
pageSizeOptions: A,
|
|
255
256
|
onPageSizeChange: P ?? g,
|
|
@@ -258,7 +259,7 @@ function T({ rows: e, columns: a, isLoading: _ = !1, isError: v = !1, canToggleS
|
|
|
258
259
|
hasNextPage: !N && !_,
|
|
259
260
|
onPrevPage: F ?? g,
|
|
260
261
|
onNextPage: I ?? g,
|
|
261
|
-
renderCard: (e) => /* @__PURE__ */ d(
|
|
262
|
+
renderCard: (e) => /* @__PURE__ */ d(C, {
|
|
262
263
|
row: e,
|
|
263
264
|
columns: a,
|
|
264
265
|
labels: B,
|
|
@@ -270,9 +271,9 @@ function T({ rows: e, columns: a, isLoading: _ = !1, isError: v = !1, canToggleS
|
|
|
270
271
|
previousPage: B.pagination.previousPageButton,
|
|
271
272
|
nextPage: B.pagination.nextPageButton
|
|
272
273
|
},
|
|
273
|
-
...
|
|
274
|
+
...J
|
|
274
275
|
})
|
|
275
276
|
]
|
|
276
277
|
});
|
|
277
278
|
}
|
|
278
|
-
export {
|
|
279
|
+
export { w as CardsList, w as default };
|