@magicgol/polyjuice 0.13.0 → 0.14.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -9,4 +9,12 @@ module.exports = {
9
9
  '@storybook/preset-scss',
10
10
  ],
11
11
  'framework': '@storybook/vue',
12
+ "previewHead": (head) => (`
13
+ ${head}
14
+ <style>
15
+ html, body {
16
+ background: #eee;
17
+ }
18
+ </style>
19
+ `),
12
20
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magicgol/polyjuice",
3
- "version": "0.13.0",
3
+ "version": "0.14.0",
4
4
  "scripts": {
5
5
  "serve": "vue-cli-service serve",
6
6
  "build": "vue-cli-service build",
@@ -1,6 +1,8 @@
1
1
  /* eslint-disable */
2
2
  require('./check-with-circle')
3
3
  require('./magic-coin')
4
+ require('./message')
4
5
  require('./soccer-ball')
5
6
  require('./star-c')
6
7
  require('./star-stroke-p')
8
+ require('./timer')
@@ -0,0 +1,10 @@
1
+ /* eslint-disable */
2
+ var icon = require('vue-svgicon')
3
+ icon.register({
4
+ 'message': {
5
+ width: 16,
6
+ height: 16,
7
+ viewBox: '0 0 16 16',
8
+ data: '<path pid="0" d="M13.333 1.333H2.667c-.736 0-1.334.598-1.334 1.334v8c0 .735.598 1.333 1.334 1.333h2v2.511L8.85 12h4.482c.736 0 1.334-.598 1.334-1.333v-8c0-.736-.598-1.334-1.334-1.334zm0 9.334H8.482L6 12.155v-1.488H2.667v-8h10.666v8z" _fill="#D81159"/><path pid="1" d="M4.667 4.667h6.666V6H4.667V4.667zm0 2.666h4.666v1.334H4.667V7.333z" _fill="#D81159"/>'
9
+ }
10
+ })
@@ -0,0 +1,10 @@
1
+ /* eslint-disable */
2
+ var icon = require('vue-svgicon')
3
+ icon.register({
4
+ 'timer': {
5
+ width: 16,
6
+ height: 16,
7
+ viewBox: '0 0 16 16',
8
+ data: '<path pid="0" d="M4 .667A.667.667 0 014.667 0H10a.666.666 0 110 1.333H4.667A.667.667 0 014 .667zM6.667 10A.667.667 0 108 10V6a.667.667 0 00-1.333 0v4zm.666-7.333a6 6 0 100 12 6 6 0 000-12zm-4.666 6a4.667 4.667 0 119.333 0 4.667 4.667 0 01-9.333 0zm10.864-3.53a.667.667 0 10.941-.944l-1.336-1.33a.666.666 0 10-.941.944l1.336 1.33z" _fill="#D81159"/>'
9
+ }
10
+ })
@@ -0,0 +1,37 @@
1
+ import MgIconBadge from './IconBadge.vue';
2
+
3
+ // More on default export: https://storybook.js.org/docs/vue/writing-stories/introduction#default-export
4
+ export default {
5
+ title: 'Icon/Badge',
6
+ component: MgIconBadge,
7
+ // More on argTypes: https://storybook.js.org/docs/vue/api/argtypes
8
+ argTypes: {
9
+ level: {
10
+ control: { type: 'select' },
11
+ options: ['normal', 'club'],
12
+ defaultValue: 'normal'
13
+ },
14
+ },
15
+ };
16
+
17
+ // More on component templates: https://storybook.js.org/docs/vue/writing-stories/introduction#using-args
18
+ const Template = (args, { argTypes }) => ({
19
+ props: Object.keys(argTypes),
20
+ components: { MgIconBadge },
21
+ template: `<mg-icon-badge v-bind="$props"></mg-icon-badge>`,
22
+ });
23
+
24
+ export const Default = Template.bind({});
25
+ // More on args: https://storybook.js.org/docs/vue/writing-stories/args
26
+ Default.args = {
27
+ icon: 'message',
28
+ level: 'normal',
29
+ };
30
+
31
+ export const Club = Template.bind({});
32
+ // More on args: https://storybook.js.org/docs/vue/writing-stories/args
33
+ Club.args = {
34
+ icon: 'star-c',
35
+ level: 'club',
36
+ };
37
+
@@ -0,0 +1,70 @@
1
+ <template>
2
+ <div
3
+ class="d-inline-flex rounded-circle align-items-center justify-content-center"
4
+ v-bind:class="classes"
5
+ >
6
+ <svgicon
7
+ :name="icon"
8
+ ></svgicon>
9
+ </div>
10
+ </template>
11
+
12
+ <script>
13
+ export default {
14
+ name: 'mg-icon-badge',
15
+
16
+ props: {
17
+ icon: {
18
+ type: String
19
+ },
20
+ level: {
21
+ type: String,
22
+ default: 'normal',
23
+ validator: function (value) {
24
+ return ['normal', 'club'].indexOf(value) !== -1;
25
+ },
26
+ }
27
+ },
28
+
29
+ computed: {
30
+ classes() {
31
+ return {
32
+ 'mg-icon-badge': true,
33
+ 'mg-icon-badge--club': this.level === 'club',
34
+ 'mg-icon-badge--normal': this.level === 'normal',
35
+ };
36
+ },
37
+ },
38
+ };
39
+ </script>
40
+
41
+ <style lang="scss">
42
+ @import '../../../assets/palette';
43
+
44
+ .mg-icon-badge {
45
+ height: 2rem;
46
+ min-width: 2rem;
47
+ width: 2rem;
48
+
49
+ svg {
50
+ height: 1rem;
51
+ width: 1rem;
52
+ }
53
+
54
+ &--normal {
55
+ background-color: white;
56
+
57
+ svg {
58
+ fill: map-get($palette, 'brand');
59
+ }
60
+ }
61
+
62
+ &--club {
63
+ background-color: map-get($palette, 'expertClub');
64
+
65
+ svg {
66
+ fill: white;
67
+ }
68
+ }
69
+ }
70
+ </style>
@@ -0,0 +1,4 @@
1
+ <svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M13.3334 1.33333H2.66671C1.93137 1.33333 1.33337 1.93133 1.33337 2.66666V10.6667C1.33337 11.402 1.93137 12 2.66671 12H4.66671V14.5113L8.85137 12H13.3334C14.0687 12 14.6667 11.402 14.6667 10.6667V2.66666C14.6667 1.93133 14.0687 1.33333 13.3334 1.33333ZM13.3334 10.6667H8.48204L6.00004 12.1553V10.6667H2.66671V2.66666H13.3334V10.6667Z" fill="#D81159"/>
3
+ <path d="M4.66663 4.66667H11.3333V6.00001H4.66663V4.66667ZM4.66663 7.33334H9.33329V8.66667H4.66663V7.33334Z" fill="#D81159"/>
4
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M4.00004 0.666667C4.00004 0.489856 4.07028 0.320286 4.1953 0.195262C4.32033 0.0702379 4.4899 0 4.66671 0L10 0C10.1769 0 10.3464 0.0702379 10.4714 0.195262C10.5965 0.320286 10.6667 0.489856 10.6667 0.666667C10.6667 0.843478 10.5965 1.01305 10.4714 1.13807C10.3464 1.2631 10.1769 1.33333 10 1.33333H4.66671C4.4899 1.33333 4.32033 1.2631 4.1953 1.13807C4.07028 1.01305 4.00004 0.843478 4.00004 0.666667V0.666667ZM6.66671 10C6.66671 10.1768 6.73695 10.3464 6.86197 10.4714C6.98699 10.5964 7.15656 10.6667 7.33337 10.6667C7.51019 10.6667 7.67975 10.5964 7.80478 10.4714C7.9298 10.3464 8.00004 10.1768 8.00004 10V6C8.00004 5.82319 7.9298 5.65362 7.80478 5.5286C7.67975 5.40357 7.51019 5.33333 7.33337 5.33333C7.15656 5.33333 6.98699 5.40357 6.86197 5.5286C6.73695 5.65362 6.66671 5.82319 6.66671 6V10ZM7.33337 2.66667C6.54544 2.66667 5.76523 2.82186 5.03727 3.12339C4.30932 3.42492 3.64788 3.86687 3.09073 4.42403C2.53358 4.98118 2.09163 5.64261 1.7901 6.37057C1.48857 7.09852 1.33337 7.87874 1.33337 8.66667C1.33337 9.4546 1.48857 10.2348 1.7901 10.9628C2.09163 11.6907 2.53358 12.3522 3.09073 12.9093C3.64788 13.4665 4.30932 13.9084 5.03727 14.2099C5.76523 14.5115 6.54544 14.6667 7.33337 14.6667C8.92467 14.6667 10.4508 14.0345 11.576 12.9093C12.7012 11.7841 13.3334 10.258 13.3334 8.66667C13.3334 7.07537 12.7012 5.54924 11.576 4.42403C10.4508 3.29881 8.92467 2.66667 7.33337 2.66667V2.66667ZM2.66671 8.66667C2.66671 8.05383 2.78741 7.447 3.02194 6.88081C3.25646 6.31462 3.6002 5.80018 4.03354 5.36684C4.46688 4.9335 4.98133 4.58975 5.54752 4.35523C6.1137 4.12071 6.72054 4 7.33337 4C7.94621 4 8.55304 4.12071 9.11923 4.35523C9.68542 4.58975 10.1999 4.9335 10.6332 5.36684C11.0665 5.80018 11.4103 6.31462 11.6448 6.88081C11.8793 7.447 12 8.05383 12 8.66667C12 9.90434 11.5084 11.0913 10.6332 11.9665C9.75804 12.8417 8.57105 13.3333 7.33337 13.3333C6.0957 13.3333 4.90871 12.8417 4.03354 11.9665C3.15837 11.0913 2.66671 9.90434 2.66671 8.66667ZM13.5307 5.13733C13.5923 5.20091 13.6659 5.25159 13.7473 5.28641C13.8287 5.32123 13.9162 5.33949 14.0047 5.34014C14.0932 5.34078 14.181 5.32378 14.2629 5.29015C14.3448 5.25651 14.4191 5.20691 14.4816 5.14422C14.5441 5.08154 14.5935 5.00704 14.6269 4.92507C14.6603 4.84309 14.6771 4.75529 14.6762 4.66677C14.6753 4.57825 14.6568 4.4908 14.6217 4.40952C14.5867 4.32823 14.5358 4.25474 14.472 4.19333L13.136 2.86267C13.0745 2.79909 13.0008 2.74841 12.9194 2.71359C12.838 2.67877 12.7505 2.66051 12.662 2.65986C12.5735 2.65922 12.4858 2.67622 12.4039 2.70985C12.322 2.74349 12.2476 2.79309 12.1851 2.85578C12.1226 2.91846 12.0732 2.99296 12.0398 3.07493C12.0064 3.15691 11.9897 3.24471 11.9906 3.33323C11.9915 3.42175 12.01 3.5092 12.045 3.59048C12.0801 3.67177 12.131 3.74526 12.1947 3.80667L13.5307 5.13733V5.13733Z" fill="#D81159"/>
3
+ </svg>