Skip to content

Commit 53d2dc4

Browse files
committedDec 2, 2022
Merge branch 'devop/update-colors' of github.com:MyEtherWallet/mew-components into devop/update-notif-tooltip
2 parents afd55ee + 362e845 commit 53d2dc4

File tree

2 files changed

+190
-130
lines changed

2 files changed

+190
-130
lines changed
 

‎src/assets/styles/vuetifyTheme.js

+111-51
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,72 @@
11
export default {
22
icons: {
3-
iconfont: 'mdi'
3+
iconfont: 'mdi',
44
},
55
theme: {
66
options: {
7-
customProperties: true
7+
customProperties: true,
88
},
99
themes: {
1010
light: {
11-
// new colors
12-
backgroundWallet: '#F2F4FA',
13-
backgroundOverlay: '#F2FAFA',
14-
backgroundGrey: '#F8F9FB',
15-
whiteAlways: '#FFFFFF',
16-
whiteBackground: '#FFFFFF',
17-
whitePopup: '#FFFFFF',
18-
textDark: '#192133',
19-
textMedium: '#5A678A',
20-
textLight: '#939FB9',
21-
greyPrimary:'#5A678A',
22-
greyMedium: '#D7DAE3',
23-
greyLight: '#F2F3F6',
24-
greenPrimary: '#05C0A5',
25-
greenMedium: '#C3F0E9',
26-
greenLight: '#EBFAF8',
11+
// Text
12+
textDark: '#1F242F',
13+
textMedium: '#626978',
14+
textLight: '#9BA1AE',
15+
// Grey
16+
greyPrimary: '#626978',
17+
greyMedium: '#E4E7ED',
18+
greyLight: '#F9FAFE',
19+
// Asphalt
20+
asphalt10: '#F9FAFE',
21+
asphalt25: '#F5F7FB',
22+
asphalt50: '#EDF0F5',
23+
asphalt75: '#E4E7ED',
24+
asphalt100: '#DADEE5',
25+
asphalt200: '#CACFD7',
26+
asphalt300: '#B7BCC7',
27+
asphalt400: '#9BA1AE',
28+
asphalt500: '#777E8C',
29+
asphalt600: '#626978',
30+
asphalt700: '#474D5B',
31+
asphalt800: '#333945',
32+
asphalt900: '#1F242F',
33+
// Backgrounds
34+
walletBg: '#F2F4FA',
35+
overlayBg: '#F2FAFA',
36+
greyBg: '#F8F9FB',
37+
// Whites
38+
alwaysWhite: '#FFFFFF',
39+
whiteBg: '#FFFFFF',
40+
popupBg: '#FFFFFF',
41+
// Blue
2742
bluePrimary: '#4B83E8',
2843
blueMedium: '#D4E1F9',
2944
blueLight: '#EEF3FD',
45+
// Green
46+
greenPrimary: '#05C0A5',
47+
greenMedium: '#C3F0E9',
48+
greenLight: '#EBFAF8',
49+
// Red
3050
redPrimary: '#FF445B',
3151
redMedium: '#FFD2D8',
3252
redLight: '#FFF0F2',
53+
// Orange
3354
orangePrimary: '#F5A623',
3455
orangeMedium: '#FBDBA7',
3556
orangeLight: '#FEF4E5',
57+
// Disabled
3658
disabledPrimary: '#CECECE',
3759
disabledMedium: '#E0E0E0',
38-
disabledLight: '#F6F6F6',
60+
disabledLight: '#F6F6F6 ',
61+
// =========================================================
62+
// =========================================================
63+
// new colors
64+
backgroundWallet: '#F2F4FA',
65+
backgroundOverlay: '#F2FAFA',
66+
backgroundGrey: '#F8F9FB',
67+
whiteAlways: '#FFFFFF',
68+
whiteBackground: '#FFFFFF',
69+
whitePopup: '#FFFFFF',
3970
//old colors
4071
primaryHover: '#1eb19b',
4172
primaryActive: '#56c5b4',
@@ -47,7 +78,7 @@ export default {
4778
selectHover: '#E5EAEE',
4879
superPrimary: {
4980
base: '#f2fafa',
50-
darken1: '#e3f2f2'
81+
darken1: '#e3f2f2',
5182
},
5283
superPrimaryHover: '#f5fdfb',
5384
emerald100: '#f2fafa',
@@ -73,7 +104,6 @@ export default {
73104
white: '#fff',
74105
black: '#000',
75106
mewBg: '#fff',
76-
walletBg: '#f2f4fa',
77107
boxShadow: '#ececec',
78108
expandHeader: '#184f90',
79109
primary: '#05c0a5',
@@ -83,12 +113,12 @@ export default {
83113
error: {
84114
base: '#ff445b',
85115
lighten1: '#ffd7dc',
86-
lighten2: '#e96071'
116+
lighten2: '#e96071',
87117
},
88118
warning: {
89119
base: '#FFF2DC',
90120
darken1: '#f5a623',
91-
darken2: '#ff7700'
121+
darken2: '#ff7700',
92122
},
93123
disabled: '#cecece',
94124
tableHeader: '#f9f9f9',
@@ -99,38 +129,69 @@ export default {
99129
textBlack2: '#5F6368',
100130
buttonSelect: '#D7F5F4',
101131
blue100: '#F3F5FB',
102-
surface: '#192133' // name from figma. not sure if its correct
132+
surface: '#192133', // name from figma. not sure if its correct
103133
},
104134
dark: {
105-
// new colors
106-
backgroundWallet: '#000000',
107-
backgroundOverlay: '#000000',
108-
backgroundGrey: '#000000',
109-
whiteAlways: '#FFFFFF',
110-
whiteBackground: '#192439',
111-
whitePopup: '#202B43',
112-
textDark: '#CCD4E6',
113-
textMedium: '#626E86',
114-
textLight: '#3A4561',
115-
greyPrimary:'#5A678A',
116-
greyMedium: '#323D57',
117-
greyLight: '#263149',
118-
greenPrimary: '#06D9B9',
119-
greenMedium: '#107E7A',
120-
greenLight: '#154853',
135+
// Text
136+
textDark: '#1F242F',
137+
textMedium: '#626978',
138+
textLight: '#9BA1AE',
139+
// Grey
140+
greyPrimary: '#626978',
141+
greyMedium: '#E4E7ED',
142+
greyLight: '#F9FAFE',
143+
// Asphalt
144+
asphalt10: '#F9FAFE',
145+
asphalt25: '#F5F7FB',
146+
asphalt50: '#EDF0F5',
147+
asphalt75: '#E4E7ED',
148+
asphalt100: '#DADEE5',
149+
asphalt200: '#CACFD7',
150+
asphalt300: '#B7BCC7',
151+
asphalt400: '#9BA1AE',
152+
asphalt500: '#777E8C',
153+
asphalt600: '#626978',
154+
asphalt700: '#474D5B',
155+
asphalt800: '#333945',
156+
asphalt900: '#1F242F',
157+
// Backgrounds
158+
walletBg: '#000000',
159+
overlayBg: '#000000',
160+
greyBg: '#000000',
161+
// Whites
162+
alwaysWhite: '#FFFFFF',
163+
whiteBg: '#151518',
164+
popupBg: '#1B1C25 ',
165+
// Blue
121166
bluePrimary: '#6292EB',
122167
blueMedium: '#355288',
123168
blueLight: '#283A5D',
169+
// Green
170+
greenPrimary: '#06D9B9',
171+
greenMedium: '#0F7E79',
172+
greenLight: '#154853',
173+
// Red
124174
redPrimary: '#FF5E70',
125175
redMedium: '#8C4155',
126176
redLight: '#473044',
177+
// Orange
127178
orangePrimary: '#F6AF3C',
128179
orangeMedium: '#87693B',
129180
orangeLight: '#45403A',
181+
// Disabled
130182
disabledPrimary: '#606670',
131183
disabledMedium: '#383F4A',
132-
disabledLight: '#242D3E',
133-
//old colors
184+
disabledLight: '#242D3E ',
185+
// =========================================================
186+
// =========================================================
187+
// new colors
188+
backgroundWallet: '#000000',
189+
backgroundOverlay: '#000000',
190+
backgroundGrey: '#000000',
191+
whiteAlways: '#FFFFFF',
192+
whiteBackground: '#192439',
193+
whitePopup: '#202B43',
194+
//old colors
134195
primaryHover: '#1eb19b',
135196
primaryActive: '#56c5b4',
136197
primaryOutlineHover: '#03292c',
@@ -145,7 +206,7 @@ export default {
145206
selectHover: '#2c3448',
146207
superPrimary: {
147208
base: '#242c48',
148-
darken1: '#e3f2f2'
209+
darken1: '#e3f2f2',
149210
},
150211
superPrimaryHover: '#f5fdfb',
151212
emerald100: '#151a29',
@@ -165,7 +226,6 @@ export default {
165226
searchText: '#96a8b6',
166227
white: '#fff',
167228
mewBg: '#151a29',
168-
walletBg: '#151a29',
169229
black: '#000',
170230
boxShadow: '#3c3c3c',
171231
expandHeader: '#184f90',
@@ -181,11 +241,11 @@ export default {
181241
error: {
182242
base: '#ff445b',
183243
lighten1: '#ffd7dc',
184-
lighten2: '#e96071'
244+
lighten2: '#e96071',
185245
},
186246
warning: {
187247
base: '#0f1320',
188-
darken1: '#f5a623'
248+
darken1: '#f5a623',
189249
},
190250
disabled: '#1f2b42',
191251
tableHeader: '#0f1320',
@@ -196,8 +256,8 @@ export default {
196256
textBlack2: '#5F6368',
197257
buttonSelect: '#D7F5F4',
198258
blue100: '#F3F5FB',
199-
surface: '#192133' //name from figma
200-
}
201-
}
202-
}
203-
}
259+
surface: '#192133', //name from figma
260+
},
261+
},
262+
},
263+
};

‎src/components/MewInput/MewInput.vue

+79-79
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<template>
2-
<!-- ===================================================================================== -->
3-
<!-- Mew Input -->
4-
<!-- ===================================================================================== -->
2+
<!--
3+
=====================================================================================
4+
Mew Input
5+
=====================================================================================
6+
-->
57
<v-text-field
6-
v-model="inputValue"
78
class="mew-input rounded-lg"
8-
:class="hideValue ? 'hide-value' : ''"
99
:disabled="disabled"
1010
:label="label"
1111
:placeholder="placeholder"
@@ -14,6 +14,7 @@
1414
:solo="hasNoBorder"
1515
color="primary"
1616
:autofocus="autofocus"
17+
v-model="inputValue"
1718
:hint="resolvedAddr ? resolvedAddr : hint"
1819
:persistent-hint="persistentHint || resolvedAddr.length > 0"
1920
:suffix="rightLabel"
@@ -22,14 +23,17 @@
2223
:type="inputType"
2324
:append-icon="showPasswordIcon"
2425
:readonly="isReadOnly"
26+
@click:append="onPasswordIconClick"
27+
@keydown.native="preventCharE($event)"
2528
validate-on-blur
2629
height="62"
27-
@click:append="onPasswordIconClick"
2830
>
29-
<!-- ===================================================================================== -->
30-
<!-- Mew Input: Error Messages -->
31-
<!-- ===================================================================================== -->
32-
<template #message="item">
31+
<!--
32+
=====================================================================================
33+
Mew Input: Error Messages
34+
=====================================================================================
35+
-->
36+
<template v-slot:message="item">
3337
<span
3438
class="mew-label"
3539
>{{ item.message }}
@@ -40,10 +44,12 @@
4044
@click="emitBuyMore"
4145
>{{ buyMoreStr }}</a></span>
4246
</template>
43-
<template #prepend-inner>
44-
<!-- ===================================================================================== -->
45-
<!-- Mew Input: Blockie (displays at the beginning of the input) -->
46-
<!-- ===================================================================================== -->
47+
<template v-slot:prepend-inner>
48+
<!--
49+
=====================================================================================
50+
Mew Input: Blockie (displays at the beginning of the input)
51+
=====================================================================================
52+
-->
4753
<div
4854
v-if="showBlockie && !value"
4955
class="blockie-placeholder mr-1 selectHover"
@@ -55,15 +61,18 @@
5561
height="25px"
5662
/>
5763
<div class="d-flex align-center justify-center">
58-
<!-- ===================================================================================== -->
59-
<!-- slot: prependInnerIcon -->
60-
<!-- prepends content to the beginning of the input. -->
61-
<!-- ===================================================================================== -->
64+
<!--
65+
=====================================================================================
66+
slot: prependInnerIcon
67+
prepends content to the beginning of the input.
68+
=====================================================================================
69+
-->
6270
<slot name="prependInnerIcon" />
63-
64-
<!-- ===================================================================================== -->
65-
<!-- Mew Input: Token Image (displays at the beginning of the input) -->
66-
<!-- ===================================================================================== -->
71+
<!--
72+
=====================================================================================
73+
Mew Input: Token Image (displays at the beginning of the input)
74+
=====================================================================================
75+
-->
6776
<mew-token-container
6877
v-if="image"
6978
class="mx-1 mt-1"
@@ -73,26 +82,27 @@
7382
/>
7483
</div>
7584
</template>
76-
77-
<!-- ===================================================================================== -->
78-
<!-- Max Button (displays at the end of the input) -->
79-
<!-- ===================================================================================== -->
80-
<template #append>
85+
<!--
86+
=====================================================================================
87+
Max Button (displays at the end of the input)
88+
=====================================================================================
89+
-->
90+
<template v-slot:append>
8191
<v-btn
8292
v-if="maxBtnObj.method"
93+
@click="maxBtnObj.method"
8394
:class="[
8495
maxBtnObj.disabled
8596
? 'disabled--text no-pointer-events'
8697
: 'greyPrimary--text',
87-
'rounded-lg mt-n2 mew-caption font-weight-medium'
98+
'rounded-lg mt-n2 mew-caption font-weight-medium',
8899
]"
89100
min-width="40"
90101
min-height="40"
91102
height="40"
92103
width="40"
93104
depressed
94105
color="greyLight"
95-
@click="maxBtnObj.method"
96106
>
97107
{{ maxBtnObj.title }}
98108
</v-btn>
@@ -110,85 +120,85 @@ export default {
110120
name: 'MewInput',
111121
components: {
112122
MewBlockie,
113-
MewTokenContainer
123+
MewTokenContainer,
114124
},
115125
props: {
116126
/**
117127
* Error messages to display at the bottom of the input.
118128
*/
119129
errorMessages: {
120130
type: [String, Array],
121-
default: ''
131+
default: '',
122132
},
123133
/**
124134
* Input becomes read only.
125135
*/
126136
isReadOnly: {
127137
type: Boolean,
128-
default: false
138+
default: false,
129139
},
130140
/**
131141
* Prepends the blockie to the beginning of the input.
132142
*/
133143
showBlockie: {
134144
type: Boolean,
135-
default: false
145+
default: false,
136146
},
137147
/**
138148
* Removes the input border and adds a box shadow.
139149
*/
140150
hasNoBorder: {
141151
type: Boolean,
142-
default: false
152+
default: false,
143153
},
144154
/**
145155
* Disables the input.
146156
*/
147157
disabled: {
148158
type: Boolean,
149-
default: false
159+
default: false,
150160
},
151161
/**
152162
* The input label.
153163
*/
154164
label: {
155165
type: String,
156-
default: ''
166+
default: '',
157167
},
158168
/**
159169
* The input placeholder.
160170
*/
161171
placeholder: {
162172
type: String,
163-
default: ''
173+
default: '',
164174
},
165175
/**
166176
* The input value.
167177
*/
168178
value: {
169179
type: String,
170-
default: ''
180+
default: '',
171181
},
172182
/**
173183
* The input id.
174184
*/
175185
id: {
176186
type: Number,
177-
default: null
187+
default: null,
178188
},
179189
/**
180190
* Displays text on the right inner side of the input.
181191
*/
182192
rightLabel: {
183193
type: String,
184-
default: ''
194+
default: '',
185195
},
186196
/**
187197
* Hides input clear functionality. Clear symbol will be displayed on the right side.
188198
*/
189199
hideClearBtn: {
190200
type: Boolean,
191-
default: false
201+
default: false,
192202
},
193203
/**
194204
* For validating your input - accepts an array of functions that take an input value as an argument and returns either true / false
@@ -198,49 +208,49 @@ export default {
198208
type: Array,
199209
default: () => {
200210
return [];
201-
}
211+
},
202212
},
203213
/**
204214
* The resolved address.
205215
*/
206216
resolvedAddr: {
207217
type: String,
208-
default: ''
218+
default: '',
209219
},
210220
/**
211221
* Enables persistent hint.
212222
*/
213223
persistentHint: {
214224
type: Boolean,
215-
default: false
225+
default: false,
216226
},
217227
/**
218228
* Hint text (will be displayed at the bottom of the input).
219229
*/
220230
hint: {
221231
type: String,
222-
default: ''
232+
default: '',
223233
},
224234
/**
225235
* Sets input type.
226236
*/
227237
type: {
228238
type: String,
229-
default: 'text'
239+
default: 'text',
230240
},
231241
/**
232242
* Prepends an image to the beginning of the input.
233243
*/
234244
image: {
235245
type: String,
236-
default: ''
246+
default: '',
237247
},
238248
/**
239249
* Adds a "Buy more" string to the end of the first index of the errorMessages prop.
240250
*/
241251
buyMoreStr: {
242252
type: String,
243-
default: ''
253+
default: '',
244254
},
245255
/**
246256
* Displays a button to the right inner side of the input.
@@ -251,37 +261,42 @@ export default {
251261
type: Object,
252262
default: () => {
253263
return {};
254-
}
264+
},
255265
},
256266
/**
257267
* Autofocuses the input.
258268
*/
259269
autofocus: {
260270
type: Boolean,
261-
default: false
271+
default: false,
262272
},
263273
/**
264274
* Hides the toggle show password icon on the right
265275
* when input type is password.
266276
*/
267277
hidePasswordIcon: {
268278
type: Boolean,
269-
default: false
279+
default: false,
270280
},
271-
/**
272-
* Hide password and key value
273-
*/
274-
hideValue: {
275-
type: Boolean,
276-
default: false
277-
}
278281
},
279282
data() {
280283
return {
281284
inputValue: '',
282-
showPassword: false
285+
showPassword: false,
283286
};
284287
},
288+
watch: {
289+
inputValue(newVal, oldVal) {
290+
if (newVal !== oldVal) {
291+
this.$emit('input', newVal, this.id);
292+
}
293+
},
294+
value(newVal, oldVal) {
295+
if (newVal !== oldVal) {
296+
this.inputValue = newVal;
297+
}
298+
},
299+
},
285300
computed: {
286301
isPasswordType() {
287302
return this.type === types[0];
@@ -297,19 +312,7 @@ export default {
297312
return types[1];
298313
}
299314
return this.type;
300-
}
301-
},
302-
watch: {
303-
inputValue(newVal, oldVal) {
304-
if (newVal !== oldVal) {
305-
this.$emit('input', newVal, this.id);
306-
}
307315
},
308-
value(newVal, oldVal) {
309-
if (newVal !== oldVal) {
310-
this.inputValue = newVal;
311-
}
312-
}
313316
},
314317
mounted() {
315318
this.inputValue = this.value;
@@ -325,21 +328,18 @@ export default {
325328
},
326329
clear(val) {
327330
this.inputValue = val ? val : '';
328-
}
329-
}
331+
},
332+
preventCharE(e) {
333+
if (this.type === 'number' && e.key === 'e') e.preventDefault();
334+
},
335+
},
330336
};
331337
</script>
332-
333338
<style lang="scss">
334339
/**
335340
* Mew Input styles
336341
*/
337342
.mew-input {
338-
&.hide-value {
339-
input {
340-
-webkit-text-security: disc;
341-
}
342-
}
343343
.mdi-close {
344344
font-size: 20px !important;
345345
}

0 commit comments

Comments
 (0)
Please sign in to comment.