@farm-investimentos/front-mfe-components 11.0.0 → 11.0.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@farm-investimentos/front-mfe-components",
3
- "version": "11.0.0",
3
+ "version": "11.0.2",
4
4
  "author": "farm investimentos",
5
5
  "private": false,
6
6
  "main": "./dist/front-mfe-components.common.js",
@@ -144,7 +144,7 @@
144
144
  color: var(--farm-#{$color}-base);
145
145
  }
146
146
 
147
- i.mdi {
147
+ ::v-deep .farm-btn__content i.mdi {
148
148
  color: var(--farm-#{$color}-base);
149
149
  }
150
150
  }
@@ -64,3 +64,12 @@ export const NoIcon = () => ({
64
64
  </farm-card-context>
65
65
  `,
66
66
  });
67
+
68
+ export const TooltipText = () => ({
69
+ template: `
70
+ <farm-card-context tooltipText="Lorem Ipsum is simply dummy text of the printing and typesetting industry" icon="mdi-currency-usd" title="Titulo do Card">
71
+ <p>Conteúdo do Card</p>
72
+ </farm-card-context>
73
+ `,
74
+ });
75
+
@@ -9,9 +9,22 @@
9
9
  <div class="card-context-header" v-if="isSuccess && title">
10
10
  <farm-icon-box v-if="icon" :icon="icon" />
11
11
  <div class="card-context-content">
12
- <p :class="{ 'card-context-title': true, 'card-context-content--bold': bold }">
13
- {{ title }}
14
- </p>
12
+ <div class="d-flex align-center">
13
+ <p :class="{
14
+ 'mr-2': true,
15
+ 'mb-1': true,
16
+ 'card-context-title': true,
17
+ 'card-context-content--bold': bold }"
18
+ >
19
+ {{ title }}
20
+ </p>
21
+ <farm-tooltip v-if="tooltipText !== null">
22
+ {{ tooltipText }}
23
+ <template v-slot:activator="{}">
24
+ <farm-icon size="sm" color="gray">help-circle</farm-icon>
25
+ </template>
26
+ </farm-tooltip>
27
+ </div>
15
28
  </div>
16
29
  </div>
17
30
  <div class="card-context-body" v-if="isSuccess">
@@ -93,6 +106,13 @@ export default Vue.extend({
93
106
  type: Boolean,
94
107
  default: false,
95
108
  },
109
+ /**
110
+ * Show Tooltip and help text
111
+ */
112
+ tooltipText: {
113
+ type: String,
114
+ default: null,
115
+ }
96
116
  },
97
117
  computed: {
98
118
  isSuccess() {
@@ -34,7 +34,10 @@
34
34
  &.farm-chip--lighten {
35
35
  background-color: themeColor($color, 'lighten');
36
36
  border-color: themeColor($color, 'lighten');
37
- color: themeColor($color, 'darken');
37
+
38
+ span {
39
+ color: themeColor($color, 'darken');
40
+ }
38
41
  }
39
42
 
40
43
  &.farm-chip--darken {
@@ -45,18 +48,21 @@
45
48
  }
46
49
 
47
50
  &[color='neutral'] {
48
- color: themeColor('secondary');
51
+ span {
52
+ color: themeColor('secondary');
53
+ }
49
54
 
50
- &.farm-chip--lighten {
55
+ &.farm-chip--lighten span {
51
56
  color: themeColor('secondary');
52
57
  }
53
- &.farm-chip--darken {
58
+
59
+ &.farm-chip--darken span {
54
60
  color: white;
55
61
  }
56
62
  }
57
63
 
58
64
  &[color='secondary'] {
59
- &.farm-chip--lighten {
65
+ &.farm-chip--lighten span {
60
66
  color: white;
61
67
  }
62
68
  }
@@ -65,26 +71,37 @@
65
71
  @each $color in $theme-colors-list {
66
72
  &#{'[color=' + $color + ']'} {
67
73
  background-color: transparent;
68
- color: themeColor($color);
74
+
75
+ span {
76
+ color: themeColor($color);
77
+ }
69
78
 
70
79
  &.farm-chip--lighten {
71
80
  background-color: transparent;
72
81
  border-color: themeColor($color, 'lighten');
73
- color: themeColor($color);
82
+
83
+ span {
84
+ color: themeColor($color);
85
+ }
74
86
  }
75
87
 
76
88
  &.farm-chip--darken {
77
89
  background-color: transparent;
78
90
  border-color: themeColor($color, 'darken');
79
- color: themeColor($color, 'darken');
91
+
92
+ span {
93
+ color: themeColor($color, 'darken');
94
+ }
80
95
  }
81
96
  }
82
97
  }
83
98
 
84
99
  &[color='neutral'] {
85
- color: themeColor('secondary');
100
+ span {
101
+ color: themeColor('secondary');
102
+ }
86
103
 
87
- &.farm-chip--lighten {
104
+ &.farm-chip--lighten span {
88
105
  color: themeColor('secondary');
89
106
  }
90
107
  }
@@ -42,8 +42,7 @@ export const Colors = () => ({
42
42
  };
43
43
  },
44
44
  template: `
45
- <div>
46
- <h3>Colors & variations</h3>
45
+ <div class="grid">
47
46
  <div class="chips-container" v-for="color in colors">
48
47
  <h4>{{ color }}</h4>
49
48
  <farm-chip
@@ -66,8 +65,7 @@ export const ColorsOutlined = () => ({
66
65
  };
67
66
  },
68
67
  template: `
69
- <div>
70
- <h3>Outlined</h3>
68
+ <div class="grid">
71
69
  <div class="chips-container" v-for="color in colors">
72
70
  <h4>{{ color }}</h4>
73
71
  <farm-chip
@@ -13,4 +13,16 @@
13
13
  margin-bottom: 0;
14
14
  }
15
15
  }
16
+ }
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
+ }
16
28
  }
@@ -8,7 +8,7 @@
8
8
  'farm-chip--darken': variation === 'darken',
9
9
  }"
10
10
  >
11
- <farm-typography tag="span" size="sm"> <slot></slot> </farm-typography>
11
+ <farm-typography tag="span" size="sm" color="white"> <slot></slot> </farm-typography>
12
12
  </span>
13
13
  </template>
14
14
  <script lang="ts">
@@ -1,8 +1,10 @@
1
1
  .farm-dialog-header__close {
2
2
  position: absolute;
3
- right: 1rem;
4
- margin-top: 4px;
5
- font-size: 1rem;
3
+ right: 16px;
4
+ margin-top: 0;
5
+ font-size: 16px;
6
+
7
+ transition: all 0.4s;
6
8
 
7
9
  &:hover {
8
10
  opacity: 0.8;
@@ -18,4 +20,5 @@ header {
18
20
  border-bottom: 1px solid var(--farm-stroke-divider);
19
21
  display: flex;
20
22
  justify-content: flex-start;
23
+ align-items: center;
21
24
  }
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <header>
3
- <farm-icon v-if="iconTitle" size="16px" color="secondary">{{ iconTitle }}</farm-icon>
4
- <farm-caption v-if="title" variation="regular" bold>
3
+ <farm-icon v-if="iconTitle" size="16px" color="primary">{{ iconTitle }}</farm-icon>
4
+ <farm-caption v-if="title" variation="regular" color="primary" bold>
5
5
  {{ title }}
6
6
  </farm-caption>
7
7
 
@@ -26,7 +26,7 @@
26
26
  &--container {
27
27
  background-color: white;
28
28
  border-radius: 8px;
29
- max-height: calc(100vh - 64px);
29
+ max-height: calc(100vh - 48px);
30
30
  position: relative;
31
31
  overflow: hidden;
32
32
  z-index: 102;
@@ -34,12 +34,21 @@
34
34
  }
35
35
 
36
36
  &--content {
37
- max-height: calc(100vh - 64px);
38
- overflow-y: auto;
37
+ max-height: calc(100vh - 48px);
38
+ //overflow-y: auto;
39
39
  width: 100%;
40
- padding: 0 16px;
40
+ padding: 0;
41
+
42
+ >div {
43
+ //max-height: calc(100vh - 176px);
44
+ //max-height: calc(100vh - 64px);
45
+ overflow-y: auto;
46
+ padding: 0 16px;
47
+ }
41
48
  }
42
49
 
50
+
51
+
43
52
  &--header {
44
53
  position: absolute;
45
54
  top: 0;
@@ -24,7 +24,7 @@ export const Primary = () => ({
24
24
  };
25
25
  },
26
26
  template: `<div>
27
- <farm-btn color="secondary" @click="value = true">abrir</farm-btn>
27
+ <farm-btn @click="value = true">abrir</farm-btn>
28
28
  <farm-modal v-model="value">
29
29
  <template v-slot:content>
30
30
  <div v-html="text" />
@@ -33,6 +33,22 @@ export const Primary = () => ({
33
33
  </div>`,
34
34
  });
35
35
 
36
+ export const SmallContent = () => ({
37
+ data() {
38
+ return {
39
+ value: false,
40
+ };
41
+ },
42
+ template: `<div>
43
+ <farm-btn @click="value = true">abrir</farm-btn>
44
+ <farm-modal v-model="value">
45
+ <template v-slot:content>
46
+ small content
47
+ </template>
48
+ </farm-modal>
49
+ </div>`,
50
+ });
51
+
36
52
  export const HeaderAndBottomFromDS = () => ({
37
53
  data() {
38
54
  return {
@@ -41,7 +57,7 @@ export const HeaderAndBottomFromDS = () => ({
41
57
  };
42
58
  },
43
59
  template: `<div>
44
- <farm-btn color="secondary" @click="value = true">abrir</farm-btn>
60
+ <farm-btn @click="value = true">abrir</farm-btn>
45
61
  <farm-modal v-model="value" :offsetTop="48" :offsetBottom="68">
46
62
  <template v-slot:header>
47
63
  <farm-dialog-header title="Título" @onClose="() => value = false" />
@@ -65,7 +81,7 @@ export const SizeMD = () => ({
65
81
  };
66
82
  },
67
83
  template: `<div>
68
- <farm-btn color="secondary" @click="value = true">abrir</farm-btn>
84
+ <farm-btn @click="value = true">abrir</farm-btn>
69
85
  <farm-modal v-model="value" size="md">
70
86
  <template v-slot:content>
71
87
  <div v-html="text" />
@@ -82,7 +98,7 @@ export const SizeSmall = () => ({
82
98
  };
83
99
  },
84
100
  template: `<div>
85
- <farm-btn color="secondary" @click="value = true">abrir</farm-btn>
101
+ <farm-btn @click="value = true">abrir</farm-btn>
86
102
  <farm-modal v-model="value" size="sm">
87
103
  <template v-slot:content>
88
104
  <div v-html="text" />
@@ -99,7 +115,7 @@ export const SizeXs = () => ({
99
115
  };
100
116
  },
101
117
  template: `<div>
102
- <farm-btn color="secondary" @click="value = true">abrir</farm-btn>
118
+ <farm-btn @click="value = true">abrir</farm-btn>
103
119
  <farm-modal v-model="value" size="xs">
104
120
  <template v-slot:content>
105
121
  <div v-html="text" />
@@ -116,7 +132,7 @@ export const HeaderAndBottom = () => ({
116
132
  };
117
133
  },
118
134
  template: `<div>
119
- <farm-btn color="secondary" @click="value = true">abrir</farm-btn>
135
+ <farm-btn @click="value = true">abrir</farm-btn>
120
136
  <farm-modal v-model="value" :offsetTop="24" :offsetBottom="68">
121
137
  <template v-slot:header>
122
138
  Header
@@ -139,7 +155,7 @@ export const HorizontalScroll = () => ({
139
155
  };
140
156
  },
141
157
  template: `<div>
142
- <farm-btn color="secondary" @click="value = true">abrir</farm-btn>
158
+ <farm-btn @click="value = true">abrir</farm-btn>
143
159
  <farm-modal v-model="value" size="md" :offsetBottom="68">
144
160
  <template v-slot:content>
145
161
  <div style="width: 800px;">
@@ -161,7 +177,7 @@ export const CustomHeader = () => ({
161
177
  };
162
178
  },
163
179
  template: `<div>
164
- <farm-btn color="secondary" @click="value = true">abrir</farm-btn>
180
+ <farm-btn @click="value = true">abrir</farm-btn>
165
181
  <farm-modal v-model="value" :offsetTop="24" :offsetBottom="68">
166
182
  <template v-slot:header>
167
183
  <farm-dialog-header>
@@ -187,7 +203,7 @@ export const Persistent = () => ({
187
203
  };
188
204
  },
189
205
  template: `<div>
190
- <farm-btn color="secondary" @click="value = true">abrir</farm-btn>
206
+ <farm-btn @click="value = true">abrir</farm-btn>
191
207
  <farm-modal v-model="value" :offsetTop="48" :offsetBottom="64" :persistent="true">
192
208
  <template v-slot:header>
193
209
  <farm-dialog-header title="Título" @onClose="() => value = false" />
@@ -245,4 +261,39 @@ teste!<br />
245
261
  teste!<br />
246
262
  teste!<br />
247
263
  teste!<br />
264
+ teste!<br />
265
+ teste!<br />
266
+ teste!<br />
267
+ teste!<br />
268
+ teste!<br />
269
+ teste 1!<br />
270
+ teste!<br />
271
+ teste!<br />
272
+ teste!<br />
273
+ teste!<br />
274
+ teste!<br />
275
+ teste!<br />
276
+ teste!<br />
277
+ teste!<br />
278
+ teste!<br />
279
+ teste!<br />
280
+ teste!<br />
281
+ teste!<br />
282
+ teste!<br />
283
+ teste!<br />
284
+ teste!<br />
285
+ teste!<br />
286
+ teste!<br />
287
+ teste 2!<br />
288
+ teste!<br />
289
+ teste!<br />
290
+ teste!<br />
291
+ teste!<br />
292
+ teste!<br />
293
+ teste!<br />
294
+ teste!<br />
295
+ teste!<br />
296
+ teste!<br />
297
+ teste!<br />
298
+ teste!<br />
248
299
  teste 3!`;
@@ -3,12 +3,17 @@
3
3
  <div :class="{ 'farm-modal': true, ['farm-modal--size-' + size]: true }" v-if="inputValue">
4
4
  <div class="farm-modal--container">
5
5
  <div class="farm-modal--header">
6
+ <!-- @slot header -->
6
7
  <slot name="header"></slot>
7
8
  </div>
8
- <div class="farm-modal--content" :style="styles">
9
- <slot name="content"></slot>
9
+ <div class="farm-modal--content">
10
+ <div :style="styles">
11
+ <!-- @slot main content -->
12
+ <slot name="content"></slot>
13
+ </div>
10
14
  </div>
11
15
  <div class="farm-modal--footer">
16
+ <!-- @slot footer -->
12
17
  <slot name="footer"></slot>
13
18
  </div>
14
19
  </div>
@@ -55,6 +60,7 @@ export default Vue.extend({
55
60
  const styles = {
56
61
  marginTop: offsetTop.value + 'px',
57
62
  marginBottom: offsetBottom.value + 'px',
63
+ maxHeight: `calc(100vh - ${offsetTop.value + offsetBottom.value + 48}px)`,
58
64
  };
59
65
 
60
66
  const close = () => {
@@ -1,5 +1,6 @@
1
1
  @import '../../configurations/variables';
2
2
  @import '../../configurations/mixins';
3
+ @import '../../configurations/theme-colors';
3
4
 
4
5
  .farm-typography {
5
6
  font-size: 16px;
@@ -24,13 +25,20 @@
24
25
  margin-bottom: auto;
25
26
  }
26
27
 
27
- @each $k in $colors {
28
+ color: var(--farm-text-primary);
29
+
30
+ @each $k in $theme-colors-list {
28
31
  &#{'[color=' + $k + ']'} {
29
- color: var(--v-#{$k}-base);
32
+ color: var(--farm-#{$k}-base);
30
33
  }
31
34
  }
32
35
 
33
- @each $s, $val in $fontSizes {
36
+ &[color=white] {
37
+ color: white;
38
+ }
39
+
40
+ @each $s,
41
+ $val in $fontSizes {
34
42
  &--#{$s} {
35
43
  font-size: $val;
36
44
  }
@@ -44,9 +52,11 @@
44
52
  }
45
53
 
46
54
  @include upToSm {
47
- @each $s, $val in $fontSizes {
55
+
56
+ @each $s,
57
+ $val in $fontSizes {
48
58
  .farm-typography--#{$s} {
49
59
  font-size: calc(#{$val} - 2px);
50
60
  }
51
61
  }
52
- }
62
+ }
@@ -1,6 +1,8 @@
1
1
  import Typography from './Typography';
2
2
  import sizes from '../../configurations/sizes';
3
- import colors from '../../configurations/colors';
3
+ import baseThemeColors from '../../configurations/_theme-colors-base.scss';
4
+
5
+ const colors = Object.keys(baseThemeColors);
4
6
 
5
7
  export default {
6
8
  title: 'Typography/Atom',
@@ -8,7 +10,9 @@ export default {
8
10
  parameters: {
9
11
  docs: {
10
12
  description: {
11
- component: `Typography<br />selector: <em>farm-typography</em>`,
13
+ component: `Typography<br />
14
+ selector: <em>farm-typography</em><br />
15
+ <span style="color: var(--farm-primary-base);">ready for use</span>`,
12
16
  },
13
17
  },
14
18
 
@@ -17,32 +21,26 @@ export default {
17
21
  };
18
22
 
19
23
  export const Primary = () => ({
20
- components: { 'farm-typography': Typography },
21
24
  template: '<farm-typography type="legenda">Typography</farm-typography>',
22
25
  });
23
26
 
24
27
  export const Bold = () => ({
25
- components: { 'farm-typography': Typography },
26
28
  template: '<farm-typography bold>Typography</farm-typography>',
27
29
  });
28
30
 
29
31
  export const Italic = () => ({
30
- components: { 'farm-typography': Typography },
31
32
  template: '<farm-typography italic>Typography</farm-typography>',
32
33
  });
33
34
 
34
35
  export const Underline = () => ({
35
- components: { 'farm-typography': Typography },
36
36
  template: '<farm-typography underline>Typography</farm-typography>',
37
37
  });
38
38
 
39
39
  export const LineThrough = () => ({
40
- components: { 'farm-typography': Typography },
41
40
  template: '<farm-typography line-through>Typography</farm-typography>',
42
41
  });
43
42
 
44
43
  export const Weight = () => ({
45
- components: { 'farm-typography': Typography },
46
44
  data() {
47
45
  return {
48
46
  weights: [100, 200, 300, 400, 500, 600, 700],
@@ -57,7 +55,6 @@ const newSizes = [...sizes];
57
55
  newSizes.splice(3, 0, 'default');
58
56
 
59
57
  export const Sizes = () => ({
60
- components: { 'farm-typography': Typography },
61
58
  data() {
62
59
  return {
63
60
  sizes: newSizes,
@@ -75,7 +72,6 @@ export const Sizes = () => ({
75
72
  });
76
73
 
77
74
  export const CustomSizes = () => ({
78
- components: { 'farm-typography': Typography },
79
75
  data() {
80
76
  return {
81
77
  sizes: ['11px', '1.12876rem', '48px'],
@@ -93,10 +89,9 @@ export const CustomSizes = () => ({
93
89
  });
94
90
 
95
91
  export const Colors = () => ({
96
- components: { 'farm-typography': Typography },
97
92
  data() {
98
93
  return {
99
- colors,
94
+ colors: ['default', ...colors, 'white'],
100
95
  };
101
96
  },
102
97
  template: `<div>
@@ -111,7 +106,6 @@ export const Colors = () => ({
111
106
  });
112
107
 
113
108
  export const Tags = () => ({
114
- components: { 'farm-typography': Typography },
115
109
  data() {
116
110
  return {
117
111
  tags: ['p', 'span', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'legend', 'label', 'li'],
@@ -129,7 +123,6 @@ export const Tags = () => ({
129
123
  });
130
124
 
131
125
  export const LineHeight = () => ({
132
- components: { 'farm-typography': Typography },
133
126
  data() {
134
127
  return {
135
128
  heights: ['12px', '16px', '20px', '24px', '32px', '40px'],
@@ -7,6 +7,7 @@
7
7
  ['farm-typography--weight-' + weight]: weight !== undefined,
8
8
  }"
9
9
  :style="style"
10
+ :color="color"
10
11
  >
11
12
  <slot></slot>
12
13
  </component>
@@ -33,9 +34,25 @@ export default Vue.extend({
33
34
  type: String,
34
35
  },
35
36
  weight: {
36
- type: Number as PropType<
37
- 100 | 200 | 300 | 400 | 500 | 600 | 700
38
- >
37
+ type: Number as PropType<100 | 200 | 300 | 400 | 500 | 600 | 700>,
38
+ },
39
+ /**
40
+ * Color
41
+ */
42
+ color: {
43
+ type: String as PropType<
44
+ | 'primary'
45
+ | 'secondary'
46
+ | 'neutral'
47
+ | 'info'
48
+ | 'success'
49
+ | 'error'
50
+ | 'warning'
51
+ | 'success'
52
+ | 'extra-1'
53
+ | 'extra-2'
54
+ >,
55
+ default: 'default',
39
56
  },
40
57
  },
41
58
  setup(props) {
@@ -12,25 +12,4 @@
12
12
  position: relative;
13
13
  }
14
14
 
15
- @each $k in $justifications {
16
- &#{'--justify-' + $k} {
17
- >div {
18
- justify-content: $k;
19
- }
20
- }
21
- }
22
-
23
- @each $k in $directions {
24
- &#{'--direction-' + $k} {
25
- >div {
26
- flex-direction: $k;
27
- }
28
- }
29
- }
30
-
31
- @each $k in map-keys($gutters) {
32
- &#{'[gutter=' + $k + ']'} {
33
- padding: map-get($gutters, $k);
34
- }
35
- }
36
15
  }
@@ -1,5 +1,4 @@
1
1
  import Box from './Box.vue';
2
- import { directions, justifications } from '../../../configurations/flexVariables';
3
2
  import gutters from '../../../configurations/gutters';
4
3
 
5
4
  export default {
@@ -30,42 +29,6 @@ export const Tag = () => ({
30
29
  </div>`,
31
30
  });
32
31
 
33
- export const Justify = () => ({
34
- data() {
35
- return {
36
- justifications,
37
- };
38
- },
39
- template: `<div>
40
- <farm-box :justify="k" v-for="k in justifications" :key="'justify-_' + k" style="border:1px solid var(--farm-stroke-base); margin-bottom: 16px;">
41
- <div>
42
- justify {{ k }}
43
- </div>
44
- <div>
45
- another div
46
- </div>
47
- </farm-box>
48
- </div>`,
49
- });
50
-
51
- export const Directions = () => ({
52
- data() {
53
- return {
54
- directions,
55
- };
56
- },
57
- template: `<div>
58
- <farm-box :direction="k" v-for="k in directions" :key="'direction-_' + k" style="border:1px solid var(--farm-stroke-base); margin-bottom: 16px;">
59
- <div>
60
- direction {{ k }}
61
- </div>
62
- <div>
63
- another div
64
- </div>
65
- </farm-box>
66
- </div>`,
67
- });
68
-
69
32
  export const Gutters = () => ({
70
33
  data() {
71
34
  return { gutters };