Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(cta): add default aria-label for different types (#5096)
### Related Ticket(s) #2728 #2384 #4142 #4060 ### Description Added an `aria-label` to inform screen reader users the CTA about the type of link they are focused on, such as `external`, `video`, or `download`. The default label is provided in English by default, but the message can be a custom translation that is passed in using the `ariaLabel` prop by adopters. This PR also changes the `role` of LinkList to `listitem` with the use of a custom `ariaRole` prop to specify different roles depending on the use within components. ### Changelog **New** - added `ariaLabel` to `CTA` component for adopters to customize the message in a different language - added `ariaProp` to `CTA` component to set a custom role depending on the use in other components **Changed** - `aria-label` message for CTA Text and Card - set `role='listitem` in `LinkList` <!-- React and Web Component deploy previews are enabled by default. --> <!-- To enable additional available deploy previews, apply the following --> <!-- labels for the corresponding package: --> <!-- *** "package: services": Services --> <!-- *** "package: utilities": Utilities --> <!-- *** "package: styles": Carbon Expressive --> <!-- *** "RTL": React / Web Components (RTL) --> <!-- *** "feature flag": React / Web Components (experimental) -->
- Loading branch information