@rango-dev/ui 0.1.14-next.10 → 0.1.14-next.12

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 (125) hide show
  1. package/dist/components/Alert/Alert.stories.d.ts +4 -4
  2. package/dist/components/BestRoute/BestRoute.stories.d.ts +5 -4
  3. package/dist/components/BlockchainsList/BlockchainsList.stories.d.ts +2 -3
  4. package/dist/components/Button/Button.stories.d.ts +5 -4
  5. package/dist/components/Checkbox/Checkbox.stories.d.ts +5 -4
  6. package/dist/components/Chip/Chip.stories.d.ts +2 -3
  7. package/dist/components/ColorPicker/ColorPicker.stories.d.ts +2 -3
  8. package/dist/components/Divider/Divider.d.ts +1 -1
  9. package/dist/components/Drawer/Drawer.stories.d.ts +2 -3
  10. package/dist/components/Icon/Icons.stories.d.ts +2 -3
  11. package/dist/components/LiquiditySourceList/LiquiditySource.stories.d.ts +2 -3
  12. package/dist/components/Modal/Modal.stories.d.ts +2 -3
  13. package/dist/components/Radio/Radio.stories.d.ts +2 -3
  14. package/dist/components/SecondaryPage/SecondaryPage.stories.d.ts +4 -3
  15. package/dist/components/SelectableWalletList/SelectableWalletList.stories.d.ts +5 -4
  16. package/dist/components/Skeleton/Skeleton.stories.d.ts +2 -3
  17. package/dist/components/Spinner/Spinner.stories.d.ts +2 -3
  18. package/dist/components/StatusDrawer/StatusDrawer.stories.d.ts +2 -3
  19. package/dist/components/StepDetail/StepDetail.stories.d.ts +5 -4
  20. package/dist/components/SwapDetail/SwapDetail.stories.d.ts +5 -4
  21. package/dist/components/Switch/Switch.stories.d.ts +2 -3
  22. package/dist/components/TextField/TextField.stories.d.ts +1 -2
  23. package/dist/components/TokenList/TokenList.stories.d.ts +2 -3
  24. package/dist/components/Tooltip/Tooltip.stories.d.ts +5 -4
  25. package/dist/components/Typography/Typography.stories.d.ts +5 -4
  26. package/dist/components/Wallet/Wallet.stories.d.ts +4 -3
  27. package/dist/components/index.d.ts +0 -6
  28. package/dist/containers/BlockchainSelector/BlockchainSelector.stories.d.ts +5 -0
  29. package/dist/containers/ConfirmSwap/ConfirmSwap.stories.d.ts +5 -4
  30. package/dist/containers/ConnectWalletsModal/ConnectWallets.stories.d.ts +5 -0
  31. package/dist/containers/History/History.stories.d.ts +7 -4
  32. package/dist/containers/LiquiditySourcesSelector/LiquiditySourcesSelector.stories.d.ts +5 -0
  33. package/dist/containers/Settings/Settings.stories.d.ts +5 -0
  34. package/dist/containers/SwapHistory/SwapHistory.stories.d.ts +12 -4
  35. package/dist/{components → containers}/TokenSelector/TokenSelector.d.ts +1 -1
  36. package/dist/containers/TokenSelector/TokenSelector.stories.d.ts +5 -0
  37. package/dist/containers/index.d.ts +5 -0
  38. package/dist/index.js +6 -6
  39. package/dist/index.js.map +4 -4
  40. package/package.json +12 -7
  41. package/src/components/Alert/Alert.stories.tsx +19 -6
  42. package/src/components/Alert/Alert.tsx +3 -3
  43. package/src/components/BestRoute/BestRoute.stories.tsx +15 -5
  44. package/src/components/BestRoute/mock.ts +1 -1
  45. package/src/components/BlockchainsList/BlockchainsList.stories.tsx +9 -3
  46. package/src/components/BlockchainsList/mockData.ts +603 -108
  47. package/src/components/Button/Button.stories.tsx +8 -3
  48. package/src/components/Checkbox/Checkbox.stories.tsx +6 -2
  49. package/src/components/Chip/Chip.stories.tsx +23 -7
  50. package/src/components/ColorPicker/ColorPicker.stories.tsx +6 -3
  51. package/src/components/Divider/Divider.tsx +113 -11
  52. package/src/components/Drawer/Drawer.stories.tsx +8 -11
  53. package/src/components/Icon/Icons.stories.tsx +8 -4
  54. package/src/components/LiquiditySourceList/LiquiditySource.stories.tsx +6 -3
  55. package/src/components/LiquiditySourceList/LiquiditySourceList.tsx +3 -3
  56. package/src/components/Modal/Modal.stories.tsx +9 -10
  57. package/src/components/Radio/Radio.stories.tsx +12 -7
  58. package/src/components/SecondaryPage/SecondaryPage.stories.tsx +12 -3
  59. package/src/components/SelectableWalletList/SelectableWalletList.stories.tsx +2 -2
  60. package/src/components/Skeleton/Skeleton.stories.tsx +6 -2
  61. package/src/components/Spinner/Spinner.stories.tsx +6 -2
  62. package/src/components/StatusDrawer/StatusDrawer.stories.tsx +7 -2
  63. package/src/components/StatusDrawer/StatusDrawer.tsx +2 -2
  64. package/src/components/StepDetail/StepDetail.stories.tsx +9 -2
  65. package/src/components/SwapDetail/SwapDetail.stories.tsx +5 -2
  66. package/src/components/SwapDetail/SwapDetail.tsx +3 -3
  67. package/src/components/SwapDetail/Token.tsx +4 -4
  68. package/src/components/Switch/Switch.stories.tsx +2 -2
  69. package/src/components/TextField/TextField.stories.tsx +3 -2
  70. package/src/components/TokenList/TokenList.stories.tsx +3 -3
  71. package/src/components/Tooltip/Tooltip.stories.tsx +7 -2
  72. package/src/components/Typography/Typography.stories.tsx +2 -2
  73. package/src/components/Wallet/Wallet.stories.tsx +7 -13
  74. package/src/components/index.ts +0 -6
  75. package/src/containers/BlockchainSelector/BlockchainSelector.stories.tsx +41 -0
  76. package/src/{components → containers}/BlockchainSelector/BlockchainSelector.tsx +5 -5
  77. package/src/containers/ConfirmSwap/ConfirmSwap.stories.tsx +223 -10
  78. package/src/containers/ConfirmSwap/ConfirmSwap.tsx +21 -12
  79. package/src/containers/ConnectWalletsModal/ConnectWallets.stories.tsx +24 -0
  80. package/src/{components → containers}/ConnectWalletsModal/ConnectWalletsModal.tsx +3 -3
  81. package/src/containers/History/History.stories.tsx +2 -2
  82. package/src/containers/History/History.tsx +1 -1
  83. package/src/containers/History/mock.ts +3 -3
  84. package/src/{components → containers}/LiquiditySourcesSelector/LiquiditySourcesSelector.stories.tsx +7 -4
  85. package/src/{components → containers}/LiquiditySourcesSelector/LiquiditySourcesSelector.tsx +2 -3
  86. package/src/containers/Settings/Settings.stories.tsx +27 -0
  87. package/src/{components → containers}/Settings/Settings.tsx +11 -8
  88. package/src/containers/SwapHistory/SwapHistory.stories.tsx +3 -3
  89. package/src/containers/SwapHistory/SwapHistory.tsx +4 -5
  90. package/src/containers/SwapHistory/mock.ts +2 -2
  91. package/src/{components → containers}/TokenSelector/TokenSelector.stories.tsx +7 -8
  92. package/src/{components → containers}/TokenSelector/TokenSelector.tsx +7 -6
  93. package/src/containers/index.ts +5 -0
  94. package/dist/components/BlockchainSelector/BlockchainSelector.stories.d.ts +0 -6
  95. package/dist/components/ConnectWalletsModal/ConnectWallets.stories.d.ts +0 -6
  96. package/dist/components/LiquiditySourcesSelector/LiquiditySourcesSelector.stories.d.ts +0 -6
  97. package/dist/components/Settings/Settings.stories.d.ts +0 -6
  98. package/dist/components/Spacer/Spacer.d.ts +0 -6
  99. package/dist/components/Spacer/Spacer.stories.d.ts +0 -6
  100. package/dist/components/Spacer/index.d.ts +0 -1
  101. package/dist/components/SwapContainer/SwapContainer.stories.d.ts +0 -6
  102. package/dist/components/TokenSelector/TokenSelector.stories.d.ts +0 -6
  103. package/src/components/BlockchainSelector/BlockchainSelector.stories.tsx +0 -25
  104. package/src/components/ConnectWalletsModal/ConnectWallets.stories.tsx +0 -13
  105. package/src/components/Settings/Settings.stories.tsx +0 -34
  106. package/src/components/Spacer/Spacer.stories.tsx +0 -31
  107. package/src/components/Spacer/Spacer.tsx +0 -128
  108. package/src/components/Spacer/index.ts +0 -1
  109. package/src/components/SwapContainer/SwapContainer.stories.tsx +0 -13
  110. /package/dist/{components → containers}/BlockchainSelector/BlockchainSelector.d.ts +0 -0
  111. /package/dist/{components → containers}/BlockchainSelector/index.d.ts +0 -0
  112. /package/dist/{components → containers}/ConnectWalletsModal/ConnectWalletsModal.d.ts +0 -0
  113. /package/dist/{components → containers}/ConnectWalletsModal/index.d.ts +0 -0
  114. /package/dist/{components → containers}/ConnectWalletsModal/mockData.d.ts +0 -0
  115. /package/dist/{components → containers}/LiquiditySourcesSelector/LiquiditySourcesSelector.d.ts +0 -0
  116. /package/dist/{components → containers}/LiquiditySourcesSelector/index.d.ts +0 -0
  117. /package/dist/{components → containers}/Settings/Settings.d.ts +0 -0
  118. /package/dist/{components → containers}/Settings/index.d.ts +0 -0
  119. /package/dist/{components → containers}/TokenSelector/index.d.ts +0 -0
  120. /package/src/{components → containers}/BlockchainSelector/index.ts +0 -0
  121. /package/src/{components → containers}/ConnectWalletsModal/index.ts +0 -0
  122. /package/src/{components → containers}/ConnectWalletsModal/mockData.ts +0 -0
  123. /package/src/{components → containers}/LiquiditySourcesSelector/index.ts +0 -0
  124. /package/src/{components → containers}/Settings/index.ts +0 -0
  125. /package/src/{components → containers}/TokenSelector/index.ts +0 -0
