@primer/gatsby-theme-doctocat 3.0.0 → 3.2.0
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/CHANGELOG.md +24 -0
- package/gatsby-node.js +37 -2
- package/package.json +1 -1
- package/src/components/clipboard-copy.js +2 -2
- package/src/components/code.js +3 -3
- package/src/components/contributors.js +1 -2
- package/src/components/do-dont.js +1 -1
- package/src/components/drawer.js +2 -10
- package/src/components/hero-layout.js +2 -2
- package/src/components/hero.js +1 -1
- package/src/components/image-container.js +2 -4
- package/src/components/layout.js +23 -15
- package/src/components/live-code.js +14 -4
- package/src/components/mobile-search.js +4 -9
- package/src/components/nav-drawer.js +17 -19
- package/src/components/nav-dropdown.js +1 -1
- package/src/components/nav-items.js +15 -7
- package/src/components/page-footer.js +3 -3
- package/src/components/search.js +9 -7
- package/src/components/sidebar.js +9 -10
- package/src/components/status-label.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @primer/gatsby-theme-doctocat
|
|
2
2
|
|
|
3
|
+
## 3.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`438eadb`](https://github.com/primer/doctocat/commit/438eadbae21b14c246ca7f6c9f405a1c4a00728a) [#332](https://github.com/primer/doctocat/pull/332) Thanks [@siddharthkp](https://github.com/siddharthkp)! - Support function for `live-code-scope`
|
|
8
|
+
|
|
9
|
+
## 3.1.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`45e8748`](https://github.com/primer/doctocat/commit/45e8748a547903b8f7091fafb5b13e5c197b0dae) [#324](https://github.com/primer/doctocat/pull/324) Thanks [@rezrah](https://github.com/rezrah)! - Only add pages that have `componentId` and `status` to `components.json`
|
|
14
|
+
|
|
15
|
+
## 3.1.0
|
|
16
|
+
|
|
17
|
+
### Minor Changes
|
|
18
|
+
|
|
19
|
+
- [`3767651`](https://github.com/primer/doctocat/commit/37676515f1d7485ca7b5e932e115d96e3ef0285b) [#318](https://github.com/primer/doctocat/pull/318) Thanks [@colebemis](https://github.com/colebemis)! - Add a step to build process that will output a static `components.json` file with component status info if the site that its building has markdown files containing `componentId` frontmatter.
|
|
20
|
+
|
|
21
|
+
## 3.0.1
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- [`ff74ece`](https://github.com/primer/doctocat/commit/ff74ecea1b373469034c2122d94a54ca3e964158) [#301](https://github.com/primer/doctocat/pull/301) Thanks [@jfuchs](https://github.com/jfuchs)! - Removed styled system prop usage on Primer React components.
|
|
26
|
+
|
|
3
27
|
## 3.0.0
|
|
4
28
|
|
|
5
29
|
### Major Changes
|
package/gatsby-node.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const path = require('path')
|
|
2
|
+
const fs = require('fs')
|
|
2
3
|
const readPkgUp = require('read-pkg-up')
|
|
3
4
|
const getPkgRepo = require('get-pkg-repo')
|
|
4
5
|
const axios = require('axios')
|
|
@@ -12,7 +13,7 @@ exports.createPages = async ({graphql, actions}, themeOptions) => {
|
|
|
12
13
|
const repo = getPkgRepo(readPkgUp.sync().package)
|
|
13
14
|
|
|
14
15
|
const {data} = await graphql(`
|
|
15
|
-
{
|
|
16
|
+
query {
|
|
16
17
|
allMdx {
|
|
17
18
|
nodes {
|
|
18
19
|
fileAbsolutePath
|
|
@@ -34,7 +35,7 @@ exports.createPages = async ({graphql, actions}, themeOptions) => {
|
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
// Turn every MDX file into a page.
|
|
37
|
-
|
|
38
|
+
await Promise.all(
|
|
38
39
|
data.allMdx.nodes.map(async node => {
|
|
39
40
|
const pagePath = path
|
|
40
41
|
.join(node.parent.relativeDirectory, node.parent.name === 'index' ? '/' : node.parent.name)
|
|
@@ -74,6 +75,40 @@ exports.createPages = async ({graphql, actions}, themeOptions) => {
|
|
|
74
75
|
)
|
|
75
76
|
}
|
|
76
77
|
|
|
78
|
+
exports.onPostBuild = async ({graphql}) => {
|
|
79
|
+
try {
|
|
80
|
+
const {data} = await graphql(`
|
|
81
|
+
query {
|
|
82
|
+
allSitePage(filter: {context: {frontmatter: {componentId: {ne: null}, status: {ne: null}}}}) {
|
|
83
|
+
nodes {
|
|
84
|
+
path
|
|
85
|
+
context {
|
|
86
|
+
frontmatter {
|
|
87
|
+
componentId
|
|
88
|
+
status
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
`)
|
|
95
|
+
|
|
96
|
+
const components = data.allSitePage.nodes.map(node => {
|
|
97
|
+
return {
|
|
98
|
+
id: node.context.frontmatter.componentId,
|
|
99
|
+
path: node.path,
|
|
100
|
+
status: node.context.frontmatter.status.toLowerCase()
|
|
101
|
+
}
|
|
102
|
+
})
|
|
103
|
+
|
|
104
|
+
fs.writeFileSync(path.resolve(process.cwd(), 'public/components.json'), JSON.stringify(components))
|
|
105
|
+
} catch (error) {
|
|
106
|
+
// This is not necessarily an error, so we just log a warning instead of failing the build.
|
|
107
|
+
// Some sites won't have any markdown files with `componentId` frontmatter and that's okay.
|
|
108
|
+
console.warn('Unable to build components.json')
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
77
112
|
function getEditUrl(repo, filePath, defaultBranch) {
|
|
78
113
|
return `https://github.com/${repo.user}/${repo.project}/edit/${defaultBranch}/${filePath}`
|
|
79
114
|
}
|
package/package.json
CHANGED
|
@@ -24,9 +24,9 @@ function ClipboardCopy({value}) {
|
|
|
24
24
|
sx={{px: 2}}
|
|
25
25
|
>
|
|
26
26
|
{copied ? (
|
|
27
|
-
<StyledOcticon icon={CheckIcon} color
|
|
27
|
+
<StyledOcticon icon={CheckIcon} sx={{color: 'success.fg'}} />
|
|
28
28
|
) : (
|
|
29
|
-
<StyledOcticon icon={CopyIcon} color
|
|
29
|
+
<StyledOcticon icon={CopyIcon} sx={{color: 'fg.muted'}} />
|
|
30
30
|
)}
|
|
31
31
|
</Button>
|
|
32
32
|
)
|
package/src/components/code.js
CHANGED
|
@@ -6,12 +6,12 @@ import React from 'react'
|
|
|
6
6
|
import ClipboardCopy from './clipboard-copy'
|
|
7
7
|
import LiveCode from './live-code'
|
|
8
8
|
|
|
9
|
-
function Code({className, children, live, noinline}) {
|
|
9
|
+
function Code({className, children, live, noinline, metastring}) {
|
|
10
10
|
const language = className ? className.replace(/language-/, '') : ''
|
|
11
11
|
const code = children.trim()
|
|
12
12
|
|
|
13
13
|
if (live) {
|
|
14
|
-
return <LiveCode code={code} language={language} noinline={noinline} />
|
|
14
|
+
return <LiveCode code={code} language={language} noinline={noinline} metastring={metastring} />
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
return (
|
|
@@ -24,7 +24,7 @@ function Code({className, children, live, noinline}) {
|
|
|
24
24
|
width: '100%'
|
|
25
25
|
}}
|
|
26
26
|
>
|
|
27
|
-
<Absolute
|
|
27
|
+
<Absolute sx={{top: 0, right: 0, p: 2}}>
|
|
28
28
|
<ClipboardCopy value={code} />
|
|
29
29
|
</Absolute>
|
|
30
30
|
<Highlight {...defaultProps} Prism={Prism} code={code} language={language} theme={githubTheme}>
|
|
@@ -20,8 +20,7 @@ function Contributors({contributors}) {
|
|
|
20
20
|
<Link
|
|
21
21
|
key={contributor.login}
|
|
22
22
|
href={`https://github.com/${contributor.login}`}
|
|
23
|
-
lineHeight
|
|
24
|
-
sx={{mr: 2}}
|
|
23
|
+
sx={{mr: 2, lineHeight: 'condensedUltra'}}
|
|
25
24
|
>
|
|
26
25
|
<Tooltip key={contributor.login} aria-label={contributor.login}>
|
|
27
26
|
<Avatar src={`https://github.com/${contributor.login}.png?size=40`} alt={contributor.login} />
|
|
@@ -26,7 +26,7 @@ function DoDontBase({children, title, icon: Icon, iconBg}) {
|
|
|
26
26
|
return (
|
|
27
27
|
<Box display="flex" flexDirection="column">
|
|
28
28
|
<Box display="flex" alignSelf="start" flexDirection="row" alignItems="center" mb="2">
|
|
29
|
-
<StyledOcticon icon={Icon}
|
|
29
|
+
<StyledOcticon icon={Icon} sx={{color: iconBg}} />
|
|
30
30
|
<Text fontWeight="bold" color="fg.default" ml={2}>
|
|
31
31
|
{title}
|
|
32
32
|
</Text>
|
package/src/components/drawer.js
CHANGED
|
@@ -23,12 +23,8 @@ function Drawer({isOpen, onDismiss, children}) {
|
|
|
23
23
|
animate={{opacity: 1}}
|
|
24
24
|
exit={{opacity: 0}}
|
|
25
25
|
transition={{type: 'tween'}}
|
|
26
|
-
top={0}
|
|
27
|
-
right={0}
|
|
28
|
-
bottom={0}
|
|
29
|
-
left={0}
|
|
30
|
-
bg="rgba(0, 0, 0, 0.5)"
|
|
31
26
|
onClick={() => onDismiss()}
|
|
27
|
+
sx={{top: 0, right: 0, bottom: 0, left: 0, bg: 'rgba(0, 0, 0, 0.5)'}}
|
|
32
28
|
/>
|
|
33
29
|
|
|
34
30
|
<Fixed
|
|
@@ -38,12 +34,8 @@ function Drawer({isOpen, onDismiss, children}) {
|
|
|
38
34
|
animate={{x: 0}}
|
|
39
35
|
exit={{x: '100%'}}
|
|
40
36
|
transition={{type: 'tween', duration: 0.2}}
|
|
41
|
-
width={300}
|
|
42
|
-
top={0}
|
|
43
|
-
right={0}
|
|
44
|
-
bottom={0}
|
|
45
|
-
bg="gray.0"
|
|
46
37
|
style={{zIndex: 1}}
|
|
38
|
+
sx={{width: 300, top: 0, right: 0, bottom: 0, bg: 'gray.0'}}
|
|
47
39
|
>
|
|
48
40
|
{children}
|
|
49
41
|
</Fixed>
|
|
@@ -15,10 +15,10 @@ function HeroLayout({children, pageContext}) {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
return (
|
|
18
|
-
<Flex flexDirection
|
|
18
|
+
<Flex sx={{flexDirection: 'column', minHeight: '100vh'}}>
|
|
19
19
|
<Head />
|
|
20
20
|
<Header />
|
|
21
|
-
<Flex flex
|
|
21
|
+
<Flex sx={{flex: '1 1 auto', flexDirection: 'row'}}>
|
|
22
22
|
<Box display={['none', null, null, 'block']}>
|
|
23
23
|
<Sidebar />
|
|
24
24
|
</Box>
|
package/src/components/hero.js
CHANGED
|
@@ -10,7 +10,7 @@ function Hero() {
|
|
|
10
10
|
<ThemeProvider colorMode="night" nightScheme="dark_dimmed">
|
|
11
11
|
<Box bg="canvas.default" py={6}>
|
|
12
12
|
<Container>
|
|
13
|
-
<Heading as="h1" color
|
|
13
|
+
<Heading as="h1" sx={{color: 'accent.fg', fontSize: 7, m: 0}}>
|
|
14
14
|
{title}
|
|
15
15
|
</Heading>
|
|
16
16
|
<Text as="p" m={0} color="fg.default" fontSize={4}>
|
|
@@ -3,10 +3,8 @@ import React from 'react'
|
|
|
3
3
|
|
|
4
4
|
function ImageContainer({children}) {
|
|
5
5
|
return (
|
|
6
|
-
<BorderBox
|
|
7
|
-
<Flex
|
|
8
|
-
{children}
|
|
9
|
-
</Flex>
|
|
6
|
+
<BorderBox sx={{p: 6, bg: 'gray.1'}}>
|
|
7
|
+
<Flex sx={{img: {maxWidth: '100%'}, justifyContent: 'center'}}>{children}</Flex>
|
|
10
8
|
</BorderBox>
|
|
11
9
|
)
|
|
12
10
|
}
|
package/src/components/layout.js
CHANGED
|
@@ -26,10 +26,10 @@ function Layout({children, pageContext}) {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
return (
|
|
29
|
-
<Flex flexDirection
|
|
29
|
+
<Flex sx={{flexDirection: 'column', minHeight: '100vh'}}>
|
|
30
30
|
<Head title={title} description={description} />
|
|
31
31
|
<Header />
|
|
32
|
-
<Flex flex
|
|
32
|
+
<Flex css={{zIndex: 0}} sx={{flex: '1 1 auto', flexDirection: 'row'}}>
|
|
33
33
|
<Box display={['none', null, null, 'block']}>
|
|
34
34
|
<Sidebar />
|
|
35
35
|
</Box>
|
|
@@ -45,12 +45,16 @@ function Layout({children, pageContext}) {
|
|
|
45
45
|
>
|
|
46
46
|
{pageContext.tableOfContents.items ? (
|
|
47
47
|
<Position
|
|
48
|
-
sx={{
|
|
49
|
-
|
|
48
|
+
sx={{
|
|
49
|
+
width: 220,
|
|
50
|
+
flex: '0 0 auto',
|
|
51
|
+
marginLeft: 6,
|
|
52
|
+
display: ['none', null, 'block'],
|
|
53
|
+
position: 'sticky',
|
|
54
|
+
top: HEADER_HEIGHT + 48,
|
|
55
|
+
maxHeight: `calc(100vh - ${HEADER_HEIGHT}px - 48px)`
|
|
56
|
+
}}
|
|
50
57
|
css={{gridArea: 'table-of-contents', overflow: 'auto'}}
|
|
51
|
-
position="sticky"
|
|
52
|
-
top={HEADER_HEIGHT + 48}
|
|
53
|
-
maxHeight={`calc(100vh - ${HEADER_HEIGHT}px - 48px)`}
|
|
54
58
|
>
|
|
55
59
|
<Text display="inline-block" fontWeight="bold" mb={1}>
|
|
56
60
|
On this page
|
|
@@ -61,7 +65,7 @@ function Layout({children, pageContext}) {
|
|
|
61
65
|
<Box width="100%" maxWidth="960px">
|
|
62
66
|
<Box mb={4}>
|
|
63
67
|
<Flex sx={{alignItems: 'center'}}>
|
|
64
|
-
<Heading as="h1"
|
|
68
|
+
<Heading as="h1" sx={{mr: 2}}>
|
|
65
69
|
{title}
|
|
66
70
|
</Heading>{' '}
|
|
67
71
|
{status ? <StatusLabel status={status} /> : null}
|
|
@@ -73,11 +77,13 @@ function Layout({children, pageContext}) {
|
|
|
73
77
|
) : null}
|
|
74
78
|
{source || storybook ? (
|
|
75
79
|
<Grid
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
80
|
+
sx={{
|
|
81
|
+
py: 2,
|
|
82
|
+
gridGap: [1, null, 3],
|
|
83
|
+
gridAutoFlow: ['row', null, 'column'],
|
|
84
|
+
gridAutoColumns: 'max-content',
|
|
85
|
+
gridAutoRows: 'max-content'
|
|
86
|
+
}}
|
|
81
87
|
>
|
|
82
88
|
{source ? <SourceLink href={source} /> : null}
|
|
83
89
|
{storybook ? <StorybookLink href={storybook} /> : null}
|
|
@@ -85,9 +91,11 @@ function Layout({children, pageContext}) {
|
|
|
85
91
|
) : null}
|
|
86
92
|
</Box>
|
|
87
93
|
{pageContext.tableOfContents.items ? (
|
|
88
|
-
<BorderBox
|
|
94
|
+
<BorderBox
|
|
95
|
+
sx={{display: ['block', null, 'none'], mb: 5, borderColor: 'border.muted', bg: 'canvas.subtle'}}
|
|
96
|
+
>
|
|
89
97
|
<Box p={3}>
|
|
90
|
-
<Flex flexDirection
|
|
98
|
+
<Flex sx={{flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center'}}>
|
|
91
99
|
<Text fontWeight="bold">On this page</Text>
|
|
92
100
|
</Flex>
|
|
93
101
|
</Box>
|
|
@@ -34,14 +34,24 @@ function wrapWithFragment(jsx) {
|
|
|
34
34
|
return `<React.Fragment>${jsx}</React.Fragment>`
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
const getResolvedScope = metastring => {
|
|
38
|
+
if (typeof scope === 'function') return scope(metastring)
|
|
39
|
+
return scope
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function LiveCode({code, language, noinline, metastring}) {
|
|
38
43
|
const theme = React.useContext(ThemeContext)
|
|
39
44
|
const [liveCode, setLiveCode] = useState(code)
|
|
40
45
|
const handleChange = updatedLiveCode => setLiveCode(updatedLiveCode)
|
|
41
46
|
|
|
42
47
|
return (
|
|
43
|
-
<Flex flexDirection
|
|
44
|
-
<LiveProvider
|
|
48
|
+
<Flex sx={{flexDirection: 'column', mb: 3}}>
|
|
49
|
+
<LiveProvider
|
|
50
|
+
scope={getResolvedScope(metastring)}
|
|
51
|
+
code={liveCode}
|
|
52
|
+
transformCode={languageTransformers[language]}
|
|
53
|
+
noInline={noinline}
|
|
54
|
+
>
|
|
45
55
|
<Flex
|
|
46
56
|
sx={{
|
|
47
57
|
border: '1px solid',
|
|
@@ -70,7 +80,7 @@ function LiveCode({code, language, noinline}) {
|
|
|
70
80
|
borderColor: theme.colors.border.default
|
|
71
81
|
}}
|
|
72
82
|
/>
|
|
73
|
-
<Absolute
|
|
83
|
+
<Absolute sx={{top: 0, right: 0, p: 2}}>
|
|
74
84
|
<ClipboardCopy value={liveCode} />
|
|
75
85
|
</Absolute>
|
|
76
86
|
</Relative>
|
|
@@ -38,19 +38,14 @@ function MobileSearch({isOpen, onDismiss}) {
|
|
|
38
38
|
<AnimatePresence>
|
|
39
39
|
{isOpen ? (
|
|
40
40
|
<FocusOn returnFocus={true} onEscapeKey={() => handleDismiss()}>
|
|
41
|
-
<Fixed
|
|
41
|
+
<Fixed sx={{top: 0, left: 0, right: 0, bottom: 0, zIndex: 1}}>
|
|
42
42
|
<Absolute
|
|
43
43
|
as={motion.div}
|
|
44
44
|
initial={{opacity: 0}}
|
|
45
45
|
animate={{opacity: 1}}
|
|
46
46
|
exit={{opacity: 0}}
|
|
47
|
-
top={0}
|
|
48
|
-
left={0}
|
|
49
|
-
right={0}
|
|
50
|
-
bottom={0}
|
|
51
|
-
bg="primer.canvas.backdrop"
|
|
52
|
-
zIndex={-1}
|
|
53
47
|
onClick={handleDismiss}
|
|
48
|
+
sx={{top: 0, left: 0, right: 0, bottom: 0, bg: 'primer.canvas.backdrop', zIndex: -1}}
|
|
54
49
|
/>
|
|
55
50
|
<Downshift
|
|
56
51
|
inputValue={query}
|
|
@@ -72,7 +67,7 @@ function MobileSearch({isOpen, onDismiss}) {
|
|
|
72
67
|
height: isMenuOpen ? '100%' : 'auto'
|
|
73
68
|
})}
|
|
74
69
|
>
|
|
75
|
-
<Flex bg
|
|
70
|
+
<Flex sx={{bg: 'canvas.default', color: 'fg.default', p: 3, flex: '0 0 auto'}}>
|
|
76
71
|
<motion.div
|
|
77
72
|
initial={{scaleX: 0.1}}
|
|
78
73
|
animate={{scaleX: 1}}
|
|
@@ -83,7 +78,7 @@ function MobileSearch({isOpen, onDismiss}) {
|
|
|
83
78
|
<TextInput
|
|
84
79
|
{...getInputProps({
|
|
85
80
|
placeholder: `Search`,
|
|
86
|
-
width: '100%'
|
|
81
|
+
sx: {width: '100%'}
|
|
87
82
|
})}
|
|
88
83
|
/>
|
|
89
84
|
</motion.div>
|
|
@@ -44,15 +44,13 @@ function NavDrawer({isOpen, onDismiss}) {
|
|
|
44
44
|
return (
|
|
45
45
|
<Drawer isOpen={isOpen} onDismiss={onDismiss}>
|
|
46
46
|
<Flex
|
|
47
|
-
flexDirection="column"
|
|
48
|
-
height="100%"
|
|
49
|
-
bg="canvas.default"
|
|
50
47
|
style={{overflow: 'auto', WebkitOverflowScrolling: 'touch'}}
|
|
48
|
+
sx={{flexDirection: 'column', height: '100%', bg: 'canvas.default'}}
|
|
51
49
|
>
|
|
52
|
-
<Flex flexDirection
|
|
53
|
-
<BorderBox
|
|
54
|
-
<Flex
|
|
55
|
-
<Link href="https://primer.style" fontFamily
|
|
50
|
+
<Flex sx={{flexDirection: 'column', flex: '0 0 auto', color: 'fg.default', bg: 'canvas.default'}}>
|
|
51
|
+
<BorderBox sx={{borderWidth: 0, borderRadius: 0, borderBottomWidth: 1, borderColor: 'border.muted'}}>
|
|
52
|
+
<Flex sx={{py: 3, pl: 4, pr: 3, alignItems: 'center', justifyContent: 'space-between'}}>
|
|
53
|
+
<Link href="https://primer.style" sx={{fontFamily: 'mono', color: 'inherit'}}>
|
|
56
54
|
Primer
|
|
57
55
|
</Link>
|
|
58
56
|
<Button aria-label="Close" onClick={onDismiss}>
|
|
@@ -60,14 +58,18 @@ function NavDrawer({isOpen, onDismiss}) {
|
|
|
60
58
|
</Button>
|
|
61
59
|
</Flex>
|
|
62
60
|
</BorderBox>
|
|
63
|
-
<Flex flexDirection
|
|
61
|
+
<Flex sx={{flexDirection: 'column'}}>
|
|
64
62
|
<PrimerNavItems items={primerNavItems} />
|
|
65
63
|
</Flex>
|
|
66
64
|
</Flex>
|
|
67
65
|
{navItems.length > 0 ? (
|
|
68
66
|
<ThemeProvider colorMode="day">
|
|
69
|
-
<Flex flexDirection
|
|
70
|
-
<Link
|
|
67
|
+
<Flex sx={{flexDirection: 'column', flex: '1 0 auto', color: 'fg.default', bg: 'canvas.default'}}>
|
|
68
|
+
<Link
|
|
69
|
+
as={GatsbyLink}
|
|
70
|
+
to="/"
|
|
71
|
+
sx={{display: 'inline-block', color: 'inherit', fontFamily: 'mono', mx: 4, my: 4}}
|
|
72
|
+
>
|
|
71
73
|
{siteMetadata.title}
|
|
72
74
|
</Link>
|
|
73
75
|
<NavItems items={navItems} />
|
|
@@ -84,25 +86,21 @@ function PrimerNavItems({items}) {
|
|
|
84
86
|
return (
|
|
85
87
|
<BorderBox
|
|
86
88
|
key={item.title}
|
|
87
|
-
|
|
88
|
-
borderRadius={0}
|
|
89
|
-
borderTopWidth={index !== 0 ? 1 : 0}
|
|
90
|
-
borderColor="border.muted"
|
|
91
|
-
p={4}
|
|
89
|
+
sx={{borderWidth: 0, borderRadius: 0, borderTopWidth: index !== 0 ? 1 : 0, borderColor: 'border.muted', p: 4}}
|
|
92
90
|
>
|
|
93
91
|
{item.children ? (
|
|
94
92
|
<Details key={index}>
|
|
95
93
|
{({open, toggle}) => (
|
|
96
94
|
<>
|
|
97
95
|
<summary onClick={toggle} style={{cursor: 'pointer'}}>
|
|
98
|
-
<Flex alignItems
|
|
96
|
+
<Flex sx={{alignItems: 'center', justifyContent: 'space-between'}}>
|
|
99
97
|
<Text>{item.title}</Text>
|
|
100
98
|
{open ? <ChevronUpIcon /> : <ChevronDownIcon />}
|
|
101
99
|
</Flex>
|
|
102
100
|
</summary>
|
|
103
|
-
<Flex flexDirection
|
|
101
|
+
<Flex sx={{flexDirection: 'column', mt: 2}}>
|
|
104
102
|
{item.children.map(child => (
|
|
105
|
-
<Link key={child.title} href={child.url}
|
|
103
|
+
<Link key={child.title} href={child.url} sx={{py: 1, mt: 2, fontSize: 1, color: 'inherit'}}>
|
|
106
104
|
{child.title}
|
|
107
105
|
</Link>
|
|
108
106
|
))}
|
|
@@ -111,7 +109,7 @@ function PrimerNavItems({items}) {
|
|
|
111
109
|
)}
|
|
112
110
|
</Details>
|
|
113
111
|
) : (
|
|
114
|
-
<Link key={index} href={item.url} color
|
|
112
|
+
<Link key={index} href={item.url} sx={{color: 'inherit', display: 'block'}}>
|
|
115
113
|
{item.title}
|
|
116
114
|
</Link>
|
|
117
115
|
)}
|
|
@@ -9,7 +9,7 @@ function NavDropdown({title, children}) {
|
|
|
9
9
|
<Details {...getDetailsProps()}>
|
|
10
10
|
<summary style={{cursor: 'pointer'}}>
|
|
11
11
|
<Text>{title}</Text>
|
|
12
|
-
<StyledOcticon icon={TriangleDownIcon}
|
|
12
|
+
<StyledOcticon icon={TriangleDownIcon} sx={{ml: 1}} />
|
|
13
13
|
</summary>
|
|
14
14
|
<Box position="absolute">
|
|
15
15
|
<Box
|
|
@@ -38,7 +38,13 @@ function NavItems({items}) {
|
|
|
38
38
|
p={4}
|
|
39
39
|
>
|
|
40
40
|
<Box display="flex" flexDirection="column">
|
|
41
|
-
<NavLink
|
|
41
|
+
<NavLink
|
|
42
|
+
as={GatsbyLink}
|
|
43
|
+
to={item.url}
|
|
44
|
+
activeClassName="active"
|
|
45
|
+
partiallyActive={true}
|
|
46
|
+
sx={{color: 'inherit'}}
|
|
47
|
+
>
|
|
42
48
|
{item.title}
|
|
43
49
|
</NavLink>
|
|
44
50
|
{item.children ? (
|
|
@@ -49,10 +55,12 @@ function NavItems({items}) {
|
|
|
49
55
|
as={GatsbyLink}
|
|
50
56
|
to={child.url}
|
|
51
57
|
activeClassName="active"
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
58
|
+
sx={{
|
|
59
|
+
display: 'block',
|
|
60
|
+
py: 1,
|
|
61
|
+
mt: 2,
|
|
62
|
+
fontSize: 1
|
|
63
|
+
}}
|
|
56
64
|
>
|
|
57
65
|
{child.title}
|
|
58
66
|
</NavLink>
|
|
@@ -64,10 +72,10 @@ function NavItems({items}) {
|
|
|
64
72
|
))}
|
|
65
73
|
{repositoryUrl ? (
|
|
66
74
|
<Box borderWidth={0} borderTopWidth={1} borderRadius={0} borderStyle="solid" borderColor="border.default" p={4}>
|
|
67
|
-
<Link href={repositoryUrl} color
|
|
75
|
+
<Link href={repositoryUrl} sx={{color: 'inherit'}}>
|
|
68
76
|
<Box display="flex" justifyContent="space-between" alignItems="center">
|
|
69
77
|
GitHub
|
|
70
|
-
<StyledOcticon icon={LinkExternalIcon} color
|
|
78
|
+
<StyledOcticon icon={LinkExternalIcon} sx={{color: 'fg.muted'}} />
|
|
71
79
|
</Box>
|
|
72
80
|
</Link>
|
|
73
81
|
</Box>
|
|
@@ -5,11 +5,11 @@ import Contributors from './contributors'
|
|
|
5
5
|
|
|
6
6
|
function PageFooter({editUrl, contributors}) {
|
|
7
7
|
return editUrl || contributors.length > 0 ? (
|
|
8
|
-
<BorderBox
|
|
9
|
-
<Grid
|
|
8
|
+
<BorderBox sx={{borderWidth: 0, borderTopWidth: 1, borderRadius: 0, mt: 8, py: 5}}>
|
|
9
|
+
<Grid sx={{gridGap: 4}}>
|
|
10
10
|
{editUrl ? (
|
|
11
11
|
<Link href={editUrl}>
|
|
12
|
-
<StyledOcticon icon={PencilIcon}
|
|
12
|
+
<StyledOcticon icon={PencilIcon} sx={{mr: 2}} />
|
|
13
13
|
Edit this page on GitHub
|
|
14
14
|
</Link>
|
|
15
15
|
) : null}
|
package/src/components/search.js
CHANGED
|
@@ -64,14 +64,16 @@ function Search() {
|
|
|
64
64
|
>
|
|
65
65
|
<ThemeProvider colorMode="day">
|
|
66
66
|
<BorderBox
|
|
67
|
-
minWidth={300}
|
|
68
|
-
maxHeight="70vh"
|
|
69
|
-
p={2}
|
|
70
|
-
boxShadow="shadow.large"
|
|
71
|
-
borderColor="border.muted"
|
|
72
|
-
bg="canvas.overlay"
|
|
73
|
-
borderRadius="12px"
|
|
74
67
|
style={{overflow: 'auto'}}
|
|
68
|
+
sx={{
|
|
69
|
+
minWidth: 300,
|
|
70
|
+
maxHeight: '70vh',
|
|
71
|
+
p: 2,
|
|
72
|
+
boxShadow: 'shadow.large',
|
|
73
|
+
borderColor: 'border.muted',
|
|
74
|
+
bg: 'canvas.overlay',
|
|
75
|
+
borderRadius: '12px'
|
|
76
|
+
}}
|
|
75
77
|
>
|
|
76
78
|
<SearchResults results={results} getItemProps={getItemProps} highlightedIndex={highlightedIndex} />
|
|
77
79
|
</BorderBox>
|
|
@@ -33,21 +33,20 @@ function Sidebar() {
|
|
|
33
33
|
|
|
34
34
|
return (
|
|
35
35
|
<Position
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
sx={{
|
|
37
|
+
position: 'sticky',
|
|
38
|
+
top: HEADER_HEIGHT,
|
|
39
|
+
height: `calc(100vh - ${HEADER_HEIGHT}px)`,
|
|
40
|
+
minWidth: 260,
|
|
41
|
+
bg: 'canvas.subtle'
|
|
42
|
+
}}
|
|
41
43
|
>
|
|
42
44
|
<BorderBox
|
|
43
45
|
{...scrollContainerProps}
|
|
44
|
-
borderWidth={0}
|
|
45
|
-
borderRightWidth={1}
|
|
46
|
-
borderRadius={0}
|
|
47
|
-
height="100%"
|
|
48
46
|
style={{overflow: 'auto'}}
|
|
47
|
+
sx={{borderWidth: 0, borderRightWidth: 1, borderRadius: 0, height: '100%'}}
|
|
49
48
|
>
|
|
50
|
-
<Flex flexDirection
|
|
49
|
+
<Flex sx={{flexDirection: 'column'}}>
|
|
51
50
|
<NavItems items={navItems} />
|
|
52
51
|
</Flex>
|
|
53
52
|
</BorderBox>
|
|
@@ -14,7 +14,7 @@ function getStatusColor(status) {
|
|
|
14
14
|
|
|
15
15
|
function StatusLabel({status}) {
|
|
16
16
|
return (
|
|
17
|
-
<Label outline
|
|
17
|
+
<Label outline sx={{color: getStatusColor(status), borderColor: getStatusColor(status)}}>
|
|
18
18
|
{status}
|
|
19
19
|
</Label>
|
|
20
20
|
)
|