@react-ui-org/react-ui 0.50.2 → 0.51.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/lib.development.js +30 -30
- package/dist/lib.js +1 -1
- package/package.json +1 -1
- package/src/lib/components/Alert/Alert.jsx +1 -3
- package/src/lib/components/Alert/Alert.scss +1 -9
- package/src/lib/components/Alert/README.mdx +0 -20
- package/src/lib/components/Alert/_settings.scss +1 -1
- package/src/lib/components/Alert/_theme.scss +0 -10
- package/src/lib/components/Badge/Badge.jsx +1 -3
- package/src/lib/components/Badge/Badge.scss +25 -44
- package/src/lib/components/Badge/README.mdx +6 -14
- package/src/lib/components/Button/Button.jsx +3 -1
- package/src/lib/components/Button/README.mdx +8 -3
- package/src/lib/components/Button/_priorities.scss +12 -0
- package/src/lib/components/Button/_settings.scss +1 -1
- package/src/lib/components/ButtonGroup/README.mdx +74 -58
- package/src/lib/components/Card/Card.jsx +1 -3
- package/src/lib/components/Card/Card.scss +0 -9
- package/src/lib/components/Card/README.mdx +0 -16
- package/src/lib/components/Card/_theme.scss +0 -10
- package/src/lib/components/FormLayout/README.mdx +17 -8
- package/src/lib/components/Grid/_helpers/generateResponsiveCustomProperties.js +1 -1
- package/src/lib/components/Modal/ModalCloseButton.scss +2 -2
- package/src/lib/components/Modal/README.mdx +106 -115
- package/src/lib/components/Modal/_settings.scss +1 -1
- package/src/lib/components/Popover/README.mdx +7 -4
- package/src/lib/components/ScrollView/README.mdx +2 -2
- package/src/lib/components/Table/_components/TableCell.scss +6 -5
- package/src/lib/components/Table/_components/TableHeaderCell/TableHeaderCell.jsx +8 -5
- package/src/lib/components/Table/_settings.scss +5 -6
- package/src/lib/components/Text/README.mdx +14 -8
- package/src/lib/components/TextLink/README.mdx +8 -6
- package/src/lib/components/TextLink/TextLink.scss +5 -0
- package/src/lib/components/TextLink/_theme.scss +2 -0
- package/src/lib/components/Toolbar/README.mdx +19 -11
- package/src/lib/components/_helpers/getRootColorClassName.js +4 -0
- package/src/lib/styles/elements/_code.scss +1 -3
- package/src/lib/styles/elements/_page.scss +1 -0
- package/src/lib/styles/elements/_rulers.scss +1 -3
- package/src/lib/styles/elements/_small.scss +1 -1
- package/src/lib/styles/settings/_form-fields.scss +1 -1
- package/src/lib/styles/settings/_utilities.scss +46 -14
- package/src/lib/styles/theme/_accessibility.scss +4 -4
- package/src/lib/styles/theme/_borders.scss +2 -2
- package/src/lib/styles/theme/_code.scss +2 -2
- package/src/lib/styles/theme/_links.scss +6 -4
- package/src/lib/styles/theme/_lists.scss +1 -1
- package/src/lib/styles/theme/_page.scss +2 -2
- package/src/lib/styles/theme/_spacing.scss +11 -11
- package/src/lib/styles/theme/_typography.scss +19 -18
- package/src/lib/styles/theme-constants/_colors.scss +23 -23
- package/src/lib/styles/tools/_spacing.scss +1 -1
- package/src/lib/theme.scss +635 -564
- package/src/lib/styles/theme/_colors.scss +0 -65
package/package.json
CHANGED
@@ -72,9 +72,7 @@ Alert.propTypes = {
|
|
72
72
|
/**
|
73
73
|
* [Color variant](/foundation/colors#component-colors) to clarify importance and meaning of the alert.
|
74
74
|
*/
|
75
|
-
color: PropTypes.oneOf(
|
76
|
-
['primary', 'secondary', 'success', 'warning', 'danger', 'help', 'info', 'note', 'light', 'dark'],
|
77
|
-
),
|
75
|
+
color: PropTypes.oneOf(['success', 'warning', 'danger', 'help', 'info', 'note', 'light', 'dark']),
|
78
76
|
/**
|
79
77
|
* Optional element to be displayed next to the alert body.
|
80
78
|
*/
|
@@ -56,7 +56,7 @@
|
|
56
56
|
@include accessibility.min-tap-target();
|
57
57
|
|
58
58
|
padding: theme.$padding;
|
59
|
-
font-size: map.get(typography.$size-values,
|
59
|
+
font-size: map.get(typography.$font-size-values, 4);
|
60
60
|
line-height: 1;
|
61
61
|
}
|
62
62
|
|
@@ -65,14 +65,6 @@
|
|
65
65
|
top: -0.1em;
|
66
66
|
}
|
67
67
|
|
68
|
-
.isRootColorPrimary {
|
69
|
-
@include tools.color(primary);
|
70
|
-
}
|
71
|
-
|
72
|
-
.isRootColorSecondary {
|
73
|
-
@include tools.color(secondary);
|
74
|
-
}
|
75
|
-
|
76
68
|
.isRootColorSuccess {
|
77
69
|
@include tools.color(success);
|
78
70
|
}
|
@@ -51,26 +51,6 @@ See [API](#api) for all available options.
|
|
51
51
|
All [component colors](/foundation/colors#component-colors) are supported by
|
52
52
|
alert to cover all possible needs of your project.
|
53
53
|
|
54
|
-
### Primary
|
55
|
-
|
56
|
-
Primary alert uses brand primary color.
|
57
|
-
|
58
|
-
<Playground>
|
59
|
-
<Alert color="primary">
|
60
|
-
<strong>Primary:</strong> This is a primary alert.
|
61
|
-
</Alert>
|
62
|
-
</Playground>
|
63
|
-
|
64
|
-
### Secondary
|
65
|
-
|
66
|
-
Secondary alert uses brand secondary color.
|
67
|
-
|
68
|
-
<Playground>
|
69
|
-
<Alert color="secondary">
|
70
|
-
<strong>Secondary:</strong> This is a secondary alert.
|
71
|
-
</Alert>
|
72
|
-
</Playground>
|
73
|
-
|
74
54
|
### Success
|
75
55
|
|
76
56
|
Success alerts confirm that an operation has been processed successfully.
|
@@ -2,6 +2,6 @@
|
|
2
2
|
@use "../../styles/theme/typography";
|
3
3
|
@use "theme";
|
4
4
|
|
5
|
-
$font-size: map.get(typography.$size-values,
|
5
|
+
$font-size: map.get(typography.$font-size-values, 1);
|
6
6
|
$line-height: typography.$line-height-base;
|
7
7
|
$min-height: calc(#{$font-size} * #{$line-height} + 2 * #{theme.$padding});
|
@@ -6,16 +6,6 @@ $emphasis-font-weight: var(--rui-Alert__emphasis__font-weight);
|
|
6
6
|
$stripe-width: var(--rui-Alert__stripe__width);
|
7
7
|
|
8
8
|
$colors: (
|
9
|
-
primary: (
|
10
|
-
color: var(--rui-Alert--primary__color),
|
11
|
-
foreground-color: var(--rui-Alert--primary__foreground-color),
|
12
|
-
background-color: var(--rui-Alert--primary__background-color),
|
13
|
-
),
|
14
|
-
secondary: (
|
15
|
-
color: var(--rui-Alert--secondary__color),
|
16
|
-
foreground-color: var(--rui-Alert--secondary__foreground-color),
|
17
|
-
background-color: var(--rui-Alert--secondary__background-color),
|
18
|
-
),
|
19
9
|
success: (
|
20
10
|
color: var(--rui-Alert--success__color),
|
21
11
|
foreground-color: var(--rui-Alert--success__foreground-color),
|
@@ -33,9 +33,7 @@ Badge.propTypes = {
|
|
33
33
|
/**
|
34
34
|
* [Color variant](/foundation/colors#component-colors) to clarify importance and meaning of the badge.
|
35
35
|
*/
|
36
|
-
color: PropTypes.oneOf(
|
37
|
-
['primary', 'secondary', 'success', 'warning', 'danger', 'help', 'info', 'note', 'light', 'dark'],
|
38
|
-
),
|
36
|
+
color: PropTypes.oneOf(['success', 'warning', 'danger', 'help', 'info', 'note', 'light', 'dark']),
|
39
37
|
/**
|
40
38
|
* Text to be displayed.
|
41
39
|
*/
|
@@ -1,7 +1,6 @@
|
|
1
1
|
@use "sass:map";
|
2
2
|
@use "sass:math";
|
3
3
|
@use "../../styles/theme/borders";
|
4
|
-
@use "../../styles/theme/colors";
|
5
4
|
@use "../../styles/theme/typography";
|
6
5
|
|
7
6
|
$_badge-size: 1.25rem;
|
@@ -13,7 +12,7 @@ $_badge-size: 1.25rem;
|
|
13
12
|
padding: 0.25rem 0.35rem;
|
14
13
|
overflow: hidden;
|
15
14
|
font-weight: map.get(typography.$font-weight-values, bold);
|
16
|
-
font-size: typography.$size-smaller;
|
15
|
+
font-size: typography.$font-size-smaller;
|
17
16
|
line-height: 1;
|
18
17
|
text-align: center;
|
19
18
|
white-space: nowrap;
|
@@ -24,55 +23,45 @@ $_badge-size: 1.25rem;
|
|
24
23
|
box-shadow: var(--rui-local-box-shadow, #{0 0 0 2px rgb(255 255 255 / 80%)});
|
25
24
|
}
|
26
25
|
|
27
|
-
.isRootColorPrimary {
|
28
|
-
--rui-local-color: #{map.get(colors.$brand, on-primary)};
|
29
|
-
--rui-local-background-color: #{map.get(colors.$brand, primary)};
|
30
|
-
}
|
31
|
-
|
32
|
-
.isRootColorSecondary {
|
33
|
-
--rui-local-color: #{map.get(colors.$brand, on-secondary)};
|
34
|
-
--rui-local-background-color: #{map.get(colors.$brand, secondary)};
|
35
|
-
}
|
36
|
-
|
37
26
|
.isRootColorSuccess {
|
38
|
-
--rui-local-color:
|
39
|
-
--rui-local-background-color:
|
27
|
+
--rui-local-color: var(--rui-color-feedback-on-success);
|
28
|
+
--rui-local-background-color: var(--rui-color-feedback-success);
|
40
29
|
}
|
41
30
|
|
42
31
|
.isRootColorWarning {
|
43
|
-
--rui-local-color:
|
44
|
-
--rui-local-background-color:
|
32
|
+
--rui-local-color: var(--rui-color-feedback-on-warning);
|
33
|
+
--rui-local-background-color: var(--rui-color-feedback-warning);
|
45
34
|
}
|
46
35
|
|
47
36
|
.isRootColorDanger {
|
48
|
-
--rui-local-color:
|
49
|
-
--rui-local-background-color:
|
37
|
+
--rui-local-color: var(--rui-color-feedback-on-danger);
|
38
|
+
--rui-local-background-color: var(--rui-color-feedback-danger);
|
50
39
|
}
|
51
40
|
|
52
41
|
.isRootColorHelp {
|
53
|
-
--rui-local-color:
|
54
|
-
--rui-local-background-color:
|
42
|
+
--rui-local-color: var(--rui-color-feedback-on-help);
|
43
|
+
--rui-local-background-color: var(--rui-color-feedback-help);
|
55
44
|
}
|
56
45
|
|
57
46
|
.isRootColorInfo {
|
58
|
-
--rui-local-color:
|
59
|
-
--rui-local-background-color:
|
47
|
+
--rui-local-color: var(--rui-color-feedback-on-info);
|
48
|
+
--rui-local-background-color: var(--rui-color-feedback-info);
|
60
49
|
}
|
61
50
|
|
62
51
|
.isRootColorNote {
|
63
|
-
--rui-local-color:
|
64
|
-
--rui-local-background-color:
|
52
|
+
--rui-local-color: var(--rui-color-feedback-on-note);
|
53
|
+
--rui-local-background-color: var(--rui-color-feedback-note);
|
65
54
|
}
|
66
55
|
|
67
56
|
.isRootColorLight {
|
68
|
-
--rui-local-color:
|
69
|
-
--rui-local-background-color:
|
57
|
+
--rui-local-color: var(--rui-color-neutral-on-light);
|
58
|
+
--rui-local-background-color: var(--rui-color-neutral-light);
|
70
59
|
--rui-local-box-shadow: none;
|
71
60
|
}
|
72
61
|
|
73
62
|
.isRootColorDark {
|
74
|
-
--rui-local-color:
|
75
|
-
--rui-local-background-color:
|
63
|
+
--rui-local-color: var(--rui-color-neutral-on-dark);
|
64
|
+
--rui-local-background-color: var(--rui-color-neutral-dark);
|
76
65
|
--rui-local-box-shadow: none;
|
77
66
|
}
|
78
67
|
|
@@ -85,42 +74,34 @@ $_badge-size: 1.25rem;
|
|
85
74
|
border: borders.$width solid currentColor;
|
86
75
|
}
|
87
76
|
|
88
|
-
.isRootPriorityOutline.isRootColorPrimary {
|
89
|
-
--rui-local-color: #{map.get(colors.$brand, primary)};
|
90
|
-
}
|
91
|
-
|
92
|
-
.isRootPriorityOutline.isRootColorSecondary {
|
93
|
-
--rui-local-color: #{map.get(colors.$brand, secondary)};
|
94
|
-
}
|
95
|
-
|
96
77
|
.isRootPriorityOutline.isRootColorSuccess {
|
97
|
-
--rui-local-color:
|
78
|
+
--rui-local-color: var(--rui-color-feedback-success);
|
98
79
|
}
|
99
80
|
|
100
81
|
.isRootPriorityOutline.isRootColorWarning {
|
101
|
-
--rui-local-color:
|
82
|
+
--rui-local-color: var(--rui-color-feedback-warning);
|
102
83
|
}
|
103
84
|
|
104
85
|
.isRootPriorityOutline.isRootColorDanger {
|
105
|
-
--rui-local-color:
|
86
|
+
--rui-local-color: var(--rui-color-feedback-danger);
|
106
87
|
}
|
107
88
|
|
108
89
|
.isRootPriorityOutline.isRootColorHelp {
|
109
|
-
--rui-local-color:
|
90
|
+
--rui-local-color: var(--rui-color-feedback-help);
|
110
91
|
}
|
111
92
|
|
112
93
|
.isRootPriorityOutline.isRootColorInfo {
|
113
|
-
--rui-local-color:
|
94
|
+
--rui-local-color: var(--rui-color-feedback-info);
|
114
95
|
}
|
115
96
|
|
116
97
|
.isRootPriorityOutline.isRootColorNote {
|
117
|
-
--rui-local-color:
|
98
|
+
--rui-local-color: var(--rui-color-feedback-note);
|
118
99
|
}
|
119
100
|
|
120
101
|
.isRootPriorityOutline.isRootColorLight {
|
121
|
-
--rui-local-color:
|
102
|
+
--rui-local-color: var(--rui-color-neutral-light);
|
122
103
|
}
|
123
104
|
|
124
105
|
.isRootPriorityOutline.isRootColorDark {
|
125
|
-
--rui-local-color:
|
106
|
+
--rui-local-color: var(--rui-color-neutral-dark);
|
126
107
|
}
|
@@ -52,11 +52,9 @@ All priorities come in supported
|
|
52
52
|
High-emphasis priority to draw user's attention.
|
53
53
|
|
54
54
|
<Playground>
|
55
|
-
<Badge label="1" color="
|
56
|
-
<Badge label="2" color="
|
57
|
-
<Badge label="3" color="
|
58
|
-
<Badge label="4" color="warning" />
|
59
|
-
<Badge label="5" color="danger" />
|
55
|
+
<Badge label="1" color="success" />
|
56
|
+
<Badge label="2" color="warning" />
|
57
|
+
<Badge label="3" color="danger" />
|
60
58
|
<Badge label="10" color="help" />
|
61
59
|
<Badge label="34" color="info" />
|
62
60
|
<Badge label="99+" />
|
@@ -67,8 +65,6 @@ High-emphasis priority to draw user's attention.
|
|
67
65
|
</Playground>
|
68
66
|
|
69
67
|
<Playground>
|
70
|
-
<Badge label="Primary" color="primary" />
|
71
|
-
<Badge label="Secondary" color="secondary" />
|
72
68
|
<Badge label="Success" color="success" />
|
73
69
|
<Badge label="Warning" color="warning" />
|
74
70
|
<Badge label="Danger" color="danger" />
|
@@ -86,11 +82,9 @@ High-emphasis priority to draw user's attention.
|
|
86
82
|
Medium-emphasis priority to provide additional context in an unobtrusive way.
|
87
83
|
|
88
84
|
<Playground>
|
89
|
-
<Badge priority="outline" label="1" color="
|
90
|
-
<Badge priority="outline" label="2" color="
|
91
|
-
<Badge priority="outline" label="3" color="
|
92
|
-
<Badge priority="outline" label="4" color="warning" />
|
93
|
-
<Badge priority="outline" label="5" color="danger" />
|
85
|
+
<Badge priority="outline" label="1" color="success" />
|
86
|
+
<Badge priority="outline" label="2" color="warning" />
|
87
|
+
<Badge priority="outline" label="3" color="danger" />
|
94
88
|
<Badge priority="outline" label="10" color="help" />
|
95
89
|
<Badge priority="outline" label="34" color="info" />
|
96
90
|
<Badge priority="outline" label="99+" />
|
@@ -101,8 +95,6 @@ Medium-emphasis priority to provide additional context in an unobtrusive way.
|
|
101
95
|
</Playground>
|
102
96
|
|
103
97
|
<Playground>
|
104
|
-
<Badge priority="outline" label="Primary" color="primary" />
|
105
|
-
<Badge priority="outline" label="Secondary" color="secondary" />
|
106
98
|
<Badge priority="outline" label="Success" color="success" />
|
107
99
|
<Badge priority="outline" label="Warning" color="warning" />
|
108
100
|
<Badge priority="outline" label="Danger" color="danger" />
|
@@ -127,7 +127,9 @@ Button.propTypes = {
|
|
127
127
|
/**
|
128
128
|
* [Color variant](/foundation/colors#component-colors) to clarify importance and meaning of the button.
|
129
129
|
*/
|
130
|
-
color: PropTypes.oneOf(
|
130
|
+
color: PropTypes.oneOf(
|
131
|
+
['primary', 'secondary', 'selected', 'success', 'warning', 'danger', 'help', 'info', 'note', 'light', 'dark'],
|
132
|
+
),
|
131
133
|
/**
|
132
134
|
* If `true`, the button will be disabled.
|
133
135
|
*
|
@@ -65,6 +65,7 @@ app. Use it sparingly but remember there should always be one on a screen.
|
|
65
65
|
<Playground>
|
66
66
|
<Button label="Primary" />
|
67
67
|
<Button label="Secondary" color="secondary" />
|
68
|
+
<Button label="Selected" color="selected" />
|
68
69
|
<Button label="Success" color="success" />
|
69
70
|
<Button label="Warning" color="warning" />
|
70
71
|
<Button label="Danger" color="danger" />
|
@@ -88,6 +89,7 @@ important but not primary in your app.
|
|
88
89
|
<Playground>
|
89
90
|
<Button priority="outline" label="Primary" />
|
90
91
|
<Button priority="outline" label="Secondary" color="secondary" />
|
92
|
+
<Button priority="outline" label="Selected" color="selected" />
|
91
93
|
<Button priority="outline" label="Success" color="success" />
|
92
94
|
<Button priority="outline" label="Warning" color="warning" />
|
93
95
|
<Button priority="outline" label="Danger" color="danger" />
|
@@ -108,6 +110,7 @@ the content.
|
|
108
110
|
<Playground>
|
109
111
|
<Button priority="flat" label="Primary" />
|
110
112
|
<Button priority="flat" label="Secondary" color="secondary" />
|
113
|
+
<Button priority="flat" label="Selected" color="selected" />
|
111
114
|
<Button priority="flat" label="Success" color="success" />
|
112
115
|
<Button priority="flat" label="Warning" color="warning" />
|
113
116
|
<Button priority="flat" label="Danger" color="danger" />
|
@@ -269,9 +272,11 @@ Disabled state makes the action unavailable.
|
|
269
272
|
### Feedback State
|
270
273
|
|
271
274
|
When user's action triggers an asynchronous process on background, the button's
|
272
|
-
feedback state
|
273
|
-
|
274
|
-
|
275
|
+
feedback state (not to be mistaken with
|
276
|
+
[feedback colors](/foundation/colors#component-colors)) can be indicated by
|
277
|
+
showing an icon. The icon replaces button's label while retaining original
|
278
|
+
dimensions of the button. Buttons in feedback state are automatically disabled
|
279
|
+
to prevent unwanted interaction.
|
275
280
|
|
276
281
|
Filled buttons in feedback state:
|
277
282
|
|
@@ -11,6 +11,10 @@
|
|
11
11
|
@include tools.button-color(filled, secondary);
|
12
12
|
}
|
13
13
|
|
14
|
+
.isRootPriorityFilled.isRootColorSelected {
|
15
|
+
@include tools.button-color(filled, selected);
|
16
|
+
}
|
17
|
+
|
14
18
|
.isRootPriorityFilled.isRootColorSuccess {
|
15
19
|
@include tools.button-color(filled, success);
|
16
20
|
}
|
@@ -51,6 +55,10 @@
|
|
51
55
|
@include tools.button-color(outline, secondary);
|
52
56
|
}
|
53
57
|
|
58
|
+
.isRootPriorityOutline.isRootColorSelected {
|
59
|
+
@include tools.button-color(outline, selected);
|
60
|
+
}
|
61
|
+
|
54
62
|
.isRootPriorityOutline.isRootColorSuccess {
|
55
63
|
@include tools.button-color(outline, success);
|
56
64
|
}
|
@@ -91,6 +99,10 @@
|
|
91
99
|
@include tools.button-color(flat, secondary);
|
92
100
|
}
|
93
101
|
|
102
|
+
.isRootPriorityFlat.isRootColorSelected {
|
103
|
+
@include tools.button-color(flat, selected);
|
104
|
+
}
|
105
|
+
|
94
106
|
.isRootPriorityFlat.isRootColorSuccess {
|
95
107
|
@include tools.button-color(flat, success);
|
96
108
|
}
|
@@ -12,7 +12,7 @@ $group-z-indexes: (
|
|
12
12
|
button-overflowing-elements: 3,
|
13
13
|
);
|
14
14
|
|
15
|
-
$themeable-variants: (primary, secondary, success, warning, danger, help, info, note, light, dark);
|
15
|
+
$themeable-variants: (primary, secondary, selected, success, warning, danger, help, info, note, light, dark);
|
16
16
|
$themeable-states: (default, hover, active, disabled);
|
17
17
|
$themeable-priority-properties: (
|
18
18
|
filled: (color, border-color, background, box-shadow),
|
@@ -43,6 +43,13 @@ See [API](#api) for all available options.
|
|
43
43
|
- Use button group to group **related actions** that a user can take. Buttons
|
44
44
|
should not be grouped just to save space on the screen.
|
45
45
|
|
46
|
+
- **Mixing multiple button priorities** and some other properties within a
|
47
|
+
button group is [not allowed](#shared-properties). The priority can only be
|
48
|
+
set for all buttons in the group at once.
|
49
|
+
|
50
|
+
- In most use cases, **secondary action color** is probably the best option for
|
51
|
+
buttons in a group as it works good with the colors of the selected state.
|
52
|
+
|
46
53
|
- Use **short labels or icons** so the buttons can fit small screens.
|
47
54
|
|
48
55
|
- For toggling between on/off states, use rather the
|
@@ -58,11 +65,17 @@ See [API](#api) for all available options.
|
|
58
65
|
### Shared Properties
|
59
66
|
|
60
67
|
You can set the following properties directly on ButtonGroup to be shared for
|
61
|
-
all buttons inside the group:
|
68
|
+
all buttons inside the group:
|
69
|
+
|
70
|
+
- `size`,
|
71
|
+
- `priority`,
|
72
|
+
- `disabled` state,
|
73
|
+
- and `block` width.
|
74
|
+
|
62
75
|
These properties are then passed over to individual buttons. At the same time,
|
63
|
-
they **cannot be overridden** on the buttons' level. While
|
64
|
-
from the design point of view it's undesirable to group
|
65
|
-
different types or sizes.
|
76
|
+
they **cannot be overridden** on the buttons' level. While (in theory)
|
77
|
+
technically possible, from the design point of view it's undesirable to group
|
78
|
+
buttons of totally different types or sizes.
|
66
79
|
|
67
80
|
## Priorities
|
68
81
|
|
@@ -73,6 +86,9 @@ priorities of the [Button](/components/button) component:
|
|
73
86
|
2. outline
|
74
87
|
3. flat
|
75
88
|
|
89
|
+
👉 To avoid undesired combinations, the visual priority of the button group
|
90
|
+
**cannot be overridden** on the Button level.
|
91
|
+
|
76
92
|
### Filled
|
77
93
|
|
78
94
|
The default, high-emphasis priority should be used for primary actions of your
|
@@ -80,9 +96,9 @@ app.
|
|
80
96
|
|
81
97
|
<Playground>
|
82
98
|
<ButtonGroup>
|
83
|
-
<Button label="Week" />
|
84
|
-
<Button label="Month" />
|
85
|
-
<Button label="Year" />
|
99
|
+
<Button color="secondary" label="Week" />
|
100
|
+
<Button color="secondary" label="Month" />
|
101
|
+
<Button color="secondary" label="Year" />
|
86
102
|
</ButtonGroup>
|
87
103
|
</Playground>
|
88
104
|
|
@@ -93,9 +109,9 @@ in your app.
|
|
93
109
|
|
94
110
|
<Playground>
|
95
111
|
<ButtonGroup priority="outline">
|
96
|
-
<Button label="Week" />
|
97
|
-
<Button label="Month" />
|
98
|
-
<Button label="Year" />
|
112
|
+
<Button color="secondary" label="Week" />
|
113
|
+
<Button color="secondary" label="Month" />
|
114
|
+
<Button color="secondary" label="Year" />
|
99
115
|
</ButtonGroup>
|
100
116
|
</Playground>
|
101
117
|
|
@@ -106,9 +122,9 @@ the content.
|
|
106
122
|
|
107
123
|
<Playground>
|
108
124
|
<ButtonGroup priority="flat">
|
109
|
-
<Button label="Week" />
|
110
|
-
<Button label="Month" />
|
111
|
-
<Button label="Year" />
|
125
|
+
<Button color="secondary" label="Week" />
|
126
|
+
<Button color="secondary" label="Month" />
|
127
|
+
<Button color="secondary" label="Year" />
|
112
128
|
</ButtonGroup>
|
113
129
|
</Playground>
|
114
130
|
|
@@ -119,19 +135,19 @@ medium, and large.
|
|
119
135
|
|
120
136
|
<Playground>
|
121
137
|
<ButtonGroup size="small">
|
122
|
-
<Button label="Week" />
|
123
|
-
<Button label="Month" />
|
124
|
-
<Button label="Year" />
|
138
|
+
<Button color="secondary" label="Week" />
|
139
|
+
<Button color="secondary" label="Month" />
|
140
|
+
<Button color="secondary" label="Year" />
|
125
141
|
</ButtonGroup>
|
126
142
|
<ButtonGroup>
|
127
|
-
<Button label="Week" />
|
128
|
-
<Button label="Month" />
|
129
|
-
<Button label="Year" />
|
143
|
+
<Button color="secondary" label="Week" />
|
144
|
+
<Button color="secondary" label="Month" />
|
145
|
+
<Button color="secondary" label="Year" />
|
130
146
|
</ButtonGroup>
|
131
147
|
<ButtonGroup size="large">
|
132
|
-
<Button label="Week" />
|
133
|
-
<Button label="Month" />
|
134
|
-
<Button label="Year" />
|
148
|
+
<Button color="secondary" label="Week" />
|
149
|
+
<Button color="secondary" label="Month" />
|
150
|
+
<Button color="secondary" label="Year" />
|
135
151
|
</ButtonGroup>
|
136
152
|
</Playground>
|
137
153
|
|
@@ -139,9 +155,9 @@ Block button groups span the full width of a parent:
|
|
139
155
|
|
140
156
|
<Playground>
|
141
157
|
<ButtonGroup block>
|
142
|
-
<Button label="Week" />
|
143
|
-
<Button label="Month" />
|
144
|
-
<Button label="Year" />
|
158
|
+
<Button color="secondary" label="Week" />
|
159
|
+
<Button color="secondary" label="Month" />
|
160
|
+
<Button color="secondary" label="Year" />
|
145
161
|
</ButtonGroup>
|
146
162
|
</Playground>
|
147
163
|
|
@@ -153,19 +169,19 @@ Disables all buttons inside the group.
|
|
153
169
|
|
154
170
|
<Playground>
|
155
171
|
<ButtonGroup disabled>
|
156
|
-
<Button label="Week" />
|
157
|
-
<Button label="Month" />
|
158
|
-
<Button label="Year" />
|
172
|
+
<Button color="secondary" label="Week" />
|
173
|
+
<Button color="secondary" label="Month" />
|
174
|
+
<Button color="secondary" label="Year" />
|
159
175
|
</ButtonGroup>
|
160
176
|
<ButtonGroup priority="outline" disabled>
|
161
|
-
<Button label="Week" />
|
162
|
-
<Button label="Month" />
|
163
|
-
<Button label="Year" />
|
177
|
+
<Button color="secondary" label="Week" />
|
178
|
+
<Button color="secondary" label="Month" />
|
179
|
+
<Button color="secondary" label="Year" />
|
164
180
|
</ButtonGroup>
|
165
181
|
<ButtonGroup priority="flat" disabled>
|
166
|
-
<Button label="Week" />
|
167
|
-
<Button label="Month" />
|
168
|
-
<Button label="Year" />
|
182
|
+
<Button color="secondary" label="Week" />
|
183
|
+
<Button color="secondary" label="Month" />
|
184
|
+
<Button color="secondary" label="Year" />
|
169
185
|
</ButtonGroup>
|
170
186
|
</Playground>
|
171
187
|
|
@@ -176,42 +192,42 @@ state of individual buttons can be indicated by showing an icon.
|
|
176
192
|
|
177
193
|
<Playground>
|
178
194
|
<ButtonGroup>
|
179
|
-
<Button
|
180
|
-
<Button label="Month" />
|
181
|
-
<Button label="Year" />
|
195
|
+
<Button color="success" label="Week" feedbackIcon={<Icon icon="success" />} />
|
196
|
+
<Button color="secondary" label="Month" />
|
197
|
+
<Button color="secondary" label="Year" />
|
182
198
|
</ButtonGroup>
|
183
199
|
<ButtonGroup priority="outline">
|
184
|
-
<Button
|
185
|
-
<Button label="Month" />
|
186
|
-
<Button label="Year" />
|
200
|
+
<Button color="success" label="Week" feedbackIcon={<Icon icon="success" />} />
|
201
|
+
<Button color="secondary" label="Month" />
|
202
|
+
<Button color="secondary" label="Year" />
|
187
203
|
</ButtonGroup>
|
188
204
|
<ButtonGroup priority="flat">
|
189
|
-
<Button
|
190
|
-
<Button label="Month" />
|
191
|
-
<Button label="Year" />
|
205
|
+
<Button color="success" label="Week" feedbackIcon={<Icon icon="success" />} />
|
206
|
+
<Button color="secondary" label="Month" />
|
207
|
+
<Button color="secondary" label="Year" />
|
192
208
|
</ButtonGroup>
|
193
209
|
</Playground>
|
194
210
|
|
195
|
-
###
|
211
|
+
### Selected State
|
196
212
|
|
197
|
-
To highlight the selected option,
|
198
|
-
|
213
|
+
To highlight the selected option, just apply the selected color variant for
|
214
|
+
the desired item.
|
199
215
|
|
200
216
|
<Playground>
|
201
217
|
<ButtonGroup>
|
202
|
-
<Button color="
|
203
|
-
<Button label="Month" />
|
204
|
-
<Button label="Year" />
|
218
|
+
<Button color="selected" label="Week" />
|
219
|
+
<Button color="secondary" label="Month" />
|
220
|
+
<Button color="secondary" label="Year" />
|
205
221
|
</ButtonGroup>
|
206
222
|
<ButtonGroup priority="outline">
|
207
|
-
<Button color="
|
208
|
-
<Button label="Month" />
|
209
|
-
<Button label="Year" />
|
223
|
+
<Button color="selected" label="Week" />
|
224
|
+
<Button color="secondary" label="Month" />
|
225
|
+
<Button color="secondary" label="Year" />
|
210
226
|
</ButtonGroup>
|
211
227
|
<ButtonGroup priority="flat">
|
212
|
-
<Button color="
|
213
|
-
<Button label="Month" />
|
214
|
-
<Button label="Year" />
|
228
|
+
<Button color="selected" label="Week" />
|
229
|
+
<Button color="secondary" label="Month" />
|
230
|
+
<Button color="secondary" label="Year" />
|
215
231
|
</ButtonGroup>
|
216
232
|
</Playground>
|
217
233
|
|
@@ -224,9 +240,9 @@ and communicating the state of individual options.
|
|
224
240
|
<>
|
225
241
|
<span id="period-label">Period:</span>
|
226
242
|
<ButtonGroup aria-labelledby="period-label">
|
227
|
-
<Button label="Week" aria-pressed
|
228
|
-
<Button label="Month" aria-pressed={false} />
|
229
|
-
<Button label="Year" aria-pressed={false} />
|
243
|
+
<Button color="selected" label="Week" aria-pressed />
|
244
|
+
<Button color="secondary" label="Month" aria-pressed={false} />
|
245
|
+
<Button color="secondary" label="Year" aria-pressed={false} />
|
230
246
|
</ButtonGroup>
|
231
247
|
</>
|
232
248
|
</Playground>
|
@@ -46,9 +46,7 @@ Card.propTypes = {
|
|
46
46
|
/**
|
47
47
|
* [Color variant](/foundation/colors#component-colors) to clarify importance and meaning of the card.
|
48
48
|
*/
|
49
|
-
color: PropTypes.oneOf(
|
50
|
-
['primary', 'secondary', 'success', 'warning', 'danger', 'help', 'info', 'note', 'light', 'dark'],
|
51
|
-
),
|
49
|
+
color: PropTypes.oneOf(['success', 'warning', 'danger', 'help', 'info', 'note', 'light', 'dark']),
|
52
50
|
/**
|
53
51
|
* Make the card more compact.
|
54
52
|
*/
|
@@ -1,6 +1,5 @@
|
|
1
1
|
// 1. Retain equal card widths in flex and grid layouts independently on their content.
|
2
2
|
|
3
|
-
@use "../../styles/theme/colors";
|
4
3
|
@use "theme";
|
5
4
|
@use "tools";
|
6
5
|
|
@@ -33,14 +32,6 @@
|
|
33
32
|
box-shadow: theme.$raised-box-shadow;
|
34
33
|
}
|
35
34
|
|
36
|
-
.isRootColorPrimary {
|
37
|
-
@include tools.color(primary);
|
38
|
-
}
|
39
|
-
|
40
|
-
.isRootColorSecondary {
|
41
|
-
@include tools.color(secondary);
|
42
|
-
}
|
43
|
-
|
44
35
|
.isRootColorSuccess {
|
45
36
|
@include tools.color(success);
|
46
37
|
}
|