@react-ui-org/react-ui 0.55.1 → 0.56.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. package/.nvmrc +1 -1
  2. package/dist/react-ui.css +16 -21
  3. package/dist/react-ui.development.css +18 -37
  4. package/dist/react-ui.development.js +101 -91
  5. package/dist/react-ui.js +1 -1
  6. package/package.json +41 -39
  7. package/src/components/Alert/Alert.jsx +1 -1
  8. package/src/components/Alert/README.md +5 -4
  9. package/src/components/Badge/Badge.jsx +1 -1
  10. package/src/components/Badge/README.md +5 -4
  11. package/src/components/Button/Button.jsx +1 -1
  12. package/src/components/Button/README.md +20 -18
  13. package/src/components/Button/_base.scss +1 -4
  14. package/src/components/ButtonGroup/ButtonGroup.jsx +1 -1
  15. package/src/components/ButtonGroup/README.md +5 -4
  16. package/src/components/Card/Card.jsx +1 -1
  17. package/src/components/Card/CardBody.jsx +1 -1
  18. package/src/components/Card/CardFooter.jsx +1 -1
  19. package/src/components/Card/README.md +5 -4
  20. package/src/components/CheckboxField/CheckboxField.jsx +2 -2
  21. package/src/components/CheckboxField/README.md +8 -4
  22. package/src/components/FileInputField/FileInputField.jsx +3 -3
  23. package/src/components/FileInputField/README.md +8 -4
  24. package/src/components/FormLayout/FormLayout.jsx +1 -1
  25. package/src/components/FormLayout/FormLayoutCustomField.jsx +1 -1
  26. package/src/components/FormLayout/README.md +5 -4
  27. package/src/components/Grid/Grid.jsx +1 -1
  28. package/src/components/Grid/Grid.module.scss +2 -4
  29. package/src/components/Grid/GridSpan.jsx +1 -1
  30. package/src/components/Grid/README.md +6 -4
  31. package/src/components/Grid/_settings.scss +2 -2
  32. package/src/components/InputGroup/InputGroup.jsx +2 -2
  33. package/src/components/InputGroup/README.md +5 -4
  34. package/src/components/Modal/Modal.jsx +1 -1
  35. package/src/components/Modal/Modal.module.scss +1 -1
  36. package/src/components/Modal/ModalBody.jsx +1 -1
  37. package/src/components/Modal/ModalCloseButton.jsx +1 -1
  38. package/src/components/Modal/ModalContent.jsx +1 -1
  39. package/src/components/Modal/ModalFooter.jsx +1 -1
  40. package/src/components/Modal/ModalHeader.jsx +2 -4
  41. package/src/components/Modal/ModalTitle.jsx +2 -4
  42. package/src/components/Modal/README.md +3 -2
  43. package/src/components/Paper/Paper.jsx +1 -1
  44. package/src/components/Paper/README.md +5 -4
  45. package/src/components/Popover/Popover.jsx +1 -1
  46. package/src/components/Popover/PopoverWrapper.jsx +1 -1
  47. package/src/components/Popover/README.md +5 -4
  48. package/src/components/Radio/README.md +8 -4
  49. package/src/components/Radio/Radio.jsx +2 -2
  50. package/src/components/ScrollView/README.md +5 -4
  51. package/src/components/ScrollView/ScrollView.jsx +1 -1
  52. package/src/components/ScrollView/ScrollView.module.scss +2 -4
  53. package/src/components/SelectField/README.md +8 -4
  54. package/src/components/SelectField/SelectField.jsx +2 -2
  55. package/src/components/Table/README.md +5 -4
  56. package/src/components/Table/Table.jsx +1 -1
  57. package/src/components/Tabs/README.md +3 -2
  58. package/src/components/Tabs/Tabs.jsx +1 -1
  59. package/src/components/Tabs/TabsItem.jsx +1 -1
  60. package/src/components/Text/README.md +3 -2
  61. package/src/components/Text/Text.jsx +1 -1
  62. package/src/components/TextArea/README.md +8 -4
  63. package/src/components/TextArea/TextArea.jsx +2 -2
  64. package/src/components/TextField/README.md +8 -4
  65. package/src/components/TextField/TextField.jsx +2 -2
  66. package/src/components/TextLink/README.md +5 -4
  67. package/src/components/TextLink/TextLink.jsx +1 -1
  68. package/src/components/Toggle/README.md +8 -4
  69. package/src/components/Toggle/Toggle.jsx +2 -2
  70. package/src/components/Toolbar/README.md +5 -4
  71. package/src/components/Toolbar/Toolbar.jsx +1 -1
  72. package/src/components/Toolbar/ToolbarGroup.jsx +1 -1
  73. package/src/components/Toolbar/ToolbarItem.jsx +1 -1
  74. package/src/index.js +1 -0
  75. package/src/provider/RUIProvider.jsx +6 -3
  76. package/src/styles/tools/form-fields/_box-field-layout.scss +1 -2
  77. package/src/styles/tools/form-fields/_inline-field-layout.scss +1 -0
  78. package/src/utils/mergeDeep.js +28 -0
  79. package/src/{components/_helpers → utils}/transferProps.js +0 -8
