@magicgol/polyjuice 0.2.1 → 0.4.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magicgol/polyjuice",
3
- "version": "0.2.1",
3
+ "version": "0.4.0",
4
4
  "scripts": {
5
5
  "serve": "vue-cli-service serve",
6
6
  "build": "vue-cli-service build",
@@ -1,3 +1,10 @@
1
1
  $palette: (
2
2
  'brand': #d81159,
3
+ 'warning': #ff614c,
4
+ 'success': #349B50,
5
+ 'info': #004781,
6
+ 'goalkeeper': #ffc700,
7
+ 'defender': #3de000,
8
+ 'midfielder': #116dd8,
9
+ 'forward': #f30026,
3
10
  );
@@ -0,0 +1,35 @@
1
+ import MgVCard from './VCard.vue';
2
+
3
+ // More on default export: https://storybook.js.org/docs/vue/writing-stories/introduction#default-export
4
+ export default {
5
+ title: 'Card/VCard',
6
+ component: MgVCard,
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, { argTypes }) => ({
26
+ props: Object.keys(argTypes),
27
+ components: { MgVCard },
28
+ template: `<mg-v-card @click="$emit('click')" v-bind="$props"><template v-if="${'default' in args}" v-slot>${args.default}</template></mg-v-card>`,
29
+ });
30
+
31
+ export const Default = Template.bind({});
32
+ // More on args: https://storybook.js.org/docs/vue/writing-stories/args
33
+ Default.args = {
34
+ default: '<p>This is a vertical card.</p><div>What do you think about?</div>'
35
+ };
@@ -0,0 +1,37 @@
1
+ <template>
2
+ <div
3
+ class="p-3 bg-white rounded"
4
+ :class="classes"
5
+ @click="onClick"
6
+ >
7
+ <slot></slot>
8
+ </div>
9
+ </template>
10
+
11
+ <script>
12
+ export default {
13
+ name: 'mg-v-card',
14
+
15
+ computed: {
16
+ classes() {
17
+ return {
18
+ 'mg-v-card': true,
19
+ };
20
+ }
21
+ },
22
+
23
+ methods: {
24
+ onClick() {
25
+ this.$emit('click');
26
+ },
27
+ },
28
+ };
29
+ </script>
30
+
31
+ <style lang="scss">
32
+ @import '../../../assets/palette';
33
+
34
+ .mg-v-card {
35
+ box-shadow: 0 8px 22px 0 rgba(0, 0, 0, 0.3);
36
+ }
37
+ </style>
@@ -35,7 +35,7 @@ export default {
35
35
  const Template = (args, { argTypes }) => ({
36
36
  props: Object.keys(argTypes),
37
37
  components: { MgPrimaryButton },
38
- template: `<mg-primary-button @onClick="onClick" v-bind="$props"><template v-if="${'default' in args}" v-slot>${args.default}</template></mg-primary-button>`,
38
+ template: `<mg-primary-button @click="$emit('click')" v-bind="$props"><template v-if="${'default' in args}" v-slot>${args.default}</template></mg-primary-button>`,
39
39
  });
40
40
 
41
41
  export const Default = Template.bind({});
@@ -46,7 +46,7 @@ export default {
46
46
 
47
47
  methods: {
48
48
  onClick() {
49
- this.$emit('onClick');
49
+ this.$emit('click');
50
50
  },
51
51
  },
52
52
  };
@@ -25,7 +25,7 @@ export default {
25
25
  const Template = (args, { argTypes }) => ({
26
26
  props: Object.keys(argTypes),
27
27
  components: { MgSecondaryButton },
28
- template: `<mg-secondary-button @onClick="onClick" v-bind="$props"><template v-if="${'default' in args}" v-slot>${args.default}</template></mg-secondary-button>`,
28
+ template: `<mg-secondary-button @click="$emit('click')" v-bind="$props"><template v-if="${'default' in args}" v-slot>${args.default}</template></mg-secondary-button>`,
29
29
  });
30
30
 
31
31
  export const Default = Template.bind({});
@@ -29,7 +29,7 @@ export default {
29
29
 
30
30
  methods: {
31
31
  onClick() {
32
- this.$emit('onClick');
32
+ this.$emit('click');
33
33
  },
34
34
  },
35
35
  };
@@ -25,7 +25,7 @@ export default {
25
25
  const Template = (args, { argTypes }) => ({
26
26
  props: Object.keys(argTypes),
27
27
  components: { MgTertiaryButton },
28
- template: `<mg-tertiary-button @onClick="onClick" v-bind="$props"><template v-if="${'default' in args}" v-slot>${args.default}</template></mg-tertiary-button>`,
28
+ template: `<mg-tertiary-button @click="$emit('click')" v-bind="$props"><template v-if="${'default' in args}" v-slot>${args.default}</template></mg-tertiary-button>`,
29
29
  });
30
30
 
31
31
  export const Default = Template.bind({});
@@ -29,7 +29,7 @@ export default {
29
29
 
30
30
  methods: {
31
31
  onClick() {
32
- this.$emit('onClick');
32
+ this.$emit('click');
33
33
  },
34
34
  },
35
35
  };
@@ -0,0 +1,21 @@
1
+ import {ColorItem, ColorPalette, Meta} from '@storybook/addon-docs';
2
+
3
+ <Meta title="Colors/Alert" />
4
+
5
+ <ColorPalette>
6
+ <ColorItem
7
+ title="Warning"
8
+ subtitle="Used for error messages"
9
+ colors={{Persimmon: '#ff614c'}}
10
+ />
11
+ <ColorItem
12
+ title="Success"
13
+ subtitle="Used for success messages"
14
+ colors={{'Sea Green': '#349B50'}}
15
+ />
16
+ <ColorItem
17
+ title="Info"
18
+ subtitle="Used for info messages"
19
+ colors={{'Congress Blue': '#004781'}}
20
+ />
21
+ </ColorPalette>
@@ -0,0 +1,10 @@
1
+ import {ColorItem, ColorPalette, Meta} from '@storybook/addon-docs';
2
+
3
+ <Meta title="Colors/Brand" />
4
+
5
+ <ColorPalette>
6
+ <ColorItem
7
+ title="Brand Color"
8
+ colors={{Razzmatazz: '#d81159'}}
9
+ />
10
+ </ColorPalette>
@@ -0,0 +1,22 @@
1
+ import {ColorItem, ColorPalette, Meta} from '@storybook/addon-docs';
2
+
3
+ <Meta title="Colors/Footballer" />
4
+
5
+ <ColorPalette>
6
+ <ColorItem
7
+ title="Goalkeeper"
8
+ colors={{Supernova: '#ffc700'}}
9
+ />
10
+ <ColorItem
11
+ title="Defender"
12
+ colors={{Harlequin: '#3de000'}}
13
+ />
14
+ <ColorItem
15
+ title="Midfielder"
16
+ colors={{Denim: '#116dd8'}}
17
+ />
18
+ <ColorItem
19
+ title="Forward"
20
+ colors={{'Torch Red': '#f30026'}}
21
+ />
22
+ </ColorPalette>
package/src/main.js CHANGED
@@ -6,3 +6,8 @@ Vue.config.productionTip = false
6
6
  new Vue({
7
7
  render: h => h(App),
8
8
  }).$mount('#app')
9
+
10
+ export MgVCard from './components/card/vertical-card/VCard';
11
+ export MgPrimaryButton from './components/form/primary-button/PrimaryButton';
12
+ export MgSecondaryButton from './components/form/secondary-button/SecondaryButton';
13
+ export MgTertiaryButton from './components/form/tertiary-button/TertiaryButton';