@magicgol/polyjuice 0.9.2 → 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.
@@ -1,4 +1,4 @@
1
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
2
- <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
1
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.3.1/dist/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
2
+ <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.3.1/dist/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
3
3
 
4
- <link href="https://fonts.googleapis.com/css?family=Ubuntu:500" rel="stylesheet" />
4
+ <link href="https://fonts.googleapis.com/css?family=Ubuntu:500,600" rel="stylesheet" />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magicgol/polyjuice",
3
- "version": "0.9.2",
3
+ "version": "0.11.0",
4
4
  "scripts": {
5
5
  "serve": "vue-cli-service serve",
6
6
  "build": "vue-cli-service build",
@@ -1,13 +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
17
+ 'online': #00b669,
18
+ 'offline': #ea7203,
13
19
  );
@@ -30,12 +30,6 @@ export default {
30
30
  };
31
31
  }
32
32
  },
33
-
34
- methods: {
35
- onClick() {
36
- this.$emit('click');
37
- },
38
- },
39
33
  };
40
34
  </script>
41
35
 
@@ -4,7 +4,7 @@
4
4
  class="w-100 rounded justify-content-center align-items-center p-2 border-0 text-white text-uppercase d-flex"
5
5
  :class="classes"
6
6
  :disabled="disabled"
7
- @click="$emit('click')"
7
+ @click="onClick"
8
8
  >
9
9
  <svgicon name="star-c"></svgicon>
10
10
  <div class="ml-2">
@@ -4,7 +4,7 @@
4
4
  type="button"
5
5
  :class="classes"
6
6
  :disabled="disabled"
7
- @click="$emit('click')"
7
+ @click="onClick"
8
8
  >
9
9
  <div class="d-flex justify-content-center align-items-center">
10
10
  <svgicon name="star-stroke-p"></svgicon>
@@ -16,7 +16,7 @@
16
16
  <span><slot></slot></span>
17
17
  </label>
18
18
  <div
19
- v-if="contentSlotVisibility"
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
- contentSlotVisibility() {
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
 
@@ -50,12 +50,6 @@ export default {
50
50
  };
51
51
  }
52
52
  },
53
-
54
- methods: {
55
- onClick() {
56
- this.$emit('click');
57
- },
58
- },
59
53
  };
60
54
  </script>
61
55
 
