@magicgol/polyjuice 0.23.0 → 0.24.1

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magicgol/polyjuice",
3
- "version": "0.23.0",
3
+ "version": "0.24.1",
4
4
  "scripts": {
5
5
  "serve": "vue-cli-service serve",
6
6
  "build": "vue-cli-service build",
@@ -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({});
@@ -43,3 +60,13 @@ Disabled.args = {
43
60
  firstname: 'Paulo',
44
61
  lastname: 'Dybala',
45
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
- <!-- LAST NAME ONLY -->
12
- <span
13
- v-if="hasOnlyLastname"
14
- class="mg-h-footballer-strong"
15
- >{{ lastname }}</span>
16
- <!-- end of LAST NAME ONLY -->
17
- <!-- FULL NAME -->
18
- <span v-else-if="hasName">
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
- <span v-else>&ndash;</span>
22
+ <span v-else>&ndash;</span>
23
+ </div>
24
+ <div class="mg-h-footballer-subtext text-uppercase"><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 :role="role"></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>
@@ -59,6 +65,13 @@ export default {
59
65
  type: String,
60
66
  default: null
61
67
  },
68
+ size: {
69
+ type: String,
70
+ default: 'normal',
71
+ validator: function (value) {
72
+ return ['normal', 'large'].indexOf(value) !== -1;
73
+ },
74
+ },
62
75
  },
63
76
 
64
77
  computed: {
@@ -66,6 +79,8 @@ export default {
66
79
  return {
67
80
  'mg-h-footballer': true,
68
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',
69
84
  };
70
85
  },
71
86
  hasOnlyLastname() {
@@ -89,20 +104,33 @@ export default {
89
104
  </script>
90
105
 
91
106
  <style lang="scss">
92
- @import '../../../assets/palette';
107
+ @import '../../../assets/palette';
93
108
 
94
- .mg-h-footballer {
95
- color: #343434;
96
- font-family: 'Ubuntu', sans-serif;
97
- font-size: 0.75rem;
109
+ .mg-h-footballer {
110
+ color: map-get($palette, 'text');
111
+ font-family: 'Ubuntu', sans-serif;
98
112
 
99
- &-strong {
100
- font-weight: 500;
101
- }
113
+ &-strong {
114
+ font-weight: 500;
115
+ }
102
116
 
103
- &--disabled {
104
- opacity: 0.6;
105
- cursor: not-allowed !important;
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
+ }
106
135
  }
107
- }
108
136
  </style>
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div
3
- class="d-inline-flex text-center text-white rounded-circle justify-content-center align-items-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: 600;
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.5rem;
73
- width: 1.5rem;
74
- min-width: 1.5rem;
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,32 @@
1
+ <template>
2
+ <div
3
+ class="d-inline-flex rounded-circle align-items-center justify-content-center text-white"
4
+ :class="classes"
5
+ ><slot></slot></div>
6
+ </template>
7
+
8
+ <script>
9
+ export default {
10
+ name: 'mg-label-badge',
11
+
12
+ computed: {
13
+ classes() {
14
+ return {
15
+ 'mg-label-badge': true,
16
+ };
17
+ },
18
+ },
19
+ };
20
+ </script>
21
+
22
+ <style lang="scss">
23
+ @import '../../../assets/palette';
24
+
25
+ .mg-label-badge {
26
+ background-color: #84485E;
27
+ font-family: 'Ubuntu', sans-serif;
28
+ font-weight: 500;
29
+ height: 2rem;
30
+ width: 2rem;
31
+ }
32
+ </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: #343434;
73
+ color: map-get($palette, 'text');
72
74
  }
73
75
 
74
76
  &-dark {
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div
3
- class="text-uppercase pb-2 px-3"
3
+ class="text-uppercase pb-2 px-2"
4
4
  :class="classes"
5
5
  ><slot></slot></div>
6
6
  </template>
@@ -17,8 +17,10 @@ export default {
17
17
  </script>
18
18
 
19
19
  <style lang="scss">
20
+ @import '../../../assets/palette';
21
+
20
22
  .mg-h1 {
21
- color: #343434;
23
+ color: map-get($palette, 'text');
22
24
  font-family: 'Ubuntu', sans-serif;
23
25
  font-size: 1.25rem;
24
26
  font-weight: 500;
@@ -17,8 +17,10 @@ export default {
17
17
  </script>
18
18
 
19
19
  <style lang="scss">
20
+ @import '../../../assets/palette';
21
+
20
22
  .mg-h2 {
21
- color: #343434;
23
+ color: map-get($palette, 'text');
22
24
  font-family: 'Ubuntu', sans-serif;
23
25
  font-size: 1.125rem;
24
26
  font-weight: 500;
@@ -17,8 +17,10 @@ export default {
17
17
  </script>
18
18
 
19
19
  <style lang="scss">
20
+ @import '../../../assets/palette';
21
+
20
22
  .mg-h3 {
21
- color: #343434;
23
+ color: map-get($palette, 'text');
22
24
  font-family: 'Ubuntu', sans-serif;
23
25
  font-size: 1rem;
24
26
  font-weight: 500;
@@ -17,8 +17,10 @@ export default {
17
17
  </script>
18
18
 
19
19
  <style lang="scss">
20
+ @import '../../../assets/palette';
21
+
20
22
  .mg-h4 {
21
- color: #343434;
23
+ color: map-get($palette, 'text');
22
24
  font-family: 'Ubuntu', sans-serif;
23
25
  font-size: 1rem;
24
26
  font-weight: 400;
@@ -31,7 +31,7 @@ export default {
31
31
  @import '../../../assets/palette';
32
32
 
33
33
  .mg-h5 {
34
- color: #343434;
34
+ color: map-get($palette, 'text');
35
35
  font-family: 'Ubuntu', sans-serif;
36
36
  font-size: 0.875rem;
37
37
  font-weight: 700;
@@ -13,7 +13,7 @@ import {ColorItem, ColorPalette, Meta} from '@storybook/addon-docs';
13
13
  />
14
14
  <ColorItem
15
15
  title="Coin"
16
- colors={{'Goldenrod': '#ffcf73'}}
16
+ colors={{'Golden Rod': '#ffcf73'}}
17
17
  />
18
18
  <ColorItem
19
19
  title="Expert Club Color"
@@ -5,7 +5,7 @@ import {ColorItem, ColorPalette, Meta} from '@storybook/addon-docs';
5
5
  <ColorPalette>
6
6
  <ColorItem
7
7
  title="Goalkeeper"
8
- colors={{'Goldenrod': '#fcd777'}}
8
+ colors={{'Golden Rod': '#fcd777'}}
9
9
  />
10
10
  <ColorItem
11
11
  title="Defender"