@magicgol/polyjuice 0.22.2 → 0.24.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/assets/palette.scss +4 -4
- package/src/components/card/vertical-card/VCard.stories.js +9 -1
- package/src/components/card/vertical-card/VCard.vue +7 -1
- package/src/components/footballer/horizontal-footballer/HFootballer.stories.js +37 -1
- package/src/components/footballer/horizontal-footballer/HFootballer.vue +56 -18
- package/src/components/footballer/role-badge/RoleBadge.vue +6 -5
- package/src/components/label/badge/LabelBadge.stories.js +24 -0
- package/src/components/label/badge/LabelBadge.vue +36 -0
- package/src/components/label/label/Label.vue +3 -1
- package/src/components/list/head/ListHead.vue +1 -1
- package/src/components/typography/h1/HeadingOne.vue +3 -1
- package/src/components/typography/h2/HeadingTwo.vue +3 -1
- package/src/components/typography/h3/HeadingThree.vue +3 -1
- package/src/components/typography/h4/HeadingFour.vue +3 -1
- package/src/components/typography/h5/HeadingFive.vue +1 -1
- package/src/documentation/Brand.stories.mdx +1 -1
- package/src/documentation/Footballer.stories.mdx +4 -4
package/package.json
CHANGED
package/src/assets/palette.scss
CHANGED
|
@@ -11,10 +11,10 @@ $palette: (
|
|
|
11
11
|
'success': #349B50,
|
|
12
12
|
'info': #004781,
|
|
13
13
|
// FOOTBALLERS
|
|
14
|
-
'goalkeeper': #
|
|
15
|
-
'defender': #
|
|
16
|
-
'midfielder': #
|
|
17
|
-
'forward': #
|
|
14
|
+
'goalkeeper': #fcd777,
|
|
15
|
+
'defender': #89f4a1,
|
|
16
|
+
'midfielder': #8fc6f9,
|
|
17
|
+
'forward': #f58383,
|
|
18
18
|
// LIVE
|
|
19
19
|
'online': #00b669,
|
|
20
20
|
'offline': #ea7203,
|
|
@@ -20,7 +20,7 @@ export default {
|
|
|
20
20
|
},
|
|
21
21
|
theme: {
|
|
22
22
|
control: { type: 'select' },
|
|
23
|
-
options: [null, 'club', 'rating', 'goalkeeper', 'defender', 'midfielder', 'forward'],
|
|
23
|
+
options: [null, 'club', 'rating', 'goalkeeper', 'defender', 'midfielder', 'forward', 'transparent'],
|
|
24
24
|
defaultValue: null
|
|
25
25
|
},
|
|
26
26
|
footer: {
|
|
@@ -108,3 +108,11 @@ Forward.args = {
|
|
|
108
108
|
default: '<div>This is a vertical card.</div><div>What do you think about?</div>',
|
|
109
109
|
footer: '<div>The footer content goes here</div>'
|
|
110
110
|
};
|
|
111
|
+
|
|
112
|
+
export const Transparent = Template.bind({});
|
|
113
|
+
// More on args: https://storybook.js.org/docs/vue/writing-stories/args
|
|
114
|
+
Transparent.args = {
|
|
115
|
+
theme: 'transparent',
|
|
116
|
+
default: '<div>This is a vertical card.</div><div>What do you think about?</div>',
|
|
117
|
+
footer: '<div>The footer content goes here</div>'
|
|
118
|
+
};
|
|
@@ -25,7 +25,7 @@ export default {
|
|
|
25
25
|
type: String,
|
|
26
26
|
default: null,
|
|
27
27
|
validator: function (value) {
|
|
28
|
-
return ['club', 'rating', 'goalkeeper', 'defender', 'midfielder', 'forward'].indexOf(value) !== -1;
|
|
28
|
+
return ['club', 'rating', 'goalkeeper', 'defender', 'midfielder', 'forward', 'transparent'].indexOf(value) !== -1;
|
|
29
29
|
},
|
|
30
30
|
}
|
|
31
31
|
},
|
|
@@ -40,6 +40,7 @@ export default {
|
|
|
40
40
|
'mg-v-card--theme-defender': this.theme === 'defender',
|
|
41
41
|
'mg-v-card--theme-midfielder': this.theme === 'midfielder',
|
|
42
42
|
'mg-v-card--theme-forward': this.theme === 'forward',
|
|
43
|
+
'mg-v-card--theme-transparent': this.theme === 'transparent',
|
|
43
44
|
};
|
|
44
45
|
},
|
|
45
46
|
footerVisibility() {
|
|
@@ -88,6 +89,11 @@ export default {
|
|
|
88
89
|
&-forward {
|
|
89
90
|
background-color: map-get($palette, 'forward');
|
|
90
91
|
}
|
|
92
|
+
|
|
93
|
+
&-transparent {
|
|
94
|
+
background: rgba(255, 255, 255, 0.95) !important;
|
|
95
|
+
box-shadow: none;
|
|
96
|
+
}
|
|
91
97
|
}
|
|
92
98
|
|
|
93
99
|
&-footer {
|
|
@@ -11,6 +11,23 @@ export default {
|
|
|
11
11
|
options: [null, 'P', 'D', 'C', 'A'],
|
|
12
12
|
defaultValue: 'A'
|
|
13
13
|
},
|
|
14
|
+
size: {
|
|
15
|
+
control: { type: 'select' },
|
|
16
|
+
options: ['normal', 'large'],
|
|
17
|
+
defaultValue: 'normal'
|
|
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
|
+
},
|
|
14
31
|
},
|
|
15
32
|
};
|
|
16
33
|
|
|
@@ -18,7 +35,7 @@ export default {
|
|
|
18
35
|
const Template = (args, { argTypes }) => ({
|
|
19
36
|
props: Object.keys(argTypes),
|
|
20
37
|
components: { MgHFootballer },
|
|
21
|
-
template: `<mg-h-footballer @click="$emit('click')" v-bind="$props"></mg-h-footballer>`,
|
|
38
|
+
template: `<mg-h-footballer @click="$emit('click')" v-bind="$props"><template v-if="${'default' in args}" v-slot>${args.default}</template></mg-h-footballer>`,
|
|
22
39
|
});
|
|
23
40
|
|
|
24
41
|
export const Default = Template.bind({});
|
|
@@ -34,3 +51,22 @@ export const Empty = Template.bind({});
|
|
|
34
51
|
Empty.args = {
|
|
35
52
|
role: null
|
|
36
53
|
};
|
|
54
|
+
|
|
55
|
+
export const Disabled = Template.bind({});
|
|
56
|
+
// More on args: https://storybook.js.org/docs/vue/writing-stories/args
|
|
57
|
+
Disabled.args = {
|
|
58
|
+
disabled: true,
|
|
59
|
+
role: 'A',
|
|
60
|
+
firstname: 'Paulo',
|
|
61
|
+
lastname: 'Dybala',
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export const Large = Template.bind({});
|
|
65
|
+
// More on args: https://storybook.js.org/docs/vue/writing-stories/args
|
|
66
|
+
Large.args = {
|
|
67
|
+
size: 'large',
|
|
68
|
+
role: 'A',
|
|
69
|
+
firstname: 'Paulo',
|
|
70
|
+
lastname: 'Dybala',
|
|
71
|
+
};
|
|
72
|
+
|
|
@@ -8,22 +8,28 @@
|
|
|
8
8
|
class="flex-fill text-truncate"
|
|
9
9
|
v-bind:class="{'text-right': inverted, 'order-1': !inverted}"
|
|
10
10
|
>
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
<div class="text-truncate">
|
|
12
|
+
<!-- LAST NAME ONLY -->
|
|
13
|
+
<span
|
|
14
|
+
v-if="hasOnlyLastname"
|
|
15
|
+
class="mg-h-footballer-strong"
|
|
16
|
+
>{{ lastname }}</span>
|
|
17
|
+
<!-- end of LAST NAME ONLY -->
|
|
18
|
+
<!-- FULL NAME -->
|
|
19
|
+
<span v-else-if="hasName">
|
|
19
20
|
<span class="mg-h-footballer-strong">{{ lastname }}</span>, <span>{{ firstname }}</span>
|
|
20
21
|
</span>
|
|
21
|
-
|
|
22
|
+
<span v-else>–</span>
|
|
23
|
+
</div>
|
|
24
|
+
<div class="mg-h-footballer-subtext"><slot></slot></div>
|
|
22
25
|
</div>
|
|
23
26
|
<!-- end of FOOTBALLER NAME -->
|
|
24
27
|
<!-- ROLE BADGE -->
|
|
25
28
|
<div v-bind:class="{'pl-2': inverted, 'pr-2': !inverted}">
|
|
26
|
-
<mg-role-badge
|
|
29
|
+
<mg-role-badge
|
|
30
|
+
:role="role"
|
|
31
|
+
:size="size"
|
|
32
|
+
></mg-role-badge>
|
|
27
33
|
</div>
|
|
28
34
|
<!-- end of ROLE BADGE -->
|
|
29
35
|
</div>
|
|
@@ -40,6 +46,10 @@ export default {
|
|
|
40
46
|
type: Boolean,
|
|
41
47
|
default: false,
|
|
42
48
|
},
|
|
49
|
+
disabled: {
|
|
50
|
+
type: Boolean,
|
|
51
|
+
default: false,
|
|
52
|
+
},
|
|
43
53
|
role: {
|
|
44
54
|
type: String,
|
|
45
55
|
default: null,
|
|
@@ -55,12 +65,22 @@ export default {
|
|
|
55
65
|
type: String,
|
|
56
66
|
default: null
|
|
57
67
|
},
|
|
68
|
+
size: {
|
|
69
|
+
type: String,
|
|
70
|
+
default: 'normal',
|
|
71
|
+
validator: function (value) {
|
|
72
|
+
return ['normal', 'large'].indexOf(value) !== -1;
|
|
73
|
+
},
|
|
74
|
+
},
|
|
58
75
|
},
|
|
59
76
|
|
|
60
77
|
computed: {
|
|
61
78
|
classes() {
|
|
62
79
|
return {
|
|
63
80
|
'mg-h-footballer': true,
|
|
81
|
+
'mg-h-footballer--disabled': this.disabled,
|
|
82
|
+
'mg-h-footballer--size-normal': this.size === 'normal',
|
|
83
|
+
'mg-h-footballer--size-large': this.size === 'large',
|
|
64
84
|
};
|
|
65
85
|
},
|
|
66
86
|
hasOnlyLastname() {
|
|
@@ -84,15 +104,33 @@ export default {
|
|
|
84
104
|
</script>
|
|
85
105
|
|
|
86
106
|
<style lang="scss">
|
|
87
|
-
@import '../../../assets/palette';
|
|
107
|
+
@import '../../../assets/palette';
|
|
88
108
|
|
|
89
|
-
.mg-h-footballer {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
font-size: 0.75rem;
|
|
109
|
+
.mg-h-footballer {
|
|
110
|
+
color: map-get($palette, 'text');
|
|
111
|
+
font-family: 'Ubuntu', sans-serif;
|
|
93
112
|
|
|
94
|
-
|
|
95
|
-
|
|
113
|
+
&-strong {
|
|
114
|
+
font-weight: 500;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
&-subtext {
|
|
118
|
+
font-size: 0.875rem;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
&--disabled {
|
|
122
|
+
opacity: 0.6;
|
|
123
|
+
cursor: not-allowed !important;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
&--size {
|
|
127
|
+
&-normal {
|
|
128
|
+
font-size: 0.75rem;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
&-large {
|
|
132
|
+
font-size: 1rem;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
96
135
|
}
|
|
97
|
-
}
|
|
98
136
|
</style>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
|
-
class="d-inline-flex text-center
|
|
3
|
+
class="d-inline-flex text-center rounded-circle justify-content-center align-items-center"
|
|
4
4
|
:class="classes"
|
|
5
5
|
>
|
|
6
6
|
<slot v-if="slotVisibility"></slot>
|
|
@@ -57,8 +57,9 @@ export default {
|
|
|
57
57
|
|
|
58
58
|
.mg-role-badge {
|
|
59
59
|
background-color: #c2c2c2;
|
|
60
|
+
color: map-get($palette, 'text');
|
|
60
61
|
font-family: 'Ubuntu', sans-serif;
|
|
61
|
-
font-weight:
|
|
62
|
+
font-weight: 500;
|
|
62
63
|
|
|
63
64
|
&--normal {
|
|
64
65
|
font-size: 0.75rem;
|
|
@@ -69,9 +70,9 @@ export default {
|
|
|
69
70
|
|
|
70
71
|
&--large {
|
|
71
72
|
font-size: 1rem;
|
|
72
|
-
height: 1.
|
|
73
|
-
width: 1.
|
|
74
|
-
min-width: 1.
|
|
73
|
+
height: 1.875rem;
|
|
74
|
+
width: 1.875rem;
|
|
75
|
+
min-width: 1.875rem;
|
|
75
76
|
}
|
|
76
77
|
|
|
77
78
|
&--huge {
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import MgLabelBadge from './LabelBadge.vue';
|
|
2
|
+
|
|
3
|
+
// More on default export: https://storybook.js.org/docs/vue/writing-stories/introduction#default-export
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Label/Badge',
|
|
6
|
+
component: MgLabelBadge,
|
|
7
|
+
// More on argTypes: https://storybook.js.org/docs/vue/api/argtypes
|
|
8
|
+
argTypes: {},
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
// More on component templates: https://storybook.js.org/docs/vue/writing-stories/introduction#using-args
|
|
12
|
+
const Template = (args, { argTypes }) => ({
|
|
13
|
+
props: Object.keys(argTypes),
|
|
14
|
+
components: { MgLabelBadge },
|
|
15
|
+
template: `<mg-label-badge v-bind="$props"><template v-if="${'default' in args}" v-slot>${args.default}</template></mg-label-badge>`,
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export const Default = Template.bind({});
|
|
19
|
+
// More on args: https://storybook.js.org/docs/vue/writing-stories/args
|
|
20
|
+
Default.args = {
|
|
21
|
+
default: '99'
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="d-inline-flex rounded-circle align-items-center justify-content-center text-white"
|
|
4
|
+
:class="classes"
|
|
5
|
+
@click="onClick"
|
|
6
|
+
><slot></slot></div>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script>
|
|
10
|
+
export default {
|
|
11
|
+
name: 'mg-label-badge',
|
|
12
|
+
|
|
13
|
+
props: {
|
|
14
|
+
},
|
|
15
|
+
|
|
16
|
+
computed: {
|
|
17
|
+
classes() {
|
|
18
|
+
return {
|
|
19
|
+
'mg-label-badge': true,
|
|
20
|
+
};
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<style lang="scss">
|
|
27
|
+
@import '../../../assets/palette';
|
|
28
|
+
|
|
29
|
+
.mg-label-badge {
|
|
30
|
+
background-color: #84485E;
|
|
31
|
+
font-family: 'Ubuntu', sans-serif;
|
|
32
|
+
font-weight: 500;
|
|
33
|
+
height: 2rem;
|
|
34
|
+
width: 2rem;
|
|
35
|
+
}
|
|
36
|
+
</style>
|
|
@@ -45,6 +45,8 @@ export default {
|
|
|
45
45
|
</script>
|
|
46
46
|
|
|
47
47
|
<style lang="scss">
|
|
48
|
+
@import '../../../assets/palette';
|
|
49
|
+
|
|
48
50
|
.mg-label {
|
|
49
51
|
border-radius: 32px;
|
|
50
52
|
padding-top: 0.0625rem;
|
|
@@ -68,7 +70,7 @@ export default {
|
|
|
68
70
|
&--theme {
|
|
69
71
|
&-light {
|
|
70
72
|
background: #f7f7f7;
|
|
71
|
-
color:
|
|
73
|
+
color: map-get($palette, 'text');
|
|
72
74
|
}
|
|
73
75
|
|
|
74
76
|
&-dark {
|
|
@@ -5,18 +5,18 @@ import {ColorItem, ColorPalette, Meta} from '@storybook/addon-docs';
|
|
|
5
5
|
<ColorPalette>
|
|
6
6
|
<ColorItem
|
|
7
7
|
title="Goalkeeper"
|
|
8
|
-
colors={{'
|
|
8
|
+
colors={{'Golden Rod': '#fcd777'}}
|
|
9
9
|
/>
|
|
10
10
|
<ColorItem
|
|
11
11
|
title="Defender"
|
|
12
|
-
colors={{'
|
|
12
|
+
colors={{'Mint Green': '#89f4a1'}}
|
|
13
13
|
/>
|
|
14
14
|
<ColorItem
|
|
15
15
|
title="Midfielder"
|
|
16
|
-
colors={{'
|
|
16
|
+
colors={{'Malibu': '#8fc6f9'}}
|
|
17
17
|
/>
|
|
18
18
|
<ColorItem
|
|
19
19
|
title="Forward"
|
|
20
|
-
colors={{'
|
|
20
|
+
colors={{'Froly': '#f58383'}}
|
|
21
21
|
/>
|
|
22
22
|
</ColorPalette>
|