@react-ui-org/react-ui 0.46.0 → 0.47.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/README.md +15 -16
- package/dist/lib.development.js +106 -154
- package/dist/lib.js +1 -1
- package/package.json +2 -1
- package/src/lib/components/Alert/Alert.jsx +43 -43
- package/src/lib/components/Alert/README.mdx +2 -5
- package/src/lib/components/Badge/Badge.jsx +3 -3
- package/src/lib/components/Button/Button.jsx +4 -4
- package/src/lib/components/Button/README.mdx +4 -4
- package/src/lib/components/Button/_base.scss +6 -6
- package/src/lib/components/Button/helpers/getRootLabelVisibilityClassName.js +4 -4
- package/src/lib/components/ButtonGroup/ButtonGroup.jsx +10 -3
- package/src/lib/components/ButtonGroup/README.mdx +1 -1
- package/src/lib/components/Card/Card.jsx +3 -3
- package/src/lib/components/Card/CardBody.jsx +16 -5
- package/src/lib/components/Card/CardFooter.jsx +13 -5
- package/src/lib/components/CheckboxField/CheckboxField.jsx +3 -3
- package/src/lib/components/FileInputField/FileInputField.jsx +3 -3
- package/src/lib/components/FormLayout/FormLayout.jsx +3 -3
- package/src/lib/components/FormLayout/FormLayoutCustomField.jsx +3 -3
- package/src/lib/components/FormLayout/README.mdx +4 -5
- package/src/lib/components/Grid/Grid.jsx +21 -21
- package/src/lib/components/Grid/Grid.scss +6 -0
- package/src/lib/components/Grid/GridSpan.jsx +7 -7
- package/src/lib/components/Grid/README.mdx +46 -20
- package/src/lib/components/Grid/_theme.scss +7 -7
- package/src/lib/components/Modal/Modal.jsx +30 -26
- package/src/lib/components/Modal/README.mdx +2 -5
- package/src/lib/components/Paper/Paper.jsx +3 -3
- package/src/lib/components/Popover/Popover.jsx +94 -0
- package/src/lib/components/Popover/Popover.scss +235 -0
- package/src/lib/components/Popover/PopoverWrapper.jsx +46 -0
- package/src/lib/components/Popover/README.mdx +333 -0
- package/src/lib/components/Popover/_helpers/getRootAlignmentClassName.js +13 -0
- package/src/lib/components/Popover/_helpers/getRootSideClassName.js +17 -0
- package/src/lib/components/Popover/_theme.scss +16 -0
- package/src/lib/components/Popover/index.js +2 -0
- package/src/lib/components/Radio/Radio.jsx +3 -3
- package/src/lib/components/ScrollView/README.mdx +2 -5
- package/src/lib/components/ScrollView/ScrollView.jsx +11 -13
- package/src/lib/components/SelectField/SelectField.jsx +3 -3
- package/src/lib/components/Table/README.mdx +1 -1
- package/src/lib/components/Table/Table.jsx +3 -3
- package/src/lib/components/Tabs/Tabs.jsx +3 -3
- package/src/lib/components/Tabs/TabsItem.jsx +3 -3
- package/src/lib/components/Text/README.mdx +2 -2
- package/src/lib/components/Text/Text.jsx +3 -3
- package/src/lib/components/TextArea/TextArea.jsx +3 -3
- package/src/lib/components/TextField/TextField.jsx +3 -3
- package/src/lib/components/TextLink/TextLink.jsx +3 -3
- package/src/lib/components/Toggle/Toggle.jsx +3 -3
- package/src/lib/components/Toolbar/README.mdx +18 -6
- package/src/lib/components/Toolbar/Toolbar.jsx +10 -3
- package/src/lib/components/Toolbar/Toolbar.scss +5 -23
- package/src/lib/components/Toolbar/ToolbarGroup.jsx +10 -3
- package/src/lib/components/Toolbar/ToolbarItem.jsx +10 -3
- package/src/lib/index.js +4 -9
- package/src/lib/provider/index.js +2 -1
- package/src/lib/provider/withGlobalProps.jsx +21 -0
- package/src/lib/styles/settings/_breakpoints.scss +2 -2
- package/src/lib/styles/theme-constants/_breakpoints.scss +2 -2
- package/src/lib/styles/tools/_spacing.scss +2 -6
- package/src/lib/theme.scss +19 -18
- package/src/lib/components/List/List.jsx +0 -73
- package/src/lib/components/List/List.scss +0 -53
- package/src/lib/components/List/ListItem.jsx +0 -32
- package/src/lib/components/List/README.mdx +0 -114
- package/src/lib/components/List/_theme.scss +0 -1
- package/src/lib/components/List/index.js +0 -2
- package/src/lib/components/Media/Media.jsx +0 -36
- package/src/lib/components/Media/Media.scss +0 -16
- package/src/lib/components/Media/MediaBody.jsx +0 -32
- package/src/lib/components/Media/MediaObject.jsx +0 -32
- package/src/lib/components/Media/README.mdx +0 -63
- package/src/lib/components/Media/index.js +0 -3
- package/src/lib/provider/withProviderContext.jsx +0 -32
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@react-ui-org/react-ui",
|
3
3
|
"description": "React UI is a themeable UI library for React apps.",
|
4
|
-
"version": "0.
|
4
|
+
"version": "0.47.0",
|
5
5
|
"keywords": [
|
6
6
|
"react",
|
7
7
|
"ui",
|
@@ -44,6 +44,7 @@
|
|
44
44
|
"@babel/preset-env": "^7.16.0",
|
45
45
|
"@babel/preset-react": "^7.16.0",
|
46
46
|
"@babel/register": "^7.16.0",
|
47
|
+
"@floating-ui/react-dom": "^0.7.1",
|
47
48
|
"@nejcm/docz-theme-extended": "^2.0.14",
|
48
49
|
"@testing-library/jest-dom": "^5.15.0",
|
49
50
|
"@testing-library/react": "^12.1.2",
|
@@ -1,6 +1,9 @@
|
|
1
1
|
import PropTypes from 'prop-types';
|
2
|
-
import React from 'react';
|
3
|
-
import {
|
2
|
+
import React, { useContext } from 'react';
|
3
|
+
import {
|
4
|
+
RUIContext,
|
5
|
+
withGlobalProps,
|
6
|
+
} from '../../provider';
|
4
7
|
import { classNames } from '../../utils/classNames';
|
5
8
|
import { getRootColorClassName } from '../_helpers/getRootColorClassName';
|
6
9
|
import styles from './Alert.scss';
|
@@ -11,42 +14,45 @@ export const Alert = ({
|
|
11
14
|
icon,
|
12
15
|
id,
|
13
16
|
onClose,
|
14
|
-
|
15
|
-
}
|
16
|
-
|
17
|
-
|
18
|
-
styles.root,
|
19
|
-
getRootColorClassName(color, styles),
|
20
|
-
)}
|
21
|
-
id={id}
|
22
|
-
role="alert"
|
23
|
-
>
|
24
|
-
{icon && (
|
25
|
-
<div className={styles.icon}>
|
26
|
-
{icon}
|
27
|
-
</div>
|
28
|
-
)}
|
17
|
+
}) => {
|
18
|
+
const { translations } = useContext(RUIContext);
|
19
|
+
|
20
|
+
return (
|
29
21
|
<div
|
30
|
-
className={
|
31
|
-
|
22
|
+
className={classNames(
|
23
|
+
styles.root,
|
24
|
+
getRootColorClassName(color, styles),
|
25
|
+
)}
|
26
|
+
id={id}
|
27
|
+
role="alert"
|
32
28
|
>
|
33
|
-
{
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
className={styles.
|
40
|
-
|
41
|
-
onKeyPress={() => onClose()}
|
42
|
-
tabIndex="0"
|
43
|
-
title={translations.close}
|
29
|
+
{icon && (
|
30
|
+
<div className={styles.icon}>
|
31
|
+
{icon}
|
32
|
+
</div>
|
33
|
+
)}
|
34
|
+
<div
|
35
|
+
className={styles.message}
|
36
|
+
{...(id && { id: `${id}__content` })}
|
44
37
|
>
|
45
|
-
|
46
|
-
</
|
47
|
-
|
48
|
-
|
49
|
-
|
38
|
+
{children}
|
39
|
+
</div>
|
40
|
+
{onClose && (
|
41
|
+
<button
|
42
|
+
type="button"
|
43
|
+
{...(id && { id: `${id}__close` })}
|
44
|
+
className={styles.close}
|
45
|
+
onClick={() => onClose()}
|
46
|
+
onKeyPress={() => onClose()}
|
47
|
+
tabIndex="0"
|
48
|
+
title={translations.Alert.close}
|
49
|
+
>
|
50
|
+
<span className={styles.closeSign}>×</span>
|
51
|
+
</button>
|
52
|
+
)}
|
53
|
+
</div>
|
54
|
+
);
|
55
|
+
};
|
50
56
|
|
51
57
|
Alert.defaultProps = {
|
52
58
|
color: 'note',
|
@@ -83,14 +89,8 @@ Alert.propTypes = {
|
|
83
89
|
* hidden.
|
84
90
|
*/
|
85
91
|
onClose: PropTypes.func,
|
86
|
-
/**
|
87
|
-
* Translations required by the component.
|
88
|
-
*/
|
89
|
-
translations: PropTypes.shape({
|
90
|
-
close: PropTypes.string.isRequired,
|
91
|
-
}).isRequired,
|
92
92
|
};
|
93
93
|
|
94
|
-
export const
|
94
|
+
export const AlertWithGlobalProps = withGlobalProps(Alert, 'Alert');
|
95
95
|
|
96
|
-
export default
|
96
|
+
export default AlertWithGlobalProps;
|
@@ -13,10 +13,7 @@ import {
|
|
13
13
|
import Icon from '../../../docs/_components/Icon'
|
14
14
|
import Placeholder from '../../../docs/_components/Placeholder'
|
15
15
|
import Button from '../Button'
|
16
|
-
import {
|
17
|
-
AlertWithContext as Alert,
|
18
|
-
Alert as ParsableAlert,
|
19
|
-
} from './Alert'
|
16
|
+
import { Alert } from './Alert'
|
20
17
|
|
21
18
|
Alert presents feedback or important information to users.
|
22
19
|
|
@@ -207,7 +204,7 @@ click on the close button:
|
|
207
204
|
|
208
205
|
## API
|
209
206
|
|
210
|
-
<Props table of={
|
207
|
+
<Props table of={Alert} />
|
211
208
|
|
212
209
|
## Theming
|
213
210
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import PropTypes from 'prop-types';
|
2
2
|
import React from 'react';
|
3
|
-
import {
|
3
|
+
import { withGlobalProps } from '../../provider';
|
4
4
|
import { classNames } from '../../utils/classNames';
|
5
5
|
import { getRootColorClassName } from '../_helpers/getRootColorClassName';
|
6
6
|
import styles from './Badge.scss';
|
@@ -50,6 +50,6 @@ Badge.propTypes = {
|
|
50
50
|
priority: PropTypes.oneOf(['filled', 'outline']),
|
51
51
|
};
|
52
52
|
|
53
|
-
export const
|
53
|
+
export const BadgeWithGlobalProps = withGlobalProps(Badge, 'Badge');
|
54
54
|
|
55
|
-
export default
|
55
|
+
export default BadgeWithGlobalProps;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import PropTypes from 'prop-types';
|
2
2
|
import React, { useContext } from 'react';
|
3
|
-
import {
|
3
|
+
import { withGlobalProps } from '../../provider';
|
4
4
|
import { classNames } from '../../utils/classNames';
|
5
5
|
import { getRootColorClassName } from '../_helpers/getRootColorClassName';
|
6
6
|
import { getRootSizeClassName } from '../_helpers/getRootSizeClassName';
|
@@ -169,7 +169,7 @@ Button.propTypes = {
|
|
169
169
|
/**
|
170
170
|
* Defines minimum breakpoint from which the button label will be visible.
|
171
171
|
*/
|
172
|
-
labelVisibility: PropTypes.oneOf(['xs', 'sm', 'md', 'lg', 'xl', '
|
172
|
+
labelVisibility: PropTypes.oneOf(['xs', 'sm', 'md', 'lg', 'xl', 'x2l', 'x3l', 'none']),
|
173
173
|
/**
|
174
174
|
* Visual priority to highlight or suppress the button.
|
175
175
|
*
|
@@ -194,6 +194,6 @@ Button.propTypes = {
|
|
194
194
|
type: PropTypes.oneOf(['button', 'submit']),
|
195
195
|
};
|
196
196
|
|
197
|
-
export const
|
197
|
+
export const ButtonWithGlobalProps = withForwardedRef(withGlobalProps(Button, 'Button'));
|
198
198
|
|
199
|
-
export default
|
199
|
+
export default ButtonWithGlobalProps;
|
@@ -194,13 +194,13 @@ of your choice and display label once you know there is enough room for it.
|
|
194
194
|
beforeLabel={<Icon icon="pencil" />}
|
195
195
|
/>
|
196
196
|
<Button
|
197
|
-
label="Label visible from
|
198
|
-
labelVisibility="
|
197
|
+
label="Label visible from x2l up"
|
198
|
+
labelVisibility="x2l"
|
199
199
|
beforeLabel={<Icon icon="pencil" />}
|
200
200
|
/>
|
201
201
|
<Button
|
202
|
-
label="Label visible from
|
203
|
-
labelVisibility="
|
202
|
+
label="Label visible from x3l up"
|
203
|
+
labelVisibility="x3l"
|
204
204
|
beforeLabel={<Icon icon="pencil" />}
|
205
205
|
/>
|
206
206
|
</Playground>
|
@@ -106,8 +106,8 @@
|
|
106
106
|
.withLabelVisibleMd,
|
107
107
|
.withLabelVisibleLg,
|
108
108
|
.withLabelVisibleXl,
|
109
|
-
.
|
110
|
-
.
|
109
|
+
.withLabelVisibleX2l,
|
110
|
+
.withLabelVisibleX3l {
|
111
111
|
@include tools.hide-label();
|
112
112
|
}
|
113
113
|
|
@@ -135,14 +135,14 @@
|
|
135
135
|
}
|
136
136
|
}
|
137
137
|
|
138
|
-
.
|
139
|
-
@include breakpoint.up(
|
138
|
+
.withLabelVisibleX2l {
|
139
|
+
@include breakpoint.up(x2l) {
|
140
140
|
@include tools.show-label();
|
141
141
|
}
|
142
142
|
}
|
143
143
|
|
144
|
-
.
|
145
|
-
@include breakpoint.up(
|
144
|
+
.withLabelVisibleX3l {
|
145
|
+
@include breakpoint.up(x3l) {
|
146
146
|
@include tools.show-label();
|
147
147
|
}
|
148
148
|
}
|
@@ -17,12 +17,12 @@ export default (labelVisibility, styles) => {
|
|
17
17
|
return styles.withLabelVisibleXl;
|
18
18
|
}
|
19
19
|
|
20
|
-
if (labelVisibility === '
|
21
|
-
return styles.
|
20
|
+
if (labelVisibility === 'x2l') {
|
21
|
+
return styles.withLabelVisibleX2l;
|
22
22
|
}
|
23
23
|
|
24
|
-
if (labelVisibility === '
|
25
|
-
return styles.
|
24
|
+
if (labelVisibility === 'x3l') {
|
25
|
+
return styles.withLabelVisibleX3l;
|
26
26
|
}
|
27
27
|
|
28
28
|
if (labelVisibility === 'none') {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import PropTypes from 'prop-types';
|
2
2
|
import React from 'react';
|
3
|
-
import {
|
3
|
+
import { withGlobalProps } from '../../provider';
|
4
4
|
import { classNames } from '../../utils/classNames';
|
5
5
|
import { isChildrenEmpty } from '../_helpers/isChildrenEmpty';
|
6
6
|
import styles from './ButtonGroup.scss';
|
@@ -10,6 +10,7 @@ export const ButtonGroup = ({
|
|
10
10
|
block,
|
11
11
|
disabled,
|
12
12
|
children,
|
13
|
+
id,
|
13
14
|
priority,
|
14
15
|
size,
|
15
16
|
...restProps
|
@@ -24,6 +25,7 @@ export const ButtonGroup = ({
|
|
24
25
|
styles.root,
|
25
26
|
block && styles.isRootBlock,
|
26
27
|
)}
|
28
|
+
id={id}
|
27
29
|
role="group"
|
28
30
|
{...restProps}
|
29
31
|
>
|
@@ -45,6 +47,7 @@ ButtonGroup.defaultProps = {
|
|
45
47
|
block: false,
|
46
48
|
children: null,
|
47
49
|
disabled: false,
|
50
|
+
id: undefined,
|
48
51
|
priority: 'filled',
|
49
52
|
size: 'medium',
|
50
53
|
};
|
@@ -62,6 +65,10 @@ ButtonGroup.propTypes = {
|
|
62
65
|
* If `true`, all buttons inside the group will be disabled.
|
63
66
|
*/
|
64
67
|
disabled: PropTypes.bool,
|
68
|
+
/**
|
69
|
+
* ID of the root HTML element.
|
70
|
+
*/
|
71
|
+
id: PropTypes.string,
|
65
72
|
/**
|
66
73
|
* Visual priority to highlight or suppress the buttons.
|
67
74
|
*/
|
@@ -72,6 +79,6 @@ ButtonGroup.propTypes = {
|
|
72
79
|
size: PropTypes.oneOf(['small', 'medium', 'large']),
|
73
80
|
};
|
74
81
|
|
75
|
-
export const
|
82
|
+
export const ButtonGroupWithGlobalProps = withGlobalProps(ButtonGroup, 'ButtonGroup');
|
76
83
|
|
77
|
-
export default
|
84
|
+
export default ButtonGroupWithGlobalProps;
|
@@ -221,7 +221,7 @@ and communicating the state of individual options.
|
|
221
221
|
<Playground>
|
222
222
|
<>
|
223
223
|
<span id="period-label">Period:</span>
|
224
|
-
<ButtonGroup aria-labelledby="
|
224
|
+
<ButtonGroup aria-labelledby="period-label">
|
225
225
|
<Button label="Week" aria-pressed color="dark" />
|
226
226
|
<Button label="Month" aria-pressed={false} />
|
227
227
|
<Button label="Year" aria-pressed={false} />
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import PropTypes from 'prop-types';
|
2
2
|
import React from 'react';
|
3
|
-
import {
|
3
|
+
import { withGlobalProps } from '../../provider';
|
4
4
|
import { classNames } from '../../utils/classNames';
|
5
5
|
import { getRootColorClassName } from '../_helpers/getRootColorClassName';
|
6
6
|
import styles from './Card.scss';
|
@@ -67,6 +67,6 @@ Card.propTypes = {
|
|
67
67
|
raised: PropTypes.bool,
|
68
68
|
};
|
69
69
|
|
70
|
-
export const
|
70
|
+
export const CardWithGlobalProps = withGlobalProps(Card, 'Card');
|
71
71
|
|
72
|
-
export default
|
72
|
+
export default CardWithGlobalProps;
|
@@ -1,21 +1,32 @@
|
|
1
1
|
import PropTypes from 'prop-types';
|
2
2
|
import React from 'react';
|
3
|
-
import {
|
3
|
+
import { withGlobalProps } from '../../provider';
|
4
4
|
import styles from './Card.scss';
|
5
5
|
|
6
|
-
export const CardBody = ({
|
7
|
-
|
6
|
+
export const CardBody = ({
|
7
|
+
children,
|
8
|
+
id,
|
9
|
+
}) => (
|
10
|
+
<div className={styles.body} id={id}>
|
8
11
|
{children}
|
9
12
|
</div>
|
10
13
|
);
|
11
14
|
|
15
|
+
CardBody.defaultProps = {
|
16
|
+
id: undefined,
|
17
|
+
};
|
18
|
+
|
12
19
|
CardBody.propTypes = {
|
13
20
|
/**
|
14
21
|
* Content of the card.
|
15
22
|
*/
|
16
23
|
children: PropTypes.node.isRequired,
|
24
|
+
/**
|
25
|
+
* ID of the root HTML element.
|
26
|
+
*/
|
27
|
+
id: PropTypes.string,
|
17
28
|
};
|
18
29
|
|
19
|
-
export const
|
30
|
+
export const CardBodyWithGlobalProps = withGlobalProps(CardBody, 'CardBody');
|
20
31
|
|
21
|
-
export default
|
32
|
+
export default CardBodyWithGlobalProps;
|
@@ -1,16 +1,19 @@
|
|
1
1
|
import PropTypes from 'prop-types';
|
2
2
|
import React from 'react';
|
3
|
-
import {
|
3
|
+
import { withGlobalProps } from '../../provider';
|
4
4
|
import { isChildrenEmpty } from '../_helpers/isChildrenEmpty';
|
5
5
|
import styles from './Card.scss';
|
6
6
|
|
7
|
-
export const CardFooter = ({
|
7
|
+
export const CardFooter = ({
|
8
|
+
children,
|
9
|
+
id,
|
10
|
+
}) => {
|
8
11
|
if (isChildrenEmpty(children)) {
|
9
12
|
return null;
|
10
13
|
}
|
11
14
|
|
12
15
|
return (
|
13
|
-
<div className={styles.footer}>
|
16
|
+
<div className={styles.footer} id={id}>
|
14
17
|
{children}
|
15
18
|
</div>
|
16
19
|
);
|
@@ -18,6 +21,7 @@ export const CardFooter = ({ children }) => {
|
|
18
21
|
|
19
22
|
CardFooter.defaultProps = {
|
20
23
|
children: null,
|
24
|
+
id: undefined,
|
21
25
|
};
|
22
26
|
|
23
27
|
CardFooter.propTypes = {
|
@@ -25,8 +29,12 @@ CardFooter.propTypes = {
|
|
25
29
|
* Card actions, usually buttons.
|
26
30
|
*/
|
27
31
|
children: PropTypes.node,
|
32
|
+
/**
|
33
|
+
* ID of the root HTML element.
|
34
|
+
*/
|
35
|
+
id: PropTypes.string,
|
28
36
|
};
|
29
37
|
|
30
|
-
export const
|
38
|
+
export const CardFooterWithGlobalProps = withGlobalProps(CardFooter, 'CardFooter');
|
31
39
|
|
32
|
-
export default
|
40
|
+
export default CardFooterWithGlobalProps;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import PropTypes from 'prop-types';
|
2
2
|
import React, { useContext } from 'react';
|
3
|
-
import {
|
3
|
+
import { withGlobalProps } from '../../provider';
|
4
4
|
import { classNames } from '../../utils/classNames';
|
5
5
|
import { getRootValidationStateClassName } from '../_helpers/getRootValidationStateClassName';
|
6
6
|
import { transferProps } from '../_helpers/transferProps';
|
@@ -160,6 +160,6 @@ CheckboxField.propTypes = {
|
|
160
160
|
]),
|
161
161
|
};
|
162
162
|
|
163
|
-
export const
|
163
|
+
export const CheckboxFieldWithGlobalProps = withForwardedRef(withGlobalProps(CheckboxField, 'CheckboxField'));
|
164
164
|
|
165
|
-
export default
|
165
|
+
export default CheckboxFieldWithGlobalProps;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import PropTypes from 'prop-types';
|
2
2
|
import React, { useContext } from 'react';
|
3
|
-
import {
|
3
|
+
import { withGlobalProps } from '../../provider';
|
4
4
|
import { classNames } from '../../utils/classNames';
|
5
5
|
import { getRootValidationStateClassName } from '../_helpers/getRootValidationStateClassName';
|
6
6
|
import { resolveContextOrProp } from '../_helpers/resolveContextOrProp';
|
@@ -158,6 +158,6 @@ FileInputField.propTypes = {
|
|
158
158
|
validationText: PropTypes.node,
|
159
159
|
};
|
160
160
|
|
161
|
-
export const
|
161
|
+
export const FileInputFieldWithGlobalProps = withForwardedRef(withGlobalProps(FileInputField, 'FileInputField'));
|
162
162
|
|
163
|
-
export default
|
163
|
+
export default FileInputFieldWithGlobalProps;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import PropTypes from 'prop-types';
|
2
2
|
import React from 'react';
|
3
|
-
import {
|
3
|
+
import { withGlobalProps } from '../../provider';
|
4
4
|
import { classNames } from '../../utils/classNames';
|
5
5
|
import { isChildrenEmpty } from '../_helpers/isChildrenEmpty';
|
6
6
|
import { FormLayoutContext } from './FormLayoutContext';
|
@@ -110,6 +110,6 @@ FormLayout.propTypes = {
|
|
110
110
|
]),
|
111
111
|
};
|
112
112
|
|
113
|
-
export const
|
113
|
+
export const FormLayoutWithGlobalProps = withGlobalProps(FormLayout, 'FormLayout');
|
114
114
|
|
115
|
-
export default
|
115
|
+
export default FormLayoutWithGlobalProps;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import PropTypes from 'prop-types';
|
2
2
|
import React, { useContext } from 'react';
|
3
|
-
import {
|
3
|
+
import { withGlobalProps } from '../../provider';
|
4
4
|
import { classNames } from '../../utils/classNames';
|
5
5
|
import { getRootSizeClassName } from '../_helpers/getRootSizeClassName';
|
6
6
|
import { getRootValidationStateClassName } from '../_helpers/getRootValidationStateClassName';
|
@@ -131,6 +131,6 @@ FormLayoutCustomField.propTypes = {
|
|
131
131
|
validationState: PropTypes.oneOf(['invalid', 'valid', 'warning']),
|
132
132
|
};
|
133
133
|
|
134
|
-
export const
|
134
|
+
export const FormLayoutCustomFieldWithGlobalProps = withGlobalProps(FormLayoutCustomField, 'FormLayoutCustomField');
|
135
135
|
|
136
|
-
export default
|
136
|
+
export default FormLayoutCustomFieldWithGlobalProps;
|
@@ -75,10 +75,9 @@ there are longer validation messages or help texts.
|
|
75
75
|
|
76
76
|
## Vertical Layout
|
77
77
|
|
78
|
-
Vertical FormLayout works similar to
|
79
|
-
|
80
|
-
|
81
|
-
simply wrap your form fields with the FormLayout component:
|
78
|
+
Vertical FormLayout works similar to single-column [Grid](/components/grid)
|
79
|
+
layout while it also forces vertical layout mode on form fields. To use this
|
80
|
+
layout, simply wrap your form fields with the FormLayout component:
|
82
81
|
|
83
82
|
<Playground>
|
84
83
|
<FormLayout>
|
@@ -143,7 +142,7 @@ with CSS custom properties.
|
|
143
142
|
<span id="label-width-options-label">Label width:</span>
|
144
143
|
</ToolbarItem>
|
145
144
|
<ToolbarItem>
|
146
|
-
<ButtonGroup aria-labelledby="
|
145
|
+
<ButtonGroup aria-labelledby="label-width-options-label">
|
147
146
|
<Button
|
148
147
|
color={labelWidth === 'default' ? 'dark' : 'primary'}
|
149
148
|
label="default"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import PropTypes from 'prop-types';
|
2
2
|
import React from 'react';
|
3
|
-
import {
|
3
|
+
import { withGlobalProps } from '../../provider';
|
4
4
|
import { isChildrenEmpty } from '../_helpers/isChildrenEmpty';
|
5
5
|
import { generateResponsiveCustomProperties } from './_helpers/generateResponsiveCustomProperties';
|
6
6
|
import styles from './Grid.scss';
|
@@ -77,8 +77,8 @@ Grid.propTypes = {
|
|
77
77
|
md: PropTypes.string,
|
78
78
|
lg: PropTypes.string,
|
79
79
|
xl: PropTypes.string,
|
80
|
-
|
81
|
-
|
80
|
+
x2l: PropTypes.string,
|
81
|
+
x3l: PropTypes.string,
|
82
82
|
}),
|
83
83
|
]),
|
84
84
|
/**
|
@@ -93,8 +93,8 @@ Grid.propTypes = {
|
|
93
93
|
md: PropTypes.string,
|
94
94
|
lg: PropTypes.string,
|
95
95
|
xl: PropTypes.string,
|
96
|
-
|
97
|
-
|
96
|
+
x2l: PropTypes.string,
|
97
|
+
x3l: PropTypes.string,
|
98
98
|
}),
|
99
99
|
]),
|
100
100
|
/**
|
@@ -109,8 +109,8 @@ Grid.propTypes = {
|
|
109
109
|
md: PropTypes.string,
|
110
110
|
lg: PropTypes.string,
|
111
111
|
xl: PropTypes.string,
|
112
|
-
|
113
|
-
|
112
|
+
x2l: PropTypes.string,
|
113
|
+
x3l: PropTypes.string,
|
114
114
|
}),
|
115
115
|
]),
|
116
116
|
/**
|
@@ -129,8 +129,8 @@ Grid.propTypes = {
|
|
129
129
|
md: PropTypes.string,
|
130
130
|
lg: PropTypes.string,
|
131
131
|
xl: PropTypes.string,
|
132
|
-
|
133
|
-
|
132
|
+
x2l: PropTypes.string,
|
133
|
+
x3l: PropTypes.string,
|
134
134
|
}),
|
135
135
|
]),
|
136
136
|
/**
|
@@ -145,8 +145,8 @@ Grid.propTypes = {
|
|
145
145
|
md: PropTypes.string,
|
146
146
|
lg: PropTypes.string,
|
147
147
|
xl: PropTypes.string,
|
148
|
-
|
149
|
-
|
148
|
+
x2l: PropTypes.string,
|
149
|
+
x3l: PropTypes.string,
|
150
150
|
}),
|
151
151
|
]),
|
152
152
|
/**
|
@@ -165,8 +165,8 @@ Grid.propTypes = {
|
|
165
165
|
md: PropTypes.string,
|
166
166
|
lg: PropTypes.string,
|
167
167
|
xl: PropTypes.string,
|
168
|
-
|
169
|
-
|
168
|
+
x2l: PropTypes.string,
|
169
|
+
x3l: PropTypes.string,
|
170
170
|
}),
|
171
171
|
]),
|
172
172
|
/**
|
@@ -181,8 +181,8 @@ Grid.propTypes = {
|
|
181
181
|
md: PropTypes.string,
|
182
182
|
lg: PropTypes.string,
|
183
183
|
xl: PropTypes.string,
|
184
|
-
|
185
|
-
|
184
|
+
x2l: PropTypes.string,
|
185
|
+
x3l: PropTypes.string,
|
186
186
|
}),
|
187
187
|
]),
|
188
188
|
/**
|
@@ -197,8 +197,8 @@ Grid.propTypes = {
|
|
197
197
|
md: PropTypes.string,
|
198
198
|
lg: PropTypes.string,
|
199
199
|
xl: PropTypes.string,
|
200
|
-
|
201
|
-
|
200
|
+
x2l: PropTypes.string,
|
201
|
+
x3l: PropTypes.string,
|
202
202
|
}),
|
203
203
|
]),
|
204
204
|
/**
|
@@ -213,8 +213,8 @@ Grid.propTypes = {
|
|
213
213
|
md: PropTypes.string,
|
214
214
|
lg: PropTypes.string,
|
215
215
|
xl: PropTypes.string,
|
216
|
-
|
217
|
-
|
216
|
+
x2l: PropTypes.string,
|
217
|
+
x3l: PropTypes.string,
|
218
218
|
}),
|
219
219
|
]),
|
220
220
|
/**
|
@@ -224,6 +224,6 @@ Grid.propTypes = {
|
|
224
224
|
tag: PropTypes.string,
|
225
225
|
};
|
226
226
|
|
227
|
-
export const
|
227
|
+
export const GridWithGlobalProps = withGlobalProps(Grid, 'Grid');
|
228
228
|
|
229
|
-
export default
|
229
|
+
export default GridWithGlobalProps;
|
@@ -40,6 +40,11 @@
|
|
40
40
|
justify-items: var(--rui-local-justify-items, #{map.get(theme.$responsive-properties, justify-items)}); // 2.
|
41
41
|
}
|
42
42
|
|
43
|
+
// stylelint-disable-next-line selector-max-universal -- Reset any previously added margins.
|
44
|
+
.root > * {
|
45
|
+
margin-block: 0;
|
46
|
+
}
|
47
|
+
|
43
48
|
.span {
|
44
49
|
$responsive-properties: (
|
45
50
|
column-span: 1,
|
@@ -58,5 +63,6 @@ ol.root,
|
|
58
63
|
ul.root {
|
59
64
|
padding-left: 0;
|
60
65
|
margin-left: 0;
|
66
|
+
list-style: none;
|
61
67
|
}
|
62
68
|
// stylelint-enable selector-no-qualifying-type
|