@magicgol/polyjuice 0.16.2 → 0.18.0
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/package.json +1 -1
- package/src/components/card/vertical-card/VCard.vue +11 -5
- package/src/components/footballer/horizontal-placeholder/HPlaceholder.stories.js +70 -0
- package/src/components/footballer/horizontal-placeholder/HPlaceholder.vue +74 -0
- package/src/components/form/button/toggle-button/ToggleButton.vue +1 -1
- package/src/components/icon/badge/IconBadge.stories.js +10 -9
- package/src/components/icon/badge/IconBadge.vue +106 -19
- package/src/components/label/anchor/Anchor.stories.js +40 -0
- package/src/components/label/anchor/Anchor.vue +49 -0
- package/src/components/label/label/Label.stories.js +46 -0
- package/src/components/label/label/Label.vue +80 -0
- package/src/components/typography/h2/HeadingTwo.stories.js +34 -0
- package/src/components/typography/h2/HeadingTwo.vue +26 -0
- package/src/components/typography/h3/HeadingThree.vue +2 -1
- package/src/components/typography/h4/HeadingFour.stories.js +8 -2
- package/src/components/typography/h4/HeadingFour.vue +20 -0
package/package.json
CHANGED
@@ -4,11 +4,15 @@
|
|
4
4
|
:class="classes"
|
5
5
|
@click="onClick"
|
6
6
|
>
|
7
|
-
<div class="mg-v-card-
|
7
|
+
<div class="mg-v-card-body p-3"><slot></slot></div>
|
8
8
|
<div
|
9
|
-
class="mg-v-card-footer
|
9
|
+
class="mg-v-card-footer px-3 pb-3"
|
10
10
|
v-if="footerVisibility"
|
11
|
-
|
11
|
+
>
|
12
|
+
<div class="mg-v-card-content pt-3">
|
13
|
+
<slot name="footer"></slot>
|
14
|
+
</div>
|
15
|
+
</div>
|
12
16
|
</div>
|
13
17
|
</template>
|
14
18
|
|
@@ -58,7 +62,7 @@ export default {
|
|
58
62
|
|
59
63
|
&--theme {
|
60
64
|
&-club {
|
61
|
-
& .mg-v-card-
|
65
|
+
& .mg-v-card-body {
|
62
66
|
background: linear-gradient(90deg, #D1EFFF 0%, #DDDAFC 99.65%) !important;
|
63
67
|
color: #777;
|
64
68
|
}
|
@@ -66,7 +70,9 @@ export default {
|
|
66
70
|
}
|
67
71
|
|
68
72
|
&-footer {
|
69
|
-
|
73
|
+
.mg-v-card-content {
|
74
|
+
border-top: 1px solid #cecece;
|
75
|
+
}
|
70
76
|
}
|
71
77
|
}
|
72
78
|
</style>
|
@@ -0,0 +1,70 @@
|
|
1
|
+
import MgHPlaceholder from './HPlaceholder.vue';
|
2
|
+
|
3
|
+
// More on default export: https://storybook.js.org/docs/vue/writing-stories/introduction#default-export
|
4
|
+
export default {
|
5
|
+
title: 'Footballer/HPlaceholder',
|
6
|
+
component: MgHPlaceholder,
|
7
|
+
// More on argTypes: https://storybook.js.org/docs/vue/api/argtypes
|
8
|
+
argTypes: {
|
9
|
+
role: {
|
10
|
+
control: { type: 'select' },
|
11
|
+
options: ['P', 'D', 'C', 'A'],
|
12
|
+
defaultValue: 'A'
|
13
|
+
},
|
14
|
+
default: {
|
15
|
+
description: "The default Vue slot",
|
16
|
+
control: {
|
17
|
+
type: 'text',
|
18
|
+
},
|
19
|
+
table: {
|
20
|
+
category: 'Slots',
|
21
|
+
type: {
|
22
|
+
summary: 'html',
|
23
|
+
},
|
24
|
+
}
|
25
|
+
},
|
26
|
+
},
|
27
|
+
};
|
28
|
+
|
29
|
+
// More on component templates: https://storybook.js.org/docs/vue/writing-stories/introduction#using-args
|
30
|
+
const Template = (args, { argTypes }) => ({
|
31
|
+
props: Object.keys(argTypes),
|
32
|
+
components: { MgHPlaceholder },
|
33
|
+
template: `<mg-h-placeholder @click="$emit('click')" v-bind="$props">
|
34
|
+
<template v-if="${'default' in args}" v-slot>${args.default}</template>
|
35
|
+
</mg-h-placeholder>`,
|
36
|
+
});
|
37
|
+
|
38
|
+
export const Default = Template.bind({});
|
39
|
+
// More on args: https://storybook.js.org/docs/vue/writing-stories/args
|
40
|
+
Default.args = {
|
41
|
+
default: '<div>This is a horizontal placeholder.</div><div>What do you think about?</div>'
|
42
|
+
};
|
43
|
+
|
44
|
+
export const Goalkeeper = Template.bind({});
|
45
|
+
// More on args: https://storybook.js.org/docs/vue/writing-stories/args
|
46
|
+
Goalkeeper.args = {
|
47
|
+
role: 'P',
|
48
|
+
default: '<div>This is a horizontal placeholder.</div><div>What do you think about?</div>',
|
49
|
+
};
|
50
|
+
|
51
|
+
export const Defender = Template.bind({});
|
52
|
+
// More on args: https://storybook.js.org/docs/vue/writing-stories/args
|
53
|
+
Defender.args = {
|
54
|
+
role: 'D',
|
55
|
+
default: '<div>This is a horizontal placeholder.</div><div>What do you think about?</div>',
|
56
|
+
};
|
57
|
+
|
58
|
+
export const Midfielder = Template.bind({});
|
59
|
+
// More on args: https://storybook.js.org/docs/vue/writing-stories/args
|
60
|
+
Midfielder.args = {
|
61
|
+
role: 'C',
|
62
|
+
default: '<div>This is a horizontal placeholder.</div><div>What do you think about?</div>',
|
63
|
+
};
|
64
|
+
|
65
|
+
export const Forward = Template.bind({});
|
66
|
+
// More on args: https://storybook.js.org/docs/vue/writing-stories/args
|
67
|
+
Forward.args = {
|
68
|
+
role: 'A',
|
69
|
+
default: '<div>This is a horizontal placeholder.</div><div>What do you think about?</div>',
|
70
|
+
};
|
@@ -0,0 +1,74 @@
|
|
1
|
+
<template>
|
2
|
+
<div
|
3
|
+
class="d-flex align-items-center rounded px-3"
|
4
|
+
v-bind:class="classes"
|
5
|
+
>
|
6
|
+
<div class="flex-fill"><slot></slot></div>
|
7
|
+
</div>
|
8
|
+
</template>
|
9
|
+
|
10
|
+
<script>
|
11
|
+
export default {
|
12
|
+
name: 'mg-h-placeholder',
|
13
|
+
|
14
|
+
props: {
|
15
|
+
role: {
|
16
|
+
type: String,
|
17
|
+
default: 'A',
|
18
|
+
validator: function (value) {
|
19
|
+
return ['P', 'D', 'C', 'A'].indexOf(value) !== -1;
|
20
|
+
},
|
21
|
+
},
|
22
|
+
},
|
23
|
+
|
24
|
+
computed: {
|
25
|
+
classes() {
|
26
|
+
return {
|
27
|
+
'mg-h-placeholder': true,
|
28
|
+
'mg-h-placeholder--role-goalkeeper': this.role === 'P',
|
29
|
+
'mg-h-placeholder--role-defender': this.role === 'D',
|
30
|
+
'mg-h-placeholder--role-midfielder': this.role === 'C',
|
31
|
+
'mg-h-placeholder--role-forward': this.role === 'A',
|
32
|
+
};
|
33
|
+
},
|
34
|
+
},
|
35
|
+
|
36
|
+
methods: {
|
37
|
+
onClick() {
|
38
|
+
this.$emit('click');
|
39
|
+
},
|
40
|
+
},
|
41
|
+
};
|
42
|
+
</script>
|
43
|
+
|
44
|
+
<style lang="scss">
|
45
|
+
@import '../../../assets/palette';
|
46
|
+
|
47
|
+
.mg-h-placeholder {
|
48
|
+
background: white;
|
49
|
+
border: 2px dashed;
|
50
|
+
color: #777777;
|
51
|
+
font-family: 'Ubuntu', sans-serif;
|
52
|
+
font-size: 1rem;
|
53
|
+
font-weight: 500;
|
54
|
+
height: 3.5rem;
|
55
|
+
|
56
|
+
&--role {
|
57
|
+
&-goalkeeper {
|
58
|
+
border-color: map-get($palette, 'goalkeeper');
|
59
|
+
}
|
60
|
+
|
61
|
+
&-defender {
|
62
|
+
border-color: map-get($palette, 'defender');
|
63
|
+
}
|
64
|
+
|
65
|
+
&-midfielder {
|
66
|
+
border-color: map-get($palette, 'midfielder');
|
67
|
+
}
|
68
|
+
|
69
|
+
&-forward {
|
70
|
+
border-color: map-get($palette, 'forward');
|
71
|
+
}
|
72
|
+
}
|
73
|
+
}
|
74
|
+
</style>
|
@@ -6,9 +6,14 @@ export default {
|
|
6
6
|
component: MgIconBadge,
|
7
7
|
// More on argTypes: https://storybook.js.org/docs/vue/api/argtypes
|
8
8
|
argTypes: {
|
9
|
-
|
9
|
+
size: {
|
10
10
|
control: { type: 'select' },
|
11
|
-
options: ['normal', '
|
11
|
+
options: ['normal', 'large'],
|
12
|
+
defaultValue: 'normal'
|
13
|
+
},
|
14
|
+
context: {
|
15
|
+
control: { type: 'select' },
|
16
|
+
options: ['normal', 'club', 'success', 'failure'],
|
12
17
|
defaultValue: 'normal'
|
13
18
|
},
|
14
19
|
},
|
@@ -25,13 +30,9 @@ export const Default = Template.bind({});
|
|
25
30
|
// More on args: https://storybook.js.org/docs/vue/writing-stories/args
|
26
31
|
Default.args = {
|
27
32
|
icon: 'message',
|
28
|
-
|
33
|
+
context: 'normal',
|
34
|
+
size: 'normal',
|
35
|
+
active: false
|
29
36
|
};
|
30
37
|
|
31
|
-
export const Club = Template.bind({});
|
32
|
-
// More on args: https://storybook.js.org/docs/vue/writing-stories/args
|
33
|
-
Club.args = {
|
34
|
-
icon: 'star-c',
|
35
|
-
level: 'club',
|
36
|
-
};
|
37
38
|
|
@@ -17,21 +17,37 @@ export default {
|
|
17
17
|
icon: {
|
18
18
|
type: String
|
19
19
|
},
|
20
|
-
|
20
|
+
size: {
|
21
21
|
type: String,
|
22
22
|
default: 'normal',
|
23
23
|
validator: function (value) {
|
24
|
-
return ['normal', '
|
24
|
+
return ['normal', 'large'].indexOf(value) !== -1;
|
25
25
|
},
|
26
|
-
}
|
26
|
+
},
|
27
|
+
context: {
|
28
|
+
type: String,
|
29
|
+
default: 'normal',
|
30
|
+
validator: function (value) {
|
31
|
+
return ['normal', 'club', 'success', 'failure'].indexOf(value) !== -1;
|
32
|
+
},
|
33
|
+
},
|
34
|
+
active: {
|
35
|
+
type: Boolean,
|
36
|
+
default: false,
|
37
|
+
},
|
27
38
|
},
|
28
39
|
|
29
40
|
computed: {
|
30
41
|
classes() {
|
31
42
|
return {
|
32
43
|
'mg-icon-badge': true,
|
33
|
-
'mg-icon-badge--
|
34
|
-
'mg-icon-badge--normal': this.
|
44
|
+
'mg-icon-badge--active': this.active === true,
|
45
|
+
'mg-icon-badge--size-normal': this.size === 'normal',
|
46
|
+
'mg-icon-badge--size-large': this.size === 'large',
|
47
|
+
'mg-icon-badge--context-club': this.context === 'club',
|
48
|
+
'mg-icon-badge--context-normal': this.context === 'normal',
|
49
|
+
'mg-icon-badge--context-success': this.context === 'success',
|
50
|
+
'mg-icon-badge--context-failure': this.context === 'failure',
|
35
51
|
};
|
36
52
|
},
|
37
53
|
},
|
@@ -42,28 +58,99 @@ export default {
|
|
42
58
|
@import '../../../assets/palette';
|
43
59
|
|
44
60
|
.mg-icon-badge {
|
45
|
-
|
46
|
-
|
47
|
-
|
61
|
+
&--size {
|
62
|
+
&-normal {
|
63
|
+
height: 2rem;
|
64
|
+
min-width: 2rem;
|
65
|
+
width: 2rem;
|
66
|
+
|
67
|
+
svg {
|
68
|
+
height: 1rem;
|
69
|
+
width: 1rem;
|
70
|
+
}
|
71
|
+
}
|
72
|
+
|
73
|
+
&-large {
|
74
|
+
height: 2.5rem;
|
75
|
+
min-width: 2.5rem;
|
76
|
+
width: 2.5rem;
|
48
77
|
|
49
|
-
|
50
|
-
|
51
|
-
|
78
|
+
svg {
|
79
|
+
height: 1.25rem;
|
80
|
+
width: 1.25rem;
|
81
|
+
}
|
82
|
+
}
|
52
83
|
}
|
53
84
|
|
54
|
-
&--
|
55
|
-
|
85
|
+
&--context {
|
86
|
+
&-normal {
|
87
|
+
background-color: #f5f5f5;
|
56
88
|
|
57
|
-
|
58
|
-
|
89
|
+
svg {
|
90
|
+
fill: map-get($palette, 'brand');
|
91
|
+
}
|
92
|
+
}
|
93
|
+
|
94
|
+
&-club {
|
95
|
+
background-color: rgba(map-get($palette, 'expertClub'), 0.05);
|
96
|
+
|
97
|
+
svg {
|
98
|
+
fill: map-get($palette, 'expertClub');
|
99
|
+
}
|
100
|
+
}
|
101
|
+
|
102
|
+
&-success {
|
103
|
+
background-color: #f5f5f5;
|
104
|
+
|
105
|
+
svg {
|
106
|
+
fill: map-get($palette, 'success');
|
107
|
+
}
|
108
|
+
}
|
109
|
+
|
110
|
+
&-failure {
|
111
|
+
background-color: #f5f5f5;
|
112
|
+
|
113
|
+
svg {
|
114
|
+
fill: map-get($palette, 'error');
|
115
|
+
}
|
59
116
|
}
|
60
117
|
}
|
61
118
|
|
62
|
-
&--
|
63
|
-
|
119
|
+
&--active {
|
120
|
+
&.mg-icon-badge {
|
121
|
+
&--context {
|
122
|
+
&-normal {
|
123
|
+
background-color: map-get($palette, 'brand');
|
124
|
+
|
125
|
+
svg {
|
126
|
+
fill: #f5f5f5;
|
127
|
+
}
|
128
|
+
}
|
129
|
+
|
130
|
+
&-club {
|
131
|
+
background-color: map-get($palette, 'expertClub');
|
132
|
+
|
133
|
+
svg {
|
134
|
+
fill: mix(white, map-get($palette, 'expertClub'), 90%);
|
135
|
+
}
|
136
|
+
}
|
137
|
+
|
138
|
+
&-success {
|
139
|
+
background-color: map-get($palette, 'success');
|
140
|
+
|
141
|
+
svg {
|
142
|
+
fill: #f5f5f5;
|
143
|
+
}
|
144
|
+
}
|
145
|
+
|
146
|
+
&-failure {
|
147
|
+
background-color: map-get($palette, 'error');
|
64
148
|
|
65
|
-
|
66
|
-
|
149
|
+
svg {
|
150
|
+
fill: #f5f5f5;
|
151
|
+
}
|
152
|
+
}
|
153
|
+
}
|
67
154
|
}
|
68
155
|
}
|
69
156
|
}
|
@@ -0,0 +1,40 @@
|
|
1
|
+
import MgAnchor from './Anchor.vue';
|
2
|
+
|
3
|
+
// More on default export: https://storybook.js.org/docs/vue/writing-stories/introduction#default-export
|
4
|
+
export default {
|
5
|
+
title: 'Label/Anchor',
|
6
|
+
component: MgAnchor,
|
7
|
+
// More on argTypes: https://storybook.js.org/docs/vue/api/argtypes
|
8
|
+
argTypes: {
|
9
|
+
light: {
|
10
|
+
control: { type: 'select' },
|
11
|
+
options: ['red', 'yellow', 'green'],
|
12
|
+
defaultValue: 'green'
|
13
|
+
},
|
14
|
+
default: {
|
15
|
+
description: "The default Vue slot",
|
16
|
+
control: {
|
17
|
+
type: 'text',
|
18
|
+
},
|
19
|
+
table: {
|
20
|
+
category: 'Slots',
|
21
|
+
type: {
|
22
|
+
summary: 'html',
|
23
|
+
},
|
24
|
+
}
|
25
|
+
}
|
26
|
+
},
|
27
|
+
};
|
28
|
+
|
29
|
+
// More on component templates: https://storybook.js.org/docs/vue/writing-stories/introduction#using-args
|
30
|
+
const Template = (args, { argTypes }) => ({
|
31
|
+
props: Object.keys(argTypes),
|
32
|
+
components: { MgAnchor },
|
33
|
+
template: `<mg-anchor v-bind="$props"><template v-if="${'default' in args}" v-slot>${args.default}</template></mg-anchor>`,
|
34
|
+
});
|
35
|
+
|
36
|
+
export const Default = Template.bind({});
|
37
|
+
// More on args: https://storybook.js.org/docs/vue/writing-stories/args
|
38
|
+
Default.args = {
|
39
|
+
default: 'bozza',
|
40
|
+
};
|
@@ -0,0 +1,49 @@
|
|
1
|
+
<template>
|
2
|
+
<div class="mg-anchor">
|
3
|
+
<div class="mg-anchor-content position-relative d-inline-flex align-items-center text-uppercase text-white">
|
4
|
+
<div><slot></slot></div>
|
5
|
+
</div>
|
6
|
+
</div>
|
7
|
+
</template>
|
8
|
+
|
9
|
+
<script>
|
10
|
+
export default {
|
11
|
+
name: 'mg-anchor',
|
12
|
+
|
13
|
+
computed: {
|
14
|
+
classes() {
|
15
|
+
return {
|
16
|
+
'mg-anchor': true,
|
17
|
+
};
|
18
|
+
}
|
19
|
+
},
|
20
|
+
};
|
21
|
+
</script>
|
22
|
+
|
23
|
+
<style lang="scss">
|
24
|
+
.mg-anchor {
|
25
|
+
padding-left: 10px;
|
26
|
+
|
27
|
+
.mg-anchor-content {
|
28
|
+
background: #444444;
|
29
|
+
border-radius: 0 4px 4px 0;
|
30
|
+
font-family: 'Ubuntu', sans-serif;
|
31
|
+
font-size: 0.75rem;
|
32
|
+
font-weight: 500;
|
33
|
+
height: 1.625rem;
|
34
|
+
padding-right: 0.6875rem;
|
35
|
+
padding-left: 0.375rem;
|
36
|
+
|
37
|
+
&::after {
|
38
|
+
content: '';
|
39
|
+
position: absolute;
|
40
|
+
border-radius: 50%;
|
41
|
+
border-top: 16px solid transparent;
|
42
|
+
border-right: 16px solid #444444;
|
43
|
+
border-bottom: 16px solid transparent;
|
44
|
+
left: 0;
|
45
|
+
margin-left: -13px;
|
46
|
+
}
|
47
|
+
}
|
48
|
+
}
|
49
|
+
</style>
|
@@ -0,0 +1,46 @@
|
|
1
|
+
import MgLabel from './Label.vue';
|
2
|
+
|
3
|
+
// More on default export: https://storybook.js.org/docs/vue/writing-stories/introduction#default-export
|
4
|
+
export default {
|
5
|
+
title: 'Label/Label',
|
6
|
+
component: MgLabel,
|
7
|
+
// More on argTypes: https://storybook.js.org/docs/vue/api/argtypes
|
8
|
+
argTypes: {
|
9
|
+
size: {
|
10
|
+
control: { type: 'select' },
|
11
|
+
options: ['normal', 'x-small'],
|
12
|
+
defaultValue: 'normal'
|
13
|
+
},
|
14
|
+
theme: {
|
15
|
+
control: { type: 'select' },
|
16
|
+
options: ['light', 'dark'],
|
17
|
+
defaultValue: 'light'
|
18
|
+
},
|
19
|
+
default: {
|
20
|
+
description: "The default Vue slot",
|
21
|
+
control: {
|
22
|
+
type: 'text',
|
23
|
+
},
|
24
|
+
table: {
|
25
|
+
category: 'Slots',
|
26
|
+
type: {
|
27
|
+
summary: 'html',
|
28
|
+
},
|
29
|
+
}
|
30
|
+
}
|
31
|
+
},
|
32
|
+
};
|
33
|
+
|
34
|
+
// More on component templates: https://storybook.js.org/docs/vue/writing-stories/introduction#using-args
|
35
|
+
const Template = (args, { argTypes }) => ({
|
36
|
+
props: Object.keys(argTypes),
|
37
|
+
components: { MgLabel },
|
38
|
+
template: `<mg-label v-bind="$props"><template v-if="${'default' in args}" v-slot>${args.default}</template></mg-label>`,
|
39
|
+
});
|
40
|
+
|
41
|
+
export const Default = Template.bind({});
|
42
|
+
// More on args: https://storybook.js.org/docs/vue/writing-stories/args
|
43
|
+
Default.args = {
|
44
|
+
default: 'etichetta',
|
45
|
+
size: 'x-small'
|
46
|
+
};
|
@@ -0,0 +1,80 @@
|
|
1
|
+
<template>
|
2
|
+
<div
|
3
|
+
class="d-inline-flex align-items-center px-2 text-uppercase"
|
4
|
+
:class="classes"
|
5
|
+
>
|
6
|
+
<div>
|
7
|
+
<slot></slot>
|
8
|
+
</div>
|
9
|
+
</div>
|
10
|
+
</template>
|
11
|
+
|
12
|
+
<script>
|
13
|
+
export default {
|
14
|
+
name: 'mg-label',
|
15
|
+
|
16
|
+
props: {
|
17
|
+
size: {
|
18
|
+
type: String,
|
19
|
+
default: 'normal',
|
20
|
+
validator: function (value) {
|
21
|
+
return ['normal', 'x-small'].indexOf(value) !== -1;
|
22
|
+
},
|
23
|
+
},
|
24
|
+
theme: {
|
25
|
+
type: String,
|
26
|
+
default: 'light',
|
27
|
+
validator: function (value) {
|
28
|
+
return ['light', 'dark'].indexOf(value) !== -1;
|
29
|
+
},
|
30
|
+
},
|
31
|
+
},
|
32
|
+
|
33
|
+
computed: {
|
34
|
+
classes() {
|
35
|
+
return {
|
36
|
+
'mg-label': true,
|
37
|
+
'mg-label--size-x-small': this.size === 'x-small',
|
38
|
+
'mg-label--size-normal': this.size === 'normal',
|
39
|
+
'mg-label--theme-light': this.theme === 'light',
|
40
|
+
'mg-label--theme-dark': this.theme === 'dark',
|
41
|
+
};
|
42
|
+
}
|
43
|
+
},
|
44
|
+
};
|
45
|
+
</script>
|
46
|
+
|
47
|
+
<style lang="scss">
|
48
|
+
.mg-label {
|
49
|
+
border-radius: 32px;
|
50
|
+
padding-top: 0.0625rem;
|
51
|
+
padding-bottom: 0.0625rem;
|
52
|
+
|
53
|
+
> div {
|
54
|
+
font-family: 'Raleway', sans-serif;
|
55
|
+
font-weight: 700;
|
56
|
+
}
|
57
|
+
|
58
|
+
&--size {
|
59
|
+
&-x-small {
|
60
|
+
font-size: 0.625rem;
|
61
|
+
}
|
62
|
+
|
63
|
+
&-normal {
|
64
|
+
font-size: 0.875rem;
|
65
|
+
}
|
66
|
+
}
|
67
|
+
|
68
|
+
&--theme {
|
69
|
+
&-light {
|
70
|
+
background: #f7f7f7;
|
71
|
+
color: #343434;
|
72
|
+
}
|
73
|
+
|
74
|
+
&-dark {
|
75
|
+
background: #5b5b5b;
|
76
|
+
color: #fff;
|
77
|
+
}
|
78
|
+
}
|
79
|
+
}
|
80
|
+
</style>
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import MgHeadingTwo from './HeadingTwo.vue';
|
2
|
+
|
3
|
+
// More on default export: https://storybook.js.org/docs/vue/writing-stories/introduction#default-export
|
4
|
+
export default {
|
5
|
+
title: 'Typography/Heading/H2',
|
6
|
+
component: MgHeadingTwo,
|
7
|
+
// More on argTypes: https://storybook.js.org/docs/vue/api/argtypes
|
8
|
+
argTypes: {
|
9
|
+
default: {
|
10
|
+
description: "The default Vue slot",
|
11
|
+
control: {
|
12
|
+
type: 'text',
|
13
|
+
},
|
14
|
+
table: {
|
15
|
+
category: 'Slots',
|
16
|
+
type: {
|
17
|
+
summary: 'html',
|
18
|
+
},
|
19
|
+
}
|
20
|
+
}
|
21
|
+
},
|
22
|
+
};
|
23
|
+
|
24
|
+
// More on component templates: https://storybook.js.org/docs/vue/writing-stories/introduction#using-args
|
25
|
+
const Template = args => ({
|
26
|
+
components: { MgHeadingTwo },
|
27
|
+
template: `<mg-heading-two><template v-if="${'default' in args}" v-slot>${args.default}</template></mg-heading-two>`,
|
28
|
+
});
|
29
|
+
|
30
|
+
export const Default = Template.bind({});
|
31
|
+
// More on args: https://storybook.js.org/docs/vue/writing-stories/args
|
32
|
+
Default.args = {
|
33
|
+
default: 'heading 2'
|
34
|
+
};
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<template>
|
2
|
+
<div v-bind:class="classes"><slot></slot></div>
|
3
|
+
</template>
|
4
|
+
|
5
|
+
<script>
|
6
|
+
export default {
|
7
|
+
name: 'mg-heading-two',
|
8
|
+
|
9
|
+
computed: {
|
10
|
+
classes() {
|
11
|
+
return {
|
12
|
+
'mg-h2': true,
|
13
|
+
};
|
14
|
+
}
|
15
|
+
},
|
16
|
+
};
|
17
|
+
</script>
|
18
|
+
|
19
|
+
<style lang="scss">
|
20
|
+
.mg-h2 {
|
21
|
+
color: #343434;
|
22
|
+
font-family: 'Ubuntu', sans-serif;
|
23
|
+
font-size: 1rem;
|
24
|
+
font-weight: 500;
|
25
|
+
}
|
26
|
+
</style>
|
@@ -6,6 +6,11 @@ export default {
|
|
6
6
|
component: MgHeadingFour,
|
7
7
|
// More on argTypes: https://storybook.js.org/docs/vue/api/argtypes
|
8
8
|
argTypes: {
|
9
|
+
level: {
|
10
|
+
control: { type: 'select' },
|
11
|
+
options: [null, 'club'],
|
12
|
+
defaultValue: null
|
13
|
+
},
|
9
14
|
default: {
|
10
15
|
description: "The default Vue slot",
|
11
16
|
control: {
|
@@ -22,9 +27,10 @@ export default {
|
|
22
27
|
};
|
23
28
|
|
24
29
|
// More on component templates: https://storybook.js.org/docs/vue/writing-stories/introduction#using-args
|
25
|
-
const Template = args => ({
|
30
|
+
const Template = (args, { argTypes }) => ({
|
31
|
+
props: Object.keys(argTypes),
|
26
32
|
components: { MgHeadingFour },
|
27
|
-
template: `<mg-heading-four><template v-if="${'default' in args}" v-slot>${args.default}</template></mg-heading-four>`,
|
33
|
+
template: `<mg-heading-four v-bind="$props"><template v-if="${'default' in args}" v-slot>${args.default}</template></mg-heading-four>`,
|
28
34
|
});
|
29
35
|
|
30
36
|
export const Default = Template.bind({});
|
@@ -6,10 +6,21 @@
|
|
6
6
|
export default {
|
7
7
|
name: 'mg-heading-four',
|
8
8
|
|
9
|
+
props: {
|
10
|
+
level: {
|
11
|
+
type: String,
|
12
|
+
default: null,
|
13
|
+
validator: function (value) {
|
14
|
+
return ['club'].indexOf(value) !== -1;
|
15
|
+
},
|
16
|
+
}
|
17
|
+
},
|
18
|
+
|
9
19
|
computed: {
|
10
20
|
classes() {
|
11
21
|
return {
|
12
22
|
'mg-h4': true,
|
23
|
+
'mg-h4--level-club': this.level === 'club',
|
13
24
|
};
|
14
25
|
}
|
15
26
|
},
|
@@ -17,9 +28,18 @@ export default {
|
|
17
28
|
</script>
|
18
29
|
|
19
30
|
<style lang="scss">
|
31
|
+
@import '../../../assets/palette';
|
32
|
+
|
20
33
|
.mg-h4 {
|
34
|
+
color: #343434;
|
21
35
|
font-family: 'Ubuntu', sans-serif;
|
22
36
|
font-size: 0.875rem;
|
23
37
|
font-weight: 700;
|
38
|
+
|
39
|
+
&--level {
|
40
|
+
&-club {
|
41
|
+
color: map-get($palette, 'expertClub') !important;
|
42
|
+
}
|
43
|
+
}
|
24
44
|
}
|
25
45
|
</style>
|