* feat(BOOK-117): Added aria-label to Scandic Friends levels * feat(BOOK-117): Added aria-label to hotel logos * feat(BOOK-117): Added alt text to app download images * feat(BOOK-117): Added same logo component to footer as the one in the header * feat(BOOK-117): Added aria attributes to icons similar to how we handled MaterialIcon aria attributes Approved-by: Bianca Widstam Approved-by: Matilda Landström
18 lines
535 B
TypeScript
18 lines
535 B
TypeScript
import { IconProps, IllustrationProps, NucleoIconProps } from './icon'
|
|
import { MaterialIconSetIconProps } from './MaterialIcon'
|
|
|
|
export function getIconAriaProps(
|
|
props:
|
|
| IconProps
|
|
| NucleoIconProps
|
|
| MaterialIconSetIconProps
|
|
| IllustrationProps
|
|
) {
|
|
const { role, 'aria-label': ariaLabel, 'aria-hidden': ariaHidden } = props
|
|
|
|
const computedAriaHidden =
|
|
ariaHidden !== undefined ? ariaHidden : ariaLabel || role ? false : true
|
|
|
|
return { role, 'aria-label': ariaLabel, 'aria-hidden': computedAriaHidden }
|
|
}
|