From df44fadbdd63863129731073ed36b81b6b88282c Mon Sep 17 00:00:00 2001 From: jxom Date: Mon, 19 Nov 2018 22:41:56 +1100 Subject: [PATCH] Add icons to the Input component --- .../__snapshots__/Dialog.test.js.snap | 7 +- .../__snapshots__/FieldWrapper.test.js.snap | 413 ++- src/Icon/Icon.js | 9 +- .../__tests__/__snapshots__/Icon.test.js.snap | 76 +- src/Icon/styled.js | 2 + src/Input/Input.js | 31 +- src/Input/Input.mdx | 52 +- src/Input/InputField.js | 4 + src/Input/__tests__/Input.test.js | 10 + src/Input/__tests__/InputField.test.js | 11 + .../__snapshots__/Input.test.js.snap | 1487 +++++++---- .../__snapshots__/InputField.test.js.snap | 2264 ++++++++++------- src/Input/styled.js | 67 +- 13 files changed, 2652 insertions(+), 1781 deletions(-) diff --git a/src/Dialog/__tests__/__snapshots__/Dialog.test.js.snap b/src/Dialog/__tests__/__snapshots__/Dialog.test.js.snap index b6daf1fb4..0660aad86 100644 --- a/src/Dialog/__tests__/__snapshots__/Dialog.test.js.snap +++ b/src/Dialog/__tests__/__snapshots__/Dialog.test.js.snap @@ -386,6 +386,8 @@ h6.c6 { fill: #435a6f; position: relative; top: 0.1em; + height: 1em; + width: 1em; } @media (max-width:480px) { @@ -441,11 +443,10 @@ h6.c6 {
= LARGE_VIEW_BOX_SIZE ? LARGE_VIEW_BOX_SIZE : DEFAULT_VIEW_BOX_SIZE; const paths = svgPaths[icon]; return ( - <_Icon - as="svg" - role="img" - height={`${size}em`} - width={`${size}em`} - viewBox={`0 0 ${viewBoxSize} ${viewBoxSize}`} - {...props} - > + <_Icon as="svg" role="img" size={size} viewBox={`0 0 ${viewBoxSize} ${viewBoxSize}`} {...props}> {a11yLabel && {a11yLabel}} {paths.map(path => ( diff --git a/src/Icon/__tests__/__snapshots__/Icon.test.js.snap b/src/Icon/__tests__/__snapshots__/Icon.test.js.snap index c79b9ca96..c2914cfcb 100644 --- a/src/Icon/__tests__/__snapshots__/Icon.test.js.snap +++ b/src/Icon/__tests__/__snapshots__/Icon.test.js.snap @@ -57,6 +57,8 @@ exports[`colors renders correctly for an icon with color danger 1`] = ` fill: #d60027; position: relative; top: 0.1em; + height: 1em; + width: 1em; }