@farm-investimentos/front-mfe-components 9.4.1 → 10.0.1

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 (54) hide show
  1. package/dist/front-mfe-components.common.js +4917 -4508
  2. package/dist/front-mfe-components.common.js.map +1 -1
  3. package/dist/front-mfe-components.css +1 -1
  4. package/dist/front-mfe-components.umd.js +4917 -4508
  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 +5 -5
  9. package/src/components/Card/Card.vue +1 -1
  10. package/src/components/Card/CardContent/CardContent.vue +1 -1
  11. package/src/components/CopyToClipboard/__tests__/CopyToClipboard.spec.js +5 -1
  12. package/src/components/DatePicker/DatePicker.vue +0 -2
  13. package/src/components/Form/Form.stories.js +25 -0
  14. package/src/components/List/List.scss +0 -0
  15. package/src/components/List/List.stories.js +29 -0
  16. package/src/components/List/List.vue +16 -0
  17. package/src/components/List/__tests__/List.spec.js +20 -0
  18. package/src/components/List/index.ts +4 -0
  19. package/src/components/ListItem/ListItem.scss +37 -0
  20. package/src/components/ListItem/ListItem.stories.js +70 -0
  21. package/src/components/ListItem/ListItem.vue +82 -0
  22. package/src/components/ListItem/__tests__/ListItem.spec.js +20 -0
  23. package/src/components/ListItem/index.ts +4 -0
  24. package/src/components/Logger/Logger.vue +5 -7
  25. package/src/components/Modal/Modal.scss +1 -0
  26. package/src/components/ModalPromptUser/ModalPromptUser.scss +3 -0
  27. package/src/components/ModalPromptUser/ModalPromptUser.stories.js +7 -6
  28. package/src/components/ModalPromptUser/ModalPromptUser.vue +18 -17
  29. package/src/components/PromptUserToConfirm/PromptUserToConfirm.vue +2 -2
  30. package/src/components/RadioGroup/RadioGroup.scss +46 -20
  31. package/src/components/RadioGroup/RadioGroup.stories.js +69 -8
  32. package/src/components/RadioGroup/RadioGroup.vue +68 -46
  33. package/src/components/TableContextMenu/TableContextMenu.scss +5 -2
  34. package/src/components/TableContextMenu/TableContextMenu.stories.js +21 -4
  35. package/src/components/TableContextMenu/TableContextMenu.vue +6 -7
  36. package/src/components/TextField/__tests__/{Label.spec.js → TextField.spec.js} +0 -0
  37. package/src/{examples/Container → components/layout}/Basic.stories.js +27 -5
  38. package/src/components/layout/Col/Col.scss +5 -0
  39. package/src/components/layout/Col/Col.stories.js +42 -0
  40. package/src/components/layout/Col/Col.vue +62 -0
  41. package/src/components/layout/Col/__tests__/Col.spec.js +22 -0
  42. package/src/components/layout/Col/index.ts +4 -0
  43. package/src/components/layout/Container/Container.scss +9 -4
  44. package/src/components/layout/Container/Container.stories.js +2 -1
  45. package/src/components/layout/Container/Container.vue +1 -1
  46. package/src/components/layout/ContainerFooter/Container.stories.js +2 -1
  47. package/src/components/layout/ContainerFooter/ContainerFooter.scss +6 -3
  48. package/src/components/layout/DisplayBreakpoints.stories.mdx +100 -0
  49. package/src/components/layout/Row/Row.scss +25 -1
  50. package/src/components/layout/Row/Row.stories.js +48 -3
  51. package/src/components/layout/Row/Row.vue +33 -2
  52. package/src/configurations/_mixins.scss +6 -0
  53. package/src/configurations/_variables.scss +2 -2
  54. package/src/main.ts +4 -0
