@magicgol/polyjuice 0.7.0 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (31) hide show
  1. package/package.json +1 -1
  2. package/src/assets/palette.scss +2 -0
  3. package/src/assets/svg/check-with-circle.js +10 -0
  4. package/src/assets/svg/index.js +3 -0
  5. package/src/assets/svg/magic-coin.js +10 -0
  6. package/src/assets/svg/soccer-ball.js +10 -0
  7. package/src/components/club/button/primary-club-button/PrimaryClubButton.vue +6 -5
  8. package/src/components/club/button/secondary-club-button/SecondaryClubButton.vue +5 -6
  9. package/src/components/form/{primary-button → button/primary-button}/PrimaryButton.stories.js +0 -0
  10. package/src/components/form/{primary-button → button/primary-button}/PrimaryButton.vue +1 -1
  11. package/src/components/form/{secondary-button → button/secondary-button}/SecondaryButton.stories.js +0 -0
  12. package/src/components/form/{secondary-button → button/secondary-button}/SecondaryButton.vue +1 -1
  13. package/src/components/form/{tertiary-button → button/tertiary-button}/TertiaryButton.stories.js +0 -0
  14. package/src/components/form/{tertiary-button → button/tertiary-button}/TertiaryButton.vue +1 -1
  15. package/src/components/form/{toggle-button → button/toggle-button}/ToggleButton.stories.js +0 -0
  16. package/src/components/form/{toggle-button → button/toggle-button}/ToggleButton.vue +1 -1
  17. package/src/components/form/checkbox/checkbox/Checkbox.stories.js +51 -0
  18. package/src/components/form/checkbox/checkbox/Checkbox.vue +99 -0
  19. package/src/components/form/checkbox/switch/Switch.stories.js +39 -0
  20. package/src/components/form/checkbox/switch/Switch.vue +167 -0
  21. package/src/components/loader/soccer-ball/SoccerBall.stories.js +19 -0
  22. package/src/components/loader/soccer-ball/SoccerBall.vue +58 -0
  23. package/src/components/magic-coin/button/MagicCoinButton.stories.js +44 -0
  24. package/src/components/magic-coin/button/MagicCoinButton.vue +81 -0
  25. package/src/components/magic-coin/credits/Credits.stories.js +21 -0
  26. package/src/components/magic-coin/credits/Credits.vue +45 -0
  27. package/src/documentation/Brand.stories.mdx +8 -0
  28. package/src/main.js +7 -4
  29. package/src/svg/check-with-circle.svg +14 -0
  30. package/src/svg/magic-coin.svg +11 -0
  31. package/src/svg/soccer-ball.svg +1 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magicgol/polyjuice",
