@magicgol/polyjuice 0.11.0 → 0.12.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
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
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,600" rel="stylesheet" />
4
+ <link href="https://fonts.googleapis.com/css?family=Ubuntu:400,500,600,700" rel="stylesheet" />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magicgol/polyjuice",
3
- "version": "0.11.0",
3
+ "version": "0.12.0",
4
4
  "scripts": {
5
5
  "serve": "vue-cli-service serve",
6
6
  "build": "vue-cli-service build",
@@ -17,6 +17,18 @@ export default {
17
17
  summary: 'html',
18
18
  },
19
19
  }
20
+ },
21
+ footer: {
22
+ description: "The footer content goes here",
23
+ control: {
24
+ type: 'text',
25
+ },
26
+ table: {
27
+ category: 'Slots',
28
+ type: {
29
+ summary: 'html',
30
+ },
31
+ }
20
32
  }
21
33
  },
22
34
  };
@@ -25,11 +37,21 @@ export default {
25
37
  const Template = (args, { argTypes }) => ({
26
38
  props: Object.keys(argTypes),
27
39
  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>`,
40
+ template: `<mg-v-card @click="$emit('click')" v-bind="$props">
41
+ <template v-if="${'default' in args}" v-slot>${args.default}</template>
42
+ <template v-if="${'footer' in args}" v-slot:footer>${args.footer}</template>
43
+ </mg-v-card>`,
29
44
  });
30
45
 
31
46
  export const Default = Template.bind({});
32
47
  // More on args: https://storybook.js.org/docs/vue/writing-stories/args
33
48
  Default.args = {
34
- default: '<p>This is a vertical card.</p><div>What do you think about?</div>'
49
+ default: '<div>This is a vertical card.</div><div>What do you think about?</div>'
50
+ };
51
+
52
+ export const Footer = Template.bind({});
53
+ // More on args: https://storybook.js.org/docs/vue/writing-stories/args
54
+ Footer.args = {
55
+ default: '<div>This is a vertical card.</div><div>What do you think about?</div>',
56
+ footer: '<div>The footer content goes here</div>'
35
57
  };
@@ -1,10 +1,14 @@
1
1
  <template>
2
2
  <div
3
- class="p-3 bg-white rounded"
3
+ class="rounded overflow-hidden"
4
4
  :class="classes"
5
5
  @click="onClick"
6
6
  >
7
- <slot></slot>
7
+ <div class="p-3 bg-white"><slot></slot></div>
8
+ <div
9
+ class="mg-footer p-3"
10
+ v-if="footerVisibility"
11
+ ><slot name="footer"></slot></div>
8
12
  </div>
9
13
  </template>
10
14
 
@@ -17,6 +21,9 @@ export default {
17
21
  return {
18
22
  'mg-v-card': true,
19
23
  };
24
+ },
25
+ footerVisibility() {
26
+ return this.$slots['footer']
20
27
  }
21
28
  },
22
29
 
@@ -33,5 +40,9 @@ export default {
33
40
 
34
41
  .mg-v-card {
35
42
  box-shadow: 0 8px 22px 0 rgba(0, 0, 0, 0.3);
43
+
44
+ .mg-footer {
45
+ background-color: rgba(map-get($palette, 'brand'), 0.04);
46
+ }
36
47
  }
37
48
  </style>
@@ -0,0 +1,20 @@
1
+ import MgClubPlate from './ClubPlate.vue';
2
+
3
+ // More on default export: https://storybook.js.org/docs/vue/writing-stories/introduction#default-export
4
+ export default {
5
+ title: 'Club/Plate',
6
+ component: MgClubPlate,
7
+ };
8
+
9
+ // More on component templates: https://storybook.js.org/docs/vue/writing-stories/introduction#using-args
10
+ const Template = (args, { argTypes }) => ({
11
+ props: Object.keys(argTypes),
12
+ components: { MgClubPlate },
13
+ template: `<mg-club-plate v-bind="$props"></mg-club-plate>`,
14
+ });
15
+
16
+ export const Default = Template.bind({});
17
+ // More on args: https://storybook.js.org/docs/vue/writing-stories/args
18
+ Default.args = {
19
+ achievement: '2.2k'
20
+ };
@@ -0,0 +1,54 @@
1
+ <template>
2
+ <div
3
+ class="d-inline-flex flex-column text-center"
4
+ :class="classes"
5
+ >
6
+ <svgicon
7
+ name="star-c"
8
+ ></svgicon>
9
+ <div class="mt-1">{{ achievement }}</div>
10
+ </div>
11
+ </template>
12
+
13
+ <script>
14
+ export default {
15
+ name: 'mg-club-plate',
16
+
17
+ props: {
18
+ achievement: {
19
+ type: String,
20
+ default: null,
21
+ },
22
+ },
23
+
24
+ computed: {
25
+ classes() {
26
+ return {
27
+ 'mg-club-plate': true,
28
+ };
29
+ }
30
+ },
31
+
32
+ methods: {
33
+ onClick() {
34
+ this.$emit('click');
35
+ },
36
+ },
37
+ };
38
+ </script>
39
+
40
+ <style lang="scss">
41
+ @import '../../../assets/palette';
42
+
43
+ .mg-club-plate {
44
+ color: map-get($palette, 'expertClub');
45
+ font-family: 'Ubuntu', sans-serif;
46
+ font-size: 0.75rem;
47
+ font-weight: 700;
48
+
49
+ svg {
50
+ fill: map-get($palette, 'expertClub');
51
+ height: 1.25rem;
52
+ }
53
+ }
54
+ </style>
@@ -65,6 +65,7 @@ export default {
65
65
  default: 'text'
66
66
  },
67
67
  value: {
68
+ type: [String, Number],
68
69
  default: null
69
70
  },
70
71
  min: {
@@ -80,9 +80,9 @@ export default {
80
80
  font-weight: 600;
81
81
 
82
82
  &--normal {
83
- height: 2.5rem;
84
- font-size: 1rem;
85
- width: 2.5rem;
83
+ height: 3rem;
84
+ font-size: 1.125rem;
85
+ width: 3rem;
86
86
  }
87
87
 
88
88
  &--large {
@@ -2,7 +2,7 @@ import MgHeadingOne from './HeadingOne.vue';
2
2
 
3
3
  // More on default export: https://storybook.js.org/docs/vue/writing-stories/introduction#default-export
4
4
  export default {
5
- title: 'Typography/H1/H1',
5
+ title: 'Typography/Heading/H1',
6
6
  component: MgHeadingOne,
7
7
  // More on argTypes: https://storybook.js.org/docs/vue/api/argtypes
8
8
  argTypes: {
@@ -0,0 +1,34 @@
1
+ import MgHeadingFour from './HeadingFour.vue';
2
+
3
+ // More on default export: https://storybook.js.org/docs/vue/writing-stories/introduction#default-export
4
+ export default {
5
+ title: 'Typography/Heading/H4',
6
+ component: MgHeadingFour,
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: { MgHeadingFour },
27
+ template: `<mg-heading-four><template v-if="${'default' in args}" v-slot>${args.default}</template></mg-heading-four>`,
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 four'
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-four',
8
+
9
+ computed: {
10
+ classes() {
11
+ return {
12
+ 'mg-h4': true,
13
+ };
14
+ }
15
+ },
16
+ };
17
+ </script>
18
+
19
+ <style lang="scss">
20
+ .mg-h4 {
21
+ font-family: 'Ubuntu', sans-serif;
22
+ font-size: 0.875rem;
23
+ font-weight: 700;
24
+ }
25
+ </style>
@@ -0,0 +1,34 @@
1
+ import MgHeadingSix from './HeadingSix.vue';
2
+
3
+ // More on default export: https://storybook.js.org/docs/vue/writing-stories/introduction#default-export
4
+ export default {
5
+ title: 'Typography/Heading/H6',
6
+ component: MgHeadingSix,
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: { MgHeadingSix },
27
+ template: `<mg-heading-six><template v-if="${'default' in args}" v-slot>${args.default}</template></mg-heading-six>`,
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 six'
34
+ };
@@ -0,0 +1,26 @@
1
+ <template>
2
+ <div v-bind:class="classes"><slot></slot></div>
3
+ </template>
4
+
5
+ <script>
6
+ export default {
7
+ name: 'mg-heading-five',
8
+
9
+ computed: {
10
+ classes() {
11
+ return {
12
+ 'mg-h6': true,
13
+ };
14
+ }
15
+ },
16
+ };
17
+ </script>
18
+
19
+ <style lang="scss">
20
+ .mg-h6 {
21
+ color: #666666;
22
+ font-family: 'Ubuntu', sans-serif;
23
+ font-size: 0.75rem;
24
+ font-weight: 400;
25
+ }
26
+ </style>
package/src/main.js CHANGED
@@ -17,27 +17,3 @@ Vue.config.productionTip = false;
17
17
  new Vue({
18
18
  render: h => h(App),
19
19
  }).$mount('#app')
20
-
21
- export MgHCard from './components/card/horizontal-card/HCard';
22
- export MgVCard from './components/card/vertical-card/VCard';
23
-
24
- export MgPrimaryClubButton from './components/club/button/primary-club-button/PrimaryClubButton';
25
- export MgSecondaryClubButton from './components/club/button/secondary-club-button/SecondaryClubButton';
26
-
27
- export MgPrimaryButton from './components/form/button/primary-button/PrimaryButton';
28
- export MgSecondaryButton from './components/form/button/secondary-button/SecondaryButton';
29
- export MgTertiaryButton from './components/form/button/tertiary-button/TertiaryButton';
30
- export MgToggleButton from './components/form/button/toggle-button/ToggleButton';
31
- export MgCheckbox from './components/form/checkbox/checkbox/Checkbox';
32
- export MgSwitch from './components/form/checkbox/switch/Switch';
33
-
34
- export MgProfileImage from './components/image/profile-image/ProfileImage';
35
-
36
- export MgMagicCoinButton from './components/magic-coin/button/MagicCoinButton';
37
- export MgCredits from './components/magic-coin/credits/Credits';
38
-
39
- export MgSoccerBallLoader from './components/loader/soccer-ball/SoccerBall';
40
-
41
- export MgTabButton from './components/navigation/tab-button/TabButton';
42
-
43
- export MgHeadingOne from './components/typography/h1/HeadingOne';