@farm-investimentos/front-mfe-components 10.1.1 → 10.1.3

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": "@farm-investimentos/front-mfe-components",
3
- "version": "10.1.1",
3
+ "version": "10.1.3",
4
4
  "author": "farm investimentos",
5
5
  "private": false,
6
6
  "main": "./dist/front-mfe-components.common.js",
@@ -11,6 +11,9 @@ export default Vue.extend({
11
11
  name: 'farm-card-content',
12
12
  props: {
13
13
  tag: { type: String, default: 'div' },
14
+ /**
15
+ * Add gutter
16
+ */
14
17
  gutter: {
15
18
  type: String as PropType<'none' | 'xs' | 'sm' | 'default' | 'md' | 'lg' | 'xl'>,
16
19
  default: 'default',
@@ -6,7 +6,6 @@ describe('Form component', () => {
6
6
 
7
7
  beforeEach(() => {
8
8
  wrapper = shallowMount(Form);
9
- component = wrapper.vm;
10
9
  });
11
10
 
12
11
  test('Created hook', () => {
@@ -7,7 +7,7 @@
7
7
  <farm-caption>
8
8
  {{ tooltip }}
9
9
  </farm-caption>
10
- <template v-slot:activator="">
10
+ <template v-slot:activator="{}">
11
11
  <farm-icon size="sm" color="gray">help-circle</farm-icon>
12
12
  </template>
13
13
  </farm-tooltip>
@@ -6,15 +6,31 @@
6
6
  max-width: 100%;
7
7
  transition: .2s cubic-bezier(.4, 0, .2, 1);
8
8
 
9
+ >div {
10
+ flex: 1 1 auto;
11
+ max-width: 100%;
12
+ position: relative;
13
+ }
14
+
9
15
  @each $k in $justifications {
10
16
  &#{'--justify-' + $k} {
11
- justify-content: $k;
17
+ >div {
18
+ justify-content: $k;
19
+ }
12
20
  }
13
21
  }
14
22
 
15
23
  @each $k in $directions {
16
24
  &#{'--direction-' + $k} {
17
- flex-direction: $k;
25
+ >div {
26
+ flex-direction: $k;
27
+ }
28
+ }
29
+ }
30
+
31
+ @each $k in map-keys($gutters) {
32
+ &#{'[gutter=' + $k + ']'} {
33
+ padding: map-get($gutters, $k);
18
34
  }
19
35
  }
20
36
  }
@@ -1,5 +1,6 @@
1
1
  import Box from './Box.vue';
2
2
  import { directions, justifications } from '../../../configurations/flexVariables';
3
+ import gutters from '../../../configurations/gutters';
3
4
 
4
5
  export default {
5
6
  title: 'Layout/Box',
@@ -64,3 +65,14 @@ export const Directions = () => ({
64
65
  </farm-box>
65
66
  </div>`,
66
67
  });
68
+
69
+ export const Gutters = () => ({
70
+ data() {
71
+ return { gutters };
72
+ },
73
+ template: `<div style="width: 480px;">
74
+ <farm-box v-for="gutter in gutters" :key="gutter" :gutter="gutter" style="margin-bottom: 16px">
75
+ box with gutter {{ gutter }}
76
+ </farm-box>
77
+ </div>`,
78
+ });
@@ -6,8 +6,11 @@
6
6
  [`farm-box--justify-${justify}`]: justify,
7
7
  [`farm-box--direction-${direction}`]: direction,
8
8
  }"
9
+ :gutter="gutter"
9
10
  >
10
- <slot></slot>
11
+ <div>
12
+ <slot></slot>
13
+ </div>
11
14
  </component>
12
15
  </template>
13
16
  <script lang="ts">
@@ -34,6 +37,13 @@ export default Vue.extend({
34
37
  type: String as PropType<'start' | 'center' | 'end' | 'space-between' | 'space-around'>,
35
38
  default: '',
36
39
  },
40
+ /**
41
+ * Add gutter
42
+ */
43
+ gutter: {
44
+ type: String as PropType<'none' | 'xs' | 'sm' | 'default' | 'md' | 'lg' | 'xl' | 'ds'>,
45
+ default: 'none',
46
+ },
37
47
  },
38
48
  inheritAttrs: true,
39
49
  });
@@ -6,7 +6,6 @@ describe('Box component', () => {
6
6
 
7
7
  beforeEach(() => {
8
8
  wrapper = shallowMount(Box);
9
- component = wrapper.vm;
10
9
  });
11
10
 
12
11
  test('Created hook', () => {
@@ -6,7 +6,6 @@ describe('Col component', () => {
6
6
 
7
7
  beforeEach(() => {
8
8
  wrapper = shallowMount(Col);
9
- component = wrapper.vm;
10
9
  });
11
10
 
12
11
  test('Created hook', () => {
@@ -93,8 +93,8 @@ The _mixins.scss contains mixins for media query, to abstract the breakpoints an
93
93
  @import '@farm-investimentos/front-mfe-components/src/configurations/_mixins.scss';
94
94
 
95
95
  @include fromSm { // min-width: 960px <br />
96
- .product-limit {<br />
97
- text-align: center;<br />
98
- }<br />
96
+ &emsp;.product-limit {<br />
97
+ &emsp;&emsp;text-align: center;<br />
98
+ &emsp;}<br />
99
99
  }
100
100
  </code>
@@ -0,0 +1,30 @@
1
+ import { Meta } from '@storybook/addon-docs';
2
+
3
+ <Meta title="Layout/Props Values" />
4
+
5
+ # About
6
+ Many components have props that accepts strings as values instead of passa a numeric values.
7
+ Example:
8
+ <code>
9
+ &#x3C;my-component some-prop=&#x22;md&#x22; /&#x3E;<br />
10
+ //"md" will be used as 12px in the CSS
11
+ </code>
12
+ <br /><br />
13
+
14
+ ## Gutter
15
+ * none: 0
16
+ * xs: 4px
17
+ * sm: 8px
18
+ * vuetify: 12px
19
+ * md: 16px
20
+ * lg: 24px
21
+ * xl: 32px
22
+ * default: 24px
23
+
24
+ ## Font Size
25
+ * xs: 8px
26
+ * sm: 12px
27
+ * md: 14px
28
+ * default: 16px
29
+ * lg: 20px
30
+ * xl: 24px
@@ -25,4 +25,8 @@
25
25
  justify-content: $k !important;
26
26
  }
27
27
  }
28
+
29
+ &--no-gutters {
30
+ margin: 0;
31
+ }
28
32
  }
@@ -67,3 +67,7 @@ export const Justify = () => ({
67
67
  </farm-row>
68
68
  </div>`,
69
69
  });
70
+
71
+ export const NoGutters = () => ({
72
+ template: '<farm-row :no-gutters="true">no gutters</farm-row>',
73
+ });
@@ -6,6 +6,7 @@
6
6
  [`farm-row--align-${align}`]: align,
7
7
  [`farm-row--align-content-${alignContent}`]: alignContent,
8
8
  [`farm-row--justify-${justify}`]: justify,
9
+ 'farm-row--no-gutters': noGutters,
9
10
  }"
10
11
  >
11
12
  <slot></slot>
@@ -44,10 +45,17 @@ export default Vue.extend({
44
45
  type: String as PropType<'start' | 'center' | 'end' | 'space-between' | 'space-around'>,
45
46
  default: '',
46
47
  },
48
+ /**
49
+ * Remove default gutters
50
+ */
51
+ noGutters: {
52
+ type: Boolean,
53
+ default: false,
54
+ },
47
55
  },
48
56
  inheritAttrs: true,
49
57
  });
50
58
  </script>
51
59
  <style lang="scss" scoped>
52
- @import 'Row.scss';
60
+ @import 'Row';
53
61
  </style>
@@ -6,7 +6,6 @@ describe('Row component', () => {
6
6
 
7
7
  beforeEach(() => {
8
8
  wrapper = shallowMount(Row);
9
- component = wrapper.vm;
10
9
  });
11
10
 
12
11
  test('Created hook', () => {
@@ -10,10 +10,11 @@ $gutters: (
10
10
  "none": 0,
11
11
  "xs": 4px,
12
12
  "sm": 8px,
13
- "default": 12px,
13
+ "vuetify": 12px,
14
14
  "md": 16px,
15
15
  "lg": 24px,
16
- "xl": 32px
16
+ "xl": 32px,
17
+ "default": 24px,
17
18
  );
18
19
 
19
20
  $fontSizes: (
@@ -1 +1 @@
1
- export default ['none', 'xs', 'sm', 'md', 'lg', 'xl'];
1
+ export default ['none', 'xs', 'sm', 'vuetify', 'md', 'lg', 'xl', 'default'];