Skip to content

Commit c1edd49

Browse files
authored
Test theme v2 upgrade (#968)
* chore: update other deps * chore: update deps * fix: gatsby v3 migration woes * more v3 fixes * chore: use node 14 * chore: up theme * fix: header and footer shadowing * fix: index and deps * fix: node version * chore: remove bg color override * chore: remove unused classes * chore: update theme * fix: homepage resource cards * chore: update theme w/ resource card fix
1 parent f15266b commit c1edd49

File tree

22 files changed

+6333
-8577
lines changed

22 files changed

+6333
-8577
lines changed

.babelrc

+1-15
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,4 @@
11
{
22
"plugins": ["@loadable/babel-plugin"],
3-
"presets": [
4-
[
5-
"babel-preset-gatsby",
6-
{
7-
"targets": {
8-
"browsers": [
9-
"last 1 edge version",
10-
"last 1 firefox version",
11-
"last 1 safari version",
12-
"last 1 chrome version"
13-
]
14-
}
15-
}
16-
]
17-
]
3+
"presets": ["babel-preset-gatsby"]
184
}

.nvmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v10
1+
v14

gatsby-config.js

-7
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@ module.exports = {
66
description:
77
'The IBM Design Language provides the guidance and assets used to express the IBM brand in products, communications, marketing, events and digital experiences.',
88
},
9-
flags: {
10-
FAST_DEV: true,
11-
FAST_REFRESH: true,
12-
PARALLEL_SOURCING: true,
13-
},
149
pathPrefix: '/design/language',
1510
plugins: [
1611
{
@@ -43,8 +38,6 @@ module.exports = {
4338
short_name: 'IDL',
4439
start_url: 'https://www.ibm.com/design/language/',
4540
icon: 'src/images/favicon.svg',
46-
background_color: '#f4f4f4',
47-
theme_color: '#0f62fe',
4841
},
4942
},
5043
`gatsby-plugin-sitemap`,

package.json

+16-16
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"version": "1.0.1",
66
"main": "src",
77
"engines": {
8-
"node": "^12 || ^13 || ^14"
8+
"node": "14.x"
99
},
1010
"browserslist": [
1111
"last 2 edge version",
@@ -58,37 +58,37 @@
5858
]
5959
},
6060
"dependencies": {
61-
"@carbon/colors": "^10.21.0",
61+
"@carbon/colors": "^10.26.0",
6262
"@carbon/icons": "^10.26.0",
6363
"@carbon/icons-react": "^10.26.0",
64-
"@carbon/layout": "^10.22.0",
64+
"@carbon/layout": "^10.25.0",
6565
"@carbon/pictograms": "^11.4.0",
6666
"@carbon/pictograms-react": "^11.4.0",
6767
"@ibm/plex": "^5.2.1",
6868
"@loadable/babel-plugin": "^5.12.0",
69-
"@loadable/component": "^5.12.0",
70-
"@loadable/webpack-plugin": "^5.12.0",
71-
"babel-preset-gatsby": "^0.5.2",
72-
"carbon-components": "^10.29.0",
73-
"carbon-components-react": "^7.29.0",
69+
"@loadable/component": "^5.15.0",
70+
"@loadable/webpack-plugin": "^5.15.0",
71+
"babel-preset-gatsby": "^1.7.1",
72+
"carbon-components": "^10.37.0",
73+
"carbon-components-react": "^7.37.1",
7474
"copy-to-clipboard": "^3.2.1",
7575
"fs-extra": "^8.1.0",
76-
"gatsby": "^2.31.1",
77-
"gatsby-plugin-manifest": "^2.2.5",
76+
"gatsby": "^3.7.2",
77+
"gatsby-plugin-manifest": "^3.7.1",
7878
"gatsby-plugin-remove-serviceworker": "^1.0.0",
79-
"gatsby-plugin-sitemap": "^2.4.12",
80-
"gatsby-theme-carbon": "^1.29.2",
79+
"gatsby-plugin-sitemap": "^4.3.1",
80+
"gatsby-theme-carbon": "^2.1.3",
8181
"lodash-es": "^4.17.15",
8282
"prop-types": "^15.7.2",
8383
"raw-loader": "^4.0.2",
84-
"react": "^16.8.6",
85-
"react-dom": "^16.8.6",
84+
"react": "^17.0.2",
85+
"react-dom": "^17.0.2",
8686
"react-lottie": "^1.2.3",
8787
"react-textarea-autosize": "^7.1.0",
8888
"use-media": "^1.4.0"
8989
},
9090
"devDependencies": {
91-
"@babel/core": "^7.10.5",
91+
"@babel/core": "^7.14.6",
9292
"babel-eslint": "^10.1.0",
9393
"carbon-icons": "^7.0.7",
9494
"eslint": "^7.4.0",
@@ -106,6 +106,6 @@
106106
"stylelint-scss": "^3.18.0",
107107
"svgo": "^2.3.0",
108108
"uuid": "^8.3.2",
109-
"webpack": "^4.43.0"
109+
"webpack": "^5.40.0"
110110
}
111111
}

