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