3
- "version": "0.7.0",
3
+ "version": "0.9.0",
4
4
  "scripts": {
5
5
  "serve": "vue-cli-service serve",
6
6
  "build": "vue-cli-service build",
@@ -1,5 +1,7 @@
1
1
  $palette: (
2
2
  'brand': #d81159,
3
+ 'freemium' :#004781,
4
+ 'coin': #ffcf73,
3
5
  'expertClub': #075169,
4
6
  'warning': #ff614c,
5
7
  'success': #349B50,
@@ -0,0 +1,10 @@
1
+ /* eslint-disable */
2
+ var icon = require('vue-svgicon')
3
+ icon.register({
4
+ 'check-with-circle': {
5
+ width: 16,
6
+ height: 16,
7
+ viewBox: '0 0 129 129',
8
+ data: '<g _fill="#349B50" fill-rule="nonzero"><path pid="0" d="M110.108 18.891C97.926 6.71 81.728 0 64.5 0 47.271 0 31.074 6.71 18.891 18.891 6.71 31.074 0 47.271 0 64.5c0 17.229 6.709 33.426 18.891 45.608C31.074 122.291 47.271 129 64.5 129c17.229 0 33.426-6.71 45.608-18.892C122.291 97.926 129 81.728 129 64.5c0-17.229-6.71-33.426-18.892-45.609zM64.5 121.441c-31.398 0-56.941-25.543-56.941-56.941 0-31.398 25.543-56.941 56.941-56.941 31.398 0 56.941 25.543 56.941 56.941 0 31.398-25.543 56.941-56.941 56.941z"/><path pid="1" d="M97.873 42.117a3.872 3.872 0 00-5.441 0L58.454 75.793 40.568 58.066a3.872 3.872 0 00-5.441 0 3.79 3.79 0 000 5.393l20.606 20.424A3.853 3.853 0 0058.454 85c.985 0 1.97-.372 2.72-1.117L97.874 47.51a3.79 3.79 0 000-5.393z"/></g>'
9
+ }
10
+ })
@@ -1,3 +1,6 @@
1
1
  /* eslint-disable */
2
+ require('./check-with-circle')
3
+ require('./magic-coin')
4
+ require('./soccer-ball')
2
5
  require('./star-c')
3
6
  require('./star-stroke-p')
@@ -0,0 +1,10 @@
1
+ /* eslint-disable */
2
+ var icon = require('vue-svgicon')
3
+ icon.register({
4
+ 'magic-coin': {
5
+ width: 16,
6
+ height: 16,
7
+ viewBox: '0 0 18 18',
8
+ data: '<path pid="0" d="M9.257 7.467l3.508-3.365A.361.361 0 0113.017 4h.61c.206 0 .373.176.373.392v9.215a.403.403 0 01-.109.278.364.364 0 01-.264.115h-1.763a.384.384 0 01-.374-.393V9.756a.393.393 0 00-.222-.36.359.359 0 00-.402.07l-1.61 1.547a.36.36 0 01-.501 0L7.133 9.47a.359.359 0 00-.401-.068.393.393 0 00-.222.359v3.843a.384.384 0 01-.374.394H4.373a.364.364 0 01-.264-.116.403.403 0 01-.109-.278V4.392C4 4.176 4.167 4 4.373 4h.614c.093 0 .182.037.25.102l3.52 3.365a.36.36 0 00.5 0zM9 18A9 9 0 109 0a9 9 0 000 18z" _fill="#FFD166" fill-rule="nonzero"/>'
9
+ }
10
+ })
@@ -0,0 +1,10 @@
1
+ /* eslint-disable */
2
+ var icon = require('vue-svgicon')
3
+ icon.register({
4
+ 'soccer-ball': {
5
+ width: 16,
6
+ height: 16,
7
+ viewBox: '0 0 480 480',
8
+ data: '<path pid="0" d="M240 0C107.453 0 0 107.453 0 240s107.453 240 240 240 240-107.453 240-240C479.852 107.516 372.484.148 240 0zm8.566 69.191L332 35.84a224.492 224.492 0 0127.414 14.777l.219.137a225.29 225.29 0 0124.695 18.11l.672.585a227.354 227.354 0 0110.223 9.262c.418.41.855.8 1.273 1.219a234.39 234.39 0 0110.09 10.484c.27.305.527.625.797.93 2.855 3.199 5.601 6.511 8.265 9.879.641.8 1.282 1.601 1.903 2.402 2.89 3.742 5.687 7.55 8.328 11.48l-16.633 70.704-81.832 27.28-78.828-63.073zm-186.125 34.48c.621-.8 1.254-1.6 1.895-2.398a224.935 224.935 0 018.168-9.777c.305-.336.586-.68.887-1.016A217.481 217.481 0 0183.44 80c.399-.39.797-.8 1.215-1.16a228.569 228.569 0 0110.137-9.207l.8-.672a226.15 226.15 0 0124.462-18l.312-.2A224.738 224.738 0 01147.617 36l83.817 33.191v80.801l-78.832 63.063-81.832-27.23-16.633-70.704a233.682 233.682 0 018.304-11.45zm-9.64 259.09a222.72 222.72 0 01-6.746-10.96l-.52-.899a210.277 210.277 0 01-6.055-11.293l-.066-.12a222.882 222.882 0 01-10.535-24.802v-.078c-1.422-4-2.719-8.097-3.918-12.218l-.434-1.52a220.618 220.618 0 01-2.984-11.742c-.078-.387-.176-.754-.254-1.137a222.66 222.66 0 01-4.227-27.097l48.84-58.606 81.266 27.086 23.586 94.336L132 375.273zm240.472 94.782c-4 .992-8.105 1.848-12.21 2.617-.575.113-1.16.207-1.735.313-3.496.625-7.031 1.16-10.574 1.597-.945.121-1.883.25-2.824.364-3.29.382-6.61.671-9.938.91-1.047.07-2.082.176-3.129.242-4.254.262-8.543.414-12.863.414-3.957 0-7.89-.105-11.8-.313-.473 0-.927-.078-1.4-.113-3.48-.199-6.945-.46-10.402-.797l-.398-.074a227.948 227.948 0 01-22.559-3.598l-47.32-74.09 38.145-50.863h111.468l38.77 51.2zM458.77 288c-.082.383-.176.754-.258 1.137a230.481 230.481 0 01-2.985 11.742l-.43 1.52a224.8 224.8 0 01-3.921 12.218v.078a222.149 222.149 0 01-10.535 24.801l-.067.121a221.793 221.793 0 01-6.054 11.293l-.52.899a198.32 198.32 0 01-6.734 10.945l-78.93 12.445-39.023-51.52 23.574-94.312 81.265-27.086 48.84 58.606A222.142 222.142 0 01458.77 288zm0 0"/>'
9
+ }
10
+ })
@@ -6,11 +6,7 @@
6
6
  :disabled="disabled"
7
7
  @click="$emit('click')"
8
8
  >
9
- <svgicon
10
- name="star-c"
11
- color="#fff"
12
- style="height: 16px"
13
- ></svgicon>
9
+ <svgicon name="star-c"></svgicon>
14
10
  <div class="ml-2">
15
11
  <slot></slot>
16
12
  </div>
@@ -58,6 +54,11 @@ export default {
58
54
  font-weight: 500;
59
55
  outline: none;
60
56
 
57
+ svg {
58
+ fill: #fff;
59
+ height: 1rem;
60
+ }
61
+
61
62
  &--disabled {
62
63
  opacity: 0.6 !important;
63
64
  cursor: not-allowed !important;
@@ -1,16 +1,13 @@
1
1
  <template>
2
2
  <button
3
- class="d-block bg-white w-100 p-2 rounded text-uppercase text-center text-decoration-none"
3
+ class="d-block bg-white w-100 rounded text-uppercase text-center text-decoration-none"
4
4
  type="button"
5
5
  :class="classes"
6
6
  :disabled="disabled"
7
7
  @click="$emit('click')"
8
8
  >
9
- <div class="d-inline-flex align-items-center">
10
- <svgicon
11
- name="star-stroke-p"
12
- style="height: 20px"
13
- ></svgicon>
9
+ <div class="d-flex justify-content-center align-items-center">
10
+ <svgicon name="star-stroke-p"></svgicon>
14
11
  <div class="ml-2"><slot></slot></div>
15
12
  </div>
16
13
  </button>
@@ -56,10 +53,12 @@ export default {
56
53
  font-size: 1rem;
57
54
  font-family: 'Ubuntu', sans-serif;
58
55
  font-weight: 500;
56
+ height: 2.5rem;
59
57
  outline: none;
60
58
 
61
59
  svg {
62
60
  fill: map-get($palette, 'expertClub');
61
+ height: 1.25rem;
63
62
  }
64
63
 
65
64
  &--disabled {
@@ -53,7 +53,7 @@ export default {
53
53
  </script>
54
54
 
55
55
  <style lang="scss">
56
- @import '../../../assets/palette';
56
+ @import '../../../../assets/palette';
57
57
 
58
58
  .mg-primary-button {
59
59
  appearance: none;
@@ -36,7 +36,7 @@ export default {
36
36
  </script>
37
37
 
38
38
  <style lang="scss">
39
- @import '../../../assets/palette';
39
+ @import '../../../../assets/palette';
40
40
 
41
41
  .mg-secondary-button {
42
42
  appearance: none;
@@ -36,7 +36,7 @@ export default {
36
36
  </script>
37
37
 
38
38
  <style lang="scss">
39
- @import '../../../assets/palette';
39
+ @import '../../../../assets/palette';
40
40
 
41
41
  .mg-tertiary-button {
42
42
  color: map-get($palette, 'brand');
@@ -57,7 +57,7 @@ export default {
57
57
  </script>
58
58
 
59
59
  <style lang="scss">
60
- @import '../../../assets/palette';
60
+ @import '../../../../assets/palette';
61
61
 
62
62
  .mg-toggle-button {
63
63
  appearance: none;
@@ -0,0 +1,51 @@
1
+ import MgCheckbox from './Checkbox.vue';
2
+
3
+ // More on default export: https://storybook.js.org/docs/vue/writing-stories/introduction#default-export
4
+ export default {
5
+ title: 'Form/Checkbox/Checkbox',
6
+ component: MgCheckbox,
7
+ // More on argTypes: https://storybook.js.org/docs/vue/api/argtypes
8
+ argTypes: {
9
+ default: {
10
+ description: "The default Vue slot",
11
+ control: {
12
+ type: 'text',
13
+ },
14
+ table: {
15
+ category: 'Slots',
16
+ type: {
17
+ summary: 'html',
18
+ },
19
+ }
20
+ }
21
+ },
22
+ };
23
+
24
+ // More on component templates: https://storybook.js.org/docs/vue/writing-stories/introduction#using-args
25
+ const Template = (args, { argTypes }) => ({
26
+ props: Object.keys(argTypes),
27
+ components: { MgCheckbox },
28
+ template: `<mg-checkbox @click="$emit('click')" v-bind="$props"><template v-if="${'default' in args}" v-slot>${args.default}</template></mg-checkbox>`,
29
+ });
30
+
31
+ export const Default = Template.bind({});
32
+ // More on args: https://storybook.js.org/docs/vue/writing-stories/args
33
+ Default.args = {
34
+ disabled: false,
35
+ value: false,
36
+ default: 'checkbox'
37
+ };
38
+
39
+ export const Disabled = Template.bind({});
40
+ Disabled.args = {
41
+ disabled: true,
42
+ value: false,
43
+ default: 'checkbox'
44
+ };
45
+
46
+ export const Checked = Template.bind({});
47
+ Checked.args = {
48
+ disabled: false,
49
+ value: true,
50
+ default: 'checkbox'
51
+ };
@@ -0,0 +1,99 @@
1
+ <template>
2
+ <label
3
+ class="mg-checkbox m-0"
4
+ v-bind:class="classes"
5
+ >
6
+ <!-- HIDDEN CHECKBOX -->
7
+ <input
8
+ type="checkbox"
9
+ class="d-none"
10
+ v-bind:name="name"
11
+ v-on:change="$emit('input', $event.target.checked)"
12
+ v-bind:checked="value"
13
+ v-bind:disabled="disabled"
14
+ />
15
+ <!-- end of HIDDEN CHECKBOX -->
16
+ <!-- THE SQUARE -->
17
+ <span class="mg-checkbox-check align-middle d-inline-block position-relative"></span>
18
+ <!-- end of THE SQUARE -->
19
+ <!-- TEXT AS LABEL -->
20
+ <span class="align-middle">
21
+ <slot></slot>
22
+ </span>
23
+ <!-- end of TEXT AS LABEL -->
24
+ </label>
25
+ </template>
26
+
27
+ <script>
28
+ export default {
29
+ name: 'mg-checkbox',
30
+
31
+ props: {
32
+ disabled: {
33
+ type: Boolean,
34
+ default: false,
35
+ },
36
+ name: {
37
+ type: String
38
+ },
39
+ value: {
40
+ type: Boolean,
41
+ default: false
42
+ },
43
+ },
44
+
45
+ computed: {
46
+ classes() {
47
+ return {
48
+ 'mg-checkbox': true,
49
+ 'mg-checkbox--disabled': this.disabled,
50
+ };
51
+ }
52
+ },
53
+
54
+ methods: {
55
+ onClick() {
56
+ this.$emit('click');
57
+ },
58
+ },
59
+ };
60
+ </script>
61
+
62
+ <style lang="scss">
63
+ @import '../../../../assets/palette';
64
+
65
+ .mg-checkbox {
66
+ .mg-checkbox-check {
67
+ border: 2px solid map-get($palette, 'brand');
68
+ border-radius: 2px;
69
+ box-sizing: border-box;
70
+ height: 20px;
71
+ vertical-align: sub;
72
+ width: 20px;
73
+ }
74
+
75
+ input:checked {
76
+ + .mg-checkbox-check {
77
+ background-color: map-get($palette, 'brand');
78
+
79
+ &::after {
80
+ border-left: 2px solid #fff;
81
+ border-bottom: 2px solid #fff;
82
+ content: '';
83
+ height: 8px;
84
+ left: 50%;
85
+ margin-left: -7px;
86
+ position: absolute;
87
+ top: 2px;
88
+ transform: rotate(-45deg);
89
+ width: 14px;
90
+ }
91
+ }
92
+ }
93
+
94
+ &--disabled {
95
+ opacity: 0.6 !important;
96
+ cursor: not-allowed !important;
97
+ }
98
+ }
99
+ </style>
@@ -0,0 +1,39 @@
1
+ import MgSwitch from './Switch.vue';
2
+
3
+ // More on default export: https://storybook.js.org/docs/vue/writing-stories/introduction#default-export
4
+ export default {
5
+ title: 'Form/Checkbox/Switch',
6
+ component: MgSwitch,
7
+ // More on argTypes: https://storybook.js.org/docs/vue/api/argtypes
8
+ argTypes: {},
9
+ };
10
+
11
+ // More on component templates: https://storybook.js.org/docs/vue/writing-stories/introduction#using-args
12
+ const Template = (args, { argTypes }) => ({
13
+ props: Object.keys(argTypes),
14
+ components: { MgSwitch },
15
+ template: `<mg-switch @input="$emit('input')" v-bind="$props"></mg-switch>`,
16
+ });
17
+
18
+ export const Default = Template.bind({});
19
+ // More on args: https://storybook.js.org/docs/vue/writing-stories/args
20
+ Default.args = {
21
+ value: false
22
+ };
23
+
24
+ export const Checked = Template.bind({});
25
+ Checked.args = {
26
+ value: true
27
+ };
28
+
29
+ export const Disabled = Template.bind({});
30
+ Disabled.args = {
31
+ disabled: true,
32
+ value: false
33
+ };
34
+
35
+ export const Blocked = Template.bind({});
36
+ Blocked.args = {
37
+ value: true,
38
+ reversible: false
39
+ };
@@ -0,0 +1,167 @@
1
+ <template>
2
+ <label
3
+ class="mg-switch"
4
+ v-bind:class="classes"
5
+ >
6
+ <input
7
+ type="checkbox"
8
+ v-bind:checked="value"
9
+ v-bind:disabled="disabled"
10
+ v-on:input="onInput"
11
+ >
12
+ <span class="mg-switch-slider"></span>
13
+ <span class="mg-switch-icon">
14
+ <svgicon
15
+ name="check-with-circle"
16
+ ></svgicon>
17
+ </span>
18
+ </label>
19
+ </template>
20
+
21
+ <script>
22
+ export default {
23
+ name: 'mg-switch',
24
+
25
+ props: {
26
+ disabled: {
27
+ type: Boolean,
28
+ default: false,
29
+ },
30
+ reversible: {
31
+ type: Boolean,
32
+ default: true
33
+ },
34
+ value: {
35
+ type: Boolean,
36
+ default: false
37
+ },
38
+ },
39
+
40
+ computed: {
41
+ checked() {
42
+ return this.value === true;
43
+ },
44
+ blocked() {
45
+ return this.checked && this.reversible === false;
46
+ },
47
+ classes() {
48
+ return {
49
+ 'mg-switch': true,
50
+ 'mg-switch--disabled': this.disabled,
51
+ 'mg-switch--checked': this.checked,
52
+ 'mg-switch--blocked': this.blocked
53
+ };
54
+ },
55
+ },
56
+
57
+ methods: {
58
+ onInput($event) {
59
+ if (!this.blocked) {
60
+ this.$emit('input', $event.target.checked);
61
+ }
62
+ },
63
+ },
64
+ };
65
+ </script>
66
+
67
+ <style lang="scss">
68
+ @import '../../../../assets/palette';
69
+
70
+ .mg-switch {
71
+ cursor: pointer;
72
+ display: inline-block;
73
+ height: 32px;
74
+ position: relative;
75
+ width: 60px;
76
+
77
+ input {
78
+ opacity: 0;
79
+ width: 0;
80
+ height: 0;
81
+ }
82
+
83
+ &-slider {
84
+ background-color: #ccc;
85
+ border-radius: 32px;
86
+ bottom: 0;
87
+ cursor: pointer;
88
+ left: 0;
89
+ position: absolute;
90
+ right: 0;
91
+ top: 0;
92
+ transition: .4s;
93
+
94
+ &:before {
95
+ background-color: white;
96
+ border-radius: 50%;
97
+ bottom: 4px;
98
+ content: "";
99
+ height: 24px;
100
+ left: 4px;
101
+ position: absolute;
102
+ transition: .4s;
103
+ width: 24px;
104
+ }
105
+ }
106
+
107
+ &-icon {
108
+ display: none;
109
+ left: 50%;
110
+ top: 50%;
111
+ margin-top: -.6125rem;
112
+ margin-left: -.6125rem;
113
+ position: absolute;
114
+ width: 1.25rem;
115
+
116
+ svg {
117
+ fill: #fff;
118
+ }
119
+ }
120
+
121
+ &--checked {
122
+ .mg-switch-slider {
123
+ background-color: map-get($palette, 'brand') !important;
124
+
125
+ &:before {
126
+ transform: translateX(28px);
127
+ }
128
+ }
129
+ }
130
+
131
+ &--blocked {
132
+ .mg-switch-slider {
133
+ background-color: map-get($palette, 'success') !important;
134
+
135
+ &:before {
136
+ content: none;
137
+ }
138
+ }
139
+
140
+ .mg-switch-icon {
141
+ display: block !important;
142
+ }
143
+ }
144
+
145
+
146
+ &--disabled {
147
+ opacity: 0.6 !important;
148
+ cursor: not-allowed !important;
149
+ }
150
+ //
151
+
152
+ //
153
+ // &--blocked {
154
+ // .mg-switch-slider {
155
+ // background-color: map-get($palette, 'success');
156
+ //
157
+ // &:before {
158
+ // content: none;
159
+ // }
160
+ // }
161
+ //
162
+ // .mg-switch-check {
163
+ // display: block !important;
164
+ // }
165
+ // }
166
+ }
167
+ </style>
@@ -0,0 +1,19 @@
1
+ import MgSoccerBall from './SoccerBall.vue';
2
+
3
+ // More on default export: https://storybook.js.org/docs/vue/writing-stories/introduction#default-export
4
+ export default {
5
+ title: 'Loader/Soccer Ball',
6
+ component: MgSoccerBall,
7
+ // More on argTypes: https://storybook.js.org/docs/vue/api/argtypes
8
+ };
9
+
10
+ // More on component templates: https://storybook.js.org/docs/vue/writing-stories/introduction#using-args
11
+ const Template = (args, { argTypes }) => ({
12
+ props: Object.keys(argTypes),
13
+ components: { MgSoccerBall },
14
+ template: `<mg-soccer-ball></mg-soccer-ball>`,
15
+ });
16
+
17
+ export const Default = Template.bind({});
18
+ // More on args: https://storybook.js.org/docs/vue/writing-stories/args
19
+ Default.args = {};
@@ -0,0 +1,58 @@
1
+ <template>
2
+ <div
3
+ class="d-flex justify-content-center"
4
+ :class="classes"
5
+ >
6
+ <div>
7
+ <div class="d-inline-block">
8
+ <svgicon name="soccer-ball" class="h-100"></svgicon>
9
+ </div>
10
+ </div>
11
+ </div>
12
+ </template>
13
+
14
+ <script>
15
+ export default {
16
+ name: 'mg-soccer-ball',
17
+
18
+ computed: {
19
+ classes() {
20
+ return {
21
+ 'mg-soccer-ball': true,
22
+ };
23
+ }
24
+ },
25
+ };
26
+ </script>
27
+
28
+ <style scoped lang="scss">
29
+ .mg-soccer-ball {
30
+ height: 75px;
31
+
32
+ > div {
33
+ animation: bounce 0.5s;
34
+ animation-direction: alternate;
35
+ animation-timing-function: cubic-bezier(.5, 0.05, 1, .5);
36
+ animation-iteration-count: infinite;
37
+
38
+ > div {
39
+ height: 40px;
40
+ animation: rotation 2s linear infinite;
41
+ }
42
+ }
43
+
44
+ svg {
45
+ height: 100%;
46
+ }
47
+ }
48
+
49
+ @keyframes rotation {
50
+ from { transform: rotate(0deg); }
51
+ to { transform: rotate(359deg); }
52
+ }
53
+
54
+ @keyframes bounce {
55
+ from { transform: translate3d(0, 0, 0); }
56
+ to { transform: translate3d(0, 50px, 0); }
57
+ }
58
+ </style>
@@ -0,0 +1,44 @@
1
+ import MgMagicCoinButton from './MagicCoinButton.vue';
2
+
3
+ // More on default export: https://storybook.js.org/docs/vue/writing-stories/introduction#default-export
4
+ export default {
5
+ title: 'MagicCoin/Button/Magic Coin Button',
6
+ component: MgMagicCoinButton,
7
+ // More on argTypes: https://storybook.js.org/docs/vue/api/argtypes
8
+ argTypes: {
9
+ default: {
10
+ description: "The default Vue slot",
11
+ control: {
12
+ type: 'text',
13
+ },
14
+ table: {
15
+ category: 'Slots',
16
+ type: {
17
+ summary: 'html',
18
+ },
19
+ }
20
+ }
21
+ },
22
+ };
23
+
24
+ // More on component templates: https://storybook.js.org/docs/vue/writing-stories/introduction#using-args
25
+ const Template = (args, { argTypes }) => ({
26
+ props: Object.keys(argTypes),
27
+ components: { MgMagicCoinButton },
28
+ template: `<mg-magic-coin-button @click="$emit('click')" v-bind="$props"><template v-if="${'default' in args}" v-slot>${args.default}</template></mg-magic-coin-button>`,
29
+ });
30
+
31
+ export const Default = Template.bind({});
32
+ // More on args: https://storybook.js.org/docs/vue/writing-stories/args
33
+ Default.args = {
34
+ disabled: false,
35
+ value: 100,
36
+ default: 'magic coin button'
37
+ };
38
+
39
+ export const Disabled = Template.bind({});
40
+ Disabled.args = {
41
+ disabled: true,
42
+ value: 100,
43
+ default: 'magic coin button'
44
+ };
@@ -0,0 +1,81 @@
1
+ <template>
2
+ <button
3
+ class="align-items-center d-flex w-100 justify-content-center rounded py-2 px-3 border-0 text-white text-uppercase"
4
+ style="line-height: 1"
5
+ :class="classes"
6
+ :type="type"
7
+ :disabled="disabled"
8
+ @click="onClick"
9
+ >
10
+ <span
11
+ class="pr-3"
12
+ ><slot></slot></span>
13
+ <mg-credits :value="value"></mg-credits>
14
+ </button>
15
+ </template>
16
+
17
+ <script>
18
+ import MgCredits from "../credits/Credits";
19
+
20
+ export default {
21
+ name: 'mg-magic-coin-button',
22
+
23
+ props: {
24
+ disabled: {
25
+ type: Boolean,
26
+ default: false,
27
+ },
28
+ type: {
29
+ type: String,
30
+ default: 'button',
31
+ validator: function (value) {
32
+ return ['button', 'submit'].indexOf(value) !== -1;
33
+ },
34
+ },
35
+ value: {
36
+ type: Number,
37
+ validator: function (value) {
38
+ return value > 0;
39
+ },
40
+ }
41
+ },
42
+
43
+ computed: {
44
+ classes() {
45
+ return {
46
+ 'mg-magic-coin-button': true,
47
+ 'mg-magic-coin-button--disabled': this.disabled,
48
+ };
49
+ }
50
+ },
51
+
52
+ components: {
53
+ MgCredits,
54
+ },
55
+
56
+ methods: {
57
+ onClick() {
58
+ this.$emit('click');
59
+ },
60
+ },
61
+ };
62
+ </script>
63
+
64
+ <style lang="scss">
65
+ @import '../../../assets/palette';
66
+
67
+ .mg-magic-coin-button {
68
+ appearance: none;
69
+ background-color: map-get($palette, 'freemium');
70
+ cursor: pointer;
71
+ font-family: 'Ubuntu', sans-serif;
72
+ font-size: 0.875rem;
73
+ font-weight: 500;
74
+ outline: none;
75
+
76
+ &--disabled {
77
+ opacity: 0.6 !important;
78
+ cursor: not-allowed !important;
79
+ }
80
+ }
81
+ </style>
@@ -0,0 +1,21 @@
1
+ import MgCredits from './Credits.vue';
2
+
3
+ // More on default export: https://storybook.js.org/docs/vue/writing-stories/introduction#default-export
4
+ export default {
5
+ title: 'MagicCoin/Credits/Credits',
6
+ component: MgCredits,
7
+ };
8
+
9
+ // More on component templates: https://storybook.js.org/docs/vue/writing-stories/introduction#using-args
10
+ const Template = (args, { argTypes }) => ({
11
+ props: Object.keys(argTypes),
12
+ components: { MgCredits },
13
+ template: `<mg-credits @click="$emit('click')" v-bind="$props"></mg-credits>`,
14
+ });
15
+
16
+ export const Default = Template.bind({});
17
+ // More on args: https://storybook.js.org/docs/vue/writing-stories/args
18
+ Default.args = {
19
+ disabled: false,
20
+ value: 100,
21
+ };
@@ -0,0 +1,45 @@
1
+ <template>
2
+ <span
3
+ class="d-inline-flex align-items-center"
4
+ :class="classes"
5
+ >
6
+ <span
7
+ class="pr-1"
8
+ style="line-height: 1"
9
+ >{{ value }}</span>
10
+ <svgicon
11
+ name="magic-coin"
12
+ ></svgicon>
13
+ </span>
14
+ </template>
15
+
16
+ <script>
17
+ export default {
18
+ name: 'mg-credits',
19
+
20
+ props: {
21
+ value: {
22
+ type: Number
23
+ }
24
+ },
25
+
26
+ computed: {
27
+ classes() {
28
+ return {
29
+ 'mg-credits': true,
30
+ };
31
+ }
32
+ },
33
+ };
34
+ </script>
35
+
36
+ <style lang="scss">
37
+ @import '../../../assets/palette';
38
+
39
+ .mg-credits {
40
+ svg {
41
+ fill: map-get($palette, 'coin');
42
+ height: 1.125rem;
43
+ }
44
+ }
45
+ </style>
@@ -7,6 +7,14 @@ import {ColorItem, ColorPalette, Meta} from '@storybook/addon-docs';
7
7
  title="Brand Color"
8
8
  colors={{'Razzmatazz': '#d81159'}}
9
9
  />
10
+ <ColorItem
11
+ title="Freemium"
12
+ colors={{'Congress Blue': '#004781'}}
13
+ />
14
+ <ColorItem
15
+ title="Coin"
16
+ colors={{'Goldenrod': '#ffcf73'}}
17
+ />
10
18
  <ColorItem
11
19
  title="Expert Club Color"
12
20
  colors={{'Teal Blue': '#075169'}}
package/src/main.js CHANGED
@@ -22,8 +22,11 @@ export MgHCard from './components/card/horizontal-card/HCard';
22
22
  export MgVCard from './components/card/vertical-card/VCard';
23
23
  export MgPrimaryClubButton from './components/club/button/primary-club-button/PrimaryClubButton';
24
24
  export MgSecondaryClubButton from './components/club/button/secondary-club-button/SecondaryClubButton';
25
- export MgPrimaryButton from './components/form/primary-button/PrimaryButton';
26
- export MgSecondaryButton from './components/form/secondary-button/SecondaryButton';
27
- export MgTertiaryButton from './components/form/tertiary-button/TertiaryButton';
28
- export MgToggleButton from './components/form/toggle-button/ToggleButton';
25
+ export MgPrimaryButton from './components/form/button/primary-button/PrimaryButton';
26
+ export MgSecondaryButton from './components/form/button/secondary-button/SecondaryButton';
27
+ export MgTertiaryButton from './components/form/button/tertiary-button/TertiaryButton';
28
+ export MgToggleButton from './components/form/button/toggle-button/ToggleButton';
29
+ export MgMagicCoinButton from './components/magic-coin/button/MagicCoinButton';
30
+ export MgCredits from './components/magic-coin/credits/Credits';
31
+ export MgSoccerBall from './components/loader/soccer-ball/SoccerBall';
29
32
  export MgTabButton from './components/navigation/tab-button/TabButton';
@@ -0,0 +1,14 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg viewBox="0 0 129 129" version="1.1" xmlns="http://www.w3.org/2000/svg">
3
+ <!-- Generator: Sketch 63.1 (92452) - https://sketch.com -->
4
+ <title>verified</title>
5
+ <desc>Created with Sketch.</desc>
6
+ <g id="Lega" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
7
+ <g id="Lega---Nuova-Lega---Creata" transform="translate(-123.000000, -104.000000)" fill="#349B50" fill-rule="nonzero">
8
+ <g id="verified" transform="translate(123.000000, 104.000000)">
9
+ <path d="M110.108303,18.8914453 C97.9258652,6.70925977 81.7285547,0 64.5,0 C47.2711934,0 31.0736309,6.70925977 18.8914453,18.8914453 C6.70900781,31.0738828 0,47.2714453 0,64.5 C0,81.7285547 6.70900781,97.9258652 18.8914453,110.108303 C31.0738828,122.29074 47.2711934,129 64.5,129 C81.7285547,129 97.9258652,122.29074 110.108303,110.108303 C122.29074,97.9258652 129,81.7285547 129,64.5 C129,47.2714453 122.29074,31.0741348 110.108303,18.8914453 Z M64.5,121.441406 C33.1023574,121.441406 7.55859375,95.8976426 7.55859375,64.5 C7.55859375,33.1023574 33.1023574,7.55859375 64.5,7.55859375 C95.8976426,7.55859375 121.441406,33.1023574 121.441406,64.5 C121.441406,95.8976426 95.8976426,121.441406 64.5,121.441406 Z" id="Shape"></path>
10
+ <path d="M97.8730081,42.1165964 C96.3706087,40.6277588 93.9342438,40.6277588 92.4318444,42.1168506 L58.4543268,75.7934108 L40.5684121,58.0659215 C39.0660128,56.5768297 36.6296478,56.5768297 35.1269919,58.0659215 C33.624336,59.5550133 33.624336,61.969798 35.1269919,63.4591441 L55.7334884,83.8831176 C56.4848164,84.6277906 57.4695716,85 58.4540703,85 C59.438569,85 60.4235807,84.6275364 61.1746521,83.8831176 L97.8730081,47.509819 C99.375664,46.0207272 99.375664,43.6059425 97.8730081,42.1165964 Z" id="Path"></path>
11
+ </g>
12
+ </g>
13
+ </g>
14
+ </svg>
@@ -0,0 +1,11 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg viewBox="0 0 18 18" version="1.1" xmlns="http://www.w3.org/2000/svg">
3
+ <!-- Generator: Sketch 55.2 (78181) - https://sketchapp.com -->
4
+ <title>Shape Copy 2</title>
5
+ <desc>Created with Sketch.</desc>
6
+ <g id="Email" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
7
+ <g id="Newsletter" transform="translate(-982.000000, -162.000000)" fill="#FFD166" fill-rule="nonzero">
8
+ <path d="M991.257273,169.466549 L994.765327,166.102441 C994.833941,166.036415 994.923599,165.999861 995.016589,166 L995.627312,166 C995.833141,166 996,166.175531 996,166.392058 L996,175.606678 C996.000318,175.710877 995.961194,175.810923 995.891267,175.884722 C995.82134,175.958521 995.726363,176 995.627312,176 L993.863668,176 C993.657176,176 993.48978,175.823904 993.48978,175.606678 L993.48978,171.75566 C993.489803,171.600319 993.40264,171.459614 993.267542,171.396906 C993.132443,171.334197 992.974891,171.361313 992.865832,171.466043 L991.256071,173.012774 C991.113931,173.148674 990.896889,173.148674 990.754749,173.012774 L989.132965,171.471102 C989.023678,171.367067 988.866374,171.340562 988.731665,171.403483 C988.596957,171.466405 988.510154,171.606932 988.51022,171.761983 L988.51022,175.605413 C988.51022,175.822639 988.342824,175.998735 988.136332,175.998735 L986.372688,175.998735 C986.273637,175.998736 986.17866,175.957256 986.108733,175.883457 C986.038806,175.809659 985.999682,175.709612 986,175.605413 L986,166.392058 C986,166.175531 986.166859,166 986.372688,166 L986.987018,166 C987.079593,166.000177 987.16877,166.03671 987.237078,166.102441 L990.757153,169.466549 C990.899327,169.6011 991.115099,169.6011 991.257273,169.466549 L991.257273,169.466549 Z M991,180 C995.970563,180 1000,175.970563 1000,171 C1000,166.029437 995.970563,162 991,162 C986.029437,162 982,166.029437 982,171 C982,175.970563 986.029437,180 991,180 Z" id="Shape-Copy-2"></path>
9
+ </g>
10
+ </g>
11
+ </svg>
@@ -0,0 +1 @@
1
+ <svg viewBox="0 0 480 480" xmlns="http://www.w3.org/2000/svg"><path d="m240 0c-132.546875 0-240 107.453125-240 240s107.453125 240 240 240 240-107.453125 240-240c-.148438-132.484375-107.515625-239.851562-240-240zm8.566406 69.191406 83.433594-33.351562c9.46875 4.285156 18.628906 9.222656 27.414062 14.777344l.21875.136718c8.632813 5.46875 16.882813 11.519532 24.695313 18.109375l.671875.585938c3.503906 2.984375 6.910156 6.074219 10.222656 9.261719.417969.410156.855469.800781 1.273438 1.21875 3.472656 3.390624 6.835937 6.886718 10.089844 10.484374.269531.304688.527343.625.796874.929688 2.855469 3.199219 5.601563 6.511719 8.265626 9.878906.640624.800782 1.28125 1.601563 1.902343 2.402344 2.890625 3.742188 5.6875 7.550781 8.328125 11.480469l-16.632812 70.703125-81.832032 27.28125-78.828124-63.074219zm-186.125 34.480469c.621094-.800781 1.253906-1.601563 1.894532-2.398437 2.632812-3.339844 5.355468-6.597657 8.167968-9.777344.304688-.335938.585938-.679688.886719-1.015625 3.234375-3.605469 6.582031-7.097657 10.050781-10.480469.398438-.390625.796875-.800781 1.214844-1.160156 3.285156-3.167969 6.664062-6.238282 10.136719-9.207032l.800781-.671874c7.742188-6.542969 15.914062-12.554688 24.460938-18l.3125-.199219c8.734374-5.542969 17.835937-10.472657 27.25-14.761719l83.816406 33.191406v80.800782l-78.832032 63.0625-81.832031-27.230469-16.632812-70.703125c2.664062-3.921875 5.429687-7.722656 8.304687-11.449219zm-9.640625 259.089844c-2.351562-3.585938-4.601562-7.238281-6.746093-10.960938l-.519532-.898437c-2.132812-3.703125-4.152344-7.46875-6.054687-11.292969l-.066407-.121094c-4.007812-8.046875-7.527343-16.328125-10.535156-24.800781v-.078125c-1.421875-4-2.71875-8.097656-3.917968-12.21875l-.433594-1.519531c-1.097656-3.871094-2.09375-7.785156-2.984375-11.742188-.078125-.386718-.175781-.753906-.253907-1.136718-1.964843-8.9375-3.375-17.984376-4.226562-27.097657l48.839844-58.605469 81.265625 27.085938 23.585937 94.335938-38.753906 51.5625zm240.472657 94.78125c-4 .992187-8.105469 1.847656-12.210938 2.617187-.574219.113282-1.160156.207032-1.734375.3125-3.496094.625-7.03125 1.160156-10.574219 1.597656-.945312.121094-1.882812.25-2.824218.363282-3.289063.382812-6.609376.671875-9.9375.910156-1.046876.070312-2.082032.175781-3.128907.242188-4.253906.261718-8.542969.414062-12.863281.414062-3.957031 0-7.890625-.105469-11.800781-.3125-.472657 0-.925781-.078125-1.398438-.113281-3.480469-.199219-6.945312-.460938-10.402343-.796875l-.398438-.074219c-7.574219-.820313-15.105469-2.023437-22.558594-3.597656l-47.320312-74.089844 38.144531-50.863281h111.46875l38.769531 51.199218zm165.496093-169.542969c-.082031.382812-.175781.753906-.257812 1.136719-.894531 3.953125-1.890625 7.867187-2.984375 11.742187l-.429688 1.519532c-1.203125 4.121093-2.496094 8.203124-3.921875 12.21875v.078124c-3.007812 8.472657-6.523437 16.753907-10.535156 24.800782l-.066406.121094c-1.914063 3.828124-3.929688 7.59375-6.054688 11.292968l-.519531.898438c-2.132812 3.734375-4.378906 7.378906-6.734375 10.945312l-78.929687 12.445313-39.023438-51.519531 23.574219-94.3125 81.265625-27.085938 48.839844 58.605469c-.847657 9.117187-2.257813 18.171875-4.222657 27.113281zm0 0"/></svg>