From ed1f7d52b2544c204e4802db72e543504e4d1da5 Mon Sep 17 00:00:00 2001 From: Joeyyy09 Date: Sat, 13 Apr 2024 17:52:22 +0530 Subject: [PATCH] Make transfer props available to users Signed-off-by: Joeyyy09 --- package-lock.json | 2 +- src/components/Alert/README.md | 5 ++- src/components/Badge/README.md | 5 ++- src/components/Button/README.md | 9 +++-- src/components/ButtonGroup/README.md | 5 ++- src/components/Card/README.md | 5 ++- src/components/CheckboxField/README.md | 9 +++-- src/components/FormLayout/README.md | 5 ++- src/components/Grid/README.md | 12 +++--- src/components/InputGroup/README.md | 9 +++-- src/components/Paper/README.md | 5 ++- src/components/Popover/README.md | 5 ++- src/components/Radio/README.md | 9 +++-- src/components/ScrollView/README.md | 6 ++- src/components/SelectField/README.md | 9 +++-- src/components/Table/README.md | 9 +++-- src/components/TextLink/README.md | 9 +++-- src/components/Toggle/README.md | 9 +++-- src/components/Toolbar/README.md | 5 ++- src/components/_helpers/transferProps.js | 2 + src/docs/js-helpers/classnames.md | 2 +- src/docs/js-helpers/transferProps.md | 23 +++++++++++ src/utils/transferProps.js | 51 ++++++++++++++++++++++++ 23 files changed, 169 insertions(+), 41 deletions(-) create mode 100644 src/docs/js-helpers/transferProps.md create mode 100644 src/utils/transferProps.js diff --git a/package-lock.json b/package-lock.json index 444f0a4b..0545bc6f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,7 +6,7 @@ "packages": { "": { "name": "@react-ui-org/react-ui", - "version": "0.54.0", + "version": "0.55.0", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/src/components/Alert/README.md b/src/components/Alert/README.md index 34d696f5..6996d410 100644 --- a/src/components/Alert/README.md +++ b/src/components/Alert/README.md @@ -176,11 +176,14 @@ with the API of the React component are forwarded to the root `
` HTML element. This enables making the component interactive and helps to improve its accessibility. -👉 For the full list of supported attributes refer to: +👉 For forwarding HTML attributes programmatically, you can use the `transferProps` function. For detailed usage examples, refer to the [TransferProps documentation](/src/docs/js-helpers/transferProps.md). + +For the full list of supported attributes, you can also refer to: - [`
` HTML element attributes][div-attributes]{:target="_blank"} - [React common props]{:target="_blank"} + ## API diff --git a/src/components/Badge/README.md b/src/components/Badge/README.md index 1598f285..b7a7c51c 100644 --- a/src/components/Badge/README.md +++ b/src/components/Badge/README.md @@ -92,11 +92,14 @@ with the API of the React component are forwarded to the root `
` HTML element. This enables making the component interactive and helps to improve its accessibility. -👉 For the full list of supported attributes refer to: +👉 For forwarding HTML attributes programmatically, you can use the `transferProps` function. For detailed usage examples, refer to the [TransferProps documentation](/src/docs/js-helpers/transferProps.md). + +For the full list of supported attributes, you can also refer to: - [`
` HTML element attributes][div-attributes]{:target="_blank"} - [React common props]{:target="_blank"} + ## API diff --git a/src/components/Button/README.md b/src/components/Button/README.md index 800d93b7..d999ae96 100644 --- a/src/components/Button/README.md +++ b/src/components/Button/README.md @@ -389,15 +389,18 @@ animation is made. In addition to the options below in the [component's API](#api) section, you can specify **any HTML attribute you like.** All attributes that don't interfere -with the API of the React component are forwarded to the root `