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