@rango-dev/ui 0.8.0 → 0.8.1-next.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.
Files changed (40) hide show
  1. package/CHANGELOG.md +0 -23
  2. package/dist/index.js +6 -6
  3. package/dist/index.js.map +4 -4
  4. package/dist/widget/ui/src/components/BottomLogo/BottomLogo.d.ts +3 -0
  5. package/dist/widget/ui/src/components/BottomLogo/BottomLogo.d.ts.map +1 -0
  6. package/dist/widget/ui/src/components/BottomLogo/index.d.ts +2 -0
  7. package/dist/widget/ui/src/components/BottomLogo/index.d.ts.map +1 -0
  8. package/dist/widget/ui/src/components/ChangeSlippageButton/ChangeSlippageButton.d.ts +7 -0
  9. package/dist/widget/ui/src/components/ChangeSlippageButton/ChangeSlippageButton.d.ts.map +1 -0
  10. package/dist/widget/ui/src/components/ChangeSlippageButton/index.d.ts +2 -0
  11. package/dist/widget/ui/src/components/ChangeSlippageButton/index.d.ts.map +1 -0
  12. package/dist/widget/ui/src/components/HeaderButtons/HeaderButtons.d.ts +9 -0
  13. package/dist/widget/ui/src/components/HeaderButtons/HeaderButtons.d.ts.map +1 -0
  14. package/dist/widget/ui/src/components/HeaderButtons/index.d.ts +2 -0
  15. package/dist/widget/ui/src/components/HeaderButtons/index.d.ts.map +1 -0
  16. package/dist/widget/ui/src/components/index.d.ts +11 -8
  17. package/dist/widget/ui/src/components/index.d.ts.map +1 -1
  18. package/dist/widget/ui/src/containers/Warnings/BalanceErrors.d.ts +7 -0
  19. package/dist/widget/ui/src/containers/Warnings/BalanceErrors.d.ts.map +1 -0
  20. package/dist/widget/ui/src/containers/Warnings/HighSlippageWarning.d.ts +9 -0
  21. package/dist/widget/ui/src/containers/Warnings/HighSlippageWarning.d.ts.map +1 -0
  22. package/dist/widget/ui/src/containers/Warnings/MinRequiredSlippage.d.ts +8 -0
  23. package/dist/widget/ui/src/containers/Warnings/MinRequiredSlippage.d.ts.map +1 -0
  24. package/dist/widget/ui/src/containers/Warnings/index.d.ts +4 -0
  25. package/dist/widget/ui/src/containers/Warnings/index.d.ts.map +1 -0
  26. package/dist/widget/ui/src/containers/index.d.ts +1 -0
  27. package/dist/widget/ui/src/containers/index.d.ts.map +1 -1
  28. package/package.json +2 -4
  29. package/src/components/BottomLogo/BottomLogo.tsx +47 -0
  30. package/src/components/BottomLogo/index.ts +1 -0
  31. package/src/components/ChangeSlippageButton/ChangeSlippageButton.tsx +17 -0
  32. package/src/components/ChangeSlippageButton/index.ts +1 -0
  33. package/src/components/HeaderButtons/HeaderButtons.tsx +41 -0
  34. package/src/components/HeaderButtons/index.ts +1 -0
  35. package/src/components/index.ts +11 -8
  36. package/src/containers/Warnings/BalanceErrors.tsx +48 -0
  37. package/src/containers/Warnings/HighSlippageWarning.tsx +33 -0
  38. package/src/containers/Warnings/MinRequiredSlippage.tsx +33 -0
  39. package/src/containers/Warnings/index.ts +3 -0
  40. package/src/containers/index.ts +2 -1
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ export declare function BottomLogo(): JSX.Element;
3
+ //# sourceMappingURL=BottomLogo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BottomLogo.d.ts","sourceRoot":"","sources":["../../../../../../src/components/BottomLogo/BottomLogo.tsx"],"names":[],"mappings":";AA0BA,wBAAgB,UAAU,gBAoBzB"}
@@ -0,0 +1,2 @@
1
+ export { BottomLogo } from './BottomLogo';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/BottomLogo/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ interface PropTypes {
3
+ onClick: () => void;
4
+ }
5
+ export declare function ChangeSlippageButton(props: PropTypes): JSX.Element;
6
+ export {};
7
+ //# sourceMappingURL=ChangeSlippageButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChangeSlippageButton.d.ts","sourceRoot":"","sources":["../../../../../../src/components/ChangeSlippageButton/ChangeSlippageButton.tsx"],"names":[],"mappings":";AAIA,UAAU,SAAS;IACjB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,SAAS,eAQpD"}
@@ -0,0 +1,2 @@
1
+ export { ChangeSlippageButton } from './ChangeSlippageButton';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/ChangeSlippageButton/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC"}
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ interface PropTypes {
3
+ onClickRefresh?: () => void;
4
+ onClickHistory?: () => void;
5
+ onClickSettings?: () => void;
6
+ }
7
+ export declare function HeaderButtons(props: PropTypes): JSX.Element;
8
+ export {};
9
+ //# sourceMappingURL=HeaderButtons.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HeaderButtons.d.ts","sourceRoot":"","sources":["../../../../../../src/components/HeaderButtons/HeaderButtons.tsx"],"names":[],"mappings":";AASA,UAAU,SAAS;IACjB,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;CAC9B;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,SAAS,eAyB7C"}
@@ -0,0 +1,2 @@
1
+ export { HeaderButtons } from './HeaderButtons';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/HeaderButtons/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
@@ -1,10 +1,20 @@
1
1
  export * from './I18nManager';
