@tesouro/embedded-components-react 0.3.61 → 0.3.63

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 (43) hide show
  1. package/README.md +11 -11
  2. package/dist/index.css +6 -0
  3. package/dist/index.d.ts +44 -0
  4. package/dist/index.js +1 -1
  5. package/dist/lib/CardDetailsWidget.d.ts +44 -0
  6. package/dist/lib/CardDetailsWidget.js +1 -1
  7. package/dist/lib/CreditCardsWidget.d.ts +44 -0
  8. package/dist/lib/DebitCardsWidget.d.ts +44 -0
  9. package/dist/lib/WidgetSuite.d.ts +44 -0
  10. package/dist/libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index.js +4 -2
  11. package/dist/libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index10.js +32 -0
  12. package/dist/libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index11.js +27 -0
  13. package/dist/libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index9.js +17 -12
  14. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index.js +2 -2
  15. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index10.js +26 -0
  16. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index11.js +63 -0
  17. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index12.js +79 -0
  18. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index13.js +219 -0
  19. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index3.js +18 -2
  20. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index4.js +29 -28
  21. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index5.js +3 -0
  22. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index6.js +33 -19
  23. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index7.js +17 -102
  24. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index8.js +14 -181
  25. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index9.js +113 -0
  26. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/ActivateCardPanel/ActivateCardPanel.js +58 -55
  27. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/ActivateCardPanel/ActivateCardSuccessView.js +12 -13
  28. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardCredentialsFace.js +27 -24
  29. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsHeader.js +26 -27
  30. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsPanel.js +140 -110
  31. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardFace.js +29 -19
  32. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardFaceFlip.js +16 -17
  33. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/DetailCopyRow.js +4 -4
  34. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/NicknameRow.js +65 -0
  35. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/labels.js +23 -0
  36. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index9.js +1 -1
  37. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +22 -22
  38. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +165 -151
  39. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +164 -132
  40. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/zod.gen.js +2325 -2315
  41. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  42. package/package.json +1 -1
  43. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/testIds.js +0 -14
@@ -1,56 +1,55 @@
1
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
2
  import { cardStatusToneClassName as o } from "./statusBadge.js";
3
- import { cardDetailsWidgetUiTestIds as s } from "./testIds.js";
4
- import { jsx as c, jsxs as l } from "react/jsx-runtime";
5
- import { EllipsisVerticalIcon as u, XIcon as d } from "lucide-react";
3
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
4
+ import { EllipsisVerticalIcon as l, XIcon as u } from "lucide-react";
6
5
  //#region ../../libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsHeader.js
