@0xsquid/ui 2.6.7 → 2.6.8-send-beta.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.
- package/dist/cjs/index.js +17647 -18101
- package/dist/cjs/types/components/controls/LargeNumericInput.d.ts +2 -6
- package/dist/cjs/types/components/controls/NumericInput.d.ts +14 -13
- package/dist/cjs/types/components/icons/SwapInputs.d.ts +4 -1
- package/dist/cjs/types/components/lists/HistoryItem.d.ts +2 -1
- package/dist/cjs/types/components/views/SwapProgressView.d.ts +2 -1
- package/dist/cjs/types/core/design-system.d.ts +1 -0
- package/dist/cjs/types/hooks/useNumericInput.d.ts +34 -0
- package/dist/cjs/types/stories/views/SwapProgressView.stories.d.ts +1 -0
- package/dist/esm/index.js +17647 -18101
- package/dist/esm/types/components/controls/LargeNumericInput.d.ts +2 -6
- package/dist/esm/types/components/controls/NumericInput.d.ts +14 -13
- package/dist/esm/types/components/icons/SwapInputs.d.ts +4 -1
- package/dist/esm/types/components/lists/HistoryItem.d.ts +2 -1
- package/dist/esm/types/components/views/SwapProgressView.d.ts +2 -1
- package/dist/esm/types/core/design-system.d.ts +1 -0
- package/dist/esm/types/hooks/useNumericInput.d.ts +34 -0
- package/dist/esm/types/stories/views/SwapProgressView.stories.d.ts +1 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +25 -21
- package/package.json +1 -1
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
onChange: (value: string) => void;
|
|
4
|
-
}
|
|
5
|
-
export declare function LargeNumericInput({ onChange, value }: LargeNumericInputProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
export {};
|
|
1
|
+
import { type NumericInputProps } from "./NumericInput";
|
|
2
|
+
export declare function LargeNumericInput({ balance, token, onAmountChange, forcedAmount, maxUsdDecimals, formatIfVerySmall, inputModeButton, balanceButton, debounceInput, }: NumericInputProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { type SwapDirection } from "../../types/components";
|
|
3
3
|
import { type TooltipProps } from "./Tooltip";
|
|
4
|
-
interface Token {
|
|
4
|
+
export interface Token {
|
|
5
5
|
price: number;
|
|
6
6
|
symbol: string;
|
|
7
7
|
decimals: number;
|
|
8
8
|
}
|
|
9
|
-
interface NumericInputProps
|
|
9
|
+
export interface NumericInputProps {
|
|
10
10
|
token: Token;
|
|
11
11
|
onAmountChange: (tokenAmount: string) => void;
|
|
12
12
|
forcedAmount?: string;
|
|
@@ -14,27 +14,28 @@ interface NumericInputProps extends React.InputHTMLAttributes<HTMLInputElement>
|
|
|
14
14
|
token: string;
|
|
15
15
|
usd: string;
|
|
16
16
|
};
|
|
17
|
-
showDetails?: boolean;
|
|
18
|
-
isLoading?: boolean;
|
|
19
|
-
error?: {
|
|
20
|
-
message: string;
|
|
21
|
-
};
|
|
22
17
|
balance?: string;
|
|
23
|
-
priceImpactPercentage?: string;
|
|
24
|
-
criticalPriceImpactPercentage?: number;
|
|
25
|
-
direction?: SwapDirection;
|
|
26
18
|
inputModeButton?: {
|
|
27
19
|
usdModeTooltip?: Omit<TooltipProps, "children">;
|
|
28
20
|
tokenModeTooltip?: Omit<TooltipProps, "children">;
|
|
29
21
|
amountUsd?: string;
|
|
30
22
|
};
|
|
31
23
|
maxUsdDecimals?: number;
|
|
32
|
-
isInteractive?: boolean;
|
|
33
24
|
balanceButton?: {
|
|
34
25
|
tooltip?: Omit<TooltipProps, "children">;
|
|
35
26
|
hideMaxChip?: boolean;
|
|
36
27
|
};
|
|
37
28
|
debounceInput?: boolean;
|
|
38
29
|
}
|
|
39
|
-
export
|
|
40
|
-
|
|
30
|
+
export interface Props extends NumericInputProps, React.InputHTMLAttributes<HTMLInputElement> {
|
|
31
|
+
direction?: SwapDirection;
|
|
32
|
+
showDetails?: boolean;
|
|
33
|
+
isLoading?: boolean;
|
|
34
|
+
isInteractive?: boolean;
|
|
35
|
+
priceImpactPercentage?: string;
|
|
36
|
+
criticalPriceImpactPercentage?: number;
|
|
37
|
+
error?: {
|
|
38
|
+
message: string;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
export declare function NumericInput({ priceImpactPercentage, balance, error, criticalPriceImpactPercentage, token, onAmountChange, forcedAmount, maxUsdDecimals, formatIfVerySmall, showDetails, isLoading, direction, inputModeButton, isInteractive, balanceButton, debounceInput, ...props }: Props): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
export declare function SwapInputsIcon(
|
|
1
|
+
export declare function SwapInputsIcon({ size, className, }: {
|
|
2
|
+
size?: string;
|
|
3
|
+
className?: string;
|
|
4
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
2
5
|
export declare function SwapIcon({ size, className, }: {
|
|
3
6
|
size?: string;
|
|
4
7
|
className?: string;
|
|
@@ -13,6 +13,7 @@ interface HistoryItemProps {
|
|
|
13
13
|
onClick?: () => void;
|
|
14
14
|
warningLabel?: string;
|
|
15
15
|
dropdownMenuContent?: React.ReactNode;
|
|
16
|
+
txType: "swap" | "send";
|
|
16
17
|
}
|
|
17
|
-
export declare function HistoryItem({ firstImageUrl, secondImageUrl, dateCompleted, fromAmount, fromLabel, toAmount, toLabel, dropdownMenuContent, itemsContainerRef, status, warningLabel, onClick, }: HistoryItemProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare function HistoryItem({ firstImageUrl, secondImageUrl, dateCompleted, fromAmount, fromLabel, toAmount, toLabel, dropdownMenuContent, itemsContainerRef, status, warningLabel, txType, onClick, }: HistoryItemProps): import("react/jsx-runtime").JSX.Element;
|
|
18
19
|
export {};
|
|
@@ -10,7 +10,7 @@ interface Token {
|
|
|
10
10
|
logoUrl: string;
|
|
11
11
|
bgColor: string;
|
|
12
12
|
}
|
|
13
|
-
export declare function SwapProgressView({ steps, isOpen, handleClose, handleComplete, supportLink, fromAmount, fromChain, fromToken, toAmount, toChain, toToken, fromAddressFormatted, toAddressFormatted, swapState, estimatedTimeToComplete, footerButton, refundTokenSymbol, addGasLink, shareSwapDropdownContent, }: {
|
|
13
|
+
export declare function SwapProgressView({ steps, isOpen, handleClose, handleComplete, supportLink, fromAmount, fromChain, fromToken, toAmount, toChain, toToken, fromAddressFormatted, toAddressFormatted, swapState, estimatedTimeToComplete, footerButton, refundTokenSymbol, addGasLink, shareSwapDropdownContent, isSendTransaction, }: {
|
|
14
14
|
steps: SwapStep[];
|
|
15
15
|
handleClose?: (swapState: SwapState) => void;
|
|
16
16
|
handleComplete?: () => void;
|
|
@@ -30,5 +30,6 @@ export declare function SwapProgressView({ steps, isOpen, handleClose, handleCom
|
|
|
30
30
|
footerButton?: SwapStepsCollapsedFooterButton;
|
|
31
31
|
refundTokenSymbol?: string;
|
|
32
32
|
addGasLink?: string;
|
|
33
|
+
isSendTransaction?: boolean;
|
|
33
34
|
}): import("react/jsx-runtime").JSX.Element;
|
|
34
35
|
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type ChangeEvent } from "react";
|
|
2
|
+
import { type Token } from "../components/controls/NumericInput";
|
|
3
|
+
export declare enum UserInputType {
|
|
4
|
+
TOKEN = 0,
|
|
5
|
+
USD = 1
|
|
6
|
+
}
|
|
7
|
+
interface UseNumericInputOptions {
|
|
8
|
+
token: Pick<Token, "decimals" | "price">;
|
|
9
|
+
onAmountChange: (tokenAmount: string) => void;
|
|
10
|
+
forcedAmount?: string;
|
|
11
|
+
formatIfVerySmall: {
|
|
12
|
+
token: string;
|
|
13
|
+
usd: string;
|
|
14
|
+
};
|
|
15
|
+
balance: string;
|
|
16
|
+
inputModeButton?: {
|
|
17
|
+
amountUsd?: string;
|
|
18
|
+
};
|
|
19
|
+
maxUsdDecimals?: number;
|
|
20
|
+
debounceInput?: boolean;
|
|
21
|
+
direction?: "from" | "to";
|
|
22
|
+
}
|
|
23
|
+
export declare function useNumericInput({ onAmountChange, token, balance, debounceInput, forcedAmount, formatIfVerySmall, inputModeButton, maxUsdDecimals, direction, }: UseNumericInputOptions): {
|
|
24
|
+
userInputType: UserInputType;
|
|
25
|
+
inputValue: string;
|
|
26
|
+
handleInputChange: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
27
|
+
handleSwitchInputMode: () => void;
|
|
28
|
+
isTokenAmountVerySmall: boolean;
|
|
29
|
+
isUsdAmountVerySmall: boolean;
|
|
30
|
+
amountFormatted: string;
|
|
31
|
+
onBalanceButtonClick: () => void;
|
|
32
|
+
balanceFormatted: string;
|
|
33
|
+
};
|
|
34
|
+
export {};
|