@react-ui-org/react-ui 0.44.1 → 0.45.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (139) hide show
  1. package/dist/lib.development.js +138 -258
  2. package/dist/lib.js +1 -1
  3. package/package.json +7 -10
  4. package/src/lib/components/Alert/Alert.jsx +4 -3
  5. package/src/lib/components/Alert/Alert.scss +48 -48
  6. package/src/lib/components/Alert/_settings.scss +4 -4
  7. package/src/lib/components/Alert/_theme.scss +50 -50
  8. package/src/lib/components/Alert/_tools.scss +6 -6
  9. package/src/lib/components/Badge/Badge.jsx +5 -4
  10. package/src/lib/components/Badge/Badge.scss +57 -57
  11. package/src/lib/components/Button/Button.jsx +10 -9
  12. package/src/lib/components/Button/Button.scss +2 -2
  13. package/src/lib/components/Button/README.mdx +6 -1
  14. package/src/lib/components/Button/_base.scss +65 -65
  15. package/src/lib/components/Button/_priorities.scss +49 -49
  16. package/src/lib/components/Button/_settings.scss +10 -10
  17. package/src/lib/components/Button/_theme.scss +18 -15
  18. package/src/lib/components/Button/_tools.scss +98 -100
  19. package/src/lib/components/ButtonGroup/ButtonGroup.jsx +4 -3
  20. package/src/lib/components/ButtonGroup/ButtonGroup.scss +3 -3
  21. package/src/lib/components/Card/Card.jsx +7 -6
  22. package/src/lib/components/Card/Card.scss +28 -28
  23. package/src/lib/components/Card/_theme.scss +50 -50
  24. package/src/lib/components/Card/_tools.scss +6 -6
  25. package/src/lib/components/CheckboxField/CheckboxField.jsx +12 -11
  26. package/src/lib/components/CheckboxField/CheckboxField.scss +20 -20
  27. package/src/lib/components/FileInputField/FileInputField.jsx +13 -12
  28. package/src/lib/components/FileInputField/FileInputField.scss +19 -19
  29. package/src/lib/components/FormLayout/FormLayout.jsx +5 -4
  30. package/src/lib/components/FormLayout/FormLayout.scss +17 -17
  31. package/src/lib/components/FormLayout/FormLayoutCustomField.jsx +9 -8
  32. package/src/lib/components/FormLayout/FormLayoutCustomField.scss +18 -18
  33. package/src/lib/components/FormLayout/README.mdx +16 -36
  34. package/src/lib/components/Grid/Grid.jsx +1 -1
  35. package/src/lib/components/Grid/Grid.scss +28 -30
  36. package/src/lib/components/Grid/GridSpan.jsx +1 -1
  37. package/src/lib/components/Grid/{helpers → _helpers}/generateResponsiveCustomProperties.js +0 -2
  38. package/src/lib/components/Grid/_theme.scss +9 -9
  39. package/src/lib/components/Grid/_tools.scss +20 -20
  40. package/src/lib/components/Link/Link.jsx +1 -1
  41. package/src/lib/components/Link/Link.scss +7 -7
  42. package/src/lib/components/List/List.jsx +11 -10
  43. package/src/lib/components/List/List.scss +21 -21
  44. package/src/lib/components/Media/Media.scss +6 -6
  45. package/src/lib/components/Modal/Modal.jsx +6 -5
  46. package/src/lib/components/Modal/Modal.scss +73 -73
  47. package/src/lib/components/Modal/_settings.scss +5 -5
  48. package/src/lib/components/Modal/_theme.scss +17 -17
  49. package/src/lib/components/Paper/Paper.jsx +5 -4
  50. package/src/lib/components/Paper/Paper.scss +8 -8
  51. package/src/lib/components/Radio/Radio.jsx +12 -11
  52. package/src/lib/components/Radio/Radio.scss +26 -26
  53. package/src/lib/components/ScrollView/ScrollView.jsx +9 -8
  54. package/src/lib/components/ScrollView/ScrollView.scss +113 -113
  55. package/src/lib/{services/elementPositionService.js → components/ScrollView/_helpers/getElementsPositionDifference.js} +0 -2
  56. package/src/lib/{hooks → components/ScrollView/_hooks}/useLoadResizeHook.js +1 -1
  57. package/src/lib/{hooks → components/ScrollView/_hooks}/useScrollPositionHook.js +1 -1
  58. package/src/lib/components/SelectField/SelectField.jsx +14 -13
  59. package/src/lib/components/SelectField/SelectField.scss +30 -30
  60. package/src/lib/components/Table/Table.scss +28 -35
  61. package/src/lib/components/Table/_settings.scss +5 -5
  62. package/src/lib/components/Tabs/Tabs.scss +21 -21
  63. package/src/lib/components/Tabs/TabsItem.jsx +4 -3
  64. package/src/lib/components/Tabs/TabsItem.scss +78 -78
  65. package/src/lib/components/Text/Text.jsx +5 -4
  66. package/src/lib/components/Text/Text.scss +12 -12
  67. package/src/lib/components/Text/{helpers → _helpers}/getRootHyphensClassName.js +1 -1
  68. package/src/lib/components/Text/{helpers → _helpers}/getRootWordWrappingClassName.js +1 -1
  69. package/src/lib/components/TextArea/TextArea.jsx +14 -13
  70. package/src/lib/components/TextArea/TextArea.scss +27 -27
  71. package/src/lib/components/TextField/TextField.jsx +16 -15
  72. package/src/lib/components/TextField/TextField.scss +28 -28
  73. package/src/lib/components/Toggle/Toggle.jsx +12 -11
  74. package/src/lib/components/Toggle/Toggle.scss +20 -20
  75. package/src/lib/components/Toolbar/Toolbar.jsx +5 -4
  76. package/src/lib/components/Toolbar/Toolbar.scss +25 -25
  77. package/src/lib/components/Toolbar/ToolbarGroup.jsx +5 -4
  78. package/src/lib/{helpers → components/_helpers}/getRootColorClassName.js +1 -1
  79. package/src/lib/{helpers → components/_helpers}/getRootSizeClassName.js +1 -1
  80. package/src/lib/{helpers → components/_helpers}/getRootValidationStateClassName.js +1 -1
  81. package/src/lib/{helpers → components/_helpers}/resolveContextOrProp.js +0 -0
  82. package/src/lib/{utils → components/_helpers}/transferProps.js +1 -1
  83. package/src/lib/foundation.scss +11 -11
  84. package/src/lib/helpers.scss +2 -2
  85. package/src/lib/index.js +3 -7
  86. package/src/lib/styles/_utilities.scss +13 -13
  87. package/src/lib/styles/elements/_code.scss +7 -7
  88. package/src/lib/styles/elements/_links.scss +8 -8
  89. package/src/lib/styles/elements/_lists.scss +3 -3
  90. package/src/lib/styles/elements/_page.scss +14 -14
  91. package/src/lib/styles/elements/_rulers.scss +6 -6
  92. package/src/lib/styles/elements/_small.scss +2 -2
  93. package/src/lib/styles/generic/_box-sizing.scss +3 -2
  94. package/src/lib/styles/generic/_forms.scss +3 -3
  95. package/src/lib/styles/generic/_reset.scss +6 -6
  96. package/src/lib/styles/generic/_shared.scss +3 -3
  97. package/src/lib/styles/helpers/_animation.scss +8 -8
  98. package/src/lib/styles/settings/_breakpoints.scss +7 -7
  99. package/src/lib/styles/settings/_escaped-characters.scss +5 -5
  100. package/src/lib/styles/settings/_form-fields.scss +24 -24
  101. package/src/lib/styles/settings/_utilities.scss +112 -100
  102. package/src/lib/styles/theme/_colors.scss +50 -50
  103. package/src/lib/styles/theme/_form-fields.scss +32 -32
  104. package/src/lib/styles/theme/_spacing.scss +11 -11
  105. package/src/lib/styles/theme/_typography.scss +12 -11
  106. package/src/lib/styles/theme-constants/_breakpoints.scss +2 -2
  107. package/src/lib/styles/theme-constants/_colors.scss +2 -2
  108. package/src/lib/styles/theme-constants/_svg.scss +1 -2
  109. package/src/lib/styles/tools/_accessibility.scss +29 -29
  110. package/src/lib/styles/tools/_breakpoint.scss +11 -14
  111. package/src/lib/styles/tools/_caret.scss +8 -8
  112. package/src/lib/styles/tools/_colors.scss +3 -3
  113. package/src/lib/styles/tools/_reset.scss +21 -21
  114. package/src/lib/styles/tools/_scrollbar.scss +4 -4
  115. package/src/lib/styles/tools/_spacing.scss +17 -21
  116. package/src/lib/styles/tools/_string.scss +9 -9
  117. package/src/lib/styles/tools/_svg.scss +13 -16
  118. package/src/lib/styles/tools/_transition.scss +42 -44
  119. package/src/lib/styles/tools/_utilities.scss +19 -19
  120. package/src/lib/styles/tools/form-fields/_box-field-elements.scss +88 -88
  121. package/src/lib/styles/tools/form-fields/_box-field-layout.scss +144 -144
  122. package/src/lib/styles/tools/form-fields/_box-field-sizes.scss +13 -15
  123. package/src/lib/styles/tools/form-fields/_foundation.scss +12 -12
  124. package/src/lib/styles/tools/form-fields/_inline-field-elements.scss +71 -71
  125. package/src/lib/styles/tools/form-fields/_inline-field-layout.scss +44 -44
  126. package/src/lib/styles/tools/form-fields/_variants.scss +104 -106
  127. package/src/lib/theme.scss +958 -954
  128. package/src/lib/utils/classNames.js +8 -0
  129. package/src/lib/components/CTA/CTA.jsx +0 -60
  130. package/src/lib/components/CTA/CTA.scss +0 -71
  131. package/src/lib/components/CTA/CTACenter.jsx +0 -27
  132. package/src/lib/components/CTA/CTAEnd.jsx +0 -27
  133. package/src/lib/components/CTA/CTAStart.jsx +0 -27
  134. package/src/lib/components/CTA/README.mdx +0 -119
  135. package/src/lib/components/CTA/index.js +0 -4
  136. package/src/lib/components/Center/Center.jsx +0 -27
  137. package/src/lib/components/Center/Center.scss +0 -7
  138. package/src/lib/components/Center/README.mdx +0 -52
  139. package/src/lib/components/Center/index.js +0 -1
