@lydianpay/sdk-web 2.0.2 → 2.0.3

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.
@@ -109,7 +109,8 @@ export declare class Checkout extends HTMLElement {
109
109
  private city;
110
110
  private region;
111
111
  private postalCode;
112
- private country;
112
+ private countryInput;
113
+ private countryCombobox;
113
114
  private documentType;
114
115
  private documentFileFront;
115
116
  private documentFileBackContainer;
@@ -122,6 +123,7 @@ export declare class Checkout extends HTMLElement {
122
123
  private kycStepBasic;
123
124
  private kycStepAddress;
124
125
  private kycStepDocument;
126
+ private btnKycWalletSummaryRow;
125
127
  private btnKycNetworkSummaryRow;
126
128
  private btnCoinSummaryRow;
127
129
  private kycSteps;
@@ -1,5 +1,6 @@
1
1
  import { CheckoutWallet } from '../../constants';
2
- export default function WalletButton({ wallet, badgeLabel, }: {
2
+ export default function WalletButton({ wallet, badgeLabel, iconSvg, }: {
3
3
  wallet: CheckoutWallet;
4
4
  badgeLabel?: string;
5
+ iconSvg?: string;
5
6
  }): string;
@@ -0,0 +1,7 @@
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;
@@ -16,3 +16,4 @@ export declare const checkMarkIconSvg = "<svg width=\"14\" height=\"14\" viewBox
16
16
  export declare const xCircleIconSvg = "<svg width=\"22\" height=\"22\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <circle cx=\"12\" cy=\"12\" r=\"11\" stroke=\"currentColor\" stroke-width=\"1.6\"/>\n <path d=\"M9 9l6 6M15 9l-6 6\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\"/>\n</svg>";
17
17
  export declare const alertCircleOutlineIconSvg = "<svg width=\"40\" height=\"40\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <circle cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" stroke-width=\"1.6\"/>\n <path d=\"M12 7v6\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\"/>\n <circle cx=\"12\" cy=\"16.5\" r=\"1.1\" fill=\"currentColor\"/>\n</svg>";
18
18
  export declare const walletIconSvg = "<svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M18 7V5.5A1.5 1.5 0 0 0 16.5 4H5a2 2 0 0 0 0 4h13a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <circle cx=\"16.5\" cy=\"13.5\" r=\"1.25\" fill=\"currentColor\"/>\n</svg>";
19
+ export declare const otherWalletsIconSvg = "<svg width=\"32\" height=\"32\" viewBox=\"0 0 32 32\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <circle cx=\"8\" cy=\"16\" r=\"2.5\" fill=\"currentColor\"/>\n <circle cx=\"16\" cy=\"16\" r=\"2.5\" fill=\"currentColor\"/>\n <circle cx=\"24\" cy=\"16\" r=\"2.5\" fill=\"currentColor\"/>\n</svg>";
@@ -0,0 +1,18 @@
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,6 +1,10 @@
1
1
  import { AllowedWalletConfig, Asset, GetSessionResponse } from '../types';
2
2
  export declare function resolveAllowedAssets(allowedCrypto: string[] | null | undefined): Asset[];
3
3
  export declare function collectNetworksFromAssets(allowedAssets: Asset[]): string[];
4
+ export declare function hoistRecommendedNetwork({ networks, recommendedNetwork, }: {
5
+ networks: string[];
6
+ recommendedNetwork: string | null | undefined;
7
+ }): string[];
4
8
  export declare function filterAssetsByNetwork(allowedAssets: Asset[], networkCode: string): Asset[];
5
9
  type NetworkFeeSource = Pick<GetSessionResponse, 'customFlatFeePerNetwork' | 'customFeePercentagePerNetwork'>;
6
10
  type CryptoTotalSource = Pick<GetSessionResponse, 'calculatedCryptoTotals' | 'calculatedCryptoTotalsPerNetwork'>;
@@ -0,0 +1,8 @@
1
+ import type { SelectOption } from './components/formSelect';
2
+ export declare function filterOptions(options: SelectOption[], query: string): SelectOption[];
3
+ export declare function resolveOption(options: SelectOption[], query: string): SelectOption | null;
4
+ export declare function initialHighlightIndex(options: SelectOption[], value: string | undefined): number;
5
+ export declare function wrapIndex({ index, count }: {
6
+ index: number;
7
+ count: number;
8
+ }): number;
@@ -10,7 +10,8 @@ export declare class RestoreDetailsController {
10
10
  private readonly dialog;
11
11
  private readonly views;
12
12
  private readonly emailInput;
13
- private readonly countrySelect;
13
+ private readonly countryInput;
14
+ private readonly countryCombobox;
14
15
  private readonly emailError;
15
16
  private readonly otpError;
16
17
  private readonly otpEmailLabel;
@@ -0,0 +1,28 @@
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
+ }
@@ -0,0 +1,19 @@
1
+ import { CheckoutWallet } from '../constants';
2
+ import { WalletConnectWallet } from '../types';
3
+ export declare function otherWalletsTile(): CheckoutWallet;
4
+ export declare function getWalletSummaryValue({ walletConnect, selectedWallet, }: {
5
+ walletConnect: boolean;
6
+ selectedWallet: WalletConnectWallet | null;
7
+ }): {
8
+ img: string;
9
+ label: string;
10
+ } | null;
11
+ export declare function getScanPayHeading({ walletConnect, selectedWallet, }: {
12
+ walletConnect: boolean;
13
+ selectedWallet: WalletConnectWallet | null;
14
+ }): {
15
+ key: string;
16
+ params?: {
17
+ wallet: string;
18
+ };
19
+ };
@@ -1,5 +1,12 @@
1
1
  /** The items in first-seen order, with later duplicates dropped. */
2
2
  export declare function unique<T>(items: T[]): T[];
3
+ /**
4
+ * The items with every match first, leaving both the matches and the rest in their
5
+ * original order — the source order, not the order a caller listed its targets in.
6
+ * Relies on Array.prototype.sort being stable, which it has been required to be
7
+ * since ES2019.
8
+ */
9
+ export declare function matchesFirst<T>(items: T[], isMatch: (item: T) => boolean): T[];
3
10
  /**
4
11
  * Collects `[key, value]` entries into a Map of key to every value seen for it,
5
12
  * both in first-seen order. Keys with one value still get an array.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lydianpay/sdk-web",
3
- "version": "2.0.2",
3
+ "version": "2.0.3",
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": {