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

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.
Files changed (28) hide show
  1. package/dist/front-mfe-components.common.js +255 -234
  2. package/dist/front-mfe-components.common.js.map +1 -1
  3. package/dist/front-mfe-components.css +1 -1
  4. package/dist/front-mfe-components.umd.js +255 -234
  5. package/dist/front-mfe-components.umd.js.map +1 -1
  6. package/dist/front-mfe-components.umd.min.js +1 -1
  7. package/dist/front-mfe-components.umd.min.js.map +1 -1
  8. package/package.json +1 -1
  9. package/src/components/Card/CardContent/CardContent.vue +5 -2
  10. package/src/components/DialogHeader/DialogHeader.scss +4 -2
  11. package/src/components/DialogHeader/DialogHeader.vue +3 -5
  12. package/src/components/Form/Form.vue +1 -1
  13. package/src/components/Form/__tests__/Form.spec.js +0 -2
  14. package/src/components/ListItem/ListItem.stories.js +1 -1
  15. package/src/components/MainFilter/MainFilter.scss +5 -1
  16. package/src/components/MainFilter/MainFilter.stories.js +23 -1
  17. package/src/components/MainFilter/MainFilter.vue +16 -5
  18. package/src/components/Modal/Modal.scss +2 -1
  19. package/src/components/Modal/Modal.vue +1 -1
  20. package/src/components/Tooltip/Tooltip.scss +12 -11
  21. package/src/components/Tooltip/Tooltip.stories.js +12 -38
  22. package/src/components/Tooltip/Tooltip.vue +18 -17
  23. package/src/components/layout/Box/Box.scss +12 -2
  24. package/src/components/layout/Box/Box.vue +3 -1
  25. package/src/components/layout/Box/__tests__/Box.spec.js +0 -2
  26. package/src/components/layout/Col/__tests__/Col.spec.js +0 -2
  27. package/src/components/layout/Row/__tests__/Row.spec.js +0 -2
  28. package/src/configurations/_variables.scss +2 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@farm-investimentos/front-mfe-components",
3
- "version": "10.1.0",
3
+ "version": "10.1.2",
4
4
  "author": "farm investimentos",
5
5
  "private": false,
6
6
  "main": "./dist/front-mfe-components.common.js",
@@ -5,13 +5,16 @@
5
5
  </template>
6
6
 
7
7
  <script lang="ts">
8
- import Vue from 'vue';
8
+ import Vue, { PropType } from 'vue';
9
9
 
10
10
  export default Vue.extend({
11
11
  name: 'farm-card-content',
12
12
  props: {
13
13
  tag: { type: String, default: 'div' },
14
- gutter: { type: String, default: 'default' },
14
+ gutter: {
15
+ type: String as PropType<'none' | 'xs' | 'sm' | 'default' | 'md' | 'lg' | 'xl'>,
16
+ default: 'default',
17
+ },
15
18
  },
16
19
  inheritAttrs: true,
17
20
  });
@@ -14,6 +14,8 @@ header {
14
14
  padding: 16px;
15
15
  background-color: #fff;
16
16
  font-weight: 700;
17
- color: var(--v-secondary-base);
18
- border-bottom: 1px solid #d6d6d6;
17
+ color: var(--farm-primary-base);
18
+ border-bottom: 1px solid var(--farm-stroke-divider);
19
+ display: flex;
20
+ justify-content: flex-start;
19
21
  }
@@ -1,7 +1,9 @@
1
1
  <template>
2
2
  <header>
3
3
  <farm-icon v-if="iconTitle" size="16px" color="secondary">{{ iconTitle }}</farm-icon>
4
- {{ title }}
4
+ <farm-caption v-if="title" variation="regular" bold>
5
+ {{ title }}
6
+ </farm-caption>
5
7
 
6
8
  <slot></slot>
7
9
 
@@ -19,7 +21,6 @@
19
21
  </template>
20
22
  <script lang="ts">
21
23
  import Vue from 'vue';
22
- import Icon from '../Icon';
23
24
  /**
24
25
  * Header de dialog/modal
25
26
  */
@@ -48,9 +49,6 @@ export default Vue.extend({
48
49
  default: true,
49
50
  },
50
51
  },
