Skip to content

Commit 6940731

Browse files
dacerondrejadamkudrna
authored andcommitted
Make transferProps available to users (#524)
1 parent 698101c commit 6940731

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+203
-142
lines changed

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ nav:
131131
- Typography: 'docs/css-helpers/typography.md'
132132
- JS Helpers:
133133
- Classnames: 'docs/js-helpers/classnames.md'
134+
- Transferring Props: 'docs/js-helpers/transferProps.md'
134135
- Guides:
135136
- Customize:
136137
- Theming:

src/components/Alert/Alert.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import {
44
RUIContext,
55
withGlobalProps,
66
} from '../../provider';
7-
import { transferProps } from '../_helpers/transferProps';
87
import { classNames } from '../../utils/classNames';
8+
import { transferProps } from '../../utils/transferProps';
99
import { getRootColorClassName } from '../_helpers/getRootColorClassName';
1010
import styles from './Alert.module.scss';
1111

src/components/Alert/README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,11 @@ React.createElement(() => {
171171
## Forwarding HTML Attributes
172172

173173
In addition to the options below in the [component's API](#api) section, you
174-
can specify **any HTML attribute you like.** All attributes that don't interfere
175-
with the API of the React component are forwarded to the root `<div>` HTML
176-
element. This enables making the component interactive and helps to improve
177-
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+
root `<div>` HTML element. This enables making the component interactive and
178+
helps to improve its accessibility.
178179

179180
👉 For the full list of supported attributes refer to:
180181

src/components/Badge/Badge.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import PropTypes from 'prop-types';
22
import React from 'react';
33
import { withGlobalProps } from '../../provider';
4-
import { transferProps } from '../_helpers/transferProps';
54
import { classNames } from '../../utils/classNames';
5+
import { transferProps } from '../../utils/transferProps';
66
import { getRootColorClassName } from '../_helpers/getRootColorClassName';
77
import styles from './Badge.module.scss';
88

src/components/Badge/README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,11 @@ Medium-emphasis priority to provide additional context in an unobtrusive way.
8787
## Forwarding HTML Attributes
8888

8989
In addition to the options below in the [component's API](#api) section, you
90-
can specify **any HTML attribute you like.** All attributes that don't interfere
91-
with the API of the React component are forwarded to the root `<div>` HTML
92-
element. This enables making the component interactive and helps to improve
93-
its accessibility.
90+
can specify **any HTML attribute you like.** All attributes that don't
91+
interfere with the API of the React component and that aren't filtered out by
92+
[`transferProps`](/docs/js-helpers/transferProps) helper are forwarded to the
93+
root `<div>` HTML element. This enables making the component interactive and
94+
helps to improve its accessibility.
9495

9596
👉 For the full list of supported attributes refer to:
9697

src/components/Button/Button.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import PropTypes from 'prop-types';
22
import React, { useContext } from 'react';
33
import { withGlobalProps } from '../../provider';
44
import { classNames } from '../../utils/classNames';
5+
import { transferProps } from '../../utils/transferProps';
56
import { getRootColorClassName } from '../_helpers/getRootColorClassName';
67
import { getRootSizeClassName } from '../_helpers/getRootSizeClassName';
78
import { resolveContextOrProp } from '../_helpers/resolveContextOrProp';
8-
import { transferProps } from '../_helpers/transferProps';
99
import { ButtonGroupContext } from '../ButtonGroup';
1010
import { InputGroupContext } from '../InputGroup/InputGroupContext';
1111
import getRootPriorityClassName from '../_helpers/getRootPriorityClassName';

src/components/Button/README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -389,10 +389,11 @@ animation is made.
389389
## Forwarding HTML Attributes
390390

391391
In addition to the options below in the [component's API](#api) section, you
392-
can specify **any HTML attribute you like.** All attributes that don't interfere
393-
with the API of the React component are forwarded to the root `<button>` HTML
394-
element. This enables making the component interactive and helps to improve
395-
its accessibility.
392+
can specify **any HTML attribute you like.** All attributes that don't
393+
interfere with the API of the React component and that aren't filtered out by
394+
[`transferProps`](/docs/js-helpers/transferProps) helper are forwarded to the
395+
root `<button>` HTML element. This enables making the component interactive and
396+
helps to improve its accessibility.
396397

397398
👉 For the full list of supported attributes refer to:
398399

src/components/ButtonGroup/ButtonGroup.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import React, {
44
} from 'react';
55
import { withGlobalProps } from '../../provider';
66
import { classNames } from '../../utils/classNames';
7+
import { transferProps } from '../../utils/transferProps';
78
import getRootPriorityClassName from '../_helpers/getRootPriorityClassName';
89
import { isChildrenEmpty } from '../_helpers/isChildrenEmpty';
9-
import { transferProps } from '../_helpers/transferProps';
1010
import styles from './ButtonGroup.module.scss';
1111
import { ButtonGroupContext } from './ButtonGroupContext';
1212

src/components/ButtonGroup/README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,10 +249,11 @@ and communicating the state of individual options.
249249
## Forwarding HTML Attributes
250250

251251
In addition to the options below in the [component's API](#api) section, you
252-
can specify **any HTML attribute you like.** All attributes that don't interfere
253-
with the API of the React component are forwarded to the root `<div>` HTML
254-
element. This enables making the component interactive and helps to improve
255-
its accessibility.
252+
can specify **any HTML attribute you like.** All attributes that don't
253+
interfere with the API of the React component and that aren't filtered out by
254+
[`transferProps`](/docs/js-helpers/transferProps) helper are forwarded to the
255+
root `<div>` HTML element. This enables making the component interactive and
256+
helps to improve its accessibility.
256257

257258
👉 For the full list of supported attributes refer to:
258259

src/components/Card/Card.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import PropTypes from 'prop-types';
22
import React from 'react';
33
import { withGlobalProps } from '../../provider';
4-
import { transferProps } from '../_helpers/transferProps';
54
import { classNames } from '../../utils/classNames';
5+
import { transferProps } from '../../utils/transferProps';
66
import { getRootColorClassName } from '../_helpers/getRootColorClassName';
77
import styles from './Card.module.scss';
88

0 commit comments

Comments
 (0)