@lydianpay/sdk-web 2.3.0 → 3.0.0

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 (90) hide show
  1. package/dist/chunks/{index-D40m-QBR.js → index-B-nXrLNN.js} +1 -1
  2. package/dist/chunks/{index-C4FghA5o.js → index-CoARqfML.js} +7575 -10102
  3. package/dist/chunks/{metamask-sdk-Dx44aYBT.js → metamask-sdk-DpI24rgz.js} +1 -1
  4. package/dist/chunks/mount-mNbGvMK_.js +12914 -0
  5. package/dist/lydian.js +1 -1
  6. package/dist/types/.tsbuildinfo +1 -1
  7. package/dist/types/constants.d.ts +0 -17
  8. package/dist/types/types.d.ts +6 -1
  9. package/dist/types/ui/Checkout.d.ts +42 -141
  10. package/dist/types/ui/brandingHelpers.d.ts +0 -4
  11. package/dist/types/ui/countdownBanner.d.ts +4 -1
  12. package/dist/types/ui/countries.d.ts +1 -1
  13. package/dist/types/ui/networkListHelpers.d.ts +2 -2
  14. package/dist/types/ui/optionFilter.d.ts +4 -1
  15. package/dist/types/ui/react/AlertBanner.d.ts +6 -0
  16. package/dist/types/ui/react/AssetSelectScreen.d.ts +6 -0
  17. package/dist/types/ui/react/CheckoutApp.d.ts +9 -0
  18. package/dist/types/ui/react/CloseTransactionDialogBody.d.ts +7 -0
  19. package/dist/types/ui/react/ConnectWithQrScreen.d.ts +6 -0
  20. package/dist/types/ui/react/ConnectingWalletScreen.d.ts +6 -0
  21. package/dist/types/ui/react/CopyField.d.ts +16 -0
  22. package/dist/types/ui/react/DetailCard.d.ts +12 -0
  23. package/dist/types/ui/react/DownloadWalletScreen.d.ts +4 -0
  24. package/dist/types/ui/react/FileDropzone.d.ts +8 -0
  25. package/dist/types/ui/react/FormField.d.ts +19 -0
  26. package/dist/types/ui/react/FormSelect.d.ts +12 -0
  27. package/dist/types/ui/react/KycScreen.d.ts +6 -0
  28. package/dist/types/ui/react/LoadingScreen.d.ts +9 -0
  29. package/dist/types/ui/react/NetworkSelectScreen.d.ts +6 -0
  30. package/dist/types/ui/{buttons/optionButton.d.ts → react/OptionButton.d.ts} +4 -3
  31. package/dist/types/ui/react/OtpInput.d.ts +4 -0
  32. package/dist/types/ui/react/PayButtons.d.ts +4 -0
  33. package/dist/types/ui/react/PaymentFailureScreen.d.ts +6 -0
  34. package/dist/types/ui/react/PaymentHeaderSection.d.ts +13 -0
  35. package/dist/types/ui/react/PaymentSuccessScreen.d.ts +6 -0
  36. package/dist/types/ui/react/RestoreDetailsDialogBody.d.ts +5 -0
  37. package/dist/types/ui/react/ScanToPayScreen.d.ts +6 -0
  38. package/dist/types/ui/react/SearchSelect.d.ts +11 -0
  39. package/dist/types/ui/react/SummaryRow.d.ts +11 -0
  40. package/dist/types/ui/react/TimerBanner.d.ts +4 -0
  41. package/dist/types/ui/react/WalletSelectScreen.d.ts +6 -0
  42. package/dist/types/ui/react/WarningIcon.d.ts +4 -0
  43. package/dist/types/ui/react/callbacksFixture.d.ts +6 -0
  44. package/dist/types/ui/react/checkoutStore.d.ts +138 -0
  45. package/dist/types/ui/react/checkoutTargets.d.ts +14 -0
  46. package/dist/types/ui/react/mount.d.ts +10 -0
  47. package/dist/types/ui/scanToPayView.d.ts +36 -0
  48. package/dist/types/ui/walletSelection.d.ts +4 -0
  49. package/dist/types/utils/collections.d.ts +0 -2
  50. package/dist/types/utils/index.d.ts +0 -8
  51. package/package.json +12 -3
  52. package/dist/types/ui/buttons/assetButton.d.ts +0 -2
  53. package/dist/types/ui/buttons/networkButton.d.ts +0 -2
  54. package/dist/types/ui/buttons/walletButton.d.ts +0 -6
  55. package/dist/types/ui/components/additionalInfoContent.d.ts +0 -1
  56. package/dist/types/ui/components/alertBanner.d.ts +0 -8
  57. package/dist/types/ui/components/assetSelectContent.d.ts +0 -1
  58. package/dist/types/ui/components/changePaymentMethodRow.d.ts +0 -1
  59. package/dist/types/ui/components/closeTransactionModal.d.ts +0 -1
  60. package/dist/types/ui/components/connectWithQrContent.d.ts +0 -1
  61. package/dist/types/ui/components/connectingWalletContent.d.ts +0 -1
  62. package/dist/types/ui/components/copyButton.d.ts +0 -7
  63. package/dist/types/ui/components/copyField.d.ts +0 -10
  64. package/dist/types/ui/components/detailCard.d.ts +0 -6
  65. package/dist/types/ui/components/detailRow.d.ts +0 -9
  66. package/dist/types/ui/components/downloadWalletContent.d.ts +0 -1
  67. package/dist/types/ui/components/featuredWalletBanner.d.ts +0 -3
  68. package/dist/types/ui/components/fieldShell.d.ts +0 -7
  69. package/dist/types/ui/components/fileDropzone.d.ts +0 -8
  70. package/dist/types/ui/components/formField.d.ts +0 -8
  71. package/dist/types/ui/components/formSelect.d.ts +0 -12
  72. package/dist/types/ui/components/loadingContent.d.ts +0 -1
  73. package/dist/types/ui/components/logoHeader.d.ts +0 -1
  74. package/dist/types/ui/components/networkPill.d.ts +0 -5
  75. package/dist/types/ui/components/networkSelectContent.d.ts +0 -1
  76. package/dist/types/ui/components/payButtons.d.ts +0 -1
  77. package/dist/types/ui/components/paymentFailureContent.d.ts +0 -1
  78. package/dist/types/ui/components/paymentHeader.d.ts +0 -1
  79. package/dist/types/ui/components/paymentSuccessContent.d.ts +0 -1
  80. package/dist/types/ui/components/restoreDetailsModal.d.ts +0 -1
  81. package/dist/types/ui/components/scanToPayContent.d.ts +0 -1
  82. package/dist/types/ui/components/searchSelectField.d.ts +0 -18
  83. package/dist/types/ui/components/summaryRow.d.ts +0 -7
  84. package/dist/types/ui/components/summaryRowGroup.d.ts +0 -7
  85. package/dist/types/ui/components/timerBanner.d.ts +0 -1
  86. package/dist/types/ui/components/underpaidContent.d.ts +0 -3
  87. package/dist/types/ui/components/walletSelectContent.d.ts +0 -1
  88. package/dist/types/ui/domHelpers.d.ts +0 -3
  89. package/dist/types/ui/restoreDetailsController.d.ts +0 -48
  90. package/dist/types/ui/searchSelectController.d.ts +0 -28
