@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.
Files changed (174) hide show
  1. package/CONTRIBUTING.md +7 -0
  2. package/dist/lib.development.js +209 -305
  3. package/dist/lib.js +1 -1
  4. package/package.json +10 -13
  5. package/src/lib/components/Alert/Alert.jsx +4 -3
  6. package/src/lib/components/Alert/Alert.scss +48 -48
  7. package/src/lib/components/Alert/_settings.scss +4 -4
  8. package/src/lib/components/Alert/_theme.scss +50 -50
  9. package/src/lib/components/Alert/_tools.scss +6 -6
  10. package/src/lib/components/Badge/Badge.jsx +6 -8
  11. package/src/lib/components/Badge/Badge.scss +57 -57
  12. package/src/lib/components/Button/Button.jsx +10 -9
  13. package/src/lib/components/Button/Button.scss +2 -2
  14. package/src/lib/components/Button/README.mdx +8 -3
  15. package/src/lib/components/Button/_base.scss +65 -65
  16. package/src/lib/components/Button/_priorities.scss +49 -49
  17. package/src/lib/components/Button/_settings.scss +10 -10
  18. package/src/lib/components/Button/_theme.scss +18 -15
  19. package/src/lib/components/Button/_tools.scss +98 -100
  20. package/src/lib/components/ButtonGroup/ButtonGroup.jsx +31 -22
  21. package/src/lib/components/ButtonGroup/ButtonGroup.scss +3 -3
  22. package/src/lib/components/ButtonGroup/README.mdx +4 -4
  23. package/src/lib/components/Card/Card.jsx +7 -6
  24. package/src/lib/components/Card/Card.scss +28 -28
  25. package/src/lib/components/Card/CardBody.jsx +5 -11
  26. package/src/lib/components/Card/CardFooter.jsx +10 -5
  27. package/src/lib/components/Card/README.mdx +2 -2
  28. package/src/lib/components/Card/_theme.scss +50 -50
  29. package/src/lib/components/Card/_tools.scss +6 -6
  30. package/src/lib/components/CheckboxField/CheckboxField.jsx +18 -17
  31. package/src/lib/components/CheckboxField/CheckboxField.scss +20 -20
  32. package/src/lib/components/CheckboxField/README.mdx +3 -3
  33. package/src/lib/components/FileInputField/FileInputField.jsx +13 -12
  34. package/src/lib/components/FileInputField/FileInputField.scss +19 -19
  35. package/src/lib/components/FileInputField/README.mdx +1 -1
  36. package/src/lib/components/FormLayout/FormLayout.jsx +16 -14
  37. package/src/lib/components/FormLayout/FormLayout.scss +17 -17
  38. package/src/lib/components/FormLayout/FormLayoutCustomField.jsx +15 -9
  39. package/src/lib/components/FormLayout/FormLayoutCustomField.scss +18 -18
  40. package/src/lib/components/FormLayout/README.mdx +27 -49
  41. package/src/lib/components/Grid/Grid.jsx +4 -3
  42. package/src/lib/components/Grid/Grid.scss +32 -23
  43. package/src/lib/components/Grid/GridSpan.jsx +4 -3
  44. package/src/lib/components/Grid/{helpers → _helpers}/generateResponsiveCustomProperties.js +0 -2
  45. package/src/lib/components/Grid/_theme.scss +9 -9
  46. package/src/lib/components/Grid/_tools.scss +20 -20
  47. package/src/lib/components/List/List.jsx +14 -12
  48. package/src/lib/components/List/List.scss +21 -21
  49. package/src/lib/components/List/ListItem.jsx +3 -2
  50. package/src/lib/components/List/README.mdx +1 -1
  51. package/src/lib/components/Media/Media.jsx +12 -5
  52. package/src/lib/components/Media/Media.scss +6 -6
  53. package/src/lib/components/Media/MediaBody.jsx +18 -7
  54. package/src/lib/components/Media/MediaObject.jsx +18 -7
  55. package/src/lib/components/Modal/Modal.jsx +8 -6
  56. package/src/lib/components/Modal/Modal.scss +73 -73
  57. package/src/lib/components/Modal/README.mdx +2 -2
  58. package/src/lib/components/Modal/_settings.scss +5 -5
  59. package/src/lib/components/Modal/_theme.scss +17 -17
  60. package/src/lib/components/Paper/Paper.jsx +6 -6
  61. package/src/lib/components/Paper/Paper.scss +8 -8
  62. package/src/lib/components/Paper/README.mdx +1 -1
  63. package/src/lib/components/Radio/README.mdx +4 -4
  64. package/src/lib/components/Radio/Radio.jsx +12 -11
  65. package/src/lib/components/Radio/Radio.scss +26 -26
  66. package/src/lib/components/ScrollView/README.mdx +4 -1
  67. package/src/lib/components/ScrollView/ScrollView.jsx +11 -9
  68. package/src/lib/components/ScrollView/ScrollView.scss +113 -113
  69. package/src/lib/{services/elementPositionService.js → components/ScrollView/_helpers/getElementsPositionDifference.js} +0 -2
  70. package/src/lib/{hooks → components/ScrollView/_hooks}/useLoadResizeHook.js +1 -1
  71. package/src/lib/{hooks → components/ScrollView/_hooks}/useScrollPositionHook.js +1 -1
  72. package/src/lib/components/SelectField/README.mdx +4 -4
  73. package/src/lib/components/SelectField/SelectField.jsx +14 -13
  74. package/src/lib/components/SelectField/SelectField.scss +30 -30
  75. package/src/lib/components/Table/README.mdx +3 -3
  76. package/src/lib/components/Table/Table.scss +28 -35
  77. package/src/lib/components/Table/_settings.scss +5 -5
  78. package/src/lib/components/Tabs/README.mdx +1 -1
  79. package/src/lib/components/Tabs/Tabs.jsx +1 -2
  80. package/src/lib/components/Tabs/Tabs.scss +21 -21
  81. package/src/lib/components/Tabs/TabsItem.jsx +4 -3
  82. package/src/lib/components/Tabs/TabsItem.scss +78 -78
  83. package/src/lib/components/Text/README.mdx +1 -1
  84. package/src/lib/components/Text/Text.jsx +13 -6
  85. package/src/lib/components/Text/Text.scss +23 -13
  86. package/src/lib/components/Text/_helpers/getRootClampClassName.js +11 -0
  87. package/src/lib/components/Text/{helpers → _helpers}/getRootHyphensClassName.js +1 -1
  88. package/src/lib/components/Text/{helpers → _helpers}/getRootWordWrappingClassName.js +1 -1
  89. package/src/lib/components/TextArea/README.mdx +1 -1
  90. package/src/lib/components/TextArea/TextArea.jsx +18 -14
  91. package/src/lib/components/TextArea/TextArea.scss +27 -27
  92. package/src/lib/components/TextField/README.mdx +1 -1
  93. package/src/lib/components/TextField/TextField.jsx +16 -14
  94. package/src/lib/components/TextField/TextField.scss +28 -28
  95. package/src/lib/components/TextLink/README.mdx +77 -0
  96. package/src/lib/components/{Link/Link.jsx → TextLink/TextLink.jsx} +12 -13
  97. package/src/lib/components/TextLink/TextLink.scss +11 -0
  98. package/src/lib/components/TextLink/_theme.scss +4 -0
  99. package/src/lib/components/TextLink/index.js +1 -0
  100. package/src/lib/components/Toggle/README.mdx +3 -3
  101. package/src/lib/components/Toggle/Toggle.jsx +18 -17
  102. package/src/lib/components/Toggle/Toggle.scss +20 -20
  103. package/src/lib/components/Toolbar/README.mdx +19 -3
  104. package/src/lib/components/Toolbar/Toolbar.jsx +23 -14
  105. package/src/lib/components/Toolbar/Toolbar.scss +35 -30
  106. package/src/lib/components/Toolbar/ToolbarGroup.jsx +18 -13
  107. package/src/lib/components/Toolbar/ToolbarItem.jsx +26 -7
  108. package/src/lib/{helpers → components/_helpers}/getRootColorClassName.js +1 -1
  109. package/src/lib/{helpers → components/_helpers}/getRootSizeClassName.js +1 -1
  110. package/src/lib/{helpers → components/_helpers}/getRootValidationStateClassName.js +1 -1
  111. package/src/lib/components/_helpers/isChildrenEmpty.js +3 -0
  112. package/src/lib/{helpers → components/_helpers}/resolveContextOrProp.js +0 -0
  113. package/src/lib/{utils → components/_helpers}/transferProps.js +1 -1
  114. package/src/lib/foundation.scss +11 -11
  115. package/src/lib/helpers.scss +2 -2
  116. package/src/lib/index.js +4 -8
  117. package/src/lib/styles/_utilities.scss +13 -13
  118. package/src/lib/styles/elements/_code.scss +7 -7
  119. package/src/lib/styles/elements/_links.scss +8 -8
  120. package/src/lib/styles/elements/_lists.scss +3 -3
  121. package/src/lib/styles/elements/_page.scss +14 -14
  122. package/src/lib/styles/elements/_rulers.scss +6 -6
  123. package/src/lib/styles/elements/_small.scss +2 -2
  124. package/src/lib/styles/generic/_box-sizing.scss +3 -2
  125. package/src/lib/styles/generic/_forms.scss +3 -3
  126. package/src/lib/styles/generic/_reset.scss +6 -6
  127. package/src/lib/styles/generic/_shared.scss +3 -3
  128. package/src/lib/styles/helpers/_animation.scss +8 -8
  129. package/src/lib/styles/settings/_breakpoints.scss +7 -7
  130. package/src/lib/styles/settings/_escaped-characters.scss +5 -5
  131. package/src/lib/styles/settings/_form-fields.scss +24 -24
  132. package/src/lib/styles/settings/_utilities.scss +112 -100
  133. package/src/lib/styles/theme/_colors.scss +50 -50
  134. package/src/lib/styles/theme/_form-fields.scss +32 -32
  135. package/src/lib/styles/theme/_spacing.scss +11 -11
  136. package/src/lib/styles/theme/_typography.scss +12 -11
  137. package/src/lib/styles/theme-constants/_breakpoints.scss +2 -2
  138. package/src/lib/styles/theme-constants/_colors.scss +2 -2
  139. package/src/lib/styles/theme-constants/_svg.scss +1 -2
  140. package/src/lib/styles/tools/_accessibility.scss +29 -29
  141. package/src/lib/styles/tools/_breakpoint.scss +11 -14
  142. package/src/lib/styles/tools/_caret.scss +8 -8
  143. package/src/lib/styles/tools/_colors.scss +3 -3
  144. package/src/lib/styles/tools/_reset.scss +24 -21
  145. package/src/lib/styles/tools/_scrollbar.scss +4 -4
  146. package/src/lib/styles/tools/_spacing.scss +17 -21
  147. package/src/lib/styles/tools/_string.scss +9 -9
  148. package/src/lib/styles/tools/_svg.scss +13 -16
  149. package/src/lib/styles/tools/_transition.scss +42 -44
  150. package/src/lib/styles/tools/_utilities.scss +19 -19
  151. package/src/lib/styles/tools/form-fields/_box-field-elements.scss +88 -88
  152. package/src/lib/styles/tools/form-fields/_box-field-layout.scss +147 -147
  153. package/src/lib/styles/tools/form-fields/_box-field-sizes.scss +13 -15
  154. package/src/lib/styles/tools/form-fields/_foundation.scss +12 -12
  155. package/src/lib/styles/tools/form-fields/_inline-field-elements.scss +82 -71
  156. package/src/lib/styles/tools/form-fields/_inline-field-layout.scss +88 -47
  157. package/src/lib/styles/tools/form-fields/_variants.scss +104 -106
  158. package/src/lib/theme.scss +958 -954
  159. package/src/lib/utils/classNames.js +8 -0
  160. package/src/lib/components/CTA/CTA.jsx +0 -60
  161. package/src/lib/components/CTA/CTA.scss +0 -71
  162. package/src/lib/components/CTA/CTACenter.jsx +0 -27
  163. package/src/lib/components/CTA/CTAEnd.jsx +0 -27
  164. package/src/lib/components/CTA/CTAStart.jsx +0 -27
  165. package/src/lib/components/CTA/README.mdx +0 -119
  166. package/src/lib/components/CTA/index.js +0 -4
  167. package/src/lib/components/Center/Center.jsx +0 -27
  168. package/src/lib/components/Center/Center.scss +0 -7
  169. package/src/lib/components/Center/README.mdx +0 -52
  170. package/src/lib/components/Center/index.js +0 -1
  171. package/src/lib/components/Link/Link.scss +0 -11
  172. package/src/lib/components/Link/README.mdx +0 -85
  173. package/src/lib/components/Link/_theme.scss +0 -4
  174. package/src/lib/components/Link/index.js +0 -1
