@primer/doctocat-nextjs 0.0.0-20251114183111 → 0.0.0-20251124211620

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 CHANGED
@@ -1,16 +1,16 @@
1
1
  # @primer/doctocat-nextjs
2
2
 
3
- ## 0.0.0-20251114183111
3
+ ## 0.0.0-20251124211620
4
4
 
5
5
  ### Patch Changes
6
6
 
7
7
  - Fake entry to force publishing
8
8
 
9
- ## 0.0.0-20251114183109
9
+ ## 0.0.0-20251124211618
10
10
 
11
11
  ### Patch Changes
12
12
 
13
- - [#70](https://github.com/primer/doctocat-nextjs/pull/70) [`63538e2`](https://github.com/primer/doctocat-nextjs/commit/63538e2c496cb77b4842264a899dffce412b7cfd) Thanks [@copilot-swe-agent](https://github.com/apps/copilot-swe-agent)! - Improve screen reader accessibility by updating sidebar navigation heading hierarchy. The sidebar title now uses a semantic `<Heading>` component with visually hidden text to clarify it's a navigation area, and is properly connected to the `<NavList>` via `aria-labelledby`.
13
+ - [#68](https://github.com/primer/doctocat-nextjs/pull/68) [`b75584e`](https://github.com/primer/doctocat-nextjs/commit/b75584edb6936a70ea94925fc743989422cc3d9a) Thanks [@janmaarten-a11y](https://github.com/janmaarten-a11y)! - Improve screen reader accessibility by updating sidebar navigation heading hierarchy. The sidebar title now uses a semantic `<Heading>` component with visually hidden text to clarify it's a navigation area, and is properly connected to the `<NavList>` via `aria-labelledby`.
14
14
 
15
15
  ## 0.7.0
16
16
 
@@ -0,0 +1,6 @@
1
+ .Caption {
2
+ margin-top: var(--base-size-8);
3
+ margin-bottom: var(--base-size-12);
4
+ font-size: var(--brand-text-size-100);
5
+ color: var(--brand-color-text-default);
6
+ }
@@ -1,6 +1,11 @@
1
1
  import React, {PropsWithChildren} from 'react'
2
- import {Text} from '@primer/react'
2
+ import styles from './Caption.module.css'
3
3
 
4
4
  export function Caption(props: PropsWithChildren) {
5
- return <Text as="span" {...props} sx={{mt: 2, mb: 3, fontSize: 1, color: 'var(--brand-color-text-default)'}} />
5
+ const {children, ...rest} = props
6
+ return (
7
+ <span className={styles.Caption} {...rest}>
8
+ {children}
9
+ </span>
10
+ )
6
11
  }
@@ -1,5 +1,4 @@
1
1
  import React from 'react'
2
- import {Box} from '@primer/react'
3
2
  import clsx from 'clsx'
4
3
  import styles from './DosAndDonts.module.css'
5
4
 
@@ -39,14 +38,9 @@ type DoDontBaseProps = {
39
38
  export function DoDontBase({children, title, indented, className, ...rest}: React.PropsWithChildren<DoDontBaseProps>) {
40
39
  return (
41
40
  <div className={clsx(`exclude-from-prose`, styles.doDontBase, className)} {...rest}>
42
- <Box
43
- className={styles.header}
44
- sx={{
45
- color: 'var(--fgColor-onEmphasis, var(--color-fg-on-emphasis))',
46
- }}
47
- >
41
+ <div className={styles.header} style={{color: 'var(--fgColor-onEmphasis, var(--color-fg-on-emphasis))'}}>
48
42
  <span className={styles.headerText}>{title}</span>
49
- </Box>
43
+ </div>
50
44
  <div className={styles.content}>
51
45
  {indented ? (
52
46
  <blockquote className={styles.indentedContent} style={{borderLeftColor: 'var(--brand-color-border-default)'}}>
@@ -0,0 +1,5 @@
1
+ .LoadingContainer {
2
+ border: 1px solid var(--brand-color-border-default);
3
+ border-radius: var(--brand-borderRadius-medium);
4
+ margin-block-end: var(--base-size-16);
5
+ }
@@ -0,0 +1,19 @@
1
+ .DrawerOverlay {
2
+ position: fixed;
3
+ inset: 0;
4
+ background: rgba(0, 0, 0, 0.5);
5
+ z-index: 1;
6
+ }
7
+
8
+ .DrawerPanel {
9
+ position: fixed;
10
+ top: 0;
11
+ right: 0;
12
+ bottom: 0;
13
+ width: 300px;
14
+ background: var(--brand-color-canvas-default, var(--color-canvas-default));
15
+ z-index: 1;
16
+ display: flex;
17
+ flex-direction: column;
18
+ }
19
+
@@ -1,7 +1,7 @@
1
1
  import React, {PropsWithChildren} from 'react'
2
- import {Box} from '@primer/react'
3
2
  import {AnimatePresence, motion} from 'framer-motion'
4
3
  import {FocusOn} from 'react-focus-on'
4
+ import styles from './Drawer.module.css'
5
5
 
6
6
  type Drawer = {
7
7
  isOpen: boolean
@@ -22,29 +22,26 @@ export function Drawer({isOpen, onDismiss, children}: PropsWithChildren<Drawer>)
22
22
  tabIndex={0}
23
23
  >
24
24
  <FocusOn returnFocus={true} onEscapeKey={() => onDismiss()}>
25
- <Box
25
+ <motion.div
26
26
  key="overlay"
27
- as={motion.div}
27
+ className={styles.DrawerOverlay}
28
28
  initial={{opacity: 0}}
29
29
  animate={{opacity: 1}}
30
30
  exit={{opacity: 0}}
31
31
  transition={{type: 'tween'}}
32
32
  onClick={() => onDismiss()}
33
- sx={{top: 0, right: 0, bottom: 0, left: 0, bg: 'rgba(0, 0, 0, 0.5)', position: 'fixed', zIndex: 1}}
34
33
  />
35
34
 
36
- <Box
35
+ <motion.div
37
36
  key="drawer"
38
- as={motion.div}
37
+ className={styles.DrawerPanel}
39
38
  initial={{x: '100%'}}
40
39
  animate={{x: 0}}
41
40
  exit={{x: '100%'}}
42
41
  transition={{type: 'tween', duration: 0.2}}
43
- style={{zIndex: 1}}
44
- sx={{width: 300, top: 0, right: 0, bottom: 0, bg: 'gray.0', position: 'fixed'}}
45
42
  >
46
43
  {children}
47
- </Box>
44
+ </motion.div>
48
45
  </FocusOn>
49
46
  </div>
50
47
  ) : null}
@@ -0,0 +1,35 @@
1
+ .StickyHeader {
2
+ position: sticky;
3
+ top: 0;
4
+ z-index: 99;
5
+ }
6
+
7
+ .ContentContainer {
8
+ max-width: 1200px;
9
+ width: 100%;
10
+ margin: 0 auto;
11
+ }
12
+
13
+ .BreadcrumbRoot,
14
+ .BreadcrumbItem {
15
+ color: var(--brand-InlineLink-color-rest);
16
+ }
17
+
18
+ .BreadcrumbItem {
19
+ text-transform: capitalize;
20
+ }
21
+
22
+ .HeroImageWrapper {
23
+ padding-block-start: var(--base-size-16);
24
+ width: 100%;
25
+ }
26
+
27
+
28
+ .ActionsWrapper {
29
+ padding-block-start: var(--base-size-16);
30
+ }
31
+
32
+
33
+ .RelatedLinks {
34
+ padding-top: var(--base-size-20);
35
+ }
@@ -4,7 +4,7 @@ import NextLink from 'next/link'
4
4
  import Head from 'next/head'
5
5
  import type {Folder, MdxFile, PageMapItem} from 'nextra'
6
6
  import {useFSRoute} from 'nextra/hooks'
7
- import {BaseStyles, Box as PRCBox, Breadcrumbs, PageLayout, ThemeProvider} from '@primer/react'
7
+ import {BaseStyles, Breadcrumbs, PageLayout, ThemeProvider} from '@primer/react'
8
8
  import '@primer/primitives/dist/css/functional/themes/light.css'
9
9
  import '@primer/primitives/dist/css/functional/themes/dark.css'
10
10
  import {
@@ -119,16 +119,10 @@ export function Theme({pageMap, children}: ThemeProps) {
119
119
  </Head>
120
120
 
121
121
  <ContentWrapper disableAnimations={disablePageAnimation}>
122
- <PRCBox
123
- sx={{
124
- position: 'sticky',
125
- top: 0,
126
- zIndex: 99,
127
- }}
128
- >
122
+ <div style={{position: 'sticky', top: 0, zIndex: 99}}>
129
123
  <SkipToMainContent href="#main">Skip to main content</SkipToMainContent>
130
124
  <Header flatDocsDirectories={flatDocsDirectories} siteTitle={siteTitle} pageMap={pageMap} />
131
- </PRCBox>
125
+ </div>
132
126
  <PageLayout rowGap="none" columnGap="none" padding="none" containerWidth="full">
133
127
  <PageLayout.Pane
134
128
  width="small"
@@ -145,7 +139,7 @@ export function Theme({pageMap, children}: ThemeProps) {
145
139
  </PageLayout.Pane>
146
140
  <PageLayout.Content padding="normal">
147
141
  <div id="main">
148
- <PRCBox sx={!isHomePage && {maxWidth: 1200, width: '100%', margin: '0 auto'}}>
142
+ <div style={!isHomePage ? {maxWidth: 1200, width: '100%', margin: '0 auto'} : undefined}>
149
143
  <Stack direction="vertical" padding="none" gap="spacious">
150
144
  {!isHomePage && (
151
145
  <>
@@ -155,9 +149,7 @@ export function Theme({pageMap, children}: ThemeProps) {
155
149
  <Breadcrumbs.Item
156
150
  as={NextLink}
157
151
  href="/"
158
- sx={{
159
- color: 'var(--brand-InlineLink-color-rest)',
160
- }}
152
+ style={{color: 'var(--brand-InlineLink-color-rest)'}}
161
153
  >
162
154
  {activeHeaderLink ? activeHeaderLink.title : siteTitle}
163
155
  </Breadcrumbs.Item>
@@ -166,8 +158,6 @@ export function Theme({pageMap, children}: ThemeProps) {
166
158
  .filter((item, index, array) => {
167
159
  const nextItem = array[index + 1]
168
160
 
169
- // Skip when current item is a folder followed by its index page
170
- // or when it is an index page with a tabbed navigation
171
161
  return !(
172
162
  (index < array.length - 1 &&
173
163
  nextItem.name === 'index' &&
@@ -192,7 +182,7 @@ export function Theme({pageMap, children}: ThemeProps) {
192
182
  key={item.name}
193
183
  href={item.route}
194
184
  selected={isLastItem}
195
- sx={{
185
+ style={{
196
186
  textTransform: 'capitalize',
197
187
  color: 'var(--brand-InlineLink-color-rest)',
198
188
  }}
@@ -204,7 +194,7 @@ export function Theme({pageMap, children}: ThemeProps) {
204
194
  </Breadcrumbs>
205
195
  )}
206
196
 
207
- <Box>
197
+ <div>
208
198
  <Stack direction="vertical" padding="none" gap={12} alignItems="flex-start">
209
199
  {activeMetadata.title && (
210
200
  <Heading as="h1" size="3">
@@ -217,12 +207,12 @@ export function Theme({pageMap, children}: ThemeProps) {
217
207
  </Text>
218
208
  )}
219
209
  {activeMetadata.image && (
220
- <Box paddingBlockStart={16} style={{width: '100%'}}>
210
+ <div style={{paddingBlockStart: 'var(--base-size-16)', width: '100%'}}>
221
211
  <Hero.Image src={activeMetadata.image} alt={activeMetadata['image-alt']} />
222
- </Box>
212
+ </div>
223
213
  )}
224
214
  {activeMetadata['action-1-text'] && (
225
- <Box paddingBlockStart={16}>
215
+ <div style={{paddingBlockStart: 'var(--base-size-16)'}}>
226
216
  <ButtonGroup>
227
217
  <Button as="a" href={activeMetadata['action-1-link']}>
228
218
  {activeMetadata['action-1-text']}
@@ -233,10 +223,10 @@ export function Theme({pageMap, children}: ThemeProps) {
233
223
  </Button>
234
224
  )}
235
225
  </ButtonGroup>
236
- </Box>
226
+ </div>
237
227
  )}
238
228
  </Stack>
239
- </Box>
229
+ </div>
240
230
  {activeMetadata['show-tabs'] && <UnderlineNav tabData={filteredTabData} />}
241
231
  </>
242
232
  )}
@@ -248,16 +238,16 @@ export function Theme({pageMap, children}: ThemeProps) {
248
238
  <>{children}</>
249
239
 
250
240
  {relatedLinks.length > 0 && (
251
- <PRCBox sx={{pt: 5}}>
241
+ <div style={{paddingTop: 'var(--base-size-20)'}}>
252
242
  <RelatedContentLinks links={relatedLinks} />
253
- </PRCBox>
243
+ </div>
254
244
  )}
255
245
  </>
256
246
  )}
257
247
  </article>
258
248
  <Footer filePath={filePath} repoURL={repoURL} repoSrcPath={repoSrcPath} />
259
249
  </Stack>
260
- </PRCBox>
250
+ </div>
261
251
  </div>
262
252
  </PageLayout.Content>
263
253
  </PageLayout>
@@ -49,7 +49,7 @@ export function Sidebar({pageMap}: SidebarProps) {
49
49
  return (
50
50
  <div className={styles.Sidebar}>
51
51
  {activeHeaderLink && (
52
- <Heading as="h2" size="6" className={styles.Sidebar__title} id="nav-list-heading">
52
+ <Heading as="h2" size="6" className={styles.Sidebar__title} id="nav-list-heading">
53
53
  {activeHeaderLink.title}
54
54
  <span className="visually-hidden"> navigation</span>
55
55
  </Heading>
@@ -77,7 +77,7 @@ export function Sidebar({pageMap}: SidebarProps) {
77
77
  }
78
78
 
79
79
  return (
80
- <NavList.Group title={subNavName} key={item.name} sx={{mb: 24}}>
80
+ <NavList.Group title={subNavName} key={item.name} style={{marginBottom: 'var(--base-size-24)'}}>
81
81
  <NavList.GroupHeading as="h3">
82
82
  <NextLink href={item.route}>{subNavName}</NextLink>
83
83
  </NavList.GroupHeading>
@@ -142,7 +142,7 @@ export function Sidebar({pageMap}: SidebarProps) {
142
142
  as={NextLink}
143
143
  key={landingPageItem.route}
144
144
  href={landingPageItem.route}
145
- sx={{textTransform: 'capitalize'}}
145
+ style={{textTransform: 'capitalize'}}
146
146
  aria-current={isCurrentOrChild ? 'page' : undefined}
147
147
  className={styles.NavListItem}
148
148
  >
@@ -155,7 +155,7 @@ export function Sidebar({pageMap}: SidebarProps) {
155
155
  )
156
156
  })}
157
157
  {sidebarLinks.length > 0 && (
158
- <NavList.Group title="" sx={{mb: 24}}>
158
+ <NavList.Group title="" style={{marginBottom: 'var(--base-size-24)'}}>
159
159
  {sidebarLinks.map(link => {
160
160
  return (
161
161
  <NavList.Item
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primer/doctocat-nextjs",
3
- "version": "0.0.0-20251114183111",
3
+ "version": "0.0.0-20251124211620",
4
4
  "description": "A Next.js theme for building Primer documentation sites",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -27,7 +27,7 @@
27
27
  "dependencies": {
28
28
  "@next/mdx": "15.5.2",
29
29
  "@primer/octicons-react": "19.15.1",
30
- "@primer/react": "^37.11.0",
30
+ "@primer/react": "^38.0.0",
31
31
  "@types/lodash.debounce": "^4.0.9",
32
32
  "framer-motion": "12.4.0",
33
33
  "lodash.debounce": "^4.0.8",