From 7976e0af6fe781ae74dd6374a5ec1eafc61c9e68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aappo=20=C3=85lander?= Date: Wed, 13 Nov 2019 14:32:13 +0200 Subject: [PATCH] Update suomifi-icons to 0.0.10 and add support for more Icon props including fill. --- package.json | 2 +- src/components/Svg/Svg.tsx | 2 ++ src/core/Icon/Icon.tsx | 19 +++++-------------- yarn.lock | 8 ++++---- 4 files changed, 12 insertions(+), 19 deletions(-) diff --git a/package.json b/package.json index b1bacb4e18..286b02d39e 100644 --- a/package.json +++ b/package.json @@ -116,7 +116,7 @@ "react-svg": "7.2.2", "styled-components": "4.3.2", "suomifi-design-tokens": "0.2.1", - "suomifi-icons": "0.0.8", + "suomifi-icons": "0.0.10", "uuid": "3.3.2" }, "peerDependencies": { diff --git a/src/components/Svg/Svg.tsx b/src/components/Svg/Svg.tsx index c281386293..f12d3ebfe7 100644 --- a/src/components/Svg/Svg.tsx +++ b/src/components/Svg/Svg.tsx @@ -19,6 +19,8 @@ export interface SvgProps { /** Show mouse cursor as hand-pointer */ mousePointer?: boolean; testId?: string; + /** Allow passing custom attributes */ + [key: string]: any; } export const Svg = styled( diff --git a/src/core/Icon/Icon.tsx b/src/core/Icon/Icon.tsx index 1db66f7407..03fe0444f6 100644 --- a/src/core/Icon/Icon.tsx +++ b/src/core/Icon/Icon.tsx @@ -84,24 +84,15 @@ export class Icon extends Component { } = withSuomifiDefaultProps(this.props); const { className, ariaLabel } = this.props; + const iconColor = + color !== undefined ? color : colorValue({ tokens })('depthDark27'); + if (!!src) { - return ( - - ); + return ; } if (icon !== undefined) { - return ( - - ); + return ; } logger.warn( diff --git a/yarn.lock b/yarn.lock index 394aca3f5b..49f4f3b8c1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10546,10 +10546,10 @@ suomifi-design-tokens@0.2.1: resolved "https://registry.yarnpkg.com/suomifi-design-tokens/-/suomifi-design-tokens-0.2.1.tgz#adfa14df6617ab26b96884b7071789a398bcf1e7" integrity sha512-C8pkDmi9A8hradqiVfKxtfqfNIGl9ky8T5RoCa7oQRORTzxFu1RudJ83SDkm4/iLR64mCLByeMtwZFvKCveCDw== -suomifi-icons@0.0.8: - version "0.0.8" - resolved "https://registry.yarnpkg.com/suomifi-icons/-/suomifi-icons-0.0.8.tgz#2a25de59b9e945321d504c0c393f8371d8213bbb" - integrity sha512-C/qsOpERN73eyAMjpOMtGPw2NkS1R57VVk/cjsxM7mmlDMiBYjCdXM8XYa3HPsGxlznEHxNmCxWqMf4z/QF1WA== +suomifi-icons@0.0.10: + version "0.0.10" + resolved "https://registry.yarnpkg.com/suomifi-icons/-/suomifi-icons-0.0.10.tgz#d2e32f7e03c53b86d1efeeada037a0f420a01804" + integrity sha512-tPh7CFBOGyyK0qaBU7dlOsHn9c8hLi0qpNHXz2xhHbVOkPD6bGLDlrtkQVdvni5nRi9zYJ2xeiaSZ7azADTeLQ== supports-color@^2.0.0: version "2.0.0"