gatsby-theme-carbon 4.2.5 → 4.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/gatsby-node.mjs CHANGED
@@ -35,7 +35,7 @@ export const onPreBootstrap = ({ store, reporter }) => {
35
35
  // We can't do page queries from MDX templates, so we'll add the page's relative path to context after it's created.
36
36
  // The context object **is** supplied to MDX templates through the pageContext prop.
37
37
  export const onCreatePage = (
38
- { page, actions, getNodesByType, ...rest },
38
+ { page, actions, getNodesByType, ...rest }, // eslint-disable-line no-unused-vars
39
39
  pluginOptions
40
40
  ) => {
41
41
  // Don't override if it's already been provided
package/gatsby-ssr.js CHANGED
@@ -1,5 +1,3 @@
1
- /* eslint-disable react/no-unknown-property */
2
- /* eslint-disable react/no-danger */
3
1
  import React from 'react';
4
2
  import wrapRoot from './src/util/wrap-root-element';
5
3
  import { version } from './package.json';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-theme-carbon",
3
- "version": "4.2.5",
3
+ "version": "4.2.7",
4
4
  "main": "index.js",
5
5
  "author": "vpicone <vp@vincepic.one> (@vpicone)",
6
6
  "repository": {
@@ -18,28 +18,28 @@
18
18
  "react-dom": "^18.2.0"
19
19
  },
20
20
  "devDependencies": {
21
- "gatsby": "^5.13.6",
21
+ "gatsby": "^5.14.1",
22
22
  "react": "^18.3.1",
23
23
  "react-dom": "^18.3.1"
24
24
  },
25
25
  "dependencies": {
26
- "@babel/core": "^7.24.7",
26
+ "@babel/core": "^7.26.7",
27
27
  "@babel/plugin-proposal-class-properties": "^7.18.6",
28
28
  "@babel/plugin-syntax-jsx": "^7.25.9",
29
- "@carbon/elements": "^11.59.0",
30
- "@carbon/grid": "^11.30.0",
31
- "@carbon/pictograms-react": "^11.70.0",
32
- "@carbon/react": "^1.74.0",
33
- "@carbon/themes": "^11.45.0",
29
+ "@carbon/elements": "^11.60.0",
30
+ "@carbon/grid": "^11.31.0",
31
+ "@carbon/pictograms-react": "^11.71.1",
32
+ "@carbon/react": "^1.75.0",
33
+ "@carbon/themes": "^11.46.0",
34
34
  "@garcia-enterprise/gatsby-plugin-sass-resources": "^4.0.2",
35
- "@mdx-js/mdx": "^3.0.1",
36
- "@mdx-js/react": "^3.0.1",
35
+ "@mdx-js/mdx": "^3.1.0",
36
+ "@mdx-js/react": "^3.1.0",
37
37
  "@reach/router": "^1.3.4",
38
- "@vimeo/player": "^2.23.0",
38
+ "@vimeo/player": "^2.25.1",
39
39
  "beautiful-react-hooks": "^5.0.2",
40
40
  "classnames": "^2.5.1",
41
41
  "copy-to-clipboard": "^3.3.3",
42
- "focus-trap-react": "^10.2.3",
42
+ "focus-trap-react": "^10.3.1",
43
43
  "gatsby-plugin-catch-links": "^5.14.0",
44
44
  "gatsby-plugin-local-search": "^2.0.1",
45
45
  "gatsby-plugin-manifest": "^5.14.0",
@@ -58,15 +58,15 @@
58
58
  "lodash.startcase": "^4.4.0",
59
59
  "lodash.throttle": "^4.1.1",
60
60
  "mkdirp": "^3.0.1",
61
- "prism-react-renderer": "^2.3.1",
61
+ "prism-react-renderer": "^2.4.1",
62
62
  "prop-types": "^15.8.1",
63
63
  "react-helmet": "^6.1.0",
64
64
  "react-lunr": "^1.1.0",
65
65
  "react-transition-group": "^4.4.5",
66
- "react-use": "^17.5.0",
66
+ "react-use": "^17.6.0",
67
67
  "rehype-mdx-fenced-code-meta-support": "^1.0.4",
68
68
  "remark-gfm": "3.0.1",
69
- "sass": "^1.82.0",
69
+ "sass": "^1.84.0",
70
70
  "slugify": "^1.6.6",
71
71
  "smooth-scroll": "^16.1.3",
72
72
  "use-media": "^1.5.0",
@@ -108,9 +108,9 @@ const Code = ({ children, className: classNameProp = '', metaData }) => {
108
108
  })}
109
109
  style={style}>
110
110
  {getLines(tokens).map((line, i) => (
111
- <div {...getLineProps({ line, key: i })}>
111
+ <div {...getLineProps({ line, key: i })} key={i}>
112
112
  {line.map((token, key) => (
113
- <span {...getTokenProps({ token, key })} />
113
+ <span {...getTokenProps({ token, key })} key={key} />
114
114
  ))}
115
115
  </div>
116
116
  ))}
@@ -1,4 +1,3 @@
1
- /* eslint-disable import/no-duplicates */
2
1
  import React, { useContext, useEffect, useRef, useCallback } from 'react';
3
2
  import cx from 'classnames';
4
3
  import NavContext from '../../util/context/NavContext';
@@ -1,4 +1,3 @@
1
- /* eslint-disable jsx-a11y/label-has-associated-control */
2
1
  // eslint doesn't know about TextArea labeling
3
2
  import React, { useState } from 'react';
4
3
  import { TextArea } from '@carbon/react';
@@ -16,8 +16,6 @@ const NEUTRAL = 'feedback-form-neutral';
16
16
  const POSITIVE = 'feedback-form-positive';
17
17
 
18
18
  const Experience = React.forwardRef((props, ref) => {
19
- 'Experience';
20
-
21
19
  const [selected, setSelected] = useState(NEUTRAL);
22
20
 
23
21
  const onExperienceChange = (e) => {
@@ -98,4 +96,6 @@ const Experience = React.forwardRef((props, ref) => {
98
96
  );
99
97
  });
100
98
 
99
+ Experience.displayName = 'Experience';
100
+
101
101
  export default Experience;
@@ -1,7 +1,4 @@
1
1
  // https://www.w3.org/TR/wai-aria-practices/examples/combobox/aria1.1pattern/listbox-combo.html/#ex1
2
- /* eslint-disable jsx-a11y/label-has-for */
3
- /* eslint-disable jsx-a11y/label-has-associated-control */
4
- /* eslint-disable jsx-a11y/role-has-required-aria-props */
5
2
 
6
3
  import React, {
7
4
  useState,
@@ -13,7 +10,7 @@ import React, {
13
10
  } from 'react';
14
11
  import { useLunr } from 'react-lunr';
15
12
  import { Close, Search } from '@carbon/react/icons';
16
- import _throttle from 'lodash.throttle';
13
+ import _throttle from 'lodash.throttle'; // eslint-disable-line no-unused-vars
17
14
  import { graphql, navigate, useStaticQuery } from 'gatsby';
18
15
  import cx from 'classnames';
19
16
  import NavContext from '../../util/context/NavContext';
@@ -1,5 +1,5 @@
1
1
  // Gatsby doesn't include the recommended exceptions to this rule
2
- /* eslint-disable jsx-a11y/no-noninteractive-element-to-interactive-role */
2
+
3
3
  // https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-noninteractive-element-to-interactive-role.md#rule-details
4
4
 
5
5
  import React, { useEffect, createContext, useContext } from 'react';
@@ -131,8 +131,6 @@ function ImageGallery({ children, className }) {
131
131
  !isMobile &&
132
132
  ReactDOM.createPortal(
133
133
  <FocusTrap>
134
- {/* Because of FocusTrap, the key down events will propagate up removing the accessibility problem that would be created by having a keydown event listener on a non-interactive element. */}
135
- {/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */}
136
134
  <div
137
135
  role="group"
138
136
  className={inDialogGalleryContainer}
@@ -1,4 +1,3 @@
1
- /* eslint-disable import/no-unresolved */
2
1
  import React, { useEffect } from 'react';
3
2
 
4
3
  import Meta from './Meta';
@@ -8,6 +7,7 @@ import { Switcher } from './Switcher';
8
7
  import Footer from './Footer';
9
8
  import Container from './Container';
10
9
  import useMetadata from '../util/hooks/useMetadata';
10
+ import smoothScroll from 'smooth-scroll';
11
11
 
12
12
  import '../styles/index.scss';
13
13
 
@@ -25,8 +25,7 @@ const Layout = ({
25
25
  const { isSwitcherEnabled } = useMetadata();
26
26
 
27
27
  useEffect(() => {
28
- // eslint-disable-next-line global-require
29
- const scroll = require('smooth-scroll')('a[href*="#"]', {
28
+ const scroll = smoothScroll('a[href*="#"]', {
30
29
  speed: 400,
31
30
  durationMin: 250,
32
31
  durationMax: 700,
@@ -29,7 +29,7 @@ const LeftNavTree = ({ items, pathPrefix, theme }) => {
29
29
  // branch node with more than 1 leaf nodes
30
30
  if (item.pages && item.pages.length > 1) {
31
31
  item.isBranch = true;
32
- item.pages.forEach((SubNavItem, i) => assignNodeType(SubNavItem));
32
+ item.pages.forEach((SubNavItem) => assignNodeType(SubNavItem));
33
33
  }
34
34
  // if it is branch node with only one leaf node, convert it to a leaf node
35
35
  else if (item.pages && item.pages.length) {
@@ -185,6 +185,7 @@ LeftNavTree.propTypes = {
185
185
  ),
186
186
  };
187
187
 
188
+ // eslint-disable-next-line no-unused-vars
188
189
  const areEqual = (prevProps, nextProps) => true;
189
190
 
190
191
  export default memo(LeftNavTree, areEqual);
@@ -25,13 +25,13 @@ const LeftNavResourceLinks = ({
25
25
  [dividerSpace]: includeDividerSpace,
26
26
  })}
27
27
  />
28
+ {/* eslint-disable-next-line no-unused-vars */}
28
29
  {links.map(({ title, href, ...rest }, i) => {
29
30
  const outbound = !/^\/(?!\/)/.test(href);
30
31
  return (
31
32
  <SideNavLink
32
33
  key={i}
33
34
  renderIcon={outbound ? LaunchIcon : undefined}
34
- // eslint-disable-next-line jsx-a11y/aria-proptypes
35
35
  aria-current=""
36
36
  to={href}
37
37
  href={href}
@@ -1,4 +1,3 @@
1
- /* eslint-disable react/display-name */
2
1
  import React from 'react';
3
2
 
4
3
  import { P, H1, H2, H3, H4, H5, Ul, Ol, Li, Blockquote } from '../markdown';
@@ -29,6 +29,7 @@ const MediumPosts = ({ postLimit = 3, cardProps, ...rest }) => {
29
29
  <Row {...rest}>
30
30
  {allPosts.slice(0, postLimit).map((latestPost) => (
31
31
  <Column
32
+ key={latestPost.slug}
32
33
  colSm={4}
33
34
  colMd={4}
34
35
  colLg={4}
@@ -1,5 +1,5 @@
1
1
  // Gatsby doesn't include the recommended exceptions to this rule
2
- /* eslint-disable jsx-a11y/no-noninteractive-element-to-interactive-role */
2
+
3
3
  // https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-noninteractive-element-to-interactive-role.md#rule-details
4
4
 
5
5
  import React, {
@@ -130,7 +130,6 @@ const Video = ({
130
130
  {isPlaying ? 'Pause' : 'Play'}
131
131
  </span>
132
132
  </div>
133
- {/* eslint-disable-next-line jsx-a11y/media-has-caption */}
134
133
  <video
135
134
  autoPlay={autoPlay}
136
135
  className={video}
@@ -16,5 +16,4 @@ const Li = ({ children, ...rest }) =>
16
16
  )
17
17
  );
18
18
 
19
- // eslint-disable-next-line no-restricted-exports
20
19
  export { Li as default, LiConsumer };
@@ -3,6 +3,7 @@ import { OrderedList } from '@carbon/react';
3
3
  import { LiConsumer } from './Li.js';
4
4
  import { ordered } from './Markdown.module.scss';
5
5
 
6
+ // eslint-disable-next-line no-unused-vars
6
7
  const Ol = ({ children, className, ...rest }) =>
7
8
  React.createElement(LiConsumer, null, (value) => {
8
9
  if (value.hasListItemParent) {
@@ -3,6 +3,7 @@ import { UnorderedList } from '@carbon/react';
3
3
  import { LiConsumer } from './Li.js';
4
4
  import { unordered } from './Markdown.module.scss';
5
5
 
6
+ // eslint-disable-next-line no-unused-vars
6
7
  const Ul = ({ children, className, ...rest }) =>
7
8
  React.createElement(LiConsumer, null, (value) => {
8
9
  if (value.hasListItemParent) {
@@ -2,7 +2,7 @@ import { useState, useEffect, useLayoutEffect } from 'react';
2
2
 
3
3
  let serverHandoffComplete = false;
4
4
  let globalIndex = 0;
5
- // eslint-disable-next-line no-plusplus
5
+
6
6
  const genId = () => ++globalIndex;
7
7
 
8
8
  // https://medium.com/@alexandereardon/uselayouteffect-and-ssr-192986cdcf7a
@@ -28,7 +28,6 @@ export const useId = (label) => {
28
28
  */
29
29
  setId(genId());
30
30
  }
31
- // eslint-disable-next-line react-hooks/exhaustive-deps
32
31
  }, []);
33
32
 
34
33
  useEffect(() => {
@@ -12,6 +12,7 @@ try {
12
12
  window.addEventListener('testPassive', null, opts);
13
13
  window.removeEventListener('testPassive', null, opts);
14
14
  } catch (e) {
15
+ console.warn(e);
15
16
  passiveListenerSupported = false;
16
17
  }
17
18
 
@@ -13,6 +13,7 @@ try {
13
13
  window.addEventListener('testPassive', null, opts);
14
14
  window.removeEventListener('testPassive', null, opts);
15
15
  } catch (e) {
16
+ console.warn(e);
16
17
  passiveListenerSupported = false;
17
18
  }
18
19