Skip to content

Commit 88a88a1

Browse files
committedJan 20, 2022
add slot for mew menu item, remove line heights, add logo
1 parent 04d92ee commit 88a88a1

File tree

8 files changed

+45168
-15051
lines changed

8 files changed

+45168
-15051
lines changed
 

‎.storybook/manager.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { addons } from '@storybook/addons';
22
import mewTheme from './mewTheme';
33

4-
// addons.setConfig({
5-
// theme: mewTheme,
6-
// });
4+
addons.setConfig({
5+
theme: mewTheme,
6+
});

‎.storybook/mewTheme.js

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ import { create } from '@storybook/theming/create';
22

33
export default create({
44
base: 'light',
5+
title: 'default',
6+
brandTitle: 'MEW Components',
7+
brandUrl: 'www.myetherwallet.com',
8+
brandImage: 'https://www.ledger.com/wp-content/uploads/2019/05/mew-logo.jpg'
59

610
// colorPrimary: '#f0f0f0',
711
// colorSecondary: 'deepskyblue',

‎package-lock.json

+30,222-468
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@myetherwallet/mew-components",
3-
"version": "0.7.17-beta",
3+
"version": "0.7.18-beta",
44
"description": "MEW Components",
55
"main": "dist/mew-components.umd.js",
66
"module": "dist/mew-components.esm.js",

‎src/assets/styles/basics/_typography.scss

-9
Original file line numberDiff line numberDiff line change
@@ -9,49 +9,42 @@
99
.mew-title {
1010
/* size - 50px, height - 52px */
1111
font-size: 3.571rem;
12-
line-height: 3.714rem;
1312
font-weight: 700;
1413
}
1514

1615
.mew-subtitle {
1716
/* size - 30px, height - 40px */
1817
font-size: 2.143rem;
1918
font-weight: 700;
20-
line-height: 2.857rem;
2119
}
2220

2321
.mew-heading-1 {
2422
/* size - 24px, height - 32px */
2523
font-size: 1.714rem;
2624
font-weight: 700;
27-
line-height: 2.286rem;
2825
}
2926

3027
.mew-heading-2 {
3128
/* size - 20px, height - 28px */
3229
font-size: 1.429rem;
33-
line-height: 2rem;
3430
font-weight: 700;
3531
}
3632

3733
.mew-heading-3 {
3834
/* size - 16px, height - 24px */
3935
font-size: 1.143rem;
4036
font-weight: 700;
41-
line-height: 1.714rem;
4237
}
4338

4439
.mew-body {
4540
/* size - 14px , height - 20px */
4641
font-size: 1rem !important;
4742
font-weight: 400;
48-
line-height: 1.429rem !important;
4943
}
5044

5145
.mew-caption {
5246
/* size - 12px, height - 20px */
5347
font-size: 0.8571rem;
54-
line-height: 1.429rem;
5548
font-weight: 700;
5649
text-transform: uppercase;
5750
}
@@ -75,13 +68,11 @@
7568
/* size - 12px, height - 16px */
7669
font-size: 0.8571rem;
7770
font-weight: 400;
78-
line-height: 1.143rem;
7971
}
8072

8173
.mew-heading-4 {
8274
/* size - 16px, height - 24px */
8375
font-size: 1.143rem;
84-
line-height: 1.714rem;
8576
font-weight: 400;
8677
}
8778

‎src/components/MewMenu/MewMenu.vue

+33-35
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,26 @@
2121
v-on="on"
2222
>
2323
{{ listObj.name }}
24-
<v-icon
25-
v-if="!isMenuOpen"
26-
:class="['title', activatorTextColor]"
27-
>mdi-chevron-down</v-icon>
28-
<v-icon
29-
v-if="isMenuOpen"
30-
:class="['title', activatorTextColor]"
31-
>mdi-chevron-up</v-icon>
24+
<v-icon v-if="!isMenuOpen" :class="['title', activatorTextColor]"
25+
>mdi-chevron-down</v-icon
26+
>
27+
<v-icon v-if="isMenuOpen" :class="['title', activatorTextColor]"
28+
>mdi-chevron-up</v-icon
29+
>
3230
</span>
3331
</template>
3432
<!--
3533
=====================================================================================
3634
Menu List Content
3735
=====================================================================================
3836
-->
39-
<v-list
40-
v-for="(item, index) in listObj.items"
41-
:key="index"
42-
>
37+
<v-list v-for="(item, index) in listObj.items" :key="index">
38+
<!--
39+
=====================================================================================
40+
slot: 'mewMenuItem' + number of menu item
41+
=====================================================================================
42+
-->
43+
<slot :name="'mewMenuItem' + (i + 1)" />
4344
<v-list-item v-if="item.title">
4445
<v-list-item-title class="basic--text mew-heading-3 titleItem">
4546
{{ item.title }}
@@ -51,14 +52,13 @@
5152
@click="goTo(subItem.to)"
5253
class="cursor-pointer"
5354
>
54-
<v-list-item-title class="mew-body basic--text subItem d-flex align-center">
55-
<v-icon
56-
v-if="subItem.iconName"
57-
class="mr-1 basic--text"
58-
size="14px"
59-
>
55+
<v-list-item-title
56+
class="mew-body basic--text subItem d-flex align-center"
57+
>
58+
<v-icon v-if="subItem.iconName" class="mr-1 basic--text" size="14px">
6059
{{ subItem.iconName }}
61-
</v-icon> {{ subItem.title }}
60+
</v-icon>
61+
{{ subItem.title }}
6262
</v-list-item-title>
6363
</v-list-item>
6464
</v-list>
@@ -67,10 +67,10 @@
6767

6868
<script>
6969
export default {
70-
name: 'MewMenu',
70+
name: "MewMenu",
7171
data() {
7272
return {
73-
isMenuOpen: false
73+
isMenuOpen: false,
7474
};
7575
},
7676
props: {
@@ -89,17 +89,17 @@ export default {
8989
*/
9090
activatorTextColor: {
9191
type: String,
92-
default: 'basic--text',
93-
}
92+
default: "basic--text",
93+
},
9494
},
9595
computed: {
9696
contentClasses() {
97-
return 'mew-menu-content elevation-2 '
98-
}
97+
return "mew-menu-content elevation-2 ";
98+
},
9999
},
100100
methods: {
101101
goTo(link) {
102-
this.$emit('goToPage', link);
102+
this.$emit("goToPage", link);
103103
},
104104
},
105105
};
@@ -120,7 +120,7 @@ export default {
120120
}
121121
.v-list {
122122
border-radius: 0;
123-
123+
124124
.v-list-item {
125125
min-height: 30px;
126126
}
@@ -132,14 +132,12 @@ export default {
132132
}
133133
}
134134
}
135-
.v-list:first-of-type > .v-list-item:first-of-type {
136-
margin-top: 10px;
137-
}
138-
139-
.v-list:last-of-type > .v-list-item:last-of-type {
140-
margin-bottom: 10px;
141-
}
142-
135+
.v-list:first-of-type > .v-list-item:first-of-type {
136+
margin-top: 10px;
137+
}
143138
139+
.v-list:last-of-type > .v-list-item:last-of-type {
140+
margin-bottom: 10px;
141+
}
144142
}
145143
</style>

