@magicgol/polyjuice 0.19.2 → 0.21.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.
@@ -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.21.0",
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>
@@ -20,7 +20,7 @@ export default {
20
20
  .mg-h2 {
21
21
  color: #343434;
22
22
  font-family: 'Ubuntu', sans-serif;
23
- font-size: 1rem;
23
+ font-size: 1.125rem;
24
24
  font-weight: 500;
25
25
  }
26
26
  </style>
@@ -21,6 +21,6 @@ export default {
21
21
  color: #343434;
22
22
  font-family: 'Ubuntu', sans-serif;
23
23
  font-size: 1rem;
24
- font-weight: 400;
24
+ font-weight: 500;
25
25
  }
26
26
  </style>
@@ -6,11 +6,6 @@ export default {
6
6
  component: MgHeadingFour,
7
7
  // More on argTypes: https://storybook.js.org/docs/vue/api/argtypes
8
8
  argTypes: {
9
- level: {
10
- control: { type: 'select' },
11
- options: [null, 'club'],
12
- defaultValue: null
13
- },
14
9
  default: {
15
10
  description: "The default Vue slot",
16
11
  control: {
@@ -27,10 +22,9 @@ export default {
27
22
  };
28
23
 
29
24
  // 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),
25
+ const Template = args => ({
32
26
  components: { MgHeadingFour },
33
- template: `<mg-heading-four v-bind="$props"><template v-if="${'default' in args}" v-slot>${args.default}</template></mg-heading-four>`,
27
+ template: `<mg-heading-four><template v-if="${'default' in args}" v-slot>${args.default}</template></mg-heading-four>`,
34
28
  });
35
29
 
36
30
  export const Default = Template.bind({});
@@ -6,21 +6,10 @@
6
6
  export default {
7
7
  name: 'mg-heading-four',
8
8
 
9
- props: {
10
- level: {
11
- type: String,
12
- default: null,
13
- validator: function (value) {
14
- return ['club'].indexOf(value) !== -1;
15
- },
16
- }
17
- },
18
-
19
9
  computed: {
20
10
  classes() {
21
11
  return {
22
12
  'mg-h4': true,
23
- 'mg-h4--level-club': this.level === 'club',
24
13
  };
25
14
  }
26
15
  },
@@ -28,18 +17,10 @@ export default {
28
17
  </script>
29
18
 
30
19
  <style lang="scss">
31
- @import '../../../assets/palette';
32
-
33
20
  .mg-h4 {
34
21
  color: #343434;
35
22
  font-family: 'Ubuntu', sans-serif;
36
- font-size: 0.875rem;
37
- font-weight: 700;
38
-
39
- &--level {
40
- &-club {
41
- color: map-get($palette, 'expertClub') !important;
42
- }
43
- }
23
+ font-size: 1rem;
24
+ font-weight: 400;
44
25
  }
45
26
  </style>
@@ -0,0 +1,40 @@
1
+ import MgHeadingFive from './HeadingFive.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/H5',
6
+ component: MgHeadingFive,
7
+ // More on argTypes: https://storybook.js.org/docs/vue/api/argtypes
8
+ argTypes: {
9
+ level: {
10
+ control: { type: 'select' },
11
+ options: [null, 'club'],
12
+ defaultValue: null
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: { MgHeadingFive },
33
+ template: `<mg-heading-five v-bind="$props"><template v-if="${'default' in args}" v-slot>${args.default}</template></mg-heading-five>`,
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
+ default: 'heading 5'
40
+ };
@@ -0,0 +1,45 @@
1
+ <template>
2
+ <div v-bind:class="classes"><slot></slot></div>
3
+ </template>
4
+
5
+ <script>
6
+ export default {
7
+ name: 'mg-heading-five',
8
+
9
+ props: {
10
+ level: {
11
+ type: String,
12
+ default: null,
13
+ validator: function (value) {
14
+ return ['club'].indexOf(value) !== -1;
15
+ },
16
+ }
17
+ },
18
+
19
+ computed: {
20
+ classes() {
21
+ return {
22
+ 'mg-h5': true,
23
+ 'mg-h5--level-club': this.level === 'club',
24
+ };
25
+ }
26
+ },
27
+ };
28
+ </script>
29
+
30
+ <style lang="scss">
31
+ @import '../../../assets/palette';
32
+
33
+ .mg-h5 {
34
+ color: #343434;
35
+ font-family: 'Ubuntu', sans-serif;
36
+ font-size: 0.875rem;
37
+ font-weight: 700;
38
+
39
+ &--level {
40
+ &-club {
41
+ color: map-get($palette, 'expertClub') !important;
42
+ }
43
+ }
44
+ }
45
+ </style>