@tesouro/embedded-components-react 0.2.306 → 0.2.308

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.
Files changed (20) hide show
  1. package/README.md +7 -4
  2. package/dist/index.css +12 -0
  3. package/dist/index.d.ts +22 -1
  4. package/dist/lib/CardDetailsWidget.d.ts +6 -0
  5. package/dist/lib/CardsWidget.d.ts +6 -0
  6. package/dist/lib/TransfersWidget.d.ts +16 -1
  7. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/index7.js +132 -110
  8. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/index.js +1 -0
  9. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/ActivateCardPanel/ActivateCardPanel.js +13 -0
  10. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/ActivateCardPanel/ActivateCardSuccessView.js +2 -0
  11. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/ActivateCardPanel/FieldError.js +1 -0
  12. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/ActivateCardPanel/PinField.js +5 -0
  13. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsPanel.js +80 -70
  14. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/labels.js +5 -0
  15. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/testIds.js +3 -1
  16. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  17. package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/index4.js +174 -164
  18. package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/index5.js +55 -52
  19. package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/index6.js +6 -3
  20. package/package.json +1 -1
@@ -2,90 +2,100 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { Badge as e, Skeleton as t, cn as n } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
6
- import { EmptyState as r } from "../../../../../shared/ui/dist/lib/EmptyState/EmptyState.js";
7
- import { ErrorState as i } from "../../../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
5
+ import { Badge as e, Button as t, Skeleton as n, cn as r } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
6
+ import { EmptyState as i } from "../../../../../shared/ui/dist/lib/EmptyState/EmptyState.js";
7
+ import { ErrorState as a } from "../../../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
8
8
  import "../../../../../shared/ui/dist/index.js";
9
- import { cardDetailsWidgetUiTestIds as a } from "./testIds.js";
10
- import { CardDetailsHeader as o } from "./CardDetailsHeader.js";
11
- import { CardFace as s } from "./CardFace.js";
12
- import { DetailCopyRow as c } from "./DetailCopyRow.js";
13
- import { resolveCardDetailsPanelLabels as l } from "./labels.js";
14
- import { useMemo as u } from "react";
15
- import { jsx as d, jsxs as f } from "react/jsx-runtime";
16
- import { CreditCardIcon as p } from "lucide-react";
9
+ import { cardDetailsWidgetUiTestIds as o } from "./testIds.js";
10
+ import { CardDetailsHeader as s } from "./CardDetailsHeader.js";
11
+ import { CardFace as c } from "./CardFace.js";
12
+ import { DetailCopyRow as l } from "./DetailCopyRow.js";
13
+ import { resolveCardDetailsPanelLabels as u } from "./labels.js";
14
+ import { useMemo as d } from "react";
15
+ import { jsx as f, jsxs as p } from "react/jsx-runtime";
16
+ import { CreditCardIcon as m, PowerIcon as h } from "lucide-react";
17
17
  //#region ../../libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsPanel.js
