Skip to content

Commit

Permalink
fix(cta): add default aria-label for different types (#5096)
Browse files Browse the repository at this point in the history
### 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
IgnacioBecerra authored Feb 12, 2021
1 parent 36f3323 commit 728499f
Show file tree
Hide file tree
Showing 4 changed files with 326 additions and 47 deletions.
Loading

0 comments on commit 728499f

Please sign in to comment.