@react-ui-org/react-ui 0.48.0 → 0.49.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 (99) hide show
  1. package/dist/lib.development.js +160 -64
  2. package/dist/lib.js +1 -1
  3. package/package.json +1 -1
  4. package/src/lib/components/Alert/Alert.jsx +3 -0
  5. package/src/lib/components/Alert/Alert.scss +10 -10
  6. package/src/lib/components/Alert/README.mdx +14 -0
  7. package/src/lib/components/Badge/Badge.jsx +4 -8
  8. package/src/lib/components/Badge/Badge.scss +21 -21
  9. package/src/lib/components/Badge/README.mdx +14 -0
  10. package/src/lib/components/Button/Button.jsx +2 -13
  11. package/src/lib/components/Button/README.mdx +17 -5
  12. package/src/lib/components/Button/_base.scss +20 -20
  13. package/src/lib/components/Button/_priorities.scss +35 -35
  14. package/src/lib/components/Button/helpers/getRootLabelVisibilityClassName.js +7 -7
  15. package/src/lib/components/Button/helpers/getRootPriorityClassName.js +3 -3
  16. package/src/lib/components/ButtonGroup/ButtonGroup.jsx +0 -7
  17. package/src/lib/components/ButtonGroup/README.mdx +14 -0
  18. package/src/lib/components/Card/Card.jsx +6 -10
  19. package/src/lib/components/Card/Card.scss +13 -13
  20. package/src/lib/components/Card/CardBody.jsx +6 -10
  21. package/src/lib/components/Card/CardFooter.jsx +6 -7
  22. package/src/lib/components/Card/README.mdx +14 -0
  23. package/src/lib/components/CheckboxField/CheckboxField.jsx +1 -27
  24. package/src/lib/components/CheckboxField/README.mdx +17 -5
  25. package/src/lib/components/FileInputField/FileInputField.jsx +2 -11
  26. package/src/lib/components/FileInputField/FileInputField.scss +3 -3
  27. package/src/lib/components/FileInputField/README.mdx +29 -27
  28. package/src/lib/components/FormLayout/FormLayout.jsx +5 -9
  29. package/src/lib/components/FormLayout/FormLayout.scss +3 -3
  30. package/src/lib/components/FormLayout/FormLayoutCustomField.jsx +4 -1
  31. package/src/lib/components/FormLayout/FormLayoutCustomField.scss +8 -8
  32. package/src/lib/components/FormLayout/README.mdx +13 -0
  33. package/src/lib/components/Grid/Grid.jsx +0 -7
  34. package/src/lib/components/Grid/GridSpan.jsx +0 -7
  35. package/src/lib/components/Grid/README.mdx +14 -0
  36. package/src/lib/components/Modal/Modal.jsx +6 -10
  37. package/src/lib/components/Modal/ModalBody.jsx +3 -7
  38. package/src/lib/components/Modal/ModalCloseButton.jsx +0 -16
  39. package/src/lib/components/Modal/ModalContent.jsx +3 -7
  40. package/src/lib/components/Modal/ModalFooter.jsx +3 -7
  41. package/src/lib/components/Modal/ModalFooter.scss +5 -5
  42. package/src/lib/components/Modal/ModalHeader.jsx +3 -7
  43. package/src/lib/components/Modal/ModalHeader.scss +5 -5
  44. package/src/lib/components/Modal/ModalTitle.jsx +6 -7
  45. package/src/lib/components/Modal/README.mdx +25 -0
  46. package/src/lib/components/Modal/_helpers/getJustifyClassName.js +5 -5
  47. package/src/lib/components/Paper/Paper.jsx +5 -9
  48. package/src/lib/components/Paper/Paper.scss +2 -2
  49. package/src/lib/components/Paper/README.mdx +14 -0
  50. package/src/lib/components/Popover/Popover.jsx +0 -16
  51. package/src/lib/components/Popover/PopoverWrapper.jsx +0 -7
  52. package/src/lib/components/Popover/README.mdx +19 -0
  53. package/src/lib/components/Radio/README.mdx +12 -5
  54. package/src/lib/components/Radio/Radio.jsx +2 -2
  55. package/src/lib/components/Radio/Radio.scss +3 -3
  56. package/src/lib/components/ScrollView/README.mdx +19 -0
  57. package/src/lib/components/ScrollView/ScrollView.jsx +11 -4
  58. package/src/lib/components/SelectField/README.mdx +17 -5
  59. package/src/lib/components/SelectField/SelectField.jsx +3 -22
  60. package/src/lib/components/SelectField/SelectField.scss +8 -8
  61. package/src/lib/components/Table/README.mdx +21 -7
  62. package/src/lib/components/Table/Table.jsx +43 -101
  63. package/src/lib/components/Table/Table.scss +0 -24
  64. package/src/lib/components/Table/_components/TableBodyCell/TableBodyCell.jsx +46 -0
  65. package/src/lib/components/Table/_components/TableBodyCell/index.js +1 -0
  66. package/src/lib/components/Table/_components/TableCell.scss +25 -0
  67. package/src/lib/components/Table/_components/TableHeaderCell/TableHeaderCell.jsx +71 -0
  68. package/src/lib/components/Table/_components/TableHeaderCell/index.js +1 -0
  69. package/src/lib/components/Tabs/README.mdx +16 -0
  70. package/src/lib/components/Tabs/Tabs.jsx +6 -1
  71. package/src/lib/components/Tabs/TabsItem.jsx +3 -0
  72. package/src/lib/components/Text/README.mdx +16 -0
  73. package/src/lib/components/Text/Text.jsx +3 -7
  74. package/src/lib/components/Text/Text.scss +6 -6
  75. package/src/lib/components/Text/_helpers/getRootClampClassName.js +2 -2
  76. package/src/lib/components/Text/_helpers/getRootHyphensClassName.js +2 -2
  77. package/src/lib/components/Text/_helpers/getRootWordWrappingClassName.js +2 -2
  78. package/src/lib/components/TextArea/README.mdx +33 -30
  79. package/src/lib/components/TextArea/TextArea.jsx +3 -43
  80. package/src/lib/components/TextArea/TextArea.scss +8 -8
  81. package/src/lib/components/TextField/README.mdx +53 -51
  82. package/src/lib/components/TextField/TextField.jsx +3 -29
  83. package/src/lib/components/TextField/TextField.scss +9 -9
  84. package/src/lib/components/TextLink/README.mdx +12 -5
  85. package/src/lib/components/TextLink/TextLink.jsx +0 -10
  86. package/src/lib/components/Toggle/README.mdx +17 -5
  87. package/src/lib/components/Toggle/Toggle.jsx +1 -27
  88. package/src/lib/components/Toolbar/README.mdx +13 -0
  89. package/src/lib/components/Toolbar/Toolbar.jsx +9 -43
  90. package/src/lib/components/Toolbar/Toolbar.scss +24 -12
  91. package/src/lib/components/Toolbar/ToolbarGroup.jsx +7 -26
  92. package/src/lib/components/Toolbar/ToolbarItem.jsx +3 -7
  93. package/src/lib/components/Toolbar/_helpers/getAlignClassName.js +19 -0
  94. package/src/lib/components/Toolbar/_helpers/getJustifyClassName.js +16 -0
  95. package/src/lib/components/_helpers/getRootColorClassName.js +10 -10
  96. package/src/lib/components/_helpers/getRootSizeClassName.js +3 -3
  97. package/src/lib/styles/tools/form-fields/_box-field-layout.scss +15 -15
  98. package/src/lib/styles/tools/form-fields/_inline-field-elements.scss +1 -1
  99. package/src/lib/styles/tools/form-fields/_inline-field-layout.scss +9 -9
