Skip to content

Commit

Permalink
Merge branch 'master' into node-12
Browse files Browse the repository at this point in the history
  • Loading branch information
scottdickerson authored Jun 2, 2020
2 parents fa2eec9 + d93e73b commit f0537ec
Show file tree
Hide file tree
Showing 29 changed files with 826 additions and 752 deletions.
2 changes: 1 addition & 1 deletion README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 0 additions & 2 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -137,7 +136,6 @@ export default [
'styled-components',
'prop-types',
'carbon-components-react',
'carbon-icons',
'@carbon/icons',
'@carbon/icons-react',
'carbon-components',
Expand Down
3 changes: 0 additions & 3 deletions src/components/Button/Button.story.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand All @@ -22,8 +21,6 @@ const icons = {
};

const iconMap = {
iconAddSolid,
iconSearch,
Add16,
Search16,
};
Expand Down
6 changes: 3 additions & 3 deletions src/components/Dashboard/CardRenderer.test.jsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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={[
{
Expand Down
13 changes: 6 additions & 7 deletions src/components/Dashboard/Dashboard.test.jsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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: <Add /> },
{ id: 'add', labelText: 'Add', icon: <Add20 /> },
{ id: 'custom', labelText: 'Custom', customActionComponent: <CustomIcon /> },
]}
cards={cardValues}
Expand All @@ -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: <Add20 /> },
]}
cards={cardValues}
onDashboardAction={onClick}
Expand Down Expand Up @@ -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: <Add20 /> },
]}
cards={cardValues}
onDashboardAction={onClick}
Expand All @@ -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: <Add20 /> },
]}
cards={cardValues}
onDashboardAction={onClick}
Expand All @@ -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: <Add20 /> },
]}
cards={cardValues}
onDashboardAction={onClick}
Expand Down
17 changes: 6 additions & 11 deletions src/components/Dashboard/DashboardHeader.jsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -99,19 +99,14 @@ const DashboardHeader = ({
}}
>
{typeof action.icon === 'string' ? (
<Icon
key={`icon-${action.id}`}
icon={icons[action.icon]}
description={action.labelText}
/>
React.createElement(icons[action.icon], {
'aria-label': action.labelText,
key: `icon-${action.id}`,
})
) : React.isValidElement(action.icon) ? (
action.icon
) : (
<Icon
key={`icon-${action.id}`}
icon={action.icon}
description={action.labelText}
/>
<action.icon aria-label={action.labelText} key={`icon-${action.id}`} />
)}
</div>
) : (
Expand Down
Loading

0 comments on commit f0537ec

Please sign in to comment.