@magicgol/polyjuice 0.15.1 → 0.16.2
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +1 -1
- package/src/assets/palette.scss +2 -0
- package/src/components/box/filing-cabinet/FilingCabinet.vue +4 -2
- package/src/components/card/vertical-card/VCard.stories.js +5 -0
- package/src/components/card/vertical-card/VCard.vue +27 -3
- package/src/components/label/traffic-light/TrafficLight.stories.js +41 -0
- package/src/components/label/traffic-light/TrafficLight.vue +60 -0
- package/src/components/typography/h1/HeadingOne.stories.js +1 -1
- package/src/components/typography/h1/HeadingOne.vue +1 -0
- package/src/components/typography/h3/HeadingThree.stories.js +34 -0
- package/src/components/typography/h3/HeadingThree.vue +25 -0
- package/src/components/typography/h4/HeadingFour.stories.js +1 -1
- package/src/components/typography/h6/HeadingSix.stories.js +1 -1
- package/src/documentation/Typography.stories.mdx +10 -0
package/package.json
CHANGED
package/src/assets/palette.scss
CHANGED
@@ -9,13 +9,15 @@
|
|
9
9
|
</div>
|
10
10
|
</div>
|
11
11
|
<div class="p-4">
|
12
|
-
<
|
12
|
+
<div class="px-2">
|
13
|
+
<slot></slot>
|
14
|
+
</div>
|
13
15
|
</div>
|
14
16
|
</div>
|
15
17
|
</template>
|
16
18
|
|
17
19
|
<script>
|
18
20
|
export default {
|
19
|
-
name: 'mg-filing-cabinet'
|
21
|
+
name: 'mg-filing-cabinet'
|
20
22
|
};
|
21
23
|
</script>
|
@@ -4,9 +4,9 @@
|
|
4
4
|
:class="classes"
|
5
5
|
@click="onClick"
|
6
6
|
>
|
7
|
-
<div class="p-3
|
7
|
+
<div class="mg-v-card-content p-3"><slot></slot></div>
|
8
8
|
<div
|
9
|
-
class="mg-footer p-3"
|
9
|
+
class="mg-v-card-footer p-3"
|
10
10
|
v-if="footerVisibility"
|
11
11
|
><slot name="footer"></slot></div>
|
12
12
|
</div>
|
@@ -16,10 +16,21 @@
|
|
16
16
|
export default {
|
17
17
|
name: 'mg-v-card',
|
18
18
|
|
19
|
+
props: {
|
20
|
+
theme: {
|
21
|
+
type: String,
|
22
|
+
default: null,
|
23
|
+
validator: function (value) {
|
24
|
+
return ['club'].indexOf(value) !== -1;
|
25
|
+
},
|
26
|
+
}
|
27
|
+
},
|
28
|
+
|
19
29
|
computed: {
|
20
30
|
classes() {
|
21
31
|
return {
|
22
32
|
'mg-v-card': true,
|
33
|
+
'mg-v-card--theme-club': this.theme === 'club',
|
23
34
|
};
|
24
35
|
},
|
25
36
|
footerVisibility() {
|
@@ -41,7 +52,20 @@ export default {
|
|
41
52
|
.mg-v-card {
|
42
53
|
box-shadow: 0 8px 22px 0 rgba(0, 0, 0, 0.3);
|
43
54
|
|
44
|
-
|
55
|
+
&-content {
|
56
|
+
background: white;
|
57
|
+
}
|
58
|
+
|
59
|
+
&--theme {
|
60
|
+
&-club {
|
61
|
+
& .mg-v-card-content {
|
62
|
+
background: linear-gradient(90deg, #D1EFFF 0%, #DDDAFC 99.65%) !important;
|
63
|
+
color: #777;
|
64
|
+
}
|
65
|
+
}
|
66
|
+
}
|
67
|
+
|
68
|
+
&-footer {
|
45
69
|
background-color: rgba(map-get($palette, 'brand'), 0.04);
|
46
70
|
}
|
47
71
|
}
|
@@ -0,0 +1,41 @@
|
|
1
|
+
import MgTrafficLight from './TrafficLight.vue';
|
2
|
+
|
3
|
+
// More on default export: https://storybook.js.org/docs/vue/writing-stories/introduction#default-export
|
4
|
+
export default {
|
5
|
+
title: 'Label/Traffic Light',
|
6
|
+
component: MgTrafficLight,
|
7
|
+
// More on argTypes: https://storybook.js.org/docs/vue/api/argtypes
|
8
|
+
argTypes: {
|
9
|
+
light: {
|
10
|
+
control: { type: 'select' },
|
11
|
+
options: ['red', 'yellow', 'green'],
|
12
|
+
defaultValue: 'green'
|
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: { MgTrafficLight },
|
33
|
+
template: `<mg-traffic-light v-bind="$props"><template v-if="${'default' in args}" v-slot>${args.default}</template></mg-traffic-light>`,
|
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
|
+
light: 'green',
|
40
|
+
default: '300',
|
41
|
+
};
|
@@ -0,0 +1,60 @@
|
|
1
|
+
<template>
|
2
|
+
<div
|
3
|
+
class="d-inline-flex bg-white align-items-center px-3"
|
4
|
+
:class="classes"
|
5
|
+
>
|
6
|
+
<div><slot></slot></div>
|
7
|
+
</div>
|
8
|
+
</template>
|
9
|
+
|
10
|
+
<script>
|
11
|
+
export default {
|
12
|
+
name: 'mg-traffic-light',
|
13
|
+
|
14
|
+
props: {
|
15
|
+
light: {
|
16
|
+
type: String,
|
17
|
+
default: 'green',
|
18
|
+
validator: function (value) {
|
19
|
+
return ['red', 'yellow', 'green'].indexOf(value) !== -1;
|
20
|
+
},
|
21
|
+
},
|
22
|
+
},
|
23
|
+
|
24
|
+
computed: {
|
25
|
+
classes() {
|
26
|
+
return {
|
27
|
+
'mg-traffic-light': true,
|
28
|
+
'mg-traffic-light--error': this.light === 'red',
|
29
|
+
'mg-traffic-light--warning': this.light === 'yellow',
|
30
|
+
'mg-traffic-light--success': this.light === 'green',
|
31
|
+
};
|
32
|
+
}
|
33
|
+
},
|
34
|
+
};
|
35
|
+
</script>
|
36
|
+
|
37
|
+
<style lang="scss">
|
38
|
+
@import '../../../assets/palette';
|
39
|
+
|
40
|
+
.mg-traffic-light {
|
41
|
+
border: 2px solid;
|
42
|
+
border-radius: 50px;
|
43
|
+
font-family: 'Ubuntu', sans-serif;
|
44
|
+
font-size: 1.3125rem;
|
45
|
+
font-weight: 500;
|
46
|
+
height: 2.25rem;
|
47
|
+
|
48
|
+
&--error {
|
49
|
+
border-color: map-get($palette, 'error');
|
50
|
+
}
|
51
|
+
|
52
|
+
&--warning {
|
53
|
+
border-color: map-get($palette, 'warning');
|
54
|
+
}
|
55
|
+
|
56
|
+
&--success {
|
57
|
+
border-color: map-get($palette, 'success');
|
58
|
+
}
|
59
|
+
}
|
60
|
+
</style>
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import MgHeadingThree from './HeadingThree.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/H3',
|
6
|
+
component: MgHeadingThree,
|
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: { MgHeadingThree },
|
27
|
+
template: `<mg-heading-three><template v-if="${'default' in args}" v-slot>${args.default}</template></mg-heading-three>`,
|
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 3'
|
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-three',
|
8
|
+
|
9
|
+
computed: {
|
10
|
+
classes() {
|
11
|
+
return {
|
12
|
+
'mg-h3': true,
|
13
|
+
};
|
14
|
+
}
|
15
|
+
},
|
16
|
+
};
|
17
|
+
</script>
|
18
|
+
|
19
|
+
<style lang="scss">
|
20
|
+
.mg-h3 {
|
21
|
+
font-family: 'Ubuntu', sans-serif;
|
22
|
+
font-size: 1rem;
|
23
|
+
font-weight: 500;
|
24
|
+
}
|
25
|
+
</style>
|