@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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rango-dev/ui",
3
- "version": "0.1.14-next.10",
3
+ "version": "0.1.14-next.12",
4
4
  "license": "MIT",
5
5
  "module": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -13,8 +13,8 @@
13
13
  "bundle": "esbuild src/index.ts --bundle --minify --keep-names --sourcemap --outdir=dist --platform=node --format=esm --packages=external",
14
14
  "build": "yarn type-checking && yarn bundle",
15
15
  "type-checking": "tsc --declaration --emitDeclarationOnly",
16
- "storybook": "start-storybook -p 3000",
17
- "build-storybook": "build-storybook"
16
+ "storybook": "storybook dev -p 3000",
17
+ "build-storybook": "storybook build"
18
18
  },
19
19
  "peerDependencies": {
20
20
  "@rango-dev/queue-manager-rango-preset": "*",
@@ -22,12 +22,16 @@
22
22
  },
23
23
  "devDependencies": {
24
24
  "@babel/core": "^7.20.2",
25
+ "@babel/preset-env": "^7.21.4",
26
+ "@babel/preset-react": "^7.18.6",
27
+ "@babel/preset-typescript": "^7.21.4",
25
28
  "@size-limit/preset-small-lib": "^8.1.0",
26
- "@storybook/addon-essentials": "^6.5.13",
29
+ "@storybook/addon-essentials": "^7.0.9",
27
30
  "@storybook/addon-info": "^5.3.21",
28
- "@storybook/addon-links": "^6.5.13",
29
- "@storybook/addons": "^6.5.13",
30
- "@storybook/react": "^6.5.13",
31
+ "@storybook/addon-links": "^7.0.9",
32
+ "@storybook/addons": "^7.0.9",
33
+ "@storybook/react": "^7.0.9",
34
+ "@storybook/react-webpack5": "^7.0.9",
31
35
  "@types/react": "^18.0.25",
32
36
  "@types/react-dom": "^18.0.8",
33
37
  "@types/react-virtualized-auto-sizer": "^1.0.1",
@@ -39,6 +43,7 @@
39
43
  "react-dom": "^18.2.0",
40
44
  "react-is": "^18.2.0",
41
45
  "size-limit": "^8.1.0",
46
+ "storybook": "^7.0.9",
42
47
  "tsdx": "^0.14.1",
43
48
  "tslib": "^2.4.1",
44
49
  "typescript": "^4.8.4"
@@ -1,22 +1,35 @@
1
1
  import React from 'react';
2
- import { ComponentMeta } from '@storybook/react';
3
2
  import { Alert } from '.';
4
3
  import { PropTypes } from './Alert';
4
+ import { Meta } from '@storybook/react';
5
+ import { Typography } from '../Typography';
5
6
 
6
7
  export default {
7
- title: 'Alert',
8
+ title: 'Components/Alert',
8
9
  component: Alert,
10
+ args: {
11
+ type: 'success',
12
+ title: 'Alert Title',
13
+ footer: <Typography variant='body1'>It's a Alert!</Typography>
14
+ },
9
15
  argTypes: {
10
16
  type: {
17
+ name: 'type',
11
18
  defaultValue: 'success',
19
+ control: {
20
+ type: 'select',
21
+ options: ['primary', 'secondary', 'success', 'warning', 'error'],
22
+ },
12
23
  },
24
+
13
25
  title: {
26
+ name: 'title',
14
27
  defaultValue: 'Alert Title',
15
- },
16
- description: {
17
- defaultValue: 'Alert description ...',
28
+ control: {
29
+ type: 'text',
30
+ },
18
31
  },
19
32
  },
20
- } as ComponentMeta<typeof Alert>;
33
+ } as Meta<typeof Alert>;
21
34
 
22
35
  export const Main = (args: PropTypes) => <Alert {...args} />;
@@ -2,7 +2,7 @@ import React, { PropsWithChildren, ReactNode } from 'react';
2
2
  import { CheckCircleIcon, InfoCircleIcon, WarningIcon } from '../Icon';
3
3
  import { Typography } from '../Typography';
4
4
  import { styled } from '../../theme';
5
- import { Spacer } from '../Spacer';
5
+ import { Divider } from '../Divider';
6
6
 