51
- components: {
52
- 'farm-icon': Icon,
53
- },
54
52
  methods: {
55
53
  onClose() {
56
54
  this.$emit('onClose', {});
@@ -9,7 +9,7 @@ type ErrorsBag = Record<number, boolean>;
9
9
  export default Vue.extend({
10
10
  name: 'farm-form',
11
11
  props: {
12
- value: { type: [Array, Boolean], required: true },
12
+ value: { type: [Boolean], required: true },
13
13
  },
14
14
  inheritAttrs: true,
15
15
  setup(props, { emit }) {
@@ -3,11 +3,9 @@ import Form from '../Form';
3
3
 
4
4
  describe('Form component', () => {
5
5
  let wrapper;
6
- let component;
7
6
 
8
7
  beforeEach(() => {
9
8
  wrapper = shallowMount(Form);
10
- component = wrapper.vm;
11
9
  });
12
10
 
13
11
  test('Created hook', () => {
@@ -55,7 +55,7 @@ export const ClickableCursor = () => ({
55
55
  export const ClickListener = () => ({
56
56
  methods: {
57
57
  onClick() {
58
- alert('Clicked')
58
+ alert('Clicked');
59
59
  }
60
60
  },
61
61
  template:
@@ -10,6 +10,10 @@ section {
10
10
  border: 0;
11
11
  }
12
12
 
13
+ .farm-tooltip {
14
+ margin-left: 4px;
15
+ }
16
+
13
17
  }
14
18
 
15
19
  @media screen and (max-width: 600px) {
@@ -22,4 +26,4 @@ section {
22
26
  margin-top: 0 !important;
23
27
  }
24
28
  }
25
- }
29
+ }
@@ -3,6 +3,17 @@ import MainFilter from './MainFilter.vue';
3
3
  export default {
4
4
  title: 'Form/MainFilter',
5
5
  component: MainFilter,
6
+ parameters: {
7
+ docs: {
8
+ description: {
9
+ component: `Main Filter<br />
10
+ selector: <em>farm-form-mainfilter</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 = () => ({
@@ -17,7 +28,6 @@ export const CustomLabel = () => ({
17
28
  template: '<farm-form-mainfilter label="Custom" />',
18
29
  });
19
30
 
20
-
21
31
  export const MainFilters = () => ({
22
32
  data() {
23
33
  return {
@@ -32,3 +42,15 @@ export const MainFilters = () => ({
32
42
  </section>
33
43
  </div>`,
34
44
  });
45
+
46
+ export const Tooltip = () => ({
47
+ data() {
48
+ return {
49
+ text: 'Some long tooltip text to be placed here!',
50
+ };
51
+ },
52
+ template: `
53
+ <div style="max-width: 480px; padding-top: 32px; margin-left: 32px;">
54
+ <farm-form-mainfilter label="Label" :tooltip="text" />
55
+ </div>`,
56
+ });
@@ -3,12 +3,16 @@
3
3
  <fieldset v-if="hasInitialInput">
4
4
  <farm-label :for="elementId">
5
5
  {{ label }}
6
+ <farm-tooltip v-if="tooltip">
7
+ <farm-caption>
8
+ {{ tooltip }}
9
+ </farm-caption>
10
+ <template v-slot:activator="{}">
11
+ <farm-icon size="sm" color="gray">help-circle</farm-icon>
12
+ </template>
13
+ </farm-tooltip>
6
14
  </farm-label>
7
- <farm-textfield
8
- v-model="inputValue"
9
- :id="elementId"
10
- @keyup="onKeyUp"
11
- />
15
+ <farm-textfield v-model="inputValue" :id="elementId" @keyup="onKeyUp" />
12
16
  </fieldset>
13
17
  <farm-btn
14
18
  v-if="hasExtraFilters"
@@ -65,6 +69,13 @@ export default Vue.extend({
65
69
  type: Boolean,
66
70
  default: false,
67
71
  },
72
+ /**
73
+ * Tooltip text
74
+ */
75
+ tooltip: {
76
+ type: String,
77
+ default: null,
78
+ },
68
79
  },
69
80
 
70
81
  watch: {
@@ -18,7 +18,8 @@
18
18
  left: 0;
19
19
  width: 100vw;
20
20
  height: 100vh;
21
- background: rgba(#999999, 0.8);
21
+ opacity: 0.46;
22
+ background-color: rgb(33, 33, 33) !important;
22
23
  z-index: 101;
23
24
  }
24
25
 
@@ -25,7 +25,7 @@ export default Vue.extend({
25
25
  /**
26
26
  * v-model binding
27
27
  */
28
- value: { type: Boolean, required: true, default: true },
28
+ value: { type: Boolean, required: true, default: false },
29
29
  /**
30
30
  * Is persistent
31
31
  */
@@ -1,8 +1,20 @@
1
+ @import '../../configurations/theme-colors';
1
2
  @import '../../configurations/variables';
2
3
 
3
4
  .farm-tooltip {
4
5
  display: inline-block;
5
6
  position: relative;
7
+
8
+ @each $color in $colors {
9
+ @each $color in $theme-colors-list {
10
+
11
+ &--#{$color} {
12
+ .farm-tooltip__popup {
13
+ background-color: themeColor($color);
14
+ }
15
+ }
16
+ }
17
+ }
6
18
  }
7
19
 
8
20
  .farm-tooltip__popup {
@@ -22,15 +34,4 @@
22
34
  opacity: 1;
23
35
  visibility: visible;
24
36
  }
25
-
26
- }
27
-
28
-
29
- @each $color in $colors {
30
- #{'.farm-tooltip--' + $color} {
31
- .farm-tooltip__popup {
32
- background-color: var(--v-#{$color}-base);
33
-
34
- }
35
- }
36
37
  }
@@ -1,25 +1,29 @@
1
1
  import { withDesign } from 'storybook-addon-designs';
2
2
  import Tooltip from '.';
3
- import colors from '../../configurations/colors';
4
-
3
+ import baseThemeColors from '../../configurations/_theme-colors-base.scss';
4
+ const colors = Object.keys(baseThemeColors);
5
5
 
6
6
  export default {
7
- title: 'Interactions/Tooltip',
8
- component: Tooltip,
9
- decorators: [withDesign],
10
- parameters: {
7
+ title: 'Interactions/Tooltip',
8
+ component: Tooltip,
9
+ decorators: [withDesign],
10
+ parameters: {
11
11
  docs: {
12
12
  description: {
13
13
  component: `Tooltip<br />
14
- selector: <em>farm-tooltip</em>
14
+ selector: <em>farm-tooltip</em><br />
15
+ <span style="color: var(--farm-primary-base);">ready for use</span>
15
16
  `,
16
17
  },
17
18
  },
19
+ design: {
20
+ type: 'figma',
21
+ url: 'https://www.figma.com/file/p62YDSTfWg0Mcnf5APfdvI/%E2%9C%8D-Design-System-%7C-v2?node-id=3779%3A6131',
22
+ },
18
23
  viewMode: 'docs',
19
24
  },
20
25
  };
21
26
 
22
-
23
27
  export const Tooltips = () => ({
24
28
  data() {
25
29
  return {
@@ -79,33 +83,3 @@ export const Visibility = () => ({
79
83
  </farm-tooltip>
80
84
  </div>`,
81
85
  });
82
-
83
- Tooltips.story = {
84
- name: 'Colors',
85
- parameters: {
86
- design: {
87
- type: 'figma',
88
- url: 'https://www.figma.com/file/p62YDSTfWg0Mcnf5APfdvI/%E2%9C%8D-Design-System-%7C-v2?node-id=3779%3A6131',
89
- },
90
- },
91
- };
92
-
93
- Iconed.story = {
94
- name: 'Iconed',
95
- parameters: {
96
- design: {
97
- type: 'figma',
98
- url: 'https://www.figma.com/file/p62YDSTfWg0Mcnf5APfdvI/%E2%9C%8D-Design-System-%7C-v2?node-id=3779%3A6131',
99
- },
100
- },
101
- };
102
-
103
- Visibility.story = {
104
- name: 'Visibility',
105
- parameters: {
106
- design: {
107
- type: 'figma',
108
- url: 'https://www.figma.com/file/p62YDSTfWg0Mcnf5APfdvI/%E2%9C%8D-Design-System-%7C-v2?node-id=3779%3A6131',
109
- },
110
- },
111
- };
@@ -9,7 +9,8 @@
9
9
  <span
10
10
  :class="{
11
11
  'farm-tooltip__popup': true,
12
- 'farm-tooltip__popup--visible': (!externalControl && showOver) || (externalControl && toggleComponent),
12
+ 'farm-tooltip__popup--visible':
13
+ (!externalControl && showOver) || (externalControl && toggleComponent),
13
14
  }"
14
15
  >
15
16
  <slot></slot>
@@ -29,32 +30,32 @@ export default Vue.extend({
29
30
  type: String as PropType<
30
31
  | 'primary'
31
32
  | 'secondary'
32
- | 'error'
33
- | 'extra'
34
- | 'accent'
33
+ | 'neutral'
35
34
  | 'info'
36
35
  | 'success'
37
- | 'gray'
38
- | 'yellow'
39
- | 'white'
36
+ | 'error'
37
+ | 'warning'
38
+ | 'success'
39
+ | 'extra-1'
40
+ | 'extra-2'
40
41
  >,
41
- default: 'gray',
42
+ default: 'secondary',
42
43
  },
43
44
  /**
44
45
  * Control visibility
46
+ * v-model bind
45
47
  */
46
- value: {},
48
+ value: {
49
+ type: Boolean,
50
+ default: undefined,
51
+ },
47
52
  },
48
53
  setup(props) {
49
54
  const parent = ref(null);
50
55
  const showOver = ref(false);
51
56
 
52
- const toggleComponent = computed(() => {
53
- return props.value;
54
- });
55
- const externalControl = computed(() => {
56
- return typeof props.value === 'boolean';
57
- });
57
+ const toggleComponent = computed(() => props.value);
58
+ const externalControl = computed(() => props.value !== undefined);
58
59
 
59
60
  const onOver = () => {
60
61
  showOver.value = true;
@@ -66,10 +67,10 @@ export default Vue.extend({
66
67
  return {
67
68
  parent,
68
69
  showOver,
69
- onOver,
70
- onOut,
71
70
  toggleComponent,
72
71
  externalControl,
72
+ onOver,
73
+ onOut,
73
74
  };
74
75
  },
75
76
  });
@@ -6,15 +6,25 @@
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
+ }
18
28
  }
19
29
  }
20
30
  }
@@ -7,7 +7,9 @@
7
7
  [`farm-box--direction-${direction}`]: direction,
8
8
  }"
9
9
  >
10
- <slot></slot>
10
+ <div>
11
+ <slot></slot>
12
+ </div>
11
13
  </component>
12
14
  </template>
13
15
  <script lang="ts">
@@ -3,11 +3,9 @@ import Box from '../Box';
3
3
 
4
4
  describe('Box component', () => {
5
5
  let wrapper;
6
- let component;
7
6
 
8
7
  beforeEach(() => {
9
8
  wrapper = shallowMount(Box);
10
- component = wrapper.vm;
11
9
  });
12
10
 
13
11
  test('Created hook', () => {
@@ -3,11 +3,9 @@ import Col from '../Col';
3
3
 
4
4
  describe('Col component', () => {
5
5
  let wrapper;
6
- let component;
7
6
 
8
7
  beforeEach(() => {
9
8
  wrapper = shallowMount(Col);
10
- component = wrapper.vm;
11
9
  });
12
10
 
13
11
  test('Created hook', () => {
@@ -3,11 +3,9 @@ import Row from '../Row';
3
3
 
4
4
  describe('Row component', () => {
5
5
  let wrapper;
6
- let component;
7
6
 
8
7
  beforeEach(() => {
9
8
  wrapper = shallowMount(Row);
10
- component = wrapper.vm;
11
9
  });
12
10
 
13
11
  test('Created hook', () => {
@@ -9,9 +9,9 @@ $sizes: (
9
9
  $gutters: (
10
10
  "none": 0,
11
11
  "xs": 4px,
12
- 'sm': 8px,
12
+ "sm": 8px,
13
13
  "default": 12px,
14
- 'md': 16px,
14
+ "md": 16px,
15
15
  "lg": 24px,
16
16
  "xl": 32px
17
17
  );