@magicgol/polyjuice 0.42.2 → 0.43.0

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magicgol/polyjuice",
3
- "version": "0.42.2",
3
+ "version": "0.43.0",
4
4
  "scripts": {
5
5
  "serve": "vue-cli-service serve",
6
6
  "build": "vue-cli-service build",
@@ -19,11 +19,11 @@
19
19
  },
20
20
  "devDependencies": {
21
21
  "@babel/core": "^7.17.9",
22
- "@storybook/addon-actions": "^6.5.10",
23
- "@storybook/addon-essentials": "^6.5.10",
24
- "@storybook/addon-links": "^6.5.10",
22
+ "@storybook/addon-actions": "^6.5.13",
23
+ "@storybook/addon-essentials": "^6.5.13",
24
+ "@storybook/addon-links": "^6.5.13",
25
25
  "@storybook/preset-scss": "^1.0.3",
26
- "@storybook/vue": "^6.5.10",
26
+ "@storybook/vue": "^6.5.13",
27
27
  "@vue/cli-plugin-babel": "~4.5.15",
28
28
  "@vue/cli-plugin-eslint": "~4.5.15",
29
29
  "@vue/cli-service": "~4.5.15",
@@ -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>
@@ -30,6 +30,10 @@ export default {
30
30
  placeholder: {
31
31
  type: String,
32
32
  default: null
33
+ },
34
+ error: {
35
+ type: Boolean,
36
+ default: false,
33
37
  }
34
38
  },
35
39
  computed: {
@@ -76,5 +80,9 @@ export default {
76
80
  &--focused {
77
81
  border-color: #444444 !important;
78
82
  }
83
+
84
+ &--errored {
85
+ border-color: map-get($palette, 'warning') !important;
86
+ }
79
87
  }
80
88
  </style>
@@ -65,7 +65,9 @@ export default {
65
65
  width: 1.375rem;
66
66
 
67
67
  svg {
68
- display: none;
68
+ fill: white;
69
+ height: 18px;
70
+ visibility: hidden;
69
71
  }
70
72
  }
71
73
 
@@ -75,9 +77,7 @@ export default {
75
77
  border-color: map-get($palette, 'brand');
76
78
 
77
79
  svg {
78
- display: block;
79
- fill: white;
80
- height: 18px;
80
+ visibility: visible;
81
81
  }
82
82
  }
83
83
  }