@rango-dev/ui 0.1.10-next.78 → 0.1.10-next.80

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 (39) hide show
  1. package/dist/components/Alert/Alert.d.ts +2 -2
  2. package/dist/components/Alert/Alert.stories.d.ts +2 -1
  3. package/dist/components/BestRoute/BestRoute.d.ts +4 -1
  4. package/dist/components/SecondaryPage/SecondaryPage.d.ts +3 -5
  5. package/dist/components/SelectableWalletList/SelectableWalletList.d.ts +1 -1
  6. package/dist/components/TextField/TextField.stories.d.ts +1 -1
  7. package/dist/containers/ConfirmSwap/ConfirmSwap.d.ts +8 -4
  8. package/dist/containers/ConfirmWallets/ConfirmWallets.d.ts +4 -2
  9. package/dist/containers/History/types.d.ts +1 -0
  10. package/dist/helper/index.d.ts +0 -5
  11. package/dist/types/wallet.d.ts +8 -0
  12. package/dist/ui.cjs.development.js +288 -262
  13. package/dist/ui.cjs.development.js.map +1 -1
  14. package/dist/ui.cjs.production.min.js +1 -1
  15. package/dist/ui.cjs.production.min.js.map +1 -1
  16. package/dist/ui.esm.js +288 -262
  17. package/dist/ui.esm.js.map +1 -1
  18. package/package.json +1 -1
  19. package/src/components/Alert/Alert.tsx +5 -9
  20. package/src/components/BestRoute/BestRoute.tsx +55 -21
  21. package/src/components/BlockchainSelector/BlockchainSelector.tsx +13 -11
  22. package/src/components/LiquiditySourceList/LiquiditySourceList.tsx +21 -20
  23. package/src/components/LiquiditySourcesSelector/LiquiditySourcesSelector.tsx +3 -2
  24. package/src/components/Radio/Radio.tsx +1 -0
  25. package/src/components/SecondaryPage/SecondaryPage.tsx +5 -6
  26. package/src/components/SelectableWalletList/SelectableWalletList.tsx +1 -1
  27. package/src/components/Settings/Settings.tsx +12 -13
  28. package/src/components/SwapContainer/SwapContainer.tsx +1 -0
  29. package/src/components/Switch/Switch.tsx +1 -0
  30. package/src/components/TokenSelector/TokenSelector.tsx +3 -2
  31. package/src/containers/ConfirmSwap/ConfirmSwap.tsx +92 -54
  32. package/src/containers/ConfirmWallets/ConfirmWallets.tsx +66 -62
  33. package/src/containers/History/History.tsx +3 -2
  34. package/src/containers/History/types.tsx +10 -1
  35. package/src/containers/SwapHistory/SwapHistory.tsx +87 -95
  36. package/src/helper/index.ts +1 -22
  37. package/src/types/wallet.ts +9 -0
  38. package/dist/containers/ConfirmWallets/types.d.ts +0 -9
  39. package/src/containers/ConfirmWallets/types.ts +0 -10
@@ -1,6 +1,6 @@
1
+ import { PropsWithChildren } from 'react';
1
2
  export interface PropTypes {
2
3
  type: 'primary' | 'secondary' | 'success' | 'warning' | 'error';
3
- description: string;
4
4
  title?: string;
5
5
  }
6
- export declare function Alert(props: PropTypes): JSX.Element;
6
+ export declare function Alert(props: PropsWithChildren<PropTypes>): JSX.Element;
@@ -1,4 +1,5 @@
1
+ import React from 'react';
1
2
  import { PropTypes } from './Alert';
2
- declare const _default: import("@storybook/csf").ComponentAnnotations<import("@storybook/react").ReactFramework, PropTypes>;
3
+ declare const _default: import("@storybook/csf").ComponentAnnotations<import("@storybook/react").ReactFramework, React.PropsWithChildren<PropTypes>>;
3
4
  export default _default;
4
5
  export declare const Main: (args: PropTypes) => JSX.Element;
@@ -2,7 +2,10 @@ import { PropsWithChildren } from 'react';
2
2
  import { BestRouteResponse } from 'rango-sdk';
3
3
  export interface PropTypes {
4
4
  data: BestRouteResponse | null;
5
+ totalFee: string;
6
+ feeWarning: boolean;
7
+ totalTime: string;
5
8
  loading?: boolean;
6
9
  error?: string;
7
10
  }
