@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.
Files changed (46) hide show
  1. package/README.md +16 -16
  2. package/dist/index.css +40 -70
  3. package/dist/index.d.ts +19 -6
  4. package/dist/lib/CardDetailsWidget.d.ts +11 -3
  5. package/dist/lib/CreditCardsWidget.d.ts +19 -6
  6. package/dist/lib/DebitCardsWidget.d.ts +19 -6
  7. package/dist/lib/WidgetSuite.d.ts +19 -6
  8. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/lib/CardDetailsWidget.js +112 -110
  9. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/lib/cardDetailsView.js +1 -0
  10. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/index.js +0 -2
  11. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/ActivateCardPanel/ActivateCardPanel.js +94 -83
  12. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/ActivateCardPanel/ActivateCardSuccessView.js +32 -31
  13. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/ActivateCardPanel/labels.js +5 -2
  14. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardCredentialRow.js +41 -23
  15. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardCredentialsFace.js +3 -0
  16. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsHeader.js +30 -25
  17. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsPanel.js +162 -190
  18. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardFace.js +2 -2
  19. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CopyButton.js +35 -0
  20. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CopyableValue.js +18 -0
  21. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/NicknameEditor.js +43 -0
  22. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/cardFaceSurface.js +1 -1
  23. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/labels.js +12 -8
  24. package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/feature/dist/index5.js +3 -3
  25. package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/feature/dist/index8.js +110 -104
  26. package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/ui/dist/lib/CreateCardWidget/CreateCardWidget.js +74 -68
  27. package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/ui/dist/lib/CreateCardWidget/PreparingView.js +19 -18
  28. package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/ui/dist/lib/CreateCardWidget/SetupView.js +110 -108
  29. package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/ui/dist/lib/CreateCardWidget/SuccessView.js +33 -42
  30. package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/ui/dist/lib/CreateCardWidget/labels.js +10 -7
  31. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/lib/labels.js +1 -0
  32. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/lib/testIds.js +2 -6
  33. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/lib/useCardsWidget.js +159 -145
  34. package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/index.js +0 -1
  35. package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardsList.js +255 -112
  36. package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardsListDetailsSheet.js +1 -1
  37. package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/labels.js +4 -4
  38. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  39. package/package.json +1 -1
  40. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/AddressLine.js +0 -22
  41. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/DetailCopyRow.js +0 -28
  42. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/NicknameRow.js +0 -64
  43. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/statusBadge.js +0 -11
  44. package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardFaceSwatch.js +0 -11
  45. package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardsListRow.js +0 -103
  46. package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/statusBadge.js +0 -11
@@ -2,142 +2,153 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { Button as e, Input as t, Label as n, Separator as r, Spinner as i, Tooltip as a, TooltipContent as o, TooltipProvider as s, TooltipTrigger as c, cn as l } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
6
- import { InlineErrorAlert as u } from "../../../../../shared/ui/dist/lib/InlineErrorAlert/InlineErrorAlert.js";
5
+ import { Button as e, Heading as t, Input as n, Label as r, Separator as i, Spinner as a, Tooltip as o, TooltipContent as s, TooltipProvider as c, TooltipTrigger as l, cn as u } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
6
+ import { InlineErrorAlert as d } from "../../../../../shared/ui/dist/lib/InlineErrorAlert/InlineErrorAlert.js";
7
7
  import "../../../../../shared/ui/dist/index.js";
