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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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
@@ -1,16 +1,16 @@
1
1
  $values: (
2
- 0: var(--rui-spacing-0),
3
- 1: var(--rui-spacing-1),
4
- 2: var(--rui-spacing-2),
5
- 3: var(--rui-spacing-3),
6
- 4: var(--rui-spacing-4),
7
- 5: var(--rui-spacing-5),
8
- 6: var(--rui-spacing-6),
9
- 7: var(--rui-spacing-7),
2
+ 0: var(--rui-spacing-0),
3
+ 1: var(--rui-spacing-1),
4
+ 2: var(--rui-spacing-2),
5
+ 3: var(--rui-spacing-3),
6
+ 4: var(--rui-spacing-4),
7
+ 5: var(--rui-spacing-5),
8
+ 6: var(--rui-spacing-6),
9
+ 7: var(--rui-spacing-7),
10
10
  );
11
11
 
12
12
  $bottom: (
13
- default: var(--rui-spacing-bottom-default),
14
- headings: var(--rui-spacing-bottom-headings),
15
- layouts: var(--rui-spacing-bottom-layouts),
13
+ default: var(--rui-spacing-bottom-default),
14
+ headings: var(--rui-spacing-bottom-headings),
15
+ layouts: var(--rui-spacing-bottom-layouts),
16
16
  );
@@ -1,18 +1,18 @@
1
1
  $font-weight-values: (
2
- thin: var(--rui-typography-font-weight-thin),
3
- light: var(--rui-typography-font-weight-light),
4
- regular: var(--rui-typography-font-weight-regular),
5
- medium: var(--rui-typography-font-weight-medium),
6
- bold: var(--rui-typography-font-weight-bold),
2
+ thin: var(--rui-typography-font-weight-thin),
3
+ light: var(--rui-typography-font-weight-light),
4
+ regular: var(--rui-typography-font-weight-regular),
5
+ medium: var(--rui-typography-font-weight-medium),
6
+ bold: var(--rui-typography-font-weight-bold),
7
7
  );
8
8
 
9
9
  $size-values: (
10
- 0: var(--rui-typography-size-0),
11
- 1: var(--rui-typography-size-1),
12
- 2: var(--rui-typography-size-2),
13
- 3: var(--rui-typography-size-3),
14
- 4: var(--rui-typography-size-4),
15
- 5: var(--rui-typography-size-5),
10
+ 0: var(--rui-typography-size-0),
11
+ 1: var(--rui-typography-size-1),
12
+ 2: var(--rui-typography-size-2),
13
+ 3: var(--rui-typography-size-3),
14
+ 4: var(--rui-typography-size-4),
15
+ 5: var(--rui-typography-size-5),
16
16
  );
17
17
 
18
18
  $size-small: var(--rui-typography-size-small);
@@ -21,3 +21,4 @@ $size-smaller: var(--rui-typography-size-smaller);
21
21
  $font-family-base: var(--rui-typography-font-family-base);
22
22
  $font-size-base: var(--rui-typography-font-size-base);
23
23
  $line-height-base: var(--rui-typography-line-height-base);
24
+ $line-height-small: var(--rui-typography-line-height-small);
@@ -1,7 +1,7 @@
1
1
  // ⚠️ For `theme.scss` purposes only, do not use anywhere else.
2
2
 
3
- @use 'sass:map';
4
- @use '../settings/breakpoints';
3
+ @use "sass:map";
4
+ @use "../settings/breakpoints";
5
5
 
6
6
  $xs: map.get(breakpoints.$values, xs);
7
7
  $sm: map.get(breakpoints.$values, sm);
@@ -1,7 +1,7 @@
1
1
  // ⚠️ For `theme.scss` purposes only, do not use anywhere else.
2
2
 
3
- @use 'sass:color';
4
- @use '../tools/colors';
3
+ @use "sass:color";
4
+ @use "../tools/colors";
5
5
 
6
6
  $_gray-base-color: #fff;
7
7
  $_amount-light: 90%;
@@ -1,8 +1,7 @@
1
1
  // ⚠️ For `theme.scss` purposes only, do not use anywhere else.
2
2
 
3
- @use '../tools/svg';
3
+ @use "../tools/svg";
4
4
 