@@ -7,94 +7,94 @@
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
9
 
10
- @use '../../theme/typography';
11
- @use '../../theme/form-fields' as theme;
12
- @use '../../tools/accessibility';
13
- @use '../transition';
10
+ @use "../../theme/typography";
11
+ @use "../../theme/form-fields" as theme;
12
+ @use "../../tools/accessibility";
13
+ @use "../transition";
14
14
 
15
15
  @mixin check-input($type) {
16
- @include transition.add((background-color, background-position, box-shadow));
17
-
18
- appearance: none;
19
- width: theme.$check-input-size;
20
- height: theme.$check-input-size;
21
- margin-top: calc((1rem * #{typography.$line-height-base} - #{theme.$check-input-size}) / 2);
22
- border: theme.$check-input-border-width solid var(--rui-local-border-color);
23
- background-position: center;
24
- background-size: contain;
25
- background-repeat: no-repeat;
26
- background-color: var(--rui-local-check-background-color);
27
- color-adjust: exact; // 1.
28
-
29
- &:focus,
30
- &:checked:focus {
31
- box-shadow: theme.$check-input-focus-box-shadow;
32
- }
33
-
34
- @if ($type == 'checkbox') {
35
- border-radius: theme.$check-input-checkbox-border-radius;
36
-
37
- &:checked {
38
- background-image: theme.$check-input-checkbox-checked-background-image;
16
+ @include transition.add((background-color, background-position, box-shadow));
17
+
18
+ appearance: none;
19
+ width: theme.$check-input-size;
20
+ height: theme.$check-input-size;
21
+ margin-top: calc((1rem * #{typography.$line-height-base} - #{theme.$check-input-size}) / 2);
22
+ border: theme.$check-input-border-width solid var(--rui-local-border-color);
23
+ background-position: center;
24
+ background-size: contain;
25
+ background-repeat: no-repeat;
26
+ background-color: var(--rui-local-check-background-color);
27
+ color-adjust: exact; // 1.
28
+
29
+ &:focus,
30
+ &:checked:focus {
31
+ box-shadow: theme.$check-input-focus-box-shadow;
39
32
  }
40
- }
41
33
 
42
- @if ($type == 'radio') {
43
- border-radius: theme.$check-input-radio-border-radius;
34
+ @if $type == "checkbox" {
35
+ border-radius: theme.$check-input-checkbox-border-radius;
44
36
 
45
- &:checked {
46
- background-image: theme.$check-input-radio-checked-background-image;
37
+ &:checked {
38
+ background-image: theme.$check-input-checkbox-checked-background-image;
39
+ }
47
40
  }
48
- }
49
-
50
- @if ($type == 'toggle') {
51
- width: theme.$check-input-toggle-width;
52
- border-radius: theme.$check-input-toggle-border-radius;
53
- background-image: theme.$check-input-toggle-default-background-image;
54
- background-position: theme.$check-input-toggle-default-background-position;
55
- background-size: theme.$check-input-toggle-background-size;
56
-
57
- &:checked {
58
- background-image: theme.$check-input-toggle-checked-background-image;
59
- background-position: theme.$check-input-toggle-checked-background-position;
41
+
42
+ @if $type == "radio" {
43
+ border-radius: theme.$check-input-radio-border-radius;
44
+
45
+ &:checked {
46
+ background-image: theme.$check-input-radio-checked-background-image;
47
+ }
48
+ }
49
+
50
+ @if $type == "toggle" {
51
+ width: theme.$check-input-toggle-width;
52
+ border-radius: theme.$check-input-toggle-border-radius;
53
+ background-image: theme.$check-input-toggle-default-background-image;
54
+ background-position: theme.$check-input-toggle-default-background-position;
55
+ background-size: theme.$check-input-toggle-background-size;
56
+
57
+ &:checked {
58
+ background-image: theme.$check-input-toggle-checked-background-image;
59
+ background-position: theme.$check-input-toggle-checked-background-position;
60
+ }
60
61
  }
61
- }
62
62
  }
63
63
 
64
64
  // 2.
65
65
  @mixin min-tap-target($type) {
66
- $input-width: theme.$check-input-size;
66
+ $input-width: theme.$check-input-size;
67
67
 
68
- @if ($type == 'toggle') {
69
- $input-width: theme.$check-input-toggle-width;
70
- }
71
-
72
- $tap-target-offset: calc((#{$input-width} - #{theme.$check-tap-target-size}) / 2);
68
+ @if $type == "toggle" {
69
+ $input-width: theme.$check-input-toggle-width;
70
+ }
73
71
 
74
- @include accessibility.min-tap-target($size: theme.$check-tap-target-size, $center: false);
72
+ $tap-target-offset: calc((#{$input-width} - #{theme.$check-tap-target-size}) / 2);
75
73
 
76
- min-height: theme.$check-tap-target-size;
77
- padding-top: calc((#{theme.$check-tap-target-size} - 1rem * #{typography.$line-height-base}) / 2);
74
+ @include accessibility.min-tap-target($size: theme.$check-tap-target-size, $center: false);
78
75
 
79
- &::before {
80
- top: 0;
81
- left: $tap-target-offset;
82
- }
76
+ min-height: theme.$check-tap-target-size;
77
+ padding-top: calc((#{theme.$check-tap-target-size} - 1rem * #{typography.$line-height-base}) / 2);
83
78
 
84
- @if ($type == 'checkbox' or $type == 'toggle') {
85
- &.hasRootLabelBefore::before {
86
- right: $tap-target-offset;
87
- left: auto;
79
+ &::before {
80
+ top: 0;
81
+ left: $tap-target-offset;
88
82
  }
89
83
 
90
- // 3.
91
- &.isRootInFormLayout {
92
- min-height: 0;
93
- padding-top: 0;
94
-
95
- &::before {
96
- top: calc((#{typography.$line-height-base} - 1rem * #{theme.$check-tap-target-size}) / 2);
97
- }
84
+ @if $type == "checkbox" or $type == "toggle" {
85
+ &.hasRootLabelBefore::before {
86
+ right: $tap-target-offset;
87
+ left: auto;
88
+ }
89
+
90
+ // 3.
91
+ &.isRootInFormLayout {
92
+ min-height: 0;
93
+ padding-top: 0;
94
+
95
+ &::before {
96
+ top: calc((#{typography.$line-height-base} - 1rem * #{theme.$check-tap-target-size}) / 2);
97
+ }
98
+ }
98
99
  }
99
- }
100
100
  }
@@ -8,66 +8,66 @@
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 '../../settings/forms';
12
- @use '../../settings/form-fields' as settings;
13
- @use '../../theme/typography';
14
- @use '../breakpoint';
11
+ @use "../../settings/forms";
12
+ @use "../../settings/form-fields" as settings;
13
+ @use "../../theme/typography";
14
+ @use "../breakpoint";
15
15
 
16
16
  @mixin root() {
17
- display: inline-flex; // 1.
18
- flex-wrap: wrap;
19
- align-items: baseline;
20
- width: min-content;
21
- min-width: 0; // 1.
22
- max-width: 100%; // 1.
17
+ display: inline-flex; // 1.
18
+ flex-wrap: wrap;
19
+ align-items: baseline;
20
+ width: min-content;
21
+ min-width: 0; // 1.
22
+ max-width: 100%; // 1.
23
23
 
24
- .helpText,
25
- .validationText {
26
- padding-top: settings.$vertical-inner-gap;
27
- }
24
+ .helpText,
25
+ .validationText {
26
+ padding-top: settings.$vertical-inner-gap;
27
+ }
28
28
  }
29
29
 
30
30
  @mixin field() {
31
- display: flex; // 1.
32
- align-items: flex-start;
33
- min-width: 0; // 1.
31
+ display: flex; // 1.
32
+ align-items: flex-start;
33
+ min-width: 0; // 1.
34
34
 
35
- .input {
36
- flex: none;
37
- }
35
+ .input {
36
+ flex: none;
37
+ }
38
38
 
39
- .label,
40
- .optionLabel {
41
- width: max-content; // 1.
42
- margin-left: settings.$inline-field-inner-gap;
43
- }
39
+ .label,
40
+ .optionLabel {
41
+ width: max-content; // 1.
42
+ margin-left: settings.$inline-field-inner-gap;
43
+ }
44
44
  }
45
45
 
46
46
  @mixin has-label-before() {
47
- .field {
48
- flex-direction: row-reverse;
49
- }
47
+ .field {
48
+ flex-direction: row-reverse;
49
+ }
50
50
 
51
- .label,
52
- .optionLabel {
53
- margin-right: settings.$inline-field-inner-gap;
54
- margin-left: 0;
55
- }
51
+ .label,
52
+ .optionLabel {
53
+ margin-right: settings.$inline-field-inner-gap;
54
+ margin-left: 0;
55
+ }
56
56
  }
57
57
 
58
58
  @mixin in-form-layout() {
59
- display: inline-grid; // 2.
60
- justify-self: start; // 3.
61
- width: auto; // 2., 3.
59
+ display: inline-grid; // 2.
60
+ justify-self: start; // 3.
61
+ width: auto; // 2., 3.
62
62
 
63
- @include breakpoint.up(forms.$horizontal-breakpoint) {
64
- &.rootLayoutHorizontal {
65
- grid-column-start: 2;
66
- }
63
+ @include breakpoint.up(forms.$horizontal-breakpoint) {
64
+ &.rootLayoutHorizontal {
65
+ grid-column-start: 2;
66
+ }
67
67
 
68
- &.rootLayoutHorizontal .label,
69
- &.rootLayoutHorizontal .optionLabel {
70
- width: auto; // 1.
68
+ &.rootLayoutHorizontal .label,
69
+ &.rootLayoutHorizontal .optionLabel {
70
+ width: auto; // 1.
71
+ }
71
72
  }
72
- }
73
73
  }
@@ -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 'sass:list';
12
- @use 'sass:map';
13
- @use '../../settings/form-fields' as settings;
14
- @use '../../theme/form-fields' as theme;
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
- opacity: theme.$disabled-opacity;
18
- cursor: theme.$disabled-cursor;
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
- @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
- }
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
- @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)}.";
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
- $themeable-states: map.get(map.get(settings.$themeable-variant-states, $type), $variant);
33
+ $properties: map.get(settings.$themeable-state-properties, $state);
34
+ $infix: $type;
35
+ $fallback-state: "default";
74
36
 
75
- @if (list.index($themeable-states, 'hover')) {
76
- @include _generate-custom-properties($type, $variant, 'default');
37
+ @if $type == "validation" {
38
+ $infix: $variant;
39
+ }
77
40
 
78
- &:hover {
79
- @include _generate-custom-properties($type, $variant, 'hover');
41
+ @if $type != "validation" and $variant != "default" {
42
+ $infix: #{$type}--#{$variant};
80
43
  }
81
- }
82
44
 
83
- @else {
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
- @if (list.index($themeable-states, 'focus')) {
91
- // 3.
92
- &:focus-within,
93
- &:focus-within:hover,
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
- @if (list.index($themeable-states, 'checked')) {
100
- .input:checked {
101
- @include _generate-custom-properties($type, $variant, 'checked');
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
- @if (list.index($themeable-states, 'disabled')) {
106
- &.isRootDisabled {
107
- @include _generate-custom-properties($type, $variant, 'disabled');
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
- @if (list.index($themeable-states, 'checked-disabled')) {
112
- .input:checked:disabled {
113
- @include _generate-custom-properties($type, $variant, 'checked-disabled');
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
- @mixin visual($type, $variant: 'default', $has-caret: false) {
119
- @include _get-theme($type, $variant);
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
- .input:disabled {
122
- @include _disabled-state();
123
- }
97
+ @if list.index($themeable-states, "checked") {
98
+ .input:checked {
99
+ @include _generate-custom-properties($type, $variant, "checked");
100
+ }
101
+ }
124
102
 
125
- @if ($type == 'box' and $variant == 'filled') {
126
- .input {
127
- border-top-color: transparent;
128
- border-right-color: transparent;
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
- @if ($type == 'box' and $variant == 'outline' and $has-caret) {
136
- .caret {
137
- border-left: theme.$box-border-width theme.$box-select-caret-border-style var(--rui-local-border-color);
138
- background: theme.$box-select-caret-background;
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
- &.isRootDisabled .caret {
142
- @include _disabled-state();
139
+ &.isRootDisabled .caret {
140
+ @include _disabled-state();
141
+ }
143
142
  }
144
- }
145
143
  }
146
144
 
147
145
  @mixin validation($variant) {
148
- @include _get-theme(validation, $variant);
146
+ @include _get-theme(validation, $variant);
149
147
  }