@tesouro/embedded-components-react 0.11.59 → 0.11.61

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 (105) hide show
  1. package/README.md +37 -37
  2. package/dist/index.css +77 -230
  3. package/dist/index.d.ts +69 -23
  4. package/dist/lib/BankAccountsWidget.d.ts +20 -7
  5. package/dist/lib/CardDetailsWidget.d.ts +11 -3
  6. package/dist/lib/CreditCardsWidget.d.ts +19 -6
  7. package/dist/lib/DebitCardsWidget.d.ts +19 -6
  8. package/dist/lib/LinkedAccountsWidget.d.ts +30 -10
  9. package/dist/lib/WidgetSuite.d.ts +69 -23
  10. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/data-access/dist/index.js +5 -5
  11. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/data-access/dist/index3.js +21 -26
  12. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/data-access/dist/index4.js +18 -16
  13. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/data-access/dist/index5.js +22 -35
  14. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/data-access/dist/index6.js +29 -14
  15. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/data-access/dist/index7.js +20 -24
  16. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/data-access/dist/index8.js +31 -0
  17. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/feature/dist/index.js +2 -2
  18. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/feature/dist/index10.js +296 -0
  19. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/feature/dist/index12.js +1 -0
  20. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/feature/dist/index5.js +5 -10
  21. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/feature/dist/index9.js +42 -281
  22. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/ui/dist/index.js +5 -3
  23. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/ui/dist/index10.js +180 -0
  24. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/ui/dist/index2.js +16 -184
  25. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/ui/dist/index3.js +9 -93
  26. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/ui/dist/index4.js +136 -81
  27. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/ui/dist/index5.js +64 -101
  28. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/ui/dist/index6.js +54 -81
  29. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/ui/dist/index7.js +90 -65
  30. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/ui/dist/index8.js +108 -183
  31. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/ui/dist/index9.js +76 -0
  32. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/lib/BankAccountsWidget/BankAccountsWidget.js +1 -1
  33. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/lib/labels.js +6 -8
  34. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/lib/useBankAccountsWidget.js +137 -120
  35. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/mocks/labels.js +5 -5
  36. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/ui/dist/lib/AccountCard.js +47 -60
  37. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/ui/dist/lib/BankAccountsWidgetUi.js +71 -72
  38. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/ui/dist/lib/BankingHeader.js +22 -37
  39. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/ui/dist/lib/CreateAccountDialog.js +119 -133
  40. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/ui/dist/lib/labels.js +12 -8
  41. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/lib/CardDetailsWidget.js +112 -110
  42. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/lib/cardDetailsView.js +1 -0
  43. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/index.js +0 -2
  44. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/ActivateCardPanel/ActivateCardPanel.js +94 -83
  45. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/ActivateCardPanel/ActivateCardSuccessView.js +32 -31
  46. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/ActivateCardPanel/labels.js +5 -2
  47. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardCredentialRow.js +41 -23
  48. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardCredentialsFace.js +3 -0
  49. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsHeader.js +30 -25
  50. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsPanel.js +162 -190
  51. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardFace.js +2 -2
  52. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CopyButton.js +35 -0
  53. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CopyableValue.js +18 -0
  54. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/NicknameEditor.js +43 -0
  55. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/cardFaceSurface.js +1 -1
  56. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/labels.js +12 -8
  57. package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/feature/dist/index5.js +3 -3
  58. package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/feature/dist/index8.js +110 -104
  59. package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/ui/dist/lib/CreateCardWidget/CreateCardWidget.js +74 -68
  60. package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/ui/dist/lib/CreateCardWidget/PreparingView.js +19 -18
  61. package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/ui/dist/lib/CreateCardWidget/SetupView.js +110 -108
  62. package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/ui/dist/lib/CreateCardWidget/SuccessView.js +33 -42
  63. package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/ui/dist/lib/CreateCardWidget/labels.js +10 -7
  64. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/lib/labels.js +1 -0
  65. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/lib/testIds.js +2 -6
  66. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/lib/useCardsWidget.js +159 -145
  67. package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/index.js +0 -1
  68. package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardsList.js +255 -112
  69. package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardsListDetailsSheet.js +1 -1
  70. package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/labels.js +4 -4
  71. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/LinkedAccountsWidget.js +1 -1
  72. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/labels.js +9 -7
  73. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/rows.js +46 -27
  74. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/useAdminEligibleUserIds.js +3 -2
  75. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/useLinkedAccountsWidget.js +248 -224
  76. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/mocks/labels.js +5 -5
  77. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index.js +2 -2
  78. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index10.js +22 -36
  79. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index11.js +23 -70
  80. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index12.js +91 -27
  81. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index13.js +80 -63
  82. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index14.js +145 -125
  83. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index2.js +61 -9
  84. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index3.js +77 -50
  85. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index4.js +180 -65
  86. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index5.js +22 -178
  87. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index6.js +6 -75
  88. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index7.js +48 -11
  89. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index8.js +45 -7
  90. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index9.js +8 -82
  91. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  92. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/index.js +15 -14
  93. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/AddTile/AddTile.js +17 -0
  94. package/dist/packages/shared-ui-shadcn/dist/index.js +3603 -3518
  95. package/package.json +1 -1
  96. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/feature/dist/index11.js +0 -1
  97. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/AddressLine.js +0 -22
  98. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/DetailCopyRow.js +0 -28
  99. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/NicknameRow.js +0 -64
  100. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/statusBadge.js +0 -11
  101. package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardFaceSwatch.js +0 -11
  102. package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardsListRow.js +0 -103
  103. package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/statusBadge.js +0 -11
  104. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index15.js +0 -67
  105. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index16.js +0 -138
