@react-ui-org/react-ui 0.44.1 → 0.45.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (139) hide show
  1. package/dist/lib.development.js +138 -258
  2. package/dist/lib.js +1 -1
  3. package/package.json +7 -10
  4. package/src/lib/components/Alert/Alert.jsx +4 -3
  5. package/src/lib/components/Alert/Alert.scss +48 -48
  6. package/src/lib/components/Alert/_settings.scss +4 -4
  7. package/src/lib/components/Alert/_theme.scss +50 -50
  8. package/src/lib/components/Alert/_tools.scss +6 -6
  9. package/src/lib/components/Badge/Badge.jsx +5 -4
  10. package/src/lib/components/Badge/Badge.scss +57 -57
  11. package/src/lib/components/Button/Button.jsx +10 -9
  12. package/src/lib/components/Button/Button.scss +2 -2
  13. package/src/lib/components/Button/README.mdx +6 -1
  14. package/src/lib/components/Button/_base.scss +65 -65
  15. package/src/lib/components/Button/_priorities.scss +49 -49
  16. package/src/lib/components/Button/_settings.scss +10 -10
  17. package/src/lib/components/Button/_theme.scss +18 -15
  18. package/src/lib/components/Button/_tools.scss +98 -100
  19. package/src/lib/components/ButtonGroup/ButtonGroup.jsx +4 -3
  20. package/src/lib/components/ButtonGroup/ButtonGroup.scss +3 -3
  21. package/src/lib/components/Card/Card.jsx +7 -6
  22. package/src/lib/components/Card/Card.scss +28 -28
  23. package/src/lib/components/Card/_theme.scss +50 -50
  24. package/src/lib/components/Card/_tools.scss +6 -6
  25. package/src/lib/components/CheckboxField/CheckboxField.jsx +12 -11
  26. package/src/lib/components/CheckboxField/CheckboxField.scss +20 -20
  27. package/src/lib/components/FileInputField/FileInputField.jsx +13 -12
  28. package/src/lib/components/FileInputField/FileInputField.scss +19 -19
  29. package/src/lib/components/FormLayout/FormLayout.jsx +5 -4
  30. package/src/lib/components/FormLayout/FormLayout.scss +17 -17
  31. package/src/lib/components/FormLayout/FormLayoutCustomField.jsx +9 -8
  32. package/src/lib/components/FormLayout/FormLayoutCustomField.scss +18 -18
  33. package/src/lib/components/FormLayout/README.mdx +16 -36
  34. package/src/lib/components/Grid/Grid.jsx +1 -1
  35. package/src/lib/components/Grid/Grid.scss +28 -30
  36. package/src/lib/components/Grid/GridSpan.jsx +1 -1
  37. package/src/lib/components/Grid/{helpers → _helpers}/generateResponsiveCustomProperties.js +0 -2
  38. package/src/lib/components/Grid/_theme.scss +9 -9
  39. package/src/lib/components/Grid/_tools.scss +20 -20
  40. package/src/lib/components/Link/Link.jsx +1 -1
  41. package/src/lib/components/Link/Link.scss +7 -7
  42. package/src/lib/components/List/List.jsx +11 -10
  43. package/src/lib/components/List/List.scss +21 -21
  44. package/src/lib/components/Media/Media.scss +6 -6
  45. package/src/lib/components/Modal/Modal.jsx +6 -5
  46. package/src/lib/components/Modal/Modal.scss +73 -73
  47. package/src/lib/components/Modal/_settings.scss +5 -5
  48. package/src/lib/components/Modal/_theme.scss +17 -17
  49. package/src/lib/components/Paper/Paper.jsx +5 -4
  50. package/src/lib/components/Paper/Paper.scss +8 -8
  51. package/src/lib/components/Radio/Radio.jsx +12 -11
  52. package/src/lib/components/Radio/Radio.scss +26 -26
  53. package/src/lib/components/ScrollView/ScrollView.jsx +9 -8
  54. package/src/lib/components/ScrollView/ScrollView.scss +113 -113
  55. package/src/lib/{services/elementPositionService.js → components/ScrollView/_helpers/getElementsPositionDifference.js} +0 -2
  56. package/src/lib/{hooks → components/ScrollView/_hooks}/useLoadResizeHook.js +1 -1
  57. package/src/lib/{hooks → components/ScrollView/_hooks}/useScrollPositionHook.js +1 -1
  58. package/src/lib/components/SelectField/SelectField.jsx +14 -13
  59. package/src/lib/components/SelectField/SelectField.scss +30 -30
  60. package/src/lib/components/Table/Table.scss +28 -35
  61. package/src/lib/components/Table/_settings.scss +5 -5
  62. package/src/lib/components/Tabs/Tabs.scss +21 -21
  63. package/src/lib/components/Tabs/TabsItem.jsx +4 -3
  64. package/src/lib/components/Tabs/TabsItem.scss +78 -78
  65. package/src/lib/components/Text/Text.jsx +5 -4
  66. package/src/lib/components/Text/Text.scss +12 -12
  67. package/src/lib/components/Text/{helpers → _helpers}/getRootHyphensClassName.js +1 -1
  68. package/src/lib/components/Text/{helpers → _helpers}/getRootWordWrappingClassName.js +1 -1
  69. package/src/lib/components/TextArea/TextArea.jsx +14 -13
  70. package/src/lib/components/TextArea/TextArea.scss +27 -27
  71. package/src/lib/components/TextField/TextField.jsx +16 -15
  72. package/src/lib/components/TextField/TextField.scss +28 -28
  73. package/src/lib/components/Toggle/Toggle.jsx +12 -11
  74. package/src/lib/components/Toggle/Toggle.scss +20 -20
  75. package/src/lib/components/Toolbar/Toolbar.jsx +5 -4
  76. package/src/lib/components/Toolbar/Toolbar.scss +25 -25
  77. package/src/lib/components/Toolbar/ToolbarGroup.jsx +5 -4
  78. package/src/lib/{helpers → components/_helpers}/getRootColorClassName.js +1 -1
  79. package/src/lib/{helpers → components/_helpers}/getRootSizeClassName.js +1 -1
  80. package/src/lib/{helpers → components/_helpers}/getRootValidationStateClassName.js +1 -1
  81. package/src/lib/{helpers → components/_helpers}/resolveContextOrProp.js +0 -0
  82. package/src/lib/{utils → components/_helpers}/transferProps.js +1 -1
  83. package/src/lib/foundation.scss +11 -11
  84. package/src/lib/helpers.scss +2 -2
  85. package/src/lib/index.js +3 -7
  86. package/src/lib/styles/_utilities.scss +13 -13
  87. package/src/lib/styles/elements/_code.scss +7 -7
  88. package/src/lib/styles/elements/_links.scss +8 -8
  89. package/src/lib/styles/elements/_lists.scss +3 -3
  90. package/src/lib/styles/elements/_page.scss +14 -14
  91. package/src/lib/styles/elements/_rulers.scss +6 -6
  92. package/src/lib/styles/elements/_small.scss +2 -2
  93. package/src/lib/styles/generic/_box-sizing.scss +3 -2
  94. package/src/lib/styles/generic/_forms.scss +3 -3
  95. package/src/lib/styles/generic/_reset.scss +6 -6
  96. package/src/lib/styles/generic/_shared.scss +3 -3
  97. package/src/lib/styles/helpers/_animation.scss +8 -8
  98. package/src/lib/styles/settings/_breakpoints.scss +7 -7
  99. package/src/lib/styles/settings/_escaped-characters.scss +5 -5
  100. package/src/lib/styles/settings/_form-fields.scss +24 -24
  101. package/src/lib/styles/settings/_utilities.scss +112 -100
  102. package/src/lib/styles/theme/_colors.scss +50 -50
  103. package/src/lib/styles/theme/_form-fields.scss +32 -32
  104. package/src/lib/styles/theme/_spacing.scss +11 -11
  105. package/src/lib/styles/theme/_typography.scss +12 -11
  106. package/src/lib/styles/theme-constants/_breakpoints.scss +2 -2
  107. package/src/lib/styles/theme-constants/_colors.scss +2 -2
  108. package/src/lib/styles/theme-constants/_svg.scss +1 -2
  109. package/src/lib/styles/tools/_accessibility.scss +29 -29
  110. package/src/lib/styles/tools/_breakpoint.scss +11 -14
  111. package/src/lib/styles/tools/_caret.scss +8 -8
  112. package/src/lib/styles/tools/_colors.scss +3 -3
  113. package/src/lib/styles/tools/_reset.scss +21 -21
  114. package/src/lib/styles/tools/_scrollbar.scss +4 -4
  115. package/src/lib/styles/tools/_spacing.scss +17 -21
  116. package/src/lib/styles/tools/_string.scss +9 -9
  117. package/src/lib/styles/tools/_svg.scss +13 -16
  118. package/src/lib/styles/tools/_transition.scss +42 -44
  119. package/src/lib/styles/tools/_utilities.scss +19 -19
  120. package/src/lib/styles/tools/form-fields/_box-field-elements.scss +88 -88
  121. package/src/lib/styles/tools/form-fields/_box-field-layout.scss +144 -144
  122. package/src/lib/styles/tools/form-fields/_box-field-sizes.scss +13 -15
  123. package/src/lib/styles/tools/form-fields/_foundation.scss +12 -12
  124. package/src/lib/styles/tools/form-fields/_inline-field-elements.scss +71 -71
  125. package/src/lib/styles/tools/form-fields/_inline-field-layout.scss +44 -44
  126. package/src/lib/styles/tools/form-fields/_variants.scss +104 -106
  127. package/src/lib/theme.scss +958 -954
  128. package/src/lib/utils/classNames.js +8 -0
  129. package/src/lib/components/CTA/CTA.jsx +0 -60
  130. package/src/lib/components/CTA/CTA.scss +0 -71
  131. package/src/lib/components/CTA/CTACenter.jsx +0 -27
  132. package/src/lib/components/CTA/CTAEnd.jsx +0 -27
  133. package/src/lib/components/CTA/CTAStart.jsx +0 -27
  134. package/src/lib/components/CTA/README.mdx +0 -119
  135. package/src/lib/components/CTA/index.js +0 -4
  136. package/src/lib/components/Center/Center.jsx +0 -27
  137. package/src/lib/components/Center/Center.scss +0 -7
  138. package/src/lib/components/Center/README.mdx +0 -52
  139. package/src/lib/components/Center/index.js +0 -1