@@ -1,9 +1,8 @@
1
1
  import React from 'react';
2
2
  import { styled } from '../../theme';
3
3
  import { WalletInfo } from '../../types/wallet';
4
- import { Modal } from '../Modal';
5
4
  import { WalletType } from '@rango-dev/wallets-shared';
6
- import { Wallet } from '../Wallet';
5
+ import { Modal, Wallet } from '../../components';
7
6
 
8
7
  export interface PropTypes {
9
8
  open: boolean;
@@ -17,6 +16,7 @@ const ModalContent = styled('div', {
17
16
  display: 'grid',
18
17
  gap: '$8',
19
18
  gridTemplateColumns: 'repeat(2, minmax(0, 1fr))',
19
+ overflow: 'auto',
20
20
  });
21
21
 
22
22
  export function ConnectWalletsModal(props: PropTypes) {
@@ -36,7 +36,7 @@ export function ConnectWalletsModal(props: PropTypes) {
36
36
  open={open}
37
37
  content={Content}
38
38
  onClose={onClose}
39
- containerStyle={{ width: '75%', maxWidth: '30rem', height: '70%' }}
39
+ containerStyle={{ width: '75%', maxWidth: '30rem', height: '60%' }}
40
40
  />
41
41
  );
42
42
  }
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { ComponentMeta } from '@storybook/react';
2
+ import { Meta } from '@storybook/react';
3
3
 
4
4
  import { History, PropTypes } from './History';
5
5
  import { pendingSwap } from './mock';
@@ -7,7 +7,7 @@ import { pendingSwap } from './mock';
7
7
  export default {
8
8
  title: 'Containers/History',
9
9
  component: History,
10
- } as ComponentMeta<typeof History>;
10
+ } as Meta<typeof History>;
11
11
 
