@react-ui-org/react-ui 0.47.0 → 0.49.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/lib.development.js +465 -93
- package/dist/lib.js +1 -1
- package/package.json +1 -1
- package/src/lib/components/Alert/Alert.jsx +3 -0
- package/src/lib/components/Alert/Alert.scss +10 -10
- package/src/lib/components/Alert/README.mdx +18 -2
- package/src/lib/components/Alert/index.js +1 -1
- package/src/lib/components/Badge/Badge.jsx +4 -8
- package/src/lib/components/Badge/Badge.scss +21 -21
- package/src/lib/components/Badge/README.mdx +15 -1
- package/src/lib/components/Badge/index.js +1 -1
- package/src/lib/components/Button/Button.jsx +23 -34
- package/src/lib/components/Button/README.mdx +21 -7
- package/src/lib/components/Button/_base.scss +20 -20
- package/src/lib/components/Button/_priorities.scss +35 -35
- package/src/lib/components/Button/helpers/getRootLabelVisibilityClassName.js +7 -7
- package/src/lib/components/Button/helpers/getRootPriorityClassName.js +3 -3
- package/src/lib/components/Button/index.js +1 -1
- package/src/lib/components/ButtonGroup/ButtonGroup.jsx +2 -8
- package/src/lib/components/ButtonGroup/README.mdx +18 -2
- package/src/lib/components/Card/Card.jsx +6 -10
- package/src/lib/components/Card/Card.scss +13 -13
- package/src/lib/components/Card/CardBody.jsx +6 -10
- package/src/lib/components/Card/CardFooter.jsx +6 -7
- package/src/lib/components/Card/README.mdx +21 -5
- package/src/lib/components/CheckboxField/CheckboxField.jsx +17 -44
- package/src/lib/components/CheckboxField/README.mdx +18 -6
- package/src/lib/components/CheckboxField/index.js +1 -1
- package/src/lib/components/FileInputField/FileInputField.jsx +20 -29
- package/src/lib/components/FileInputField/FileInputField.scss +3 -3
- package/src/lib/components/FileInputField/README.mdx +30 -28
- package/src/lib/components/FileInputField/index.js +1 -1
- package/src/lib/components/FormLayout/FormLayout.jsx +5 -9
- package/src/lib/components/FormLayout/FormLayout.scss +3 -3
- package/src/lib/components/FormLayout/FormLayoutCustomField.jsx +4 -1
- package/src/lib/components/FormLayout/FormLayoutCustomField.scss +8 -8
- package/src/lib/components/FormLayout/README.mdx +28 -13
- package/src/lib/components/Grid/Grid.jsx +31 -35
- package/src/lib/components/Grid/Grid.scss +10 -15
- package/src/lib/components/Grid/GridSpan.jsx +5 -11
- package/src/lib/components/Grid/README.mdx +48 -36
- package/src/lib/components/Grid/_helpers/generateResponsiveCustomProperties.js +11 -3
- package/src/lib/components/Grid/_settings.scss +18 -0
- package/src/lib/components/Grid/_tools.scss +5 -5
- package/src/lib/components/Modal/Modal.jsx +147 -254
- package/src/lib/components/Modal/Modal.scss +7 -55
- package/src/lib/components/Modal/ModalBody.jsx +60 -0
- package/src/lib/components/Modal/ModalBody.scss +18 -0
- package/src/lib/components/Modal/ModalCloseButton.jsx +45 -0
- package/src/lib/components/Modal/ModalCloseButton.scss +18 -0
- package/src/lib/components/Modal/ModalContent.jsx +39 -0
- package/src/lib/components/Modal/ModalContent.scss +5 -0
- package/src/lib/components/Modal/ModalFooter.jsx +42 -0
- package/src/lib/components/Modal/ModalFooter.scss +35 -0
- package/src/lib/components/Modal/ModalHeader.jsx +44 -0
- package/src/lib/components/Modal/ModalHeader.scss +30 -0
- package/src/lib/components/Modal/ModalTitle.jsx +44 -0
- package/src/lib/components/Modal/ModalTitle.scss +10 -0
- package/src/lib/components/Modal/README.mdx +865 -195
- package/src/lib/components/Modal/_helpers/getJustifyClassName.js +19 -0
- package/src/lib/components/Modal/_helpers/getScrollingClassName.js +11 -0
- package/src/lib/components/Modal/_settings.scss +1 -5
- package/src/lib/components/Modal/_theme.scss +6 -0
- package/src/lib/components/Modal/index.js +7 -1
- package/src/lib/components/Paper/Paper.jsx +5 -9
- package/src/lib/components/Paper/Paper.scss +2 -2
- package/src/lib/components/Paper/README.mdx +15 -1
- package/src/lib/components/Paper/index.js +1 -1
- package/src/lib/components/Popover/Popover.jsx +14 -30
- package/src/lib/components/Popover/Popover.scss +7 -6
- package/src/lib/components/Popover/PopoverWrapper.jsx +5 -12
- package/src/lib/components/Popover/PopoverWrapper.scss +3 -0
- package/src/lib/components/Popover/README.mdx +32 -11
- package/src/lib/components/Popover/_theme.scss +1 -1
- package/src/lib/components/Radio/README.mdx +13 -6
- package/src/lib/components/Radio/Radio.jsx +39 -29
- package/src/lib/components/Radio/Radio.scss +3 -3
- package/src/lib/components/Radio/index.js +1 -1
- package/src/lib/components/ScrollView/README.mdx +165 -84
- package/src/lib/components/ScrollView/ScrollView.jsx +115 -117
- package/src/lib/components/ScrollView/ScrollView.scss +18 -16
- package/src/lib/components/ScrollView/index.js +1 -1
- package/src/lib/components/SelectField/README.mdx +83 -7
- package/src/lib/components/SelectField/SelectField.jsx +86 -61
- package/src/lib/components/SelectField/SelectField.scss +8 -8
- package/src/lib/components/SelectField/_components/Option/Option.jsx +46 -0
- package/src/lib/components/SelectField/_components/Option/index.js +1 -0
- package/src/lib/components/SelectField/index.js +1 -1
- package/src/lib/components/Table/README.mdx +25 -9
- package/src/lib/components/Table/Table.jsx +43 -101
- package/src/lib/components/Table/Table.scss +0 -24
- package/src/lib/components/Table/_components/TableBodyCell/TableBodyCell.jsx +46 -0
- package/src/lib/components/Table/_components/TableBodyCell/index.js +1 -0
- package/src/lib/components/Table/_components/TableCell.scss +25 -0
- package/src/lib/components/Table/_components/TableHeaderCell/TableHeaderCell.jsx +71 -0
- package/src/lib/components/Table/_components/TableHeaderCell/index.js +1 -0
- package/src/lib/components/Table/index.js +1 -1
- package/src/lib/components/Tabs/README.mdx +21 -3
- package/src/lib/components/Tabs/Tabs.jsx +6 -1
- package/src/lib/components/Tabs/TabsItem.jsx +3 -0
- package/src/lib/components/Tabs/TabsItem.scss +1 -2
- package/src/lib/components/Text/README.mdx +25 -7
- package/src/lib/components/Text/Text.jsx +3 -7
- package/src/lib/components/Text/Text.scss +6 -6
- package/src/lib/components/Text/_helpers/getRootClampClassName.js +2 -2
- package/src/lib/components/Text/_helpers/getRootHyphensClassName.js +2 -2
- package/src/lib/components/Text/_helpers/getRootWordWrappingClassName.js +2 -2
- package/src/lib/components/Text/index.js +1 -1
- package/src/lib/components/TextArea/README.mdx +34 -31
- package/src/lib/components/TextArea/TextArea.jsx +23 -63
- package/src/lib/components/TextArea/TextArea.scss +8 -8
- package/src/lib/components/TextArea/index.js +1 -1
- package/src/lib/components/TextField/README.mdx +56 -54
- package/src/lib/components/TextField/TextField.jsx +25 -52
- package/src/lib/components/TextField/TextField.scss +9 -9
- package/src/lib/components/TextField/index.js +1 -1
- package/src/lib/components/TextLink/README.mdx +13 -6
- package/src/lib/components/TextLink/TextLink.jsx +0 -10
- package/src/lib/components/TextLink/index.js +1 -1
- package/src/lib/components/Toggle/README.mdx +18 -6
- package/src/lib/components/Toggle/Toggle.jsx +18 -44
- package/src/lib/components/Toggle/index.js +1 -1
- package/src/lib/components/Toolbar/README.mdx +21 -6
- package/src/lib/components/Toolbar/Toolbar.jsx +9 -43
- package/src/lib/components/Toolbar/Toolbar.scss +24 -12
- package/src/lib/components/Toolbar/ToolbarGroup.jsx +7 -26
- package/src/lib/components/Toolbar/ToolbarItem.jsx +3 -7
- package/src/lib/components/Toolbar/_helpers/getAlignClassName.js +19 -0
- package/src/lib/components/Toolbar/_helpers/getJustifyClassName.js +16 -0
- package/src/lib/components/_helpers/getRootColorClassName.js +10 -10
- package/src/lib/components/_helpers/getRootSizeClassName.js +3 -3
- package/src/lib/components/_helpers/transferProps.js +1 -1
- package/src/lib/index.js +24 -16
- package/src/lib/provider/withGlobalProps.jsx +20 -3
- package/src/lib/styles/tools/form-fields/_box-field-layout.scss +15 -15
- package/src/lib/styles/tools/form-fields/_inline-field-elements.scss +1 -1
- package/src/lib/styles/tools/form-fields/_inline-field-layout.scss +9 -9
- package/src/lib/theme.scss +18 -26
- package/src/lib/translations/en.js +1 -1
- package/src/lib/components/Grid/_theme.scss +0 -11
- package/src/lib/components/ScrollView/_theme.scss +0 -2
- package/src/lib/components/withForwardedRef.jsx +0 -11
@@ -1,64 +1,35 @@
|
|
1
1
|
import PropTypes from 'prop-types';
|
2
2
|
import React from 'react';
|
3
3
|
import { withGlobalProps } from '../../provider';
|
4
|
+
import { transferProps } from '../_helpers/transferProps';
|
4
5
|
import { classNames } from '../../utils/classNames';
|
5
6
|
import { isChildrenEmpty } from '../_helpers/isChildrenEmpty';
|
7
|
+
import { getAlignClassName } from './_helpers/getAlignClassName';
|
8
|
+
import { getJustifyClassName } from './_helpers/getJustifyClassName';
|
6
9
|
import styles from './Toolbar.scss';
|
7
10
|
|
8
11
|
export const Toolbar = ({
|
9
12
|
align,
|
10
13
|
children,
|
11
14
|
dense,
|
12
|
-
id,
|
13
15
|
justify,
|
14
16
|
nowrap,
|
17
|
+
...restProps
|
15
18
|
}) => {
|
16
19
|
if (isChildrenEmpty(children)) {
|
17
20
|
return null;
|
18
21
|
}
|
19
22
|
|
20
|
-
const alignClass = (value) => {
|
21
|
-
if (value === 'top') {
|
22
|
-
return styles.isAlignedToTop;
|
23
|
-
}
|
24
|
-
|
25
|
-
if (value === 'middle') {
|
26
|
-
return styles.isAlignedToMiddle;
|
27
|
-
}
|
28
|
-
|
29
|
-
if (value === 'bottom') {
|
30
|
-
return styles.isAlignedToBottom;
|
31
|
-
}
|
32
|
-
|
33
|
-
return styles.isAlignedToBaseline;
|
34
|
-
};
|
35
|
-
|
36
|
-
const justifyClass = (value) => {
|
37
|
-
if (value === 'start') {
|
38
|
-
return styles.isJustifiedToStart;
|
39
|
-
}
|
40
|
-
|
41
|
-
if (value === 'center') {
|
42
|
-
return styles.isJustifiedToCenter;
|
43
|
-
}
|
44
|
-
|
45
|
-
if (value === 'end') {
|
46
|
-
return styles.isJustifiedToEnd;
|
47
|
-
}
|
48
|
-
|
49
|
-
return styles.isJustifiedToSpaceBetween;
|
50
|
-
};
|
51
|
-
|
52
23
|
return (
|
53
24
|
<div
|
25
|
+
{...transferProps(restProps)}
|
54
26
|
className={classNames(
|
55
27
|
styles.toolbar,
|
56
|
-
dense && styles.
|
57
|
-
nowrap && styles.
|
58
|
-
|
59
|
-
|
28
|
+
dense && styles.isToolbarDense,
|
29
|
+
nowrap && styles.isToolbarNowrap,
|
30
|
+
getAlignClassName(align, styles, 'toolbar'),
|
31
|
+
getJustifyClassName(justify, styles),
|
60
32
|
)}
|
61
|
-
id={id}
|
62
33
|
>
|
63
34
|
{children}
|
64
35
|
</div>
|
@@ -69,7 +40,6 @@ Toolbar.defaultProps = {
|
|
69
40
|
align: 'top',
|
70
41
|
children: null,
|
71
42
|
dense: false,
|
72
|
-
id: undefined,
|
73
43
|
justify: 'start',
|
74
44
|
nowrap: false,
|
75
45
|
};
|
@@ -91,10 +61,6 @@ Toolbar.propTypes = {
|
|
91
61
|
* If `true`, spacing of all toolbar items in the toolbar will be reduced.
|
92
62
|
*/
|
93
63
|
dense: PropTypes.bool,
|
94
|
-
/**
|
95
|
-
* ID of the root HTML element.
|
96
|
-
*/
|
97
|
-
id: PropTypes.string,
|
98
64
|
/**
|
99
65
|
* Horizontal alignment (distribution) of toolbar items and groups.
|
100
66
|
*/
|
@@ -25,47 +25,59 @@
|
|
25
25
|
min-width: 0;
|
26
26
|
}
|
27
27
|
|
28
|
-
.
|
28
|
+
.isToolbarAlignedToTop,
|
29
|
+
.isGroupAlignedToTop {
|
29
30
|
align-items: flex-start;
|
30
31
|
}
|
31
32
|
|
32
|
-
.
|
33
|
+
.isToolbarAlignedToMiddle,
|
34
|
+
.isGroupAlignedToMiddle {
|
33
35
|
align-items: center;
|
34
36
|
}
|
35
37
|
|
36
|
-
.
|
38
|
+
.isToolbarAlignedToBottom,
|
39
|
+
.isGroupAlignedToBottom {
|
37
40
|
align-items: flex-end;
|
38
41
|
}
|
39
42
|
|
40
|
-
.
|
43
|
+
.isToolbarAlignedToBaseline,
|
44
|
+
.isGroupAlignedToBaseline {
|
41
45
|
align-items: baseline;
|
42
46
|
}
|
43
47
|
|
44
|
-
.
|
48
|
+
.isToolbarJustifiedToStart,
|
49
|
+
.isGroupJustifiedToStart {
|
45
50
|
justify-content: flex-start;
|
46
51
|
}
|
47
52
|
|
48
|
-
.
|
53
|
+
.isToolbarJustifiedToCenter,
|
54
|
+
.isGroupJustifiedToCenter {
|
49
55
|
justify-content: center;
|
50
56
|
}
|
51
57
|
|
52
|
-
.
|
58
|
+
.isToolbarJustifiedToEnd,
|
59
|
+
.isGroupJustifiedToEnd {
|
53
60
|
justify-content: flex-end;
|
54
61
|
}
|
55
62
|
|
56
|
-
.
|
63
|
+
.isToolbarJustifiedToSpaceBetween,
|
64
|
+
.isGroupJustifiedToSpaceBetween {
|
57
65
|
justify-content: space-between;
|
58
66
|
}
|
59
67
|
|
60
|
-
.
|
61
|
-
.
|
68
|
+
.isToolbarDense,
|
69
|
+
.isGroupDense,
|
70
|
+
.isToolbarDense .group,
|
71
|
+
.isGroupDense .group {
|
62
72
|
gap: theme.$gap-dense;
|
63
73
|
}
|
64
74
|
|
65
|
-
.
|
75
|
+
.isToolbarNowrap,
|
76
|
+
.isGroupNowrap {
|
66
77
|
flex-wrap: nowrap;
|
67
78
|
}
|
68
79
|
|
69
|
-
.
|
80
|
+
.isToolbarNowrap > .item:not(.isItemFlexible),
|
81
|
+
.isGroupNowrap > .item:not(.isItemFlexible) {
|
70
82
|
flex: 0 1 auto;
|
71
83
|
}
|
@@ -1,46 +1,32 @@
|
|
1
1
|
import PropTypes from 'prop-types';
|
2
2
|
import React from 'react';
|
3
3
|
import { withGlobalProps } from '../../provider';
|
4
|
+
import { transferProps } from '../_helpers/transferProps';
|
4
5
|
import { classNames } from '../../utils/classNames';
|
5
6
|
import { isChildrenEmpty } from '../_helpers/isChildrenEmpty';
|
7
|
+
import { getAlignClassName } from './_helpers/getAlignClassName';
|
6
8
|
import styles from './Toolbar.scss';
|
7
9
|
|
8
10
|
export const ToolbarGroup = ({
|
9
11
|
align,
|
10
12
|
children,
|
11
13
|
dense,
|
12
|
-
id,
|
13
14
|
nowrap,
|
15
|
+
...restProps
|
14
16
|
}) => {
|
15
17
|
if (isChildrenEmpty(children)) {
|
16
18
|
return null;
|
17
19
|
}
|
18
20
|
|
19
|
-
const alignClass = (value) => {
|
20
|
-
if (value === 'top') {
|
21
|
-
return styles.isAlignedToTop;
|
22
|
-
}
|
23
|
-
|
24
|
-
if (value === 'middle') {
|
25
|
-
return styles.isAlignedToMiddle;
|
26
|
-
}
|
27
|
-
|
28
|
-
if (value === 'bottom') {
|
29
|
-
return styles.isAlignedToBottom;
|
30
|
-
}
|
31
|
-
|
32
|
-
return styles.isAlignedToBaseline;
|
33
|
-
};
|
34
|
-
|
35
21
|
return (
|
36
22
|
<div
|
23
|
+
{...transferProps(restProps)}
|
37
24
|
className={classNames(
|
38
25
|
styles.group,
|
39
|
-
dense && styles.
|
40
|
-
nowrap && styles.
|
41
|
-
|
26
|
+
dense && styles.isGroupDense,
|
27
|
+
nowrap && styles.isGroupNowrap,
|
28
|
+
getAlignClassName(align, styles, 'group'),
|
42
29
|
)}
|
43
|
-
id={id}
|
44
30
|
>
|
45
31
|
{children}
|
46
32
|
</div>
|
@@ -51,7 +37,6 @@ ToolbarGroup.defaultProps = {
|
|
51
37
|
align: 'top',
|
52
38
|
children: null,
|
53
39
|
dense: false,
|
54
|
-
id: undefined,
|
55
40
|
nowrap: false,
|
56
41
|
};
|
57
42
|
|
@@ -68,10 +53,6 @@ ToolbarGroup.propTypes = {
|
|
68
53
|
* If `true`, spacing of toolbar items in the group will be reduced.
|
69
54
|
*/
|
70
55
|
dense: PropTypes.bool,
|
71
|
-
/**
|
72
|
-
* ID of the root HTML element.
|
73
|
-
*/
|
74
|
-
id: PropTypes.string,
|
75
56
|
/**
|
76
57
|
* If set, the toolbar group will not wrap.
|
77
58
|
*/
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import PropTypes from 'prop-types';
|
2
2
|
import React from 'react';
|
3
|
+
import { transferProps } from '../_helpers/transferProps';
|
3
4
|
import { classNames } from '../../utils/classNames';
|
4
5
|
import { withGlobalProps } from '../../provider';
|
5
6
|
import { isChildrenEmpty } from '../_helpers/isChildrenEmpty';
|
@@ -8,7 +9,7 @@ import styles from './Toolbar.scss';
|
|
8
9
|
export const ToolbarItem = ({
|
9
10
|
children,
|
10
11
|
flexible,
|
11
|
-
|
12
|
+
...restProps
|
12
13
|
}) => {
|
13
14
|
if (isChildrenEmpty(children)) {
|
14
15
|
return null;
|
@@ -16,11 +17,11 @@ export const ToolbarItem = ({
|
|
16
17
|
|
17
18
|
return (
|
18
19
|
<div
|
20
|
+
{...transferProps(restProps)}
|
19
21
|
className={classNames(
|
20
22
|
styles.item,
|
21
23
|
flexible && styles.isItemFlexible,
|
22
24
|
)}
|
23
|
-
id={id}
|
24
25
|
>
|
25
26
|
{children}
|
26
27
|
</div>
|
@@ -30,7 +31,6 @@ export const ToolbarItem = ({
|
|
30
31
|
ToolbarItem.defaultProps = {
|
31
32
|
children: null,
|
32
33
|
flexible: false,
|
33
|
-
id: undefined,
|
34
34
|
};
|
35
35
|
|
36
36
|
ToolbarItem.propTypes = {
|
@@ -42,10 +42,6 @@ ToolbarItem.propTypes = {
|
|
42
42
|
* Allow item to grow and shrink if needed.
|
43
43
|
*/
|
44
44
|
flexible: PropTypes.bool,
|
45
|
-
/**
|
46
|
-
* ID of the root HTML element.
|
47
|
-
*/
|
48
|
-
id: PropTypes.string,
|
49
45
|
};
|
50
46
|
|
51
47
|
export const ToolbarItemWithGlobalProps = withGlobalProps(ToolbarItem, 'ToolbarItem');
|
@@ -0,0 +1,19 @@
|
|
1
|
+
export const getAlignClassName = (value, styles, type) => {
|
2
|
+
if (value === 'top') {
|
3
|
+
if (type === 'group') return styles.isGroupAlignedToTop;
|
4
|
+
return styles.isToolbarAlignedToTop;
|
5
|
+
}
|
6
|
+
|
7
|
+
if (value === 'middle') {
|
8
|
+
if (type === 'group') return styles.isGroupAlignedToMiddle;
|
9
|
+
return styles.isToolbarAlignedToMiddle;
|
10
|
+
}
|
11
|
+
|
12
|
+
if (value === 'bottom') {
|
13
|
+
if (type === 'group') return styles.isGroupAlignedToBottom;
|
14
|
+
return styles.isToolbarAlignedToBottom;
|
15
|
+
}
|
16
|
+
|
17
|
+
if (type === 'group') return styles.isGroupAlignedToBaseline;
|
18
|
+
return styles.isToolbarAlignedToBaseline;
|
19
|
+
};
|
@@ -0,0 +1,16 @@
|
|
1
|
+
export const getJustifyClassName = (value, styles) => {
|
2
|
+
if (value === 'start') {
|
3
|
+
return styles.isToolbarJustifiedToStart;
|
4
|
+
}
|
5
|
+
|
6
|
+
if (value === 'center') {
|
7
|
+
return styles.isToolbarJustifiedToCenter;
|
8
|
+
}
|
9
|
+
|
10
|
+
if (value === 'end') {
|
11
|
+
return styles.isToolbarJustifiedToEnd;
|
12
|
+
}
|
13
|
+
|
14
|
+
return styles.isToolbarJustifiedToSpaceBetween;
|
15
|
+
};
|
16
|
+
|
@@ -1,42 +1,42 @@
|
|
1
1
|
export const getRootColorClassName = (variant, styles) => {
|
2
2
|
if (variant === 'primary') {
|
3
|
-
return styles.
|
3
|
+
return styles.isRootColorPrimary;
|
4
4
|
}
|
5
5
|
|
6
6
|
if (variant === 'secondary') {
|
7
|
-
return styles.
|
7
|
+
return styles.isRootColorSecondary;
|
8
8
|
}
|
9
9
|
|
10
10
|
if (variant === 'success') {
|
11
|
-
return styles.
|
11
|
+
return styles.isRootColorSuccess;
|
12
12
|
}
|
13
13
|
|
14
14
|
if (variant === 'warning') {
|
15
|
-
return styles.
|
15
|
+
return styles.isRootColorWarning;
|
16
16
|
}
|
17
17
|
|
18
18
|
if (variant === 'danger') {
|
19
|
-
return styles.
|
19
|
+
return styles.isRootColorDanger;
|
20
20
|
}
|
21
21
|
|
22
22
|
if (variant === 'help') {
|
23
|
-
return styles.
|
23
|
+
return styles.isRootColorHelp;
|
24
24
|
}
|
25
25
|
|
26
26
|
if (variant === 'info') {
|
27
|
-
return styles.
|
27
|
+
return styles.isRootColorInfo;
|
28
28
|
}
|
29
29
|
|
30
30
|
if (variant === 'note') {
|
31
|
-
return styles.
|
31
|
+
return styles.isRootColorNote;
|
32
32
|
}
|
33
33
|
|
34
34
|
if (variant === 'light') {
|
35
|
-
return styles.
|
35
|
+
return styles.isRootColorLight;
|
36
36
|
}
|
37
37
|
|
38
38
|
if (variant === 'dark') {
|
39
|
-
return styles.
|
39
|
+
return styles.isRootColorDark;
|
40
40
|
}
|
41
41
|
|
42
42
|
return null;
|
@@ -1,14 +1,14 @@
|
|
1
1
|
export const getRootSizeClassName = (size, styles) => {
|
2
2
|
if (size === 'small') {
|
3
|
-
return styles.
|
3
|
+
return styles.isRootSizeSmall;
|
4
4
|
}
|
5
5
|
|
6
6
|
if (size === 'medium') {
|
7
|
-
return styles.
|
7
|
+
return styles.isRootSizeMedium;
|
8
8
|
}
|
9
9
|
|
10
10
|
if (size === 'large') {
|
11
|
-
return styles.
|
11
|
+
return styles.isRootSizeLarge;
|
12
12
|
}
|
13
13
|
|
14
14
|
return null;
|
package/src/lib/index.js
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
// Components
|
2
|
-
export {
|
3
|
-
export {
|
4
|
-
export {
|
2
|
+
export { Alert } from './components/Alert';
|
3
|
+
export { Badge } from './components/Badge';
|
4
|
+
export { Button } from './components/Button';
|
5
5
|
export { ButtonGroup } from './components/ButtonGroup';
|
6
6
|
export {
|
7
7
|
Card,
|
8
8
|
CardBody,
|
9
9
|
CardFooter,
|
10
10
|
} from './components/Card';
|
11
|
-
export {
|
12
|
-
export {
|
11
|
+
export { CheckboxField } from './components/CheckboxField';
|
12
|
+
export { FileInputField } from './components/FileInputField';
|
13
13
|
export {
|
14
14
|
FormLayout,
|
15
15
|
FormLayoutCustomField,
|
@@ -18,25 +18,33 @@ export {
|
|
18
18
|
Grid,
|
19
19
|
GridSpan,
|
20
20
|
} from './components/Grid';
|
21
|
-
export {
|
22
|
-
|
21
|
+
export {
|
22
|
+
Modal,
|
23
|
+
ModalBody,
|
24
|
+
ModalCloseButton,
|
25
|
+
ModalContent,
|
26
|
+
ModalFooter,
|
27
|
+
ModalHeader,
|
28
|
+
ModalTitle,
|
29
|
+
} from './components/Modal';
|
30
|
+
export { Paper } from './components/Paper';
|
23
31
|
export {
|
24
32
|
Popover,
|
25
33
|
PopoverWrapper,
|
26
34
|
} from './components/Popover';
|
27
|
-
export {
|
28
|
-
export {
|
29
|
-
export {
|
35
|
+
export { Radio } from './components/Radio';
|
36
|
+
export { ScrollView } from './components/ScrollView';
|
37
|
+
export { SelectField } from './components/SelectField';
|
30
38
|
export {
|
31
39
|
Tabs,
|
32
40
|
TabsItem,
|
33
41
|
} from './components/Tabs';
|
34
|
-
export {
|
35
|
-
export {
|
36
|
-
export {
|
37
|
-
export {
|
38
|
-
export {
|
39
|
-
export {
|
42
|
+
export { Table } from './components/Table';
|
43
|
+
export { Text } from './components/Text';
|
44
|
+
export { TextArea } from './components/TextArea';
|
45
|
+
export { TextField } from './components/TextField';
|
46
|
+
export { TextLink } from './components/TextLink';
|
47
|
+
export { Toggle } from './components/Toggle';
|
40
48
|
export {
|
41
49
|
Toolbar,
|
42
50
|
ToolbarGroup,
|
@@ -1,8 +1,12 @@
|
|
1
|
+
import PropTypes from 'prop-types';
|
1
2
|
import React from 'react';
|
2
3
|
import RUIContext from './RUIContext';
|
3
4
|
|
4
5
|
export default (Component, componentName) => {
|
5
|
-
const WithGlobalPropsComponent = (
|
6
|
+
const WithGlobalPropsComponent = ({
|
7
|
+
forwardedRef,
|
8
|
+
...rest
|
9
|
+
}) => (
|
6
10
|
<RUIContext.Consumer>
|
7
11
|
{({ globalProps }) => {
|
8
12
|
const contextGlobalProps = globalProps ? globalProps[componentName] : null;
|
@@ -10,12 +14,25 @@ export default (Component, componentName) => {
|
|
10
14
|
return (
|
11
15
|
<Component
|
12
16
|
{...contextGlobalProps}
|
13
|
-
{...
|
17
|
+
{...rest}
|
18
|
+
ref={forwardedRef}
|
14
19
|
/>
|
15
20
|
);
|
16
21
|
}}
|
17
22
|
</RUIContext.Consumer>
|
18
23
|
);
|
19
24
|
|
20
|
-
|
25
|
+
WithGlobalPropsComponent.defaultProps = {
|
26
|
+
forwardedRef: undefined,
|
27
|
+
};
|
28
|
+
|
29
|
+
WithGlobalPropsComponent.propTypes = {
|
30
|
+
forwardedRef: PropTypes.oneOfType([
|
31
|
+
PropTypes.func,
|
32
|
+
// eslint-disable-next-line react/forbid-prop-types
|
33
|
+
PropTypes.shape({ current: PropTypes.any }),
|
34
|
+
]),
|
35
|
+
};
|
36
|
+
|
37
|
+
return React.forwardRef((props, ref) => (<WithGlobalPropsComponent {...props} forwardedRef={ref} />));
|
21
38
|
};
|
@@ -169,12 +169,12 @@
|
|
169
169
|
}
|
170
170
|
|
171
171
|
@include breakpoint.up(forms.$horizontal-breakpoint) {
|
172
|
-
&.
|
172
|
+
&.isRootLayoutHorizontal {
|
173
173
|
display: grid;
|
174
174
|
grid-template-columns: theme.$horizontal-full-width-label-width 1fr; // 6.
|
175
175
|
}
|
176
176
|
|
177
|
-
&.
|
177
|
+
&.isRootLayoutHorizontal .field {
|
178
178
|
justify-self: stretch; // 7.
|
179
179
|
}
|
180
180
|
}
|
@@ -192,8 +192,8 @@
|
|
192
192
|
width: auto; // 11.
|
193
193
|
}
|
194
194
|
|
195
|
-
&.
|
196
|
-
&.
|
195
|
+
&.isRootLayoutHorizontal,
|
196
|
+
&.isRootLayoutHorizontal.hasRootSmallInput {
|
197
197
|
grid: inherit; // 8.
|
198
198
|
grid-template-columns: subgrid; // 8.
|
199
199
|
grid-column: span 2; // 8.
|
@@ -203,26 +203,26 @@
|
|
203
203
|
}
|
204
204
|
}
|
205
205
|
|
206
|
-
&.
|
206
|
+
&.isRootLayoutHorizontal.isRootFullWidth {
|
207
207
|
grid-template-columns: subgrid; // 8.
|
208
208
|
}
|
209
209
|
|
210
|
-
&.
|
211
|
-
&.
|
212
|
-
&.
|
213
|
-
&.
|
214
|
-
&.
|
210
|
+
&.isRootLayoutHorizontal .label,
|
211
|
+
&.isRootLayoutHorizontal .field,
|
212
|
+
&.isRootLayoutHorizontal .inputContainer,
|
213
|
+
&.isRootLayoutHorizontal .helpText,
|
214
|
+
&.isRootLayoutHorizontal .validationText {
|
215
215
|
grid-area: unset; // 8.
|
216
216
|
}
|
217
217
|
|
218
|
-
&.
|
219
|
-
&.
|
220
|
-
&.
|
221
|
-
&.
|
218
|
+
&.isRootLayoutHorizontal .field,
|
219
|
+
&.isRootLayoutHorizontal .inputContainer,
|
220
|
+
&.isRootLayoutHorizontal .helpText,
|
221
|
+
&.isRootLayoutHorizontal .validationText {
|
222
222
|
grid-column-start: 2; // 8.
|
223
223
|
}
|
224
224
|
|
225
|
-
&.
|
225
|
+
&.isRootLayoutHorizontal.hasRootSmallInput .field {
|
226
226
|
display: block; // 5.
|
227
227
|
}
|
228
228
|
}
|
@@ -69,7 +69,7 @@
|
|
69
69
|
width: auto; // 2., 3.
|
70
70
|
|
71
71
|
@include breakpoint.up(forms.$horizontal-breakpoint) {
|
72
|
-
&.
|
72
|
+
&.isRootLayoutHorizontal {
|
73
73
|
grid: inherit;
|
74
74
|
grid-template-columns: subgrid;
|
75
75
|
grid-column: span 2;
|
@@ -79,11 +79,11 @@
|
|
79
79
|
}
|
80
80
|
}
|
81
81
|
|
82
|
-
&.
|
82
|
+
&.isRootLayoutHorizontal .field {
|
83
83
|
display: contents;
|
84
84
|
}
|
85
85
|
|
86
|
-
&.
|
86
|
+
&.isRootLayoutHorizontal .label {
|
87
87
|
grid-column-start: 1;
|
88
88
|
width: auto;
|
89
89
|
padding-right: settings.$horizontal-inner-gap;
|
@@ -91,14 +91,14 @@
|
|
91
91
|
text-align: theme.$horizontal-label-text-align;
|
92
92
|
}
|
93
93
|
|
94
|
-
&.
|
95
|
-
&.
|
96
|
-
&.
|
94
|
+
&.isRootLayoutHorizontal .input,
|
95
|
+
&.isRootLayoutHorizontal .helpText,
|
96
|
+
&.isRootLayoutHorizontal .validationText {
|
97
97
|
grid-column-start: 2;
|
98
98
|
}
|
99
99
|
|
100
|
-
&.
|
101
|
-
&.
|
100
|
+
&.isRootLayoutHorizontal .helpText,
|
101
|
+
&.isRootLayoutHorizontal .validationText {
|
102
102
|
width: auto;
|
103
103
|
max-width: 100%;
|
104
104
|
|
@@ -107,7 +107,7 @@
|
|
107
107
|
}
|
108
108
|
}
|
109
109
|
|
110
|
-
&.
|
110
|
+
&.isRootLayoutHorizontal.hasRootLabelBefore .label {
|
111
111
|
margin-right: 0;
|
112
112
|
}
|
113
113
|
}
|