@@ -2,28 +2,28 @@ import PropTypes from 'prop-types';
2
2
  import React from 'react';
3
3
  import { withGlobalProps } from '../../provider';
4
4
  import { classNames } from '../../utils/classNames';
5
+ import { transferProps } from '../_helpers/transferProps';
5
6
  import styles from './Paper.scss';
6
7
 
7
8
  export const Paper = ({
8
9
  children,
9
- id,
10
10
  muted,
11
11
  raised,
12
+ ...restProps
12
13
  }) => (
13
14
  <div
15
+ {...transferProps(restProps)}
14
16
  className={classNames(
15
17
  styles.root,
16
- muted && styles.rootMuted,
17
- raised && styles.rootRaised,
18
+ muted && styles.isRootMuted,
19
+ raised && styles.isRootRaised,
18
20
  )}
19
- id={id}
20
21
  >
21
22
  {children}
22
23
  </div>
23
24
  );
24
25
 
25
26
  Paper.defaultProps = {
26
- id: undefined,
27
27
  muted: false,
28
28
  raised: false,
29
29
  };
@@ -33,10 +33,6 @@ Paper.propTypes = {
33
33
  * Content to be placed onto Paper.
34
34
  */
35
35
  children: PropTypes.node.isRequired,
36
- /**
37
- * ID of the root HTML element.
38
- */
39
- id: PropTypes.string,
40
36
  /**
41
37
  * Visually suppress Paper.
42
38
  */
@@ -7,11 +7,11 @@
7
7
  background-color: theme.$background-color;
8
8
  }
9
9
 
10
- .rootMuted {
10
+ .isRootMuted {
11
11
  background-color: theme.$muted-background-color;
12
12
  opacity: theme.$muted-opacity;
13
13
  }
14
14
 
15
- .rootRaised {
15
+ .isRootRaised {
16
16
  box-shadow: theme.$raised-box-shadow;
17
17
  }
@@ -63,6 +63,17 @@ Dim background and add transparency to visually suppress the Paper.
63
63
  </Paper>
64
64
  </Playground>
65
65
 
66
+ ## Forwarding HTML Attributes
67
+
68
+ In addition to the options below in the [component's API](#api) section, you
69
+ can specify [React synthetic events] or **any HTML attribute you like.** All
70
+ attributes that don't interfere with the API are forwarded to the root `<div>`
71
+ HTML element. This enables making the component interactive and helps to improve
72
+ its accessibility.
73
+
74
+ 👉 Refer to the MDN reference for the full list of supported attributes of the
75
+ [div] element.
76
+
66
77
  ## API
67
78
 
68
79
  <Props table of={Paper} />
@@ -79,3 +90,6 @@ Dim background and add transparency to visually suppress the Paper.
79
90
  | `--rui-Paper--muted__background-color` | Background color of muted paper |
80
91
  | `--rui-Paper--muted__opacity` | Opacity of muted paper |
81
92
  | `--rui-Paper--raised__box-shadow` | Box shadow of raised paper |
93
+
94
+ [React synthetic events]: https://reactjs.org/docs/events.html
95
+ [div]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/div#attributes
@@ -12,7 +12,6 @@ export const Popover = React.forwardRef((props, ref) => {
12
12
  const {
13
13
  placement,
14
14
  children,
15
- id,
16
15
  portalId,
17
16
  ...restProps
18
17
  } = props;
@@ -26,7 +25,6 @@ export const Popover = React.forwardRef((props, ref) => {
26
25
  getRootSideClassName(placement, styles),
27
26
  getRootAlignmentClassName(placement, styles),
28
27
  )}
29
- id={id}
30
28
  ref={ref}
31
29
  >
32
30
  {children}
@@ -42,10 +40,8 @@ export const Popover = React.forwardRef((props, ref) => {
42
40
  });
43
41
 
44
42
  Popover.defaultProps = {
45
- id: undefined,
46
43
  placement: 'bottom',
47
44
  portalId: null,
48
- ref: undefined,
49
45
  };
50
46
 
51
47
  Popover.propTypes = {
@@ -53,10 +49,6 @@ Popover.propTypes = {
53
49
  * Popover content.
54
50
  */
55
51
  children: PropTypes.node.isRequired,
56
- /**
57
- * ID of the root HTML element.
58
- */
59
- id: PropTypes.string,
60
52
  /**
61
53
  * Popover placement affects position of the arrow.
62
54
  * Compatible with [Floating UI API](https://floating-ui.com/docs/computePosition#placement).
@@ -79,14 +71,6 @@ Popover.propTypes = {
79
71
  * If set, popover is rendered in the React Portal with that ID.
80
72
  */
81
73
  portalId: PropTypes.string,
82
- /**
83
- * Reference forwarded to the root `div` element.
84
- */
85
- ref: PropTypes.oneOfType([
86
- PropTypes.func,
87
- // eslint-disable-next-line react/forbid-prop-types
88
- PropTypes.shape({ current: PropTypes.any }),
89
- ]),
90
74
  };
91
75
 
92
76
  export const PopoverWithGlobalProps = withGlobalProps(Popover, 'Popover');
@@ -6,21 +6,18 @@ import styles from './PopoverWrapper.scss';
6
6
 
7
7
  export const PopoverWrapper = ({
8
8
  children,
9
- id,
10
9
  tag: Tag,
11
10
  ...restProps
12
11
  }) => (
13
12
  <Tag
14
13
  {...transferProps(restProps)}
15
14
  className={styles.root}
16
- id={id}
17
15
  >
18
16
  {children}
19
17
  </Tag>
20
18
  );
21
19
 
22
20
  PopoverWrapper.defaultProps = {
23
- id: undefined,
24
21
  tag: 'div',
25
22
  };
26
23
 
@@ -29,10 +26,6 @@ PopoverWrapper.propTypes = {
29
26
  * Popover reference and the Popover itself.
30
27
  */
31
28
  children: PropTypes.node.isRequired,
32
- /**
33
- * ID of the root HTML element.
34
- */
35
- id: PropTypes.string,
36
29
  /**
37
30
  * HTML tag to render. Can be any valid HTML tag of your choice, usually a
38
31
  * [block-level element](https://developer.mozilla.org/en-US/docs/Web/HTML/Block-level_elements).
@@ -311,6 +311,22 @@ get an idea of all possible cases you may need to cover.
311
311
  }}
312
312
  </Playground>
313
313
 
314
+ ## Forwarding HTML Attributes
315
+
316
+ In addition to the options below in the [component's API](#api) section, you
317
+ can specify [React synthetic events] or **any HTML attribute you like.** All
318
+ attributes that don't interfere with the API are forwarded to the root `<div>`
319
+ HTML element. This enables making the component interactive and helps to improve
320
+ its accessibility.
321
+
322
+ 👉 Refer to the MDN reference for the full list of supported attributes of the
323
+ [div] element.
324
+
325
+ ## Forwarding ref
326
+
327
+ If you provide [ref], it is forwarded to the root native HTML `<div>` element,
328
+ which enables [Advanced Positioning](#advanced-positioning).
329
+
314
330
  ## API
315
331
 
316
332
  <Props table of={Popover} />
@@ -333,3 +349,6 @@ get an idea of all possible cases you may need to cover.
333
349
  | `--rui-Popover__box-shadow` | Popover box shadow |
334
350
 
335
351
  [Floating UI]: https://floating-ui.com/docs/react-dom
352
+ [React synthetic events]: https://reactjs.org/docs/events.html
353
+ [div]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/div#attributes
354
+ [ref]: https://reactjs.org/docs/refs-and-the-dom.html
@@ -283,12 +283,18 @@ It's possible to disable just some options or the whole set.
283
283
  }}
284
284
  </Playground>
285
285
 
286
- ## API
286
+ ## Forwarding HTML Attributes
287
+
288
+ In addition to the options below in the [component's API](#api) section, you
289
+ can specify [React synthetic events] or you can **add whatever HTML attribute
290
+ you like.** All attributes that don't interfere with the API are forwarded to
291
+ the native HTML `<input>`. This enables making the component interactive and helps
292
+ to improve its accessibility.
287
293
 
288
- In addition to the options below, you can specify [React synthetic events] or
289
- any custom HTML attributes that do not interfere with the API, and they will be
290
- passed to the `<input>` HTML element. This enables making the component
291
- interactive and helps improve its accessibility.
294
+ 👉 Refer to the MDN reference for the full list of supported attributes of the
295
+ [radio] input type.
296
+
297
+ ## API
292
298
 
293
299
  <Props table of={Radio} />
294
300
 
@@ -303,3 +309,4 @@ options. On top of that, the following options are available for Radio.
303
309
  | `--rui-FormField--check__input--radio--checked__background-image` | Checked input background image (inline, URL, …) |
304
310
 
305
311
  [React synthetic events]: https://reactjs.org/docs/events.html
312
+ [radio]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/radio#additional_attributes
@@ -30,8 +30,8 @@ export const Radio = ({
30
30
  styles.root,
31
31
  context && styles.isRootInFormLayout,
32
32
  resolveContextOrProp(context && context.layout, layout) === 'horizontal'
33
- ? styles.rootLayoutHorizontal
34
- : styles.rootLayoutVertical,
33
+ ? styles.isRootLayoutHorizontal
34
+ : styles.isRootLayoutVertical,
35
35
  disabled && styles.isRootDisabled,
36
36
  required && styles.isRootRequired,
37
37
  getRootValidationStateClassName(validationState, styles),
@@ -60,12 +60,12 @@
60
60
  }
61
61
 
62
62
  // Layouts
63
- .rootLayoutVertical,
64
- .rootLayoutHorizontal {
63
+ .isRootLayoutVertical,
64
+ .isRootLayoutHorizontal {
65
65
  @include box-field-layout.vertical($has-list: true);
66
66
  }
67
67
 
68
- .rootLayoutHorizontal {
68
+ .isRootLayoutHorizontal {
69
69
  @include box-field-layout.horizontal($has-min-tap-target: true);
70
70
  }
71
71
 
@@ -495,8 +495,27 @@ scrolling shadows in both directions via
495
495
  )}}
496
496
  </Playground>
497
497
 
498
+ ## Forwarding HTML Attributes
499
+
500
+ In addition to the options below in the [component's API](#api) section, you
501
+ can specify [React synthetic events] or **any HTML attribute you like.** All
502
+ attributes that don't interfere with the API are forwarded to the `<div>` HTML
503
+ element. This enables making the component interactive and helps to improve its
504
+ accessibility.
505
+
506
+ 👉 Refer to the MDN reference for the full list of supported attributes of the
507
+ [div] element.
508
+
509
+ ## Forwarding ref
510
+
511
+ If you provide [ref], it is forwarded to the scrolling viewport native HTML
512
+ `<div>` element.
513
+
498
514
  ## API
499
515
 
500
516
  <Props table of={ScrollView} />
501
517
 
502
518
  [linear gradients]: https://developer.mozilla.org/en-US/docs/Web/CSS/gradient/linear-gradient
519
+ [React synthetic events]: https://reactjs.org/docs/events.html
520
+ [div]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/div#attributes
521
+ [ref]: https://reactjs.org/docs/refs-and-the-dom.html
@@ -11,6 +11,7 @@ import {
11
11
  withGlobalProps,
12
12
  } from '../../provider';
13
13
  import { classNames } from '../../utils/classNames';
14
+ import { transferProps } from '../_helpers/transferProps';
14
15
  import { getElementsPositionDifference } from './_helpers/getElementsPositionDifference';
15
16
  import { useLoadResize } from './_hooks/useLoadResizeHook';
16
17
  import { useScrollPosition } from './_hooks/useScrollPositionHook';
@@ -21,7 +22,7 @@ import styles from './ScrollView.scss';
21
22
  // every value less or equal to 1px as start/end.
22
23
  const EDGE_DETECTION_INACCURACY_PX = 1;
23
24
 
24
- export const ScrollView = (props) => {
25
+ export const ScrollView = React.forwardRef((props, ref) => {
25
26
  const {
26
27
  arrows,
27
28
  arrowsScrollStep,
@@ -44,6 +45,7 @@ export const ScrollView = (props) => {
44
45
  startShadowBackground,
45
46
  startShadowInitialOffset,
46
47
  startShadowSize,
48
+ ...restProps
47
49
  } = props;
48
50
 
49
51
  const { translations } = useContext(RUIContext);
@@ -55,7 +57,8 @@ export const ScrollView = (props) => {
55
57
  const scrollPositionStart = direction === 'horizontal' ? 'left' : 'top';
56
58
  const scrollPositionEnd = direction === 'horizontal' ? 'right' : 'bottom';
57
59
  const scrollViewContentEl = useRef(null);
58
- const scrollViewViewportEl = useRef(null);
60
+ const blankRef = useRef(null);
61
+ const scrollViewViewportEl = ref ?? blankRef;
59
62
 
60
63
  const handleScrollViewState = (currentPosition) => {
61
64
  const isScrolledAtStartActive = currentPosition[scrollPositionStart]
@@ -172,6 +175,7 @@ export const ScrollView = (props) => {
172
175
 
173
176
  return (
174
177
  <div
178
+ {...transferProps(restProps)}
175
179
  className={classNames(
176
180
  styles.root,
177
181
  isScrolledAtStart && styles.isRootScrolledAtStart,
@@ -195,7 +199,10 @@ export const ScrollView = (props) => {
195
199
  '--rui-local-start-shadow-size': startShadowSize,
196
200
  }}
197
201
  >
198
- <div className={styles.viewport} ref={scrollViewViewportEl}>
202
+ <div
203
+ className={styles.viewport}
204
+ ref={scrollViewViewportEl}
205
+ >
199
206
  <div
200
207
  className={styles.content}
201
208
  id={id && `${id}__content`}
@@ -247,7 +254,7 @@ export const ScrollView = (props) => {
247
254
  )}
248
255
  </div>
249
256
  );
250
- };
257
+ });
251
258
 
252
259
  ScrollView.defaultProps = {
253
260
  arrows: false,
@@ -658,12 +658,22 @@ It's possible to disable just some options or the whole input.
658
658
  }}
659
659
  </Playground>
660
660
 
661
- ## API
661
+ ## Forwarding HTML Attributes
662
+
663
+ In addition to the options below in the [component's API](#api) section, you
664
+ can specify [React synthetic events] or you can **add whatever HTML attribute
665
+ you like.** All attributes that don't interfere with the API are forwarded to
666
+ the native HTML `<select>`. This enables making the component interactive and helps
667
+ to improve its accessibility.
668
+
669
+ 👉 Refer to the MDN reference for the full list of supported attributes of the
670
+ [select] element.
662
671
 
663
- In addition to the options below, you can specify [React synthetic events] or
664
- any custom HTML attributes that do not interfere with the API, and they will be
665
- passed to the `<select>` HTML element. This enables making the component
666
- interactive and helps improve its accessibility.
672
+ ## Forwarding ref
673
+
674
+ If you provide [ref], it is forwarded to the native HTML `<select>` element.
675
+
676
+ ## API
667
677
 
668
678
  <Props table of={SelectField} />
669
679
 
@@ -679,3 +689,5 @@ options. On top of that, the following options are available for SelectField.
679
689
  | `--rui-FormField--box--select__option--disabled__color` | Text color of disabled SelectField options |
680
690
 
681
691
  [React synthetic events]: https://reactjs.org/docs/events.html
692
+ [select]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select#attributes
693
+ [ref]: https://reactjs.org/docs/refs-and-the-dom.html
@@ -24,7 +24,6 @@ export const SelectField = React.forwardRef((props, ref) => {
24
24
  size,
25
25
  validationState,
26
26
  validationText,
27
- value,
28
27
  variant,
29
28
  ...restProps
30
29
  } = props;
@@ -38,13 +37,13 @@ export const SelectField = React.forwardRef((props, ref) => {
38
37
  fullWidth && styles.isRootFullWidth,
39
38
  context && styles.isRootInFormLayout,
40
39
  resolveContextOrProp(context && context.layout, layout) === 'horizontal'
41
- ? styles.rootLayoutHorizontal
42
- : styles.rootLayoutVertical,
40
+ ? styles.isRootLayoutHorizontal
41
+ : styles.isRootLayoutVertical,
43
42
  disabled && styles.isRootDisabled,
44
43
  required && styles.isRootRequired,
45
44
  getRootSizeClassName(size, styles),
46
45
  getRootValidationStateClassName(validationState, styles),
47
- variant === 'filled' ? styles.rootVariantFilled : styles.rootVariantOutline,
46
+ variant === 'filled' ? styles.isRootVariantFilled : styles.isRootVariantOutline,
48
47
  )}
49
48
  htmlFor={id}
50
49
  id={id && `${id}__label`}
@@ -67,7 +66,6 @@ export const SelectField = React.forwardRef((props, ref) => {
67
66
  id={id}
68
67
  ref={ref}
69
68
  required={required}
70
- value={value}
71
69
  >
72
70
  {
73
71
  options.map((option) => {
@@ -132,12 +130,10 @@ SelectField.defaultProps = {
132
130
  id: undefined,
133
131
  isLabelVisible: true,
134
132
  layout: 'vertical',
135
- ref: undefined,
136
133
  required: false,
137
134
  size: 'medium',
138
135
  validationState: null,
139
136
  validationText: null,
140
- value: undefined,
141
137
  variant: 'outline',
142
138
  };
143
139
 
@@ -222,14 +218,6 @@ SelectField.propTypes = {
222
218
  ]),
223
219
  })),
224
220
  ]).isRequired,
225
- /**
226
- * Reference forwarded to the `select` element.
227
- */
228
- ref: PropTypes.oneOfType([
229
- PropTypes.func,
230
- // eslint-disable-next-line react/forbid-prop-types
231
- PropTypes.shape({ current: PropTypes.any }),
232
- ]),
233
221
  /**
234
222
  * If `true`, the input will be required.
235
223
  */
@@ -246,13 +234,6 @@ SelectField.propTypes = {
246
234
  * Validation message to be displayed.
247
235
  */
248
236
  validationText: PropTypes.node,
249
- /**
250
- * Value of the input.
251
- */
252
- value: PropTypes.oneOfType([
253
- PropTypes.string,
254
- PropTypes.number,
255
- ]),
256
237
  /**
257
238
  * Design variant of the field, further customizable with CSS custom properties.
258
239
  */
@@ -46,11 +46,11 @@
46
46
  }
47
47
 
48
48
  // Variants
49
- .rootVariantFilled {
49
+ .isRootVariantFilled {
50
50
  @include variants.visual(box, $variant: filled, $has-caret: true);
51
51
  }
52
52
 
53
- .rootVariantOutline {
53
+ .isRootVariantOutline {
54
54
  @include variants.visual(box, $variant: outline, $has-caret: true);
55
55
  }
56
56
 
@@ -73,12 +73,12 @@
73
73
  }
74
74
 
75
75
  // Layouts
76
- .rootLayoutVertical,
77
- .rootLayoutHorizontal {
76
+ .isRootLayoutVertical,
77
+ .isRootLayoutHorizontal {
78
78
  @include box-field-layout.vertical();
79
79
  }
80
80
 
81
- .rootLayoutHorizontal {
81
+ .isRootLayoutHorizontal {
82
82
  @include box-field-layout.horizontal();
83
83
  }
84
84
 
@@ -91,14 +91,14 @@
91
91
  }
92
92
 
93
93
  // Sizes
94
- .rootSizeSmall {
94
+ .isRootSizeSmall {
95
95
  @include box-field-sizes.size(small);
96
96
  }
97
97
 
98
- .rootSizeMedium {
98
+ .isRootSizeMedium {
99
99
  @include box-field-sizes.size(medium);
100
100
  }
101
101
 
102
- .rootSizeLarge {
102
+ .isRootSizeLarge {
103
103
  @include box-field-sizes.size(large);
104
104
  }
@@ -40,7 +40,7 @@ And use it:
40
40
  name: 'name',
41
41
  },
42
42
  {
43
- format: (row) => row.dateOfBirth.toLocaleDateString('en-GB'),
43
+ format: (date) => date.toLocaleDateString('en-GB'),
44
44
  label: 'Date of birth',
45
45
  name: 'dateOfBirth',
46
46
  },
@@ -99,21 +99,21 @@ The easiest way to make tables responsive is to wrap them with the
99
99
  name: 'id',
100
100
  },
101
101
  {
102
- format: (row) => (
103
- <span style={{ whiteSpace: 'nowrap' }}>{row.name}</span>
102
+ format: (name) => (
103
+ <span style={{ whiteSpace: 'nowrap' }}>{name}</span>
104
104
  ),
105
105
  label: 'Name',
106
106
  name: 'name',
107
107
  },
108
108
  {
109
- format: (row) => (
110
- <span style={{ whiteSpace: 'nowrap' }}>{row.note}</span>
109
+ format: (note) => (
110
+ <span style={{ whiteSpace: 'nowrap' }}>{note}</span>
111
111
  ),
112
112
  label: 'Note',
113
113
  name: 'note',
114
114
  },
115
115
  {
116
- format: (row) => row.dateOfBirth.toLocaleDateString('en-GB'),
116
+ format: (date) => date.toLocaleDateString('en-GB'),
117
117
  label: 'Date of birth',
118
118
  name: 'dateOfBirth',
119
119
  },
@@ -230,7 +230,7 @@ The following is an example of custom sorting function executed on the client.
230
230
  name: 'name',
231
231
  },
232
232
  {
233
- format: (row) => row.dateOfBirth.toISOString(),
233
+ format: (date) => date.toISOString(),
234
234
  isSortable: true,
235
235
  label: 'Date of birth',
236
236
  name: 'dateOfBirth',
@@ -256,6 +256,20 @@ The following is an example of custom sorting function executed on the client.
256
256
  }}
257
257
  </Playground>
258
258
 
259
+ ## Forwarding HTML Attributes
260
+
261
+ In addition to the options below in the [component's API](#api) section, you
262
+ can specify [React synthetic events] or **any HTML attribute you like.** All
263
+ attributes that don't interfere with the API are forwarded to the `<table>` HTML
264
+ element. This enables making the component interactive and helps to improve its
265
+ accessibility.
266
+
267
+ 👉 Refer to the MDN reference for the full list of supported attributes of the
268
+ [table] element.
269
+
259
270
  ## API
260
271
 
261
272
  <Props table of={Table} />
273
+
274
+ [React synthetic events]: https://reactjs.org/docs/events.html
275
+ [table]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/table#attributes