@primer/gatsby-theme-doctocat 3.1.0 → 3.2.1

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.
Files changed (38) hide show
  1. package/.eslintrc.json +2 -1
  2. package/CHANGELOG.md +20 -0
  3. package/babel.config.js +11 -1
  4. package/gatsby-node.js +1 -1
  5. package/jest.config.js +2 -1
  6. package/package.json +3 -3
  7. package/src/components/caption.js +2 -2
  8. package/src/components/clipboard-copy.js +1 -1
  9. package/src/components/code.js +13 -16
  10. package/src/components/container.js +2 -2
  11. package/src/components/contributors.js +4 -4
  12. package/src/components/details.js +1 -1
  13. package/src/components/do-dont.js +6 -8
  14. package/src/components/drawer.js +6 -6
  15. package/src/components/header.js +20 -16
  16. package/src/components/heading.js +1 -1
  17. package/src/components/hero-layout.js +8 -8
  18. package/src/components/hero.js +3 -3
  19. package/src/components/image-container.js +13 -4
  20. package/src/components/layout.js +40 -35
  21. package/src/components/live-code.js +27 -13
  22. package/src/components/live-preview-wrapper.js +2 -2
  23. package/src/components/mobile-search.js +19 -10
  24. package/src/components/nav-drawer.js +46 -21
  25. package/src/components/nav-dropdown.js +11 -9
  26. package/src/components/nav-items.js +22 -11
  27. package/src/components/page-footer.js +15 -5
  28. package/src/components/search-results.js +6 -11
  29. package/src/components/search.js +11 -9
  30. package/src/components/sidebar.js +15 -8
  31. package/src/components/skip-link.js +1 -1
  32. package/src/components/source-link.js +2 -4
  33. package/src/components/status-label.js +1 -1
  34. package/src/components/storybook-link.js +2 -4
  35. package/src/components/table-of-contents.js +3 -3
  36. package/src/components/text-input.js +2 -2
  37. package/src/components/wrap-page-element.js +1 -1
  38. package/src/components/wrap-root-element.js +1 -1
@@ -1,4 +1,4 @@
1
- import {Absolute, BorderBox, Flex, Relative, Text} from '@primer/components'
1
+ import {Box, Text} from '@primer/react'
2
2
  import htmlReactParser from 'html-react-parser'
3
3
  import githubTheme from '../github'
4
4
  import React, {useState} from 'react'
@@ -34,27 +34,38 @@ function wrapWithFragment(jsx) {
34
34
  return `<React.Fragment>${jsx}</React.Fragment>`
35
35
  }
36
36
 
37
- function LiveCode({code, language, noinline}) {
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 sx={{flexDirection: 'column', mb: 3}}>
44
- <LiveProvider scope={scope} code={liveCode} transformCode={languageTransformers[language]} noInline={noinline}>
45
- <Flex
48
+ <Box sx={{flexDirection: 'column', mb: 3, display: 'flex'}}>
49
+ <LiveProvider
50
+ scope={getResolvedScope(metastring)}
51
+ code={liveCode}
52
+ transformCode={languageTransformers[language]}
53
+ noInline={noinline}
54
+ >
55
+ <Box
46
56
  sx={{
47
57
  border: '1px solid',
48
58
  borderColor: 'border.default',
49
59
  borderTopRightRadius: 2,
50
- borderTopLeftRadius: 2
60
+ borderTopLeftRadius: 2,
61
+ display: 'flex'
51
62
  }}
52
63
  >
53
64
  <LivePreviewWrapper>
54
65
  <LivePreview />
55
66
  </LivePreviewWrapper>
56
- </Flex>
57
- <Relative>
67
+ </Box>
68
+ <Box sx={{position: 'relative'}}>
58
69
  <LiveEditor
59
70
  onChange={handleChange}
60
71
  theme={githubTheme}
@@ -70,13 +81,16 @@ function LiveCode({code, language, noinline}) {
70
81
  borderColor: theme.colors.border.default
71
82
  }}
72
83
  />
73
- <Absolute sx={{top: 0, right: 0, p: 2}}>
84
+ <Box sx={{top: 0, right: 0, p: 2, position: 'absolute'}}>
74
85
  <ClipboardCopy value={liveCode} />