@@ -1,8 +1,8 @@
1
1
  import PropTypes from 'prop-types';
2
2
  import React from 'react';
3
3
  import { withGlobalProps } from '../../provider';
4
- import { transferProps } from '../_helpers/transferProps';
5
4
  import { classNames } from '../../utils/classNames';
5
+ import { transferProps } from '../../utils/transferProps';
6
6
  import { isChildrenEmpty } from '../_helpers/isChildrenEmpty';
7
7
  import { getScrollingClassName } from './_helpers/getScrollingClassName';
8
8
  import styles from './ModalBody.module.scss';
@@ -4,7 +4,7 @@ import {
4
4
  RUIContext,
5
5
  withGlobalProps,
6
6
  } from '../../provider';
7
- import { transferProps } from '../_helpers/transferProps';
7
+ import { transferProps } from '../../utils/transferProps';
8
8
  import styles from './ModalCloseButton.module.scss';
9
9
 
10
10
  export const ModalCloseButton = React.forwardRef((props, ref) => {
@@ -1,8 +1,8 @@
1
1
  import PropTypes from 'prop-types';
2
2
  import React from 'react';
3
3
  import { withGlobalProps } from '../../provider';
4
+ import { transferProps } from '../../utils/transferProps';
4
5
  import { isChildrenEmpty } from '../_helpers/isChildrenEmpty';
5
- import { transferProps } from '../_helpers/transferProps';
6
6
  import styles from './ModalContent.module.scss';
7
7
 
8
8
  export const ModalContent = ({
@@ -1,8 +1,8 @@
1
1
  import PropTypes from 'prop-types';
2
2
  import React from 'react';
3
3
  import { withGlobalProps } from '../../provider';
4
- import { transferProps } from '../_helpers/transferProps';
5
4
  import { classNames } from '../../utils/classNames';
5
+ import { transferProps } from '../../utils/transferProps';
6
6
  import { getJustifyClassName } from './_helpers/getJustifyClassName';
7
7
  import styles from './ModalFooter.module.scss';
8
8
 
@@ -1,10 +1,8 @@
1
1
  import PropTypes from 'prop-types';
2
2
  import React from 'react';
3
- import {
4
- withGlobalProps,
5
- } from '../../provider';
6
- import { transferProps } from '../_helpers/transferProps';
3
+ import { withGlobalProps } from '../../provider';
7
4
  import { classNames } from '../../utils/classNames';
5
+ import { transferProps } from '../../utils/transferProps';
8
6
  import { getJustifyClassName } from './_helpers/getJustifyClassName';
9
7
  import styles from './ModalHeader.module.scss';
10
8
 
@@ -1,9 +1,7 @@
1
1
  import PropTypes from 'prop-types';
2
2
  import React from 'react';
3
- import {
4
- withGlobalProps,
5
- } from '../../provider';
6
- import { transferProps } from '../_helpers/transferProps';
3
+ import { withGlobalProps } from '../../provider';
4
+ import { transferProps } from '../../utils/transferProps';
7
5
  import styles from './ModalTitle.module.scss';
8
6
 
9
7
  export const ModalTitle = ({
@@ -1015,8 +1015,9 @@ opened.
1015
1015
  ## Forwarding HTML Attributes
1016
1016
 
1017
1017
  In addition to the options below in the [component's API](#api) section, you
1018
- can specify **any HTML attribute you like.** All attributes that don't interfere
1019
- with the API of the React component are forwarded to:
1018
+ can specify **any HTML attribute you like.** All attributes that don't
1019
+ interfere with the API of the React component and that aren't filtered out by
1020
+ [`transferProps`](/docs/js-helpers/transferProps) helper are forwarded to:
1020
1021
 
1021
1022
  - the `<div>` HTML element in case of the `Modal` component. This `<div>` is not
1022
1023
  the root, but its first child which represents the modal window.
@@ -2,7 +2,7 @@ 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
+ import { transferProps } from '../../utils/transferProps';
6
6
  import styles from './Paper.module.scss';
7
7
 
8
8
  export const Paper = ({
@@ -54,10 +54,11 @@ Dim background and add transparency to visually suppress the Paper.
54
54
  ## Forwarding HTML Attributes
55
55
 
56
56
  In addition to the options below in the [component's API](#api) section, you
57
- can specify **any HTML attribute you like.** All attributes that don't interfere
58
- with the API of the React component are forwarded to the root `<div>` HTML
59
- element. This enables making the component interactive and helps to improve
60
- its accessibility.
57
+ can specify **any HTML attribute you like.** All attributes that don't
58
+ interfere with the API of the React component and that aren't filtered out by
59
+ [`transferProps`](/docs/js-helpers/transferProps) helper are forwarded to the
60
+ root `<div>` HTML element. This enables making the component interactive and
61
+ helps to improve its accessibility.
61
62
 
62
63
  👉 For the full list of supported attributes refer to:
63
64
 
@@ -3,7 +3,7 @@ import React from 'react';
3
3
  import { createPortal } from 'react-dom';
4
4
  import { withGlobalProps } from '../../provider';
5
5
  import { classNames } from '../../utils/classNames';
6
- import { transferProps } from '../_helpers/transferProps';
6
+ import { transferProps } from '../../utils/transferProps';
7
7
  import getRootSideClassName from './_helpers/getRootSideClassName';
8
8
  import getRootAlignmentClassName from './_helpers/getRootAlignmentClassName';
9
9
  import styles from './Popover.module.scss';
@@ -1,7 +1,7 @@
1
1
  import PropTypes from 'prop-types';
2
2
  import React from 'react';
3
3
  import { withGlobalProps } from '../../provider';
4
- import { transferProps } from '../_helpers/transferProps';
4
+ import { transferProps } from '../../utils/transferProps';
5
5
  import styles from './PopoverWrapper.module.scss';
6
6
 
7
7
  export const PopoverWrapper = ({
@@ -287,10 +287,11 @@ React.createElement(() => {
287
287
  ## Forwarding HTML Attributes
288
288
 
289
289
  In addition to the options below in the [component's API](#api) section, you
290
- can specify **any HTML attribute you like.** All attributes that don't interfere
291
- with the API of the React component are forwarded to the root `<div>` HTML
292
- element. This enables making the component interactive and helps to improve
293
- its accessibility.
290
+ can specify **any HTML attribute you like.** All attributes that don't
291
+ interfere with the API of the React component and that aren't filtered out by
292
+ [`transferProps`](/docs/js-helpers/transferProps) helper are forwarded to the
293
+ root `<div>` HTML element. This enables making the component interactive and
294
+ helps to improve its accessibility.
294
295
 
295
296
  👉 For the full list of supported attributes refer to:
296
297
 
@@ -56,6 +56,9 @@ See [API](#api) for all available options.
56
56
  polite phrases like _Please select your favourite fruit_. Short labels will
57
57
  help your users accomplish their task faster.
58
58
 
59
+ - **Use text labels** unless it is necessary to wrap text label into
60
+ Popover-like to component to provide additional info about the field.
61
+
59
62
  - Only make the Radio's label invisible when there is **another visual
60
63
  clue** to guide users through filling the input.
61
64
 
@@ -279,10 +282,11 @@ It's possible to disable just some options or the whole set.
279
282
  ## Forwarding HTML Attributes
280
283
 
281
284
  In addition to the options below in the [component's API](#api) section, you
282
- can specify **any HTML attribute you like.** All attributes that don't interfere
283
- with the API of the React component are forwarded to the root `<input>` HTML
284
- element. This enables making the component interactive and helps to improve
285
- its accessibility.
285
+ can specify **any HTML attribute you like.** All attributes that don't
286
+ interfere with the API of the React component and that aren't filtered out by
287
+ [`transferProps`](/docs/js-helpers/transferProps) helper are forwarded to the
288
+ `<input>` HTML element. This enables making the component interactive and helps
289
+ to improve its accessibility.
286
290
 
287
291
  👉 For the full list of supported attributes refer to:
288
292
 
@@ -2,9 +2,9 @@ import PropTypes from 'prop-types';
2
2
  import React, { useContext } from 'react';
3
3
  import { withGlobalProps } from '../../provider';
4
4
  import { classNames } from '../../utils/classNames';
5
+ import { transferProps } from '../../utils/transferProps';
5
6
  import { getRootValidationStateClassName } from '../_helpers/getRootValidationStateClassName';
6
7
  import { resolveContextOrProp } from '../_helpers/resolveContextOrProp';
7
- import { transferProps } from '../_helpers/transferProps';
8
8
  import { FormLayoutContext } from '../FormLayout';
9
9
  import styles from './Radio.module.scss';
10
10
 
@@ -157,7 +157,7 @@ Radio.propTypes = {
157
157
  /**
158
158
  * Label of the group of options.
159
159
  */
160
- label: PropTypes.string.isRequired,
160
+ label: PropTypes.node.isRequired,
161
161
  /**
162
162
  * Layout of the field.
163
163
  *
@@ -480,10 +480,11 @@ 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 **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.
483
+ can specify **any HTML attribute you like.** All attributes that don't
484
+ interfere with the API of the React component and that aren't filtered out by
485
+ [`transferProps`](/docs/js-helpers/transferProps) helper are forwarded to the
486
+ root `<div>` HTML element. This enables making the component interactive and
487
+ helps to improve its accessibility.
487
488
 
488
489
  👉 For the full list of supported attributes refer to:
489
490
 
@@ -11,7 +11,7 @@ import {
11
11
  withGlobalProps,
12
12
  } from '../../provider';
13
13
  import { classNames } from '../../utils/classNames';
14
- import { transferProps } from '../_helpers/transferProps';
14
+ import { transferProps } from '../../utils/transferProps';
15
15
  import { getElementsPositionDifference } from './_helpers/getElementsPositionDifference';
16
16
  import { useLoadResize } from './_hooks/useLoadResizeHook';
17
17
  import { useScrollPosition } from './_hooks/useScrollPositionHook';
@@ -103,8 +103,7 @@ $_arrow-outer-spacing: spacing.of(4);
103
103
 
104
104
  .isRootVertical .viewport {
105
105
  height: 100%;
106
- overflow-x: clip; // 7., 8.
107
- overflow-y: auto; // 2.
106
+ overflow: clip auto; // 7., 8. / 2.
108
107
  }
109
108
 
110
109
  .isRootVertical .arrowPrev {
@@ -183,8 +182,7 @@ $_arrow-outer-spacing: spacing.of(4);
183
182
  }
184
183
 
185
184
  .isRootHorizontal .viewport {
186
- overflow-x: auto; // 2.
187
- overflow-y: clip; // 5., 7., 8.
185
+ overflow: auto clip; // 2. / 5., 7., 8.
188
186
  }
189
187
 
190
188
  .isRootHorizontal .content {
@@ -56,6 +56,9 @@ See [API](#api) for all available options.
56
56
  polite phrases like _Please select your favourite fruit_. Short labels will
57
57
  help your users accomplish their task faster.
58
58
 
59
+ - **Use text labels** unless it is necessary to wrap text label into
60
+ Popover-like to component to provide additional info about the field.
61
+
59
62
  - Only make the SelectField's label invisible when there is **another visual
60
63
  clue** to guide users through filling the input. Using the first option as
61
64
  label is not recommended either — it disappears once user makes their choice.
@@ -649,10 +652,11 @@ React.createElement(() => {
649
652
  ## Forwarding HTML Attributes
650
653
 
651
654
  In addition to the options below in the [component's API](#api) section, you
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.
655
+ can specify **any HTML attribute you like.** All attributes that don't
656
+ interfere with the API of the React component and that aren't filtered out by
657
+ [`transferProps`](/docs/js-helpers/transferProps) helper are forwarded to the
658
+ `<select>` HTML element. This enables making the component interactive and
659
+ helps to improve its accessibility.
656
660
 
657
661
  👉 For the full list of supported attributes refer to:
658
662
 
@@ -2,10 +2,10 @@ import PropTypes from 'prop-types';
2
2
  import React, { useContext } from 'react';
3
3
  import { withGlobalProps } from '../../provider';
4
4
  import { classNames } from '../../utils/classNames';
5
+ import { transferProps } from '../../utils/transferProps';
5
6
  import { getRootSizeClassName } from '../_helpers/getRootSizeClassName';
6
7
  import { getRootValidationStateClassName } from '../_helpers/getRootValidationStateClassName';
7
8
  import { resolveContextOrProp } from '../_helpers/resolveContextOrProp';
8
- 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';
@@ -182,7 +182,7 @@ SelectField.propTypes = {
182
182
  /**
183
183
  * Select field label.
184
184
  */
185
- label: PropTypes.string.isRequired,
185
+ label: PropTypes.node.isRequired,
186
186
  /**
187
187
  * Layout of the field.
188
188
  *
@@ -243,10 +243,11 @@ 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 **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.
246
+ can specify **any HTML attribute you like.** All attributes that don't
247
+ interfere with the API of the React component and that aren't filtered out by
248
+ [`transferProps`](/docs/js-helpers/transferProps) helper are forwarded to the
249
+ root `<table>` HTML element. This enables making the component interactive and
250
+ helps to improve its accessibility.
250
251
 
251
252
  👉 For the full list of supported attributes refer to:
252
253
 
@@ -1,7 +1,7 @@
1
1
  import PropTypes from 'prop-types';
2
2
  import React from 'react';
3
3
  import { withGlobalProps } from '../../provider';
4
- import { transferProps } from '../_helpers/transferProps';
4
+ import { transferProps } from '../../utils/transferProps';
5
5
  import { TableHeaderCell } from './_components/TableHeaderCell';
6
6
  import { TableBodyCell } from './_components/TableBodyCell';
7
7
  import styles from './Table.module.scss';
@@ -157,8 +157,9 @@ 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 **any HTML attribute you like.** All attributes that don't interfere
161
- with the API of the React component are forwarded to:
160
+ can specify **any HTML attribute you like.** All attributes that don't
161
+ interfere with the API of the React component and that aren't filtered out by
162
+ [`transferProps`](/docs/js-helpers/transferProps) helper are forwarded to:
162
163
 
163
164
  - the root `<nav>` HTML element in case of `Tabs` component
164
165
  - the `<a>` HTML element in case of `TabsItem`
@@ -1,7 +1,7 @@
1
1
  import PropTypes from 'prop-types';
2
2
  import React from 'react';
3
3
  import { withGlobalProps } from '../../provider';
4
- import { transferProps } from '../_helpers/transferProps';
4
+ import { transferProps } from '../../utils/transferProps';
5
5
  import styles from './Tabs.module.scss';
6
6
 
7
7
  export const Tabs = ({
@@ -1,8 +1,8 @@
1
1
  import PropTypes from 'prop-types';
2
2
  import React from 'react';
3
3
  import { withGlobalProps } from '../../provider';
4
- import { transferProps } from '../_helpers/transferProps';
5
4
  import { classNames } from '../../utils/classNames';
5
+ import { transferProps } from '../../utils/transferProps';
6
6
  import styles from './TabsItem.module.scss';
7
7
 
8
8
  export const TabsItem = ({
@@ -202,8 +202,9 @@ React.createElement(() => {
202
202
  ## Forwarding HTML Attributes
203
203
 
204
204
  In addition to the options below in the [component's API](#api) section, you
205
- can specify **any HTML attribute you like.** All attributes that don't interfere
206
- with the API of the React component are forwarded to the root:
205
+ can specify **any HTML attribute you like.** All attributes that don't
206
+ interfere with the API of the React component and that aren't filtered out by
207
+ [`transferProps`](/docs/js-helpers/transferProps) helper are forwarded to:
207
208
 
208
209
  - `<span>` HTML element in case that `blockLevel` is set to `false`
209
210
  - `<div>` HTML element in case that `blockLevel` is set to `true`
@@ -1,8 +1,8 @@
1
1
  import PropTypes from 'prop-types';
2
2
  import React from 'react';
3
3
  import { withGlobalProps } from '../../provider';
4
- import { transferProps } from '../_helpers/transferProps';
5
4
  import { classNames } from '../../utils/classNames';
5
+ import { transferProps } from '../../utils/transferProps';
6
6
  import { isChildrenEmpty } from '../_helpers/isChildrenEmpty';
7
7
  import { getRootClampClassName } from './_helpers/getRootClampClassName';
8
8
  import { getRootHyphensClassName } from './_helpers/getRootHyphensClassName';
@@ -24,6 +24,9 @@ See [API](#api) for all available options.
24
24
  polite phrases like _Please enter your message_. Short labels will help your
25
25
  users accomplish their task faster.
26
26
 
27
+ - **Use text labels** unless it is necessary to wrap text label into
28
+ Popover-like to component to provide additional info about the field.
29
+
27
30
  - Only make the TextArea's label invisible when there is **another visual
28
31
  clue** to guide users through filling the input. Using the first option as
29
32
  label is not recommended either — it disappears once user makes their choice.
@@ -317,10 +320,11 @@ It's possible to disable the whole input.
317
320
  ## Forwarding HTML Attributes
318
321
 
319
322
  In addition to the options below in the [component's API](#api) section, you
320
- can specify **any HTML attribute you like.** All attributes that don't interfere
321
- with the API of the React component are forwarded to the root `<textarea>` HTML
322
- element. This enables making the component interactive and helps to improve
323
- its accessibility.
323
+ can specify **any HTML attribute you like.** All attributes that don't
324
+ interfere with the API of the React component and that aren't filtered out by
325
+ [`transferProps`](/docs/js-helpers/transferProps) helper are forwarded to the
326
+ `<textarea>` HTML element. This enables making the component interactive and
327
+ helps to improve its accessibility.
324
328
 
325
329
  ```docoff-react-preview
326
330
  <TextArea
@@ -2,10 +2,10 @@ import PropTypes from 'prop-types';
2
2
  import React, { useContext } from 'react';
3
3
  import { withGlobalProps } from '../../provider';
4
4
  import { classNames } from '../../utils/classNames';
5
+ import { transferProps } from '../../utils/transferProps';
5
6
  import { getRootSizeClassName } from '../_helpers/getRootSizeClassName';
6
7
  import { getRootValidationStateClassName } from '../_helpers/getRootValidationStateClassName';
7
8
  import { resolveContextOrProp } from '../_helpers/resolveContextOrProp';
8
- import { transferProps } from '../_helpers/transferProps';
9
9
  import { FormLayoutContext } from '../FormLayout';
10
10
  import styles from './TextArea.module.scss';
11
11
 
@@ -132,7 +132,7 @@ TextArea.propTypes = {
132
132
  /**
133
133
  * Text field label.
134
134
  */
135
- label: PropTypes.string.isRequired,
135
+ label: PropTypes.node.isRequired,
136
136
  /**
137
137
  * Layout of the field.
138
138
  *
@@ -36,6 +36,9 @@ See [API](#api) for all available options.
36
36
  polite phrases like _Please enter your first name_. Short labels will help
37
37
  your users accomplish their task faster.
38
38
 
39
+ - **Use text labels** unless it is necessary to wrap text label into
40
+ Popover-like to component to provide additional info about the field.
41
+
39
42
  - Only make the TextField's label invisible when there is **another visual
40
43
  clue** to guide users through filling the input.
41
44
 
@@ -445,10 +448,11 @@ It's possible to disable the whole input.
445
448
  ## Forwarding HTML Attributes
446
449
 
447
450
  In addition to the options below in the [component's API](#api) section, you
448
- can specify **any HTML attribute you like.** All attributes that don't interfere
449
- with the API of the React component are forwarded to the root `<input>` HTML
450
- element. This enables making the component interactive and helps to improve
451
- its accessibility.
451
+ can specify **any HTML attribute you like.** All attributes that don't
452
+ interfere with the API of the React component and that aren't filtered out by
453
+ [`transferProps`](/docs/js-helpers/transferProps) helper are forwarded to the
454
+ `<input>` HTML element. This enables making the component interactive and helps
455
+ to improve its accessibility.
452
456
 
453
457
  ```docoff-react-preview
454
458
  <TextField
@@ -2,10 +2,10 @@ import PropTypes from 'prop-types';
2
2
  import React, { useContext } from 'react';
3
3
  import { withGlobalProps } from '../../provider';
4
4
  import { classNames } from '../../utils/classNames';
5
+ import { transferProps } from '../../utils/transferProps';
5
6
  import { getRootSizeClassName } from '../_helpers/getRootSizeClassName';
6
7
  import { getRootValidationStateClassName } from '../_helpers/getRootValidationStateClassName';
7
8
  import { resolveContextOrProp } from '../_helpers/resolveContextOrProp';
8
- import { transferProps } from '../_helpers/transferProps';
9
9
  import { FormLayoutContext } from '../FormLayout';
10
10
  import { InputGroupContext } from '../InputGroup/InputGroupContext';
11
11
  import styles from './TextField.module.scss';
@@ -156,7 +156,7 @@ TextField.propTypes = {
156
156
  /**
157
157
  * Text field label.
158
158
  */
159
- label: PropTypes.string.isRequired,
159
+ label: PropTypes.node.isRequired,
160
160
  /**
161
161
  * Layout of the field.
162
162
  *
@@ -47,10 +47,11 @@ It's common to use custom function for routing within SPAs. Use the
47
47
  ## Forwarding HTML Attributes
48
48
 
49
49
  In addition to the options below in the [component's API](#api) section, you
50
- can specify **any HTML attribute you like.** All attributes that don't interfere
51
- with the API of the React component are forwarded to the root `<a>` HTML
52
- element. This enables making the component interactive and helps to improve
53
- its accessibility.
50
+ can specify **any HTML attribute you like.** All attributes that don't
51
+ interfere with the API of the React component and that aren't filtered out by
52
+ [`transferProps`](/docs/js-helpers/transferProps) helper are forwarded to the
53
+ root `<a>` HTML element. This enables making the component interactive and
54
+ helps to improve its accessibility.
54
55
 
55
56
  👉 For the full list of supported attributes refer to:
56
57
 
@@ -1,7 +1,7 @@
1
1
  import PropTypes from 'prop-types';
2
2
  import React from 'react';
3
3
  import { withGlobalProps } from '../../provider';
4
- import { transferProps } from '../_helpers/transferProps';
4
+ import { transferProps } from '../../utils/transferProps';
5
5
  import styles from './TextLink.module.scss';
6
6
 
7
7
  export const TextLink = ({
@@ -39,6 +39,9 @@ See [API](#api) for all available options.
39
39
  me any emails” which would mean that the user needs to turn the toggle **on**
40
40
  in order for something **not** to happen.
41
41
 
42
+ - **Use text labels** unless it is necessary to wrap text label into
43
+ Popover-like to component to provide additional info about the field.
44
+
42
45
  - Only make the Toggle's label invisible when there is **another visual clue**
43
46
  to guide users through using the input.
44
47
 
@@ -168,10 +171,11 @@ Disabled state makes the input unavailable.
168
171
  ## Forwarding HTML Attributes
169
172
 
170
173
  In addition to the options below in the [component's API](#api) section, you
171
- can specify **any HTML attribute you like.** All attributes that don't interfere
172
- with the API of the React component are forwarded to the root `<input>` HTML
173
- element. This enables making the component interactive and helps to improve
174
- its accessibility.
174
+ can specify **any HTML attribute you like.** All attributes that don't
175
+ interfere with the API of the React component and that aren't filtered out by
176
+ [`transferProps`](/docs/js-helpers/transferProps) helper are forwarded to the
177
+ `<input>` HTML element. This enables making the component interactive and helps
178
+ to improve its accessibility.
175
179
 
176
180
  👉 For the full list of supported attributes refer to:
177
181
 
@@ -2,8 +2,8 @@ import PropTypes from 'prop-types';
2
2
  import React, { useContext } from 'react';
3
3
  import { withGlobalProps } from '../../provider';
4
4
  import { classNames } from '../../utils/classNames';
5
+ import { transferProps } from '../../utils/transferProps';
5
6
  import { getRootValidationStateClassName } from '../_helpers/getRootValidationStateClassName';
6
- import { transferProps } from '../_helpers/transferProps';
7
7
  import { FormLayoutContext } from '../FormLayout';
8
8
  import styles from './Toggle.module.scss';
9
9
 
@@ -114,7 +114,7 @@ Toggle.propTypes = {
114
114
  /**
115
115
  * Toggle label.
116
116
  */
117
- label: PropTypes.string.isRequired,
117
+ label: PropTypes.node.isRequired,
118
118
  /**
119
119
  * Placement of the label relative to the input.
120
120
  */
@@ -322,10 +322,11 @@ Or to build a classic media layout with image on the left and text on the right:
322
322
  ## Forwarding HTML Attributes
323
323
 
324
324
  In addition to the options below in the [component's API](#api) section, you
325
- can specify **any HTML attribute you like.** All attributes that don't interfere
326
- with the API of the React component are forwarded to the root `<div>` HTML
327
- element. This enables making the component interactive and helps to improve
328
- its accessibility.
325
+ can specify **any HTML attribute you like.** All attributes that don't
326
+ interfere with the API of the React component and that aren't filtered out by
327
+ [`transferProps`](/docs/js-helpers/transferProps) helper are forwarded to the
328
+ root `<div>` HTML element. This enables making the component interactive and
329
+ helps to improve its accessibility.
329
330
 
330
331
  👉 For the full list of supported attributes refer to:
331
332
 
@@ -1,8 +1,8 @@
1
1
  import PropTypes from 'prop-types';
2
2
  import React from 'react';
3
3
  import { withGlobalProps } from '../../provider';
4
- import { transferProps } from '../_helpers/transferProps';
5
4
  import { classNames } from '../../utils/classNames';
5
+ import { transferProps } from '../../utils/transferProps';
6
6
  import { isChildrenEmpty } from '../_helpers/isChildrenEmpty';
7
7
  import { getAlignClassName } from './_helpers/getAlignClassName';
8
8
  import { getJustifyClassName } from './_helpers/getJustifyClassName';
@@ -1,8 +1,8 @@
1
1
  import PropTypes from 'prop-types';
2
2
  import React from 'react';
3
3
  import { withGlobalProps } from '../../provider';
4
- import { transferProps } from '../_helpers/transferProps';
5
4
  import { classNames } from '../../utils/classNames';
5
+ import { transferProps } from '../../utils/transferProps';
6
6
  import { isChildrenEmpty } from '../_helpers/isChildrenEmpty';
7
7
  import { getAlignClassName } from './_helpers/getAlignClassName';
8
8
  import styles from './Toolbar.module.scss';
@@ -1,7 +1,7 @@
1
1
  import PropTypes from 'prop-types';
2
2
  import React from 'react';
3
- import { transferProps } from '../_helpers/transferProps';
4
3
  import { classNames } from '../../utils/classNames';
4
+ import { transferProps } from '../../utils/transferProps';
5
5
  import { withGlobalProps } from '../../provider';
6
6
  import { isChildrenEmpty } from '../_helpers/isChildrenEmpty';
7
7
  import styles from './Toolbar.module.scss';
package/src/index.js CHANGED
@@ -62,3 +62,4 @@ export { RUIProvider } from './provider';
62
62
 
63
63
  // Utils
64
64
  export { classNames } from './utils/classNames';
65
+ export { transferProps } from './utils/transferProps';