@@ -0,0 +1,6 @@
1
+ import { type Mock } from 'vitest';
2
+ import type { CheckoutCallbacks } from './checkoutStore';
3
+ export type CheckoutCallbackSpies = {
4
+ [K in keyof CheckoutCallbacks]: Mock;
5
+ };
6
+ export declare function callbacksSpy(): CheckoutCallbackSpies;
@@ -0,0 +1,138 @@
1
+ import type { CreateTransactionResponse, DisplayAsset, GetSessionResponse, GetTransactionResponse, WalletConnectWallet } from '../../types';
2
+ import type { CheckoutWallet } from '../../constants';
3
+ import type { RestoreContext } from '../sessionHelpers';
4
+ import type { KycFieldValues } from '../kycValidation';
5
+ export declare const SCREEN_NAMES: {
6
+ readonly PAY_BUTTONS: "payButtons";
7
+ readonly WALLETS: "wallets";
8
+ readonly DOWNLOAD_WALLET: "downloadWallet";
9
+ readonly NETWORKS: "networks";
10
+ readonly CONNECTING: "connecting";
11
+ readonly CONNECT_QR: "connectQr";
12
+ readonly ASSETS: "assets";
13
+ readonly KYC: "kyc";
14
+ readonly SCAN: "scan";
15
+ readonly SUCCESS: "success";
16
+ readonly FAILURE: "failure";
17
+ };
18
+ export type ActiveScreen = (typeof SCREEN_NAMES)[keyof typeof SCREEN_NAMES];
19
+ export interface CheckoutState {
20
+ activeScreen: ActiveScreen | null;
21
+ processingVisible: boolean;
22
+ session: GetSessionResponse | null;
23
+ cryptoTransaction: CreateTransactionResponse | null;
24
+ selectedAsset: DisplayAsset | null;
25
+ selectedNetwork: string | null;
26
+ selectedWallet: WalletConnectWallet | null;
27
+ walletConnectFlow: boolean;
28
+ hideNoWalletOption: boolean;
29
+ isCheckoutSettled: boolean;
30
+ settledTransaction: GetTransactionResponse | null;
31
+ overpaidUSD: number;
32
+ underpaidTransaction: GetTransactionResponse | null;
33
+ canSignWithConnectedWallet: boolean;
34
+ connectOpenWalletVisible: boolean;
35
+ connectOpenFailed: boolean;
36
+ connectPairingUri: string | null;
37
+ connectInstallHref: string | null;
38
+ termNoticeHtml: string;
39
+ errorBannerMessage: string | null;
40
+ loadingMessage: string | null;
41
+ loadingSubMessage: string | null;
42
+ loadingCancellable: boolean;
43
+ brandLogoUrl: string | null;
44
+ brandLogoAlt: string;
45
+ headerVisible: boolean;
46
+ logoHeaderVisible: boolean;
47
+ headerBackVisible: boolean;
48
+ headerMerchant: string | null;
49
+ headerAmount: string;
50
+ changeMethodVisible: boolean;
51
+ failureMessage: string;
52
+ kycStepSession: number;
53
+ kycFormSession: number;
54
+ kycDraft: KycDraft | null;
55
+ restoreContext: RestoreContext | null;
56
+ restoreDialogSession: number;
57
+ closeDialogVariant: CloseDialogVariant;
58
+ }
59
+ export type KycTextFields = Omit<KycFieldValues, 'documentType' | 'hasDocumentFront' | 'hasDocumentBack'>;
60
+ export interface KycDraft {
61
+ text: KycTextFields;
62
+ documentType: string;
63
+ documentFront: File | null;
64
+ documentBack: File | null;
65
+ storeKyc: boolean;
66
+ }
67
+ export type CloseDialogVariant = 'default' | 'signing';
68
+ export interface IslandClickEvent {
69
+ preventDefault(): void;
70
+ target: EventTarget | null;
71
+ }
72
+ export interface CheckoutCallbacks {
73
+ onDownloadWalletBack(): void;
74
+ onTimerClockElement(element: HTMLSpanElement | null): void;
75
+ onCryptoPay(): void;
76
+ onLoadingCancel(): void;
77
+ onHeaderBack(): void;
78
+ onChangePaymentMethod(): void;
79
+ onCloseFailure(): void;
80
+ onCloseDialogAccept(): void;
81
+ onCloseDialogReject(): void;
82
+ onSelectNetwork(networkCode: string): void;
83
+ onSelectAsset(assetCode: string): void;
84
+ onSelectWallet(wallet: CheckoutWallet): void;
85
+ onNoWallet(): void;
86
+ onDoneSuccess(): void;
87
+ onConnectQrElement(element: HTMLDivElement | null): void;
88
+ onCancelConnect(): void;
89
+ onOpenWalletApp(): void;
90
+ onOpenWalletUniversal(): void;
91
+ onOpenInWallet(event: IslandClickEvent): void;
92
+ onPanelClick(event: IslandClickEvent): void;
93
+ onDownloadQr(): void;
94
+ onChangeCoin(): void;
95
+ onCancel(): void;
96
+ onChooseDifferentAsset(): void;
97
+ onCanvasElement(element: HTMLDivElement | null): void;
98
+ onPanelElement(element: HTMLDivElement | null): void;
99
+ onCancelSelection(): void;
100
+ onSendRestoreOtp(details: {
101
+ email: string;
102
+ country: string;
103
+ }): Promise<void>;
104
+ onVerifyRestoreOtp(details: {
105
+ email: string;
106
+ country: string;
107
+ otp: string;
108
+ }): Promise<{
109
+ customerUUID?: string;
110
+ kycValidated?: boolean;
111
+ }>;
112
+ onRestoreVerified(customerUUID: string): Promise<void>;
113
+ onRestoreDocumentRequired(customerUUID: string, country: string): void;
114
+ onRestoreClose(): void;
115
+ onRestoreDetails(): void;
116
+ onKycSubmit(submission: {
117
+ values: KycFieldValues;
118
+ documentFront: File | null;
119
+ documentBack: File | null;
120
+ storeKyc: boolean;
121
+ }): void;
122
+ onKycCancel(): void;
123
+ onKycDraftSource(getDraft: (() => KycDraft) | null): void;
124
+ onKycWalletSummaryRow(): void;
125
+ onKycNetworkSummaryRow(): void;
126
+ onKycCoinSummaryRow(): void;
127
+ onWalletSummaryRow(): void;
128
+ onNetworkSummaryRow(): void;
129
+ onAssetWalletSummaryRow(): void;
130
+ }
131
+ export interface CheckoutStore {
132
+ getState(): CheckoutState;
133
+ setState(partial: Partial<CheckoutState>): void;
134
+ subscribe(listener: () => void): () => void;
135
+ reset(): void;
136
+ }
137
+ export declare function defaultCheckoutState(): CheckoutState;
138
+ export declare function createCheckoutStore(initial?: CheckoutState): CheckoutStore;
@@ -0,0 +1,14 @@
1
+ export declare const CHECKOUT_APP_TARGET_SELECTORS: {
2
+ readonly errorBannerSlot: "#errorBannerSlot";
3
+ readonly timerBannerSlot: "#timerBannerSlot";
4
+ readonly paymentHeaderSlot: "#paymentHeaderSlot";
5
+ readonly activeScreen: "#activeScreen";
6
+ readonly payButtonsSlot: "#payButtonsSlot";
7
+ readonly closeDialogBody: "#modalCloseTransactionModal .modal-body";
8
+ readonly restoreDialogBody: "#modalRestoreDetails .modal-body";
9
+ };
10
+ export type CheckoutAppTargets = Record<keyof typeof CHECKOUT_APP_TARGET_SELECTORS, HTMLElement>;
11
+ export declare function resolveCheckoutAppTargets(root: ParentNode | null | undefined): {
12
+ targets: CheckoutAppTargets | null;
13
+ missing: string[];
14
+ };
@@ -0,0 +1,10 @@
1
+ import { type CheckoutAppTargets } from './CheckoutApp';
2
+ import type { CheckoutCallbacks, CheckoutStore } from './checkoutStore';
3
+ export interface CheckoutAppHandle {
4
+ unmount(): void;
5
+ }
6
+ export declare function mountCheckoutApp({ targets, store, callbacks, }: {
7
+ targets: CheckoutAppTargets;
8
+ store: CheckoutStore;
9
+ callbacks: CheckoutCallbacks;
10
+ }): CheckoutAppHandle;
@@ -0,0 +1,36 @@
1
+ import type { CreateTransactionResponse, DisplayAsset, GetTransactionResponse, WalletConnectWallet } from '../types';
2
+ export interface ScanToPayView {
3
+ heading: string;
4
+ amountLabel: string;
5
+ assetTotal: string;
6
+ copyableAmount: string;
7
+ subtotal: string;
8
+ networkFee: string;
9
+ markup: string | null;
10
+ address: string;
11
+ networkName: string;
12
+ networkLogoUrl: string;
13
+ openInWalletVisible: boolean;
14
+ openInWalletLabel: string;
15
+ qrMissing: boolean;
16
+ }
17
+ export interface UnderpaidView {
18
+ total: string;
19
+ alreadyPaid: string;
20
+ remaining: string;
21
+ ledger: {
22
+ key: string;
23
+ label: string;
24
+ value: string;
25
+ }[];
26
+ }
27
+ export declare function underpaidView(transaction: GetTransactionResponse | null | undefined): UnderpaidView | null;
28
+ export declare function scanToPayView({ cryptoTransaction, selectedAsset, selectedNetwork, selectedWallet, walletConnectFlow, canSignWithConnectedWallet, underpaid, }: {
29
+ cryptoTransaction: CreateTransactionResponse | null;
30
+ selectedAsset: DisplayAsset | null;
31
+ selectedNetwork: string | null;
32
+ selectedWallet: WalletConnectWallet | null;
33
+ walletConnectFlow: boolean;
34
+ canSignWithConnectedWallet: boolean;
35
+ underpaid: boolean;
36
+ }): ScanToPayView;
@@ -1,6 +1,10 @@
1
1
  import { CheckoutWallet } from '../constants';
