Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EuiDescriptionList accepts nodes for titles and descriptions. #552

Merged
merged 1 commit into from
Mar 21, 2018
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
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