@react-ui-org/react-ui 0.56.0 → 0.57.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/react-ui.css +14 -14
- package/dist/react-ui.development.css +2352 -843
- package/dist/react-ui.development.js +10 -10
- package/dist/react-ui.js +1 -1
- package/package.json +2 -2
- package/src/CNAME +1 -0
- package/src/components/Alert/Alert.jsx +2 -1
- package/src/components/Alert/Alert.module.scss +9 -31
- package/src/components/Alert/README.md +6 -5
- package/src/components/Alert/_settings.scss +5 -0
- package/src/components/Alert/_theme.scss +0 -43
- package/src/components/Badge/Badge.jsx +4 -2
- 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 +3 -2
- 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 +1 -1
- package/src/components/Card/Card.jsx +2 -1
- package/src/components/Card/Card.module.scss +10 -31
- package/src/components/Card/README.md +6 -6
- package/src/components/Card/_settings.scss +5 -0
- package/src/components/Card/_theme.scss +0 -43
- package/src/components/Grid/Grid.module.scss +9 -2
- package/src/components/Popover/Popover.module.scss +16 -16
- package/src/components/Popover/_theme.scss +4 -2
- package/src/components/_helpers/getRootPriorityClassName.js +1 -1
- package/src/styles/settings/_collections.scss +9 -0
- package/src/styles/tools/_collections.scss +191 -0
- package/src/styles/tools/_string.scss +5 -2
- package/src/styles/tools/form-fields/_box-field-layout.scss +7 -1
- package/src/theme.scss +64 -0
- 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/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@react-ui-org/react-ui",
|
3
3
|
"description": "React UI is a themeable UI library for React apps.",
|
4
|
-
"version": "0.
|
4
|
+
"version": "0.57.0",
|
5
5
|
"keywords": [
|
6
6
|
"react",
|
7
7
|
"ui",
|
@@ -71,7 +71,7 @@
|
|
71
71
|
"@testing-library/react": "^16.0.0",
|
72
72
|
"@testing-library/user-event": "^14.5.2",
|
73
73
|
"@visionappscz/eslint-config-visionapps": "^1.7.0",
|
74
|
-
"@visionappscz/stylelint-config": "^4.0.0
|
74
|
+
"@visionappscz/stylelint-config": "^4.0.0",
|
75
75
|
"autoprefixer": "^10.4.19",
|
76
76
|
"babel-jest": "^29.7.0",
|
77
77
|
"babel-loader": "^9.1.3",
|
package/src/CNAME
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
react-ui.io
|
@@ -70,7 +70,8 @@ Alert.propTypes = {
|
|
70
70
|
*/
|
71
71
|
children: PropTypes.node.isRequired,
|
72
72
|
/**
|
73
|
-
*
|
73
|
+
* Color variant to clarify importance and meaning of the alert. Implements
|
74
|
+
* [Feedback and Neutral color collections](/docs/foundation/collections#colors).
|
74
75
|
*/
|
75
76
|
color: PropTypes.oneOf(['success', 'warning', 'danger', 'help', 'info', 'note', 'light', 'dark']),
|
76
77
|
/**
|
@@ -1,10 +1,10 @@
|
|
1
1
|
@use "sass:map";
|
2
2
|
@use "../../styles/theme/typography";
|
3
3
|
@use "../../styles/tools/accessibility";
|
4
|
+
@use "../../styles/tools/collections";
|
4
5
|
@use "../../styles/tools/reset";
|
5
6
|
@use "settings";
|
6
7
|
@use "theme";
|
7
|
-
@use "tools";
|
8
8
|
|
9
9
|
@layer components.alert {
|
10
10
|
.root {
|
@@ -66,35 +66,13 @@
|
|
66
66
|
top: -0.1em;
|
67
67
|
}
|
68
68
|
|
69
|
-
|
70
|
-
@include
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
.isRootColorDanger {
|
78
|
-
@include tools.color(danger);
|
79
|
-
}
|
80
|
-
|
81
|
-
.isRootColorHelp {
|
82
|
-
@include tools.color(help);
|
83
|
-
}
|
84
|
-
|
85
|
-
.isRootColorInfo {
|
86
|
-
@include tools.color(info);
|
87
|
-
}
|
88
|
-
|
89
|
-
.isRootColorNote {
|
90
|
-
@include tools.color(note);
|
91
|
-
}
|
92
|
-
|
93
|
-
.isRootColorLight {
|
94
|
-
@include tools.color(light);
|
95
|
-
}
|
96
|
-
|
97
|
-
.isRootColorDark {
|
98
|
-
@include tools.color(dark);
|
69
|
+
@each $color in settings.$colors {
|
70
|
+
@include collections.generate-class(
|
71
|
+
$prefix: "rui-",
|
72
|
+
$component-name: "Alert",
|
73
|
+
$variant-name: "color",
|
74
|
+
$variant-value: $color,
|
75
|
+
$properties: settings.$themeable-properties,
|
76
|
+
);
|
99
77
|
}
|
100
78
|
}
|
@@ -31,8 +31,8 @@ See [API](#api) for all available options.
|
|
31
31
|
|
32
32
|
## Color Variants
|
33
33
|
|
34
|
-
|
35
|
-
|
34
|
+
To cover all possible needs of your project, Alert is available in colors from
|
35
|
+
[Feedback and Neutral color collections](/docs/foundation/collections#colors).
|
36
36
|
|
37
37
|
### Success
|
38
38
|
|
@@ -208,9 +208,10 @@ convention looks as follows:
|
|
208
208
|
|
209
209
|
Where:
|
210
210
|
|
211
|
-
- `<COLOR>` is
|
212
|
-
[
|
213
|
-
(
|
211
|
+
- `<COLOR>` is a value from supported
|
212
|
+
[color collections](/docs/foundation/collections#colors)
|
213
|
+
(check [color variants](#color-variants) and [API](#api) to see which
|
214
|
+
collections are supported),
|
214
215
|
- `<PROPERTY>` is one of `color` (color of text), `foreground-color` (color of
|
215
216
|
border, icon, links, and emphasis), or `background-color`.
|
216
217
|
|
@@ -1,7 +1,12 @@
|
|
1
|
+
@use "sass:list";
|
1
2
|
@use "sass:map";
|
3
|
+
@use "../../styles/settings/collections";
|
2
4
|
@use "../../styles/theme/typography";
|
3
5
|
@use "theme";
|
4
6
|
|
5
7
|
$font-size: map.get(typography.$font-size-values, 1);
|
6
8
|
$line-height: typography.$line-height-base;
|
7
9
|
$min-height: calc(#{$font-size} * #{$line-height} + 2 * #{theme.$padding});
|
10
|
+
|
11
|
+
$colors: list.join(collections.$feedback-colors, collections.$neutral-colors);
|
12
|
+
$themeable-properties: color, foreground-color, background-color;
|
@@ -4,46 +4,3 @@ $border-width: var(--rui-Alert__border-width);
|
|
4
4
|
$border-radius: var(--rui-Alert__border-radius);
|
5
5
|
$emphasis-font-weight: var(--rui-Alert__emphasis__font-weight);
|
6
6
|
$stripe-width: var(--rui-Alert__stripe__width);
|
7
|
-
|
8
|
-
$colors: (
|
9
|
-
success: (
|
10
|
-
color: var(--rui-Alert--success__color),
|
11
|
-
foreground-color: var(--rui-Alert--success__foreground-color),
|
12
|
-
background-color: var(--rui-Alert--success__background-color),
|
13
|
-
),
|
14
|
-
warning: (
|
15
|
-
color: var(--rui-Alert--warning__color),
|
16
|
-
foreground-color: var(--rui-Alert--warning__foreground-color),
|
17
|
-
background-color: var(--rui-Alert--warning__background-color),
|
18
|
-
),
|
19
|
-
danger: (
|
20
|
-
color: var(--rui-Alert--danger__color),
|
21
|
-
foreground-color: var(--rui-Alert--danger__foreground-color),
|
22
|
-
background-color: var(--rui-Alert--danger__background-color),
|
23
|
-
),
|
24
|
-
info: (
|
25
|
-
color: var(--rui-Alert--info__color),
|
26
|
-
foreground-color: var(--rui-Alert--info__foreground-color),
|
27
|
-
background-color: var(--rui-Alert--info__background-color),
|
28
|
-
),
|
29
|
-
help: (
|
30
|
-
color: var(--rui-Alert--help__color),
|
31
|
-
foreground-color: var(--rui-Alert--help__foreground-color),
|
32
|
-
background-color: var(--rui-Alert--help__background-color),
|
33
|
-
),
|
34
|
-
note: (
|
35
|
-
color: var(--rui-Alert--note__color),
|
36
|
-
foreground-color: var(--rui-Alert--note__foreground-color),
|
37
|
-
background-color: var(--rui-Alert--note__background-color),
|
38
|
-
),
|
39
|
-
light: (
|
40
|
-
color: var(--rui-Alert--light__color),
|
41
|
-
foreground-color: var(--rui-Alert--light__foreground-color),
|
42
|
-
background-color: var(--rui-Alert--light__background-color),
|
43
|
-
),
|
44
|
-
dark: (
|
45
|
-
color: var(--rui-Alert--dark__color),
|
46
|
-
foreground-color: var(--rui-Alert--dark__foreground-color),
|
47
|
-
background-color: var(--rui-Alert--dark__background-color),
|
48
|
-
),
|
49
|
-
);
|
@@ -4,6 +4,7 @@ import { withGlobalProps } from '../../provider';
|
|
4
4
|
import { classNames } from '../../utils/classNames';
|
5
5
|
import { transferProps } from '../../utils/transferProps';
|
6
6
|
import { getRootColorClassName } from '../_helpers/getRootColorClassName';
|
7
|
+
import { getRootPriorityClassName } from '../_helpers/getRootPriorityClassName';
|
7
8
|
import styles from './Badge.module.scss';
|
8
9
|
|
9
10
|
export const Badge = ({
|
@@ -16,7 +17,7 @@ export const Badge = ({
|
|
16
17
|
{...transferProps(restProps)}
|
17
18
|
className={classNames(
|
18
19
|
styles.root,
|
19
|
-
priority
|
20
|
+
getRootPriorityClassName(priority, styles),
|
20
21
|
getRootColorClassName(color, styles),
|
21
22
|
)}
|
22
23
|
>
|
@@ -31,7 +32,8 @@ Badge.defaultProps = {
|
|
31
32
|
|
32
33
|
Badge.propTypes = {
|
33
34
|
/**
|
34
|
-
*
|
35
|
+
* Color to clarify importance and meaning of the badge. Implements
|
36
|
+
* [Feedback and Neutral color collections](/docs/foundation/collections#colors).
|
35
37
|
*/
|
36
38
|
color: PropTypes.oneOf(['success', 'warning', 'danger', 'help', 'info', 'note', 'light', 'dark']),
|
37
39
|
/**
|
@@ -2,14 +2,14 @@
|
|
2
2
|
@use "sass:math";
|
3
3
|
@use "../../styles/theme/borders";
|
4
4
|
@use "../../styles/theme/typography";
|
5
|
-
|
6
|
-
|
5
|
+
@use "../../styles/tools/collections";
|
6
|
+
@use "settings";
|
7
7
|
|
8
8
|
@layer components.badge {
|
9
9
|
.root {
|
10
10
|
display: inline-block;
|
11
|
-
min-width:
|
12
|
-
height:
|
11
|
+
min-width: settings.$badge-size;
|
12
|
+
height: settings.$badge-size;
|
13
13
|
padding: 0.25rem 0.35rem;
|
14
14
|
overflow: hidden;
|
15
15
|
font-weight: map.get(typography.$font-weight-values, bold);
|
@@ -19,91 +19,46 @@ $_badge-size: 1.25rem;
|
|
19
19
|
white-space: nowrap;
|
20
20
|
vertical-align: baseline;
|
21
21
|
color: var(--rui-local-color);
|
22
|
-
border-radius: math.div(
|
23
|
-
background-color: var(--rui-local-background-color);
|
24
|
-
box-shadow: var(--rui-local-box-shadow, #{0 0 0 2px rgb(255 255 255 / 80%)});
|
25
|
-
}
|
26
|
-
|
27
|
-
.isRootColorSuccess {
|
28
|
-
--rui-local-color: var(--rui-color-feedback-on-success);
|
29
|
-
--rui-local-background-color: var(--rui-color-feedback-success);
|
30
|
-
}
|
31
|
-
|
32
|
-
.isRootColorWarning {
|
33
|
-
--rui-local-color: var(--rui-color-feedback-on-warning);
|
34
|
-
--rui-local-background-color: var(--rui-color-feedback-warning);
|
35
|
-
}
|
36
|
-
|
37
|
-
.isRootColorDanger {
|
38
|
-
--rui-local-color: var(--rui-color-feedback-on-danger);
|
39
|
-
--rui-local-background-color: var(--rui-color-feedback-danger);
|
40
|
-
}
|
41
|
-
|
42
|
-
.isRootColorHelp {
|
43
|
-
--rui-local-color: var(--rui-color-feedback-on-help);
|
44
|
-
--rui-local-background-color: var(--rui-color-feedback-help);
|
45
|
-
}
|
46
|
-
|
47
|
-
.isRootColorInfo {
|
48
|
-
--rui-local-color: var(--rui-color-feedback-on-info);
|
49
|
-
--rui-local-background-color: var(--rui-color-feedback-info);
|
22
|
+
border-radius: math.div(settings.$badge-size, 2);
|
50
23
|
}
|
51
24
|
|
52
|
-
.
|
53
|
-
|
54
|
-
|
25
|
+
.isRootPriorityFilled {
|
26
|
+
background-color: var(--rui-local-background-color);
|
27
|
+
box-shadow: var(--rui-local-box-shadow, #{0 0 0 2px rgb(255 255 255 / 80%)});
|
55
28
|
}
|
56
29
|
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
30
|
+
@each $color in settings.$colors {
|
31
|
+
@include collections.generate-class(
|
32
|
+
$prefix: "rui-",
|
33
|
+
$component-name: "Badge",
|
34
|
+
$modifier-name: "priority",
|
35
|
+
$modifier-value: "filled",
|
36
|
+
$variant-name: "color",
|
37
|
+
$variant-value: $color,
|
38
|
+
$properties: settings.$themeable-properties-filled,
|
39
|
+
);
|
61
40
|
}
|
62
41
|
|
42
|
+
.isRootColorLight,
|
63
43
|
.isRootColorDark {
|
64
|
-
--rui-local-color: var(--rui-color-neutral-on-dark);
|
65
|
-
--rui-local-background-color: var(--rui-color-neutral-dark);
|
66
44
|
--rui-local-box-shadow: none;
|
67
45
|
}
|
68
46
|
|
69
47
|
.isRootPriorityOutline {
|
70
|
-
--rui-local-background-color: transparent;
|
71
|
-
--rui-local-box-shadow: none;
|
72
|
-
|
73
48
|
padding-top: 0.1875rem;
|
74
49
|
padding-bottom: 0.1875rem;
|
75
50
|
border: borders.$width solid currentcolor;
|
76
51
|
}
|
77
52
|
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
}
|
89
|
-
|
90
|
-
.isRootPriorityOutline.isRootColorHelp {
|
91
|
-
--rui-local-color: var(--rui-color-feedback-help);
|
92
|
-
}
|
93
|
-
|
94
|
-
.isRootPriorityOutline.isRootColorInfo {
|
95
|
-
--rui-local-color: var(--rui-color-feedback-info);
|
96
|
-
}
|
97
|
-
|
98
|
-
.isRootPriorityOutline.isRootColorNote {
|
99
|
-
--rui-local-color: var(--rui-color-feedback-note);
|
100
|
-
}
|
101
|
-
|
102
|
-
.isRootPriorityOutline.isRootColorLight {
|
103
|
-
--rui-local-color: var(--rui-color-neutral-light);
|
104
|
-
}
|
105
|
-
|
106
|
-
.isRootPriorityOutline.isRootColorDark {
|
107
|
-
--rui-local-color: var(--rui-color-neutral-dark);
|
53
|
+
@each $color in settings.$colors {
|
54
|
+
@include collections.generate-class(
|
55
|
+
$prefix: "rui-",
|
56
|
+
$component-name: "Badge",
|
57
|
+
$modifier-name: "priority",
|
58
|
+
$modifier-value: "outline",
|
59
|
+
$variant-name: "color",
|
60
|
+
$variant-value: $color,
|
61
|
+
$properties: settings.$themeable-properties-outline,
|
62
|
+
);
|
108
63
|
}
|
109
64
|
}
|
@@ -29,8 +29,9 @@ lowest:
|
|
29
29
|
1. filled
|
30
30
|
2. outline
|
31
31
|
|
32
|
-
All priorities
|
33
|
-
[
|
32
|
+
All priorities are available in colors from supported
|
33
|
+
[color collections](/docs/foundation/collections#colors).
|
34
|
+
Check [API](#api) to see which collections are supported.
|
34
35
|
|
35
36
|
### Filled
|
36
37
|
|
@@ -102,5 +103,21 @@ helps to improve its accessibility.
|
|
102
103
|
|
103
104
|
<docoff-react-props src="/components/Badge/Badge.jsx" />
|
104
105
|
|
106
|
+
## Theming
|
107
|
+
|
108
|
+
It's possible to adjust the theme of specific badge color variant. Naming
|
109
|
+
convention looks as follows:
|
110
|
+
|
111
|
+
`--rui-Badge--<PRIORITY>--<COLOR>__<PROPERTY>`
|
112
|
+
|
113
|
+
Where:
|
114
|
+
|
115
|
+
- `<PRIORITY>` is one of `filled` or `outline`,
|
116
|
+
- `<COLOR>` is a value from supported
|
117
|
+
[color collections](/docs/foundation/collections#colors)
|
118
|
+
(check [API](#api) to see which collections are supported),
|
119
|
+
- `<PROPERTY>` is one of `color` (color of text) or `background-color` for the
|
120
|
+
filled priority, or just `color` for the outline priority.
|
121
|
+
|
105
122
|
[div-attributes]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/div#attributes
|
106
123
|
[React common props]: https://react.dev/reference/react-dom/components/common#common-props
|
@@ -0,0 +1,8 @@
|
|
1
|
+
@use "sass:list";
|
2
|
+
@use "../../styles/settings/collections";
|
3
|
+
|
4
|
+
$badge-size: 1.25rem;
|
5
|
+
|
6
|
+
$colors: list.join(collections.$feedback-colors, collections.$neutral-colors);
|
7
|
+
$themeable-properties-filled: color, background-color;
|
8
|
+
$themeable-properties-outline: color;
|
@@ -4,11 +4,11 @@ import { withGlobalProps } from '../../provider';
|
|
4
4
|
import { classNames } from '../../utils/classNames';
|
5
5
|
import { transferProps } from '../../utils/transferProps';
|
6
6
|
import { getRootColorClassName } from '../_helpers/getRootColorClassName';
|
7
|
+
import { getRootPriorityClassName } from '../_helpers/getRootPriorityClassName';
|
7
8
|
import { getRootSizeClassName } from '../_helpers/getRootSizeClassName';
|
8
9
|
import { resolveContextOrProp } from '../_helpers/resolveContextOrProp';
|
9
10
|
import { ButtonGroupContext } from '../ButtonGroup';
|
10
11
|
import { InputGroupContext } from '../InputGroup/InputGroupContext';
|
11
|
-
import getRootPriorityClassName from '../_helpers/getRootPriorityClassName';
|
12
12
|
import getRootLabelVisibilityClassName from './helpers/getRootLabelVisibilityClassName';
|
13
13
|
import styles from './Button.module.scss';
|
14
14
|
|
@@ -133,7 +133,8 @@ Button.propTypes = {
|
|
133
133
|
*/
|
134
134
|
block: PropTypes.bool,
|
135
135
|
/**
|
136
|
-
*
|
136
|
+
* Color variant to clarify importance and meaning of the alert. Implements
|
137
|
+
* [Action, Feedback and Neutral color collections](/docs/foundation/collections#colors).
|
137
138
|
*/
|
138
139
|
color: PropTypes.oneOf(
|
139
140
|
['primary', 'secondary', 'selected', 'success', 'warning', 'danger', 'help', 'info', 'note', 'light', 'dark'],
|
@@ -1,2 +1,183 @@
|
|
1
|
-
|
2
|
-
|
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 "../../styles/tools/collections";
|
7
|
+
@use "settings";
|
8
|
+
@use "theme";
|
9
|
+
@use "tools";
|
10
|
+
|
11
|
+
@layer components.button {
|
12
|
+
.root {
|
13
|
+
@include tools.button();
|
14
|
+
}
|
15
|
+
|
16
|
+
.label {
|
17
|
+
display: block;
|
18
|
+
}
|
19
|
+
|
20
|
+
.beforeLabel,
|
21
|
+
.afterLabel,
|
22
|
+
.startCorner,
|
23
|
+
.endCorner,
|
24
|
+
.feedbackIcon {
|
25
|
+
display: flex;
|
26
|
+
align-items: baseline;
|
27
|
+
justify-content: center;
|
28
|
+
}
|
29
|
+
|
30
|
+
.startCorner,
|
31
|
+
.endCorner {
|
32
|
+
position: absolute;
|
33
|
+
top: -0.35rem;
|
34
|
+
z-index: 2;
|
35
|
+
}
|
36
|
+
|
37
|
+
.startCorner {
|
38
|
+
left: 0;
|
39
|
+
margin-left: -0.35rem;
|
40
|
+
}
|
41
|
+
|
42
|
+
.endCorner {
|
43
|
+
right: 0;
|
44
|
+
margin-right: -0.35rem;
|
45
|
+
}
|
46
|
+
|
47
|
+
.feedbackIcon {
|
48
|
+
position: absolute;
|
49
|
+
inset: 0;
|
50
|
+
z-index: 1;
|
51
|
+
align-items: center;
|
52
|
+
}
|
53
|
+
|
54
|
+
.isRootSizeSmall {
|
55
|
+
@include tools.button-size(small);
|
56
|
+
}
|
57
|
+
|
58
|
+
.isRootSizeMedium {
|
59
|
+
@include tools.button-size(medium);
|
60
|
+
}
|
61
|
+
|
62
|
+
.isRootSizeLarge {
|
63
|
+
@include tools.button-size(large);
|
64
|
+
}
|
65
|
+
|
66
|
+
.isRootBlock {
|
67
|
+
width: 100%;
|
68
|
+
}
|
69
|
+
|
70
|
+
.hasRootFeedback:disabled {
|
71
|
+
opacity: theme.$feedback-opacity;
|
72
|
+
cursor: theme.$feedback-cursor;
|
73
|
+
}
|
74
|
+
|
75
|
+
.hasRootFeedback .label,
|
76
|
+
.hasRootFeedback .beforeLabel,
|
77
|
+
.hasRootFeedback .afterLabel {
|
78
|
+
color: transparent;
|
79
|
+
}
|
80
|
+
|
81
|
+
.isRootInButtonGroup,
|
82
|
+
.isRootInInputGroup {
|
83
|
+
z-index: map.get(settings.$group-z-indexes, button);
|
84
|
+
|
85
|
+
&:not(:first-child) {
|
86
|
+
border-start-start-radius: var(--rui-local-inner-border-radius);
|
87
|
+
border-end-start-radius: var(--rui-local-inner-border-radius);
|
88
|
+
}
|
89
|
+
|
90
|
+
&:not(:last-child) {
|
91
|
+
border-start-end-radius: var(--rui-local-inner-border-radius);
|
92
|
+
border-end-end-radius: var(--rui-local-inner-border-radius);
|
93
|
+
}
|
94
|
+
}
|
95
|
+
|
96
|
+
.isRootInButtonGroup:not(:first-child) {
|
97
|
+
margin-inline-start: var(--rui-local-gap); // 1.
|
98
|
+
|
99
|
+
&::before {
|
100
|
+
content: "";
|
101
|
+
position: absolute;
|
102
|
+
top: calc(-1 * #{theme.$border-width});
|
103
|
+
bottom: calc(-1 * #{theme.$border-width});
|
104
|
+
left: calc(-1 * #{theme.$border-width});
|
105
|
+
z-index: map.get(settings.$group-z-indexes, separator);
|
106
|
+
border-left: var(--rui-local-separator-width) solid var(--rui-local-separator-color);
|
107
|
+
transform: translateX(calc(-0.5 * var(--rui-local-gap) - 50%));
|
108
|
+
}
|
109
|
+
}
|
110
|
+
|
111
|
+
.isRootInButtonGroup:focus,
|
112
|
+
.isRootInButtonGroup:not(:disabled):hover {
|
113
|
+
z-index: map.get(settings.$group-z-indexes, button-hover);
|
114
|
+
}
|
115
|
+
|
116
|
+
.isRootInButtonGroup .startCorner,
|
117
|
+
.isRootInInputGroup .startCorner,
|
118
|
+
.isRootInButtonGroup .endCorner,
|
119
|
+
.isRootInInputGroup .endCorner {
|
120
|
+
z-index: map.get(settings.$group-z-indexes, button-overflowing-elements);
|
121
|
+
}
|
122
|
+
|
123
|
+
.hasLabelHidden,
|
124
|
+
.hasLabelVisibleSm,
|
125
|
+
.hasLabelVisibleMd,
|
126
|
+
.hasLabelVisibleLg,
|
127
|
+
.hasLabelVisibleXl,
|
128
|
+
.hasLabelVisibleX2l,
|
129
|
+
.hasLabelVisibleX3l {
|
130
|
+
@include tools.hide-label();
|
131
|
+
}
|
132
|
+
|
133
|
+
.hasLabelVisibleSm {
|
134
|
+
@include breakpoint.up(sm) {
|
135
|
+
@include tools.show-label();
|
136
|
+
}
|
137
|
+
}
|
138
|
+
|
139
|
+
.hasLabelVisibleMd {
|
140
|
+
@include breakpoint.up(md) {
|
141
|
+
@include tools.show-label();
|
142
|
+
}
|
143
|
+
}
|
144
|
+
|
145
|
+
.hasLabelVisibleLg {
|
146
|
+
@include breakpoint.up(lg) {
|
147
|
+
@include tools.show-label();
|
148
|
+
}
|
149
|
+
}
|
150
|
+
|
151
|
+
.hasLabelVisibleXl {
|
152
|
+
@include breakpoint.up(xl) {
|
153
|
+
@include tools.show-label();
|
154
|
+
}
|
155
|
+
}
|
156
|
+
|
157
|
+
.hasLabelVisibleX2l {
|
158
|
+
@include breakpoint.up(x2l) {
|
159
|
+
@include tools.show-label();
|
160
|
+
}
|
161
|
+
}
|
162
|
+
|
163
|
+
.hasLabelVisibleX3l {
|
164
|
+
@include breakpoint.up(x3l) {
|
165
|
+
@include tools.show-label();
|
166
|
+
}
|
167
|
+
}
|
168
|
+
|
169
|
+
@each $priority in map.keys(settings.$themeable-properties) {
|
170
|
+
@each $color in settings.$colors {
|
171
|
+
@include collections.generate-class(
|
172
|
+
$prefix: "rui-",
|
173
|
+
$component-name: "Button",
|
174
|
+
$modifier-name: "priority",
|
175
|
+
$modifier-value: $priority,
|
176
|
+
$variant-name: "color",
|
177
|
+
$variant-value: $color,
|
178
|
+
$generate-interaction-states: true,
|
179
|
+
$properties: map.get(settings.$themeable-properties, $priority),
|
180
|
+
);
|
181
|
+
}
|
182
|
+
}
|
183
|
+
}
|
@@ -40,8 +40,9 @@ lowest:
|
|
40
40
|
2. outline
|
41
41
|
3. flat
|
42
42
|
|
43
|
-
All priorities
|
44
|
-
[
|
43
|
+
All priorities are available in colors from supported
|
44
|
+
[color collections](/docs/foundation/collections#colors).
|
45
|
+
Check [API](#api) to see which collections are supported.
|
45
46
|
|
46
47
|
### Filled
|
47
48
|
|
@@ -257,7 +258,7 @@ Disabled state makes the action unavailable.
|
|
257
258
|
|
258
259
|
When user's action triggers an asynchronous process on background, the button's
|
259
260
|
feedback state (not to be mistaken with
|
260
|
-
[feedback colors](/docs/foundation/colors#
|
261
|
+
[feedback colors](/docs/foundation/colors#feedback-colors)) can be indicated by
|
261
262
|
showing an icon. The icon replaces button's label while retaining original
|
262
263
|
dimensions of the button. Buttons in feedback state are automatically disabled
|
263
264
|
to prevent unwanted interaction.
|
@@ -431,9 +432,10 @@ Where:
|
|
431
432
|
|
432
433
|
- `<PRIORITY>` is one of `filled`, `outline`, or `flat` (see
|
433
434
|
[Priorities](#priorities) and [API](#api)),
|
434
|
-
- `<COLOR>` is
|
435
|
-
[
|
436
|
-
(
|
435
|
+
- `<COLOR>` is a value from supported
|
436
|
+
[color collections](/docs/foundation/collections#colors)
|
437
|
+
(check color variants of [each priority](#priorities) and [API](#api) to see
|
438
|
+
which collections are supported),
|
437
439
|
- `<INTERACTION STATE>` is one of `default`, `hover`, `active`, or `disabled`
|
438
440
|
(the last one being optional),
|
439
441
|
- `<PROPERTY>` is one of:
|
@@ -1,3 +1,5 @@
|
|
1
|
+
@use "sass:list";
|
2
|
+
@use "../../styles/settings/collections";
|
1
3
|
@use "../../styles/theme/typography";
|
2
4
|
@use "../../styles/tools/spacing";
|
3
5
|
|
@@ -12,9 +14,12 @@ $group-z-indexes: (
|
|
12
14
|
button-overflowing-elements: 3,
|
13
15
|
);
|
14
16
|
|
15
|
-
$
|
16
|
-
|
17
|
-
|
17
|
+
$colors:
|
18
|
+
list.join(
|
19
|
+
list.join(collections.$action-colors, collections.$feedback-colors),
|
20
|
+
collections.$neutral-colors
|
21
|
+
);
|
22
|
+
$themeable-properties: (
|
18
23
|
filled: (color, border-color, background, box-shadow),
|
19
24
|
outline: (color, border-color, background),
|
20
25
|
flat: (color, background),
|
@@ -1,6 +1,3 @@
|
|
1
|
-
// Priority and variant specific theme options are obtained dynamically because there is way too
|
2
|
-
// many of them to maintain manually. See `_tools.scss` for details.
|
3
|
-
|
4
1
|
$font-weight: var(--rui-Button__font-weight);
|
5
2
|
$letter-spacing: var(--rui-Button__letter-spacing);
|
6
3
|
$text-transform: var(--rui-Button__text-transform);
|