@magicgol/polyjuice 0.15.1 → 0.16.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.15.1",
3
+ "version": "0.16.0",
4
4
  "scripts": {
5
5
  "serve": "vue-cli-service serve",
6
6
  "build": "vue-cli-service build",
@@ -5,6 +5,7 @@ $palette: (
5
5
  'coin': #ffcf73,
6
6
  'expertClub': #075169,
7
7
  // ALERT
8
+ 'error': #ed4949,
8
9
  'warning': #ff614c,
9
10
  'success': #349B50,
10
11
  'info': #004781,
@@ -9,13 +9,15 @@
9
9
  </div>
10
10
  </div>
11
11
  <div class="p-4">
12
- <slot></slot>
12
+ <div class="px-2">
13
+ <slot></slot>
14
+ </div>
13
15
  </div>
14
16
  </div>
15
17
  </template>
16
18
 
17
19
  <script>
18
20
  export default {
19
- name: 'mg-filing-cabinet',
21
+ name: 'mg-filing-cabinet'
20
22
  };
21
23
  </script>
@@ -18,6 +18,11 @@ export default {
18
18
  },
19
19
  }
20
20
  },
21
+ theme: {
22
+ control: { type: 'select' },
23
+ options: [null, 'club'],
24
+ defaultValue: null
25
+ },
21
26
  footer: {
22
27
  description: "The footer content goes here",
23
28
  control: {
@@ -4,9 +4,9 @@
4
4
  :class="classes"
5
5
  @click="onClick"
6
6
  >
7
- <div class="p-3 bg-white"><slot></slot></div>
7
+ <div class="mg-v-card-content p-3"><slot></slot></div>
8
8
  <div
9
- class="mg-footer p-3"
9
+ class="mg-v-card-footer p-3"
10
10
  v-if="footerVisibility"
11
11
  ><slot name="footer"></slot></div>
12
12
  </div>
@@ -16,10 +16,21 @@
16
16
  export default {
17
17
  name: 'mg-v-card',
18
18
 
19
+ props: {
20
+ theme: {
21
+ type: String,
22
+ default: null,
23
+ validator: function (value) {
24
+ return ['club'].indexOf(value) !== -1;
25
+ },
26
+ }
27
+ },
28
+
19
29
  computed: {
20
30
  classes() {
21
31
  return {
22
32
  'mg-v-card': true,
33
+ 'mg-v-card--theme-club': this.theme === 'club',
23
34
  };
24
35
  },
25
36
  footerVisibility() {
@@ -41,7 +52,20 @@ export default {
41
52
  .mg-v-card {
42
53
  box-shadow: 0 8px 22px 0 rgba(0, 0, 0, 0.3);
43
54
 
44
- .mg-footer {
55
+ &-content {
56
+ background: white;
57
+ }
58
+
59
+ &--theme {
60
+ &-club {
61
+ & .mg-v-card-content {
62
+ background: linear-gradient(90deg, #D1EFFF 0%, #DDDAFC 99.65%) !important;
63
+ color: #777;
64
+ }
65
+ }
66
+ }
67
+
68
+ &-footer {
45
69
  background-color: rgba(map-get($palette, 'brand'), 0.04);
46
70
  }
47
71
  }
@@ -0,0 +1,41 @@
1
+ import MgTrafficLight from './TrafficLight.vue';
2
+
3
+ // More on default export: https://storybook.js.org/docs/vue/writing-stories/introduction#default-export
4
+ export default {
5
+ title: 'Label/Traffic Light',
6
+ component: MgTrafficLight,
7
+ // More on argTypes: https://storybook.js.org/docs/vue/api/argtypes
8
+ argTypes: {
9
+ light: {
10
+ control: { type: 'select' },
11
+ options: ['red', 'yellow', 'green'],
12
+ defaultValue: 'green'
13
+ },
14
+ default: {
15
+ description: "The default Vue slot",
16
+ control: {
17
+ type: 'text',
18
+ },
19
+ table: {
20
+ category: 'Slots',
21
+ type: {
22
+ summary: 'html',
23
+ },
24
+ }
25
+ }
26
+ },
27
+ };
28
+
29
+ // More on component templates: https://storybook.js.org/docs/vue/writing-stories/introduction#using-args
30
+ const Template = (args, { argTypes }) => ({
31
+ props: Object.keys(argTypes),
32
+ components: { MgTrafficLight },
33
+ template: `<mg-traffic-light v-bind="$props"><template v-if="${'default' in args}" v-slot>${args.default}</template></mg-traffic-light>`,
34
+ });
35
+
36
+ export const Default = Template.bind({});
37
+ // More on args: https://storybook.js.org/docs/vue/writing-stories/args
38
+ Default.args = {
39
+ light: 'green',
40
+ default: '300',
41
+ };
@@ -0,0 +1,57 @@
1
+ <template>
2
+ <div
3
+ class="d-inline-flex bg-white align-items-center px-3"
4
+ :class="classes"
5
+ >
6
+ <div><slot></slot></div>
7
+ </div>
8
+ </template>
9
+
10
+ <script>
11
+ export default {
12
+ name: 'mg-traffic-light',
13
+
14
+ props: {
15
+ light: {
16
+ type: String,
17
+ default: 'green',
18
+ validator: function (value) {
19
+ return ['red', 'yellow', 'green'].indexOf(value) !== -1;
20
+ },
21
+ },
22
+ },
23
+
24
+ computed: {
25
+ classes() {
26
+ return {
27
+ 'mg-traffic-light': true,
28
+ 'mg-traffic-light--error': this.light === 'red',
29
+ 'mg-traffic-light--warning': this.light === 'yellow',
30
+ 'mg-traffic-light--success': this.light === 'green',
31
+ };
32
+ }
33
+ },
34
+ };
35
+ </script>
36
+
37
+ <style lang="scss">
38
+ @import '../../../assets/palette';
39
+
40
+ .mg-traffic-light {
41
+ border: 2px solid;
42
+ border-radius: 50px;
43
+ height: 2.25rem;
44
+
45
+ &--error {
46
+ border-color: map-get($palette, 'error');
47
+ }
48
+
49
+ &--warning {
50
+ border-color: map-get($palette, 'warning');
51
+ }
52
+
53
+ &--success {
54
+ border-color: map-get($palette, 'success');
55
+ }
56
+ }
57
+ </style>
@@ -30,5 +30,5 @@ const Template = args => ({
30
30
  export const Default = Template.bind({});
31
31
  // More on args: https://storybook.js.org/docs/vue/writing-stories/args
32
32
  Default.args = {
33
- default: 'heading one'
33
+ default: 'heading 1'
34
34
  };
@@ -0,0 +1,34 @@
1
+ import MgHeadingThree from './HeadingThree.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/H3',
6
+ component: MgHeadingThree,
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: { MgHeadingThree },
27
+ template: `<mg-heading-three><template v-if="${'default' in args}" v-slot>${args.default}</template></mg-heading-three>`,
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 3'
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-three',
8
+
9
+ computed: {
10
+ classes() {
11
+ return {
12
+ 'mg-h3': true,
13
+ };
14
+ }
15
+ },
16
+ };
17
+ </script>
18
+
19
+ <style lang="scss">
20
+ .mg-h3 {
21
+ font-family: 'Ubuntu', sans-serif;
22
+ font-size: 1rem;
23
+ font-weight: 500;
24
+ }
25
+ </style>
@@ -30,5 +30,5 @@ const Template = args => ({
30
30
  export const Default = Template.bind({});
31
31
  // More on args: https://storybook.js.org/docs/vue/writing-stories/args
32
32
  Default.args = {
33
- default: 'heading four'
33
+ default: 'heading 4'
34
34
  };
@@ -30,5 +30,5 @@ const Template = args => ({
30
30
  export const Default = Template.bind({});
31
31
  // More on args: https://storybook.js.org/docs/vue/writing-stories/args
32
32
  Default.args = {
33
- default: 'heading six'
33
+ default: 'heading 6'
34
34
  };