8
- import { CardFace as d } from "../CardDetailsPanel/CardFace.js";
9
- import { resolveActivateCardPanelLabels as f } from "./labels.js";
10
- import { ActivateCardFieldError as p, ActivateCardFormError as m, EMPTY_ACTIVATE_CARD_FORM_VALUES as h, formatDigitsInput as g, formatExpirationDateInput as _ } from "./validation.js";
11
- import { ActivateCardSuccessView as v } from "./ActivateCardSuccessView.js";
12
- import { FieldError as y } from "./FieldError.js";
13
- import { useId as b, useMemo as x } from "react";
14
- import { jsx as S, jsxs as C } from "react/jsx-runtime";
15
- import { ChevronRightIcon as w, HelpCircleIcon as T, XIcon as E } from "lucide-react";
8
+ import { CardFace as f } from "../CardDetailsPanel/CardFace.js";
9
+ import { resolveActivateCardPanelLabels as p } from "./labels.js";
10
+ import { ActivateCardFieldError as m, ActivateCardFormError as h, EMPTY_ACTIVATE_CARD_FORM_VALUES as g, formatDigitsInput as _, formatExpirationDateInput as v } from "./validation.js";
11
+ import { ActivateCardSuccessView as y } from "./ActivateCardSuccessView.js";
12
+ import { FieldError as b } from "./FieldError.js";
13
+ import { useId as x, useMemo as S } from "react";
14
+ import { jsx as C, jsxs as w } from "react/jsx-runtime";
15
+ import { InfoIcon as T, XIcon as E } from "lucide-react";
16
16
  // ../../libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/ActivateCardPanel/ActivateCardPanel.js
17
17
  var D = {};
18
18
  function O(e, t) {
19
19
  switch (e) {
20
- case p.ImpossibleMonth: return t.impossibleMonth;
21
- case p.PastExpiration: return t.pastExpiration;
22
- case m.VerificationRejected: return t.verificationRejected;
20
+ case m.ImpossibleMonth: return t.impossibleMonth;
21
+ case m.PastExpiration: return t.pastExpiration;
22
+ case h.VerificationRejected: return t.verificationRejected;
23
23
  default: return;
24
24
  }
25
25
  }