18
- function m({ labels: m, state: h, nickname: g, statusLabel: _, statusTone: v, formFactorLabel: y, cardMenu: b, onClose: x, bankLogoSrc: S, bankLogoAlt: C, cardholderName: w, maskedCardNumber: T, programLabel: E, billingAddress: D, allowedCategories: O, onCopy: k, onRetry: A, className: j }) {
19
- let M = u(() => l(m), [m]), N = !!O?.length;
20
- return /* @__PURE__ */ f("div", {
21
- "data-testid": a.panel,
22
- className: n("ttw:flex ttw:w-full ttw:flex-col", j),
23
- children: [/* @__PURE__ */ d(o, {
24
- labels: M.header,
25
- title: h === "loaded" ? g ?? M.header.untitledCard : void 0,
26
- isTitlePending: h === "loading",
27
- statusLabel: h === "loaded" ? _ : void 0,
28
- statusTone: v,
29
- formFactorLabel: h === "loaded" ? y : void 0,
30
- cardMenu: h === "loaded" ? b : void 0,
31
- onClose: x
32
- }), /* @__PURE__ */ d("div", {
18
+ function g({ labels: g, state: _, nickname: v, statusLabel: y, statusTone: b, formFactorLabel: x, cardMenu: S, onClose: C, bankLogoSrc: w, bankLogoAlt: T, cardholderName: E, maskedCardNumber: D, programLabel: O, billingAddress: k, allowedCategories: A, onCopy: j, onActivate: M, onRetry: N, className: P }) {
19
+ let F = d(() => u(g), [g]), I = !!A?.length;
20
+ return /* @__PURE__ */ p("div", {
21
+ "data-testid": o.panel,
22
+ className: r("ttw:flex ttw:w-full ttw:flex-col", P),
23
+ children: [/* @__PURE__ */ f(s, {
24
+ labels: F.header,
25
+ title: _ === "loaded" ? v ?? F.header.untitledCard : void 0,
26
+ isTitlePending: _ === "loading",
27
+ statusLabel: _ === "loaded" ? y : void 0,
28
+ statusTone: b,
29
+ formFactorLabel: _ === "loaded" ? x : void 0,
30
+ cardMenu: _ === "loaded" ? S : void 0,
31
+ onClose: C
32
+ }), /* @__PURE__ */ f("div", {
33
33
  className: "ttw:px-4 ttw:pb-4",
34
- children: h === "loading" ? /* @__PURE__ */ f("div", {
35
- "data-testid": a.loading,
34
+ children: _ === "loading" ? /* @__PURE__ */ p("div", {
35
+ "data-testid": o.loading,
36
36
  role: "status",
37
- "aria-label": M.status.loadingAriaLabel,
37
+ "aria-label": F.status.loadingAriaLabel,
38
38
  className: "ttw:space-y-4",
39
- children: [/* @__PURE__ */ d(t, { className: "ttw:h-8 ttw:w-56" }), /* @__PURE__ */ d(t, { className: "ttw:h-64 ttw:w-full ttw:rounded-xl" })]
40
- }) : h === "error" ? /* @__PURE__ */ d(i, {
41
- title: M.status.errorTitle,
42
- description: M.status.errorDescription,
43
- retryLabel: M.status.errorRetry,
44
- onRetry: A
45
- }) : h === "notFound" ? /* @__PURE__ */ d(r, {
46
- icon: /* @__PURE__ */ d(p, { className: "ttw:size-6 ttw:text-muted-foreground" }),
47
- title: M.status.notFoundTitle,
48
- description: M.status.notFoundDescription
49
- }) : /* @__PURE__ */ f("div", {
39
+ children: [/* @__PURE__ */ f(n, { className: "ttw:h-8 ttw:w-56" }), /* @__PURE__ */ f(n, { className: "ttw:h-64 ttw:w-full ttw:rounded-xl" })]
40
+ }) : _ === "error" ? /* @__PURE__ */ f(a, {
41
+ title: F.status.errorTitle,
42
+ description: F.status.errorDescription,
43
+ retryLabel: F.status.errorRetry,
44
+ onRetry: N
45
+ }) : _ === "notFound" ? /* @__PURE__ */ f(i, {
46
+ icon: /* @__PURE__ */ f(m, { className: "ttw:size-6 ttw:text-muted-foreground" }),
47
+ title: F.status.notFoundTitle,
48
+ description: F.status.notFoundDescription
49
+ }) : /* @__PURE__ */ p("div", {
50
50
  className: "ttw:flex ttw:flex-col ttw:overflow-hidden ttw:rounded-xl ttw:border ttw:border-border ttw:sm:flex-row",
51
- children: [/* @__PURE__ */ d("div", {
51
+ children: [/* @__PURE__ */ f("div", {
52
52
  className: "ttw:flex ttw:items-center ttw:justify-center ttw:bg-muted ttw:px-4 ttw:py-5",
53
- children: /* @__PURE__ */ d(s, {
54
- bankLogoSrc: S,
55
- bankLogoAlt: C ?? M.cardFace.bankLogoAlt,
56
- cardholderName: w ?? "",
57
- maskedCardNumber: T ?? "",
58
- programLabel: E ?? ""
53
+ children: /* @__PURE__ */ p("div", {
54
+ className: "ttw:flex ttw:flex-col ttw:gap-4",
55
+ children: [/* @__PURE__ */ f(c, {
56
+ bankLogoSrc: w,
57
+ bankLogoAlt: T ?? F.cardFace.bankLogoAlt,
58
+ cardholderName: E ?? "",
59
+ maskedCardNumber: D ?? "",
60
+ programLabel: O ?? ""
61
+ }), M ? /* @__PURE__ */ p(t, {
62
+ type: "button",
63
+ onClick: M,
64
+ children: [/* @__PURE__ */ f(h, {
65
+ className: "ttw:size-4",
66
+ "aria-hidden": "true"
67
+ }), F.actions.activateCard]
68
+ }) : null]
59
69
  })
60
- }), /* @__PURE__ */ f("div", {
70
+ }), /* @__PURE__ */ p("div", {
61
71
  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",
62
72
  children: [
63
- /* @__PURE__ */ d(c, {
64
- label: M.fields.cardholder,
65
- copyAriaLabel: w && k ? M.fields.copyCardholderAriaLabel : void 0,
66
- onCopy: w && k ? () => k(w) : void 0,
67
- children: w ?? M.fields.emptyValue
73
+ /* @__PURE__ */ f(l, {
74
+ label: F.fields.cardholder,
75
+ copyAriaLabel: E && j ? F.fields.copyCardholderAriaLabel : void 0,
76
+ onCopy: E && j ? () => j(E) : void 0,
77
+ children: E ?? F.fields.emptyValue
68
78
  }),
69
- /* @__PURE__ */ d(c, {
70
- label: M.fields.nickname,
71
- copyAriaLabel: g && k ? M.fields.copyNicknameAriaLabel : void 0,
72
- onCopy: g && k ? () => k(g) : void 0,
73
- isLast: !D && !N,
74
- children: g ?? M.fields.emptyValue
79
+ /* @__PURE__ */ f(l, {
80
+ label: F.fields.nickname,
81
+ copyAriaLabel: v && j ? F.fields.copyNicknameAriaLabel : void 0,
82
+ onCopy: v && j ? () => j(v) : void 0,
83
+ isLast: !k && !I,
84
+ children: v ?? F.fields.emptyValue
75
85
  }),
76
- D ? /* @__PURE__ */ d(c, {
77
- label: M.fields.billingAddress,
78
- copyAriaLabel: k ? M.fields.copyBillingAddressAriaLabel : void 0,
79
- onCopy: k ? () => k(D) : void 0,
80
- isLast: !N,
81
- children: D
86
+ k ? /* @__PURE__ */ f(l, {
87
+ label: F.fields.billingAddress,
88
+ copyAriaLabel: j ? F.fields.copyBillingAddressAriaLabel : void 0,
89
+ onCopy: j ? () => j(k) : void 0,
90
+ isLast: !I,
91
+ children: k
82
92
  }) : null,
83
- N ? /* @__PURE__ */ d(c, {
84
- label: M.fields.allowedCategories,
93
+ I ? /* @__PURE__ */ f(l, {
94
+ label: F.fields.allowedCategories,
85
95
  isLast: !0,
86
- children: /* @__PURE__ */ d("div", {
96
+ children: /* @__PURE__ */ f("div", {
87
97
  className: "ttw:flex ttw:flex-wrap ttw:gap-2",
88
- children: O?.map((t) => /* @__PURE__ */ d(e, {
98
+ children: A?.map((t) => /* @__PURE__ */ f(e, {
89
99
  variant: "secondary",
90
100
  children: t
91
101
  }, t))
@@ -98,4 +108,4 @@ function m({ labels: m, state: h, nickname: g, statusLabel: _, statusTone: v, fo
98
108
  });
99
109
  }
100
110
  //#endregion
101
- export { m as CardDetailsPanel };
111
+ export { g as CardDetailsPanel };
@@ -16,6 +16,7 @@ var e = {
16
16
  copyNicknameAriaLabel: "Copy nickname",
17
17
  copyBillingAddressAriaLabel: "Copy billing address"
18
18
  },
19
+ actions: { activateCard: "Activate Card" },
19
20
  status: {
20
21
  loadingAriaLabel: "Loading card details",
21
22
  errorTitle: "We couldn't load this card",
@@ -39,6 +40,10 @@ function t(t) {
39
40
  ...e.fields,
40
41
  ...t?.fields
41
42
  },
43
+ actions: {
44
+ ...e.actions,
45
+ ...t?.actions
46
+ },
42
47
  status: {
43
48
  ...e.status,
44
49
  ...t?.status
@@ -4,7 +4,9 @@ var e = {
4
4
  cardFace: "card-details-widget-card-face",
5
5
  loading: "card-details-widget-loading",
6
6
  menuTrigger: "card-details-widget-menu-trigger",
7
- closeButton: "card-details-widget-close-button"
7
+ closeButton: "card-details-widget-close-button",
8
+ activatePanel: "card-details-widget-activate-panel",
9
+ activateSuccess: "card-details-widget-activate-success"
8
10
  };
9
11
  //#endregion
10
12
  export { e as cardDetailsWidgetUiTestIds };
@@ -1,5 +1,5 @@
1
1
  //#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
2
- var e = "@tesouro/embedded-components-react", t = "0.2.306", n = "845e8eed4263c4d7b4b94e2f39f1d4a9edf82fc5", r = Object.freeze({
2
+ var e = "@tesouro/embedded-components-react", t = "0.2.308", n = "23859351e9e0bc83c3468ea19507174c7848d694", r = Object.freeze({
3
3
  library_name: e,
4
4
  library_version: t,
5
5
  library_sha: n