gatsby-theme-carbon 1.27.3 → 1.29.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 +6 -6
- package/src/components/GlobalSearch/GlobalSearch.module.scss +4 -0
- package/src/components/Header/Header.js +6 -3
- package/src/components/Header/Header.module.scss +9 -2
- package/src/components/Homepage/homepage.scss +5 -0
- package/src/components/LastModifiedDate/LastModifiedDate.js +25 -0
- package/src/components/LastModifiedDate/index.js +3 -0
- package/src/components/LastModifiedDate/last-modified-date.module.scss +8 -0
- package/src/components/Switcher/Switcher.js +8 -0
- package/src/components/Tabs/Tabs.js +2 -3
- package/src/components/Tabs/Tabs.module.scss +5 -0
- package/src/templates/Default.js +3 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gatsby-theme-carbon",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.29.2",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"author": "vpicone <vp@vincepic.one> (@vpicone)",
|
|
6
6
|
"repository": {
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@babel/core": "^7.10.4",
|
|
26
|
-
"@carbon/elements": "^10.
|
|
27
|
-
"@carbon/icons-react": "^10.
|
|
28
|
-
"@carbon/themes": "^10.
|
|
26
|
+
"@carbon/elements": "^10.32.0",
|
|
27
|
+
"@carbon/icons-react": "^10.30.0",
|
|
28
|
+
"@carbon/themes": "^10.32.0",
|
|
29
29
|
"@emotion/core": "^10.0.10",
|
|
30
30
|
"@emotion/styled": "^10.0.11",
|
|
31
31
|
"@mdx-js/mdx": "^1.5.5",
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"@reach/router": "^1.2.1",
|
|
34
34
|
"@vimeo/player": "^2.9.1",
|
|
35
35
|
"beautiful-react-hooks": "^0.23.1",
|
|
36
|
-
"carbon-components": "^10.
|
|
37
|
-
"carbon-components-react": "^7.
|
|
36
|
+
"carbon-components": "^10.33.0",
|
|
37
|
+
"carbon-components-react": "^7.33.0",
|
|
38
38
|
"carbon-icons": "^7.0.7",
|
|
39
39
|
"classnames": "^2.2.6",
|
|
40
40
|
"copy-to-clipboard": "^3.2.0",
|
|
@@ -10,6 +10,10 @@
|
|
|
10
10
|
color: $carbon--white-0;
|
|
11
11
|
transition: max-width $duration--fast-02 $carbon--standard-easing,
|
|
12
12
|
background $duration--fast-02 $carbon--standard-easing;
|
|
13
|
+
|
|
14
|
+
@include carbon--breakpoint('lg') {
|
|
15
|
+
max-width: 28rem;
|
|
16
|
+
}
|
|
13
17
|
}
|
|
14
18
|
|
|
15
19
|
.container.inputFocusWithin {
|
|
@@ -23,6 +23,7 @@ const Header = ({ children }) => {
|
|
|
23
23
|
toggleNavState,
|
|
24
24
|
switcherIsOpen,
|
|
25
25
|
searchIsOpen,
|
|
26
|
+
switcherTooltipText = 'Switch sites',
|
|
26
27
|
} = useContext(NavContext);
|
|
27
28
|
const { isSearchEnabled, navigationStyle } = useMetadata();
|
|
28
29
|
|
|
@@ -44,20 +45,22 @@ const Header = ({ children }) => {
|
|
|
44
45
|
/>
|
|
45
46
|
<Link
|
|
46
47
|
className={cx(styles.headerName, {
|
|
47
|
-
[styles.
|
|
48
|
+
[styles.searchIsOpenOnLink]: searchIsOpen,
|
|
48
49
|
[styles.headerNameWithHeaderNav]: navigationStyle,
|
|
49
50
|
})}
|
|
50
51
|
to="/">
|
|
51
52
|
{children}
|
|
52
53
|
</Link>
|
|
53
54
|
{navigationStyle && <HeaderNav />}
|
|
54
|
-
<HeaderGlobalBar
|
|
55
|
+
<HeaderGlobalBar
|
|
56
|
+
className={cx({ [styles.searchIsOpenOnBar]: searchIsOpen })}>
|
|
55
57
|
{isSearchEnabled && <GlobalSearch />}
|
|
56
58
|
<HeaderGlobalAction
|
|
57
59
|
className={cx(styles.headerButton, styles.switcherButton, {
|
|
58
60
|
[styles.switcherButtonOpen]: switcherIsOpen,
|
|
59
61
|
})}
|
|
60
|
-
aria-label=
|
|
62
|
+
aria-label={switcherTooltipText}
|
|
63
|
+
tooltipAlignment="end"
|
|
61
64
|
onClick={() => {
|
|
62
65
|
toggleNavState('switcherIsOpen');
|
|
63
66
|
toggleNavState('searchIsOpen', 'close');
|
|
@@ -5,13 +5,18 @@
|
|
|
5
5
|
top: 0;
|
|
6
6
|
right: 0;
|
|
7
7
|
width: calc(100% - 3rem);
|
|
8
|
-
z-index:
|
|
8
|
+
z-index: 1;
|
|
9
9
|
@include carbon--breakpoint('lg') {
|
|
10
10
|
position: static;
|
|
11
11
|
width: auto;
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
// When search is open, it will properly sit on top of the navigation links when using the headernav style of naviation.
|
|
16
|
+
.searchIsOpenOnBar {
|
|
17
|
+
z-index: 2;
|
|
18
|
+
}
|
|
19
|
+
|
|
15
20
|
// Overrides upstream Carbon styles for header nav
|
|
16
21
|
.headerWithHeaderNav :global(.bx--header__nav) {
|
|
17
22
|
@include carbon--breakpoint('lg') {
|
|
@@ -20,6 +25,7 @@
|
|
|
20
25
|
left: 25%;
|
|
21
26
|
top: 0;
|
|
22
27
|
padding-left: 0;
|
|
28
|
+
z-index: 2;
|
|
23
29
|
}
|
|
24
30
|
}
|
|
25
31
|
|
|
@@ -122,7 +128,8 @@ header.header {
|
|
|
122
128
|
}
|
|
123
129
|
}
|
|
124
130
|
|
|
125
|
-
.
|
|
131
|
+
// When search is open this will allow the search bar to cover the header on mobile and tablet screens.
|
|
132
|
+
.searchIsOpenOnLink {
|
|
126
133
|
z-index: 1;
|
|
127
134
|
}
|
|
128
135
|
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Row, Column } from '../Grid';
|
|
3
|
+
import styles from './last-modified-date.module.scss';
|
|
4
|
+
|
|
5
|
+
const LastModifiedDate = ({ date }) => {
|
|
6
|
+
const options = {
|
|
7
|
+
day: '2-digit',
|
|
8
|
+
year: 'numeric',
|
|
9
|
+
month: 'long',
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const lastModified = new Date(date);
|
|
13
|
+
|
|
14
|
+
return date ? (
|
|
15
|
+
<Row className={styles.row}>
|
|
16
|
+
<Column>
|
|
17
|
+
<div className={styles.text}>
|
|
18
|
+
Page last updated: {lastModified.toLocaleDateString('en-GB', options)}
|
|
19
|
+
{/* // https://www-03preprod.ibm.com/support/knowledgecenter/ibm_style/dates-and-times.html */}
|
|
20
|
+
</div>
|
|
21
|
+
</Column>
|
|
22
|
+
</Row>
|
|
23
|
+
) : null;
|
|
24
|
+
};
|
|
25
|
+
export default LastModifiedDate;
|
|
@@ -108,6 +108,9 @@ const DefaultChildren = () => (
|
|
|
108
108
|
<SwitcherLink href="https://www.ibm.com/design/event/">
|
|
109
109
|
IBM Event Design
|
|
110
110
|
</SwitcherLink>
|
|
111
|
+
<SwitcherLink href="https://www.ibm.com/design/workplace/">
|
|
112
|
+
IBM Workplace Design
|
|
113
|
+
</SwitcherLink>
|
|
111
114
|
<SwitcherDivider>Practices</SwitcherDivider>
|
|
112
115
|
<SwitcherLink href="https://www.ibm.com/design/thinking/">
|
|
113
116
|
Enterprise Design Thinking
|
|
@@ -124,6 +127,11 @@ const DefaultChildren = () => (
|
|
|
124
127
|
<SwitcherLink href="https://www.ibm.com/services/ibmix/">
|
|
125
128
|
IBM iX
|
|
126
129
|
</SwitcherLink>
|
|
130
|
+
<SwitcherLink
|
|
131
|
+
isInternal
|
|
132
|
+
href="https://w3.ibm.com/design/universal-experiences/">
|
|
133
|
+
IBM Universal Experiences
|
|
134
|
+
</SwitcherLink>
|
|
127
135
|
<SwitcherDivider>Community</SwitcherDivider>
|
|
128
136
|
<SwitcherLink href="https://w3.ibm.com/design/" isInternal>
|
|
129
137
|
IBM Design
|
|
@@ -16,7 +16,7 @@ import { breakpoints } from '@carbon/elements';
|
|
|
16
16
|
import cx from 'classnames';
|
|
17
17
|
|
|
18
18
|
import { useId } from '../../util/hooks/useId';
|
|
19
|
-
import styles from './Tabs.module.scss';
|
|
19
|
+
import * as styles from './Tabs.module.scss';
|
|
20
20
|
|
|
21
21
|
function elementIsNullOrString(child) {
|
|
22
22
|
return !child || typeof child.type === 'string';
|
|
@@ -31,12 +31,11 @@ const Select = ({ children, _id }) => {
|
|
|
31
31
|
index,
|
|
32
32
|
}));
|
|
33
33
|
return (
|
|
34
|
-
<div
|
|
34
|
+
<div className={styles.dropdownWrapper}>
|
|
35
35
|
<Dropdown
|
|
36
36
|
size="xl"
|
|
37
37
|
onChange={({ selectedItem }) => setActiveTab(selectedItem.index)}
|
|
38
38
|
initialSelectedItem={items[0]}
|
|
39
|
-
light
|
|
40
39
|
label="tab selection"
|
|
41
40
|
items={items}
|
|
42
41
|
id={_id}
|
package/src/templates/Default.js
CHANGED
|
@@ -10,6 +10,7 @@ import NextPrevious from '../components/NextPrevious';
|
|
|
10
10
|
import PageTabs from '../components/PageTabs';
|
|
11
11
|
import Main from '../components/Main';
|
|
12
12
|
import useMetadata from '../util/hooks/useMetadata';
|
|
13
|
+
import LastModifiedDate from '../components/LastModifiedDate';
|
|
13
14
|
|
|
14
15
|
const Default = ({ pageContext, children, location, Title }) => {
|
|
15
16
|
const { frontmatter = {}, relativePagePath, titleType } = pageContext;
|
|
@@ -19,6 +20,7 @@ const Default = ({ pageContext, children, location, Title }) => {
|
|
|
19
20
|
theme: frontmatterTheme,
|
|
20
21
|
description,
|
|
21
22
|
keywords,
|
|
23
|
+
date,
|
|
22
24
|
} = frontmatter;
|
|
23
25
|
|
|
24
26
|
const { interiorTheme } = useMetadata();
|
|
@@ -77,6 +79,7 @@ const Default = ({ pageContext, children, location, Title }) => {
|
|
|
77
79
|
<Main padded>
|
|
78
80
|
{children}
|
|
79
81
|
<EditLink relativePagePath={relativePagePath} />
|
|
82
|
+
<LastModifiedDate date={date} />
|
|
80
83
|
</Main>
|
|
81
84
|
<NextPrevious
|
|
82
85
|
pageContext={pageContext}
|