@magicgol/polyjuice 0.42.3 → 0.43.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.42.3",
3
+ "version": "0.43.0",
4
4
  "scripts": {
5
5
  "serve": "vue-cli-service serve",
6
6
  "build": "vue-cli-service build",
@@ -12,6 +12,7 @@ $palette: (
12
12
  'warning': #ff614c,
13
13
  'success': #349B50,
14
14
  'info': #004781,
15
+ 'highlighted': #ffdb59,
15
16
  // FOOTBALLERS
16
17
  'goalkeeper': #fcd777,
17
18
  'defender': #89f4a1,
@@ -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,40 @@
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
+
36
+ &--disabled {
37
+ opacity: 0.3 !important;
38
+ }
39
+ }
40
+ </style>