‎stories/MewTypography/MewTypography.stories.js

-9
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,10 @@ export const All = () => ({
99
/* size - 12px, height - 16px */
1010
fontSize: '0.8571rem',
1111
fontWeight: 400,
12-
lineHeight: '1.143rem'
1312
},
1413
mewHeading4: {
1514
/* size - 16px, height - 24px */
1615
fontSize: '1.143rem',
17-
lineHeight: '1.714rem',
1816
fontWeight: '400'
1917
},
2018
mewAddress: {
@@ -23,43 +21,36 @@ export const All = () => ({
2321
mewTitle: {
2422
/* size - 50px, height - 52px */
2523
fontSize: '3.571rem',
26-
lineHeight: '3.714rem',
2724
fontWeight: 700
2825
},
2926
mewSubtitle: {
3027
/* size - 30px, height - 40px */
3128
fontSize: '2.143rem',
3229
fontWeight: 700,
33-
lineHeight: '2.857rem'
3430
},
3531
mewHeading1: {
3632
/* size - 24px, height - 32px */
3733
fontSize: '1.714rem',
3834
fontWeight: 700,
39-
lineHeight: '2.286rem'
4035
},
4136
mewHeading2: {
4237
/* size - 20px, height - 28px */
4338
fontSize: '1.429rem',
44-
lineHeight: '2rem',
4539
fontWeight: 700
4640
},
4741
mewHeading3: {
4842
/* size - 16px, height - 24px */
4943
fontSize: '1.143rem',
5044
fontWeight: 700,
51-
lineHeight: '1.714rem'
5245
},
5346
mewBody: {
5447
/* size - 14px , height - 20px */
5548
fontSize: '1rem',
5649
fontWeight: 400,
57-
lineHeight: '1.429rem'
5850
},
5951
mewCaption: {
6052
/* size - 12px, height - 20px */
6153
fontSize: '0.8571rem',
62-
lineHeight: '1.429rem',
6354
fontWeight: 700,
6455
textTransform: 'uppercase'
6556
},

‎yarn.lock

+14,905-14,526
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)
Please sign in to comment.