2
2
  import { WalletConnectWallet } from '../types';
3
3
  export declare function otherWalletsTile(): CheckoutWallet;
4
+ export declare function isConnectableWallet({ walletConnect, selectedWallet, }: {
5
+ walletConnect: boolean;
6
+ selectedWallet: WalletConnectWallet | null;
7
+ }): boolean;
4
8
  export declare function getWalletSummaryValue({ walletConnect, selectedWallet, }: {
5
9
  walletConnect: boolean;
6
10
  selectedWallet: WalletConnectWallet | null;
@@ -1,5 +1,3 @@
1
- /** The items in first-seen order, with later duplicates dropped. */
2
- export declare function unique<T>(items: T[]): T[];
3
1
  /**
4
2
  * The items with every match first, leaving both the matches and the rest in their
5
3
  * original order — the source order, not the order a caller listed its targets in.
@@ -1,11 +1,3 @@
1
- export declare function capitalizeFirstLetter(str: string): string;
2
- /**
3
- * Formats a number as currency using Intl.NumberFormat
4
- * @param amount - The numeric amount to format
5
- * @param currency - The currency code (USD or TRY)
6
- * @returns Formatted currency string
7
- */
8
- export declare function formatCurrency(amount: number, currency?: string | null, maximumFractionDigits?: number): string;
9
1
  export declare function formatExchangeRate(asset: string, cryptoRatePerUSD: number, fxRateToUSD: number, currency: string): string;
10
2
  export declare function formatDateForTransactionDetails(isoDateString: string): string;
11
3
  export declare function formatDateShort(isoDateString?: string | null): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lydianpay/sdk-web",
3
- "version": "2.3.0",
3
+ "version": "3.0.0",
4
4
  "description": "Drop-in crypto payment checkout for the web — a <lydian-checkout> web component and window.Lydian API across 20+ chains and major stablecoins.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -49,36 +49,45 @@
49
49
  "test:coverage": "vitest run --coverage --coverage.provider=v8 --coverage.reporter=lcov --coverage.reporter=text",
50
50
  "build:css": "npx tailwindcss -i src/ui/lydian.css -o ./src/ui/lydian.generated.css --minify",
51
51
  "build:types": "tsc -p tsconfig.build.json",
52
+ "bundle:ledger": "node scripts/bundle-ledger.mjs",
52
53
  "build": "npm run build:css && vite build && npm run build:types",
53
54
  "build:watch": "npm run build:css && vite build --watch",
54
- "serve": "live-server --cors --no-browser --port=9999 dist",
55
+ "serve": "cp scripts/bundle-check.html dist/index.html && vite preview --outDir dist --port 9999 --strictPort",
55
56
  "dev": "run-p dev:css dev:vite",
56
57
  "dev:css": "tailwindcss -i src/ui/lydian.css -o src/ui/lydian.generated.css --minify --watch",
57
58
  "dev:vite": "vite"
58
59
  },
59
60
  "devDependencies": {
60
61
  "@eslint/js": "^9.0.0",
62
+ "@testing-library/dom": "^10.4.1",
63
+ "@testing-library/react": "^16.3.2",
64
+ "@testing-library/user-event": "^14.6.5",
61
65
  "@types/qrcode": "^1.5.5",
66
+ "@types/react": "^19.2.18",
67
+ "@types/react-dom": "^19.2.4",
62
68
  "@vitest/coverage-v8": "^3.0.0",
63
69
  "autoprefixer": "^10.4.0",
64
70
  "eslint": "^9.0.0",
65
71
  "globals": "^16.0.0",
72
+ "jsdom": "^29.1.1",
66
73
  "npm-run-all2": "^7.0.2",
67
74
  "postcss": "^8.4.6",
68
75
  "prettier": "3.9.5",
69
76
  "qrcode": "^1.5.4",
70
77
  "tailwindcss": "^3.0.0",
71
- "tsx-dom": "^3.1.0",
72
78
  "typescript": "^5.0.0",
73
79
  "typescript-eslint": "^8.0.0",
74
80
  "vite": "^6.3.5",
75
81
  "vitest": "^3.0.0"
76
82
  },
77
83
  "dependencies": {
84
+ "@lydianpay/frontend-shared-helpers": "1.1.0",
78
85
  "@lydianpay/lydianconnect": "^1.3.0",
79
86
  "@lydianpay/lydianconnect-catalog": "^1.3.1",
80
87
  "@solana/qr-code-styling": "^1.6.0",
81
88
  "dompurify": "^3.4.12",
89
+ "react": "^19.2.8",
90
+ "react-dom": "^19.2.8",
82
91
  "viem": "^2.30.6"
83
92
  }
84
93
  }
