vmware-archive / clarity

Clarity is a scalable, accessible, customizable, open source design system built with web components. Works with any JavaScript framework, built for enterprises, and designed to be inclusive.
http://clarity.design
MIT License
6.43k stars 763 forks source link

fix(react): update required message for aria attributes - backport v5 #6553

Closed ashleyryan closed 2 years ago

ashleyryan commented 2 years ago

fixes #6463

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

What is the current behavior?

When an ariaLabel is required, like with CdsIconButton, if you don't include it in React, a warning message appears in the console that says to give an ariaLabel prop. In React, aria attributes, unlike other attributes are kebab case, so it should be aria-label

Issue Number: #6463

What is the new behavior?

For attributes that begin with aria, the warning message for react will format the property with a hypen

Does this PR introduce a breaking change?

Other information

This still leaves React components with aria-label and ariaLabel attributes, but that will be addressed separately after discussing with the Lit team.