@@ -0,0 +1,100 @@
1
+ import { Meta } from '@storybook/addon-docs';
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
+ <tbody>
17
+ <tr>
18
+ <td>
19
+ <span>
20
+ <i className="mdi mdi-cellphone" />
21
+ &nbsp; Extra small
22
+ </span>
23
+ </td>
24
+ <td>
25
+ <strong>xs</strong>
26
+ </td>
27
+ <td>Small to large phone</td>
28
+ <td>&lt; 600px</td>
29
+ </tr>
30
+ <tr>
31
+ <td>
32
+ <i className="mdi mdi-tablet" />
33
+ &nbsp;
34
+ <span>Small</span>
35
+ </td>
36
+ <td>
37
+ <strong>sm</strong>
38
+ </td>
39
+ <td>Small to medium tablet</td>
40
+ <td>600px &gt; &lt; 960px</td>
41
+ </tr>
42
+ <tr>
43
+ <td>
44
+ <i className="mdi mdi-laptop" />
45
+ &nbsp;
46
+ <span>Medium</span>
47
+ </td>
48
+ <td>
49
+ <strong>md</strong>
50
+ </td>
51
+ <td>Large tablet to laptop</td>
52
+ <td>960px &gt; &lt; 1264px*</td>
53
+ </tr>
54
+ <tr>
55
+ <td>
56
+ <i className="mdi mdi-monitor" />
57
+ &nbsp;
58
+ <span>Large</span>
59
+ </td>
60
+ <td>
61
+ <strong>lg</strong>
62
+ </td>
63
+ <td>Desktop</td>
64
+ <td>1264px &gt; &lt; 1904px*</td>
65
+ </tr>
66
+ <tr>
67
+ <td>
68
+ <i className="mdi mdi-television" />
69
+ &nbsp;
70
+ <span>Extra large</span>
71
+ </td>
72
+ <td>
73
+ <strong>xl</strong>
74
+ </td>
75
+ <td>4k and ultra-wide</td>
76
+ <td>&gt; 1904px*</td>
77
+ </tr>
78
+ </tbody>
79
+ <tfoot>
80
+ <tr>
81
+ <td colSpan="4">
82
+ <em> * -16px on desktop for browser scrollbar</em>
83
+ </td>
84
+ </tr>
85
+ </tfoot>
86
+ </table>
87
+
88
+ ## SCSS Helpers
89
+
90
+ The _mixins.scss contains mixins for media query, to abstract the breakpoints and create queries for different breakpoints.
91
+
92
+ <code>
93
+ @import '@farm-investimentos/front-mfe-components/src/configurations/_mixins.scss';
94
+
95
+ @include fromSm { // min-width: 960px <br />
96
+ .product-limit {<br />
97
+ text-align: center;<br />
98
+ }<br />
99
+ }
100
+ </code>
@@ -1,6 +1,30 @@
1
+ @import '../../../configurations/functions';
2
+ $aligns: start, center, end, baseline, stretch;
3
+ $align-contents: start, center, end, space-between, space-around, stretch;
4
+ $justifications: start, center, end, space-between, space-around;
5
+
6
+
1
7
  .farm-row {
2
8
  display: flex;
3
9
  flex-wrap: wrap;
4
10
  flex: 1 1 auto;
5
- margin: -12px;
11
+ margin: 0 calc(#{gutter('lg')} * -1);
12
+
13
+ @each $k in $aligns {
14
+ &#{'--align-' + $k} {
15
+ align-items: $k !important;
16
+ }
17
+ }
18
+
19
+ @each $k in $align-contents {
20
+ &#{'--align-content-' + $k} {
21
+ align-content: $k !important;
22
+ }
23
+ }
24
+
25
+ @each $k in $justifications {
26
+ &#{'--justify-' + $k} {
27
+ justify-content: $k !important;
28
+ }
29
+ }
6
30
  }
