@react-ui-org/react-ui 0.44.0 → 0.46.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CONTRIBUTING.md +7 -0
- package/dist/lib.development.js +209 -305
- package/dist/lib.js +1 -1
- package/package.json +10 -13
- package/src/lib/components/Alert/Alert.jsx +4 -3
- package/src/lib/components/Alert/Alert.scss +48 -48
- 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 +6 -8
- package/src/lib/components/Badge/Badge.scss +57 -57
- package/src/lib/components/Button/Button.jsx +10 -9
- package/src/lib/components/Button/Button.scss +2 -2
- package/src/lib/components/Button/README.mdx +8 -3
- package/src/lib/components/Button/_base.scss +65 -65
- 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/ButtonGroup/ButtonGroup.jsx +31 -22
- package/src/lib/components/ButtonGroup/ButtonGroup.scss +3 -3
- package/src/lib/components/ButtonGroup/README.mdx +4 -4
- package/src/lib/components/Card/Card.jsx +7 -6
- package/src/lib/components/Card/Card.scss +28 -28
- package/src/lib/components/Card/CardBody.jsx +5 -11
- package/src/lib/components/Card/CardFooter.jsx +10 -5
- package/src/lib/components/Card/README.mdx +2 -2
- 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 +18 -17
- package/src/lib/components/CheckboxField/CheckboxField.scss +20 -20
- package/src/lib/components/CheckboxField/README.mdx +3 -3
- package/src/lib/components/FileInputField/FileInputField.jsx +13 -12
- 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 +16 -14
- package/src/lib/components/FormLayout/FormLayout.scss +17 -17
- package/src/lib/components/FormLayout/FormLayoutCustomField.jsx +15 -9
- package/src/lib/components/FormLayout/FormLayoutCustomField.scss +18 -18
- package/src/lib/components/FormLayout/README.mdx +27 -49
- package/src/lib/components/Grid/Grid.jsx +4 -3
- package/src/lib/components/Grid/Grid.scss +32 -23
- package/src/lib/components/Grid/GridSpan.jsx +4 -3
- 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/List/List.jsx +14 -12
- package/src/lib/components/List/List.scss +21 -21
- package/src/lib/components/List/ListItem.jsx +3 -2
- package/src/lib/components/List/README.mdx +1 -1
- package/src/lib/components/Media/Media.jsx +12 -5
- package/src/lib/components/Media/Media.scss +6 -6
- package/src/lib/components/Media/MediaBody.jsx +18 -7
- package/src/lib/components/Media/MediaObject.jsx +18 -7
- package/src/lib/components/Modal/Modal.jsx +8 -6
- package/src/lib/components/Modal/Modal.scss +73 -73
- package/src/lib/components/Modal/README.mdx +2 -2
- 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 +6 -6
- package/src/lib/components/Paper/Paper.scss +8 -8
- package/src/lib/components/Paper/README.mdx +1 -1
- package/src/lib/components/Radio/README.mdx +4 -4
- package/src/lib/components/Radio/Radio.jsx +12 -11
- package/src/lib/components/Radio/Radio.scss +26 -26
- package/src/lib/components/ScrollView/README.mdx +4 -1
- package/src/lib/components/ScrollView/ScrollView.jsx +11 -9
- 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 +4 -4
- package/src/lib/components/SelectField/SelectField.jsx +14 -13
- package/src/lib/components/SelectField/SelectField.scss +30 -30
- package/src/lib/components/Table/README.mdx +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/README.mdx +1 -1
- package/src/lib/components/Tabs/Tabs.jsx +1 -2
- package/src/lib/components/Tabs/Tabs.scss +21 -21
- package/src/lib/components/Tabs/TabsItem.jsx +4 -3
- package/src/lib/components/Tabs/TabsItem.scss +78 -78
- package/src/lib/components/Text/README.mdx +1 -1
- package/src/lib/components/Text/Text.jsx +13 -6
- 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 +18 -14
- 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 +16 -14
- package/src/lib/components/TextField/TextField.scss +28 -28
- package/src/lib/components/TextLink/README.mdx +77 -0
- package/src/lib/components/{Link/Link.jsx → TextLink/TextLink.jsx} +12 -13
- 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 +3 -3
- package/src/lib/components/Toggle/Toggle.jsx +18 -17
- package/src/lib/components/Toggle/Toggle.scss +20 -20
- package/src/lib/components/Toolbar/README.mdx +19 -3
- package/src/lib/components/Toolbar/Toolbar.jsx +23 -14
- package/src/lib/components/Toolbar/Toolbar.scss +35 -30
- package/src/lib/components/Toolbar/ToolbarGroup.jsx +18 -13
- package/src/lib/components/Toolbar/ToolbarItem.jsx +26 -7
- 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 +4 -8
- 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 +2 -2
- 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 +17 -21
- 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 +958 -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.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
@@ -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
|
}
|
@@ -8,66 +8,107 @@
|
|
8
8
|
// 3. Make fields just as wide as necessary. Fields should be interactive only where their visible
|
9
9
|
// content is.
|
10
10
|
|
11
|
-
@use
|
12
|
-
@use
|
13
|
-
@use
|
14
|
-
@use
|
11
|
+
@use "../../settings/forms";
|
12
|
+
@use "../../settings/form-fields" as settings;
|
13
|
+
@use "../../theme/form-fields" as theme;
|
14
|
+
@use "../../theme/typography";
|
15
|
+
@use "../breakpoint";
|
15
16
|
|
16
17
|
@mixin root() {
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
18
|
+
display: inline-flex; // 1.
|
19
|
+
flex-wrap: wrap;
|
20
|
+
align-items: baseline;
|
21
|
+
width: min-content;
|
22
|
+
min-width: 0; // 1.
|
23
|
+
max-width: 100%; // 1.
|
24
|
+
|
25
|
+
.helpText,
|
26
|
+
.validationText {
|
27
|
+
padding-top: settings.$vertical-inner-gap;
|
28
|
+
}
|
28
29
|
}
|
29
30
|
|
30
|
-
@mixin field() {
|
31
|
-
|
32
|
-
|
33
|
-
|
31
|
+
@mixin field($type) {
|
32
|
+
display: flex; // 1.
|
33
|
+
align-items: flex-start;
|
34
|
+
min-width: 0; // 1.
|
35
|
+
|
36
|
+
@if $type == "radio" {
|
37
|
+
flex-direction: row;
|
38
|
+
} @else {
|
39
|
+
flex-direction: row-reverse;
|
40
|
+
justify-content: flex-end;
|
41
|
+
}
|
34
42
|
|
35
|
-
|
36
|
-
|
37
|
-
|
43
|
+
.input {
|
44
|
+
flex: none;
|
45
|
+
}
|
38
46
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
47
|
+
.label,
|
48
|
+
.optionLabel {
|
49
|
+
width: max-content; // 1.
|
50
|
+
margin-left: settings.$inline-field-inner-gap;
|
51
|
+
}
|
44
52
|
}
|
45
53
|
|
46
54
|
@mixin has-label-before() {
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
55
|
+
.field {
|
56
|
+
flex-direction: row;
|
57
|
+
}
|
58
|
+
|
59
|
+
.label,
|
60
|
+
.optionLabel {
|
61
|
+
margin-right: settings.$inline-field-inner-gap;
|
62
|
+
margin-left: 0;
|
63
|
+
}
|
56
64
|
}
|
57
65
|
|
58
66
|
@mixin in-form-layout() {
|
59
|
-
|
60
|
-
|
61
|
-
|
67
|
+
display: inline-grid; // 2.
|
68
|
+
justify-self: start; // 3.
|
69
|
+
width: auto; // 2., 3.
|
62
70
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
71
|
+
@include breakpoint.up(forms.$horizontal-breakpoint) {
|
72
|
+
&.rootLayoutHorizontal {
|
73
|
+
grid: inherit;
|
74
|
+
grid-template-columns: subgrid;
|
75
|
+
grid-column: span 2;
|
76
|
+
|
77
|
+
@supports not (grid-template-columns: subgrid) {
|
78
|
+
display: contents;
|
79
|
+
}
|
80
|
+
}
|
81
|
+
|
82
|
+
&.rootLayoutHorizontal .field {
|
83
|
+
display: contents;
|
84
|
+
}
|
85
|
+
|
86
|
+
&.rootLayoutHorizontal .label {
|
87
|
+
grid-column-start: 1;
|
88
|
+
width: auto;
|
89
|
+
padding-right: settings.$horizontal-inner-gap;
|
90
|
+
margin-left: 0;
|
91
|
+
text-align: theme.$horizontal-label-text-align;
|
92
|
+
}
|
93
|
+
|
94
|
+
&.rootLayoutHorizontal .input,
|
95
|
+
&.rootLayoutHorizontal .helpText,
|
96
|
+
&.rootLayoutHorizontal .validationText {
|
97
|
+
grid-column-start: 2;
|
98
|
+
}
|
99
|
+
|
100
|
+
&.rootLayoutHorizontal .helpText,
|
101
|
+
&.rootLayoutHorizontal .validationText {
|
102
|
+
width: auto;
|
103
|
+
max-width: 100%;
|
104
|
+
|
105
|
+
@supports not (grid-template-columns: subgrid) {
|
106
|
+
margin-top: calc(-1 * var(--rui-FormLayout__row-gap));
|
107
|
+
}
|
108
|
+
}
|
67
109
|
|
68
|
-
|
69
|
-
|
70
|
-
|
110
|
+
&.rootLayoutHorizontal.hasRootLabelBefore .label {
|
111
|
+
margin-right: 0;
|
112
|
+
}
|
71
113
|
}
|
72
|
-
}
|
73
114
|
}
|
@@ -8,142 +8,140 @@
|
|
8
8
|
//
|
9
9
|
// 3. `.input:focus` is added just in case `:focus-within` doesn't work.
|
10
10
|
|
11
|
-
@use
|
12
|
-
@use
|
13
|
-
@use
|
14
|
-
@use
|
11
|
+
@use "sass:list";
|
12
|
+
@use "sass:map";
|
13
|
+
@use "../../settings/form-fields" as settings;
|
14
|
+
@use "../../theme/form-fields" as theme;
|
15
15
|
|
16
16
|
@mixin _disabled-state() {
|
17
|
-
|
18
|
-
|
17
|
+
opacity: theme.$disabled-opacity;
|
18
|
+
cursor: theme.$disabled-cursor;
|
19
19
|
}
|
20
20
|
|
21
21
|
// 1.
|
22
22
|
@mixin _generate-custom-properties($type, $variant, $state) {
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
@if (not list.index(map.keys(settings.$themeable-state-properties), $state)) {
|
29
|
-
@error "Invalid state specified! #{$state} doesn't exist. "
|
30
|
-
+ "Choose one of #{map.keys(settings.$themeable-state-properties)}.";
|
31
|
-
}
|
32
|
-
|
33
|
-
$properties: map.get(settings.$themeable-state-properties, $state);
|
34
|
-
$infix: $type;
|
35
|
-
$fallback-state: 'default';
|
36
|
-
|
37
|
-
@if ($type == 'validation') {
|
38
|
-
$infix: $variant;
|
39
|
-
}
|
40
|
-
|
41
|
-
@if ($type != 'validation' and $variant != 'default') {
|
42
|
-
$infix: #{$type}--#{$variant};
|
43
|
-
}
|
44
|
-
|
45
|
-
@if ($state == 'checked-disabled') {
|
46
|
-
$fallback-state: 'checked';
|
47
|
-
}
|
48
|
-
|
49
|
-
@if ($state == 'default') {
|
50
|
-
@each $property in $properties {
|
51
|
-
--rui-local-#{$property}: var(--rui-FormField--#{$infix}--#{$state}__#{$property});
|
52
|
-
}
|
53
|
-
}
|
54
|
-
|
55
|
-
// 2.
|
56
|
-
@else {
|
57
|
-
@each $property in $properties {
|
58
|
-
--rui-local-#{$property}:
|
59
|
-
var(
|
60
|
-
--rui-FormField--#{$infix}--#{$state}__#{$property},
|
61
|
-
var(--rui-FormField--#{$infix}--#{$fallback-state}__#{$property})
|
62
|
-
);
|
63
|
-
}
|
64
|
-
}
|
65
|
-
}
|
23
|
+
@if not list.index(map.keys(map.get(settings.$themeable-variant-states, $type)), $variant) {
|
24
|
+
@error "Invalid variant specified! #{$variant} doesn't exist. "
|
25
|
+
+ "Choose one of #{map.keys(map.get(settings.$themeable-variant-states, $type))}.";
|
26
|
+
}
|
66
27
|
|
67
|
-
@
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
}
|
28
|
+
@if not list.index(map.keys(settings.$themeable-state-properties), $state) {
|
29
|
+
@error "Invalid state specified! #{$state} doesn't exist. "
|
30
|
+
+ "Choose one of #{map.keys(settings.$themeable-state-properties)}.";
|
31
|
+
}
|
72
32
|
|
73
|
-
|
33
|
+
$properties: map.get(settings.$themeable-state-properties, $state);
|
34
|
+
$infix: $type;
|
35
|
+
$fallback-state: "default";
|
74
36
|
|
75
|
-
|
76
|
-
|
37
|
+
@if $type == "validation" {
|
38
|
+
$infix: $variant;
|
39
|
+
}
|
77
40
|
|
78
|
-
|
79
|
-
|
41
|
+
@if $type != "validation" and $variant != "default" {
|
42
|
+
$infix: #{$type}--#{$variant};
|
80
43
|
}
|
81
|
-
}
|
82
44
|
|
83
|
-
|
84
|
-
|
85
|
-
&:hover {
|
86
|
-
@include _generate-custom-properties($type, $variant, 'default');
|
45
|
+
@if $state == "checked-disabled" {
|
46
|
+
$fallback-state: "checked";
|
87
47
|
}
|
88
|
-
}
|
89
48
|
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
.input:focus {
|
95
|
-
@include _generate-custom-properties($type, $variant, 'focus');
|
49
|
+
@if $state == "default" {
|
50
|
+
@each $property in $properties {
|
51
|
+
--rui-local-#{$property}: var(--rui-FormField--#{$infix}--#{$state}__#{$property});
|
52
|
+
}
|
96
53
|
}
|
97
|
-
}
|
98
54
|
|
99
|
-
|
100
|
-
|
101
|
-
|
55
|
+
// 2.
|
56
|
+
@else {
|
57
|
+
@each $property in $properties {
|
58
|
+
--rui-local-#{$property}:
|
59
|
+
var(
|
60
|
+
--rui-FormField--#{$infix}--#{$state}__#{$property},
|
61
|
+
var(--rui-FormField--#{$infix}--#{$fallback-state}__#{$property})
|
62
|
+
);
|
63
|
+
}
|
102
64
|
}
|
103
|
-
|
65
|
+
}
|
104
66
|
|
105
|
-
|
106
|
-
|
107
|
-
|
67
|
+
@mixin _get-theme($type, $variant) {
|
68
|
+
@if not list.index(map.keys(settings.$themeable-variant-states), $type) {
|
69
|
+
@error "Invalid type specified! #{$type} doesn't exist. "
|
70
|
+
+ "Choose one of #{map.keys(settings.$themeable-variant-states)}.";
|
108
71
|
}
|
109
|
-
}
|
110
72
|
|
111
|
-
|
112
|
-
|
113
|
-
|
73
|
+
$themeable-states: map.get(map.get(settings.$themeable-variant-states, $type), $variant);
|
74
|
+
|
75
|
+
@if list.index($themeable-states, "hover") {
|
76
|
+
@include _generate-custom-properties($type, $variant, "default");
|
77
|
+
|
78
|
+
&:hover {
|
79
|
+
@include _generate-custom-properties($type, $variant, "hover");
|
80
|
+
}
|
81
|
+
} @else {
|
82
|
+
&,
|
83
|
+
&:hover {
|
84
|
+
@include _generate-custom-properties($type, $variant, "default");
|
85
|
+
}
|
114
86
|
}
|
115
|
-
}
|
116
|
-
}
|
117
87
|
|
118
|
-
@
|
119
|
-
|
88
|
+
@if list.index($themeable-states, "focus") {
|
89
|
+
// 3.
|
90
|
+
&:focus-within,
|
91
|
+
&:focus-within:hover,
|
92
|
+
.input:focus {
|
93
|
+
@include _generate-custom-properties($type, $variant, "focus");
|
94
|
+
}
|
95
|
+
}
|
120
96
|
|
121
|
-
|
122
|
-
|
123
|
-
|
97
|
+
@if list.index($themeable-states, "checked") {
|
98
|
+
.input:checked {
|
99
|
+
@include _generate-custom-properties($type, $variant, "checked");
|
100
|
+
}
|
101
|
+
}
|
124
102
|
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
border-left-color: transparent;
|
130
|
-
border-bottom-right-radius: 0;
|
131
|
-
border-bottom-left-radius: 0;
|
103
|
+
@if list.index($themeable-states, "disabled") {
|
104
|
+
&.isRootDisabled {
|
105
|
+
@include _generate-custom-properties($type, $variant, "disabled");
|
106
|
+
}
|
132
107
|
}
|
133
|
-
}
|
134
108
|
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
109
|
+
@if list.index($themeable-states, "checked-disabled") {
|
110
|
+
.input:checked:disabled {
|
111
|
+
@include _generate-custom-properties($type, $variant, "checked-disabled");
|
112
|
+
}
|
139
113
|
}
|
114
|
+
}
|
115
|
+
|
116
|
+
@mixin visual($type, $variant: "default", $has-caret: false) {
|
117
|
+
@include _get-theme($type, $variant);
|
118
|
+
|
119
|
+
.input:disabled {
|
120
|
+
@include _disabled-state();
|
121
|
+
}
|
122
|
+
|
123
|
+
@if $type == "box" and $variant == "filled" {
|
124
|
+
.input {
|
125
|
+
border-top-color: transparent;
|
126
|
+
border-right-color: transparent;
|
127
|
+
border-left-color: transparent;
|
128
|
+
border-bottom-right-radius: 0;
|
129
|
+
border-bottom-left-radius: 0;
|
130
|
+
}
|
131
|
+
}
|
132
|
+
|
133
|
+
@if $type == "box" and $variant == "outline" and $has-caret {
|
134
|
+
.caret {
|
135
|
+
border-left: theme.$box-border-width theme.$box-select-caret-border-style var(--rui-local-border-color);
|
136
|
+
background: theme.$box-select-caret-background;
|
137
|
+
}
|
140
138
|
|
141
|
-
|
142
|
-
|
139
|
+
&.isRootDisabled .caret {
|
140
|
+
@include _disabled-state();
|
141
|
+
}
|
143
142
|
}
|
144
|
-
}
|
145
143
|
}
|
146
144
|
|
147
145
|
@mixin validation($variant) {
|
148
|
-
|
146
|
+
@include _get-theme(validation, $variant);
|
149
147
|
}
|