diff --git a/README.MD b/README.MD
index dd43b26dc4..c88629b91e 100644
--- a/README.MD
+++ b/README.MD
@@ -96,7 +96,7 @@ Feedback and improvement requests regarding this configuration would be apprecia
## Dependencies
-Usage of this package does not require you to install additional Carbon packages; `carbon-components`, `carbon-icons`, or `@carbon` packages (`@carbon/grid`, `@carbon-layout`, etc) as peer dependencies. You may still need these packages if you use them directly in your project.
+Usage of this package does not require you to install additional Carbon packages; `carbon-components`, `carbon-components-react`, or `@carbon` packages (`@carbon/grid`, `@carbon-layout`, etc) as peer dependencies. You may still need these packages if you use them directly in your project.
## 📚 Docs
diff --git a/package.json b/package.json
index 37a58a3335..e1ffe02569 100644
--- a/package.json
+++ b/package.json
@@ -81,14 +81,13 @@
"@carbon/charts": "^0.30.18",
"@carbon/charts-react": "^0.30.18",
"@carbon/colors": "10.8.0",
- "@carbon/icons": "10.9.3",
"@carbon/icons-react": "10.10.0",
"@carbon/layout": "10.7.1",
"@carbon/motion": "10.6.0",
"@carbon/themes": "10.10.3",
"carbon-components": "10.10.3",
"carbon-components-react": "7.10.3",
- "carbon-icons": "7.0.7",
+ "carbon-icons": "^7.0.7",
"classnames": "^2.2.5",
"core-js": "3.6.5",
"immutability-helper": "^2.9.0",
diff --git a/rollup.config.js b/rollup.config.js
index db28746642..f87c2bc66d 100644
--- a/rollup.config.js
+++ b/rollup.config.js
@@ -122,7 +122,6 @@ export default [
'prop-types': 'PropTypes',
react: 'React',
'react-dom': 'ReactDOM',
- 'carbon-icons': 'CarbonIcons',
'@carbon/icons-react': 'CarbonIconsReact',
'carbon-components': 'CarbonComponents',
'carbon-components-react': 'CarbonComponentsReact',
@@ -137,7 +136,6 @@ export default [
'styled-components',
'prop-types',
'carbon-components-react',
- 'carbon-icons',
'@carbon/icons',
'@carbon/icons-react',
'carbon-components',
diff --git a/src/components/Button/Button.story.jsx b/src/components/Button/Button.story.jsx
index 726b4dbbf3..5550d2ceea 100644
--- a/src/components/Button/Button.story.jsx
+++ b/src/components/Button/Button.story.jsx
@@ -3,7 +3,6 @@ import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import { withKnobs, boolean, select, text } from '@storybook/addon-knobs';
import { settings } from 'carbon-components';
-import { iconAddSolid, iconSearch } from 'carbon-icons';
import { Add16, Search16 } from '@carbon/icons-react';
import { ButtonSkeleton } from 'carbon-components-react';
@@ -22,8 +21,6 @@ const icons = {
};
const iconMap = {
- iconAddSolid,
- iconSearch,
Add16,
Search16,
};
diff --git a/src/components/Dashboard/CardRenderer.test.jsx b/src/components/Dashboard/CardRenderer.test.jsx
index 57e2a8fda9..0fa249f5cb 100644
--- a/src/components/Dashboard/CardRenderer.test.jsx
+++ b/src/components/Dashboard/CardRenderer.test.jsx
@@ -1,5 +1,5 @@
import React from 'react';
-import { iconCrash } from 'carbon-icons';
+import { Add16, Maximize16 } from '@carbon/icons-react';
import { render, fireEvent } from '@testing-library/react';
import { CARD_SIZES, CARD_TYPES, COLORS } from '../../constants/LayoutConstants';
@@ -147,8 +147,8 @@ describe('CardRenderer', () => {
layouts={{ lg: [{ id: 'bogus', x: 0, y: 0 }] }}
actions={[
{ id: 'edit', labelText: 'Edit', icon: 'edit' },
- { id: 'crash', labelText: 'Crash', icon: iconCrash },
- { id: 'expand', labelText: 'Expand', icon: iconCrash },
+ { id: 'crash', labelText: 'Add', icon: Add16 },
+ { id: 'maximize', labelText: 'Maximize', icon: Maximize16 },
]}
cards={[
{
diff --git a/src/components/Dashboard/Dashboard.test.jsx b/src/components/Dashboard/Dashboard.test.jsx
index 869eed1815..a619f86783 100644
--- a/src/components/Dashboard/Dashboard.test.jsx
+++ b/src/components/Dashboard/Dashboard.test.jsx
@@ -1,7 +1,6 @@
import { mount } from 'enzyme';
import React from 'react';
-import Add from '@carbon/icons-react/lib/add/20';
-import { iconCrash } from 'carbon-icons';
+import { Add20 } from '@carbon/icons-react';
import { render, waitFor } from '@testing-library/react';
import { CARD_SIZES, CARD_TYPES, COLORS } from '../../constants/LayoutConstants';
@@ -135,7 +134,7 @@ let wrapper = mount(
layouts={{ lg: [{ id: 'bogus', x: 0, y: 0 }] }}
actions={[
{ id: 'edit', labelText: 'Edit', icon: 'edit' },
- { id: 'add', labelText: 'Add', icon: },
+ { id: 'add', labelText: 'Add', icon: },
{ id: 'custom', labelText: 'Custom', customActionComponent: },
]}
cards={cardValues}
@@ -160,7 +159,7 @@ describe('Dashboard', () => {
layouts={{ lg: [{ id: 'bogus', x: 0, y: 0 }] }}
actions={[
{ id: 'edit', labelText: 'Edit', icon: 'edit' },
- { id: 'crash', labelText: 'Crash', icon: iconCrash },
+ { id: 'add', labelText: 'Add', icon: },
]}
cards={cardValues}
onDashboardAction={onClick}
@@ -192,7 +191,7 @@ describe('Dashboard', () => {
layouts={{ lg: [{ id: 'bogus', x: 0, y: 0 }] }}
actions={[
{ id: 'edit', labelText: 'Edit', icon: 'edit' },
- { id: 'crash', labelText: 'Crash', icon: iconCrash },
+ { id: 'add', labelText: 'Add', icon: },
]}
cards={cardValues}
onDashboardAction={onClick}
@@ -209,7 +208,7 @@ describe('Dashboard', () => {
layouts={{ lg: [{ id: 'bogus', x: 0, y: 0 }] }}
actions={[
{ id: 'edit', labelText: 'Edit', icon: 'edit' },
- { id: 'crash', labelText: 'Crash', icon: iconCrash },
+ { id: 'add', labelText: 'Add', icon: },
]}
cards={cardValues}
onDashboardAction={onClick}
@@ -235,7 +234,7 @@ describe('Dashboard', () => {
layouts={{ lg: [{ id: 'bogus', x: 0, y: 0 }] }}
actions={[
{ id: 'edit', labelText: 'Edit', icon: 'edit' },
- { id: 'crash', labelText: 'Crash', icon: iconCrash },
+ { id: 'add', labelText: 'Add', icon: },
]}
cards={cardValues}
onDashboardAction={onClick}
diff --git a/src/components/Dashboard/DashboardHeader.jsx b/src/components/Dashboard/DashboardHeader.jsx
index 3afe8c4fc0..e16ec6830f 100644
--- a/src/components/Dashboard/DashboardHeader.jsx
+++ b/src/components/Dashboard/DashboardHeader.jsx
@@ -1,6 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
-import { SkeletonText, Icon } from 'carbon-components-react';
+import { SkeletonText } from 'carbon-components-react';
import { handleEnterKeyDown } from '../../utils/componentUtilityFunctions';
import icons, { bundledIconNames } from '../../utils/bundledIcons';
@@ -99,19 +99,14 @@ const DashboardHeader = ({
}}
>
{typeof action.icon === 'string' ? (
-
+ React.createElement(icons[action.icon], {
+ 'aria-label': action.labelText,
+ key: `icon-${action.id}`,
+ })
) : React.isValidElement(action.icon) ? (
action.icon
) : (
-
+
)}
) : (
diff --git a/src/components/Dashboard/__snapshots__/Dashboard.story.storyshot b/src/components/Dashboard/__snapshots__/Dashboard.story.storyshot
index 8b3bf68379..69125ebd9c 100644
--- a/src/components/Dashboard/__snapshots__/Dashboard.story.storyshot
+++ b/src/components/Dashboard/__snapshots__/Dashboard.story.storyshot
@@ -739,20 +739,19 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Dashb
>
@@ -1096,20 +1095,24 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Dashb
>
@@ -1981,20 +1984,19 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Dashb
tabIndex={0}
>
@@ -2099,20 +2101,19 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Dashb
tabIndex={0}
>
@@ -2944,20 +2945,19 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Dashb
>
@@ -3301,20 +3301,24 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Dashb
>
@@ -4186,20 +4190,19 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Dashb
tabIndex={0}
>
@@ -4304,20 +4307,19 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Dashb
tabIndex={0}
>
@@ -4463,17 +4465,22 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Dashb
>
@@ -5181,20 +5188,19 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Dashb
>
@@ -5538,20 +5544,24 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Dashb
>
@@ -6423,20 +6433,19 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Dashb
tabIndex={0}
>
@@ -6541,20 +6550,19 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Dashb
tabIndex={0}
>
@@ -9794,20 +9802,19 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Dashb
>
@@ -10151,20 +10158,24 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Dashb
>
@@ -11034,20 +11045,19 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Dashb
tabIndex={0}
>
@@ -11152,20 +11162,19 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Dashb
tabIndex={0}
>
@@ -13605,20 +13614,19 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Dashb
>
@@ -13717,20 +13725,24 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Dashb
>
@@ -13829,20 +13841,19 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Dashb
>
@@ -13941,20 +13952,19 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Dashb
>
@@ -14118,20 +14128,19 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Dashb
>
@@ -14230,20 +14239,24 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Dashb
>
@@ -14342,20 +14355,19 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Dashb
>
@@ -14454,20 +14466,19 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Dashb
>
@@ -16575,20 +16586,19 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Dashb
>
@@ -16687,20 +16697,24 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Dashb
>
@@ -16799,20 +16813,19 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Dashb
>
@@ -16911,20 +16924,19 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Dashb
>
@@ -18472,20 +18484,19 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Dashb
>
@@ -18584,20 +18595,24 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Dashb
>
@@ -18696,20 +18711,19 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Dashb
>
@@ -18808,20 +18822,19 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Dashb
>
@@ -21227,20 +21240,19 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Dashb
>
@@ -21294,20 +21306,24 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Dashb
>
@@ -21409,20 +21425,19 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Dashb
>
@@ -21476,20 +21491,19 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Dashb
>
@@ -21656,20 +21670,19 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Dashb
>
@@ -21723,20 +21736,24 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Dashb
>
@@ -21838,20 +21855,19 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Dashb
>
@@ -21905,20 +21921,19 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Dashb
>
@@ -22451,20 +22466,24 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Dashb
>
@@ -22524,20 +22543,19 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Dashb
>
@@ -22597,20 +22615,19 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Dashb
>
@@ -23143,20 +23160,24 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Dashb
>
@@ -23216,20 +23237,19 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Dashb
>
@@ -23289,20 +23309,19 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Dashb
>
@@ -24123,20 +24142,19 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Dashb
>
@@ -24480,20 +24498,24 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Dashb
>
@@ -25365,20 +25387,19 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Dashb
tabIndex={0}
>
@@ -25483,20 +25504,19 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Dashb
tabIndex={0}
>
diff --git a/src/components/ImageCard/CardIcon.jsx b/src/components/ImageCard/CardIcon.jsx
index 6cdb8bd5cc..d63b49c409 100644
--- a/src/components/ImageCard/CardIcon.jsx
+++ b/src/components/ImageCard/CardIcon.jsx
@@ -1,6 +1,5 @@
import React from 'react';
import PropTypes from 'prop-types';
-import { Icon } from 'carbon-components-react';
import warning from 'warning';
import icons from '../../utils/bundledIcons';
@@ -26,6 +25,8 @@ const CardIcon = ({ icon, renderIconByName, title, color, width, height, classNa
)} so we will default to our 'help' icon.`
);
}
+ const Icon = icons[icon] || icons.help;
+
return icon ? (
renderIconByName ? (
renderIconByName(icon, {
@@ -38,13 +39,12 @@ const CardIcon = ({ icon, renderIconByName, title, color, width, height, classNa
})
) : (
)
) : null;
diff --git a/src/components/ImageCard/HotspotContent.test.jsx b/src/components/ImageCard/HotspotContent.test.jsx
index 5ada433b09..3979eef7f6 100644
--- a/src/components/ImageCard/HotspotContent.test.jsx
+++ b/src/components/ImageCard/HotspotContent.test.jsx
@@ -122,7 +122,7 @@ describe('HotspotContent', () => {
/>
);
// threshold should be found and french formatted
- expect(getAllByTitle(/temperature > 0,05/)).toHaveLength(2);
+ expect(getAllByTitle(/temperature > 0,05/)).toHaveLength(1);
});
it('hotspot threshold', () => {
const { getAllByTitle } = render(
@@ -148,7 +148,7 @@ describe('HotspotContent', () => {
/>
);
// threshold should be found
- expect(getAllByTitle(/temperature > 0.05/)).toHaveLength(2);
+ expect(getAllByTitle(/temperature > 0.05/)).toHaveLength(1);
});
it('custom render Icon By Name', () => {
const mockRenderIconByName = jest.fn().mockReturnValue();
diff --git a/src/components/ImageCard/ImageControls.jsx b/src/components/ImageCard/ImageControls.jsx
index 1eadc04942..d4f597d96e 100644
--- a/src/components/ImageCard/ImageControls.jsx
+++ b/src/components/ImageCard/ImageControls.jsx
@@ -1,7 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
-import { Icon } from 'carbon-components-react';
-import { iconMinimize } from 'carbon-icons';
+import { Minimize20 } from '@carbon/icons-react';
import Minimap, { MinimapPropTypes } from './Minimap';
@@ -56,7 +55,7 @@ const ImageControls = ({
{draggable && (
<>
diff --git a/src/components/ImageCard/__snapshots__/ImageCard.story.storyshot b/src/components/ImageCard/__snapshots__/ImageCard.story.storyshot
index 5a55301241..380fcafd26 100644
--- a/src/components/ImageCard/__snapshots__/ImageCard.story.storyshot
+++ b/src/components/ImageCard/__snapshots__/ImageCard.story.storyshot
@@ -143,20 +143,19 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Image
tabIndex={0}
>
diff --git a/src/components/ImageCard/__snapshots__/ImageHotspots.story.storyshot b/src/components/ImageCard/__snapshots__/ImageHotspots.story.storyshot
index f5952f8ee9..71b8b74251 100644
--- a/src/components/ImageCard/__snapshots__/ImageHotspots.story.storyshot
+++ b/src/components/ImageCard/__snapshots__/ImageHotspots.story.storyshot
@@ -79,20 +79,19 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Image
tabIndex={0}
>
@@ -115,20 +114,19 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Image
tabIndex={0}
>
@@ -368,20 +366,19 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Image
tabIndex={0}
>
@@ -404,20 +401,19 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Image
tabIndex={0}
>
@@ -657,20 +653,19 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Image
tabIndex={0}
>
@@ -693,20 +688,19 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Image
tabIndex={0}
>
@@ -946,20 +940,19 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Image
tabIndex={0}
>
@@ -982,20 +975,19 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Image
tabIndex={0}
>
@@ -1235,20 +1227,19 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Image
tabIndex={0}
>
@@ -1271,20 +1262,19 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Image
tabIndex={0}
>
diff --git a/src/components/List/ListItem/ListItem.jsx b/src/components/List/ListItem/ListItem.jsx
index e20b546ff7..e8a938dae9 100644
--- a/src/components/List/ListItem/ListItem.jsx
+++ b/src/components/List/ListItem/ListItem.jsx
@@ -1,7 +1,6 @@
import React from 'react';
import classnames from 'classnames';
-import { Icon } from 'carbon-components-react';
-import { iconChevronDown, iconChevronUp } from 'carbon-icons';
+import { ChevronUp16, ChevronDown16 } from '@carbon/icons-react';
import PropTypes from 'prop-types';
import { settings } from '../../../constants/Settings';
@@ -129,10 +128,11 @@ const ListItem = ({
onClick={handleExpansionClick}
onKeyPress={({ key }) => key === 'Enter' && handleExpansionClick()}
>
-
+ {expanded ? (
+
+ ) : (
+
+ )}
) : null;
diff --git a/src/components/MultiSelect/README.md b/src/components/MultiSelect/README.md
index 24f4171bd2..89008c1ab9 100644
--- a/src/components/MultiSelect/README.md
+++ b/src/components/MultiSelect/README.md
@@ -18,14 +18,14 @@ package on npm. You can install this package by running the following command in
your terminal with [npm](https://www.npmjs.com/):
```bash
-npm i carbon-components carbon-components-react carbon-icons --save
+npm i carbon-components carbon-components-react --save
```
If you prefer [Yarn Classic](https://classic.yarnpkg.com/), use the following command
instead:
```bash
-yarn add carbon-components-react carbon-components carbon-icons
+yarn add carbon-components-react carbon-components
```
## Usage
diff --git a/src/components/OverflowMenu/README.md b/src/components/OverflowMenu/README.md
index db25aa000e..9dcd4c7076 100644
--- a/src/components/OverflowMenu/README.md
+++ b/src/components/OverflowMenu/README.md
@@ -26,9 +26,9 @@ package on NPM. You can install this package by running the following in your
terminal:
```bash
-npm i carbon-components carbon-components-react carbon-icons --save
+npm i carbon-components carbon-components-react --save
# Or, with Yarn Classic
-yarn add carbon-components carbon-components-react carbon-icons
+yarn add carbon-components carbon-components-react
```
## Usage
diff --git a/src/components/Table/TableBody/RowActionsCell/RowActionsCell.jsx b/src/components/Table/TableBody/RowActionsCell/RowActionsCell.jsx
index 8401b4f2ba..5a4d4c7af5 100644
--- a/src/components/Table/TableBody/RowActionsCell/RowActionsCell.jsx
+++ b/src/components/Table/TableBody/RowActionsCell/RowActionsCell.jsx
@@ -5,7 +5,6 @@ import {
DataTable,
OverflowMenu,
OverflowMenuItem,
- Icon,
Loading,
} from 'carbon-components-react';
import styled from 'styled-components';
@@ -15,6 +14,7 @@ import omit from 'lodash/omit';
import { settings } from '../../../../constants/Settings';
import { RowActionPropTypes, RowActionErrorPropTypes } from '../../TablePropTypes';
import { COLORS } from '../../../../styles/styles';
+import icons from '../../../../utils/bundledIcons';
import RowActionsError from './RowActionsError';
@@ -252,7 +252,9 @@ class RowActionsCell extends React.Component {
action.renderIcon ? (
{typeof action.renderIcon === 'string' ? (
-
+ React.createElement(icons[action.renderIcon], {
+ 'aria-label': action.labelText,
+ })
) : (
)}
diff --git a/src/components/Table/TableHead/FilterHeaderRow/FilterHeaderRow.jsx b/src/components/Table/TableHead/FilterHeaderRow/FilterHeaderRow.jsx
index 5c68e0096a..1155daa1a4 100644
--- a/src/components/Table/TableHead/FilterHeaderRow/FilterHeaderRow.jsx
+++ b/src/components/Table/TableHead/FilterHeaderRow/FilterHeaderRow.jsx
@@ -329,7 +329,6 @@ class FilterHeaderRow extends Component {
title={clearFilterText}
>
- {/* */}
) : null}
diff --git a/src/components/Table/TablePropTypes.js b/src/components/Table/TablePropTypes.js
index c3361cbf0d..a2f43a50ef 100644
--- a/src/components/Table/TablePropTypes.js
+++ b/src/components/Table/TablePropTypes.js
@@ -1,6 +1,7 @@
import PropTypes from 'prop-types';
import deprecate from '../../internal/deprecate';
+import { bundledIconNames } from '../../utils/bundledIcons';
export const RowActionPropTypes = PropTypes.arrayOf(
PropTypes.shape({
@@ -14,7 +15,7 @@ export const RowActionPropTypes = PropTypes.arrayOf(
viewBox: PropTypes.string.isRequired,
svgData: PropTypes.object.isRequired,
}),
- PropTypes.string,
+ PropTypes.oneOf(bundledIconNames),
PropTypes.node,
PropTypes.object,
PropTypes.func,
diff --git a/src/components/TableCard/TableCard.jsx b/src/components/TableCard/TableCard.jsx
index ec71f8cf93..7515bd4da8 100644
--- a/src/components/TableCard/TableCard.jsx
+++ b/src/components/TableCard/TableCard.jsx
@@ -1,5 +1,5 @@
import React, { useMemo, useCallback } from 'react';
-import { OverflowMenu, OverflowMenuItem, Icon, Link } from 'carbon-components-react';
+import { OverflowMenu, OverflowMenuItem, Link } from 'carbon-components-react';
import styled from 'styled-components';
import moment from 'moment';
import isNil from 'lodash/isNil';
@@ -22,6 +22,7 @@ import {
formatNumberWithPrecision,
getVariables,
} from '../../utils/cardUtilityFunctions';
+import icons from '../../utils/bundledIcons';
import ThresholdIcon from './ThresholdIcon';
@@ -330,19 +331,21 @@ const TableCard = ({
const renderActionCell = cellItem => {
const actionList = JSON.parse(cellItem.value);
return actionList && actionList.length === 1 ? (
- {
- evt.preventDefault();
- evt.stopPropagation();
- onCardAction(id, 'TABLE_CARD_ROW_ACTION', {
- rowId: cellItem.rowId,
- actionId: actionList[0].id,
- });
- }}
- icon={actionList[0].icon}
- description={actionList[0].label}
- />
+ React.createElement(
+ typeof actionList[0].icon === 'string' ? icons[actionList[0].icon] : actionList.icon,
+ {
+ className: `${iotPrefix}--table-card--action-icon`,
+ onClick: evt => {
+ evt.preventDefault();
+ evt.stopPropagation();
+ onCardAction(id, 'TABLE_CARD_ROW_ACTION', {
+ rowId: cellItem.rowId,
+ actionId: actionList[0].id,
+ });
+ },
+ 'aria-label': actionList[0].label,
+ }
+ )
) : actionList && actionList.length > 1 ? (
{
);
wrapper
- .find('Icon')
- .find({ icon: { name: 'icon--edit' } })
+ .find('.iot--table-card--action-icon')
.first()
.simulate('click');
expect(onCardAction.mock.calls).toHaveLength(1);
diff --git a/src/components/TableCard/__snapshots__/TableCard.story.storyshot b/src/components/TableCard/__snapshots__/TableCard.story.storyshot
index c36abeb415..22a7f7dae5 100644
--- a/src/components/TableCard/__snapshots__/TableCard.story.storyshot
+++ b/src/components/TableCard/__snapshots__/TableCard.story.storyshot
@@ -24573,18 +24573,23 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Table
@@ -24669,18 +24674,23 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Table
@@ -24765,18 +24775,23 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Table
@@ -24861,18 +24876,23 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Table
@@ -24957,18 +24977,23 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Table
@@ -25053,18 +25078,23 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Table
@@ -25149,18 +25179,23 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Table
@@ -25245,18 +25280,23 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Table
@@ -25341,18 +25381,23 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Table
@@ -25437,18 +25482,23 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Table
diff --git a/src/components/ValueCard/Attribute.jsx b/src/components/ValueCard/Attribute.jsx
index 580ece9545..75c959f8d1 100644
--- a/src/components/ValueCard/Attribute.jsx
+++ b/src/components/ValueCard/Attribute.jsx
@@ -2,7 +2,7 @@ import React from 'react';
import PropTypes from 'prop-types';
import styled from 'styled-components';
import isNil from 'lodash/isNil';
-import { Icon } from 'carbon-components-react';
+import { CaretUp16, CaretDown16 } from '@carbon/icons-react';
import withSize from 'react-sizeme';
import classNames from 'classnames';
@@ -10,7 +10,6 @@ import { CARD_LAYOUTS, CARD_SIZES } from '../../constants/LayoutConstants';
import { settings } from '../../constants/Settings';
import { getUpdatedCardSize } from '../../utils/cardUtilityFunctions';
import CardIcon from '../ImageCard/CardIcon';
-import icons from '../../utils/bundledIcons';
import ValueRenderer from './ValueRenderer';
import UnitRenderer from './UnitRenderer';
@@ -28,10 +27,6 @@ const StyledAttribute = styled.div`
: 'width: 50%'};
`;
-const TrendIcon = styled(Icon)`
- margin-right: 0.25rem;
-`;
-
const ThresholdIcon = styled(CardIcon)`
${props =>
props.color &&
@@ -210,9 +205,9 @@ const Attribute = ({
isMini={isMini}
>
{secondaryValue.trend && secondaryValue.trend === 'up' ? (
-
+
) : secondaryValue.trend === 'down' ? (
-
+
) : null}
{!isMini && secondaryValue.value}
diff --git a/src/components/ValueCard/__snapshots__/ValueCard.story.storyshot b/src/components/ValueCard/__snapshots__/ValueCard.story.storyshot
index 36bee09076..979532b16e 100644
--- a/src/components/ValueCard/__snapshots__/ValueCard.story.storyshot
+++ b/src/components/ValueCard/__snapshots__/ValueCard.story.storyshot
@@ -3573,20 +3573,19 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Value
>
@@ -3648,20 +3647,19 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Value
>
@@ -3723,20 +3721,19 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Value
>
@@ -4126,7 +4123,7 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Value
className="iot--value-card__attribute-threshold-icon-container"
>