@farm-investimentos/front-mfe-components 10.0.1 → 10.1.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 +168 -67
- package/dist/front-mfe-components.common.js.map +1 -1
- package/dist/front-mfe-components.css +1 -1
- package/dist/front-mfe-components.umd.js +168 -67
- 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/Card/Card.stories.js +1 -1
- package/src/components/Checkbox/Checkbox.stories.js +1 -1
- package/src/components/Chip/Chip.stories.js +1 -1
- package/src/components/Form/Form.stories.js +1 -1
- package/src/components/Icon/Icon.stories.js +1 -1
- package/src/components/Loader/Loader.stories.ts +1 -1
- package/src/components/Logger/Logger.stories.js +1 -1
- package/src/components/Modal/Modal.stories.js +1 -1
- package/src/components/ModalPromptUser/ModalPromptUser.stories.js +1 -1
- package/src/components/RadioGroup/RadioGroup.stories.js +1 -1
- package/src/components/TableContextMenu/TableContextMenu.stories.js +1 -1
- package/src/components/layout/Basic.stories.js +2 -2
- package/src/components/layout/Box/Box.scss +20 -0
- package/src/components/layout/Box/Box.stories.js +66 -0
- package/src/components/layout/Box/Box.vue +43 -0
- package/src/components/layout/Box/__tests__/Box.spec.js +22 -0
- package/src/components/layout/Box/index.ts +4 -0
- package/src/components/layout/Container/Container.stories.js +1 -1
- package/src/components/layout/ContainerFooter/Container.stories.js +1 -1
- package/src/components/layout/Row/Row.scss +1 -3
- package/src/components/layout/Row/Row.stories.js +3 -2
- package/src/configurations/_variables.scss +6 -1
- package/src/configurations/flexVariables.ts +4 -0
- package/src/main.ts +1 -0
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@ export default {
|
|
|
11
11
|
description: {
|
|
12
12
|
component: `Modal Prompt User to Confirm<br />
|
|
13
13
|
selector: <em>farm-prompt-user</em><br />
|
|
14
|
-
<span style="color:
|
|
14
|
+
<span style="color: var(--farm-primary-base);">ready for use</span>`,
|
|
15
15
|
},
|
|
16
16
|
},
|
|
17
17
|
design: {
|
|
@@ -17,13 +17,13 @@ export const Primary = () => ({
|
|
|
17
17
|
export const Structure = () => ({
|
|
18
18
|
template: `
|
|
19
19
|
<farm-container>
|
|
20
|
-
<
|
|
20
|
+
<farm-box>
|
|
21
21
|
Content<br />
|
|
22
22
|
Content<br />
|
|
23
23
|
Content<br />
|
|
24
24
|
Content<br />
|
|
25
25
|
Content<br />
|
|
26
|
-
</
|
|
26
|
+
</farm-box>
|
|
27
27
|
<farm-row>
|
|
28
28
|
<v-col md="6" lg="3">
|
|
29
29
|
coluna 1
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
@import '../../../configurations/variables';
|
|
2
|
+
|
|
3
|
+
.farm-box {
|
|
4
|
+
display: flex;
|
|
5
|
+
flex: 1 0 auto;
|
|
6
|
+
max-width: 100%;
|
|
7
|
+
transition: .2s cubic-bezier(.4, 0, .2, 1);
|
|
8
|
+
|
|
9
|
+
@each $k in $justifications {
|
|
10
|
+
&#{'--justify-' + $k} {
|
|
11
|
+
justify-content: $k;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@each $k in $directions {
|
|
16
|
+
&#{'--direction-' + $k} {
|
|
17
|
+
flex-direction: $k;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import Box from './Box.vue';
|
|
2
|
+
import { directions, justifications } from '../../../configurations/flexVariables';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Layout/Box',
|
|
6
|
+
component: Box,
|
|
7
|
+
parameters: {
|
|
8
|
+
docs: {
|
|
9
|
+
description: {
|
|
10
|
+
component: `Box<br />
|
|
11
|
+
selector: <em>farm-box</em><br />
|
|
12
|
+
<span style="color: var(--farm-primary-base);">ready for use</span>
|
|
13
|
+
`,
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
viewMode: 'docs',
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export const Primary = () => ({
|
|
21
|
+
template: `<div>
|
|
22
|
+
<farm-box>box</farm-box>
|
|
23
|
+
</div>`,
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
export const Tag = () => ({
|
|
27
|
+
template: `<div>
|
|
28
|
+
<farm-box tag="section">tag: section</farm-box>
|
|
29
|
+
</div>`,
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
export const Justify = () => ({
|
|
33
|
+
data() {
|
|
34
|
+
return {
|
|
35
|
+
justifications,
|
|
36
|
+
};
|
|
37
|
+
},
|
|
38
|
+
template: `<div>
|
|
39
|
+
<farm-box :justify="k" v-for="k in justifications" :key="'justify-_' + k" style="border:1px solid var(--farm-stroke-base); margin-bottom: 16px;">
|
|
40
|
+
<div>
|
|
41
|
+
justify {{ k }}
|
|
42
|
+
</div>
|
|
43
|
+
<div>
|
|
44
|
+
another div
|
|
45
|
+
</div>
|
|
46
|
+
</farm-box>
|
|
47
|
+
</div>`,
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
export const Directions = () => ({
|
|
51
|
+
data() {
|
|
52
|
+
return {
|
|
53
|
+
directions,
|
|
54
|
+
};
|
|
55
|
+
},
|
|
56
|
+
template: `<div>
|
|
57
|
+
<farm-box :direction="k" v-for="k in directions" :key="'direction-_' + k" style="border:1px solid var(--farm-stroke-base); margin-bottom: 16px;">
|
|
58
|
+
<div>
|
|
59
|
+
direction {{ k }}
|
|
60
|
+
</div>
|
|
61
|
+
<div>
|
|
62
|
+
another div
|
|
63
|
+
</div>
|
|
64
|
+
</farm-box>
|
|
65
|
+
</div>`,
|
|
66
|
+
});
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<component
|
|
3
|
+
:is="tag"
|
|
4
|
+
:class="{
|
|
5
|
+
'farm-box': true,
|
|
6
|
+
[`farm-box--justify-${justify}`]: justify,
|
|
7
|
+
[`farm-box--direction-${direction}`]: direction,
|
|
8
|
+
}"
|
|
9
|
+
>
|
|
10
|
+
<slot></slot>
|
|
11
|
+
</component>
|
|
12
|
+
</template>
|
|
13
|
+
<script lang="ts">
|
|
14
|
+
import Vue, { PropType } from 'vue';
|
|
15
|
+
|
|
16
|
+
export default Vue.extend({
|
|
17
|
+
name: 'farm-box',
|
|
18
|
+
props: {
|
|
19
|
+
/**
|
|
20
|
+
* Html tag
|
|
21
|
+
*/
|
|
22
|
+
tag: { type: String, default: 'div' },
|
|
23
|
+
/**
|
|
24
|
+
* Applies the flex-direction css property
|
|
25
|
+
*/
|
|
26
|
+
direction: {
|
|
27
|
+
type: String as PropType<'row' | 'row-reverse' | 'column' | 'column-reverse'>,
|
|
28
|
+
default: 'row',
|
|
29
|
+
},
|
|
30
|
+
/**
|
|
31
|
+
* Applies the justify-content css property
|
|
32
|
+
*/
|
|
33
|
+
justify: {
|
|
34
|
+
type: String as PropType<'start' | 'center' | 'end' | 'space-between' | 'space-around'>,
|
|
35
|
+
default: '',
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
inheritAttrs: true,
|
|
39
|
+
});
|
|
40
|
+
</script>
|
|
41
|
+
<style lang="scss" scoped>
|
|
42
|
+
@import 'Box';
|
|
43
|
+
</style>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
|
+
import Box from '../Box';
|
|
3
|
+
|
|
4
|
+
describe('Box component', () => {
|
|
5
|
+
let wrapper;
|
|
6
|
+
let component;
|
|
7
|
+
|
|
8
|
+
beforeEach(() => {
|
|
9
|
+
wrapper = shallowMount(Box);
|
|
10
|
+
component = wrapper.vm;
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
test('Created hook', () => {
|
|
14
|
+
expect(wrapper).toBeDefined();
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
describe('mount component', () => {
|
|
18
|
+
it('renders correctly', () => {
|
|
19
|
+
expect(wrapper.element).toMatchSnapshot();
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
});
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
@import '../../../configurations/functions';
|
|
2
|
-
|
|
3
|
-
$align-contents: start, center, end, space-between, space-around, stretch;
|
|
4
|
-
$justifications: start, center, end, space-between, space-around;
|
|
2
|
+
@import '../../../configurations/variables';
|
|
5
3
|
|
|
6
4
|
|
|
7
5
|
.farm-row {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import Row from './Row.vue';
|
|
2
|
+
import { justifications } from '../../../configurations/flexVariables';
|
|
2
3
|
|
|
3
4
|
export default {
|
|
4
5
|
title: 'Layout/Row',
|
|
@@ -8,7 +9,7 @@ export default {
|
|
|
8
9
|
description: {
|
|
9
10
|
component: `Row<br />
|
|
10
11
|
selector: <em>farm-row</em><br />
|
|
11
|
-
<span style="color:
|
|
12
|
+
<span style="color: var(--farm-primary-base);">ready for use</span>
|
|
12
13
|
`,
|
|
13
14
|
},
|
|
14
15
|
},
|
|
@@ -55,7 +56,7 @@ export const AlignContent = () => ({
|
|
|
55
56
|
export const Justify = () => ({
|
|
56
57
|
data() {
|
|
57
58
|
return {
|
|
58
|
-
justifications
|
|
59
|
+
justifications,
|
|
59
60
|
};
|
|
60
61
|
},
|
|
61
62
|
template: `<div>
|
|
@@ -25,4 +25,9 @@ $fontSizes: (
|
|
|
25
25
|
"xl": 24px
|
|
26
26
|
);
|
|
27
27
|
|
|
28
|
-
$fontWeights: 100, 200, 300, 400, 500, 600, 700;
|
|
28
|
+
$fontWeights: 100, 200, 300, 400, 500, 600, 700;
|
|
29
|
+
|
|
30
|
+
$aligns: start, center, end, baseline, stretch;
|
|
31
|
+
$align-contents: start, center, end, space-between, space-around, stretch;
|
|
32
|
+
$justifications: start, center, end, space-between, space-around;
|
|
33
|
+
$directions: row, row-reverse, column, column-reverse;
|
package/src/main.ts
CHANGED
|
@@ -85,6 +85,7 @@ export * from './components/TextField';
|
|
|
85
85
|
export * from './components/Tooltip';
|
|
86
86
|
export * from './components/Typography';
|
|
87
87
|
|
|
88
|
+
export * from './components/layout/Box';
|
|
88
89
|
export * from './components/layout/Col';
|
|
89
90
|
export * from './components/layout/Container';
|
|
90
91
|
export * from './components/layout/ContainerFooter';
|