@magicgol/polyjuice 0.7.1 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magicgol/polyjuice",
3
- "version": "0.7.1",
3
+ "version": "0.8.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,
@@ -1,4 +1,5 @@
1
1
  /* eslint-disable */
2
+ require('./magic-coin')
2
3
  require('./soccer-ball')
3
4
  require('./star-c')
4
5
  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,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
@@ -26,4 +26,7 @@ export MgPrimaryButton from './components/form/primary-button/PrimaryButton';
26
26
  export MgSecondaryButton from './components/form/secondary-button/SecondaryButton';
27
27
  export MgTertiaryButton from './components/form/tertiary-button/TertiaryButton';
28
28
  export MgToggleButton from './components/form/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,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>