From 18b16f251f18027a9d65c4db40957267e57aadb4 Mon Sep 17 00:00:00 2001 From: Tobias Date: Fri, 25 Jan 2019 07:02:25 +0100 Subject: [PATCH] fix: make area-hidden not false by "default" on #icon component --- packages/dnb-ui-lib/src/components/icon/Icon.js | 3 ++- .../dnb-ui-lib/src/components/icon/details.md | 17 +++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/packages/dnb-ui-lib/src/components/icon/Icon.js b/packages/dnb-ui-lib/src/components/icon/Icon.js index 4472dd49f7c..5673adac672 100644 --- a/packages/dnb-ui-lib/src/components/icon/Icon.js +++ b/packages/dnb-ui-lib/src/components/icon/Icon.js @@ -246,7 +246,8 @@ export default class Icon extends PureComponent { let alt = _alt || title if (!(alt && alt.length > 0)) { - alt = String(Icon.getIconNameFromComponent(props)).replace(/_/g, ' ') + alt = Icon.getIconNameFromComponent(props) + alt = alt ? String(alt).replace(/_/g, ' ') : null } // some wrapper params diff --git a/packages/dnb-ui-lib/src/components/icon/details.md b/packages/dnb-ui-lib/src/components/icon/details.md index 9e7a3516df3..07bcf81bd9e 100644 --- a/packages/dnb-ui-lib/src/components/icon/details.md +++ b/packages/dnb-ui-lib/src/components/icon/details.md @@ -1,8 +1,9 @@ -| Properties | Description | -| ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `icon` | _(mandatory)_ a React SVG Component or the icon name (in case we use `IconPrimary` or `dnb-icon-primary`). | -| `alt` | _(mandatory)_ the alternative label (text version) of the icon. | -| `size` | _(optional)_ the dimension of the icon. This will be the `viewBox` and represent `width` and `height`. Defaults to `16`. You can use `small`,`medium` or `large` | -| `color` | _(optional)_ sets a color property to the `svg` markup. Default is no color, witch means _black_ | -| `modifier` | _(optional)_ modifier class to define e.g. sizes. | -| `attributes` | _(optional)_ insert any other attributes. For example `disabled` or any other custom attributes. | +| Properties | Description | +| ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `icon` | _(mandatory)_ a React SVG Component or the icon name (in case we use `IconPrimary` or `dnb-icon-primary`). | +| `alt` | _(mandatory)_ the alternative label (text version) of the icon. | +| `size` | _(optional)_ the dimension of the icon. This will be the `viewBox` and represent `width` and `height`. Defaults to `16`. You can use `small`,`medium` or `large` | +| `color` | _(optional)_ sets a color property to the `svg` markup. Default is no color, witch means _black_ | +| `modifier` | _(optional)_ modifier class to define e.g. sizes. | +| `area_hidden` | _(optional)_ To declare that the icon should not be visible to screen readers. | +| `attributes` | _(optional)_ insert any other attributes. For example `disabled` or any other custom attributes. |