@farm-investimentos/front-mfe-components-vue3 0.5.1 → 0.6.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 (49) hide show
  1. package/README.md +1 -1
  2. package/dist/front-mfe-components.common.js +104 -35
  3. package/dist/front-mfe-components.common.js.map +1 -1
  4. package/dist/front-mfe-components.css +1 -1
  5. package/dist/front-mfe-components.umd.js +104 -35
  6. package/dist/front-mfe-components.umd.js.map +1 -1
  7. package/dist/front-mfe-components.umd.min.js +1 -1
  8. package/dist/front-mfe-components.umd.min.js.map +1 -1
  9. package/package.json +17 -14
  10. package/src/components/AlertReload/AlertReload.stories.js +2 -0
  11. package/src/components/Buttons/ConfirmButton/ConfirmButton.stories.js +1 -1
  12. package/src/components/Buttons/RemoveButton/RemoveButton.stories.js +4 -4
  13. package/src/components/Checkbox/Checkbox.stories.js +1 -2
  14. package/src/components/Chip/Chip.stories.js +1 -1
  15. package/src/components/DataTableEmptyWrapper/DataTableEmptyWrapper.stories.js +2 -3
  16. package/src/components/DataTableHeader/DataTableHeader.stories.js +0 -2
  17. package/src/components/DataTablePaginator/DataTablePaginator.stories.js +6 -4
  18. package/src/components/DatePicker/DatePicker.stories.js +60 -9
  19. package/src/components/DatePicker/DatePicker.vue +82 -12
  20. package/src/components/DialogHeader/DialogHeader.stories.js +1 -1
  21. package/src/components/IdCaption/IdCaption.stories.js +6 -6
  22. package/src/components/InputDecimalFormatter/InputDecimalFormatter.stories.js +2 -10
  23. package/src/components/ListItem/ListItem.stories.js +0 -2
  24. package/src/components/Loader/Loader.stories.ts +2 -0
  25. package/src/components/Logger/Logger.stories.js +3 -3
  26. package/src/components/ManagersList/ManagersList.stories.js +3 -3
  27. package/src/components/ModalPromptUser/ModalPromptUser.stories.js +2 -3
  28. package/src/components/MultipleFilePicker/MultipleFilePicker.stories.js +2 -2
  29. package/src/components/ProgressBar/ProgressBar.stories.js +2 -1
  30. package/src/components/PromptUserToConfirm/PromptUserToConfirm.stories.js +2 -1
  31. package/src/components/RangeDatePicker/RangeDatePicker.stories.js +2 -2
  32. package/src/components/TextFieldV2/TextFieldV2.scss +6 -0
  33. package/src/components/TextFieldV2/TextFieldV2.stories.js +21 -7
  34. package/src/components/TextFieldV2/TextFieldV2.vue +8 -1
  35. package/src/components/Typography/Typography.stories.js +0 -1
  36. package/src/components/layout/Box/Box.stories.js +0 -1
  37. package/src/components/layout/Col/Col.stories.js +8 -9
  38. package/src/components/layout/DisplayBreakpoints.mdx +111 -0
  39. package/src/components/layout/GridSystem.stories.js +0 -2
  40. package/src/components/layout/{PropsValues.stories.mdx → PropsValues.mdx} +11 -4
  41. package/src/components/layout/Row/Row.stories.js +0 -2
  42. package/src/examples/Colors.stories.js +1 -1
  43. package/src/examples/Dialog.stories.js +20 -16
  44. package/src/examples/Table.stories.js +15 -3
  45. package/src/scss/Sticky-table.scss +7 -4
  46. package/src/scss/utils.scss +4 -4
  47. package/src/stories/Introduction.mdx +118 -0
  48. package/src/components/layout/DisplayBreakpoints.stories.mdx +0 -90
  49. package/src/stories/Introduction.stories.mdx +0 -118
@@ -54,5 +54,6 @@ export const IndeterminateAnimation = () => ({
54
54
  val: 35,
55
55
  };
56
56
  },
