@magicgol/polyjuice 0.9.2 → 0.10.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.
@@ -1,4 +1,4 @@
1
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
2
- <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
1
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.3.1/dist/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
2
+ <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.3.1/dist/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
3
3
 
4
- <link href="https://fonts.googleapis.com/css?family=Ubuntu:500" rel="stylesheet" />
4
+ <link href="https://fonts.googleapis.com/css?family=Ubuntu:500,600" rel="stylesheet" />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magicgol/polyjuice",
3
- "version": "0.9.2",
3
+ "version": "0.10.0",
4
4
  "scripts": {
5
5
  "serve": "vue-cli-service serve",
6
6
  "build": "vue-cli-service build",
@@ -10,4 +10,6 @@ $palette: (
10
10
  'defender': #3de000,
11
11
  'midfielder': #116dd8,
12
12
  'forward': #f30026,
13
+ 'online': #00b669,
14
+ 'offline': #ea7203,
13
15
  );
@@ -0,0 +1,47 @@
1
+ import MgProfileImage from './ProfileImage.vue';
2
+
3
+ // More on default export: https://storybook.js.org/docs/vue/writing-stories/introduction#default-export
4
+ export default {
5
+ title: 'Image/Profile',
6
+ component: MgProfileImage,
7
+ // More on argTypes: https://storybook.js.org/docs/vue/api/argtypes
8
+ argTypes: {
9
+ size: {
10
+ control: { type: 'select' },
11
+ options: ['large', 'normal'],
12
+ defaultValue: 'normal'
13
+ },
14
+ online: {
15
+ control: { type: 'select' },
16
+ options: [true, false],
17
+ defaultValue: false
18
+ },
19
+ },
20
+ };
21
+
22
+ // More on component templates: https://storybook.js.org/docs/vue/writing-stories/introduction#using-args
23
+ const Template = (args, { argTypes }) => ({
24
+ props: Object.keys(argTypes),
25
+ components: { MgProfileImage },
26
+ template: `<mg-profile-image v-bind="$props"></mg-profile-image>`,
27
+ });
28
+
29
+ export const Default = Template.bind({});
30
+ // More on args: https://storybook.js.org/docs/vue/writing-stories/args
31
+ Default.args = {
32
+ // active: false,
33
+ };
34
+
35
+ export const Large = Template.bind({});
36
+ // More on args: https://storybook.js.org/docs/vue/writing-stories/args
37
+ Large.args = {
38
+ name: 'VdF',
39
+ size: 'large',
40
+ };
41
+
42
+ export const Online = Template.bind({});
43
+ // More on args: https://storybook.js.org/docs/vue/writing-stories/args
44
+ Online.args = {
45
+ online: true,
46
+ name: 'VdF'
47
+ };
@@ -0,0 +1,134 @@
1
+ <template>
2
+ <div
3
+ class="position-relative"
4
+ v-bind:class="classes"
5
+ >
6
+ <!-- INITIALS LAYER -->
7
+ <div
8
+ class="mg-acronym d-flex align-items-center position-absolute w-100 h-100"
9
+ >
10
+ <div
11
+ class="px-1 w-100 text-center flex-fill text-truncate text-white"
12
+ >{{ name }}</div>
13
+ </div>
14
+ <!-- end of INITIALS LAYER -->
15
+ <!-- PROFILE IMAGE LAYER -->
16
+ <div
17
+ class="mg-image position-absolute w-100 h-100"
18
+ style="background-position: center; background-size: cover"
19
+ v-if="imageUrl"
20
+ v-bind:style="{ backgroundImage: 'url(' + imageUrl + ')' }"
21
+ ></div>
22
+ <!-- end of PROFILE IMAGE LAYER -->
23
+ <!-- ONLINE BADGE -->
24
+ <div
25
+ class="mg-live-badge position-absolute w-100"
26
+ >
27
+ <div class="w-100"></div>
28
+ </div>
29
+ <!-- end of ONLINE BADGE -->
30
+ </div>
31
+ </template>
32
+
33
+ <script>
34
+ export default {
35
+ name: 'mg-profile-image',
36
+
37
+ props: {
38
+ name: {
39
+ type: String
40
+ },
41
+ imageUrl: {
42
+ type: String
43
+ },
44
+ size: {
45
+ type: String,
46
+ default: 'normal',
47
+ validator: function (value) {
48
+ return ['large', 'normal'].indexOf(value) !== -1;
49
+ },
50
+ },
51
+ online: {
52
+ type: Boolean,
53
+ default: false
54
+ }
55
+ },
56
+
57
+ computed: {
58
+ classes() {
59
+ return {
60
+ 'mg-profile-image': true,
61
+ 'mg-profile-image--normal': this.size === 'normal',
62
+ 'mg-profile-image--large': this.size === 'large',
63
+ 'mg-profile-image--online': this.online === true,
64
+ 'mg-profile-image--offline': this.online === false,
65
+ };
66
+ },
67
+ acronym() {
68
+ return '';
69
+ }
70
+ },
71
+ };
72
+ </script>
73
+
74
+ <style lang="scss">
75
+ @import '../../../assets/palette';
76
+
77
+ .mg-profile-image {
78
+ border-radius: 50%;
79
+ font-family: 'Ubuntu', sans-serif;
80
+ font-weight: 600;
81
+
82
+ &--normal {
83
+ height: 2.5rem;
84
+ font-size: 1rem;
85
+ width: 2.5rem;
86
+ }
87
+
88
+ &--large {
89
+ height: 5rem;
90
+ font-size: 2rem;
91
+ width: 5rem;
92
+ }
93
+
94
+ .mg-acronym {
95
+ background-color: #5770bc;
96
+ border-radius: 50%;
97
+ }
98
+
99
+ .mg-image {
100
+ border-radius: 50%;
101
+ }
102
+
103
+ > div {
104
+ z-index: 100;
105
+ }
106
+
107
+ .mg-live-badge {
108
+ border-radius: 50%;
109
+ border: 3px solid white;
110
+ margin-bottom: -3px;
111
+ margin-right: -3px;
112
+ max-width: calc(20% + 6px);
113
+ min-width: 0.8125rem;
114
+ right: 0;
115
+ bottom: 0;
116
+
117
+ div {
118
+ padding-top: 100%;
119
+ }
120
+ }
121
+
122
+ &--online {
123
+ .mg-live-badge {
124
+ background-color: map-get($palette, 'online');
125
+ }
126
+ }
127
+
128
+ &--offline {
129
+ .mg-live-badge {
130
+ background-color: map-get($palette, 'offline');
131
+ }
132
+ }
133
+ }
134
+ </style>
@@ -0,0 +1,34 @@
1
+ import MgHeadingOne from './HeadingOne.vue';
2
+
3
+ // More on default export: https://storybook.js.org/docs/vue/writing-stories/introduction#default-export
4
+ export default {
5
+ title: 'Typography/H1/H1',
6
+ component: MgHeadingOne,
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 => ({
26
+ components: { MgHeadingOne },
27
+ template: `<mg-heading-one><template v-if="${'default' in args}" v-slot>${args.default}</template></mg-heading-one>`,
28
+ });
29
+
30
+ export const Default = Template.bind({});
31
+ // More on args: https://storybook.js.org/docs/vue/writing-stories/args
32
+ Default.args = {
33
+ default: 'heading one'
34
+ };
@@ -0,0 +1,25 @@
1
+ <template>
2
+ <div v-bind:class="classes"><slot></slot></div>
3
+ </template>
4
+
5
+ <script>
6
+ export default {
7
+ name: 'mg-heading-one',
8
+
9
+ computed: {
10
+ classes() {
11
+ return {
12
+ 'mg-h1': true,
13
+ };
14
+ }
15
+ },
16
+ };
17
+ </script>
18
+
19
+ <style lang="scss">
20
+ .mg-h1 {
21
+ font-family: 'Ubuntu', sans-serif;
22
+ font-size: 1.25rem;
23
+ font-weight: 500;
24
+ }
25
+ </style>
@@ -0,0 +1,16 @@
1
+ import {ColorItem, ColorPalette, Meta} from '@storybook/addon-docs';
2
+
3
+ <Meta title="Colors/Alert" />
4
+
5
+ <ColorPalette>
6
+ <ColorItem
7
+ title="Live"
8
+ subtitle="Used for online people"
9
+ colors={{'Jade': '#00b669'}}
10
+ />
11
+ <ColorItem
12
+ title="Offline"
13
+ subtitle="Used for offline people"
14
+ colors={{'Clementine': '#ea7203'}}
15
+ />
16
+ </ColorPalette>
package/src/main.js CHANGED
@@ -31,9 +31,13 @@ export MgToggleButton from './components/form/button/toggle-button/ToggleButton'
31
31
  export MgCheckbox from './components/form/checkbox/checkbox/Checkbox';
32
32
  export MgSwitch from './components/form/checkbox/switch/Switch';
33
33
 
34
+ export MgProfileImage from './components/image/profile-image/ProfileImage';
35
+
34
36
  export MgMagicCoinButton from './components/magic-coin/button/MagicCoinButton';
35
37
  export MgCredits from './components/magic-coin/credits/Credits';
36
38
 
37
39
  export MgSoccerBallLoader from './components/loader/soccer-ball/SoccerBall';
38
40
 
39
41
  export MgTabButton from './components/navigation/tab-button/TabButton';
42
+
43
+ export MgHeadingOne from './components/typography/h1/HeadingOne';