@magicgol/polyjuice 0.19.2 → 0.20.0

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.2",
3
+ "version": "0.20.0",
4
4
  "scripts": {
5
5
  "serve": "vue-cli-service serve",
6
6
  "build": "vue-cli-service build",
@@ -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>