@0xsquid/ui 3.1.0 → 3.2.1

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 (49) hide show
  1. package/dist/cjs/index.js +162 -49
  2. package/dist/cjs/types/components/badges/TransactionState.d.ts +2 -2
  3. package/dist/cjs/types/components/buttons/CopyButton.d.ts +7 -0
  4. package/dist/cjs/types/components/buttons/LinkButton.d.ts +5 -0
  5. package/dist/cjs/types/components/buttons/TokenOnlyButton.d.ts +18 -0
  6. package/dist/cjs/types/components/buttons/index.d.ts +1 -0
  7. package/dist/cjs/types/components/icons/Arrow.d.ts +5 -0
  8. package/dist/cjs/types/components/icons/Timeline.d.ts +1 -1
  9. package/dist/cjs/types/components/layout/AnimationWrapper.d.ts +1 -1
  10. package/dist/cjs/types/components/layout/HashLink.d.ts +2 -2
  11. package/dist/cjs/types/components/layout/PipeSeparator.d.ts +6 -2
  12. package/dist/cjs/types/components/layout/SwapConfiguration.d.ts +2 -1
  13. package/dist/cjs/types/components/lists/TransactionAction/FeesAction.d.ts +2 -1
  14. package/dist/cjs/types/components/lists/TransactionAction/SuccessAction.d.ts +1 -1
  15. package/dist/cjs/types/components/lists/TransactionAction/TransactionAction.d.ts +1 -1
  16. package/dist/cjs/types/components/views/SwapProgressView.d.ts +2 -1
  17. package/dist/cjs/types/components/views/TransactionView/BridgeTransactionView.d.ts +12 -4
  18. package/dist/cjs/types/components/views/TransactionView/SwapTransactionView.d.ts +4 -2
  19. package/dist/cjs/types/components/views/TransactionView/TransactionView.d.ts +2 -2
  20. package/dist/cjs/types/stories/buttons/TokenOnlyButton.stories.d.ts +18 -0
  21. package/dist/cjs/types/stories/views/SwapProgressView.stories.d.ts +1 -0
  22. package/dist/cjs/types/stories/views/TransactionView.stories.d.ts +12 -6
  23. package/dist/cjs/types/types/components.d.ts +1 -1
  24. package/dist/esm/index.js +161 -50
  25. package/dist/esm/types/components/badges/TransactionState.d.ts +2 -2
  26. package/dist/esm/types/components/buttons/CopyButton.d.ts +7 -0
  27. package/dist/esm/types/components/buttons/LinkButton.d.ts +5 -0
  28. package/dist/esm/types/components/buttons/TokenOnlyButton.d.ts +18 -0
  29. package/dist/esm/types/components/buttons/index.d.ts +1 -0
  30. package/dist/esm/types/components/icons/Arrow.d.ts +5 -0
  31. package/dist/esm/types/components/icons/Timeline.d.ts +1 -1
  32. package/dist/esm/types/components/layout/AnimationWrapper.d.ts +1 -1
  33. package/dist/esm/types/components/layout/HashLink.d.ts +2 -2
  34. package/dist/esm/types/components/layout/PipeSeparator.d.ts +6 -2
  35. package/dist/esm/types/components/layout/SwapConfiguration.d.ts +2 -1
  36. package/dist/esm/types/components/lists/TransactionAction/FeesAction.d.ts +2 -1
  37. package/dist/esm/types/components/lists/TransactionAction/SuccessAction.d.ts +1 -1
  38. package/dist/esm/types/components/lists/TransactionAction/TransactionAction.d.ts +1 -1
  39. package/dist/esm/types/components/views/SwapProgressView.d.ts +2 -1
  40. package/dist/esm/types/components/views/TransactionView/BridgeTransactionView.d.ts +12 -4
  41. package/dist/esm/types/components/views/TransactionView/SwapTransactionView.d.ts +4 -2
  42. package/dist/esm/types/components/views/TransactionView/TransactionView.d.ts +2 -2
  43. package/dist/esm/types/stories/buttons/TokenOnlyButton.stories.d.ts +18 -0
  44. package/dist/esm/types/stories/views/SwapProgressView.stories.d.ts +1 -0
  45. package/dist/esm/types/stories/views/TransactionView.stories.d.ts +12 -6
  46. package/dist/esm/types/types/components.d.ts +1 -1
  47. package/dist/index.css +1 -1
  48. package/dist/index.d.ts +56 -19
  49. package/package.json +1 -1