src/components/SVGLibraries/IconLibrary/IconLibrary.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,15 @@ import loadable from '@loadable/component';
66

77
import useColumnCount from '../shared/useColumnCount';
88

9-
import {
10-
icons as iconMetaData,
11-
categories as iconCategoryMetadata,
12-
} from './metadata.json';
9+
import * as metadata from './metadata.json';
1310
import { svgPage, svgLibrary } from '../shared/SvgLibrary.module.scss';
1411

1512
import FilterRow from '../shared/FilterRow';
1613
import IconCategory from './IconCategory';
1714
import NoResult from '../shared/NoResult';
1815

16+
const { icons: iconMetaData, categories: iconCategoryMetadata } = metadata;
17+
1918
const IconLibrary = () => {
2019
const [iconComponents, setIconComponents] = useState([]);
2120
const [selectedCategory, setSelectedCategory] = useState('All icons');

src/components/SVGLibraries/PictogramLibrary/PictogramLibrary.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,16 @@ import { groupBy, debounce } from 'lodash-es';
66

77
import useColumnCount from '../shared/useColumnCount';
88

9-
import {
10-
icons as pictogramMetaData,
11-
categories as pictogramCatagoryMetadata,
12-
} from './metadata.json';
9+
import * as metadata from './metadata.json';
1310

1411
import FilterRow from '../shared/FilterRow';
1512
import { svgPage, svgLibrary } from '../shared/SvgLibrary.module.scss';
1613

1714
import PictogramCategory from './PictogramCategory';
1815
import NoResult from '../shared/NoResult';
1916

17+
const { icons: pictogramMetaData, categories: pictogramCategoryMetadata } = metadata;
18+
2019
const IconLibrary = () => {
2120
const [pictogramComponents, setPictogramComponents] = useState([]);
2221
const [selectedCategory, setSelectedCategory] = useState('All pictograms');
@@ -48,7 +47,7 @@ const IconLibrary = () => {
4847
[]
4948
);
5049

51-
setCategoryList(pictogramCatagoryMetadata.map(({ name }) => name).sort());
50+
setCategoryList(pictogramCategoryMetadata.map(({ name }) => name).sort());
5251
setCategoriesLoaded(true);
5352

5453
setPictogramComponents(pictogramArray);

src/components/SVGLibraries/shared/ActionBar.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { Button } from 'carbon-components-react';
66
import copy from 'copy-to-clipboard';
77
import cx from 'classnames';
88
import { LibraryContext } from './LibraryProvider';
9-
import styles from './ActionBar.module.scss';
9+
import {container, trigger, hidden, tooltip} from './ActionBar.module.scss';
1010

1111
const ActionBar = ({
1212
name,
@@ -56,8 +56,8 @@ const ActionBar = ({
5656
ref={actionBarRef}
5757
onBlur={handleBlurEvent}
5858
aria-hidden={!isActionBarVisible}
59-
className={cx(styles.container, {
60-
[styles.hidden]: !isActionBarVisible,
59+
className={cx(container, {
60+
[hidden]: !isActionBarVisible,
6161
})}>
6262
<Button
6363
kind="ghost"
@@ -69,8 +69,8 @@ const ActionBar = ({
6969
renderIcon={Download16}
7070
onFocus={() => setIsActionBarVisible(true)}
7171
onClick={handleDownload}
72-
className={styles.tooltip}
73-
triggerClassName={styles.trigger}
72+
className={tooltip}
73+
triggerClassName={trigger}
7474
/>
7575
{shouldShowCopyButton && (
7676
<Button
@@ -83,8 +83,8 @@ const ActionBar = ({
8383
renderIcon={Code16}
8484
onClick={handleCopy}
8585
onFocus={() => setIsActionBarVisible(true)}
86-
className={styles.tooltip}
87-
triggerClassName={styles.trigger}
86+
className={tooltip}
87+
triggerClassName={trigger}
8888
/>
8989
)}
9090
</div>

src/components/SVGLibraries/shared/NoResult.js

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import {
99

1010
import { Github } from './Icons';
1111
import { noResult, allSvgs, searchLabel } from './SvgLibrary.module.scss';
12-
import '../../../styles/Grid.module.scss';
1312

1413
const NoResult = ({
1514
allIconResults,

src/gatsby-theme-carbon/components/GifPlayer/GifPlayer.js

+18-9
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,16 @@ import {
1212
PauseOutline24,
1313
PauseOutlineFilled24,
1414
} from '@carbon/icons-react';
15-
import styles from 'gatsby-theme-carbon/src/components/GifPlayer/GifPlayer.module.scss';
15+
import {
16+
controls,
17+
dark,
18+
container,
19+
gifInDialog,
20+
imgHidden,
21+
imgDisplayed,
22+
gifDisplayed,
23+
gifHidden,
24+
} from 'gatsby-theme-carbon/src/components/GifPlayer/GifPlayer.module.scss';
1625

1726
const Pause = ({ hovering }) =>
1827
hovering ? <PauseOutlineFilled24 /> : <PauseOutline24 />;
@@ -68,24 +77,24 @@ const GifPlayer = ({ children, color, className, isInDialog }) => {
6877
};
6978

7079
const controlsClassNames = classnames({
71-
[styles.controls]: true,
72-
[styles.dark]: color === 'dark',
80+
[controls]: true,
81+
[dark]: color === 'dark',
7382
});
7483

7584
const containerClassNames = classnames({
76-
[styles.container]: true,
85+
[container]: true,
7786
[className]: className,
78-
[styles.gifInDialog]: isInDialog,
87+
[gifInDialog]: isInDialog,
7988
});
8089

8190
const staticImageClassNames = classnames({
82-
[styles.imgHidden]: true,
83-
[styles.imgDisplayed]: paused,
91+
[imgHidden]: true,
92+
[imgDisplayed]: paused,
8493
});
8594

8695
const gifClassNames = classnames({
87-
[styles.gifDisplayed]: true,
88-
[styles.gifHidden]: paused,
96+
[gifDisplayed]: true,
97+
[gifHidden]: paused,
8998
});
9099

91100
const childrenArray = React.Children.toArray(children);

src/pages/color.mdx

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ description:
88
import Carousel from '../components/Carousel';
99
import SwatchPaletteWidget from '../components/SwatchPaletteWidget';
1010
import ColorGrid from '../components/ColorGrid';
11-
import { noGutterSm } from '../styles/Grid.module.scss';
1211

1312
<PageDescription>
1413

src/pages/data-visualization/charts.mdx

-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ description: Charts are typically divided into categories based on their goals,
44
---
55

66
import OverviewCard from "../../components/OverviewCard";
7-
import { noGutterSm } from '../../styles/Grid.module.scss'
8-
97

108
<PageDescription>
119

src/pages/iconography/pictograms/usage.mdx

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ tabs: [Library, Design, Usage, Contribute]
77
---
88

99
import { Bee32 } from '@carbon/icons-react';
10-
import { noGutterSm } from '../../../styles/Grid.module.scss';
1110

1211
<PageDescription>
1312

src/pages/illustration/overview.mdx

-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ title: Overview
33
description: Our illustrations take on many forms and ultimately have a job to do. They should always have a clear purpose, support content and guide a user to understand difficult concepts, products or services. Clear and simple illustrations help us provide meaningful engagement to our users.
44
---
55

6-
import { noGutterSm } from '../../styles/Grid.module.scss';
7-
86
<PageDescription>
97

108
Our illustrations take on many forms and ultimately have a job to do. They should always have a clear purpose, support content and guide a user to understand difficult concepts, products or services. Clear and simple illustrations help us provide meaningful engagement to our users.

src/pages/index.mdx

+14-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import HomepageTemplate from 'gatsby-theme-carbon/src/templates/Homepage';
2-
import { h3 } from "gatsby-theme-carbon/src/components/markdown/Markdown.module.scss";
2+
import { h3 } from 'gatsby-theme-carbon/src/components/markdown/Markdown.module.scss';
33
import HomepageTile from '../components/HomepageTile';
44
import Carousel from '../components/Carousel';
55
import Helmet from '../components/Helmet';
6-
import { noGutterSm, noGutterMdLeft } from '../styles/Grid.module.scss';
7-
import "../styles/index.scss";
6+
import '../styles/index.scss';
87

98
export default HomepageTemplate;
109

@@ -21,6 +20,7 @@ export default HomepageTemplate;
2120
className="card-background"
2221
>
2322

23+
2424
![presentational animation of plex font](../images/homepage/landing-plex-animation.gif)
2525

2626
</ImageCard>
@@ -36,6 +36,7 @@ export default HomepageTemplate;
3636
className="card-background"
3737
>
3838

39+
3940
![IBM rebus logo](../images/homepage/philosophy-rebus.png)
4041

4142
</ImageCard>
@@ -51,6 +52,7 @@ export default HomepageTemplate;
5152
className="card-background"
5253
>
5354

55+
5456
![IBM rebus logo](../images/homepage/landing-color-grid.svg)
5557

5658
</ImageCard>
@@ -66,6 +68,7 @@ export default HomepageTemplate;
6668
className="card-background"
6769
>
6870

71+
6972
![grid of ibm colors](../images/homepage/photography_divers.jpg)
7073

7174
</ImageCard>
@@ -81,6 +84,7 @@ export default HomepageTemplate;
8184
className="card-background"
8285
>
8386

87+
8488
![grid of ibm colors](../images/homepage/illustration_isometric.png)
8589

8690
</ImageCard>
@@ -93,12 +97,14 @@ export default HomepageTemplate;
9397
className="card-background"
9498
>
9599

100+
96101
![IBM 2x grid](../images/homepage/grid-temp.png)
97102

98103
</ImageCard>
99104
</Column>
100105
</Row>
101106

107+
102108
<h2 classname={h3}>Tools, templates and assets</h2>
103109

104110
<Row className="homepage-cards resource-card-group">
@@ -197,6 +203,7 @@ export default HomepageTemplate;
197203
color="dark"
198204
>
199205

206+
200207
![Imagery](../images/homepage/whatsnew-plex-japanese.gif)
201208

202209
</ArticleCard>
@@ -210,6 +217,7 @@ export default HomepageTemplate;
210217
color="dark"
211218
>
212219

220+
213221
![IBM and Red Hat Experience Guide](../images/homepage/whatsnew_ibm_redhat.jpg)
214222

215223
</ArticleCard>
@@ -223,8 +231,10 @@ export default HomepageTemplate;
223231
color="dark"
224232
>
225233

234+
226235
![Expressive pictograms](../images/homepage/whatsnew_pictogram.png)
227236

228237
</ArticleCard>
229238
</Column>
230-
</Row>
239+
</Row>
240+

0 commit comments

Comments
 (0)