@magicgol/polyjuice 0.30.0 → 0.31.0

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.30.0",
3
+ "version": "0.31.0",
4
4
  "scripts": {
5
5
  "serve": "vue-cli-service serve",
6
6
  "build": "vue-cli-service build",
@@ -1,5 +1,4 @@
1
1
  import MgHCard from './HCard.vue';
2
- import SvgIcon from "vue-svgicon";
3
2
 
4
3
  // More on default export: https://storybook.js.org/docs/vue/writing-stories/introduction#default-export
5
4
  export default {
@@ -37,7 +36,7 @@ export default {
37
36
  // More on component templates: https://storybook.js.org/docs/vue/writing-stories/introduction#using-args
38
37
  const Template = (args, { argTypes }) => ({
39
38
  props: Object.keys(argTypes),
40
- components: { MgHCard, SvgIcon },
39
+ components: { MgHCard },
41
40
  template: `<mg-h-card @click="$emit('click')" v-bind="$props">
42
41
  <template v-if="${'default' in args}" v-slot>${args.default}</template>
43
42
  <template v-if="${'actions' in args}" v-slot:actions>${args.actions}</template>
@@ -47,12 +46,12 @@ const Template = (args, { argTypes }) => ({
47
46
  export const Default = Template.bind({});
48
47
  // More on args: https://storybook.js.org/docs/vue/writing-stories/args
49
48
  Default.args = {
50
- default: '<div>This is a vertical card.</div><div>What do you think about?</div>'
49
+ default: '<div>This is a vertical card.</div><div>What do you think about?</div>',
51
50
  };
52
51
 
53
52
  export const Actions = Template.bind({});
54
53
  // More on args: https://storybook.js.org/docs/vue/writing-stories/args
55
54
  Actions.args = {
56
55
  default: '<div>This is a vertical card.</div><div>What do you think about?</div>',
57
- actions: '<div>+</div>'
56
+ actions: '<div>+</div>',
58
57
  };
@@ -25,7 +25,7 @@
25
25
  <div
26
26
  v-if="slotVisibility"
27
27
  class="mg-h-footballer-subtext text-uppercase"
28
- ><span v-if="!isLarge" class="mx-2">-</span><slot></slot></div>
28
+ ><span v-if="!isLarge" class="mx-1">-</span><slot></slot></div>
29
29
  </div>
30
30
  <!-- end of FOOTBALLER NAME -->
31
31
  <!-- ROLE BADGE -->
@@ -132,6 +132,7 @@ export default {
132
132
  }
133
133
 
134
134
  &-subtext {
135
+ color: #979797;
135
136
  font-size: 0.875rem;
136
137
  }
137
138
 
@@ -0,0 +1,75 @@
1
+ import MgHFootballerCard from './HFootballerCard.vue';
2
+
3
+ // More on default export: https://storybook.js.org/docs/vue/writing-stories/introduction#default-export
4
+ export default {
5
+ title: 'Footballer/HFootballerCard',
6
+ component: MgHFootballerCard,
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
+ actions: {
22
+ description: "The actions Vue slot",
23
+ control: {
24
+ type: 'text',
25
+ },
26
+ table: {
27
+ category: 'Slots',
28
+ type: {
29
+ summary: 'html',
30
+ },
31
+ }
32
+ }
33
+ },
34
+ };
35
+
36
+ // More on component templates: https://storybook.js.org/docs/vue/writing-stories/introduction#using-args
37
+ const Template = (args, { argTypes }) => ({
38
+ props: Object.keys(argTypes),
39
+ components: { MgHFootballerCard },
40
+ template: `<mg-h-footballer-card @click="$emit('click')" v-bind="$props">
41
+ <template v-if="${'default' in args}" v-slot>${args.default}</template>
42
+ <template v-if="${'actions' in args}" v-slot:actions>${args.actions}</template>
43
+ </mg-h-footballer-card>`,
44
+ });
45
+
46
+ export const Default = Template.bind({});
47
+ // More on args: https://storybook.js.org/docs/vue/writing-stories/args
48
+ Default.args = {
49
+ firstname: 'P',
50
+ lastname: 'Dybala',
51
+ role: 'A',
52
+ default: '<span><b>MIL</b></span> - <span>JUV</span>',
53
+ pressed: false
54
+ };
55
+
56
+ export const Actions = Template.bind({});
57
+ // More on args: https://storybook.js.org/docs/vue/writing-stories/args
58
+ Actions.args = {
59
+ firstname: 'P',
60
+ lastname: 'Dybala',
61
+ role: 'A',
62
+ default: '<span><b>MIL</b></span> - <span>JUV</span>',
63
+ actions: '<div>+</div>',
64
+ pressed: false
65
+ };
66
+
67
+ export const Pressed = Template.bind({});
68
+ // More on args: https://storybook.js.org/docs/vue/writing-stories/args
69
+ Pressed.args = {
70
+ firstname: 'P',
71
+ lastname: 'Dybala',
72
+ role: 'A',
73
+ default: '<span><b>MIL</b></span> - <span>JUV</span>',
74
+ pressed: true
75
+ };
@@ -0,0 +1,74 @@
1
+ <template>
2
+ <mg-h-card
3
+ :class="classes"
4
+ >
5
+ <template v-slot:default>
6
+ <mg-h-footballer
7
+ size="large"
8
+ :firstname="firstname"
9
+ :lastname="lastname"
10
+ :role="role"
11
+ ><slot></slot></mg-h-footballer>
12
+ </template>
13
+ <template v-slot:actions><slot name="actions"></slot></template>
14
+ </mg-h-card>
15
+ </template>
16
+
17
+ <script>
18
+ import MgHFootballer from "../horizontal-footballer/HFootballer";
19
+ import MgHCard from "../../card/horizontal-card/HCard";
20
+
21
+ export default {
22
+ name: 'mg-h-footballer-card',
23
+
24
+ props: {
25
+ firstname: {
26
+ type: String,
27
+ default: null
28
+ },
29
+ lastname: {
30
+ type: String,
31
+ default: null
32
+ },
33
+ role: {
34
+ type: String,
35
+ default: null,
36
+ validator: function (value) {
37
+ return ['P', 'D', 'C', 'A'].indexOf(value) !== -1;
38
+ },
39
+ },
40
+ pressed: {
41
+ props: {
42
+ type: Boolean,
43
+ default: false
44
+ }
45
+ }
46
+ },
47
+
48
+ computed: {
49
+ classes() {
50
+ return {
51
+ 'mg-h-footballer-card': true,
52
+ 'mg-h-footballer-card--pressed': this.pressed === true,
53
+ };
54
+ },
55
+ actionsSlotVisibility() {
56
+ return 'actions' in this.$slots && !!this.$slots.actions;
57
+ }
58
+ },
59
+
60
+ components: {
61
+ MgHFootballer,
62
+ MgHCard,
63
+ },
64
+ };
65
+ </script>
66
+
67
+ <style lang="scss">
68
+ .mg-h-footballer-card {
69
+ &--pressed {
70
+ background: #dAf0d9 !important;
71
+ box-shadow: inset 0 4px 9px rgba(0, 0, 0, 0.1) !important;
72
+ }
73
+ }
74
+ </style>