@farm-investimentos/front-mfe-components 9.3.0 → 9.3.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 +105 -89
- 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 +105 -89
- 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/Checkbox/Checkbox.scss +26 -5
- package/src/components/Checkbox/Checkbox.stories.js +31 -0
- package/src/components/Checkbox/Checkbox.vue +25 -4
- package/src/components/Chip/Chip.scss +20 -4
- package/src/components/Chip/Chip.stories.js +0 -2
- package/src/components/Modal/Modal.stories.js +0 -27
- package/src/configurations/_theme-colors.scss +5 -5
package/package.json
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
@import '../../configurations/theme-colors';
|
|
2
|
+
|
|
1
3
|
.farm-checkbox__container {
|
|
2
4
|
display: flex;
|
|
3
5
|
flex-direction: row;
|
|
@@ -5,6 +7,29 @@
|
|
|
5
7
|
.farm-label {
|
|
6
8
|
margin-left: 8px;
|
|
7
9
|
}
|
|
10
|
+
|
|
11
|
+
@each $color in $theme-colors-list {
|
|
12
|
+
&#{'[color=' + $color + ']'} {
|
|
13
|
+
.farm-checkbox--checked {
|
|
14
|
+
background-color: themeColor($color);
|
|
15
|
+
border-color: themeColor($color);
|
|
16
|
+
|
|
17
|
+
&.farm-checkbox--lighten {
|
|
18
|
+
background-color: themeColor($color, 'lighten');
|
|
19
|
+
border-color: themeColor($color, 'lighten');
|
|
20
|
+
|
|
21
|
+
.farm-icon {
|
|
22
|
+
color: themeColor($color, 'darken');
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&.farm-checkbox--darken {
|
|
27
|
+
background-color: themeColor($color, 'darken');
|
|
28
|
+
border-color: themeColor($color, 'darken');
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
8
33
|
}
|
|
9
34
|
|
|
10
35
|
.farm-checkbox {
|
|
@@ -18,11 +43,6 @@
|
|
|
18
43
|
line-height: 0;
|
|
19
44
|
transition: all 0.4s;
|
|
20
45
|
|
|
21
|
-
&--checked {
|
|
22
|
-
background-color: var(--v-secondary-base);
|
|
23
|
-
border-color: var(--v-secondary-base);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
46
|
&--disabled {
|
|
27
47
|
border-color: #dadada;
|
|
28
48
|
cursor: default;
|
|
@@ -35,4 +55,5 @@
|
|
|
35
55
|
.farm-icon {
|
|
36
56
|
color: white;
|
|
37
57
|
}
|
|
58
|
+
|
|
38
59
|
}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import Checkbox from './Checkbox';
|
|
2
|
+
import baseThemeColors from '../../configurations/_theme-colors-base.scss';
|
|
3
|
+
|
|
4
|
+
const colors = Object.keys(baseThemeColors);
|
|
5
|
+
const variations = ['', 'darken', 'lighten'];
|
|
2
6
|
|
|
3
7
|
export default {
|
|
4
8
|
title: 'Form/Checkbox',
|
|
@@ -60,3 +64,30 @@ export const Disabled = () => ({
|
|
|
60
64
|
<farm-checkbox v-model="notIsChecked" :disabled="true" />
|
|
61
65
|
</div>`,
|
|
62
66
|
});
|
|
67
|
+
|
|
68
|
+
export const Colors = () => ({
|
|
69
|
+
data() {
|
|
70
|
+
return {
|
|
71
|
+
isChecked: true,
|
|
72
|
+
colors,
|
|
73
|
+
variations,
|
|
74
|
+
};
|
|
75
|
+
},
|
|
76
|
+
template: `<div style="display: flex; flex-direction: row; flex-wrap: wrap;">
|
|
77
|
+
<div v-for="color in colors" style="width: 33.3%;">
|
|
78
|
+
<h4>{{ color }}</h4>
|
|
79
|
+
<div
|
|
80
|
+
style="display: flex; flex-direction: column;"
|
|
81
|
+
v-for="variation in variations"
|
|
82
|
+
:key="color + '_' + variation"
|
|
83
|
+
>
|
|
84
|
+
<farm-checkbox
|
|
85
|
+
v-model="isChecked"
|
|
86
|
+
:color="color"
|
|
87
|
+
:variation="variation"
|
|
88
|
+
:label="variation || 'Base'"
|
|
89
|
+
/>
|
|
90
|
+
</div>
|
|
91
|
+
</div>
|
|
92
|
+
</div>`,
|
|
93
|
+
});
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="farm-checkbox__container">
|
|
2
|
+
<div class="farm-checkbox__container" :color="$props.color">
|
|
3
3
|
<span
|
|
4
|
-
:class="{
|
|
4
|
+
:class="{
|
|
5
|
+
'farm-checkbox': true,
|
|
6
|
+
'farm-checkbox--checked': innerValue,
|
|
7
|
+
'farm-checkbox--disabled': disabled,
|
|
8
|
+
'farm-checkbox--lighten': variation === 'lighten',
|
|
9
|
+
'farm-checkbox--darken': variation === 'darken',
|
|
10
|
+
}"
|
|
5
11
|
@click="toggleValue"
|
|
6
12
|
>
|
|
7
13
|
<farm-icon size="sm" v-if="innerValue">check</farm-icon>
|
|
@@ -12,7 +18,7 @@
|
|
|
12
18
|
</div>
|
|
13
19
|
</template>
|
|
14
20
|
<script lang="ts">
|
|
15
|
-
import Vue, { ref, toRefs } from 'vue';
|
|
21
|
+
import Vue, { ref, toRefs, watch } from 'vue';
|
|
16
22
|
|
|
17
23
|
export default Vue.extend({
|
|
18
24
|
name: 'farm-checkbox',
|
|
@@ -29,19 +35,34 @@ export default Vue.extend({
|
|
|
29
35
|
* disabled
|
|
30
36
|
*/
|
|
31
37
|
disabled: { type: Boolean, default: false },
|
|
38
|
+
variation: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: '',
|
|
41
|
+
},
|
|
42
|
+
color: {
|
|
43
|
+
type: String,
|
|
44
|
+
default: 'primary',
|
|
45
|
+
},
|
|
32
46
|
},
|
|
33
47
|
setup(props, { emit }) {
|
|
34
48
|
const innerValue = ref(props.value);
|
|
35
49
|
const { label, disabled } = toRefs(props);
|
|
36
50
|
|
|
37
51
|
const toggleValue = () => {
|
|
38
|
-
if(disabled.value) {
|
|
52
|
+
if (disabled.value) {
|
|
39
53
|
return false;
|
|
40
54
|
}
|
|
41
55
|
innerValue.value = !innerValue.value;
|
|
42
56
|
emit('input', innerValue.value);
|
|
43
57
|
};
|
|
44
58
|
|
|
59
|
+
watch(
|
|
60
|
+
() => props.value,
|
|
61
|
+
() => {
|
|
62
|
+
innerValue.value = props.value;
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
|
|
45
66
|
return {
|
|
46
67
|
innerValue,
|
|
47
68
|
label,
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
align-items: center;
|
|
14
14
|
color: white;
|
|
15
15
|
width: 100%;
|
|
16
|
-
border:1px solid themeColor('primary');
|
|
16
|
+
border: 1px solid themeColor('primary');
|
|
17
17
|
font-size: 12px;
|
|
18
18
|
font-weight: 500;
|
|
19
19
|
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
&#{'[color=' + $color + ']'} {
|
|
31
31
|
background-color: themeColor($color);
|
|
32
32
|
border-color: themeColor($color);
|
|
33
|
-
|
|
33
|
+
|
|
34
34
|
&.farm-chip--lighten {
|
|
35
35
|
background-color: themeColor($color, 'lighten');
|
|
36
36
|
border-color: themeColor($color, 'lighten');
|
|
@@ -44,18 +44,26 @@
|
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
+
&[color='neutral'] {
|
|
48
|
+
color: themeColor('secondary');
|
|
49
|
+
|
|
50
|
+
&.farm-chip--lighten {
|
|
51
|
+
color: themeColor('secondary');
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
47
55
|
&--outlined {
|
|
48
56
|
@each $color in $theme-colors-list {
|
|
49
57
|
&#{'[color=' + $color + ']'} {
|
|
50
58
|
background-color: transparent;
|
|
51
59
|
color: themeColor($color);
|
|
52
|
-
|
|
60
|
+
|
|
53
61
|
&.farm-chip--lighten {
|
|
54
62
|
background-color: transparent;
|
|
55
63
|
border-color: themeColor($color, 'lighten');
|
|
56
64
|
color: themeColor($color);
|
|
57
65
|
}
|
|
58
|
-
|
|
66
|
+
|
|
59
67
|
&.farm-chip--darken {
|
|
60
68
|
background-color: transparent;
|
|
61
69
|
border-color: themeColor($color, 'darken');
|
|
@@ -63,5 +71,13 @@
|
|
|
63
71
|
}
|
|
64
72
|
}
|
|
65
73
|
}
|
|
74
|
+
|
|
75
|
+
&[color='neutral'] {
|
|
76
|
+
color: themeColor('secondary');
|
|
77
|
+
|
|
78
|
+
&.farm-chip--lighten {
|
|
79
|
+
color: themeColor('secondary');
|
|
80
|
+
}
|
|
81
|
+
}
|
|
66
82
|
}
|
|
67
83
|
}
|
|
@@ -2,8 +2,6 @@ import Chip from './Chip.vue';
|
|
|
2
2
|
import baseThemeColors from '../../configurations/_theme-colors-base.scss';
|
|
3
3
|
import('./Chip.stories.scss');
|
|
4
4
|
|
|
5
|
-
console.log(baseThemeColors);
|
|
6
|
-
|
|
7
5
|
const colors = Object.keys(baseThemeColors);
|
|
8
6
|
const variations = ['', 'darken', 'lighten'];
|
|
9
7
|
|
|
@@ -131,30 +131,6 @@ export const HeaderAndBottom = () => ({
|
|
|
131
131
|
</div>`,
|
|
132
132
|
});
|
|
133
133
|
|
|
134
|
-
export const Persistent = () => ({
|
|
135
|
-
data() {
|
|
136
|
-
return {
|
|
137
|
-
value: false,
|
|
138
|
-
text,
|
|
139
|
-
};
|
|
140
|
-
},
|
|
141
|
-
template: `<div>
|
|
142
|
-
<farm-btn color="secondary" @click="value = true">abrir</farm-btn>
|
|
143
|
-
<farm-modal v-model="value" :offsetTop="48" :offsetBottom="68" :persistent="true">
|
|
144
|
-
<template v-slot:header>
|
|
145
|
-
<farm-dialog-header title="Título" @onClose="() => value = false" />
|
|
146
|
-
</template>
|
|
147
|
-
<template v-slot:content>
|
|
148
|
-
<br />persistent modal<br />
|
|
149
|
-
</template>
|
|
150
|
-
|
|
151
|
-
<template v-slot:footer>
|
|
152
|
-
<farm-dialog-footer @onConfirm="() => value = false" @onClose="() => value = false" />
|
|
153
|
-
</template>
|
|
154
|
-
</farm-modal>
|
|
155
|
-
</div>`,
|
|
156
|
-
});
|
|
157
|
-
|
|
158
134
|
export const HorizontalScroll = () => ({
|
|
159
135
|
data() {
|
|
160
136
|
return {
|
|
@@ -202,7 +178,6 @@ export const CustomHeader = () => ({
|
|
|
202
178
|
</div>`,
|
|
203
179
|
});
|
|
204
180
|
|
|
205
|
-
<<<<<<< HEAD
|
|
206
181
|
export const Persistent = () => ({
|
|
207
182
|
data() {
|
|
208
183
|
return {
|
|
@@ -227,8 +202,6 @@ export const Persistent = () => ({
|
|
|
227
202
|
</div>`,
|
|
228
203
|
});
|
|
229
204
|
|
|
230
|
-
=======
|
|
231
|
-
>>>>>>> develop
|
|
232
205
|
const text = `inicio!<br />
|
|
233
206
|
teste!<br />
|
|
234
207
|
teste!<br />
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
$primary: (
|
|
2
|
-
base: #
|
|
2
|
+
base: #00B493,
|
|
3
3
|
lighten: #EBFFFB,
|
|
4
|
-
darken: #
|
|
4
|
+
darken: #099A82,
|
|
5
5
|
);
|
|
6
6
|
|
|
7
7
|
$secondary: (
|
|
8
|
-
base: #
|
|
9
|
-
lighten: #
|
|
10
|
-
darken: #
|
|
8
|
+
base: #1A3738,
|
|
9
|
+
lighten: #467D7E,
|
|
10
|
+
darken: #0B1A1B,
|
|
11
11
|
);
|
|
12
12
|
|
|
13
13
|
$neutral: (
|