@@ -1,16 +1,16 @@
1
- @use '../../styles/tools/spacing';
1
+ @use "../../styles/tools/spacing";
2
2
 
3
3
  .media {
4
- @include spacing.bottom(layouts);
4
+ @include spacing.bottom(layouts);
5
5
 
6
- display: flex;
7
- align-items: flex-start;
6
+ display: flex;
7
+ align-items: flex-start;
8
8
  }
9
9
 
10
10
  .object {
11
- margin-right: spacing.of(3);
11
+ margin-right: spacing.of(3);
12
12
  }
13
13
 
14
14
  .body {
15
- flex: 1;
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
- <div className={styles.body}>
8
- {children}
9
- </div>
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.isRequired,
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
- <div className={styles.object}>
8
- {children}
9
- </div>
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.isRequired,
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
- ].join(' ')}
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
- ].join(' ')}
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.isRequired,
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 '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';
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
- --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(--local-outer-spacing)));
19
- max-height: calc(100% - (2 * var(--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
- --local-outer-spacing: #{theme.$outer-spacing-sm};
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
- 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;
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
- font-size: settings.$head-title-font-size;
40
+ font-size: settings.$head-title-font-size;
41
41
 
42
- &:not(:last-child) {
43
- margin-bottom: 0;
44
- }
42
+ &:not(:last-child) {
43
+ margin-bottom: 0;
44
+ }
45
45
  }
46
46
 
47
47
  .close {
48
- @include reset.button();
49
- @include accessibility.min-tap-target();
48
+ @include reset.button();
49
+ @include accessibility.min-tap-target();
50
50
 
51
- font-size: map.get(typography.$size-values, 3);
52
- line-height: 1;
53
- color: inherit;
51
+ font-size: map.get(typography.$size-values, 3);
52
+ line-height: 1;
53
+ color: inherit;
54
54
  }
55
55
 
56
56
  .body {
57
- flex: 1 1 auto;
57
+ flex: 1 1 auto;
58
58
  }
59
59
 
60
60
  .isBodyScrollable {
61
- display: flex;
62
- flex-direction: column;
63
- min-height: 0;
61
+ display: flex;
62
+ flex-direction: column;
63
+ min-height: 0;
64
64
  }
65
65
 
66
66
  .content {
67
- padding: settings.$padding-y settings.$padding-x settings.$content-padding-bottom;
67
+ padding: settings.$padding-y settings.$padding-x settings.$content-padding-bottom;
68
68
  }
69
69
 
70
70
  .footer {
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;
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
- 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;
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
- width: map.get(theme.$sizes, small, width);
93
+ width: map.get(theme.$sizes, small, width);
94
94
  }
95
95
 
96
96
  .isRootSizeMedium {
97
- width: map.get(theme.$sizes, medium, width);
97
+ width: map.get(theme.$sizes, medium, width);
98
98
  }
99
99
 
100
100
  .isRootSizeLarge {
101
- width: map.get(theme.$sizes, large, width);
101
+ width: map.get(theme.$sizes, large, width);
102
102
  }
103
103
 
104
104
  .isRootSizeFullscreen {
105
- width: map.get(theme.$sizes, fullscreen, width);
106
- height: map.get(theme.$sizes, fullscreen, height);
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
- height: 100%;
110
+ height: 100%;
111
111
  }
112
112
 
113
113
  .isRootSizeAuto {
114
- width: auto;
115
- min-width: map.get(theme.$sizes, auto, min-width);
116
- max-width: map.get(theme.$sizes, auto, max-width);
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
- top: 50%;
121
- transform: translate(-50%, -50%);
120
+ top: 50%;
121
+ transform: translate(-50%, -50%);
122
122
  }
123
123
 
124
124
  .isRootPositionTop {
125
- top: var(--local-outer-spacing);
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/layout/form-layout#label-width). It's just too much
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/ui/scroll-view)
251
+ [customizable](#api) instance of the [ScrollView](/components/scroll-view)
252
252
  component.
253
253
 
254
254
  <Playground>
@@ -1,8 +1,8 @@
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';
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
- 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
- ),
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 ? styles.rootMuted : '',
16
- raised ? styles.rootRaised : '',
17
- ].join(' ')}
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 'theme';
1
+ @use "theme";
2
2
 
