@tesouro/embedded-components-react 0.11.100 → 0.11.102

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 (71) hide show
  1. package/dist/experimental/QuickViewWidget.d.ts +62 -2
  2. package/dist/experimental/index.d.ts +62 -2
  3. package/dist/index.css +21 -17
  4. package/dist/index.d.ts +10 -6
  5. package/dist/lib/CardDetailsWidget.d.ts +6 -4
  6. package/dist/lib/CreditCardsWidget.d.ts +6 -4
  7. package/dist/lib/DebitCardsWidget.d.ts +6 -4
  8. package/dist/lib/SettingsWidget.d.ts +2 -1
  9. package/dist/lib/WidgetSuite.d.ts +8 -5
  10. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsPanel.js +199 -168
  11. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/labels.js +1 -0
  12. package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardsList.js +44 -43
  13. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/feature/dist/index.js +1 -1
  14. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/feature/dist/index3.js +9 -9
  15. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/feature/dist/index4.js +2 -2
  16. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/feature/dist/index6.js +25 -284
  17. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/feature/dist/index7.js +291 -0
  18. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/ui/dist/index.js +3 -3
  19. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/ui/dist/index3.js +28 -17
  20. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/ui/dist/index5.js +21 -34
  21. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/ui/dist/index6.js +71 -78
  22. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/ui/dist/index7.js +71 -77
  23. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/ui/dist/index8.js +43 -49
  24. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index.js +1 -1
  25. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index2.js +8 -1
  26. package/dist/libs/tesouro-embedded-components-react/quick-view-widget/accounts/ui/dist/index2.js +1 -1
  27. package/dist/libs/tesouro-embedded-components-react/quick-view-widget/bills/ui/dist/index2.js +1 -1
  28. package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/data-access/dist/index.js +1 -0
  29. package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/data-access/dist/index2.js +98 -0
  30. package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/feature/dist/index.js +3 -0
  31. package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/feature/dist/lib/CardsQuickViewWidget/CardsQuickViewWidgetFeature.js +80 -0
  32. package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/feature/dist/lib/CardsQuickViewWidget/labels.js +27 -0
  33. package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/feature/dist/lib/CardsQuickViewWidget/summarizeCardSpend.js +17 -0
  34. package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/feature/dist/lib/CardsQuickViewWidget/testIds.js +7 -0
  35. package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/feature/dist/lib/CardsQuickViewWidget/useCardSpendSummary.js +29 -0
  36. package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/feature/dist/lib/analytics/events.js +4 -0
  37. package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/ui/dist/index.js +3 -0
  38. package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/ui/dist/index2.js +8 -0
  39. package/dist/libs/tesouro-embedded-components-react/quick-view-widget/cards/ui/dist/index3.js +31 -0
  40. package/dist/libs/tesouro-embedded-components-react/quick-view-widget/feature/dist/lib/QuickViewWidget/QuickViewWidget.js +57 -44
  41. package/dist/libs/tesouro-embedded-components-react/quick-view-widget/feature/dist/lib/QuickViewWidget/labels.js +6 -3
  42. package/dist/libs/tesouro-embedded-components-react/quick-view-widget/invoices/ui/dist/index2.js +1 -1
  43. package/dist/libs/tesouro-embedded-components-react/settings-widget/chart-of-accounts/ui/dist/index3.js +98 -91
  44. package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/lib/ExpenseSettingsTabs/ExpenseSettingsTabs.js +24 -21
  45. package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/lib/SettingsWidget/SettingsWidget.js +14 -8
  46. package/dist/libs/tesouro-embedded-components-react/settings-widget/help/ui/shadcn/dist/index3.js +2 -2
  47. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/feature/dist/index10.js +87 -81
  48. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/ui/dist/index3.js +63 -44
  49. package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/ui/dist/index6.js +9 -6
  50. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/feature/dist/index17.js +302 -276
  51. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/ui/dist/index.js +10 -10
  52. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/ui/dist/index12.js +36 -36
  53. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/ui/dist/index17.js +27 -13
  54. package/dist/libs/tesouro-embedded-components-react/settings-widget/ui/dist/lib/SettingsWidgetUi/SettingsSectionContent.js +22 -0
  55. package/dist/libs/tesouro-embedded-components-react/settings-widget/ui/dist/lib/SettingsWidgetUi/SettingsWidgetUi.js +6 -7
  56. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/feature/dist/lib/ApprovalPoliciesSettings.js +39 -37
  57. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index.js +9 -9
  58. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index11.js +39 -35
  59. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index16.js +59 -61
  60. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index4.js +2 -2
  61. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index6.js +2 -2
  62. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index7.js +3 -3
  63. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +114 -103
  64. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +43 -43
  65. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/debit-card/useAllDebitCardsQuery.js +22 -18
  66. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +97 -97
  67. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +166 -154
  68. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  69. package/dist/libs/tesouro-embedded-components-react/shared/util/dist/index.js +12 -12
  70. package/dist/packages/shared-ui-shadcn/dist/index.js +18 -15
  71. package/package.json +1 -1
