@primer/doctocat-nextjs 0.5.5-rc.5575e44 → 0.5.6-rc.89c7234

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,5 +1,13 @@
1
1
  # @primer/doctocat-nextjs
2
2
 
3
+ ## 0.5.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [#56](https://github.com/primer/doctocat-nextjs/pull/56) [`e6a55fa`](https://github.com/primer/doctocat-nextjs/commit/e6a55fab3eb3fd56cbb20fe85a31751e6c227fc5) Thanks [@danielguillan](https://github.com/danielguillan)! - Updated theme switcher aria label
8
+
9
+ - [#54](https://github.com/primer/doctocat-nextjs/pull/54) [`a57f42f`](https://github.com/primer/doctocat-nextjs/commit/a57f42fec69d142e4dd1dc33129ce2423651e907) Thanks [@danielguillan](https://github.com/danielguillan)! - Fixed a bug that caused breadcrumbs to display an incorrect title for pages with tabs
10
+
3
11
  ## 0.5.5
4
12
 
5
13
  ### Patch Changes
@@ -120,7 +120,7 @@ export function Header({siteTitle, flatDocsDirectories, pageMap}: HeaderProps) {
120
120
  <IconButton
121
121
  icon={colorMode === 'light' ? SunIcon : MoonIcon}
122
122
  variant="invisible"
123
- aria-label={`Change color mode. Active mode is ${colorMode}.`}
123
+ aria-label={`Switch to ${colorMode === 'light' ? 'dark' : 'light'} mode`}
124
124
  onClick={() => setColorMode(colorMode === 'light' ? 'dark' : 'light')}
125
125
  />
126
126
  <IconButton
@@ -159,16 +159,18 @@ export function Theme({pageMap, children}: ThemeProps) {
159
159
  (index < array.length - 1 &&
160
160
  nextItem.name === 'index' &&
161
161
  item.route === nextItem.route &&
162
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
163
- !nextItem.frontMatter?.['tab-label']) ||
164
- (item.name === 'index' &&
165
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
166
- item.frontMatter?.['tab-label'])
162
+ !nextItem.frontMatter['tab-label']) ||
163
+ (item.name === 'index' && item.frontMatter['tab-label'])
167
164
  )
168
165
  })
169
166
  .map((item, index, visibleItems) => {
170
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
171
- const itemTitle = item.frontMatter?.['tab-label'] || item.title
167
+ const itemTitle = Array.isArray(item.children)
168
+ ? item.children.find(child => child.name === 'index')?.frontMatter.title ||
169
+ item.frontMatter['tab-label'] ||
170
+ item.frontMatter.title ||
171
+ item.title
172
+ : item.frontMatter['tab-label'] || item.frontMatter.title || item.title
173
+
172
174
  const isLastItem = index === visibleItems.length - 1
173
175
 
174
176
  return (
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primer/doctocat-nextjs",
3
- "version": "0.5.5-rc.5575e44",
3
+ "version": "0.5.6-rc.89c7234",
4
4
  "description": "A Next.js theme for building Primer documentation sites",
5
5
  "main": "index.js",
6
6
  "type": "module",