gatsby-theme-carbon 4.2.6 → 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 +1 -1
- package/gatsby-ssr.js +0 -2
- package/package.json +11 -11
- package/src/components/Code/Code.js +2 -2
- package/src/components/Container/Container.js +0 -1
- package/src/components/FeedbackDialog/Comment.js +0 -1
- package/src/components/FeedbackDialog/Experience.js +2 -2
- package/src/components/GlobalSearch/GlobalSearch.js +1 -4
- package/src/components/GlobalSearch/Menu.js +1 -1
- package/src/components/ImageGallery/ImageGallery.js +0 -2
- package/src/components/Layout.js +2 -3
- package/src/components/LeftNav/LeftNavTree.js +2 -1
- package/src/components/LeftNav/ResourceLinks.js +1 -1
- package/src/components/MDXProvider/defaultComponents.js +0 -1
- package/src/components/MediumPosts/MediumPosts.js +1 -0
- package/src/components/Tabs/Tabs.js +1 -1
- package/src/components/Video/Video.js +0 -1
- package/src/components/markdown/Li.js +0 -1
- package/src/components/markdown/Ol.js +1 -0
- package/src/components/markdown/Ul.js +1 -0
- package/src/util/hooks/useId.js +1 -2
- package/src/util/hooks/useOnClickOutside.js +1 -0
- package/src/util/hooks/useScrollPosition.js +1 -0
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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gatsby-theme-carbon",
|
|
3
|
-
"version": "4.2.
|
|
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.
|
|
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.
|
|
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
29
|
"@carbon/elements": "^11.60.0",
|
|
30
30
|
"@carbon/grid": "^11.31.0",
|
|
31
|
-
"@carbon/pictograms-react": "^11.71.
|
|
31
|
+
"@carbon/pictograms-react": "^11.71.1",
|
|
32
32
|
"@carbon/react": "^1.75.0",
|
|
33
33
|
"@carbon/themes": "^11.46.0",
|
|
34
34
|
"@garcia-enterprise/gatsby-plugin-sass-resources": "^4.0.2",
|
|
35
|
-
"@mdx-js/mdx": "^3.0
|
|
36
|
-
"@mdx-js/react": "^3.0
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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
|
))}
|
|
@@ -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
|
-
|
|
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}
|
package/src/components/Layout.js
CHANGED
|
@@ -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
|
-
|
|
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
|
|
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,5 +1,5 @@
|
|
|
1
1
|
// Gatsby doesn't include the recommended exceptions to this rule
|
|
2
|
-
|
|
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, {
|
|
@@ -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) {
|
package/src/util/hooks/useId.js
CHANGED
|
@@ -2,7 +2,7 @@ import { useState, useEffect, useLayoutEffect } from 'react';
|
|
|
2
2
|
|
|
3
3
|
let serverHandoffComplete = false;
|
|
4
4
|
let globalIndex = 0;
|
|
5
|
-
|
|
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(() => {
|