@magicgol/polyjuice 0.19.0 → 0.20.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/.storybook/main.js +4 -0
- package/package.json +1 -1
- package/src/components/box/selection-box/SelectionBox.stories.js +61 -0
- package/src/components/box/selection-box/SelectionBox.vue +61 -0
- package/src/components/form/checkbox/switch/Switch.vue +4 -9
- package/src/components/typography/link/Link.vue +0 -1
package/.storybook/main.js
CHANGED
package/package.json
CHANGED
@@ -0,0 +1,61 @@
|
|
1
|
+
import MgSelectionBox from './SelectionBox.vue';
|
2
|
+
import MgPrimaryButton from "../../form/button/primary-button/PrimaryButton";
|
3
|
+
import MgMagicCoinButton from "../../magic-coin/button/MagicCoinButton";
|
4
|
+
|
5
|
+
// More on default export: https://storybook.js.org/docs/vue/writing-stories/introduction#default-export
|
6
|
+
export default {
|
7
|
+
title: 'Box/Selection Box',
|
8
|
+
component: MgSelectionBox,
|
9
|
+
// More on argTypes: https://storybook.js.org/docs/vue/api/argtypes
|
10
|
+
argTypes: {
|
11
|
+
default: {
|
12
|
+
description: "The default Vue slot",
|
13
|
+
control: {
|
14
|
+
type: 'text',
|
15
|
+
},
|
16
|
+
table: {
|
17
|
+
category: 'Slots',
|
18
|
+
type: {
|
19
|
+
summary: 'html',
|
20
|
+
},
|
21
|
+
}
|
22
|
+
}
|
23
|
+
},
|
24
|
+
};
|
25
|
+
|
26
|
+
// More on component templates: https://storybook.js.org/docs/vue/writing-stories/introduction#using-args
|
27
|
+
const Template = (args, { argTypes }) => ({
|
28
|
+
props: Object.keys(argTypes),
|
29
|
+
components: { MgSelectionBox, MgPrimaryButton },
|
30
|
+
template: `<mg-selection-box v-bind="$props">
|
31
|
+
<template v-if="${'default' in args}" v-slot>${args.default}</template>
|
32
|
+
<template v-slot:cancel>Annulla</template>
|
33
|
+
<template v-slot:confirm>
|
34
|
+
<mg-primary-button>Conferma</mg-primary-button>
|
35
|
+
</template>
|
36
|
+
</mg-selection-box>`,
|
37
|
+
});
|
38
|
+
|
39
|
+
export const Default = Template.bind({});
|
40
|
+
// More on args: https://storybook.js.org/docs/vue/writing-stories/args
|
41
|
+
Default.args = {
|
42
|
+
default: 'this is the content'
|
43
|
+
};
|
44
|
+
|
45
|
+
const PaymentTemplate = (args, { argTypes }) => ({
|
46
|
+
props: Object.keys(argTypes),
|
47
|
+
components: { MgSelectionBox, MgMagicCoinButton },
|
48
|
+
template: `<mg-selection-box v-bind="$props">
|
49
|
+
<template v-if="${'default' in args}" v-slot>${args.default}</template>
|
50
|
+
<template v-slot:cancel>Annulla</template>
|
51
|
+
<template v-slot:confirm>
|
52
|
+
<mg-magic-coin-button>Conferma</mg-magic-coin-button>
|
53
|
+
</template>
|
54
|
+
</mg-selection-box>`,
|
55
|
+
});
|
56
|
+
|
57
|
+
export const Payment = PaymentTemplate.bind({});
|
58
|
+
// More on args: https://storybook.js.org/docs/vue/writing-stories/args
|
59
|
+
Payment.args = {
|
60
|
+
default: 'this is the content'
|
61
|
+
};
|
@@ -0,0 +1,61 @@
|
|
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
|
+
<mg-tertiary-button
|
11
|
+
v-on:click="$emit('cancel')"
|
12
|
+
><slot name="cancel"></slot></mg-tertiary-button>
|
13
|
+
</div>
|
14
|
+
<div class="w-50">
|
15
|
+
<slot name="confirm"></slot>
|
16
|
+
</div>
|
17
|
+
</div>
|
18
|
+
</div>
|
19
|
+
</div>
|
20
|
+
<div class="mg-selection-box-shadow"></div>
|
21
|
+
</div>
|
22
|
+
</template>
|
23
|
+
|
24
|
+
<script>
|
25
|
+
import MgTertiaryButton from "../../form/button/tertiary-button/TertiaryButton";
|
26
|
+
|
27
|
+
export default {
|
28
|
+
name: 'mg-selection-box',
|
29
|
+
|
30
|
+
computed: {
|
31
|
+
classes() {
|
32
|
+
return {
|
33
|
+
'mg-selection-box': true,
|
34
|
+
};
|
35
|
+
},
|
36
|
+
},
|
37
|
+
|
38
|
+
components: {
|
39
|
+
MgTertiaryButton
|
40
|
+
},
|
41
|
+
};
|
42
|
+
</script>
|
43
|
+
|
44
|
+
<style lang="scss">
|
45
|
+
.mg-selection-box {
|
46
|
+
&-shadow {
|
47
|
+
height: 5.625rem;
|
48
|
+
}
|
49
|
+
|
50
|
+
&-content {
|
51
|
+
bottom: 0;
|
52
|
+
|
53
|
+
> div {
|
54
|
+
box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.3);
|
55
|
+
font-family: 'Ubuntu', sans-serif;
|
56
|
+
font-size: 0.8125rem;
|
57
|
+
font-weight: 500;
|
58
|
+
}
|
59
|
+
}
|
60
|
+
}
|
61
|
+
</style>
|
@@ -10,9 +10,7 @@
|
|
10
10
|
v-on:input="onInput"
|
11
11
|
>
|
12
12
|
<span class="mg-switch-slider"></span>
|
13
|
-
<
|
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
|
-
|
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
|
-
|
133
|
+
svg {
|
139
134
|
display: block !important;
|
140
135
|
}
|
141
136
|
}
|