@rango-dev/ui 0.22.1-next.5 → 0.22.1-next.7
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 +2 -2
- package/dist/index.js.map +4 -4
- package/dist/widget/ui/src/components/Alert/Alert.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Checkbox/Checkbox.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/ListItem/ListItem.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Radio/Radio.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/RoutesOverview/RoutesOverview.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Switch/Switch.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/containers/BlockchainSelector/BlockchainSelector.d.ts +3 -3
- package/dist/widget/ui/src/containers/BlockchainSelector/BlockchainSelector.d.ts.map +1 -1
- package/dist/widget/ui/src/containers/SwapInput/SwapInput.d.ts.map +1 -1
- package/dist/widget/ui/src/containers/SwapInput/SwapInput.styles.d.ts +159 -0
- package/dist/widget/ui/src/containers/SwapInput/SwapInput.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/containers/SwapInput/TokenSection.d.ts.map +1 -1
- package/dist/widget/ui/src/containers/SwapInput/TokenSection.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/containers/TokenSelector/TokenSelector.d.ts +2 -2
- package/dist/widget/ui/src/containers/TokenSelector/TokenSelector.d.ts.map +1 -1
- package/dist/widget/ui/src/index.d.ts +0 -1
- package/dist/widget/ui/src/index.d.ts.map +1 -1
- package/dist/widget/ui/src/{helper → utils}/index.d.ts +0 -3
- package/dist/widget/ui/src/utils/index.d.ts.map +1 -0
- package/package.json +2 -2
- package/src/components/Alert/Alert.styles.ts +1 -5
- package/src/components/Checkbox/Checkbox.styles.ts +5 -1
- package/src/components/ListItem/ListItem.styles.ts +7 -0
- package/src/components/ListItem/ListItem.tsx +1 -1
- package/src/components/Radio/Radio.styles.tsx +5 -2
- package/src/components/RoutesOverview/RoutesOverview.tsx +6 -2
- package/src/components/SelectableWalletList/SelectableWalletList.tsx +1 -1
- package/src/components/SvgIcon/SvgIcon.style.ts +1 -1
- package/src/components/Switch/Switch.styles.tsx +6 -2
- package/src/containers/BlockchainSelector/BlockchainSelector.tsx +9 -8
- package/src/containers/SwapInput/SwapInput.styles.ts +33 -0
- package/src/containers/SwapInput/SwapInput.tsx +15 -18
- package/src/containers/SwapInput/TokenSection.styles.ts +7 -0
- package/src/containers/SwapInput/TokenSection.tsx +4 -1
- package/src/containers/TokenSelector/TokenSelector.tsx +8 -10
- package/src/index.ts +0 -1
- package/src/theme.ts +4 -4
- package/src/utils/index.ts +23 -0
- package/dist/widget/ui/src/helper/index.d.ts.map +0 -1
- package/src/helper/index.ts +0 -99
package/src/theme.ts
CHANGED
|
@@ -185,10 +185,10 @@ export const darkColors = {
|
|
|
185
185
|
secondary600: '#2B3462',
|
|
186
186
|
|
|
187
187
|
neutral: '#222222',
|
|
188
|
-
neutral900: '#
|
|
189
|
-
neutral800: '#
|
|
190
|
-
neutral700: '#
|
|
191
|
-
neutral600: '#
|
|
188
|
+
neutral900: '#E9E9E9',
|
|
189
|
+
neutral800: '#E6E6E6',
|
|
190
|
+
neutral700: '#B8B8B8',
|
|
191
|
+
neutral600: '#A2A2A2',
|
|
192
192
|
neutral500: '#222222',
|
|
193
193
|
neutral400: '#1B1B1B',
|
|
194
194
|
neutral300: '#121212',
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-magic-numbers */
|
|
2
|
+
|
|
3
|
+
export function containsText(text: string, searchText: string): boolean {
|
|
4
|
+
return text.toLowerCase().indexOf(searchText.toLowerCase()) > -1;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export function getConciseAddress(
|
|
8
|
+
address: string | null,
|
|
9
|
+
maxChars = 8,
|
|
10
|
+
ellipsisLength = 3
|
|
11
|
+
): string | null {
|
|
12
|
+
if (!address) {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
if (address.length < 2 * maxChars + ellipsisLength) {
|
|
16
|
+
return address;
|
|
17
|
+
}
|
|
18
|
+
const start = Math.ceil((address.length - maxChars) / 2);
|
|
19
|
+
const end = address.length - maxChars;
|
|
20
|
+
return `${address.substr(start, maxChars)}${'.'.repeat(
|
|
21
|
+
ellipsisLength
|
|
22
|
+
)}${address.substr(end)}`;
|
|
23
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/helper/index.ts"],"names":[],"mappings":"AAEA,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAEtE;AAED,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,MAAM,GAAG,IAAI,EACtB,QAAQ,SAAI,EACZ,cAAc,SAAI,GACjB,MAAM,GAAG,IAAI,CAYf;AA2CD,eAAO,MAAM,mBAAmB,SACxB,MAAM,QACN,OAAO,GAAG,MAAM,UACd,MAAM;;CA8Bf,CAAC"}
|
package/src/helper/index.ts
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-magic-numbers */
|
|
2
|
-
|
|
3
|
-
export function containsText(text: string, searchText: string): boolean {
|
|
4
|
-
return text.toLowerCase().indexOf(searchText.toLowerCase()) > -1;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export function getConciseAddress(
|
|
8
|
-
address: string | null,
|
|
9
|
-
maxChars = 8,
|
|
10
|
-
ellipsisLength = 3
|
|
11
|
-
): string | null {
|
|
12
|
-
if (!address) {
|
|
13
|
-
return null;
|
|
14
|
-
}
|
|
15
|
-
if (address.length < 2 * maxChars + ellipsisLength) {
|
|
16
|
-
return address;
|
|
17
|
-
}
|
|
18
|
-
const start = Math.ceil((address.length - maxChars) / 2);
|
|
19
|
-
const end = address.length - maxChars;
|
|
20
|
-
return `${address.substr(start, maxChars)}${'.'.repeat(
|
|
21
|
-
ellipsisLength
|
|
22
|
-
)}${address.substr(end)}`;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const hexToRgb = (hex: string) =>
|
|
26
|
-
((value) =>
|
|
27
|
-
value.length === 3
|
|
28
|
-
? value.split('').map((c) => parseInt(c.repeat(2), 16))
|
|
29
|
-
: (value.match(/.{1,2}/g) || []).map((v) => parseInt(v, 16)))(
|
|
30
|
-
hex.replace('#', '')
|
|
31
|
-
);
|
|
32
|
-
|
|
33
|
-
const isHexTooDark = (hexColor: string) =>
|
|
34
|
-
(([r, g, b]) => 0.2126 * r + 0.7152 * g + 0.0722 * b < 40)(
|
|
35
|
-
hexToRgb(hexColor)
|
|
36
|
-
);
|
|
37
|
-
|
|
38
|
-
const isHexTooLight = (hexColor: string) =>
|
|
39
|
-
(([r, g, b]) => (r * 299 + g * 587 + b * 114) / 1000 > 155)(
|
|
40
|
-
hexToRgb(hexColor)
|
|
41
|
-
);
|
|
42
|
-
|
|
43
|
-
const colorShade = (col: string, amt: number) => {
|
|
44
|
-
col = col.replace(/^#/, '');
|
|
45
|
-
if (col.length === 3) {
|
|
46
|
-
col = col[0] + col[0] + col[1] + col[1] + col[2] + col[2];
|
|
47
|
-
}
|
|
48
|
-
let [r, g, b]: any = col.match(/.{2}/g);
|
|
49
|
-
[r, g, b] = [
|
|
50
|
-
parseInt(r, 16) + amt,
|
|
51
|
-
parseInt(g, 16) + amt,
|
|
52
|
-
parseInt(b, 16) + amt,
|
|
53
|
-
];
|
|
54
|
-
|
|
55
|
-
r = Math.max(Math.min(255, r), 0).toString(16);
|
|
56
|
-
g = Math.max(Math.min(255, g), 0).toString(16);
|
|
57
|
-
b = Math.max(Math.min(255, b), 0).toString(16);
|
|
58
|
-
|
|
59
|
-
const rr = (r.length < 2 ? '0' : '') + r;
|
|
60
|
-
const gg = (g.length < 2 ? '0' : '') + g;
|
|
61
|
-
const bb = (b.length < 2 ? '0' : '') + b;
|
|
62
|
-
|
|
63
|
-
return `#${rr}${gg}${bb}`;
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
export const generateRangeColors = (
|
|
67
|
-
name: string,
|
|
68
|
-
mode: 'light' | 'dark',
|
|
69
|
-
color?: string
|
|
70
|
-
) => {
|
|
71
|
-
let colors = { [name]: color };
|
|
72
|
-
if (color) {
|
|
73
|
-
let c = color;
|
|
74
|
-
if (isHexTooDark(color) || mode === 'dark') {
|
|
75
|
-
for (let i = 1; i < 10; i++) {
|
|
76
|
-
colors = {
|
|
77
|
-
...colors,
|
|
78
|
-
[name + i * 100]:
|
|
79
|
-
name === 'neutral'
|
|
80
|
-
? colorShade(c, i * 15)
|
|
81
|
-
: colorShade(color, i * 5),
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
if (isHexTooLight(color) || mode === 'light') {
|
|
86
|
-
for (let i = 1; i < 10; i++) {
|
|
87
|
-
c = colorShade(c, -(i * 5));
|
|
88
|
-
colors = {
|
|
89
|
-
...colors,
|
|
90
|
-
[name + i * 100]:
|
|
91
|
-
name === 'neutral'
|
|
92
|
-
? colorShade(c, -(i * 5))
|
|
93
|
-
: colorShade(color, -(i * 5)),
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
return colors;
|
|
99
|
-
};
|