7
7
  const MainContainer = styled('div', {
8
8
  width: '100%',
@@ -72,7 +72,7 @@ export function Alert(props: PropsWithChildren<PropTypes>) {
72
72
  {type === 'success' && <CheckCircleIcon color={type} size={24} />}
73
73
  {type === 'warning' && <WarningIcon color={type} size={24} />}
74
74
  {type === 'error' && <InfoCircleIcon color={type} size={24} />}
75
- <Spacer size={4} />
75
+ <Divider size={4} direction='horizontal' />
76
76
  </div>
77
77
  </>
78
78
  )}
@@ -90,7 +90,7 @@ export function Alert(props: PropsWithChildren<PropTypes>) {
90
90
  <Typography className="title" variant="title" color={type}>
91
91
  {title}
92
92
  </Typography>
93
- {!!children && <Spacer size={4} direction="vertical" />}
93
+ {!!children && <Divider size={4} />}
94
94
  </>
95
95
  )}
96
96
  {children}
@@ -1,27 +1,37 @@
1
1
  import React from 'react';
2
- import { ComponentMeta } from '@storybook/react';
3
2
  import { BestRoute, PropTypes } from './BestRoute';
4
3
  import { bestRoute, bestRouteExample2, bestRouteExample3 } from './mock';
4
+ import { Meta } from '@storybook/react';
5
5
 
6
6
  export default {
7
7
  title: 'Components/Best Route',
8
8
  component: BestRoute,
9
- } as ComponentMeta<typeof BestRoute>;
9
+ } as Meta<typeof BestRoute>;
10
10
 
11
11
  export const Main = (props: PropTypes) => (
12
12
  <div style={{ maxWidth: 512 }}>
13
- <BestRoute {...props} data={bestRoute} />
13
+ <BestRoute {...props} data={bestRoute} totalFee="0.28" totalTime="10:45" />
14
14
  </div>
15
15
  );
16
16
  export const With4Step = (props: PropTypes) => (
17
17
  <div style={{ maxWidth: 512 }}>
18
- <BestRoute {...props} data={bestRouteExample2} />
18
+ <BestRoute
19
+ {...props}
20
+ data={bestRouteExample2}
21
+ totalFee="0.28"
22
+ totalTime="10:45"
23
+ />
19
24
  </div>
20
25
  );
21
26
 
22
27
  export const With2Step = (props: PropTypes) => (
23
28
  <div style={{ maxWidth: 512 }}>
24
- <BestRoute {...props} data={bestRouteExample3} />
29
+ <BestRoute
30
+ {...props}
31
+ data={bestRouteExample3}
32
+ totalFee="0.28"
33
+ totalTime="10:45"
34
+ />
25
35
  </div>
26
36
  );
27
37
  export const WithError = (props: PropTypes) => (
@@ -174,7 +174,7 @@ export const bestRouteExample2: BestRouteType = {
174
174
  warnings: [],
175
175
  swapperId: 'ParaSwap Bsc',
176
176
  swapperType: 'DEX',
177
- swapperLogo: 'https://api.rango.exchange/swappers/para-swap.png',
177
+ swapperLogo: 'https://api.rango.exchange/swappers/paraswap.svg',
178
178
 
179
179
  from: {
180
180
  symbol: 'USDC',
@@ -1,18 +1,24 @@
1
1
  import React from 'react';
2
- import { ComponentMeta } from '@storybook/react';
2
+ import { Meta } from '@storybook/react';
3
3
  import { BlockchainsList, PropTypes } from './BlockchainsList';
4
4
  import { blockchainMeta } from './mockData';
5
5
 
6
6
  export default {
7
- title: 'Blockchains List',
7
+ title: 'Components/Blockchains List',
8
8
  component: BlockchainsList,
9
+ args: {
10
+ searchedText: '',
11
+ },
9
12
  argTypes: {
10
13
  searchedText: {
11
14
  type: 'string',
12
15
  defaultValue: '',
16
+ control: {
17
+ type: 'text',
18
+ },
13
19
  },
14
20
  },
15
- } as ComponentMeta<typeof BlockchainsList>;
21
+ } as Meta<typeof BlockchainsList>;
16
22
 
17
23
  export const Main = (args: PropTypes) => {
18
24
  return (