@rango-dev/ui 0.28.2-next.1 → 0.28.2-next.11
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.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 +9 -5
- 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 +3 -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.styles.d.ts +3 -0
- 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.styles.d.ts +1 -0
- 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 +2 -0
- 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 +3 -0
- 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/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.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/Popover/Popover.types.d.ts +4 -0
- package/dist/widget/ui/src/components/Popover/Popover.types.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 +4 -0
- 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 +6 -0
- 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 +1 -0
- 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.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.styles.d.ts +173 -1
- package/dist/widget/ui/src/components/Toast/Toast.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/TokenAmount/TokenAmount.styles.d.ts +3 -0
- 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/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/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 +12 -1
- 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 +5 -0
- 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/Tune.d.ts +5 -0
- package/dist/widget/ui/src/icons/Tune.d.ts.map +1 -0
- package/dist/widget/ui/src/icons/index.d.ts +1 -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 +6 -6
- package/src/components/Alert/Alert.types.ts +3 -2
- 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 +19 -7
- package/src/components/Popover/Popover.tsx +5 -3
- package/src/components/Popover/Popover.types.ts +4 -0
- 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.helpers.ts +5 -0
- package/src/components/Toast/Toast.styles.ts +209 -5
- package/src/components/Toast/Toast.tsx +59 -34
- package/src/components/Typography/NotSelectableTypography.ts +7 -0
- package/src/components/Typography/index.ts +1 -0
- package/src/components/index.ts +1 -0
- package/src/icons/Tune.tsx +51 -0
- package/src/icons/index.ts +1 -0
- package/src/theme.ts +4 -1
|
@@ -1,16 +1,217 @@
|
|
|
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', {
|
|
10
|
-
|
|
17
|
+
transition: `transform ${TOAST_TRANSITION_DURATION}ms cubic-bezier(0, 0, 0.75, 1.25)`,
|
|
18
|
+
cursor: 'pointer',
|
|
19
|
+
variants: {
|
|
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',
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
position: 'right-top',
|
|
47
|
+
isActive: false,
|
|
48
|
+
isVisible: true,
|
|
49
|
+
css: {
|
|
50
|
+
maxHeight: '200px',
|
|
51
|
+
transform: 'translateX(100%)',
|
|
52
|
+
},
|
|
53
|
+
},
|
|
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
|
+
],
|
|
11
211
|
});
|
|
12
212
|
|
|
13
213
|
export const ToastContainer = styled('div', {
|
|
214
|
+
overflow: 'hidden',
|
|
14
215
|
position: 'absolute',
|
|
15
216
|
zIndex: 9999,
|
|
16
217
|
display: 'flex',
|
|
@@ -25,6 +226,7 @@ export const ToastContainer = styled('div', {
|
|
|
25
226
|
'right-bottom': {
|
|
26
227
|
right: 12,
|
|
27
228
|
bottom: 2,
|
|
229
|
+
flexDirection: 'column-reverse',
|
|
28
230
|
},
|
|
29
231
|
'left-top': {
|
|
30
232
|
left: 12,
|
|
@@ -33,6 +235,7 @@ export const ToastContainer = styled('div', {
|
|
|
33
235
|
'left-bottom': {
|
|
34
236
|
left: 12,
|
|
35
237
|
bottom: 2,
|
|
238
|
+
flexDirection: 'column-reverse',
|
|
36
239
|
},
|
|
37
240
|
'center-top': {
|
|
38
241
|
left: '50%',
|
|
@@ -43,6 +246,7 @@ export const ToastContainer = styled('div', {
|
|
|
43
246
|
left: '50%',
|
|
44
247
|
transform: 'translateX(-50%)',
|
|
45
248
|
bottom: 2,
|
|
249
|
+
flexDirection: 'column-reverse',
|
|
46
250
|
},
|
|
47
251
|
},
|
|
48
252
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
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
5
|
import { CloseIcon } from '../../icons';
|
|
6
6
|
import { Alert } from '../Alert';
|
|
@@ -9,12 +9,14 @@ import AlertIcon from '../Alert/AlertIcon';
|
|
|
9
9
|
import { Divider } from '../Divider';
|
|
10
10
|
import { IconButton } from '../IconButton';
|
|
11
11
|
|
|
12
|
+
import { TOAST_HIDE_DELAY, TOAST_UNMOUNT_DELAY } from './Toast.helpers';
|
|
12
13
|
import { useToast } from './Toast.Provider';
|
|
13
14
|
import {
|
|
14
15
|
AlertBox,
|
|
15
16
|
AlertFlexContainer,
|
|
16
17
|
StyledTypography,
|
|
17
18
|
ToastContentContainer,
|
|
19
|
+
toastContentStyles,
|
|
18
20
|
} from './Toast.styles';
|
|
19
21
|
|
|
20
22
|
export const Toast = (props: ToastProps) => {
|
|
@@ -29,6 +31,8 @@ export const Toast = (props: ToastProps) => {
|
|
|
29
31
|
hideOnTap = true,
|
|
30
32
|
variant = 'standard',
|
|
31
33
|
} = props;
|
|
34
|
+
const [isActive, setIsActive] = useState(false);
|
|
35
|
+
const [isVisible, setIsVisible] = useState(false);
|
|
32
36
|
const { removeToast } = useToast();
|
|
33
37
|
useEffect(() => {
|
|
34
38
|
let cleanup;
|
|
@@ -45,42 +49,63 @@ export const Toast = (props: ToastProps) => {
|
|
|
45
49
|
}, [id]);
|
|
46
50
|
|
|
47
51
|
const handleClose = () => {
|
|
48
|
-
|
|
49
|
-
|
|
52
|
+
setIsActive(false);
|
|
53
|
+
setTimeout(() => {
|
|
54
|
+
setIsVisible(false);
|
|
55
|
+
}, TOAST_HIDE_DELAY);
|
|
56
|
+
setTimeout(() => {
|
|
57
|
+
removeToast(id, position);
|
|
58
|
+
onClose?.();
|
|
59
|
+
}, TOAST_UNMOUNT_DELAY);
|
|
50
60
|
};
|
|
51
61
|
|
|
62
|
+
useEffect(() => {
|
|
63
|
+
setIsVisible(true);
|
|
64
|
+
setTimeout(() => {
|
|
65
|
+
setIsActive(true);
|
|
66
|
+
}, 0);
|
|
67
|
+
}, []);
|
|
68
|
+
|
|
52
69
|
return (
|
|
53
|
-
<ToastContentContainer
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
<
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
70
|
+
<ToastContentContainer
|
|
71
|
+
isActive={isActive}
|
|
72
|
+
position={position}
|
|
73
|
+
isVisible={isVisible}>
|
|
74
|
+
<div className={toastContentStyles()}>
|
|
75
|
+
<AlertBox
|
|
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
|
+
)}
|
|
107
|
+
</AlertBox>
|
|
108
|
+
</div>
|
|
84
109
|
</ToastContentContainer>
|
|
85
110
|
);
|
|
86
111
|
};
|
package/src/components/index.ts
CHANGED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { SvgIconPropsWithChildren } from '../components/SvgIcon';
|
|
2
|
+
|
|
3
|
+
import React, { createElement } from 'react';
|
|
4
|
+
|
|
5
|
+
import { SvgIcon } from '../components/SvgIcon';
|
|
6
|
+
|
|
7
|
+
function SvgTune(props: SvgIconPropsWithChildren) {
|
|
8
|
+
return createElement(
|
|
9
|
+
SvgIcon,
|
|
10
|
+
props,
|
|
11
|
+
<svg viewBox="0 0 24 25" xmlns="http://www.w3.org/2000/svg">
|
|
12
|
+
<path
|
|
13
|
+
fillRule="evenodd"
|
|
14
|
+
clipRule="evenodd"
|
|
15
|
+
d="M10.3143 10.9429C11.7029 10.9429 12.8286 9.81717 12.8286 8.42857C12.8286 7.03997 11.7029 5.91429 10.3143 5.91429C8.92568 5.91429 7.8 7.03997 7.8 8.42857C7.8 9.81717 8.92568 10.9429 10.3143 10.9429ZM10.3143 11.8571C12.2078 11.8571 13.7429 10.3221 13.7429 8.42857C13.7429 6.53502 12.2078 5 10.3143 5C8.42074 5 6.88571 6.53502 6.88571 8.42857C6.88571 10.3221 8.42074 11.8571 10.3143 11.8571Z"
|
|
16
|
+
fill="currentColor"
|
|
17
|
+
/>
|
|
18
|
+
<path
|
|
19
|
+
fillRule="evenodd"
|
|
20
|
+
clipRule="evenodd"
|
|
21
|
+
d="M13.7429 20.0857C15.1315 20.0857 16.2571 18.96 16.2571 17.5714C16.2571 16.1828 15.1315 15.0571 13.7429 15.0571C12.3543 15.0571 11.2286 16.1828 11.2286 17.5714C11.2286 18.96 12.3543 20.0857 13.7429 20.0857ZM13.7429 21C15.6364 21 17.1714 19.465 17.1714 17.5714C17.1714 15.6779 15.6364 14.1429 13.7429 14.1429C11.8493 14.1429 10.3143 15.6779 10.3143 17.5714C10.3143 19.465 11.8493 21 13.7429 21Z"
|
|
22
|
+
fill="currentColor"
|
|
23
|
+
/>
|
|
24
|
+
<path
|
|
25
|
+
fillRule="evenodd"
|
|
26
|
+
clipRule="evenodd"
|
|
27
|
+
d="M3 8.42857C3 8.1761 3.20467 7.97143 3.45714 7.97143H6.88571C7.13819 7.97143 7.34286 8.1761 7.34286 8.42857C7.34286 8.68104 7.13819 8.88571 6.88571 8.88571H3.45714C3.20467 8.88571 3 8.68104 3 8.42857Z"
|
|
28
|
+
fill="currentColor"
|
|
29
|
+
/>
|
|
30
|
+
<path
|
|
31
|
+
fillRule="evenodd"
|
|
32
|
+
clipRule="evenodd"
|
|
33
|
+
d="M16.7143 17.5714C16.7143 17.319 16.919 17.1143 17.1714 17.1143H20.6C20.8525 17.1143 21.0571 17.319 21.0571 17.5714C21.0571 17.8239 20.8525 18.0286 20.6 18.0286H17.1714C16.919 18.0286 16.7143 17.8239 16.7143 17.5714Z"
|
|
34
|
+
fill="currentColor"
|
|
35
|
+
/>
|
|
36
|
+
<path
|
|
37
|
+
fillRule="evenodd"
|
|
38
|
+
clipRule="evenodd"
|
|
39
|
+
d="M14.4286 8.42857C14.4286 8.1761 14.6332 7.97143 14.8857 7.97143H20.6C20.8525 7.97143 21.0571 8.1761 21.0571 8.42857C21.0571 8.68104 20.8525 8.88571 20.6 8.88571H14.8857C14.6332 8.88571 14.4286 8.68104 14.4286 8.42857Z"
|
|
40
|
+
fill="currentColor"
|
|
41
|
+
/>
|
|
42
|
+
<path
|
|
43
|
+
fillRule="evenodd"
|
|
44
|
+
clipRule="evenodd"
|
|
45
|
+
d="M3 17.5714C3 17.319 3.20467 17.1143 3.45714 17.1143H9.17143C9.4239 17.1143 9.62857 17.319 9.62857 17.5714C9.62857 17.8239 9.4239 18.0286 9.17143 18.0286H3.45714C3.20467 18.0286 3 17.8239 3 17.5714Z"
|
|
46
|
+
fill="currentColor"
|
|
47
|
+
/>
|
|
48
|
+
</svg>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
export default SvgTune;
|
package/src/icons/index.ts
CHANGED
|
@@ -46,6 +46,7 @@ export { default as SearchIcon } from './Search';
|
|
|
46
46
|
export { default as SwapIcon } from './Swap';
|
|
47
47
|
export { default as TimeIcon } from './Time';
|
|
48
48
|
export { default as TransactionIcon } from './Transaction';
|
|
49
|
+
export { default as TuneIcon } from './Tune';
|
|
49
50
|
export { default as UtxoCategoryIcon } from './UtxoCategory';
|
|
50
51
|
export { default as WalletIcon } from './Wallet';
|
|
51
52
|
export { default as WarningIcon } from './Warning';
|
package/src/theme.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// TSDX + stiches doesn't work with import statement and has a bug.
|
|
2
2
|
|
|
3
|
-
import type { PropertyValue } from '@stitches/react';
|
|
3
|
+
import type { PropertyValue, CSS as StitchesCSS } from '@stitches/react';
|
|
4
4
|
import type { DefaultThemeMap } from '@stitches/react/types/config';
|
|
5
5
|
|
|
6
6
|
import { createStitches } from '@stitches/react';
|
|
@@ -153,6 +153,7 @@ export const theme = {
|
|
|
153
153
|
18: '18px',
|
|
154
154
|
20: '20px',
|
|
155
155
|
24: '24px',
|
|
156
|
+
26: '26px',
|
|
156
157
|
28: '28px',
|
|
157
158
|
30: '30px',
|
|
158
159
|
32: '32px',
|
|
@@ -217,6 +218,8 @@ export const { styled, css, createTheme, keyframes, globalCss, config } =
|
|
|
217
218
|
utils,
|
|
218
219
|
});
|
|
219
220
|
|
|
221
|
+
export type CSS = StitchesCSS<typeof config>;
|
|
222
|
+
|
|
220
223
|
export const lightTheme = createTheme('light-theme-ui', {});
|
|
221
224
|
|
|
222
225
|
export const darkTheme = createTheme('dark-theme-ui', {
|