@0xsquid/ui 2.6.6 → 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.
@@ -1,6 +1,2 @@
1
- interface LargeNumericInputProps {
2
- value?: string;
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 extends React.InputHTMLAttributes<HTMLInputElement> {
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 declare function NumericInput({ priceImpactPercentage, balance, error, criticalPriceImpactPercentage, token, onAmountChange, forcedAmount, maxUsdDecimals, formatIfVerySmall, showDetails, isLoading, direction, inputModeButton, isInteractive, balanceButton, debounceInput, ...props }: NumericInputProps): import("react/jsx-runtime").JSX.Element;
40
- export {};
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(): import("react/jsx-runtime").JSX.Element;
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 {};
@@ -3,16 +3,19 @@ type TabSize = "small" | "large";
3
3
  interface TabsProps {
4
4
  tabs: Array<{
5
5
  label: string;
6
+ isDisabled?: boolean;
6
7
  }>;
7
8
  size?: TabSize;
8
9
  activeTab?: number;
9
10
  onTabChange?: (tabIndex: number) => void;
11
+ isDisabled?: boolean;
10
12
  }
11
- export declare function Tabs({ tabs, size, onTabChange, activeTab, }: TabsProps): import("react/jsx-runtime").JSX.Element;
13
+ export declare function Tabs({ tabs, size, onTabChange, activeTab, isDisabled, }: TabsProps): import("react/jsx-runtime").JSX.Element;
12
14
  interface TabProps extends React.ComponentProps<"button"> {
13
15
  label: string;
14
16
  size: TabSize;
15
17
  isActive?: boolean;
18
+ isDisabled?: boolean;
16
19
  }
17
- export declare function Tab({ label, isActive, size, ...props }: TabProps): import("react/jsx-runtime").JSX.Element;
20
+ export declare function Tab({ label, isActive, size, isDisabled, ...props }: TabProps): import("react/jsx-runtime").JSX.Element;
18
21
  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 {};
@@ -6,6 +6,7 @@ export declare const spacing: {
6
6
  "squid-m": string;
7
7
  "squid-l": string;
8
8
  "squid-xl": string;
9
+ "squid-xl2": string;
9
10
  "squid-xxl": string;
10
11
  };
11
12
  export declare const boxShadow: {
@@ -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 {};
@@ -5,3 +5,4 @@ export default meta;
5
5
  type Story = StoryObj<typeof meta>;
6
6
  export declare const Small: Story;
7
7
  export declare const Large: Story;
8
+ export declare const Disabled: Story;
@@ -15,3 +15,4 @@ export declare const ConfirmationTooLong: Story;
15
15
  export declare const NeedsGas: Story;
16
16
  export declare const PartialSuccess: Story;
17
17
  export declare const Progress: Story;
18
+ export declare const SendTransaction: Story;