@farm-investimentos/front-mfe-components 14.2.2 → 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 +1232 -1133
- 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 +1232 -1133
- 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 +35 -9
- package/src/components/Buttons/DefaultButton/DefaultButton.stories.js +4 -4
- package/src/components/Buttons/DefaultButton/DefaultButton.vue +2 -0
- 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 +3 -3
- package/src/components/ContextMenu/ContextMenu.vue +14 -2
- 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/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/ResourceMetaInfo/ResourceMetaInfo.vue +8 -8
- package/src/components/Select/Select.scss +4 -0
- package/src/components/Select/Select.vue +4 -0
- package/src/components/Stepper/StepperHeader/StepperHeader.scss +7 -7
- 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 +3 -3
- package/src/components/Tabs/Tabs.scss +21 -10
- package/src/components/Tabs/Tabs.vue +45 -24
- 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 +0 -3
- package/src/scss/Sticky-table.scss +8 -6
- 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;
|
|
@@ -93,28 +93,45 @@ $butonSizes: (
|
|
|
93
93
|
|
|
94
94
|
&:not(.farm-btn--plain):hover {
|
|
95
95
|
&:before {
|
|
96
|
-
opacity: 0.
|
|
96
|
+
opacity: 0.14;
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
&:not(.farm-btn--plain):not(.farm-btn--disabled):active {
|
|
101
101
|
&:before {
|
|
102
|
-
opacity: 0.
|
|
102
|
+
opacity: 0.27;
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
&.farm-btn--plain {
|
|
107
107
|
background-color: transparent !important;
|
|
108
108
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
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;
|
|
112
129
|
}
|
|
113
130
|
}
|
|
114
131
|
|
|
115
132
|
&:active {
|
|
116
133
|
&:before {
|
|
117
|
-
opacity: 0.
|
|
134
|
+
opacity: 0.73;
|
|
118
135
|
}
|
|
119
136
|
}
|
|
120
137
|
}
|
|
@@ -125,7 +142,6 @@ $butonSizes: (
|
|
|
125
142
|
}
|
|
126
143
|
|
|
127
144
|
.farm-btn.farm-btn--icon {
|
|
128
|
-
border: none;
|
|
129
145
|
background: transparent !important;
|
|
130
146
|
border: transparent !important;
|
|
131
147
|
transition: color 0.5s ease;
|
|
@@ -195,10 +211,13 @@ $butonSizes: (
|
|
|
195
211
|
|
|
196
212
|
@each $color in $theme-colors-list {
|
|
197
213
|
#{'.farm-btn--' + $color} {
|
|
198
|
-
border: 1px solid var(--farm-#{$color}-base);
|
|
199
214
|
background-color: var(--farm-#{$color}-base);
|
|
200
215
|
color: white;
|
|
201
216
|
|
|
217
|
+
&.farm-btn--outlined {
|
|
218
|
+
border: 1px solid var(--farm-#{$color}-base);
|
|
219
|
+
}
|
|
220
|
+
|
|
202
221
|
&:not(.farm-btn--outlined):not(.farm-btn--plain):not(.farm-btn--icon) {
|
|
203
222
|
::v-deep .farm-btn__content {
|
|
204
223
|
i.mdi {
|
|
@@ -216,6 +235,7 @@ $butonSizes: (
|
|
|
216
235
|
background-color: var(--farm-#{$color}-lighten);
|
|
217
236
|
color: var(--farm-text-primary);
|
|
218
237
|
}
|
|
238
|
+
|
|
219
239
|
&.farm-btn--variation-darken {
|
|
220
240
|
border: 1px solid var(--farm-#{$color}-darken);
|
|
221
241
|
background-color: var(--farm-#{$color}-darken);
|
|
@@ -275,6 +295,12 @@ $butonSizes: (
|
|
|
275
295
|
}
|
|
276
296
|
}
|
|
277
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
|
+
|
|
278
304
|
.farm-btn--plain.farm-btn--disabled {
|
|
279
305
|
background-color: transparent;
|
|
280
306
|
border: none;
|
|
@@ -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
|
});
|
|
@@ -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
|
-
}
|
|
@@ -1,23 +1,45 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<span
|
|
3
|
+
v-bind="$props"
|
|
4
|
+
v-on="$listeners"
|
|
3
5
|
:class="{
|
|
4
6
|
'farm-chip': true,
|
|
5
7
|
'farm-chip--dense': dense,
|
|
6
8
|
'farm-chip--outlined': outlined,
|
|
9
|
+
'farm-chip--base': variation === 'base' || !variation,
|
|
7
10
|
'farm-chip--lighten': variation === 'lighten',
|
|
8
11
|
'farm-chip--darken': variation === 'darken',
|
|
9
12
|
}"
|
|
10
13
|
>
|
|
11
|
-
<farm-
|
|
14
|
+
<farm-caption tag="span" color="white" ellipsis> <slot></slot> </farm-caption>
|
|
12
15
|
</span>
|
|
13
16
|
</template>
|
|
14
17
|
<script lang="ts">
|
|
15
|
-
import Vue from 'vue';
|
|
18
|
+
import Vue, { PropType } from 'vue';
|
|
16
19
|
|
|
17
20
|
export default Vue.extend({
|
|
18
21
|
name: 'farm-chip',
|
|
19
22
|
inheritAttrs: true,
|
|
20
23
|
props: {
|
|
24
|
+
/**
|
|
25
|
+
* Color
|
|
26
|
+
*/
|
|
27
|
+
color: {
|
|
28
|
+
type: String as PropType<
|
|
29
|
+
| 'primary'
|
|
30
|
+
| 'secondary'
|
|
31
|
+
| 'secondary-green'
|
|
32
|
+
| 'secondary-golden'
|
|
33
|
+
| 'neutral'
|
|
34
|
+
| 'info'
|
|
35
|
+
| 'success'
|
|
36
|
+
| 'error'
|
|
37
|
+
| 'warning'
|
|
38
|
+
| 'extra-1'
|
|
39
|
+
| 'extra-2'
|
|
40
|
+
>,
|
|
41
|
+
default: 'primary',
|
|
42
|
+
},
|
|
21
43
|
/**
|
|
22
44
|
* Is dense (not 100% width)?
|
|
23
45
|
*/
|
|
@@ -34,7 +56,7 @@ export default Vue.extend({
|
|
|
34
56
|
},
|
|
35
57
|
variation: {
|
|
36
58
|
type: String,
|
|
37
|
-
default: '',
|
|
59
|
+
default: 'base',
|
|
38
60
|
},
|
|
39
61
|
},
|
|
40
62
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
.collapsible {
|
|
2
2
|
width: 100%;
|
|
3
|
-
|
|
3
|
+
|
|
4
4
|
&__header {
|
|
5
5
|
width: 100%;
|
|
6
6
|
display: flex;
|
|
@@ -15,8 +15,13 @@
|
|
|
15
15
|
justify-content: flex-start;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
&
|
|
18
|
+
&__content-right {
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
justify-content: space-between;
|
|
22
|
+
}
|
|
19
23
|
|
|
24
|
+
&__icon {
|
|
20
25
|
&--main {
|
|
21
26
|
margin-right: 0.5rem;
|
|
22
27
|
}
|
|
@@ -40,4 +45,4 @@
|
|
|
40
45
|
.fade-enter,
|
|
41
46
|
.fade-leave-to {
|
|
42
47
|
opacity: 0;
|
|
43
|
-
}
|
|
48
|
+
}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import Collapsible from './Collapsible';
|
|
2
|
+
import baseThemeColors from '../../configurations/_theme-colors-base.scss';
|
|
3
|
+
const colors = Object.keys(baseThemeColors);
|
|
4
|
+
const variations = ['', 'darken', 'lighten'];
|
|
2
5
|
|
|
3
6
|
export default {
|
|
4
7
|
title: 'Surfaces/Collapsible',
|
|
@@ -22,7 +25,8 @@ export const Title = () => ({
|
|
|
22
25
|
});
|
|
23
26
|
|
|
24
27
|
export const Icon = () => ({
|
|
25
|
-
template:
|
|
28
|
+
template:
|
|
29
|
+
'<farm-collapsible icon="plus" title="With Icon">collapsible content</farm-collapsible>',
|
|
26
30
|
});
|
|
27
31
|
|
|
28
32
|
export const Opened = () => ({
|
|
@@ -43,7 +47,70 @@ export const Opened = () => ({
|
|
|
43
47
|
</div>`,
|
|
44
48
|
});
|
|
45
49
|
|
|
50
|
+
export const ColorsChips = () => ({
|
|
51
|
+
data() {
|
|
52
|
+
return {
|
|
53
|
+
colors,
|
|
54
|
+
variations,
|
|
55
|
+
};
|
|
56
|
+
},
|
|
57
|
+
template: `
|
|
58
|
+
<farm-row>
|
|
59
|
+
<farm-col cols="12" md="4" v-for="color in colors" :key="'color_' + color">
|
|
60
|
+
<h4 style="margin:15px">{{ color }}</h4>
|
|
61
|
+
<farm-collapsible
|
|
62
|
+
style="margin-top:15px"
|
|
63
|
+
v-for="variation in variations"
|
|
64
|
+
icon="plus"
|
|
65
|
+
textChip="chip"
|
|
66
|
+
title="color chip"
|
|
67
|
+
:key="color + '_' + variation"
|
|
68
|
+
:showChip="true"
|
|
69
|
+
:colorChip="color"
|
|
70
|
+
:variation="variation"
|
|
71
|
+
>
|
|
72
|
+
</farm-collapsible>
|
|
73
|
+
</farm-col>
|
|
74
|
+
</farm-row>`,
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
export const ColorsOutlinedChips = () => ({
|
|
78
|
+
data() {
|
|
79
|
+
return {
|
|
80
|
+
colors,
|
|
81
|
+
variations,
|
|
82
|
+
};
|
|
83
|
+
},
|
|
84
|
+
template: `
|
|
85
|
+
<farm-row>
|
|
86
|
+
<farm-col cols="12" md="4" v-for="color in colors" :key="'color_' + color">
|
|
87
|
+
<h4 style="margin:15px">{{ color }}</h4>
|
|
88
|
+
<farm-collapsible
|
|
89
|
+
style="margin-top:15px"
|
|
90
|
+
v-for="variation in variations"
|
|
91
|
+
icon="plus"
|
|
92
|
+
textChip="chip"
|
|
93
|
+
title="color chip"
|
|
94
|
+
:key="color + '_' + variation"
|
|
95
|
+
:showChip="true"
|
|
96
|
+
:outlined="true"
|
|
97
|
+
:colorChip="color"
|
|
98
|
+
:variation="variation"
|
|
99
|
+
>
|
|
100
|
+
</farm-collapsible>
|
|
101
|
+
</farm-col>
|
|
102
|
+
</farm-row>`,
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
export const Dense = () => ({
|
|
106
|
+
template:
|
|
107
|
+
'<farm-collapsible icon="plus" title="With Icon" textChip="chip" dense showChip>collapsible content</farm-collapsible>',
|
|
108
|
+
});
|
|
109
|
+
|
|
46
110
|
Primary.storyName = 'Basic';
|
|
47
111
|
Title.storyName = 'Title';
|
|
48
112
|
Icon.storyName = 'Icon';
|
|
49
113
|
Opened.storyName = 'Opened';
|
|
114
|
+
ColorsChips.storyName = 'Colors';
|
|
115
|
+
ColorsOutlinedChips.storyName = 'Outlined';
|
|
116
|
+
Dense.storyName = 'Dense';
|