@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.
Files changed (148) hide show
  1. package/dist/front-mfe-components.common.js +4146 -5381
  2. package/dist/front-mfe-components.common.js.map +1 -1
  3. package/dist/front-mfe-components.css +2 -2
  4. package/dist/front-mfe-components.umd.js +4146 -5381
  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/AlertBox/AlertBox.scss +3 -2
  10. package/src/components/AlertBox/AlertBox.vue +2 -0
  11. package/src/components/Buttons/DefaultButton/DefaultButton.scss +57 -18
  12. package/src/components/Buttons/DefaultButton/DefaultButton.stories.js +49 -16
  13. package/src/components/Buttons/DefaultButton/DefaultButton.vue +3 -1
  14. package/src/components/Buttons/ExportButton/ExportButton.vue +2 -1
  15. package/src/components/Card/Card.scss +1 -1
  16. package/src/components/Card/CardComposition.stories.ts +8 -2
  17. package/src/components/Card/CardContent/CardContent.scss +11 -0
  18. package/src/components/Card/CardContent/CardContent.stories.js +11 -0
  19. package/src/components/Card/CardContent/CardContent.vue +9 -1
  20. package/src/components/CardContext/__tests__/CardContext.spec.js +5 -2
  21. package/src/components/Checkbox/Checkbox.scss +2 -2
  22. package/src/components/Checkbox/Checkbox.vue +2 -1
  23. package/src/components/Chip/Chip.scss +15 -15
  24. package/src/components/Chip/Chip.stories.js +13 -13
  25. package/src/components/Chip/Chip.stories.scss +1 -16
  26. package/src/components/Chip/Chip.vue +25 -3
  27. package/src/components/Collapsible/Collapsible.scss +8 -3
  28. package/src/components/Collapsible/Collapsible.stories.js +68 -1
  29. package/src/components/Collapsible/Collapsible.vue +68 -8
  30. package/src/components/ContextMenu/ContextMenu.scss +1 -1
  31. package/src/components/ContextMenu/ContextMenu.stories.js +42 -29
  32. package/src/components/ContextMenu/ContextMenu.vue +20 -1
  33. package/src/components/CopyToClipboard/CopyToClipboard.stories.js +7 -1
  34. package/src/components/CopyToClipboard/CopyToClipboard.vue +15 -3
  35. package/src/components/DataTableEmptyWrapper/DataTableEmptyWrapper.scss +6 -9
  36. package/src/components/DataTableEmptyWrapper/DataTableEmptyWrapper.stories.js +4 -0
  37. package/src/components/DataTableEmptyWrapper/DataTableEmptyWrapper.vue +21 -5
  38. package/src/components/{TextField/__tests__/TextField.spec.js → DataTableEmptyWrapper/__tests__/DataTableEmptyWrapper.spec.js} +3 -3
  39. package/src/components/DataTableHeader/DataTableHeader.scss +10 -12
  40. package/src/components/DataTableHeader/DataTableHeader.vue +5 -4
  41. package/src/components/DataTablePaginator/DataTablePaginator.scss +71 -69
  42. package/src/components/DatePicker/DatePicker.scss +5 -5
  43. package/src/components/DatePicker/DatePicker.vue +2 -3
  44. package/src/components/DatePicker/__tests__/DatePicker.spec.js +1 -1
  45. package/src/components/DatePicker/vDatePicker.scss +214 -0
  46. package/src/components/DialogFooter/DialogFooter.scss +1 -1
  47. package/src/components/DialogFooter/DialogFooter.stories.js +2 -2
  48. package/src/components/DialogFooter/DialogFooter.vue +1 -1
  49. package/src/components/DialogHeader/DialogHeader.scss +2 -3
  50. package/src/components/DialogHeader/DialogHeader.vue +4 -4
  51. package/src/components/Form/Form.stories.js +1 -1
  52. package/src/components/Icon/Icon.scss +6 -0
  53. package/src/components/Icon/Icon.stories.js +19 -1
  54. package/src/components/Icon/Icon.vue +8 -2
  55. package/src/components/IconBox/IconBox.stories.js +16 -0
  56. package/src/components/IconBox/IconBox.vue +17 -7
  57. package/src/components/IdCaption/IdCaption.vue +27 -13
  58. package/src/components/Label/Label.scss +17 -5
  59. package/src/components/Label/Label.stories.js +0 -1
  60. package/src/components/ListItem/ListItem.scss +5 -3
  61. package/src/components/ListItem/ListItem.vue +2 -0
  62. package/src/components/Logger/LoggerItem/LoggerItem.scss +9 -1
  63. package/src/components/Logger/LoggerItem/LoggerItem.vue +25 -8
  64. package/src/components/Logger/LoggerItem/__tests__/LoggerItem.spec.js +1 -1
  65. package/src/components/MainFilter/MainFilter.stories.js +4 -4
  66. package/src/components/Modal/Modal.scss +3 -3
  67. package/src/components/ModalPromptUser/ModalPromptUser.stories.js +26 -0
  68. package/src/components/ModalPromptUser/ModalPromptUser.vue +10 -0
  69. package/src/components/MultipleFilePicker/MultipleFilePicker.scss +19 -12
  70. package/src/components/MultipleFilePicker/MultipleFilePicker.stories.js +12 -0
  71. package/src/components/MultipleFilePicker/MultipleFilePicker.vue +18 -11
  72. package/src/components/MultipleFilePicker/__tests__/MultipleFilePicker.spec.js +9 -0
  73. package/src/components/ProgressBar/ProgressBar.vue +4 -0
  74. package/src/components/Radio/Radio.scss +18 -4
  75. package/src/components/Radio/Radio.stories.js +2 -1
  76. package/src/components/Radio/Radio.vue +3 -1
  77. package/src/components/RangeDatePicker/RangeDatePicker.vue +0 -2
  78. package/src/components/ResourceMetaInfo/ResourceMetaInfo.vue +8 -8
  79. package/src/components/Select/Select.scss +4 -0
  80. package/src/components/Select/Select.vue +9 -1
  81. package/src/components/Stepper/StepperHeader/StepperHeader.scss +7 -7
  82. package/src/components/Stepper/StepperHeader/StepperHeader.vue +35 -36
  83. package/src/components/Switcher/Switcher.scss +24 -8
  84. package/src/components/Switcher/Switcher.stories.js +33 -0
  85. package/src/components/Switcher/Switcher.vue +24 -3
  86. package/src/components/TableContextMenu/TableContextMenu.scss +4 -9
  87. package/src/components/TableContextMenu/TableContextMenu.stories.js +2 -0
  88. package/src/components/TableContextMenu/TableContextMenu.vue +5 -4
  89. package/src/components/Tabs/Tabs.scss +69 -0
  90. package/src/components/Tabs/Tabs.stories.js +51 -4
  91. package/src/components/Tabs/Tabs.vue +59 -32
  92. package/src/components/Tabs/__tests__/Tabs.spec.js +54 -54
  93. package/src/components/Tabs/index.ts +1 -0
  94. package/src/components/TextArea/TextArea.scss +7 -3
  95. package/src/components/TextArea/TextArea.vue +1 -0
  96. package/src/components/TextFieldV2/TextFieldV2.scss +8 -4
  97. package/src/components/TextFieldV2/TextFieldV2.vue +1 -0
  98. package/src/components/Tooltip/Tooltip.scss +8 -10
  99. package/src/components/Tooltip/Tooltip.vue +4 -2
  100. package/src/components/Typography/BodyText/BodyText.scss +7 -7
  101. package/src/components/Typography/Caption/Caption.scss +7 -7
  102. package/src/components/Typography/Caption/Caption.stories.js +1 -1
  103. package/src/components/Typography/Caption/Caption.vue +4 -1
  104. package/src/components/Typography/Caption/configurations.ts +3 -2
  105. package/src/components/Typography/Heading/Heading.scss +19 -19
  106. package/src/components/Typography/Heading/configurations.ts +5 -5
  107. package/src/components/Typography/Small/Small.scss +3 -0
  108. package/src/components/Typography/Small/Small.stories.js +34 -0
  109. package/src/components/Typography/Small/Small.vue +47 -0
  110. package/src/components/Typography/Small/__tests__/Small.spec.js +31 -0
  111. package/src/components/Typography/Small/configurations.ts +7 -0
  112. package/src/components/Typography/Subtitle/Subtitle.scss +7 -7
  113. package/src/components/Typography/Typography.scss +10 -0
  114. package/src/components/Typography/Typography.stories.js +15 -2
  115. package/src/components/Typography/Typography.vue +6 -2
  116. package/src/components/Typography/index.ts +2 -1
  117. package/src/components/ValueCaption/ValueCaption.vue +2 -0
  118. package/src/components/layout/Line/Line.scss +15 -0
  119. package/src/components/layout/Line/Line.stories.js +28 -5
  120. package/src/components/layout/Line/Line.vue +37 -3
  121. package/src/configurations/_mixins.scss +1 -1
  122. package/src/configurations/_theme-colors-background.scss +10 -0
  123. package/src/configurations/_theme-colors-bw.scss +10 -0
  124. package/src/configurations/_theme-colors.scss +79 -48
  125. package/src/configurations/_variables.scss +2 -0
  126. package/src/examples/Colors.stories.js +39 -1
  127. package/src/examples/Colors.stories.scss +1 -1
  128. package/src/helpers/index.ts +2 -1
  129. package/src/helpers/isChildOfFixedElement.js +16 -0
  130. package/src/main.ts +1 -5
  131. package/src/scss/Sticky-table.scss +13 -7
  132. package/src/scss/VuejsDialog.scss +58 -51
  133. package/src/scss/cssVariablesGenerator.scss +17 -14
  134. package/src/scss/utils.scss +17 -251
  135. package/src/components/FilePicker/FilePicker.scss +0 -53
  136. package/src/components/FilePicker/FilePicker.stories.js +0 -14
  137. package/src/components/FilePicker/FilePicker.vue +0 -109
  138. package/src/components/FilePicker/__tests__/FilePicker.spec.js +0 -77
  139. package/src/components/FilePicker/index.ts +0 -3
  140. package/src/components/TextField/TextField.scss +0 -43
  141. package/src/components/TextField/TextField.stories.js +0 -104
  142. package/src/components/TextField/TextField.vue +0 -18
  143. package/src/components/TextField/index.ts +0 -4
  144. package/src/scss/ButtonOverrides.scss +0 -73
  145. package/src/scss/DefaultModal.scss +0 -89
  146. package/src/scss/DialogOverrides.scss +0 -94
  147. package/src/scss/FormOverrides.scss +0 -264
  148. package/src/scss/Status-Chip.scss +0 -34
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@farm-investimentos/front-mfe-components",
3
- "version": "14.2.1",
3
+ "version": "15.0.0",
4
4
  "author": "farm investimentos",
