@react-ui-org/react-ui 0.44.0 → 0.46.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/CONTRIBUTING.md +7 -0
- package/dist/lib.development.js +209 -305
- package/dist/lib.js +1 -1
- package/package.json +10 -13
- package/src/lib/components/Alert/Alert.jsx +4 -3
- package/src/lib/components/Alert/Alert.scss +48 -48
- package/src/lib/components/Alert/_settings.scss +4 -4
- package/src/lib/components/Alert/_theme.scss +50 -50
- package/src/lib/components/Alert/_tools.scss +6 -6
- package/src/lib/components/Badge/Badge.jsx +6 -8
- package/src/lib/components/Badge/Badge.scss +57 -57
- package/src/lib/components/Button/Button.jsx +10 -9
- package/src/lib/components/Button/Button.scss +2 -2
- package/src/lib/components/Button/README.mdx +8 -3
- package/src/lib/components/Button/_base.scss +65 -65
- package/src/lib/components/Button/_priorities.scss +49 -49
- package/src/lib/components/Button/_settings.scss +10 -10
- package/src/lib/components/Button/_theme.scss +18 -15
- package/src/lib/components/Button/_tools.scss +98 -100
- package/src/lib/components/ButtonGroup/ButtonGroup.jsx +31 -22
- package/src/lib/components/ButtonGroup/ButtonGroup.scss +3 -3
- package/src/lib/components/ButtonGroup/README.mdx +4 -4
- package/src/lib/components/Card/Card.jsx +7 -6
- package/src/lib/components/Card/Card.scss +28 -28
- package/src/lib/components/Card/CardBody.jsx +5 -11
- package/src/lib/components/Card/CardFooter.jsx +10 -5
- package/src/lib/components/Card/README.mdx +2 -2
- package/src/lib/components/Card/_theme.scss +50 -50
- package/src/lib/components/Card/_tools.scss +6 -6
- package/src/lib/components/CheckboxField/CheckboxField.jsx +18 -17
- package/src/lib/components/CheckboxField/CheckboxField.scss +20 -20
- package/src/lib/components/CheckboxField/README.mdx +3 -3
- package/src/lib/components/FileInputField/FileInputField.jsx +13 -12
- package/src/lib/components/FileInputField/FileInputField.scss +19 -19
- package/src/lib/components/FileInputField/README.mdx +1 -1
- package/src/lib/components/FormLayout/FormLayout.jsx +16 -14
- package/src/lib/components/FormLayout/FormLayout.scss +17 -17
- package/src/lib/components/FormLayout/FormLayoutCustomField.jsx +15 -9
- package/src/lib/components/FormLayout/FormLayoutCustomField.scss +18 -18
- package/src/lib/components/FormLayout/README.mdx +27 -49
- package/src/lib/components/Grid/Grid.jsx +4 -3
- package/src/lib/components/Grid/Grid.scss +32 -23
- package/src/lib/components/Grid/GridSpan.jsx +4 -3
- package/src/lib/components/Grid/{helpers → _helpers}/generateResponsiveCustomProperties.js +0 -2
- package/src/lib/components/Grid/_theme.scss +9 -9
- package/src/lib/components/Grid/_tools.scss +20 -20
- package/src/lib/components/List/List.jsx +14 -12
- package/src/lib/components/List/List.scss +21 -21
- package/src/lib/components/List/ListItem.jsx +3 -2
- package/src/lib/components/List/README.mdx +1 -1
- package/src/lib/components/Media/Media.jsx +12 -5
- package/src/lib/components/Media/Media.scss +6 -6
- package/src/lib/components/Media/MediaBody.jsx +18 -7
- package/src/lib/components/Media/MediaObject.jsx +18 -7
- package/src/lib/components/Modal/Modal.jsx +8 -6
- package/src/lib/components/Modal/Modal.scss +73 -73
- package/src/lib/components/Modal/README.mdx +2 -2
- package/src/lib/components/Modal/_settings.scss +5 -5
- package/src/lib/components/Modal/_theme.scss +17 -17
- package/src/lib/components/Paper/Paper.jsx +6 -6
- package/src/lib/components/Paper/Paper.scss +8 -8
- package/src/lib/components/Paper/README.mdx +1 -1
- package/src/lib/components/Radio/README.mdx +4 -4
- package/src/lib/components/Radio/Radio.jsx +12 -11
- package/src/lib/components/Radio/Radio.scss +26 -26
- package/src/lib/components/ScrollView/README.mdx +4 -1
- package/src/lib/components/ScrollView/ScrollView.jsx +11 -9
- package/src/lib/components/ScrollView/ScrollView.scss +113 -113
- package/src/lib/{services/elementPositionService.js → components/ScrollView/_helpers/getElementsPositionDifference.js} +0 -2
- package/src/lib/{hooks → components/ScrollView/_hooks}/useLoadResizeHook.js +1 -1
- package/src/lib/{hooks → components/ScrollView/_hooks}/useScrollPositionHook.js +1 -1
- package/src/lib/components/SelectField/README.mdx +4 -4
- package/src/lib/components/SelectField/SelectField.jsx +14 -13
- package/src/lib/components/SelectField/SelectField.scss +30 -30
- package/src/lib/components/Table/README.mdx +3 -3
- package/src/lib/components/Table/Table.scss +28 -35
- package/src/lib/components/Table/_settings.scss +5 -5
- package/src/lib/components/Tabs/README.mdx +1 -1
- package/src/lib/components/Tabs/Tabs.jsx +1 -2
- package/src/lib/components/Tabs/Tabs.scss +21 -21
- package/src/lib/components/Tabs/TabsItem.jsx +4 -3
- package/src/lib/components/Tabs/TabsItem.scss +78 -78
- package/src/lib/components/Text/README.mdx +1 -1
- package/src/lib/components/Text/Text.jsx +13 -6
- package/src/lib/components/Text/Text.scss +23 -13
- package/src/lib/components/Text/_helpers/getRootClampClassName.js +11 -0
- package/src/lib/components/Text/{helpers → _helpers}/getRootHyphensClassName.js +1 -1
- package/src/lib/components/Text/{helpers → _helpers}/getRootWordWrappingClassName.js +1 -1
- package/src/lib/components/TextArea/README.mdx +1 -1
- package/src/lib/components/TextArea/TextArea.jsx +18 -14
- package/src/lib/components/TextArea/TextArea.scss +27 -27
- package/src/lib/components/TextField/README.mdx +1 -1
- package/src/lib/components/TextField/TextField.jsx +16 -14
- package/src/lib/components/TextField/TextField.scss +28 -28
- package/src/lib/components/TextLink/README.mdx +77 -0
- package/src/lib/components/{Link/Link.jsx → TextLink/TextLink.jsx} +12 -13
- package/src/lib/components/TextLink/TextLink.scss +11 -0
- package/src/lib/components/TextLink/_theme.scss +4 -0
- package/src/lib/components/TextLink/index.js +1 -0
- package/src/lib/components/Toggle/README.mdx +3 -3
- package/src/lib/components/Toggle/Toggle.jsx +18 -17
- package/src/lib/components/Toggle/Toggle.scss +20 -20
- package/src/lib/components/Toolbar/README.mdx +19 -3
- package/src/lib/components/Toolbar/Toolbar.jsx +23 -14
- package/src/lib/components/Toolbar/Toolbar.scss +35 -30
- package/src/lib/components/Toolbar/ToolbarGroup.jsx +18 -13
- package/src/lib/components/Toolbar/ToolbarItem.jsx +26 -7
- package/src/lib/{helpers → components/_helpers}/getRootColorClassName.js +1 -1
- package/src/lib/{helpers → components/_helpers}/getRootSizeClassName.js +1 -1
- package/src/lib/{helpers → components/_helpers}/getRootValidationStateClassName.js +1 -1
- package/src/lib/components/_helpers/isChildrenEmpty.js +3 -0
- package/src/lib/{helpers → components/_helpers}/resolveContextOrProp.js +0 -0
- package/src/lib/{utils → components/_helpers}/transferProps.js +1 -1
- package/src/lib/foundation.scss +11 -11
- package/src/lib/helpers.scss +2 -2
- package/src/lib/index.js +4 -8
- package/src/lib/styles/_utilities.scss +13 -13
- package/src/lib/styles/elements/_code.scss +7 -7
- package/src/lib/styles/elements/_links.scss +8 -8
- package/src/lib/styles/elements/_lists.scss +3 -3
- package/src/lib/styles/elements/_page.scss +14 -14
- package/src/lib/styles/elements/_rulers.scss +6 -6
- package/src/lib/styles/elements/_small.scss +2 -2
- package/src/lib/styles/generic/_box-sizing.scss +3 -2
- package/src/lib/styles/generic/_forms.scss +3 -3
- package/src/lib/styles/generic/_reset.scss +6 -6
- package/src/lib/styles/generic/_shared.scss +3 -3
- package/src/lib/styles/helpers/_animation.scss +8 -8
- package/src/lib/styles/settings/_breakpoints.scss +7 -7
- package/src/lib/styles/settings/_escaped-characters.scss +5 -5
- package/src/lib/styles/settings/_form-fields.scss +24 -24
- package/src/lib/styles/settings/_utilities.scss +112 -100
- package/src/lib/styles/theme/_colors.scss +50 -50
- package/src/lib/styles/theme/_form-fields.scss +32 -32
- package/src/lib/styles/theme/_spacing.scss +11 -11
- package/src/lib/styles/theme/_typography.scss +12 -11
- package/src/lib/styles/theme-constants/_breakpoints.scss +2 -2
- package/src/lib/styles/theme-constants/_colors.scss +2 -2
- package/src/lib/styles/theme-constants/_svg.scss +1 -2
- package/src/lib/styles/tools/_accessibility.scss +29 -29
- package/src/lib/styles/tools/_breakpoint.scss +11 -14
- package/src/lib/styles/tools/_caret.scss +8 -8
- package/src/lib/styles/tools/_colors.scss +3 -3
- package/src/lib/styles/tools/_reset.scss +24 -21
- package/src/lib/styles/tools/_scrollbar.scss +4 -4
- package/src/lib/styles/tools/_spacing.scss +17 -21
- package/src/lib/styles/tools/_string.scss +9 -9
- package/src/lib/styles/tools/_svg.scss +13 -16
- package/src/lib/styles/tools/_transition.scss +42 -44
- package/src/lib/styles/tools/_utilities.scss +19 -19
- package/src/lib/styles/tools/form-fields/_box-field-elements.scss +88 -88
- package/src/lib/styles/tools/form-fields/_box-field-layout.scss +147 -147
- package/src/lib/styles/tools/form-fields/_box-field-sizes.scss +13 -15
- package/src/lib/styles/tools/form-fields/_foundation.scss +12 -12
- package/src/lib/styles/tools/form-fields/_inline-field-elements.scss +82 -71
- package/src/lib/styles/tools/form-fields/_inline-field-layout.scss +88 -47
- package/src/lib/styles/tools/form-fields/_variants.scss +104 -106
- package/src/lib/theme.scss +958 -954
- package/src/lib/utils/classNames.js +8 -0
- package/src/lib/components/CTA/CTA.jsx +0 -60
- package/src/lib/components/CTA/CTA.scss +0 -71
- package/src/lib/components/CTA/CTACenter.jsx +0 -27
- package/src/lib/components/CTA/CTAEnd.jsx +0 -27
- package/src/lib/components/CTA/CTAStart.jsx +0 -27
- package/src/lib/components/CTA/README.mdx +0 -119
- package/src/lib/components/CTA/index.js +0 -4
- package/src/lib/components/Center/Center.jsx +0 -27
- package/src/lib/components/Center/Center.scss +0 -7
- package/src/lib/components/Center/README.mdx +0 -52
- package/src/lib/components/Center/index.js +0 -1
- package/src/lib/components/Link/Link.scss +0 -11
- package/src/lib/components/Link/README.mdx +0 -85
- package/src/lib/components/Link/_theme.scss +0 -4
- package/src/lib/components/Link/index.js +0 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
@use
|
|
1
|
+
@use "../../styles/tools/spacing";
|
|
2
2
|
|
|
3
3
|
.media {
|
|
4
|
-
|
|
4
|
+
@include spacing.bottom(layouts);
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: flex-start;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
.object {
|
|
11
|
-
|
|
11
|
+
margin-right: spacing.of(3);
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
.body {
|
|
15
|
-
|
|
15
|
+
flex: 1;
|
|
16
16
|
}
|
|
@@ -1,19 +1,30 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { withProviderContext } from '../../provider';
|
|
4
|
+
import { isChildrenEmpty } from '../_helpers/isChildrenEmpty';
|
|
4
5
|
import styles from './Media.scss';
|
|
5
6
|
|
|
6
|
-
export const MediaBody = ({ children }) =>
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
export const MediaBody = ({ children }) => {
|
|
8
|
+
if (isChildrenEmpty(children)) {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<div className={styles.body}>
|
|
14
|
+
{children}
|
|
15
|
+
</div>
|
|
16
|
+
);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
MediaBody.defaultProps = {
|
|
20
|
+
children: null,
|
|
21
|
+
};
|
|
11
22
|
|
|
12
23
|
MediaBody.propTypes = {
|
|
13
24
|
/**
|
|
14
|
-
* Content of the media layout.
|
|
25
|
+
* Content of the media layout. If none are provided nothing is rendered.
|
|
15
26
|
*/
|
|
16
|
-
children: PropTypes.node
|
|
27
|
+
children: PropTypes.node,
|
|
17
28
|
};
|
|
18
29
|
|
|
19
30
|
export const MediaBodyWithContext = withProviderContext(MediaBody, 'MediaBody');
|
|
@@ -1,19 +1,30 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { withProviderContext } from '../../provider';
|
|
4
|
+
import { isChildrenEmpty } from '../_helpers/isChildrenEmpty';
|
|
4
5
|
import styles from './Media.scss';
|
|
5
6
|
|
|
6
|
-
export const MediaObject = ({ children }) =>
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
export const MediaObject = ({ children }) => {
|
|
8
|
+
if (isChildrenEmpty(children)) {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<div className={styles.object}>
|
|
14
|
+
{children}
|
|
15
|
+
</div>
|
|
16
|
+
);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
MediaObject.defaultProps = {
|
|
20
|
+
children: null,
|
|
21
|
+
};
|
|
11
22
|
|
|
12
23
|
MediaObject.propTypes = {
|
|
13
24
|
/**
|
|
14
|
-
* Accompanying media object for the Media layout, eg. an image.
|
|
25
|
+
* Accompanying media object for the Media layout, eg. an image. If none are provided nothing is rendered.
|
|
15
26
|
*/
|
|
16
|
-
children: PropTypes.node
|
|
27
|
+
children: PropTypes.node,
|
|
17
28
|
};
|
|
18
29
|
|
|
19
30
|
export const MediaObjectWithContext = withProviderContext(MediaObject, 'MediaObject');
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { createPortal } from 'react-dom';
|
|
4
|
-
import transferProps from '../../utils/transferProps';
|
|
5
4
|
import { withProviderContext } from '../../provider';
|
|
5
|
+
import { classNames } from '../../utils/classNames';
|
|
6
|
+
import { transferProps } from '../_helpers/transferProps';
|
|
6
7
|
import {
|
|
7
8
|
Toolbar,
|
|
8
9
|
ToolbarItem,
|
|
@@ -125,10 +126,10 @@ export class Modal extends React.Component {
|
|
|
125
126
|
if (scrollView) {
|
|
126
127
|
return (
|
|
127
128
|
<div
|
|
128
|
-
className={
|
|
129
|
+
className={classNames(
|
|
129
130
|
styles.body,
|
|
130
131
|
styles.isBodyScrollable,
|
|
131
|
-
|
|
132
|
+
)}
|
|
132
133
|
>
|
|
133
134
|
{React.cloneElement(scrollView, scrollView.props, content)}
|
|
134
135
|
</div>
|
|
@@ -154,11 +155,11 @@ export class Modal extends React.Component {
|
|
|
154
155
|
role="presentation"
|
|
155
156
|
>
|
|
156
157
|
<div
|
|
157
|
-
className={
|
|
158
|
+
className={classNames(
|
|
158
159
|
styles.root,
|
|
159
160
|
sizeClass(size),
|
|
160
161
|
positionClass(position),
|
|
161
|
-
|
|
162
|
+
)}
|
|
162
163
|
onClick={(e) => {
|
|
163
164
|
e.stopPropagation();
|
|
164
165
|
}}
|
|
@@ -234,6 +235,7 @@ export class Modal extends React.Component {
|
|
|
234
235
|
Modal.defaultProps = {
|
|
235
236
|
actions: [],
|
|
236
237
|
autoFocus: true,
|
|
238
|
+
children: null,
|
|
237
239
|
id: undefined,
|
|
238
240
|
onClose: null,
|
|
239
241
|
portalId: null,
|
|
@@ -265,7 +267,7 @@ Modal.propTypes = {
|
|
|
265
267
|
/**
|
|
266
268
|
* Content of the modal.
|
|
267
269
|
*/
|
|
268
|
-
children: PropTypes.node
|
|
270
|
+
children: PropTypes.node,
|
|
269
271
|
/**
|
|
270
272
|
* ID of the root HTML element. It also serves as a base for nested elements:
|
|
271
273
|
* * `<ID>__content`
|
|
@@ -1,126 +1,126 @@
|
|
|
1
|
-
@use
|
|
2
|
-
@use
|
|
3
|
-
@use
|
|
4
|
-
@use
|
|
5
|
-
@use
|
|
6
|
-
@use
|
|
7
|
-
@use
|
|
8
|
-
@use
|
|
1
|
+
@use "sass:map";
|
|
2
|
+
@use "../../styles/theme/typography";
|
|
3
|
+
@use "../../styles/tools/accessibility";
|
|
4
|
+
@use "../../styles/tools/breakpoint";
|
|
5
|
+
@use "../../styles/tools/reset";
|
|
6
|
+
@use "../../styles/tools/spacing";
|
|
7
|
+
@use "settings";
|
|
8
|
+
@use "theme";
|
|
9
9
|
|
|
10
10
|
.root {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
11
|
+
--rui-local-outer-spacing: #{theme.$outer-spacing-xs};
|
|
12
|
+
|
|
13
|
+
position: fixed;
|
|
14
|
+
left: 50%;
|
|
15
|
+
z-index: settings.$z-index;
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
max-width: calc(100% - (2 * var(--rui-local-outer-spacing)));
|
|
19
|
+
max-height: calc(100% - (2 * var(--rui-local-outer-spacing)));
|
|
20
|
+
overflow-y: auto;
|
|
21
|
+
border-radius: settings.$border-radius;
|
|
22
|
+
background: theme.$background;
|
|
23
|
+
box-shadow: theme.$box-shadow;
|
|
24
|
+
transform: translateX(-50%);
|
|
25
|
+
|
|
26
|
+
@include breakpoint.up(sm) {
|
|
27
|
+
--rui-local-outer-spacing: #{theme.$outer-spacing-sm};
|
|
28
|
+
}
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
.head {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
display: flex;
|
|
33
|
+
flex: none;
|
|
34
|
+
align-items: baseline;
|
|
35
|
+
justify-content: space-between;
|
|
36
|
+
padding: settings.$padding-y spacing.of(4) settings.$padding-y settings.$padding-x;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
.headTitle {
|
|
40
|
-
|
|
40
|
+
font-size: settings.$head-title-font-size;
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
&:not(:last-child) {
|
|
43
|
+
margin-bottom: 0;
|
|
44
|
+
}
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
.close {
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
@include reset.button();
|
|
49
|
+
@include accessibility.min-tap-target();
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
font-size: map.get(typography.$size-values, 3);
|
|
52
|
+
line-height: 1;
|
|
53
|
+
color: inherit;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
.body {
|
|
57
|
-
|
|
57
|
+
flex: 1 1 auto;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
.isBodyScrollable {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
display: flex;
|
|
62
|
+
flex-direction: column;
|
|
63
|
+
min-height: 0;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
.content {
|
|
67
|
-
|
|
67
|
+
padding: settings.$padding-y settings.$padding-x settings.$content-padding-bottom;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
.footer {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
71
|
+
display: flex;
|
|
72
|
+
flex: none;
|
|
73
|
+
flex-wrap: wrap;
|
|
74
|
+
align-items: center;
|
|
75
|
+
justify-content: center;
|
|
76
|
+
padding: settings.$padding-y settings.$padding-x;
|
|
77
|
+
border-bottom-right-radius: settings.$border-radius;
|
|
78
|
+
border-bottom-left-radius: settings.$border-radius;
|
|
79
|
+
background: theme.$footer-background;
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
.backdrop {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
83
|
+
position: fixed;
|
|
84
|
+
top: 0;
|
|
85
|
+
left: 0;
|
|
86
|
+
z-index: settings.$backdrop-z-index;
|
|
87
|
+
width: 100vw;
|
|
88
|
+
height: 100vh;
|
|
89
|
+
background: theme.$backdrop-background;
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
.isRootSizeSmall {
|
|
93
|
-
|
|
93
|
+
width: map.get(theme.$sizes, small, width);
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
.isRootSizeMedium {
|
|
97
|
-
|
|
97
|
+
width: map.get(theme.$sizes, medium, width);
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
.isRootSizeLarge {
|
|
101
|
-
|
|
101
|
+
width: map.get(theme.$sizes, large, width);
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
.isRootSizeFullscreen {
|
|
105
|
-
|
|
106
|
-
|
|
105
|
+
width: map.get(theme.$sizes, fullscreen, width);
|
|
106
|
+
height: map.get(theme.$sizes, fullscreen, height);
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
.isRootSizeFullscreen .content {
|
|
110
|
-
|
|
110
|
+
height: 100%;
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
.isRootSizeAuto {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
114
|
+
width: auto;
|
|
115
|
+
min-width: map.get(theme.$sizes, auto, min-width);
|
|
116
|
+
max-width: map.get(theme.$sizes, auto, max-width);
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
.isRootPositionCenter {
|
|
120
|
-
|
|
121
|
-
|
|
120
|
+
top: 50%;
|
|
121
|
+
transform: translate(-50%, -50%);
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
.isRootPositionTop {
|
|
125
|
-
|
|
125
|
+
top: var(--rui-local-outer-spacing);
|
|
126
126
|
}
|
|
@@ -155,7 +155,7 @@ On top of that, the modal is able to adjust to the width of its content.
|
|
|
155
155
|
|
|
156
156
|
👉 Please note the auto width may not function correctly in combination with
|
|
157
157
|
other auto layout mechanisms, e.g. the auto-width
|
|
158
|
-
[FormLayout](/components/
|
|
158
|
+
[FormLayout](/components/form-layout#label-width). It's just too much
|
|
159
159
|
magic that doesn't work together yet 🎩.
|
|
160
160
|
|
|
161
161
|
<Playground>
|
|
@@ -248,7 +248,7 @@ When modals become too long for the user's viewport or device, they scroll
|
|
|
248
248
|
independent of the page itself.
|
|
249
249
|
|
|
250
250
|
The inner implementation of body scrolling uses a partially
|
|
251
|
-
[customizable](#api) instance of the [ScrollView](/components/
|
|
251
|
+
[customizable](#api) instance of the [ScrollView](/components/scroll-view)
|
|
252
252
|
component.
|
|
253
253
|
|
|
254
254
|
<Playground>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
@use
|
|
2
|
-
@use
|
|
3
|
-
@use
|
|
4
|
-
@use
|
|
5
|
-
@use
|
|
1
|
+
@use "sass:map";
|
|
2
|
+
@use "../../styles/settings/z-indexes";
|
|
3
|
+
@use "../../styles/theme/borders";
|
|
4
|
+
@use "../../styles/theme/typography";
|
|
5
|
+
@use "../../styles/tools/spacing";
|
|
6
6
|
|
|
7
7
|
$padding-x: spacing.of(5);
|
|
8
8
|
$padding-y: spacing.of(3);
|
|
@@ -6,21 +6,21 @@ $outer-spacing-xs: var(--rui-Modal__outer-spacing--xs);
|
|
|
6
6
|
$outer-spacing-sm: var(--rui-Modal__outer-spacing--sm);
|
|
7
7
|
|
|
8
8
|
$sizes: (
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
9
|
+
auto: (
|
|
10
|
+
min-width: var(--rui-Modal--auto__min-width),
|
|
11
|
+
max-width: var(--rui-Modal--auto__max-width),
|
|
12
|
+
),
|
|
13
|
+
small: (
|
|
14
|
+
width: var(--rui-Modal--small__width),
|
|
15
|
+
),
|
|
16
|
+
medium: (
|
|
17
|
+
width: var(--rui-Modal--medium__width),
|
|
18
|
+
),
|
|
19
|
+
large: (
|
|
20
|
+
width: var(--rui-Modal--large__width),
|
|
21
|
+
),
|
|
22
|
+
fullscreen: (
|
|
23
|
+
width: var(--rui-Modal--fullscreen__width),
|
|
24
|
+
height: var(--rui-Modal--fullscreen__height),
|
|
25
|
+
),
|
|
26
26
|
);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { withProviderContext } from '../../provider';
|
|
4
|
+
import { classNames } from '../../utils/classNames';
|
|
4
5
|
import styles from './Paper.scss';
|
|
5
6
|
|
|
6
7
|
export const Paper = ({
|
|
@@ -10,11 +11,11 @@ export const Paper = ({
|
|
|
10
11
|
raised,
|
|
11
12
|
}) => (
|
|
12
13
|
<div
|
|
13
|
-
className={
|
|
14
|
+
className={classNames(
|
|
14
15
|
styles.root,
|
|
15
|
-
muted
|
|
16
|
-
raised
|
|
17
|
-
|
|
16
|
+
muted && styles.rootMuted,
|
|
17
|
+
raised && styles.rootRaised,
|
|
18
|
+
)}
|
|
18
19
|
id={id}
|
|
19
20
|
>
|
|
20
21
|
{children}
|
|
@@ -22,7 +23,6 @@ export const Paper = ({
|
|
|
22
23
|
);
|
|
23
24
|
|
|
24
25
|
Paper.defaultProps = {
|
|
25
|
-
children: null,
|
|
26
26
|
id: undefined,
|
|
27
27
|
muted: false,
|
|
28
28
|
raised: false,
|
|
@@ -32,7 +32,7 @@ Paper.propTypes = {
|
|
|
32
32
|
/**
|
|
33
33
|
* Content to be placed onto Paper.
|
|
34
34
|
*/
|
|
35
|
-
children: PropTypes.node,
|
|
35
|
+
children: PropTypes.node.isRequired,
|
|
36
36
|
/**
|
|
37
37
|
* ID of the root HTML element.
|
|
38
38
|
*/
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
@use
|
|
1
|
+
@use "theme";
|
|
2
2
|
|
|
3
3
|
.root {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
padding: theme.$padding;
|
|
5
|
+
border: theme.$border-width solid theme.$border-color;
|
|
6
|
+
border-radius: theme.$border-radius;
|
|
7
|
+
background-color: theme.$background-color;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
.rootMuted {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
background-color: theme.$muted-background-color;
|
|
12
|
+
opacity: theme.$muted-opacity;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
.rootRaised {
|
|
16
|
-
|
|
16
|
+
box-shadow: theme.$raised-box-shadow;
|
|
17
17
|
}
|
|
@@ -39,7 +39,7 @@ See [API](#api) for all available options.
|
|
|
39
39
|
the default appearance to make it stand out on white background.
|
|
40
40
|
|
|
41
41
|
- **Paper, or Card?** Paper is a basic surface to put content on. However,
|
|
42
|
-
there is also the [Card](/components/
|
|
42
|
+
there is also the [Card](/components/card) component. While Paper is
|
|
43
43
|
usually used to hold larger content areas like lists, grids, or forms, Card is
|
|
44
44
|
designed for displaying items. Card also supports more visual options.
|
|
45
45
|
|
|
@@ -56,13 +56,13 @@ See [API](#api) for all available options.
|
|
|
56
56
|
## General Guidelines
|
|
57
57
|
|
|
58
58
|
- Use Radio for **just a few options**. For larger sets of many options (say 4
|
|
59
|
-
and more) consider using the [SelectField](/components/
|
|
59
|
+
and more) consider using the [SelectField](/components/select-field)
|
|
60
60
|
component. This will help keep your UI clean and uncluttered and prevent your
|
|
61
61
|
users from being overwhelmed by too many options.
|
|
62
62
|
|
|
63
63
|
- **Don't use for boolean** (true/false) selection or to toggle things on and
|
|
64
|
-
off. [CheckboxField](/components/
|
|
65
|
-
[Toggle](/components/
|
|
64
|
+
off. [CheckboxField](/components/checkbox-field) and
|
|
65
|
+
[Toggle](/components/toggle) are more suitable for such cases.
|
|
66
66
|
|
|
67
67
|
- Use **short and descriptive labels**, ideally nouns rather than seemingly
|
|
68
68
|
polite phrases like _Please select your favourite fruit_. Short labels will
|
|
@@ -287,7 +287,7 @@ It's possible to disable just some options or the whole set.
|
|
|
287
287
|
|
|
288
288
|
In addition to the options below, you can specify [React synthetic events] or
|
|
289
289
|
any custom HTML attributes that do not interfere with the API, and they will be
|
|
290
|
-
passed to the
|
|
290
|
+
passed to the `<input>` HTML element. This enables making the component
|
|
291
291
|
interactive and helps improve its accessibility.
|
|
292
292
|
|
|
293
293
|
<Props table of={Radio} />
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
2
|
import React, { useContext } from 'react';
|
|
3
|
-
import getRootValidationStateClassName from '../../helpers/getRootValidationStateClassName';
|
|
4
|
-
import { resolveContextOrProp } from '../../helpers/resolveContextOrProp';
|
|
5
3
|
import { withProviderContext } from '../../provider';
|
|
6
|
-
import
|
|
4
|
+
import { classNames } from '../../utils/classNames';
|
|
5
|
+
import { getRootValidationStateClassName } from '../_helpers/getRootValidationStateClassName';
|
|
6
|
+
import { resolveContextOrProp } from '../_helpers/resolveContextOrProp';
|
|
7
|
+
import { transferProps } from '../_helpers/transferProps';
|
|
7
8
|
import { FormLayoutContext } from '../FormLayout';
|
|
8
9
|
import styles from './Radio.scss';
|
|
9
10
|
|
|
@@ -25,23 +26,23 @@ export const Radio = ({
|
|
|
25
26
|
|
|
26
27
|
return (
|
|
27
28
|
<div
|
|
28
|
-
className={
|
|
29
|
+
className={classNames(
|
|
29
30
|
styles.root,
|
|
30
|
-
context
|
|
31
|
+
context && styles.isRootInFormLayout,
|
|
31
32
|
resolveContextOrProp(context && context.layout, layout) === 'horizontal'
|
|
32
33
|
? styles.rootLayoutHorizontal
|
|
33
34
|
: styles.rootLayoutVertical,
|
|
34
|
-
disabled
|
|
35
|
-
required
|
|
35
|
+
disabled && styles.isRootDisabled,
|
|
36
|
+
required && styles.isRootRequired,
|
|
36
37
|
getRootValidationStateClassName(validationState, styles),
|
|
37
|
-
|
|
38
|
+
)}
|
|
38
39
|
id={id}
|
|
39
40
|
>
|
|
40
41
|
<div
|
|
41
|
-
className={
|
|
42
|
+
className={classNames(
|
|
42
43
|
styles.label,
|
|
43
|
-
isLabelVisible
|
|
44
|
-
|
|
44
|
+
!isLabelVisible && styles.isLabelHidden,
|
|
45
|
+
)}
|
|
45
46
|
id={id && `${id}__labelText`}
|
|
46
47
|
>
|
|
47
48
|
{label}
|