@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
@@ -15,142 +15,140 @@
15
15
  //
16
16
  // 5. Use original padding to restore square buttons back to their size.
17
17
 
18
- @use 'sass:list';
19
- @use 'sass:map';
20
- @use 'sass:math';
21
- @use '../../styles/tools/accessibility';
22
- @use '../../styles/tools/breakpoint';
23
- @use '../../styles/tools/transition';
24
- @use 'settings';
25
- @use 'theme';
18
+ @use "sass:list";
19
+ @use "sass:map";
20
+ @use "sass:math";
21
+ @use "../../styles/tools/accessibility";
22
+ @use "../../styles/tools/breakpoint";
23
+ @use "../../styles/tools/transition";
24
+ @use "settings";
25
+ @use "theme";
26
26
 
27
27
  // 1.
28
28
  @mixin _get-themeable-properties($priority, $color, $state) {
29
- @if (not list.index(map.keys(settings.$themeable-priority-properties), $priority)) {
30
- @error "Invalid priority specified! #{$priority} doesn't exist. "
31
- + "Choose one of #{settings.$themeable-priority-properties}.";
32
- }
33
-
34
- @if (not list.index(settings.$themeable-variants, $color)) {
35
- @error "Invalid variant specified! #{$color} doesn't exist. "
36
- + "Choose one of #{settings.$themeable-variants}.";
37
- }
38
-
39
- @if (not list.index(settings.$themeable-states, $state)) {
40
- @error "Invalid state specified! #{$state} doesn't exist. "
41
- + "Choose one of #{settings.$themeable-states}.";
42
- }
43
-
44
- $properties: map.get(settings.$themeable-priority-properties, $priority);
45
-
46
- // 2.
47
- @if ($state == 'disabled') {
48
- @each $property in $properties {
49
- --rui-local-#{$property}:
50
- var(
51
- --rui-Button--#{$priority}--#{$color}--#{$state}__#{$property},
52
- var(--rui-Button--#{$priority}--#{$color}--default__#{$property})
53
- );
29
+ @if not list.index(map.keys(settings.$themeable-priority-properties), $priority) {
30
+ @error "Invalid priority specified! #{$priority} doesn't exist. "
31
+ + "Choose one of #{settings.$themeable-priority-properties}.";
54
32
  }
55
- }
56
33
 
57
- @else {
58
- @each $property in $properties {
59
- --rui-local-#{$property}: var(--rui-Button--#{$priority}--#{$color}--#{$state}__#{$property});
34
+ @if not list.index(settings.$themeable-variants, $color) {
35
+ @error "Invalid variant specified! #{$color} doesn't exist. "
36
+ + "Choose one of #{settings.$themeable-variants}.";
37
+ }
38
+
39
+ @if not list.index(settings.$themeable-states, $state) {
40
+ @error "Invalid state specified! #{$state} doesn't exist. "
41
+ + "Choose one of #{settings.$themeable-states}.";
42
+ }
43
+
44
+ $properties: map.get(settings.$themeable-priority-properties, $priority);
45
+
46
+ // 2.
47
+ @if $state == "disabled" {
48
+ @each $property in $properties {
49
+ --rui-local-#{$property}:
50
+ var(
51
+ --rui-Button--#{$priority}--#{$color}--#{$state}__#{$property},
52
+ var(--rui-Button--#{$priority}--#{$color}--default__#{$property})
53
+ );
54
+ }
55
+ } @else {
56
+ @each $property in $properties {
57
+ --rui-local-#{$property}: var(--rui-Button--#{$priority}--#{$color}--#{$state}__#{$property});
58
+ }
60
59
  }
61
- }
62
60
  }
63
61
 
64
62
  // 4.
65
63
  @mixin _button-square() {
66
- --rui-local-padding: 0;
67
- --rui-local-width: var(--rui-local-height);
64
+ --rui-local-padding: 0;
65
+ --rui-local-width: var(--rui-local-height);
68
66
  }
69
67
 
70
68
  // 5.
71
69
  @mixin _button-size-restore() {
72
- --rui-local-padding: var(--rui-local-padding-original);
73
- --rui-local-width: unset;
70
+ --rui-local-padding: var(--rui-local-padding-original);
71
+ --rui-local-width: unset;
74
72
  }
75
73
 
76
74
  @mixin button() {
77
- @include transition.add((opacity, color, border-color, background-color, box-shadow));
78
-
79
- position: relative; // 3.
80
- display: inline-flex;
81
- column-gap: settings.$icon-spacing;
82
- align-items: center;
83
- justify-content: center;
84
- width: var(--rui-local-width, auto);
85
- height: var(--rui-local-height, auto);
86
- padding: var(--rui-local-padding);
87
- font: theme.$font-weight list.slash(var(--rui-local-font-size), settings.$line-height) settings.$font-family;
88
- letter-spacing: theme.$letter-spacing;
89
- text-align: center;
90
- text-decoration: none;
91
- text-transform: theme.$text-transform;
92
- vertical-align: middle;
93
- color: var(--rui-local-color);
94
- border: theme.$border-width solid var(--rui-local-border-color, transparent);
95
- border-radius: theme.$border-radius;
96
- background: var(--rui-local-background, transparent);
97
- box-shadow: var(--rui-local-box-shadow, none);
98
- user-select: none;
99
- cursor: pointer;
100
-
101
- &:hover,
102
- &:focus {
75
+ @include transition.add((opacity, color, border-color, background-color, box-shadow));
76
+
77
+ position: relative; // 3.
78
+ display: inline-flex;
79
+ column-gap: settings.$icon-spacing;
80
+ align-items: center;
81
+ justify-content: center;
82
+ width: var(--rui-local-width, auto);
83
+ min-height: var(--rui-local-height, auto);
84
+ padding: var(--rui-local-padding);
85
+ font: theme.$font-weight list.slash(var(--rui-local-font-size), settings.$line-height) settings.$font-family;
86
+ letter-spacing: theme.$letter-spacing;
87
+ text-align: center;
103
88
  text-decoration: none;
104
- }
89
+ text-transform: theme.$text-transform;
90
+ vertical-align: middle;
91
+ color: var(--rui-local-color);
92
+ border: theme.$border-width solid var(--rui-local-border-color, transparent);
93
+ border-radius: theme.$border-radius;
94
+ background: var(--rui-local-background, transparent);
95
+ box-shadow: var(--rui-local-box-shadow, none);
96
+ user-select: none;
97
+ cursor: pointer;
98
+
99
+ &:hover,
100
+ &:focus {
101
+ text-decoration: none;
102
+ }
105
103
 
106
- &:disabled {
107
- opacity: theme.$disabled-opacity;
108
- cursor: theme.$disabled-cursor;
109
- }
104
+ &:disabled {
105
+ opacity: theme.$disabled-opacity;
106
+ cursor: theme.$disabled-cursor;
107
+ }
110
108
 
111
- &:-moz-focusring {
112
- outline: 0;
113
- }
109
+ &:-moz-focusring {
110
+ outline: 0;
111
+ }
114
112
  }
115
113
 
116
114
  @mixin button-size($size) {
117
- $properties: map.get(theme.$sizes, $size);
115
+ $properties: map.get(theme.$sizes, $size);
118
116
 
119
- --rui-local-height: #{map.get($properties, height)};
120
- --rui-local-padding: 0 #{map.get($properties, padding-x)};
121
- --rui-local-padding-original: 0 #{map.get($properties, padding-x)}; // 5.
122
- --rui-local-font-size: #{map.get($properties, font-size)};
117
+ --rui-local-height: #{map.get($properties, height)};
118
+ --rui-local-padding: #{map.get($properties, padding-y)} #{map.get($properties, padding-x)};
119
+ --rui-local-padding-original: #{map.get($properties, padding-y)} #{map.get($properties, padding-x)}; // 5.
120
+ --rui-local-font-size: #{map.get($properties, font-size)};
123
121
  }
124
122
 
125
123
  @mixin button-color($priority, $color) {
126
- @include _get-themeable-properties($priority, $color, default);
124
+ @include _get-themeable-properties($priority, $color, default);
127
125
 
128
- &:disabled {
129
- @include _get-themeable-properties($priority, $color, disabled);
130
- }
126
+ &:disabled {
127
+ @include _get-themeable-properties($priority, $color, disabled);
128
+ }
131
129
 
132
- &:not(:disabled):hover,
133
- &:not(:disabled):focus {
134
- @include _get-themeable-properties($priority, $color, hover);
135
- }
130
+ &:not(:disabled):hover,
131
+ &:not(:disabled):focus {
132
+ @include _get-themeable-properties($priority, $color, hover);
133
+ }
136
134
 
137
- &:not(:disabled):active {
138
- @include _get-themeable-properties($priority, $color, active);
139
- }
135
+ &:not(:disabled):active {
136
+ @include _get-themeable-properties($priority, $color, active);
137
+ }
140
138
  }
141
139
 
142
140
  @mixin hide-label() {
143
- @include _button-square();
141
+ @include _button-square();
144
142
 
145
- .label {
146
- @include accessibility.hide-text();
147
- }
143
+ .label {
144
+ @include accessibility.hide-text();
145
+ }
148
146
  }
149
147
 
150
148
  @mixin show-label() {
151
- @include _button-size-restore();
149
+ @include _button-size-restore();
152
150
 
153
- .label {
154
- @include accessibility.unhide-text();
155
- }
151
+ .label {
152
+ @include accessibility.unhide-text();
153
+ }
156
154
  }
@@ -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 './ButtonGroup.scss';
5
6
  import { ButtonGroupContext } from './ButtonGroupContext';
6
7
 
@@ -13,10 +14,10 @@ export const ButtonGroup = ({
13
14
  ...restProps
14
15
  }) => (
15
16
  <div
16
- className={[
17
+ className={classNames(
17
18
  styles.root,
18
- block ? styles.isRootBlock : '',
19
- ].join(' ')}
19
+ block && styles.isRootBlock,
20
+ )}
20
21
  role="group"
21
22
  {...restProps}
22
23
  >
@@ -1,8 +1,8 @@
1
1
  .root {
2
- display: inline-flex;
2
+ display: inline-flex;
3
3
  }
4
4
 
5
5
  .isRootBlock {
6
- display: flex;
7
- width: 100%;
6
+ display: flex;
7
+ width: 100%;
8
8
  }
@@ -1,7 +1,8 @@
1
1
  import PropTypes from 'prop-types';
2
2
  import React from 'react';
3
- import getRootColorClassName from '../../helpers/getRootColorClassName';
4
3
  import { withProviderContext } from '../../provider';
4
+ import { classNames } from '../../utils/classNames';
5
+ import { getRootColorClassName } from '../_helpers/getRootColorClassName';
5
6
  import styles from './Card.scss';
6
7
 
7
8
  export const Card = ({
@@ -13,13 +14,13 @@ export const Card = ({
13
14
  color,
14
15
  }) => (
15
16
  <div
16
- className={[
17
+ className={classNames(
17
18
  styles.root,
18
19
  getRootColorClassName(color, styles),
19
- dense ? styles.rootDense : '',
20
- raised ? styles.rootRaised : '',
21
- disabled ? styles.isDisabled : '',
22
- ].join(' ')}
20
+ dense && styles.rootDense,
21
+ raised && styles.rootRaised,
22
+ disabled && styles.isDisabled,
23
+ )}
23
24
  id={id}
24
25
  >
25
26
  {children}
@@ -1,79 +1,79 @@
1
1
  // 1. Retain equal card widths in flex and grid layouts independently on their content.
2
2
 
3
- @use '../../styles/theme/colors';
4
- @use 'theme';
5
- @use 'tools';
3
+ @use "../../styles/theme/colors";
4
+ @use "theme";
5
+ @use "tools";
6
6
 
7
7
  .root {
8
- --rui-local-padding: #{theme.$padding};
8
+ --rui-local-padding: #{theme.$padding};
9
9
 
10
- display: flex;
11
- flex-direction: column;
12
- min-width: 0; // 1.
13
- color: var(--rui-local-color);
14
- border: theme.$border-width solid var(--rui-local-border-color);
15
- border-radius: theme.$border-radius;
16
- background-color: var(--rui-local-background-color);
10
+ display: flex;
11
+ flex-direction: column;
12
+ min-width: 0; // 1.
13
+ color: var(--rui-local-color);
14
+ border: theme.$border-width solid var(--rui-local-border-color);
15
+ border-radius: theme.$border-radius;
16
+ background-color: var(--rui-local-background-color);
17
17
  }
18
18
 
19
19
  .body {
20
- flex: 1 0 auto;
21
- padding: var(--rui-local-padding);
20
+ flex: 1 0 auto;
21
+ padding: var(--rui-local-padding);
22
22
  }
23
23
 
24
24
  .footer {
25
- padding: var(--rui-local-padding);
25
+ padding: var(--rui-local-padding);
26
26
  }
27
27
 
28
28
  .rootDense {
29
- --rui-local-padding: #{theme.$dense-padding};
29
+ --rui-local-padding: #{theme.$dense-padding};
30
30
  }
31
31
 
32
32
  .rootRaised {
33
- box-shadow: theme.$raised-box-shadow;
33
+ box-shadow: theme.$raised-box-shadow;
34
34
  }
35
35
 
36
36
  .rootColorPrimary {
37
- @include tools.color(primary);
37
+ @include tools.color(primary);
38
38
  }
39
39
 
40
40
  .rootColorSecondary {
41
- @include tools.color(secondary);
41
+ @include tools.color(secondary);
42
42
  }
43
43
 
44
44
  .rootColorSuccess {
45
- @include tools.color(success);
45
+ @include tools.color(success);
46
46
  }
47
47
 
48
48
  .rootColorWarning {
49
- @include tools.color(warning);
49
+ @include tools.color(warning);
50
50
  }
51
51
 
52
52
  .rootColorDanger {
53
- @include tools.color(danger);
53
+ @include tools.color(danger);
54
54
  }
55
55
 
56
56
  .rootColorHelp {
57
- @include tools.color(help);
57
+ @include tools.color(help);
58
58
  }
59
59
 
60
60
  .rootColorInfo {
61
- @include tools.color(info);
61
+ @include tools.color(info);
62
62
  }
63
63
 
64
64
  .rootColorNote {
65
- @include tools.color(note);
65
+ @include tools.color(note);
66
66
  }
67
67
 
68
68
  .rootColorLight {
69
- @include tools.color(light);
69
+ @include tools.color(light);
70
70
  }
71
71
 
72
72
  .rootColorDark {
73
- @include tools.color(dark);
73
+ @include tools.color(dark);
74
74
  }
75
75
 
76
76
  .isDisabled {
77
- background-color: theme.$disabled-background-color;
78
- opacity: theme.$disabled-opacity;
77
+ background-color: theme.$disabled-background-color;
78
+ opacity: theme.$disabled-opacity;
79
79
  }
@@ -9,54 +9,54 @@ $disabled-background-color: var(--rui-Card--disabled__background-color);
9
9
  $disabled-opacity: var(--rui-Card--disabled__opacity);
10
10
 
11
11
  $colors: (
12
- primary: (
13
- color: var(--rui-Card--primary__color),
14
- border-color: var(--rui-Card--primary__border-color),
15
- background-color: var(--rui-Card--primary__background-color),
16
- ),
17
- secondary: (
18
- color: var(--rui-Card--secondary__color),
19
- border-color: var(--rui-Card--secondary__border-color),
20
- background-color: var(--rui-Card--secondary__background-color),
21
- ),
22
- success: (
23
- color: var(--rui-Card--success__color),
24
- border-color: var(--rui-Card--success__border-color),
25
- background-color: var(--rui-Card--success__background-color),
26
- ),
27
- warning: (
28
- color: var(--rui-Card--warning__color),
29
- border-color: var(--rui-Card--warning__border-color),
30
- background-color: var(--rui-Card--warning__background-color),
31
- ),
32
- danger: (
33
- color: var(--rui-Card--danger__color),
34
- border-color: var(--rui-Card--danger__border-color),
35
- background-color: var(--rui-Card--danger__background-color),
36
- ),
37
- info: (
38
- color: var(--rui-Card--info__color),
39
- border-color: var(--rui-Card--info__border-color),
40
- background-color: var(--rui-Card--info__background-color),
41
- ),
42
- help: (
43
- color: var(--rui-Card--help__color),
44
- border-color: var(--rui-Card--help__border-color),
45
- background-color: var(--rui-Card--help__background-color),
46
- ),
47
- note: (
48
- color: var(--rui-Card--note__color),
49
- border-color: var(--rui-Card--note__border-color),
50
- background-color: var(--rui-Card--note__background-color),
51
- ),
52
- light: (
53
- color: var(--rui-Card--light__color),
54
- border-color: var(--rui-Card--light__border-color),
55
- background-color: var(--rui-Card--light__background-color),
56
- ),
57
- dark: (
58
- color: var(--rui-Card--dark__color),
59
- border-color: var(--rui-Card--dark__border-color),
60
- background-color: var(--rui-Card--dark__background-color),
61
- ),
12
+ primary: (
13
+ color: var(--rui-Card--primary__color),
14
+ border-color: var(--rui-Card--primary__border-color),
15
+ background-color: var(--rui-Card--primary__background-color),
16
+ ),
17
+ secondary: (
18
+ color: var(--rui-Card--secondary__color),
19
+ border-color: var(--rui-Card--secondary__border-color),
20
+ background-color: var(--rui-Card--secondary__background-color),
21
+ ),
22
+ success: (
23
+ color: var(--rui-Card--success__color),
24
+ border-color: var(--rui-Card--success__border-color),
25
+ background-color: var(--rui-Card--success__background-color),
26
+ ),
27
+ warning: (
28
+ color: var(--rui-Card--warning__color),
29
+ border-color: var(--rui-Card--warning__border-color),
30
+ background-color: var(--rui-Card--warning__background-color),
31
+ ),
32
+ danger: (
33
+ color: var(--rui-Card--danger__color),
34
+ border-color: var(--rui-Card--danger__border-color),
35
+ background-color: var(--rui-Card--danger__background-color),
36
+ ),
37
+ info: (
38
+ color: var(--rui-Card--info__color),
39
+ border-color: var(--rui-Card--info__border-color),
40
+ background-color: var(--rui-Card--info__background-color),
41
+ ),
42
+ help: (
43
+ color: var(--rui-Card--help__color),
44
+ border-color: var(--rui-Card--help__border-color),
45
+ background-color: var(--rui-Card--help__background-color),
46
+ ),
47
+ note: (
48
+ color: var(--rui-Card--note__color),
49
+ border-color: var(--rui-Card--note__border-color),
50
+ background-color: var(--rui-Card--note__background-color),
51
+ ),
52
+ light: (
53
+ color: var(--rui-Card--light__color),
54
+ border-color: var(--rui-Card--light__border-color),
55
+ background-color: var(--rui-Card--light__background-color),
56
+ ),
57
+ dark: (
58
+ color: var(--rui-Card--dark__color),
59
+ border-color: var(--rui-Card--dark__border-color),
60
+ background-color: var(--rui-Card--dark__background-color),
61
+ ),
62
62
  );
@@ -1,10 +1,10 @@
1
- @use 'sass:map';
2
- @use 'theme';
1
+ @use "sass:map";
2
+ @use "theme";
3
3
 
4
4
  @mixin color($color) {
5
- $color-variant-properties: map.get(theme.$colors, $color);
5
+ $color-variant-properties: map.get(theme.$colors, $color);
6
6
 
7
- --rui-local-color: #{map.get($color-variant-properties, color)};
8
- --rui-local-border-color: #{map.get($color-variant-properties, border-color)};
9
- --rui-local-background-color: #{map.get($color-variant-properties, background-color)};
7
+ --rui-local-color: #{map.get($color-variant-properties, color)};
8
+ --rui-local-border-color: #{map.get($color-variant-properties, border-color)};
9
+ --rui-local-background-color: #{map.get($color-variant-properties, background-color)};
10
10
  }
@@ -1,8 +1,9 @@
1
1
  import PropTypes from 'prop-types';
2
2
  import React, { useContext } from 'react';
3
- import getRootValidationStateClassName from '../../helpers/getRootValidationStateClassName';
4
3
  import { withProviderContext } from '../../provider';
5
- import transferProps from '../../utils/transferProps';
4
+ import { classNames } from '../../utils/classNames';
5
+ import { getRootValidationStateClassName } from '../_helpers/getRootValidationStateClassName';
6
+ import { transferProps } from '../_helpers/transferProps';
6
7
  import { FormLayoutContext } from '../FormLayout';
7
8
  import withForwardedRef from '../withForwardedRef';
8
9
  import styles from './CheckboxField.scss';
@@ -26,15 +27,15 @@ export const CheckboxField = ({
26
27
 
27
28
  return (
28
29
  <label
29
- className={[
30
+ className={classNames(
30
31
  styles.root,
31
- context ? styles.isRootInFormLayout : '',
32
+ context && styles.isRootInFormLayout,
32
33
  context && context.layout === 'horizontal' ? styles.rootLayoutHorizontal : styles.rootLayoutVertical,
33
- labelPosition === 'before' ? styles.hasRootLabelBefore : '',
34
- disabled ? styles.isRootDisabled : '',
35
- required ? styles.isRootRequired : '',
34
+ labelPosition === 'before' && styles.hasRootLabelBefore,
35
+ disabled && styles.isRootDisabled,
36
+ required && styles.isRootRequired,
36
37
  getRootValidationStateClassName(validationState, styles),
37
- ].join(' ')}
38
+ )}
38
39
  htmlFor={id}
39
40
  id={id && `${id}__label`}
40
41
  >
@@ -51,10 +52,10 @@ export const CheckboxField = ({
51
52
  value={value}
52
53
  />
53
54
  <div
54
- className={[
55
+ className={classNames(
55
56
  styles.label,
56
- isLabelVisible ? '' : styles.isLabelHidden,
57
- ].join(' ')}
57
+ !isLabelVisible && styles.isLabelHidden,
58
+ )}
58
59
  id={id && `${id}__labelText`}
59
60
  >
60
61
  {label}
@@ -1,61 +1,61 @@
1
- @use '../../styles/tools/form-fields/foundation';
2
- @use '../../styles/tools/form-fields/inline-field-elements';
3
- @use '../../styles/tools/form-fields/inline-field-layout';
4
- @use '../../styles/tools/form-fields/variants';
5
- @use '../../styles/tools/accessibility';
1
+ @use "../../styles/tools/form-fields/foundation";
2
+ @use "../../styles/tools/form-fields/inline-field-elements";
3
+ @use "../../styles/tools/form-fields/inline-field-layout";
4
+ @use "../../styles/tools/form-fields/variants";
5
+ @use "../../styles/tools/accessibility";
6
6
 
7
7
  // Foundation
8
8
  .root {
9
- @include foundation.root();
10
- @include inline-field-layout.root();
11
- @include inline-field-elements.min-tap-target($type: checkbox);
12
- @include variants.visual(check);
9
+ @include foundation.root();
10
+ @include inline-field-layout.root();
11
+ @include inline-field-elements.min-tap-target($type: checkbox);
12
+ @include variants.visual(check);
13
13
  }
14
14
 
15
15
  .label {
16
- @include foundation.label();
16
+ @include foundation.label();
17
17
  }
18
18
 
19
19
  .field {
20
- @include inline-field-layout.field();
20
+ @include inline-field-layout.field();
21
21
  }
22
22
 
23
23
  .input {
24
- @include inline-field-elements.check-input($type: checkbox);
24
+ @include inline-field-elements.check-input($type: checkbox);
25
25
  }
26
26
 
27
27
  .helpText,
28
28
  .validationText {
29
- @include foundation.help-text();
29
+ @include foundation.help-text();
30
30
  }
31
31
 
32
32
  .isRootRequired .label {
33
- @include foundation.label-required();
33
+ @include foundation.label-required();
34
34
  }
35
35
 
36
36
  // States
37
37
  .isRootStateInvalid {
38
- @include variants.validation(invalid);
38
+ @include variants.validation(invalid);
39
39
  }
40
40
 
41
41
  .isRootStateValid {
42
- @include variants.validation(valid);
42
+ @include variants.validation(valid);
43
43
  }
44
44
 
45
45
  .isRootStateWarning {
46
- @include variants.validation(warning);
46
+ @include variants.validation(warning);
47
47
  }
48
48
 
49
49
  // Invisible label
50
50
  .isLabelHidden {
51
- @include accessibility.hide-text();
51
+ @include accessibility.hide-text();
52
52
  }
53
53
 
54
54
  // Layouts
55
55
  .hasRootLabelBefore {
56
- @include inline-field-layout.has-label-before();
56
+ @include inline-field-layout.has-label-before();
57
57
  }
58
58
 
59
59
  .isRootInFormLayout {
60
- @include inline-field-layout.in-form-layout();
60
+ @include inline-field-layout.in-form-layout();
61
61
  }