@farm-investimentos/front-mfe-components 10.1.2 → 10.1.4

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.2",
3
+ "version": "10.1.4",
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',
@@ -0,0 +1,20 @@
1
+ div {
2
+ border-top: 1px solid var(--farm-stroke-divider);
3
+ padding: 64px 24px 32px;
4
+ display: flex;
5
+ flex-direction: column;
6
+ justify-content: center;
7
+ text-align: center;
8
+
9
+ p:first-of-type {
10
+ margin: 24px auto 16px;
11
+ }
12
+
13
+ p:last-child {
14
+ color: var(--farm-text-secondary);
15
+ }
16
+
17
+ .farm-icon.farm-icon--primary {
18
+ color: var(--farm-text-disabled);
19
+ }
20
+ }
@@ -3,13 +3,24 @@ import DataTableEmptyWrapper from './DataTableEmptyWrapper.vue';
3
3
  export default {
4
4
  title: 'Display/Table/DataTableEmptyWrapper',
5
5
  component: DataTableEmptyWrapper,
6
+ parameters: {
7
+ docs: {
8
+ description: {
9
+ component: `Message for empty list/data<br />
10
+ selector: <em>farm-emptywrapper</em><br />
11
+ <span style="color: var(--farm-primary-base);">ready for use</span>
12
+ `,
13
+ },
14
+ },
15
+ viewMode: 'docs',
16
+ },
6
17
  };
7
18
 
8
19
  export const Primary = () => ({
9
- template: '<DataTableEmptyWrapper />',
20
+ template: '<farm-emptywrapper />',
10
21
  });
11
22
 
12
23
  export const CustomTitles = () => ({
13
24
  template:
14
- '<DataTableEmptyWrapper title="Título customizado" subtitle="Subtítulo customizado" />',
25
+ '<farm-emptywrapper title="Título customizado" subtitle="Subtítulo customizado" />',
15
26
  });
@@ -1,27 +1,25 @@
1
1
  <template>
2
- <div align="center">
3
- <v-icon>mdi-magnify</v-icon>
4
- <p>{{ title }}</p>
5
- <p>{{ subtitle }}</p>
2
+ <div>
3
+ <farm-icon size="lg">magnify</farm-icon>
4
+ <farm-caption bold>{{ title }}</farm-caption>
5
+ <farm-caption variation="regular" v-if="subtitle">{{ subtitle }}</farm-caption>
6
6
  </div>
7
7
  </template>
