@rango-dev/ui 0.28.2-next.0 → 0.28.2-next.10
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.
- package/dist/index.js +6 -6
- package/dist/index.js.map +4 -4
- package/dist/translations/en.d.ts.map +1 -1
- package/dist/translations/es.d.ts.map +1 -1
- package/dist/translations/fr.d.ts.map +1 -1
- package/dist/translations/ja.d.ts.map +1 -1
- package/dist/translations/pt.d.ts +2 -0
- package/dist/translations/pt.d.ts.map +1 -0
- package/dist/widget/ui/src/components/Alert/Alert.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Alert/Alert.helpers.d.ts +3 -2
- package/dist/widget/ui/src/components/Alert/Alert.helpers.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Alert/Alert.styles.d.ts +12 -8
- package/dist/widget/ui/src/components/Alert/Alert.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Alert/Alert.types.d.ts +5 -2
- package/dist/widget/ui/src/components/Alert/Alert.types.d.ts.map +1 -1
- package/dist/widget/ui/src/components/BlockchainsChip/BlockchainsChip.styles.d.ts +1 -0
- package/dist/widget/ui/src/components/BlockchainsChip/BlockchainsChip.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/BottomLogo/BottomLogo.styles.d.ts +2 -0
- package/dist/widget/ui/src/components/BottomLogo/BottomLogo.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Button/Button.d.ts +6 -6
- package/dist/widget/ui/src/components/Button/Button.styles.d.ts +4 -1
- package/dist/widget/ui/src/components/Button/Button.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/ChainToken/ChainToken.styles.d.ts +2 -0
- package/dist/widget/ui/src/components/ChainToken/ChainToken.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Checkbox/Checkbox.styles.d.ts +4 -0
- package/dist/widget/ui/src/components/Checkbox/Checkbox.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Chip/Chip.styles.d.ts +1 -0
- package/dist/widget/ui/src/components/Chip/Chip.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Collapsible/Collapsible.styles.d.ts +1 -0
- package/dist/widget/ui/src/components/Collapsible/Collapsible.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Divider/Divider.d.ts +1 -1
- package/dist/widget/ui/src/components/Divider/Divider.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Divider/Divider.styles.d.ts +3 -2
- package/dist/widget/ui/src/components/Divider/Divider.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Drawer/Drawer.styles.d.ts +5 -0
- package/dist/widget/ui/src/components/Drawer/Drawer.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Flags/Portuguese.d.ts +4 -0
- package/dist/widget/ui/src/components/Flags/Portuguese.d.ts.map +1 -0
- package/dist/widget/ui/src/components/Flags/index.d.ts +2 -1
- package/dist/widget/ui/src/components/Flags/index.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Header/Header.styles.d.ts +2 -0
- package/dist/widget/ui/src/components/Header/Header.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/I18nManager/I18nManager.d.ts +1 -0
- package/dist/widget/ui/src/components/I18nManager/I18nManager.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Icon/CloseIcon.d.ts +1 -0
- package/dist/widget/ui/src/components/Icon/CloseIcon.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Icon/common.d.ts +4 -2
- package/dist/widget/ui/src/components/Icon/common.d.ts.map +1 -1
- package/dist/widget/ui/src/components/List/List.styles.d.ts +1 -0
- package/dist/widget/ui/src/components/List/List.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/ListItem/ListItem.styles.d.ts +1 -0
- package/dist/widget/ui/src/components/ListItem/ListItem.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/ListItemButton/ListItemButton.styles.d.ts +1 -0
- package/dist/widget/ui/src/components/ListItemButton/ListItemButton.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/MessageBox/CollapsibleMessageBox.styles.d.ts +1 -0
- package/dist/widget/ui/src/components/MessageBox/CollapsibleMessageBox.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/MessageBox/MessageBox.styles.d.ts +4 -1
- package/dist/widget/ui/src/components/MessageBox/MessageBox.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Modal/Modal.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Modal/Modal.styles.d.ts +6 -0
- package/dist/widget/ui/src/components/Modal/Modal.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Modal/Modal.types.d.ts +6 -1
- package/dist/widget/ui/src/components/Modal/Modal.types.d.ts.map +1 -1
- package/dist/widget/ui/src/components/NotFound/NotFound.styles.d.ts +1 -0
- package/dist/widget/ui/src/components/NotFound/NotFound.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Popover/Popover.styles.d.ts +2 -0
- package/dist/widget/ui/src/components/Popover/Popover.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/PriceImpact/PriceImpact.styles.d.ts +2 -0
- package/dist/widget/ui/src/components/PriceImpact/PriceImpact.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/QuoteCost/QuoteCost.styles.d.ts +4 -0
- package/dist/widget/ui/src/components/QuoteCost/QuoteCost.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/QuoteCost/QuoteCost.types.d.ts +2 -1
- package/dist/widget/ui/src/components/QuoteCost/QuoteCost.types.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Radio/Radio.styles.d.ts +2 -0
- package/dist/widget/ui/src/components/Radio/Radio.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/RadioGroup/RadioGroup.styles.d.ts +5 -1
- package/dist/widget/ui/src/components/RadioGroup/RadioGroup.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/RefreshProgressButton/RefreshProgressButton.styles.d.ts +2 -0
- package/dist/widget/ui/src/components/RefreshProgressButton/RefreshProgressButton.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/RoutesOverview/RoutesOverview.d.ts +1 -0
- package/dist/widget/ui/src/components/RoutesOverview/RoutesOverview.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Select/Select.d.ts +4 -0
- package/dist/widget/ui/src/components/Select/Select.d.ts.map +1 -0
- package/dist/widget/ui/src/components/Select/Select.types.d.ts +12 -0
- package/dist/widget/ui/src/components/Select/Select.types.d.ts.map +1 -0
- package/dist/widget/ui/src/components/Select/index.d.ts +2 -0
- package/dist/widget/ui/src/components/Select/index.d.ts.map +1 -0
- package/dist/widget/ui/src/components/Select/select.styles.d.ts +492 -0
- package/dist/widget/ui/src/components/Select/select.styles.d.ts.map +1 -0
- package/dist/widget/ui/src/components/SelectableCategoryList/SelectableCategoryList.styles.d.ts +3 -0
- package/dist/widget/ui/src/components/SelectableCategoryList/SelectableCategoryList.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Skeleton/Skeleton.styles.d.ts +1 -0
- package/dist/widget/ui/src/components/Skeleton/Skeleton.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/StepDetails/StepDetails.styles.d.ts +10 -4
- package/dist/widget/ui/src/components/StepDetails/StepDetails.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/SvgIcon/SvgIcon.style.d.ts +2 -1
- package/dist/widget/ui/src/components/SvgIcon/SvgIcon.style.d.ts.map +1 -1
- package/dist/widget/ui/src/components/SwapDetailsPlaceholder/SwapDetailsPlaceholder.d.ts +1 -0
- package/dist/widget/ui/src/components/SwapDetailsPlaceholder/SwapDetailsPlaceholder.d.ts.map +1 -1
- package/dist/widget/ui/src/components/SwapListItem/SwapListItem.styles.d.ts +6 -0
- package/dist/widget/ui/src/components/SwapListItem/SwapListItem.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/SwapListItem/SwapToken.styles.d.ts +9 -0
- package/dist/widget/ui/src/components/SwapListItem/SwapToken.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Switch/Switch.styles.d.ts +2 -0
- package/dist/widget/ui/src/components/Switch/Switch.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/TextField/TextField.d.ts +1 -1
- package/dist/widget/ui/src/components/TextField/TextField.stories.d.ts +1 -1
- package/dist/widget/ui/src/components/TextField/TextField.styles.d.ts +3 -0
- package/dist/widget/ui/src/components/TextField/TextField.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Toast/Toast.Provider.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Toast/Toast.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Toast/Toast.helpers.d.ts +4 -0
- package/dist/widget/ui/src/components/Toast/Toast.helpers.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Toast/Toast.stories.d.ts +4 -3
- package/dist/widget/ui/src/components/Toast/Toast.stories.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Toast/Toast.styles.d.ts +174 -4
- package/dist/widget/ui/src/components/Toast/Toast.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Toast/Toast.types.d.ts +14 -14
- package/dist/widget/ui/src/components/Toast/Toast.types.d.ts.map +1 -1
- package/dist/widget/ui/src/components/TokenAmount/TokenAmount.styles.d.ts +4 -1
- package/dist/widget/ui/src/components/TokenAmount/TokenAmount.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Tooltip/Tooltip.styles.d.ts +3 -0
- package/dist/widget/ui/src/components/Tooltip/Tooltip.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Typography/NotSelectableTypography.d.ts +164 -0
- package/dist/widget/ui/src/components/Typography/NotSelectableTypography.d.ts.map +1 -0
- package/dist/widget/ui/src/components/Typography/Typography.styles.d.ts +1 -0
- package/dist/widget/ui/src/components/Typography/Typography.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Typography/Typography.types.d.ts +1 -1
- package/dist/widget/ui/src/components/Typography/Typography.types.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Typography/index.d.ts +1 -0
- package/dist/widget/ui/src/components/Typography/index.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Wallet/Wallet.styles.d.ts +5 -0
- package/dist/widget/ui/src/components/Wallet/Wallet.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/common/FilledCircle.d.ts +1 -0
- package/dist/widget/ui/src/components/common/FilledCircle.d.ts.map +1 -1
- package/dist/widget/ui/src/components/common/Image.d.ts +1 -0
- package/dist/widget/ui/src/components/common/Image.d.ts.map +1 -1
- package/dist/widget/ui/src/components/common/styles.d.ts +1 -0
- package/dist/widget/ui/src/components/common/styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/index.d.ts +1 -0
- package/dist/widget/ui/src/components/index.d.ts.map +1 -1
- package/dist/widget/ui/src/containers/ConnectWalletsModal/ConnectWalletsModal.d.ts.map +1 -1
- package/dist/widget/ui/src/containers/SwapHistory/SwapHistory.d.ts +10 -0
- package/dist/widget/ui/src/containers/SwapHistory/SwapHistory.d.ts.map +1 -1
- package/dist/widget/ui/src/containers/SwapInput/SwapInput.styles.d.ts +18 -7
- package/dist/widget/ui/src/containers/SwapInput/SwapInput.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/containers/SwapInput/TokenSection.styles.d.ts +11 -6
- package/dist/widget/ui/src/containers/SwapInput/TokenSection.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/containers/TokenSelector/TokenSelector.d.ts +1 -0
- package/dist/widget/ui/src/containers/TokenSelector/TokenSelector.d.ts.map +1 -1
- package/dist/widget/ui/src/icons/Autorenew.d.ts +5 -0
- package/dist/widget/ui/src/icons/Autorenew.d.ts.map +1 -0
- package/dist/widget/ui/src/icons/Exit.d.ts +5 -0
- package/dist/widget/ui/src/icons/Exit.d.ts.map +1 -0
- package/dist/widget/ui/src/icons/Swap.d.ts +5 -0
- package/dist/widget/ui/src/icons/Swap.d.ts.map +1 -0
- package/dist/widget/ui/src/icons/index.d.ts +3 -0
- package/dist/widget/ui/src/icons/index.d.ts.map +1 -1
- package/dist/widget/ui/src/theme.d.ts +25 -13
- package/dist/widget/ui/src/theme.d.ts.map +1 -1
- package/package.json +5 -4
- package/readme.md +3 -1
- package/src/components/Alert/Alert.helpers.ts +13 -2
- package/src/components/Alert/Alert.styles.ts +7 -8
- package/src/components/Alert/Alert.tsx +8 -6
- package/src/components/Alert/Alert.types.ts +5 -2
- package/src/components/Divider/Divider.tsx +2 -1
- package/src/components/Flags/Portuguese.tsx +34 -0
- package/src/components/Flags/index.ts +2 -1
- package/src/components/I18nManager/I18nManager.tsx +2 -0
- package/src/components/Modal/Modal.tsx +25 -12
- package/src/components/Modal/Modal.types.ts +6 -1
- package/src/components/QuoteCost/QuoteCost.styles.ts +0 -1
- package/src/components/QuoteCost/QuoteCost.types.ts +1 -1
- package/src/components/Select/Select.tsx +85 -0
- package/src/components/Select/Select.types.ts +10 -0
- package/src/components/Select/index.ts +1 -0
- package/src/components/Select/select.styles.ts +100 -0
- package/src/components/TextField/TextField.styles.ts +1 -0
- package/src/components/Toast/Toast.Provider.tsx +82 -44
- package/src/components/Toast/Toast.helpers.ts +5 -0
- package/src/components/Toast/Toast.stories.tsx +18 -21
- package/src/components/Toast/Toast.styles.ts +278 -38
- package/src/components/Toast/Toast.tsx +84 -32
- package/src/components/Toast/Toast.types.ts +19 -17
- package/src/components/Typography/NotSelectableTypography.ts +7 -0
- package/src/components/Typography/Typography.types.tsx +1 -1
- package/src/components/Typography/index.ts +1 -0
- package/src/components/index.ts +1 -0
- package/src/containers/ConnectWalletsModal/ConnectWalletsModal.tsx +3 -1
- package/src/icons/Autorenew.tsx +20 -0
- package/src/icons/Exit.tsx +20 -0
- package/src/icons/Swap.tsx +20 -0
- package/src/icons/index.ts +3 -0
- package/src/theme.ts +4 -1
|
@@ -1,48 +1,252 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { css, darkTheme, lightTheme, styled } from '../../theme';
|
|
2
2
|
import { Typography } from '../Typography';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
import {
|
|
5
|
+
HOVER_TRANSITION_DURATION,
|
|
6
|
+
TOAST_TRANSITION_DURATION,
|
|
7
|
+
} from './Toast.helpers';
|
|
8
|
+
|
|
9
|
+
export const toastContentStyles = css({
|
|
10
|
+
transition: `transform ${HOVER_TRANSITION_DURATION}ms ease-in-out`,
|
|
11
|
+
'&:hover': {
|
|
12
|
+
transform: 'scale(0.99)',
|
|
13
|
+
},
|
|
7
14
|
});
|
|
8
15
|
|
|
9
16
|
export const ToastContentContainer = styled('div', {
|
|
17
|
+
transition: `transform ${TOAST_TRANSITION_DURATION}ms cubic-bezier(0, 0, 0.75, 1.25)`,
|
|
18
|
+
cursor: 'pointer',
|
|
10
19
|
variants: {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
20
|
+
isActive: {
|
|
21
|
+
true: {},
|
|
22
|
+
},
|
|
23
|
+
isVisible: {
|
|
24
|
+
true: {},
|
|
25
|
+
},
|
|
26
|
+
position: {
|
|
27
|
+
'right-top': {},
|
|
28
|
+
'right-bottom': {},
|
|
29
|
+
'left-top': {},
|
|
30
|
+
'left-bottom': {},
|
|
31
|
+
'center-top': {},
|
|
32
|
+
'center-bottom': {},
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
compoundVariants: [
|
|
36
|
+
{
|
|
37
|
+
position: 'right-top',
|
|
38
|
+
isActive: true,
|
|
39
|
+
isVisible: true,
|
|
40
|
+
css: {
|
|
41
|
+
transform: 'translateX(0)',
|
|
42
|
+
maxHeight: '200px',
|
|
15
43
|
},
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
position: 'right-top',
|
|
47
|
+
isActive: false,
|
|
48
|
+
isVisible: true,
|
|
49
|
+
css: {
|
|
50
|
+
maxHeight: '200px',
|
|
51
|
+
transform: 'translateX(100%)',
|
|
19
52
|
},
|
|
20
53
|
},
|
|
21
|
-
|
|
54
|
+
{
|
|
55
|
+
position: 'right-top',
|
|
56
|
+
isActive: false,
|
|
57
|
+
isVisible: false,
|
|
58
|
+
css: {
|
|
59
|
+
maxHeight: '0px',
|
|
60
|
+
transform: 'translateX(100%)',
|
|
61
|
+
transition: `max-height ${TOAST_TRANSITION_DURATION}ms ease-in-out`,
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
position: 'right-bottom',
|
|
66
|
+
isActive: true,
|
|
67
|
+
isVisible: true,
|
|
68
|
+
css: {
|
|
69
|
+
transform: 'translateX(0)',
|
|
70
|
+
maxHeight: '200px',
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
position: 'right-bottom',
|
|
75
|
+
isActive: false,
|
|
76
|
+
isVisible: true,
|
|
77
|
+
css: {
|
|
78
|
+
transform: 'translateX(100%)',
|
|
79
|
+
maxHeight: '200px',
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
position: 'right-bottom',
|
|
84
|
+
isActive: false,
|
|
85
|
+
isVisible: false,
|
|
86
|
+
css: {
|
|
87
|
+
transform: 'translateX(100%)',
|
|
88
|
+
maxHeight: '0px',
|
|
89
|
+
transition: `max-height ${TOAST_TRANSITION_DURATION}ms ease-in-out`,
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
position: 'left-top',
|
|
94
|
+
isActive: true,
|
|
95
|
+
isVisible: true,
|
|
96
|
+
css: {
|
|
97
|
+
transform: 'translateX(0)',
|
|
98
|
+
maxHeight: '200px',
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
position: 'left-top',
|
|
103
|
+
isActive: false,
|
|
104
|
+
isVisible: true,
|
|
105
|
+
css: {
|
|
106
|
+
transform: 'translateX(-100%)',
|
|
107
|
+
maxHeight: '200px',
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
position: 'left-top',
|
|
112
|
+
isActive: false,
|
|
113
|
+
isVisible: false,
|
|
114
|
+
css: {
|
|
115
|
+
transform: 'translateX(-100%)',
|
|
116
|
+
maxHeight: '0px',
|
|
117
|
+
transition: `max-height ${TOAST_TRANSITION_DURATION}ms ease-in-out`,
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
position: 'left-bottom',
|
|
122
|
+
isActive: true,
|
|
123
|
+
isVisible: true,
|
|
124
|
+
css: {
|
|
125
|
+
transform: 'translateX(0)',
|
|
126
|
+
maxHeight: '200px',
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
position: 'left-bottom',
|
|
131
|
+
isActive: false,
|
|
132
|
+
isVisible: true,
|
|
133
|
+
css: {
|
|
134
|
+
transform: 'translateX(-100%)',
|
|
135
|
+
maxHeight: '200px',
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
position: 'left-bottom',
|
|
140
|
+
isActive: false,
|
|
141
|
+
isVisible: false,
|
|
142
|
+
css: {
|
|
143
|
+
transform: 'translateX(-100%)',
|
|
144
|
+
maxHeight: '0px',
|
|
145
|
+
transition: `max-height ${TOAST_TRANSITION_DURATION}ms ease-in-out`,
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
position: 'center-top',
|
|
150
|
+
isActive: true,
|
|
151
|
+
isVisible: true,
|
|
152
|
+
css: {
|
|
153
|
+
maxHeight: '200px',
|
|
154
|
+
transform: 'translateY(0)',
|
|
155
|
+
opacity: 1,
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
position: 'center-top',
|
|
160
|
+
isActive: false,
|
|
161
|
+
isVisible: true,
|
|
162
|
+
css: {
|
|
163
|
+
maxHeight: '200px',
|
|
164
|
+
transform: 'translateY(-1000%)',
|
|
165
|
+
opacity: 0,
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
position: 'center-top',
|
|
170
|
+
isActive: false,
|
|
171
|
+
isVisible: false,
|
|
172
|
+
css: {
|
|
173
|
+
maxHeight: '0px',
|
|
174
|
+
opacity: 0,
|
|
175
|
+
transform: 'translateY(-1000%)',
|
|
176
|
+
transition: `max-height ${TOAST_TRANSITION_DURATION}ms ease-in-out`,
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
position: 'center-bottom',
|
|
181
|
+
isActive: true,
|
|
182
|
+
isVisible: true,
|
|
183
|
+
css: {
|
|
184
|
+
transform: 'translateY(0)',
|
|
185
|
+
maxHeight: '200px',
|
|
186
|
+
opacity: 1,
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
position: 'center-bottom',
|
|
191
|
+
isActive: false,
|
|
192
|
+
isVisible: true,
|
|
193
|
+
css: {
|
|
194
|
+
transform: 'translateY(1000%)',
|
|
195
|
+
maxHeight: '200px',
|
|
196
|
+
opacity: 0,
|
|
197
|
+
},
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
position: 'center-bottom',
|
|
201
|
+
isActive: false,
|
|
202
|
+
isVisible: false,
|
|
203
|
+
css: {
|
|
204
|
+
transform: 'translateY(1000%)',
|
|
205
|
+
maxHeight: '0px',
|
|
206
|
+
opacity: 0,
|
|
207
|
+
transition: `max-height ${TOAST_TRANSITION_DURATION}ms ease-in-out`,
|
|
208
|
+
},
|
|
209
|
+
},
|
|
210
|
+
],
|
|
22
211
|
});
|
|
23
212
|
|
|
24
213
|
export const ToastContainer = styled('div', {
|
|
214
|
+
overflow: 'hidden',
|
|
25
215
|
position: 'absolute',
|
|
26
216
|
zIndex: 9999,
|
|
27
217
|
display: 'flex',
|
|
28
218
|
gap: '$4',
|
|
29
219
|
flexDirection: 'column',
|
|
30
220
|
variants: {
|
|
31
|
-
|
|
32
|
-
right: {
|
|
221
|
+
position: {
|
|
222
|
+
'right-top': {
|
|
223
|
+
right: 12,
|
|
224
|
+
top: 2,
|
|
225
|
+
},
|
|
226
|
+
'right-bottom': {
|
|
33
227
|
right: 12,
|
|
228
|
+
bottom: 2,
|
|
229
|
+
flexDirection: 'column-reverse',
|
|
34
230
|
},
|
|
35
|
-
left: {
|
|
231
|
+
'left-top': {
|
|
36
232
|
left: 12,
|
|
233
|
+
top: 2,
|
|
37
234
|
},
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
235
|
+
'left-bottom': {
|
|
236
|
+
left: 12,
|
|
237
|
+
bottom: 2,
|
|
238
|
+
flexDirection: 'column-reverse',
|
|
239
|
+
},
|
|
240
|
+
'center-top': {
|
|
241
|
+
left: '50%',
|
|
242
|
+
transform: 'translateX(-50%)',
|
|
42
243
|
top: 2,
|
|
43
244
|
},
|
|
44
|
-
bottom: {
|
|
245
|
+
'center-bottom': {
|
|
246
|
+
left: '50%',
|
|
247
|
+
transform: 'translateX(-50%)',
|
|
45
248
|
bottom: 2,
|
|
249
|
+
flexDirection: 'column-reverse',
|
|
46
250
|
},
|
|
47
251
|
},
|
|
48
252
|
},
|
|
@@ -53,36 +257,73 @@ export const AlertBox = styled('div', {
|
|
|
53
257
|
borderRadius: '$sm',
|
|
54
258
|
width: '292px',
|
|
55
259
|
minHeight: '52px',
|
|
56
|
-
backgroundColor: '$background',
|
|
57
|
-
borderRight: '1px solid',
|
|
58
|
-
[`.${darkTheme} &`]: {
|
|
59
|
-
backgroundColor: '#070917',
|
|
60
|
-
},
|
|
61
|
-
'&:hover': {
|
|
62
|
-
backgroundColor: '$info100',
|
|
63
|
-
[`.${darkTheme} &`]: {
|
|
64
|
-
backgroundColor: '#111733',
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
260
|
variants: {
|
|
261
|
+
variant: {
|
|
262
|
+
custom: {
|
|
263
|
+
backgroundColor: '$background',
|
|
264
|
+
borderRight: '1px solid',
|
|
265
|
+
'&:hover': {
|
|
266
|
+
backgroundColor: '$info100',
|
|
267
|
+
[`.${darkTheme} &`]: {
|
|
268
|
+
backgroundColor: '$neutral300',
|
|
269
|
+
},
|
|
270
|
+
},
|
|
271
|
+
},
|
|
272
|
+
standard: {
|
|
273
|
+
'& ._alert': {
|
|
274
|
+
padding: '$10',
|
|
275
|
+
width: '100%',
|
|
276
|
+
justifyContent: 'center',
|
|
277
|
+
alignItems: 'center',
|
|
278
|
+
},
|
|
279
|
+
},
|
|
280
|
+
},
|
|
68
281
|
type: {
|
|
69
|
-
error: {
|
|
282
|
+
error: {},
|
|
283
|
+
success: {},
|
|
284
|
+
warning: {},
|
|
285
|
+
info: {},
|
|
286
|
+
loading: {},
|
|
287
|
+
},
|
|
288
|
+
},
|
|
289
|
+
compoundVariants: [
|
|
290
|
+
{
|
|
291
|
+
variant: 'custom',
|
|
292
|
+
type: 'error',
|
|
293
|
+
|
|
294
|
+
css: {
|
|
70
295
|
borderRightColor: '$error500',
|
|
71
296
|
},
|
|
72
|
-
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
variant: 'custom',
|
|
300
|
+
type: 'success',
|
|
301
|
+
css: {
|
|
73
302
|
borderRightColor: '$success500',
|
|
74
303
|
},
|
|
75
|
-
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
variant: 'custom',
|
|
307
|
+
type: 'warning',
|
|
308
|
+
css: {
|
|
76
309
|
borderRightColor: '$warning500',
|
|
77
310
|
},
|
|
78
|
-
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
variant: 'custom',
|
|
314
|
+
type: 'info',
|
|
315
|
+
css: {
|
|
79
316
|
borderRightColor: '$info500',
|
|
80
317
|
},
|
|
81
|
-
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
variant: 'custom',
|
|
321
|
+
type: 'loading',
|
|
322
|
+
css: {
|
|
82
323
|
borderRightColor: '$info500',
|
|
83
324
|
},
|
|
84
325
|
},
|
|
85
|
-
|
|
326
|
+
],
|
|
86
327
|
});
|
|
87
328
|
|
|
88
329
|
export const AlertFlexContainer = styled('div', {
|
|
@@ -108,6 +349,5 @@ export const StyledTypography = styled(Typography, {
|
|
|
108
349
|
|
|
109
350
|
export const ToastStoryContainer = styled('div', {
|
|
110
351
|
display: 'flex',
|
|
111
|
-
justifyContent: 'center',
|
|
112
352
|
alignItems: 'center',
|
|
113
353
|
});
|
|
@@ -1,59 +1,111 @@
|
|
|
1
1
|
import type { ToastProps } from './Toast.types';
|
|
2
2
|
|
|
3
|
-
import React, { useEffect } from 'react';
|
|
3
|
+
import React, { useEffect, useState } from 'react';
|
|
4
4
|
|
|
5
|
+
import { CloseIcon } from '../../icons';
|
|
6
|
+
import { Alert } from '../Alert';
|
|
5
7
|
import { IconHighlight } from '../Alert/Alert.styles';
|
|
6
8
|
import AlertIcon from '../Alert/AlertIcon';
|
|
7
9
|
import { Divider } from '../Divider';
|
|
10
|
+
import { IconButton } from '../IconButton';
|
|
8
11
|
|
|
12
|
+
import { TOAST_HIDE_DELAY, TOAST_UNMOUNT_DELAY } from './Toast.helpers';
|
|
9
13
|
import { useToast } from './Toast.Provider';
|
|
10
14
|
import {
|
|
11
15
|
AlertBox,
|
|
12
16
|
AlertFlexContainer,
|
|
13
17
|
StyledTypography,
|
|
14
18
|
ToastContentContainer,
|
|
19
|
+
toastContentStyles,
|
|
15
20
|
} from './Toast.styles';
|
|
16
21
|
|
|
17
|
-
const DEFAULT_HIDE_DURATION = 3_000;
|
|
18
|
-
|
|
19
22
|
export const Toast = (props: ToastProps) => {
|
|
20
|
-
const {
|
|
23
|
+
const {
|
|
24
|
+
id,
|
|
25
|
+
autoHideDuration,
|
|
26
|
+
onClose,
|
|
27
|
+
type,
|
|
28
|
+
title,
|
|
29
|
+
position,
|
|
30
|
+
hasCloseIcon = true,
|
|
31
|
+
hideOnTap = true,
|
|
32
|
+
variant = 'standard',
|
|
33
|
+
} = props;
|
|
34
|
+
const [isActive, setIsActive] = useState(false);
|
|
35
|
+
const [isVisible, setIsVisible] = useState(false);
|
|
21
36
|
const { removeToast } = useToast();
|
|
22
37
|
useEffect(() => {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
38
|
+
let cleanup;
|
|
39
|
+
|
|
40
|
+
if (autoHideDuration) {
|
|
41
|
+
const timer = setTimeout(() => {
|
|
42
|
+
handleClose();
|
|
43
|
+
}, autoHideDuration);
|
|
44
|
+
|
|
45
|
+
cleanup = () => clearTimeout(timer);
|
|
46
|
+
}
|
|
26
47
|
|
|
27
|
-
return
|
|
28
|
-
clearTimeout(timer);
|
|
29
|
-
};
|
|
48
|
+
return cleanup;
|
|
30
49
|
}, [id]);
|
|
31
50
|
|
|
51
|
+
const handleClose = () => {
|
|
52
|
+
setIsActive(false);
|
|
53
|
+
setTimeout(() => {
|
|
54
|
+
setIsVisible(false);
|
|
55
|
+
}, TOAST_HIDE_DELAY);
|
|
56
|
+
setTimeout(() => {
|
|
57
|
+
removeToast(id, position);
|
|
58
|
+
onClose?.();
|
|
59
|
+
}, TOAST_UNMOUNT_DELAY);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
useEffect(() => {
|
|
63
|
+
setIsVisible(true);
|
|
64
|
+
setTimeout(() => {
|
|
65
|
+
setIsActive(true);
|
|
66
|
+
}, 0);
|
|
67
|
+
}, []);
|
|
68
|
+
|
|
32
69
|
return (
|
|
33
|
-
<ToastContentContainer
|
|
34
|
-
{
|
|
35
|
-
|
|
36
|
-
|
|
70
|
+
<ToastContentContainer
|
|
71
|
+
isActive={isActive}
|
|
72
|
+
position={position}
|
|
73
|
+
isVisible={isVisible}>
|
|
74
|
+
<div className={toastContentStyles()}>
|
|
37
75
|
<AlertBox
|
|
38
|
-
onClick={
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
<
|
|
43
|
-
<
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
variant="body"
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
76
|
+
onClick={hideOnTap ? handleClose : undefined}
|
|
77
|
+
variant={variant}
|
|
78
|
+
type={type}>
|
|
79
|
+
{variant === 'custom' ? (
|
|
80
|
+
<AlertFlexContainer>
|
|
81
|
+
<IconHighlight type={type} align="center">
|
|
82
|
+
<AlertIcon type={type} />
|
|
83
|
+
</IconHighlight>
|
|
84
|
+
<Divider direction="horizontal" size={10} />
|
|
85
|
+
<StyledTypography variant="body" size="small" align="left">
|
|
86
|
+
{props.title}
|
|
87
|
+
</StyledTypography>
|
|
88
|
+
</AlertFlexContainer>
|
|
89
|
+
) : (
|
|
90
|
+
<Alert
|
|
91
|
+
title={title}
|
|
92
|
+
type={type}
|
|
93
|
+
variant="alarm"
|
|
94
|
+
titleAlign="left"
|
|
95
|
+
action={
|
|
96
|
+
hasCloseIcon ? (
|
|
97
|
+
<IconButton
|
|
98
|
+
variant="ghost"
|
|
99
|
+
size="xsmall"
|
|
100
|
+
onClick={handleClose}>
|
|
101
|
+
<CloseIcon size={12} />
|
|
102
|
+
</IconButton>
|
|
103
|
+
) : undefined
|
|
104
|
+
}
|
|
105
|
+
/>
|
|
106
|
+
)}
|
|
55
107
|
</AlertBox>
|
|
56
|
-
|
|
108
|
+
</div>
|
|
57
109
|
</ToastContentContainer>
|
|
58
110
|
);
|
|
59
111
|
};
|
|
@@ -1,31 +1,33 @@
|
|
|
1
|
+
import type { ToastContainer } from './Toast.styles';
|
|
1
2
|
import type { Type } from '../Alert/Alert.types';
|
|
2
|
-
import type
|
|
3
|
+
import type * as Stitches from '@stitches/react';
|
|
4
|
+
import type { CSSProperties } from 'react';
|
|
3
5
|
|
|
6
|
+
type BaseProps = Stitches.VariantProps<typeof ToastContainer>;
|
|
7
|
+
export type ToastPosition = Exclude<BaseProps['position'], object>;
|
|
4
8
|
export interface ProviderPropTypes {
|
|
5
9
|
container: HTMLElement;
|
|
6
|
-
anchorOrigin?: {
|
|
7
|
-
horizontal: 'left' | 'right';
|
|
8
|
-
vertical: 'bottom' | 'top';
|
|
9
|
-
};
|
|
10
|
-
containerStyle?: CSSProperties;
|
|
11
10
|
}
|
|
12
11
|
|
|
13
|
-
export type ToastType = {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
12
|
+
export type ToastType = {
|
|
13
|
+
autoHideDuration?: number;
|
|
14
|
+
id?: number | string;
|
|
15
|
+
containerStyle?: CSSProperties;
|
|
16
|
+
onClose?: () => void;
|
|
17
|
+
position: ToastPosition;
|
|
18
|
+
title: string;
|
|
19
|
+
type: Type;
|
|
20
|
+
style?: CSSProperties;
|
|
21
|
+
hasCloseIcon?: boolean;
|
|
22
|
+
hideOnTap?: boolean;
|
|
23
|
+
variant?: 'custom' | 'standard';
|
|
24
|
+
};
|
|
22
25
|
|
|
23
26
|
export type ToastProps = ToastType & {
|
|
24
27
|
id: number | string;
|
|
25
|
-
horizontal: 'left' | 'right';
|
|
26
28
|
};
|
|
27
29
|
|
|
28
30
|
export type ProviderContext = {
|
|
29
31
|
addToast: (content: ToastType) => void;
|
|
30
|
-
removeToast: (id: number | string) => void;
|
|
32
|
+
removeToast: (id: number | string, position: ToastPosition) => void;
|
|
31
33
|
};
|
|
@@ -4,7 +4,7 @@ import type * as Stitches from '@stitches/react';
|
|
|
4
4
|
type BaseProps = Stitches.VariantProps<typeof TypographyContainer>;
|
|
5
5
|
type BaseSizes = Exclude<BaseProps['size'], object>;
|
|
6
6
|
type BaseVariants = Exclude<BaseProps['variant'], object>;
|
|
7
|
-
type BaseAlign = Exclude<BaseProps['align'], object>;
|
|
7
|
+
export type BaseAlign = Exclude<BaseProps['align'], object>;
|
|
8
8
|
|
|
9
9
|
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
|
|
10
10
|
type margin = 2 | 4 | 8 | 12;
|
package/src/components/index.ts
CHANGED
|
@@ -30,7 +30,9 @@ export function ConnectWalletsModal(props: PropTypes) {
|
|
|
30
30
|
title={i18n.t('Connect Wallets')}
|
|
31
31
|
open={open}
|
|
32
32
|
onClose={onClose}
|
|
33
|
-
|
|
33
|
+
styles={{
|
|
34
|
+
container: { width: '75%', maxWidth: '30rem', height: '60%' },
|
|
35
|
+
}}>
|
|
34
36
|
<ModalContent>
|
|
35
37
|
{list.map((info) => (
|
|
36
38
|
<Wallet {...info} key={info.title} onClick={onSelect} />
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { SvgIconPropsWithChildren } from '../components/SvgIcon';
|
|
2
|
+
|
|
3
|
+
import React, { createElement } from 'react';
|
|
4
|
+
|
|
5
|
+
import { SvgIcon } from '../components/SvgIcon';
|
|
6
|
+
|
|
7
|
+
function SvgAutorenew(props: SvgIconPropsWithChildren) {
|
|
8
|
+
return createElement(
|
|
9
|
+
SvgIcon,
|
|
10
|
+
props,
|
|
11
|
+
<svg viewBox="0 0 24 24">
|
|
12
|
+
<path
|
|
13
|
+
fillRule="evenodd"
|
|
14
|
+
d="M12 6v3l4-4-4-4v3c-4.42 0-8 3.58-8 8 0 1.57.46 3.03 1.24 4.26L6.7 14.8c-.45-.83-.7-1.79-.7-2.8 0-3.31 2.69-6 6-6zm6.76 1.74L17.3 9.2c.44.84.7 1.79.7 2.8 0 3.31-2.69 6-6 6v-3l-4 4 4 4v-3c4.42 0 8-3.58 8-8 0-1.57-.46-3.03-1.24-4.26z"
|
|
15
|
+
fill="currentColor"
|
|
16
|
+
/>
|
|
17
|
+
</svg>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
export default SvgAutorenew;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { SvgIconPropsWithChildren } from '../components/SvgIcon';
|
|
2
|
+
|
|
3
|
+
import React, { createElement } from 'react';
|
|
4
|
+
|
|
5
|
+
import { SvgIcon } from '../components/SvgIcon';
|
|
6
|
+
|
|
7
|
+
function SvgExit(props: SvgIconPropsWithChildren) {
|
|
8
|
+
return createElement(
|
|
9
|
+
SvgIcon,
|
|
10
|
+
props,
|
|
11
|
+
<svg viewBox="0 0 24 24">
|
|
12
|
+
<path
|
|
13
|
+
fillRule="evenodd"
|
|
14
|
+
d="M10.09 15.59 11.5 17l5-5-5-5-1.41 1.41L12.67 11H3v2h9.67l-2.58 2.59zM19 3H5c-1.11 0-2 .9-2 2v4h2V5h14v14H5v-4H3v4c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"
|
|
15
|
+
fill="currentColor"
|
|
16
|
+
/>
|
|
17
|
+
</svg>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
export default SvgExit;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { SvgIconPropsWithChildren } from '../components/SvgIcon';
|
|
2
|
+
|
|
3
|
+
import React, { createElement } from 'react';
|
|
4
|
+
|
|
5
|
+
import { SvgIcon } from '../components/SvgIcon';
|
|
6
|
+
|
|
7
|
+
function SvgSwap(props: SvgIconPropsWithChildren) {
|
|
8
|
+
return createElement(
|
|
9
|
+
SvgIcon,
|
|
10
|
+
props,
|
|
11
|
+
<svg viewBox="0 0 24 24">
|
|
12
|
+
<path
|
|
13
|
+
fillRule="evenodd"
|
|
14
|
+
d="M6.99 11 3 15l3.99 4v-3H14v-2H6.99v-3zM21 9l-3.99-4v3H10v2h7.01v3L21 9z"
|
|
15
|
+
fill="currentColor"
|
|
16
|
+
/>
|
|
17
|
+
</svg>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
export default SvgSwap;
|
package/src/icons/index.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { default as AddIcon } from './Add';
|
|
2
2
|
export { default as AutoThemeIcon } from './AutoTheme';
|
|
3
|
+
export { default as AutorenewIcon } from './Autorenew';
|
|
3
4
|
export { default as BorderRadiusIcon } from './BorderRadius';
|
|
4
5
|
export { default as ChevronDownIcon } from './ChevronDown';
|
|
5
6
|
export { default as ChevronLeftIcon } from './ChevronLeft';
|
|
@@ -16,6 +17,7 @@ export { default as DesktopIcon } from './Desktop';
|
|
|
16
17
|
export { default as DoneIcon } from './Done';
|
|
17
18
|
export { default as EvmCategoryIcon } from './EvmCategory';
|
|
18
19
|
export { default as ErrorIcon } from './Error';
|
|
20
|
+
export { default as ExitIcon } from './Exit';
|
|
19
21
|
export { default as ExternalLinkIcon } from './ExternalLink';
|
|
20
22
|
export { default as FontIcon } from './Font';
|
|
21
23
|
export { default as GasIcon } from './Gas';
|
|
@@ -41,6 +43,7 @@ export { default as RefreshIcon } from './Refresh';
|
|
|
41
43
|
export { default as ReverseIcon } from './Reverse';
|
|
42
44
|
export { default as RouteIcon } from './Route';
|
|
43
45
|
export { default as SearchIcon } from './Search';
|
|
46
|
+
export { default as SwapIcon } from './Swap';
|
|
44
47
|
export { default as TimeIcon } from './Time';
|
|
45
48
|
export { default as TransactionIcon } from './Transaction';
|
|
46
49
|
export { default as UtxoCategoryIcon } from './UtxoCategory';
|