diff --git a/packages/core/src/components/Alert/Alert.jsx b/packages/core/src/components/Alert/Alert.jsx index 242e6e35cc..22f80e9ba4 100644 --- a/packages/core/src/components/Alert/Alert.jsx +++ b/packages/core/src/components/Alert/Alert.jsx @@ -19,11 +19,12 @@ export class Alert extends React.PureComponent { } heading() { + const Heading = `h${this.props.headingLevel}` || `h3`; if (this.props.heading) { return ( -

+ {this.props.heading} -

+ ); } } @@ -51,7 +52,8 @@ export class Alert extends React.PureComponent { } } Alert.defaultProps = { - role: 'region' + role: 'region', + headingLevel: '3' }; Alert.propTypes = { /** @@ -66,6 +68,10 @@ Alert.propTypes = { * Optional id used to link the `aria-labelledby` attribute to the heading. If not provided, a unique id will be automatically generated and used. */ headingId: PropTypes.string, + /** + * Heading type to override default `

`. + */ + headingLevel: PropTypes.oneOf(['1', '2', '3', '4', '5']), /** * Boolean to hide the `Alert` icon */ diff --git a/packages/core/src/components/Dialog/Dialog.example.jsx b/packages/core/src/components/Dialog/Dialog.example.jsx index 616dade938..3ea57b0e2e 100644 --- a/packages/core/src/components/Dialog/Dialog.example.jsx +++ b/packages/core/src/components/Dialog/Dialog.example.jsx @@ -31,7 +31,7 @@ class Example extends React.PureComponent { this.hideModal()} getApplicationNode={() => document.getElementById('App')} - title="Dialog title" + heading="Dialog heading" actions={[