@react-ui-org/react-ui 0.44.1 → 0.47.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CONTRIBUTING.md +7 -0
- package/README.md +15 -16
- package/dist/lib.development.js +271 -415
- package/dist/lib.js +1 -1
- package/package.json +11 -13
- package/src/lib/components/Alert/Alert.jsx +45 -44
- package/src/lib/components/Alert/Alert.scss +48 -48
- package/src/lib/components/Alert/README.mdx +2 -5
- package/src/lib/components/Alert/_settings.scss +4 -4
- package/src/lib/components/Alert/_theme.scss +50 -50
- package/src/lib/components/Alert/_tools.scss +6 -6
- package/src/lib/components/Badge/Badge.jsx +9 -11
- package/src/lib/components/Badge/Badge.scss +57 -57
- package/src/lib/components/Button/Button.jsx +14 -13
- package/src/lib/components/Button/Button.scss +2 -2
- package/src/lib/components/Button/README.mdx +11 -6
- package/src/lib/components/Button/_base.scss +69 -69
- package/src/lib/components/Button/_priorities.scss +49 -49
- package/src/lib/components/Button/_settings.scss +10 -10
- package/src/lib/components/Button/_theme.scss +18 -15
- package/src/lib/components/Button/_tools.scss +98 -100
- package/src/lib/components/Button/helpers/getRootLabelVisibilityClassName.js +4 -4
- package/src/lib/components/ButtonGroup/ButtonGroup.jsx +41 -25
- package/src/lib/components/ButtonGroup/ButtonGroup.scss +3 -3
- package/src/lib/components/ButtonGroup/README.mdx +1 -1
- package/src/lib/components/Card/Card.jsx +10 -9
- package/src/lib/components/Card/Card.scss +28 -28
- package/src/lib/components/Card/CardBody.jsx +17 -12
- package/src/lib/components/Card/CardFooter.jsx +22 -9
- package/src/lib/components/Card/_theme.scss +50 -50
- package/src/lib/components/Card/_tools.scss +6 -6
- package/src/lib/components/CheckboxField/CheckboxField.jsx +21 -20
- package/src/lib/components/CheckboxField/CheckboxField.scss +20 -20
- package/src/lib/components/CheckboxField/README.mdx +1 -1
- package/src/lib/components/FileInputField/FileInputField.jsx +16 -15
- package/src/lib/components/FileInputField/FileInputField.scss +19 -19
- package/src/lib/components/FileInputField/README.mdx +1 -1
- package/src/lib/components/FormLayout/FormLayout.jsx +19 -17
- package/src/lib/components/FormLayout/FormLayout.scss +17 -17
- package/src/lib/components/FormLayout/FormLayoutCustomField.jsx +18 -12
- package/src/lib/components/FormLayout/FormLayoutCustomField.scss +18 -18
- package/src/lib/components/FormLayout/README.mdx +26 -49
- package/src/lib/components/Grid/Grid.jsx +25 -24
- package/src/lib/components/Grid/Grid.scss +33 -29
- package/src/lib/components/Grid/GridSpan.jsx +11 -10
- package/src/lib/components/Grid/README.mdx +46 -20
- package/src/lib/components/Grid/{helpers → _helpers}/generateResponsiveCustomProperties.js +0 -2
- package/src/lib/components/Grid/_theme.scss +9 -9
- package/src/lib/components/Grid/_tools.scss +20 -20
- package/src/lib/components/Modal/Modal.jsx +38 -32
- package/src/lib/components/Modal/Modal.scss +73 -73
- package/src/lib/components/Modal/README.mdx +2 -5
- package/src/lib/components/Modal/_settings.scss +5 -5
- package/src/lib/components/Modal/_theme.scss +17 -17
- package/src/lib/components/Paper/Paper.jsx +9 -9
- package/src/lib/components/Paper/Paper.scss +8 -8
- package/src/lib/components/Popover/Popover.jsx +94 -0
- package/src/lib/components/Popover/Popover.scss +235 -0
- package/src/lib/components/Popover/PopoverWrapper.jsx +46 -0
- package/src/lib/components/Popover/README.mdx +333 -0
- package/src/lib/components/Popover/_helpers/getRootAlignmentClassName.js +13 -0
- package/src/lib/components/Popover/_helpers/getRootSideClassName.js +17 -0
- package/src/lib/components/Popover/_theme.scss +16 -0
- package/src/lib/components/Popover/index.js +2 -0
- package/src/lib/components/Radio/README.mdx +1 -1
- package/src/lib/components/Radio/Radio.jsx +15 -14
- package/src/lib/components/Radio/Radio.scss +26 -26
- package/src/lib/components/ScrollView/README.mdx +5 -5
- package/src/lib/components/ScrollView/ScrollView.jsx +22 -22
- package/src/lib/components/ScrollView/ScrollView.scss +113 -113
- package/src/lib/{services/elementPositionService.js → components/ScrollView/_helpers/getElementsPositionDifference.js} +0 -2
- package/src/lib/{hooks → components/ScrollView/_hooks}/useLoadResizeHook.js +1 -1
- package/src/lib/{hooks → components/ScrollView/_hooks}/useScrollPositionHook.js +1 -1
- package/src/lib/components/SelectField/README.mdx +1 -1
- package/src/lib/components/SelectField/SelectField.jsx +17 -16
- package/src/lib/components/SelectField/SelectField.scss +30 -30
- package/src/lib/components/Table/README.mdx +1 -1
- package/src/lib/components/Table/Table.jsx +3 -3
- package/src/lib/components/Table/Table.scss +28 -35
- package/src/lib/components/Table/_settings.scss +5 -5
- package/src/lib/components/Tabs/Tabs.jsx +4 -5
- package/src/lib/components/Tabs/Tabs.scss +21 -21
- package/src/lib/components/Tabs/TabsItem.jsx +7 -6
- package/src/lib/components/Tabs/TabsItem.scss +78 -78
- package/src/lib/components/Text/README.mdx +3 -3
- package/src/lib/components/Text/Text.jsx +16 -9
- package/src/lib/components/Text/Text.scss +23 -13
- package/src/lib/components/Text/_helpers/getRootClampClassName.js +11 -0
- package/src/lib/components/Text/{helpers → _helpers}/getRootHyphensClassName.js +1 -1
- package/src/lib/components/Text/{helpers → _helpers}/getRootWordWrappingClassName.js +1 -1
- package/src/lib/components/TextArea/README.mdx +1 -1
- package/src/lib/components/TextArea/TextArea.jsx +21 -17
- package/src/lib/components/TextArea/TextArea.scss +27 -27
- package/src/lib/components/TextField/README.mdx +1 -1
- package/src/lib/components/TextField/TextField.jsx +19 -18
- package/src/lib/components/TextField/TextField.scss +28 -28
- package/src/lib/components/TextLink/README.mdx +77 -0
- package/src/lib/components/TextLink/TextLink.jsx +44 -0
- package/src/lib/components/TextLink/TextLink.scss +11 -0
- package/src/lib/components/TextLink/_theme.scss +4 -0
- package/src/lib/components/TextLink/index.js +1 -0
- package/src/lib/components/Toggle/README.mdx +1 -1
- package/src/lib/components/Toggle/Toggle.jsx +21 -20
- package/src/lib/components/Toggle/Toggle.scss +20 -20
- package/src/lib/components/Toolbar/README.mdx +33 -5
- package/src/lib/components/Toolbar/Toolbar.jsx +33 -17
- package/src/lib/components/Toolbar/Toolbar.scss +29 -42
- package/src/lib/components/Toolbar/ToolbarGroup.jsx +28 -16
- package/src/lib/components/Toolbar/ToolbarItem.jsx +36 -10
- package/src/lib/{helpers → components/_helpers}/getRootColorClassName.js +1 -1
- package/src/lib/{helpers → components/_helpers}/getRootSizeClassName.js +1 -1
- package/src/lib/{helpers → components/_helpers}/getRootValidationStateClassName.js +1 -1
- package/src/lib/components/_helpers/isChildrenEmpty.js +3 -0
- package/src/lib/{helpers → components/_helpers}/resolveContextOrProp.js +0 -0
- package/src/lib/{utils → components/_helpers}/transferProps.js +1 -1
- package/src/lib/foundation.scss +11 -11
- package/src/lib/helpers.scss +2 -2
- package/src/lib/index.js +8 -17
- package/src/lib/provider/index.js +2 -1
- package/src/lib/provider/withGlobalProps.jsx +21 -0
- package/src/lib/styles/_utilities.scss +13 -13
- package/src/lib/styles/elements/_code.scss +7 -7
- package/src/lib/styles/elements/_links.scss +8 -8
- package/src/lib/styles/elements/_lists.scss +3 -3
- package/src/lib/styles/elements/_page.scss +14 -14
- package/src/lib/styles/elements/_rulers.scss +6 -6
- package/src/lib/styles/elements/_small.scss +2 -2
- package/src/lib/styles/generic/_box-sizing.scss +3 -2
- package/src/lib/styles/generic/_forms.scss +3 -3
- package/src/lib/styles/generic/_reset.scss +6 -6
- package/src/lib/styles/generic/_shared.scss +3 -3
- package/src/lib/styles/helpers/_animation.scss +8 -8
- package/src/lib/styles/settings/_breakpoints.scss +7 -7
- package/src/lib/styles/settings/_escaped-characters.scss +5 -5
- package/src/lib/styles/settings/_form-fields.scss +24 -24
- package/src/lib/styles/settings/_utilities.scss +112 -100
- package/src/lib/styles/theme/_colors.scss +50 -50
- package/src/lib/styles/theme/_form-fields.scss +32 -32
- package/src/lib/styles/theme/_spacing.scss +11 -11
- package/src/lib/styles/theme/_typography.scss +12 -11
- package/src/lib/styles/theme-constants/_breakpoints.scss +4 -4
- package/src/lib/styles/theme-constants/_colors.scss +2 -2
- package/src/lib/styles/theme-constants/_svg.scss +1 -2
- package/src/lib/styles/tools/_accessibility.scss +29 -29
- package/src/lib/styles/tools/_breakpoint.scss +11 -14
- package/src/lib/styles/tools/_caret.scss +8 -8
- package/src/lib/styles/tools/_colors.scss +3 -3
- package/src/lib/styles/tools/_reset.scss +24 -21
- package/src/lib/styles/tools/_scrollbar.scss +4 -4
- package/src/lib/styles/tools/_spacing.scss +14 -22
- package/src/lib/styles/tools/_string.scss +9 -9
- package/src/lib/styles/tools/_svg.scss +13 -16
- package/src/lib/styles/tools/_transition.scss +42 -44
- package/src/lib/styles/tools/_utilities.scss +19 -19
- package/src/lib/styles/tools/form-fields/_box-field-elements.scss +88 -88
- package/src/lib/styles/tools/form-fields/_box-field-layout.scss +147 -147
- package/src/lib/styles/tools/form-fields/_box-field-sizes.scss +13 -15
- package/src/lib/styles/tools/form-fields/_foundation.scss +12 -12
- package/src/lib/styles/tools/form-fields/_inline-field-elements.scss +82 -71
- package/src/lib/styles/tools/form-fields/_inline-field-layout.scss +88 -47
- package/src/lib/styles/tools/form-fields/_variants.scss +104 -106
- package/src/lib/theme.scss +959 -954
- package/src/lib/utils/classNames.js +8 -0
- package/src/lib/components/CTA/CTA.jsx +0 -60
- package/src/lib/components/CTA/CTA.scss +0 -71
- package/src/lib/components/CTA/CTACenter.jsx +0 -27
- package/src/lib/components/CTA/CTAEnd.jsx +0 -27
- package/src/lib/components/CTA/CTAStart.jsx +0 -27
- package/src/lib/components/CTA/README.mdx +0 -119
- package/src/lib/components/CTA/index.js +0 -4
- package/src/lib/components/Center/Center.jsx +0 -27
- package/src/lib/components/Center/Center.scss +0 -7
- package/src/lib/components/Center/README.mdx +0 -52
- package/src/lib/components/Center/index.js +0 -1
- package/src/lib/components/Link/Link.jsx +0 -45
- package/src/lib/components/Link/Link.scss +0 -11
- package/src/lib/components/Link/README.mdx +0 -85
- package/src/lib/components/Link/_theme.scss +0 -4
- package/src/lib/components/Link/index.js +0 -1
- package/src/lib/components/List/List.jsx +0 -71
- package/src/lib/components/List/List.scss +0 -53
- package/src/lib/components/List/ListItem.jsx +0 -31
- package/src/lib/components/List/README.mdx +0 -114
- package/src/lib/components/List/_theme.scss +0 -1
- package/src/lib/components/List/index.js +0 -2
- package/src/lib/components/Media/Media.jsx +0 -29
- package/src/lib/components/Media/Media.scss +0 -16
- package/src/lib/components/Media/MediaBody.jsx +0 -21
- package/src/lib/components/Media/MediaObject.jsx +0 -21
- package/src/lib/components/Media/README.mdx +0 -63
- package/src/lib/components/Media/index.js +0 -3
- package/src/lib/provider/withProviderContext.jsx +0 -32
@@ -1,126 +1,126 @@
|
|
1
|
-
@use
|
2
|
-
@use
|
3
|
-
@use
|
4
|
-
@use
|
5
|
-
@use
|
1
|
+
@use "sass:map";
|
2
|
+
@use "sass:math";
|
3
|
+
@use "../../styles/theme/borders";
|
4
|
+
@use "../../styles/theme/colors";
|
5
|
+
@use "../../styles/theme/typography";
|
6
6
|
|
7
7
|
$_badge-size: 1.25rem;
|
8
8
|
|
9
9
|
.root {
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
10
|
+
display: inline-block;
|
11
|
+
min-width: $_badge-size;
|
12
|
+
height: $_badge-size;
|
13
|
+
padding: 0.25rem 0.35rem;
|
14
|
+
overflow: hidden;
|
15
|
+
font-weight: map.get(typography.$font-weight-values, bold);
|
16
|
+
font-size: typography.$size-smaller;
|
17
|
+
line-height: 1;
|
18
|
+
text-align: center;
|
19
|
+
white-space: nowrap;
|
20
|
+
vertical-align: baseline;
|
21
|
+
color: var(--rui-local-color);
|
22
|
+
border-radius: math.div($_badge-size, 2);
|
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
25
|
}
|
26
26
|
|
27
27
|
.rootColorPrimary {
|
28
|
-
|
29
|
-
|
28
|
+
--rui-local-color: #{map.get(colors.$brand, on-primary)};
|
29
|
+
--rui-local-background-color: #{map.get(colors.$brand, primary)};
|
30
30
|
}
|
31
31
|
|
32
32
|
.rootColorSecondary {
|
33
|
-
|
34
|
-
|
33
|
+
--rui-local-color: #{map.get(colors.$brand, on-secondary)};
|
34
|
+
--rui-local-background-color: #{map.get(colors.$brand, secondary)};
|
35
35
|
}
|
36
36
|
|
37
37
|
.rootColorSuccess {
|
38
|
-
|
39
|
-
|
38
|
+
--rui-local-color: #{map.get(colors.$ui, on-success)};
|
39
|
+
--rui-local-background-color: #{map.get(colors.$ui, success)};
|
40
40
|
}
|
41
41
|
|
42
42
|
.rootColorWarning {
|
43
|
-
|
44
|
-
|
43
|
+
--rui-local-color: #{map.get(colors.$ui, on-warning)};
|
44
|
+
--rui-local-background-color: #{map.get(colors.$ui, warning)};
|
45
45
|
}
|
46
46
|
|
47
47
|
.rootColorDanger {
|
48
|
-
|
49
|
-
|
48
|
+
--rui-local-color: #{map.get(colors.$ui, on-danger)};
|
49
|
+
--rui-local-background-color: #{map.get(colors.$ui, danger)};
|
50
50
|
}
|
51
51
|
|
52
52
|
.rootColorHelp {
|
53
|
-
|
54
|
-
|
53
|
+
--rui-local-color: #{map.get(colors.$ui, on-help)};
|
54
|
+
--rui-local-background-color: #{map.get(colors.$ui, help)};
|
55
55
|
}
|
56
56
|
|
57
57
|
.rootColorInfo {
|
58
|
-
|
59
|
-
|
58
|
+
--rui-local-color: #{map.get(colors.$ui, on-info)};
|
59
|
+
--rui-local-background-color: #{map.get(colors.$ui, info)};
|
60
60
|
}
|
61
61
|
|
62
62
|
.rootColorNote {
|
63
|
-
|
64
|
-
|
63
|
+
--rui-local-color: #{map.get(colors.$ui, on-note)};
|
64
|
+
--rui-local-background-color: #{map.get(colors.$ui, note)};
|
65
65
|
}
|
66
66
|
|
67
67
|
.rootColorLight {
|
68
|
-
|
69
|
-
|
70
|
-
|
68
|
+
--rui-local-color: #{colors.$dark};
|
69
|
+
--rui-local-background-color: #{colors.$light};
|
70
|
+
--rui-local-box-shadow: none;
|
71
71
|
}
|
72
72
|
|
73
73
|
.rootColorDark {
|
74
|
-
|
75
|
-
|
76
|
-
|
74
|
+
--rui-local-color: #{colors.$light};
|
75
|
+
--rui-local-background-color: #{colors.$dark};
|
76
|
+
--rui-local-box-shadow: none;
|
77
77
|
}
|
78
78
|
|
79
79
|
.rootPriorityOutline {
|
80
|
-
|
81
|
-
|
80
|
+
--rui-local-background-color: transparent;
|
81
|
+
--rui-local-box-shadow: none;
|
82
82
|
|
83
|
-
|
84
|
-
|
85
|
-
|
83
|
+
padding-top: 0.1875rem;
|
84
|
+
padding-bottom: 0.1875rem;
|
85
|
+
border: borders.$width solid currentColor;
|
86
86
|
}
|
87
87
|
|
88
88
|
.rootPriorityOutline.rootColorPrimary {
|
89
|
-
|
89
|
+
--rui-local-color: #{map.get(colors.$brand, primary)};
|
90
90
|
}
|
91
91
|
|
92
92
|
.rootPriorityOutline.rootColorSecondary {
|
93
|
-
|
93
|
+
--rui-local-color: #{map.get(colors.$brand, secondary)};
|
94
94
|
}
|
95
95
|
|
96
96
|
.rootPriorityOutline.rootColorSuccess {
|
97
|
-
|
97
|
+
--rui-local-color: #{map.get(colors.$ui, success)};
|
98
98
|
}
|
99
99
|
|
100
100
|
.rootPriorityOutline.rootColorWarning {
|
101
|
-
|
101
|
+
--rui-local-color: #{map.get(colors.$ui, warning)};
|
102
102
|
}
|
103
103
|
|
104
104
|
.rootPriorityOutline.rootColorDanger {
|
105
|
-
|
105
|
+
--rui-local-color: #{map.get(colors.$ui, danger)};
|
106
106
|
}
|
107
107
|
|
108
108
|
.rootPriorityOutline.rootColorHelp {
|
109
|
-
|
109
|
+
--rui-local-color: #{map.get(colors.$ui, help)};
|
110
110
|
}
|
111
111
|
|
112
112
|
.rootPriorityOutline.rootColorInfo {
|
113
|
-
|
113
|
+
--rui-local-color: #{map.get(colors.$ui, info)};
|
114
114
|
}
|
115
115
|
|
116
116
|
.rootPriorityOutline.rootColorNote {
|
117
|
-
|
117
|
+
--rui-local-color: #{map.get(colors.$ui, note)};
|
118
118
|
}
|
119
119
|
|
120
120
|
.rootPriorityOutline.rootColorLight {
|
121
|
-
|
121
|
+
--rui-local-color: #{colors.$light};
|
122
122
|
}
|
123
123
|
|
124
124
|
.rootPriorityOutline.rootColorDark {
|
125
|
-
|
125
|
+
--rui-local-color: #{colors.$dark};
|
126
126
|
}
|
@@ -1,10 +1,11 @@
|
|
1
1
|
import PropTypes from 'prop-types';
|
2
2
|
import React, { useContext } from 'react';
|
3
|
-
import
|
4
|
-
import
|
5
|
-
import {
|
6
|
-
import {
|
7
|
-
import
|
3
|
+
import { withGlobalProps } from '../../provider';
|
4
|
+
import { classNames } from '../../utils/classNames';
|
5
|
+
import { getRootColorClassName } from '../_helpers/getRootColorClassName';
|
6
|
+
import { getRootSizeClassName } from '../_helpers/getRootSizeClassName';
|
7
|
+
import { resolveContextOrProp } from '../_helpers/resolveContextOrProp';
|
8
|
+
import { transferProps } from '../_helpers/transferProps';
|
8
9
|
import withForwardedRef from '../withForwardedRef';
|
9
10
|
import { ButtonGroupContext } from '../ButtonGroup';
|
10
11
|
import getRootLabelVisibilityClassName from './helpers/getRootLabelVisibilityClassName';
|
@@ -36,7 +37,7 @@ export const Button = ({
|
|
36
37
|
/* eslint-disable react/button-has-type */
|
37
38
|
<button
|
38
39
|
{...transferProps(restProps)}
|
39
|
-
className={
|
40
|
+
className={classNames(
|
40
41
|
styles.root,
|
41
42
|
getRootPriorityClassName(
|
42
43
|
resolveContextOrProp(context && context.priority, priority),
|
@@ -48,10 +49,10 @@ export const Button = ({
|
|
48
49
|
styles,
|
49
50
|
),
|
50
51
|
getRootLabelVisibilityClassName(labelVisibility, styles),
|
51
|
-
resolveContextOrProp(context && context.block, block)
|
52
|
-
context
|
53
|
-
feedbackIcon
|
54
|
-
|
52
|
+
resolveContextOrProp(context && context.block, block) && styles.rootBlock,
|
53
|
+
context && styles.rootGrouped,
|
54
|
+
feedbackIcon && styles.hasRootFeedback,
|
55
|
+
)}
|
55
56
|
disabled={resolveContextOrProp(context && context.disabled, disabled) || !!feedbackIcon}
|
56
57
|
id={id}
|
57
58
|
ref={forwardedRef}
|
@@ -168,7 +169,7 @@ Button.propTypes = {
|
|
168
169
|
/**
|
169
170
|
* Defines minimum breakpoint from which the button label will be visible.
|
170
171
|
*/
|
171
|
-
labelVisibility: PropTypes.oneOf(['xs', 'sm', 'md', 'lg', 'xl', '
|
172
|
+
labelVisibility: PropTypes.oneOf(['xs', 'sm', 'md', 'lg', 'xl', 'x2l', 'x3l', 'none']),
|
172
173
|
/**
|
173
174
|
* Visual priority to highlight or suppress the button.
|
174
175
|
*
|
@@ -193,6 +194,6 @@ Button.propTypes = {
|
|
193
194
|
type: PropTypes.oneOf(['button', 'submit']),
|
194
195
|
};
|
195
196
|
|
196
|
-
export const
|
197
|
+
export const ButtonWithGlobalProps = withForwardedRef(withGlobalProps(Button, 'Button'));
|
197
198
|
|
198
|
-
export default
|
199
|
+
export default ButtonWithGlobalProps;
|
@@ -1,2 +1,2 @@
|
|
1
|
-
@use
|
2
|
-
@use
|
1
|
+
@use "base";
|
2
|
+
@use "priorities";
|
@@ -194,13 +194,13 @@ of your choice and display label once you know there is enough room for it.
|
|
194
194
|
beforeLabel={<Icon icon="pencil" />}
|
195
195
|
/>
|
196
196
|
<Button
|
197
|
-
label="Label visible from
|
198
|
-
labelVisibility="
|
197
|
+
label="Label visible from x2l up"
|
198
|
+
labelVisibility="x2l"
|
199
199
|
beforeLabel={<Icon icon="pencil" />}
|
200
200
|
/>
|
201
201
|
<Button
|
202
|
-
label="Label visible from
|
203
|
-
labelVisibility="
|
202
|
+
label="Label visible from x3l up"
|
203
|
+
labelVisibility="x3l"
|
204
204
|
beforeLabel={<Icon icon="pencil" />}
|
205
205
|
/>
|
206
206
|
</Playground>
|
@@ -399,7 +399,7 @@ animation is made.
|
|
399
399
|
|
400
400
|
In addition to the options below, you can specify [React synthetic events] or
|
401
401
|
any custom HTML attributes that do not interfere with the API, and they will be
|
402
|
-
passed to the
|
402
|
+
passed to the `<button>` HTML element. This enables making the component
|
403
403
|
interactive and helps improve its accessibility.
|
404
404
|
|
405
405
|
<Props table of={Button} />
|
@@ -448,7 +448,11 @@ Where:
|
|
448
448
|
|
449
449
|
- `<SIZE>` is one of `small`, `medium`, or `large` (see [Sizes](#sizes) and
|
450
450
|
[API](#api))
|
451
|
-
- `<PROPERTY>` is one of `height`, `padding-x`, or `font-size`
|
451
|
+
- `<PROPERTY>` is one of `height`, `padding-x`, `padding-y`, or `font-size`
|
452
|
+
|
453
|
+
👉 Button sizes are linked to
|
454
|
+
[box field sizes](/customize/theming/forms#box-field-sizes) sizes so they align
|
455
|
+
nicely when placed in row.
|
452
456
|
|
453
457
|
### Example Theme
|
454
458
|
|
@@ -464,6 +468,7 @@ Where:
|
|
464
468
|
0.1em 0.1em 0.5em rgba(0, 0, 0, 0.3);
|
465
469
|
--rui-Button--medium__height: 3rem;
|
466
470
|
--rui-Button--medium__padding-x: 1.25rem;
|
471
|
+
--rui-Button--medium__padding-y: 0.25rem;
|
467
472
|
}
|
468
473
|
`}
|
469
474
|
</style>
|
@@ -1,15 +1,15 @@
|
|
1
|
-
@use
|
2
|
-
@use
|
3
|
-
@use
|
4
|
-
@use
|
5
|
-
@use
|
1
|
+
@use "sass:map";
|
2
|
+
@use "../../styles/tools/breakpoint";
|
3
|
+
@use "settings";
|
4
|
+
@use "theme";
|
5
|
+
@use "tools";
|
6
6
|
|
7
7
|
.root {
|
8
|
-
|
8
|
+
@include tools.button();
|
9
9
|
}
|
10
10
|
|
11
11
|
.label {
|
12
|
-
|
12
|
+
display: block;
|
13
13
|
}
|
14
14
|
|
15
15
|
.beforeLabel,
|
@@ -17,88 +17,88 @@
|
|
17
17
|
.startCorner,
|
18
18
|
.endCorner,
|
19
19
|
.feedbackIcon {
|
20
|
-
|
21
|
-
|
22
|
-
|
20
|
+
display: flex;
|
21
|
+
align-items: baseline;
|
22
|
+
justify-content: center;
|
23
23
|
}
|
24
24
|
|
25
25
|
.startCorner,
|
26
26
|
.endCorner {
|
27
|
-
|
28
|
-
|
29
|
-
|
27
|
+
position: absolute;
|
28
|
+
top: -0.35rem;
|
29
|
+
z-index: 2;
|
30
30
|
}
|
31
31
|
|
32
32
|
.startCorner {
|
33
|
-
|
34
|
-
|
33
|
+
left: 0;
|
34
|
+
margin-left: -0.35rem;
|
35
35
|
}
|
36
36
|
|
37
37
|
.endCorner {
|
38
|
-
|
39
|
-
|
38
|
+
right: 0;
|
39
|
+
margin-right: -0.35rem;
|
40
40
|
}
|
41
41
|
|
42
42
|
.feedbackIcon {
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
43
|
+
position: absolute;
|
44
|
+
top: 0;
|
45
|
+
right: 0;
|
46
|
+
bottom: 0;
|
47
|
+
left: 0;
|
48
|
+
z-index: 1;
|
49
|
+
align-items: center;
|
50
50
|
}
|
51
51
|
|
52
52
|
.rootSizeSmall {
|
53
|
-
|
53
|
+
@include tools.button-size(small);
|
54
54
|
}
|
55
55
|
|
56
56
|
.rootSizeMedium {
|
57
|
-
|
57
|
+
@include tools.button-size(medium);
|
58
58
|
}
|
59
59
|
|
60
60
|
.rootSizeLarge {
|
61
|
-
|
61
|
+
@include tools.button-size(large);
|
62
62
|
}
|
63
63
|
|
64
64
|
.rootBlock {
|
65
|
-
|
65
|
+
width: 100%;
|
66
66
|
}
|
67
67
|
|
68
68
|
.hasRootFeedback:disabled {
|
69
|
-
|
70
|
-
|
69
|
+
opacity: theme.$feedback-opacity;
|
70
|
+
cursor: theme.$feedback-cursor;
|
71
71
|
}
|
72
72
|
|
73
73
|
.hasRootFeedback .label,
|
74
74
|
.hasRootFeedback .beforeLabel,
|
75
75
|
.hasRootFeedback .afterLabel {
|
76
|
-
|
76
|
+
color: transparent;
|
77
77
|
}
|
78
78
|
|
79
79
|
.rootGrouped {
|
80
|
-
|
80
|
+
z-index: map.get(settings.$group-z-indexes, button);
|
81
81
|
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
82
|
+
&:not(:first-child) {
|
83
|
+
margin-left: var(--rui-local-gap);
|
84
|
+
border-top-left-radius: 0;
|
85
|
+
border-bottom-left-radius: 0;
|
86
|
+
}
|
87
87
|
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
88
|
+
&:not(:last-child) {
|
89
|
+
border-top-right-radius: 0;
|
90
|
+
border-bottom-right-radius: 0;
|
91
|
+
}
|
92
92
|
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
93
|
+
&:focus,
|
94
|
+
&:not(:disabled):hover {
|
95
|
+
z-index: map.get(settings.$group-z-indexes, button-hover);
|
96
|
+
}
|
97
97
|
}
|
98
98
|
|
99
99
|
.rootGrouped .startCorner,
|
100
100
|
.rootGrouped .endCorner {
|
101
|
-
|
101
|
+
z-index: map.get(settings.$group-z-indexes, button-overflowing-elements);
|
102
102
|
}
|
103
103
|
|
104
104
|
.withLabelHidden,
|
@@ -106,43 +106,43 @@
|
|
106
106
|
.withLabelVisibleMd,
|
107
107
|
.withLabelVisibleLg,
|
108
108
|
.withLabelVisibleXl,
|
109
|
-
.
|
110
|
-
.
|
111
|
-
|
109
|
+
.withLabelVisibleX2l,
|
110
|
+
.withLabelVisibleX3l {
|
111
|
+
@include tools.hide-label();
|
112
112
|
}
|
113
113
|
|
114
114
|
.withLabelVisibleSm {
|
115
|
-
|
116
|
-
|
117
|
-
|
115
|
+
@include breakpoint.up(sm) {
|
116
|
+
@include tools.show-label();
|
117
|
+
}
|
118
118
|
}
|
119
119
|
|
120
120
|
.withLabelVisibleMd {
|
121
|
-
|
122
|
-
|
123
|
-
|
121
|
+
@include breakpoint.up(md) {
|
122
|
+
@include tools.show-label();
|
123
|
+
}
|
124
124
|
}
|
125
125
|
|
126
126
|
.withLabelVisibleLg {
|
127
|
-
|
128
|
-
|
129
|
-
|
127
|
+
@include breakpoint.up(lg) {
|
128
|
+
@include tools.show-label();
|
129
|
+
}
|
130
130
|
}
|
131
131
|
|
132
132
|
.withLabelVisibleXl {
|
133
|
-
|
134
|
-
|
135
|
-
|
133
|
+
@include breakpoint.up(xl) {
|
134
|
+
@include tools.show-label();
|
135
|
+
}
|
136
136
|
}
|
137
137
|
|
138
|
-
.
|
139
|
-
|
140
|
-
|
141
|
-
|
138
|
+
.withLabelVisibleX2l {
|
139
|
+
@include breakpoint.up(x2l) {
|
140
|
+
@include tools.show-label();
|
141
|
+
}
|
142
142
|
}
|
143
143
|
|
144
|
-
.
|
145
|
-
|
146
|
-
|
147
|
-
|
144
|
+
.withLabelVisibleX3l {
|
145
|
+
@include breakpoint.up(x3l) {
|
146
|
+
@include tools.show-label();
|
147
|
+
}
|
148
148
|
}
|