@@ -2,30 +2,71 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { Button as e, Skeleton as t, cn as n } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
6
- import { EmptyState as ee } from "../../../../../shared/ui/dist/lib/EmptyState/EmptyState.js";
7
- import { ErrorState as r } from "../../../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
8
- import { InlineErrorAlert as i } from "../../../../../shared/ui/dist/lib/InlineErrorAlert/InlineErrorAlert.js";
5
+ import { Alert as e, AlertDescription as t, Badge as n, Button as r, DescriptionList as i, Heading as a, Skeleton as o, cn as s } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
6
+ import { EmptyState as c } from "../../../../../shared/ui/dist/lib/EmptyState/EmptyState.js";
7
+ import { ErrorState as l } from "../../../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
8
+ import { LoadingRegion as u } from "../../../../../shared/ui/dist/lib/LoadingRegion/LoadingRegion.js";
9
+ import { InlineErrorAlert as d } from "../../../../../shared/ui/dist/lib/InlineErrorAlert/InlineErrorAlert.js";
9
10
  import "../../../../../shared/ui/dist/index.js";
10
- import { CardDetailsHeader as te } from "./CardDetailsHeader.js";
11
- import { CARD_FACE_WIDTH_CLASS_NAME as ne } from "./cardFaceSurface.js";
12
- import { CardFace as a } from "./CardFace.js";
13
- import { DetailCopyRow as o } from "./DetailCopyRow.js";
14
- import { resolveCardDetailsPanelLabels as s } from "./labels.js";
15
- import { AddressLine as c } from "./AddressLine.js";
16
- import { CardCredentialsFace as re } from "./CardCredentialsFace.js";
17
- import { CardFaceFlip as ie } from "./CardFaceFlip.js";
18
- import { NicknameRow as ae } from "./NicknameRow.js";
19
- import { useMemo as oe } from "react";
20
- import { jsx as l, jsxs as u } from "react/jsx-runtime";
21
- import { CheckIcon as d, CreditCardIcon as f, EyeIcon as p, EyeOffIcon as m, LockIcon as h, LockOpenIcon as se, PowerIcon as ce } from "lucide-react";
11
+ import { CardDetailsHeader as ee } from "./CardDetailsHeader.js";
12
+ import { CARD_FACE_WIDTH_CLASS_NAME as te } from "./cardFaceSurface.js";
13
+ import { CardFace as ne } from "./CardFace.js";
14
+ import { resolveCardDetailsPanelLabels as re } from "./labels.js";
15
+ import { CardCredentialsFace as ie } from "./CardCredentialsFace.js";
16
+ import { CardFaceFlip as ae } from "./CardFaceFlip.js";
17
+ import { CopyableValue as f } from "./CopyableValue.js";
18
+ import { NicknameEditor as oe } from "./NicknameEditor.js";
19
+ import { useMemo as se } from "react";
20
+ import { jsx as p, jsxs as m } from "react/jsx-runtime";
21
+ import { CircleAlertIcon as h, CreditCardIcon as g } from "lucide-react";
22
22
  // ../../libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsPanel.js