8
- export declare function BestRoute({ data, loading, error, }: PropsWithChildren<PropTypes>): JSX.Element;
11
+ export declare function BestRoute(props: PropsWithChildren<PropTypes>): JSX.Element;
@@ -1,13 +1,11 @@
1
- import React from 'react';
1
+ import React, { ReactNode } from 'react';
2
2
  export declare type PropTypes = ({
3
3
  textField: true;
4
- Content: React.ElementType<{
5
- searchedFor: string;
6
- }>;
4
+ children?: (searchedFor: string) => ReactNode;
7
5
  textFieldPlaceholder: string;
8
6
  } | {
9
7
  textField: false;
10
- Content: React.ReactNode;
8
+ children?: ReactNode;
11
9
  }) & {
12
10
  title?: string;
13
11
  onBack?: () => void;
@@ -1,5 +1,5 @@
1
1
  import { PropsWithChildren } from 'react';
2
- import { SelectableWallet } from '../../containers/ConfirmWallets/types';
2
+ import { SelectableWallet } from '../../types';
3
3
  export interface PropTypes {
4
4
  list: SelectableWallet[];
5
5
  onChange: (w: SelectableWallet) => void;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { PropTypes } from './TextField';
3
- declare const _default: import("@storybook/csf").ComponentAnnotations<import("@storybook/react").ReactFramework, Pick<React.PropsWithChildren<PropTypes>, "color" | "height" | "translate" | "width" | "list" | "onChange" | "form" | "label" | "slot" | "style" | "title" | "pattern" | "hidden" | "size" | "type" | "onClick" | "prefix" | "suffix" | "disabled" | "children" | "id" | "defaultChecked" | "checked" | "name" | "className" | "lang" | "max" | "min" | "role" | "tabIndex" | "crossOrigin" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "step" | "defaultValue" | "accept" | "alt" | "autoComplete" | "autoFocus" | "capture" | "enterKeyHint" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "maxLength" | "minLength" | "multiple" | "placeholder" | "readOnly" | "required" | "src" | "value" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "nonce" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is"> & React.RefAttributes<HTMLInputElement>>;
3
+ declare const _default: import("@storybook/csf").ComponentAnnotations<import("@storybook/react").ReactFramework, Pick<React.PropsWithChildren<PropTypes>, "color" | "height" | "translate" | "width" | "list" | "onChange" | "form" | "label" | "slot" | "style" | "title" | "pattern" | "hidden" | "size" | "type" | "children" | "onClick" | "prefix" | "suffix" | "disabled" | "id" | "defaultChecked" | "checked" | "name" | "className" | "lang" | "max" | "min" | "role" | "tabIndex" | "crossOrigin" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "step" | "defaultValue" | "accept" | "alt" | "autoComplete" | "autoFocus" | "capture" | "enterKeyHint" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "maxLength" | "minLength" | "multiple" | "placeholder" | "readOnly" | "required" | "src" | "value" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "nonce" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is"> & React.RefAttributes<HTMLInputElement>>;
4
4
  export default _default;
5
5
  export declare const Main: (args: PropTypes) => JSX.Element;
6
6
  export declare const WithPrefix: (args: PropTypes) => JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import { BestRouteResponse } from 'rango-sdk';
2
- import React, { PropsWithChildren } from 'react';
2
+ import React, { PropsWithChildren, ReactNode } from 'react';
3
3
  export declare const Line: any;
4
4
  export declare const SwapperContainer: any;
5
5
  export declare const BodyError: any;
@@ -14,10 +14,14 @@ export declare const UpdateIcon: any;
14
14
  export declare const StyledUpdateIcon: any;
15
15
  export interface PropTypes {
16
16
  bestRoute: BestRouteResponse | null;
17
+ onRefresh?: React.MouseEventHandler<SVGElement>;
18
+ confirmButtonTitle: string;
19
+ confirmButtonDisabled: boolean;
17
20
  onBack: () => void;
18
21
  onConfirm?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
19
22
  loading?: boolean;
20
- error?: string;
21
- warning?: string;
23
+ errors?: ReactNode[];
24
+ warnings?: ReactNode[];
25
+ extraMessages?: ReactNode;
22
26
  }
23
- export declare function ConfirmSwap({ bestRoute, onBack, onConfirm, loading, error, warning, }: PropsWithChildren<PropTypes>): JSX.Element;
27
+ export declare function ConfirmSwap(props: PropsWithChildren<PropTypes>): JSX.Element;
@@ -1,8 +1,10 @@
1
1
  import { BestRouteResponse } from 'rango-sdk';
2
2
  import React, { PropsWithChildren } from 'react';
3
- import { SelectableWallet } from './types';
3
+ import { SelectableWallet } from '../../types';
4
4
  export interface PropTypes {
5
5
  swap: BestRouteResponse;
6
+ fromAmount: string;
7
+ toAmount: string;
6
8
  onBack: () => void;
7
9
  onConfirm?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
8
10
  confirmDisabled?: boolean;
@@ -13,4 +15,4 @@ export interface PropTypes {
13
15
  isExperimentalChain?: (wallet: string) => boolean;
14
16
  handleConnectChain?: (wallet: string) => void;
15
17
  }
16
- export declare function ConfirmWallets({ onBack, loading, onConfirm, swap, requiredWallets, selectableWallets, onChange, confirmDisabled, isExperimentalChain, handleConnectChain, }: PropsWithChildren<PropTypes>): JSX.Element;
18
+ export declare function ConfirmWallets(props: PropsWithChildren<PropTypes>): JSX.Element;
@@ -20,6 +20,7 @@ export declare type PendingSwapStep = {
20
20
  swapperId: string;
21
21
  swapperLogo: string;
22
22
  swapperType: string;
23
+ feeInUsd: string;
23
24
  expectedOutputAmountHumanReadable: string | null;
24
25
  startTransactionTime: number;
25
26
  outputAmount: string;
@@ -1,6 +1 @@
1
- import { BestRouteResponse } from 'rango-sdk';
2
- export declare const secondsToString: (s: number) => string;
3
- export declare const totalArrivalTime: (data: BestRouteResponse) => number;
4
- export declare const rawFees: (data: BestRouteResponse) => string;
5
- export declare const decimalNumber: (number: string | undefined, toFixed: number) => string;
6
1
  export declare const containsText: (text: string, searchText: string) => boolean;
@@ -12,3 +12,11 @@ export declare type WalletInfo = {
12
12
  image: string;
13
13
  type: WalletType;
14
14
  };
15
+ export interface SelectableWallet {
16
+ chain: string;
17
+ walletType: WalletType;
18
+ address: string;
19
+ image: string;
20
+ selected: boolean;
21
+ name: string;
22
+ }