@@ -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>
@@ -0,0 +1,54 @@
1
+ import MgProfileImage from './ProfileImage.vue';
2
+
3
+ // More on default export: https://storybook.js.org/docs/vue/writing-stories/introduction#default-export
4
+ export default {
5
+ title: 'Image/Profile',
6
+ component: MgProfileImage,
7
+ // More on argTypes: https://storybook.js.org/docs/vue/api/argtypes
8
+ argTypes: {
9
+ size: {
10
+ control: { type: 'select' },
11
+ options: ['large', 'normal'],
12
+ defaultValue: 'normal'
13
+ },
14
+ online: {
15
+ control: { type: 'select' },
16
+ options: [true, false],
17
+ defaultValue: false
18
+ },
19
+ },
20
+ };
21
+
22
+ // More on component templates: https://storybook.js.org/docs/vue/writing-stories/introduction#using-args
23
+ const Template = (args, { argTypes }) => ({
24
+ props: Object.keys(argTypes),
25
+ components: { MgProfileImage },
26
+ template: `<mg-profile-image v-bind="$props"></mg-profile-image>`,
27
+ });
28
+
29
+ export const Default = Template.bind({});
30
+ // More on args: https://storybook.js.org/docs/vue/writing-stories/args
31
+ Default.args = {
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'
40
+ };
41
+
42
+ export const Large = Template.bind({});
43
+ // More on args: https://storybook.js.org/docs/vue/writing-stories/args
44
+ Large.args = {
45
+ name: 'VdF',
46
+ size: 'large',
47
+ };
48
+
49
+ export const Online = Template.bind({});
50
+ // More on args: https://storybook.js.org/docs/vue/writing-stories/args
51
+ Online.args = {
52
+ online: true,
53
+ name: 'VdF'
54
+ };
@@ -0,0 +1,134 @@
1
+ <template>
2
+ <div
3
+ class="position-relative"
4
+ v-bind:class="classes"
5
+ >
6
+ <!-- INITIALS LAYER -->
7
+ <div
8
+ class="mg-acronym d-flex align-items-center position-absolute w-100 h-100"
9
+ >
10
+ <div
11
+ class="px-1 w-100 text-center flex-fill text-truncate text-white"
12
+ >{{ name }}</div>
13
+ </div>
14
+ <!-- end of INITIALS LAYER -->
15
+ <!-- PROFILE IMAGE LAYER -->
16
+ <div
17
+ class="mg-image position-absolute w-100 h-100"
18
+ style="background-position: center; background-size: cover"
19
+ v-if="imageUrl"
20
+ v-bind:style="{ backgroundImage: 'url(' + imageUrl + ')' }"
21
+ ></div>
22
+ <!-- end of PROFILE IMAGE LAYER -->
23
+ <!-- ONLINE BADGE -->
24
+ <div
25
+ class="mg-live-badge position-absolute w-100"
26
+ >
27
+ <div class="w-100"></div>
28
+ </div>
29
+ <!-- end of ONLINE BADGE -->
30
+ </div>
31
+ </template>
32
+
33
+ <script>
34
+ export default {
35
+ name: 'mg-profile-image',
36
+
37
+ props: {
38
+ name: {
39
+ type: String
40
+ },
41
+ imageUrl: {
42
+ type: String
43
+ },
44
+ size: {
45
+ type: String,
46
+ default: 'normal',
47
+ validator: function (value) {
48
+ return ['large', 'normal'].indexOf(value) !== -1;
49
+ },
50
+ },
51
+ online: {
52
+ type: Boolean,
53
+ default: false
54
+ }
55
+ },
56
+
57
+ computed: {
58
+ classes() {
59
+ return {
60
+ 'mg-profile-image': true,
61
+ 'mg-profile-image--normal': this.size === 'normal',
62
+ 'mg-profile-image--large': this.size === 'large',
63
+ 'mg-profile-image--online': this.online === true,
64
+ 'mg-profile-image--offline': this.online === false,
65
+ };
66
+ },
67
+ acronym() {
68
+ return '';
69
+ }
70
+ },
71
+ };
72
+ </script>
73
+
74
+ <style lang="scss">
75
+ @import '../../../assets/palette';
76
+
77
+ .mg-profile-image {
78
+ border-radius: 50%;
79
+ font-family: 'Ubuntu', sans-serif;
80
+ font-weight: 600;
81
+
82
+ &--normal {
83
+ height: 2.5rem;
84
+ font-size: 1rem;
85
+ width: 2.5rem;
86
+ }
87
+
88
+ &--large {
89
+ height: 5rem;
90
+ font-size: 2rem;
91
+ width: 5rem;
92
+ }
93
+
94
+ .mg-acronym {
95
+ background-color: #5770bc;
96
+ border-radius: 50%;
97
+ }
98
+
99
+ .mg-image {
100
+ border-radius: 50%;
101
+ }
102
+
103
+ > div {
104
+ z-index: 100;
105
+ }
106
+
107
+ .mg-live-badge {
108
+ border-radius: 50%;
109
+ border: 3px solid white;
110
+ margin-bottom: -3px;
111
+ margin-right: -3px;
112
+ max-width: calc(20% + 6px);
113
+ min-width: 0.8125rem;
114
+ right: 0;
115
+ bottom: 0;
116
+
117
+ div {
118
+ padding-top: 100%;
119
+ }
120
+ }
121
+
122
+ &--online {
123
+ .mg-live-badge {
124
+ background-color: map-get($palette, 'online');
125
+ }
126
+ }
127
+
128
+ &--offline {
129
+ .mg-live-badge {
130
+ background-color: map-get($palette, 'offline');
131
+ }
132
+ }
133
+ }
134
+ </style>
@@ -0,0 +1,34 @@
1
+ import MgHeadingOne from './HeadingOne.vue';
2
+
3
+ // More on default export: https://storybook.js.org/docs/vue/writing-stories/introduction#default-export
4
+ export default {
5
+ title: 'Typography/H1/H1',
6
+ component: MgHeadingOne,
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: { MgHeadingOne },
27
+ template: `<mg-heading-one><template v-if="${'default' in args}" v-slot>${args.default}</template></mg-heading-one>`,
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 one'
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-heading-one',
8
+
9
+ computed: {
10
+ classes() {
11
+ return {
12
+ 'mg-h1': true,
13
+ };
14
+ }
15
+ },
16
+ };
17
+ </script>
18
+
19
+ <style lang="scss">
20
+ .mg-h1 {
21
+ font-family: 'Ubuntu', sans-serif;
22
+ font-size: 1.25rem;
23
+ font-weight: 500;
24
+ }
25
+ </style>
@@ -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>
@@ -0,0 +1,16 @@
1
+ import {ColorItem, ColorPalette, Meta} from '@storybook/addon-docs';
2
+
3
+ <Meta title="Colors/Community" />
4
+
5
+ <ColorPalette>
6
+ <ColorItem
7
+ title="Live"
8
+ subtitle="Used for online people"
9
+ colors={{'Jade': '#00b669'}}
10
+ />
11
+ <ColorItem
12
+ title="Offline"
13
+ subtitle="Used for offline people"
14
+ colors={{'Clementine': '#ea7203'}}
15
+ />
16
+ </ColorPalette>
package/src/main.js CHANGED
@@ -31,9 +31,13 @@ export MgToggleButton from './components/form/button/toggle-button/ToggleButton'
31
31
  export MgCheckbox from './components/form/checkbox/checkbox/Checkbox';
32
32
  export MgSwitch from './components/form/checkbox/switch/Switch';
33
33
 
34
+ export MgProfileImage from './components/image/profile-image/ProfileImage';
35
+
34
36
  export MgMagicCoinButton from './components/magic-coin/button/MagicCoinButton';
35
37
  export MgCredits from './components/magic-coin/credits/Credits';
36
38
 
37
39
  export MgSoccerBallLoader from './components/loader/soccer-ball/SoccerBall';
38
40
 
39
41
  export MgTabButton from './components/navigation/tab-button/TabButton';
42
+
43
+ export MgHeadingOne from './components/typography/h1/HeadingOne';
package/src/App.vue DELETED
@@ -1,28 +0,0 @@
1
- <template>
2
- <div id="app">
3
- <img alt="Vue logo" src="./assets/logo.png">
4
- <HelloWorld msg="Welcome to Your Vue.js App"/>
5
- </div>
6
- </template>
7
-
8
- <script>
9
- import HelloWorld from './components/HelloWorld.vue'
10
-
11
- export default {
12
- name: 'App',
13
- components: {
14
- HelloWorld
15
- }
16
- }
17
- </script>
18
-
19
- <style>
20
- #app {
21
- font-family: Avenir, Helvetica, Arial, sans-serif;
22
- -webkit-font-smoothing: antialiased;
23
- -moz-osx-font-smoothing: grayscale;
24
- text-align: center;
25
- color: #2c3e50;
26
- margin-top: 60px;
27
- }
28
- </style>