@tesouro/embedded-components-react 0.2.306 → 0.2.307

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 CHANGED
@@ -216,6 +216,9 @@
216
216
  .ttw\:end-0 {
217
217
  inset-inline-end: calc(var(--ttw-spacing) * 0);
218
218
  }
219
+ .ttw\:end-1 {
220
+ inset-inline-end: calc(var(--ttw-spacing) * 1);
221
+ }
219
222
  .ttw\:\!top-2 {
220
223
  top: calc(var(--ttw-spacing) * 2) !important;
221
224
  }
@@ -225,6 +228,9 @@
225
228
  .ttw\:top-0 {
226
229
  top: 0px;
227
230
  }
231
+ .ttw\:top-1 {
232
+ top: var(--ttw-spacing);
233
+ }
228
234
  .ttw\:top-1\.5 {
229
235
  top: calc(var(--ttw-spacing) * 1.5);
230
236
  }
@@ -1214,6 +1220,9 @@
1214
1220
  .ttw\:w-\[600px\] {
1215
1221
  width: 600px;
1216
1222
  }
1223
+ .ttw\:w-\[616px\] {
1224
+ width: 616px;
1225
+ }
1217
1226
  .ttw\:w-\[672px\] {
1218
1227
  width: 672px;
1219
1228
  }
@@ -2823,6 +2832,9 @@
2823
2832
  .ttw\:py-\[7px\] {
2824
2833
  padding-block: 7px;
2825
2834
  }
2835
+ .ttw\:pe-10 {
2836
+ padding-inline-end: calc(var(--ttw-spacing) * 10);
2837
+ }
2826
2838
  .ttw\:pt-0 {
2827
2839
  padding-top: 0px;
2828
2840
  }
package/dist/index.d.ts CHANGED
@@ -2060,6 +2060,11 @@ interface CardDetailsFieldLabels {
2060
2060
  copyNicknameAriaLabel: string;
2061
2061
  copyBillingAddressAriaLabel: string;
2062
2062
  }
2063
+ /** Copy for the controls the owner can switch on alongside the details. */
2064
+ interface CardDetailsActionLabels {
2065
+ /** Primary control that opens the Activate Card form. */
2066
+ activateCard: string;
2067
+ }
2063
2068
  /** Copy for the three non-loaded screens. */
2064
2069
  interface CardDetailsStatusScreenLabels {
2065
2070
  /** Accessible name announced while the panel is loading. */
@@ -2074,6 +2079,7 @@ interface CardDetailsPanelLabels {
2074
2079
  header: CardDetailsHeaderLabels;
2075
2080
  cardFace: CardDetailsCardFaceLabels;
2076
2081
  fields: CardDetailsFieldLabels;
2082
+ actions: CardDetailsActionLabels;
2077
2083
  status: CardDetailsStatusScreenLabels;
2078
2084
  }
2079
2085
 
@@ -28,6 +28,11 @@ interface CardDetailsFieldLabels {
28
28
  copyNicknameAriaLabel: string;
29
29
  copyBillingAddressAriaLabel: string;
30
30
  }
31
+ /** Copy for the controls the owner can switch on alongside the details. */
32
+ interface CardDetailsActionLabels {
33
+ /** Primary control that opens the Activate Card form. */
34
+ activateCard: string;
35
+ }
31
36
  /** Copy for the three non-loaded screens. */
32
37
  interface CardDetailsStatusScreenLabels {
33
38
  /** Accessible name announced while the panel is loading. */
@@ -42,6 +47,7 @@ interface CardDetailsPanelLabels {
42
47
  header: CardDetailsHeaderLabels;
43
48
  cardFace: CardDetailsCardFaceLabels;
44
49
  fields: CardDetailsFieldLabels;
50
+ actions: CardDetailsActionLabels;
45
51
  status: CardDetailsStatusScreenLabels;
46
52
  }
47
53
 
@@ -754,6 +754,11 @@ interface CardDetailsFieldLabels {
754
754
  copyNicknameAriaLabel: string;
755
755
  copyBillingAddressAriaLabel: string;
756
756
  }
757
+ /** Copy for the controls the owner can switch on alongside the details. */
758
+ interface CardDetailsActionLabels {
759
+ /** Primary control that opens the Activate Card form. */
760
+ activateCard: string;
761
+ }
757
762
  /** Copy for the three non-loaded screens. */
758
763
  interface CardDetailsStatusScreenLabels {
759
764
  /** Accessible name announced while the panel is loading. */
@@ -768,6 +773,7 @@ interface CardDetailsPanelLabels {
768
773
  header: CardDetailsHeaderLabels;
769
774
  cardFace: CardDetailsCardFaceLabels;
770
775
  fields: CardDetailsFieldLabels;
776
+ actions: CardDetailsActionLabels;
771
777
  status: CardDetailsStatusScreenLabels;
772
778
  }
773
779
 
@@ -5,4 +5,5 @@ import "./lib/CardDetailsPanel/CardFace.js";
5
5
  import "./lib/CardDetailsPanel/DetailCopyRow.js";
6
6
  import "./lib/CardDetailsPanel/labels.js";
7
7
  import { CardDetailsPanel as e } from "./lib/CardDetailsPanel/CardDetailsPanel.js";
8
+ import "./lib/ActivateCardPanel/ActivateCardPanel.js";
8
9
  export { e as CardDetailsPanel };
@@ -0,0 +1,13 @@
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
6
+ import "../../../../../shared/ui/dist/index.js";
7
+ import "../CardDetailsPanel/CardFace.js";
8
+ import "./ActivateCardSuccessView.js";
9
+ import "./FieldError.js";
10
+ import "./PinField.js";
11
+ import "react";
12
+ import "react/jsx-runtime";
13
+ import "lucide-react";
@@ -0,0 +1,5 @@
1
+ import "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import "./FieldError.js";
3
+ import "react";
4
+ import "react/jsx-runtime";
5
+ import "lucide-react";
@@ -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.307", n = "e6190e49468ca4e80ee98046dc93a991cb03537c", r = Object.freeze({
3
3
  library_name: e,
4
4
  library_version: t,
5
5
  library_sha: n
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tesouro/embedded-components-react",
3
- "version": "0.2.306",
3
+ "version": "0.2.307",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "packageDepSync": {