@magicgol/polyjuice 0.37.0 → 0.37.1

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.37.0",
3
+ "version": "0.37.1",
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
+ header: {
22
+ description: "The header Vue slot",
23
+ control: {
24
+ type: 'text',
25
+ },
26
+ table: {
27
+ category: 'Slots',
28
+ type: {
29
+ summary: 'html',
30
+ },
31
+ }
20
32
  }
21
33
  },
22
34
  };
@@ -27,6 +39,7 @@ const Template = (args, { argTypes }) => ({
27
39
  components: { MgVBox },
28
40
  template: `<mg-v-box @click="$emit('click')" v-bind="$props">
29
41
  <template v-if="${'default' in args}" v-slot>${args.default}</template>
42
+ <template v-if="${'header' in args}" v-slot:header>${args.header}</template>
30
43
  </mg-v-box>`,
31
44
  });
32
45
 
@@ -42,3 +55,11 @@ Selected.args = {
42
55
  default: '<div>This is a vertical card.</div><div>What do you think about?</div>',
43
56
  selected: true
44
57
  };
58
+
59
+ export const Header = Template.bind({});
60
+ // More on args: https://storybook.js.org/docs/vue/writing-stories/args
61
+ Header.args = {
62
+ default: '<div>This is a vertical card.</div><div>What do you think about?</div>',
63
+ selected: true,
64
+ header: 'prima scelta'
65
+ };
@@ -1,11 +1,11 @@
1
1
  <template>
2
2
  <div
3
- class="p-3"
4
3
  :class="classes"
5
4
  :selected="selected"
6
5
  @click="$emit('click')"
7
6
  >
8
- <slot></slot>
7
+ <div class="mg-v-box--header" v-if="headerSlotVisibility"><slot name="header"></slot></div>
8
+ <div class="p-3"><slot></slot></div>
9
9
  </div>
10
10
  </template>
11
11
 
@@ -27,6 +27,9 @@ export default {
27
27
  'mg-v-box--selected': this.selected === true,
28
28
  };
29
29
  },
30
+ headerSlotVisibility() {
31
+ return 'header' in this.$slots && !!this.$slots.header;
32
+ }
30
33
  },
31
34
  };
32
35
  </script>
@@ -38,6 +41,17 @@ export default {
38
41
  background: white;
39
42
  border-radius: 10px;
40
43
  border: 1px solid #bababa;
44
+ cursor: pointer;
45
+ overflow: hidden;
46
+
47
+ &--header {
48
+ background-color: map-get($palette, 'brand');
49
+ color: white;
50
+ font-family: Ubuntu, sans-serif;
51
+ font-size: 0.8125rem;
52
+ font-weight: 500;
53
+ text-align: center;
54
+ }
41
55
 
42
56
  &--selected {
43
57
  background: rgba(map-get($palette, 'brand'), 0.05);
@@ -55,33 +55,7 @@ export default {
55
55
  @import '../../../assets/palette';
56
56
 
57
57
  .mg-radio {
58
- //border-bottom: 1px solid #d8d8d8;
59
-
60
- input {
61
- //background-color: #fff;
62
- //color: #666;
63
- //font-family: 'Raleway', sans-serif;
64
- //font-size: 1rem;
65
- //font-weight: 600;
66
- //letter-spacing: 0.54px;
67
- //padding: 0.5rem;
68
-
69
- //&:-webkit-autofill {
70
- // -webkit-box-shadow: 0 0 0 30px white inset;
71
- // -webkit-text-fill-color: #666666;
72
- // caret-color: #666666;
73
- //}
74
-
75
- //&:focus {
76
- // outline: 0;
77
- //}
78
-
79
- //&::placeholder {
80
- // color: #ccc;
81
- // font-size: 0.8125rem;
82
- // font-weight: 600;
83
- //}
84
- }
58
+ cursor: pointer;
85
59
 
86
60
  span {
87
61
  background-color: #fff;