@rango-dev/ui 0.1.13 → 0.1.14-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/CHANGELOG.md +11 -0
- package/dist/components/Alert/Alert.d.ts +7 -7
- package/dist/components/Alert/Alert.stories.d.ts +7 -5
- package/dist/components/Alert/LoadingFailedAlert.d.ts +2 -2
- package/dist/components/Alert/NotFoundAlert.d.ts +7 -7
- package/dist/components/Alert/index.d.ts +2 -2
- package/dist/components/BestRoute/BestRoute.d.ts +15 -12
- package/dist/components/BestRoute/BestRoute.stories.d.ts +9 -8
- package/dist/components/BestRoute/index.d.ts +1 -1
- package/dist/components/BestRoute/mock.d.ts +4 -4
- package/dist/components/BlockchainSelector/BlockchainSelector.d.ts +17 -17
- package/dist/components/BlockchainSelector/BlockchainSelector.stories.d.ts +6 -5
- package/dist/components/BlockchainSelector/index.d.ts +1 -1
- package/dist/components/BlockchainsList/BlockchainsList.d.ts +10 -10
- package/dist/components/BlockchainsList/BlockchainsList.stories.d.ts +6 -5
- package/dist/components/BlockchainsList/index.d.ts +1 -1
- package/dist/components/BlockchainsList/mockData.d.ts +2 -2
- package/dist/components/Button/Button.d.ts +17 -17
- package/dist/components/Button/Button.stories.d.ts +9 -8
- package/dist/components/Button/index.d.ts +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts +11 -11
- package/dist/components/Checkbox/Checkbox.stories.d.ts +6 -5
- package/dist/components/Checkbox/index.d.ts +1 -1
- package/dist/components/Chip/Chip.d.ts +12 -12
- package/dist/components/Chip/Chip.stories.d.ts +8 -7
- package/dist/components/Chip/index.d.ts +1 -1
- package/dist/components/ColorPicker/ColorPicker.d.ts +9 -9
- package/dist/components/ColorPicker/ColorPicker.stories.d.ts +6 -5
- package/dist/components/ColorPicker/index.d.ts +1 -1
- package/dist/components/ConnectWalletsModal/ConnectWallets.stories.d.ts +6 -5
- package/dist/components/ConnectWalletsModal/ConnectWalletsModal.d.ts +11 -11
- package/dist/components/ConnectWalletsModal/index.d.ts +1 -1
- package/dist/components/ConnectWalletsModal/mockData.d.ts +2 -2
- package/dist/components/Divider/Divider.d.ts +6 -6
- package/dist/components/Divider/index.d.ts +1 -1
- package/dist/components/Drawer/Drawer.d.ts +13 -13
- package/dist/components/Drawer/Drawer.stories.d.ts +9 -8
- package/dist/components/Drawer/index.d.ts +1 -1
- package/dist/components/Header/Header.d.ts +9 -9
- package/dist/components/Header/index.d.ts +1 -1
- package/dist/components/Icon/AddCircleIcon.d.ts +3 -3
- package/dist/components/Icon/AddIcon.d.ts +3 -3
- package/dist/components/Icon/AddWalletIcon.d.ts +3 -3
- package/dist/components/Icon/AngleDownIcon.d.ts +3 -3
- package/dist/components/Icon/AngleLeftIcon.d.ts +3 -3
- package/dist/components/Icon/AngleRightIcon.d.ts +3 -3
- package/dist/components/Icon/AngleUpIcon.d.ts +3 -3
- package/dist/components/Icon/ArrowRightIcon.d.ts +3 -3
- package/dist/components/Icon/BagIcon.d.ts +3 -3
- package/dist/components/Icon/BanIcon.d.ts +3 -3
- package/dist/components/Icon/CheckCircleIcon.d.ts +3 -3
- package/dist/components/Icon/CheckIcon.d.ts +3 -3
- package/dist/components/Icon/CheckSquareIcon.d.ts +3 -3
- package/dist/components/Icon/CheckWalletIcon.d.ts +3 -3
- package/dist/components/Icon/ChevronRightIcon.d.ts +3 -3
- package/dist/components/Icon/CloseIcon.d.ts +112 -1
- package/dist/components/Icon/CopyIcon.d.ts +3 -3
- package/dist/components/Icon/DeleteCircleIcon.d.ts +3 -3
- package/dist/components/Icon/DeleteWalletIcon.d.ts +3 -3
- package/dist/components/Icon/DisconnectIcon.d.ts +3 -3
- package/dist/components/Icon/DownloadIcon.d.ts +3 -3
- package/dist/components/Icon/GasIcon.d.ts +3 -3
- package/dist/components/Icon/HistoryIcon.d.ts +3 -3
- package/dist/components/Icon/HorizontalSwapIcon.d.ts +3 -3
- package/dist/components/Icon/Icons.stories.d.ts +6 -5
- package/dist/components/Icon/InfoCircleIcon.d.ts +3 -3
- package/dist/components/Icon/MinusCircleIcon.d.ts +3 -3
- package/dist/components/Icon/RetryIcon.d.ts +3 -3
- package/dist/components/Icon/RetryLeftIcon.d.ts +3 -3
- package/dist/components/Icon/RetryRightIcon.d.ts +3 -3
- package/dist/components/Icon/SearchIcon.d.ts +3 -3
- package/dist/components/Icon/SearchMinusIcon.d.ts +3 -3
- package/dist/components/Icon/SettingIcon.d.ts +3 -3
- package/dist/components/Icon/SignatureIcon.d.ts +3 -3
- package/dist/components/Icon/SwapWalletIcon.d.ts +3 -3
- package/dist/components/Icon/TimeIcon.d.ts +3 -3
- package/dist/components/Icon/TrashIcon.d.ts +3 -3
- package/dist/components/Icon/TryAgainIcon.d.ts +3 -3
- package/dist/components/Icon/VerticalSwapIcon.d.ts +3 -3
- package/dist/components/Icon/WalletIconIcon.d.ts +3 -3
- package/dist/components/Icon/WarningIcon.d.ts +3 -3
- package/dist/components/Icon/common.d.ts +228 -2
- package/dist/components/Icon/index.d.ts +40 -40
- package/dist/components/Icon/types.d.ts +7 -7
- package/dist/components/LiquiditySourceList/LiquiditySource.stories.d.ts +6 -5
- package/dist/components/LiquiditySourceList/LiquiditySourceList.d.ts +11 -11
- package/dist/components/LiquiditySourceList/index.d.ts +1 -1
- package/dist/components/LiquiditySourceList/mockData.d.ts +2 -2
- package/dist/components/LiquiditySourcesSelector/LiquiditySourcesSelector.d.ts +13 -13
- package/dist/components/LiquiditySourcesSelector/LiquiditySourcesSelector.stories.d.ts +6 -5
- package/dist/components/LiquiditySourcesSelector/index.d.ts +1 -1
- package/dist/components/Modal/Modal.d.ts +11 -11
- package/dist/components/Modal/Modal.stories.d.ts +6 -5
- package/dist/components/Modal/index.d.ts +1 -1
- package/dist/components/Radio/Radio.d.ts +13 -13
- package/dist/components/Radio/Radio.stories.d.ts +6 -5
- package/dist/components/Radio/index.d.ts +1 -1
- package/dist/components/SecondaryPage/SecondaryPage.d.ts +16 -16
- package/dist/components/SecondaryPage/SecondaryPage.stories.d.ts +4 -2
- package/dist/components/SecondaryPage/index.d.ts +1 -1
- package/dist/components/SelectableWalletList/SelectableWalletList.d.ts +7 -7
- package/dist/components/SelectableWalletList/SelectableWalletList.stories.d.ts +6 -5
- package/dist/components/SelectableWalletList/index.d.ts +1 -1
- package/dist/components/SelectableWalletList/mock.d.ts +2 -2
- package/dist/components/Settings/Settings.d.ts +24 -23
- package/dist/components/Settings/Settings.stories.d.ts +6 -5
- package/dist/components/Settings/index.d.ts +1 -1
- package/dist/components/Skeleton/Skeleton.d.ts +6 -6
- package/dist/components/Skeleton/Skeleton.stories.d.ts +6 -5
- package/dist/components/Skeleton/index.d.ts +1 -1
- package/dist/components/Spacer/Spacer.d.ts +6 -6
- package/dist/components/Spacer/Spacer.stories.d.ts +6 -5
- package/dist/components/Spacer/index.d.ts +1 -1
- package/dist/components/Spinner/Spinner.d.ts +6 -6
- package/dist/components/Spinner/Spinner.stories.d.ts +6 -5
- package/dist/components/Spinner/index.d.ts +1 -1
- package/dist/components/StatusDrawer/StatusDrawer.d.ts +11 -11
- package/dist/components/StatusDrawer/StatusDrawer.stories.d.ts +6 -5
- package/dist/components/StatusDrawer/index.d.ts +1 -1
- package/dist/components/StepDetail/StepDetail.d.ts +12 -12
- package/dist/components/StepDetail/StepDetail.stories.d.ts +6 -5
- package/dist/components/StepDetail/index.d.ts +1 -1
- package/dist/components/SwapContainer/SwapContainer.d.ts +7 -7
- package/dist/components/SwapContainer/SwapContainer.stories.d.ts +6 -5
- package/dist/components/SwapContainer/index.d.ts +1 -1
- package/dist/components/SwapDetail/SwapDetail.d.ts +8 -8
- package/dist/components/SwapDetail/SwapDetail.stories.d.ts +6 -5
- package/dist/components/SwapDetail/Token.d.ts +17 -17
- package/dist/components/SwapDetail/index.d.ts +1 -1
- package/dist/components/SwapDetail/mock.d.ts +2 -2
- package/dist/components/Switch/Switch.d.ts +6 -6
- package/dist/components/Switch/Switch.stories.d.ts +6 -5
- package/dist/components/Switch/index.d.ts +1 -1
- package/dist/components/TextField/TextField.d.ts +10 -10
- package/dist/components/TextField/TextField.stories.d.ts +8 -7
- package/dist/components/TextField/index.d.ts +1 -1
- package/dist/components/TokenList/TokenItem.d.ts +11 -11
- package/dist/components/TokenList/TokenList.d.ts +17 -17
- package/dist/components/TokenList/TokenList.stories.d.ts +6 -5
- package/dist/components/TokenList/index.d.ts +1 -1
- package/dist/components/TokenList/mockData.d.ts +2 -2
- package/dist/components/TokenSelector/TokenSelector.d.ts +124 -14
- package/dist/components/TokenSelector/TokenSelector.stories.d.ts +6 -5
- package/dist/components/TokenSelector/index.d.ts +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts +7 -7
- package/dist/components/Tooltip/Tooltip.stories.d.ts +6 -5
- package/dist/components/Tooltip/index.d.ts +1 -1
- package/dist/components/Typography/Typography.d.ts +18 -18
- package/dist/components/Typography/Typography.stories.d.ts +6 -5
- package/dist/components/Typography/index.d.ts +1 -1
- package/dist/components/VirtualizedList/VirtualizedList.d.ts +17 -17
- package/dist/components/Wallet/State.d.ts +7 -7
- package/dist/components/Wallet/Wallet.d.ts +7 -7
- package/dist/components/Wallet/Wallet.stories.d.ts +6 -5
- package/dist/components/Wallet/index.d.ts +1 -1
- package/dist/components/common/FilledCircle.d.ts +111 -1
- package/dist/components/common/Image.d.ts +6 -6
- package/dist/components/common/index.d.ts +2 -2
- package/dist/components/index.d.ts +31 -31
- package/dist/containers/ConfirmSwap/ConfirmSwap.d.ts +22 -22
- package/dist/containers/ConfirmSwap/ConfirmSwap.stories.d.ts +7 -6
- package/dist/containers/ConfirmSwap/index.d.ts +1 -1
- package/dist/containers/ConfirmSwap/mock.d.ts +5 -5
- package/dist/containers/History/History.d.ts +6 -6
- package/dist/containers/History/History.stories.d.ts +6 -5
- package/dist/containers/History/SwapsGroup.d.ts +13 -13
- package/dist/containers/History/index.d.ts +3 -2
- package/dist/containers/History/mock.d.ts +2 -2
- package/dist/containers/History/types.d.ts +39 -39
- package/dist/containers/SwapHistory/SwapHistory.d.ts +1128 -24
- package/dist/containers/SwapHistory/SwapHistory.stories.d.ts +6 -5
- package/dist/containers/SwapHistory/SwapMessages.d.ts +17 -17
- package/dist/containers/SwapHistory/index.d.ts +1 -1
- package/dist/containers/SwapHistory/mock.d.ts +2 -2
- package/dist/containers/index.d.ts +3 -3
- package/dist/helper/index.d.ts +6 -3
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/useCopyToClipboard.d.ts +1 -1
- package/dist/index.d.ts +6 -5
- package/dist/index.js +20 -8
- package/dist/index.js.map +7 -0
- package/dist/theme.d.ts +928 -8
- package/dist/types/index.d.ts +2 -2
- package/dist/types/meta.d.ts +23 -23
- package/dist/types/swaps.d.ts +29 -29
- package/dist/types/wallet.d.ts +23 -23
- package/package.json +10 -34
- package/src/components/Alert/Alert.tsx +2 -2
- package/src/components/BestRoute/BestRoute.tsx +4 -3
- package/src/components/Button/Button.tsx +42 -42
- package/src/components/Checkbox/Checkbox.tsx +2 -0
- package/src/components/Chip/Chip.tsx +1 -1
- package/src/components/ColorPicker/ColorPicker.stories.tsx +9 -2
- package/src/components/ColorPicker/ColorPicker.tsx +34 -10
- package/src/components/Icon/common.ts +2 -2
- package/src/components/LiquiditySourceList/LiquiditySourceList.tsx +2 -2
- package/src/components/Modal/Modal.tsx +3 -2
- package/src/components/Radio/Radio.tsx +2 -2
- package/src/components/SelectableWalletList/SelectableWalletList.tsx +5 -5
- package/src/components/Settings/Settings.tsx +22 -18
- package/src/components/Skeleton/Skeleton.tsx +1 -1
- package/src/components/Spinner/Spinner.tsx +1 -1
- package/src/components/StepDetail/StepDetail.tsx +4 -4
- package/src/components/SwapContainer/SwapContainer.tsx +3 -3
- package/src/components/SwapDetail/SwapDetail.tsx +1 -1
- package/src/components/SwapDetail/Token.tsx +2 -2
- package/src/components/Switch/Switch.tsx +2 -2
- package/src/components/TextField/TextField.tsx +3 -3
- package/src/components/TokenList/TokenItem.tsx +1 -1
- package/src/components/Tooltip/Tooltip.tsx +2 -2
- package/src/containers/ConfirmSwap/ConfirmSwap.tsx +4 -4
- package/src/containers/History/SwapsGroup.tsx +1 -1
- package/src/containers/History/index.ts +2 -1
- package/src/containers/History/types.tsx +1 -1
- package/src/containers/SwapHistory/SwapHistory.tsx +5 -5
- package/src/helper/index.ts +75 -0
- package/src/index.ts +1 -0
- package/src/theme.ts +34 -36
- package/src/types/index.ts +1 -1
- package/dist/ui.cjs.development.js +0 -5094
- package/dist/ui.cjs.development.js.map +0 -1
- package/dist/ui.cjs.production.min.js +0 -2
- package/dist/ui.cjs.production.min.js.map +0 -1
- package/dist/ui.esm.js +0 -5005
- package/dist/ui.esm.js.map +0 -1
|
@@ -32,10 +32,10 @@ const StyledItem = styled(RadioGroup.Item, {
|
|
|
32
32
|
borderRadius: '100%',
|
|
33
33
|
cursor: 'pointer',
|
|
34
34
|
backgroundColor: '$background',
|
|
35
|
-
border: '1px solid $
|
|
35
|
+
border: '1px solid $neutral400',
|
|
36
36
|
|
|
37
37
|
'&:hover': {
|
|
38
|
-
borderColor: '$
|
|
38
|
+
borderColor: '$neutral600',
|
|
39
39
|
},
|
|
40
40
|
});
|
|
41
41
|
|
|
@@ -14,7 +14,7 @@ const Circle = styled('div', {
|
|
|
14
14
|
width: 12,
|
|
15
15
|
height: 12,
|
|
16
16
|
borderRadius: 6,
|
|
17
|
-
border: '1px solid $
|
|
17
|
+
border: '1px solid $neutral400',
|
|
18
18
|
position: 'absolute',
|
|
19
19
|
top: 12,
|
|
20
20
|
right: 12,
|
|
@@ -24,7 +24,7 @@ const Circle = styled('div', {
|
|
|
24
24
|
borderColor: '$success',
|
|
25
25
|
},
|
|
26
26
|
false: {
|
|
27
|
-
borderColor: '$
|
|
27
|
+
borderColor: '$neutral400',
|
|
28
28
|
},
|
|
29
29
|
},
|
|
30
30
|
},
|
|
@@ -40,7 +40,7 @@ const SolidCircle = styled('div', {
|
|
|
40
40
|
backgroundColor: '$success',
|
|
41
41
|
},
|
|
42
42
|
false: {
|
|
43
|
-
backgroundColor: '$
|
|
43
|
+
backgroundColor: '$neutral400',
|
|
44
44
|
},
|
|
45
45
|
},
|
|
46
46
|
},
|
|
@@ -65,8 +65,8 @@ const Container = styled('div', {
|
|
|
65
65
|
color: '$success',
|
|
66
66
|
},
|
|
67
67
|
false: {
|
|
68
|
-
borderColor: '$
|
|
69
|
-
color: '$
|
|
68
|
+
borderColor: '$neutral400',
|
|
69
|
+
color: '$neutral400',
|
|
70
70
|
},
|
|
71
71
|
},
|
|
72
72
|
},
|
|
@@ -12,7 +12,7 @@ import { Button } from '../Button';
|
|
|
12
12
|
|
|
13
13
|
const BaseContainer = styled('div', {
|
|
14
14
|
borderRadius: '$5',
|
|
15
|
-
backgroundColor: '$
|
|
15
|
+
backgroundColor: '$neutral100',
|
|
16
16
|
padding: '$16',
|
|
17
17
|
});
|
|
18
18
|
|
|
@@ -60,7 +60,7 @@ type Theme = 'dark' | 'light' | 'auto';
|
|
|
60
60
|
export interface PropTypes {
|
|
61
61
|
slippages: number[];
|
|
62
62
|
selectedSlippage: number;
|
|
63
|
-
customSlippage: number;
|
|
63
|
+
customSlippage: number | null;
|
|
64
64
|
maxSlippage: number;
|
|
65
65
|
minSlippage: number;
|
|
66
66
|
liquiditySources: LiquiditySource[];
|
|
@@ -74,6 +74,7 @@ export interface PropTypes {
|
|
|
74
74
|
infiniteApprove: boolean;
|
|
75
75
|
toggleInfiniteApprove: (infinite: boolean) => void;
|
|
76
76
|
loadingStatus: LoadingStatus;
|
|
77
|
+
singleTheme?: boolean;
|
|
77
78
|
}
|
|
78
79
|
|
|
79
80
|
export function Settings(props: PropTypes) {
|
|
@@ -93,6 +94,7 @@ export function Settings(props: PropTypes) {
|
|
|
93
94
|
toggleInfiniteApprove,
|
|
94
95
|
infiniteApprove,
|
|
95
96
|
loadingStatus,
|
|
97
|
+
singleTheme,
|
|
96
98
|
} = props;
|
|
97
99
|
|
|
98
100
|
const [selectedSlippage, setSelectedSlippage] = useState(
|
|
@@ -132,7 +134,7 @@ export function Settings(props: PropTypes) {
|
|
|
132
134
|
))}
|
|
133
135
|
<TextField
|
|
134
136
|
type="number"
|
|
135
|
-
value={customSlippage}
|
|
137
|
+
value={customSlippage || ''}
|
|
136
138
|
onChange={(event) => {
|
|
137
139
|
const parsedValue = parseFloat(event.target.value);
|
|
138
140
|
if (
|
|
@@ -153,20 +155,22 @@ export function Settings(props: PropTypes) {
|
|
|
153
155
|
/>
|
|
154
156
|
</SlippageChipsContainer>
|
|
155
157
|
</BaseContainer>
|
|
156
|
-
|
|
157
|
-
<
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
{
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
158
|
+
{!singleTheme && (
|
|
159
|
+
<ThemesContainer>
|
|
160
|
+
<Title variant="body2">Theme</Title>
|
|
161
|
+
<Radio
|
|
162
|
+
value={selectedTheme}
|
|
163
|
+
options={[
|
|
164
|
+
{ value: 'dark', label: 'Dark' },
|
|
165
|
+
{ value: 'light', label: 'Light' },
|
|
166
|
+
{ value: 'auto', label: 'Auto' },
|
|
167
|
+
]}
|
|
168
|
+
onChange={(value) => onThemeChange(value as Theme)}
|
|
169
|
+
direction="horizontal"
|
|
170
|
+
style={{ marginTop: '$24' }}
|
|
171
|
+
/>
|
|
172
|
+
</ThemesContainer>
|
|
173
|
+
)}
|
|
170
174
|
<InfiniteContainer>
|
|
171
175
|
<Typography variant="body2">Infinite Approval</Typography>
|
|
172
176
|
<Switch checked={infiniteApprove} onChange={toggleInfiniteApprove} />
|
|
@@ -180,7 +184,7 @@ export function Settings(props: PropTypes) {
|
|
|
180
184
|
suffix={
|
|
181
185
|
<LiquiditySourceNumber>
|
|
182
186
|
{loadingStatus === 'success' && (
|
|
183
|
-
<Typography variant="body2" color="
|
|
187
|
+
<Typography variant="body2" color="neutral800">
|
|
184
188
|
{liquiditySources.length !== selectedLiquiditySources.length
|
|
185
189
|
? `${selectedLiquiditySources.length} / ${liquiditySources.length}`
|
|
186
190
|
: liquiditySources.length}
|
|
@@ -12,7 +12,7 @@ const waveSquares = keyframes({
|
|
|
12
12
|
|
|
13
13
|
const SkeletonContainer = styled('div', {
|
|
14
14
|
borderRadius: '$5',
|
|
15
|
-
backgroundColor: '$
|
|
15
|
+
backgroundColor: '$neutral100',
|
|
16
16
|
background: `linear-gradient(to right, rgba(130, 130, 130, 0.2) 8%, rgba(130, 130, 130, 0.3) 18%, rgba(130, 130, 130, 0.2) 33%)`,
|
|
17
17
|
backgroundSize: '800px 100px',
|
|
18
18
|
animation: `${waveSquares} 2s infinite ease-out`,
|
|
@@ -10,7 +10,7 @@ const spin = keyframes({
|
|
|
10
10
|
const SpinnerContainer = styled('div', {
|
|
11
11
|
borderRadius: '50%',
|
|
12
12
|
position: 'relative',
|
|
13
|
-
border: `2px solid $
|
|
13
|
+
border: `2px solid $neutral100`,
|
|
14
14
|
borderRight: `2px solid`,
|
|
15
15
|
animation: `${spin} 1.5s linear infinite`,
|
|
16
16
|
margin: `0px $8`,
|
|
@@ -30,7 +30,7 @@ const ChainLogo = styled('div', {
|
|
|
30
30
|
padding: '$2',
|
|
31
31
|
borderRadius: '50%',
|
|
32
32
|
backgroundColor: '$background',
|
|
33
|
-
border: '1px solid $
|
|
33
|
+
border: '1px solid $neutral400',
|
|
34
34
|
|
|
35
35
|
img: {
|
|
36
36
|
width: '100%',
|
|
@@ -74,7 +74,7 @@ const Detail = styled('div', {
|
|
|
74
74
|
},
|
|
75
75
|
});
|
|
76
76
|
const SubTitle = styled(Typography, {
|
|
77
|
-
color: '$
|
|
77
|
+
color: '$neutral600',
|
|
78
78
|
display: 'block',
|
|
79
79
|
paddingLeft: '$8',
|
|
80
80
|
});
|
|
@@ -121,7 +121,7 @@ export function StepDetail(props: PropsWithChildren<PropTypes>) {
|
|
|
121
121
|
<Typography
|
|
122
122
|
noWrap
|
|
123
123
|
variant={direction === 'vertical' ? 'body2' : 'title'}
|
|
124
|
-
color={'$
|
|
124
|
+
color={'$neutral600'}
|
|
125
125
|
>
|
|
126
126
|
{estimatedAmount}
|
|
127
127
|
</Typography>
|
|
@@ -133,7 +133,7 @@ export function StepDetail(props: PropsWithChildren<PropTypes>) {
|
|
|
133
133
|
>
|
|
134
134
|
{symbol}
|
|
135
135
|
</Typography>
|
|
136
|
-
<SubTitle noWrap variant="caption" color="$
|
|
136
|
+
<SubTitle noWrap variant="caption" color="$neutral800">
|
|
137
137
|
on {blockchain}
|
|
138
138
|
</SubTitle>
|
|
139
139
|
</Detail>
|
|
@@ -20,14 +20,14 @@ const MainContainer = styled('div', {
|
|
|
20
20
|
listStyleType: 'none',
|
|
21
21
|
'&::-webkit-scrollbar': { width: '$8', height: '$8' },
|
|
22
22
|
'&::-webkit-scrollbar-thumb': {
|
|
23
|
-
backgroundColor: '$
|
|
23
|
+
backgroundColor: '$neutral400',
|
|
24
24
|
borderRadius: '$10',
|
|
25
25
|
},
|
|
26
26
|
'&::-webkit-scrollbar-thumb:hover': {
|
|
27
|
-
backgroundColor: '$
|
|
27
|
+
backgroundColor: '$neutral500',
|
|
28
28
|
},
|
|
29
29
|
'&::-webkit-scrollbar-track': {
|
|
30
|
-
backgroundColor: '$
|
|
30
|
+
backgroundColor: '$neutral100',
|
|
31
31
|
},
|
|
32
32
|
},
|
|
33
33
|
variants: {
|
|
@@ -12,7 +12,7 @@ const TokenContainer = styled('div', {
|
|
|
12
12
|
fontWeight: 'bold',
|
|
13
13
|
},
|
|
14
14
|
'& .estimated': {
|
|
15
|
-
color: '$
|
|
15
|
+
color: '$neutral600',
|
|
16
16
|
},
|
|
17
17
|
});
|
|
18
18
|
|
|
@@ -33,7 +33,7 @@ const TokenImage = styled('div', {
|
|
|
33
33
|
justifyContent: 'center',
|
|
34
34
|
alignItems: 'center',
|
|
35
35
|
backgroundColor: '$background',
|
|
36
|
-
border: '1px solid $
|
|
36
|
+
border: '1px solid $neutral400',
|
|
37
37
|
},
|
|
38
38
|
});
|
|
39
39
|
|
|
@@ -9,8 +9,8 @@ const StyledSwitchRoot = styled(RadixSwitch.Root, {
|
|
|
9
9
|
borderStyle: 'solid',
|
|
10
10
|
width: '42px',
|
|
11
11
|
height: '22px',
|
|
12
|
-
backgroundColor: '$
|
|
13
|
-
borderColor: '$
|
|
12
|
+
backgroundColor: '$neutral600',
|
|
13
|
+
borderColor: '$neutral600',
|
|
14
14
|
borderRadius: '99999px',
|
|
15
15
|
position: 'relative',
|
|
16
16
|
padding: '0',
|
|
@@ -3,10 +3,10 @@ import React, { PropsWithChildren, RefObject } from 'react';
|
|
|
3
3
|
import { styled } from '../../theme';
|
|
4
4
|
|
|
5
5
|
const InputContainer = styled('div', {
|
|
6
|
-
backgroundColor: '$
|
|
6
|
+
backgroundColor: '$surface',
|
|
7
7
|
padding: '1px',
|
|
8
8
|
boxSizing: 'border-box',
|
|
9
|
-
border: '1px solid $
|
|
9
|
+
border: '1px solid $neutral400',
|
|
10
10
|
borderRadius: '$5',
|
|
11
11
|
height: '$48',
|
|
12
12
|
display: 'flex',
|
|
@@ -43,7 +43,7 @@ const InputContainer = styled('div', {
|
|
|
43
43
|
},
|
|
44
44
|
disabled: {
|
|
45
45
|
true: {
|
|
46
|
-
backgroundColor: '$
|
|
46
|
+
backgroundColor: '$neutral100',
|
|
47
47
|
cursor: 'not-allowed',
|
|
48
48
|
filter: 'grayscale(100%)',
|
|
49
49
|
},
|
|
@@ -66,7 +66,7 @@ export function TokenItem(props: PropTypes) {
|
|
|
66
66
|
>
|
|
67
67
|
<TokenNameContainer>
|
|
68
68
|
<Typography variant="body1">{token.symbol}</Typography>
|
|
69
|
-
<Typography variant="caption" color="
|
|
69
|
+
<Typography variant="caption" color="neutral600">
|
|
70
70
|
{token.name}
|
|
71
71
|
</Typography>
|
|
72
72
|
</TokenNameContainer>
|
|
@@ -46,7 +46,7 @@ const TooltipContent = styled(RadixTooltip.Content, {
|
|
|
46
46
|
color: '$white',
|
|
47
47
|
},
|
|
48
48
|
gray: {
|
|
49
|
-
backgroundColor: '$
|
|
49
|
+
backgroundColor: '$neutral100',
|
|
50
50
|
color: '$black',
|
|
51
51
|
},
|
|
52
52
|
black: {
|
|
@@ -76,7 +76,7 @@ const TooltipArrow = styled(RadixTooltip.Arrow, {
|
|
|
76
76
|
fill: '$success',
|
|
77
77
|
},
|
|
78
78
|
gray: {
|
|
79
|
-
fill: '$
|
|
79
|
+
fill: '$neutral100',
|
|
80
80
|
},
|
|
81
81
|
black: {
|
|
82
82
|
fill: '$black',
|
|
@@ -14,7 +14,7 @@ const MainContainer = styled('div', {
|
|
|
14
14
|
const Section = styled('div', {
|
|
15
15
|
paddingBottom: '$32',
|
|
16
16
|
marginBottom: '$32',
|
|
17
|
-
borderBottom: '1px solid $
|
|
17
|
+
borderBottom: '1px solid $neutral400',
|
|
18
18
|
});
|
|
19
19
|
|
|
20
20
|
const Footer = styled('div', {
|
|
@@ -39,14 +39,14 @@ const Container = styled('div', {
|
|
|
39
39
|
alignItems: 'center',
|
|
40
40
|
},
|
|
41
41
|
'.num': {
|
|
42
|
-
backgroundColor: '$
|
|
42
|
+
backgroundColor: '$neutral100',
|
|
43
43
|
display: 'inline-flex',
|
|
44
44
|
width: '24px',
|
|
45
45
|
height: '24px',
|
|
46
|
-
color: '$
|
|
46
|
+
color: '$neutral800',
|
|
47
47
|
borderRadius: '50%',
|
|
48
48
|
fontSize: '$14',
|
|
49
|
-
border: '1px solid $
|
|
49
|
+
border: '1px solid $neutral400',
|
|
50
50
|
justifyContent: 'center',
|
|
51
51
|
alignItems: 'center',
|
|
52
52
|
},
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
Transfer,
|
|
8
8
|
} from 'rango-sdk';
|
|
9
9
|
import { PendingSwapNetworkStatus, StepStatus } from '../../types/swaps';
|
|
10
|
-
export { PendingSwap } from '@rango-dev/queue-manager-rango-preset';
|
|
10
|
+
export type { PendingSwap } from '@rango-dev/queue-manager-rango-preset';
|
|
11
11
|
|
|
12
12
|
export type PendingSwapStep = {
|
|
13
13
|
id: number;
|
|
@@ -53,7 +53,7 @@ export const ErrorMsg = styled(Typography, {
|
|
|
53
53
|
|
|
54
54
|
export const FeeContainer = styled('div', {
|
|
55
55
|
paddingLeft: '$16',
|
|
56
|
-
color: '$
|
|
56
|
+
color: '$neutral800'
|
|
57
57
|
});
|
|
58
58
|
|
|
59
59
|
export const Fee = styled('div', {
|
|
@@ -96,7 +96,7 @@ const SwapInfoContainer = styled('div', {
|
|
|
96
96
|
display: 'flex',
|
|
97
97
|
flexDirection: 'column',
|
|
98
98
|
paddingBottom: '$16',
|
|
99
|
-
borderBottom: '1px solid $
|
|
99
|
+
borderBottom: '1px solid $neutral100',
|
|
100
100
|
});
|
|
101
101
|
|
|
102
102
|
const InternalDetailsContainer = styled('div', {
|
|
@@ -137,12 +137,12 @@ const Row = styled('div', {
|
|
|
137
137
|
padding: '$8 0',
|
|
138
138
|
|
|
139
139
|
'.name': {
|
|
140
|
-
color: '$
|
|
140
|
+
color: '$neutral600',
|
|
141
141
|
},
|
|
142
142
|
'.value': {
|
|
143
143
|
display: 'flex',
|
|
144
144
|
alignItems: 'center',
|
|
145
|
-
color: '$
|
|
145
|
+
color: '$neutral800',
|
|
146
146
|
justifyContent: 'flex-end',
|
|
147
147
|
},
|
|
148
148
|
'.status': {
|
|
@@ -169,7 +169,7 @@ const RequestId = styled('div', {
|
|
|
169
169
|
|
|
170
170
|
const ExtraDetails = styled('div', {
|
|
171
171
|
padding: '0',
|
|
172
|
-
color: '$
|
|
172
|
+
color: '$neutral600',
|
|
173
173
|
fontSize: '$10',
|
|
174
174
|
});
|
|
175
175
|
|
package/src/helper/index.ts
CHANGED
|
@@ -29,3 +29,78 @@ export function limitDecimalPlaces(
|
|
|
29
29
|
return roundedNumber.toString();
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
+
|
|
33
|
+
const hexToRgb = (hex: string) =>
|
|
34
|
+
((value) =>
|
|
35
|
+
value.length === 3
|
|
36
|
+
? value.split('').map((c) => parseInt(c.repeat(2), 16))
|
|
37
|
+
: (value.match(/.{1,2}/g) || []).map((v) => parseInt(v, 16)))(
|
|
38
|
+
hex.replace('#', '')
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
const isHexTooDark = (hexColor: string) =>
|
|
42
|
+
(([r, g, b]) => 0.2126 * r + 0.7152 * g + 0.0722 * b < 40)(
|
|
43
|
+
hexToRgb(hexColor)
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
const isHexTooLight = (hexColor: string) =>
|
|
47
|
+
(([r, g, b]) => (r * 299 + g * 587 + b * 114) / 1000 > 155)(
|
|
48
|
+
hexToRgb(hexColor)
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
const colorShade = (col: string, amt: number) => {
|
|
52
|
+
col = col.replace(/^#/, '');
|
|
53
|
+
if (col.length === 3)
|
|
54
|
+
col = col[0] + col[0] + col[1] + col[1] + col[2] + col[2];
|
|
55
|
+
let [r, g, b]: any = col.match(/.{2}/g);
|
|
56
|
+
[r, g, b] = [
|
|
57
|
+
parseInt(r, 16) + amt,
|
|
58
|
+
parseInt(g, 16) + amt,
|
|
59
|
+
parseInt(b, 16) + amt,
|
|
60
|
+
];
|
|
61
|
+
|
|
62
|
+
r = Math.max(Math.min(255, r), 0).toString(16);
|
|
63
|
+
g = Math.max(Math.min(255, g), 0).toString(16);
|
|
64
|
+
b = Math.max(Math.min(255, b), 0).toString(16);
|
|
65
|
+
|
|
66
|
+
const rr = (r.length < 2 ? '0' : '') + r;
|
|
67
|
+
const gg = (g.length < 2 ? '0' : '') + g;
|
|
68
|
+
const bb = (b.length < 2 ? '0' : '') + b;
|
|
69
|
+
|
|
70
|
+
return `#${rr}${gg}${bb}`;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export const generateRangeColors = (
|
|
74
|
+
name: string,
|
|
75
|
+
mode: 'light' | 'dark',
|
|
76
|
+
color?: string,
|
|
77
|
+
) => {
|
|
78
|
+
let colors = { [name]: color };
|
|
79
|
+
if (color) {
|
|
80
|
+
let c = color;
|
|
81
|
+
if (isHexTooDark(color) || mode === 'dark') {
|
|
82
|
+
for (let i = 1; i < 10; i++) {
|
|
83
|
+
colors = {
|
|
84
|
+
...colors,
|
|
85
|
+
[name + i * 100]:
|
|
86
|
+
name === 'neutral'
|
|
87
|
+
? colorShade(c, i * 15)
|
|
88
|
+
: colorShade(color, i * 5),
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
if (isHexTooLight(color) || mode === 'light') {
|
|
93
|
+
for (let i = 1; i < 10; i++) {
|
|
94
|
+
c = colorShade(c, -(i * 5));
|
|
95
|
+
colors = {
|
|
96
|
+
...colors,
|
|
97
|
+
[name + i * 100]:
|
|
98
|
+
name === 'neutral'
|
|
99
|
+
? colorShade(c, -(i * 5))
|
|
100
|
+
: colorShade(color, -(i * 5)),
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return colors;
|
|
106
|
+
};
|
package/src/index.ts
CHANGED
package/src/theme.ts
CHANGED
|
@@ -2,11 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
import { PropertyValue, CreateStitches } from '@stitches/react';
|
|
4
4
|
import { DefaultThemeMap } from '@stitches/react/types/config';
|
|
5
|
-
|
|
6
|
-
// Solution: (https://github.com/stitchesjs/stitches/issues/833#issuecomment-950707025)
|
|
7
|
-
const { createStitches } = require('@stitches/react');
|
|
5
|
+
import { createStitches } from '@stitches/react';
|
|
8
6
|
|
|
9
7
|
/* ----------------------- Values ----------------------- */
|
|
8
|
+
|
|
10
9
|
const theme = {
|
|
11
10
|
colors: {
|
|
12
11
|
primary: '#5FA425',
|
|
@@ -19,14 +18,16 @@ const theme = {
|
|
|
19
18
|
primary700: '#396216',
|
|
20
19
|
primary800: '#26420F',
|
|
21
20
|
primary900: '#132107',
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
21
|
+
surface: '#fff',
|
|
22
|
+
neutral100: '#f3f3f3',
|
|
23
|
+
neutral200: '#FAFAFA',
|
|
24
|
+
neutral300: '#EAEAEA',
|
|
25
|
+
neutral400: '#999999',
|
|
26
|
+
neutral500: '#888888',
|
|
27
|
+
neutral600: '#666666',
|
|
28
|
+
neutral700: '#444444',
|
|
29
|
+
neutral800: '#333333',
|
|
30
|
+
neutral900: '#111111',
|
|
30
31
|
background: '#fff',
|
|
31
32
|
foreground: '#000',
|
|
32
33
|
success: '#0070F3',
|
|
@@ -124,36 +125,33 @@ const utils = {
|
|
|
124
125
|
|
|
125
126
|
const typedCreateStiches = createStitches as CreateStitches;
|
|
126
127
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
>({
|
|
140
|
-
media,
|
|
141
|
-
theme,
|
|
142
|
-
utils,
|
|
143
|
-
});
|
|
128
|
+
export const { styled, css, createTheme, keyframes, globalCss } = typedCreateStiches<
|
|
129
|
+
'',
|
|
130
|
+
typeof media,
|
|
131
|
+
typeof theme,
|
|
132
|
+
DefaultThemeMap,
|
|
133
|
+
// TODO: Make `utils` typesafe as well.
|
|
134
|
+
{}
|
|
135
|
+
>({
|
|
136
|
+
media,
|
|
137
|
+
theme,
|
|
138
|
+
utils,
|
|
139
|
+
});
|
|
144
140
|
|
|
145
141
|
export const lightTheme = createTheme({});
|
|
146
142
|
|
|
147
143
|
export const darkTheme = createTheme({
|
|
148
144
|
colors: {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
145
|
+
surface: '#000',
|
|
146
|
+
neutral900: '#f3f3f3',
|
|
147
|
+
neutral800: '#FAFAFA',
|
|
148
|
+
neutral700: '#EAEAEA',
|
|
149
|
+
neutral600: '#999999',
|
|
150
|
+
neutral500: '#888888',
|
|
151
|
+
neutral400: '#666666',
|
|
152
|
+
neutral300: '#444444',
|
|
153
|
+
neutral200: '#333333',
|
|
154
|
+
neutral100: '#111111',
|
|
157
155
|
foreground: '#fff',
|
|
158
156
|
background: '#000',
|
|
159
157
|
},
|
package/src/types/index.ts
CHANGED