@magicgol/polyjuice 0.47.2 → 0.49.0
Sign up to get free protection for your applications and to get access to all the features.
package/package.json
CHANGED
@@ -0,0 +1,40 @@
|
|
1
|
+
import MgText from './Text.vue';
|
2
|
+
|
3
|
+
// More on default export: https://storybook.js.org/docs/vue/writing-stories/introduction#default-export
|
4
|
+
export default {
|
5
|
+
title: 'Color/Text',
|
6
|
+
component: MgText,
|
7
|
+
// More on argTypes: https://storybook.js.org/docs/vue/api/argtypes
|
8
|
+
argTypes: {
|
9
|
+
theme: {
|
10
|
+
control: { type: 'select' },
|
11
|
+
options: [null, 'club'],
|
12
|
+
defaultValue: null
|
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: { MgText },
|
33
|
+
template: `<mg-text v-bind="$props"><template v-if="${'default' in args}" v-slot>${args.default}</template></mg-text>`,
|
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
|
+
default: 'testo libero'
|
40
|
+
};
|
@@ -0,0 +1,44 @@
|
|
1
|
+
<template>
|
2
|
+
<div v-bind:class="classes"><span><slot></slot></span></div>
|
3
|
+
</template>
|
4
|
+
|
5
|
+
<script>
|
6
|
+
export default {
|
7
|
+
name: 'mg-text',
|
8
|
+
|
9
|
+
props: {
|
10
|
+
theme: {
|
11
|
+
type: String,
|
12
|
+
default: null,
|
13
|
+
validator: function (value) {
|
14
|
+
return ['club'].indexOf(value) !== -1;
|
15
|
+
},
|
16
|
+
}
|
17
|
+
},
|
18
|
+
|
19
|
+
computed: {
|
20
|
+
classes() {
|
21
|
+
return {
|
22
|
+
'mg-text': true,
|
23
|
+
'mg-text--theme-club': this.theme === 'club',
|
24
|
+
};
|
25
|
+
}
|
26
|
+
},
|
27
|
+
};
|
28
|
+
</script>
|
29
|
+
|
30
|
+
<style lang="scss">
|
31
|
+
@import '../../../assets/palette';
|
32
|
+
|
33
|
+
.mg-text{
|
34
|
+
&--theme {
|
35
|
+
&-club {
|
36
|
+
> span {
|
37
|
+
background: map-get($palette, 'club');
|
38
|
+
-webkit-background-clip: text;
|
39
|
+
-webkit-text-fill-color: transparent;
|
40
|
+
}
|
41
|
+
}
|
42
|
+
}
|
43
|
+
}
|
44
|
+
</style>
|
@@ -6,6 +6,11 @@ export default {
|
|
6
6
|
component: MgParagraph,
|
7
7
|
// More on argTypes: https://storybook.js.org/docs/vue/api/argtypes
|
8
8
|
argTypes: {
|
9
|
+
theme: {
|
10
|
+
control: { type: 'select' },
|
11
|
+
options: [null, 'club'],
|
12
|
+
defaultValue: null
|
13
|
+
},
|
9
14
|
default: {
|
10
15
|
description: "The default Vue slot",
|
11
16
|
control: {
|
@@ -22,9 +27,10 @@ export default {
|
|
22
27
|
};
|
23
28
|
|
24
29
|
// More on component templates: https://storybook.js.org/docs/vue/writing-stories/introduction#using-args
|
25
|
-
const Template = args => ({
|
30
|
+
const Template = (args, { argTypes }) => ({
|
31
|
+
props: Object.keys(argTypes),
|
26
32
|
components: { MgParagraph },
|
27
|
-
template: `<mg-paragraph><template v-if="${'default' in args}" v-slot>${args.default}</template></mg-paragraph>`,
|
33
|
+
template: `<mg-paragraph v-bind="$props"><template v-if="${'default' in args}" v-slot>${args.default}</template></mg-paragraph>`,
|
28
34
|
});
|
29
35
|
|
30
36
|
export const Default = Template.bind({});
|
@@ -6,10 +6,21 @@
|
|
6
6
|
export default {
|
7
7
|
name: 'mg-paragraph',
|
8
8
|
|
9
|
+
props: {
|
10
|
+
theme: {
|
11
|
+
type: String,
|
12
|
+
default: null,
|
13
|
+
validator: function (value) {
|
14
|
+
return ['club'].indexOf(value) !== -1;
|
15
|
+
},
|
16
|
+
}
|
17
|
+
},
|
18
|
+
|
9
19
|
computed: {
|
10
20
|
classes() {
|
11
21
|
return {
|
12
22
|
'mg-paragraph': true,
|
23
|
+
'mg-paragraph--theme-club': this.theme === 'club',
|
13
24
|
};
|
14
25
|
}
|
15
26
|
},
|
@@ -17,9 +28,19 @@ export default {
|
|
17
28
|
</script>
|
18
29
|
|
19
30
|
<style lang="scss">
|
31
|
+
@import '../../../assets/palette';
|
32
|
+
|
20
33
|
.mg-paragraph {
|
21
34
|
font-family: 'Ubuntu', sans-serif;
|
22
|
-
font-size: 0.
|
35
|
+
font-size: 0.875rem;
|
23
36
|
font-weight: 400;
|
37
|
+
|
38
|
+
&--theme {
|
39
|
+
&-club {
|
40
|
+
background: map-get($palette, 'club');
|
41
|
+
-webkit-background-clip: text;
|
42
|
+
-webkit-text-fill-color: transparent;
|
43
|
+
}
|
44
|
+
}
|
24
45
|
}
|
25
46
|
</style>
|