Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(radio): add typescript support for accepting react node #200

Merged
merged 2 commits into from
Mar 27, 2024

Conversation

bbleungg
Copy link
Contributor

This change adds Typescript support for Radio label accepting a React node

Copy link

github-actions bot commented Mar 27, 2024

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@bbleungg
Copy link
Contributor Author

recheck

Copy link

github-actions bot commented Mar 27, 2024

size-limit report 📦

Path Size
dist/components.cjs.production.min.js 195.33 KB (0%)
dist/components.esm.js 142.26 KB (0%)

@@ -45,7 +45,7 @@ export type RadioProps = {
/**
* The actual text to be displayed `Cats For Adoptions`
*/
label: string;
label: string | ReactNode;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm okay with this but note that this has a bit of a11y implications. Can you double check that the text node of whatever react node you pass in get's read in for a11y?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified with Chrome Lighthouse that there were no accessibility issues using a node. From the code, it looks like all aria values are appended using the value prop being passed in, so the label being a node should not affect (unless the node being passed in does not pass a11y)

@mikeldking
Copy link
Collaborator

@bbleungg spelling error in the title of the PR

@bbleungg bbleungg changed the title feat(radio): add typescript support for accepting ract node feat(radio): add typescript support for accepting react node Mar 27, 2024
@bbleungg bbleungg merged commit 838d1cb into main Mar 27, 2024
6 checks passed
@bbleungg bbleungg deleted the bleung/add-react-node-support branch March 27, 2024 21:25
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants