Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/react-core/src/components/Alert/Alert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export interface AlertProps extends Omit<React.HTMLProps<HTMLDivElement>, 'actio
}

export const Alert: React.FunctionComponent<AlertProps & OUIAProps> = ({
variant = AlertVariant.info,
variant = AlertVariant.default,
isInline = false,
isLiveRegion = false,
variantLabel = `${capitalize(variant)} alert:`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import { Alert, AlertVariant } from '../Alert';
import { AlertActionLink } from '../AlertActionLink';
import { AlertActionCloseButton } from '../AlertActionCloseButton';

test('default Alert variant is info', () => {
test('default Alert variant is default', () => {
const view = mount(<Alert title="this is a test">Alert testing</Alert>);
expect(
view
.find('Alert')
.childAt(0)
.prop('className')
).toContain('pf-m-info');
).toContain('pf-c-alert');
});

Object.values(AlertVariant).forEach(variant => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,9 @@ exports[`alertgroup closes when alerts are closed 1`] = `
<li>
<div
aria-atomic="false"
aria-label="Info Alert"
aria-label="Default Alert"
aria-live="polite"
class="pf-c-alert pf-m-info"
class="pf-c-alert"
data-ouia-component-id="2"
data-ouia-component-type="PF4/Alert"
data-ouia-safe="true"
Expand All @@ -279,11 +279,11 @@ exports[`alertgroup closes when alerts are closed 1`] = `
height="1em"
role="img"
style="vertical-align: -0.125em;"
viewBox="0 0 512 512"
viewBox="0 0 448 512"
width="1em"
>
<path
d="M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z"
d="M224 512c35.32 0 63.97-28.65 63.97-64H160.03c0 35.35 28.65 64 63.97 64zm215.39-149.71c-19.32-20.76-55.47-51.99-55.47-154.29 0-77.7-54.48-139.9-127.94-155.16V32c0-17.67-14.32-32-31.98-32s-31.98 14.33-31.98 32v20.84C118.56 68.1 64.08 130.3 64.08 208c0 102.3-36.15 133.53-55.47 154.29-6 6.45-8.66 14.16-8.61 21.71.11 16.4 12.98 32 32.1 32h383.8c19.12 0 32-15.6 32.1-32 .05-7.55-2.61-15.27-8.61-21.71z"
transform=""
/>
</svg>
Expand All @@ -294,7 +294,7 @@ exports[`alertgroup closes when alerts are closed 1`] = `
<span
class="pf-u-screen-reader"
>
Info alert:
Default alert:
</span>
Test Alert
</h4>
Expand Down Expand Up @@ -342,9 +342,9 @@ exports[`alertgroup closes when alerts are closed 1`] = `
<li>
<div
aria-atomic="false"
aria-label="Info Alert"
aria-label="Default Alert"
aria-live="polite"
class="pf-c-alert pf-m-info"
class="pf-c-alert"
data-ouia-component-id="2"
data-ouia-component-type="PF4/Alert"
data-ouia-safe="true"
Expand All @@ -358,11 +358,11 @@ exports[`alertgroup closes when alerts are closed 1`] = `
height="1em"
role="img"
style="vertical-align: -0.125em;"
viewBox="0 0 512 512"
viewBox="0 0 448 512"
width="1em"
>
<path
d="M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z"
d="M224 512c35.32 0 63.97-28.65 63.97-64H160.03c0 35.35 28.65 64 63.97 64zm215.39-149.71c-19.32-20.76-55.47-51.99-55.47-154.29 0-77.7-54.48-139.9-127.94-155.16V32c0-17.67-14.32-32-31.98-32s-31.98 14.33-31.98 32v20.84C118.56 68.1 64.08 130.3 64.08 208c0 102.3-36.15 133.53-55.47 154.29-6 6.45-8.66 14.16-8.61 21.71.11 16.4 12.98 32 32.1 32h383.8c19.12 0 32-15.6 32.1-32 .05-7.55-2.61-15.27-8.61-21.71z"
transform=""
/>
</svg>
Expand All @@ -373,7 +373,7 @@ exports[`alertgroup closes when alerts are closed 1`] = `
<span
class="pf-u-screen-reader"
>
Info alert:
Default alert:
</span>
Test Alert
</h4>
Expand Down Expand Up @@ -432,20 +432,20 @@ exports[`alertgroup closes when alerts are closed 1`] = `
>
<div
aria-atomic="false"
aria-label="Info Alert"
aria-label="Default Alert"
aria-live="polite"
className="pf-c-alert pf-m-info"
className="pf-c-alert"
data-ouia-component-id={2}
data-ouia-component-type="PF4/Alert"
data-ouia-safe={true}
>
<AlertIcon
variant="info"
variant="default"
>
<div
className="pf-c-alert__icon"
>
<InfoCircleIcon
<BellIcon
color="currentColor"
noVerticalAlign={false}
size="sm"
Expand All @@ -462,15 +462,15 @@ exports[`alertgroup closes when alerts are closed 1`] = `
"verticalAlign": "-0.125em",
}
}
viewBox="0 0 512 512"
viewBox="0 0 448 512"
width="1em"
>
<path
d="M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z"
d="M224 512c35.32 0 63.97-28.65 63.97-64H160.03c0 35.35 28.65 64 63.97 64zm215.39-149.71c-19.32-20.76-55.47-51.99-55.47-154.29 0-77.7-54.48-139.9-127.94-155.16V32c0-17.67-14.32-32-31.98-32s-31.98 14.33-31.98 32v20.84C118.56 68.1 64.08 130.3 64.08 208c0 102.3-36.15 133.53-55.47 154.29-6 6.45-8.66 14.16-8.61 21.71.11 16.4 12.98 32 32.1 32h383.8c19.12 0 32-15.6 32.1-32 .05-7.55-2.61-15.27-8.61-21.71z"
transform=""
/>
</svg>
</InfoCircleIcon>
</BellIcon>
</div>
</AlertIcon>
<h4
Expand All @@ -479,7 +479,7 @@ exports[`alertgroup closes when alerts are closed 1`] = `
<span
className="pf-u-screen-reader"
>
Info alert:
Default alert:
</span>
Test Alert
</h4>
Expand All @@ -490,7 +490,7 @@ exports[`alertgroup closes when alerts are closed 1`] = `
aria-label="Close"
onClose={[MockFunction]}
title="Test Alert"
variantLabel="Info alert:"
variantLabel="Default alert:"
>
<Button
aria-label="Close"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class AlertDemo extends React.Component<null, AlertDemoState> {
Info alert description. <a href="#">This is a link.</a>
</Alert>
)}
<Alert id="default-alert" variant="default" title="Default alert title" isInline>
<Alert id="default-alert" title="Default alert title" isInline>
Info alert description
</Alert>
</React.Fragment>
Expand Down