@@ -2,198 +2,229 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
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 ee } from "../../../../../shared/ui/dist/lib/EmptyState/EmptyState.js";
7
- import { ErrorState as c } from "../../../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
8
- import { LoadingRegion as l } from "../../../../../shared/ui/dist/lib/LoadingRegion/LoadingRegion.js";
9
- import { InlineErrorAlert as u } from "../../../../../shared/ui/dist/lib/InlineErrorAlert/InlineErrorAlert.js";
5
+ import { Alert as e, AlertDescription as t, Badge as ee, Button as n, DescriptionList as r, Heading as i, Skeleton as a, cn as o } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
6
+ import { EmptyState as te } from "../../../../../shared/ui/dist/lib/EmptyState/EmptyState.js";
7
+ import { ErrorState as ne } from "../../../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
8
+ import { LoadingRegion as re } from "../../../../../shared/ui/dist/lib/LoadingRegion/LoadingRegion.js";
9
+ import { InlineErrorAlert as s } from "../../../../../shared/ui/dist/lib/InlineErrorAlert/InlineErrorAlert.js";
10
10
  import "../../../../../shared/ui/dist/index.js";
11
- import { CardDetailsHeader as d } from "./CardDetailsHeader.js";
12
- import { CARD_FACE_WIDTH_CLASS_NAME as f } from "./cardFaceSurface.js";
13
- import { CardFace as te } from "./CardFace.js";
14
- import { resolveCardDetailsPanelLabels as ne } from "./labels.js";
15
- import { CardCredentialsFace as re } from "./CardCredentialsFace.js";
16
- import { CardFaceFlip as ie } from "./CardFaceFlip.js";
17
- import { CopyableValue as p } from "./CopyableValue.js";
18
- import { NicknameEditor as ae } from "./NicknameEditor.js";
19
- import { useMemo as oe } from "react";
20
- import { jsx as m, jsxs as h } from "react/jsx-runtime";
21
- import { CircleAlertIcon as g, CreditCardIcon as _ } from "lucide-react";
11
+ import { CardDetailsHeader as ie } from "./CardDetailsHeader.js";
12
+ import { CARD_FACE_WIDTH_CLASS_NAME as ae } from "./cardFaceSurface.js";
13
+ import { CardFace as c } from "./CardFace.js";
14
+ import { resolveCardDetailsPanelLabels as l } from "./labels.js";
15
+ import { CardCredentialsFace as oe } from "./CardCredentialsFace.js";
16
+ import { CardFaceFlip as se } from "./CardFaceFlip.js";
17
+ import { CopyableValue as u } from "./CopyableValue.js";
18
+ import { NicknameEditor as ce } from "./NicknameEditor.js";
19
+ import { useMemo as le } from "react";
20
+ import { jsx as d, jsxs as f } from "react/jsx-runtime";
21
+ import { CircleAlertIcon as ue, CreditCardIcon as de } from "lucide-react";
22
22
  // ../../libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsPanel.js
