@tesouro/embedded-components-react 0.3.52 → 0.3.55
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 +47 -64
- package/dist/index.css +0 -6
- package/dist/index.d.ts +80 -26
- package/dist/index.js +45 -49
- package/dist/lib/CardDetailsWidget.d.ts +61 -1
- package/dist/lib/CardDetailsWidget.js +1 -1
- package/dist/lib/CreditCardsWidget.d.ts +78 -4
- package/dist/lib/DebitCardsWidget.d.ts +78 -4
- package/dist/lib/WidgetSuite.d.ts +78 -4
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index.js +7 -4
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index2.js +20 -0
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index3.js +43 -6
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index4.js +40 -14
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index5.js +5 -26
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index6.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index7.js +32 -0
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index8.js +25 -0
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index9.js +27 -0
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index5.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index6.js +17 -160
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index7.js +107 -0
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index8.js +188 -0
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/index.js +4 -2
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/ActivateCardPanel/ActivateCardPanel.js +137 -8
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/ActivateCardPanel/ActivateCardSuccessView.js +27 -2
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/ActivateCardPanel/FieldError.js +12 -1
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/ActivateCardPanel/labels.js +55 -0
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/ActivateCardPanel/validation.js +47 -0
- package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index9.js +37 -36
- package/dist/libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index22.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index98.js +47 -29
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +22 -20
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/isApiConflictError.js +7 -0
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/isApiUnprocessableError.js +7 -0
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +246 -225
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +170 -134
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +27 -2
- package/dist/lib/CreateCardWidget.d.ts +0 -823
- package/dist/lib/CreateCardWidget.js +0 -5
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/ActivateCardPanel/PinField.js +0 -5
|
@@ -1,2 +1,27 @@
|
|
|
1
|
-
import "
|
|
2
|
-
import "
|
|
1
|
+
import { cardDetailsWidgetUiTestIds as e } from "../CardDetailsPanel/testIds.js";
|
|
2
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
+
import { CheckIcon as r } from "lucide-react";
|
|
4
|
+
//#region ../../libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/ActivateCardPanel/ActivateCardSuccessView.js
|
|
5
|
+
function i({ labels: i }) {
|
|
6
|
+
return /* @__PURE__ */ n("div", {
|
|
7
|
+
"data-testid": e.activateSuccess,
|
|
8
|
+
className: "ttw:flex ttw:flex-col ttw:items-center ttw:gap-3 ttw:px-4 ttw:py-10 ttw:text-center",
|
|
9
|
+
children: [
|
|
10
|
+
/* @__PURE__ */ t("div", {
|
|
11
|
+
"aria-hidden": "true",
|
|
12
|
+
className: "ttw:flex ttw:size-10 ttw:items-center ttw:justify-center ttw:rounded-lg ttw:bg-emerald-700 ttw:text-white",
|
|
13
|
+
children: /* @__PURE__ */ t(r, { className: "ttw:size-5" })
|
|
14
|
+
}),
|
|
15
|
+
/* @__PURE__ */ t("h3", {
|
|
16
|
+
className: "ttw:text-lg ttw:font-semibold ttw:text-foreground",
|
|
17
|
+
children: i.successTitle
|
|
18
|
+
}),
|
|
19
|
+
/* @__PURE__ */ t("p", {
|
|
20
|
+
className: "ttw:max-w-sm ttw:text-sm ttw:text-muted-foreground",
|
|
21
|
+
children: i.successDescription
|
|
22
|
+
})
|
|
23
|
+
]
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { i as ActivateCardSuccessView };
|
|
@@ -1 +1,12 @@
|
|
|
1
|
-
import "react/jsx-runtime";
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
//#region ../../libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/ActivateCardPanel/FieldError.js
|
|
3
|
+
function t({ id: t, message: n }) {
|
|
4
|
+
return n ? /* @__PURE__ */ e("p", {
|
|
5
|
+
id: t,
|
|
6
|
+
role: "alert",
|
|
7
|
+
className: "ttw:text-xs ttw:text-destructive",
|
|
8
|
+
children: n
|
|
9
|
+
}) : null;
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { t as FieldError };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
//#region ../../libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/ActivateCardPanel/labels.js
|
|
2
|
+
var e = {
|
|
3
|
+
header: {
|
|
4
|
+
title: "Activate Card",
|
|
5
|
+
closeAriaLabel: "Close activate card"
|
|
6
|
+
},
|
|
7
|
+
cardFace: { bankLogoAlt: "Bank logo" },
|
|
8
|
+
fields: {
|
|
9
|
+
expirationDate: "Expiration date",
|
|
10
|
+
expirationDatePlaceholder: "MM/YY",
|
|
11
|
+
securityCode: "Security code (CVV2)",
|
|
12
|
+
securityCodePlaceholder: "3 digits",
|
|
13
|
+
securityCodeInfoAriaLabel: "What is the security code?",
|
|
14
|
+
securityCodeInfo: "The CVV2 is the 3-digit security code printed on your card — usually near the signature strip on the back. It proves you have the physical card in hand."
|
|
15
|
+
},
|
|
16
|
+
validation: {
|
|
17
|
+
impossibleMonth: "Enter a month between 01 and 12.",
|
|
18
|
+
pastExpiration: "That expiration date has already passed.",
|
|
19
|
+
verificationRejected: "Those details don't match this card. Check the expiration date and security code printed on it, then try again."
|
|
20
|
+
},
|
|
21
|
+
status: {
|
|
22
|
+
submit: "Activate card",
|
|
23
|
+
submittingAriaLabel: "Activating card",
|
|
24
|
+
successTitle: "Card activated",
|
|
25
|
+
successDescription: "This card is ready to use.",
|
|
26
|
+
done: "Done",
|
|
27
|
+
errorDescription: "We couldn't activate this card. Check the details and try again."
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
function t(t) {
|
|
31
|
+
return {
|
|
32
|
+
header: {
|
|
33
|
+
...e.header,
|
|
34
|
+
...t?.header
|
|
35
|
+
},
|
|
36
|
+
cardFace: {
|
|
37
|
+
...e.cardFace,
|
|
38
|
+
...t?.cardFace
|
|
39
|
+
},
|
|
40
|
+
fields: {
|
|
41
|
+
...e.fields,
|
|
42
|
+
...t?.fields
|
|
43
|
+
},
|
|
44
|
+
validation: {
|
|
45
|
+
...e.validation,
|
|
46
|
+
...t?.validation
|
|
47
|
+
},
|
|
48
|
+
status: {
|
|
49
|
+
...e.status,
|
|
50
|
+
...t?.status
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
//#endregion
|
|
55
|
+
export { e as ACTIVATE_CARD_PANEL_LABELS_EN, t as resolveActivateCardPanelLabels };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
//#region ../../libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/ActivateCardPanel/validation.js
|
|
2
|
+
var e = {
|
|
3
|
+
expirationDate: "",
|
|
4
|
+
securityCode: ""
|
|
5
|
+
}, t = {
|
|
6
|
+
ImpossibleMonth: "impossibleMonth",
|
|
7
|
+
PastExpiration: "pastExpiration"
|
|
8
|
+
}, n = { VerificationRejected: "verificationRejected" }, r = 4;
|
|
9
|
+
function i(e, t) {
|
|
10
|
+
return e.replace(/\D/g, "").slice(0, t);
|
|
11
|
+
}
|
|
12
|
+
function a(e) {
|
|
13
|
+
let t = e.replace(/\D/g, "");
|
|
14
|
+
return t.length > 0 && Number(t[0]) > 1 && (t = `0${t}`), t = t.slice(0, r), t.length <= 2 ? t : `${t.slice(0, 2)}/${t.slice(2)}`;
|
|
15
|
+
}
|
|
16
|
+
function o(e) {
|
|
17
|
+
return e.replace(/\D/g, "").slice(0, r);
|
|
18
|
+
}
|
|
19
|
+
function s(e) {
|
|
20
|
+
let t = o(e);
|
|
21
|
+
if (t.length < 2) return !0;
|
|
22
|
+
let n = Number(t.slice(0, 2));
|
|
23
|
+
return n >= 1 && n <= 12;
|
|
24
|
+
}
|
|
25
|
+
function c(e) {
|
|
26
|
+
return o(e).length === r;
|
|
27
|
+
}
|
|
28
|
+
function l(e, t = /* @__PURE__ */ new Date()) {
|
|
29
|
+
if (!c(e) || !s(e)) return !1;
|
|
30
|
+
let n = o(e), r = Number(n.slice(0, 2)), i = 2e3 + Number(n.slice(2, 4)), a = t.getFullYear(), l = t.getMonth() + 1;
|
|
31
|
+
return i < a || i === a && r < l;
|
|
32
|
+
}
|
|
33
|
+
function u(e, t = /* @__PURE__ */ new Date()) {
|
|
34
|
+
return c(e) && s(e) && !l(e, t);
|
|
35
|
+
}
|
|
36
|
+
function d(e) {
|
|
37
|
+
return (/* @__PURE__ */ RegExp("^\\d{3,4}$")).test(e);
|
|
38
|
+
}
|
|
39
|
+
function f(e, n = /* @__PURE__ */ new Date()) {
|
|
40
|
+
let r = {};
|
|
41
|
+
return s(e.expirationDate) ? l(e.expirationDate, n) && (r.expirationDate = t.PastExpiration) : r.expirationDate = t.ImpossibleMonth, {
|
|
42
|
+
errors: r,
|
|
43
|
+
isValid: u(e.expirationDate, n) && d(e.securityCode)
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
//#endregion
|
|
47
|
+
export { t as ActivateCardFieldError, n as ActivateCardFormError, e as EMPTY_ACTIVATE_CARD_FORM_VALUES, i as formatDigitsInput, a as formatExpirationDateInput, c as isExpirationDateComplete, l as isExpirationDateExpired, u as isExpirationDateValid, s as isExpirationMonthPossible, d as isSecurityCodeValid, f as validateActivateCardForm };
|
|
@@ -11,15 +11,15 @@ import { CardsList as i } from "../../ui/dist/lib/CardsList/CardsList.js";
|
|
|
11
11
|
import { CardsListDetailsSheet as a } from "../../ui/dist/lib/CardsList/CardsListDetailsSheet.js";
|
|
12
12
|
import "../../ui/dist/index.js";
|
|
13
13
|
import { useCardsWidget as o } from "./index8.js";
|
|
14
|
-
import { CardDetailsWidget as s } from "../../../card-details-widget/feature/dist/
|
|
14
|
+
import { CardDetailsWidget as s } from "../../../card-details-widget/feature/dist/index8.js";
|
|
15
15
|
import "../../../card-details-widget/feature/dist/index.js";
|
|
16
16
|
import { CreateCardWidget as c } from "../../../create-card-widget/feature/dist/index8.js";
|
|
17
17
|
import "../../../create-card-widget/feature/dist/index.js";
|
|
18
18
|
import { useCallback as l, useMemo as u, useState as d } from "react";
|
|
19
19
|
import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
20
20
|
//#region ../../libs/tesouro-embedded-components-react/cards-widget/feature/dist/index9.js
|
|
21
|
-
function h({ cardProgram: e, pagination: t, defaultPagination: h, onPaginationChange: g, labels: _, featureLabels: v, selectedCardId: y, defaultSelectedCardId: b, onSelectedCardIdChange: x, cardDetailsLabels: S, cardDetailsFeatureLabels: C,
|
|
22
|
-
let { selectedCardId:
|
|
21
|
+
function h({ cardProgram: e, pagination: t, defaultPagination: h, onPaginationChange: g, labels: _, featureLabels: v, selectedCardId: y, defaultSelectedCardId: b, onSelectedCardIdChange: x, cardDetailsLabels: S, cardDetailsFeatureLabels: C, cardDetailsActivateLabels: w, bankLogoSrc: T, bankLogoAlt: E, cardArtSrc: D, createCardLabels: O, createCardFeatureLabels: k, onCreateCard: A, onActivateCard: j }) {
|
|
22
|
+
let { selectedCardId: M, onSelectCard: N, onCreateCardClick: P, canCreateCard: F, canReadCards: I, ...L } = o({
|
|
23
23
|
cardProgram: e,
|
|
24
24
|
pagination: t,
|
|
25
25
|
defaultPagination: h,
|
|
@@ -28,49 +28,50 @@ function h({ cardProgram: e, pagination: t, defaultPagination: h, onPaginationCh
|
|
|
28
28
|
selectedCardId: y,
|
|
29
29
|
defaultSelectedCardId: b,
|
|
30
30
|
onSelectedCardIdChange: x,
|
|
31
|
-
onCreateCard:
|
|
32
|
-
onActivateCard:
|
|
33
|
-
cardArtSrc:
|
|
34
|
-
}),
|
|
35
|
-
|
|
36
|
-
}, [
|
|
37
|
-
|
|
38
|
-
}, [
|
|
39
|
-
|
|
40
|
-
}, [
|
|
41
|
-
|
|
42
|
-
let
|
|
31
|
+
onCreateCard: A,
|
|
32
|
+
onActivateCard: j,
|
|
33
|
+
cardArtSrc: D
|
|
34
|
+
}), R = u(() => r(_), [_]), [z, B] = d(!1), [V, H] = d(0), [U, W] = d(M), [G, K] = d(null), q = l(() => {
|
|
35
|
+
M !== null && N(null), H((e) => e + 1), B(!0);
|
|
36
|
+
}, [M, N]), J = l(() => {
|
|
37
|
+
B(!1), M !== null && N(null);
|
|
38
|
+
}, [M, N]), Y = l((e) => {
|
|
39
|
+
B(!1), N(e);
|
|
40
|
+
}, [N]), X = e === "debit" && !!D && !!F && P === void 0, Z = z && M === null && X;
|
|
41
|
+
z && (M !== null || !X) && B(!1), Z ? G !== "create" && K("create") : M !== null && (G !== "details" && K("details"), M !== U && W(M));
|
|
42
|
+
let Q = G === "create", $ = M !== null || Z;
|
|
43
43
|
return /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(i, {
|
|
44
|
-
...
|
|
45
|
-
canCreateCard:
|
|
46
|
-
onCreateCardClick:
|
|
47
|
-
labels:
|
|
44
|
+
...L,
|
|
45
|
+
canCreateCard: F,
|
|
46
|
+
onCreateCardClick: P ?? q,
|
|
47
|
+
labels: R,
|
|
48
48
|
testIds: {
|
|
49
49
|
root: n.list,
|
|
50
50
|
row: { cardFaceSwatch: { root: n.cardFaceSwatch } }
|
|
51
51
|
}
|
|
52
52
|
}), /* @__PURE__ */ p(a, {
|
|
53
|
-
isOpen:
|
|
54
|
-
labels:
|
|
55
|
-
contentClassName:
|
|
56
|
-
onClose:
|
|
57
|
-
children:
|
|
58
|
-
cardArtSrc:
|
|
59
|
-
labels:
|
|
60
|
-
featureLabels:
|
|
61
|
-
onClose:
|
|
62
|
-
onCancel:
|
|
63
|
-
onViewCard:
|
|
53
|
+
isOpen: $,
|
|
54
|
+
labels: Q ? R.createSheet : R.detailsSheet,
|
|
55
|
+
contentClassName: Q ? "ttw:overflow-hidden ttw:p-0 ttw:min-h-0" : void 0,
|
|
56
|
+
onClose: J,
|
|
57
|
+
children: Q && X && D ? /* @__PURE__ */ p(c, {
|
|
58
|
+
cardArtSrc: D,
|
|
59
|
+
labels: O,
|
|
60
|
+
featureLabels: k,
|
|
61
|
+
onClose: J,
|
|
62
|
+
onCancel: J,
|
|
63
|
+
onViewCard: I ? Y : void 0,
|
|
64
64
|
className: "ttw:min-h-0 ttw:flex-1"
|
|
65
|
-
},
|
|
66
|
-
cardId:
|
|
65
|
+
}, V) : U === null ? null : /* @__PURE__ */ p(s, {
|
|
66
|
+
cardId: U,
|
|
67
67
|
cardProgram: e,
|
|
68
68
|
labels: S,
|
|
69
|
+
activateLabels: w,
|
|
69
70
|
featureLabels: C,
|
|
70
|
-
bankLogoSrc:
|
|
71
|
-
bankLogoAlt:
|
|
72
|
-
onClose:
|
|
73
|
-
},
|
|
71
|
+
bankLogoSrc: T,
|
|
72
|
+
bankLogoAlt: E,
|
|
73
|
+
onClose: J
|
|
74
|
+
}, U)
|
|
74
75
|
})] });
|
|
75
76
|
}
|
|
76
77
|
function g({ baseUrl: n, widgetToken: r, organizationId: i, configClient: a, gatewayRouting: o, linkComponent: s, implementation: c, uiFramework: l, errorFallback: u, onError: d, analytics: f, disclosuresAcceptance: m, providerLabels: g, ..._ }) {
|
package/dist/libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { CreateCardWidget as
|
|
4
|
-
export {
|
|
1
|
+
import "./index3.js";
|
|
2
|
+
import "./index5.js";
|
|
3
|
+
import { CreateCardWidget as e } from "./index8.js";
|
|
4
|
+
export { e as CreateCardWidget };
|