8
- <script>
9
- import { VIcon } from 'vuetify/lib/components/VIcon';
10
- /**
11
- * Componente de lista vazia
12
- */
13
- export default {
14
- name: 'DataTableEmptyWrapper',
8
+ <script lang="ts">
9
+ import Vue from 'vue';
10
+
11
+ export default Vue.extend({
12
+ name: 'farm-emptywrapper',
15
13
  props: {
16
14
  /**
17
- * Título
15
+ * Title
18
16
  */
19
17
  title: {
20
18
  type: String,
21
19
  default: 'Nenhuma informação para exibir aqui',
22
20
  },
23
- /**
24
- * Subtítulo
21
+ /**
22
+ * Subtitle
25
23
  */
26
24
  subtitle: {
27
25
  type: String,
@@ -29,31 +27,8 @@ export default {
29
27
  'Tente filtrar novamente sua pesquisa ou faça uma importação para ver mais resultados',
30
28
  },
31
29
  },
32
- components: {
33
- VIcon,
34
- },
35
- };
30
+ });
36
31
  </script>
37
32
  <style scoped lang="scss">
38
- div {
39
- border-top: 1px solid var(--v-gray-lighten2);
40
- padding: 3rem 1rem;
41
- .v-icon {
42
- margin-top: 1rem;
43
- font-size: 2.625rem;
44
- color: var(--v-gray-lighten2);
45
- }
46
- p:nth-child(2) {
47
- color: var(--v-primary-base);
48
- font-weight: 700;
49
- font-size: 0.75rem;
50
- margin-top: 1rem;
51
- }
52
- p:nth-child(3) {
53
- color: var(--v-gray-base);
54
- font-weight: 400;
55
- font-size: 0.625rem;
56
- margin-bottom: 1rem;
57
- }
58
- }
33
+ @import './DataTableEmptyWrapper';
59
34
  </style>
@@ -9,7 +9,8 @@ export default {
9
9
  docs: {
10
10
  description: {
11
11
  component: `Paginator with items per page select<br />
12
- selector: <em>farm-datatable-paginator</em>
12
+ selector: <em>farm-datatable-paginator</em><br />
13
+ <span style="color: var(--farm-primary-base);">ready for use</span>
13
14
  `,
14
15
  },
15
16
  },
@@ -22,10 +23,9 @@ export default {
22
23
  };
23
24
 
24
25
  export const Primary = () => ({
25
- components: { DataTablePaginator },
26
26
  data() {
27
27
  return {
28
- totalPages: 8
28
+ totalPages: 8,
29
29
  };
30
30
  },
31
31
  template: '<DataTablePaginator :totalPages="totalPages" :page="1" />',
@@ -33,46 +33,18 @@ export const Primary = () => ({
33
33
  setTimeout(() => {
34
34
  this.totalPages = 0;
35
35
  }, 1000);
36
- }
36
+ },
37
37
  });
38
38
 
39
39
  export const Secondary = () => ({
40
- components: { DataTablePaginator },
41
40
  template: '<DataTablePaginator :hidePerPageOptions="true" :totalPages="190000" :page="1" />',
42
41
  });
43
42
 
44
43
  export const Disabled = () => ({
45
- components: { DataTablePaginator },
46
44
  template: '<DataTablePaginator :disabled="true":totalPages="19" :page="1" />',
47
45
  });
48
46
 
49
47
  export const CustomPerPage = () => ({
50
- components: { DataTablePaginator },
51
48
  template:
52
49
  '<DataTablePaginator :perPageOptions="[1, 2, 4, 12, 27]" :totalPages="19" :page="1" />',
53
50
  });
54
-
55
- const parameters = {
56
- design: {
57
- type: 'figma',
58
- url: 'https://www.figma.com/file/1f84J4m1IBghWhozQvdyyt/%E2%9C%8D---Design-System?node-id=1503%3A921',
59
- },
60
- };
61
-
62
- Primary.story = {
63
- name: 'Básico',
64
- parameters,
65
- };
66
- Secondary.story = {
67
- name: 'Sem limite por páginas',
68
- parameters,
69
- };
70
- Disabled.story = {
71
- name: 'Desabilitado',
72
- parameters,
73
- };
74
- CustomPerPage.story = {
75
- name: 'Lista de registros por página customizada',
76
- parameters,
77
- };
78
-
@@ -4,7 +4,7 @@
4
4
  <div
5
5
  :class="{ idcaption__body: true, 'idcaption__body--single': !hasTitle || !hasSubtitle }"
6
6
  >
7
- <farm-caption bold variation="medium" v-if="hasTitle">
7
+ <farm-caption variation="medium" v-if="hasTitle">
8
8
  <span>
9
9
  {{ $slots.title ? $slots.title[0].text : null }}
10
10
  <farm-btn icon color="gray" v-if="link" @click="$emit('onLinkClick')">
@@ -27,4 +27,10 @@
27
27
  }
28
28
  }
29
29
  }
30
+
31
+ @each $k in map-keys($gutters) {
32
+ &#{'[gutter=' + $k + ']'} {
33
+ padding: map-get($gutters, $k);
34
+ }
35
+ }
30
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,6 +6,7 @@
6
6
  [`farm-box--justify-${justify}`]: justify,
7
7
  [`farm-box--direction-${direction}`]: direction,
8
8
  }"
9
+ :gutter="gutter"
9
10
  >
10
11
  <div>
11
12
  <slot></slot>
@@ -36,6 +37,13 @@ export default Vue.extend({
36
37
  type: String as PropType<'start' | 'center' | 'end' | 'space-between' | 'space-around'>,
37
38
  default: '',
38
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
+ },
39
47
  },
40
48
  inheritAttrs: true,
41
49
  });
@@ -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>
@@ -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'];