From b773e1f8d2543026d48bee24e0525b2edd8396f2 Mon Sep 17 00:00:00 2001 From: Walter Rafelsberger Date: Tue, 10 Jul 2018 14:39:57 +0200 Subject: [PATCH 1/2] Allow size to be passed in for EuiIconTip --- src-docs/src/views/tool_tip/icon_tip.js | 1 + .../src/views/tool_tip/tool_tip_example.js | 2 +- .../__snapshots__/icon_tip.test.js.snap | 25 +++++++++++++++++++ src/components/tool_tip/icon_tip.js | 9 +++++-- src/components/tool_tip/icon_tip.test.js | 11 ++++++++ 5 files changed, 45 insertions(+), 3 deletions(-) diff --git a/src-docs/src/views/tool_tip/icon_tip.js b/src-docs/src/views/tool_tip/icon_tip.js index 441c47ce812..31ed696ebd3 100644 --- a/src-docs/src/views/tool_tip/icon_tip.js +++ b/src-docs/src/views/tool_tip/icon_tip.js @@ -31,6 +31,7 @@ export default () => (

It accepts all the same props as EuiToolTip. - For convenience, you can also specify optional icon type and + For convenience, you can also specify optional icon size, type and color props.

diff --git a/src/components/tool_tip/__snapshots__/icon_tip.test.js.snap b/src/components/tool_tip/__snapshots__/icon_tip.test.js.snap index ee05c4398af..c0b58ff73c5 100644 --- a/src/components/tool_tip/__snapshots__/icon_tip.test.js.snap +++ b/src/components/tool_tip/__snapshots__/icon_tip.test.js.snap @@ -50,6 +50,31 @@ exports[`EuiIconTip props color is rendered as the icon color 1`] = ` `; +exports[`EuiIconTip props size is rendered as the icon size 1`] = ` + + + + + + +`; + exports[`EuiIconTip props type is rendered as the icon 1`] = ` ( +export const EuiIconTip = ({ type, 'aria-label': ariaLabel, color, size, ...rest }) => ( - + ); @@ -21,6 +21,11 @@ EuiIconTip.propTypes = { */ color: PropTypes.string, + /** + * The icon size. + */ + size: PropTypes.string, + /** * Explain what this icon means for screen readers. */ diff --git a/src/components/tool_tip/icon_tip.test.js b/src/components/tool_tip/icon_tip.test.js index 7b5e8f049a9..a9a58ef6a72 100644 --- a/src/components/tool_tip/icon_tip.test.js +++ b/src/components/tool_tip/icon_tip.test.js @@ -36,5 +36,16 @@ describe('EuiIconTip', () => { .toMatchSnapshot(); }); }); + + describe('size', () => { + test('is rendered as the icon size', () => { + const component = render( + + ); + + expect(component) + .toMatchSnapshot(); + }); + }); }); }); From 7f8fce419f3f67814e98ae865fea06f9829b78cb Mon Sep 17 00:00:00 2001 From: Walter Rafelsberger Date: Tue, 10 Jul 2018 14:44:00 +0200 Subject: [PATCH 2/2] Update changelog. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 01cdfb07e2f..1fe74dce711 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ - Changed `EuiXYChart` components exports to `/experimental` subfolder ([#975](https://github.com/elastic/eui/pull/975)) - Added beta version of `EuiXYChart` and associated components ([#309](https://github.com/elastic/eui/pull/309)) +- Added `size` prop to `EuiIconTip` ([987](https://github.com/elastic/eui/pull/987)) **Bug fixes**