@magicgol/polyjuice 0.48.0 → 0.49.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magicgol/polyjuice",
3
- "version": "0.48.0",
3
+ "version": "0.49.0",
4
4
  "scripts": {
5
5
  "serve": "vue-cli-service serve",
6
6
  "build": "vue-cli-service build",
@@ -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>