@farm-investimentos/front-mfe-components 10.1.0 → 10.1.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/dist/front-mfe-components.common.js +232 -210
- package/dist/front-mfe-components.common.js.map +1 -1
- package/dist/front-mfe-components.css +1 -1
- package/dist/front-mfe-components.umd.js +232 -210
- package/dist/front-mfe-components.umd.js.map +1 -1
- package/dist/front-mfe-components.umd.min.js +1 -1
- package/dist/front-mfe-components.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Card/CardContent/CardContent.vue +5 -2
- package/src/components/DialogHeader/DialogHeader.scss +4 -2
- package/src/components/DialogHeader/DialogHeader.vue +3 -5
- package/src/components/Form/Form.vue +1 -1
- package/src/components/Form/__tests__/Form.spec.js +0 -1
- package/src/components/ListItem/ListItem.stories.js +1 -1
- package/src/components/MainFilter/MainFilter.scss +5 -1
- package/src/components/MainFilter/MainFilter.stories.js +23 -1
- package/src/components/MainFilter/MainFilter.vue +16 -5
- package/src/components/Modal/Modal.scss +2 -1
- package/src/components/Modal/Modal.vue +1 -1
- package/src/components/Tooltip/Tooltip.scss +12 -11
- package/src/components/Tooltip/Tooltip.stories.js +12 -38
- package/src/components/Tooltip/Tooltip.vue +18 -17
- package/src/components/layout/Box/__tests__/Box.spec.js +0 -1
- package/src/components/layout/Col/__tests__/Col.spec.js +0 -1
- package/src/components/layout/Row/__tests__/Row.spec.js +0 -1
- package/src/configurations/_variables.scss +2 -2
package/package.json
CHANGED
|
@@ -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: {
|
|
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(--
|
|
18
|
-
border-bottom: 1px solid
|
|
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
|
-
|
|
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: [
|
|
12
|
+
value: { type: [Boolean], required: true },
|
|
13
13
|
},
|
|
14
14
|
inheritAttrs: true,
|
|
15
15
|
setup(props, { emit }) {
|
|
@@ -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: {
|
|
@@ -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
|
|
4
|
-
|
|
3
|
+
import baseThemeColors from '../../configurations/_theme-colors-base.scss';
|
|
4
|
+
const colors = Object.keys(baseThemeColors);
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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':
|
|
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
|
-
| '
|
|
33
|
-
| 'extra'
|
|
34
|
-
| 'accent'
|
|
33
|
+
| 'neutral'
|
|
35
34
|
| 'info'
|
|
36
35
|
| 'success'
|
|
37
|
-
| '
|
|
38
|
-
| '
|
|
39
|
-
| '
|
|
36
|
+
| 'error'
|
|
37
|
+
| 'warning'
|
|
38
|
+
| 'success'
|
|
39
|
+
| 'extra-1'
|
|
40
|
+
| 'extra-2'
|
|
40
41
|
>,
|
|
41
|
-
default: '
|
|
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
|
-
|
|
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
|
});
|