3
3
  .root {
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;
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
- background-color: theme.$muted-background-color;
12
- opacity: theme.$muted-opacity;
11
+ background-color: theme.$muted-background-color;
12
+ opacity: theme.$muted-opacity;
13
13
  }
14
14
 
15
15
  .rootRaised {
16
- box-shadow: theme.$raised-box-shadow;
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/ui/card) component. While Paper is
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/ui/select-field)
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/ui/checkbox-field) and
65
- [Toggle](/components/ui/toggle) are more suitable for such cases.
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 `input` HTML element. This enables making the component
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 transferProps from '../../utils/transferProps';
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 ? styles.isRootInFormLayout : '',
31
+ context && styles.isRootInFormLayout,
31
32
  resolveContextOrProp(context && context.layout, layout) === 'horizontal'
32
33
  ? styles.rootLayoutHorizontal
33
34
  : styles.rootLayoutVertical,
34
- disabled ? styles.isRootDisabled : '',
35
- required ? styles.isRootRequired : '',
35
+ disabled && styles.isRootDisabled,
36
+ required && styles.isRootRequired,
36
37
  getRootValidationStateClassName(validationState, styles),
37
- ].join(' ')}
38
+ )}
38
39
  id={id}
39
40
  >
40
41
  <div
41
- className={[
42
+ className={classNames(
42
43
  styles.label,
43
- isLabelVisible ? '' : styles.isLabelHidden,
44
- ].join(' ')}
44
+ !isLabelVisible && styles.isLabelHidden,
45
+ )}
45
46
  id={id && `${id}__labelText`}
46
47
  >
47
48
  {label}