@magicgol/polyjuice 0.12.0 → 0.14.1

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magicgol/polyjuice",
3
- "version": "0.12.0",
3
+ "version": "0.14.1",
4
4
  "scripts": {
5
5
  "serve": "vue-cli-service serve",
6
6
  "build": "vue-cli-service build",
@@ -1,6 +1,8 @@
1
1
  /* eslint-disable */
2
2
  require('./check-with-circle')
3
3
  require('./magic-coin')
4
+ require('./message')
4
5
  require('./soccer-ball')
5
6
  require('./star-c')
6
7
  require('./star-stroke-p')
8
+ require('./timer')
@@ -0,0 +1,10 @@
1
+ /* eslint-disable */
2
+ var icon = require('vue-svgicon')
3
+ icon.register({
4
+ 'message': {
5
+ width: 16,
6
+ height: 16,
7
+ viewBox: '0 0 16 16',
8
+ data: '<path pid="0" d="M13.333 1.333H2.667c-.736 0-1.334.598-1.334 1.334v8c0 .735.598 1.333 1.334 1.333h2v2.511L8.85 12h4.482c.736 0 1.334-.598 1.334-1.333v-8c0-.736-.598-1.334-1.334-1.334zm0 9.334H8.482L6 12.155v-1.488H2.667v-8h10.666v8z" _fill="#D81159"/><path pid="1" d="M4.667 4.667h6.666V6H4.667V4.667zm0 2.666h4.666v1.334H4.667V7.333z" _fill="#D81159"/>'
9
+ }
10
+ })
@@ -0,0 +1,10 @@
1
+ /* eslint-disable */
2
+ var icon = require('vue-svgicon')
3
+ icon.register({
4
+ 'timer': {
5
+ width: 16,
6
+ height: 16,
7
+ viewBox: '0 0 16 16',
8
+ data: '<path pid="0" d="M4 .667A.667.667 0 014.667 0H10a.666.666 0 110 1.333H4.667A.667.667 0 014 .667zM6.667 10A.667.667 0 108 10V6a.667.667 0 00-1.333 0v4zm.666-7.333a6 6 0 100 12 6 6 0 000-12zm-4.666 6a4.667 4.667 0 119.333 0 4.667 4.667 0 01-9.333 0zm10.864-3.53a.667.667 0 10.941-.944l-1.336-1.33a.666.666 0 10-.941.944l1.336 1.33z" _fill="#D81159"/>'
9
+ }
10
+ })
@@ -23,7 +23,7 @@ export default {
23
23
  };
24
24
  },
25
25
  footerVisibility() {
26
- return this.$slots['footer']
26
+ return 'footer' in this.$slots;
27
27
  }
28
28
  },
29
29
 
@@ -2,6 +2,7 @@
2
2
  <div
3
3
  class="d-inline-flex flex-column text-center"
4
4
  :class="classes"
5
+ @click="$emit('click')"
5
6
  >
6
7
  <svgicon
7
8
  name="star-c"
@@ -48,7 +49,7 @@ export default {
48
49
 
49
50
  svg {
50
51
  fill: map-get($palette, 'expertClub');
51
- height: 1.25rem;
52
+ height: 1.5rem;
52
53
  }
53
54
  }
54
55
  </style>
