@farm-investimentos/front-mfe-components 14.2.1 → 15.0.0
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 +4146 -5381
- package/dist/front-mfe-components.common.js.map +1 -1
- package/dist/front-mfe-components.css +2 -2
- package/dist/front-mfe-components.umd.js +4146 -5381
- 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/AlertBox/AlertBox.scss +3 -2
- package/src/components/AlertBox/AlertBox.vue +2 -0
- package/src/components/Buttons/DefaultButton/DefaultButton.scss +57 -18
- package/src/components/Buttons/DefaultButton/DefaultButton.stories.js +49 -16
- package/src/components/Buttons/DefaultButton/DefaultButton.vue +3 -1
- package/src/components/Buttons/ExportButton/ExportButton.vue +2 -1
- package/src/components/Card/Card.scss +1 -1
- package/src/components/Card/CardComposition.stories.ts +8 -2
- package/src/components/Card/CardContent/CardContent.scss +11 -0
- package/src/components/Card/CardContent/CardContent.stories.js +11 -0
- package/src/components/Card/CardContent/CardContent.vue +9 -1
- package/src/components/CardContext/__tests__/CardContext.spec.js +5 -2
- package/src/components/Checkbox/Checkbox.scss +2 -2
- package/src/components/Checkbox/Checkbox.vue +2 -1
- package/src/components/Chip/Chip.scss +15 -15
- package/src/components/Chip/Chip.stories.js +13 -13
- package/src/components/Chip/Chip.stories.scss +1 -16
- package/src/components/Chip/Chip.vue +25 -3
- package/src/components/Collapsible/Collapsible.scss +8 -3
- package/src/components/Collapsible/Collapsible.stories.js +68 -1
- package/src/components/Collapsible/Collapsible.vue +68 -8
- package/src/components/ContextMenu/ContextMenu.scss +1 -1
- package/src/components/ContextMenu/ContextMenu.stories.js +42 -29
- package/src/components/ContextMenu/ContextMenu.vue +20 -1
- package/src/components/CopyToClipboard/CopyToClipboard.stories.js +7 -1
- package/src/components/CopyToClipboard/CopyToClipboard.vue +15 -3
- package/src/components/DataTableEmptyWrapper/DataTableEmptyWrapper.scss +6 -9
- package/src/components/DataTableEmptyWrapper/DataTableEmptyWrapper.stories.js +4 -0
- package/src/components/DataTableEmptyWrapper/DataTableEmptyWrapper.vue +21 -5
- package/src/components/{TextField/__tests__/TextField.spec.js → DataTableEmptyWrapper/__tests__/DataTableEmptyWrapper.spec.js} +3 -3
- package/src/components/DataTableHeader/DataTableHeader.scss +10 -12
- package/src/components/DataTableHeader/DataTableHeader.vue +5 -4
- package/src/components/DataTablePaginator/DataTablePaginator.scss +71 -69
- package/src/components/DatePicker/DatePicker.scss +5 -5
- package/src/components/DatePicker/DatePicker.vue +2 -3
- package/src/components/DatePicker/__tests__/DatePicker.spec.js +1 -1
- package/src/components/DatePicker/vDatePicker.scss +214 -0
- package/src/components/DialogFooter/DialogFooter.scss +1 -1
- package/src/components/DialogFooter/DialogFooter.stories.js +2 -2
- package/src/components/DialogFooter/DialogFooter.vue +1 -1
- package/src/components/DialogHeader/DialogHeader.scss +2 -3
- package/src/components/DialogHeader/DialogHeader.vue +4 -4
- package/src/components/Form/Form.stories.js +1 -1
- package/src/components/Icon/Icon.scss +6 -0
- package/src/components/Icon/Icon.stories.js +19 -1
- package/src/components/Icon/Icon.vue +8 -2
- package/src/components/IconBox/IconBox.stories.js +16 -0
- package/src/components/IconBox/IconBox.vue +17 -7
- package/src/components/IdCaption/IdCaption.vue +27 -13
- package/src/components/Label/Label.scss +17 -5
- package/src/components/Label/Label.stories.js +0 -1
- package/src/components/ListItem/ListItem.scss +5 -3
- package/src/components/ListItem/ListItem.vue +2 -0
- package/src/components/Logger/LoggerItem/LoggerItem.scss +9 -1
- package/src/components/Logger/LoggerItem/LoggerItem.vue +25 -8
- package/src/components/Logger/LoggerItem/__tests__/LoggerItem.spec.js +1 -1
- package/src/components/MainFilter/MainFilter.stories.js +4 -4
- package/src/components/Modal/Modal.scss +3 -3
- package/src/components/ModalPromptUser/ModalPromptUser.stories.js +26 -0
- package/src/components/ModalPromptUser/ModalPromptUser.vue +10 -0
- package/src/components/MultipleFilePicker/MultipleFilePicker.scss +19 -12
- package/src/components/MultipleFilePicker/MultipleFilePicker.stories.js +12 -0
- package/src/components/MultipleFilePicker/MultipleFilePicker.vue +18 -11
- package/src/components/MultipleFilePicker/__tests__/MultipleFilePicker.spec.js +9 -0
- package/src/components/ProgressBar/ProgressBar.vue +4 -0
- package/src/components/Radio/Radio.scss +18 -4
- package/src/components/Radio/Radio.stories.js +2 -1
- package/src/components/Radio/Radio.vue +3 -1
- package/src/components/RangeDatePicker/RangeDatePicker.vue +0 -2
- package/src/components/ResourceMetaInfo/ResourceMetaInfo.vue +8 -8
- package/src/components/Select/Select.scss +4 -0
- package/src/components/Select/Select.vue +9 -1
- package/src/components/Stepper/StepperHeader/StepperHeader.scss +7 -7
- package/src/components/Stepper/StepperHeader/StepperHeader.vue +35 -36
- package/src/components/Switcher/Switcher.scss +24 -8
- package/src/components/Switcher/Switcher.stories.js +33 -0
- package/src/components/Switcher/Switcher.vue +24 -3
- package/src/components/TableContextMenu/TableContextMenu.scss +4 -9
- package/src/components/TableContextMenu/TableContextMenu.stories.js +2 -0
- package/src/components/TableContextMenu/TableContextMenu.vue +5 -4
- package/src/components/Tabs/Tabs.scss +69 -0
- package/src/components/Tabs/Tabs.stories.js +51 -4
- package/src/components/Tabs/Tabs.vue +59 -32
- package/src/components/Tabs/__tests__/Tabs.spec.js +54 -54
- package/src/components/Tabs/index.ts +1 -0
- package/src/components/TextArea/TextArea.scss +7 -3
- package/src/components/TextArea/TextArea.vue +1 -0
- package/src/components/TextFieldV2/TextFieldV2.scss +8 -4
- package/src/components/TextFieldV2/TextFieldV2.vue +1 -0
- package/src/components/Tooltip/Tooltip.scss +8 -10
- package/src/components/Tooltip/Tooltip.vue +4 -2
- package/src/components/Typography/BodyText/BodyText.scss +7 -7
- package/src/components/Typography/Caption/Caption.scss +7 -7
- package/src/components/Typography/Caption/Caption.stories.js +1 -1
- package/src/components/Typography/Caption/Caption.vue +4 -1
- package/src/components/Typography/Caption/configurations.ts +3 -2
- package/src/components/Typography/Heading/Heading.scss +19 -19
- package/src/components/Typography/Heading/configurations.ts +5 -5
- package/src/components/Typography/Small/Small.scss +3 -0
- package/src/components/Typography/Small/Small.stories.js +34 -0
- package/src/components/Typography/Small/Small.vue +47 -0
- package/src/components/Typography/Small/__tests__/Small.spec.js +31 -0
- package/src/components/Typography/Small/configurations.ts +7 -0
- package/src/components/Typography/Subtitle/Subtitle.scss +7 -7
- package/src/components/Typography/Typography.scss +10 -0
- package/src/components/Typography/Typography.stories.js +15 -2
- package/src/components/Typography/Typography.vue +6 -2
- package/src/components/Typography/index.ts +2 -1
- package/src/components/ValueCaption/ValueCaption.vue +2 -0
- package/src/components/layout/Line/Line.scss +15 -0
- package/src/components/layout/Line/Line.stories.js +28 -5
- package/src/components/layout/Line/Line.vue +37 -3
- package/src/configurations/_mixins.scss +1 -1
- package/src/configurations/_theme-colors-background.scss +10 -0
- package/src/configurations/_theme-colors-bw.scss +10 -0
- package/src/configurations/_theme-colors.scss +79 -48
- package/src/configurations/_variables.scss +2 -0
- package/src/examples/Colors.stories.js +39 -1
- package/src/examples/Colors.stories.scss +1 -1
- package/src/helpers/index.ts +2 -1
- package/src/helpers/isChildOfFixedElement.js +16 -0
- package/src/main.ts +1 -5
- package/src/scss/Sticky-table.scss +13 -7
- package/src/scss/VuejsDialog.scss +58 -51
- package/src/scss/cssVariablesGenerator.scss +17 -14
- package/src/scss/utils.scss +17 -251
- package/src/components/FilePicker/FilePicker.scss +0 -53
- package/src/components/FilePicker/FilePicker.stories.js +0 -14
- package/src/components/FilePicker/FilePicker.vue +0 -109
- package/src/components/FilePicker/__tests__/FilePicker.spec.js +0 -77
- package/src/components/FilePicker/index.ts +0 -3
- package/src/components/TextField/TextField.scss +0 -43
- package/src/components/TextField/TextField.stories.js +0 -104
- package/src/components/TextField/TextField.vue +0 -18
- package/src/components/TextField/index.ts +0 -4
- package/src/scss/ButtonOverrides.scss +0 -73
- package/src/scss/DefaultModal.scss +0 -89
- package/src/scss/DialogOverrides.scss +0 -94
- package/src/scss/FormOverrides.scss +0 -264
- package/src/scss/Status-Chip.scss +0 -34
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@ $butonSizes: (
|
|
|
17
17
|
display: inline-flex;
|
|
18
18
|
flex: 0 0 auto;
|
|
19
19
|
font-weight: 700;
|
|
20
|
-
letter-spacing:
|
|
20
|
+
letter-spacing: 0.5px;
|
|
21
21
|
justify-content: center;
|
|
22
22
|
outline: 0;
|
|
23
23
|
position: relative;
|
|
@@ -37,7 +37,8 @@ $butonSizes: (
|
|
|
37
37
|
width: 100%;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
@each $size,
|
|
40
|
+
@each $size,
|
|
41
|
+
$value in $sizes {
|
|
41
42
|
&#{'.farm-btn[size=' + $size + ']'} {
|
|
42
43
|
font-size: $value;
|
|
43
44
|
height: map-get($butonSizes, $size);
|
|
@@ -92,28 +93,45 @@ $butonSizes: (
|
|
|
92
93
|
|
|
93
94
|
&:not(.farm-btn--plain):hover {
|
|
94
95
|
&:before {
|
|
95
|
-
opacity: 0.
|
|
96
|
+
opacity: 0.14;
|
|
96
97
|
}
|
|
97
98
|
}
|
|
98
99
|
|
|
99
100
|
&:not(.farm-btn--plain):not(.farm-btn--disabled):active {
|
|
100
101
|
&:before {
|
|
101
|
-
opacity: 0.
|
|
102
|
+
opacity: 0.27;
|
|
102
103
|
}
|
|
103
104
|
}
|
|
104
105
|
|
|
105
106
|
&.farm-btn--plain {
|
|
106
107
|
background-color: transparent !important;
|
|
107
108
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
109
|
+
.farm-btn__content {
|
|
110
|
+
position: relative;
|
|
111
|
+
|
|
112
|
+
&:before {
|
|
113
|
+
content: '';
|
|
114
|
+
transition: all 0.28s ease;
|
|
115
|
+
background-color: currentColor;
|
|
116
|
+
top: 110%;
|
|
117
|
+
left: 0;
|
|
118
|
+
position: absolute;
|
|
119
|
+
width: 100%;
|
|
120
|
+
height: 1px;
|
|
121
|
+
opacity: 0;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
&:hover:not(.farm-btn--disabled) {
|
|
126
|
+
.farm-btn__content,
|
|
127
|
+
.farm-btn__content:before {
|
|
128
|
+
opacity: 0.86;
|
|
111
129
|
}
|
|
112
130
|
}
|
|
113
131
|
|
|
114
132
|
&:active {
|
|
115
133
|
&:before {
|
|
116
|
-
opacity: 0.
|
|
134
|
+
opacity: 0.73;
|
|
117
135
|
}
|
|
118
136
|
}
|
|
119
137
|
}
|
|
@@ -124,8 +142,8 @@ $butonSizes: (
|
|
|
124
142
|
}
|
|
125
143
|
|
|
126
144
|
.farm-btn.farm-btn--icon {
|
|
127
|
-
|
|
128
|
-
|
|
145
|
+
background: transparent !important;
|
|
146
|
+
border: transparent !important;
|
|
129
147
|
transition: color 0.5s ease;
|
|
130
148
|
|
|
131
149
|
min-width: auto;
|
|
@@ -135,7 +153,8 @@ $butonSizes: (
|
|
|
135
153
|
color: gray;
|
|
136
154
|
}
|
|
137
155
|
|
|
138
|
-
@each $size,
|
|
156
|
+
@each $size,
|
|
157
|
+
$value in $sizes {
|
|
139
158
|
&#{'.farm-btn[size=' + $size + ']'} {
|
|
140
159
|
font-size: $value;
|
|
141
160
|
}
|
|
@@ -157,26 +176,26 @@ $butonSizes: (
|
|
|
157
176
|
color: var(--farm-#{$color}-base);
|
|
158
177
|
}
|
|
159
178
|
|
|
160
|
-
|
|
179
|
+
.farm-btn__content :deep(i.mdi) {
|
|
161
180
|
color: var(--farm-#{$color}-base);
|
|
162
181
|
}
|
|
163
182
|
|
|
164
|
-
&.
|
|
183
|
+
&.farm-btn--variation-lighten {
|
|
165
184
|
&:hover {
|
|
166
185
|
color: var(--farm-#{$color}-lighten);
|
|
167
186
|
}
|
|
168
187
|
|
|
169
|
-
|
|
188
|
+
.farm-btn__content :deep(i.mdi) {
|
|
170
189
|
color: var(--farm-#{$color}-lighten);
|
|
171
190
|
}
|
|
172
191
|
}
|
|
173
192
|
|
|
174
|
-
&.
|
|
193
|
+
&.farm-btn--variation-darken {
|
|
175
194
|
&:hover {
|
|
176
195
|
color: var(--farm-#{$color}-darken);
|
|
177
196
|
}
|
|
178
197
|
|
|
179
|
-
|
|
198
|
+
.farm-btn__content :deep(i.mdi) {
|
|
180
199
|
color: var(--farm-#{$color}-darken);
|
|
181
200
|
}
|
|
182
201
|
}
|
|
@@ -192,10 +211,13 @@ $butonSizes: (
|
|
|
192
211
|
|
|
193
212
|
@each $color in $theme-colors-list {
|
|
194
213
|
#{'.farm-btn--' + $color} {
|
|
195
|
-
border: 1px solid var(--farm-#{$color}-base);
|
|
196
214
|
background-color: var(--farm-#{$color}-base);
|
|
197
215
|
color: white;
|
|
198
216
|
|
|
217
|
+
&.farm-btn--outlined {
|
|
218
|
+
border: 1px solid var(--farm-#{$color}-base);
|
|
219
|
+
}
|
|
220
|
+
|
|
199
221
|
&:not(.farm-btn--outlined):not(.farm-btn--plain):not(.farm-btn--icon) {
|
|
200
222
|
::v-deep .farm-btn__content {
|
|
201
223
|
i.mdi {
|
|
@@ -207,6 +229,17 @@ $butonSizes: (
|
|
|
207
229
|
}
|
|
208
230
|
}
|
|
209
231
|
}
|
|
232
|
+
|
|
233
|
+
&.farm-btn--variation-lighten {
|
|
234
|
+
border: 1px solid var(--farm-#{$color}-lighten);
|
|
235
|
+
background-color: var(--farm-#{$color}-lighten);
|
|
236
|
+
color: var(--farm-text-primary);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
&.farm-btn--variation-darken {
|
|
240
|
+
border: 1px solid var(--farm-#{$color}-darken);
|
|
241
|
+
background-color: var(--farm-#{$color}-darken);
|
|
242
|
+
}
|
|
210
243
|
}
|
|
211
244
|
|
|
212
245
|
.farm-btn--extra,
|
|
@@ -262,6 +295,12 @@ $butonSizes: (
|
|
|
262
295
|
}
|
|
263
296
|
}
|
|
264
297
|
|
|
298
|
+
.farm-btn--primary.farm-btn--disabled:not(.farm-btn--outlined) {
|
|
299
|
+
.farm-btn__content i.mdi {
|
|
300
|
+
color: rgba(0, 0, 0, 0.26) !important;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
|
|
265
304
|
.farm-btn--plain.farm-btn--disabled {
|
|
266
305
|
background-color: transparent;
|
|
267
306
|
border: none;
|
|
@@ -286,4 +325,4 @@ $butonSizes: (
|
|
|
286
325
|
width: 100%;
|
|
287
326
|
margin: 0;
|
|
288
327
|
}
|
|
289
|
-
}
|
|
328
|
+
}
|
|
@@ -44,22 +44,22 @@ export const PrimaryInactive = () => ({
|
|
|
44
44
|
template:
|
|
45
45
|
'<farm-btn disabled> <farm-icon>plus</farm-icon> Pass text as slot <farm-icon>plus</farm-icon></farm-btn>',
|
|
46
46
|
});
|
|
47
|
-
export const
|
|
47
|
+
export const OutlinedActive = () => ({
|
|
48
48
|
template:
|
|
49
49
|
'<farm-btn outlined> <farm-icon>plus</farm-icon> Pass text as slot <farm-icon>plus</farm-icon></farm-btn>',
|
|
50
50
|
});
|
|
51
51
|
|
|
52
|
-
export const
|
|
52
|
+
export const OutlinedInactive = () => ({
|
|
53
53
|
template:
|
|
54
54
|
'<farm-btn outlined disabled> <farm-icon>plus</farm-icon> Pass text as slot <farm-icon>plus</farm-icon></farm-btn>',
|
|
55
55
|
});
|
|
56
56
|
|
|
57
|
-
export const
|
|
57
|
+
export const PlainActive = () => ({
|
|
58
58
|
template:
|
|
59
59
|
'<farm-btn plain> <farm-icon>plus</farm-icon> Pass text as slot <farm-icon>plus</farm-icon></farm-btn>',
|
|
60
60
|
});
|
|
61
61
|
|
|
62
|
-
export const
|
|
62
|
+
export const PlainInactive = () => ({
|
|
63
63
|
template:
|
|
64
64
|
'<farm-btn plain disabled> <farm-icon>plus</farm-icon> Pass text as slot <farm-icon>plus</farm-icon></farm-btn>',
|
|
65
65
|
});
|
|
@@ -92,11 +92,31 @@ export const ActiveButtons = () => ({
|
|
|
92
92
|
colors,
|
|
93
93
|
};
|
|
94
94
|
},
|
|
95
|
-
template: `<
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
95
|
+
template: `<farm-box>
|
|
96
|
+
<farm-row>
|
|
97
|
+
|
|
98
|
+
<farm-col cols="12" md="3" class="d-flex flex-column">
|
|
99
|
+
Base
|
|
100
|
+
<farm-btn v-for="color of colors":key="'random_9_' + color" :color="color" class="mb-2">
|
|
101
|
+
{{ color }}
|
|
102
|
+
</farm-btn>
|
|
103
|
+
</farm-col>
|
|
104
|
+
|
|
105
|
+
<farm-col cols="12" md="3" class="d-flex flex-column">
|
|
106
|
+
Lighten
|
|
107
|
+
<farm-btn v-for="color of colors":key="'random_9_lighten_' + color" :color="color" variation="lighten" class="mb-2">
|
|
108
|
+
{{ color }}
|
|
109
|
+
</farm-btn>
|
|
110
|
+
</farm-col>
|
|
111
|
+
|
|
112
|
+
<farm-col cols="12" md="3" class="d-flex flex-column">
|
|
113
|
+
Darken
|
|
114
|
+
<farm-btn v-for="color of colors":key="'random_9_darken_' + color" :color="color" variation="darken" class="mb-2">
|
|
115
|
+
{{ color }}
|
|
116
|
+
</farm-btn>
|
|
117
|
+
</farm-col>
|
|
118
|
+
<farm-row>
|
|
119
|
+
</farm-box>`,
|
|
100
120
|
});
|
|
101
121
|
|
|
102
122
|
export const OutlinedButtons = () => ({
|
|
@@ -195,28 +215,41 @@ export const Iconed = () => ({
|
|
|
195
215
|
colors: [...colors, 'white'],
|
|
196
216
|
};
|
|
197
217
|
},
|
|
198
|
-
template: `<
|
|
199
|
-
|
|
218
|
+
template: `<farm-box>
|
|
219
|
+
<farm-row>
|
|
220
|
+
|
|
221
|
+
<farm-col cols="12" md="3" class="d-flex flex-column">
|
|
222
|
+
Base
|
|
200
223
|
<farm-btn icon v-for="color of colors" :key="'random_2_' + color" :color="color">
|
|
201
224
|
<farm-icon>book</farm-icon>
|
|
202
225
|
</farm-btn>
|
|
226
|
+
</farm-col>
|
|
227
|
+
|
|
228
|
+
<farm-col cols="12" md="3" class="d-flex flex-column">
|
|
203
229
|
|
|
204
|
-
<h4>Darken
|
|
230
|
+
<h4>Darken</h4>
|
|
205
231
|
<farm-btn icon v-for="color of colors" :key="'random_2_' + color" :color="color" variation="darken">
|
|
206
232
|
<farm-icon>book</farm-icon>
|
|
207
233
|
</farm-btn>
|
|
234
|
+
</farm-col>
|
|
235
|
+
|
|
236
|
+
<farm-col cols="12" md="3" class="d-flex flex-column">
|
|
208
237
|
|
|
209
|
-
<h4>Lighten
|
|
238
|
+
<h4>Lighten </h4>
|
|
210
239
|
<farm-btn icon v-for="color of colors" :key="'random_2_' + color" :color="color" variation="lighten">
|
|
211
240
|
<farm-icon>book</farm-icon>
|
|
212
241
|
</farm-btn>
|
|
242
|
+
</farm-col>
|
|
243
|
+
|
|
244
|
+
<farm-col cols="12" md="3" class="d-flex flex-column">
|
|
213
245
|
|
|
214
|
-
<h4>Disabled
|
|
246
|
+
<h4>Disabled</h4>
|
|
215
247
|
<farm-btn icon v-for="color of colors" :key="'disabled_random_2_' + color" :color="color" :disabled="true">
|
|
216
248
|
<farm-icon>book</farm-icon>
|
|
217
249
|
</farm-btn>
|
|
218
|
-
|
|
219
|
-
</
|
|
250
|
+
</farm-col>
|
|
251
|
+
</farm-row>
|
|
252
|
+
</farm-box>`,
|
|
220
253
|
});
|
|
221
254
|
|
|
222
255
|
export const Rounded = () => ({
|
|
@@ -33,6 +33,8 @@ export default Vue.extend({
|
|
|
33
33
|
type: String as PropType<
|
|
34
34
|
| 'primary'
|
|
35
35
|
| 'secondary'
|
|
36
|
+
| 'secondary-green'
|
|
37
|
+
| 'secondary-golden'
|
|
36
38
|
| 'neutral'
|
|
37
39
|
| 'info'
|
|
38
40
|
| 'success'
|
|
@@ -112,7 +114,7 @@ export default Vue.extend({
|
|
|
112
114
|
'farm-btn--icon': this.icon,
|
|
113
115
|
'farm-btn--full': this.full,
|
|
114
116
|
['farm-btn--' + this.color]: true,
|
|
115
|
-
[
|
|
117
|
+
['farm-btn--variation-' + this.variation]: true,
|
|
116
118
|
...obj,
|
|
117
119
|
};
|
|
118
120
|
},
|
|
@@ -55,8 +55,14 @@ export const Shadow = () => ({
|
|
|
55
55
|
export const BackgroundChildren = () => ({
|
|
56
56
|
template: `<div style="width: 480px;">
|
|
57
57
|
<farm-card>
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
<farm-card-content background="lighten">
|
|
59
|
+
Lighten bg
|
|
60
|
+
</farm-card-content>
|
|
61
|
+
<farm-card-content>
|
|
62
|
+
No bg
|
|
63
|
+
</farm-card-content>
|
|
64
|
+
<farm-card-content background="base">
|
|
65
|
+
Base bg
|
|
60
66
|
</farm-card-content>
|
|
61
67
|
</farm-card>
|
|
62
68
|
</div>`,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
@import '../../../configurations/variables';
|
|
2
2
|
@import '../../../configurations/functions';
|
|
3
|
+
@import '../../../configurations/_theme-colors';
|
|
3
4
|
|
|
4
5
|
.farm-card__content {
|
|
5
6
|
@each $k in map-keys($gutters) {
|
|
@@ -7,4 +8,14 @@
|
|
|
7
8
|
padding: map-get($gutters, $k);
|
|
8
9
|
}
|
|
9
10
|
}
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@each $k in map-keys($background-colors) {
|
|
16
|
+
@debug $k;
|
|
17
|
+
|
|
18
|
+
#{'.farm-card__content--' + $k} {
|
|
19
|
+
background-color: map-get($background-colors, $k);
|
|
20
|
+
}
|
|
10
21
|
}
|
|
@@ -34,3 +34,14 @@ export const Gutters = () => ({
|
|
|
34
34
|
</farm-card-content>
|
|
35
35
|
</div>`,
|
|
36
36
|
});
|
|
37
|
+
|
|
38
|
+
export const Background = () => ({
|
|
39
|
+
data() {
|
|
40
|
+
return { bgs: ['base', 'lighten', 'white'] };
|
|
41
|
+
},
|
|
42
|
+
template: `<div style="width: 480px;">
|
|
43
|
+
<farm-card-content v-for="bg in bgs" :key="bg" style="margin-bottom: 16px" :background="bg">
|
|
44
|
+
Content with {{ bg }} background
|
|
45
|
+
</farm-card-content>
|
|
46
|
+
</div>`,
|
|
47
|
+
});
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<component
|
|
2
|
+
<component
|
|
3
|
+
:is="tag"
|
|
4
|
+
:class="{ 'farm-card__content': true, ['farm-card__content--' + background]: background }"
|
|
5
|
+
:gutter="gutter"
|
|
6
|
+
>
|
|
3
7
|
<slot></slot>
|
|
4
8
|
</component>
|
|
5
9
|
</template>
|
|
@@ -21,6 +25,10 @@ export default Vue.extend({
|
|
|
21
25
|
type: String as PropType<'none' | 'xs' | 'sm' | 'vuetify' | 'md' | 'lg' | 'xl'>,
|
|
22
26
|
default: 'md',
|
|
23
27
|
},
|
|
28
|
+
background: {
|
|
29
|
+
type: String as PropType<'base' | 'lighten' | 'darken'> | null,
|
|
30
|
+
default: null,
|
|
31
|
+
},
|
|
24
32
|
},
|
|
25
33
|
inheritAttrs: true,
|
|
26
34
|
});
|
|
@@ -6,7 +6,11 @@ describe('CardContext component', () => {
|
|
|
6
6
|
let component;
|
|
7
7
|
|
|
8
8
|
beforeEach(() => {
|
|
9
|
-
wrapper = shallowMount(CardContext
|
|
9
|
+
wrapper = shallowMount(CardContext, {
|
|
10
|
+
propsData: {
|
|
11
|
+
title: 'title',
|
|
12
|
+
},
|
|
13
|
+
});
|
|
10
14
|
component = wrapper.vm;
|
|
11
15
|
});
|
|
12
16
|
|
|
@@ -21,7 +25,6 @@ describe('CardContext component', () => {
|
|
|
21
25
|
});
|
|
22
26
|
|
|
23
27
|
describe('Computed properties', () => {
|
|
24
|
-
|
|
25
28
|
it('Should compute isLargeLoading for false', () => {
|
|
26
29
|
expect(component.isLargeLoading).toEqual('small');
|
|
27
30
|
});
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
.farm-checkbox {
|
|
48
48
|
display: flex;
|
|
49
49
|
justify-content: center;
|
|
50
|
-
border:
|
|
51
|
-
border-radius:
|
|
50
|
+
border: 3px solid themeColor('neutral', 'darken');
|
|
51
|
+
border-radius: 4px;
|
|
52
52
|
cursor: pointer;
|
|
53
53
|
line-height: 0;
|
|
54
54
|
transition: all 0.4s;
|
|
@@ -62,12 +62,13 @@ export default Vue.extend({
|
|
|
62
62
|
type: String as PropType<
|
|
63
63
|
| 'primary'
|
|
64
64
|
| 'secondary'
|
|
65
|
+
| 'secondary-green'
|
|
66
|
+
| 'secondary-golden'
|
|
65
67
|
| 'neutral'
|
|
66
68
|
| 'info'
|
|
67
69
|
| 'success'
|
|
68
70
|
| 'error'
|
|
69
71
|
| 'warning'
|
|
70
|
-
| 'success'
|
|
71
72
|
| 'extra-1'
|
|
72
73
|
| 'extra-2'
|
|
73
74
|
>,
|
|
@@ -2,20 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
.farm-chip {
|
|
4
4
|
display: inline-flex;
|
|
5
|
-
padding:
|
|
5
|
+
padding: 2px 8px 0;
|
|
6
6
|
border-radius: 16px;
|
|
7
|
-
background-color: themeColor('primary');
|
|
8
7
|
height: 24px;
|
|
9
8
|
min-width: 80px;
|
|
10
9
|
max-width: 100%;
|
|
11
|
-
vertical-align: middle;
|
|
12
10
|
text-align: center;
|
|
13
11
|
align-items: center;
|
|
14
12
|
color: white;
|
|
15
13
|
width: 100%;
|
|
16
14
|
border: 1px solid themeColor('primary');
|
|
17
|
-
font-size: 12px;
|
|
18
|
-
font-weight: 500;
|
|
19
15
|
|
|
20
16
|
&--dense {
|
|
21
17
|
min-width: auto;
|
|
@@ -47,23 +43,27 @@
|
|
|
47
43
|
}
|
|
48
44
|
}
|
|
49
45
|
|
|
46
|
+
|
|
50
47
|
&[color='neutral'] {
|
|
51
48
|
span {
|
|
52
|
-
color:
|
|
49
|
+
color: var(--farm-secondary-green-base);
|
|
53
50
|
}
|
|
54
|
-
|
|
55
|
-
&.farm-chip--lighten span {
|
|
56
|
-
color: themeColor('secondary');
|
|
57
|
-
}
|
|
58
|
-
|
|
59
51
|
&.farm-chip--darken span {
|
|
60
52
|
color: white;
|
|
61
53
|
}
|
|
62
54
|
}
|
|
63
55
|
|
|
64
|
-
&[color='secondary']
|
|
56
|
+
&[color='secondary'],
|
|
57
|
+
&[color='secondary-golden'] {
|
|
58
|
+
&:not(.farm-chip--outlined).farm-chip--base span {
|
|
59
|
+
color: var(--farm-bw-black);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
&[color='secondary-green'] {
|
|
65
65
|
&.farm-chip--lighten span {
|
|
66
|
-
color: white;
|
|
66
|
+
color: var(--farm-bw-white);
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
|
|
@@ -98,11 +98,11 @@
|
|
|
98
98
|
|
|
99
99
|
&[color='neutral'] {
|
|
100
100
|
span {
|
|
101
|
-
color: themeColor('secondary');
|
|
101
|
+
color: themeColor('secondary-green');
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
&.farm-chip--lighten span {
|
|
105
|
-
color: themeColor('secondary');
|
|
105
|
+
color: themeColor('secondary-green');
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
}
|
|
@@ -22,13 +22,13 @@ export default {
|
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
export const Primary = () => ({
|
|
25
|
-
template: `<
|
|
25
|
+
template: `<farm-box>
|
|
26
26
|
<farm-chip color="primary">Chip (100% width)</farm-chip>
|
|
27
|
-
</
|
|
27
|
+
</farm-box>`,
|
|
28
28
|
});
|
|
29
29
|
|
|
30
30
|
export const Dense = () => ({
|
|
31
|
-
template: `<div
|
|
31
|
+
template: `<div>
|
|
32
32
|
<farm-chip color="primary" :dense="true">prop</farm-chip>
|
|
33
33
|
<farm-chip color="secondary" dense>attribute</farm-chip>
|
|
34
34
|
</div>`,
|
|
@@ -42,8 +42,8 @@ export const Colors = () => ({
|
|
|
42
42
|
};
|
|
43
43
|
},
|
|
44
44
|
template: `
|
|
45
|
-
<
|
|
46
|
-
<
|
|
45
|
+
<farm-row>
|
|
46
|
+
<farm-col cols="12" md="4" class="chips-container" v-for="color in colors" :key="'color_' + color">
|
|
47
47
|
<h4>{{ color }}</h4>
|
|
48
48
|
<farm-chip
|
|
49
49
|
v-for="variation in variations"
|
|
@@ -52,9 +52,9 @@ export const Colors = () => ({
|
|
|
52
52
|
:variation="variation">
|
|
53
53
|
{{ variation || 'base' }}
|
|
54
54
|
</farm-chip>
|
|
55
|
-
</
|
|
55
|
+
</farm-col>
|
|
56
56
|
|
|
57
|
-
</
|
|
57
|
+
</farm-row>`,
|
|
58
58
|
});
|
|
59
59
|
|
|
60
60
|
export const ColorsOutlined = () => ({
|
|
@@ -65,8 +65,8 @@ export const ColorsOutlined = () => ({
|
|
|
65
65
|
};
|
|
66
66
|
},
|
|
67
67
|
template: `
|
|
68
|
-
<
|
|
69
|
-
<
|
|
68
|
+
<farm-row>
|
|
69
|
+
<farm-col cols="12" md="4" class="chips-container" v-for="color in colors">
|
|
70
70
|
<h4>{{ color }}</h4>
|
|
71
71
|
<farm-chip
|
|
72
72
|
v-for="variation in variations"
|
|
@@ -76,14 +76,14 @@ export const ColorsOutlined = () => ({
|
|
|
76
76
|
:variation="variation">
|
|
77
77
|
{{ variation || 'base' }}
|
|
78
78
|
</farm-chip>
|
|
79
|
-
</
|
|
79
|
+
</farm-col>
|
|
80
80
|
|
|
81
|
-
</
|
|
81
|
+
</arm-row>`,
|
|
82
82
|
});
|
|
83
83
|
|
|
84
84
|
export const CustomTypography = () => ({
|
|
85
|
-
template: `<div
|
|
86
|
-
<farm-chip color="primary">
|
|
85
|
+
template: `<div>
|
|
86
|
+
<farm-chip color="primary" dense>
|
|
87
87
|
<farm-bodytext :type="2">BodyText 2</farm-bodytext>
|
|
88
88
|
</farm-chip>
|
|
89
89
|
</div>`,
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
.chips-container {
|
|
2
|
-
|
|
3
|
-
flex-direction: column;
|
|
4
|
-
max-width: 160px;
|
|
5
|
-
|
|
2
|
+
|
|
6
3
|
> .farm-chip {
|
|
7
4
|
margin-bottom: 16px;
|
|
8
5
|
}
|
|
@@ -14,15 +11,3 @@
|
|
|
14
11
|
}
|
|
15
12
|
}
|
|
16
13
|
}
|
|
17
|
-
|
|
18
|
-
.grid {
|
|
19
|
-
display: flex;
|
|
20
|
-
flex-wrap: wrap;
|
|
21
|
-
flex-direction: row;
|
|
22
|
-
|
|
23
|
-
> div.chips-container {
|
|
24
|
-
width: calc(33% - 32px);
|
|
25
|
-
margin: 0 16px;
|
|
26
|
-
max-width: 33%;
|
|
27
|
-
}
|
|
28
|
-
}
|