@@ -7,8 +7,8 @@ export default {
7
7
  docs: {
8
8
  description: {
9
9
  component: `Row<br />
10
- selector: <em>farm-row</em>
11
- <span style="color: yellow;">wait</span>
10
+ selector: <em>farm-row</em><br />
11
+ <span style="color: green">ready for use</span>
12
12
  `,
13
13
  },
14
14
  },
@@ -20,4 +20,49 @@ export const Primary = () => ({
20
20
  template: '<farm-row>row content</farm-row>',
21
21
  });
22
22
 
23
- Primary.storyName = 'Basic';
23
+ export const Align = () => ({
24
+ data() {
25
+ return {
26
+ aligns: ['start', 'center', 'end', 'baseline', 'stretch'],
27
+ };
28
+ },
29
+ template: `<div>
30
+ <farm-row :align="align" v-for="align in aligns" :key="'align_' + align">
31
+ <v-col md="6">
32
+ row align
33
+ {{ align }}
34
+ </v-col>
35
+ </farm-row>
36
+ </div>`,
37
+ });
38
+
39
+ export const AlignContent = () => ({
40
+ data() {
41
+ return {
42
+ aligns: ['start', 'center', 'end', 'space-between', 'space-around', 'stretch'],
43
+ };
44
+ },
45
+ template: `<div>
46
+ <farm-row :align-content="align" v-for="align in aligns" :key="'align-content-_' + align">
47
+ <v-col md="6">
48
+ row align-content
49
+ {{ align }}
50
+ </v-col>
51
+ </farm-row>
52
+ </div>`,
53
+ });
54
+
55
+ export const Justify = () => ({
56
+ data() {
57
+ return {
58
+ justifications: ['start', 'center', 'end', 'space-between', 'space-around'],
59
+ };
60
+ },
61
+ template: `<div>
62
+ <farm-row :justify="k" v-for="k in justifications" :key="'justify-_' + k">
63
+ <v-col md="6">
64
+ row justify {{ k }}
65
+ </v-col>
66
+ </farm-row>
67
+ </div>`,
68
+ });
@@ -1,10 +1,18 @@
1
1
  <template>
2
- <component v-bind:is="tag" class="farm-row">
2
+ <component
3
+ :is="tag"
4
+ :class="{
5
+ 'farm-row': true,
6
+ [`farm-row--align-${align}`]: align,
7
+ [`farm-row--align-content-${alignContent}`]: alignContent,
8
+ [`farm-row--justify-${justify}`]: justify,
9
+ }"
10
+ >
3
11
  <slot></slot>
4
12
  </component>
5
13
  </template>
6
14
  <script lang="ts">
7
- import Vue from 'vue';
15
+ import Vue, { PropType } from 'vue';
8
16
 
9
17
  export default Vue.extend({
10
18
  name: 'farm-row',
@@ -13,6 +21,29 @@ export default Vue.extend({
13
21
  * Html tag
14
22
  */
15
23
  tag: { type: String, default: 'div' },
24
+ /**
25
+ * Applies the align-items css property.
26
+ */
27
+ align: {
28
+ type: String as PropType<'start' | 'center' | 'end' | 'baseline' | 'stretch'>,
29
+ default: '',
30
+ },
31
+ /**
32
+ * applies the align-content css property
33
+ */
34
+ alignContent: {
35
+ type: String as PropType<
36
+ 'start' | 'center' | 'end' | 'space-between' | 'space-around' | 'stretch'
37
+ >,
38
+ default: '',
39
+ },
40
+ /**
41
+ * Applies the justify-content css property
42
+ */
43
+ justify: {
44
+ type: String as PropType<'start' | 'center' | 'end' | 'space-between' | 'space-around'>,
45
+ default: '',
46
+ },
16
47
  },
17
48
  inheritAttrs: true,
18
49
  });
@@ -28,6 +28,12 @@
28
28
  }
29
29
  }
30
30
 
31
+ @mixin fromLg {
32
+ @media (min-width: 1904px) {
33
+ @content;
34
+ }
35
+ }
36
+
31
37
  @mixin addShadow {
32
38
  box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.16);
33
39
  }
@@ -12,8 +12,8 @@ $gutters: (
12
12
  'sm': 8px,
13
13
  "default": 12px,
14
14
  'md': 16px,
15
- "lg": 36px,
16
- "xl": 40px
15
+ "lg": 24px,
16
+ "xl": 32px
17
17
  );
18
18
 
19
19
  $fontSizes: (
package/src/main.ts CHANGED
@@ -71,6 +71,8 @@ export * from './components/SelectModalOptions';
71
71
  export * from './components/ChipInviteStatus';
72
72
  export * from './components/Form';
73
73
  export * from './components/Label';
74
+ export * from './components/List';
75
+ export * from './components/ListItem';
74
76
  export * from './components/Logger';
75
77
  export * from './components/Logger/LoggerItem';
76
78
  export * from './components/Icon';
@@ -83,7 +85,9 @@ export * from './components/TextField';
83
85
  export * from './components/Tooltip';
84
86
  export * from './components/Typography';
85
87
 
88
+ export * from './components/layout/Col';
86
89
  export * from './components/layout/Container';
87
90
  export * from './components/layout/ContainerFooter';
88
91
  export * from './components/layout/Row';
89
92
  export * from './components/layout/Line';
93
+