@magicgol/polyjuice 0.10.1 → 0.11.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 -0
- package/src/components/card/horizontal-card/HCard.vue +0 -6
- package/src/components/club/button/primary-club-button/PrimaryClubButton.vue +1 -1
- package/src/components/club/button/secondary-club-button/SecondaryClubButton.vue +1 -1
- package/src/components/form/button/toggle-button/ToggleButton.vue +2 -8
- package/src/components/form/checkbox/checkbox/Checkbox.vue +0 -6
- package/src/components/form/checkbox/switch/Switch.vue +1 -19
- package/src/components/form/input/input/Input.stories.js +37 -0
- package/src/components/form/input/input/Input.vue +149 -0
- package/src/components/image/profile-image/ProfileImage.stories.js +8 -1
- package/src/components/typography/paragraph/Paragraph.stories.js +34 -0
- package/src/components/typography/paragraph/Paragraph.vue +25 -0
- package/src/documentation/Community.stories.mdx +1 -1
package/package.json
CHANGED
package/src/assets/palette.scss
CHANGED
@@ -1,15 +1,19 @@
|
|
1
1
|
$palette: (
|
2
|
+
// BRAND
|
2
3
|
'brand': #d81159,
|
3
4
|
'freemium' :#004781,
|
4
5
|
'coin': #ffcf73,
|
5
6
|
'expertClub': #075169,
|
7
|
+
// ALERT
|
6
8
|
'warning': #ff614c,
|
7
9
|
'success': #349B50,
|
8
10
|
'info': #004781,
|
11
|
+
// FOOTBALLERS
|
9
12
|
'goalkeeper': #ffc700,
|
10
13
|
'defender': #3de000,
|
11
14
|
'midfielder': #116dd8,
|
12
15
|
'forward': #f30026,
|
16
|
+
// LIVE
|
13
17
|
'online': #00b669,
|
14
18
|
'offline': #ea7203,
|
15
19
|
);
|
@@ -16,7 +16,7 @@
|
|
16
16
|
<span><slot></slot></span>
|
17
17
|
</label>
|
18
18
|
<div
|
19
|
-
v-if="
|
19
|
+
v-if="contentVisibility"
|
20
20
|
class="p-2"
|
21
21
|
><slot name="content"></slot></div>
|
22
22
|
</div>
|
@@ -43,16 +43,10 @@ export default {
|
|
43
43
|
'mg-toggle-button--on': this.value === true
|
44
44
|
};
|
45
45
|
},
|
46
|
-
|
46
|
+
contentVisibility() {
|
47
47
|
return this.$slots['content'] && this.value === true
|
48
48
|
}
|
49
49
|
},
|
50
|
-
|
51
|
-
methods: {
|
52
|
-
onClick() {
|
53
|
-
this.$emit('click');
|
54
|
-
},
|
55
|
-
},
|
56
50
|
};
|
57
51
|
</script>
|
58
52
|
|
@@ -11,9 +11,7 @@
|
|
11
11
|
>
|
12
12
|
<span class="mg-switch-slider"></span>
|
13
13
|
<span class="mg-switch-icon">
|
14
|
-
<svgicon
|
15
|
-
name="check-with-circle"
|
16
|
-
></svgicon>
|
14
|
+
<svgicon name="check-with-circle"></svgicon>
|
17
15
|
</span>
|
18
16
|
</label>
|
19
17
|
</template>
|
@@ -147,21 +145,5 @@ export default {
|
|
147
145
|
opacity: 0.6 !important;
|
148
146
|
cursor: not-allowed !important;
|
149
147
|
}
|
150
|
-
//
|
151
|
-
|
152
|
-
//
|
153
|
-
// &--blocked {
|
154
|
-
// .mg-switch-slider {
|
155
|
-
// background-color: map-get($palette, 'success');
|
156
|
-
//
|
157
|
-
// &:before {
|
158
|
-
// content: none;
|
159
|
-
// }
|
160
|
-
// }
|
161
|
-
//
|
162
|
-
// .mg-switch-check {
|
163
|
-
// display: block !important;
|
164
|
-
// }
|
165
|
-
// }
|
166
148
|
}
|
167
149
|
</style>
|
@@ -0,0 +1,37 @@
|
|
1
|
+
import MgInput from './Input.vue';
|
2
|
+
|
3
|
+
// More on default export: https://storybook.js.org/docs/vue/writing-stories/introduction#default-export
|
4
|
+
export default {
|
5
|
+
title: 'Form/Input/Input',
|
6
|
+
component: MgInput,
|
7
|
+
// More on argTypes: https://storybook.js.org/docs/vue/api/argtypes
|
8
|
+
argTypes: {
|
9
|
+
},
|
10
|
+
};
|
11
|
+
|
12
|
+
// More on component templates: https://storybook.js.org/docs/vue/writing-stories/introduction#using-args
|
13
|
+
const Template = (args, { argTypes }) => ({
|
14
|
+
props: Object.keys(argTypes),
|
15
|
+
components: { MgInput },
|
16
|
+
template: `<mg-input @click="$emit('click')" v-bind="$props"></mg-input>`,
|
17
|
+
});
|
18
|
+
|
19
|
+
export const Default = Template.bind({});
|
20
|
+
// More on args: https://storybook.js.org/docs/vue/writing-stories/args
|
21
|
+
Default.args = {
|
22
|
+
disabled: false,
|
23
|
+
value: 'given input'
|
24
|
+
};
|
25
|
+
|
26
|
+
export const Disabled = Template.bind({});
|
27
|
+
Disabled.args = {
|
28
|
+
disabled: true,
|
29
|
+
value: 'given input',
|
30
|
+
};
|
31
|
+
|
32
|
+
export const Error = Template.bind({});
|
33
|
+
Error.args = {
|
34
|
+
disabled: false,
|
35
|
+
value: 'given input',
|
36
|
+
error: true
|
37
|
+
};
|
@@ -0,0 +1,149 @@
|
|
1
|
+
<template>
|
2
|
+
<div
|
3
|
+
class="d-flex align-items-center"
|
4
|
+
:class="classes"
|
5
|
+
>
|
6
|
+
<input
|
7
|
+
ref="input"
|
8
|
+
class="border-0 w-100 bg-transparent"
|
9
|
+
:autocapitalize="autocapitalize"
|
10
|
+
:autocomplete="autocomplete"
|
11
|
+
:disabled="disabled"
|
12
|
+
:name="name"
|
13
|
+
:id="id"
|
14
|
+
:min="min"
|
15
|
+
:step="step"
|
16
|
+
:placeholder="placeholder"
|
17
|
+
:type="type"
|
18
|
+
:value="value"
|
19
|
+
@input="onInput"
|
20
|
+
@focus="onFocus"
|
21
|
+
@blur="onBlur"
|
22
|
+
/>
|
23
|
+
</div>
|
24
|
+
</template>
|
25
|
+
|
26
|
+
<script>
|
27
|
+
export default {
|
28
|
+
name: 'mg-input',
|
29
|
+
|
30
|
+
data () {
|
31
|
+
return {
|
32
|
+
focus: false,
|
33
|
+
};
|
34
|
+
},
|
35
|
+
|
36
|
+
props: {
|
37
|
+
autocapitalize: {
|
38
|
+
type: String,
|
39
|
+
default: 'on'
|
40
|
+
},
|
41
|
+
autocomplete: {
|
42
|
+
type: String,
|
43
|
+
default: 'off'
|
44
|
+
},
|
45
|
+
disabled: {
|
46
|
+
type: Boolean,
|
47
|
+
default: false,
|
48
|
+
},
|
49
|
+
error: {
|
50
|
+
type: Boolean,
|
51
|
+
default: false,
|
52
|
+
},
|
53
|
+
id: {
|
54
|
+
type: String,
|
55
|
+
default: null
|
56
|
+
},
|
57
|
+
name: {
|
58
|
+
type: String
|
59
|
+
},
|
60
|
+
placeholder: {
|
61
|
+
type: String
|
62
|
+
},
|
63
|
+
type: {
|
64
|
+
type: String,
|
65
|
+
default: 'text'
|
66
|
+
},
|
67
|
+
value: {
|
68
|
+
default: null
|
69
|
+
},
|
70
|
+
min: {
|
71
|
+
default: null
|
72
|
+
},
|
73
|
+
step: {
|
74
|
+
default: null
|
75
|
+
},
|
76
|
+
},
|
77
|
+
|
78
|
+
computed: {
|
79
|
+
classes() {
|
80
|
+
return {
|
81
|
+
'mg-input': true,
|
82
|
+
'mg-input--disabled': this.disabled,
|
83
|
+
'mg-input--errored': this.error === true,
|
84
|
+
'mg-input--focused': this.focus === true,
|
85
|
+
};
|
86
|
+
}
|
87
|
+
},
|
88
|
+
|
89
|
+
methods: {
|
90
|
+
onInput($event) {
|
91
|
+
this.$emit('input', $event.target.value);
|
92
|
+
},
|
93
|
+
onFocus() {
|
94
|
+
this.focus = true;
|
95
|
+
this.$emit('focus');
|
96
|
+
},
|
97
|
+
onBlur() {
|
98
|
+
this.focus = false;
|
99
|
+
this.$emit('blur');
|
100
|
+
},
|
101
|
+
}
|
102
|
+
};
|
103
|
+
</script>
|
104
|
+
|
105
|
+
<style lang="scss">
|
106
|
+
@import '../../../../assets/palette';
|
107
|
+
|
108
|
+
.mg-input {
|
109
|
+
border-bottom: 1px solid #d8d8d8;
|
110
|
+
|
111
|
+
input {
|
112
|
+
color: #666666;
|
113
|
+
font-family: 'Raleway', sans-serif;
|
114
|
+
font-size: 1rem;
|
115
|
+
font-weight: 600;
|
116
|
+
letter-spacing: 0.54px;
|
117
|
+
padding: 0.5rem;
|
118
|
+
|
119
|
+
&:-webkit-autofill {
|
120
|
+
-webkit-box-shadow: 0 0 0 30px white inset;
|
121
|
+
-webkit-text-fill-color: #666666;
|
122
|
+
caret-color: #666666;
|
123
|
+
}
|
124
|
+
|
125
|
+
&:focus {
|
126
|
+
outline: 0;
|
127
|
+
}
|
128
|
+
|
129
|
+
&::placeholder {
|
130
|
+
color: #ccc;
|
131
|
+
font-size: 0.8125rem;
|
132
|
+
font-weight: 600;
|
133
|
+
}
|
134
|
+
}
|
135
|
+
|
136
|
+
&--disabled {
|
137
|
+
opacity: 0.6 !important;
|
138
|
+
cursor: not-allowed !important;
|
139
|
+
}
|
140
|
+
|
141
|
+
&--errored {
|
142
|
+
border-bottom-color: map-get($palette, 'warning') !important;
|
143
|
+
}
|
144
|
+
|
145
|
+
&--focused {
|
146
|
+
border-bottom-color: #414141;
|
147
|
+
}
|
148
|
+
}
|
149
|
+
</style>
|
@@ -29,7 +29,14 @@ const Template = (args, { argTypes }) => ({
|
|
29
29
|
export const Default = Template.bind({});
|
30
30
|
// More on args: https://storybook.js.org/docs/vue/writing-stories/args
|
31
31
|
Default.args = {
|
32
|
-
|
32
|
+
name: 'Mg',
|
33
|
+
};
|
34
|
+
|
35
|
+
export const Image = Template.bind({});
|
36
|
+
// More on args: https://storybook.js.org/docs/vue/writing-stories/args
|
37
|
+
Image.args = {
|
38
|
+
name: 'VdF',
|
39
|
+
imageUrl: 'https://magicgol.it/wp-content/uploads/2021/09/EspertoFantacalcio_DanteGregorio_MagicGol.jpg'
|
33
40
|
};
|
34
41
|
|
35
42
|
export const Large = Template.bind({});
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import MgParagraph from './Paragraph.vue';
|
2
|
+
|
3
|
+
// More on default export: https://storybook.js.org/docs/vue/writing-stories/introduction#default-export
|
4
|
+
export default {
|
5
|
+
title: 'Typography/Paragraph',
|
6
|
+
component: MgParagraph,
|
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: { MgParagraph },
|
27
|
+
template: `<mg-paragraph><template v-if="${'default' in args}" v-slot>${args.default}</template></mg-paragraph>`,
|
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: 'testo libero'
|
34
|
+
};
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<template>
|
2
|
+
<div v-bind:class="classes"><slot></slot></div>
|
3
|
+
</template>
|
4
|
+
|
5
|
+
<script>
|
6
|
+
export default {
|
7
|
+
name: 'mg-paragraph',
|
8
|
+
|
9
|
+
computed: {
|
10
|
+
classes() {
|
11
|
+
return {
|
12
|
+
'mg-paragraph': true,
|
13
|
+
};
|
14
|
+
}
|
15
|
+
},
|
16
|
+
};
|
17
|
+
</script>
|
18
|
+
|
19
|
+
<style lang="scss">
|
20
|
+
.mg-paragraph {
|
21
|
+
font-family: 'Ubuntu', sans-serif;
|
22
|
+
font-size: 0.75rem;
|
23
|
+
font-weight: 400;
|
24
|
+
}
|
25
|
+
</style>
|