57
- template: '<farm-progressbar indeterminate :value="val" background-color="#FFFF00" value-color="#00FF00" />',
57
+ template:
58
+ '<farm-progressbar indeterminate :value="val" background-color="#FFFF00" value-color="#00FF00" />',
58
59
  });
@@ -32,7 +32,8 @@ export const CustomTitle = () => ({
32
32
  model: false,
33
33
  };
34
34
  },
35
- template: '<div style="max-width: 320px"><farm-promptusertoconfirm title="Custom" v-model="model" /></div>',
35
+ template:
36
+ '<div style="max-width: 320px"><farm-promptusertoconfirm title="Custom" v-model="model" /></div>',
36
37
  });
37
38
 
38
39
  export const CustomMatchInput = () => ({
@@ -63,11 +63,11 @@ export const Reset = () => ({
63
63
  },
64
64
  methods: {
65
65
  click() {
66
- this.$refs.datepickerExemple.clear();
66
+ this.$refs.datepickerExample.clear();
67
67
  },
68
68
  },
69
69
  template: `<div style="width: 480px">
70
- <farm-input-rangedatepicker ref="datepickerExemple" inputId="input-custom-id" v-model="date" />
70
+ <farm-input-rangedatepicker ref="datepickerExample" inputId="input-custom-id" v-model="date" />
71
71
  date: {{ date }}
72
72
  <farm-btn @click="click">
73
73
  reset
@@ -3,6 +3,12 @@
3
3
  .farm-textfield {
4
4
  height: 64px;
5
5
 
6
+ &--ellipsed {
7
+ input {
8
+ text-overflow: ellipsis;
9
+ }
10
+ }
11
+
6
12
  &--hiddendetails {
7
13
  height: 40px;
8
14
  }
@@ -39,13 +39,15 @@ export const Primary = () => ({
39
39
  v: 'input text',
40
40
  };
41
41
  },
42
- template: `<div style="width: 480px;">
42
+ template: `<farm-row>
43
+ <farm-col md="4">
43
44
  <farm-label for="input-primary">
44
45
  label
45
46
  </farm-label>
46
47
  <farm-textfield-v2 id="input-primary" v-model="v" />
47
48
  v-model: {{ v }}
48
- </div>`,
49
+ <farm-col>
50
+ </farm-row>`,
49
51
  });
50
52
 
51
53
  export const Disabled = () => ({
@@ -252,11 +254,23 @@ export const Uppercase = () => ({
252
254
  v: 'value',
253
255
  };
254
256
  },
255
- template: `<div style="width: 480px;">
256
- <farm-label for="input-uppercase">
257
- label
258
- </farm-label>
257
+ template: `<farm-row>
258
+ <farm-col md="4">
259
259
  <farm-textfield-v2 id="input-uppercase" v-model="v" uppercase/>
260
- </div>`,
260
+ <farm-col>
261
+ </farm-row>`,
261
262
  });
262
263
 
264
+ export const Ellipsed = () => ({
265
+ data() {
266
+ return {
267
+ v: 'very long text inside the input field',
268
+ };
269
+ },
270
+ template: `<farm-row>
271
+ <farm-col md="2">
272
+ <farm-textfield-v2 id="input-primary-ellipsed" v-model="v" ellipsed />
273
+ v-model: {{ v }}
274
+ <farm-col>
275
+ </farm-row>`,
276
+ });
@@ -11,6 +11,7 @@
11
11
  'farm-textfield--disabled': disabled,
12
12
  'farm-textfield--hiddendetails': hideDetails,
13
13
  'farm-textfield--uppercase': isUppercase,
14
+ 'farm-textfield--ellipsed': ellipsed,
14
15
  }"
15
16
  :id="customId"
16
17
  >
@@ -164,7 +165,6 @@ export default {
164
165
  type: String,
165
166
  default: '',
166
167
  },
167
-
168
168
  /**
169
169
  * uppercase
170
170
  * leaves only the text in the input in uppercase does not affect the value of the v-model
@@ -182,6 +182,13 @@ export default {
182
182
  // eslint-disable-next-line
183
183
  default: (event: Event) => {},
184
184
  },
185
+ /**
186
+ * Hide overflow content using ellipsis
187
+ */
188
+ ellipsed: {
189
+ type: Boolean,
190
+ default: false,
191
+ },
185
192
  },
186
193
  setup(props, { emit }) {
187
194
  const { rules } = toRefs(props);
@@ -4,7 +4,6 @@ import baseThemeColors from '../../configurations/_theme-colors-base.module.scss
4
4
  import bwThemeColors from '../../configurations/_theme-colors-bw.module.scss';
5
5
  import sizes from '../../configurations/sizes';
6
6
 
7
-
8
7
  const colors = Object.keys(baseThemeColors);
9
8
 
10
9
  export default {
@@ -2,7 +2,6 @@ import Box from './Box.vue';
2
2
 
3
3
  import gutters from '../../../configurations/gutters';
4
4
 
5
-
6
5
  export default {
7
6
  title: 'Layout/Box',
8
7
  component: Box,
@@ -2,7 +2,6 @@ import Col from './Col.vue';
2
2
 
3
3
  import { aligns } from '../../../configurations/flexVariables';
4
4
 
5
-
6
5
  export default {
7
6
  title: 'Layout/Col',
8
7
  component: Col,
@@ -41,7 +40,7 @@ export const Cols = () => ({
41
40
  data() {
42
41
  return {
43
42
  style,
44
- items
43
+ items,
45
44
  };
46
45
  },
47
46
  template: `<farm-row>
@@ -53,7 +52,7 @@ export const Xl = () => ({
53
52
  data() {
54
53
  return {
55
54
  style,
56
- items
55
+ items,
57
56
  };
58
57
  },
59
58
  template: `<farm-row>
@@ -65,7 +64,7 @@ export const Lg = () => ({
65
64
  data() {
66
65
  return {
67
66
  style,
68
- items
67
+ items,
69
68
  };
70
69
  },
71
70
  template: `<farm-row>
@@ -77,7 +76,7 @@ export const Md = () => ({
77
76
  data() {
78
77
  return {
79
78
  style,
80
- items
79
+ items,
81
80
  };
82
81
  },
83
82
  template: `<farm-row>
@@ -89,7 +88,7 @@ export const Sm = () => ({
89
88
  data() {
90
89
  return {
91
90
  style,
92
- items
91
+ items,
93
92
  };
94
93
  },
95
94
  template: `<farm-row>
@@ -101,7 +100,7 @@ export const Xs = () => ({
101
100
  data() {
102
101
  return {
103
102
  style,
104
- items
103
+ items,
105
104
  };
106
105
  },
107
106
  template: `<farm-row>
@@ -149,7 +148,7 @@ export const Offsets = () => ({
149
148
  data() {
150
149
  return {
151
150
  style,
152
- items
151
+ items,
153
152
  };
154
153
  },
155
154
  template: `<farm-box>
@@ -173,4 +172,4 @@ export const Offsets = () => ({
173
172
  <farm-col :style="style" md="1" offset="1" offset-md="0">offset md 0</farm-col>
174
173
  </farm-row>
175
174
  </farm-box>`,
176
- });
175
+ });
@@ -0,0 +1,111 @@
1
+ import { Meta } from '@storybook/blocks';
2
+
3
+ <Meta title="Layout/Display Breakpoints" />
4
+
5
+ # Display Breakpoints
6
+
7
+ <table width="100%">
8
+ <thead>
9
+ <tr>
10
+ <th>Device</th>
11
+ <th>Code</th>
12
+ <th>Type</th>
13
+ <th>Range</th>
14
+ </tr>
15
+ </thead>
16
+
17
+ <tbody>
18
+ <tr>
19
+ <td>
20
+ <span>
21
+ <i className="mdi mdi-cellphone" />
22
+
23
+   Extra small
24
+ </span>
25
+ </td>
26
+
27
+ <td>
28
+ <strong>xs</strong>
29
+ </td>
30
+
31
+ <td>Small to large phone</td>
32
+ <td>\< 600px</td>
33
+ </tr>
34
+
35
+ <tr>
36
+ <td>
37
+ <i className="mdi mdi-tablet" />
38
+
39
+  
40
+ <span>Small</span>
41
+ </td>
42
+
43
+ <td>
44
+ <strong>sm</strong>
45
+ </td>
46
+
47
+ <td>Small to medium tablet</td>
48
+ <td>600px > \< 960px</td>
49
+ </tr>
50
+
51
+ <tr>
52
+ <td>
53
+ <i className="mdi mdi-laptop" />
54
+
55
+  
56
+ <span>Medium</span>
57
+ </td>
58
+
59
+ <td>
60
+ <strong>md</strong>
61
+ </td>
62
+
63
+ <td>Large tablet to laptop</td>
64
+ <td>960px > \< 1264px\*</td>
65
+ </tr>
66
+
67
+ <tr>
68
+ <td>
69
+ <i className="mdi mdi-monitor" />
70
+
71
+  
72
+ <span>Large</span>
73
+ </td>
74
+
75
+ <td>
76
+ <strong>lg</strong>
77
+ </td>
78
+
79
+ <td>Desktop</td>
80
+ <td>1264px > \< 1904px\*</td>
81
+ </tr>
82
+
83
+ <tr>
84
+ <td>
85
+ <i className="mdi mdi-television" />
86
+
87
+  
88
+ <span>Extra large</span>
89
+ </td>
90
+
91
+ <td>
92
+ <strong>xl</strong>
93
+ </td>
94
+
95
+ <td>4k and ultra-wide</td>
96
+ <td>> 1904px\*</td>
97
+ </tr>
98
+ </tbody>
99
+
100
+ <tfoot>
101
+ <tr>
102
+ <td colSpan="4">
103
+ <em> \* -16px on desktop for browser scrollbar</em>
104
+ </td>
105
+ </tr>
106
+ </tfoot>
107
+ </table>
108
+
109
+ ## SCSS Helpers
110
+
111
+ The \_mixins.scss contains mixins for media query, to abstract the breakpoints and create queries for different breakpoints.
@@ -134,5 +134,3 @@ export const Xs = () => ({
134
134
  <farm-col xs="2" :style="style">6 of 6</farm-col>
135
135
  </farm-row>`,
136
136
  });
137
-
138
-
@@ -1,17 +1,23 @@
1
- import { Meta } from '@storybook/addon-docs';
1
+ import { Meta } from '@storybook/blocks';
2
2
 
3
3
  <Meta title="Layout/Props Values" />
4
4
 
5
5
  # About
6
+
6
7
  Many components have props that accepts strings as values instead of passa a numeric values.
7
8
  Example:
9
+
8
10
  <code>
9
- &#x3C;my-component some-prop=&#x22;md&#x22; /&#x3E;<br />
10
- //"md" will be used as 12px in the CSS
11
+ \<my-component some-prop="md" /><br />
12
+ //"md" will be used as 12px in the CSS
11
13
  </code>
12
- <br /><br />
14
+
15
+ <br />
16
+
17
+ <br />
13
18
 
14
19
  ## Gutter
20
+
15
21
  * none: 0
16
22
  * xs: 4px
17
23
  * sm: 8px
@@ -22,6 +28,7 @@ Example:
22
28
  * default: 24px
23
29
 
24
30
  ## Font Size
31
+
25
32
  * xs: 8px
26
33
  * sm: 12px
27
34
  * md: 14px
@@ -2,7 +2,6 @@ import Row from './Row.vue';
2
2
 
3
3
  import { justifications } from '../../../configurations/flexVariables';
4
4
 
5
-
6
5
  export default {
7
6
  title: 'Layout/Row',
8
7
  component: Row,
@@ -93,7 +92,6 @@ export const DefaultGrid = () => ({
93
92
  </div>`,
94
93
  });
95
94
 
96
-
97
95
  export const yGridGutters = () => ({
98
96
  template: `<div>
99
97
  <farm-row y-grid-gutters>
@@ -76,7 +76,7 @@ export const CssVariables = () => ({
76
76
  bwThemeColorsKeys: Object.keys(bwThemeColors),
77
77
  bwThemeColors: { ...bwThemeColors },
78
78
  backgroundThemeColorsKeys: Object.keys(backgroundThemeColors),
79
- backgroundThemeColors: { ...backgroundThemeColors },
79
+ backgroundThemeColors: { ...backgroundThemeColors },
80
80
  };
81
81
  },
82
82
  template: `<div class="palette-container">
@@ -131,29 +131,33 @@ export const CustomHtml = () => ({
131
131
  export const OpenTwice = () => ({
132
132
  methods: {
133
133
  openDialog() {
134
- this.$dialog.confirm(
135
- {
136
- title: 'Dialog title',
137
- body: 'Dialog content',
138
- },
139
- {
140
- html: true,
141
- okText: 'OK',
142
- cancelText: 'Cancel',
143
- }
144
- ).finally( () => {});
145
-
146
- setTimeout(() => {
147
- this.$dialog.alert(
134
+ this.$dialog
135
+ .confirm(
148
136
  {
149
137
  title: 'Dialog title',
150
138
  body: 'Dialog content',
151
139
  },
152
140
  {
153
141
  html: true,
154
- okText: 'Cancel',
142
+ okText: 'OK',
143
+ cancelText: 'Cancel',
155
144
  }
156
- ).finally( () => {});
145
+ )
146
+ .finally(() => {});
147
+
148
+ setTimeout(() => {
149
+ this.$dialog
150
+ .alert(
151
+ {
152
+ title: 'Dialog title',
153
+ body: 'Dialog content',
154
+ },
155
+ {
156
+ html: true,
157
+ okText: 'Cancel',
158
+ }
159
+ )
160
+ .finally(() => {});
157
161
  }, 2000);
158
162
  },
159
163
  },
@@ -162,7 +162,21 @@ export const TableSampleDataWithFarmCheckbox = () => ({
162
162
  components: { 'v-data-table': VDataTable },
163
163
  data() {
164
164
  return {
165
- headers,
165
+ headers: [
166
+ {
167
+ title: 'ID',
168
+ sortable: false,
169
+ key: 'id',
170
+ width: 80,
171
+ align: 'center',
172
+ },
173
+ {
174
+ title: 'Name',
175
+ sortable: false,
176
+ key: 'name',
177
+ align: 'end',
178
+ },
179
+ ],
166
180
  items: [
167
181
  { id: 1, name: 'name 1' },
168
182
  { id: 2, name: 'name 2' },
@@ -173,7 +187,6 @@ export const TableSampleDataWithFarmCheckbox = () => ({
173
187
  },
174
188
  methods: {
175
189
  onSelect({ item }) {
176
- console.log(item);
177
190
  if (item.id === 2)
178
191
  this.selectedItems = [...this.selectedItems].filter(
179
192
  innerItem => innerItem.id !== 2
@@ -197,7 +210,6 @@ export const TableSampleDataWithFarmCheckbox = () => ({
197
210
  show-select
198
211
  id="v-data-table--default"
199
212
  v-model="selectedItems"
200
-
201
213
  :headers="headers"
202
214
  :items="items"
203
215
  @item-selected="onSelect"
@@ -84,10 +84,13 @@ $defaultLefts: 0, 4rem, 4rem;
84
84
  thead {
85
85
  height: 51px;
86
86
  }
87
-
88
- th[role='columnheader']:has(> .v-data-table__checkbox) {
89
- max-width: 71px !important;
90
- padding-left: 24px;
87
+ &.v-data-table--show-select {
88
+ th:first-child, td:first-child {
89
+ padding-left: 0;
90
+ }
91
+ td:first-child .farm-checkbox__container {
92
+ margin-left: 12px;
93
+ }
91
94
  }
92
95
 
93
96
  .v-data-table-header__icon {
@@ -33,11 +33,11 @@ body.body--has-footer {
33
33
  }
34
34
 
35
35
  //temporary solution for v-data-table checkboxes
36
- .v-data-table__checkbox.v-simple-checkbox {
36
+ .v-selection-control.v-checkbox-btn {
37
37
  .v-icon.v-icon {
38
38
  font-size: 22px;
39
- color: var(--farm-neutral-farken);
40
- ;
39
+ color: var(--farm-neutral-darken);
40
+ opacity: 1;
41
41
 
42
42
  &.mdi-checkbox-marked,
43
43
  &.mdi-minus-box {
@@ -45,7 +45,7 @@ body.body--has-footer {
45
45
  }
46
46
  }
47
47
 
48
- .v-input--selection-controls__ripple {
48
+ .v-ripple__container {
49
49
  display: none;
50
50
  }
51
51
  }
@@ -0,0 +1,118 @@
1
+ import { Meta } from '@storybook/blocks';
2
+ import imageFile from './assets/logo_farmtech.svg';
3
+
4
+ <Meta title="Introduction" />
5
+
6
+ <style>
7
+ {`
8
+ .subheading {
9
+ --mediumdark: '#999999';
10
+ font-weight: 900;
11
+ font-size: 13px;
12
+ color: #999;
13
+ letter-spacing: 6px;
14
+ line-height: 24px;
15
+ text-transform: uppercase;
16
+ margin-bottom: 12px;
17
+ margin-top: 40px;
18
+ }
19
+
20
+ .link-list {
21
+ display: grid;
22
+ grid-template-columns: 1fr;
23
+ grid-template-rows: 1fr 1fr;
24
+ row-gap: 10px;
25
+ }
26
+
27
+ @media (min-width: 620px) {
28
+ .link-list {
29
+ row-gap: 20px;
30
+ column-gap: 20px;
31
+ grid-template-columns: 1fr 1fr;
32
+ }
33
+ }
34
+
35
+ @media all and (-ms-high-contrast:none) {
36
+ .link-list {
37
+ display: -ms-grid;
38
+ -ms-grid-columns: 1fr 1fr;
39
+ -ms-grid-rows: 1fr 1fr;
40
+ }
41
+ }
42
+
43
+ .link-item {
44
+ display: block;
45
+ padding: 20px 30px 20px 15px;
46
+ border: 1px solid #00000010;
47
+ border-radius: 5px;
48
+ transition: background 150ms ease-out, border 150ms ease-out, transform 150ms ease-out;
49
+ color: #333333;
50
+ display: flex;
51
+ align-items: flex-start;
52
+ }
53
+
54
+ .link-item:hover {
55
+ border-color: #1EA7FD50;
56
+ transform: translate3d(0, -3px, 0);
57
+ box-shadow: rgba(0, 0, 0, 0.08) 0 3px 10px 0;
58
+ }
59
+
60
+ .link-item:active {
61
+ border-color: #1EA7FD;
62
+ transform: translate3d(0, 0, 0);
63
+ }
64
+
65
+ .link-item strong {
66
+ font-weight: 700;
67
+ display: block;
68
+ margin-bottom: 2px;
69
+ }
70
+
71
+ .link-item img {
72
+ height: 40px;
73
+ width: 40px;
74
+ margin-right: 15px;
75
+ flex: none;
76
+ }
77
+
78
+ .link-item span {
79
+ font-size: 14px;
80
+ line-height: 20px;
81
+ }
82
+
83
+ .tip {
84
+ display: inline-block;
85
+ border-radius: 1em;
86
+ font-size: 11px;
87
+ line-height: 12px;
88
+ font-weight: 700;
89
+ background: #E7FDD8;
90
+ color: #66BF3C;
91
+ padding: 4px 12px;
92
+ margin-right: 10px;
93
+ vertical-align: top;
94
+ }
95
+
96
+ .tip-wrapper {
97
+ font-size: 13px;
98
+ line-height: 20px;
99
+ margin-top: 40px;
100
+ margin-bottom: 40px;
101
+ }
102
+
103
+ .tip-wrapper code {
104
+ font-size: 12px;
105
+ display: inline-block;
106
+ }
107
+
108
+
109
+ `}
110
+ </style>
111
+
112
+ # Welcome to Farmtech Storybook
113
+
114
+ <img src={imageFile} />
115
+
116
+ Here you can find the components from the Farmtech's Design System on the top of Vue 3.
117
+
118
+ Currrent version: {VERSION}