26
- function k({ labels: p, state: m = "idle", values: k = h, onValuesChange: A, errors: j = D, isSubmitDisabled: M = !0, onSubmit: N, onClose: P, onDone: F, cardArtSrc: I, bankLogoSrc: L, bankLogoAlt: R, cardholderName: z, maskedCardNumber: B, programLabel: V, testIds: H, className: U }) {
27
- let W = x(() => f(p), [p]), G = b(), K = b(), q = b(), J = b(), Y = m === "submitting", X = O(j.expirationDate, W.validation), Z = O(j.form, W.validation);
28
- return /* @__PURE__ */ C("div", {
29
- "data-testid": H?.root,
30
- className: l("ttw:flex ttw:w-full ttw:flex-col", U),
31
- children: [/* @__PURE__ */ C("div", {
32
- className: "ttw:flex ttw:items-start ttw:gap-1.5 ttw:px-4 ttw:pt-4 ttw:pb-3",
33
- children: [/* @__PURE__ */ S("h2", {
34
- className: "ttw:min-w-0 ttw:flex-1 ttw:text-2xl ttw:font-semibold ttw:tracking-[-0.6px] ttw:text-foreground",
35
- children: W.header.title
36
- }), P ? /* @__PURE__ */ S(e, {
26
+ function k({ labels: m, state: h = "idle", values: k = g, onValuesChange: A, errors: j = D, isSubmitDisabled: M = !0, onSubmit: N, onClose: P, onDone: F, cardArtSrc: I, bankLogoSrc: L, bankLogoAlt: R, cardholderName: z, maskedCardNumber: B, programLabel: V, lastFour: H, formFactorLabel: U, testIds: W, className: G }) {
27
+ let K = S(() => p(m), [m]), q = x(), J = x(), Y = x(), X = x(), Z = h === "submitting", Q = O(j.expirationDate, K.validation), $ = O(j.form, K.validation);
28
+ return /* @__PURE__ */ w("div", {
29
+ "data-testid": W?.root,
30
+ className: u("ttw:flex ttw:w-full ttw:flex-col", G),
31
+ children: [/* @__PURE__ */ w("div", {
32
+ className: "ttw:flex ttw:items-start ttw:gap-2 ttw:px-6 ttw:pt-5 ttw:pb-4",
33
+ children: [/* @__PURE__ */ C(t, {
34
+ variant: "sheet",
35
+ level: 2,
36
+ className: "ttw:min-w-0 ttw:flex-1 ttw:text-foreground",
37
+ children: K.header.title
38
+ }), P ? /* @__PURE__ */ C(e, {
37
39
  type: "button",
38
40
  variant: "ghost",
39
- size: "icon",
40
- className: "ttw:size-8 ttw:shrink-0",
41
- "aria-label": W.header.closeAriaLabel,
41
+ size: "icon-sm",
42
+ className: "ttw:shrink-0 ttw:text-muted-foreground",
43
+ "aria-label": K.header.closeAriaLabel,
42
44
  onClick: P,
43
- children: /* @__PURE__ */ S(E, { className: "ttw:size-4" })
45
+ children: /* @__PURE__ */ C(E, { className: "ttw:size-4" })
44
46
  }) : null]
45
- }), m === "succeeded" ? /* @__PURE__ */ S(v, {
46
- labels: W.status,
47
- onDone: F,
48
- testIds: H?.successView
49
- }) : /* @__PURE__ */ C("form", {
47
+ }), h === "succeeded" ? /* @__PURE__ */ C(y, {
48
+ labels: K.status,
49
+ cardFace: /* @__PURE__ */ C(f, {
50
+ cardArtSrc: I,
51
+ bankLogoSrc: L,
52
+ bankLogoAlt: R ?? K.cardFace.bankLogoAlt,
53
+ cardholderName: z ?? "",
54
+ maskedCardNumber: B ?? "",
55
+ programLabel: V ?? ""
56
+ }),
57
+ cardholderName: z,
58
+ lastFour: H,
59
+ formFactorLabel: U,
60
+ onDone: F ?? P,
61
+ testIds: W?.successView
62
+ }) : /* @__PURE__ */ w("form", {
50
63
  noValidate: !0,
51
64
  onSubmit: (e) => {
52
- e.preventDefault(), !(M || Y) && N?.();
65
+ e.preventDefault(), !(M || Z) && N?.();
53
66
  },
54
- className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:px-4 ttw:pb-4",
67
+ className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:px-6 ttw:pb-6",
55
68
  children: [
56
- /* @__PURE__ */ S("div", {
69
+ /* @__PURE__ */ C("div", {
57
70
  className: "ttw:flex ttw:justify-center",
58
- children: /* @__PURE__ */ S(d, {
71
+ children: /* @__PURE__ */ C(f, {
59
72
  cardArtSrc: I,
60
73
  bankLogoSrc: L,
61
- bankLogoAlt: R ?? W.cardFace.bankLogoAlt,
74
+ bankLogoAlt: R ?? K.cardFace.bankLogoAlt,
62
75
  cardholderName: z ?? "",
63
76
  maskedCardNumber: B ?? "",
64
77
  programLabel: V ?? "",
65
- testIds: H?.cardFace
78
+ testIds: W?.cardFace
66
79
  })
67
80
  }),
68
- /* @__PURE__ */ C("div", {
81
+ /* @__PURE__ */ w("div", {
69
82
  className: "ttw:flex ttw:flex-col ttw:gap-1.5",
70
83
  children: [
71
- /* @__PURE__ */ S(n, {
72
- htmlFor: G,
84
+ /* @__PURE__ */ C(r, {
85
+ htmlFor: q,
73
86
  className: "ttw:text-sm ttw:font-medium",
74
- children: W.fields.expirationDate
87
+ children: K.fields.expirationDate
75
88
  }),
76
- /* @__PURE__ */ S(t, {
77
- id: G,
89
+ /* @__PURE__ */ C(n, {
90
+ id: q,
78
91
  value: k.expirationDate,
79
- placeholder: W.fields.expirationDatePlaceholder,
80
- disabled: Y,
92
+ placeholder: K.fields.expirationDatePlaceholder,
93
+ disabled: Z,
81
94
  inputMode: "numeric",
82
95
  autoComplete: "off",
83
- "aria-invalid": X ? !0 : void 0,
84
- "aria-describedby": X ? K : void 0,
85
- onChange: (e) => A?.({ expirationDate: _(e.target.value) })
96
+ "aria-invalid": Q ? !0 : void 0,
97
+ "aria-describedby": Q ? J : void 0,
98
+ onChange: (e) => A?.({ expirationDate: v(e.target.value) })
86
99
  }),
87
- /* @__PURE__ */ S(y, {
88
- id: K,
89
- message: X
100
+ /* @__PURE__ */ C(b, {
101
+ id: J,
102
+ message: Q
90
103
  })
91
104
  ]
92
105
  }),
93
- /* @__PURE__ */ C("div", {
106
+ /* @__PURE__ */ w("div", {
94
107
  className: "ttw:flex ttw:flex-col ttw:gap-1.5",
95
108
  children: [
96
- /* @__PURE__ */ C("div", {
109
+ /* @__PURE__ */ w("div", {
97
110
  className: "ttw:flex ttw:items-center ttw:gap-1.5",
98
- children: [/* @__PURE__ */ S(n, {
99
- htmlFor: q,
111
+ children: [/* @__PURE__ */ C(r, {
112
+ htmlFor: Y,
100
113
  className: "ttw:text-sm ttw:font-medium",
101
- children: W.fields.securityCode
102
- }), /* @__PURE__ */ S(s, { children: /* @__PURE__ */ C(a, { children: [/* @__PURE__ */ S(c, {
114
+ children: K.fields.securityCode
115
+ }), /* @__PURE__ */ C(c, { children: /* @__PURE__ */ w(o, { children: [/* @__PURE__ */ C(l, {
103
116
  type: "button",
104
117
  className: "ttw:inline-flex ttw:shrink-0 ttw:cursor-help ttw:text-muted-foreground",
105
- "aria-label": W.fields.securityCodeInfoAriaLabel,
106
- children: /* @__PURE__ */ S(T, { className: "ttw:size-4" })
107
- }), /* @__PURE__ */ S(o, {
118
+ "aria-label": K.fields.securityCodeInfoAriaLabel,
119
+ children: /* @__PURE__ */ C(T, { className: "ttw:size-4" })
120
+ }), /* @__PURE__ */ C(s, {
108
121
  className: "ttw:max-w-xs",
109
- children: W.fields.securityCodeInfo
122
+ children: K.fields.securityCodeInfo
110
123
  })] }) })]
111
124
  }),
112
- /* @__PURE__ */ S(t, {
113
- id: q,
125
+ /* @__PURE__ */ C(n, {
126
+ id: Y,
114
127
  value: k.securityCode,
115
- placeholder: W.fields.securityCodePlaceholder,
116
- "aria-describedby": J,
117
- disabled: Y,
128
+ placeholder: K.fields.securityCodePlaceholder,
129
+ "aria-describedby": X,
130
+ disabled: Z,
118
131
  inputMode: "numeric",
119
132
  autoComplete: "off",
120
133
  maxLength: 4,
121
- onChange: (e) => A?.({ securityCode: g(e.target.value, 4) })
134
+ onChange: (e) => A?.({ securityCode: _(e.target.value, 4) })
122
135
  }),
123
- /* @__PURE__ */ S("span", {
124
- id: J,
136
+ /* @__PURE__ */ C("span", {
137
+ id: X,
125
138
  className: "ttw:sr-only",
126
- children: W.fields.securityCodeInfo
139
+ children: K.fields.securityCodeInfo
127
140
  })
128
141
  ]
129
142
  }),
130
- /* @__PURE__ */ S(r, {}),
131
- m === "errored" || Z ? /* @__PURE__ */ S(u, { children: Z ?? W.status.errorDescription }) : null,
132
- /* @__PURE__ */ C(e, {
133
- type: "submit",
134
- className: "ttw:w-full",
135
- disabled: M || Y,
136
- children: [
137
- Y ? /* @__PURE__ */ S(i, { "aria-label": W.status.submittingAriaLabel }) : null,
138
- W.status.submit,
139
- /* @__PURE__ */ S(w, { className: "ttw:size-4" })
140
- ]
143
+ /* @__PURE__ */ C(i, {}),
144
+ h === "errored" || $ ? /* @__PURE__ */ C(d, { children: $ ?? K.status.errorDescription }) : null,
145
+ /* @__PURE__ */ C("div", {
146
+ className: "ttw:flex ttw:justify-end",
147
+ children: /* @__PURE__ */ w(e, {
148
+ type: "submit",
149
+ disabled: M || Z,
150
+ children: [Z ? /* @__PURE__ */ C(a, { "aria-label": K.status.submittingAriaLabel }) : null, K.status.submit]
151
+ })
141
152
  })
142
153
  ]
143
154
  })]
@@ -1,37 +1,38 @@
1
- import { Button as e } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
1
+ import { ResultScreen as e } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
2
  import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
- import { CheckIcon as r, ChevronRightIcon as i } from "lucide-react";
3
+ import { CheckIcon as r } from "lucide-react";
4
4
  // ../../libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/ActivateCardPanel/ActivateCardSuccessView.js
5
- function a({ labels: a, onDone: o, testIds: s }) {
5
+ var i = () => void 0;
6
+ function a({ labels: a, cardFace: o, cardholderName: s, lastFour: c, formFactorLabel: l, onDone: u, testIds: d }) {
7
+ let f = [
8
+ {
9
+ label: a.successCardholderLabel,
10
+ value: s
11
+ },
12
+ {
13
+ label: a.successLastFourLabel,
14
+ value: c
15
+ },
16
+ {
17
+ label: a.successFormatLabel,
18
+ value: l
19
+ }
20
+ ].filter((e) => !!e.value);
6
21
  return /* @__PURE__ */ n("div", {
7
- "data-testid": s?.root,
8
- className: "ttw:flex ttw:flex-col",
9
- children: [/* @__PURE__ */ n("div", {
10
- className: "ttw:flex ttw:flex-col ttw:items-center ttw:gap-3 ttw:px-4 ttw:pt-10 ttw:pb-8 ttw:text-center",
11
- children: [
12
- /* @__PURE__ */ t("div", {
13
- "aria-hidden": "true",
14
- className: "ttw:flex ttw:size-10 ttw:items-center ttw:justify-center ttw:rounded-lg ttw:bg-emerald-700 ttw:text-white",
15
- children: /* @__PURE__ */ t(r, { className: "ttw:size-5" })
16
- }),
17
- /* @__PURE__ */ t("h3", {
18
- className: "ttw:text-lg ttw:font-semibold ttw:text-foreground",
19
- children: a.successTitle
20
- }),
21
- /* @__PURE__ */ t("p", {
22
- className: "ttw:max-w-sm ttw:text-sm ttw:text-muted-foreground",
23
- children: a.successDescription
24
- })
25
- ]
26
- }), o ? /* @__PURE__ */ t("div", {
27
- className: "ttw:px-4 ttw:pb-4",
28
- children: /* @__PURE__ */ n(e, {
29
- type: "button",
30
- className: "ttw:w-full",
31
- onClick: o,
32
- children: [a.done, /* @__PURE__ */ t(i, { className: "ttw:size-4" })]
33
- })
34
- }) : null]
22
+ "data-testid": d?.root,
23
+ className: "ttw:flex ttw:flex-col ttw:gap-6 ttw:px-6 ttw:pb-6",
24
+ children: [/* @__PURE__ */ t("div", {
25
+ className: "ttw:flex ttw:justify-center ttw:rounded-lg ttw:bg-muted ttw:p-4",
26
+ children: o
27
+ }), /* @__PURE__ */ t(e, {
28
+ icon: /* @__PURE__ */ t(r, {}),
29
+ title: a.successTitle,
30
+ description: a.successDescription,
31
+ details: f,
32
+ onDone: u ?? i,
33
+ labels: { done: a.done },
34
+ className: u ? void 0 : "ttw:[&>[data-slot=modal-footer]]:hidden"
35
+ })]
35
36
  });
36
37
  }
37
38
  export { a as ActivateCardSuccessView };
@@ -1,7 +1,7 @@
1
1
  // ../../libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/ActivateCardPanel/labels.js
2
2
  var e = {
3
3
  header: {
4
- title: "Activate Card",
4
+ title: "Activate card",
5
5
  closeAriaLabel: "Close activate card"
6
6
  },
7
7
  cardFace: { bankLogoAlt: "Bank logo" },
@@ -23,8 +23,11 @@ var e = {
23
23
  submittingAriaLabel: "Activating card",
24
24
  successTitle: "Card activated",
25
25
  successDescription: "This card is ready to use.",
26
+ successCardholderLabel: "Cardholder",
27
+ successLastFourLabel: "Last four",
28
+ successFormatLabel: "Format",
26
29
  done: "Done",
27
- errorDescription: "We couldn't activate this card. Check the details and try again."
30
+ errorDescription: "Couldn't activate this card. Check the details and try again."
28
31
  }
29
32
  };
30
33
  function t(t) {
@@ -1,28 +1,46 @@
1
- import { jsx as e, jsxs as t } from "react/jsx-runtime";
2
- import { CopyIcon as n } from "lucide-react";
1
+ import { useEffect as e, useState as t } from "react";
2
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
3
+ import { CheckIcon as i, CopyIcon as a } from "lucide-react";
3
4
  // ../../libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardCredentialRow.js
4
- function r({ label: r, value: i, copyAriaLabel: a, onCopy: o }) {
5
- return /* @__PURE__ */ t("div", {
5
+ var o = 2e3;
6
+ function s({ label: s, value: c, copyAriaLabel: l, copiedLabel: u, onCopy: d }) {
7
+ let [f, p] = t(!1);
8
+ return e(() => {
9
+ if (!f) return;
10
+ let e = setTimeout(() => p(!1), o);
11
+ return () => clearTimeout(e);
12
+ }, [f]), /* @__PURE__ */ r("div", {
6
13
  className: "ttw:relative ttw:flex ttw:min-w-0 ttw:items-end ttw:justify-between ttw:gap-2",
7
- children: [/* @__PURE__ */ t("div", {
8
- className: "ttw:min-w-0",
9
- children: [/* @__PURE__ */ e("p", {
10
- className: "ttw:text-[10px] ttw:font-medium ttw:tracking-wide ttw:text-white/70 ttw:uppercase",
11
- children: r
12
- }), /* @__PURE__ */ e("p", {
13
- className: "ttw:mt-0.5 ttw:truncate ttw:text-base ttw:tracking-wide ttw:text-white",
14
- children: i
15
- })]
16
- }), i && o ? /* @__PURE__ */ e("button", {
17
- type: "button",
18
- "aria-label": a,
19
- onClick: () => o(i),
20
- className: "ttw:inline-flex ttw:size-7 ttw:shrink-0 ttw:cursor-pointer ttw:items-center ttw:justify-center ttw:rounded-md ttw:text-white/70 ttw:transition-colors ttw:hover:bg-white/10 ttw:hover:text-white ttw:focus-visible:ring-2 ttw:focus-visible:ring-white/70 ttw:focus-visible:outline-none",
21
- children: /* @__PURE__ */ e(n, {
22
- className: "ttw:size-3.5",
23
- "aria-hidden": "true"
14
+ children: [
15
+ /* @__PURE__ */ r("div", {
16
+ className: "ttw:min-w-0",
17
+ children: [/* @__PURE__ */ n("p", {
18
+ className: "ttw:text-[10px] ttw:font-medium ttw:tracking-wide ttw:text-white/70 ttw:uppercase",
19
+ children: s
20
+ }), /* @__PURE__ */ n("p", {
21
+ className: "ttw:mt-0.5 ttw:truncate ttw:text-base ttw:tracking-wide ttw:text-white",
22
+ children: c
23
+ })]
24
+ }),
25
+ c && d ? /* @__PURE__ */ n("button", {
26
+ type: "button",
27
+ "aria-label": l,
28
+ title: f ? u : l,
29
+ onClick: async () => {
30
+ await d(c) !== !1 && p(!0);
31
+ },
32
+ className: "ttw:inline-flex ttw:size-7 ttw:shrink-0 ttw:cursor-pointer ttw:items-center ttw:justify-center ttw:rounded-md ttw:text-white/70 ttw:transition-colors ttw:hover:bg-white/10 ttw:hover:text-white ttw:focus-visible:ring-2 ttw:focus-visible:ring-white/70 ttw:focus-visible:outline-none",
33
+ children: n(f ? i : a, {
34
+ className: "ttw:size-3.5",
35
+ "aria-hidden": "true"
36
+ })
37
+ }) : null,
38
+ /* @__PURE__ */ n("span", {
39
+ role: "status",
40
+ className: "ttw:sr-only",
41
+ children: f ? u : ""
24
42
  })
25
- }) : null]
43
+ ]
26
44
  });
27
45
  }
28
- export { r as CardCredentialRow };
46
+ export { s as CardCredentialRow };
@@ -18,6 +18,7 @@ function o({ labels: o, cardNumber: s, expirationDate: c, securityCode: l, isLoc
18
18
  label: o.cardNumber,
19
19
  value: s,
20
20
  copyAriaLabel: o.copyCardNumberAriaLabel,
21
+ copiedLabel: o.copiedLabel,
21
22
  onCopy: d
22
23
  }),
23
24
  /* @__PURE__ */ a("div", {
@@ -26,11 +27,13 @@ function o({ labels: o, cardNumber: s, expirationDate: c, securityCode: l, isLoc
26
27
  label: o.expirationDate,
27
28
  value: c,
28
29
  copyAriaLabel: o.copyExpirationDateAriaLabel,
30
+ copiedLabel: o.copiedLabel,
29
31
  onCopy: d
30
32
  }), /* @__PURE__ */ i(r, {
31
33
  label: o.securityCode,
32
34
  value: l,
33
35
  copyAriaLabel: o.copySecurityCodeAriaLabel,
36
+ copiedLabel: o.copiedLabel,
34
37
  onCopy: d
35
38
  })]
36
39
  })
@@ -1,51 +1,56 @@
1
- import { Badge as e, Button as t, DropdownMenu as n, DropdownMenuContent as r, DropdownMenuTrigger as i, Skeleton as a } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { cardStatusToneClassName as o } from "./statusBadge.js";
1
+ import { Badge as e, Button as t, DropdownMenu as n, DropdownMenuContent as r, DropdownMenuTrigger as i, Heading as a, Skeleton as o } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
3
2
  import { jsx as s, jsxs as c } from "react/jsx-runtime";
4
3
  import { EllipsisVerticalIcon as l, XIcon as u } from "lucide-react";
5
4
  // ../../libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsHeader.js
6
- function d({ labels: d, title: f, isTitlePending: p, statusLabel: m, statusTone: h, formFactorLabel: g, cardMenu: _, onClose: v, testIds: y }) {
5
+ function d({ labels: d, title: f, titleAction: p, isTitlePending: m, statusLabel: h, statusTone: g, formFactorLabel: _, cardMenu: v, onClose: y, testIds: b }) {
7
6
  return /* @__PURE__ */ c("div", {
8
- className: "ttw:flex ttw:items-start ttw:gap-1.5 ttw:px-4 ttw:pt-4 ttw:pb-3",
7
+ className: "ttw:flex ttw:items-start ttw:gap-2 ttw:px-4 ttw:pt-5 ttw:@md/card-details:px-6 ttw:pb-4",
9
8
  children: [
10
9
  /* @__PURE__ */ c("div", {
11
- className: "ttw:flex ttw:min-w-0 ttw:flex-1 ttw:flex-col ttw:gap-1.5",
10
+ className: "ttw:flex ttw:min-w-0 ttw:flex-1 ttw:flex-col ttw:gap-1",
12
11
  children: [/* @__PURE__ */ c("div", {
13
- className: "ttw:flex ttw:items-center ttw:gap-1.5",
14
- children: [p ? /* @__PURE__ */ s(a, { className: "ttw:h-8 ttw:w-48" }) : f ? /* @__PURE__ */ s("h2", {
15
- className: "ttw:truncate ttw:text-2xl ttw:font-semibold ttw:tracking-[-0.6px] ttw:text-foreground",
16
- children: f
17
- }) : null, m ? /* @__PURE__ */ s(e, {
18
- className: o(h ?? "neutral"),
19
- children: m
20
- }) : null]
21
- }), g ? /* @__PURE__ */ s("p", {
12
+ className: "ttw:flex ttw:flex-wrap ttw:items-center ttw:gap-2",
13
+ children: [
14
+ m ? /* @__PURE__ */ s(o, { className: "ttw:h-7 ttw:w-48" }) : f ? /* @__PURE__ */ s(a, {
15
+ variant: "sheet",
16
+ level: 2,
17
+ className: "ttw:truncate ttw:text-foreground",
18
+ children: f
19
+ }) : null,
20
+ p,
21
+ h ? /* @__PURE__ */ s(e, {
22
+ tone: g ?? "neutral",
23
+ children: h
24
+ }) : null
25
+ ]
26
+ }), _ ? /* @__PURE__ */ s("p", {
22
27
  className: "ttw:text-sm ttw:text-muted-foreground",
23
- children: g
28
+ children: _
24
29
  }) : null]
25
30
  }),
26
- _ ? /* @__PURE__ */ c(n, { children: [/* @__PURE__ */ s(i, {
31
+ v ? /* @__PURE__ */ c(n, { children: [/* @__PURE__ */ s(i, {
27
32
  asChild: !0,
28
33
  children: /* @__PURE__ */ s(t, {
29
34
  type: "button",
30
35
  variant: "ghost",
31
- size: "icon",
32
- className: "ttw:size-8 ttw:shrink-0 ttw:bg-muted",
36
+ size: "icon-sm",
37
+ className: "ttw:shrink-0",
33
38
  "aria-label": d.menuTriggerAriaLabel,
34
- "data-testid": y?.menuTrigger,
39
+ "data-testid": b?.menuTrigger,
35
40
  children: /* @__PURE__ */ s(l, { className: "ttw:size-4" })
36
41
  })
37
42
  }), /* @__PURE__ */ s(r, {
38
43
  align: "end",
39
- children: _
44
+ children: v
40
45
  })] }) : null,
41
- v ? /* @__PURE__ */ s(t, {
46
+ y ? /* @__PURE__ */ s(t, {
42
47
  type: "button",
43
48
  variant: "ghost",
44
- size: "icon",
45
- className: "ttw:size-8 ttw:shrink-0",
49
+ size: "icon-sm",
50
+ className: "ttw:shrink-0 ttw:text-muted-foreground",
46
51
  "aria-label": d.closeAriaLabel,
47
- "data-testid": y?.closeButton,
48
- onClick: v,
52
+ "data-testid": b?.closeButton,
53
+ onClick: y,
49
54
  children: /* @__PURE__ */ s(u, { className: "ttw:size-4" })
50
55
  }) : null
51
56
  ]