2
+ export * from './Alert';
2
3
  export * from './BestRoute';
4
+ export * from './BottomLogo';
3
5
  export * from './Button';
6
+ export * from './ChangeSlippageButton';
4
7
  export * from './Checkbox';
5
8
  export * from './Chip';
9
+ export * from './common';
10
+ export * from './ColorPicker';
11
+ export * from './Divider';
12
+ export * from './Drawer';
13
+ export * from './Header';
14
+ export * from './HeaderButtons';
6
15
  export * from './Icon';
7
16
  export * from './Modal';
17
+ export * from './Radio';
8
18
  export * from './SecondaryPage';
9
19
  export * from './SelectableWalletList';
10
20
  export * from './Spinner';
@@ -13,15 +23,8 @@ export * from './SwapContainer';
13
23
  export * from './SwapDetail';
14
24
  export * from './Switch';
15
25
  export * from './TextField';
26
+ export * from './TokenList';
16
27
  export * from './Tooltip';
17
28
  export * from './Typography';
18
29
  export * from './Wallet';
19
- export * from './Alert';
20
- export * from './ColorPicker';
21
- export * from './Radio';
22
- export * from './TokenList';
23
- export * from './common';
24
- export * from './Drawer';
25
- export * from './Header';
26
- export * from './Divider';
27
30
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,wBAAwB,CAAC;AACvC,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC"}
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ interface PropTypes {
3
+ messages: string[];
4
+ }
5
+ export declare function BalanceErrors({ messages }: PropTypes): JSX.Element;
6
+ export {};
7
+ //# sourceMappingURL=BalanceErrors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BalanceErrors.d.ts","sourceRoot":"","sources":["../../../../../../src/containers/Warnings/BalanceErrors.tsx"],"names":[],"mappings":";AAIA,UAAU,SAAS;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAwBD,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,EAAE,SAAS,eAiBpD"}
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ interface PropTypes {
3
+ selectedSlippage: number;
4
+ highSlippage: boolean;
5
+ changeSlippage: () => void;
6
+ }
7
+ export declare function HighSlippageWarning(props: PropTypes): JSX.Element;
8
+ export {};
9
+ //# sourceMappingURL=HighSlippageWarning.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HighSlippageWarning.d.ts","sourceRoot":"","sources":["../../../../../../src/containers/Warnings/HighSlippageWarning.tsx"],"names":[],"mappings":";AAKA,UAAU,SAAS;IACjB,gBAAgB,EAAE,MAAM,CAAC;IACzB,YAAY,EAAE,OAAO,CAAC;IACtB,cAAc,EAAE,MAAM,IAAI,CAAC;CAC5B;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,SAAS,eAqBnD"}
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ interface PropTypes {
3
+ minRequiredSlippage: string | null;
4
+ changeSlippage: () => void;
5
+ }
6
+ export declare function MinRequiredSlippage({ minRequiredSlippage, changeSlippage, }: PropTypes): JSX.Element;
7
+ export {};
8
+ //# sourceMappingURL=MinRequiredSlippage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MinRequiredSlippage.d.ts","sourceRoot":"","sources":["../../../../../../src/containers/Warnings/MinRequiredSlippage.tsx"],"names":[],"mappings":";AAKA,UAAU,SAAS;IACjB,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,cAAc,EAAE,MAAM,IAAI,CAAC;CAC5B;AAMD,wBAAgB,mBAAmB,CAAC,EAClC,mBAAmB,EACnB,cAAc,GACf,EAAE,SAAS,eAeX"}
@@ -0,0 +1,4 @@
1
+ export { HighSlippageWarning } from './HighSlippageWarning';
2
+ export { MinRequiredSlippage } from './MinRequiredSlippage';
3
+ export { BalanceErrors } from './BalanceErrors';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/containers/Warnings/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
@@ -6,4 +6,5 @@ export * from './ConnectWalletsModal';
6
6
  export * from './LiquiditySourcesSelector';