23
- function v({ labels: v, state: y, nickname: se, statusLabel: ce, statusTone: le, formFactorLabel: ue, cardMenu: de, onClose: fe, cardArtSrc: pe, bankLogoSrc: me, bankLogoAlt: he, cardholderName: ge, maskedCardNumber: _e, cardFaceStatusLabel: ve, 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: ye, revealedExpirationDate: be, revealedSecurityCode: xe, isLocked: I, lockState: L = "idle", onLockCard: R, onUnlockCard: z, onRetry: Se, testIds: B, className: Ce }) {
24
- let V = oe(() => ne(v), [v]), H = b?.addressLine1, U = b?.addressLine2, W = b?.cityState, G = b?.postalCode, we = !!(H || U || W || G), Te = !!x?.length, Ee = !!S?.length, De = !!C, K = F === "revealed", q = K ? P : N, J = !!(R || z), Y = I ? z : R, Oe = V.fields.copiedLabel, X = [
25
- H,
26
- U,
27
- W,
28
- G
29
- ].filter((e) => !!e), Z = we ? [{
30
- label: V.fields.billingAddress,
31
- value: /* @__PURE__ */ m(p, {
32
- copyLabel: V.fields.copyBillingAddressAriaLabel,
33
- copiedLabel: Oe,
34
- onCopy: w ? () => w(X.join("\n")) : void 0,
35
- children: /* @__PURE__ */ m("span", {
36
- className: "ttw:flex ttw:flex-col",
37
- children: X.map((e, t) => /* @__PURE__ */ m("span", { children: e }, t))
38
- })
39
- })
40
- }] : [], Q = [
23
+ function p({ labels: p, state: m, nickname: h, statusLabel: fe, statusTone: pe, formFactorLabel: g, cardMenu: _, onClose: me, cardArtSrc: he, bankLogoSrc: ge, bankLogoAlt: _e, cardholderName: v, maskedCardNumber: ve, cardFaceStatusLabel: ye, billingAddress: y, allowedCategories: b, spendLimitLabels: x, perTransactionMaxLabel: S, onCopy: C, onEditNickname: w, nicknameEditState: T = "closed", nicknameDraft: E, onNicknameDraftChange: D, onSaveNickname: O, onCancelNicknameEdit: k, isNicknameSaveDisabled: A, onActivate: j, onViewCard: M, onHideCard: N, revealState: P = "hidden", revealedCardNumber: be, revealedExpirationDate: xe, revealedSecurityCode: Se, isLocked: F, lockState: I = "idle", onLockCard: L, onUnlockCard: R, onRetry: Ce, testIds: z, className: we }) {
24
+ let B = le(() => l(p), [p]), V = y?.addressLine1, H = y?.addressLine2, U = y?.cityState, W = y?.postalCode, Te = !!(V || H || U || W), Ee = !!b?.length, De = !!x?.length, G = !!S, K = P === "revealed", q = K ? N : M, J = !!(L || R), Y = F ? R : L, X = B.fields.copiedLabel, Z = [
25
+ ...v ? [{
26
+ label: B.fields.cardholder,
27
+ value: v
28
+ }] : [],
41
29
  ...Te ? [{
42
- label: V.fields.allowedCategories,
43
- value: /* @__PURE__ */ m("span", {
30
+ label: B.fields.billingAddress,
31
+ value: /* @__PURE__ */ f("div", {
32
+ className: "ttw:flex ttw:flex-col ttw:gap-3",
33
+ children: [
34
+ V ? /* @__PURE__ */ d(u, {
35
+ copyLabel: B.fields.copyBillingAddressLine1AriaLabel,
36
+ copiedLabel: X,
37
+ onCopy: C ? () => C(V) : void 0,
38
+ children: V
39
+ }) : null,
40
+ H ? /* @__PURE__ */ d(u, {
41
+ copyLabel: B.fields.copyBillingAddressLine2AriaLabel,
42
+ copiedLabel: X,
43
+ onCopy: C ? () => C(H) : void 0,
44
+ children: H
45
+ }) : null,
46
+ U ? /* @__PURE__ */ d(u, {
47
+ copyLabel: B.fields.copyBillingAddressCityStateAriaLabel,
48
+ copiedLabel: X,
49
+ onCopy: C ? () => C(U) : void 0,
50
+ children: U
51
+ }) : null,
52
+ W ? /* @__PURE__ */ d(u, {
53
+ copyLabel: B.fields.copyBillingAddressPostalCodeAriaLabel,
54
+ copiedLabel: X,
55
+ onCopy: C ? () => C(W) : void 0,
56
+ children: W
57
+ }) : null
58
+ ]
59
+ })
60
+ }] : [],
61
+ ...h || w ? [{
62
+ label: B.fields.nickname,
63
+ value: T !== "closed" && w ? /* @__PURE__ */ d(ce, {
64
+ labels: B.nickname,
65
+ editState: T,
66
+ onEdit: w,
67
+ draft: E,
68
+ onDraftChange: D,
69
+ onSave: O,
70
+ onCancel: k,
71
+ isSaveDisabled: A
72
+ }) : /* @__PURE__ */ f("span", {
73
+ className: "ttw:flex ttw:items-center ttw:justify-between ttw:gap-2",
74
+ children: [/* @__PURE__ */ d("span", {
75
+ className: "ttw:min-w-0 ttw:flex-1 ttw:break-words",
76
+ children: h ?? B.fields.emptyValue
77
+ }), w ? /* @__PURE__ */ d(n, {
78
+ type: "button",
79
+ variant: "link",
80
+ size: "sm",
81
+ className: "ttw:shrink-0",
82
+ "aria-label": B.nickname.editAriaLabel,
83
+ onClick: w,
84
+ children: B.nickname.edit
85
+ }) : null]
86
+ })
87
+ }] : []
88
+ ], Q = [
89
+ ...Ee ? [{
90
+ label: B.fields.allowedCategories,
91
+ value: /* @__PURE__ */ d("span", {
44
92
  className: "ttw:flex ttw:flex-wrap ttw:gap-2",
45
- children: x?.map((e) => /* @__PURE__ */ m(n, {
93
+ children: b?.map((e) => /* @__PURE__ */ d(ee, {
46
94
  tone: "neutral",
47
95
  children: e
48
96
  }, e))
49
97
  })
50
98
  }] : [],
51
- ...Ee ? [{
52
- label: V.fields.spendLimit,
53
- value: /* @__PURE__ */ m("span", {
99
+ ...De ? [{
100
+ label: B.fields.spendLimit,
101
+ value: /* @__PURE__ */ d("span", {
54
102
  className: "ttw:flex ttw:flex-col ttw:gap-1 ttw:tabular-nums",
55
- children: S?.map((e, t) => /* @__PURE__ */ m("span", { children: e }, `${e}-${t}`))
103
+ children: x?.map((e, t) => /* @__PURE__ */ d("span", { children: e }, `${e}-${t}`))
56
104
  })
57
105
  }] : [],
58
- ...De ? [{
59
- label: V.fields.perTransactionMax,
60
- value: /* @__PURE__ */ m("span", {
106
+ ...G ? [{
107
+ label: B.fields.perTransactionMax,
108
+ value: /* @__PURE__ */ d("span", {
61
109
  className: "ttw:tabular-nums",
62
- children: C
110
+ children: S
63
111
  })
64
112
  }] : []
65
- ], $ = /* @__PURE__ */ m(te, {
66
- cardArtSrc: pe,
67
- bankLogoSrc: me,
68
- bankLogoAlt: he ?? V.cardFace.bankLogoAlt,
69
- cardholderName: ge ?? "",
70
- maskedCardNumber: _e ?? "",
71
- statusLabel: ve,
72
- isLocked: I,
73
- lockedLabel: V.lock.cardFaceLabel,
74
- testIds: B?.cardFace
113
+ ], $ = /* @__PURE__ */ d(c, {
114
+ cardArtSrc: he,
115
+ bankLogoSrc: ge,
116
+ bankLogoAlt: _e ?? B.cardFace.bankLogoAlt,
117
+ cardholderName: v ?? "",
118
+ maskedCardNumber: ve ?? "",
119
+ statusLabel: ye,
120
+ isLocked: F,
121
+ lockedLabel: B.lock.cardFaceLabel,
122
+ testIds: z?.cardFace
75
123
  });
76
- return /* @__PURE__ */ h("div", {
77
- "data-testid": B?.root,
78
- className: s("ttw:@container/card-details ttw:flex ttw:w-full ttw:max-w-[720px] ttw:flex-col", Ce),
79
- children: [/* @__PURE__ */ m(d, {
80
- testIds: B?.header,
81
- labels: V.header,
82
- title: y === "loaded" ? se ?? V.header.untitledCard : void 0,
83
- isTitlePending: y === "loading",
84
- statusLabel: y === "loaded" ? ce : void 0,
85
- statusTone: le,
86
- formFactorLabel: y === "loaded" ? ue : void 0,
87
- cardMenu: y === "loaded" ? de : void 0,
88
- onClose: fe,
89
- titleAction: y === "loaded" && T && E === "closed" ? /* @__PURE__ */ m(r, {
90
- type: "button",
91
- variant: "link",
92
- size: "sm",
93
- className: "ttw:shrink-0",
94
- "aria-label": V.nickname.editAriaLabel,
95
- onClick: T,
96
- children: V.nickname.edit
97
- }) : void 0
98
- }), /* @__PURE__ */ m("div", {
124
+ return /* @__PURE__ */ f("div", {
125
+ "data-testid": z?.root,
126
+ className: o("ttw:@container/card-details ttw:flex ttw:w-full ttw:max-w-[720px] ttw:flex-col", we),
127
+ children: [/* @__PURE__ */ d(ie, {
128
+ testIds: z?.header,
129
+ labels: B.header,
130
+ title: m === "loaded" ? h ?? B.header.untitledCard : void 0,
131
+ isTitlePending: m === "loading",
132
+ statusLabel: m === "loaded" ? fe : void 0,
133
+ statusTone: pe,
134
+ formFactorLabel: m === "loaded" ? g : void 0,
135
+ cardMenu: m === "loaded" ? _ : void 0,
136
+ onClose: me
137
+ }), /* @__PURE__ */ d("div", {
99
138
  className: "ttw:px-4 ttw:pb-6 ttw:@md/card-details:px-6",
100
- children: y === "loading" ? /* @__PURE__ */ h(l, {
139
+ children: m === "loading" ? /* @__PURE__ */ f(re, {
101
140
  isLoading: !0,
102
- loadingLabel: V.status.loadingAriaLabel,
103
- "data-testid": B?.loading,
141
+ loadingLabel: B.status.loadingAriaLabel,
142
+ "data-testid": z?.loading,
104
143
  className: "ttw:space-y-4",
105
- children: [/* @__PURE__ */ m(o, { className: "ttw:h-8 ttw:w-56" }), /* @__PURE__ */ m(o, { className: "ttw:h-64 ttw:w-full ttw:rounded-lg" })]
106
- }) : y === "error" ? /* @__PURE__ */ m(c, {
107
- title: V.status.errorTitle,
108
- description: V.status.errorDescription,
109
- retryLabel: V.status.errorRetry,
110
- onRetry: Se
111
- }) : y === "notFound" ? /* @__PURE__ */ m(ee, {
112
- icon: /* @__PURE__ */ m(_, {}),
113
- title: V.status.notFoundTitle,
114
- description: V.status.notFoundDescription
115
- }) : /* @__PURE__ */ h("div", {
144
+ children: [/* @__PURE__ */ d(a, { className: "ttw:h-8 ttw:w-56" }), /* @__PURE__ */ d(a, { className: "ttw:h-64 ttw:w-full ttw:rounded-lg" })]
145
+ }) : m === "error" ? /* @__PURE__ */ d(ne, {
146
+ title: B.status.errorTitle,
147
+ description: B.status.errorDescription,
148
+ retryLabel: B.status.errorRetry,
149
+ onRetry: Ce
150
+ }) : m === "notFound" ? /* @__PURE__ */ d(te, {
151
+ icon: /* @__PURE__ */ d(de, {}),
152
+ title: B.status.notFoundTitle,
153
+ description: B.status.notFoundDescription
154
+ }) : /* @__PURE__ */ f("div", {
116
155
  className: "ttw:flex ttw:flex-col ttw:gap-4",
117
- children: [
118
- T && E !== "closed" ? /* @__PURE__ */ m(ae, {
119
- labels: V.nickname,
120
- editState: E,
121
- onEdit: T,
122
- draft: D,
123
- onDraftChange: O,
124
- onSave: k,
125
- onCancel: A,
126
- isSaveDisabled: j
127
- }) : null,
128
- /* @__PURE__ */ h("div", {
129
- className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:@xl/card-details:flex-row ttw:@xl/card-details:items-start",
130
- children: [/* @__PURE__ */ m("div", {
131
- className: "ttw:flex ttw:justify-center ttw:rounded-lg ttw:bg-muted ttw:p-4 ttw:@xl/card-details:shrink-0",
132
- children: /* @__PURE__ */ h("div", {
133
- className: s("ttw:flex ttw:flex-col ttw:gap-2", f),
134
- children: [
135
- N ? /* @__PURE__ */ m(ie, {
136
- testIds: B?.cardFaceFlip,
137
- isFlipped: K,
138
- front: $,
139
- back: /* @__PURE__ */ m(re, {
140
- labels: V.credentials,
141
- cardNumber: ye,
142
- expirationDate: be,
143
- securityCode: xe,
144
- isLocked: I,
145
- onCopy: w,
146
- testIds: B?.credentialsFace
147
- })
148
- }) : $,
149
- M ? /* @__PURE__ */ m(r, {
150
- type: "button",
151
- className: "ttw:mt-2 ttw:w-full",
152
- onClick: M,
153
- children: V.actions.activateCard
154
- }) : null,
155
- N ? /* @__PURE__ */ m(r, {
156
- type: "button",
157
- variant: "ghost",
158
- className: "ttw:w-full",
159
- disabled: !q,
160
- loading: F === "revealing",
161
- onClick: q,
162
- children: K ? V.actions.hideCard : V.actions.viewCard
163
- }) : null,
164
- J ? /* @__PURE__ */ m(r, {
165
- type: "button",
166
- variant: "outline",
167
- className: "ttw:w-full",
168
- disabled: !Y,
169
- loading: L === "pending",
170
- onClick: Y,
171
- children: I ? V.lock.unlockCard : V.lock.lockCard
172
- }) : null,
173
- I ? /* @__PURE__ */ h(e, {
174
- variant: "destructive",
175
- children: [/* @__PURE__ */ m(g, { "aria-hidden": "true" }), /* @__PURE__ */ m(t, { children: J ? V.lock.lockedDescription : V.lock.lockedDescriptionWithoutUnlock })]
176
- }) : null,
177
- L === "errored" ? /* @__PURE__ */ m(u, { children: V.lock.errorDescription }) : null,
178
- F === "errored" ? /* @__PURE__ */ m(u, { children: V.credentials.errorDescription }) : null
179
- ]
180
- })
181
- }), Z.length > 0 ? /* @__PURE__ */ m("div", {
182
- className: "ttw:min-w-0 ttw:flex-1",
183
- children: /* @__PURE__ */ m(i, { items: Z })
184
- }) : null]
185
- }),
186
- Q.length > 0 ? /* @__PURE__ */ h("section", {
156
+ children: [/* @__PURE__ */ f("div", {
157
+ className: "ttw:flex ttw:flex-col ttw:gap-4",
158
+ children: [/* @__PURE__ */ d("div", {
159
+ className: "ttw:flex ttw:justify-center ttw:rounded-lg ttw:bg-muted ttw:p-4",
160
+ children: /* @__PURE__ */ f("div", {
161
+ className: o("ttw:flex ttw:flex-col ttw:gap-2", ae),
162
+ children: [
163
+ M ? /* @__PURE__ */ d(se, {
164
+ testIds: z?.cardFaceFlip,
165
+ isFlipped: K,
166
+ front: $,
167
+ back: /* @__PURE__ */ d(oe, {
168
+ labels: B.credentials,
169
+ cardNumber: be,
170
+ expirationDate: xe,
171
+ securityCode: Se,
172
+ isLocked: F,
173
+ onCopy: C,
174
+ testIds: z?.credentialsFace
175
+ })
176
+ }) : $,
177
+ j ? /* @__PURE__ */ d(n, {
178
+ type: "button",
179
+ className: "ttw:mt-2 ttw:w-full",
180
+ onClick: j,
181
+ children: B.actions.activateCard
182
+ }) : null,
183
+ M ? /* @__PURE__ */ d(n, {
184
+ type: "button",
185
+ variant: "outline",
186
+ className: "ttw:w-full",
187
+ disabled: !q,
188
+ loading: P === "revealing",
189
+ onClick: q,
190
+ children: K ? B.actions.hideCard : B.actions.viewCard
191
+ }) : null,
192
+ J ? /* @__PURE__ */ d(n, {
193
+ type: "button",
194
+ variant: "outline",
195
+ className: "ttw:w-full",
196
+ disabled: !Y,
197
+ loading: I === "pending",
198
+ onClick: Y,
199
+ children: F ? B.lock.unlockCard : B.lock.lockCard
200
+ }) : null,
201
+ F ? /* @__PURE__ */ f(e, {
202
+ variant: "destructive",
203
+ children: [/* @__PURE__ */ d(ue, { "aria-hidden": "true" }), /* @__PURE__ */ d(t, { children: J ? B.lock.lockedDescription : B.lock.lockedDescriptionWithoutUnlock })]
204
+ }) : null,
205
+ I === "errored" ? /* @__PURE__ */ d(s, { children: B.lock.errorDescription }) : null,
206
+ P === "errored" ? /* @__PURE__ */ d(s, { children: B.credentials.errorDescription }) : null
207
+ ]
208
+ })
209
+ }), Z.length > 0 ? /* @__PURE__ */ f("section", {
210
+ "aria-label": B.fields.detailsHeading,
187
211
  className: "ttw:flex ttw:flex-col ttw:gap-2",
188
- children: [/* @__PURE__ */ m(a, {
212
+ children: [/* @__PURE__ */ d(i, {
189
213
  variant: "card",
190
214
  level: 3,
191
- children: V.fields.cardControlsHeading
192
- }), /* @__PURE__ */ m(i, { items: Q })]
193
- }) : null
194
- ]
215
+ children: B.fields.detailsHeading
216
+ }), /* @__PURE__ */ d(r, { items: Z })]
217
+ }) : null]
218
+ }), Q.length > 0 ? /* @__PURE__ */ f("section", {
219
+ className: "ttw:flex ttw:flex-col ttw:gap-2",
220
+ children: [/* @__PURE__ */ d(i, {
221
+ variant: "card",
222
+ level: 3,
223
+ children: B.fields.cardControlsHeading
224
+ }), /* @__PURE__ */ d(r, { items: Q })]
225
+ }) : null]
195
226
  })
196
227
  })]
197
228
  });
198
229
  }
199
- export { v as CardDetailsPanel };
230
+ export { p as CardDetailsPanel };
@@ -7,6 +7,7 @@ var e = {
7
7
  },
8
8
  cardFace: { bankLogoAlt: "Bank logo" },
9
9
  fields: {
10
+ detailsHeading: "Card details",
10
11
  cardholder: "Cardholder",
11
12
  nickname: "Nickname",
12
13
  billingAddress: "Billing address",
@@ -15,11 +15,8 @@ var m = [
15
15
  10,
16
16
  25,
17
17
  50
18
- ], h = [], g = () => void 0, _ = {
19
- cardName: 260,
20
- fundingAccount: 220
21
- };
22
- function v({ row: e, labels: t, isClickable: n }) {
18
+ ], h = [], g = () => void 0;
19
+ function _({ row: e, labels: t, isClickable: n }) {
23
20
  return /* @__PURE__ */ f("span", {
24
21
  className: "ttw:flex ttw:min-w-0 ttw:flex-col ttw:gap-0.5",
25
22
  children: [/* @__PURE__ */ f("span", {
@@ -45,11 +42,12 @@ function v({ row: e, labels: t, isClickable: n }) {
45
42
  })]
46
43
  });
47
44
  }
48
- function y({ row: e, labels: t }) {
45
+ function v({ row: e, labels: t }) {
49
46
  return /* @__PURE__ */ f("span", {
50
47
  className: "ttw:flex ttw:min-w-0 ttw:items-baseline ttw:gap-1 ttw:text-sm ttw:font-normal",
51
48
  children: [/* @__PURE__ */ d("span", {
52
- className: "ttw:truncate ttw:text-foreground",
49
+ className: "ttw:max-w-50 ttw:truncate ttw:text-foreground",
50
+ title: e.fundingAccount,
53
51
  children: e.fundingAccount
54
52
  }), e.fundingAccountLastFour && /* @__PURE__ */ f("span", {
55
53
  className: "ttw:shrink-0 ttw:text-muted-foreground",
@@ -61,7 +59,7 @@ function y({ row: e, labels: t }) {
61
59
  })]
62
60
  });
63
61
  }
64
- function b({ row: e, labels: t }) {
62
+ function y({ row: e, labels: t }) {
65
63
  return e.limit ? /* @__PURE__ */ f("span", {
66
64
  className: "ttw:text-sm ttw:tabular-nums",
67
65
  children: [/* @__PURE__ */ d("span", {
@@ -76,13 +74,13 @@ function b({ row: e, labels: t }) {
76
74
  children: t.noLimit
77
75
  });
78
76
  }
79
- function x({ row: t }) {
77
+ function b({ row: t }) {
80
78
  return /* @__PURE__ */ d(e, {
81
79
  tone: t.statusTone,
82
80
  children: t.statusLabel
83
81
  });
84
82
  }
85
- function S({ row: e, labels: n }) {
83
+ function x({ row: e, labels: n }) {
86
84
  return e.onActivate ? /* @__PURE__ */ d(t, {
87
85
  size: "sm",
88
86
  variant: "outline",
@@ -93,25 +91,26 @@ function S({ row: e, labels: n }) {
93
91
  children: n.activateButton
94
92
  }) : null;
95
93
  }
96
- function C(e, t, n) {
97
- let r = {
98
- cardName: (e) => /* @__PURE__ */ d(v, {
94
+ function S(e, t, n, r) {
95
+ let i = {
96
+ cardName: (e) => /* @__PURE__ */ d(_, {
99
97
  row: e,
100
98
  labels: t,
101
99
  isClickable: n
102
100
  }),
103
- fundingAccount: (e) => /* @__PURE__ */ d(y, {
101
+ fundingAccount: (e) => /* @__PURE__ */ d(v, {
104
102
  row: e,
105
103
  labels: t
106
104
  }),
107
105
  cardholder: (e) => /* @__PURE__ */ d("span", {
108
- className: "ttw:text-sm ttw:font-normal ttw:text-foreground",
106
+ className: "ttw:block ttw:max-w-50 ttw:truncate ttw:text-sm ttw:font-normal ttw:text-foreground",
107
+ title: e.cardholder,
109
108
  children: e.cardholder
110
109
  }),
111
- status: (e) => /* @__PURE__ */ d(x, { row: e }),
110
+ status: (e) => /* @__PURE__ */ d(b, { row: e }),
112
111
  limit: (e) => /* @__PURE__ */ d("div", {
113
112
  className: "ttw:text-right",
114
- children: /* @__PURE__ */ d(b, {
113
+ children: /* @__PURE__ */ d(y, {
115
114
  row: e,
116
115
  labels: t
117
116
  })
@@ -119,53 +118,54 @@ function C(e, t, n) {
119
118
  };
120
119
  return [...e.map((e) => ({
121
120
  id: e,
122
- size: _[e],
121
+ meta: { fitContent: e === "status" || e === "limit" },
123
122
  header: () => e === "limit" ? /* @__PURE__ */ d("div", {
124
123
  className: "ttw:text-right",
125
124
  children: t.columnHeaders[e]
126
125
  }) : t.columnHeaders[e],
127
- cell: ({ row: t }) => r[e](t.original)
128
- })), {
126
+ cell: ({ row: t }) => i[e](t.original)
127
+ })), ...r ? [{
129
128
  id: "actions",
129
+ meta: { fitContent: !0 },
130
130
  header: () => /* @__PURE__ */ d("span", {
131
131
  className: "ttw:sr-only",
132
132
  children: t.rowActionsColumn
133
133
  }),
134
134
  cell: ({ row: e }) => /* @__PURE__ */ d("div", {
135
135
  className: "ttw:text-right",
136
- children: /* @__PURE__ */ d(S, {
136
+ children: /* @__PURE__ */ d(x, {
137
137
  row: e.original,
138
138
  labels: t
139
139
  })
140
140
  })
141
- }];
141
+ }] : []];
142
142
  }
143
- function w({ row: e, columns: t, labels: n, isClickable: r }) {
143
+ function C({ row: e, columns: t, labels: n, isClickable: r }) {
144
144
  return /* @__PURE__ */ f("div", {
145
145
  className: "ttw:flex ttw:flex-col ttw:gap-2",
146
146
  children: [
147
147
  /* @__PURE__ */ f("div", {
148
148
  className: "ttw:flex ttw:items-start ttw:justify-between ttw:gap-2",
149
- children: [/* @__PURE__ */ d(v, {
149
+ children: [/* @__PURE__ */ d(_, {
150
150
  row: e,
151
151
  labels: n,
152
152
  isClickable: r
153
- }), t.includes("status") && /* @__PURE__ */ d(x, { row: e })]
153
+ }), t.includes("status") && /* @__PURE__ */ d(b, { row: e })]
154
154
  }),
155
155
  t.includes("cardholder") && /* @__PURE__ */ d("span", {
156
156
  className: "ttw:text-sm ttw:text-foreground",
157
157
  children: e.cardholder
158
158
  }),
159
- t.includes("fundingAccount") && /* @__PURE__ */ d(y, {
159
+ t.includes("fundingAccount") && /* @__PURE__ */ d(v, {
160
160
  row: e,
161
161
  labels: n
162
162
  }),
163
163
  /* @__PURE__ */ f("div", {
164
164
  className: "ttw:flex ttw:items-center ttw:justify-between ttw:gap-2",
165
- children: [t.includes("limit") ? /* @__PURE__ */ d(b, {
165
+ children: [t.includes("limit") ? /* @__PURE__ */ d(y, {
166
166
  row: e,
167
167
  labels: n
168
- }) : null, /* @__PURE__ */ d(S, {
168
+ }) : null, /* @__PURE__ */ d(x, {
169
169
  row: e,
170
170
  labels: n
171
171
  })]
@@ -173,12 +173,13 @@ function w({ row: e, columns: t, labels: n, isClickable: r }) {
173
173
  ]
174
174
  });
175
175
  }
176
- function T({ rows: e, columns: a, isLoading: _ = !1, isError: v = !1, canToggleShowMyCards: y = !1, isShowingMyCards: b = !0, onShowMyCardsChange: x, canCreateCard: S = !1, onCreateCardClick: T, headerStart: E, onRetry: D, isPaginationVisible: O = !1, pageSize: k = 10, pageSizeOptions: A = m, rangeLabel: j = "", isPreviousPageDisabled: M = !1, isNextPageDisabled: N = !1, onPageSizeChange: P, onPreviousPageClick: F, onNextPageClick: I, labels: L, testIds: R }) {
177
- let z = l(), B = u(() => c(L), [L]), V = e.length > 0 && e.every((e) => e.onSelect !== void 0), H = u(() => C(a, B, V), [
176
+ function w({ rows: e, columns: a, isLoading: _ = !1, isError: v = !1, canToggleShowMyCards: y = !1, isShowingMyCards: b = !0, onShowMyCardsChange: x, canCreateCard: w = !1, onCreateCardClick: T, headerStart: E, onRetry: D, isPaginationVisible: O = !1, pageSize: k = 10, pageSizeOptions: A = m, rangeLabel: j = "", isPreviousPageDisabled: M = !1, isNextPageDisabled: N = !1, onPageSizeChange: P, onPreviousPageClick: F, onNextPageClick: I, labels: L, testIds: R }) {
177
+ let z = l(), B = u(() => c(L), [L]), V = e.length > 0 && e.every((e) => e.onSelect !== void 0), H = e.some((e) => !!e.onActivate), U = u(() => S(a, B, V, H), [
178
178
  a,
179
179
  B,
180
- V
181
- ]), U = !!(S && T), W = !_ && !v && e.length === 0, G = U && !W, K = !!(O && P && F && I), q = V ? {
180
+ V,
181
+ H
182
+ ]), W = !!(w && T), G = !_ && !v && e.length === 0, K = W && !G, q = !!(O && P && F && I), J = V ? {
182
183
  onRowClick: (e) => e.onSelect?.(),
183
184
  rowAriaLabel: (e) => `${B.selectCardButton} ${e.nickname} ${e.lastFour} ${e.typeLabel}`
184
185
  } : {};
@@ -188,9 +189,9 @@ function T({ rows: e, columns: a, isLoading: _ = !1, isError: v = !1, canToggleS
188
189
  "data-testid": R?.root,
189
190
  className: "ttw:flex ttw:flex-col ttw:gap-4",
190
191
  children: [
191
- (G || E) && /* @__PURE__ */ f("header", {
192
+ (K || E) && /* @__PURE__ */ f("header", {
192
193
  className: "ttw:flex ttw:items-center ttw:gap-4",
193
- children: [E, G && /* @__PURE__ */ d(t, {
194
+ children: [E, K && /* @__PURE__ */ d(t, {
194
195
  size: "sm",
195
196
  disabled: _,
196
197
  onClick: T,
@@ -211,7 +212,7 @@ function T({ rows: e, columns: a, isLoading: _ = !1, isError: v = !1, canToggleS
211
212
  children: B.showMyCardsToggle
212
213
  })]
213
214
  }),
214
- v || W ? /* @__PURE__ */ f("div", {
215
+ v || G ? /* @__PURE__ */ f("div", {
215
216
  className: "ttw:rounded-xl ttw:border ttw:border-border ttw:bg-card",
216
217
  children: [v ? /* @__PURE__ */ d(s, {
217
218
  title: B.errorTitle,
@@ -223,10 +224,10 @@ function T({ rows: e, columns: a, isLoading: _ = !1, isError: v = !1, canToggleS
223
224
  icon: /* @__PURE__ */ d(p, {}),
224
225
  title: B.emptyTitle,
225
226
  description: B.emptyDescription,
226
- actionLabel: U ? B.createCardButton : void 0,
227
- onAction: U ? T : void 0,
227
+ actionLabel: W ? B.createCardButton : void 0,
228
+ onAction: W ? T : void 0,
228
229
  testId: R?.empty
229
- }), !v && K ? /* @__PURE__ */ d(i, {
230
+ }), !v && q ? /* @__PURE__ */ d(i, {
230
231
  pageSize: k,
231
232
  pageSizeOptions: A,
232
233
  onPageSizeChange: P,
@@ -242,14 +243,14 @@ function T({ rows: e, columns: a, isLoading: _ = !1, isError: v = !1, canToggleS
242
243
  }
243
244
  }) : null]
244
245
  }) : /* @__PURE__ */ d(n, {
245
- columns: H,
246
+ columns: U,
246
247
  data: e,
247
248
  getRowId: (e) => e.key,
248
249
  rowTestId: R?.row,
249
250
  sorting: h,
250
251
  onSortingChange: g,
251
252
  isLoading: _,
252
- showPagination: K,
253
+ showPagination: q,
253
254
  pageSize: k,
254
255
  pageSizeOptions: A,
255
256
  onPageSizeChange: P ?? g,
@@ -258,7 +259,7 @@ function T({ rows: e, columns: a, isLoading: _ = !1, isError: v = !1, canToggleS
258
259
  hasNextPage: !N && !_,
259
260
  onPrevPage: F ?? g,
260
261
  onNextPage: I ?? g,
261
- renderCard: (e) => /* @__PURE__ */ d(w, {
262
+ renderCard: (e) => /* @__PURE__ */ d(C, {
262
263
  row: e,
263
264
  columns: a,
264
265
  labels: B,
@@ -270,9 +271,9 @@ function T({ rows: e, columns: a, isLoading: _ = !1, isError: v = !1, canToggleS
270
271
  previousPage: B.pagination.previousPageButton,
271
272
  nextPage: B.pagination.nextPageButton
272
273
  },
273
- ...q
274
+ ...J
274
275
  })
275
276
  ]
276
277
  });
277
278
  }
278
- export { T as CardsList, T as default };
279
+ export { w as CardsList, w as default };