@@ -0,0 +1,18 @@
1
+ import { type AssetsButtonVariant } from "../../types/components";
2
+ import { type TooltipProps } from "../controls";
3
+ interface TokenOnlyButtonProps {
4
+ token?: {
5
+ iconUrl: string;
6
+ fallbackIconUrl?: string;
7
+ symbol: string;
8
+ bgColor: string;
9
+ textColor: string;
10
+ };
11
+ onClick?: () => void;
12
+ variant?: AssetsButtonVariant;
13
+ isLoading?: boolean;
14
+ tooltip?: Omit<TooltipProps, "children">;
15
+ emptyTokenLabel?: string;
16
+ }
17
+ export declare function TokenOnlyButton({ token, onClick, variant, isLoading, tooltip, emptyTokenLabel, }: TokenOnlyButtonProps): import("react/jsx-runtime").JSX.Element;
18
+ export {};
@@ -8,3 +8,4 @@ export * from "./FeeButton";
8
8
  export * from "./FilterButton";
9
9
  export * from "./IconButton";
10
10
  export * from "./SettingsButton";
11
+ export * from "./TokenOnlyButton";
@@ -49,6 +49,11 @@ export declare function ChevronGrabberVerticalIcon({ size, className, }: {
49
49
  size?: string;
50
50
  className?: string;
51
51
  }): import("react/jsx-runtime").JSX.Element;