7
7
  export * from './TokenSelector';
8
8
  export * from './Settings';
9
+ export * from './Warnings';
9
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/containers/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/containers/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rango-dev/ui",
3
- "version": "0.8.0",
3
+ "version": "0.8.1-next.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "./dist/index.js",
@@ -54,13 +54,11 @@
54
54
  "typescript": "^4.8.4"
55
55
  },
56
56
  "dependencies": {
57
- "@lingui/core": "4.2.1",
58
- "@lingui/react": "4.2.1",
59
57
  "@radix-ui/react-checkbox": "^1.0.1",
60
58
  "@radix-ui/react-radio-group": "^1.1.1",
61
59
  "@radix-ui/react-switch": "^1.0.1",
62
60
  "@radix-ui/react-tooltip": "^1.0.2",
63
- "@rango-dev/wallets-shared": "^0.6.0",
61
+ "@rango-dev/wallets-shared": "^0.5.1-next.18",
64
62
  "@stitches/react": "^1.2.8",
65
63
  "@types/react-color": "^3.0.6",
66
64
  "rango-sdk": "^0.1.35",
@@ -0,0 +1,47 @@
1
+ import React from 'react';
2
+ import { i18n } from '@lingui/core';
3
+ import { styled } from '../../theme';
4
+ import { Typography } from '../Typography';
5
+
6
+ const Container = styled('div', {
7
+ display: 'flex',
8
+ width: '100%',
9
+ justifyContent: 'end',
10
+ alignItems: 'center',
11
+ paddingTop: '$16',
12
+ });
13
+
14
+ const Logo = styled('svg', {
15
+ fill: '$foreground',
16
+ width: '$24',
17
+ margin: '0 $8 0 $16',
18
+ });
19
+
20
+ const StyledAnchor = styled('a', {
21
+ display: 'flex',
22
+ justifyContent: 'center',
23
+ alignItems: 'center',
24
+ textDecoration: 'none',
25
+ });
26
+
27
+ export function BottomLogo() {
28
+ return (
29
+ <Container>
30
+ <Typography variant="caption" color="$neutral600">
31
+ {i18n.t('Powered By')}
32
+ </Typography>
33
+ <StyledAnchor href="https://rango.exchange" target="_blank">
34
+ <Logo xmlns="http://www.w3.org/2000/svg" viewBox="0 0 33.68 29">
35
+ <defs></defs>
36
+ <g id="Layer_2" data-name="Layer 2">
37
+ <g id="Layer_1-2" data-name="Layer 1">
38
+ <path d="M33.68,18.05A17.93,17.93,0,0,0,28.34,5.29,18.31,18.31,0,0,0,15.45,0H13.54V7.41L6.07,0H.69L9.83,9.07H0V11A17.93,17.93,0,0,0,5.34,23.71,18.32,18.32,0,0,0,18.24,29h1.9V21.59l7.38,7.31h5.39l-9-9h9.82ZM17.37,16.16H12.49a1.93,1.93,0,0,0-1.35.55,1.89,1.89,0,0,0-.56,1.34,1.85,1.85,0,0,0,.56,1.33,1.93,1.93,0,0,0,1.35.55h3.84V25.1A14.43,14.43,0,0,1,8,21a14.21,14.21,0,0,1-4.1-8.2H21.2a1.86,1.86,0,0,0,.74-.13,1.92,1.92,0,0,0,.64-.4,2,2,0,0,0,.43-.62,1.88,1.88,0,0,0,0-1.47,2,2,0,0,0-.43-.62,1.92,1.92,0,0,0-.64-.4,1.86,1.86,0,0,0-.74-.13H17.35V3.9A14.43,14.43,0,0,1,25.64,8a14.19,14.19,0,0,1,4.11,8.2Zm2.12-5.27a1.43,1.43,0,0,1,.26-.83,1.52,1.52,0,0,1,.67-.56,1.55,1.55,0,0,1,.88-.08,1.51,1.51,0,0,1,.77.4,1.54,1.54,0,0,1,.42.77,1.41,1.41,0,0,1-.09.86,1.47,1.47,0,0,1-.55.68,1.56,1.56,0,0,1-.84.25,1.52,1.52,0,0,1-1.52-1.49Z" />
39
+ <path d="M21.7,11.57a.68.68,0,0,0-.12-.38.64.64,0,0,0-.31-.25.68.68,0,0,0-.75.15.61.61,0,0,0-.19.35.62.62,0,0,0,0,.4.67.67,0,0,0,.25.3.69.69,0,0,0,.39.12.7.7,0,0,0,.49-.2A.68.68,0,0,0,21.7,11.57Z" />
40
+ </g>
41
+ </g>
42
+ </Logo>
43
+ <Typography variant="body2">RANGO</Typography>
44
+ </StyledAnchor>
45
+ </Container>
46
+ );
47
+ }
@@ -0,0 +1 @@
1
+ export { BottomLogo } from './BottomLogo';
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import { Button } from '../Button';
3
+ import { i18n } from '@lingui/core';
4
+
5
+ interface PropTypes {
6
+ onClick: () => void;
7
+ }
8
+
9
+ export function ChangeSlippageButton(props: PropTypes) {
10
+ const { onClick } = props;
11
+
12
+ return (
13
+ <Button type="primary" variant="outlined" size="small" onClick={onClick}>
14
+ {i18n.t('Change Slippage')}
15
+ </Button>
16
+ );
17
+ }
@@ -0,0 +1 @@
1
+ export { ChangeSlippageButton } from './ChangeSlippageButton';
@@ -0,0 +1,41 @@
1
+ import React from 'react';
2
+ import { i18n } from '@lingui/core';
3
+ import { SettingsIcon, Tooltip, Button, HistoryIcon, RetryIcon } from '..';
4
+ import { styled } from '../../theme';
5
+
6
+ const ButtonsContainer = styled('div', {
7
+ display: 'flex',
8
+ });
9
+
10
+ interface PropTypes {
11
+ onClickRefresh?: () => void;
12
+ onClickHistory?: () => void;
13
+ onClickSettings?: () => void;
14
+ }
15
+
16
+ export function HeaderButtons(props: PropTypes) {
17
+ const { onClickRefresh, onClickHistory, onClickSettings } = props;
18
+
19
+ return (
20
+ <ButtonsContainer>
21
+ <Tooltip content={i18n.t('Refresh')}>
22
+ <Button
23
+ variant="ghost"
24
+ onClick={onClickRefresh}
25
+ disabled={!onClickRefresh}>
26
+ <RetryIcon size={24} disabled={!onClickRefresh} />
27
+ </Button>
28
+ </Tooltip>
29
+ <Tooltip content={i18n.t('Transactions History')}>
30
+ <Button variant="ghost" onClick={onClickHistory}>
31
+ <HistoryIcon size={24} />
32
+ </Button>
33
+ </Tooltip>
34
+ <Tooltip content={i18n.t('Settings')}>
35
+ <Button variant="ghost" onClick={onClickSettings}>
36
+ <SettingsIcon size={24} />
37
+ </Button>
38
+ </Tooltip>
39
+ </ButtonsContainer>
40
+ );
41
+ }
@@ -0,0 +1 @@
1
+ export { HeaderButtons } from './HeaderButtons';
@@ -1,10 +1,20 @@
1
1
  export * from './I18nManager';
2
+ export * from './Alert';
2
3
  export * from './BestRoute';
4
+ export * from './BottomLogo';
3
5
  export * from './Button';
6
+ export * from './ChangeSlippageButton';
4
7
  export * from './Checkbox';
5
8
  export * from './Chip';
9
+ export * from './common';
10
+ export * from './ColorPicker';
11
+ export * from './Divider';
12
+ export * from './Drawer';
13
+ export * from './Header';
14
+ export * from './HeaderButtons';
6
15
  export * from './Icon';
7
16
  export * from './Modal';
17
+ export * from './Radio';
8
18
  export * from './SecondaryPage';
9
19
  export * from './SelectableWalletList';
10
20
  export * from './Spinner';
@@ -13,14 +23,7 @@ export * from './SwapContainer';
13
23
  export * from './SwapDetail';
14
24
  export * from './Switch';
15
25
  export * from './TextField';
26
+ export * from './TokenList';
16
27
  export * from './Tooltip';
17
28
  export * from './Typography';
18
29
  export * from './Wallet';
19
- export * from './Alert';
20
- export * from './ColorPicker';
21
- export * from './Radio';
22
- export * from './TokenList';
23
- export * from './common';
24
- export * from './Drawer';
25
- export * from './Header';
26
- export * from './Divider';
@@ -0,0 +1,48 @@
1
+ import { Divider, Typography } from '../../components';
2
+ import { styled } from '../../theme';
3
+ import React from 'react';
4
+ import { i18n } from '@lingui/core';
5
+ interface PropTypes {
6
+ messages: string[];
7
+ }
8
+
9
+ const List = styled('ul', {
10
+ padding: 0,
11
+ margin: 0,
12
+ variants: {
13
+ showListStyle: {
14
+ true: { paddingLeft: '$24' },
15
+ },
16
+ },
17
+ });
18
+
19
+ const ListItem = styled('li', {
20
+ variants: {
21
+ showListStyle: {
22
+ true: { listStyleType: 'disc', listStylePosition: 'outside' },
23
+ },
24
+ },
25
+ });
26
+
27
+ const Message = styled(Typography, {
28
+ display: 'block',
29
+ });
30
+
31
+ export function BalanceErrors({ messages }: PropTypes) {
32
+ const showListStyle = messages.length > 1;
33
+ return (
34
+ <>
35
+ <Typography className="title" variant="title" color={'error'}>
36
+ {i18n.t('Insufficent Balance:')}
37
+ </Typography>
38
+ <Divider size={8} />
39
+ <List showListStyle={showListStyle}>
40
+ {messages.map((warning, index) => (
41
+ <ListItem showListStyle={showListStyle} key={index}>
42
+ <Message variant="body2">{warning}</Message>
43
+ </ListItem>
44
+ ))}
45
+ </List>
46
+ </>
47
+ );
48
+ }
@@ -0,0 +1,33 @@
1
+ import { Alert } from '../../components/Alert';
2
+ import React from 'react';
3
+ import { ChangeSlippageButton } from '../../components/ChangeSlippageButton';
4
+ import { i18n } from '@lingui/core';
5
+
6
+ interface PropTypes {
7
+ selectedSlippage: number;
8
+ highSlippage: boolean;
9
+ changeSlippage: () => void;
10
+ }
11
+
12
+ export function HighSlippageWarning(props: PropTypes) {
13
+ const { highSlippage, selectedSlippage, changeSlippage } = props;
14
+
15
+ return (
16
+ <>
17
+ {highSlippage && (
18
+ <Alert
19
+ type="warning"
20
+ footer={<ChangeSlippageButton onClick={changeSlippage} />}>
21
+ {i18n.t(
22
+ 'highSlippage',
23
+ { selectedSlippage },
24
+ {
25
+ message:
26
+ ' Caution, your slippage is high (={selectedSlippage}). Your trade may be front run.',
27
+ }
28
+ )}
29
+ </Alert>
30
+ )}
31
+ </>
32
+ );
33
+ }
@@ -0,0 +1,33 @@
1
+ import React from 'react';
2
+ import { i18n } from '@lingui/core';
3
+ import { Divider, Typography, ChangeSlippageButton } from '../../components';
4
+ import { styled } from '../../theme';
5
+
6
+ interface PropTypes {
7
+ minRequiredSlippage: string | null;
8
+ changeSlippage: () => void;
9
+ }
10
+
11
+ const StyledMessage = styled(Typography, {
12
+ color: '$error500 !important',
13
+ });
14
+
15
+ export function MinRequiredSlippage({
16
+ minRequiredSlippage,
17
+ changeSlippage,
18
+ }: PropTypes) {
19
+ return (
20
+ <StyledMessage variant="body2">
21
+ {i18n.t(
22
+ 'increaseSlippage',
23
+ { minRequiredSlippage },
24
+ {
25
+ message:
26
+ 'We recommend you to increase slippage to at least {minRequiredSlippage} for this route.',
27
+ }
28
+ )}
29
+ <Divider size={8} />
30
+ <ChangeSlippageButton onClick={changeSlippage} />
31
+ </StyledMessage>
32
+ );
33
+ }
@@ -0,0 +1,3 @@
1
+ export { HighSlippageWarning } from './HighSlippageWarning';
2
+ export { MinRequiredSlippage } from './MinRequiredSlippage';
3
+ export { BalanceErrors } from './BalanceErrors';
@@ -5,4 +5,5 @@ export * from './BlockchainSelector';
5
5
  export * from './ConnectWalletsModal';
6
6
  export * from './LiquiditySourcesSelector';
7
7
  export * from './TokenSelector';
8
- export * from './Settings';
8
+ export * from './Settings';
9
+ export * from './Warnings';