@magicgol/polyjuice 0.42.3 → 0.43.1
Sign up to get free protection for your applications and to get access to all the features.
package/package.json
CHANGED
package/src/assets/palette.scss
CHANGED
@@ -0,0 +1,35 @@
|
|
1
|
+
import MgHighlighter from './Highlighter.vue';
|
2
|
+
|
3
|
+
// More on default export: https://storybook.js.org/docs/vue/writing-stories/introduction#default-export
|
4
|
+
export default {
|
5
|
+
title: 'Components/Highlighter',
|
6
|
+
component: MgHighlighter,
|
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: { MgHighlighter },
|
28
|
+
template: `<mg-highlighter v-bind="$props"><template v-if="${'default' in args}" v-slot>${args.default}</template></mg-highlighter>`,
|
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
|
+
default: 'etichetta'
|
35
|
+
};
|
@@ -0,0 +1,43 @@
|
|
1
|
+
<template>
|
2
|
+
<div
|
3
|
+
class="rounded p-2"
|
4
|
+
:class="classes"
|
5
|
+
><slot></slot></div>
|
6
|
+
</template>
|
7
|
+
|
8
|
+
<script>
|
9
|
+
export default {
|
10
|
+
name: 'mg-highlighter',
|
11
|
+
|
12
|
+
props: {
|
13
|
+
disabled: {
|
14
|
+
type: Boolean,
|
15
|
+
default: false
|
16
|
+
},
|
17
|
+
},
|
18
|
+
|
19
|
+
computed: {
|
20
|
+
classes() {
|
21
|
+
return {
|
22
|
+
'mg-highlighter': true,
|
23
|
+
'mg-highlighter--disabled': this.disabled === true,
|
24
|
+
};
|
25
|
+
}
|
26
|
+
},
|
27
|
+
};
|
28
|
+
</script>
|
29
|
+
|
30
|
+
<style lang="scss">
|
31
|
+
@import '../../../assets/palette';
|
32
|
+
|
33
|
+
.mg-highlighter {
|
34
|
+
background-color: map-get($palette, 'highlighted');
|
35
|
+
font-family: Ubuntu, sans-serif;
|
36
|
+
font-size: 16px;
|
37
|
+
font-weight: 700;
|
38
|
+
|
39
|
+
&--disabled {
|
40
|
+
opacity: 0.3 !important;
|
41
|
+
}
|
42
|
+
}
|
43
|
+
</style>
|