@@ -0,0 +1,56 @@
1
+ import MgRoleBadge from './RoleBadge.vue';
2
+
3
+ // More on default export: https://storybook.js.org/docs/vue/writing-stories/introduction#default-export
4
+ export default {
5
+ title: 'Footballer/Role Badge',
6
+ component: MgRoleBadge,
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
+ size: {
15
+ control: { type: 'select' },
16
+ options: ['large', 'normal'],
17
+ defaultValue: 'normal'
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: { MgRoleBadge },
26
+ template: `<mg-role-badge v-bind="$props"></mg-role-badge>`,
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
+ };
33
+
34
+ export const Goalkeeper = Template.bind({});
35
+ // More on args: https://storybook.js.org/docs/vue/writing-stories/args
36
+ Goalkeeper.args = {
37
+ role: 'P',
38
+ };
39
+
40
+ export const Defender = Template.bind({});
41
+ // More on args: https://storybook.js.org/docs/vue/writing-stories/args
42
+ Defender.args = {
43
+ role: 'D',
44
+ };
45
+
46
+ export const Midfielder = Template.bind({});
47
+ // More on args: https://storybook.js.org/docs/vue/writing-stories/args
48
+ Midfielder.args = {
49
+ role: 'C',
50
+ };
51
+
52
+ export const Forward = Template.bind({});
53
+ // More on args: https://storybook.js.org/docs/vue/writing-stories/args
54
+ Forward.args = {
55
+ role: 'A',
56
+ };
@@ -0,0 +1,84 @@
1
+ <template>
2
+ <div
3
+ class="d-inline-flex text-center text-white rounded-circle justify-content-center align-items-center"
4
+ :class="classes"
5
+ >
6
+ {{ role }}
7
+ </div>
8
+ </template>
9
+
10
+ <script>
11
+ export default {
12
+ name: 'mg-role-badge',
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
+ size: {
23
+ type: String,
24
+ default: 'normal',
25
+ validator: function (value) {
26
+ return ['normal', 'large'].indexOf(value) !== -1;
27
+ },
28
+ }
29
+ },
30
+
31
+ computed: {
32
+ classes() {
33
+ return {
34
+ 'mg-role-badge': true,
35
+ 'mg-role-badge--goalkeeper': this.role === 'P',
36
+ 'mg-role-badge--defender': this.role === 'D',
37
+ 'mg-role-badge--midfielder': this.role === 'C',
38
+ 'mg-role-badge--forward': this.role === 'A',
39
+ 'mg-role-badge--normal': this.size === 'normal',
40
+ 'mg-role-badge--large': this.size === 'large',
41
+ };
42
+ }
43
+ },
44
+ };
45
+ </script>
46
+
47
+ <style lang="scss">
48
+ @import '../../../assets/palette';
49
+
50
+ .mg-role-badge {
51
+ font-family: 'Ubuntu', sans-serif;
52
+ font-weight: 600;
53
+
54
+ &--normal {
55
+ font-size: 0.75rem;
56
+ height: 1.125rem;
57
+ width: 1.125rem;
58
+ min-width: 1.125rem;
59
+ }
60
+
61
+ &--large {
62
+ font-size: 0.875rem;
63
+ height: 1.5rem;
64
+ width: 1.5rem;
65
+ min-width: 1.5rem;
66
+ }
67
+
68
+ &--goalkeeper {
69
+ background-color: map-get($palette, 'goalkeeper');
70
+ }
71
+
72
+ &--defender {
73
+ background-color: map-get($palette, 'defender');
74
+ }
75
+
76
+ &--midfielder {
77
+ background-color: map-get($palette, 'midfielder');
78
+ }
79
+
80
+ &--forward {
81
+ background-color: map-get($palette, 'forward');
82
+ }
83
+ }
84
+ </style>
@@ -40,11 +40,11 @@ export default {
40
40
  classes() {
41
41
  return {
42
42
  'mg-toggle-button': true,
43
- 'mg-toggle-button--on': this.value === true
43
+ 'mg-toggle-button--on': this.value === true,
44
44
  };
45
45
  },
46
46
  contentVisibility() {
47
- return this.$slots['content'] && this.value === true
47
+ return 'content' in this.$slots && this.value === true;
48
48
  }
49
49
  },
50
50
  };
