@react-ui-org/react-ui 0.54.0 → 0.55.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 (148) hide show
  1. package/README.md +7 -5
  2. package/dist/react-ui.css +36 -38
  3. package/dist/react-ui.development.css +10021 -10523
  4. package/dist/react-ui.development.js +211 -231
  5. package/dist/react-ui.js +1 -1
  6. package/package.json +3 -2
  7. package/src/components/Alert/Alert.jsx +1 -1
  8. package/src/components/Alert/Alert.module.scss +100 -0
  9. package/src/components/Alert/README.md +9 -7
  10. package/src/components/Badge/Badge.jsx +1 -1
  11. package/src/components/Badge/Badge.module.scss +109 -0
  12. package/src/components/Badge/README.md +9 -7
  13. package/src/components/Button/Button.jsx +1 -1
  14. package/src/components/Button/README.md +9 -7
  15. package/src/components/Button/_base.scss +117 -115
  16. package/src/components/Button/_priorities.scss +135 -133
  17. package/src/components/ButtonGroup/ButtonGroup.jsx +1 -1
  18. package/src/components/ButtonGroup/ButtonGroup.module.scss +35 -0
  19. package/src/components/ButtonGroup/README.md +10 -8
  20. package/src/components/Card/Card.jsx +1 -1
  21. package/src/components/Card/Card.module.scss +72 -0
  22. package/src/components/Card/CardBody.jsx +1 -1
  23. package/src/components/Card/CardFooter.jsx +1 -1
  24. package/src/components/Card/README.md +9 -7
  25. package/src/components/CheckboxField/CheckboxField.jsx +1 -1
  26. package/src/components/CheckboxField/CheckboxField.module.scss +63 -0
  27. package/src/components/CheckboxField/README.md +10 -8
  28. package/src/components/FileInputField/FileInputField.jsx +1 -1
  29. package/src/components/FileInputField/FileInputField.module.scss +65 -0
  30. package/src/components/FileInputField/README.md +10 -8
  31. package/src/components/FormLayout/FormLayout.jsx +1 -1
  32. package/src/components/FormLayout/{FormLayout.scss → FormLayout.module.scss} +30 -28
  33. package/src/components/FormLayout/FormLayoutCustomField.jsx +1 -1
  34. package/src/components/FormLayout/FormLayoutCustomField.module.scss +65 -0
  35. package/src/components/FormLayout/README.md +11 -9
  36. package/src/components/Grid/Grid.jsx +1 -1
  37. package/src/components/Grid/Grid.module.scss +66 -0
  38. package/src/components/Grid/GridSpan.jsx +1 -1
  39. package/src/components/Grid/README.md +11 -8
  40. package/src/components/InputGroup/InputGroup.jsx +1 -1
  41. package/src/components/InputGroup/InputGroup.module.scss +93 -0
  42. package/src/components/InputGroup/README.md +10 -8
  43. package/src/components/Modal/Modal.jsx +1 -1
  44. package/src/components/Modal/Modal.module.scss +80 -0
  45. package/src/components/Modal/ModalBody.jsx +1 -1
  46. package/src/components/Modal/ModalBody.module.scss +20 -0
  47. package/src/components/Modal/ModalCloseButton.jsx +1 -1
  48. package/src/components/Modal/ModalCloseButton.module.scss +20 -0
  49. package/src/components/Modal/ModalContent.jsx +1 -1
  50. package/src/components/Modal/ModalContent.module.scss +7 -0
  51. package/src/components/Modal/ModalFooter.jsx +1 -1
  52. package/src/components/Modal/ModalFooter.module.scss +37 -0
  53. package/src/components/Modal/ModalHeader.jsx +1 -1
  54. package/src/components/Modal/ModalHeader.module.scss +32 -0
  55. package/src/components/Modal/ModalTitle.jsx +1 -1
  56. package/src/components/Modal/ModalTitle.module.scss +12 -0
  57. package/src/components/Modal/README.md +17 -14
  58. package/src/components/Paper/Paper.jsx +1 -1
  59. package/src/components/Paper/Paper.module.scss +19 -0
  60. package/src/components/Paper/README.md +9 -7
  61. package/src/components/Popover/Popover.jsx +1 -1
  62. package/src/components/Popover/Popover.module.scss +238 -0
  63. package/src/components/Popover/PopoverWrapper.jsx +1 -2
  64. package/src/components/Popover/PopoverWrapper.module.scss +5 -0
  65. package/src/components/Popover/README.md +9 -7
  66. package/src/components/Radio/README.md +12 -10
  67. package/src/components/Radio/Radio.jsx +1 -1
  68. package/src/components/Radio/Radio.module.scss +85 -0
  69. package/src/components/ScrollView/README.md +10 -8
  70. package/src/components/ScrollView/ScrollView.jsx +1 -1
  71. package/src/components/ScrollView/ScrollView.module.scss +233 -0
  72. package/src/components/SelectField/README.md +10 -8
  73. package/src/components/SelectField/SelectField.jsx +1 -1
  74. package/src/components/SelectField/SelectField.module.scss +111 -0
  75. package/src/components/Table/README.md +10 -8
  76. package/src/components/Table/Table.jsx +1 -1
  77. package/src/components/Table/Table.module.scss +30 -0
  78. package/src/components/Table/_components/TableBodyCell/TableBodyCell.jsx +1 -1
  79. package/src/components/Table/_components/TableCell.module.scss +28 -0
  80. package/src/components/Table/_components/TableHeaderCell/TableHeaderCell.jsx +1 -1
  81. package/src/components/Tabs/README.md +16 -10
  82. package/src/components/Tabs/Tabs.jsx +1 -1
  83. package/src/components/Tabs/Tabs.module.scss +31 -0
  84. package/src/components/Tabs/TabsItem.jsx +1 -1
  85. package/src/components/Tabs/TabsItem.module.scss +119 -0
  86. package/src/components/Text/README.md +15 -9
  87. package/src/components/Text/Text.jsx +1 -1
  88. package/src/components/Text/Text.module.scss +42 -0
  89. package/src/components/TextArea/README.md +10 -8
  90. package/src/components/TextArea/TextArea.jsx +1 -1
  91. package/src/components/TextArea/TextArea.module.scss +97 -0
  92. package/src/components/TextField/README.md +13 -8
  93. package/src/components/TextField/TextField.jsx +1 -1
  94. package/src/components/TextField/TextField.module.scss +109 -0
  95. package/src/components/TextLink/README.md +10 -8
  96. package/src/components/TextLink/TextLink.jsx +1 -1
  97. package/src/components/TextLink/TextLink.module.scss +18 -0
  98. package/src/components/Toggle/README.md +10 -8
  99. package/src/components/Toggle/Toggle.jsx +1 -1
  100. package/src/components/Toggle/Toggle.module.scss +63 -0
  101. package/src/components/Toolbar/README.md +9 -7
  102. package/src/components/Toolbar/Toolbar.jsx +1 -1
  103. package/src/components/Toolbar/Toolbar.module.scss +85 -0
  104. package/src/components/Toolbar/ToolbarGroup.jsx +1 -1
  105. package/src/components/Toolbar/ToolbarItem.jsx +1 -1
  106. package/src/components/_helpers/transferProps.js +47 -7
  107. package/src/foundation.scss +22 -17
  108. package/src/helpers.scss +12 -8
  109. package/src/index.js +3 -4
  110. package/src/index.scss +7 -0
  111. package/src/layers.scss +4 -0
  112. package/src/styles/elements/_page.scss +0 -4
  113. package/src/styles/helpers/_animation.scss +2 -2
  114. package/src/styles/tools/_utilities.scss +1 -1
  115. package/src/theme.scss +1040 -1038
  116. package/src/components/Alert/Alert.scss +0 -98
  117. package/src/components/Badge/Badge.scss +0 -107
  118. package/src/components/ButtonGroup/ButtonGroup.scss +0 -33
  119. package/src/components/Card/Card.scss +0 -70
  120. package/src/components/CheckboxField/CheckboxField.scss +0 -61
  121. package/src/components/FileInputField/FileInputField.scss +0 -63
  122. package/src/components/FormLayout/FormLayoutCustomField.scss +0 -63
  123. package/src/components/Grid/Grid.scss +0 -63
  124. package/src/components/InputGroup/InputGroup.scss +0 -91
  125. package/src/components/Modal/Modal.scss +0 -78
  126. package/src/components/Modal/ModalBody.scss +0 -18
  127. package/src/components/Modal/ModalCloseButton.scss +0 -18
  128. package/src/components/Modal/ModalContent.scss +0 -5
  129. package/src/components/Modal/ModalFooter.scss +0 -35
  130. package/src/components/Modal/ModalHeader.scss +0 -30
  131. package/src/components/Modal/ModalTitle.scss +0 -10
  132. package/src/components/Paper/Paper.scss +0 -17
  133. package/src/components/Popover/Popover.scss +0 -236
  134. package/src/components/Popover/PopoverWrapper.scss +0 -3
  135. package/src/components/Radio/Radio.scss +0 -83
  136. package/src/components/ScrollView/ScrollView.scss +0 -227
  137. package/src/components/SelectField/SelectField.scss +0 -109
  138. package/src/components/Table/Table.scss +0 -28
  139. package/src/components/Table/_components/TableCell.scss +0 -26
  140. package/src/components/Tabs/Tabs.scss +0 -28
  141. package/src/components/Tabs/TabsItem.scss +0 -117
  142. package/src/components/Text/Text.scss +0 -40
  143. package/src/components/TextArea/TextArea.scss +0 -95
  144. package/src/components/TextField/TextField.scss +0 -107
  145. package/src/components/TextLink/TextLink.scss +0 -16
  146. package/src/components/Toggle/Toggle.scss +0 -61
  147. package/src/components/Toolbar/Toolbar.scss +0 -83
  148. /package/src/components/Button/{Button.scss → Button.module.scss} +0 -0