5
5
  "private": false,
6
6
  "main": "./dist/front-mfe-components.common.js",
@@ -22,10 +22,11 @@
22
22
  }
23
23
  }
24
24
 
25
- &__icon {
26
- align-items: center;
25
+ &__icon.farm-icon {
26
+ align-items: self-start;
27
27
  display: flex;
28
28
  margin-right: 16px;
29
+ margin-top: 3px;
29
30
  }
30
31
 
31
32
  &__close {
@@ -80,6 +80,8 @@ export default Vue.extend({
80
80
  type: String as PropType<
81
81
  | 'primary'
82
82
  | 'secondary'
83
+ | 'secondary-green'
84
+ | 'secondary-golden'
83
85
  | 'neutral'
84
86
  | 'info'
85
87
  | 'success'
@@ -17,7 +17,7 @@ $butonSizes: (
17
17
  display: inline-flex;
18
18
  flex: 0 0 auto;
19
19
  font-weight: 700;
20
- letter-spacing: 1.25px;
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, $value in $sizes {
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.08;
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.16;
102
+ opacity: 0.27;
102
103
  }
103
104
  }
104
105
 
105
106
  &.farm-btn--plain {
106
107
  background-color: transparent !important;
107
108
 
108
- &:hover {
109
- .farm-btn__content {
110
- opacity: 0.68;
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.08;
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
- border: none;
128
- background: transparent;
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, $value in $sizes {
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
- ::v-deep .farm-btn__content i.mdi {
179
+ .farm-btn__content :deep(i.mdi) {
161
180
  color: var(--farm-#{$color}-base);
162
181
  }
163
182
 
164
- &.lighten-variation-icon {
183
+ &.farm-btn--variation-lighten {
165
184
  &:hover {
166
185
  color: var(--farm-#{$color}-lighten);
167
186
  }
168
187
 
169
- ::v-deep .farm-btn__content i.mdi {
188
+ .farm-btn__content :deep(i.mdi) {
170
189
  color: var(--farm-#{$color}-lighten);
171
190
  }
172
191
  }
173
192
 
174
- &.darken-variation-icon {
193
+ &.farm-btn--variation-darken {
175
194
  &:hover {
176
195
  color: var(--farm-#{$color}-darken);
177
196
  }
178
197
 
179
- ::v-deep .farm-btn__content i.mdi {
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 SecondaryActive = () => ({
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 SecondaryInactive = () => ({
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 TertiaryActive = () => ({
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 TertiaryInactive = () => ({
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: `<div class="buttons-container">
96
- <farm-btn v-for="color of colors":key="'random_9_' + color" :color="color">
97
- {{ color }}
98
- </farm-btn>
99
- </div>`,
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: `<div class="buttons-container">
199
- <h4>Icon</h4>
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 Icon</h4>
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 Icon</h4>
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 Icon</h4>
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
- </div>`,
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
- [this.variation + '-variation-icon']: true,
117
+ ['farm-btn--variation-' + this.variation]: true,
116
118
  ...obj,
117
119
  };
118
120
  },
@@ -72,8 +72,9 @@ export default Vue.extend({
72
72
  onClick(key) {
73
73
  this.$emit('onClick', key);
74
74
  },
75
- toggleValue() {
75
+ toggleValue(event: MouseEvent) {
76
76
  this.value = !this.value;
77
+ event.stopPropagation();
77
78
  },
78
79
  },
79
80
  });
@@ -3,7 +3,7 @@
3
3
  .farm-card {
4
4
  width: 100%;
5
5
  background: #ffffff;
6
- border: 1px solid var(--farm-stroke-base);
6
+ border: 1px solid var(--farm-gray-lighten);
7
7
  border-radius: 5px;
8
8
  overflow: hidden;
9
9
 
@@ -55,8 +55,14 @@ export const Shadow = () => ({
55
55
  export const BackgroundChildren = () => ({
56
56
  template: `<div style="width: 480px;">
57
57
  <farm-card>
58
- <farm-card-content style="background: #DADADA">
59
- Content!
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 :is="tag" class="farm-card__content" :gutter="gutter">
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: 2px solid themeColor('neutral', 'darken');
51
- border-radius: 2px;
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: 0 8px;
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: themeColor('secondary');
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: `<div class="chips-container chips-container-full-example">
25
+ template: `<farm-box>
26
26
  <farm-chip color="primary">Chip (100% width)</farm-chip>
27
- </div>`,
27
+ </farm-box>`,
28
28
  });
29
29
 
30
30
  export const Dense = () => ({
31
- template: `<div class="chips-container">
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
- <div class="grid">
46
- <div class="chips-container" v-for="color in colors">
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
- </div>
55
+ </farm-col>
56
56
 
57
- </div>`,
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
- <div class="grid">
69
- <div class="chips-container" v-for="color in colors">
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
- </div>
79
+ </farm-col>
80
80
 
81
- </div>`,
81
+ </arm-row>`,
82
82
  });
83
83
 
84
84
  export const CustomTypography = () => ({
85
- template: `<div class="chips-container">
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
- display: flex;
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
- }