@@ -1,2 +0,0 @@
1
- import { DisplayAsset } from '../../types';
2
- export default function AssetButton(asset: DisplayAsset, cryptoTotal?: string): string;
@@ -1,2 +0,0 @@
1
- import { Network } from '../../types';
2
- export default function NetworkButton(network: Network): string;
@@ -1,6 +0,0 @@
1
- import { CheckoutWallet } from '../../constants';
2
- export default function WalletButton({ wallet, badgeLabel, iconSvg, }: {
3
- wallet: CheckoutWallet;
4
- badgeLabel?: string;
5
- iconSvg?: string;
6
- }): string;
@@ -1 +0,0 @@
1
- export default function AdditionalInfoContent(): string;
@@ -1,8 +0,0 @@
1
- export type AlertVariant = 'warning' | 'error';
2
- export type AlertBannerProps = {
3
- message: string;
4
- variant?: AlertVariant;
5
- linkText?: string;
6
- linkId?: string;
7
- };
8
- export default function AlertBanner({ message, variant, linkText, linkId, }: AlertBannerProps): string;
@@ -1 +0,0 @@
1
- export default function AssetSelectContent(): string;
@@ -1 +0,0 @@
1
- export default function ChangePaymentMethodRow(): string;
@@ -1 +0,0 @@
1
- export default function CloseTransactionModal(): string;
@@ -1 +0,0 @@
1
- export default function ConnectWithQrContent(): string;
@@ -1 +0,0 @@
1
- export default function ConnectingWalletContent(): string;
@@ -1,7 +0,0 @@
1
- export type CopyButtonProps = {
2
- label: string;
3
- copyLabel?: string;
4
- buttonClass?: string;
5
- feedbackClass?: string;
6
- };
7
- export default function CopyButton({ label, copyLabel, buttonClass, feedbackClass, }: CopyButtonProps): string;
@@ -1,10 +0,0 @@
1
- export type CopyFieldProps = {
2
- valueId: string;
3
- label: string;
4
- copyLabel?: string;
5
- valueClass?: string;
6
- valueSizeClass?: string;
7
- containerClass?: string;
8
- wrap?: boolean;
9
- };
10
- export default function CopyField({ valueId, label, copyLabel, valueClass, valueSizeClass, containerClass, wrap, }: CopyFieldProps): string;
@@ -1,6 +0,0 @@
1
- export type DetailCardProps = {
2
- heading: string;
3
- rows: string[];
4
- rowsId?: string;
5
- };
6
- export default function DetailCard({ heading, rows, rowsId }: DetailCardProps): string;
@@ -1,9 +0,0 @@
1
- export type DetailRowProps = {
2
- label: string;
3
- valueId?: string;
4
- value?: string;
5
- emphasis?: boolean;
6
- rowId?: string;
7
- rowClass?: string;
8
- };
9
- export default function DetailRow({ label, valueId, value, emphasis, rowId, rowClass, }: DetailRowProps): string;
@@ -1 +0,0 @@
1
- export default function DownloadWalletContent(): string;
@@ -1,3 +0,0 @@
1
- export default function FeaturedWalletBanner({ note }: {
2
- note: string;
3
- }): string;
@@ -1,7 +0,0 @@
1
- export declare function fieldShell({ id, label, control, labelFor, }: {
2
- id: string;
3
- label: string;
4
- control: string;
5
- labelFor: string;
6
- }): string;
7
- export declare function fieldCaret(id?: string): string;
@@ -1,8 +0,0 @@
1
- export type FileDropzoneProps = {
2
- inputId: string;
3
- label: string;
4
- hint?: string;
5
- };
6
- export default function FileDropzone({ inputId, label, hint }: FileDropzoneProps): string;
7
- export declare function resetFileDropzones(root: ParentNode): void;
8
- export declare function wireFileDropzones(root: ShadowRoot): void;
@@ -1,8 +0,0 @@
1
- export type TextFieldProps = {
2
- id: string;
3
- label: string;
4
- placeholder: string;
5
- type?: string;
6
- autocomplete?: string;
7
- };
8
- export default function TextField({ id, label, placeholder, type, autocomplete, }: TextFieldProps): string;
@@ -1,12 +0,0 @@
1
- export type SelectOption = {
2
- value: string;
3
- label: string;
4
- };
5
- export type SelectFieldProps = {
6
- id: string;
7
- label: string;
8
- options: SelectOption[];
9
- placeholder?: string;
10
- ariaLabel?: string;
11
- };
12
- export default function SelectField({ id, label, options, placeholder, ariaLabel, }: SelectFieldProps): string;
@@ -1 +0,0 @@
1
- export default function LoadingContent(): string;
@@ -1 +0,0 @@
1
- export default function LogoHeader(): string;
@@ -1,5 +0,0 @@
1
- export type NetworkPillProps = {
2
- logoId: string;
3
- nameId: string;
4
- };
5
- export default function NetworkPill({ logoId, nameId }: NetworkPillProps): string;
@@ -1 +0,0 @@
1
- export default function NetworkSelectContent(): string;
@@ -1 +0,0 @@
1
- export default function PayButtons(): string;
@@ -1 +0,0 @@
1
- export default function PaymentFailureContent(): string;
@@ -1 +0,0 @@
1
- export default function PaymentHeader(): string;
@@ -1 +0,0 @@
1
- export default function PaymentSuccessContent(): string;
@@ -1 +0,0 @@
1
- export default function RestoreDetailsModal(): string;
@@ -1 +0,0 @@
1
- export default function ScanToPayContent(): string;
@@ -1,18 +0,0 @@
1
- import type { SelectOption } from './formSelect';
2
- export type SearchSelectFieldProps = {
3
- id: string;
4
- label: string;
5
- placeholder?: string;
6
- ariaLabel?: string;
7
- };
8
- export default function SearchSelectField({ id, label, placeholder, ariaLabel, }: SearchSelectFieldProps): string;
9
- export declare const searchInputId: (id: string) => string;
10
- export declare const listId: (id: string) => string;
11
- export declare const caretId: (id: string) => string;
12
- export declare const optionId: (id: string, index: number) => string;
13
- export declare function searchSelectOptionList({ id, options, selectedValue, query, }: {
14
- id: string;
15
- options: SelectOption[];
16
- selectedValue: string;
17
- query: string;
18
- }): string;
@@ -1,7 +0,0 @@
1
- export type SummaryRowProps = {
2
- id: string;
3
- leadingLabel: string;
4
- logoId: string;
5
- nameId: string;
6
- };
7
- export default function SummaryRow({ id, leadingLabel, logoId, nameId }: SummaryRowProps): string;
@@ -1,7 +0,0 @@
1
- import { SummaryRowProps } from './summaryRow';
2
- export type SummaryRowGroupItem = SummaryRowProps & {
3
- wrapperId?: string;
4
- };
5
- export default function SummaryRowGroup({ rows }: {
6
- rows: SummaryRowGroupItem[];
7
- }): string;
@@ -1 +0,0 @@
1
- export default function TimerBanner(): string;
@@ -1,3 +0,0 @@
1
- export declare function UnderpaidNotice(): string;
2
- export default function UnderpaidContent(): string;
3
- export declare function UnderpaidActions(): string;
@@ -1 +0,0 @@
1
- export default function WalletSelectContent(): string;
@@ -1,3 +0,0 @@
1
- export declare function setText(root: ShadowRoot | null | undefined, elementId: string, text: string): void;
2
- export declare function revealScreen(isEmbedded: boolean, embedded: HTMLElement | null, modal: HTMLElement | null): void;
3
- export declare function hideScreen(embedded: HTMLElement | null, modal: HTMLElement | null): void;
@@ -1,48 +0,0 @@
1
- import type { API } from '../network';
2
- export interface RestoreDetailsDeps {
3
- api: Pick<API, 'sendCustomerOTP' | 'authenticateCustomerOTP'>;
4
- onRestored: (customerUUID: string) => Promise<void>;
5
- onDocumentRequired: (customerUUID: string, country: string) => void;
6
- }
7
- export declare class RestoreDetailsController {
8
- private readonly root;
9
- private readonly deps;
10
- private readonly dialog;
11
- private readonly views;
12
- private readonly emailInput;
13
- private readonly countryInput;
14
- private readonly countryCombobox;
15
- private readonly emailError;
16
- private readonly otpError;
17
- private readonly otpEmailLabel;
18
- private readonly processingMessage;
19
- private readonly errorTitle;
20
- private readonly errorMessage;
21
- private readonly retryButton;
22
- private readonly sendAgainButton;
23
- private readonly otpBoxes;
24
- private email;
25
- private country;
26
- private resending;
27
- constructor(root: ShadowRoot, deps: RestoreDetailsDeps);
28
- private el;
29
- private wireControls;
30
- private readOtp;
31
- private clearOtp;
32
- private focusBox;
33
- private fillOtpFrom;
34
- private wireOtpBoxes;
35
- private handleOtpInput;
36
- private handleOtpKeydown;
37
- private handleOtpPaste;
38
- private showView;
39
- private setFieldError;
40
- private setProcessing;
41
- private showError;
42
- private returnToEmailStep;
43
- private open;
44
- private sendOtp;
45
- private showOtpStep;
46
- private sendOtpAgain;
47
- private verifyOtp;
48
- }
@@ -1,28 +0,0 @@
1
- import type { SelectOption } from './components/formSelect';
2
- export type SearchSelectOptions = {
3
- id: string;
4
- options: SelectOption[];
5
- onChange?: (value: string) => void;
6
- };
7
- export declare class SearchSelectController {
8
- private readonly elements;
9
- private readonly caret;
10
- private readonly options;
11
- private readonly onChange?;
12
- private visibleOptions;
13
- private activeIndex;
14
- constructor(root: ShadowRoot | HTMLElement, { id, options, onChange }: SearchSelectOptions);
15
- /** Sets the selection from a code, or clears it when the code is unknown. */
16
- setValue(code: string): void;
17
- reset(): void;
18
- private findOption;
19
- private wire;
20
- private onKeyDown;
21
- private isOpen;
22
- private open;
23
- private highlight;
24
- private close;
25
- private dismiss;
26
- private commitTypedText;
27
- private commitSelection;
28
- }