23
- function g({ labels: g, state: _, nickname: v, statusLabel: le, statusTone: ue, formFactorLabel: de, cardMenu: fe, onClose: pe, cardArtSrc: me, bankLogoSrc: he, bankLogoAlt: ge, cardholderName: y, maskedCardNumber: _e, programLabel: ve, cardFaceStatusLabel: ye, billingAddress: b, allowedCategories: x, spendLimitLabels: S, perTransactionMaxLabel: C, onCopy: w, onEditNickname: T, nicknameEditState: E = "closed", nicknameDraft: D, onNicknameDraftChange: O, onSaveNickname: k, onCancelNicknameEdit: A, isNicknameSaveDisabled: j, onActivate: M, onViewCard: N, onHideCard: P, revealState: F = "hidden", revealedCardNumber: be, revealedExpirationDate: xe, revealedSecurityCode: Se, isLocked: I, lockState: L = "idle", onLockCard: R, onUnlockCard: z, onRetry: Ce, testIds: B, className: we }) {
24
- let V = oe(() => s(g), [g]), H = b?.addressLine1, U = b?.addressLine2, W = b?.cityState, G = b?.postalCode, Te = !!(H || U || W || G), K = !!x?.length, q = !!S?.length, J = !!C, Y = F === "revealed", X = Y ? P : N, Z = !!(R || z), Q = I ? z : R, $ = /* @__PURE__ */ l(a, {
25
- cardArtSrc: me,
26
- bankLogoSrc: he,
27
- bankLogoAlt: ge ?? V.cardFace.bankLogoAlt,
28
- cardholderName: y ?? "",
23
+ function _({ labels: _, state: v, nickname: y, statusLabel: ce, statusTone: le, formFactorLabel: ue, cardMenu: de, onClose: fe, cardArtSrc: pe, bankLogoSrc: me, bankLogoAlt: he, cardholderName: ge, maskedCardNumber: _e, programLabel: ve, cardFaceStatusLabel: ye, billingAddress: b, allowedCategories: x, spendLimitLabels: S, perTransactionMaxLabel: C, onCopy: w, onEditNickname: T, nicknameEditState: E = "closed", nicknameDraft: D, onNicknameDraftChange: O, onSaveNickname: k, onCancelNicknameEdit: A, isNicknameSaveDisabled: j, onActivate: M, onViewCard: N, onHideCard: P, revealState: F = "hidden", revealedCardNumber: be, revealedExpirationDate: xe, revealedSecurityCode: Se, isLocked: I, lockState: L = "idle", onLockCard: R, onUnlockCard: z, onRetry: Ce, testIds: B, className: we }) {
24
+ let V = se(() => re(_), [_]), H = b?.addressLine1, U = b?.addressLine2, W = b?.cityState, G = b?.postalCode, Te = !!(H || U || W || G), Ee = !!x?.length, De = !!S?.length, Oe = !!C, K = F === "revealed", q = K ? P : N, J = !!(R || z), Y = I ? z : R, ke = V.fields.copiedLabel, X = [
25
+ H,
26
+ U,
27
+ W,
28
+ G
29
+ ].filter((e) => !!e), Z = Te ? [{
30
+ label: V.fields.billingAddress,
31
+ value: /* @__PURE__ */ p(f, {
32
+ copyLabel: V.fields.copyBillingAddressAriaLabel,
33
+ copiedLabel: ke,
34
+ onCopy: w ? () => w(X.join("\n")) : void 0,
35
+ children: /* @__PURE__ */ p("span", {
36
+ className: "ttw:flex ttw:flex-col",
37
+ children: X.map((e, t) => /* @__PURE__ */ p("span", { children: e }, t))
38
+ })
39
+ })
40
+ }] : [], Q = [
41
+ ...Ee ? [{
42
+ label: V.fields.allowedCategories,
43
+ value: /* @__PURE__ */ p("span", {
44
+ className: "ttw:flex ttw:flex-wrap ttw:gap-2",
45
+ children: x?.map((e) => /* @__PURE__ */ p(n, {
46
+ tone: "neutral",
47
+ children: e
48
+ }, e))
49
+ })
50
+ }] : [],
51
+ ...De ? [{
52
+ label: V.fields.spendLimit,
53
+ value: /* @__PURE__ */ p("span", {
54
+ className: "ttw:flex ttw:flex-col ttw:gap-1 ttw:tabular-nums",
55
+ children: S?.map((e, t) => /* @__PURE__ */ p("span", { children: e }, `${e}-${t}`))
56
+ })
57
+ }] : [],
58
+ ...Oe ? [{
59
+ label: V.fields.perTransactionMax,
60
+ value: /* @__PURE__ */ p("span", {
61
+ className: "ttw:tabular-nums",
62
+ children: C
63
+ })
64
+ }] : []
65
+ ], $ = /* @__PURE__ */ p(ne, {
66
+ cardArtSrc: pe,
67
+ bankLogoSrc: me,
68
+ bankLogoAlt: he ?? V.cardFace.bankLogoAlt,
69
+ cardholderName: ge ?? "",
29
70
  maskedCardNumber: _e ?? "",
30
71
  programLabel: ve ?? "",
31
72
  statusLabel: ye,
@@ -33,196 +74,127 @@ function g({ labels: g, state: _, nickname: v, statusLabel: le, statusTone: ue,
33
74
  lockedLabel: V.lock.cardFaceLabel,
34
75
  testIds: B?.cardFace
35
76
  });
36
- return /* @__PURE__ */ u("div", {
77
+ return /* @__PURE__ */ m("div", {
37
78
  "data-testid": B?.root,
38
- className: n("ttw:flex ttw:w-full ttw:flex-col", we),
39
- children: [/* @__PURE__ */ l(te, {
79
+ className: s("ttw:@container/card-details ttw:flex ttw:w-full ttw:max-w-[720px] ttw:flex-col", we),
80
+ children: [/* @__PURE__ */ p(ee, {
40
81
  testIds: B?.header,
41
82
  labels: V.header,
42
- title: _ === "loaded" ? v ?? V.header.untitledCard : void 0,
43
- isTitlePending: _ === "loading",
44
- statusLabel: _ === "loaded" ? le : void 0,
45
- statusTone: ue,
46
- formFactorLabel: _ === "loaded" ? de : void 0,
47
- cardMenu: _ === "loaded" ? fe : void 0,
48
- onClose: pe
49
- }), /* @__PURE__ */ l("div", {
50
- className: "ttw:px-4 ttw:pb-4",
51
- children: _ === "loading" ? /* @__PURE__ */ u("div", {
83
+ title: v === "loaded" ? y ?? V.header.untitledCard : void 0,
84
+ isTitlePending: v === "loading",
85
+ statusLabel: v === "loaded" ? ce : void 0,
86
+ statusTone: le,
87
+ formFactorLabel: v === "loaded" ? ue : void 0,
88
+ cardMenu: v === "loaded" ? de : void 0,
89
+ onClose: fe,
90
+ titleAction: v === "loaded" && T && E === "closed" ? /* @__PURE__ */ p(r, {
91
+ type: "button",
92
+ variant: "link",
93
+ size: "sm",
94
+ className: "ttw:shrink-0",
95
+ "aria-label": V.nickname.editAriaLabel,
96
+ onClick: T,
97
+ children: V.nickname.edit
98
+ }) : void 0
99
+ }), /* @__PURE__ */ p("div", {
100
+ className: "ttw:px-4 ttw:pb-6 ttw:@md/card-details:px-6",
101
+ children: v === "loading" ? /* @__PURE__ */ m(u, {
102
+ isLoading: !0,
103
+ loadingLabel: V.status.loadingAriaLabel,
52
104
  "data-testid": B?.loading,
53
- role: "status",
54
- "aria-label": V.status.loadingAriaLabel,
55
105
  className: "ttw:space-y-4",
56
- children: [/* @__PURE__ */ l(t, { className: "ttw:h-8 ttw:w-56" }), /* @__PURE__ */ l(t, { className: "ttw:h-64 ttw:w-full ttw:rounded-xl" })]
57
- }) : _ === "error" ? /* @__PURE__ */ l(r, {
106
+ children: [/* @__PURE__ */ p(o, { className: "ttw:h-8 ttw:w-56" }), /* @__PURE__ */ p(o, { className: "ttw:h-64 ttw:w-full ttw:rounded-lg" })]
107
+ }) : v === "error" ? /* @__PURE__ */ p(l, {
58
108
  title: V.status.errorTitle,
59
109
  description: V.status.errorDescription,
60
110
  retryLabel: V.status.errorRetry,
61
111
  onRetry: Ce
62
- }) : _ === "notFound" ? /* @__PURE__ */ l(ee, {
63
- icon: /* @__PURE__ */ l(f, { className: "ttw:size-6 ttw:text-muted-foreground" }),
112
+ }) : v === "notFound" ? /* @__PURE__ */ p(c, {
113
+ icon: /* @__PURE__ */ p(g, {}),
64
114
  title: V.status.notFoundTitle,
65
115
  description: V.status.notFoundDescription
66
- }) : /* @__PURE__ */ u("div", {
116
+ }) : /* @__PURE__ */ m("div", {
67
117
  className: "ttw:flex ttw:flex-col ttw:gap-4",
68
- children: [/* @__PURE__ */ u("div", {
69
- className: "ttw:flex ttw:flex-col ttw:overflow-hidden ttw:rounded-xl ttw:border ttw:border-border ttw:sm:flex-row",
70
- children: [/* @__PURE__ */ l("div", {
71
- className: "ttw:flex ttw:items-center ttw:justify-center ttw:bg-muted ttw:px-4 ttw:py-5",
72
- children: /* @__PURE__ */ u("div", {
73
- className: n("ttw:flex ttw:flex-col ttw:gap-4", ne),
74
- children: [N ? /* @__PURE__ */ l(ie, {
75
- testIds: B?.cardFaceFlip,
76
- isFlipped: Y,
77
- front: $,
78
- back: /* @__PURE__ */ l(re, {
79
- labels: V.credentials,
80
- cardNumber: be,
81
- expirationDate: xe,
82
- securityCode: Se,
83
- isLocked: I,
84
- onCopy: w,
85
- testIds: B?.credentialsFace
86
- })
87
- }) : $, M || N || Z ? /* @__PURE__ */ u("div", {
88
- className: "ttw:flex ttw:flex-col ttw:gap-2",
118
+ children: [
119
+ T && E !== "closed" ? /* @__PURE__ */ p(oe, {
120
+ labels: V.nickname,
121
+ editState: E,
122
+ onEdit: T,
123
+ draft: D,
124
+ onDraftChange: O,
125
+ onSave: k,
126
+ onCancel: A,
127
+ isSaveDisabled: j
128
+ }) : null,
129
+ /* @__PURE__ */ m("div", {
130
+ className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:@xl/card-details:flex-row ttw:@xl/card-details:items-start",
131
+ children: [/* @__PURE__ */ p("div", {
132
+ className: "ttw:flex ttw:justify-center ttw:rounded-lg ttw:bg-muted ttw:p-4 ttw:@xl/card-details:shrink-0",
133
+ children: /* @__PURE__ */ m("div", {
134
+ className: s("ttw:flex ttw:flex-col ttw:gap-2", te),
89
135
  children: [
90
- M ? /* @__PURE__ */ u(e, {
136
+ N ? /* @__PURE__ */ p(ae, {
137
+ testIds: B?.cardFaceFlip,
138
+ isFlipped: K,
139
+ front: $,
140
+ back: /* @__PURE__ */ p(ie, {
141
+ labels: V.credentials,
142
+ cardNumber: be,
143
+ expirationDate: xe,
144
+ securityCode: Se,
145
+ isLocked: I,
146
+ onCopy: w,
147
+ testIds: B?.credentialsFace
148
+ })
149
+ }) : $,
150
+ M ? /* @__PURE__ */ p(r, {
91
151
  type: "button",
92
- className: "ttw:self-center",
152
+ className: "ttw:mt-2 ttw:w-full",
93
153
  onClick: M,
94
- children: [/* @__PURE__ */ l(ce, {
95
- className: "ttw:size-4",
96
- "aria-hidden": "true"
97
- }), V.actions.activateCard]
154
+ children: V.actions.activateCard
98
155
  }) : null,
99
- N || Z ? /* @__PURE__ */ u("div", {
100
- className: "ttw:flex ttw:gap-2",
101
- children: [N ? /* @__PURE__ */ u(e, {
102
- type: "button",
103
- variant: "outline",
104
- className: "ttw:flex-1",
105
- disabled: !X,
106
- loading: F === "revealing",
107
- onClick: X,
108
- children: [l(Y ? m : p, {
109
- className: "ttw:size-4",
110
- "aria-hidden": "true"
111
- }), Y ? V.actions.hideCard : V.actions.viewCard]
112
- }) : null, Z ? /* @__PURE__ */ u(e, {
113
- type: "button",
114
- variant: "outline",
115
- className: "ttw:flex-1",
116
- disabled: !Q,
117
- loading: L === "pending",
118
- onClick: Q,
119
- children: [l(I ? se : h, {
120
- className: "ttw:size-4",
121
- "aria-hidden": "true"
122
- }), I ? V.lock.unlockCard : V.lock.lockCard]
123
- }) : null]
156
+ N ? /* @__PURE__ */ p(r, {
157
+ type: "button",
158
+ variant: "ghost",
159
+ className: "ttw:w-full",
160
+ disabled: !q,
161
+ loading: F === "revealing",
162
+ onClick: q,
163
+ children: K ? V.actions.hideCard : V.actions.viewCard
124
164
  }) : null,
125
- I ? /* @__PURE__ */ l("p", {
126
- className: "ttw:text-sm ttw:text-destructive",
127
- children: Z ? V.lock.lockedDescription : V.lock.lockedDescriptionWithoutUnlock
165
+ J ? /* @__PURE__ */ p(r, {
166
+ type: "button",
167
+ variant: "outline",
168
+ className: "ttw:w-full",
169
+ disabled: !Y,
170
+ loading: L === "pending",
171
+ onClick: Y,
172
+ children: I ? V.lock.unlockCard : V.lock.lockCard
173
+ }) : null,
174
+ I ? /* @__PURE__ */ m(e, {
175
+ variant: "destructive",
176
+ children: [/* @__PURE__ */ p(h, { "aria-hidden": "true" }), /* @__PURE__ */ p(t, { children: J ? V.lock.lockedDescription : V.lock.lockedDescriptionWithoutUnlock })]
128
177
  }) : null,
129
- L === "errored" ? /* @__PURE__ */ l(i, { children: V.lock.errorDescription }) : null,
130
- F === "errored" ? /* @__PURE__ */ l(i, { children: V.credentials.errorDescription }) : null
178
+ L === "errored" ? /* @__PURE__ */ p(d, { children: V.lock.errorDescription }) : null,
179
+ F === "errored" ? /* @__PURE__ */ p(d, { children: V.credentials.errorDescription }) : null
131
180
  ]
132
- }) : null]
133
- })
134
- }), /* @__PURE__ */ u("div", {
135
- 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",
136
- children: [
137
- /* @__PURE__ */ l(o, {
138
- label: V.fields.cardholder,
139
- copyAriaLabel: y && w ? V.fields.copyCardholderAriaLabel : void 0,
140
- onCopy: y && w ? () => w(y) : void 0,
141
- children: y ?? V.fields.emptyValue
142
- }),
143
- Te ? /* @__PURE__ */ l(o, {
144
- label: V.fields.billingAddress,
145
- children: /* @__PURE__ */ u("div", {
146
- className: "ttw:flex ttw:flex-col",
147
- children: [
148
- H ? /* @__PURE__ */ l(c, {
149
- value: H,
150
- copyAriaLabel: w ? V.fields.copyBillingAddressLine1AriaLabel : void 0,
151
- onCopy: w ? () => w(H) : void 0
152
- }) : null,
153
- U ? /* @__PURE__ */ l(c, {
154
- value: U,
155
- copyAriaLabel: w ? V.fields.copyBillingAddressLine2AriaLabel : void 0,
156
- onCopy: w ? () => w(U) : void 0
157
- }) : null,
158
- W ? /* @__PURE__ */ l(c, {
159
- value: W,
160
- copyAriaLabel: w ? V.fields.copyBillingAddressCityStateAriaLabel : void 0,
161
- onCopy: w ? () => w(W) : void 0
162
- }) : null,
163
- G ? /* @__PURE__ */ l(c, {
164
- value: G,
165
- copyAriaLabel: w ? V.fields.copyBillingAddressPostalCodeAriaLabel : void 0,
166
- onCopy: w ? () => w(G) : void 0
167
- }) : null
168
- ]
169
- })
170
- }) : null,
171
- /* @__PURE__ */ l(ae, {
172
- fieldLabels: V.fields,
173
- labels: V.nickname,
174
- nickname: v,
175
- editState: E,
176
- onEdit: T,
177
- draft: D,
178
- onDraftChange: O,
179
- onSave: k,
180
- onCancel: A,
181
- isSaveDisabled: j,
182
- copyAriaLabel: v && w ? V.fields.copyNicknameAriaLabel : void 0,
183
- onCopy: v && w ? () => w(v) : void 0,
184
- isLast: !0
185
181
  })
186
- ]
187
- })]
188
- }), K || q || J ? /* @__PURE__ */ u("div", {
189
- className: "ttw:flex ttw:flex-col ttw:overflow-hidden ttw:rounded-xl ttw:border ttw:border-border",
190
- children: [
191
- /* @__PURE__ */ l("h3", {
192
- 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",
182
+ }), Z.length > 0 ? /* @__PURE__ */ p("div", {
183
+ className: "ttw:min-w-0 ttw:flex-1",
184
+ children: /* @__PURE__ */ p(i, { items: Z })
185
+ }) : null]
186
+ }),
187
+ Q.length > 0 ? /* @__PURE__ */ m("section", {
188
+ className: "ttw:flex ttw:flex-col ttw:gap-2",
189
+ children: [/* @__PURE__ */ p(a, {
190
+ variant: "card",
191
+ level: 3,
193
192
  children: V.fields.cardControlsHeading
194
- }),
195
- K ? /* @__PURE__ */ l(o, {
196
- label: V.fields.allowedCategories,
197
- isLast: !q && !J,
198
- children: /* @__PURE__ */ l("div", {
199
- className: "ttw:mt-2 ttw:flex ttw:flex-wrap ttw:gap-2",
200
- children: x?.map((e) => /* @__PURE__ */ u("span", {
201
- 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",
202
- children: [/* @__PURE__ */ l(d, {
203
- "aria-hidden": "true",
204
- className: "ttw:size-3.5"
205
- }), e]
206
- }, e))
207
- })
208
- }) : null,
209
- q ? /* @__PURE__ */ l(o, {
210
- label: V.fields.spendLimit,
211
- isLast: !J,
212
- children: /* @__PURE__ */ l("div", {
213
- className: "ttw:flex ttw:flex-col ttw:gap-1",
214
- children: S?.map((e, t) => /* @__PURE__ */ l("div", { children: e }, `${e}-${t}`))
215
- })
216
- }) : null,
217
- J ? /* @__PURE__ */ l(o, {
218
- label: V.fields.perTransactionMax,
219
- isLast: !0,
220
- children: C
221
- }) : null
222
- ]
223
- }) : null]
193
+ }), /* @__PURE__ */ p(i, { items: Q })]
194
+ }) : null
195
+ ]
224
196
  })
225
197
  })]
226
198
  });
227
199
  }
228
- export { g as CardDetailsPanel };
200
+ export { _ as CardDetailsPanel };
@@ -43,9 +43,9 @@ function s({ cardArtSrc: s, bankLogoSrc: c, bankLogoAlt: l, cardholderName: u, m
43
43
  })
44
44
  }) : null,
45
45
  /* @__PURE__ */ a("div", {
46
- className: "ttw:relative ttw:flex ttw:items-end ttw:justify-between ttw:gap-3",
46
+ className: "ttw:relative ttw:flex ttw:flex-wrap ttw:items-end ttw:justify-between ttw:gap-x-3 ttw:gap-y-1",
47
47
  children: [/* @__PURE__ */ a("div", {
48
- className: "ttw:min-w-0",
48
+ className: "ttw:min-w-0 ttw:max-w-full ttw:flex-auto",
49
49
  children: [/* @__PURE__ */ i("p", {
50
50
  className: "ttw:truncate ttw:text-base ttw:font-medium ttw:text-white",
51
51
  children: u
@@ -0,0 +1,35 @@
1
+ import { Button as e, Tooltip as t, TooltipContent as n, TooltipProvider as r, TooltipTrigger as i, cn as a } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { useEffect as o, useState as s } from "react";
3
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
4
+ import { CheckIcon as u, CopyIcon as d } from "lucide-react";
5
+ // ../../libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CopyButton.js
6
+ var f = 2e3;
7
+ function p({ label: p, copiedLabel: m, onCopy: h, className: g }) {
8
+ let [_, v] = s(!1);
9
+ return o(() => {
10
+ if (!_) return;
11
+ let e = setTimeout(() => v(!1), f);
12
+ return () => clearTimeout(e);
13
+ }, [_]), /* @__PURE__ */ l(r, { children: [/* @__PURE__ */ l(t, { children: [/* @__PURE__ */ c(i, {
14
+ asChild: !0,
15
+ children: /* @__PURE__ */ c(e, {
16
+ type: "button",
17
+ variant: "ghost",
18
+ size: "icon-sm",
19
+ "aria-label": p,
20
+ className: a("ttw:shrink-0 ttw:text-muted-foreground", g),
21
+ onClick: async () => {
22
+ await h() !== !1 && v(!0);
23
+ },
24
+ children: c(_ ? u : d, {
25
+ "aria-hidden": !0,
26
+ className: "ttw:size-4"
27
+ })
28
+ })
29
+ }), /* @__PURE__ */ c(n, { children: _ ? m : p })] }), /* @__PURE__ */ c("span", {
30
+ role: "status",
31
+ className: "ttw:sr-only",
32
+ children: _ ? m : ""
33
+ })] });
34
+ }
35
+ export { p as CopyButton };
@@ -0,0 +1,18 @@
1
+ import { CopyButton as e } from "./CopyButton.js";
2
+ import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
+ // ../../libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CopyableValue.js
4
+ function r({ children: r, copyLabel: i, copiedLabel: a, onCopy: o }) {
5
+ return /* @__PURE__ */ n("span", {
6
+ className: "ttw:flex ttw:min-w-0 ttw:items-center ttw:gap-1",
7
+ children: [/* @__PURE__ */ t("span", {
8
+ className: "ttw:min-w-0 ttw:break-words",
9
+ children: r
10
+ }), i && o ? /* @__PURE__ */ t(e, {
11
+ label: i,
12
+ copiedLabel: a,
13
+ onCopy: o,
14
+ className: "ttw:-my-1.5"
15
+ }) : null]
16
+ });
17
+ }
18
+ export { r as CopyableValue };
@@ -0,0 +1,43 @@
1
+ import { Button as e, Input as t } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { InlineErrorAlert as n } from "../../../../../shared/ui/dist/lib/InlineErrorAlert/InlineErrorAlert.js";
3
+ import "../../../../../shared/ui/dist/index.js";
4
+ import { useEffect as r, useRef as i } from "react";
5
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
6
+ // ../../libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/NicknameEditor.js
7
+ function s({ labels: s, editState: c, onEdit: l, draft: u = "", onDraftChange: d, onSave: f, onCancel: p, isSaveDisabled: m }) {
8
+ let h = c !== "closed", g = i(null);
9
+ return r(() => {
10
+ h && g.current?.focus();
11
+ }, [h]), l && h ? /* @__PURE__ */ o("span", {
12
+ className: "ttw:flex ttw:flex-col ttw:gap-2",
13
+ children: [
14
+ /* @__PURE__ */ a(t, {
15
+ ref: g,
16
+ value: u,
17
+ "aria-label": s.inputAriaLabel,
18
+ disabled: c === "saving",
19
+ onChange: (e) => d?.(e.target.value)
20
+ }),
21
+ /* @__PURE__ */ o("span", {
22
+ className: "ttw:flex ttw:justify-end ttw:gap-2",
23
+ children: [/* @__PURE__ */ a(e, {
24
+ type: "button",
25
+ size: "sm",
26
+ variant: "ghost",
27
+ disabled: c === "saving",
28
+ onClick: p,
29
+ children: s.cancel
30
+ }), /* @__PURE__ */ a(e, {
31
+ type: "button",
32
+ size: "sm",
33
+ disabled: m,
34
+ loading: c === "saving",
35
+ onClick: f,
36
+ children: s.save
37
+ })]
38
+ }),
39
+ c === "errored" ? /* @__PURE__ */ a(n, { children: s.errorDescription }) : null
40
+ ]
41
+ }) : null;
42
+ }
43
+ export { s as NicknameEditor };
@@ -1,3 +1,3 @@
1
1
  // ../../libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/cardFaceSurface.js
2
- var e = "ttw:w-[300px]", t = "ttw:h-[190px]", n = `ttw:relative ttw:flex ${t} ${e} ttw:flex-col ttw:overflow-hidden ttw:rounded-xl ttw:bg-[#101317] ttw:p-4`, r = "ttw:rounded-full ttw:bg-white/90 ttw:px-4 ttw:py-2 ttw:text-sm ttw:font-medium ttw:text-[#101317]";
2
+ var e = "ttw:w-[300px] ttw:max-w-full", t = "ttw:h-[190px]", n = `ttw:relative ttw:flex ${t} ${e} ttw:flex-col ttw:overflow-hidden ttw:rounded-xl ttw:bg-[#101317] ttw:p-4`, r = "ttw:rounded-full ttw:bg-white/90 ttw:px-4 ttw:py-2 ttw:text-sm ttw:font-medium ttw:text-[#101317]";
3
3
  export { t as CARD_FACE_HEIGHT_CLASS_NAME, r as CARD_FACE_STATUS_PILL_CLASS_NAME, n as CARD_FACE_SURFACE_CLASS_NAME, e as CARD_FACE_WIDTH_CLASS_NAME };
@@ -17,22 +17,25 @@ var e = {
17
17
  emptyValue: "—",
18
18
  copyCardholderAriaLabel: "Copy cardholder",
19
19
  copyNicknameAriaLabel: "Copy nickname",
20
+ copyBillingAddressAriaLabel: "Copy billing address",
20
21
  copyBillingAddressLine1AriaLabel: "Copy street address 1",
21
22
  copyBillingAddressLine2AriaLabel: "Copy street address 2",
22
23
  copyBillingAddressCityStateAriaLabel: "Copy city and state",
23
- copyBillingAddressPostalCodeAriaLabel: "Copy ZIP code"
24
+ copyBillingAddressPostalCodeAriaLabel: "Copy ZIP code",
25
+ copiedLabel: "Copied"
24
26
  },
25
27
  actions: {
26
28
  activateCard: "Activate card",
27
- viewCard: "View card",
28
- hideCard: "Hide card"
29
+ viewCard: "Show card details",
30
+ hideCard: "Hide card details"
29
31
  },
30
32
  nickname: {
33
+ edit: "Edit",
31
34
  editAriaLabel: "Edit nickname",
32
35
  inputAriaLabel: "Nickname",
33
36
  save: "Save",
34
37
  cancel: "Cancel",
35
- errorDescription: "We couldn't update the nickname. Please try again."
38
+ errorDescription: "Couldn't update the nickname. Try again."
36
39
  },
37
40
  lock: {
38
41
  lockCard: "Lock card",
@@ -40,7 +43,7 @@ var e = {
40
43
  cardFaceLabel: "Card is locked",
41
44
  lockedDescription: "Your card is locked. New transactions will automatically decline. You can unlock the card at any time.",
42
45
  lockedDescriptionWithoutUnlock: "Your card is locked. New transactions will automatically decline.",
43
- errorDescription: "We couldn't change this card's lock. Please try again."
46
+ errorDescription: "Couldn't change this card's lock. Try again."
44
47
  },
45
48
  credentials: {
46
49
  cardNumber: "Card number",
@@ -49,12 +52,13 @@ var e = {
49
52
  copyCardNumberAriaLabel: "Copy card number",
50
53
  copyExpirationDateAriaLabel: "Copy expiration date",
51
54
  copySecurityCodeAriaLabel: "Copy security code",
52
- errorDescription: "We couldn't show this card's details. Please try again."
55
+ copiedLabel: "Copied",
56
+ errorDescription: "Couldn't show this card's details. Try again."
53
57
  },
54
58
  status: {
55
59
  loadingAriaLabel: "Loading card details",
56
- errorTitle: "We couldn't load this card",
57
- errorDescription: "Something went wrong on our end. Please try again.",
60
+ errorTitle: "Couldn't load this card",
61
+ errorDescription: "Check your connection, then try again.",
58
62
  errorRetry: "Try again",
59
63
  notFoundTitle: "Card not found",
60
64
  notFoundDescription: "This card may have been closed, or you may not have access to it."
@@ -3,12 +3,12 @@ var e = {
3
3
  toast: {
4
4
  creating: "Creating your card…",
5
5
  success: "Card created successfully.",
6
- error: "We could not create this card. Please try again.",
6
+ error: "Couldn't create this card. Try again.",
7
7
  controlsWarning: "Card created, but spend controls could not be applied.",
8
8
  companyAdminAccessWarning: "Card created, but some admins could not be granted access to it.",
9
9
  controlsAndAccessWarning: "Card created, but spend controls could not be applied and some admins could not be granted access to it.",
10
- debitCardIssuersError: "We could not load the list of admins to grant access to this card.",
11
- retry: "Retry"
10
+ debitCardIssuersError: "Couldn't load the admins to grant access to this card.",
11
+ retry: "Try again"
12
12
  },
13
13
  untitledFundingAccount: "Bank account",
14
14
  velocityControlNames: {