@@ -480,13 +480,15 @@ React.createElement(() => {
480
480
  ## Forwarding HTML Attributes
481
481
 
482
482
  In addition to the options below in the [component's API](#api) section, you
483
- can specify [React synthetic events] or **any HTML attribute you like.** All
484
- attributes that don't interfere with the API are forwarded to the `<div>` HTML
485
- element. This enables making the component interactive and helps to improve its
486
- accessibility.
483
+ can specify **any HTML attribute you like.** All attributes that don't interfere
484
+ with the API of the React component are forwarded to the root `<div>` HTML
485
+ element. This enables making the component interactive and helps to improve
486
+ its accessibility.
487
487
 
488
- 👉 Refer to the MDN reference for the full list of supported attributes of the
489
- [div] element.
488
+ 👉 For the full list of supported attributes refer to:
489
+
490
+ - [`<div>` HTML element attributes][div-attributes]{:target="_blank"}
491
+ - [React common props]{:target="_blank"}
490
492
 
491
493
  ## Forwarding ref
492
494
 
@@ -497,7 +499,7 @@ If you provide [ref], it is forwarded to the scrolling viewport native HTML
497
499
 
498
500
  <docoff-react-props src="/components/ScrollView/ScrollView.jsx"></docoff-react-props>
499
501
 
502
+ [div-attributes]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/div#attributes
500
503
  [linear gradients]: https://developer.mozilla.org/en-US/docs/Web/CSS/gradient/linear-gradient
501
- [React synthetic events]: https://reactjs.org/docs/events.html
502
- [div]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/div#attributes
504
+ [React common props]: https://react.dev/reference/react-dom/components/common#common-props
503
505
  [ref]: https://reactjs.org/docs/refs-and-the-dom.html
@@ -15,7 +15,7 @@ import { transferProps } from '../_helpers/transferProps';
15
15
  import { getElementsPositionDifference } from './_helpers/getElementsPositionDifference';
16
16
  import { useLoadResize } from './_hooks/useLoadResizeHook';
17
17
  import { useScrollPosition } from './_hooks/useScrollPositionHook';
18
- import styles from './ScrollView.scss';
18
+ import styles from './ScrollView.module.scss';
19
19
 
20
20
  // Function `getElementsPositionDifference` sometimes returns floating point values that results
21
21
  // in inaccurate detection of start/end. It is necessary to accept this inaccuracy and take
@@ -0,0 +1,233 @@
1
+ // 1. Scrolling shadows are implemented as pseudo elements. This way we can customise them only
2
+ // with custom properties.
3
+ //
4
+ // 2. Stack scrolling shadows over viewport content while keeping the content interactive.
5
+ //
6
+ // - `.scrollingShadows` is positioned absolutely over the `.root`, with auto `z-index` (this is
7
+ // important!), and with `overflow: hidden` to clip the shadows (ie. its pseudo elements).
8
+ // - The `.viewport` is in `.root`'s stacking context and remains interactive because its
9
+ // `z-index` is higher than the auto `z-index` of `.scrollingShadows`.
10
+ //
11
+ // 3. Optional arrows are positioned relative to the `.root` and stacked on top of scrolling
12
+ // shadows. They can be shifted outside the `ScrollView` area only because `overflow: hidden` is
13
+ // **not** present at `.root`.
14
+ //
15
+ // 4. Make the `.content`'s bounding rectangle spread beyond the part visible through `.viewport`.
16
+ //
17
+ // 5. Prevent undesired vertical scrolling that may occur with tables inside.
18
+ //
19
+ // 6. Make `ScrollView` adjust to flexible layouts.
20
+ //
21
+ // 7. Hide content overflowing in the other direction because scrollbars would be unreachable under
22
+ // scrolling shadows.
23
+ //
24
+ // 8. Use the `clip` value for `overflow` to prevent the content from unwanted scrolling on the
25
+ // cross axis during keyboard navigation.
26
+
27
+ @use "../../styles/tools/accessibility";
28
+ @use "../../styles/tools/caret";
29
+ @use "../../styles/tools/reset";
30
+ @use "../../styles/tools/scrollbar";
31
+ @use "../../styles/tools/spacing";
32
+ @use "../../styles/tools/transition";
33
+
34
+ $_arrow-inner-spacing: spacing.of(2);
35
+ $_arrow-outer-spacing: spacing.of(4);
36
+
37
+ @layer components.scroll-view {
38
+ .root {
39
+ position: relative; // 2.
40
+ display: flex;
41
+ flex-direction: column;
42
+ width: 100%;
43
+ }
44
+
45
+ // 1.
46
+ .scrollingShadows {
47
+ position: absolute; // 2.
48
+ width: 100%; // 2.
49
+ height: 100%; // 2.
50
+ overflow: hidden; // 2.
51
+ pointer-events: none; // 2.
52
+
53
+ &::before,
54
+ &::after {
55
+ @include transition.add((visibility, opacity, transform));
56
+
57
+ content: "";
58
+ position: absolute;
59
+ z-index: 2; // 2.
60
+ display: block;
61
+ visibility: hidden;
62
+ opacity: 0;
63
+ }
64
+
65
+ &::before {
66
+ background: var(--rui-local-start-shadow-background);
67
+ }
68
+
69
+ &::after {
70
+ background: var(--rui-local-end-shadow-background);
71
+ }
72
+ }
73
+
74
+ .viewport {
75
+ z-index: 1; // 2.
76
+ width: 100%;
77
+ scroll-behavior: smooth;
78
+ }
79
+
80
+ .arrowPrev,
81
+ .arrowNext {
82
+ @include reset.button();
83
+ @include accessibility.min-tap-target();
84
+ @include transition.add((visibility, opacity, transform));
85
+
86
+ position: absolute; // 3.
87
+ z-index: 3; // 3.
88
+ display: flex;
89
+ align-items: center;
90
+ justify-content: center;
91
+ visibility: hidden;
92
+ opacity: 0;
93
+ }
94
+
95
+ .arrowIcon {
96
+ @include caret.create();
97
+ }
98
+
99
+ .isRootVertical {
100
+ height: 100%;
101
+ min-height: 0; // 6.
102
+ }
103
+
104
+ .isRootVertical .viewport {
105
+ height: 100%;
106
+ overflow-x: clip; // 7., 8.
107
+ overflow-y: auto; // 2.
108
+ }
109
+
110
+ .isRootVertical .arrowPrev {
111
+ top: 0;
112
+ right: 0;
113
+ left: 0;
114
+ width: 100%;
115
+ padding-top: $_arrow-outer-spacing;
116
+ padding-bottom: $_arrow-inner-spacing;
117
+ color: var(--rui-local-prev-arrow-color);
118
+ transform: translateY(var(--rui-local-prev-arrow-initial-offset));
119
+ }
120
+
121
+ .isRootVertical .arrowPrev .arrowIcon {
122
+ @include caret.rotate(180);
123
+ }
124
+
125
+ .isRootVertical .arrowNext {
126
+ right: 0;
127
+ bottom: 0;
128
+ left: 0;
129
+ width: 100%;
130
+ padding-top: $_arrow-inner-spacing;
131
+ padding-bottom: $_arrow-outer-spacing;
132
+ color: var(--rui-local-next-arrow-color);
133
+ transform: translateY(calc(-1 * var(--rui-local-next-arrow-initial-offset)));
134
+ }
135
+
136
+ .isRootHorizontal {
137
+ min-width: 0; // 6.
138
+ }
139
+
140
+ .isRootHorizontal .arrowPrev {
141
+ top: 0;
142
+ bottom: 0;
143
+ left: 0;
144
+ padding-right: $_arrow-inner-spacing;
145
+ padding-left: $_arrow-outer-spacing;
146
+ transform: translateX(var(--rui-local-prev-arrow-initial-offset));
147
+ }
148
+
149
+ .isRootHorizontal .arrowPrev .arrowIcon {
150
+ @include caret.rotate(90);
151
+ }
152
+
153
+ .isRootHorizontal .arrowNext {
154
+ top: 0;
155
+ right: 0;
156
+ bottom: 0;
157
+ padding-right: $_arrow-outer-spacing;
158
+ padding-left: $_arrow-inner-spacing;
159
+ transform: translateX(calc(-1 * var(--rui-local-next-arrow-initial-offset)));
160
+ }
161
+
162
+ .isRootHorizontal .arrowNext .arrowIcon {
163
+ @include caret.rotate(270);
164
+ }
165
+
166
+ .isRootVertical .scrollingShadows::before,
167
+ .isRootVertical .scrollingShadows::after {
168
+ right: 0;
169
+ left: 0;
170
+ width: auto;
171
+ }
172
+
173
+ .isRootVertical .scrollingShadows::before {
174
+ top: 0;
175
+ height: var(--rui-local-start-shadow-size);
176
+ transform: translateY(var(--rui-local-start-shadow-initial-offset));
177
+ }
178
+
179
+ .isRootVertical .scrollingShadows::after {
180
+ bottom: 0;
181
+ height: var(--rui-local-end-shadow-size);
182
+ transform: translateY(calc(-1 * var(--rui-local-end-shadow-initial-offset)));
183
+ }
184
+
185
+ .isRootHorizontal .viewport {
186
+ overflow-x: auto; // 2.
187
+ overflow-y: clip; // 5., 7., 8.
188
+ }
189
+
190
+ .isRootHorizontal .content {
191
+ display: inline-flex; // 4.
192
+ min-width: 100%;
193
+ overflow: clip; // 8.
194
+ vertical-align: top;
195
+ }
196
+
197
+ .isRootHorizontal .scrollingShadows::before,
198
+ .isRootHorizontal .scrollingShadows::after {
199
+ top: 0;
200
+ bottom: 0;
201
+ height: auto;
202
+ }
203
+
204
+ .isRootHorizontal .scrollingShadows::before {
205
+ left: 0;
206
+ width: var(--rui-local-start-shadow-size);
207
+ transform: translateX(var(--rui-local-start-shadow-initial-offset));
208
+ }
209
+
210
+ .isRootHorizontal .scrollingShadows::after {
211
+ right: 0;
212
+ width: var(--rui-local-end-shadow-size);
213
+ transform: translateX(calc(-1 * var(--rui-local-end-shadow-initial-offset)));
214
+ }
215
+
216
+ .isRootScrolledAtStart .scrollingShadows::before,
217
+ .isRootScrolledAtStart .arrowPrev {
218
+ visibility: visible;
219
+ opacity: 1;
220
+ transform: translate(0, 0);
221
+ }
222
+
223
+ .isRootScrolledAtEnd .scrollingShadows::after,
224
+ .isRootScrolledAtEnd .arrowNext {
225
+ visibility: visible;
226
+ opacity: 1;
227
+ transform: translate(0, 0);
228
+ }
229
+
230
+ .hasRootScrollbarDisabled .viewport {
231
+ @include scrollbar.hide();
232
+ }
233
+ }
@@ -649,13 +649,15 @@ React.createElement(() => {
649
649
  ## Forwarding HTML Attributes
650
650
 
651
651
  In addition to the options below in the [component's API](#api) section, you
652
- can specify [React synthetic events] or you can **add whatever HTML attribute
653
- you like.** All attributes that don't interfere with the API are forwarded to
654
- the native HTML `<select>`. This enables making the component interactive and helps
655
- to improve its accessibility.
652
+ can specify **any HTML attribute you like.** All attributes that don't interfere
653
+ with the API of the React component are forwarded to the root `<select>` HTML
654
+ element. This enables making the component interactive and helps to improve
655
+ its accessibility.
656
656
 
657
- 👉 Refer to the MDN reference for the full list of supported attributes of the
658
- [select] element.
657
+ 👉 For the full list of supported attributes refer to:
658
+
659
+ - [`<select>` HTML element attributes][select-attributes]{:target="_blank"}
660
+ - [React common props]{:target="_blank"}
659
661
 
660
662
  ## Forwarding ref
661
663
 
@@ -676,6 +678,6 @@ options. On top of that, the following options are available for SelectField.
676
678
  | `--rui-FormField--box--select__caret__background` | SelectField arrow background (including `url()` or gradient) |
677
679
  | `--rui-FormField--box--select__option--disabled__color` | Text color of disabled SelectField options |
678
680
 
679
- [React synthetic events]: https://reactjs.org/docs/events.html
680
- [select]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select#attributes
681
+ [React common props]: https://react.dev/reference/react-dom/components/common#common-props
681
682
  [ref]: https://reactjs.org/docs/refs-and-the-dom.html
683
+ [select-attributes]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select#attributes
@@ -9,7 +9,7 @@ import { transferProps } from '../_helpers/transferProps';
9
9
  import { FormLayoutContext } from '../FormLayout';
10
10
  import { InputGroupContext } from '../InputGroup/InputGroupContext';
11
11
  import { Option } from './_components/Option';
12
- import styles from './SelectField.scss';
12
+ import styles from './SelectField.module.scss';
13
13
 
14
14
  export const SelectField = React.forwardRef((props, ref) => {
15
15
  const {
@@ -0,0 +1,111 @@
1
+ @use "../../styles/tools/form-fields/box-field-elements";
2
+ @use "../../styles/tools/form-fields/box-field-layout";
3
+ @use "../../styles/tools/form-fields/box-field-sizes";
4
+ @use "../../styles/tools/form-fields/foundation";
5
+ @use "../../styles/tools/form-fields/variants";
6
+ @use "../../styles/tools/accessibility";
7
+
8
+ @layer components.select-field {
9
+ // Foundation
10
+ .root {
11
+ @include foundation.root();
12
+ }
13
+
14
+ .label {
15
+ @include foundation.label();
16
+ }
17
+
18
+ .inputContainer {
19
+ @include box-field-elements.input-container();
20
+ }
21
+
22
+ .input {
23
+ @include box-field-elements.input();
24
+ @include box-field-elements.input-select();
25
+ @include box-field-elements.input-select-option();
26
+ }
27
+
28
+ .caret {
29
+ @include box-field-elements.caret();
30
+ }
31
+
32
+ .caretIcon {
33
+ @include box-field-elements.caret-icon();
34
+ }
35
+
36
+ .bottomLine {
37
+ @include box-field-elements.bottom-line();
38
+ }
39
+
40
+ .helpText,
41
+ .validationText {
42
+ @include foundation.help-text();
43
+ }
44
+
45
+ .isRootRequired .label {
46
+ @include foundation.label-required();
47
+ }
48
+
49
+ // Variants
50
+ .isRootVariantFilled {
51
+ @include variants.visual(box, $variant: filled, $has-caret: true);
52
+ }
53
+
54
+ .isRootVariantOutline {
55
+ @include variants.visual(box, $variant: outline, $has-caret: true);
56
+ }
57
+
58
+ // States
59
+ .isRootStateInvalid {
60
+ @include variants.validation(invalid);
61
+ }
62
+
63
+ .isRootStateValid {
64
+ @include variants.validation(valid);
65
+ }
66
+
67
+ .isRootStateWarning {
68
+ @include variants.validation(warning);
69
+ }
70
+
71
+ // Invisible label
72
+ .isLabelHidden {
73
+ @include accessibility.hide-text();
74
+ }
75
+
76
+ // Layouts
77
+ .isRootLayoutVertical,
78
+ .isRootLayoutHorizontal {
79
+ @include box-field-layout.vertical();
80
+ }
81
+
82
+ .isRootLayoutHorizontal {
83
+ @include box-field-layout.horizontal();
84
+ }
85
+
86
+ .isRootFullWidth {
87
+ @include box-field-layout.full-width();
88
+ }
89
+
90
+ .isRootInFormLayout {
91
+ @include box-field-layout.in-form-layout();
92
+ }
93
+
94
+ // Sizes
95
+ .isRootSizeSmall {
96
+ @include box-field-sizes.size(small);
97
+ }
98
+
99
+ .isRootSizeMedium {
100
+ @include box-field-sizes.size(medium);
101
+ }
102
+
103
+ .isRootSizeLarge {
104
+ @include box-field-sizes.size(large);
105
+ }
106
+
107
+ // Groups
108
+ .isRootGrouped {
109
+ @include box-field-elements.in-group-layout();
110
+ }
111
+ }
@@ -243,17 +243,19 @@ React.createElement(() => {
243
243
  ## Forwarding HTML Attributes
244
244
 
245
245
  In addition to the options below in the [component's API](#api) section, you
246
- can specify [React synthetic events] or **any HTML attribute you like.** All
247
- attributes that don't interfere with the API are forwarded to the `<table>` HTML
248
- element. This enables making the component interactive and helps to improve its
249
- accessibility.
246
+ can specify **any HTML attribute you like.** All attributes that don't interfere
247
+ with the API of the React component are forwarded to the root `<table>` HTML
248
+ element. This enables making the component interactive and helps to improve
249
+ its accessibility.
250
250
 
251
- 👉 Refer to the MDN reference for the full list of supported attributes of the
252
- [table] element.
251
+ 👉 For the full list of supported attributes refer to:
252
+
253
+ - [`<table>` HTML element attributes][table-attributes]{:target="_blank"}
254
+ - [React common props]{:target="_blank"}
253
255
 
254
256
  ## API
255
257
 
256
258
  <docoff-react-props src="/components/Table/Table.jsx"></docoff-react-props>
257
259
 
258
- [React synthetic events]: https://reactjs.org/docs/events.html
259
- [table]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/table#attributes
260
+ [React common props]: https://react.dev/reference/react-dom/components/common#common-props
261
+ [table-attributes]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/table#attributes
@@ -4,7 +4,7 @@ import { withGlobalProps } from '../../provider';
4
4
  import { transferProps } from '../_helpers/transferProps';
5
5
  import { TableHeaderCell } from './_components/TableHeaderCell';
6
6
  import { TableBodyCell } from './_components/TableBodyCell';
7
- import styles from './Table.scss';
7
+ import styles from './Table.module.scss';
8
8
 
9
9
  export const Table = ({
10
10
  columns,
@@ -0,0 +1,30 @@
1
+ @use "../../styles/tools/transition";
2
+ @use "settings";
3
+
4
+ @layer components.table {
5
+ .table {
6
+ width: 100%;
7
+ border-collapse: collapse;
8
+ }
9
+
10
+ .tableRow,
11
+ .tableHeadRow {
12
+ @include transition.add((background-color));
13
+ }
14
+
15
+ .tableRow {
16
+ background-color: settings.$background-color;
17
+
18
+ &:hover {
19
+ background-color: settings.$hover-background-color;
20
+ }
21
+ }
22
+
23
+ .tableHeadRow {
24
+ background-color: settings.$head-background-color;
25
+
26
+ &:hover {
27
+ background-color: settings.$head-background-color;
28
+ }
29
+ }
30
+ }
@@ -1,6 +1,6 @@
1
1
  import PropTypes from 'prop-types';
2
2
  import React from 'react';
3
- import styles from '../TableCell.scss';
3
+ import styles from '../TableCell.module.scss';
4
4
 
5
5
  export const TableBodyCell = ({
6
6
  format,
@@ -0,0 +1,28 @@
1
+ @use "../settings";
2
+
3
+ @layer components.table {
4
+ .tableCell,
5
+ .tableHeadCell,
6
+ .isTableCellSortingActive,
7
+ .isTableHeadCellSortingActive {
8
+ padding: settings.$cell-padding-y settings.$cell-padding-x;
9
+ text-align: left;
10
+ border-bottom: settings.$border-width solid settings.$border-color;
11
+ }
12
+
13
+ .tableHeadCell {
14
+ font-weight: settings.$head-font-weight;
15
+ border-bottom-width: 2px;
16
+ }
17
+
18
+ .tableHeadCellLayout {
19
+ display: flex;
20
+ gap: settings.$cell-padding-x;
21
+ align-items: center;
22
+ }
23
+
24
+ .isTableCellSortingActive,
25
+ .isTableHeadCellSortingActive {
26
+ background-color: settings.$sorted-background-color;
27
+ }
28
+ }
@@ -1,7 +1,7 @@
1
1
  import PropTypes from 'prop-types';
2
2
  import React from 'react';
3
3
  import { Button } from '../../../Button';
4
- import styles from '../TableCell.scss';
4
+ import styles from '../TableCell.module.scss';
5
5
 
6
6
  export const TableHeaderCell = ({
7
7
  column,
@@ -157,14 +157,20 @@ React.createElement(() => {
157
157
  ## Forwarding HTML Attributes
158
158
 
159
159
  In addition to the options below in the [component's API](#api) section, you
160
- can specify [React synthetic events] or **any HTML attribute you like.** All
161
- attributes that don't interfere with the API are forwarded to the `<nav>` HTML
162
- element in case of `Tabs` component and to the `<a>` HTML element in
163
- case of `TabsItem`. This enables making the component interactive and helps
164
- to improve its accessibility.
160
+ can specify **any HTML attribute you like.** All attributes that don't interfere
161
+ with the API of the React component are forwarded to:
165
162
 
166
- 👉 Refer to the MDN reference for the full list of supported attributes of the
167
- [nav] and [li] element.
163
+ - the root `<nav>` HTML element in case of `Tabs` component
164
+ - the `<a>` HTML element in case of `TabsItem`
165
+
166
+ This enables making the component interactive and helps to improve its
167
+ accessibility.
168
+
169
+ 👉 For the full list of supported attributes refer to:
170
+
171
+ - [`<nav>` HTML element attributes][nav-attributes]{:target="_blank"}
172
+ - [`<a>` HTML element attributes][a-attributes]{:target="_blank"}
173
+ - [React common props]{:target="_blank"}
168
174
 
169
175
  ## API
170
176
 
@@ -216,6 +222,6 @@ Where:
216
222
  `background-color`, `box-shadow`, `shift-y` (shifts vertically the whole
217
223
  item), or `label__shift-y` (tweaks vertical position of tab label).
218
224
 
219
- [React synthetic events]: https://reactjs.org/docs/events.html
220
- [nav]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/nav#attributes
221
- [li]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/li#attributes
225
+ [a-attributes]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/li#attributes
226
+ [nav-attributes]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/nav#attributes
227
+ [React common props]: https://react.dev/reference/react-dom/components/common#common-props
@@ -2,7 +2,7 @@ import PropTypes from 'prop-types';
2
2
  import React from 'react';
3
3
  import { withGlobalProps } from '../../provider';
4
4
  import { transferProps } from '../_helpers/transferProps';
5
- import styles from './Tabs.scss';
5
+ import styles from './Tabs.module.scss';
6
6
 
7
7
  export const Tabs = ({
8
8
  children,
@@ -0,0 +1,31 @@
1
+ // 1. Use the `clip` value to prevent the content from unwanted vertical scrolling during keyboard navigation.
2
+ // 2. Decorative bottom border.
3
+
4
+ @use "../../styles/tools/reset";
5
+ @use "theme";
6
+
7
+ @layer components.tabs {
8
+ .list {
9
+ @include reset.list();
10
+
11
+ position: relative;
12
+ display: inline-flex;
13
+ min-width: 100%;
14
+ padding-right: theme.$padding-x;
15
+ padding-left: theme.$padding-x;
16
+ overflow-y: clip; // 1.
17
+ white-space: nowrap;
18
+
19
+ // 2.
20
+ &::after {
21
+ content: "";
22
+ position: absolute;
23
+ right: 0;
24
+ bottom: 0;
25
+ left: 0;
26
+ z-index: 1;
27
+ height: theme.$border-bottom-width;
28
+ background-color: theme.$border-bottom-color;
29
+ }
30
+ }
31
+ }
@@ -3,7 +3,7 @@ import React from 'react';
3
3
  import { withGlobalProps } from '../../provider';
4
4
  import { transferProps } from '../_helpers/transferProps';
5
5
  import { classNames } from '../../utils/classNames';
6
- import styles from './TabsItem.scss';
6
+ import styles from './TabsItem.module.scss';
7
7
 
8
8
  export const TabsItem = ({
9
9
  afterLabel,