Skip to content

Commit

Permalink
EuiDescriptionList accepts nodes for titles and descriptions.
Browse files Browse the repository at this point in the history
  • Loading branch information
cjcenizal committed Mar 21, 2018
1 parent 7351dd1 commit a6ca10c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# [`master`](https://github.com/elastic/eui/tree/master)

- Updated `EuiDescriptionList` to accept nodes for the titles and descriptions ([#552](https://github.com/elastic/eui/pull/552))
- Added `stop` and `stopFilled` icons ([#543](https://github.com/elastic/eui/pull/543))

**Bug fixes**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ exports[`EuiDescriptionList props compressed is rendered 1`] = `
/>
`;

exports[`EuiDescriptionList props listItems is rendered 1`] = `
exports[`EuiDescriptionList props listItems is rendered as strings and elements 1`] = `
<dl
class="euiDescriptionList euiDescriptionList--row"
>
Expand All @@ -45,12 +45,16 @@ exports[`EuiDescriptionList props listItems is rendered 1`] = `
<dt
class="euiDescriptionList__title"
>
Title 2
<em>
Title 2
</em>
</dt>
<dd
class="euiDescriptionList__description"
>
Description 2
<code>
Description 2
</code>
</dd>
<dt
class="euiDescriptionList__title"
Expand Down
4 changes: 2 additions & 2 deletions src/components/description_list/description_list.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ EuiDescriptionList.propTypes = {
children: PropTypes.node,
className: PropTypes.string,
listItems: PropTypes.arrayOf(PropTypes.shape({
title: PropTypes.string,
description: PropTypes.string,
title: PropTypes.node,
description: PropTypes.node,
})),
compressed: PropTypes.bool,
type: PropTypes.oneOf(TYPES),
Expand Down
6 changes: 3 additions & 3 deletions src/components/description_list/description_list.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ describe('EuiDescriptionList', () => {

describe('props', () => {
describe('listItems', () => {
test('is rendered', () => {
test('is rendered as strings and elements', () => {
const listItems = [
{
title: 'Title 1',
description: 'Description 1',
},
{
title: 'Title 2',
description: 'Description 2',
title: <em>Title 2</em>,
description: <code>Description 2</code>,
},
{
title: 'Title 3',
Expand Down

0 comments on commit a6ca10c

Please sign in to comment.