75
- </Absolute>
76
- </Relative>
77
- <Text as={LiveError} m={0} p={3} fontFamily="mono" fontSize={1} color="fg.onEmphasis" bg="danger.emphasis" />
86
+ </Box>
87
+ </Box>
88
+ <Text
89
+ as={LiveError}
90
+ sx={{m: 0, p: 3, fontFamily: 'mono', fontSize: 1, color: 'fg.onEmphasis', bg: 'danger.emphasis'}}
91
+ />
78
92
  </LiveProvider>
79
- </Flex>
93
+ </Box>
80
94
  )
81
95
  }
82
96
 
@@ -1,4 +1,4 @@
1
- import {BaseStyles, Box} from '@primer/components'
1
+ import {BaseStyles, Box} from '@primer/react'
2
2
  import Frame from './frame'
3
3
  import React from 'react'
4
4
 
@@ -8,7 +8,7 @@ function LivePreviewWrapper({children}) {
8
8
  return (
9
9
  <Frame>
10
10
  <BaseStyles>
11
- <Box p={3}>{children}</Box>
11
+ <Box sx={{p: 3}}>{children}</Box>
12
12
  </BaseStyles>
13
13
  </Frame>
14
14
  )
@@ -1,4 +1,4 @@
1
- import {Absolute, Box, Button, Fixed, Flex} from '@primer/components'
1
+ import {Box, Button} from '@primer/react'
2
2
  import {XIcon} from '@primer/octicons-react'
3
3
  import Downshift from 'downshift'
4
4
  import {AnimatePresence, motion} from 'framer-motion'
@@ -6,8 +6,8 @@ import {navigate} from 'gatsby'
6
6
  import React from 'react'
7
7
  import {FocusOn} from 'react-focus-on'
8
8
  import useSearch from '../use-search'
9
- import TextInput from './text-input'
10
9
  import SearchResults from './search-results'
10
+ import TextInput from './text-input'
11
11
 
12
12
  function stateReducer(state, changes) {
13
13
  switch (changes.type) {
@@ -38,14 +38,22 @@ function MobileSearch({isOpen, onDismiss}) {
38
38
  <AnimatePresence>
39
39
  {isOpen ? (
40
40
  <FocusOn returnFocus={true} onEscapeKey={() => handleDismiss()}>
41
- <Fixed sx={{top: 0, left: 0, right: 0, bottom: 0, zIndex: 1}}>
42
- <Absolute
41
+ <Box sx={{top: 0, left: 0, right: 0, bottom: 0, zIndex: 1, position: 'fixed'}}>
42
+ <Box
43
43
  as={motion.div}
44
44
  initial={{opacity: 0}}
45
45
  animate={{opacity: 1}}
46
46
  exit={{opacity: 0}}
47
47
  onClick={handleDismiss}
48
- sx={{top: 0, left: 0, right: 0, bottom: 0, bg: 'primer.canvas.backdrop', zIndex: -1}}
48
+ sx={{
49
+ top: 0,
50
+ left: 0,
51
+ right: 0,
52
+ bottom: 0,
53
+ bg: 'primer.canvas.backdrop',
54
+ zIndex: -1,
55
+ position: 'absolute'
56
+ }}
49
57
  />
50
58
  <Downshift
51
59
  inputValue={query}
@@ -61,13 +69,14 @@ function MobileSearch({isOpen, onDismiss}) {
61
69
  stateReducer={stateReducer}
62
70
  >
63
71
  {({getInputProps, getItemProps, getMenuProps, getRootProps, isOpen: isMenuOpen, highlightedIndex}) => (
64
- <Flex
72
+ <Box
65
73
  {...getRootProps({
66
74
  flexDirection: 'column',
67
75
  height: isMenuOpen ? '100%' : 'auto'
68
76
  })}
77
+ sx={{display: 'flex'}}
69
78
  >
70
- <Flex sx={{bg: 'canvas.default', color: 'fg.default', p: 3, flex: '0 0 auto'}}>
79
+ <Box sx={{bg: 'canvas.default', color: 'fg.default', p: 3, flex: '0 0 auto', display: 'flex'}}>
71
80
  <motion.div
72
81
  initial={{scaleX: 0.1}}
73
82
  animate={{scaleX: 1}}
@@ -85,7 +94,7 @@ function MobileSearch({isOpen, onDismiss}) {
85
94
  <Button aria-label="Cancel" onClick={handleDismiss} sx={{ml: 3}}>
86
95
  <XIcon />
87
96
  </Button>
88
- </Flex>
97
+ </Box>
89
98
  {isMenuOpen ? (
90
99
  <Box
91
100
  {...getMenuProps({
@@ -108,10 +117,10 @@ function MobileSearch({isOpen, onDismiss}) {
108
117
  />
109
118
  </Box>
110
119
  ) : null}
111
- </Flex>
120
+ </Box>
112
121
  )}
113
122
  </Downshift>
114
- </Fixed>
123
+ </Box>
115
124
  </FocusOn>
116
125
  ) : null}
117
126
  </AnimatePresence>
@@ -1,4 +1,4 @@
1
- import {BorderBox, Flex, Link, Text, Button, ThemeProvider} from '@primer/components'
1
+ import {Box, Button, Link, Text, ThemeProvider} from '@primer/react'
2
2
  import {ChevronDownIcon, ChevronUpIcon, XIcon} from '@primer/octicons-react'
3
3
  import {Link as GatsbyLink} from 'gatsby'
4
4
  import debounce from 'lodash.debounce'
@@ -43,28 +43,46 @@ function NavDrawer({isOpen, onDismiss}) {
43
43
  const siteMetadata = useSiteMetadata()
44
44
  return (
45
45
  <Drawer isOpen={isOpen} onDismiss={onDismiss}>
46
- <Flex
46
+ <Box
47
47
  style={{overflow: 'auto', WebkitOverflowScrolling: 'touch'}}
48
- sx={{flexDirection: 'column', height: '100%', bg: 'canvas.default'}}
48
+ sx={{flexDirection: 'column', height: '100%', bg: 'canvas.default', display: 'flex'}}
49
49
  >
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'}}>
50
+ <Box
51
+ sx={{flexDirection: 'column', flex: '0 0 auto', color: 'fg.default', bg: 'canvas.default', display: 'flex'}}
52
+ >
53
+ <Box
54
+ sx={{
55
+ borderWidth: 0,
56
+ borderRadius: 0,
57
+ borderBottomWidth: 1,
58
+ borderColor: 'border.muted',
59
+ borderStyle: 'solid'
60
+ }}
61
+ >
62
+ <Box sx={{py: 3, pl: 4, pr: 3, alignItems: 'center', justifyContent: 'space-between', display: 'flex'}}>
53
63
  <Link href="https://primer.style" sx={{fontFamily: 'mono', color: 'inherit'}}>
54
64
  Primer
55
65
  </Link>
56
66
  <Button aria-label="Close" onClick={onDismiss}>
57
67
  <XIcon />
58
68
  </Button>
59
- </Flex>
60
- </BorderBox>
61
- <Flex sx={{flexDirection: 'column'}}>
69
+ </Box>
70
+ </Box>
71
+ <Box sx={{flexDirection: 'column', display: 'flex'}}>
62
72
  <PrimerNavItems items={primerNavItems} />
63
- </Flex>
64
- </Flex>
73
+ </Box>
74
+ </Box>
65
75
  {navItems.length > 0 ? (
66
76
  <ThemeProvider colorMode="day">
67
- <Flex sx={{flexDirection: 'column', flex: '1 0 auto', color: 'fg.default', bg: 'canvas.default'}}>
77
+ <Box
78
+ sx={{
79
+ flexDirection: 'column',
80
+ flex: '1 0 auto',
81
+ color: 'fg.default',
82
+ bg: 'canvas.default',
83
+ display: 'flex'
84
+ }}
85
+ >
68
86
  <Link
69
87
  as={GatsbyLink}
70
88
  to="/"
@@ -73,10 +91,10 @@ function NavDrawer({isOpen, onDismiss}) {
73
91
  {siteMetadata.title}
74
92
  </Link>
75
93
  <NavItems items={navItems} />
76
- </Flex>
94
+ </Box>
77
95
  </ThemeProvider>
78
96
  ) : null}
79
- </Flex>
97
+ </Box>
80
98
  </Drawer>
81
99
  )
82
100
  }
@@ -84,27 +102,34 @@ function NavDrawer({isOpen, onDismiss}) {
84
102
  function PrimerNavItems({items}) {
85
103
  return items.map((item, index) => {
86
104
  return (
87
- <BorderBox
105
+ <Box
88
106
  key={item.title}
89
- sx={{borderWidth: 0, borderRadius: 0, borderTopWidth: index !== 0 ? 1 : 0, borderColor: 'border.muted', p: 4}}
107
+ sx={{
108
+ borderWidth: 0,
109
+ borderRadius: 0,
110
+ borderTopWidth: index !== 0 ? 1 : 0,
111
+ borderColor: 'border.muted',
112
+ p: 4,
113
+ borderStyle: 'solid'
114
+ }}
90
115
  >
91
116
  {item.children ? (
92
117
  <Details key={index}>
93
118
  {({open, toggle}) => (
94
119
  <>
95
120
  <summary onClick={toggle} style={{cursor: 'pointer'}}>
96
- <Flex sx={{alignItems: 'center', justifyContent: 'space-between'}}>
121
+ <Box sx={{alignItems: 'center', justifyContent: 'space-between', display: 'flex'}}>
97
122
  <Text>{item.title}</Text>
98
123
  {open ? <ChevronUpIcon /> : <ChevronDownIcon />}
99
- </Flex>
124
+ </Box>
100
125
  </summary>
101
- <Flex sx={{flexDirection: 'column', mt: 2}}>
126
+ <Box sx={{flexDirection: 'column', mt: 2, display: 'flex'}}>
102
127
  {item.children.map(child => (
103
128
  <Link key={child.title} href={child.url} sx={{py: 1, mt: 2, fontSize: 1, color: 'inherit'}}>
104
129
  {child.title}
105
130
  </Link>
106
131
  ))}
107
- </Flex>
132
+ </Box>
108
133
  </>
109
134
  )}
110
135
  </Details>
@@ -113,7 +138,7 @@ function PrimerNavItems({items}) {
113
138
  {item.title}
114
139
  </Link>
115
140
  )}
116
- </BorderBox>
141
+ </Box>
117
142
  )
118
143
  })
119
144
  }
@@ -1,4 +1,4 @@
1
- import {Box, Details, StyledOcticon, Text, themeGet, useDetails} from '@primer/components'
1
+ import {Box, Details, StyledOcticon, Text, themeGet, useDetails} from '@primer/react'
2
2
  import {TriangleDownIcon} from '@primer/octicons-react'
3
3
  import React from 'react'
4
4
  import styled from 'styled-components'
@@ -11,15 +11,17 @@ function NavDropdown({title, children}) {
11
11
  <Text>{title}</Text>
12
12
  <StyledOcticon icon={TriangleDownIcon} sx={{ml: 1}} />
13
13
  </summary>
14
- <Box position="absolute">
14
+ <Box sx={{position: 'absolute'}}>
15
15
  <Box
16
- bg="canvas.overlay"
17
- p={2}
18
- mt={2}
19
- borderWidth="1px"
20
- borderStyle="solid"
21
- borderColor="border.default"
22
- borderRadius="12px"
16
+ sx={{
17
+ bg: 'canvas.overlay',
18
+ p: 2,
19
+ mt: 2,
20
+ borderWidth: '1px',
21
+ borderStyle: 'solid',
22
+ borderColor: 'border.default',
23
+ borderRadius: '12px'
24
+ }}
23
25
  >
24
26
  {children}
25
27
  </Box>
@@ -1,4 +1,4 @@
1
- import {Box, Link, StyledOcticon, themeGet} from '@primer/components'
1
+ import {Box, Link, StyledOcticon, themeGet} from '@primer/react'
2
2
  import {LinkExternalIcon} from '@primer/octicons-react'
3
3
  import {Link as GatsbyLink} from 'gatsby'
4
4
  import preval from 'preval.macro'
@@ -30,14 +30,16 @@ function NavItems({items}) {
30
30
  {items.map(item => (
31
31
  <Box
32
32
  key={item.title}
33
- borderWidth={0}
34
- borderRadius={0}
35
- borderTopWidth={1}
36
- borderStyle="solid"
37
- borderColor="border.muted"
38
- p={4}
33
+ sx={{
34
+ borderWidth: 0,
35
+ borderRadius: 0,
36
+ borderTopWidth: 1,
37
+ borderStyle: 'solid',
38
+ borderColor: 'border.muted',
39
+ p: 4
40
+ }}
39
41
  >
40
- <Box display="flex" flexDirection="column">
42
+ <Box sx={{display: 'flex', flexDirection: 'column'}}>
41
43
  <NavLink
42
44
  as={GatsbyLink}
43
45
  to={item.url}
@@ -48,7 +50,7 @@ function NavItems({items}) {
48
50
  {item.title}
49
51
  </NavLink>
50
52
  {item.children ? (
51
- <Box display="flex" flexDirection="column" mt={2}>
53
+ <Box sx={{display: 'flex', flexDirection: 'column', mt: 2}}>
52
54
  {item.children.map(child => (
53
55
  <NavLink
54
56
  key={child.title}
@@ -71,9 +73,18 @@ function NavItems({items}) {
71
73
  </Box>
72
74
  ))}
73
75
  {repositoryUrl ? (
74
- <Box borderWidth={0} borderTopWidth={1} borderRadius={0} borderStyle="solid" borderColor="border.default" p={4}>
76
+ <Box
77
+ sx={{
78
+ borderWidth: 0,
79
+ borderTopWidth: 1,
80
+ borderRadius: 0,
81
+ borderStyle: 'solid',
82
+ borderColor: 'border.default',
83
+ p: 4
84
+ }}
85
+ >
75
86
  <Link href={repositoryUrl} sx={{color: 'inherit'}}>
76
- <Box display="flex" justifyContent="space-between" alignItems="center">
87
+ <Box sx={{display: 'flex', justifyContent: 'space-between', alignItems: 'center'}}>
77
88
  GitHub
78
89
  <StyledOcticon icon={LinkExternalIcon} sx={{color: 'fg.muted'}} />
79
90
  </Box>
@@ -1,12 +1,22 @@
1
- import {BorderBox, Grid, StyledOcticon, Link} from '@primer/components'
1
+ import {Box, Link, StyledOcticon} from '@primer/react'
2
2
  import {PencilIcon} from '@primer/octicons-react'
3
3
  import React from 'react'
4
4
  import Contributors from './contributors'
5
5
 
6
6
  function PageFooter({editUrl, contributors}) {
7
7
  return editUrl || contributors.length > 0 ? (
8
- <BorderBox sx={{borderWidth: 0, borderTopWidth: 1, borderRadius: 0, mt: 8, py: 5}}>
9
- <Grid sx={{gridGap: 4}}>
8
+ <Box
9
+ sx={{
10
+ borderWidth: 0,
11
+ borderTopWidth: 1,
12
+ borderRadius: 0,
13
+ mt: 8,
14
+ py: 5,
15
+ borderStyle: 'solid',
16
+ borderColor: 'border.default'
17
+ }}
18
+ >
19
+ <Box sx={{gridGap: 4, display: 'grid'}}>
10
20
  {editUrl ? (
11
21
  <Link href={editUrl}>
12
22
  <StyledOcticon icon={PencilIcon} sx={{mr: 2}} />
@@ -15,8 +25,8 @@ function PageFooter({editUrl, contributors}) {
15
25
  ) : null}
16
26
 
17
27
  {contributors.length > 0 ? <Contributors contributors={contributors} /> : null}
18
- </Grid>
19
- </BorderBox>
28
+ </Box>
29
+ </Box>
20
30
  ) : null
21
31
  }
22
32
 
@@ -1,4 +1,4 @@
1
- import {Flex, Text, Box} from '@primer/components'
1
+ import {Box, Text} from '@primer/react'
2
2
  import React from 'react'
3
3
  import sentenceCase from 'sentence-case'
4
4
  import useSiteMetadata from '../use-site-metadata'
@@ -7,15 +7,11 @@ function SearchResults({results, getItemProps, highlightedIndex}) {
7
7
  const siteMetadata = useSiteMetadata()
8
8
 
9
9
  if (results.length === 0) {
10
- return (
11
- <Box p={3} fontSize={1} color="fg.muted" width="100%">
12
- No results
13
- </Box>
14
- )
10
+ return <Box sx={{p: 3, fontSize: 1, color: 'fg.muted', width: '100%'}}>No results</Box>
15
11
  }
16
12
 
17
13
  return results.map((item, index) => (
18
- <Flex
14
+ <Box
19
15
  key={item.path}
20
16
  {...getItemProps({
21
17
  item,
@@ -29,12 +25,11 @@ function SearchResults({results, getItemProps, highlightedIndex}) {
29
25
  style: {cursor: 'pointer'},
30
26
  borderRadius: 2
31
27
  })}
28
+ sx={{display: 'flex'}}
32
29
  >
33
- <Text fontSize={0} color="fg.muted">
34
- {getBreadcrumbs(siteMetadata.shortName, item.path).join(' / ')}
35
- </Text>
30
+ <Text sx={{fontSize: 0, color: 'fg.muted'}}>{getBreadcrumbs(siteMetadata.shortName, item.path).join(' / ')}</Text>
36
31
  {item.title}
37
- </Flex>
32
+ </Box>
38
33
  ))
39
34
  }
40
35
 
@@ -1,11 +1,11 @@
1
- import {BorderBox, Position, ThemeProvider} from '@primer/components'
1
+ import {Box, ThemeProvider} from '@primer/react'
2
2
  import Downshift from 'downshift'
3
3
  import {navigate} from 'gatsby'
4
4
  import React from 'react'
5
5
  import useSearch from '../use-search'
6
6
  import useSiteMetadata from '../use-site-metadata'
7
- import TextInput from './text-input'
8
7
  import SearchResults from './search-results'
8
+ import TextInput from './text-input'
9
9
 
10
10
  function stateReducer(state, changes) {
11
11
  switch (changes.type) {
@@ -44,7 +44,7 @@ function Search() {
44
44
  stateReducer={stateReducer}
45
45
  >
46
46
  {({getInputProps, getItemProps, getMenuProps, getRootProps, isOpen, highlightedIndex}) => (
47
- <Position {...getRootProps({position: 'relative'})}>
47
+ <Box {...getRootProps({position: 'relative'})}>
48
48
  <TextInput
49
49
  {...getInputProps({
50
50
  placeholder: `Search ${siteMetadata.title}`,
@@ -54,7 +54,7 @@ function Search() {
54
54
  })}
55
55
  />
56
56
  {isOpen ? (
57
- <Position
57
+ <Box
58
58
  {...getMenuProps({
59
59
  position: 'absolute',
60
60
  left: 0,
@@ -63,7 +63,7 @@ function Search() {
63
63
  })}
64
64
  >
65
65
  <ThemeProvider colorMode="day">
66
- <BorderBox
66
+ <Box
67
67
  style={{overflow: 'auto'}}
68
68
  sx={{
69
69
  minWidth: 300,
@@ -72,15 +72,17 @@ function Search() {
72
72
  boxShadow: 'shadow.large',
73
73
  borderColor: 'border.muted',
74
74
  bg: 'canvas.overlay',
75
- borderRadius: '12px'
75
+ borderRadius: '12px',
76
+ borderWidth: '1px',
77
+ borderStyle: 'solid'
76
78
  }}
77
79
  >
78
80
  <SearchResults results={results} getItemProps={getItemProps} highlightedIndex={highlightedIndex} />
79
- </BorderBox>
81
+ </Box>
80
82
  </ThemeProvider>
81
- </Position>
83
+ </Box>
82
84
  ) : null}
83
- </Position>
85
+ </Box>
84
86
  )}
85
87
  </Downshift>
86
88
  )
@@ -1,4 +1,4 @@
1
- import {BorderBox, Flex, Position} from '@primer/components'
1
+ import {Box} from '@primer/react'
2
2
  import React from 'react'
3
3
  import navItems from '../nav.yml'
4
4
  import {HEADER_HEIGHT} from './header'
@@ -32,7 +32,7 @@ function Sidebar() {
32
32
  const scrollContainerProps = usePersistentScroll('sidebar')
33
33
 
34
34
  return (
35
- <Position
35
+ <Box
36
36
  sx={{
37
37
  position: 'sticky',
38
38
  top: HEADER_HEIGHT,
@@ -41,16 +41,23 @@ function Sidebar() {
41
41
  bg: 'canvas.subtle'
42
42
  }}
43
43
  >
44
- <BorderBox
44
+ <Box
45
45
  {...scrollContainerProps}
46
46
  style={{overflow: 'auto'}}
47
- sx={{borderWidth: 0, borderRightWidth: 1, borderRadius: 0, height: '100%'}}
47
+ sx={{
48
+ borderWidth: 0,
49
+ borderRightWidth: 1,
50
+ borderRadius: 0,
51
+ height: '100%',
52
+ borderStyle: 'solid',
53
+ borderColor: 'border.default'
54
+ }}
48
55
  >
49
- <Flex sx={{flexDirection: 'column'}}>
56
+ <Box sx={{flexDirection: 'column', display: 'flex'}}>
50
57
  <NavItems items={navItems} />
51
- </Flex>
52
- </BorderBox>
53
- </Position>
58
+ </Box>
59
+ </Box>
60
+ </Box>
54
61
  )
55
62
  }
56
63
 
@@ -1,4 +1,4 @@
1
- import {Link} from '@primer/components'
1
+ import {Link} from '@primer/react'
2
2
  import styled from 'styled-components'
3
3
  import React from 'react'
4
4
 
@@ -1,4 +1,4 @@
1
- import {Link, Text} from '@primer/components'
1
+ import {Link, Text} from '@primer/react'
2
2
  import {MarkGithubIcon} from '@primer/octicons-react'
3
3
  import React from 'react'
4
4
 
@@ -6,9 +6,7 @@ function SourceLink({href}) {
6
6
  return (
7
7
  <Link href={href}>
8
8
  <MarkGithubIcon />
9
- <Text ml={2} display="inline-block">
10
- View source
11
- </Text>
9
+ <Text sx={{ml: 2, display: 'inline-block'}}>View source</Text>
12
10
  </Link>
13
11
  )
14
12
  }
@@ -1,4 +1,4 @@
1
- import {Label} from '@primer/components'
1
+ import {Label} from '@primer/react'
2
2
  import React from 'react'
3
3
 
4
4
  const STATUS_COLORS = {
@@ -1,13 +1,11 @@
1
- import {Link, Text} from '@primer/components'
1
+ import {Link, Text} from '@primer/react'
2
2
  import React from 'react'
3
3
 
4
4
  function SourceLink({href}) {
5
5
  return (
6
6
  <Link href={href}>
7
7
  <StorybookIcon />
8
- <Text ml={2} display="inline-block">
9
- View storybook
10
- </Text>
8
+ <Text sx={{ml: 2, display: 'inline-block'}}>View storybook</Text>
11
9
  </Link>
12
10
  )
13
11
  }
@@ -1,11 +1,11 @@
1
- import {Box, Link} from '@primer/components'
1
+ import {Box, Link} from '@primer/react'
2
2
  import React from 'react'
3
3
 
4
4
  function TableOfContents({items, depth}) {
5
5
  return (
6
- <Box as="ul" m={0} p={0} css={{listStyle: 'none'}}>
6
+ <Box as="ul" sx={{m: 0, p: 0, listStyle: 'none'}}>
7
7
  {items.map(item => (
8
- <Box as="li" key={item.url} pl={depth > 0 ? 3 : 0}>
8
+ <Box as="li" key={item.url} sx={{pl: depth > 0 ? 3 : 0}}>
9
9
  {item.title ? (
10
10
  <Link
11
11
  href={item.url}
@@ -1,10 +1,10 @@
1
- import {TextInput as PrimerTextInput, themeGet} from '@primer/components'
1
+ import {TextInput as PrimerTextInput, themeGet} from '@primer/react'
2
2
  import styled from 'styled-components'
3
3
 
4
4
  const TextInput = styled(PrimerTextInput)`
5
5
  /* The font-size of inputs should never be less than 16px.
6
6
  * Otherwise, iOS browsers will zoom in when the input is focused.
7
- * TODO: Update font-size of TextInput in @primer/components.
7
+ * TODO: Update font-size of TextInput in @primer/react.
8
8
  */
9
9
  font-size: ${themeGet('fontSizes.2')} !important;
10
10
  `
@@ -1,4 +1,4 @@
1
- import {BaseStyles, themeGet} from '@primer/components'
1
+ import {BaseStyles, themeGet} from '@primer/react'
2
2
  import React from 'react'
3
3
  import {createGlobalStyle} from 'styled-components'
4
4
  import SkipLink from './skip-link'