7
- function f({ labels: f, title: p, isTitlePending: m, statusLabel: h, statusTone: g, formFactorLabel: _, cardMenu: v, onClose: y }) {
8
- return /* @__PURE__ */ l("div", {
6
+ function d({ labels: d, title: f, isTitlePending: p, statusLabel: m, statusTone: h, formFactorLabel: g, cardMenu: _, onClose: v, testIds: y }) {
7
+ return /* @__PURE__ */ c("div", {
9
8
  className: "ttw:flex ttw:items-start ttw:gap-1.5 ttw:px-4 ttw:pt-4 ttw:pb-3",
10
9
  children: [
11
- /* @__PURE__ */ l("div", {
10
+ /* @__PURE__ */ c("div", {
12
11
  className: "ttw:flex ttw:min-w-0 ttw:flex-1 ttw:flex-col ttw:gap-1.5",
13
- children: [/* @__PURE__ */ l("div", {
12
+ children: [/* @__PURE__ */ c("div", {
14
13
  className: "ttw:flex ttw:items-center ttw:gap-1.5",
15
- children: [m ? /* @__PURE__ */ c(a, { className: "ttw:h-8 ttw:w-48" }) : p ? /* @__PURE__ */ c("h2", {
14
+ children: [p ? /* @__PURE__ */ s(a, { className: "ttw:h-8 ttw:w-48" }) : f ? /* @__PURE__ */ s("h2", {
16
15
  className: "ttw:truncate ttw:text-2xl ttw:font-semibold ttw:tracking-[-0.6px] ttw:text-foreground",
17
- children: p
18
- }) : null, h ? /* @__PURE__ */ c(e, {
19
- className: o(g ?? "neutral"),
20
- children: h
16
+ children: f
17
+ }) : null, m ? /* @__PURE__ */ s(e, {
18
+ className: o(h ?? "neutral"),
19
+ children: m
21
20
  }) : null]
22
- }), _ ? /* @__PURE__ */ c("p", {
21
+ }), g ? /* @__PURE__ */ s("p", {
23
22
  className: "ttw:text-sm ttw:text-muted-foreground",
24
- children: _
23
+ children: g
25
24
  }) : null]
26
25
  }),
27
- v ? /* @__PURE__ */ l(n, { children: [/* @__PURE__ */ c(i, {
26
+ _ ? /* @__PURE__ */ c(n, { children: [/* @__PURE__ */ s(i, {
28
27
  asChild: !0,
29
- children: /* @__PURE__ */ c(t, {
28
+ children: /* @__PURE__ */ s(t, {
30
29
  type: "button",
31
30
  variant: "ghost",
32
31
  size: "icon",
33
32
  className: "ttw:size-8 ttw:shrink-0 ttw:bg-muted",
34
- "aria-label": f.menuTriggerAriaLabel,
35
- "data-testid": s.menuTrigger,
36
- children: /* @__PURE__ */ c(u, { className: "ttw:size-4" })
33
+ "aria-label": d.menuTriggerAriaLabel,
34
+ "data-testid": y?.menuTrigger,
35
+ children: /* @__PURE__ */ s(l, { className: "ttw:size-4" })
37
36
  })
38
- }), /* @__PURE__ */ c(r, {
37
+ }), /* @__PURE__ */ s(r, {
39
38
  align: "end",
40
- children: v
39
+ children: _
41
40
  })] }) : null,
42
- y ? /* @__PURE__ */ c(t, {
41
+ v ? /* @__PURE__ */ s(t, {
43
42
  type: "button",
44
43
  variant: "ghost",
45
44
  size: "icon",
46
45
  className: "ttw:size-8 ttw:shrink-0",
47
- "aria-label": f.closeAriaLabel,
48
- "data-testid": s.closeButton,
49
- onClick: y,
50
- children: /* @__PURE__ */ c(d, { className: "ttw:size-4" })
46
+ "aria-label": d.closeAriaLabel,
47
+ "data-testid": y?.closeButton,
48
+ onClick: v,
49
+ children: /* @__PURE__ */ s(u, { className: "ttw:size-4" })
51
50
  }) : null
52
51
  ]
53
52
  });
54
53
  }
55
54
  //#endregion
56
- export { f as CardDetailsHeader };
55
+ export { d as CardDetailsHeader };
@@ -4,166 +4,196 @@
4
4
  "use client";
5
5
  import { Button as e, Skeleton as t, cn as n } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
6
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";
8
- import { InlineErrorAlert as a } from "../../../../../shared/ui/dist/lib/InlineErrorAlert/InlineErrorAlert.js";
7
+ import { ErrorState as ee } from "../../../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
8
+ import { InlineErrorAlert as i } from "../../../../../shared/ui/dist/lib/InlineErrorAlert/InlineErrorAlert.js";
9
9
  import "../../../../../shared/ui/dist/index.js";
10
- import { cardDetailsWidgetUiTestIds as o } from "./testIds.js";
11
- import { CardDetailsHeader as s } from "./CardDetailsHeader.js";
12
- import { CARD_FACE_WIDTH_CLASS_NAME as c } from "./cardFaceSurface.js";
13
- import { CardFace as ee } from "./CardFace.js";
14
- import { DetailCopyRow as l } from "./DetailCopyRow.js";
15
- import { resolveCardDetailsPanelLabels as u } from "./labels.js";
16
- import { CardCredentialsFace as d } from "./CardCredentialsFace.js";
17
- import { CardFaceFlip as f } from "./CardFaceFlip.js";
18
- import { useMemo as p } from "react";
19
- import { jsx as m, jsxs as h } from "react/jsx-runtime";
20
- import { CheckIcon as g, CreditCardIcon as _, EyeIcon as v, EyeOffIcon as y, PowerIcon as b } from "lucide-react";
10
+ import { CardDetailsHeader as a } from "./CardDetailsHeader.js";
11
+ import { CARD_FACE_WIDTH_CLASS_NAME as te } from "./cardFaceSurface.js";
12
+ import { CardFace as ne } from "./CardFace.js";
13
+ import { DetailCopyRow as o } from "./DetailCopyRow.js";
14
+ import { resolveCardDetailsPanelLabels as s } from "./labels.js";
15
+ import { CardCredentialsFace as c } from "./CardCredentialsFace.js";
16
+ import { CardFaceFlip as l } from "./CardFaceFlip.js";
17
+ import { NicknameRow as u } from "./NicknameRow.js";
18
+ import { useMemo as d } from "react";
19
+ import { jsx as f, jsxs as p } from "react/jsx-runtime";
20
+ import { CheckIcon as re, CreditCardIcon as m, EyeIcon as h, EyeOffIcon as ie, LockIcon as ae, LockOpenIcon as oe, PowerIcon as se } from "lucide-react";
21
21
  //#region ../../libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsPanel.js
22
- function x({ labels: x, state: S, nickname: C, statusLabel: te, statusTone: ne, formFactorLabel: w, cardMenu: T, onClose: E, bankLogoSrc: D, bankLogoAlt: O, cardholderName: k, maskedCardNumber: A, programLabel: j, cardFaceStatusLabel: M, billingAddress: N, allowedCategories: P, spendLimitLabels: F, perTransactionMaxLabel: I, onCopy: L, onActivate: R, onViewCard: z, onHideCard: B, revealState: V = "hidden", revealedCardNumber: H, revealedExpirationDate: U, revealedSecurityCode: W, onRetry: G, className: K }) {
23
- let q = p(() => u(x), [x]), J = !!P?.length, Y = !!F?.length, X = !!I, Z = V === "revealed", Q = Z ? B : z, $ = /* @__PURE__ */ m(ee, {
24
- bankLogoSrc: D,
25
- bankLogoAlt: O ?? q.cardFace.bankLogoAlt,
26
- cardholderName: k ?? "",
27
- maskedCardNumber: A ?? "",
28
- programLabel: j ?? "",
29
- statusLabel: M
22
+ function g({ labels: g, state: _, nickname: v, statusLabel: ce, statusTone: le, formFactorLabel: ue, cardMenu: de, onClose: fe, bankLogoSrc: pe, bankLogoAlt: me, cardholderName: y, maskedCardNumber: b, programLabel: x, cardFaceStatusLabel: S, billingAddress: C, allowedCategories: w, spendLimitLabels: T, perTransactionMaxLabel: E, onCopy: D, onEditNickname: O, nicknameEditState: k = "closed", nicknameDraft: A, onNicknameDraftChange: j, onSaveNickname: M, onCancelNicknameEdit: N, isNicknameSaveDisabled: P, onActivate: F, onViewCard: I, onHideCard: L, revealState: R = "hidden", revealedCardNumber: z, revealedExpirationDate: he, revealedSecurityCode: ge, isLocked: B, lockState: V = "idle", onLockCard: H, onUnlockCard: U, onRetry: _e, testIds: W, className: ve }) {
23
+ let G = d(() => s(g), [g]), K = !!w?.length, q = !!T?.length, J = !!E, Y = R === "revealed", X = Y ? L : I, Z = !!(H || U), Q = B ? U : H, $ = /* @__PURE__ */ f(ne, {
24
+ bankLogoSrc: pe,
25
+ bankLogoAlt: me ?? G.cardFace.bankLogoAlt,
26
+ cardholderName: y ?? "",
27
+ maskedCardNumber: b ?? "",
28
+ programLabel: x ?? "",
29
+ statusLabel: S,
30
+ isLocked: B,
31
+ lockedLabel: G.lock.cardFaceLabel,
32
+ testIds: W?.cardFace
30
33
  });
31
- return /* @__PURE__ */ h("div", {
32
- "data-testid": o.panel,
33
- className: n("ttw:flex ttw:w-full ttw:flex-col", K),
34
- children: [/* @__PURE__ */ m(s, {
35
- labels: q.header,
36
- title: S === "loaded" ? C ?? q.header.untitledCard : void 0,
37
- isTitlePending: S === "loading",
38
- statusLabel: S === "loaded" ? te : void 0,
39
- statusTone: ne,
40
- formFactorLabel: S === "loaded" ? w : void 0,
41
- cardMenu: S === "loaded" ? T : void 0,
42
- onClose: E
43
- }), /* @__PURE__ */ m("div", {
34
+ return /* @__PURE__ */ p("div", {
35
+ "data-testid": W?.root,
36
+ className: n("ttw:flex ttw:w-full ttw:flex-col", ve),
37
+ children: [/* @__PURE__ */ f(a, {
38
+ testIds: W?.header,
39
+ labels: G.header,
40
+ title: _ === "loaded" ? v ?? G.header.untitledCard : void 0,
41
+ isTitlePending: _ === "loading",
42
+ statusLabel: _ === "loaded" ? ce : void 0,
43
+ statusTone: le,
44
+ formFactorLabel: _ === "loaded" ? ue : void 0,
45
+ cardMenu: _ === "loaded" ? de : void 0,
46
+ onClose: fe
47
+ }), /* @__PURE__ */ f("div", {
44
48
  className: "ttw:px-4 ttw:pb-4",
45
- children: S === "loading" ? /* @__PURE__ */ h("div", {
46
- "data-testid": o.loading,
49
+ children: _ === "loading" ? /* @__PURE__ */ p("div", {
50
+ "data-testid": W?.loading,
47
51
  role: "status",
48
- "aria-label": q.status.loadingAriaLabel,
52
+ "aria-label": G.status.loadingAriaLabel,
49
53
  className: "ttw:space-y-4",
50
- children: [/* @__PURE__ */ m(t, { className: "ttw:h-8 ttw:w-56" }), /* @__PURE__ */ m(t, { className: "ttw:h-64 ttw:w-full ttw:rounded-xl" })]
51
- }) : S === "error" ? /* @__PURE__ */ m(i, {
52
- title: q.status.errorTitle,
53
- description: q.status.errorDescription,
54
- retryLabel: q.status.errorRetry,
55
- onRetry: G
56
- }) : S === "notFound" ? /* @__PURE__ */ m(r, {
57
- icon: /* @__PURE__ */ m(_, { className: "ttw:size-6 ttw:text-muted-foreground" }),
58
- title: q.status.notFoundTitle,
59
- description: q.status.notFoundDescription
60
- }) : /* @__PURE__ */ h("div", {
54
+ children: [/* @__PURE__ */ f(t, { className: "ttw:h-8 ttw:w-56" }), /* @__PURE__ */ f(t, { className: "ttw:h-64 ttw:w-full ttw:rounded-xl" })]
55
+ }) : _ === "error" ? /* @__PURE__ */ f(ee, {
56
+ title: G.status.errorTitle,
57
+ description: G.status.errorDescription,
58
+ retryLabel: G.status.errorRetry,
59
+ onRetry: _e
60
+ }) : _ === "notFound" ? /* @__PURE__ */ f(r, {
61
+ icon: /* @__PURE__ */ f(m, { className: "ttw:size-6 ttw:text-muted-foreground" }),
62
+ title: G.status.notFoundTitle,
63
+ description: G.status.notFoundDescription
64
+ }) : /* @__PURE__ */ p("div", {
61
65
  className: "ttw:flex ttw:flex-col ttw:gap-4",
62
- children: [/* @__PURE__ */ h("div", {
66
+ children: [/* @__PURE__ */ p("div", {
63
67
  className: "ttw:flex ttw:flex-col ttw:overflow-hidden ttw:rounded-xl ttw:border ttw:border-border ttw:sm:flex-row",
64
- children: [/* @__PURE__ */ m("div", {
68
+ children: [/* @__PURE__ */ f("div", {
65
69
  className: "ttw:flex ttw:items-center ttw:justify-center ttw:bg-muted ttw:px-4 ttw:py-5",
66
- children: /* @__PURE__ */ h("div", {
67
- className: n("ttw:flex ttw:flex-col ttw:gap-4", c),
68
- children: [z ? /* @__PURE__ */ m(f, {
69
- isFlipped: Z,
70
+ children: /* @__PURE__ */ p("div", {
71
+ className: n("ttw:flex ttw:flex-col ttw:gap-4", te),
72
+ children: [I ? /* @__PURE__ */ f(l, {
73
+ testIds: W?.cardFaceFlip,
74
+ isFlipped: Y,
70
75
  front: $,
71
- back: /* @__PURE__ */ m(d, {
72
- labels: q.credentials,
73
- cardNumber: H,
74
- expirationDate: U,
75
- securityCode: W,
76
- onCopy: L
76
+ back: /* @__PURE__ */ f(c, {
77
+ labels: G.credentials,
78
+ cardNumber: z,
79
+ expirationDate: he,
80
+ securityCode: ge,
81
+ isLocked: B,
82
+ onCopy: D,
83
+ testIds: W?.credentialsFace
77
84
  })
78
- }) : $, R || z ? /* @__PURE__ */ h("div", {
85
+ }) : $, F || I || Z ? /* @__PURE__ */ p("div", {
79
86
  className: "ttw:flex ttw:flex-col ttw:gap-2",
80
87
  children: [
81
- R ? /* @__PURE__ */ h(e, {
88
+ F ? /* @__PURE__ */ p(e, {
82
89
  type: "button",
83
90
  className: "ttw:self-center",
84
- onClick: R,
85
- children: [/* @__PURE__ */ m(b, {
91
+ onClick: F,
92
+ children: [/* @__PURE__ */ f(se, {
86
93
  className: "ttw:size-4",
87
94
  "aria-hidden": "true"
88
- }), q.actions.activateCard]
95
+ }), G.actions.activateCard]
89
96
  }) : null,
90
- z ? /* @__PURE__ */ m("div", {
97
+ I || Z ? /* @__PURE__ */ p("div", {
91
98
  className: "ttw:flex ttw:gap-2",
92
- children: /* @__PURE__ */ h(e, {
99
+ children: [I ? /* @__PURE__ */ p(e, {
100
+ type: "button",
101
+ variant: "outline",
102
+ className: "ttw:flex-1",
103
+ disabled: !X,
104
+ loading: R === "revealing",
105
+ onClick: X,
106
+ children: [f(Y ? ie : h, {
107
+ className: "ttw:size-4",
108
+ "aria-hidden": "true"
109
+ }), Y ? G.actions.hideCard : G.actions.viewCard]
110
+ }) : null, Z ? /* @__PURE__ */ p(e, {
93
111
  type: "button",
94
112
  variant: "outline",
95
113
  className: "ttw:flex-1",
96
114
  disabled: !Q,
97
- loading: V === "revealing",
115
+ loading: V === "pending",
98
116
  onClick: Q,
99
- children: [m(Z ? y : v, {
117
+ children: [f(B ? oe : ae, {
100
118
  className: "ttw:size-4",
101
119
  "aria-hidden": "true"
102
- }), Z ? q.actions.hideCard : q.actions.viewCard]
103
- })
120
+ }), B ? G.lock.unlockCard : G.lock.lockCard]
121
+ }) : null]
122
+ }) : null,
123
+ B ? /* @__PURE__ */ f("p", {
124
+ className: "ttw:text-sm ttw:text-destructive",
125
+ children: Z ? G.lock.lockedDescription : G.lock.lockedDescriptionWithoutUnlock
104
126
  }) : null,
105
- V === "errored" ? /* @__PURE__ */ m(a, { children: q.credentials.errorDescription }) : null
127
+ V === "errored" ? /* @__PURE__ */ f(i, { children: G.lock.errorDescription }) : null,
128
+ R === "errored" ? /* @__PURE__ */ f(i, { children: G.credentials.errorDescription }) : null
106
129
  ]
107
130
  }) : null]
108
131
  })
109
- }), /* @__PURE__ */ h("div", {
132
+ }), /* @__PURE__ */ p("div", {
110
133
  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",
111
134
  children: [
112
- /* @__PURE__ */ m(l, {
113
- label: q.fields.cardholder,
114
- copyAriaLabel: k && L ? q.fields.copyCardholderAriaLabel : void 0,
115
- onCopy: k && L ? () => L(k) : void 0,
116
- children: k ?? q.fields.emptyValue
135
+ /* @__PURE__ */ f(o, {
136
+ label: G.fields.cardholder,
137
+ copyAriaLabel: y && D ? G.fields.copyCardholderAriaLabel : void 0,
138
+ onCopy: y && D ? () => D(y) : void 0,
139
+ children: y ?? G.fields.emptyValue
117
140
  }),
118
- /* @__PURE__ */ m(l, {
119
- label: q.fields.nickname,
120
- copyAriaLabel: C && L ? q.fields.copyNicknameAriaLabel : void 0,
121
- onCopy: C && L ? () => L(C) : void 0,
122
- isLast: !N,
123
- children: C ?? q.fields.emptyValue
124
- }),
125
- N ? /* @__PURE__ */ m(l, {
126
- label: q.fields.billingAddress,
127
- copyAriaLabel: L ? q.fields.copyBillingAddressAriaLabel : void 0,
128
- onCopy: L ? () => L(N) : void 0,
129
- isLast: !0,
130
- children: N
131
- }) : null
141
+ C ? /* @__PURE__ */ f(o, {
142
+ label: G.fields.billingAddress,
143
+ copyAriaLabel: D ? G.fields.copyBillingAddressAriaLabel : void 0,
144
+ onCopy: D ? () => D(C) : void 0,
145
+ children: C
146
+ }) : null,
147
+ /* @__PURE__ */ f(u, {
148
+ fieldLabels: G.fields,
149
+ labels: G.nickname,
150
+ nickname: v,
151
+ editState: k,
152
+ onEdit: O,
153
+ draft: A,
154
+ onDraftChange: j,
155
+ onSave: M,
156
+ onCancel: N,
157
+ isSaveDisabled: P,
158
+ copyAriaLabel: v && D ? G.fields.copyNicknameAriaLabel : void 0,
159
+ onCopy: v && D ? () => D(v) : void 0,
160
+ isLast: !0
161
+ })
132
162
  ]
133
163
  })]
134
- }), J || Y || X ? /* @__PURE__ */ h("div", {
164
+ }), K || q || J ? /* @__PURE__ */ p("div", {
135
165
  className: "ttw:flex ttw:flex-col ttw:overflow-hidden ttw:rounded-xl ttw:border ttw:border-border",
136
166
  children: [
137
- /* @__PURE__ */ m("h3", {
167
+ /* @__PURE__ */ f("h3", {
138
168
  className: "ttw:border-b ttw:border-border ttw:px-4 ttw:pt-4 ttw:pb-3 ttw:text-base ttw:font-semibold ttw:text-foreground",
139
- children: q.fields.cardControlsHeading
169
+ children: G.fields.cardControlsHeading
140
170
  }),
141
- J ? /* @__PURE__ */ m(l, {
142
- label: q.fields.allowedCategories,
143
- isLast: !Y && !X,
144
- children: /* @__PURE__ */ m("div", {
171
+ K ? /* @__PURE__ */ f(o, {
172
+ label: G.fields.allowedCategories,
173
+ isLast: !q && !J,
174
+ children: /* @__PURE__ */ f("div", {
145
175
  className: "ttw:mt-2 ttw:flex ttw:flex-wrap ttw:gap-2",
146
- children: P?.map((e) => /* @__PURE__ */ h("span", {
176
+ children: w?.map((e) => /* @__PURE__ */ p("span", {
147
177
  className: "ttw:inline-flex ttw:items-center ttw:gap-1.5 ttw:rounded-full ttw:border ttw:border-primary ttw:bg-primary/5 ttw:px-4 ttw:py-2 ttw:text-sm ttw:font-semibold ttw:text-primary",
148
- children: [/* @__PURE__ */ m(g, {
178
+ children: [/* @__PURE__ */ f(re, {
149
179
  "aria-hidden": "true",
150
180
  className: "ttw:size-3.5"
151
181
  }), e]
152
182
  }, e))
153
183
  })
154
184
  }) : null,
155
- Y ? /* @__PURE__ */ m(l, {
156
- label: q.fields.spendLimit,
157
- isLast: !X,
158
- children: /* @__PURE__ */ m("div", {
185
+ q ? /* @__PURE__ */ f(o, {
186
+ label: G.fields.spendLimit,
187
+ isLast: !J,
188
+ children: /* @__PURE__ */ f("div", {
159
189
  className: "ttw:flex ttw:flex-col ttw:gap-1",
160
- children: F?.map((e, t) => /* @__PURE__ */ m("div", { children: e }, `${e}-${t}`))
190
+ children: T?.map((e, t) => /* @__PURE__ */ f("div", { children: e }, `${e}-${t}`))
161
191
  })
162
192
  }) : null,
163
- X ? /* @__PURE__ */ m(l, {
164
- label: q.fields.perTransactionMax,
193
+ J ? /* @__PURE__ */ f(o, {
194
+ label: G.fields.perTransactionMax,
165
195
  isLast: !0,
166
- children: I
196
+ children: E
167
197
  }) : null
168
198
  ]
169
199
  }) : null]
@@ -172,4 +202,4 @@ function x({ labels: x, state: S, nickname: C, statusLabel: te, statusTone: ne,
172
202
  });
173
203
  }
174
204
  //#endregion
175
- export { x as CardDetailsPanel };
205
+ export { g as CardDetailsPanel };
@@ -1,39 +1,49 @@
1
1
  import { cn as e } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { cardDetailsWidgetUiTestIds as t } from "./testIds.js";
3
- import { CARD_FACE_STATUS_PILL_CLASS_NAME as n, CARD_FACE_SURFACE_CLASS_NAME as r } from "./cardFaceSurface.js";
4
- import { CardFaceGlow as i } from "./CardFaceGlow.js";
5
- import { jsx as a, jsxs as o } from "react/jsx-runtime";
2
+ import { CARD_FACE_STATUS_PILL_CLASS_NAME as t, CARD_FACE_SURFACE_CLASS_NAME as n } from "./cardFaceSurface.js";
3
+ import { CardFaceGlow as r } from "./CardFaceGlow.js";
4
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
5
+ import { LockIcon as o } from "lucide-react";
6
6
  //#region ../../libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardFace.js
7
- function s({ bankLogoSrc: s, bankLogoAlt: c, cardholderName: l, maskedCardNumber: u, programLabel: d, statusLabel: f, className: p }) {
8
- return /* @__PURE__ */ o("div", {
9
- "data-testid": t.cardFace,
10
- className: e(r, "ttw:justify-between", p),
7
+ function s({ bankLogoSrc: s, bankLogoAlt: c, cardholderName: l, maskedCardNumber: u, programLabel: d, statusLabel: f, isLocked: p, lockedLabel: m, testIds: h, className: g }) {
8
+ return /* @__PURE__ */ a("div", {
9
+ "data-testid": h?.root,
10
+ className: e(n, "ttw:justify-between", g),
11
11
  children: [
12
- /* @__PURE__ */ a(i, {}),
13
- s ? /* @__PURE__ */ a("img", {
12
+ /* @__PURE__ */ i(r, {}),
13
+ s ? /* @__PURE__ */ i("img", {
14
14
  src: s,
15
15
  alt: c,
16
16
  className: "ttw:relative ttw:h-8 ttw:w-auto ttw:max-w-[60%] ttw:object-contain ttw:object-left"
17
- }) : /* @__PURE__ */ a("span", { className: "ttw:relative ttw:h-8" }),
18
- f ? /* @__PURE__ */ a("div", {
17
+ }) : /* @__PURE__ */ i("span", { className: "ttw:relative ttw:h-8" }),
18
+ p ? /* @__PURE__ */ i("div", {
19
+ "data-testid": h?.lockedOverlay,
20
+ className: "ttw:pointer-events-none ttw:absolute ttw:inset-0 ttw:flex ttw:items-center ttw:justify-center ttw:bg-black/55",
21
+ children: m ? /* @__PURE__ */ a("span", {
22
+ className: e(t, "ttw:inline-flex ttw:items-center ttw:gap-1.5"),
23
+ children: [/* @__PURE__ */ i(o, {
24
+ className: "ttw:size-3.5",
25
+ "aria-hidden": "true"
26
+ }), m]
27
+ }) : null
28
+ }) : f ? /* @__PURE__ */ i("div", {
19
29
  className: "ttw:pointer-events-none ttw:absolute ttw:inset-0 ttw:flex ttw:items-center ttw:justify-center",
20
- children: /* @__PURE__ */ a("span", {
21
- className: n,
30
+ children: /* @__PURE__ */ i("span", {
31
+ className: t,
22
32
  children: f
23
33
  })
24
34
  }) : null,
25
- /* @__PURE__ */ o("div", {
35
+ /* @__PURE__ */ a("div", {
26
36
  className: "ttw:relative ttw:flex ttw:items-end ttw:justify-between ttw:gap-3",
27
- children: [/* @__PURE__ */ o("div", {
37
+ children: [/* @__PURE__ */ a("div", {
28
38
  className: "ttw:min-w-0",
29
- children: [/* @__PURE__ */ a("p", {
39
+ children: [/* @__PURE__ */ i("p", {
30
40
  className: "ttw:truncate ttw:text-base ttw:font-medium ttw:text-white",
31
41
  children: l
32
- }), /* @__PURE__ */ a("p", {
42
+ }), /* @__PURE__ */ i("p", {
33
43
  className: "ttw:mt-1 ttw:truncate ttw:text-lg ttw:tracking-wide ttw:text-white/90",
34
44
  children: u
35
45
  })]
36
- }), /* @__PURE__ */ a("p", {
46
+ }), /* @__PURE__ */ i("p", {
37
47
  className: "ttw:shrink-0 ttw:text-[10px] ttw:font-medium ttw:text-white/90",
38
48
  children: d
39
49
  })]
@@ -1,27 +1,26 @@
1
1
  import { cn as e } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { cardDetailsWidgetUiTestIds as t } from "./testIds.js";
3
- import { CARD_FACE_HEIGHT_CLASS_NAME as n, CARD_FACE_WIDTH_CLASS_NAME as r } from "./cardFaceSurface.js";
4
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
2
+ import { CARD_FACE_HEIGHT_CLASS_NAME as t, CARD_FACE_WIDTH_CLASS_NAME as n } from "./cardFaceSurface.js";
3
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
5
4
  //#region ../../libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardFaceFlip.js
6
- function o({ isFlipped: o, front: s, back: c, className: l }) {
7
- return /* @__PURE__ */ i("div", {
5
+ function a({ isFlipped: a, front: o, back: s, testIds: c, className: l }) {
6
+ return /* @__PURE__ */ r("div", {
8
7
  className: e("ttw:perspective-[1000px]", l),
9
- children: /* @__PURE__ */ a("div", {
10
- "data-testid": t.cardFaceFlip,
11
- className: e("ttw:relative ttw:transform-3d", n, r, "ttw:motion-safe:transition-transform ttw:motion-safe:duration-500", o && "ttw:rotate-y-180"),
12
- children: [/* @__PURE__ */ i("div", {
8
+ children: /* @__PURE__ */ i("div", {
9
+ "data-testid": c?.root,
10
+ className: e("ttw:relative ttw:transform-3d", t, n, "ttw:motion-safe:transition-transform ttw:motion-safe:duration-500", a && "ttw:rotate-y-180"),
11
+ children: [/* @__PURE__ */ r("div", {
13
12
  className: "ttw:absolute ttw:inset-0 ttw:backface-hidden",
14
- "aria-hidden": o || void 0,
15
- inert: o || void 0,
16
- children: s
17
- }), /* @__PURE__ */ i("div", {
13
+ "aria-hidden": a || void 0,
14
+ inert: a || void 0,
15
+ children: o
16
+ }), /* @__PURE__ */ r("div", {
18
17
  className: "ttw:absolute ttw:inset-0 ttw:rotate-y-180 ttw:backface-hidden",
19
- "aria-hidden": !o || void 0,
20
- inert: !o || void 0,
21
- children: c
18
+ "aria-hidden": !a || void 0,
19
+ inert: !a || void 0,
20
+ children: s
22
21
  })]
23
22
  })
24
23
  });
25
24
  }
26
25
  //#endregion
27
- export { o as CardFaceFlip };
26
+ export { a as CardFaceFlip };
@@ -2,9 +2,9 @@ import { Button as e } from "../../../../../../../packages/shared-ui-shadcn/dist
2
2
  import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
3
  import { CopyIcon as r } from "lucide-react";
4
4
  //#region ../../libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/DetailCopyRow.js
5
- function i({ label: i, children: a, copyAriaLabel: o, onCopy: s, isLast: c }) {
5
+ function i({ label: i, children: a, copyAriaLabel: o, onCopy: s, trailing: c, isLast: l }) {
6
6
  return /* @__PURE__ */ n("div", {
7
- className: "ttw:flex ttw:items-start ttw:justify-between ttw:gap-3 ttw:px-4 ttw:py-3" + (c ? "" : " ttw:border-b ttw:border-border"),
7
+ className: "ttw:flex ttw:items-start ttw:justify-between ttw:gap-3 ttw:px-4 ttw:py-3" + (l ? "" : " ttw:border-b ttw:border-border"),
8
8
  children: [/* @__PURE__ */ n("div", {
9
9
  className: "ttw:min-w-0 ttw:space-y-1",
10
10
  children: [/* @__PURE__ */ t("p", {
@@ -14,7 +14,7 @@ function i({ label: i, children: a, copyAriaLabel: o, onCopy: s, isLast: c }) {
14
14
  className: "ttw:text-sm ttw:text-foreground",
15
15
  children: a
16
16
  })]
17
- }), o && s ? /* @__PURE__ */ t(e, {
17
+ }), c ?? (o && s ? /* @__PURE__ */ t(e, {
18
18
  type: "button",
19
19
  variant: "ghost",
20
20
  size: "icon",
@@ -22,7 +22,7 @@ function i({ label: i, children: a, copyAriaLabel: o, onCopy: s, isLast: c }) {
22
22
  "aria-label": o,
23
23
  onClick: s,
24
24
  children: /* @__PURE__ */ t(r, { className: "ttw:size-4" })
25
- }) : null]
25
+ }) : null)]
26
26
  });
27
27
  }
28
28
  //#endregion
@@ -0,0 +1,65 @@
1
+ import { Button as e, Input as t, cn as n } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { InlineErrorAlert as r } from "../../../../../shared/ui/dist/lib/InlineErrorAlert/InlineErrorAlert.js";
3
+ import "../../../../../shared/ui/dist/index.js";
4
+ import { DetailCopyRow as i } from "./DetailCopyRow.js";
5
+ import { useEffect as a, useRef as o } from "react";
6
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
7
+ import { SquarePenIcon as l } from "lucide-react";
8
+ //#region ../../libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/NicknameRow.js
9
+ function u({ fieldLabels: u, labels: d, nickname: f, editState: p, onEdit: m, draft: h = "", onDraftChange: g, onSave: _, onCancel: v, isSaveDisabled: y, onCopy: b, copyAriaLabel: x, isLast: S }) {
10
+ let C = p !== "closed", w = o(null);
11
+ return a(() => {
12
+ C && w.current?.focus();
13
+ }, [C]), m && C ? /* @__PURE__ */ c("div", {
14
+ className: n("ttw:flex ttw:flex-col ttw:gap-2 ttw:px-4 ttw:py-3", !S && "ttw:border-b ttw:border-border"),
15
+ children: [
16
+ /* @__PURE__ */ s("p", {
17
+ className: "ttw:text-sm ttw:font-medium ttw:text-foreground",
18
+ children: u.nickname
19
+ }),
20
+ /* @__PURE__ */ s(t, {
21
+ ref: w,
22
+ value: h,
23
+ "aria-label": d.inputAriaLabel,
24
+ disabled: p === "saving",
25
+ onChange: (e) => g?.(e.target.value)
26
+ }),
27
+ /* @__PURE__ */ c("div", {
28
+ className: "ttw:flex ttw:gap-2",
29
+ children: [/* @__PURE__ */ s(e, {
30
+ type: "button",
31
+ size: "sm",
32
+ disabled: y,
33
+ loading: p === "saving",
34
+ onClick: _,
35
+ children: d.save
36
+ }), /* @__PURE__ */ s(e, {
37
+ type: "button",
38
+ size: "sm",
39
+ variant: "outline",
40
+ disabled: p === "saving",
41
+ onClick: v,
42
+ children: d.cancel
43
+ })]
44
+ }),
45
+ p === "errored" ? /* @__PURE__ */ s(r, { children: d.errorDescription }) : null
46
+ ]
47
+ }) : /* @__PURE__ */ s(i, {
48
+ label: u.nickname,
49
+ copyAriaLabel: x,
50
+ onCopy: b,
51
+ trailing: m ? /* @__PURE__ */ s(e, {
52
+ type: "button",
53
+ variant: "ghost",
54
+ size: "icon",
55
+ className: "ttw:size-8 ttw:shrink-0 ttw:text-muted-foreground",
56
+ "aria-label": d.editAriaLabel,
57
+ onClick: m,
58
+ children: /* @__PURE__ */ s(l, { className: "ttw:size-4" })
59
+ }) : void 0,
60
+ isLast: S,
61
+ children: f ?? u.emptyValue
62
+ });
63
+ }
64
+ //#endregion
65
+ export { u as NicknameRow };