@farm-investimentos/front-mfe-components 11.3.2 → 11.4.1

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": "11.3.2",
3
+ "version": "11.4.1",
4
4
  "author": "farm investimentos",
5
5
  "private": false,
6
6
  "main": "./dist/front-mfe-components.common.js",
@@ -22,7 +22,7 @@
22
22
  ],
23
23
  "dependencies": {
24
24
  "core-js": "^3.8.3",
25
- "vue": "^2.7.0",
25
+ "vue": "2.7.10",
26
26
  "vuetify": "^2.4.5",
27
27
  "vuetify-dialog": "^2.0.17"
28
28
  },
@@ -51,7 +51,7 @@
51
51
  "storybook-addon-designs": "^6.2.1",
52
52
  "typescript": "~4.1.5",
53
53
  "v-mask": "^2.3.0",
54
- "vue-template-compiler": "^2.7.0"
54
+ "vue-template-compiler": "2.7.10"
55
55
  },
56
56
  "browserslist": [
57
57
  "> 1%",
File without changes
@@ -0,0 +1,21 @@
1
+ import AlertBox from './AlertBox.vue';
2
+
3
+ export default {
4
+ title: 'Feedback/AlertBox',
5
+ component: AlertBox,
6
+ parameters: {
7
+ docs: {
8
+ description: {
9
+ component: `Alert Box<br />
10
+ selector: <em>farm-alertbox</em><br />
11
+ <span style="color: var(--farm-extra-1-base);">development</span>
12
+ `,
13
+ },
14
+ },
15
+ viewMode: 'docs',
16
+ },
17
+ };
18
+
19
+ export const Primary = () => ({
20
+ template: '<farm-alertbox>alert box</farm-alertbox>',
21
+ });
@@ -0,0 +1,16 @@
1
+ <template>
2
+ <div>alertbox</div>
3
+ </template>
4
+
5
+ <script lang="ts">
6
+ import Vue from 'vue';
7
+
8
+ export default Vue.extend({
9
+ name: 'farm-alertbox',
10
+ props: {},
11
+ setup() {},
12
+ });
13
+ </script>
14
+ <style lang="scss" scoped>
15
+ @import './AlertBox';
16
+ </style>
@@ -0,0 +1,20 @@
1
+ import { shallowMount } from '@vue/test-utils';
2
+ import AlertBox from '../AlertBox';
3
+
4
+ describe('AlertBox component', () => {
5
+ let wrapper;
6
+
7
+ beforeEach(() => {
8
+ wrapper = shallowMount(AlertBox, {});
9
+ });
10
+
11
+ test('Created hook', () => {
12
+ expect(wrapper).toBeDefined();
13
+ });
14
+
15
+ describe('mount component', () => {
16
+ it('renders correctly', () => {
17
+ expect(wrapper.element).toMatchSnapshot();
18
+ });
19
+ });
20
+ });
@@ -0,0 +1,4 @@
1
+ import AlertBox from './AlertBox.vue';
2
+
3
+ export { AlertBox };
4
+ export default AlertBox;
@@ -2,7 +2,6 @@ import { shallowMount } from '@vue/test-utils';
2
2
  import ChipInviteStatus from '../ChipInviteStatus.vue';
3
3
  describe('ChipInviteStatus component', () => {
4
4
  let wrapper;
5
- let component;
6
5
 
7
6
  beforeEach(() => {
8
7
  wrapper = shallowMount(ChipInviteStatus, {
@@ -10,7 +9,6 @@ describe('ChipInviteStatus component', () => {
10
9
  status: 10,
11
10
  },
12
11
  });
13
- component = wrapper.vm;
14
12
  });
15
13
  test('ChipInviteStatus created', () => {
16
14
  expect(wrapper).toBeDefined();
@@ -30,6 +30,14 @@
30
30
  @each $k in $theme-colors-list {
31
31
  &#{'[color=' + $k + ']'} {
32
32
  color: var(--farm-#{$k}-base);
33
+
34
+ &.farm-typography--lighten {
35
+ color: var(--farm-#{$k}-lighten);
36
+ }
37
+
38
+ &.farm-typography--darken {
39
+ color: var(--farm-#{$k}-darken);
40
+ }
33
41
  }
34
42
  }
35
43
 
@@ -59,5 +67,4 @@
59
67
  font-size: calc(#{$val} - 2px);
60
68
  }
61
69
  }
62
- }
63
-
70
+ }
@@ -105,6 +105,42 @@ export const Colors = () => ({
105
105
  </div>`,
106
106
  });
107
107
 
108
+ export const ColorsLighten = () => ({
109
+ data() {
110
+ return {
111
+ colors: [ ...colors, 'white'],
112
+ };
113
+ },
114
+ template: `<div>
115
+ <farm-typography
116
+ v-for="color in colors"
117
+ color-variation="lighten"
118
+ :color="color"
119
+ :key="'lighten' + color"
120
+ >
121
+ Typography - color {{ color }} lighten
122
+ </farm-typography>
123
+ </div>`,
124
+ });
125
+
126
+ export const ColorsDarken = () => ({
127
+ data() {
128
+ return {
129
+ colors: [...colors, 'white'],
130
+ };
131
+ },
132
+ template: `<div>
133
+ <farm-typography
134
+ v-for="color in colors"
135
+ color-variation="darken"
136
+ :color="color"
137
+ :key="'darken' + color"
138
+ >
139
+ Typography - color {{ color }} darken
140
+ </farm-typography>
141
+ </div>`,
142
+ });
143
+
108
144
  export const Tags = () => ({
109
145
  data() {
110
146
  return {
@@ -5,6 +5,8 @@
5
5
  'farm-typography': true,
6
6
  ['farm-typography--' + $props.size]: isSizeFromBreakpoints,
7
7
  ['farm-typography--weight-' + weight]: weight !== undefined,
8
+ 'farm-typography--lighten': colorVariation === 'lighten',
9
+ 'farm-typography--darken': colorVariation === 'darken',
8
10
  }"
9
11
  :style="style"
10
12
  :color="color"
@@ -54,6 +56,13 @@ export default Vue.extend({
54
56
  >,
55
57
  default: 'default',
56
58
  },
59
+ /**
60
+ * Color variation
61
+ */
62
+ colorVariation: {
63
+ type: String,
64
+ default: '',
65
+ },
57
66
  },
58
67
  setup(props) {
59
68
  const { size, lineHeight } = toRefs(props);
@@ -17,6 +17,14 @@ export const Primary = () => ({
17
17
  export const Structure = () => ({
18
18
  template: `
19
19
  <farm-container>
20
+ <farm-row>
21
+ <farm-col md="6" xs="12">
22
+ Main Filter
23
+ </farm-col>
24
+ <farm-col md="6" xs="12">
25
+ Botoes laterais
26
+ </farm-col>
27
+ </farm-row>
20
28
  <farm-box>
21
29
  Content<br />
22
30
  Content<br />
@@ -25,20 +33,20 @@ export const Structure = () => ({
25
33
  Content<br />
26
34
  </farm-box>
27
35
  <farm-row>
28
- <v-col md="6" lg="3">
36
+ <farm-col md="6" lg="3">
29
37
  coluna 1
30
- </v-col>
31
- <v-col md="6" lg="3">
38
+ </farm-col>›
39
+ <farm-col md="6" lg="3">
32
40
  coluna 2
33
- </v-col>
34
- <v-col md="6" lg="3">
41
+ </farm-col>
42
+ <farm-col md="6" lg="3">
35
43
  coluna 3
36
- </v-col>
37
- <v-col md="6" lg="3">
44
+ </farm-col>
45
+ <farm-col md="6" lg="3">
38
46
  coluna 4
39
- </v-col>
47
+ </farm-col>
40
48
  </farm-row>
41
- <farm-row>
49
+ <farm-row :extra-decrease="true">
42
50
  <farm-container-footer>
43
51
  Footer content
44
52
  </farm-container-footer>
@@ -1,13 +1,21 @@
1
1
  @import '../../../configurations/mixins.scss';
2
+ @import '../../../configurations/functions.scss';
2
3
 
3
4
  .farm-col {
4
- flex: 0 0 100%;
5
+ padding: 0 gutter('vuetify');
6
+ flex-basis: 0;
7
+ flex-grow: 1;
5
8
  max-width: 100%;
6
- padding: 0 24px;
7
9
 
8
10
  &--no-gutters {
9
11
  padding: 0;
10
12
  }
13
+
14
+ @each $k in $aligns {
15
+ &#{'--align-' + $k} {
16
+ align-self: $k!important;
17
+ }
18
+ }
11
19
  }
12
20
 
13
21
  @for $i from 1 through 12 {
@@ -1,4 +1,5 @@
1
1
  import Col from './Col.vue';
2
+ import { aligns } from '../../../configurations/flexVariables';
2
3
 
3
4
  export default {
4
5
  title: 'Layout/Col',
@@ -8,7 +9,7 @@ export default {
8
9
  description: {
9
10
  component: `Col<br />
10
11
  selector: <em>farm-col</em><br />
11
- <span style="color: var(--farm-extra-1-base);">development</span>
12
+ <span style="color: var(--farm-primary-base);">ready for use</span>
12
13
  `,
13
14
  },
14
15
  },
@@ -142,3 +143,16 @@ export const NoGutters = () => ({
142
143
  },
143
144
  template: '<farm-col :no-gutters="true" :style="style">col</farm-col>',
144
145
  });
146
+
147
+ export const AlignSelf = () => ({
148
+ data() {
149
+ return {
150
+ style,
151
+ aligns,
152
+ };
153
+ },
154
+ template: `
155
+ <farm-row style="height: 150px">
156
+ <farm-col :style="style" v-for="align in aligns" :key="align" :align-self="align">{{ align }}</farm-col>
157
+ </farm-row>`,
158
+ });
@@ -3,6 +3,7 @@
3
3
  :is="tag"
4
4
  :class="{
5
5
  'farm-col': true,
6
+ [`farm-col--align-${alignSelf}`]: alignSelf,
6
7
  [`farm-col--xl-${xl}`]: xl,
7
8
  [`farm-col--lg-${lg}`]: lg,
8
9
  [`farm-col--md-${md}`]: md,
@@ -66,6 +67,13 @@ export default Vue.extend({
66
67
  type: Boolean,
67
68
  default: false,
68
69
  },
70
+ /**
71
+ * Applies the align-items css property.
72
+ */
73
+ alignSelf: {
74
+ type: String as PropType<'start' | 'center' | 'end' | 'auto' | 'baseline' | 'stretch'>,
75
+ default: '',
76
+ },
69
77
  },
70
78
  inheritAttrs: true,
71
79
  });
@@ -6,27 +6,33 @@
6
6
  display: flex;
7
7
  flex-wrap: wrap;
8
8
  flex: 1 1 auto;
9
- margin-inline: -12px;
9
+
10
+ margin: 0 -#{gutter('vuetify')};
10
11
 
11
12
  @each $k in $aligns {
12
13
  &#{'--align-' + $k} {
13
- align-items: $k !important;
14
+ align-items: $k!important;
14
15
  }
15
16
  }
16
17
 
17
18
  @each $k in $align-contents {
18
19
  &#{'--align-content-' + $k} {
19
- align-content: $k !important;
20
+ align-content: $k!important;
20
21
  }
21
22
  }
22
23
 
23
24
  @each $k in $justifications {
24
25
  &#{'--justify-' + $k} {
25
- justify-content: $k !important;
26
+ justify-content: $k!important;
26
27
  }
27
28
  }
28
29
 
29
- &--no-gutters {
30
+ &--no-default-gutters {
30
31
  margin: 0;
31
32
  }
33
+
34
+ &--extra-decrease {
35
+ margin: 0 -#{2 * gutter('vuetify')};
36
+ }
37
+
32
38
  }
@@ -29,10 +29,10 @@ export const Align = () => ({
29
29
  },
30
30
  template: `<div>
31
31
  <farm-row :align="align" v-for="align in aligns" :key="'align_' + align">
32
- <v-col md="6">
32
+ <farm-col md="6">
33
33
  row align
34
34
  {{ align }}
35
- </v-col>
35
+ </farm-col>
36
36
  </farm-row>
37
37
  </div>`,
38
38
  });
@@ -45,10 +45,10 @@ export const AlignContent = () => ({
45
45
  },
46
46
  template: `<div>
47
47
  <farm-row :align-content="align" v-for="align in aligns" :key="'align-content-_' + align">
48
- <v-col md="6">
48
+ <farm-col md="6">
49
49
  row align-content
50
50
  {{ align }}
51
- </v-col>
51
+ </farm-col>
52
52
  </farm-row>
53
53
  </div>`,
54
54
  });
@@ -61,13 +61,13 @@ export const Justify = () => ({
61
61
  },
62
62
  template: `<div>
63
63
  <farm-row :justify="k" v-for="k in justifications" :key="'justify-_' + k">
64
- <v-col md="6">
64
+ <farm-col md="6">
65
65
  row justify {{ k }}
66
- </v-col>
66
+ </farm-col>
67
67
  </farm-row>
68
68
  </div>`,
69
69
  });
70
70
 
71
- export const NoGutters = () => ({
72
- template: '<farm-row :no-gutters="true">no gutters</farm-row>',
71
+ export const NoDefaultGutters = () => ({
72
+ template: '<farm-row :no-default-gutters="true">no gutters</farm-row>',
73
73
  });
@@ -6,7 +6,8 @@
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
+ 'farm-row--no-default-gutters': noDefaultGutters,
10
+ 'farm-row--extra-decrease': extraDecrease,
10
11
  }"
11
12
  >
12
13
  <slot></slot>
@@ -48,7 +49,14 @@ export default Vue.extend({
48
49
  /**
49
50
  * Remove default gutters
50
51
  */
51
- noGutters: {
52
+ noDefaultGutters: {
53
+ type: Boolean,
54
+ default: false,
55
+ },
56
+ /**
57
+ * Extra decrease margin
58
+ */
59
+ extraDecrease: {
52
60
  type: Boolean,
53
61
  default: false,
54
62
  },
@@ -28,7 +28,7 @@ $fontSizes: (
28
28
 
29
29
  $fontWeights: 100, 200, 300, 400, 500, 600, 700;
30
30
 
31
- $aligns: start, center, end, baseline, stretch;
32
- $align-contents: start, center, end, space-between, space-around, stretch;
33
- $justifications: start, center, end, space-between, space-around;
34
- $directions: row, row-reverse, column, column-reverse;
31
+ $aligns: start,center,end,auto,baseline,stretch;
32
+ $align-contents: start,center,end,space-between,space-around,stretch;
33
+ $justifications: start,center,end,space-between,space-around;
34
+ $directions: row,row-reverse,column,column-reverse;
@@ -1,4 +1,5 @@
1
1
  const directions = ['row', 'row-reverse', 'column', 'column-reverse'];
2
- const justifications = ['start', 'center', 'end', 'space-between', 'space-around'];
2
+ const justifications = ['start', 'center', 'end', 'auto', 'space-between', 'space-around'];
3
+ const aligns = ['start', 'center', 'end', 'auto', 'baseline', 'stretch'];
3
4
 
4
- export { directions, justifications };
5
+ export { aligns, directions, justifications };
package/src/main.ts CHANGED
@@ -49,6 +49,7 @@ export {
49
49
  IdCaption,
50
50
  };
51
51
 
52
+ export * from './components/AlertBox';
52
53
  export * from './components/AlertReload';
53
54
  export * from './components/ButtonToggle';
54
55
  export * from './components/Buttons/DefaultButton';