@@ -1,11 +1,11 @@
1
- @use 'theme';
1
+ @use "theme";
2
2
 
3
3
  .root {
4
- text-decoration: theme.$link-text-decoration;
5
- color: theme.$link-color;
4
+ text-decoration: theme.$link-text-decoration;
5
+ color: theme.$link-color;
6
6
 
7
- &:hover {
8
- text-decoration: theme.$link-hover-text-decoration;
9
- color: theme.$link-hover-color;
10
- }
7
+ &:hover {
8
+ text-decoration: theme.$link-hover-text-decoration;
9
+ color: theme.$link-hover-color;
10
+ }
11
11
  }
@@ -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 './List.scss';
5
6
 
6
7
  export const List = ({
@@ -12,7 +13,7 @@ export const List = ({
12
13
  return null;
13
14
  }
14
15
 
15
- let alignClass = '';
16
+ let alignClass;
16
17
 
17
18
  if (align === 'start') {
18
19
  alignClass = styles.alignStart;
@@ -20,7 +21,7 @@ export const List = ({
20
21
  alignClass = styles.alignEnd;
21
22
  }
22
23
 
23
- let autoWidthClass = '';
24
+ let autoWidthClass;
24
25
 
25
26
  if (autoWidth) {
26
27
  autoWidthClass = styles.isAutoWidth;
@@ -28,16 +29,16 @@ export const List = ({
28
29
 
29
30
  return (
30
31
  <div
31
- className={`
32
- ${styles.root}
33
- ${autoWidthClass}
34
- `.trim()}
32
+ className={classNames(
33
+ styles.root,
34
+ autoWidthClass,
35
+ )}
35
36
  >
36
37
  <ul
37
- className={`
38
- ${styles.list}
39
- ${alignClass}
40
- `.trim()}
38
+ className={classNames(
39
+ styles.list,
40
+ alignClass,
41
+ )}
41
42
  >
42
43
  {children}
43
44
  </ul>
@@ -1,53 +1,53 @@
1
- @use '../../styles/tools/reset';
2
- @use '../../styles/tools/spacing';
3
- @use 'theme';
1
+ @use "../../styles/tools/reset";
2
+ @use "../../styles/tools/spacing";
3
+ @use "theme";
4
4
 
5
5
  .root {
6
- @include spacing.bottom(layouts);
6
+ @include spacing.bottom(layouts);
7
7
  }
8
8
 
9
9
  .list {
10
- @include reset.list();
10
+ @include reset.list();
11
11
 
12
- display: flex;
13
- flex-direction: column;
12
+ display: flex;
13
+ flex-direction: column;
14
14
  }
15
15
 
16
16
  .item {
17
- width: 100%;
18
- margin-bottom: theme.$row-gap;
17
+ width: 100%;
18
+ margin-bottom: theme.$row-gap;
19
19
 
20
- &:last-child {
21
- margin-bottom: 0;
22
- }
20
+ &:last-child {
21
+ margin-bottom: 0;
22
+ }
23
23
  }
24
24
 
25
25
  .alignStart {
26
- align-items: flex-start;
27
- text-align: left;
26
+ align-items: flex-start;
27
+ text-align: left;
28
28
  }
29
29
 
30
30
  .alignEnd {
31
- align-items: flex-end;
32
- text-align: right;
31
+ align-items: flex-end;
32
+ text-align: right;
33
33
  }
34
34
 
35
35
  [dir="rtl"] .alignStart {
36
- text-align: right;
36
+ text-align: right;
37
37
  }
38
38
 
39
39
  [dir="rtl"] .alignEnd {
40
- text-align: left;
40
+ text-align: left;
41
41
  }
42
42
 
43
43
  .isAutoWidth .list {
44
- display: inline-flex;
44
+ display: inline-flex;
45
45
  }
46
46
 
47
47
  .isAutoWidth .item {
48
- width: auto;
48
+ width: auto;
49
49
  }
50
50
 
51
51
  .item .root {
52
- margin-bottom: 0;
52
+ margin-bottom: 0;
53
53
  }
@@ -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,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
  }}
@@ -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
  }
@@ -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}
@@ -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
  }
@@ -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}
@@ -1,78 +1,78 @@
1
- @use '../../styles/tools/form-fields/box-field-elements';
2
- @use '../../styles/tools/form-fields/box-field-layout';
3
- @use '../../styles/tools/form-fields/foundation';
4
- @use '../../styles/tools/form-fields/inline-field-elements';
5
- @use '../../styles/tools/form-fields/inline-field-layout';
6
- @use '../../styles/tools/form-fields/variants';
7
- @use '../../styles/tools/accessibility';
8
- @use '../../styles/tools/reset';
9
- @use '../../styles/tools/spacing';
1
+ @use "../../styles/tools/form-fields/box-field-elements";
2
+ @use "../../styles/tools/form-fields/box-field-layout";
3
+ @use "../../styles/tools/form-fields/foundation";
4
+ @use "../../styles/tools/form-fields/inline-field-elements";
5
+ @use "../../styles/tools/form-fields/inline-field-layout";
6
+ @use "../../styles/tools/form-fields/variants";
7
+ @use "../../styles/tools/accessibility";
8
+ @use "../../styles/tools/reset";
9
+ @use "../../styles/tools/spacing";
10
10
 
11
11
  // Foundation
12
12
  .root {
13
- @include foundation.root();
14
- @include variants.visual(check);
13
+ @include foundation.root();
14
+ @include variants.visual(check);
15
15
  }
16
16
 
17
17
  .label,
18
18
  .optionLabel {
19
- @include foundation.label();
19
+ @include foundation.label();
20
20
  }
21
21
 
22
22
  .list {
23
- @include reset.list();
23
+ @include reset.list();
24
24
  }
25
25
 
26
26
  .option {
27
- @include inline-field-layout.field();
28
- @include inline-field-elements.min-tap-target($type: radio);
27
+ @include inline-field-layout.field();
28
+ @include inline-field-elements.min-tap-target($type: radio);
29
29
  }
30
30
 
31
31
  .input {
32
- @include inline-field-elements.check-input($type: radio);
32
+ @include inline-field-elements.check-input($type: radio);
33
33
  }
34
34
 
35
35
  .helpText,
36
36
  .validationText {
37
- @include foundation.help-text();
37
+ @include foundation.help-text();
38
38
  }
39
39
 
40
40
  .isRootRequired .label {
41
- @include foundation.label-required();
41
+ @include foundation.label-required();
42
42
  }
43
43
 
44
44
  // States
45
45
  .isRootStateInvalid {
46
- @include variants.validation(invalid);
46
+ @include variants.validation(invalid);
47
47
  }
48
48
 
49
49
  .isRootStateValid {
50
- @include variants.validation(valid);
50
+ @include variants.validation(valid);
51
51
  }
52
52
 
53
53
  .isRootStateWarning {
54
- @include variants.validation(warning);
54
+ @include variants.validation(warning);
55
55
  }
56
56
 
57
57
  // Invisible label
58
58
  .isLabelHidden {
59
- @include accessibility.hide-text();
59
+ @include accessibility.hide-text();
60
60
  }
61
61
 
62
62
  // Layouts
63
63
  .rootLayoutVertical,
64
64
  .rootLayoutHorizontal {
65
- @include box-field-layout.vertical($has-list: true);
65
+ @include box-field-layout.vertical($has-list: true);
66
66
  }
67
67
 
68
68
  .rootLayoutHorizontal {
69
- @include box-field-layout.horizontal($has-min-tap-target: true);
69
+ @include box-field-layout.horizontal($has-min-tap-target: true);
70
70
  }
71
71
 
72
72
  .isRootFullWidth {
73
- @include box-field-layout.full-width();
73
+ @include box-field-layout.full-width();
74
74
  }
75
75
 
76
76
  .isRootInFormLayout {
77
- @include box-field-layout.in-form-layout();
77
+ @include box-field-layout.in-form-layout();
78
78
  }