@react-ui-org/react-ui 0.44.0 → 0.46.0

Sign up to get free protection for your applications and to get access to all the features.
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,30 +1,30 @@
1
1
  // Utility generator
2
2
  // Inspired by Bootstrap 4
3
3
 
4
- @use 'sass:list';
5
- @use 'sass:map';
6
- @use 'sass:meta';
4
+ @use "sass:list";
5
+ @use "sass:map";
6
+ @use "sass:meta";
7
7
 
8
8
  @mixin generate($utility, $infix) {
9
- $values: map.get($utility, values);
9
+ $values: map.get($utility, values);
10
10
 
11
- // If the values are a list or string, convert it into a map
12
- @if meta.type-of($values) == 'string' or meta.type-of(list.nth($values, 1)) != 'list' {
13
- $values: list.zip($values, $values);
14
- }
11
+ // If the values are a list or string, convert it into a map
12
+ @if meta.type-of($values) == "string" or meta.type-of(list.nth($values, 1)) != "list" {
13
+ $values: list.zip($values, $values);
14
+ }
15
15
 
16
- @each $key, $value in $values {
17
- $properties: map.get($utility, property);
18
- $property-class: map.get($utility, class);
16
+ @each $key, $value in $values {
17
+ $properties: map.get($utility, property);
18
+ $property-class: map.get($utility, class);
19
19
 
20
- // Don't prefix if value key is null (e.g. with shadow class)
21
- $property-class-modifier: if($key, '-' + $key, '');
20
+ // Don't prefix if value key is null (e.g. with shadow class)
21
+ $property-class-modifier: if($key, "-" + $key, "");
22
22
 
23
- :global(.#{$property-class + $infix + $property-class-modifier}) {
24
- @each $property in $properties {
25
- // stylelint-disable-next-line declaration-no-important
26
- #{$property}: $value !important;
27
- }
23
+ :global(.#{$property-class + $infix + $property-class-modifier}) {
24
+ @each $property in $properties {
25
+ // stylelint-disable-next-line declaration-no-important
26
+ #{$property}: $value !important;
27
+ }
28
+ }
28
29
  }
29
- }
30
30
  }
@@ -4,121 +4,121 @@
4
4
  // 3. Let inputs properly fit various layout scenarios.
5
5
  // 4. Leave out space for SelectField caret.
6
6
 
7
- @use '../../settings/form-fields' as settings;
8
- @use '../../theme/form-fields' as theme;
9
- @use '../../tools/caret';
10
- @use '../spacing';
11
- @use '../transition';
7
+ @use "../../settings/form-fields" as settings;
8
+ @use "../../theme/form-fields" as theme;
9
+ @use "../../tools/caret";
10
+ @use "../spacing";
11
+ @use "../transition";
12
12
 
13
13
  @mixin input-container() {
14
- position: relative; // 1.
15
- display: inline-flex;
16
- min-width: 0; // 3.
17
- max-width: 100%; // 3.
14
+ position: relative; // 1.
15
+ display: inline-flex;
16
+ min-width: 0; // 3.
17
+ max-width: 100%; // 3.
18
18
  }
19
19
 
20
20
  @mixin input() {
21
- @include transition.add((opacity, color, border-color, background-color, box-shadow));
22
-
23
- appearance: none;
24
- width: theme.$box-input-width;
25
- min-width: theme.$box-input-min-width;
26
- max-width: 100%; // 3.
27
- height: var(--rui-local-height);
28
- padding: var(--rui-local-padding-y) var(--rui-local-padding-x);
29
- font-weight: settings.$box-input-font-weight;
30
- font-size: var(--rui-local-font-size);
31
- line-height: settings.$box-input-line-height;
32
- font-family: settings.$box-input-font-family;
33
- vertical-align: middle;
34
- color: var(--rui-local-color);
35
- border: theme.$box-border-width solid var(--rui-local-border-color);
36
- border-radius: theme.$box-border-radius;
37
- background: var(--rui-local-background);
38
- box-shadow: var(--rui-local-box-shadow);
39
-
40
- &::placeholder {
41
- color: theme.$box-placeholder-color;
42
- opacity: 1;
43
- }
21
+ @include transition.add((opacity, color, border-color, background-color, box-shadow));
22
+
23
+ appearance: none;
24
+ width: theme.$box-input-width;
25
+ min-width: theme.$box-input-min-width;
26
+ max-width: 100%; // 3.
27
+ height: var(--rui-local-height);
28
+ padding: var(--rui-local-padding-y) var(--rui-local-padding-x);
29
+ font-weight: settings.$box-input-font-weight;
30
+ font-size: var(--rui-local-font-size);
31
+ line-height: settings.$box-input-line-height;
32
+ font-family: settings.$box-input-font-family;
33
+ vertical-align: middle;
34
+ color: var(--rui-local-color);
35
+ border: theme.$box-border-width solid var(--rui-local-border-color);
36
+ border-radius: theme.$box-border-radius;
37
+ background: var(--rui-local-background);
38
+ box-shadow: var(--rui-local-box-shadow);
39
+
40
+ &::placeholder {
41
+ color: theme.$box-placeholder-color;
42
+ opacity: 1;
43
+ }
44
44
  }
45
45
 
46
46
  @mixin input-size() {
47
- width:
48
- calc(
49
- 1ch * var(--rui-custom-input-size)
50
- + var(--rui-local-arrows-width, 0)
51
- + 2 * var(--rui-local-padding-x)
52
- + 2 * #{theme.$box-border-width}
53
- ); // 2.
54
-
55
- min-width: auto; // 2.
56
-
57
- &[type="number"] {
58
- --rui-local-arrows-width: #{settings.$box-field-input-number-arrows-width};
59
- }
47
+ width:
48
+ calc(
49
+ 1ch * var(--rui-custom-input-size)
50
+ + var(--rui-local-arrows-width, 0)
51
+ + 2 * var(--rui-local-padding-x)
52
+ + 2 * #{theme.$box-border-width}
53
+ ); // 2.
54
+
55
+ min-width: auto; // 2.
56
+
57
+ &[type="number"] {
58
+ --rui-local-arrows-width: #{settings.$box-field-input-number-arrows-width};
59
+ }
60
60
  }
61
61
 
62
62
  @mixin input-textarea() {
63
- resize: vertical;
63
+ resize: vertical;
64
64
 
65
- &[cols] {
66
- min-width: auto;
67
- }
65
+ &[cols] {
66
+ min-width: auto;
67
+ }
68
68
  }
69
69
 
70
70
  @mixin input-select() {
71
- appearance: none;
72
- padding-right: calc(#{settings.$box-field-caret-size} + #{spacing.of(2)}); // 4.
71
+ appearance: none;
72
+ padding-right: calc(#{settings.$box-field-caret-size} + #{spacing.of(2)}); // 4.
73
73
 
74
- &::-ms-expand {
75
- display: none;
76
- }
74
+ &::-ms-expand {
75
+ display: none;
76
+ }
77
77
  }
78
78
 
79
79
  @mixin input-select-option() {
80
- option:disabled {
81
- color: theme.$box-select-option-disabled-color;
82
- }
80
+ option:disabled {
81
+ color: theme.$box-select-option-disabled-color;
82
+ }
83
83
  }
84
84
 
85
85
  @mixin caret() {
86
- @include transition.add((border-color));
87
-
88
- position: absolute; // 1.
89
- top: theme.$box-border-width;
90
- right: theme.$box-border-width;
91
- bottom: theme.$box-border-width;
92
- display: flex;
93
- align-items: center;
94
- justify-content: center;
95
- width: calc(#{settings.$box-field-caret-size} - 2 * #{theme.$box-border-width});
96
- border-top-right-radius: theme.$box-border-radius;
97
- border-bottom-right-radius: theme.$box-border-radius;
98
- pointer-events: none;
86
+ @include transition.add((border-color));
87
+
88
+ position: absolute; // 1.
89
+ top: theme.$box-border-width;
90
+ right: theme.$box-border-width;
91
+ bottom: theme.$box-border-width;
92
+ display: flex;
93
+ align-items: center;
94
+ justify-content: center;
95
+ width: calc(#{settings.$box-field-caret-size} - 2 * #{theme.$box-border-width});
96
+ border-top-right-radius: theme.$box-border-radius;
97
+ border-bottom-right-radius: theme.$box-border-radius;
98
+ pointer-events: none;
99
99
  }
100
100
 
101
101
  @mixin caret-icon() {
102
- @include caret.create();
102
+ @include caret.create();
103
103
 
104
- border-color: var(--rui-local-color);
104
+ border-color: var(--rui-local-color);
105
105
  }
106
106
 
107
107
  @mixin bottom-line() {
108
- @include transition.add((transform, opacity), 180ms);
109
-
110
- position: absolute; // 1.
111
- bottom: 0;
112
- width: 100%;
113
- height: settings.$box-field-bottom-line-height;
114
- opacity: 0;
115
- transform: scaleX(0);
116
- transform-origin: center center;
117
- pointer-events: none;
118
-
119
- .input:focus ~ & {
120
- background-color: var(--rui-local-border-color);
121
- opacity: 1;
122
- transform: scaleX(1);
123
- }
108
+ @include transition.add((transform, opacity), 180ms);
109
+
110
+ position: absolute; // 1.
111
+ bottom: 0;
112
+ width: 100%;
113
+ height: settings.$box-field-bottom-line-height;
114
+ opacity: 0;
115
+ transform: scaleX(0);
116
+ transform-origin: center center;
117
+ pointer-events: none;
118
+
119
+ .input:focus ~ & {
120
+ background-color: var(--rui-local-border-color);
121
+ opacity: 1;
122
+ transform: scaleX(1);
123
+ }
124
124
  }
@@ -5,9 +5,9 @@
5
5
  // 2. Form fields in horizontal layout also take up only as much space as they need. Labels do not
6
6
  // wrap until label width limit is reached (50 % of available horizontal space by default).
7
7
  //
8
- // 3. Help texts and validation messages are aligned below input and wrapped. Their width is always
9
- // limited to the width of the input field so they don't shift adjacent elements when they show
10
- // up. This applies unless the field is inside FormLayout (see 10).
8
+ // 3. Help texts and validation messages are aligned below input and wrapped. Their width is always
9
+ // limited to the width of the input field so they don't shift adjacent elements when they show
10
+ // up. This applies unless the field is inside FormLayout (see 10).
11
11
  //
12
12
  // 4. Define grid spacing as padding of child elements because grid areas make row and column gaps
13
13
  // show up even when not necessary.
@@ -52,178 +52,178 @@
52
52
  // 13. Label and field are vertically aligned to top (start) by default (see 10.). Vertical
53
53
  // alignment of each block can be changed by theme configuration.
54
54
 
55
- @use '../../settings/forms';
56
- @use '../../settings/form-fields' as settings;
57
- @use '../../theme/form-fields' as theme;
58
- @use '../../theme/typography';
59
- @use '../breakpoint';
55
+ @use "../../settings/forms";
56
+ @use "../../settings/form-fields" as settings;
57
+ @use "../../theme/form-fields" as theme;
58
+ @use "../../theme/typography";
59
+ @use "../breakpoint";
60
60
 
61
61
  @mixin vertical($has-list: false) {
62
- @if ($has-list) {
63
- --rui-local-vertical-gap: #{settings.$vertical-inner-gap-large};
64
- }
65
-
66
- display: inline-flex; // 1.
67
- flex-direction: column;
68
- min-width: 0; // 1.
69
- max-width: 100%; // 1.
70
-
71
- .label {
72
- padding-bottom: var(--rui-local-vertical-gap, #{settings.$vertical-inner-gap});
73
- }
74
-
75
- .helpText,
76
- .validationText {
77
- padding-top: var(--rui-local-vertical-gap, #{settings.$vertical-inner-gap});
78
- }
79
-
80
- .field {
81
- width: min-content; // 3.
82
- max-width: 100%; // 3.
83
- }
84
- }
85
-
86
- @mixin horizontal($has-min-tap-target: false) {
87
- @include breakpoint.up(forms.$horizontal-breakpoint) {
88
- display: inline-grid; // 2.
89
- grid-template-columns: theme.$horizontal-label-width min-content; // 2.
90
- grid-template-areas: 'label field';
91
- align-items: start; // 10., 13.
92
-
93
- .label {
94
- grid-area: label;
95
- align-self: theme.$horizontal-label-vertical-alignment; // 13.
96
- min-width: theme.$horizontal-label-min-width;
97
-
98
- // 10.
99
- @if ($has-min-tap-target) {
100
- padding-top:
101
- calc(
102
- (#{theme.$check-tap-target-size} - 1rem * #{typography.$line-height-base})
103
- / 2
104
- );
105
- padding-bottom:
106
- calc(
107
- (#{theme.$check-tap-target-size} - 1rem * #{typography.$line-height-base})
108
- / 2
109
- );
110
- }
111
-
112
- // 10., 13.
113
- @else {
114
- padding-top: #{theme.$horizontal-label-padding-y};
115
- padding-bottom: #{theme.$horizontal-label-padding-y};
116
- }
117
-
118
- padding-right: settings.$horizontal-inner-gap; // 4.
119
- text-align: theme.$horizontal-label-text-align;
120
- }
121
-
122
- .field {
123
- grid-area: field;
124
- align-self: theme.$horizontal-field-vertical-alignment; // 13.
125
- justify-self: start; // 7.
62
+ @if $has-list {
63
+ --rui-local-vertical-gap: #{settings.$vertical-inner-gap-large};
126
64
  }
127
- }
128
- }
129
65
 
130
- @mixin horizontal-with-small-input() {
131
- @include breakpoint.up(forms.$horizontal-breakpoint) {
132
- grid-template-columns: min-content min-content; // 5.
133
- grid-template-areas:
134
- 'label field'
135
- 'helptext helptext'
136
- 'validationtext validationtext'; // 5.
66
+ display: inline-flex; // 1.
67
+ flex-direction: column;
68
+ min-width: 0; // 1.
69
+ max-width: 100%; // 1.
137
70
 
138
71
  .label {
139
- white-space: nowrap; // 5.
72
+ padding-bottom: var(--rui-local-vertical-gap, #{settings.$vertical-inner-gap});
140
73
  }
141
74
 
142
- .field {
143
- display: contents; // 5.
75
+ .helpText,
76
+ .validationText {
77
+ padding-top: var(--rui-local-vertical-gap, #{settings.$vertical-inner-gap});
144
78
  }
145
79
 
146
- .inputContainer {
147
- grid-area: field; // 5.
80
+ .field {
81
+ width: min-content; // 3.
82
+ max-width: 100%; // 3.
148
83
  }
84
+ }
149
85
 
150
- .helpText {
151
- grid-area: helptext; // 5.
86
+ @mixin horizontal($has-min-tap-target: false) {
87
+ @include breakpoint.up(forms.$horizontal-breakpoint) {
88
+ display: inline-grid; // 2.
89
+ grid-template-columns: theme.$horizontal-label-width min-content; // 2.
90
+ grid-template-areas: "label field";
91
+ align-items: start; // 10., 13.
92
+
93
+ .label {
94
+ grid-area: label;
95
+ align-self: theme.$horizontal-label-vertical-alignment; // 13.
96
+ min-width: theme.$horizontal-label-min-width;
97
+
98
+ // 10.
99
+ @if $has-min-tap-target {
100
+ padding-top:
101
+ calc(
102
+ (#{theme.$check-tap-target-size} - 1rem * #{typography.$line-height-base})
103
+ / 2
104
+ );
105
+ padding-bottom:
106
+ calc(
107
+ (#{theme.$check-tap-target-size} - 1rem * #{typography.$line-height-base})
108
+ / 2
109
+ );
110
+ }
111
+
112
+ // 10., 13.
113
+ @else {
114
+ padding-top: #{theme.$horizontal-label-padding-y};
115
+ padding-bottom: #{theme.$horizontal-label-padding-y};
116
+ }
117
+
118
+ padding-right: settings.$horizontal-inner-gap; // 4.
119
+ text-align: theme.$horizontal-label-text-align;
120
+ }
121
+
122
+ .field {
123
+ grid-area: field;
124
+ align-self: theme.$horizontal-field-vertical-alignment; // 13.
125
+ justify-self: start; // 7.
126
+ }
152
127
  }
128
+ }
153
129
 
154
- .validationText {
155
- grid-area: validationtext; // 5.
130
+ @mixin horizontal-with-small-input() {
131
+ @include breakpoint.up(forms.$horizontal-breakpoint) {
132
+ grid-template-columns: min-content min-content; // 5.
133
+ grid-template-areas:
134
+ "label field"
135
+ "helptext helptext"
136
+ "validationtext validationtext"; // 5.
137
+
138
+ .label {
139
+ white-space: nowrap; // 5.
140
+ }
141
+
142
+ .field {
143
+ display: contents; // 5.
144
+ }
145
+
146
+ .inputContainer {
147
+ grid-area: field; // 5.
148
+ }
149
+
150
+ .helpText {
151
+ grid-area: helptext; // 5.
152
+ }
153
+
154
+ .validationText {
155
+ grid-area: validationtext; // 5.
156
+ }
156
157
  }
157
- }
158
158
  }
159
159
 
160
160
  @mixin full-width() {
161
- display: flex;
162
- flex-direction: column;
163
- width: 100%;
164
-
165
- .field,
166
- .inputContainer,
167
- .input {
161
+ display: flex;
162
+ flex-direction: column;
168
163
  width: 100%;
169
- }
170
164
 
171
- @include breakpoint.up(forms.$horizontal-breakpoint) {
172
- &.rootLayoutHorizontal {
173
- display: grid;
174
- grid-template-columns: theme.$horizontal-full-width-label-width 1fr; // 6.
165
+ .field,
166
+ .inputContainer,
167
+ .input {
168
+ width: 100%;
175
169
  }
176
170
 
177
- &.rootLayoutHorizontal .field {
178
- justify-self: stretch; // 7.
171
+ @include breakpoint.up(forms.$horizontal-breakpoint) {
172
+ &.rootLayoutHorizontal {
173
+ display: grid;
174
+ grid-template-columns: theme.$horizontal-full-width-label-width 1fr; // 6.
175
+ }
176
+
177
+ &.rootLayoutHorizontal .field {
178
+ justify-self: stretch; // 7.
179
+ }
179
180
  }
180
- }
181
181
  }
182
182
 
183
183
  @mixin in-form-layout() {
184
- justify-self: start; // 12.
185
-
186
- .field {
187
- width: auto; // 9.
188
- }
189
-
190
- @include breakpoint.up(forms.$horizontal-breakpoint) {
191
- .optionLabel {
192
- width: auto; // 11.
193
- }
194
-
195
- &.rootLayoutHorizontal,
196
- &.rootLayoutHorizontal.hasRootSmallInput {
197
- grid: inherit; // 8.
198
- grid-template-columns: subgrid; // 8.
199
- grid-column: span 2; // 8.
184
+ justify-self: start; // 12.
200
185
 
201
- @supports not (grid-template-columns: subgrid) {
202
- display: contents; // 8.
203
- }
204
- }
205
-
206
- &.rootLayoutHorizontal.isRootFullWidth {
207
- grid-template-columns: subgrid; // 8.
208
- }
209
-
210
- &.rootLayoutHorizontal .label,
211
- &.rootLayoutHorizontal .field,
212
- &.rootLayoutHorizontal .inputContainer,
213
- &.rootLayoutHorizontal .helpText,
214
- &.rootLayoutHorizontal .validationText {
215
- grid-area: unset; // 8.
216
- }
217
-
218
- &.rootLayoutHorizontal .field,
219
- &.rootLayoutHorizontal .inputContainer,
220
- &.rootLayoutHorizontal .helpText,
221
- &.rootLayoutHorizontal .validationText {
222
- grid-column-start: 2; // 8.
186
+ .field {
187
+ width: auto; // 9.
223
188
  }
224
189
 
225
- &.rootLayoutHorizontal.hasRootSmallInput .field {
226
- display: block; // 5.
190
+ @include breakpoint.up(forms.$horizontal-breakpoint) {
191
+ .optionLabel {
192
+ width: auto; // 11.
193
+ }
194
+
195
+ &.rootLayoutHorizontal,
196
+ &.rootLayoutHorizontal.hasRootSmallInput {
197
+ grid: inherit; // 8.
198
+ grid-template-columns: subgrid; // 8.
199
+ grid-column: span 2; // 8.
200
+
201
+ @supports not (grid-template-columns: subgrid) {
202
+ display: contents; // 8.
203
+ }
204
+ }
205
+
206
+ &.rootLayoutHorizontal.isRootFullWidth {
207
+ grid-template-columns: subgrid; // 8.
208
+ }
209
+
210
+ &.rootLayoutHorizontal .label,
211
+ &.rootLayoutHorizontal .field,
212
+ &.rootLayoutHorizontal .inputContainer,
213
+ &.rootLayoutHorizontal .helpText,
214
+ &.rootLayoutHorizontal .validationText {
215
+ grid-area: unset; // 8.
216
+ }
217
+
218
+ &.rootLayoutHorizontal .field,
219
+ &.rootLayoutHorizontal .inputContainer,
220
+ &.rootLayoutHorizontal .helpText,
221
+ &.rootLayoutHorizontal .validationText {
222
+ grid-column-start: 2; // 8.
223
+ }
224
+
225
+ &.rootLayoutHorizontal.hasRootSmallInput .field {
226
+ display: block; // 5.
227
+ }
227
228
  }
228
- }
229
229
  }
@@ -1,21 +1,19 @@
1
- @use 'sass:map';
2
- @use '../../theme/form-fields' as theme;
1
+ @use "sass:map";
2
+ @use "../../theme/form-fields" as theme;
3
3
 
4
4
  @mixin size($size, $is-multiline: false) {
5
- $size-properties: map.get(theme.$box-sizes, $size);
5
+ $size-properties: map.get(theme.$box-sizes, $size);
6
6
 
7
- --rui-local-padding-y: #{map.get($size-properties, padding-y)};
8
- --rui-local-padding-x: #{map.get($size-properties, padding-x)};
9
- --rui-local-font-size: #{map.get($size-properties, font-size)};
7
+ --rui-local-padding-y: #{map.get($size-properties, padding-y)};
8
+ --rui-local-padding-x: #{map.get($size-properties, padding-x)};
9
+ --rui-local-font-size: #{map.get($size-properties, font-size)};
10
10
 
11
- .input {
12
- @if $is-multiline {
13
- height: auto;
14
- min-height: map.get($size-properties, height);
11
+ .input {
12
+ @if $is-multiline {
13
+ height: auto;
14
+ min-height: map.get($size-properties, height);
15
+ } @else {
16
+ --rui-local-height: #{map.get($size-properties, height)};
17
+ }
15
18
  }
16
-
17
- @else {
18
- --rui-local-height: #{map.get($size-properties, height)};
19
- }
20
- }
21
19
  }
@@ -1,26 +1,26 @@
1
1
  // 1. Don't let text alignment be affected by a parent.
2
2
 
3
- @use '../../settings/form-fields' as settings;
4
- @use '../../theme/form-fields' as theme;
3
+ @use "../../settings/form-fields" as settings;
4
+ @use "../../theme/form-fields" as theme;
5
5
 
6
6
  @mixin root() {
7
- text-align: left; // 1.
7
+ text-align: left; // 1.
8
8
  }
9
9
 
10
10
  @mixin label() {
11
- color: var(--rui-local-surrounding-text-color, #{theme.$label-color});
11
+ color: var(--rui-local-surrounding-text-color, #{theme.$label-color});
12
12
  }
13
13
 
14
14
  @mixin label-required() {
15
- &::after {
16
- content: theme.$required-sign;
17
- color: theme.$required-sign-color;
18
- }
15
+ &::after {
16
+ content: theme.$required-sign;
17
+ color: theme.$required-sign-color;
18
+ }
19
19
  }
20
20
 
21
21
  @mixin help-text() {
22
- font-style: theme.$help-text-font-style;
23
- font-size: theme.$help-text-font-size;
24
- line-height: settings.$help-text-line-height;
25
- color: var(--rui-local-surrounding-text-color, #{theme.$help-text-color});
22
+ font-style: theme.$help-text-font-style;
23
+ font-size: theme.$help-text-font-size;
24
+ line-height: settings.$help-text-line-height;
25
+ color: var(--rui-local-surrounding-text-color, #{theme.$help-text-color});
26
26
  }