@react-ui-org/react-ui 0.56.0 → 0.58.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.
- package/.nvmrc +1 -1
- package/dist/react-ui.css +17 -17
- package/dist/react-ui.development.css +2551 -831
- package/dist/react-ui.development.js +106 -66
- package/dist/react-ui.js +1 -1
- package/package.json +13 -2
- package/src/CNAME +1 -0
- package/src/components/Alert/Alert.jsx +5 -6
- package/src/components/Alert/Alert.module.scss +12 -34
- package/src/components/Alert/README.md +28 -15
- package/src/components/Alert/_settings.scss +5 -0
- package/src/components/Alert/_theme.scss +0 -43
- package/src/components/Badge/Badge.jsx +5 -3
- package/src/components/Badge/Badge.module.scss +29 -74
- package/src/components/Badge/README.md +19 -2
- package/src/components/Badge/_settings.scss +8 -0
- package/src/components/Button/Button.jsx +4 -3
- package/src/components/Button/Button.module.scss +183 -2
- package/src/components/Button/README.md +8 -6
- package/src/components/Button/_settings.scss +8 -3
- package/src/components/Button/_theme.scss +0 -3
- package/src/components/Button/_tools.scss +7 -71
- package/src/components/ButtonGroup/ButtonGroup.jsx +2 -2
- package/src/components/Card/Card.jsx +3 -2
- package/src/components/Card/Card.module.scss +13 -33
- package/src/components/Card/CardBody.jsx +1 -1
- package/src/components/Card/CardFooter.jsx +1 -1
- package/src/components/Card/README.md +28 -6
- package/src/components/Card/_settings.scss +5 -0
- package/src/components/Card/_theme.scss +0 -43
- package/src/components/CheckboxField/CheckboxField.jsx +9 -3
- package/src/components/CheckboxField/README.md +110 -5
- package/src/components/FileInputField/FileInputField.jsx +1 -1
- package/src/components/FormLayout/FormLayout.jsx +1 -1
- package/src/components/FormLayout/FormLayoutCustomField.jsx +1 -1
- package/src/components/Grid/Grid.jsx +1 -1
- package/src/components/Grid/Grid.module.scss +9 -2
- package/src/components/Grid/GridSpan.jsx +1 -1
- package/src/components/InputGroup/InputGroup.jsx +2 -2
- package/src/components/InputGroup/InputGroup.module.scss +9 -5
- package/src/components/Modal/Modal.jsx +1 -1
- package/src/components/Modal/ModalBody.jsx +1 -1
- package/src/components/Modal/ModalCloseButton.jsx +3 -5
- package/src/components/Modal/ModalContent.jsx +1 -1
- package/src/components/Modal/ModalFooter.jsx +1 -1
- package/src/components/Modal/ModalHeader.jsx +1 -1
- package/src/components/Modal/ModalTitle.jsx +1 -1
- package/src/components/Modal/README.md +18 -18
- package/src/components/Paper/Paper.jsx +1 -1
- package/src/components/Popover/Popover.jsx +58 -13
- package/src/components/Popover/Popover.module.scss +51 -23
- package/src/components/Popover/PopoverWrapper.jsx +1 -1
- package/src/components/Popover/README.md +60 -3
- package/src/components/Popover/_helpers/cleanPlacementStyle.js +20 -0
- package/src/components/Popover/_theme.scss +4 -2
- package/src/components/Radio/README.md +103 -0
- package/src/components/Radio/Radio.jsx +9 -3
- package/src/components/Radio/Radio.module.scss +4 -0
- package/src/components/ScrollView/ScrollView.jsx +3 -5
- package/src/components/SelectField/README.md +103 -0
- package/src/components/SelectField/SelectField.jsx +9 -3
- package/src/components/Table/Table.jsx +1 -1
- package/src/components/Tabs/Tabs.jsx +1 -1
- package/src/components/Tabs/TabsItem.jsx +1 -1
- package/src/components/Text/Text.jsx +1 -1
- package/src/components/TextArea/TextArea.jsx +1 -1
- package/src/components/TextField/README.md +14 -2
- package/src/components/TextField/TextField.jsx +1 -1
- package/src/components/TextLink/README.md +10 -3
- package/src/components/TextLink/TextLink.jsx +1 -1
- package/src/components/TextLink/_theme.scss +3 -3
- package/src/components/Toggle/README.md +83 -1
- package/src/components/Toggle/Toggle.jsx +9 -3
- package/src/components/Toolbar/Toolbar.jsx +1 -1
- package/src/components/Toolbar/ToolbarGroup.jsx +1 -1
- package/src/components/Toolbar/ToolbarItem.jsx +1 -1
- package/src/components/_helpers/getRootPriorityClassName.js +1 -1
- package/src/components/_helpers/resolveContextOrProp.js +6 -3
- package/src/index.js +3 -2
- package/src/providers/globalProps/GlobalPropsContext.jsx +5 -0
- package/src/providers/globalProps/GlobalPropsProvider.jsx +33 -0
- package/src/providers/globalProps/index.js +3 -0
- package/src/{provider → providers/globalProps}/withGlobalProps.jsx +16 -16
- package/src/providers/translations/TranslationsContext.jsx +6 -0
- package/src/providers/translations/TranslationsProvider.jsx +33 -0
- package/src/providers/translations/index.js +2 -0
- package/src/styles/elements/_links.scss +7 -2
- package/src/styles/settings/_collections.scss +9 -0
- package/src/styles/theme/_form-fields.scss +19 -0
- package/src/styles/theme/_links.scss +4 -3
- package/src/styles/tools/_collections.scss +265 -0
- package/src/styles/tools/_string.scss +5 -2
- package/src/styles/tools/form-fields/_box-field-layout.scss +7 -1
- package/src/styles/tools/form-fields/_foundation.scss +6 -4
- package/src/styles/tools/form-fields/_variants.scss +5 -1
- package/src/theme.scss +66 -1
- package/src/components/Alert/_tools.scss +0 -10
- package/src/components/Button/_base.scss +0 -156
- package/src/components/Button/_priorities.scss +0 -149
- package/src/components/Card/_tools.scss +0 -10
- package/src/provider/RUIContext.jsx +0 -9
- package/src/provider/RUIProvider.jsx +0 -42
- package/src/provider/index.js +0 -3
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
@use "sass:list";
|
|
2
|
+
@use "sass:map";
|
|
3
|
+
@use "../settings/collections";
|
|
4
|
+
@use "string" as rui-string;
|
|
5
|
+
|
|
6
|
+
// Function to get the parent collection category by value.
|
|
7
|
+
//
|
|
8
|
+
// 1. Returns **only the first** matching collection category.
|
|
9
|
+
//
|
|
10
|
+
// @param {String} $value - The value to get the category for.
|
|
11
|
+
// @param {Map} $collections - The collections map to search in.
|
|
12
|
+
|
|
13
|
+
@function _get-category-by-value($value, $collections) {
|
|
14
|
+
@each $category, $values in $collections {
|
|
15
|
+
@if list.index($values, $value) {
|
|
16
|
+
@return $category; // 1.
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@error
|
|
21
|
+
"Supplied value \""
|
|
22
|
+
+ $value
|
|
23
|
+
+ "\" not found in any category ("
|
|
24
|
+
+ map.keys($collections)
|
|
25
|
+
+ ")";
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Function to get the matching link color for a component variant.
|
|
29
|
+
//
|
|
30
|
+
// @param {String} $value - The value to get the link color for.
|
|
31
|
+
|
|
32
|
+
@function _get-link-color-by-value($value) {
|
|
33
|
+
@if $value == "light" {
|
|
34
|
+
@return "dark";
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@if $value == "dark" {
|
|
38
|
+
@return "light";
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@return $value;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Mixin to generate CSS custom properties for a component theme.
|
|
45
|
+
//
|
|
46
|
+
// 1. Generates a CSS custom property for each property in the `$properties` list.
|
|
47
|
+
// 2. Theming of the disabled state is optional, so the `default` theme options are used (via CSS custom property
|
|
48
|
+
// fallback) if no `disabled` styling for the specific variant is provided by user.
|
|
49
|
+
//
|
|
50
|
+
// @param {String} $prefix - The prefix for the CSS custom properties.
|
|
51
|
+
// @param {String} $component-name - The name of the component.
|
|
52
|
+
// @param {String} $modifier-value - The value of the modifier.
|
|
53
|
+
// @param {String} $variant-value - The value of the variant.
|
|
54
|
+
// @param {String} $interaction-state - The interaction state.
|
|
55
|
+
// @param {List} $properties - The list of properties to generate CSS custom properties for.
|
|
56
|
+
//
|
|
57
|
+
// Example:
|
|
58
|
+
//
|
|
59
|
+
// @include generate-component-properties(
|
|
60
|
+
// $prefix: "rui-",
|
|
61
|
+
// $component-name: "Card",
|
|
62
|
+
// $variant-name: "color",
|
|
63
|
+
// $variant-value: "success",
|
|
64
|
+
// $properties: color, border-color, background-color,
|
|
65
|
+
// );
|
|
66
|
+
//
|
|
67
|
+
// … will output:
|
|
68
|
+
//
|
|
69
|
+
// --rui-local-color: var(--rui-Card--success__color);
|
|
70
|
+
// --rui-local-border-color: var(--rui-Card--success__border-color);
|
|
71
|
+
// --rui-local-background-color: var(--rui-Card--success__background-color);
|
|
72
|
+
|
|
73
|
+
@mixin generate-component-properties(
|
|
74
|
+
$prefix,
|
|
75
|
+
$component-name,
|
|
76
|
+
$modifier-value: null,
|
|
77
|
+
$variant-value,
|
|
78
|
+
$interaction-state: null,
|
|
79
|
+
$properties,
|
|
80
|
+
) {
|
|
81
|
+
@each $property in $properties {
|
|
82
|
+
$modifier: if($modifier-value, "--" + $modifier-value, "");
|
|
83
|
+
$state: if($interaction-state, "--" + $interaction-state, "");
|
|
84
|
+
|
|
85
|
+
// 1.
|
|
86
|
+
--#{$prefix}local-#{$property}:
|
|
87
|
+
var(
|
|
88
|
+
#{
|
|
89
|
+
"--"
|
|
90
|
+
+ $prefix
|
|
91
|
+
+ $component-name
|
|
92
|
+
+ $modifier
|
|
93
|
+
+ "--"
|
|
94
|
+
+ $variant-value
|
|
95
|
+
+ $state
|
|
96
|
+
+ "__"
|
|
97
|
+
+ $property
|
|
98
|
+
}
|
|
99
|
+
#{if(
|
|
100
|
+
$interaction-state and $interaction-state == "disabled",
|
|
101
|
+
", var(--"
|
|
102
|
+
+ $prefix
|
|
103
|
+
+ $component-name
|
|
104
|
+
+ $modifier
|
|
105
|
+
+ "--"
|
|
106
|
+
+ $variant-value
|
|
107
|
+
+ "--default__"
|
|
108
|
+
+ $property
|
|
109
|
+
+ ")",
|
|
110
|
+
""
|
|
111
|
+
)}
|
|
112
|
+
); // 2.
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// Mixin to generate CSS custom properties for links theme.
|
|
117
|
+
//
|
|
118
|
+
// @param {String} $prefix - The prefix for the CSS custom properties.
|
|
119
|
+
// @param {String} $variant-value - The value of the variant.
|
|
120
|
+
//
|
|
121
|
+
// Example:
|
|
122
|
+
//
|
|
123
|
+
// @include generate-link-properties(
|
|
124
|
+
// $prefix: "rui-",
|
|
125
|
+
// $variant-value: "success",
|
|
126
|
+
// );
|
|
127
|
+
//
|
|
128
|
+
// … will output:
|
|
129
|
+
//
|
|
130
|
+
// --rui-local-link-color: var(--rui-color-feedback-success);
|
|
131
|
+
// --rui-local-link-color-hover: var(--rui-color-feedback-success-hover);
|
|
132
|
+
// --rui-local-link-color-active: var(--rui-color-feedback-success-active);
|
|
133
|
+
|
|
134
|
+
@mixin generate-link-properties($prefix, $variant-value) {
|
|
135
|
+
$color-category: _get-category-by-value($value: $variant-value, $collections: collections.$colors);
|
|
136
|
+
$resolved-variant-value: _get-link-color-by-value($variant-value);
|
|
137
|
+
|
|
138
|
+
--#{$prefix}local-link-color: var(--rui-color-#{$color-category}-#{$resolved-variant-value});
|
|
139
|
+
--#{$prefix}local-link-color-hover: var(--rui-color-#{$color-category}-#{$resolved-variant-value}-hover);
|
|
140
|
+
--#{$prefix}local-link-color-active: var(--rui-color-#{$color-category}-#{$resolved-variant-value}-active);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// Mixin to generate CSS classes for a component variant.
|
|
144
|
+
//
|
|
145
|
+
// @param {String} $prefix - The prefix for the CSS custom properties.
|
|
146
|
+
// @param {String} $component-name - The name of the component.
|
|
147
|
+
// @param {String} $modifier-name - Optional name of the class name modifier.
|
|
148
|
+
// @param {String} $modifier-name - Optional value of the class name modifier.
|
|
149
|
+
// @param {String} $variant-name - The name of the variant.
|
|
150
|
+
// @param {String} $variant-value - The value of the variant.
|
|
151
|
+
// @param {Boolean} $generate-interaction-states - Whether to generate interaction states (disabled, hover, active).
|
|
152
|
+
// @param {Boolean} $inherit-link-color - Whether to inherit link color from the component variant.
|
|
153
|
+
// @param {List} $properties - The list of properties to generate CSS custom properties for.
|
|
154
|
+
//
|
|
155
|
+
// Examples:
|
|
156
|
+
//
|
|
157
|
+
// @include collections.generate-class(
|
|
158
|
+
// $prefix: "rui-",
|
|
159
|
+
// $component-name: "Card",
|
|
160
|
+
// $variant-name: "color",
|
|
161
|
+
// $variant-value: "success",
|
|
162
|
+
// $properties: color, border-color, background-color,
|
|
163
|
+
// );
|
|
164
|
+
//
|
|
165
|
+
// … will output:
|
|
166
|
+
//
|
|
167
|
+
// .isRootColorSuccess {
|
|
168
|
+
// --rui-local-color: var(--rui-Card--success__color);
|
|
169
|
+
// --rui-local-border-color: var(--rui-Card--success__border-color);
|
|
170
|
+
// --rui-local-background-color: var(--rui-Card--success__background-color);
|
|
171
|
+
// }
|
|
172
|
+
//
|
|
173
|
+
// @include collections.generate-class(
|
|
174
|
+
// $prefix: "rui-",
|
|
175
|
+
// $component-name: "Button",
|
|
176
|
+
// $modifier-name: "priority",
|
|
177
|
+
// $modifier-value: "flat",
|
|
178
|
+
// $variant-name: "color",
|
|
179
|
+
// $variant-value: "success",
|
|
180
|
+
// $generate-interaction-states: true,
|
|
181
|
+
// $properties: color, background,
|
|
182
|
+
// );
|
|
183
|
+
//
|
|
184
|
+
// … will output:
|
|
185
|
+
//
|
|
186
|
+
// .isRootPriorityFlat.isRootColorSuccess {
|
|
187
|
+
// --rui-local-color: var(--rui-Button--flat--success--default__color);
|
|
188
|
+
// --rui-local-background: var(--rui-Button--flat--success--default__background);
|
|
189
|
+
// }
|
|
190
|
+
// .isRootPriorityFlat.isRootColorSuccess:disabled {
|
|
191
|
+
// --rui-local-color:
|
|
192
|
+
// var(
|
|
193
|
+
// --rui-Button--flat--success--disabled__color,
|
|
194
|
+
// var(--rui-Button--flat--success--default__color)
|
|
195
|
+
// );
|
|
196
|
+
// --rui-local-background:
|
|
197
|
+
// var(
|
|
198
|
+
// --rui-Button--flat--success--disabled__background,
|
|
199
|
+
// var(--rui-Button--flat--success--default__background)
|
|
200
|
+
// );
|
|
201
|
+
// }
|
|
202
|
+
// .isRootPriorityFlat.isRootColorSuccess:not(:disabled):hover {
|
|
203
|
+
// --rui-local-color: var(--rui-Button--flat--success--hover__color);
|
|
204
|
+
// --rui-local-background: var(--rui-Button--flat--success--hover__background);
|
|
205
|
+
// }
|
|
206
|
+
// .isRootPriorityFlat.isRootColorSuccess:not(:disabled):active {
|
|
207
|
+
// --rui-local-color: var(--rui-Button--flat--success--active__color);
|
|
208
|
+
// --rui-local-background: var(--rui-Button--flat--success--active__background);
|
|
209
|
+
// }
|
|
210
|
+
|
|
211
|
+
@mixin generate-class(
|
|
212
|
+
$prefix,
|
|
213
|
+
$component-name,
|
|
214
|
+
$modifier-name: null,
|
|
215
|
+
$modifier-value: null,
|
|
216
|
+
$variant-name,
|
|
217
|
+
$variant-value,
|
|
218
|
+
$generate-interaction-states: false,
|
|
219
|
+
$inherit-link-color: false,
|
|
220
|
+
$properties,
|
|
221
|
+
) {
|
|
222
|
+
$modifier-class-name:
|
|
223
|
+
if(
|
|
224
|
+
$modifier-name and $modifier-value,
|
|
225
|
+
".isRoot#{rui-string.capitalize($modifier-name)}#{rui-string.capitalize($modifier-value)}",
|
|
226
|
+
""
|
|
227
|
+
);
|
|
228
|
+
$variant-class-name: ".isRoot#{rui-string.capitalize($variant-name)}#{rui-string.capitalize($variant-value)}";
|
|
229
|
+
|
|
230
|
+
#{$modifier-class-name}#{$variant-class-name} {
|
|
231
|
+
@if $generate-interaction-states {
|
|
232
|
+
$interaction-state-selector-map: (
|
|
233
|
+
default: "&",
|
|
234
|
+
disabled: "&:disabled",
|
|
235
|
+
hover: "&:not(:disabled):hover",
|
|
236
|
+
active: "&:not(:disabled):active",
|
|
237
|
+
);
|
|
238
|
+
|
|
239
|
+
@each $interaction-state, $interaction-state-selector in $interaction-state-selector-map {
|
|
240
|
+
#{$interaction-state-selector} {
|
|
241
|
+
@include generate-component-properties(
|
|
242
|
+
$prefix: $prefix,
|
|
243
|
+
$component-name: $component-name,
|
|
244
|
+
$modifier-value: $modifier-value,
|
|
245
|
+
$variant-value: $variant-value,
|
|
246
|
+
$interaction-state: $interaction-state,
|
|
247
|
+
$properties: $properties,
|
|
248
|
+
);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
} @else {
|
|
252
|
+
@include generate-component-properties(
|
|
253
|
+
$prefix: $prefix,
|
|
254
|
+
$component-name: $component-name,
|
|
255
|
+
$modifier-value: $modifier-value,
|
|
256
|
+
$variant-value: $variant-value,
|
|
257
|
+
$properties: $properties,
|
|
258
|
+
);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
@if $inherit-link-color {
|
|
262
|
+
@include generate-link-properties($prefix: $prefix, $variant-value: $variant-value);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
// Author: Hugo Giraudel
|
|
2
|
-
|
|
3
1
|
@use "sass:string";
|
|
4
2
|
|
|
3
|
+
@function capitalize($string) {
|
|
4
|
+
@return string.to-upper-case(string.slice($string, 1, 1)) + string.slice($string, 2);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
// Author: Hugo Giraudel
|
|
5
8
|
@function replace($string, $search, $replace: "") {
|
|
6
9
|
$index: string.index($string, $search);
|
|
7
10
|
|
|
@@ -55,6 +55,9 @@
|
|
|
55
55
|
//
|
|
56
56
|
// 13. Label and field are vertically aligned to top (start) by default (see 10.). Vertical
|
|
57
57
|
// alignment of each block can be changed by theme configuration.
|
|
58
|
+
//
|
|
59
|
+
// 14. Intentionally use longhand properties because the custom property fallback mechanism evaluates `initial` values
|
|
60
|
+
// as empty. That makes the other value of the shorthand property unexpectedly used for both axes.
|
|
58
61
|
|
|
59
62
|
@use "../../settings/forms";
|
|
60
63
|
@use "../../settings/form-fields" as settings;
|
|
@@ -125,7 +128,10 @@
|
|
|
125
128
|
|
|
126
129
|
.field {
|
|
127
130
|
grid-area: field;
|
|
128
|
-
|
|
131
|
+
// stylelint-disable declaration-block-no-redundant-longhand-properties -- 14.
|
|
132
|
+
align-self: theme.$horizontal-field-vertical-alignment; // 13.
|
|
133
|
+
justify-self: start; // 7.
|
|
134
|
+
// stylelint-enable declaration-block-no-redundant-longhand-properties
|
|
129
135
|
}
|
|
130
136
|
}
|
|
131
137
|
}
|
|
@@ -18,12 +18,14 @@
|
|
|
18
18
|
color: var(--rui-local-surrounding-text-color, #{theme.$label-color});
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
@mixin label-required() {
|
|
21
|
+
@mixin label-required($show-require-sign: true) {
|
|
22
22
|
color: var(--rui-local-surrounding-text-color, #{theme.$required-label-color});
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
@if $show-require-sign {
|
|
25
|
+
&::after {
|
|
26
|
+
content: theme.$required-sign;
|
|
27
|
+
color: theme.$required-sign-color;
|
|
28
|
+
}
|
|
27
29
|
}
|
|
28
30
|
}
|
|
29
31
|
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
+ "Choose one of #{map.keys(settings.$themeable-variant-states)}.";
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
$themeable-states: map.get(
|
|
73
|
+
$themeable-states: map.get(settings.$themeable-variant-states, $type, $variant);
|
|
74
74
|
|
|
75
75
|
@if list.index($themeable-states, "hover") {
|
|
76
76
|
@include _generate-custom-properties($type, $variant, "default");
|
|
@@ -143,5 +143,9 @@
|
|
|
143
143
|
}
|
|
144
144
|
|
|
145
145
|
@mixin validation($variant) {
|
|
146
|
+
--rui-local-link-color: map.get(theme.$link-validation-colors, $variant, default);
|
|
147
|
+
--rui-local-link-color-hover: map.get(theme.$link-validation-colors, $variant, hover);
|
|
148
|
+
--rui-local-link-color-active: map.get(theme.$link-validation-colors, $variant, active);
|
|
149
|
+
|
|
146
150
|
@include _get-theme(validation, $variant);
|
|
147
151
|
}
|
package/src/theme.scss
CHANGED
|
@@ -109,7 +109,8 @@
|
|
|
109
109
|
--rui-line-height-small: 1.25;
|
|
110
110
|
|
|
111
111
|
// Text decorations
|
|
112
|
-
--rui-
|
|
112
|
+
--rui-underline-offset-link: 0.1875em;
|
|
113
|
+
--rui-text-decoration-link: underline;
|
|
113
114
|
--rui-text-decoration-link-hover: underline;
|
|
114
115
|
--rui-text-decoration-link-active: underline;
|
|
115
116
|
|
|
@@ -306,6 +307,70 @@
|
|
|
306
307
|
--rui-Alert--dark__foreground-color: var(--rui-color-neutral-on-dark);
|
|
307
308
|
--rui-Alert--dark__background-color: var(--rui-color-background-dark);
|
|
308
309
|
|
|
310
|
+
//
|
|
311
|
+
// Badge
|
|
312
|
+
// =====
|
|
313
|
+
|
|
314
|
+
// Badge: filled priority
|
|
315
|
+
|
|
316
|
+
// Badge: filled priority: success variant
|
|
317
|
+
--rui-Badge--filled--success__color: var(--rui-color-feedback-on-success);
|
|
318
|
+
--rui-Badge--filled--success__background-color: var(--rui-color-feedback-success);
|
|
319
|
+
|
|
320
|
+
// Badge: filled priority: warning variant
|
|
321
|
+
--rui-Badge--filled--warning__color: var(--rui-color-feedback-on-warning);
|
|
322
|
+
--rui-Badge--filled--warning__background-color: var(--rui-color-feedback-warning);
|
|
323
|
+
|
|
324
|
+
// Badge: filled priority: danger variant
|
|
325
|
+
--rui-Badge--filled--danger__color: var(--rui-color-feedback-on-danger);
|
|
326
|
+
--rui-Badge--filled--danger__background-color: var(--rui-color-feedback-danger);
|
|
327
|
+
|
|
328
|
+
// Badge: filled priority: help variant
|
|
329
|
+
--rui-Badge--filled--help__color: var(--rui-color-feedback-on-help);
|
|
330
|
+
--rui-Badge--filled--help__background-color: var(--rui-color-feedback-help);
|
|
331
|
+
|
|
332
|
+
// Badge: filled priority: info variant
|
|
333
|
+
--rui-Badge--filled--info__color: var(--rui-color-feedback-on-info);
|
|
334
|
+
--rui-Badge--filled--info__background-color: var(--rui-color-feedback-info);
|
|
335
|
+
|
|
336
|
+
// Badge: filled priority: note variant
|
|
337
|
+
--rui-Badge--filled--note__color: var(--rui-color-feedback-on-note);
|
|
338
|
+
--rui-Badge--filled--note__background-color: var(--rui-color-feedback-note);
|
|
339
|
+
|
|
340
|
+
// Badge: filled priority: light variant
|
|
341
|
+
--rui-Badge--filled--light__color: var(--rui-color-neutral-on-light);
|
|
342
|
+
--rui-Badge--filled--light__background-color: var(--rui-color-neutral-light);
|
|
343
|
+
|
|
344
|
+
// Badge: filled priority: dark variant
|
|
345
|
+
--rui-Badge--filled--dark__color: var(--rui-color-neutral-on-dark);
|
|
346
|
+
--rui-Badge--filled--dark__background-color: var(--rui-color-neutral-dark);
|
|
347
|
+
|
|
348
|
+
// Badge: outline priority
|
|
349
|
+
|
|
350
|
+
// Badge: outline priority: success variant
|
|
351
|
+
--rui-Badge--outline--success__color: var(--rui-color-feedback-success);
|
|
352
|
+
|
|
353
|
+
// Badge: outline priority: warning variant
|
|
354
|
+
--rui-Badge--outline--warning__color: var(--rui-color-feedback-warning);
|
|
355
|
+
|
|
356
|
+
// Badge: outline priority: danger variant
|
|
357
|
+
--rui-Badge--outline--danger__color: var(--rui-color-feedback-danger);
|
|
358
|
+
|
|
359
|
+
// Badge: outline priority: help variant
|
|
360
|
+
--rui-Badge--outline--help__color: var(--rui-color-feedback-help);
|
|
361
|
+
|
|
362
|
+
// Badge: outline priority: info variant
|
|
363
|
+
--rui-Badge--outline--info__color: var(--rui-color-feedback-info);
|
|
364
|
+
|
|
365
|
+
// Badge: outline priority: note variant
|
|
366
|
+
--rui-Badge--outline--note__color: var(--rui-color-feedback-note);
|
|
367
|
+
|
|
368
|
+
// Badge: outline priority: light variant
|
|
369
|
+
--rui-Badge--outline--light__color: var(--rui-color-neutral-light);
|
|
370
|
+
|
|
371
|
+
// Badge: outline priority: dark variant
|
|
372
|
+
--rui-Badge--outline--dark__color: var(--rui-color-neutral-dark);
|
|
373
|
+
|
|
309
374
|
//
|
|
310
375
|
// Button
|
|
311
376
|
// ======
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
@use "sass:map";
|
|
2
|
-
@use "theme";
|
|
3
|
-
|
|
4
|
-
@mixin color($color) {
|
|
5
|
-
$color-variant-properties: map.get(theme.$colors, $color);
|
|
6
|
-
|
|
7
|
-
--rui-local-color: #{map.get($color-variant-properties, color)};
|
|
8
|
-
--rui-local-foreground-color: #{map.get($color-variant-properties, foreground-color)};
|
|
9
|
-
--rui-local-background-color: #{map.get($color-variant-properties, background-color)};
|
|
10
|
-
}
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
// 1. ButtonGroup gap is implemented using the `margin` property so the buttons can overlap and reduce duplicate
|
|
2
|
-
// borders.
|
|
3
|
-
|
|
4
|
-
@use "sass:map";
|
|
5
|
-
@use "../../styles/tools/breakpoint";
|
|
6
|
-
@use "settings";
|
|
7
|
-
@use "theme";
|
|
8
|
-
@use "tools";
|
|
9
|
-
|
|
10
|
-
@layer components.button {
|
|
11
|
-
.root {
|
|
12
|
-
@include tools.button();
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.label {
|
|
16
|
-
display: block;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.beforeLabel,
|
|
20
|
-
.afterLabel,
|
|
21
|
-
.startCorner,
|
|
22
|
-
.endCorner,
|
|
23
|
-
.feedbackIcon {
|
|
24
|
-
display: flex;
|
|
25
|
-
align-items: baseline;
|
|
26
|
-
justify-content: center;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.startCorner,
|
|
30
|
-
.endCorner {
|
|
31
|
-
position: absolute;
|
|
32
|
-
top: -0.35rem;
|
|
33
|
-
z-index: 2;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.startCorner {
|
|
37
|
-
left: 0;
|
|
38
|
-
margin-left: -0.35rem;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.endCorner {
|
|
42
|
-
right: 0;
|
|
43
|
-
margin-right: -0.35rem;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.feedbackIcon {
|
|
47
|
-
position: absolute;
|
|
48
|
-
inset: 0;
|
|
49
|
-
z-index: 1;
|
|
50
|
-
align-items: center;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.isRootSizeSmall {
|
|
54
|
-
@include tools.button-size(small);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.isRootSizeMedium {
|
|
58
|
-
@include tools.button-size(medium);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.isRootSizeLarge {
|
|
62
|
-
@include tools.button-size(large);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
.isRootBlock {
|
|
66
|
-
width: 100%;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.hasRootFeedback:disabled {
|
|
70
|
-
opacity: theme.$feedback-opacity;
|
|
71
|
-
cursor: theme.$feedback-cursor;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.hasRootFeedback .label,
|
|
75
|
-
.hasRootFeedback .beforeLabel,
|
|
76
|
-
.hasRootFeedback .afterLabel {
|
|
77
|
-
color: transparent;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.isRootInButtonGroup,
|
|
81
|
-
.isRootInInputGroup {
|
|
82
|
-
z-index: map.get(settings.$group-z-indexes, button);
|
|
83
|
-
|
|
84
|
-
&:not(:first-child) {
|
|
85
|
-
border-start-start-radius: var(--rui-local-inner-border-radius);
|
|
86
|
-
border-end-start-radius: var(--rui-local-inner-border-radius);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
&:not(:last-child) {
|
|
90
|
-
border-start-end-radius: var(--rui-local-inner-border-radius);
|
|
91
|
-
border-end-end-radius: var(--rui-local-inner-border-radius);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.isRootInButtonGroup:not(:first-child) {
|
|
96
|
-
margin-inline-start: var(--rui-local-gap); // 1.
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
.isRootInButtonGroup:focus,
|
|
100
|
-
.isRootInButtonGroup:not(:disabled):hover {
|
|
101
|
-
z-index: map.get(settings.$group-z-indexes, button-hover);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
.isRootInButtonGroup .startCorner,
|
|
105
|
-
.isRootInInputGroup .startCorner,
|
|
106
|
-
.isRootInButtonGroup .endCorner,
|
|
107
|
-
.isRootInInputGroup .endCorner {
|
|
108
|
-
z-index: map.get(settings.$group-z-indexes, button-overflowing-elements);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
.hasLabelHidden,
|
|
112
|
-
.hasLabelVisibleSm,
|
|
113
|
-
.hasLabelVisibleMd,
|
|
114
|
-
.hasLabelVisibleLg,
|
|
115
|
-
.hasLabelVisibleXl,
|
|
116
|
-
.hasLabelVisibleX2l,
|
|
117
|
-
.hasLabelVisibleX3l {
|
|
118
|
-
@include tools.hide-label();
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
.hasLabelVisibleSm {
|
|
122
|
-
@include breakpoint.up(sm) {
|
|
123
|
-
@include tools.show-label();
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
.hasLabelVisibleMd {
|
|
128
|
-
@include breakpoint.up(md) {
|
|
129
|
-
@include tools.show-label();
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
.hasLabelVisibleLg {
|
|
134
|
-
@include breakpoint.up(lg) {
|
|
135
|
-
@include tools.show-label();
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
.hasLabelVisibleXl {
|
|
140
|
-
@include breakpoint.up(xl) {
|
|
141
|
-
@include tools.show-label();
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
.hasLabelVisibleX2l {
|
|
146
|
-
@include breakpoint.up(x2l) {
|
|
147
|
-
@include tools.show-label();
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
.hasLabelVisibleX3l {
|
|
152
|
-
@include breakpoint.up(x3l) {
|
|
153
|
-
@include tools.show-label();
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
}
|