Skip to content

Commit b3f07ca

Browse files
authored
OUIA audit (#4401)
1 parent 37988ad commit b3f07ca

File tree

66 files changed

+908
-759
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+908
-759
lines changed

packages/react-core/src/components/Alert/Alert.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export enum AlertVariant {
1414
default = 'default'
1515
}
1616

17-
export interface AlertProps extends Omit<React.HTMLProps<HTMLDivElement>, 'action' | 'title'> {
17+
export interface AlertProps extends Omit<React.HTMLProps<HTMLDivElement>, 'action' | 'title'>, OUIAProps {
1818
/** Adds Alert variant styles */
1919
variant?: 'success' | 'danger' | 'warning' | 'info' | 'default';
2020
/** Flag to indicate if the Alert is inline */
@@ -37,7 +37,7 @@ export interface AlertProps extends Omit<React.HTMLProps<HTMLDivElement>, 'actio
3737
isLiveRegion?: boolean;
3838
}
3939

40-
export const Alert: React.FunctionComponent<AlertProps & OUIAProps> = ({
40+
export const Alert: React.FunctionComponent<AlertProps> = ({
4141
variant = AlertVariant.default,
4242
isInline = false,
4343
isLiveRegion = false,
@@ -49,8 +49,9 @@ export const Alert: React.FunctionComponent<AlertProps & OUIAProps> = ({
4949
children = '',
5050
className = '',
5151
ouiaId,
52+
ouiaSafe = true,
5253
...props
53-
}: AlertProps & OUIAProps) => {
54+
}: AlertProps) => {
5455
const getHeadingContent = (
5556
<React.Fragment>
5657
<span className={css(accessibleStyles.screenReader)}>{variantLabel}</span>
@@ -70,7 +71,7 @@ export const Alert: React.FunctionComponent<AlertProps & OUIAProps> = ({
7071
{...props}
7172
className={customClassName}
7273
aria-label={ariaLabel}
73-
{...getOUIAProps('Alert', ouiaId)}
74+
{...getOUIAProps(Alert.displayName, ouiaId, ouiaSafe)}
7475
{...(isLiveRegion && {
7576
'aria-live': 'polite',
7677
'aria-atomic': 'false'

0 commit comments

Comments
 (0)