12
12
  export const Main = (props: PropTypes) => (
13
13
  <History {...props} list={pendingSwap} />
@@ -5,8 +5,8 @@ import { containsText } from '../../helper';
5
5
  import { styled } from '../../theme';
6
6
  import { PendingSwap } from './types';
7
7
  import { NotFoundAlert } from '../../components/Alert/NotFoundAlert';
8
- import { LoaderContainer } from '../../components/TokenSelector/TokenSelector';
9
8
  import { SwapsGroup, PropTypes as SwapsGroupPropTypes } from './SwapsGroup';
9
+ import { LoaderContainer } from '../TokenSelector/TokenSelector';
10
10
 
11
11
  const Container = styled('div', {
12
12
  overflowY: 'auto',
@@ -172,7 +172,7 @@ export const pendingSwap: PendingSwap[] = [
172
172
  toLogo: 'https://api.rango.exchange/i/mJQPS2',
173
173
  startTransactionTime: 1673164519916,
174
174
  swapperId: 'Osmosis',
175
- swapperLogo: '',
175
+ swapperLogo: 'https://api.rango.exchange/swappers/osmosis.png',
176
176
  expectedOutputAmountHumanReadable: '1.540670',
177
177
  outputAmount: '1.540658',
178
178
  status: 'running',
@@ -307,7 +307,7 @@ export const pendingSwap: PendingSwap[] = [
307
307
  swaps: [
308
308
  {
309
309
  swapperId: 'Osmosis',
310
- swapperLogo: '',
310
+ swapperLogo: 'https://api.rango.exchange/swappers/osmosis.png',
311
311
  swapperType: 'DEX',
312
312
  from: {
313
313
  symbol: 'JUNO',
@@ -581,7 +581,7 @@ export const pendingSwap: PendingSwap[] = [
581
581
  {
582
582
  swapperId: 'Osmosis',
583
583
  swapperType: 'DEX',
584
- swapperLogo: '',
584
+ swapperLogo: 'https://api.rango.exchange/swappers/osmosis.png',
585
585
 
586
586
  from: {
587
587
  symbol: 'JUNO',
@@ -1,15 +1,18 @@
1
1
  import React from 'react';
2
- import { ComponentMeta } from '@storybook/react';
2
+ import { Meta } from '@storybook/react';
3
3
  import {
4
4
  LiquiditySourcesSelector,
5
5
  PropTypes,
6
6
  } from './LiquiditySourcesSelector';
7
- import { liquiditySources } from '../LiquiditySourceList/mockData';
7
+ import { liquiditySources } from '../../components/LiquiditySourceList/mockData';
8
8
 
9
9
  export default {
10
- title: 'Liquidity Sources Selector',
10
+ title: 'Containers/Liquidity Sources Selector',
11
11
  component: LiquiditySourcesSelector,
12
- } as ComponentMeta<typeof LiquiditySourcesSelector>;
12
+ args: {
13
+ loadingStatus: 'success',
14
+ },
15
+ } as Meta<typeof LiquiditySourcesSelector>;
13
16
 
14
17
  export const Main = (args: PropTypes) => (
15
18
  <LiquiditySourcesSelector {...args} list={liquiditySources} />
@@ -2,9 +2,8 @@ import { CSSProperties } from '@stitches/react';
2
2
  import React from 'react';
3
3
  import { containsText } from '../../helper';
4
4
  import { LiquiditySource, LoadingStatus } from '../../types/meta';
5
- import { Button } from '../Button';
6
- import { LiquiditySourceList } from '../LiquiditySourceList';
7
- import { SecondaryPage } from '../SecondaryPage/SecondaryPage';
5
+ import { Button, SecondaryPage } from '../../components';
6
+ import { LiquiditySourceList } from '../../components/LiquiditySourceList';
8
7
 
9
8
  const filterLiquiditySources = (
10
9
  liquiditySources: LiquiditySource[],
@@ -0,0 +1,27 @@
1
+ import React from 'react';
2
+ import { Meta } from '@storybook/react';
3
+ import { Settings, PropTypes } from './Settings';
4
+ import { liquiditySources } from '../../components/LiquiditySourceList/mockData';
5
+ import { SwapContainer } from '../../components';
6
+
7
+ export default {
8
+ title: 'Containers/Settings',
9
+ component: Settings,
10
+ args: {
11
+ slippages: [0.5, 1, 3, 5, 8, 13, 20],
12
+ selectedSlippage: 3,
13
+ minSlippage: 1,
14
+ maxSlippage: 10,
15
+ },
16
+ } as Meta<typeof Settings>;
17
+
18
+
19
+ export const Main = (args: PropTypes) => (
20
+ <SwapContainer>
21
+ <Settings
22
+ {...args}
23
+ liquiditySources={liquiditySources}
24
+ selectedLiquiditySources={liquiditySources.slice(0, 5)}
25
+ />
26
+ </SwapContainer>
27
+ );
@@ -1,14 +1,17 @@
1
1
  import { styled } from '../../theme';
2
2
  import React, { useState } from 'react';
3
- import { AngleRightIcon } from '../Icon';
4
- import { SecondaryPage } from '../SecondaryPage/SecondaryPage';
5
- import { Typography } from '../Typography';
6
- import { Chip } from '../Chip';
3
+
7
4
  import { LiquiditySource, LoadingStatus } from '../../types/meta';
8
- import { TextField } from '../TextField';
9
- import { Radio } from '../Radio';
10
- import { Switch } from '../Switch';
11
- import { Button } from '../Button';
5
+ import {
6
+ AngleRightIcon,
7
+ Button,
8
+ Chip,
9
+ Radio,
10
+ SecondaryPage,
11
+ Switch,
12
+ TextField,
13
+ Typography,
14
+ } from '../../components';
12
15
 
13
16
  const BaseContainer = styled('div', {
14
17
  borderRadius: '$5',
@@ -1,12 +1,12 @@
1
1
  import React from 'react';
2
- import { ComponentMeta } from '@storybook/react';
2
+ import { Meta } from '@storybook/react';
3
3
  import { PropTypes, SwapHistory } from './SwapHistory';
4
4
  import { pendingSwap } from './mock';
5
5
 
6
6
  export default {
7
- title: 'Swap History',
7
+ title: 'Containers/Swap History',
8
8
  component: SwapHistory,
9
- } as ComponentMeta<typeof SwapHistory>;
9
+ } as Meta<typeof SwapHistory>;
10
10
 
11
11
  export const Main = (args: PropTypes) => (
12
12
  <SwapHistory {...args} pendingSwap={pendingSwap} />
@@ -6,12 +6,11 @@ import {
6
6
  Typography,
7
7
  CheckCircleIcon,
8
8
  InfoCircleIcon,
9
- Spacer,
9
+ Divider,
10
10
  Button,
11
11
  Alert,
12
12
  Drawer,
13
13
  Spinner,
14
- Divider,
15
14
  Image,
16
15
  } from '../../components';
17
16
  import { styled } from '../../theme';
@@ -53,7 +52,7 @@ export const ErrorMsg = styled(Typography, {
53
52
 
54
53
  export const FeeContainer = styled('div', {
55
54
  paddingLeft: '$16',
56
- color: '$neutral800'
55
+ color: '$neutral800',
57
56
  });
58
57
 
59
58
  export const Fee = styled('div', {
@@ -243,7 +242,7 @@ export function SwapHistory(props: PropTypes) {
243
242
  onClick={onCopy.bind(null, pendingSwap?.requestId)}
244
243
  >
245
244
  <RequestId>{pendingSwap?.requestId}</RequestId>
246
- <Spacer size={4} />
245
+ <Divider size={4} direction="horizontal" />
247
246
  <Button type="primary" variant="ghost" size="compact">
248
247
  {isCopied ? 'Copied!' : 'Copy'}
249
248
  </Button>
@@ -408,7 +407,7 @@ export function SwapHistory(props: PropTypes) {
408
407
  >
409
408
  Skip
410
409
  </Button>
411
- <Spacer size={16} />
410
+ <Divider size={16} direction="horizontal" />
412
411
  <Button
413
412
  variant="contained"
414
413
  type="error"
@@ -34,7 +34,7 @@ export const pendingSwap: PendingSwap = {
34
34
  {
35
35
  swapperId: 'Osmosis',
36
36
  swapperType: 'DEX',
37
- swapperLogo: '',
37
+ swapperLogo: 'https://api.rango.exchange/swappers/osmosis.png',
38
38
  from: {
39
39
  symbol: 'JUNO',
40
40
  logo: 'https://api.rango.exchange/tokens/COSMOS/JUNO.png',
@@ -171,7 +171,7 @@ export const pendingSwap: PendingSwap = {
171
171
  toLogo: 'https://api.rango.exchange/i/mJQPS2',
172
172
  startTransactionTime: 1673164519916,
173
173
  swapperId: 'Osmosis',
174
- swapperLogo: '',
174
+ swapperLogo: 'https://api.rango.exchange/swappers/osmosis.png',
175
175
  expectedOutputAmountHumanReadable: '1.540670',
176
176
  outputAmount: '1.540658',
177
177
  status: 'running',
@@ -1,17 +1,16 @@
1
1
  import React from 'react';
2
- import { ComponentMeta } from '@storybook/react';
2
+ import { Meta } from '@storybook/react';
3
3
  import { TokenSelector, PropTypes } from './TokenSelector';
4
- import { tokensMeta } from '../TokenList/mockData';
4
+ import { tokensMeta } from '../../components/TokenList/mockData';
5
5
 
6
6
  export default {
7
- title: 'Token Selector',
7
+ title: 'Containers/Token Selector',
8
8
  component: TokenSelector,
9
- argTypes: {
10
- type: {
11
- defaultValue: 'Source',
12
- },
9
+ args: {
10
+ type: 'Source',
11
+ loadingStatus: 'success',
13
12
  },
14
- } as ComponentMeta<typeof TokenSelector>;
13
+ } as Meta<typeof TokenSelector>;
15
14
 
16
15
  export const Main = (args: PropTypes) => (
17
16
  <TokenSelector {...args} list={tokensMeta} selected={tokensMeta[0]} />
@@ -1,13 +1,14 @@
1
1
  import React from 'react';
2
2
  import { containsText } from '../../helper';
3
- import { SecondaryPage } from '../SecondaryPage/SecondaryPage';
4
- import { TokenList } from '../TokenList';
5
- import { TokenWithAmount } from '../TokenList/TokenList';
3
+
6
4
  import { LoadingStatus } from '../../types/meta';
7
- import { Spinner } from '../Spinner';
8
- import { LoadingFailedAlert } from '../Alert/LoadingFailedAlert';
9
- import { NotFoundAlert } from '../Alert/NotFoundAlert';
10
5
  import { styled } from '../../theme';
6
+ import { NotFoundAlert } from '../../components/Alert/NotFoundAlert';
7
+ import { LoadingFailedAlert, SecondaryPage, Spinner } from '../../components';
8
+ import {
9
+ TokenList,
10
+ TokenWithAmount,
11
+ } from '../../components/TokenList/TokenList';
11
12
 
12
13
  export const LoaderContainer = styled('div', {
13
14
  display: 'flex',
@@ -1,3 +1,8 @@
1
1
  export * from './ConfirmSwap';
2
2
  export * from './History';
3
3
  export * from './SwapHistory';
4
+ export * from './BlockchainSelector';
5
+ export * from './ConnectWalletsModal';
6
+ export * from './LiquiditySourcesSelector';
7
+ export * from './TokenSelector';
8
+ export * from './Settings';
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- import { ComponentMeta } from '@storybook/react';
3
- import { BlockchainSelector, PropTypes } from './BlockchainSelector';
4
- declare const _default: ComponentMeta<typeof BlockchainSelector>;
5
- export default _default;
6
- export declare const Main: (args: PropTypes) => JSX.Element;
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- import { ComponentMeta } from '@storybook/react';
3
- import { ConnectWalletsModal, PropTypes } from './ConnectWalletsModal';
4
- declare const _default: ComponentMeta<typeof ConnectWalletsModal>;
5
- export default _default;
6
- export declare const Main: (args: PropTypes) => JSX.Element;
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- import { ComponentMeta } from '@storybook/react';
3
- import { LiquiditySourcesSelector, PropTypes } from './LiquiditySourcesSelector';
4
- declare const _default: ComponentMeta<typeof LiquiditySourcesSelector>;
5
- export default _default;
6
- export declare const Main: (args: PropTypes) => JSX.Element;
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- import { ComponentMeta } from '@storybook/react';
3
- import { Settings, PropTypes } from './Settings';
4
- declare const _default: ComponentMeta<typeof Settings>;
5
- export default _default;
6
- export declare const Main: (args: PropTypes) => JSX.Element;
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- export interface PropTypes {
3
- size?: 4 | 8 | 12 | 16 | 18 | 20 | 24;
4
- direction?: 'vertical' | 'horizontal';
5
- }
6
- export declare function Spacer({ size, direction }: PropTypes): JSX.Element;
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- import { ComponentMeta } from '@storybook/react';
3
- import { Spacer, PropTypes } from './Spacer';
4
- declare const _default: ComponentMeta<typeof Spacer>;
5
- export default _default;
6
- export declare const Main: (props: PropTypes) => JSX.Element;
@@ -1 +0,0 @@
1
- export { Spacer } from './Spacer';
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- import { ComponentMeta } from '@storybook/react';
3
- import { SwapContainer, PropTypes } from './SwapContainer';
4
- declare const _default: ComponentMeta<typeof SwapContainer>;
5
- export default _default;
6
- export declare const Main: (args: PropTypes) => JSX.Element;
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- import { ComponentMeta } from '@storybook/react';
3
- import { TokenSelector, PropTypes } from './TokenSelector';
4
- declare const _default: ComponentMeta<typeof TokenSelector>;
5
- export default _default;
6
- export declare const Main: (args: PropTypes) => JSX.Element;
@@ -1,25 +0,0 @@
1
- import React from 'react';
2
- import { ComponentMeta } from '@storybook/react';
3
- import { BlockchainSelector, PropTypes } from './BlockchainSelector';
4
- import { blockchainMeta } from '../BlockchainsList/mockData';
5
- import { SwapContainer } from '../SwapContainer/SwapContainer';
6
-
7
- export default {
8
- title: 'Blockchain Selector',
9
- component: BlockchainSelector,
10
- argTypes: {
11
- type: {
12
- defaultValue: 'Source',
13
- },
14
- },
15
- } as ComponentMeta<typeof BlockchainSelector>;
16
-
17
- export const Main = (args: PropTypes) => (
18
- <SwapContainer>
19
- <BlockchainSelector
20
- {...args}
21
- list={blockchainMeta}
22
- selected={blockchainMeta[0]}
23
- />
24
- </SwapContainer>
25
- );
@@ -1,13 +0,0 @@
1
- import React from 'react';
2
- import { ComponentMeta } from '@storybook/react';
3
- import { ConnectWalletsModal, PropTypes } from './ConnectWalletsModal';
4
- import { walletsInfo } from './mockData';
5
-
6
- export default {
7
- title: 'Connect Wallets Modal',
8
- component: ConnectWalletsModal,
9
- } as ComponentMeta<typeof ConnectWalletsModal>;
10
-
11
- export const Main = (args: PropTypes) => (
12
- <ConnectWalletsModal {...args} list={walletsInfo} />
13
- );
@@ -1,34 +0,0 @@
1
- import React from 'react';
2
- import { ComponentMeta } from '@storybook/react';
3
- import { Settings, PropTypes } from './Settings';
4
- import { SwapContainer } from '../SwapContainer/SwapContainer';
5
- import { liquiditySources } from '../LiquiditySourceList/mockData';
6
-
7
- export default {
8
- title: 'Settings',
9
- component: Settings,
10
- argTypes: {
11
- slippages: {
12
- defaultValue: [0.5, 1, 3, 5, 8, 13, 20],
13
- },
14
- selectedSlippage: { defaultValue: 3 },
15
- liquiditySources: {
16
- defaultValue: liquiditySources,
17
- },
18
- selectedLiquiditySources: {
19
- defaultValue: liquiditySources.slice(0, 5),
20
- },
21
- minSlippage: {
22
- defaultValue: 1,
23
- },
24
- maxSlippage: {
25
- defaultValue: 10,
26
- },
27
- },
28
- } as ComponentMeta<typeof Settings>;
29
-
30
- export const Main = (args: PropTypes) => (
31
- <SwapContainer>
32
- <Settings {...args} />
33
- </SwapContainer>
34
- );
@@ -1,31 +0,0 @@
1
- import { ComponentMeta } from '@storybook/react';
2
- import React from 'react';
3
- import { Typography } from '../Typography';
4
- import { Spacer, PropTypes } from './Spacer';
5
-
6
- export default {
7
- title: 'Components/Spacer',
8
- component: Spacer,
9
- argTypes: {
10
- size: {
11
- name: 'size',
12
- control: { type: 'select' },
13
- options: [12, 16, 18, 20],
14
- defaultValue: 12,
15
- },
16
- direction: {
17
- name: 'direction',
18
- control: { type: 'select' },
19
- options: ['vertical', 'horizontal'],
20
- defaultValue: 'horizontal',
21
- },
22
- },
23
- } as ComponentMeta<typeof Spacer>;
24
-
25
- export const Main = (props: PropTypes) => (
26
- <div style={{ display: props.direction === 'horizontal' ? 'flex' : 'block' }}>
27
- <Typography variant="body1">spacer </Typography>
28
- <Spacer {...props} />
29
- <Typography variant="body1">spacer</Typography>
30
- </div>
31
- );
@@ -1,128 +0,0 @@
1
- import React from 'react';
2
- import { styled } from '../../theme';
3
-
4
- const SpacerContainer = styled('div', {
5
- variants: {
6
- size: {
7
- 4: {},
8
- 8: {},
9
- 12: {},
10
- 16: {},
11
- 18: {},
12
- 20: {},
13
- 24: {},
14
- },
15
- direction: {
16
- vertical: {},
17
- horizontal: {},
18
- },
19
- },
20
- compoundVariants: [
21
- {
22
- size: 4,
23
- direction: 'horizontal',
24
- css: {
25
- width: '$4',
26
- },
27
- },
28
- {
29
- size: 4,
30
- direction: 'vertical',
31
- css: {
32
- height: '$4',
33
- },
34
- },
35
- {
36
- size: 8,
37
- direction: 'horizontal',
38
- css: {
39
- width: '$8',
40
- },
41
- },
42
- {
43
- size: 8,
44
- direction: 'vertical',
45
- css: {
46
- height: '$8',
47
- },
48
- },
49
- {
50
- size: 12,
51
- direction: 'horizontal',
52
- css: {
53
- width: '$12',
54
- },
55
- },
56
- {
57
- size: 12,
58
- direction: 'vertical',
59
- css: {
60
- height: '$12',
61
- },
62
- },
63
- {
64
- size: 16,
65
- direction: 'horizontal',
66
- css: {
67
- width: '$16',
68
- },
69
- },
70
- {
71
- size: 16,
72
- direction: 'vertical',
73
- css: {
74
- height: '$16',
75
- },
76
- },
77
- {
78
- size: 18,
79
- direction: 'horizontal',
80
- css: {
81
- width: '$18',
82
- },
83
- },
84
- {
85
- size: 18,
86
- direction: 'vertical',
87
- css: {
88
- height: '$18',
89
- },
90
- },
91
- {
92
- size: 20,
93
- direction: 'horizontal',
94
- css: {
95
- width: '$20',
96
- },
97
- },
98
- {
99
- size: 20,
100
- direction: 'vertical',
101
- css: {
102
- height: '$20',
103
- },
104
- },
105
- {
106
- size: 24,
107
- direction: 'horizontal',
108
- css: {
109
- width: '$24',
110
- },
111
- },
112
- {
113
- size: 24,
114
- direction: 'vertical',
115
- css: {
116
- height: '$24',
117
- },
118
- },
119
- ],
120
- });
121
- export interface PropTypes {
122
- size?: 4 | 8 | 12 | 16 | 18 | 20 | 24;
123
- direction?: 'vertical' | 'horizontal';
124
- }
125
-
126
- export function Spacer({ size = 12, direction = 'horizontal' }: PropTypes) {
127
- return <SpacerContainer size={size} direction={direction} />;
128
- }
@@ -1 +0,0 @@
1
- export { Spacer } from './Spacer';
@@ -1,13 +0,0 @@
1
- import React from 'react';
2
- import { ComponentMeta } from '@storybook/react';
3
-
4
- import { SwapContainer, PropTypes } from './SwapContainer';
5
-
6
- export default {
7
- title: 'Components/Swap Box',
8
- component: SwapContainer,
9
- } as ComponentMeta<typeof SwapContainer>;
10
-
11
- export const Main = (args: PropTypes) => (
12
- <SwapContainer {...args}></SwapContainer>
13
- );