5
- // stylelint-disable function-url-quotes
6
5
  $checkbox-checked: svg.escape(url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path fill='none' stroke='#ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l6-6'/></svg>"));
7
6
  $radio-checked: svg.escape(url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'><circle r='2' fill='#ffffff'/></svg>"));
8
7
  $toggle: svg.escape(url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'><circle r='3' fill='#cccccc'/></svg>"));
@@ -3,49 +3,49 @@
3
3
  //
4
4
  // 2. Make tap target big enough to improve accessibility on touch screens.
5
5
 
6
- @use '../theme/accessibility' as theme;
6
+ @use "../theme/accessibility" as theme;
7
7
 
8
8
  // 1.
9
9
  @mixin hide-text() {
10
- position: absolute;
11
- width: 1px;
12
- height: 1px;
13
- padding: 0;
14
- overflow: hidden;
15
- clip: rect(0, 0, 0, 0);
16
- white-space: nowrap;
17
- border: 0;
10
+ position: absolute;
11
+ width: 1px;
12
+ height: 1px;
13
+ padding: 0;
14
+ overflow: hidden;
15
+ clip: rect(0, 0, 0, 0);
16
+ white-space: nowrap;
17
+ border: 0;
18
18
  }
19
19
 
20
20
  @mixin unhide-text() {
21
- position: unset;
22
- width: unset;
23
- height: unset;
24
- overflow: unset;
25
- clip: unset;
26
- white-space: unset;
21
+ position: unset;
22
+ width: unset;
23
+ height: unset;
24
+ overflow: unset;
25
+ clip: unset;
26
+ white-space: unset;
27
27
  }
28
28
 
29
29
  // 2.
30
30
  @mixin min-tap-target($size: theme.$tap-target-size, $center: true) {
31
- position: relative;
31
+ position: relative;
32
32
 
33
- &::before {
34
- content: '';
35
- position: absolute;
36
- width: $size;
37
- height: $size;
33
+ &::before {
34
+ content: "";
35
+ position: absolute;
36
+ width: $size;
37
+ height: $size;
38
38
 
39
- @if ($center) {
40
- top: 50%;
41
- left: 50%;
42
- transform: translate(-50%, -50%);
39
+ @if $center {
40
+ top: 50%;
41
+ left: 50%;
42
+ transform: translate(-50%, -50%);
43
+ }
43
44
  }
44
- }
45
45
  }
46
46
 
47
47
  @mixin focus-ring() {
48
- &:focus-visible {
49
- box-shadow: theme.$focus-box-shadow;
50
- }
48
+ &:focus-visible {
49
+ box-shadow: theme.$focus-box-shadow;
50
+ }
51
51
  }
@@ -1,18 +1,15 @@
1
- @use 'sass:map';
2
- @use '../settings/breakpoints';
1
+ @use "sass:map";
2
+ @use "../settings/breakpoints";
3
3
 
4
4
  @mixin up($breakpoint) {
5
- @if not map.has-key(breakpoints.$values, $breakpoint) {
6
- @error "Invalid breakpoint specified! #{$breakpoint} doesn't exist. Choose one of #{map.keys(breakpoints.$values)}";
7
- }
8
-
9
- @else if map.get(breakpoints.$values, $breakpoint) == 0 {
10
- @content;
11
- }
12
-
13
- @else {
14
- @media (min-width: map.get(breakpoints.$values, $breakpoint)) {
15
- @content;
5
+ @if not map.has-key(breakpoints.$values, $breakpoint) {
6
+ @error "Invalid breakpoint specified! #{$breakpoint} doesn't exist. "
7
+ + "Choose one of #{map.keys(breakpoints.$values)}";
8
+ } @else if map.get(breakpoints.$values, $breakpoint) == 0 {
9
+ @content;
10
+ } @else {
11
+ @media (min-width: map.get(breakpoints.$values, $breakpoint)) {
12
+ @content;
13
+ }
16
14
  }
17
- }
18
15
  }
@@ -1,14 +1,14 @@
1
1
  @mixin create($rotate: 0) {
2
- @include rotate();
2
+ @include rotate();
3
3
 
4
- display: inline-block;
5
- width: 0.4375rem;
6
- height: 0.4375rem;
7
- border-width: 2px;
8
- border-style: none solid solid none;
9
- border-color: currentColor;
4
+ display: inline-block;
5
+ width: 0.4375rem;
6
+ height: 0.4375rem;
7
+ border-width: 2px;
8
+ border-style: none solid solid none;
9
+ border-color: currentColor;
10
10
  }
11
11
 
12
12
  @mixin rotate($rotate: 0) {
13
- transform: translateY(-0.1rem) rotate($rotate + 45deg);
13
+ transform: translateY(-0.1rem) rotate($rotate + 45deg);
14
14
  }
@@ -1,9 +1,9 @@
1
- @use 'sass:color';
1
+ @use "sass:color";
2
2
 
3
3
  @function lighten-color($color, $weight) {
4
- @return color.mix(white, $color, $weight);
4
+ @return color.mix(white, $color, $weight);
5
5
  }
6
6
 
7
7
  @function darken-color($color, $weight) {
8
- @return color.mix(black, $color, $weight);
8
+ @return color.mix(black, $color, $weight);
9
9
  }
@@ -1,30 +1,30 @@
1
1
  @mixin button() {
2
- appearance: none;
3
- display: inline-flex;
4
- flex: none;
5
- align-items: center;
6
- justify-content: center;
7
- padding: 0;
8
- border: 0;
9
- border-radius: 0;
10
- background: none;
11
- box-shadow: none;
12
- cursor: pointer;
2
+ appearance: none;
3
+ display: inline-flex;
4
+ flex: none;
5
+ align-items: center;
6
+ justify-content: center;
7
+ padding: 0;
8
+ border: 0;
9
+ border-radius: 0;
10
+ background: none;
11
+ box-shadow: none;
12
+ cursor: pointer;
13
13
  }
14
14
 
15
15
  @mixin link() {
16
- text-decoration: none;
17
- color: inherit;
18
-
19
- &:hover,
20
- &:focus {
21
16
  text-decoration: none;
22
- outline: none;
23
- }
17
+ color: inherit;
18
+
19
+ &:hover,
20
+ &:focus {
21
+ text-decoration: none;
22
+ outline: none;
23
+ }
24
24
  }
25
25
 
26
26
  @mixin list() {
27
- padding-left: 0;
28
- margin-bottom: 0;
29
- list-style: none;
27
+ padding-left: 0;
28
+ margin-bottom: 0;
29
+ list-style: none;
30
30
  }
@@ -1,7 +1,7 @@
1
1
  @mixin hide() {
2
- scrollbar-width: none;
2
+ scrollbar-width: none;
3
3
 
4
- &::-webkit-scrollbar {
5
- display: none;
6
- }
4
+ &::-webkit-scrollbar {
5
+ display: none;
6
+ }
7
7
  }
@@ -1,31 +1,27 @@
1
- @use 'sass:map';
2
- @use '../theme/spacing';
1
+ @use "sass:map";
2
+ @use "../theme/spacing";
3
3
 
4
4
  @function of($value) {
5
- @if ($value % 1 != 0) {
6
- @error 'Only whole numbers can be used for spacing, #{$value} given.';
7
- }
8
-
9
- @else {
10
- @if (map.has-key(spacing.$values, $value)) {
11
- @return map.get(spacing.$values, $value);
5
+ @if $value % 1 != 0 {
6
+ @error "Only whole numbers can be used for spacing, #{$value} given.";
7
+ } @else {
8
+ @if map.has-key(spacing.$values, $value) {
9
+ @return map.get(spacing.$values, $value);
10
+ }
12
11
  }
13
- }
14
12
  }
15
13
 
16
14
  @mixin bottom($category: default, $compensation: null) {
17
- @if (not map.has-key(spacing.$bottom, $category)) {
18
- @error "Invalid spacing category specified! #{$category} doesn't exist. "
19
- + "Choose one of #{map.keys(spacing.$bottom)}.";
20
- }
21
-
22
- &:not(:last-child) {
23
- @if ($compensation != null) {
24
- margin-bottom: calc(#{map.get(spacing.$bottom, $category)} - #{$compensation});
15
+ @if not map.has-key(spacing.$bottom, $category) {
16
+ @error "Invalid spacing category specified! #{$category} doesn't exist. "
17
+ + "Choose one of #{map.keys(spacing.$bottom)}.";
25
18
  }
26
19
 
27
- @else {
28
- margin-bottom: map.get(spacing.$bottom, $category);
20
+ &:not(:last-child) {
21
+ @if $compensation {
22
+ margin-bottom: calc(#{map.get(spacing.$bottom, $category)} - #{$compensation});
23
+ } @else {
24
+ margin-bottom: map.get(spacing.$bottom, $category);
25
+ }
29
26
  }
30
- }
31
27
  }
@@ -1,15 +1,15 @@
1
1
  // Author: Hugo Giraudel
2
2
 
3
- @use 'sass:string';
3
+ @use "sass:string";
4
4
 
5
- @function replace($string, $search, $replace: '') {
6
- $index: string.index($string, $search);
5
+ @function replace($string, $search, $replace: "") {
6
+ $index: string.index($string, $search);
7
7
 
8
- @if $index {
9
- @return string.slice($string, 1, $index - 1)
10
- + $replace
11
- + replace(string.slice($string, $index + string.length($search)), $search, $replace);
12
- }
8
+ @if $index {
9
+ @return string.slice($string, 1, $index - 1)
10
+ + $replace
11
+ + replace(string.slice($string, $index + string.length($search)), $search, $replace);
12
+ }
13
13
 
14
- @return $string;
14
+ @return $string;
15
15
  }
@@ -2,24 +2,21 @@
2
2
  //
3
3
  // 1. Do not escape the url brackets.
4
4
 
5
- @use 'sass:string';
6
- @use '../settings/escaped-characters';
7
- @use 'string' as rui-string;
5
+ @use "sass:string";
6
+ @use "../settings/escaped-characters";
7
+ @use "string" as rui-string;
8
8
 
9
9
  @function escape($string) {
10
- @if string.index($string, 'data:image/svg+xml') {
11
- @each $char, $encoded in escaped-characters.$map {
12
-
13
- // 1.
14
- @if string.index($string, 'url(') == 1 {
15
- $string: url('#{rui-string.replace(string.slice($string, 6, -3), $char, $encoded)}');
16
- }
17
-
18
- @else {
19
- $string: rui-string.replace($string, $char, $encoded);
20
- }
10
+ @if string.index($string, "data:image/svg+xml") {
11
+ @each $char, $encoded in escaped-characters.$map {
12
+ // 1.
13
+ @if string.index($string, "url(") == 1 {
14
+ $string: url("#{rui-string.replace(string.slice($string, 6, -3), $char, $encoded)}");
15
+ } @else {
16
+ $string: rui-string.replace($string, $char, $encoded);
17
+ }
18
+ }
21
19
  }
22
- }
23
20
 
24
- @return $string;
21
+ @return $string;
25
22
  }
@@ -1,70 +1,68 @@
1
- @use 'sass:list';
2
- @use 'sass:meta';
3
- @use 'sass:string';
4
- @use '../settings/animations';
1
+ @use "sass:list";
2
+ @use "sass:meta";
3
+ @use "sass:string";
4
+ @use "../settings/animations";
5
5
 
6
6
  $_allowed-transitions: (
7
- border-color,
8
- background-color,
9
- background-position,
10
- box-shadow,
11
- color,
12
- opacity,
13
- transform,
14
- visibility,
7
+ border-color,
8
+ background-color,
9
+ background-position,
10
+ box-shadow,
11
+ color,
12
+ opacity,
13
+ transform,
14
+ visibility,
15
15
  );
16
16
 
17
17
  $_reduced-motion-disallowed-transitions: (transform);
18
18
 
19
19
  @function _validate-transitions($properties) {
20
- @each $property in $properties {
21
- $is-allowed: list.index($_allowed-transitions, $property);
20
+ @each $property in $properties {
21
+ $is-allowed: list.index($_allowed-transitions, $property);
22
22
 
23
- @if not $is-allowed {
24
- @return false;
23
+ @if not $is-allowed {
24
+ @return false;
25
+ }
25
26
  }
26
- }
27
27
 
28
- @return true;
28
+ @return true;
29
29
  }
30
30
 
31
31
  @function _reduce-motion-transitions($properties) {
32
- $reduced-properties: ();
33
- $separator: list.separator($properties);
32
+ $reduced-properties: ();
33
+ $separator: list.separator($properties);
34
34
 
35
- @each $property in $properties {
36
- @if not list.index($_reduced-motion-disallowed-transitions, $property) {
37
- $reduced-properties: list.append($reduced-properties, $property, $separator: $separator);
35
+ @each $property in $properties {
36
+ @if not list.index($_reduced-motion-disallowed-transitions, $property) {
37
+ $reduced-properties: list.append($reduced-properties, $property, $separator: $separator);
38
+ }
38
39
  }
39
- }
40
40
 
41
- @return $reduced-properties;
41
+ @return $reduced-properties;
42
42
  }
43
43
 
44
44
  @mixin add($properties, $duration: 150ms) {
45
- $property-list: ();
45
+ $property-list: ();
46
46
 
47
- @if meta.type-of($properties) != 'string' and meta.type-of($properties) != 'list' {
48
- @error "Transition properties must be a string or a Sass list, `#{$properties}` given.";
49
- }
50
-
51
- $property-list: list.join($property-list, $properties);
47
+ @if meta.type-of($properties) != "string" and meta.type-of($properties) != "list" {
48
+ @error "Transition properties must be a string or a Sass list, `#{$properties}` given.";
49
+ }
52
50
 
53
- @if not _validate-transitions($property-list) {
54
- @error "Only [#{$_allowed-transitions}] transitions are allowed, [#{$properties}] given.";
55
- }
51
+ $property-list: list.join($property-list, $properties);
56
52
 
57
- @else {
58
- $reduced-property-list: _reduce-motion-transitions($property-list);
53
+ @if not _validate-transitions($property-list) {
54
+ @error "Only [#{$_allowed-transitions}] transitions are allowed, [#{$properties}] given.";
55
+ } @else {
56
+ $reduced-property-list: _reduce-motion-transitions($property-list);
59
57
 
60
- transition-property: $property-list;
61
- transition-duration: $duration;
62
- transition-timing-function: animations.$standard-timing-function;
58
+ transition-property: $property-list;
59
+ transition-duration: $duration;
60
+ transition-timing-function: animations.$standard-timing-function;
63
61
 
64
- @if (list.length($reduced-property-list) > 0) {
65
- @media (prefers-reduced-motion: reduce) {
66
- transition-property: $reduced-property-list;
67
- }
62
+ @if list.length($reduced-property-list) > 0 {
63
+ @media (prefers-reduced-motion: reduce) {
64
+ transition-property: $reduced-property-list;
65
+ }
66
+ }
68
67
  }
69
- }
70
68
  }
@@ -1,30 +1,30 @@
1
1
  // Utility generator
2
2
  // Inspired by Bootstrap 4
3
3
 
4
- @use 'sass:list';
5
- @use 'sass:map';
6
- @use 'sass:meta';
4
+ @use "sass:list";
5
+ @use "sass:map";
6
+ @use "sass:meta";
7
7
 
8
8
  @mixin generate($utility, $infix) {
9
- $values: map.get($utility, values);
9
+ $values: map.get($utility, values);
10
10
 
11
- // If the values are a list or string, convert it into a map
12
- @if meta.type-of($values) == 'string' or meta.type-of(list.nth($values, 1)) != 'list' {
13
- $values: list.zip($values, $values);
14
- }
11
+ // If the values are a list or string, convert it into a map
12
+ @if meta.type-of($values) == "string" or meta.type-of(list.nth($values, 1)) != "list" {
13
+ $values: list.zip($values, $values);
14
+ }
15
15
 
16
- @each $key, $value in $values {
17
- $properties: map.get($utility, property);
18
- $property-class: map.get($utility, class);
16
+ @each $key, $value in $values {
17
+ $properties: map.get($utility, property);
18
+ $property-class: map.get($utility, class);
19
19
 
20
- // Don't prefix if value key is null (e.g. with shadow class)
21
- $property-class-modifier: if($key, '-' + $key, '');
20
+ // Don't prefix if value key is null (e.g. with shadow class)
21
+ $property-class-modifier: if($key, "-" + $key, "");
22
22
 
23
- :global(.#{$property-class + $infix + $property-class-modifier}) {
24
- @each $property in $properties {
25
- // stylelint-disable-next-line declaration-no-important
26
- #{$property}: $value !important;
27
- }
23
+ :global(.#{$property-class + $infix + $property-class-modifier}) {
24
+ @each $property in $properties {
25
+ // stylelint-disable-next-line declaration-no-important
26
+ #{$property}: $value !important;
27
+ }
28
+ }
28
29
  }
29
- }
30
30
  }