gatsby-theme-carbon 4.2.0 → 4.2.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-theme-carbon",
3
- "version": "4.2.0",
3
+ "version": "4.2.2",
4
4
  "main": "index.js",
5
5
  "author": "vpicone <vp@vincepic.one> (@vpicone)",
6
6
  "repository": {
@@ -8,7 +8,8 @@
8
8
  "type": "git"
9
9
  },
10
10
  "publishConfig": {
11
- "registry": "https://registry.npmjs.org"
11
+ "access": "public",
12
+ "provenance": true
12
13
  },
13
14
  "license": "Apache 2.0",
14
15
  "peerDependencies": {
@@ -10,6 +10,12 @@ import {
10
10
  Email,
11
11
  } from '@carbon/react/icons';
12
12
 
13
+ const defaults = {
14
+ color: 'light',
15
+ disabled: false,
16
+ actionIcon: '',
17
+ };
18
+
13
19
  export default class ArticleCard extends React.Component {
14
20
  render() {
15
21
  const {
@@ -20,9 +26,9 @@ export default class ArticleCard extends React.Component {
20
26
  author,
21
27
  date,
22
28
  readTime,
23
- color,
24
- disabled,
25
- actionIcon,
29
+ color = defaults.color,
30
+ disabled = defaults.disabled,
31
+ actionIcon = defaults.actionIcon,
26
32
  className,
27
33
  ...rest
28
34
  } = this.props;
@@ -168,9 +174,3 @@ ArticleCard.propTypes = {
168
174
  */
169
175
  className: PropTypes.string,
170
176
  };
171
-
172
- ArticleCard.defaultProps = {
173
- color: 'light',
174
- disabled: false,
175
- actionIcon: '',
176
- };
@@ -28,7 +28,15 @@ const Anchor = ({ id, string, position }) => {
28
28
  );
29
29
  };
30
30
 
31
- const AutolinkHeader = ({ is: Component, className, ...props }) => {
31
+ const defaults = {
32
+ is: 'h2',
33
+ };
34
+
35
+ const AutolinkHeader = ({
36
+ is: Component = defaults.is,
37
+ className,
38
+ ...props
39
+ }) => {
32
40
  const isMobile = useMedia({ maxWidth: breakpoints.md.width });
33
41
 
34
42
  const string = React.Children.map(
@@ -48,6 +56,4 @@ const AutolinkHeader = ({ is: Component, className, ...props }) => {
48
56
  );
49
57
  };
50
58
 
51
- AutolinkHeader.defaultProps = { is: 'h2' };
52
-
53
59
  export default AutolinkHeader;
@@ -5,6 +5,9 @@ import { CheckmarkFilled, Misuse } from '@carbon/react/icons';
5
5
  import { Column } from '../Grid';
6
6
  import * as styles from './DoDontRow.module.scss';
7
7
 
8
+ const defaults = {
9
+ type: 'do',
10
+ };
8
11
  export default class DoDont extends React.Component {
9
12
  static renderCaption = (caption, captionTitle) => {
10
13
  if (caption || captionTitle) {
@@ -25,7 +28,7 @@ export default class DoDont extends React.Component {
25
28
  text,
26
29
  aspectRatio,
27
30
  color,
28
- type,
31
+ type = defaults.type,
29
32
  className,
30
33
  ...columnProps
31
34
  } = this.props;
@@ -79,10 +82,6 @@ export default class DoDont extends React.Component {
79
82
  }
80
83
  }
81
84
 
82
- DoDont.defaultProps = {
83
- type: 'do',
84
- };
85
-
86
85
  DoDont.propTypes = {
87
86
  children: PropTypes.node,
88
87
  /** title for the caption (optional) */
@@ -6,6 +6,10 @@ import { AspectRatio } from '@carbon/react';
6
6
  import { Row, Column } from '../Grid';
7
7
  import ResourceCard from '../ResourceCard';
8
8
 
9
+ const defaults = {
10
+ disabled: false,
11
+ actionIcon: 'launch',
12
+ };
9
13
  export default class FeatureCard extends React.Component {
10
14
  render() {
11
15
  const {
@@ -14,8 +18,8 @@ export default class FeatureCard extends React.Component {
14
18
  subTitle,
15
19
  title,
16
20
  color,
17
- disabled,
18
- actionIcon,
21
+ disabled = defaults.disabled,
22
+ actionIcon = defaults.actionIcon,
19
23
  className,
20
24
  ...resourceCardProps
21
25
  } = this.props;
@@ -123,8 +127,3 @@ FeatureCard.propTypes = {
123
127
  */
124
128
  resourceCardProps: PropTypes.object,
125
129
  };
126
-
127
- FeatureCard.defaultProps = {
128
- disabled: false,
129
- actionIcon: 'launch',
130
- };
@@ -11,7 +11,60 @@ import {
11
11
  content,
12
12
  } from './Footer.module.scss';
13
13
 
14
- const Footer = ({ Content, links, Logo }) => {
14
+ const IBMLogo = () => (
15
+ <svg
16
+ className={logo}
17
+ width="81"
18
+ height="32"
19
+ xmlns="http://www.w3.org/2000/svg">
20
+ <g fillRule="evenodd">
21
+ <path d="M0 32h15.689v-2.038H0zM0 27.721h15.689v-2.038H0zM4.483 23.442h6.724v-2.037H4.483zM4.483 19.164h6.724v-2.038H4.483zM4.483 14.885h6.724v-2.037H4.483zM4.482 10.606h6.724V8.568H4.482zM0 6.327h15.689V4.29H0zM0 2.049h15.689V.011H0zM17.93 29.963V32h16.504a8.521 8.521 0 0 0 5.54-2.037H17.93zM17.93 25.683v2.038h23.914a8.535 8.535 0 0 0 .85-2.038H17.93zM22.412 23.442h6.724v-2.037h-6.724zM40.124 17.126H22.412v2.038H41.77a8.62 8.62 0 0 0-1.645-2.038M22.413 12.848v2.036h17.786a8.612 8.612 0 0 0 1.644-2.037h-19.43zM42.693 6.327a8.447 8.447 0 0 0-.85-2.037H17.93v2.037h24.763zM39.974 2.049a8.521 8.521 0 0 0-5.54-2.037H17.93v2.037h22.044zM22.412 10.606h6.724V8.568h-6.724zM35.453 10.606h7.29a8.603 8.603 0 0 0 .248-2.038h-7.538v2.038zM35.453 21.405v2.037h7.538c0-.703-.09-1.384-.248-2.037h-7.29zM57.457 0H44.825v2.038h13.34zM44.826 32h11.21v-2.038h-11.21zM44.826 27.72h11.21v-2.038h-11.21zM49.309 23.439h6.727v-2.038h-6.727zM49.309 19.159h6.727v-2.038h-6.727zM69.488 32h11.21v-2.038h-11.21zM69.488 27.72h11.21v-2.038h-11.21zM69.488 23.439h6.726v-2.038h-6.726zM69.487 19.159h6.726v-2.038h-6.726zM69.488 14.879h6.726V12.84H63.606l-.707 2.038h5.903l.686-1.94zM61.916 12.84H49.31v2.039h6.726v-1.94l.686 1.94h5.903zM76.213 8.56H65.091l-.707 2.038h11.83zM68.06 0l-.706 2.038h13.344V0zM62.757 32l.72-2.038h-1.432zM61.254 27.72h3.015l.72-2.038h-4.455zM59.743 23.44h6.037l.72-2.039h-7.476zM58.232 19.159h9.06l.719-2.038h-10.5zM49.309 10.598h11.83l-.707-2.038H49.309zM65.868 6.318h14.83V4.28H66.576zM58.947 4.28H44.826v2.038h14.828z" />
22
+ </g>
23
+ </svg>
24
+ );
25
+
26
+ const DefaultContent = () => (
27
+ <p>
28
+ Shadow this content by importing the theme Footer and supplying your own
29
+ props.
30
+ </p>
31
+ );
32
+
33
+ const defaults = {
34
+ links: {
35
+ firstCol: [
36
+ { href: 'https://www.ibm.com/design', linkText: 'Sample' },
37
+ { href: 'https://www.ibm.com/design', linkText: 'Links' },
38
+ {
39
+ href: 'https://www.ibm.com/design',
40
+ linkText: 'Column',
41
+ },
42
+ { href: 'https://www.ibm.com/design', linkText: 'One' },
43
+ ],
44
+ secondCol: [
45
+ {
46
+ href: 'https://www.ibm.com/design',
47
+ linkText: 'Dribbble',
48
+ },
49
+ {
50
+ href: 'https://www.ibm.com/design',
51
+ linkText: 'Medium',
52
+ },
53
+ {
54
+ href: 'https://www.ibm.com/design',
55
+ linkText: 'Twitter',
56
+ },
57
+ ],
58
+ },
59
+ Content: DefaultContent,
60
+ Logo: IBMLogo,
61
+ };
62
+
63
+ const Footer = ({
64
+ Content = defaults.Content,
65
+ links = defaults.links,
66
+ Logo = defaults.Logo,
67
+ }) => {
15
68
  const { firstCol, secondCol } = links;
16
69
  const { site } = useStaticQuery(graphql`
17
70
  query BUILD_TIME_QUERY {
@@ -67,55 +120,6 @@ const Footer = ({ Content, links, Logo }) => {
67
120
  );
68
121
  };
69
122
 
70
- const IBMLogo = () => (
71
- <svg
72
- className={logo}
73
- width="81"
74
- height="32"
75
- xmlns="http://www.w3.org/2000/svg">
76
- <g fillRule="evenodd">
77
- <path d="M0 32h15.689v-2.038H0zM0 27.721h15.689v-2.038H0zM4.483 23.442h6.724v-2.037H4.483zM4.483 19.164h6.724v-2.038H4.483zM4.483 14.885h6.724v-2.037H4.483zM4.482 10.606h6.724V8.568H4.482zM0 6.327h15.689V4.29H0zM0 2.049h15.689V.011H0zM17.93 29.963V32h16.504a8.521 8.521 0 0 0 5.54-2.037H17.93zM17.93 25.683v2.038h23.914a8.535 8.535 0 0 0 .85-2.038H17.93zM22.412 23.442h6.724v-2.037h-6.724zM40.124 17.126H22.412v2.038H41.77a8.62 8.62 0 0 0-1.645-2.038M22.413 12.848v2.036h17.786a8.612 8.612 0 0 0 1.644-2.037h-19.43zM42.693 6.327a8.447 8.447 0 0 0-.85-2.037H17.93v2.037h24.763zM39.974 2.049a8.521 8.521 0 0 0-5.54-2.037H17.93v2.037h22.044zM22.412 10.606h6.724V8.568h-6.724zM35.453 10.606h7.29a8.603 8.603 0 0 0 .248-2.038h-7.538v2.038zM35.453 21.405v2.037h7.538c0-.703-.09-1.384-.248-2.037h-7.29zM57.457 0H44.825v2.038h13.34zM44.826 32h11.21v-2.038h-11.21zM44.826 27.72h11.21v-2.038h-11.21zM49.309 23.439h6.727v-2.038h-6.727zM49.309 19.159h6.727v-2.038h-6.727zM69.488 32h11.21v-2.038h-11.21zM69.488 27.72h11.21v-2.038h-11.21zM69.488 23.439h6.726v-2.038h-6.726zM69.487 19.159h6.726v-2.038h-6.726zM69.488 14.879h6.726V12.84H63.606l-.707 2.038h5.903l.686-1.94zM61.916 12.84H49.31v2.039h6.726v-1.94l.686 1.94h5.903zM76.213 8.56H65.091l-.707 2.038h11.83zM68.06 0l-.706 2.038h13.344V0zM62.757 32l.72-2.038h-1.432zM61.254 27.72h3.015l.72-2.038h-4.455zM59.743 23.44h6.037l.72-2.039h-7.476zM58.232 19.159h9.06l.719-2.038h-10.5zM49.309 10.598h11.83l-.707-2.038H49.309zM65.868 6.318h14.83V4.28H66.576zM58.947 4.28H44.826v2.038h14.828z" />
78
- </g>
79
- </svg>
80
- );
81
-
82
- const DefaultContent = () => (
83
- <p>
84
- Shadow this content by importing the theme Footer and supplying your own
85
- props.
86
- </p>
87
- );
88
-
89
- Footer.defaultProps = {
90
- links: {
91
- firstCol: [
92
- { href: 'https://www.ibm.com/design', linkText: 'Sample' },
93
- { href: 'https://www.ibm.com/design', linkText: 'Links' },
94
- {
95
- href: 'https://www.ibm.com/design',
96
- linkText: 'Column',
97
- },
98
- { href: 'https://www.ibm.com/design', linkText: 'One' },
99
- ],
100
- secondCol: [
101
- {
102
- href: 'https://www.ibm.com/design',
103
- linkText: 'Dribbble',
104
- },
105
- {
106
- href: 'https://www.ibm.com/design',
107
- linkText: 'Medium',
108
- },
109
- {
110
- href: 'https://www.ibm.com/design',
111
- linkText: 'Twitter',
112
- },
113
- ],
114
- },
115
- Content: DefaultContent,
116
- Logo: IBMLogo,
117
- };
118
-
119
123
  Footer.propTypes = {
120
124
  /**
121
125
  * Specify the first and second columns of your links
@@ -18,7 +18,17 @@ const Play = ({ hovering }) =>
18
18
  const ToggleIcon = ({ paused, hovering }) =>
19
19
  paused ? <Play hovering={hovering} /> : <Pause hovering={hovering} />;
20
20
 
21
- const GifPlayer = ({ children, color, className, isInDialog }) => {
21
+ const defaults = {
22
+ color: 'light',
23
+ isInDialog: false,
24
+ };
25
+
26
+ const GifPlayer = ({
27
+ children,
28
+ color = defaults.color,
29
+ className,
30
+ isInDialog = defaults.isInDialog,
31
+ }) => {
22
32
  const [paused, setPaused] = useState(false);
23
33
 
24
34
  const [hovering, setHovering] = useState(false);
@@ -96,9 +106,4 @@ GifPlayer.propTypes = {
96
106
  isInDialog: PropTypes.bool,
97
107
  };
98
108
 
99
- GifPlayer.defaultProps = {
100
- color: 'light',
101
- isInDialog: false,
102
- };
103
-
104
109
  export default GifPlayer;
@@ -34,11 +34,15 @@ Row.propTypes = {
34
34
  className: PropTypes.string,
35
35
  };
36
36
 
37
+ const colDefaults = {
38
+ colLg: 12,
39
+ };
40
+
37
41
  export const Column = ({
38
42
  children,
39
43
  colSm,
40
44
  colMd,
41
- colLg,
45
+ colLg = colDefaults.colLg,
42
46
  colXl,
43
47
  colMax,
44
48
  offsetSm,
@@ -94,10 +98,6 @@ export const Column = ({
94
98
  );
95
99
  };
96
100
 
97
- Column.defaultProps = {
98
- colLg: 12,
99
- };
100
-
101
101
  Column.propTypes = {
102
102
  children: PropTypes.node,
103
103
  /**
@@ -17,7 +17,17 @@ import useMetadata from '../../util/hooks/useMetadata';
17
17
 
18
18
  import * as styles from './Header.module.scss';
19
19
 
20
- const Header = ({ children }) => {
20
+ const DefaultHeaderText = () => (
21
+ <>
22
+ Carbon&nbsp;<span>Design System</span>
23
+ </>
24
+ );
25
+
26
+ const defaults = {
27
+ children: <DefaultHeaderText />,
28
+ };
29
+
30
+ const Header = ({ children = defaults.children }) => {
21
31
  const {
22
32
  leftNavIsOpen,
23
33
  toggleNavState,
@@ -75,14 +85,4 @@ const Header = ({ children }) => {
75
85
  );
76
86
  };
77
87
 
78
- const DefaultHeaderText = () => (
79
- <>
80
- Carbon&nbsp;<span>Design System</span>
81
- </>
82
- );
83
-
84
- Header.defaultProps = {
85
- children: <DefaultHeaderText />,
86
- };
87
-
88
88
  export default Header;
@@ -12,9 +12,30 @@ const getBackgroundColor = (backgroundColor) =>
12
12
  const getColor = (color) =>
13
13
  theme.colors[color] || color || theme.colors.inverse01;
14
14
 
15
+ const defaults = {
16
+ leftText: function renderLeftText() {
17
+ return (
18
+ <>
19
+ Think → <strong>Guide</strong>
20
+ </>
21
+ );
22
+ },
23
+ rightText: function renderRightText() {
24
+ return (
25
+ <p>
26
+ <strong>Build Bonds.</strong>
27
+ <br />
28
+ This is the guiding ethos behind IBM’s design philosophy and principles.
29
+ This helps us distinguish every element and every experience Designed by
30
+ IBM.
31
+ </p>
32
+ );
33
+ },
34
+ };
35
+
15
36
  const HomepageCallout = ({
16
- leftText,
17
- rightText,
37
+ leftText = defaults.leftText,
38
+ rightText = defaults.rightText,
18
39
  backgroundColor: backgroundColorProp,
19
40
  color: colorProp,
20
41
  ...rest
@@ -38,25 +59,4 @@ const HomepageCallout = ({
38
59
  );
39
60
  };
40
61
 
41
- HomepageCallout.defaultProps = {
42
- leftText: function renderLeftText() {
43
- return (
44
- <>
45
- Think → <strong>Guide</strong>
46
- </>
47
- );
48
- },
49
- rightText: function renderRightText() {
50
- return (
51
- <p>
52
- <strong>Build Bonds.</strong>
53
- <br />
54
- This is the guiding ethos behind IBM’s design philosophy and principles.
55
- This helps us distinguish every element and every experience Designed by
56
- IBM.
57
- </p>
58
- );
59
- },
60
- };
61
-
62
62
  export default HomepageCallout;
@@ -10,6 +10,15 @@ import {
10
10
  Email,
11
11
  } from '@carbon/react/icons';
12
12
 
13
+ const defaults = {
14
+ disabled: false,
15
+ aspectRatio: '1:1',
16
+ titleColor: 'light',
17
+ subTitleColor: 'light',
18
+ iconColor: 'light',
19
+ hoverColor: 'light',
20
+ };
21
+
13
22
  export default class ImageCard extends React.Component {
14
23
  render() {
15
24
  const {
@@ -17,12 +26,12 @@ export default class ImageCard extends React.Component {
17
26
  href,
18
27
  subTitle,
19
28
  title,
20
- titleColor,
21
- subTitleColor,
22
- iconColor,
23
- hoverColor,
24
- disabled,
25
- aspectRatio,
29
+ titleColor = defaults.titleColor,
30
+ subTitleColor = defaults.subTitleColor,
31
+ iconColor = defaults.iconColor,
32
+ hoverColor = defaults.hoverColor,
33
+ disabled = defaults.disabled,
34
+ aspectRatio = defaults.aspectRatio,
26
35
  actionIcon,
27
36
  className,
28
37
  ...rest
@@ -181,12 +190,3 @@ ImageCard.propTypes = {
181
190
  */
182
191
  linkProps: PropTypes.object,
183
192
  };
184
-
185
- ImageCard.defaultProps = {
186
- disabled: false,
187
- aspectRatio: '1:1',
188
- titleColor: 'light',
189
- subTitleColor: 'light',
190
- iconColor: 'light',
191
- hoverColor: 'light',
192
- };
@@ -12,6 +12,13 @@ import {
12
12
  } from '@carbon/react/icons';
13
13
  import { AspectRatio } from '@carbon/react';
14
14
 
15
+ const defaults = {
16
+ color: 'light',
17
+ disabled: false,
18
+ aspectRatio: '2:1',
19
+ actionIcon: 'launch',
20
+ };
21
+
15
22
  export default class ResourceCard extends React.Component {
16
23
  render() {
17
24
  const {
@@ -19,10 +26,10 @@ export default class ResourceCard extends React.Component {
19
26
  href,
20
27
  subTitle,
21
28
  title,
22
- color,
23
- disabled,
24
- aspectRatio,
25
- actionIcon,
29
+ color = defaults.color,
30
+ disabled = defaults.disabled,
31
+ aspectRatio = defaults.aspectRatio,
32
+ actionIcon = defaults.actionIcon,
26
33
  className,
27
34
  ...rest
28
35
  } = this.props;
@@ -150,10 +157,3 @@ ResourceCard.propTypes = {
150
157
  */
151
158
  className: PropTypes.string,
152
159
  };
153
-
154
- ResourceCard.defaultProps = {
155
- color: 'light',
156
- disabled: false,
157
- aspectRatio: '2:1',
158
- actionIcon: 'launch',
159
- };
@@ -12,19 +12,26 @@ import {
12
12
  import { Column } from '../Grid';
13
13
  import * as styles from './SquareCard.module.scss';
14
14
 
15
+ const defaults = {
16
+ color: 'light',
17
+ disabled: false,
18
+ smallTitle: false,
19
+ actionIcon: 'arrowRight',
20
+ };
21
+
15
22
  export default class SquareCard extends React.Component {
16
23
  render() {
17
24
  const {
18
25
  children,
19
26
  href,
20
27
  title,
21
- smallTitle,
22
- disabled,
28
+ smallTitle = defaults.smallTitle,
29
+ disabled = defaults.disabled,
23
30
  bodyText,
24
31
  helperText,
25
32
  className,
26
- actionIcon,
27
- color,
33
+ actionIcon = defaults.actionIcon,
34
+ color = defaults.color,
28
35
  ...rest
29
36
  } = this.props;
30
37
 
@@ -158,10 +165,3 @@ SquareCard.propTypes = {
158
165
  */
159
166
  className: PropTypes.string,
160
167
  };
161
-
162
- SquareCard.defaultProps = {
163
- color: 'light',
164
- disabled: false,
165
- smallTitle: false,
166
- actionIcon: 'arrowRight',
167
- };
@@ -5,7 +5,69 @@ import { Locked } from '@carbon/react/icons';
5
5
  import NavContext from '../../util/context/NavContext';
6
6
  import { nav, open, divider, link, linkDisabled } from './Switcher.module.scss';
7
7
 
8
- const Switcher = ({ children }) => {
8
+ // https://css-tricks.com/using-css-transitions-auto-dimensions/
9
+ // Note: if you change this, update the max-height in the switcher stylesheet
10
+ const DefaultChildren = () => (
11
+ <>
12
+ <SwitcherDivider>Foundations</SwitcherDivider>
13
+ <SwitcherLink href="https://ibm.com/brand" isInternal>
14
+ IBM Brand Center
15
+ </SwitcherLink>
16
+ <SwitcherLink href="https://ibm.com/design/language">
17
+ IBM Design Language
18
+ </SwitcherLink>
19
+ <SwitcherDivider>Implementation</SwitcherDivider>
20
+ <SwitcherLink href="https://www.carbondesignsystem.com/">
21
+ Carbon Design System
22
+ </SwitcherLink>
23
+ <SwitcherLink href="http://ibm.biz/carbon4ibmproducts" isInternal>
24
+ Carbon for IBM Products
25
+ </SwitcherLink>
26
+ <SwitcherLink href="https://ibm.biz/carbon4cloud" isInternal>
27
+ Carbon for Cloud
28
+ </SwitcherLink>
29
+ <SwitcherLink href="https://www.ibm.com/standards/carbon/">
30
+ Carbon for IBM.com
31
+ </SwitcherLink>
32
+ <SwitcherLink href="https://www.ibm.com/design/event/">
33
+ IBM Event Design
34
+ </SwitcherLink>
35
+ <SwitcherLink href="https://www.ibm.com/design/workplace/">
36
+ IBM Workplace Design
37
+ </SwitcherLink>
38
+ <SwitcherDivider>Practices</SwitcherDivider>
39
+ <SwitcherLink href="https://www.ibm.com/design/thinking/">
40
+ Enterprise Design Thinking
41
+ </SwitcherLink>
42
+ <SwitcherLink href="https://www.ibm.com/able/">
43
+ IBM Accessibility
44
+ </SwitcherLink>
45
+ <SwitcherLink href="https://www.ibm.com/design/ai">
46
+ IBM Design for AI
47
+ </SwitcherLink>
48
+ <SwitcherLink href="https://www.ibm.com/design/research/">
49
+ IBM Design Research
50
+ </SwitcherLink>
51
+ <SwitcherLink
52
+ isInternal
53
+ href="https://w3.ibm.com/design/experience-standards/">
54
+ IBM Experience Standards
55
+ </SwitcherLink>
56
+ <SwitcherDivider>Community</SwitcherDivider>
57
+ <SwitcherLink href="https://w3.ibm.com/design/" isInternal>
58
+ IBM Design
59
+ </SwitcherLink>
60
+ <SwitcherLink href="https://www.ibm.com/design/racial-equity-in-design">
61
+ Racial Equity in Design
62
+ </SwitcherLink>
63
+ </>
64
+ );
65
+
66
+ const defaults = {
67
+ children: <DefaultChildren />,
68
+ };
69
+
70
+ const Switcher = ({ children = defaults.children }) => {
9
71
  const lgBreakpoint = useMedia('min-width: 1056px');
10
72
  const { switcherIsOpen, toggleNavState } = useContext(NavContext);
11
73
  const listRef = useRef(null);
@@ -81,66 +143,4 @@ export const SwitcherLink = ({
81
143
  );
82
144
  };
83
145
 
84
- // https://css-tricks.com/using-css-transitions-auto-dimensions/
85
- // Note: if you change this, update the max-height in the switcher stylesheet
86
- const DefaultChildren = () => (
87
- <>
88
- <SwitcherDivider>Foundations</SwitcherDivider>
89
- <SwitcherLink href="https://ibm.com/brand" isInternal>
90
- IBM Brand Center
91
- </SwitcherLink>
92
- <SwitcherLink href="https://ibm.com/design/language">
93
- IBM Design Language
94
- </SwitcherLink>
95
- <SwitcherDivider>Implementation</SwitcherDivider>
96
- <SwitcherLink href="https://www.carbondesignsystem.com/">
97
- Carbon Design System
98
- </SwitcherLink>
99
- <SwitcherLink href="http://ibm.biz/carbon4ibmproducts" isInternal>
100
- Carbon for IBM Products
101
- </SwitcherLink>
102
- <SwitcherLink href="https://ibm.biz/carbon4cloud" isInternal>
103
- Carbon for Cloud
104
- </SwitcherLink>
105
- <SwitcherLink href="https://www.ibm.com/standards/carbon/">
106
- Carbon for IBM.com
107
- </SwitcherLink>
108
- <SwitcherLink href="https://www.ibm.com/design/event/">
109
- IBM Event Design
110
- </SwitcherLink>
111
- <SwitcherLink href="https://www.ibm.com/design/workplace/">
112
- IBM Workplace Design
113
- </SwitcherLink>
114
- <SwitcherDivider>Practices</SwitcherDivider>
115
- <SwitcherLink href="https://www.ibm.com/design/thinking/">
116
- Enterprise Design Thinking
117
- </SwitcherLink>
118
- <SwitcherLink href="https://www.ibm.com/able/">
119
- IBM Accessibility
120
- </SwitcherLink>
121
- <SwitcherLink href="https://www.ibm.com/design/ai">
122
- IBM Design for AI
123
- </SwitcherLink>
124
- <SwitcherLink href="https://www.ibm.com/design/research/">
125
- IBM Design Research
126
- </SwitcherLink>
127
- <SwitcherLink
128
- isInternal
129
- href="https://w3.ibm.com/design/experience-standards/">
130
- IBM Experience Standards
131
- </SwitcherLink>
132
- <SwitcherDivider>Community</SwitcherDivider>
133
- <SwitcherLink href="https://w3.ibm.com/design/" isInternal>
134
- IBM Design
135
- </SwitcherLink>
136
- <SwitcherLink href="https://www.ibm.com/design/racial-equity-in-design">
137
- Racial Equity in Design
138
- </SwitcherLink>
139
- </>
140
- );
141
-
142
- Switcher.defaultProps = {
143
- children: <DefaultChildren />,
144
- };
145
-
146
146
  export default Switcher;
@@ -12,7 +12,19 @@ import {
12
12
  } from './Video.module.scss';
13
13
  import usePathPrefix from '../../util/hooks/usePathprefix';
14
14
 
15
- const Video = ({ autoPlay, vimeoId, title, src, poster, muted, ...props }) => {
15
+ const defaults = {
16
+ autoPlay: false,
17
+ };
18
+
19
+ const Video = ({
20
+ autoPlay = defaults.autoPlay,
21
+ vimeoId,
22
+ title,
23
+ src,
24
+ poster,
25
+ muted,
26
+ ...props
27
+ }) => {
16
28
  const [isPlaying, setIsPlaying] = useState(autoPlay);
17
29
  const pathPrefix = usePathPrefix();
18
30
  const videoRef = useRef(null);
@@ -164,8 +176,4 @@ Video.propTypes = {
164
176
  },
165
177
  };
166
178
 
167
- Video.defaultProps = {
168
- autoPlay: false,
169
- };
170
-
171
179
  export default Video;