52
+ export declare function SquareArrowTopRightIcon({ className, size, strokeWidth, }: {
53
+ className?: string;
54
+ size?: string;
55
+ strokeWidth?: string;
56
+ }): import("react/jsx-runtime").JSX.Element;
52
57
  export declare function SquareArrowTopRight2Icon({ className, size, strokeWidth, }: {
53
58
  className?: string;
54
59
  size?: string;
@@ -1,4 +1,4 @@
1
- import { ComponentProps } from "react";
1
+ import { type ComponentProps } from "react";
2
2
  export declare function Timeline({ className, ...props }: ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
3
3
  export declare namespace Timeline {
4
4
  var ArrowDown: (props: import("react").SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { type LottieComponentProps } from "lottie-react";
3
- interface Props extends Omit<LottieComponentProps, "src"> {
3
+ interface Props extends Omit<LottieComponentProps, "src" | "animationData"> {
4
4
  style?: React.CSSProperties;
5
5
  autoplay?: boolean;
6
6
  loop?: boolean;
@@ -7,7 +7,7 @@ interface HashLinkProps {
7
7
  url?: string;
8
8
  className?: string;
9
9
  formattedHash?: string;
10
- copyIconSize?: string;
10
+ size?: "default" | "small";
11
11
  }
12
- export declare function HashLink({ showTx, hash, showCopyButton, url, children, className, formattedHash, copyIconSize, }: HashLinkProps): import("react/jsx-runtime").JSX.Element;
12
+ export declare function HashLink({ showTx, hash, showCopyButton, url, children, className, formattedHash, size, }: HashLinkProps): import("react/jsx-runtime").JSX.Element;
13
13
  export {};
@@ -1,2 +1,6 @@
1
- import { ComponentProps } from "react";
2
- export declare function PipeSeparator(props: ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
1
+ import { type ComponentProps } from "react";
2
+ interface Props extends ComponentProps<"div"> {
3
+ size?: "default" | "small" | "large";
4
+ }
5
+ export declare function PipeSeparator({ className, size, ...props }: Props): import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -67,6 +67,7 @@ interface SwapConfigurationProps {
67
67
  fullHeight?: boolean;
68
68
  debounceInput?: boolean;
69
69
  showWalletButtonHeader?: boolean;
70
+ hideChainSelector?: boolean;
70
71
  }
71
- export declare function SwapConfiguration({ amount, tokenPrice, isFetching: isFetchingProp, chain, token, direction, onAmountChange, balance, criticalPriceImpactPercentage, error, priceImpactPercentage, maxUsdDecimals, isInputInteractive, isLoading, inputModeButton, balanceButton, assetsButton, walletButton, showNumericInputDetails, fullHeight, debounceInput, showWalletButtonHeader, }: SwapConfigurationProps): import("react/jsx-runtime").JSX.Element;
72
+ export declare function SwapConfiguration({ amount, tokenPrice, isFetching: isFetchingProp, chain, token, direction, onAmountChange, balance, criticalPriceImpactPercentage, error, priceImpactPercentage, maxUsdDecimals, isInputInteractive, isLoading, inputModeButton, balanceButton, assetsButton, walletButton, showNumericInputDetails, fullHeight, debounceInput, showWalletButtonHeader, hideChainSelector, }: SwapConfigurationProps): import("react/jsx-runtime").JSX.Element;
72
73
  export {};
@@ -18,12 +18,13 @@ interface FeesLinesProps {
18
18
  lines?: FeesRowProps[];
19
19
  showTimeline?: boolean;
20
20
  }
21
- export declare function FeesLines({ status, lines, showTimeline, }: FeesLinesProps): import("react/jsx-runtime").JSX.Element;
21
+ export declare function FeesLines({ status, lines }: FeesLinesProps): import("react/jsx-runtime").JSX.Element;
22
22
  interface FeesRowProps {
23
23
  label: string;
24
24
  amount: number | string;
25
25
  symbol: string;
26
26
  usd: number | string;
27
27
  collapsed?: boolean;
28
+ className?: string;
28
29
  }
29
30
  export {};
@@ -1,4 +1,4 @@
1
- import { BaseActionProps } from "./BaseActionProps";
1
+ import { type BaseActionProps } from "./BaseActionProps";
2
2
  interface SuccessActionProps extends BaseActionProps {
3
3
  description?: string;
4
4
  timestamp?: number;
@@ -1,4 +1,4 @@
1
- import { ComponentProps } from "react";
1
+ import { type ComponentProps } from "react";
2
2
  import { ApproveAction } from "./ApproveAction";
3
3
  import { BridgeAction } from "./BridgeAction";
4
4
  import { FeesAction } from "./FeesAction";
@@ -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, isSendTransaction, }: {
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, isBridgeTransaction, }: {
14
14
  steps: SwapStep[];
15
15
  handleClose?: (swapState: SwapState) => void;
16
16
  handleComplete?: () => void;
@@ -31,5 +31,6 @@ export declare function SwapProgressView({ steps, isOpen, handleClose, handleCom
31
31
  refundTokenSymbol?: string;
32
32
  addGasLink?: string;
33
33
  isSendTransaction?: boolean;
34
+ isBridgeTransaction?: boolean;
34
35
  }): import("react/jsx-runtime").JSX.Element;
35
36
  export {};
@@ -1,7 +1,11 @@
1
1
  import { type BaseTransactionViewProps } from "./BaseTransactionViewProps";
2
2
  interface BaseBridgeTransactionViewProps extends BaseTransactionViewProps {
3
- amount: string;
4
- token: {
3
+ fromToken: {
4
+ logoURI: string;
5
+ bgColor: string;
6
+ symbol: string;
7
+ };
8
+ toToken: {
5
9
  logoURI: string;
6
10
  bgColor: string;
7
11
  symbol: string;
@@ -19,11 +23,15 @@ interface BaseBridgeTransactionViewProps extends BaseTransactionViewProps {
19
23
  address: string;
20
24
  boosted?: boolean;
21
25
  timeToComplete: string;
26
+ fromLink?: string;
27
+ toLink?: string;
28
+ fromAmount: string;
29
+ toAmount: string;
22
30
  }
23
31
  type BridgeTransactionViewProps = (BaseBridgeTransactionViewProps & {
24
32
  isLoading?: false;
25
- }) | (Partial<BaseBridgeTransactionViewProps> & BaseTransactionViewProps & {
33
+ }) | (Partial<Omit<BaseBridgeTransactionViewProps, keyof BaseTransactionViewProps>> & BaseTransactionViewProps & {
26
34
  isLoading: true;
27
35
  });
28
- export declare function BridgeTransactionView({ title, hash, status, url, amount, token, fromChain, toChain, address, actions, fees, boosted, timeToComplete, isLoading, }: BridgeTransactionViewProps): import("react/jsx-runtime").JSX.Element;
36
+ export declare function BridgeTransactionView({ title, hash, fromLink, toLink, status, url, fromAmount, toAmount, fromToken, toToken, fromChain, toChain, address, actions, fees, boosted, timeToComplete, isLoading, }: BridgeTransactionViewProps): import("react/jsx-runtime").JSX.Element;
29
37
  export {};
@@ -20,16 +20,18 @@ interface BaseSwapTransactionViewProps extends BaseTransactionViewProps {
20
20
  logoURI: string;
21
21
  name: string;
22
22
  };
23
+ fromLink?: string;
24
+ toLink?: string;
23
25
  fromAddress: string;
24
26
  toAddress: string;
25
27
  exchangeRate: string;
26
28
  boosted?: boolean;
27
29
  timeToComplete: string;
28
30
  }
29
- export type SwapTransactionViewProps = (BaseSwapTransactionViewProps & {
31
+ type SwapTransactionViewProps = (BaseSwapTransactionViewProps & {
30
32
  isLoading?: false;
31
33
  }) | (Partial<Omit<BaseSwapTransactionViewProps, keyof BaseTransactionViewProps>> & BaseTransactionViewProps & {
32
34
  isLoading: true;
33
35
  });
34
- export declare function SwapTransactionView({ title, hash, status, url, fromAmount, fromToken, toAmount, toToken, fromChain, toChain, fromAddress, toAddress, exchangeRate, boosted, timeToComplete, actions, fees, isLoading, }: SwapTransactionViewProps): import("react/jsx-runtime").JSX.Element;
36
+ export declare function SwapTransactionView({ title, hash, toLink, fromLink, status, url, fromAmount, fromToken, toAmount, toToken, fromChain, toChain, fromAddress, toAddress, exchangeRate, boosted, timeToComplete, actions, fees, isLoading, }: SwapTransactionViewProps): import("react/jsx-runtime").JSX.Element;
35
37
  export {};
@@ -15,11 +15,11 @@ export type TransactionViewProps = {
15
15
  [Type in TransactionType]: {
16
16
  type: Type;
17
17
  isLoading?: false;
18
- data: ComponentProps<TransactionViewComponents[Type]>;
18
+ data: Omit<Partial<ComponentProps<TransactionViewComponents[Type]>>, "isLoading">;
19
19
  } | {
20
20
  type: Type;
21
21
  isLoading: true;
22
- data?: Partial<ComponentProps<TransactionViewComponents[Type]>>;
22
+ data?: Omit<Partial<ComponentProps<TransactionViewComponents[Type]>>, "isLoading">;
23
23
  };
24
24
  }[TransactionType];
25
25
  export declare function TransactionView({ type, isLoading, data, }: TransactionViewProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,18 @@
1
+ import { type Meta, type StoryObj } from "@storybook/react";
2
+ import { TokenOnlyButton } from "../../components/buttons/TokenOnlyButton";
3
+ declare const meta: Meta<typeof TokenOnlyButton>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof meta>;
6
+ export declare const PrimaryVariantLoading: Story;
7
+ export declare const AccentVariantLoading: Story;
8
+ export declare const PrimaryVariantEmpty: Story;
9
+ export declare const AccentVariantEmpty: Story;
10
+ export declare const TokenWithLightText: Story;
11
+ export declare const TokenWithDarkText: Story;
12
+ export declare const AvaxToken: Story;
13
+ export declare const LongTokenSymbol: Story;
14
+ export declare const Tooltip: Story;
15
+ export declare const BrokenTokenImage: Story;
16
+ export declare const BrokenTokenImageWithFallback: Story;
17
+ export declare const BrokenTokenImageAndBrokenFallback: Story;
18
+ export declare const AccentVariantWithToken: Story;
@@ -16,3 +16,4 @@ export declare const NeedsGas: Story;
16
16
  export declare const PartialSuccess: Story;
17
17
  export declare const Progress: Story;
18
18
  export declare const SendTransaction: Story;
19
+ export declare const BridgeTransaction: Story;
@@ -34,8 +34,9 @@ export declare const Swap: {
34
34
  };
35
35
  fromAddress: string;
36
36
  toAddress: string;
37
+ fromLink: string;
38
+ toLink: string;
37
39
  exchangeRate: string;
38
- boosted: boolean;
39
40
  timeToComplete: string;
40
41
  actions: ({
41
42
  type: "success";
@@ -214,7 +215,6 @@ export declare const BuyNFT: {
214
215
  };
215
216
  fromAddress: string;
216
217
  toAddress: string;
217
- boosted: boolean;
218
218
  timeToComplete: string;
219
219
  actions: ({
220
220
  type: "success";
@@ -349,7 +349,6 @@ export declare const Interaction: {
349
349
  hash: string;
350
350
  status: string;
351
351
  url: string;
352
- boosted: boolean;
353
352
  chain: {
354
353
  logoURI: string;
355
354
  name: string;
@@ -490,12 +489,20 @@ export declare const Bridge: {
490
489
  hash: string;
491
490
  url: string;
492
491
  status: string;
493
- amount: string;
494
- token: {
492
+ fromAmount: string;
493
+ toAmount: string;
494
+ toToken: {
495
+ logoURI: string;
496
+ bgColor: string;
497
+ symbol: string;
498
+ };
499
+ fromToken: {
495
500
  logoURI: string;
496
501
  bgColor: string;
497
502
  symbol: string;
498
503
  };
504
+ fromLink: string;
505
+ toLink: string;
499
506
  fromChain: {
500
507
  logoURI: string;
501
508
  name: string;
@@ -507,7 +514,6 @@ export declare const Bridge: {
507
514
  bgColor: string;
508
515
  };
509
516
  address: string;
510
- boosted: boolean;
511
517
  timeToComplete: string;
512
518
  actions: ({
513
519
  type: "success";
@@ -29,7 +29,7 @@ export declare enum SwapState {
29
29
  }
30
30
  export type DetailsToolbarState = "full" | "loading" | "empty" | "error";
31
31
  export type ThemeType = "light" | "dark";
32
- export type ActionStatus = "pending" | "waiting" | "ongoing" | "executed" | "success" | "error" | "warning";
32
+ export type ActionStatus = "pending" | "waiting" | "ongoing" | "executed" | "success" | "error" | "warning" | "refunded" | "troubleshoot";
33
33
  export type InputMode = "token" | "price";
34
34
  export type TransactionStateVariant = "full" | "compact" | "small";
35
35
  export type TransactionType = "swap" | "buy_nft" | "interaction" | "bridge";