@react-ui-org/react-ui 0.44.1 → 0.45.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 (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
@@ -5,10 +5,11 @@ import React, {
5
5
  useRef,
6
6
  useState,
7
7
  } from 'react';
8
- import { useLoadResize } from '../../hooks/useLoadResizeHook';
9
- import { useScrollPosition } from '../../hooks/useScrollPositionHook';
10
8
  import { withProviderContext } from '../../provider';
11
- import { getElementsPositionDifference } from '../../services/elementPositionService';
9
+ import { classNames } from '../../utils/classNames';
10
+ import { getElementsPositionDifference } from './_helpers/getElementsPositionDifference';
11
+ import { useLoadResize } from './_hooks/useLoadResizeHook';
12
+ import { useScrollPosition } from './_hooks/useScrollPositionHook';
12
13
  import styles from './ScrollView.scss';
13
14
 
14
15
  // Function `getElementsPositionDifference` sometimes returns floating point values that results
@@ -197,13 +198,13 @@ export const ScrollView = (props) => {
197
198
 
198
199
  return (
199
200
  <div
200
- className={[
201
+ className={classNames(
201
202
  styles.root,
202
- isScrolledAtStart ? styles.isRootScrolledAtStart : '',
203
- isScrolledAtEnd ? styles.isRootScrolledAtEnd : '',
204
- scrollbar ? '' : styles.hasRootScrollbarDisabled,
203
+ isScrolledAtStart && styles.isRootScrolledAtStart,
204
+ isScrolledAtEnd && styles.isRootScrolledAtEnd,
205
+ !scrollbar && styles.hasRootScrollbarDisabled,
205
206
  direction === 'horizontal' ? styles.isRootHorizontal : styles.isRootVertical,
206
- ].join(' ')}
207
+ )}
207
208
  style={inlineStyle(
208
209
  direction,
209
210
  arrowsColor,
@@ -21,204 +21,204 @@
21
21
  // 7. Hide content overflowing in the other direction because scrollbars would be unreachable under
22
22
  // scrolling shadows.
23
23
 
24
- @use '../../styles/tools/accessibility';
25
- @use '../../styles/tools/caret';
26
- @use '../../styles/tools/reset';
27
- @use '../../styles/tools/scrollbar';
28
- @use '../../styles/tools/spacing';
29
- @use '../../styles/tools/transition';
30
- @use 'theme';
24
+ @use "../../styles/tools/accessibility";
25
+ @use "../../styles/tools/caret";
26
+ @use "../../styles/tools/reset";
27
+ @use "../../styles/tools/scrollbar";
28
+ @use "../../styles/tools/spacing";
29
+ @use "../../styles/tools/transition";
30
+ @use "theme";
31
31
 
32
32
  $_arrow-inner-spacing: spacing.of(2);
33
33
  $_arrow-outer-spacing: spacing.of(4);
34
34
 
35
35
  .root {
36
- position: relative; // 2.
37
- display: flex;
38
- flex-direction: column;
39
- width: 100%;
36
+ position: relative; // 2.
37
+ display: flex;
38
+ flex-direction: column;
39
+ width: 100%;
40
40
  }
41
41
 
42
42
  // 1.
43
43
  .scrollingShadows {
44
- position: absolute; // 2.
45
- width: 100%; // 2.
46
- height: 100%; // 2.
47
- overflow: hidden; // 2.
48
-
49
- &::before,
50
- &::after {
51
- @include transition.add((visibility, opacity, transform));
52
-
53
- content: '';
54
- position: absolute;
55
- z-index: 2; // 2.
56
- display: block;
57
- width: var(--rui-local-shadow-width);
58
- height: var(--rui-local-shadow-height);
59
- visibility: hidden;
60
- opacity: 0;
61
- }
62
-
63
- &::before {
64
- background: var(--rui-local-start-shadow-background);
65
- box-shadow: var(--rui-local-start-shadow-box-shadow);
66
- }
67
-
68
- &::after {
69
- background: var(--rui-local-end-shadow-background);
70
- box-shadow: var(--rui-local-end-shadow-box-shadow);
71
- }
44
+ position: absolute; // 2.
45
+ width: 100%; // 2.
46
+ height: 100%; // 2.
47
+ overflow: hidden; // 2.
48
+
49
+ &::before,
50
+ &::after {
51
+ @include transition.add((visibility, opacity, transform));
52
+
53
+ content: "";
54
+ position: absolute;
55
+ z-index: 2; // 2.
56
+ display: block;
57
+ width: var(--rui-local-shadow-width);
58
+ height: var(--rui-local-shadow-height);
59
+ visibility: hidden;
60
+ opacity: 0;
61
+ }
62
+
63
+ &::before {
64
+ background: var(--rui-local-start-shadow-background);
65
+ box-shadow: var(--rui-local-start-shadow-box-shadow);
66
+ }
67
+
68
+ &::after {
69
+ background: var(--rui-local-end-shadow-background);
70
+ box-shadow: var(--rui-local-end-shadow-box-shadow);
71
+ }
72
72
  }
73
73
 
74
74
  .viewport {
75
- z-index: 1; // 2.
76
- width: 100%;
77
- scroll-behavior: smooth;
78
- -webkit-overflow-scrolling: touch;
75
+ z-index: 1; // 2.
76
+ width: 100%;
77
+ scroll-behavior: smooth;
78
+ -webkit-overflow-scrolling: touch;
79
79
  }
80
80
 
81
81
  .arrowPrev,
82
82
  .arrowNext {
83
- @include reset.button();
84
- @include accessibility.min-tap-target();
85
- @include transition.add((visibility, opacity, transform));
83
+ @include reset.button();
84
+ @include accessibility.min-tap-target();
85
+ @include transition.add((visibility, opacity, transform));
86
86
 
87
- position: absolute; // 3.
88
- z-index: 3; // 3.
89
- display: flex;
90
- align-items: center;
91
- justify-content: center;
92
- color: var(--rui-local-arrow-color);
93
- visibility: hidden;
94
- opacity: 0;
87
+ position: absolute; // 3.
88
+ z-index: 3; // 3.
89
+ display: flex;
90
+ align-items: center;
91
+ justify-content: center;
92
+ color: var(--rui-local-arrow-color);
93
+ visibility: hidden;
94
+ opacity: 0;
95
95
  }
96
96
 
97
97
  .arrowIcon {
98
- @include caret.create();
98
+ @include caret.create();
99
99
  }
100
100
 
101
101
  .isRootVertical {
102
- height: 100%;
103
- min-height: 0; // 6.
102
+ height: 100%;
103
+ min-height: 0; // 6.
104
104
  }
105
105
 
106
106
  .isRootVertical .viewport {
107
- height: 100%;
108
- overflow-x: hidden; // 7.
109
- overflow-y: auto; // 2.
107
+ height: 100%;
108
+ overflow-x: hidden; // 7.
109
+ overflow-y: auto; // 2.
110
110
  }
111
111
 
112
112
  .isRootVertical .arrowPrev {
113
- top: 0;
114
- right: 0;
115
- left: 0;
116
- width: 100%;
117
- padding-top: $_arrow-outer-spacing;
118
- padding-bottom: $_arrow-inner-spacing;
119
- transform: translateY(theme.$arrow-initial-offset);
113
+ top: 0;
114
+ right: 0;
115
+ left: 0;
116
+ width: 100%;
117
+ padding-top: $_arrow-outer-spacing;
118
+ padding-bottom: $_arrow-inner-spacing;
119
+ transform: translateY(theme.$arrow-initial-offset);
120
120
  }
121
121
 
122
122
  .isRootVertical .arrowPrev .arrowIcon {
123
- @include caret.rotate(180);
123
+ @include caret.rotate(180);
124
124
  }
125
125
 
126
126
  .isRootVertical .arrowNext {
127
- right: 0;
128
- bottom: 0;
129
- left: 0;
130
- width: 100%;
131
- padding-top: $_arrow-inner-spacing;
132
- padding-bottom: $_arrow-outer-spacing;
133
- transform: translateY(calc(-1 * #{theme.$arrow-initial-offset}));
127
+ right: 0;
128
+ bottom: 0;
129
+ left: 0;
130
+ width: 100%;
131
+ padding-top: $_arrow-inner-spacing;
132
+ padding-bottom: $_arrow-outer-spacing;
133
+ transform: translateY(calc(-1 * #{theme.$arrow-initial-offset}));
134
134
  }
135
135
 
136
136
  .isRootHorizontal {
137
- min-width: 0; // 6.
137
+ min-width: 0; // 6.
138
138
  }
139
139
 
140
140
  .isRootHorizontal .arrowPrev {
141
- top: 0;
142
- bottom: 0;
143
- left: 0;
144
- padding-right: $_arrow-inner-spacing;
145
- padding-left: $_arrow-outer-spacing;
146
- transform: translateX(theme.$arrow-initial-offset);
141
+ top: 0;
142
+ bottom: 0;
143
+ left: 0;
144
+ padding-right: $_arrow-inner-spacing;
145
+ padding-left: $_arrow-outer-spacing;
146
+ transform: translateX(theme.$arrow-initial-offset);
147
147
  }
148
148
 
149
149
  .isRootHorizontal .arrowPrev .arrowIcon {
150
- @include caret.rotate(90);
150
+ @include caret.rotate(90);
151
151
  }
152
152
 
153
153
  .isRootHorizontal .arrowNext {
154
- top: 0;
155
- right: 0;
156
- bottom: 0;
157
- padding-right: $_arrow-outer-spacing;
158
- padding-left: $_arrow-inner-spacing;
159
- transform: translateX(calc(-1 * #{theme.$arrow-initial-offset}));
154
+ top: 0;
155
+ right: 0;
156
+ bottom: 0;
157
+ padding-right: $_arrow-outer-spacing;
158
+ padding-left: $_arrow-inner-spacing;
159
+ transform: translateX(calc(-1 * #{theme.$arrow-initial-offset}));
160
160
  }
161
161
 
162
162
  .isRootHorizontal .arrowNext .arrowIcon {
163
- @include caret.rotate(270);
163
+ @include caret.rotate(270);
164
164
  }
165
165
 
166
166
  .isRootVertical .scrollingShadows::before,
167
167
  .isRootVertical .scrollingShadows::after {
168
- right: 0;
169
- left: 0;
168
+ right: 0;
169
+ left: 0;
170
170
  }
171
171
 
172
172
  .isRootVertical .scrollingShadows::before {
173
- top: 0;
174
- transform: translateY(theme.$shadow-initial-offset);
173
+ top: 0;
174
+ transform: translateY(theme.$shadow-initial-offset);
175
175
  }
176
176
 
177
177
  .isRootVertical .scrollingShadows::after {
178
- bottom: 0;
179
- transform: translateY(calc(-1 * #{theme.$shadow-initial-offset}));
178
+ bottom: 0;
179
+ transform: translateY(calc(-1 * #{theme.$shadow-initial-offset}));
180
180
  }
181
181
 
182
182
  .isRootHorizontal .viewport {
183
- overflow-x: auto; // 2.
184
- overflow-y: hidden; // 5., 7.
183
+ overflow-x: auto; // 2.
184
+ overflow-y: hidden; // 5., 7.
185
185
  }
186
186
 
187
187
  .isRootHorizontal .content {
188
- display: inline-flex; // 4.
189
- min-width: 100%;
188
+ display: inline-flex; // 4.
189
+ min-width: 100%;
190
190
  }
191
191
 
192
192
  .isRootHorizontal .scrollingShadows::before,
193
193
  .isRootHorizontal .scrollingShadows::after {
194
- top: 0;
195
- bottom: 0;
194
+ top: 0;
195
+ bottom: 0;
196
196
  }
197
197
 
198
198
  .isRootHorizontal .scrollingShadows::before {
199
- left: 0;
200
- transform: translateX(theme.$shadow-initial-offset);
199
+ left: 0;
200
+ transform: translateX(theme.$shadow-initial-offset);
201
201
  }
202
202
 
203
203
  .isRootHorizontal .scrollingShadows::after {
204
- right: 0;
205
- transform: translateX(calc(-1 * #{theme.$shadow-initial-offset}));
204
+ right: 0;
205
+ transform: translateX(calc(-1 * #{theme.$shadow-initial-offset}));
206
206
  }
207
207
 
208
208
  .isRootScrolledAtStart .scrollingShadows::before,
209
209
  .isRootScrolledAtStart .arrowPrev {
210
- visibility: visible;
211
- opacity: 1;
212
- transform: translate(0, 0);
210
+ visibility: visible;
211
+ opacity: 1;
212
+ transform: translate(0, 0);
213
213
  }
214
214
 
215
215
  .isRootScrolledAtEnd .scrollingShadows::after,
216
216
  .isRootScrolledAtEnd .arrowNext {
217
- visibility: visible;
218
- opacity: 1;
219
- transform: translate(0, 0);
217
+ visibility: visible;
218
+ opacity: 1;
219
+ transform: translate(0, 0);
220
220
  }
221
221
 
222
222
  .hasRootScrollbarDisabled .viewport {
223
- @include scrollbar.hide();
223
+ @include scrollbar.hide();
224
224
  }
@@ -9,5 +9,3 @@ export const getElementsPositionDifference = (contentEl, viewportEl) => {
9
9
  top: contentPosition.top - viewportPosition.top,
10
10
  };
11
11
  };
12
-
13
- export default getElementsPositionDifference;
@@ -2,7 +2,7 @@ import {
2
2
  useLayoutEffect,
3
3
  useRef,
4
4
  } from 'react';
5
- import { getElementsPositionDifference } from '../services/elementPositionService';
5
+ import { getElementsPositionDifference } from '../_helpers/getElementsPositionDifference';
6
6
 
7
7
  export const useLoadResize = (effect, dependencies, contentEl, viewportEl, wait) => {
8
8
  const throttleTimeout = useRef(null);
@@ -2,7 +2,7 @@ import {
2
2
  useLayoutEffect,
3
3
  useRef,
4
4
  } from 'react';
5
- import { getElementsPositionDifference } from '../services/elementPositionService';
5
+ import { getElementsPositionDifference } from '../_helpers/getElementsPositionDifference';
6
6
 
7
7
  export const useScrollPosition = (effect, dependencies, contentEl, viewportEl, wait) => {
8
8
  const throttleTimeout = useRef(null);
@@ -1,10 +1,11 @@
1
1
  import PropTypes from 'prop-types';
2
2
  import React, { useContext } from 'react';
3
- import getRootSizeClassName from '../../helpers/getRootSizeClassName';
4
- import getRootValidationStateClassName from '../../helpers/getRootValidationStateClassName';
5
- import { resolveContextOrProp } from '../../helpers/resolveContextOrProp';
6
3
  import { withProviderContext } from '../../provider';
7
- import transferProps from '../../utils/transferProps';
4
+ import { classNames } from '../../utils/classNames';
5
+ import { getRootSizeClassName } from '../_helpers/getRootSizeClassName';
6
+ import { getRootValidationStateClassName } from '../_helpers/getRootValidationStateClassName';
7
+ import { resolveContextOrProp } from '../_helpers/resolveContextOrProp';
8
+ import { transferProps } from '../_helpers/transferProps';
8
9
  import { FormLayoutContext } from '../FormLayout';
9
10
  import withForwardedRef from '../withForwardedRef';
10
11
  import styles from './SelectField.scss';
@@ -31,27 +32,27 @@ export const SelectField = ({
31
32
 
32
33
  return (
33
34
  <label
34
- className={[
35
+ className={classNames(
35
36
  styles.root,
36
- fullWidth ? styles.isRootFullWidth : '',
37
- context ? styles.isRootInFormLayout : '',
37
+ fullWidth && styles.isRootFullWidth,
38
+ context && styles.isRootInFormLayout,
38
39
  resolveContextOrProp(context && context.layout, layout) === 'horizontal'
39
40
  ? styles.rootLayoutHorizontal
40
41
  : styles.rootLayoutVertical,
41
- disabled ? styles.isRootDisabled : '',
42
- required ? styles.isRootRequired : '',
42
+ disabled && styles.isRootDisabled,
43
+ required && styles.isRootRequired,
43
44
  getRootSizeClassName(size, styles),
44
45
  getRootValidationStateClassName(validationState, styles),
45
46
  variant === 'filled' ? styles.rootVariantFilled : styles.rootVariantOutline,
46
- ].join(' ')}
47
+ )}
47
48
  htmlFor={id}
48
49
  id={id && `${id}__label`}
49
50
  >
50
51
  <div
51
- className={[
52
+ className={classNames(
52
53
  styles.label,
53
- isLabelVisible ? '' : styles.isLabelHidden,
54
- ].join(' ')}
54
+ !isLabelVisible && styles.isLabelHidden,
55
+ )}
55
56
  id={id && `${id}__labelText`}
56
57
  >
57
58
  {label}
@@ -1,104 +1,104 @@
1
- @use '../../styles/tools/form-fields/box-field-elements';
2
- @use '../../styles/tools/form-fields/box-field-layout';
3
- @use '../../styles/tools/form-fields/box-field-sizes';
4
- @use '../../styles/tools/form-fields/foundation';
5
- @use '../../styles/tools/form-fields/variants';
6
- @use '../../styles/tools/accessibility';
1
+ @use "../../styles/tools/form-fields/box-field-elements";
2
+ @use "../../styles/tools/form-fields/box-field-layout";
3
+ @use "../../styles/tools/form-fields/box-field-sizes";
4
+ @use "../../styles/tools/form-fields/foundation";
5
+ @use "../../styles/tools/form-fields/variants";
6
+ @use "../../styles/tools/accessibility";
7
7
 
8
8
  // Foundation
9
9
  .root {
10
- @include foundation.root();
10
+ @include foundation.root();
11
11
  }
12
12
 
13
13
  .label {
14
- @include foundation.label();
14
+ @include foundation.label();
15
15
  }
16
16
 
17
17
  .inputContainer {
18
- @include box-field-elements.input-container();
18
+ @include box-field-elements.input-container();
19
19
  }
20
20
 
21
21
  .input {
22
- @include box-field-elements.input();
23
- @include box-field-elements.input-select();
24
- @include box-field-elements.input-select-option();
22
+ @include box-field-elements.input();
23
+ @include box-field-elements.input-select();
24
+ @include box-field-elements.input-select-option();
25
25
  }
26
26
 
27
27
  .caret {
28
- @include box-field-elements.caret();
28
+ @include box-field-elements.caret();
29
29
  }
30
30
 
31
31
  .caretIcon {
32
- @include box-field-elements.caret-icon();
32
+ @include box-field-elements.caret-icon();
33
33
  }
34
34
 
35
35
  .bottomLine {
36
- @include box-field-elements.bottom-line();
36
+ @include box-field-elements.bottom-line();
37
37
  }
38
38
 
39
39
  .helpText,
40
40
  .validationText {
41
- @include foundation.help-text();
41
+ @include foundation.help-text();
42
42
  }
43
43
 
44
44
  .isRootRequired .label {
45
- @include foundation.label-required();
45
+ @include foundation.label-required();
46
46
  }
47
47
 
48
48
  // Variants
49
49
  .rootVariantFilled {
50
- @include variants.visual(box, $variant: filled, $has-caret: true);
50
+ @include variants.visual(box, $variant: filled, $has-caret: true);
51
51
  }
52
52
 
53
53
  .rootVariantOutline {
54
- @include variants.visual(box, $variant: outline, $has-caret: true);
54
+ @include variants.visual(box, $variant: outline, $has-caret: true);
55
55
  }
56
56
 
57
57
  // States
58
58
  .isRootStateInvalid {
59
- @include variants.validation(invalid);
59
+ @include variants.validation(invalid);
60
60
  }
61
61
 
62
62
  .isRootStateValid {
63
- @include variants.validation(valid);
63
+ @include variants.validation(valid);
64
64
  }
65
65
 
66
66
  .isRootStateWarning {
67
- @include variants.validation(warning);
67
+ @include variants.validation(warning);
68
68
  }
69
69
 
70
70
  // Invisible label
71
71
  .isLabelHidden {
72
- @include accessibility.hide-text();
72
+ @include accessibility.hide-text();
73
73
  }
74
74
 
75
75
  // Layouts
76
76
  .rootLayoutVertical,
77
77
  .rootLayoutHorizontal {
78
- @include box-field-layout.vertical();
78
+ @include box-field-layout.vertical();
79
79
  }
80
80
 
81
81
  .rootLayoutHorizontal {
82
- @include box-field-layout.horizontal();
82
+ @include box-field-layout.horizontal();
83
83
  }
84
84
 
85
85
  .isRootFullWidth {
86
- @include box-field-layout.full-width();
86
+ @include box-field-layout.full-width();
87
87
  }
88
88
 
89
89
  .isRootInFormLayout {
90
- @include box-field-layout.in-form-layout();
90
+ @include box-field-layout.in-form-layout();
91
91
  }
92
92
 
93
93
  // Sizes
94
94
  .rootSizeSmall {
95
- @include box-field-sizes.size(small);
95
+ @include box-field-sizes.size(small);
96
96
  }
97
97
 
98
98
  .rootSizeMedium {
99
- @include box-field-sizes.size(medium);
99
+ @include box-field-sizes.size(medium);
100
100
  }
101
101
 
102
102
  .rootSizeLarge {
103
- @include box-field-sizes.size(large);
103
+ @include box-field-sizes.size(large);
104
104
  }
@@ -1,59 +1,52 @@
1
- @use '../../styles/tools/transition';
2
- @use 'settings';
3
-
4
- // Ignore pascalCase values of `composes` property:
5
- // stylelint-disable value-keyword-case
1
+ @use "../../styles/tools/transition";
2
+ @use "settings";
6
3
 
7
4
  .table {
8
- width: 100%;
9
- border-collapse: collapse;
5
+ width: 100%;
6
+ border-collapse: collapse;
10
7
  }
11
8
 
12
- .tableRow {
13
- @include transition.add((background-color));
9
+ .tableRow,
10
+ .tableHeadRow {
11
+ @include transition.add((background-color));
12
+ }
14
13
 
15
- background-color: settings.$background-color;
14
+ .tableRow {
15
+ background-color: settings.$background-color;
16
16
 
17
- &:hover {
18
- background-color: settings.$hover-background-color;
19
- }
17
+ &:hover {
18
+ background-color: settings.$hover-background-color;
19
+ }
20
20
  }
21
21
 
22
22
  .tableHeadRow {
23
- composes: tableRow;
24
- background-color: settings.$head-background-color;
25
-
26
- &:hover {
27
23
  background-color: settings.$head-background-color;
28
- }
29
- }
30
-
31
- .tableCell {
32
- padding: settings.$cell-padding-y settings.$cell-padding-x;
33
- text-align: left;
34
- border-bottom: settings.$border-width solid settings.$border-color;
35
- }
36
24
 
37
- .tableHeadCell {
38
- composes: tableCell;
39
- font-weight: settings.$head-font-weight;
40
- border-bottom-width: 2px;
25
+ &:hover {
26
+ background-color: settings.$head-background-color;
27
+ }
41
28
  }
42
29
 
30
+ .tableCell,
31
+ .tableHeadCell,
43
32
  .isTableCellSortingActive,
44
33
  .isTableHeadCellSortingActive {
45
- background-color: settings.$sorted-background-color;
34
+ padding: settings.$cell-padding-y settings.$cell-padding-x;
35
+ text-align: left;
36
+ border-bottom: settings.$border-width solid settings.$border-color;
46
37
  }
47
38
 
48
- .isTableCellSortingActive {
49
- composes: tableCell;
39
+ .tableHeadCell {
40
+ font-weight: settings.$head-font-weight;
41
+ border-bottom-width: 2px;
50
42
  }
51
43
 
44
+ .isTableCellSortingActive,
52
45
  .isTableHeadCellSortingActive {
53
- composes: tableHeadCell;
46
+ background-color: settings.$sorted-background-color;
54
47
  }
55
48
 
56
49
  .sortButton {
57
- display: inline-block;
58
- margin-right: settings.$cell-padding-x;
50
+ display: inline-block;
51
+ margin-right: settings.$cell-padding-x;
59
52
  }
@@ -1,8 +1,8 @@
1
- @use 'sass:map';
2
- @use '../../styles/theme/borders';
3
- @use '../../styles/theme/colors';
4
- @use '../../styles/theme/typography';
5
- @use '../../styles/tools/spacing';
1
+ @use "sass:map";
2
+ @use "../../styles/theme/borders";
3
+ @use "../../styles/theme/colors";
4
+ @use "../../styles/theme/typography";
5
+ @use "../../styles/tools/spacing";
6
6
 
7
7
  $cell-padding-x: spacing.of(3);
8
8
  $cell-padding-y: spacing.of(1);