@tesouro/embedded-components-react 0.3.60 → 0.3.62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -11
- package/dist/index.css +6 -0
- package/dist/index.d.ts +44 -0
- package/dist/index.js +1 -1
- package/dist/lib/CardDetailsWidget.d.ts +44 -0
- package/dist/lib/CardDetailsWidget.js +1 -1
- package/dist/lib/CreditCardsWidget.d.ts +44 -0
- package/dist/lib/DebitCardsWidget.d.ts +44 -0
- package/dist/lib/WidgetSuite.d.ts +44 -0
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index.js +4 -2
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index10.js +32 -0
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index11.js +27 -0
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index9.js +17 -12
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index10.js +26 -0
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index11.js +63 -0
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index12.js +79 -0
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index13.js +219 -0
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index3.js +18 -2
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index4.js +29 -28
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index5.js +3 -0
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index6.js +33 -19
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index7.js +17 -102
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index8.js +14 -181
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index9.js +113 -0
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/ActivateCardPanel/ActivateCardPanel.js +58 -55
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/ActivateCardPanel/ActivateCardSuccessView.js +12 -13
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardCredentialsFace.js +27 -24
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsHeader.js +26 -27
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsPanel.js +140 -110
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardFace.js +29 -19
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardFaceFlip.js +16 -17
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/DetailCopyRow.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/NicknameRow.js +65 -0
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/labels.js +23 -0
- package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index9.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index22.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index479.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index553.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +22 -22
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +165 -151
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +164 -132
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/testIds.js +0 -14
package/README.md
CHANGED
|
@@ -312,20 +312,20 @@ One page of an organization's **debit** cards, with a scope-gated "Show my cards
|
|
|
312
312
|
|
|
313
313
|
### CardDetailsWidget
|
|
314
314
|
|
|
315
|
-
|
|
315
|
+
Details for one credit **or** debit card — status, form factor, program, masked card number, and copyable cardholder, nickname and billing-address rows. A debit card can also reveal its number, expiry and security code on demand, lock and unlock itself, and be renamed in place. It renders panel content rather than its own drawer, so it sits on a page of your own as readily as inside chrome you already have.
|
|
316
316
|
|
|
317
317
|
#### Props
|
|
318
318
|
|
|
319
|
-
| Prop | Type | Default | Description
|
|
320
|
-
| ---------------- | --------------------------------------- | -------------- |
|
|
321
|
-
| `cardId` | `string` | **Required** | Id of the card to show.
|
|
322
|
-
| `cardProgram` | `'credit' \| 'debit'` | **Required** | Which issuing program `cardId` belongs to. Selects the endpoint the card is fetched from.
|
|
323
|
-
| `onClose` | `() => void` | `undefined` | Called when the header's close control is pressed. Omit it and no close control is rendered at all.
|
|
324
|
-
| `labels` | `PartialDeep<CardDetailsWidgetLabels>` | English labels | Overrides the panel's own copy — header, card face alt text, row headings, copy-button accessible names, and the loading/error/not-found screens.
|
|
325
|
-
| `activateLabels` | `PartialDeep<ActivateCardPanelLabels>` | English labels | Overrides the Activate Card form's copy — its heading, the two field labels, the security-code explanation, and the validation and status text.
|
|
326
|
-
| `featureLabels` | `PartialDeep<CardDetailsFeatureLabels>` | English labels | Overrides the copy this widget resolves rather than passes through — status, form-factor and program vocabulary, the copy-success
|
|
327
|
-
| `bankLogoSrc` | `string` | `undefined` | Bank logo for the card face. Omit and the face renders without a logo rather than with a placeholder.
|
|
328
|
-
| `bankLogoAlt` | `string` | `undefined` | Alt text for `bankLogoSrc`. Falls back to `labels.cardFace.bankLogoAlt`.
|
|
319
|
+
| Prop | Type | Default | Description |
|
|
320
|
+
| ---------------- | --------------------------------------- | -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
321
|
+
| `cardId` | `string` | **Required** | Id of the card to show. |
|
|
322
|
+
| `cardProgram` | `'credit' \| 'debit'` | **Required** | Which issuing program `cardId` belongs to. Selects the endpoint the card is fetched from. |
|
|
323
|
+
| `onClose` | `() => void` | `undefined` | Called when the header's close control is pressed. Omit it and no close control is rendered at all. |
|
|
324
|
+
| `labels` | `PartialDeep<CardDetailsWidgetLabels>` | English labels | Overrides the panel's own copy — header, card face alt text, row headings, copy-button accessible names, the nickname editor, the lock control and its locked notice, and the loading/error/not-found screens. |
|
|
325
|
+
| `activateLabels` | `PartialDeep<ActivateCardPanelLabels>` | English labels | Overrides the Activate Card form's copy — its heading, the two field labels, the security-code explanation, and the validation and status text. |
|
|
326
|
+
| `featureLabels` | `PartialDeep<CardDetailsFeatureLabels>` | English labels | Overrides the copy this widget resolves rather than passes through — status, form-factor and program vocabulary, the copy-success and nickname-updated toasts, the activation, lock and nickname conflict toasts, and the refused-reveal sentence. |
|
|
327
|
+
| `bankLogoSrc` | `string` | `undefined` | Bank logo for the card face. Omit and the face renders without a logo rather than with a placeholder. |
|
|
328
|
+
| `bankLogoAlt` | `string` | `undefined` | Alt text for `bankLogoSrc`. Falls back to `labels.cardFace.bankLogoAlt`. |
|
|
329
329
|
|
|
330
330
|
### CounterpartsWidget
|
|
331
331
|
|
package/dist/index.css
CHANGED
|
@@ -2421,6 +2421,12 @@
|
|
|
2421
2421
|
background-color: color-mix(in oklab, var(--ttw-color-black) 50%, transparent);
|
|
2422
2422
|
}
|
|
2423
2423
|
}
|
|
2424
|
+
.ttw\:bg-black\/55 {
|
|
2425
|
+
background-color: var(--ttw-color-black);
|
|
2426
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
2427
|
+
background-color: color-mix(in oklab, var(--ttw-color-black) 55%, transparent);
|
|
2428
|
+
}
|
|
2429
|
+
}
|
|
2424
2430
|
.ttw\:bg-blue-50 {
|
|
2425
2431
|
background-color: var(--ttw-color-blue-50);
|
|
2426
2432
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1667,6 +1667,35 @@ interface CardDetailsActionLabels {
|
|
|
1667
1667
|
/** The same control, once the credentials are on screen. */
|
|
1668
1668
|
hideCard: string;
|
|
1669
1669
|
}
|
|
1670
|
+
/** Copy for the nickname row's inline editor. */
|
|
1671
|
+
interface CardDetailsNicknameLabels {
|
|
1672
|
+
/** Accessible name for the control that opens the editor. */
|
|
1673
|
+
editAriaLabel: string;
|
|
1674
|
+
/** Accessible name for the editor's text field. */
|
|
1675
|
+
inputAriaLabel: string;
|
|
1676
|
+
save: string;
|
|
1677
|
+
cancel: string;
|
|
1678
|
+
/** Shown under the editor when the save failed. */
|
|
1679
|
+
errorDescription: string;
|
|
1680
|
+
}
|
|
1681
|
+
/** Copy for the card lock control and for the locked card it produces. */
|
|
1682
|
+
interface CardDetailsLockLabels {
|
|
1683
|
+
lockCard: string;
|
|
1684
|
+
/** The same control, once the card is locked. */
|
|
1685
|
+
unlockCard: string;
|
|
1686
|
+
/** Pill stamped across the card face while it is locked. */
|
|
1687
|
+
cardFaceLabel: string;
|
|
1688
|
+
/** Sentence under the controls while the card is locked. */
|
|
1689
|
+
lockedDescription: string;
|
|
1690
|
+
/**
|
|
1691
|
+
* The same sentence for a reader who has no Unlock control, so it stops short
|
|
1692
|
+
* of promising one. Reachable: reveal and lock are entitled separately, so a
|
|
1693
|
+
* session can see a locked card it cannot unlock.
|
|
1694
|
+
*/
|
|
1695
|
+
lockedDescriptionWithoutUnlock: string;
|
|
1696
|
+
/** Shown next to the control when a lock change failed. */
|
|
1697
|
+
errorDescription: string;
|
|
1698
|
+
}
|
|
1670
1699
|
/**
|
|
1671
1700
|
* Copy for the revealed card credentials. The values themselves never have a
|
|
1672
1701
|
* default here — the panel is handed them or renders the field blank.
|
|
@@ -1696,6 +1725,8 @@ interface CardDetailsPanelLabels {
|
|
|
1696
1725
|
cardFace: CardDetailsCardFaceLabels;
|
|
1697
1726
|
fields: CardDetailsFieldLabels;
|
|
1698
1727
|
actions: CardDetailsActionLabels;
|
|
1728
|
+
nickname: CardDetailsNicknameLabels;
|
|
1729
|
+
lock: CardDetailsLockLabels;
|
|
1699
1730
|
credentials: CardDetailsCredentialsLabels;
|
|
1700
1731
|
status: CardDetailsStatusScreenLabels;
|
|
1701
1732
|
}
|
|
@@ -1784,6 +1815,19 @@ interface CardDetailsFeatureLabels {
|
|
|
1784
1815
|
* API outcome, and because the panel closes as it fires.
|
|
1785
1816
|
*/
|
|
1786
1817
|
activationConflictToast: string;
|
|
1818
|
+
/**
|
|
1819
|
+
* Toast shown when a lock change is refused because the card is no longer in
|
|
1820
|
+
* a state that accepts one. Same reason as `activationConflictToast`: it is an
|
|
1821
|
+
* API outcome, not something the panel can know.
|
|
1822
|
+
*/
|
|
1823
|
+
lockConflictToast: string;
|
|
1824
|
+
/** Confirmation toast after the nickname is saved. */
|
|
1825
|
+
nicknameUpdatedToast: string;
|
|
1826
|
+
/**
|
|
1827
|
+
* Toast shown when a nickname save is refused because the card moved on. The
|
|
1828
|
+
* editor closes as it fires, so the reader lands on the refetched name.
|
|
1829
|
+
*/
|
|
1830
|
+
nicknameConflictToast: string;
|
|
1787
1831
|
/**
|
|
1788
1832
|
* Replaces the panel's generic reveal error when the credentials call was
|
|
1789
1833
|
* refused (HTTP 403).
|
package/dist/index.js
CHANGED
|
@@ -15,7 +15,7 @@ import { useDisclosuresAcceptanceSurface as v, useOwnWidgetConfig as y, useRefet
|
|
|
15
15
|
import { BankAccountsWidget as w } from "./libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/index8.js";
|
|
16
16
|
import { CounterpartsWidget as T } from "./libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index8.js";
|
|
17
17
|
import { BillPayWidget as E } from "./libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index81.js";
|
|
18
|
-
import { CardDetailsWidget as D } from "./libs/tesouro-embedded-components-react/card-details-widget/feature/dist/
|
|
18
|
+
import { CardDetailsWidget as D } from "./libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index13.js";
|
|
19
19
|
import { CreditCardsWidget as O } from "./libs/tesouro-embedded-components-react/cards-widget/feature/dist/index10.js";
|
|
20
20
|
import { DebitCardsWidget as k } from "./libs/tesouro-embedded-components-react/cards-widget/feature/dist/index11.js";
|
|
21
21
|
import { BALANCES_WIDGET_LABELS_EN as A } from "./libs/tesouro-embedded-components-react/balances-widget/ui/dist/lib/BalancesWidget/labels.js";
|
|
@@ -41,6 +41,35 @@ interface CardDetailsActionLabels {
|
|
|
41
41
|
/** The same control, once the credentials are on screen. */
|
|
42
42
|
hideCard: string;
|
|
43
43
|
}
|
|
44
|
+
/** Copy for the nickname row's inline editor. */
|
|
45
|
+
interface CardDetailsNicknameLabels {
|
|
46
|
+
/** Accessible name for the control that opens the editor. */
|
|
47
|
+
editAriaLabel: string;
|
|
48
|
+
/** Accessible name for the editor's text field. */
|
|
49
|
+
inputAriaLabel: string;
|
|
50
|
+
save: string;
|
|
51
|
+
cancel: string;
|
|
52
|
+
/** Shown under the editor when the save failed. */
|
|
53
|
+
errorDescription: string;
|
|
54
|
+
}
|
|
55
|
+
/** Copy for the card lock control and for the locked card it produces. */
|
|
56
|
+
interface CardDetailsLockLabels {
|
|
57
|
+
lockCard: string;
|
|
58
|
+
/** The same control, once the card is locked. */
|
|
59
|
+
unlockCard: string;
|
|
60
|
+
/** Pill stamped across the card face while it is locked. */
|
|
61
|
+
cardFaceLabel: string;
|
|
62
|
+
/** Sentence under the controls while the card is locked. */
|
|
63
|
+
lockedDescription: string;
|
|
64
|
+
/**
|
|
65
|
+
* The same sentence for a reader who has no Unlock control, so it stops short
|
|
66
|
+
* of promising one. Reachable: reveal and lock are entitled separately, so a
|
|
67
|
+
* session can see a locked card it cannot unlock.
|
|
68
|
+
*/
|
|
69
|
+
lockedDescriptionWithoutUnlock: string;
|
|
70
|
+
/** Shown next to the control when a lock change failed. */
|
|
71
|
+
errorDescription: string;
|
|
72
|
+
}
|
|
44
73
|
/**
|
|
45
74
|
* Copy for the revealed card credentials. The values themselves never have a
|
|
46
75
|
* default here — the panel is handed them or renders the field blank.
|
|
@@ -70,6 +99,8 @@ interface CardDetailsPanelLabels {
|
|
|
70
99
|
cardFace: CardDetailsCardFaceLabels;
|
|
71
100
|
fields: CardDetailsFieldLabels;
|
|
72
101
|
actions: CardDetailsActionLabels;
|
|
102
|
+
nickname: CardDetailsNicknameLabels;
|
|
103
|
+
lock: CardDetailsLockLabels;
|
|
73
104
|
credentials: CardDetailsCredentialsLabels;
|
|
74
105
|
status: CardDetailsStatusScreenLabels;
|
|
75
106
|
}
|
|
@@ -831,6 +862,19 @@ interface CardDetailsFeatureLabels {
|
|
|
831
862
|
* API outcome, and because the panel closes as it fires.
|
|
832
863
|
*/
|
|
833
864
|
activationConflictToast: string;
|
|
865
|
+
/**
|
|
866
|
+
* Toast shown when a lock change is refused because the card is no longer in
|
|
867
|
+
* a state that accepts one. Same reason as `activationConflictToast`: it is an
|
|
868
|
+
* API outcome, not something the panel can know.
|
|
869
|
+
*/
|
|
870
|
+
lockConflictToast: string;
|
|
871
|
+
/** Confirmation toast after the nickname is saved. */
|
|
872
|
+
nicknameUpdatedToast: string;
|
|
873
|
+
/**
|
|
874
|
+
* Toast shown when a nickname save is refused because the card moved on. The
|
|
875
|
+
* editor closes as it fires, so the reader lands on the refetched name.
|
|
876
|
+
*/
|
|
877
|
+
nicknameConflictToast: string;
|
|
834
878
|
/**
|
|
835
879
|
* Replaces the panel's generic reveal error when the credentials call was
|
|
836
880
|
* refused (HTTP 403).
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { CardDetailsWidget as e } from "../libs/tesouro-embedded-components-react/card-details-widget/feature/dist/
|
|
1
|
+
import { CardDetailsWidget as e } from "../libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index13.js";
|
|
2
2
|
import "../libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index.js";
|
|
3
3
|
export { e as CardDetailsWidget };
|
|
@@ -801,6 +801,35 @@ interface CardDetailsActionLabels {
|
|
|
801
801
|
/** The same control, once the credentials are on screen. */
|
|
802
802
|
hideCard: string;
|
|
803
803
|
}
|
|
804
|
+
/** Copy for the nickname row's inline editor. */
|
|
805
|
+
interface CardDetailsNicknameLabels {
|
|
806
|
+
/** Accessible name for the control that opens the editor. */
|
|
807
|
+
editAriaLabel: string;
|
|
808
|
+
/** Accessible name for the editor's text field. */
|
|
809
|
+
inputAriaLabel: string;
|
|
810
|
+
save: string;
|
|
811
|
+
cancel: string;
|
|
812
|
+
/** Shown under the editor when the save failed. */
|
|
813
|
+
errorDescription: string;
|
|
814
|
+
}
|
|
815
|
+
/** Copy for the card lock control and for the locked card it produces. */
|
|
816
|
+
interface CardDetailsLockLabels {
|
|
817
|
+
lockCard: string;
|
|
818
|
+
/** The same control, once the card is locked. */
|
|
819
|
+
unlockCard: string;
|
|
820
|
+
/** Pill stamped across the card face while it is locked. */
|
|
821
|
+
cardFaceLabel: string;
|
|
822
|
+
/** Sentence under the controls while the card is locked. */
|
|
823
|
+
lockedDescription: string;
|
|
824
|
+
/**
|
|
825
|
+
* The same sentence for a reader who has no Unlock control, so it stops short
|
|
826
|
+
* of promising one. Reachable: reveal and lock are entitled separately, so a
|
|
827
|
+
* session can see a locked card it cannot unlock.
|
|
828
|
+
*/
|
|
829
|
+
lockedDescriptionWithoutUnlock: string;
|
|
830
|
+
/** Shown next to the control when a lock change failed. */
|
|
831
|
+
errorDescription: string;
|
|
832
|
+
}
|
|
804
833
|
/**
|
|
805
834
|
* Copy for the revealed card credentials. The values themselves never have a
|
|
806
835
|
* default here — the panel is handed them or renders the field blank.
|
|
@@ -830,6 +859,8 @@ interface CardDetailsPanelLabels {
|
|
|
830
859
|
cardFace: CardDetailsCardFaceLabels;
|
|
831
860
|
fields: CardDetailsFieldLabels;
|
|
832
861
|
actions: CardDetailsActionLabels;
|
|
862
|
+
nickname: CardDetailsNicknameLabels;
|
|
863
|
+
lock: CardDetailsLockLabels;
|
|
833
864
|
credentials: CardDetailsCredentialsLabels;
|
|
834
865
|
status: CardDetailsStatusScreenLabels;
|
|
835
866
|
}
|
|
@@ -918,6 +949,19 @@ interface CardDetailsFeatureLabels {
|
|
|
918
949
|
* API outcome, and because the panel closes as it fires.
|
|
919
950
|
*/
|
|
920
951
|
activationConflictToast: string;
|
|
952
|
+
/**
|
|
953
|
+
* Toast shown when a lock change is refused because the card is no longer in
|
|
954
|
+
* a state that accepts one. Same reason as `activationConflictToast`: it is an
|
|
955
|
+
* API outcome, not something the panel can know.
|
|
956
|
+
*/
|
|
957
|
+
lockConflictToast: string;
|
|
958
|
+
/** Confirmation toast after the nickname is saved. */
|
|
959
|
+
nicknameUpdatedToast: string;
|
|
960
|
+
/**
|
|
961
|
+
* Toast shown when a nickname save is refused because the card moved on. The
|
|
962
|
+
* editor closes as it fires, so the reader lands on the refetched name.
|
|
963
|
+
*/
|
|
964
|
+
nicknameConflictToast: string;
|
|
921
965
|
/**
|
|
922
966
|
* Replaces the panel's generic reveal error when the credentials call was
|
|
923
967
|
* refused (HTTP 403).
|
|
@@ -801,6 +801,35 @@ interface CardDetailsActionLabels {
|
|
|
801
801
|
/** The same control, once the credentials are on screen. */
|
|
802
802
|
hideCard: string;
|
|
803
803
|
}
|
|
804
|
+
/** Copy for the nickname row's inline editor. */
|
|
805
|
+
interface CardDetailsNicknameLabels {
|
|
806
|
+
/** Accessible name for the control that opens the editor. */
|
|
807
|
+
editAriaLabel: string;
|
|
808
|
+
/** Accessible name for the editor's text field. */
|
|
809
|
+
inputAriaLabel: string;
|
|
810
|
+
save: string;
|
|
811
|
+
cancel: string;
|
|
812
|
+
/** Shown under the editor when the save failed. */
|
|
813
|
+
errorDescription: string;
|
|
814
|
+
}
|
|
815
|
+
/** Copy for the card lock control and for the locked card it produces. */
|
|
816
|
+
interface CardDetailsLockLabels {
|
|
817
|
+
lockCard: string;
|
|
818
|
+
/** The same control, once the card is locked. */
|
|
819
|
+
unlockCard: string;
|
|
820
|
+
/** Pill stamped across the card face while it is locked. */
|
|
821
|
+
cardFaceLabel: string;
|
|
822
|
+
/** Sentence under the controls while the card is locked. */
|
|
823
|
+
lockedDescription: string;
|
|
824
|
+
/**
|
|
825
|
+
* The same sentence for a reader who has no Unlock control, so it stops short
|
|
826
|
+
* of promising one. Reachable: reveal and lock are entitled separately, so a
|
|
827
|
+
* session can see a locked card it cannot unlock.
|
|
828
|
+
*/
|
|
829
|
+
lockedDescriptionWithoutUnlock: string;
|
|
830
|
+
/** Shown next to the control when a lock change failed. */
|
|
831
|
+
errorDescription: string;
|
|
832
|
+
}
|
|
804
833
|
/**
|
|
805
834
|
* Copy for the revealed card credentials. The values themselves never have a
|
|
806
835
|
* default here — the panel is handed them or renders the field blank.
|
|
@@ -830,6 +859,8 @@ interface CardDetailsPanelLabels {
|
|
|
830
859
|
cardFace: CardDetailsCardFaceLabels;
|
|
831
860
|
fields: CardDetailsFieldLabels;
|
|
832
861
|
actions: CardDetailsActionLabels;
|
|
862
|
+
nickname: CardDetailsNicknameLabels;
|
|
863
|
+
lock: CardDetailsLockLabels;
|
|
833
864
|
credentials: CardDetailsCredentialsLabels;
|
|
834
865
|
status: CardDetailsStatusScreenLabels;
|
|
835
866
|
}
|
|
@@ -918,6 +949,19 @@ interface CardDetailsFeatureLabels {
|
|
|
918
949
|
* API outcome, and because the panel closes as it fires.
|
|
919
950
|
*/
|
|
920
951
|
activationConflictToast: string;
|
|
952
|
+
/**
|
|
953
|
+
* Toast shown when a lock change is refused because the card is no longer in
|
|
954
|
+
* a state that accepts one. Same reason as `activationConflictToast`: it is an
|
|
955
|
+
* API outcome, not something the panel can know.
|
|
956
|
+
*/
|
|
957
|
+
lockConflictToast: string;
|
|
958
|
+
/** Confirmation toast after the nickname is saved. */
|
|
959
|
+
nicknameUpdatedToast: string;
|
|
960
|
+
/**
|
|
961
|
+
* Toast shown when a nickname save is refused because the card moved on. The
|
|
962
|
+
* editor closes as it fires, so the reader lands on the refetched name.
|
|
963
|
+
*/
|
|
964
|
+
nicknameConflictToast: string;
|
|
921
965
|
/**
|
|
922
966
|
* Replaces the panel's generic reveal error when the credentials call was
|
|
923
967
|
* refused (HTTP 403).
|
|
@@ -970,6 +970,35 @@ interface CardDetailsActionLabels {
|
|
|
970
970
|
/** The same control, once the credentials are on screen. */
|
|
971
971
|
hideCard: string;
|
|
972
972
|
}
|
|
973
|
+
/** Copy for the nickname row's inline editor. */
|
|
974
|
+
interface CardDetailsNicknameLabels {
|
|
975
|
+
/** Accessible name for the control that opens the editor. */
|
|
976
|
+
editAriaLabel: string;
|
|
977
|
+
/** Accessible name for the editor's text field. */
|
|
978
|
+
inputAriaLabel: string;
|
|
979
|
+
save: string;
|
|
980
|
+
cancel: string;
|
|
981
|
+
/** Shown under the editor when the save failed. */
|
|
982
|
+
errorDescription: string;
|
|
983
|
+
}
|
|
984
|
+
/** Copy for the card lock control and for the locked card it produces. */
|
|
985
|
+
interface CardDetailsLockLabels {
|
|
986
|
+
lockCard: string;
|
|
987
|
+
/** The same control, once the card is locked. */
|
|
988
|
+
unlockCard: string;
|
|
989
|
+
/** Pill stamped across the card face while it is locked. */
|
|
990
|
+
cardFaceLabel: string;
|
|
991
|
+
/** Sentence under the controls while the card is locked. */
|
|
992
|
+
lockedDescription: string;
|
|
993
|
+
/**
|
|
994
|
+
* The same sentence for a reader who has no Unlock control, so it stops short
|
|
995
|
+
* of promising one. Reachable: reveal and lock are entitled separately, so a
|
|
996
|
+
* session can see a locked card it cannot unlock.
|
|
997
|
+
*/
|
|
998
|
+
lockedDescriptionWithoutUnlock: string;
|
|
999
|
+
/** Shown next to the control when a lock change failed. */
|
|
1000
|
+
errorDescription: string;
|
|
1001
|
+
}
|
|
973
1002
|
/**
|
|
974
1003
|
* Copy for the revealed card credentials. The values themselves never have a
|
|
975
1004
|
* default here — the panel is handed them or renders the field blank.
|
|
@@ -999,6 +1028,8 @@ interface CardDetailsPanelLabels {
|
|
|
999
1028
|
cardFace: CardDetailsCardFaceLabels;
|
|
1000
1029
|
fields: CardDetailsFieldLabels;
|
|
1001
1030
|
actions: CardDetailsActionLabels;
|
|
1031
|
+
nickname: CardDetailsNicknameLabels;
|
|
1032
|
+
lock: CardDetailsLockLabels;
|
|
1002
1033
|
credentials: CardDetailsCredentialsLabels;
|
|
1003
1034
|
status: CardDetailsStatusScreenLabels;
|
|
1004
1035
|
}
|
|
@@ -1087,6 +1118,19 @@ interface CardDetailsFeatureLabels {
|
|
|
1087
1118
|
* API outcome, and because the panel closes as it fires.
|
|
1088
1119
|
*/
|
|
1089
1120
|
activationConflictToast: string;
|
|
1121
|
+
/**
|
|
1122
|
+
* Toast shown when a lock change is refused because the card is no longer in
|
|
1123
|
+
* a state that accepts one. Same reason as `activationConflictToast`: it is an
|
|
1124
|
+
* API outcome, not something the panel can know.
|
|
1125
|
+
*/
|
|
1126
|
+
lockConflictToast: string;
|
|
1127
|
+
/** Confirmation toast after the nickname is saved. */
|
|
1128
|
+
nicknameUpdatedToast: string;
|
|
1129
|
+
/**
|
|
1130
|
+
* Toast shown when a nickname save is refused because the card moved on. The
|
|
1131
|
+
* editor closes as it fires, so the reader lands on the refetched name.
|
|
1132
|
+
*/
|
|
1133
|
+
nicknameConflictToast: string;
|
|
1090
1134
|
/**
|
|
1091
1135
|
* Replaces the panel's generic reveal error when the credentials call was
|
|
1092
1136
|
* refused (HTTP 403).
|
package/dist/libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index.js
CHANGED
|
@@ -4,5 +4,7 @@ import { useActivateCreditCardMutation as e, useActivateDebitCardMutation as t }
|
|
|
4
4
|
import { useCreditCardDetailsQuery as n } from "./index6.js";
|
|
5
5
|
import { useDebitCardCredentialsQuery as r } from "./index7.js";
|
|
6
6
|
import { useDebitCardDetailsQuery as i } from "./index8.js";
|
|
7
|
-
import {
|
|
8
|
-
|
|
7
|
+
import { useSetDebitCardLockStatusMutation as a } from "./index9.js";
|
|
8
|
+
import { useUpdateDebitCardMutation as o } from "./index10.js";
|
|
9
|
+
import { useVerifyDebitCardMutation as s } from "./index11.js";
|
|
10
|
+
export { e as useActivateCreditCardMutation, t as useActivateDebitCardMutation, n as useCreditCardDetailsQuery, r as useDebitCardCredentialsQuery, i as useDebitCardDetailsQuery, a as useSetDebitCardLockStatusMutation, o as useUpdateDebitCardMutation, s as useVerifyDebitCardMutation };
|
package/dist/libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index10.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { useEmbedApi as e } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
6
|
+
import { organizationHeaders as t } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
|
|
7
|
+
import { updateDebitCardMutation as n } from "../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
|
|
8
|
+
import "../../../shared/data-access/dist/index.js";
|
|
9
|
+
import { resyncCardViews as r, resyncOnConflict as i } from "./index3.js";
|
|
10
|
+
import { useMutation as a } from "@tanstack/react-query";
|
|
11
|
+
//#region ../../libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index10.js
|
|
12
|
+
function o() {
|
|
13
|
+
let { client: o, organizationId: s } = e();
|
|
14
|
+
return a({
|
|
15
|
+
...n({
|
|
16
|
+
client: o,
|
|
17
|
+
headers: t(s)
|
|
18
|
+
}),
|
|
19
|
+
onSuccess: r({
|
|
20
|
+
client: o,
|
|
21
|
+
organizationId: s,
|
|
22
|
+
program: "debit"
|
|
23
|
+
}),
|
|
24
|
+
onError: i({
|
|
25
|
+
client: o,
|
|
26
|
+
organizationId: s,
|
|
27
|
+
program: "debit"
|
|
28
|
+
})
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
export { o as useUpdateDebitCardMutation };
|
package/dist/libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index11.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { useEmbedApi as e } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
6
|
+
import { organizationHeaders as t } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
|
|
7
|
+
import { verifyDebitCardMutation as n } from "../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
|
|
8
|
+
import "../../../shared/data-access/dist/index.js";
|
|
9
|
+
import { resyncOnConflict as r } from "./index3.js";
|
|
10
|
+
import { useMutation as i } from "@tanstack/react-query";
|
|
11
|
+
//#region ../../libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index11.js
|
|
12
|
+
function a() {
|
|
13
|
+
let { client: a, organizationId: o } = e();
|
|
14
|
+
return i({
|
|
15
|
+
...n({
|
|
16
|
+
client: a,
|
|
17
|
+
headers: t(o)
|
|
18
|
+
}),
|
|
19
|
+
onError: r({
|
|
20
|
+
client: a,
|
|
21
|
+
organizationId: o,
|
|
22
|
+
program: "debit"
|
|
23
|
+
})
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { a as useVerifyDebitCardMutation };
|
package/dist/libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index9.js
CHANGED
|
@@ -4,24 +4,29 @@
|
|
|
4
4
|
"use client";
|
|
5
5
|
import { useEmbedApi as e } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
6
6
|
import { organizationHeaders as t } from "../../../shared/data-access/dist/lib/organizationHeaders.js";
|
|
7
|
-
import {
|
|
7
|
+
import { setDebitCardLockStatusMutation as n } from "../../../shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js";
|
|
8
8
|
import "../../../shared/data-access/dist/index.js";
|
|
9
|
-
import {
|
|
10
|
-
import { useMutation as
|
|
9
|
+
import { resyncCardViews as r, resyncOnConflict as i } from "./index3.js";
|
|
10
|
+
import { useMutation as a } from "@tanstack/react-query";
|
|
11
11
|
//#region ../../libs/tesouro-embedded-components-react/card-details-widget/data-access/dist/index9.js
|
|
12
|
-
function
|
|
13
|
-
let { client:
|
|
14
|
-
return
|
|
12
|
+
function o() {
|
|
13
|
+
let { client: o, organizationId: s } = e();
|
|
14
|
+
return a({
|
|
15
15
|
...n({
|
|
16
|
-
client:
|
|
17
|
-
headers: t(
|
|
16
|
+
client: o,
|
|
17
|
+
headers: t(s)
|
|
18
18
|
}),
|
|
19
|
-
|
|
20
|
-
client:
|
|
21
|
-
organizationId:
|
|
19
|
+
onSuccess: r({
|
|
20
|
+
client: o,
|
|
21
|
+
organizationId: s,
|
|
22
|
+
program: "debit"
|
|
23
|
+
}),
|
|
24
|
+
onError: i({
|
|
25
|
+
client: o,
|
|
26
|
+
organizationId: s,
|
|
22
27
|
program: "debit"
|
|
23
28
|
})
|
|
24
29
|
});
|
|
25
30
|
}
|
|
26
31
|
//#endregion
|
|
27
|
-
export {
|
|
32
|
+
export { o as useSetDebitCardLockStatusMutation };
|
package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index10.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { hasAnyScope as e } from "../../../shared/data-access/dist/lib/hasAnyScope.js";
|
|
2
|
+
import { Scope as t } from "../../../shared/data-access/dist/lib/scopes.js";
|
|
3
|
+
import "../../../shared/data-access/dist/index.js";
|
|
4
|
+
import { CardProgram as n } from "../../../shared/feature/dist/lib/card/cardProgram.js";
|
|
5
|
+
import "../../../shared/feature/dist/index.js";
|
|
6
|
+
//#region ../../libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index10.js
|
|
7
|
+
var r = "LOCKED", i = "PENDING_ACTIVATION", a = "CLOSED", o = { [n.Debit]: t.DebitCardLockOrg }, s = { [n.Debit]: t.DebitCardIssueOrg };
|
|
8
|
+
function c(e) {
|
|
9
|
+
return e?.cardStatus === r;
|
|
10
|
+
}
|
|
11
|
+
function l({ card: t, cardProgram: n, scopes: r }) {
|
|
12
|
+
if (!t || t.cardStatus === a || t.cardType === "PHYSICAL" && t.cardStatus === i) return !1;
|
|
13
|
+
let s = o[n];
|
|
14
|
+
return s ? e(new Set(r ?? []), [s]) : !1;
|
|
15
|
+
}
|
|
16
|
+
function u({ card: t, cardProgram: n, scopes: r }) {
|
|
17
|
+
if (!t || t.cardStatus === a) return !1;
|
|
18
|
+
let i = s[n];
|
|
19
|
+
return i ? e(new Set(r ?? []), [i]) : !1;
|
|
20
|
+
}
|
|
21
|
+
function d({ draft: e, current: t }) {
|
|
22
|
+
let n = e.trim();
|
|
23
|
+
return n ? n !== (t?.trim() ?? "") : !1;
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { u as canEditNickname, l as canLockCard, c as isCardLocked, d as isNicknameSaveable };
|
package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index11.js
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { toast as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
|
+
import { isApiConflictError as t } from "../../../shared/data-access/dist/lib/isApiConflictError.js";
|
|
7
|
+
import "../../../shared/data-access/dist/index.js";
|
|
8
|
+
import "../../../shared/ui/dist/index.js";
|
|
9
|
+
import { useIdScopedRequest as n } from "./index8.js";
|
|
10
|
+
import { useSetDebitCardLockStatusMutation as r } from "../../data-access/dist/index9.js";
|
|
11
|
+
import "../../data-access/dist/index.js";
|
|
12
|
+
import { canLockCard as i, isCardLocked as a } from "./index10.js";
|
|
13
|
+
import { useCallback as o, useState as s } from "react";
|
|
14
|
+
//#region ../../libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index11.js
|
|
15
|
+
function c({ cardId: c, cardProgram: l, card: u, scopes: d, conflictToast: f }) {
|
|
16
|
+
let [p, m] = s("idle"), { claim: h, isStale: g } = n({
|
|
17
|
+
id: c,
|
|
18
|
+
reset: () => {
|
|
19
|
+
m("idle");
|
|
20
|
+
}
|
|
21
|
+
}), { mutateAsync: _ } = r(), v = i({
|
|
22
|
+
card: u,
|
|
23
|
+
cardProgram: l,
|
|
24
|
+
scopes: d
|
|
25
|
+
}), y = a(u), b = o(async (n) => {
|
|
26
|
+
if (!v) return;
|
|
27
|
+
m("pending");
|
|
28
|
+
let r = h();
|
|
29
|
+
try {
|
|
30
|
+
if (await _({
|
|
31
|
+
path: { id: c },
|
|
32
|
+
body: { locked: n }
|
|
33
|
+
}), g(r)) return;
|
|
34
|
+
m("idle");
|
|
35
|
+
} catch (n) {
|
|
36
|
+
if (g(r)) return;
|
|
37
|
+
if (t(n)) {
|
|
38
|
+
e.error(f), m("idle");
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
m("errored");
|
|
42
|
+
}
|
|
43
|
+
}, [
|
|
44
|
+
v,
|
|
45
|
+
c,
|
|
46
|
+
h,
|
|
47
|
+
f,
|
|
48
|
+
g,
|
|
49
|
+
_
|
|
50
|
+
]), x = o(() => {
|
|
51
|
+
b(!0);
|
|
52
|
+
}, [b]), S = o(() => {
|
|
53
|
+
b(!1);
|
|
54
|
+
}, [b]);
|
|
55
|
+
return {
|
|
56
|
+
isLocked: y,
|
|
57
|
+
lockState: p,
|
|
58
|
+
onLockCard: v ? x : void 0,
|
|
59
|
+
onUnlockCard: v ? S : void 0
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
//#endregion
|
|
63
|
+
export { c as useCardLock };
|