@@ -0,0 +1,37 @@
1
+ import MgIconBadge from './IconBadge.vue';
2
+
3
+ // More on default export: https://storybook.js.org/docs/vue/writing-stories/introduction#default-export
4
+ export default {
5
+ title: 'Icon/Badge',
6
+ component: MgIconBadge,
7
+ // More on argTypes: https://storybook.js.org/docs/vue/api/argtypes
8
+ argTypes: {
9
+ level: {
10
+ control: { type: 'select' },
11
+ options: ['normal', 'club'],
12
+ defaultValue: 'normal'
13
+ },
14
+ },
15
+ };
16
+
17
+ // More on component templates: https://storybook.js.org/docs/vue/writing-stories/introduction#using-args
18
+ const Template = (args, { argTypes }) => ({
19
+ props: Object.keys(argTypes),
20
+ components: { MgIconBadge },
21
+ template: `<mg-icon-badge v-bind="$props"></mg-icon-badge>`,
22
+ });
23
+
24
+ export const Default = Template.bind({});
25
+ // More on args: https://storybook.js.org/docs/vue/writing-stories/args
26
+ Default.args = {
27
+ icon: 'message',
28
+ level: 'normal',
29
+ };
30
+
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
+
@@ -0,0 +1,70 @@
1
+ <template>
2
+ <div
3
+ class="d-inline-flex rounded-circle align-items-center justify-content-center"
4
+ v-bind:class="classes"
5
+ >
6
+ <svgicon
7
+ :name="icon"
8
+ ></svgicon>
9
+ </div>
10
+ </template>
11
+
12
+ <script>
13
+ export default {
14
+ name: 'mg-icon-badge',
15
+
16
+ props: {
17
+ icon: {
18
+ type: String
19
+ },
20
+ level: {
21
+ type: String,
22
+ default: 'normal',
23
+ validator: function (value) {
24
+ return ['normal', 'club'].indexOf(value) !== -1;
25
+ },
26
+ }
27
+ },
28
+
29
+ computed: {
30
+ classes() {
31
+ return {
32
+ 'mg-icon-badge': true,
33
+ 'mg-icon-badge--club': this.level === 'club',
34
+ 'mg-icon-badge--normal': this.level === 'normal',
35
+ };
36
+ },
37
+ },
38
+ };
39
+ </script>
40
+
41
+ <style lang="scss">
42
+ @import '../../../assets/palette';
43
+
44
+ .mg-icon-badge {
45
+ height: 2rem;
46
+ min-width: 2rem;
47
+ width: 2rem;
48
+
49
+ svg {
50
+ height: 1rem;
51
+ width: 1rem;
52
+ }
53
+
54
+ &--normal {
55
+ background-color: white;
56
+
57
+ svg {
58
+ fill: map-get($palette, 'brand');
59
+ }
60
+ }
61
+
62
+ &--club {
63
+ background-color: map-get($palette, 'expertClub');
64
+
65
+ svg {
66
+ fill: white;
67
+ }
68
+ }
69
+ }
70
+ </style>
@@ -8,9 +8,14 @@ export default {
8
8
  argTypes: {
9
9
  size: {
10
10
  control: { type: 'select' },
11
- options: ['large', 'normal'],
11
+ options: ['huge', 'large', 'normal', 'small', 'x-small'],
12
12
  defaultValue: 'normal'
13
13
  },
14
+ liveBadge: {
15
+ control: { type: 'select' },
16
+ options: [true, false],
17
+ defaultValue: false
18
+ },
14
19
  online: {
15
20
  control: { type: 'select' },
16
21
  options: [true, false],
@@ -43,12 +48,13 @@ export const Large = Template.bind({});
43
48
  // More on args: https://storybook.js.org/docs/vue/writing-stories/args
44
49
  Large.args = {
45
50
  name: 'VdF',
46
- size: 'large',
51
+ size: 'large'
47
52
  };
48
53
 
49
54
  export const Online = Template.bind({});
50
55
  // More on args: https://storybook.js.org/docs/vue/writing-stories/args
51
56
  Online.args = {
52
57
  online: true,
53
- name: 'VdF'
58
+ name: 'VdF',
59
+ liveBadge: true
54
60
  };
@@ -20,13 +20,14 @@
20
20
  v-bind:style="{ backgroundImage: 'url(' + imageUrl + ')' }"
21
21
  ></div>
22
22
  <!-- end of PROFILE IMAGE LAYER -->
23
- <!-- ONLINE BADGE -->
23
+ <!-- LIVE BADGE -->
24
24
  <div
25
+ v-if="liveBadge"
25
26
  class="mg-live-badge position-absolute w-100"
26
27
  >
27
28
  <div class="w-100"></div>
28
29
  </div>
29
- <!-- end of ONLINE BADGE -->
30
+ <!-- end of LIVE BADGE -->
30
31
  </div>
31
32
  </template>
32
33
 
@@ -45,9 +46,13 @@ export default {
45
46
  type: String,
46
47
  default: 'normal',
47
48
  validator: function (value) {
48
- return ['large', 'normal'].indexOf(value) !== -1;
49
+ return ['huge', 'large', 'normal', 'small', 'x-small'].indexOf(value) !== -1;
49
50
  },
50
51
  },
52
+ liveBadge: {
53
+ type: Boolean,
54
+ default: true
55
+ },
51
56
  online: {
52
57
  type: Boolean,
53
58
  default: false
@@ -58,15 +63,15 @@ export default {
58
63
  classes() {
59
64
  return {
60
65
  'mg-profile-image': true,
66
+ 'mg-profile-image--x-small': this.size === 'x-small',
67
+ 'mg-profile-image--small': this.size === 'small',
61
68
  'mg-profile-image--normal': this.size === 'normal',
62
69
  'mg-profile-image--large': this.size === 'large',
70
+ 'mg-profile-image--huge': this.size === 'huge',
63
71
  'mg-profile-image--online': this.online === true,
64
72
  'mg-profile-image--offline': this.online === false,
65
73
  };
66
74
  },
67
- acronym() {
68
- return '';
69
- }
70
75
  },
71
76
  };
72
77
  </script>
@@ -76,21 +81,45 @@ export default {
76
81
 
77
82
  .mg-profile-image {
78
83
  border-radius: 50%;
84
+ display: inline-flex;
79
85
  font-family: 'Ubuntu', sans-serif;
80
86
  font-weight: 600;
81
87
 
88
+ &--x-small {
89
+ height: 2rem;
90
+ min-width: 2rem;
91
+ font-size: 0.6875rem;
92
+ width: 2rem;
93
+ }
94
+
95
+ &--small {
96
+ height: 2.5rem;
97
+ min-width: 2.5rem;
98
+ font-size: 0.8125rem;
99
+ width: 2.5rem;
100
+ }
101
+
82
102
  &--normal {
83
103
  height: 3rem;
104
+ min-width: 3rem;
84
105
  font-size: 1.125rem;
85
106
  width: 3rem;
86
107
  }
87
108
 
88
109
  &--large {
89
110
  height: 5rem;
111
+ min-width: 5rem;
90
112
  font-size: 2rem;
91
113
  width: 5rem;
92
114
  }
93
115
 
116
+ &--huge {
117
+ height: 6.25rem;
118
+ min-width: 6.25rem;
119
+ font-size: 2.5rem;
120
+ width: 6.25rem;
121
+ }
122
+
94
123
  .mg-acronym {
95
124
  background-color: #5770bc;
96
125
  border-radius: 50%;
@@ -0,0 +1,4 @@
1
+ <svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M13.3334 1.33333H2.66671C1.93137 1.33333 1.33337 1.93133 1.33337 2.66666V10.6667C1.33337 11.402 1.93137 12 2.66671 12H4.66671V14.5113L8.85137 12H13.3334C14.0687 12 14.6667 11.402 14.6667 10.6667V2.66666C14.6667 1.93133 14.0687 1.33333 13.3334 1.33333ZM13.3334 10.6667H8.48204L6.00004 12.1553V10.6667H2.66671V2.66666H13.3334V10.6667Z" fill="#D81159"/>
3
+ <path d="M4.66663 4.66667H11.3333V6.00001H4.66663V4.66667ZM4.66663 7.33334H9.33329V8.66667H4.66663V7.33334Z" fill="#D81159"/>
4
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M4.00004 0.666667C4.00004 0.489856 4.07028 0.320286 4.1953 0.195262C4.32033 0.0702379 4.4899 0 4.66671 0L10 0C10.1769 0 10.3464 0.0702379 10.4714 0.195262C10.5965 0.320286 10.6667 0.489856 10.6667 0.666667C10.6667 0.843478 10.5965 1.01305 10.4714 1.13807C10.3464 1.2631 10.1769 1.33333 10 1.33333H4.66671C4.4899 1.33333 4.32033 1.2631 4.1953 1.13807C4.07028 1.01305 4.00004 0.843478 4.00004 0.666667V0.666667ZM6.66671 10C6.66671 10.1768 6.73695 10.3464 6.86197 10.4714C6.98699 10.5964 7.15656 10.6667 7.33337 10.6667C7.51019 10.6667 7.67975 10.5964 7.80478 10.4714C7.9298 10.3464 8.00004 10.1768 8.00004 10V6C8.00004 5.82319 7.9298 5.65362 7.80478 5.5286C7.67975 5.40357 7.51019 5.33333 7.33337 5.33333C7.15656 5.33333 6.98699 5.40357 6.86197 5.5286C6.73695 5.65362 6.66671 5.82319 6.66671 6V10ZM7.33337 2.66667C6.54544 2.66667 5.76523 2.82186 5.03727 3.12339C4.30932 3.42492 3.64788 3.86687 3.09073 4.42403C2.53358 4.98118 2.09163 5.64261 1.7901 6.37057C1.48857 7.09852 1.33337 7.87874 1.33337 8.66667C1.33337 9.4546 1.48857 10.2348 1.7901 10.9628C2.09163 11.6907 2.53358 12.3522 3.09073 12.9093C3.64788 13.4665 4.30932 13.9084 5.03727 14.2099C5.76523 14.5115 6.54544 14.6667 7.33337 14.6667C8.92467 14.6667 10.4508 14.0345 11.576 12.9093C12.7012 11.7841 13.3334 10.258 13.3334 8.66667C13.3334 7.07537 12.7012 5.54924 11.576 4.42403C10.4508 3.29881 8.92467 2.66667 7.33337 2.66667V2.66667ZM2.66671 8.66667C2.66671 8.05383 2.78741 7.447 3.02194 6.88081C3.25646 6.31462 3.6002 5.80018 4.03354 5.36684C4.46688 4.9335 4.98133 4.58975 5.54752 4.35523C6.1137 4.12071 6.72054 4 7.33337 4C7.94621 4 8.55304 4.12071 9.11923 4.35523C9.68542 4.58975 10.1999 4.9335 10.6332 5.36684C11.0665 5.80018 11.4103 6.31462 11.6448 6.88081C11.8793 7.447 12 8.05383 12 8.66667C12 9.90434 11.5084 11.0913 10.6332 11.9665C9.75804 12.8417 8.57105 13.3333 7.33337 13.3333C6.0957 13.3333 4.90871 12.8417 4.03354 11.9665C3.15837 11.0913 2.66671 9.90434 2.66671 8.66667ZM13.5307 5.13733C13.5923 5.20091 13.6659 5.25159 13.7473 5.28641C13.8287 5.32123 13.9162 5.33949 14.0047 5.34014C14.0932 5.34078 14.181 5.32378 14.2629 5.29015C14.3448 5.25651 14.4191 5.20691 14.4816 5.14422C14.5441 5.08154 14.5935 5.00704 14.6269 4.92507C14.6603 4.84309 14.6771 4.75529 14.6762 4.66677C14.6753 4.57825 14.6568 4.4908 14.6217 4.40952C14.5867 4.32823 14.5358 4.25474 14.472 4.19333L13.136 2.86267C13.0745 2.79909 13.0008 2.74841 12.9194 2.71359C12.838 2.67877 12.7505 2.66051 12.662 2.65986C12.5735 2.65922 12.4858 2.67622 12.4039 2.70985C12.322 2.74349 12.2476 2.79309 12.1851 2.85578C12.1226 2.91846 12.0732 2.99296 12.0398 3.07493C12.0064 3.15691 11.9897 3.24471 11.9906 3.33323C11.9915 3.42175 12.01 3.5092 12.045 3.59048C12.0801 3.67177 12.131 3.74526 12.1947 3.80667L13.5307 5.13733V5.13733Z" fill="#D81159"/>
3
+ </svg>