@magicgol/polyjuice 0.19.1 → 0.20.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -15,6 +15,10 @@ module.exports = {
15
15
  html, body {
16
16
  background: #F6F9FC;
17
17
  }
18
+ .mg-selection-box-content {
19
+ position: absolute !important;
20
+ padding: 16px !important;
21
+ }
18
22
  </style>
19
23
  `),
20
24
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magicgol/polyjuice",
3
- "version": "0.19.1",
3
+ "version": "0.20.1",
4
4
  "scripts": {
5
5
  "serve": "vue-cli-service serve",
6
6
  "build": "vue-cli-service build",
@@ -0,0 +1,66 @@
1
+ import MgSelectionBox from './SelectionBox.vue';
2
+ import MgPrimaryButton from "../../form/button/primary-button/PrimaryButton";
3
+ import MgMagicCoinButton from "../../magic-coin/button/MagicCoinButton";
4
+ import MgTertiaryButton from "../../form/button/tertiary-button/TertiaryButton";
5
+
6
+ // More on default export: https://storybook.js.org/docs/vue/writing-stories/introduction#default-export
7
+ export default {
8
+ title: 'Box/Selection Box',
9
+ component: MgSelectionBox,
10
+ // More on argTypes: https://storybook.js.org/docs/vue/api/argtypes
11
+ argTypes: {
12
+ default: {
13
+ description: "The default Vue slot",
14
+ control: {
15
+ type: 'text',
16
+ },
17
+ table: {
18
+ category: 'Slots',
19
+ type: {
20
+ summary: 'html',
21
+ },
22
+ }
23
+ }
24
+ },
25
+ };
26
+
27
+ // More on component templates: https://storybook.js.org/docs/vue/writing-stories/introduction#using-args
28
+ const Template = (args, { argTypes }) => ({
29
+ props: Object.keys(argTypes),
30
+ components: { MgSelectionBox, MgPrimaryButton, MgTertiaryButton },
31
+ template: `<mg-selection-box v-bind="$props">
32
+ <template v-if="${'default' in args}" v-slot>${args.default}</template>
33
+ <template v-slot:cancel>
34
+ <mg-tertiary-button>Annulla</mg-tertiary-button>
35
+ </template>
36
+ <template v-slot:confirm>
37
+ <mg-primary-button>Conferma</mg-primary-button>
38
+ </template>
39
+ </mg-selection-box>`,
40
+ });
41
+
42
+ export const Default = Template.bind({});
43
+ // More on args: https://storybook.js.org/docs/vue/writing-stories/args
44
+ Default.args = {
45
+ default: 'this is the content'
46
+ };
47
+
48
+ const PaymentTemplate = (args, { argTypes }) => ({
49
+ props: Object.keys(argTypes),
50
+ components: { MgSelectionBox, MgMagicCoinButton, MgTertiaryButton },
51
+ template: `<mg-selection-box v-bind="$props">
52
+ <template v-if="${'default' in args}" v-slot>${args.default}</template>
53
+ <template v-slot:cancel>
54
+ <mg-tertiary-button>Annulla</mg-tertiary-button>
55
+ </template>
56
+ <template v-slot:confirm>
57
+ <mg-magic-coin-button>Conferma</mg-magic-coin-button>
58
+ </template>
59
+ </mg-selection-box>`,
60
+ });
61
+
62
+ export const Payment = PaymentTemplate.bind({});
63
+ // More on args: https://storybook.js.org/docs/vue/writing-stories/args
64
+ Payment.args = {
65
+ default: 'this is the content'
66
+ };
@@ -0,0 +1,53 @@
1
+ <template>
2
+ <div
3
+ :class="classes"
4
+ >
5
+ <div class="mg-selection-box-content fixed-bottom p-2">
6
+ <div class="bg-white rounded w-100 h-100 p-2">
7
+ <div class="text-center text-uppercase"><slot></slot></div>
8
+ <div class="d-flex align-items-center mt-2">
9
+ <div class="w-50 text-center">
10
+ <slot name="cancel"></slot>
11
+ </div>
12
+ <div class="w-50">
13
+ <slot name="confirm"></slot>
14
+ </div>
15
+ </div>
16
+ </div>
17
+ </div>
18
+ <div class="mg-selection-box-shadow"></div>
19
+ </div>
20
+ </template>
21
+
22
+ <script>
23
+ export default {
24
+ name: 'mg-selection-box',
25
+
26
+ computed: {
27
+ classes() {
28
+ return {
29
+ 'mg-selection-box': true,
30
+ };
31
+ },
32
+ },
33
+ };
34
+ </script>
35
+
36
+ <style lang="scss">
37
+ .mg-selection-box {
38
+ &-shadow {
39
+ height: 5.625rem;
40
+ }
41
+
42
+ &-content {
43
+ bottom: 0;
44
+
45
+ > div {
46
+ box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.3);
47
+ font-family: 'Ubuntu', sans-serif;
48
+ font-size: 0.8125rem;
49
+ font-weight: 500;
50
+ }
51
+ }
52
+ }
53
+ </style>
@@ -10,9 +10,7 @@
10
10
  v-on:input="onInput"
11
11
  >
12
12
  <span class="mg-switch-slider"></span>
13
- <span class="mg-switch-icon">
14
- <svgicon name="check-with-circle"></svgicon>
15
- </span>
13
+ <svgicon name="check-with-circle"></svgicon>
16
14
  </label>
17
15
  </template>
18
16
 
@@ -102,18 +100,15 @@ export default {
102
100
  }
103
101
  }
104
102
 
105
- &-icon {
103
+ svg {
106
104
  display: none;
105
+ fill: #fff;
107
106
  left: 50%;
108
107
  top: 50%;
109
108
  margin-top: -.6125rem;
110
109
  margin-left: -.6125rem;
111
110
  position: absolute;
112
111
  width: 1.25rem;
113
-
114
- svg {
115
- fill: #fff;
116
- }
117
112
  }
118
113
 
119
114
  &--checked {
@@ -135,7 +130,7 @@ export default {
135
130
  }
136
131
  }
137
132
 
138
- .mg-switch-icon {
133
+ svg {
139
134
  display: block !important;
140
135
  }
141
136
  }