@primer/doctocat-nextjs 0.5.0-rc.6ee882c → 0.5.0-rc.d795ae7
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 +16 -2
- package/components/index.ts +1 -0
- package/components/layout/article/Article.module.css +14 -1
- package/components/layout/article/Article.tsx +5 -1
- package/components/layout/header/Header.module.css +10 -0
- package/components/layout/header/Header.tsx +25 -20
- package/components/layout/root-layout/Theme.tsx +1 -0
- package/components/layout/table-of-contents/TableOfContents.module.css +18 -2
- package/components/table-wrapper/TableWrapper.module.css +4 -0
- package/components/table-wrapper/TableWrapper.tsx +6 -0
- package/css/global.css +4 -0
- package/css/prose.module.css +5 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,9 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
7
|
-
- [#30](https://github.com/primer/doctocat-nextjs/pull/30) [`cdcb65e`](https://github.com/primer/doctocat-nextjs/commit/cdcb65e087d647a6d61c87d9122f105dcda64e35) Thanks [@joshfarrant](https://github.com/joshfarrant)! - -
|
|
7
|
+
- [#30](https://github.com/primer/doctocat-nextjs/pull/30) [`cdcb65e`](https://github.com/primer/doctocat-nextjs/commit/cdcb65e087d647a6d61c87d9122f105dcda64e35) Thanks [@joshfarrant](https://github.com/joshfarrant)! - - Arbitrary links can now be added to the sidebar and header using the `Theme` component's `headerLinks` and `sidebarLinks` props.
|
|
8
|
+
|
|
8
9
|
- Updated the header navigation to more closely visually align it with the existing Primer docs navigation.
|
|
9
|
-
- Removed `_meta.global.ts` and instead directly pass header and sidebar links into the
|
|
10
|
+
- Removed `_meta.global.ts` and instead directly pass header and sidebar links into the Doctocat `Theme` component.
|
|
11
|
+
|
|
10
12
|
```diff
|
|
11
13
|
- // _meta.global.ts
|
|
12
14
|
- export default {
|
|
@@ -15,6 +17,7 @@
|
|
|
15
17
|
- title: 'Doctocat',
|
|
16
18
|
- }
|
|
17
19
|
```
|
|
20
|
+
|
|
18
21
|
```diff
|
|
19
22
|
+ // app/layout.tsx
|
|
20
23
|
+
|
|
@@ -29,6 +32,17 @@
|
|
|
29
32
|
+ <Theme sidebarLinks={sidebarLinks} {...rest} />
|
|
30
33
|
```
|
|
31
34
|
|
|
35
|
+
### Patch Changes
|
|
36
|
+
|
|
37
|
+
- [#34](https://github.com/primer/doctocat-nextjs/pull/34) [`ccf198c`](https://github.com/primer/doctocat-nextjs/commit/ccf198cca25b1f021c5ae78b8e2760c141a77dcc) Thanks [@rezrah](https://github.com/rezrah)! - Collection of UI bugfixes:
|
|
38
|
+
|
|
39
|
+
- Sidebar offset added to prevent links being trapped under fixed header
|
|
40
|
+
- Narrow viewport overflow bug fixed
|
|
41
|
+
- Table of contents presentation fixed on narrow viewport, and has improved presentation on wider breakpoints.
|
|
42
|
+
- Frontmatter metadata presentation now fixed on narrow viewport
|
|
43
|
+
- OS scrollbar in dark color mode now respects color scheme
|
|
44
|
+
- Inverted margin spacing in markdown content to use `margin-block-end` instead of `margin-block-start` to fix inconsistent spacing
|
|
45
|
+
|
|
32
46
|
## 0.4.1
|
|
33
47
|
|
|
34
48
|
### Patch Changes
|
package/components/index.ts
CHANGED
|
@@ -10,3 +10,4 @@ export {Article} from './layout/article/Article'
|
|
|
10
10
|
export {HeadingLink} from './layout/heading-link/HeadingLinks'
|
|
11
11
|
export {CodeBlock} from './layout/code-block/CodeBlock'
|
|
12
12
|
export {PropTableValues} from './layout/prop-values/PropValues'
|
|
13
|
+
export {TableWrapper} from './table-wrapper/TableWrapper'
|
|
@@ -14,7 +14,14 @@
|
|
|
14
14
|
order: 0;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
@media screen and (
|
|
17
|
+
@media screen and (max-width: 48rem) {
|
|
18
|
+
.Article--withToc {
|
|
19
|
+
display: flex; /* Prevents column overflow */
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@media screen and (min-width: 1023px) {
|
|
18
25
|
.main {
|
|
19
26
|
order: 0;
|
|
20
27
|
}
|
|
@@ -27,3 +34,9 @@
|
|
|
27
34
|
grid-template-columns: 1fr 200px;
|
|
28
35
|
}
|
|
29
36
|
}
|
|
37
|
+
|
|
38
|
+
@media screen and (min-width: 2048px) {
|
|
39
|
+
.Article--withToc {
|
|
40
|
+
grid-template-columns: 1fr;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -35,7 +35,11 @@ export function Article({children, toc, metadata}: PropsWithChildren<Props>) {
|
|
|
35
35
|
<div className={styles.main}>
|
|
36
36
|
{hasMetadata ? (
|
|
37
37
|
<Box marginBlockEnd={48}>
|
|
38
|
-
<Stack
|
|
38
|
+
<Stack
|
|
39
|
+
padding="none"
|
|
40
|
+
direction={{narrow: 'vertical', regular: 'horizontal'}}
|
|
41
|
+
justifyContent="space-between"
|
|
42
|
+
>
|
|
39
43
|
{metadata.ready || metadata.a11yReviewed ? (
|
|
40
44
|
<Stack direction="horizontal" gap={8} padding="none">
|
|
41
45
|
{metadata.ready === true && <ReadinessLabel />}
|
|
@@ -117,12 +117,22 @@
|
|
|
117
117
|
.Header__links {
|
|
118
118
|
display: none;
|
|
119
119
|
margin-inline: var(--base-size-24);
|
|
120
|
+
margin-block: 0;
|
|
121
|
+
padding: 0;
|
|
122
|
+
list-style: none;
|
|
123
|
+
gap: var(--base-size-2);
|
|
120
124
|
}
|
|
121
125
|
|
|
122
126
|
.Header__link {
|
|
123
127
|
text-decoration: none;
|
|
124
128
|
font-size: var(--base-font-size-16);
|
|
125
129
|
font-weight: var(--base-font-weight-500);
|
|
130
|
+
padding: var(--base-size-6) var(--base-size-12);
|
|
131
|
+
border-radius: var(--brand-borderRadius-small);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.Header__link:hover {
|
|
135
|
+
background-color: var(--brand-color-canvas-subtle);
|
|
126
136
|
}
|
|
127
137
|
|
|
128
138
|
.Header__externalLinkIcon {
|
|
@@ -60,7 +60,7 @@ export function Header({siteTitle, flatDocsDirectories, pageMap}: HeaderProps) {
|
|
|
60
60
|
<div className={styles.Header__start}>
|
|
61
61
|
<Link href="/" className={styles.Header__siteTitle}>
|
|
62
62
|
<MarkGithubIcon size={24} />
|
|
63
|
-
<Text className={styles.Header__siteTitleText} as="p" size="
|
|
63
|
+
<Text className={styles.Header__siteTitleText} as="p" size="200" weight="semibold">
|
|
64
64
|
{siteTitle}
|
|
65
65
|
</Text>
|
|
66
66
|
</Link>
|
|
@@ -70,28 +70,33 @@ export function Header({siteTitle, flatDocsDirectories, pageMap}: HeaderProps) {
|
|
|
70
70
|
{headerLinks.length > 0 && <LinksDropdown className={styles.Header__linksDropdown} items={headerLinks} />}
|
|
71
71
|
</div>
|
|
72
72
|
<div className={styles.Header__end}>
|
|
73
|
-
<
|
|
73
|
+
<ul className={styles.Header__links}>
|
|
74
74
|
{headerLinks.map(link => (
|
|
75
|
-
<
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
>
|
|
82
|
-
<Text
|
|
83
|
-
size="200"
|
|
84
|
-
variant={link.isActive ? 'default' : 'muted'}
|
|
85
|
-
weight={link.isActive ? 'semibold' : 'normal'}
|
|
75
|
+
<li key={link.href}>
|
|
76
|
+
<Link
|
|
77
|
+
className={styles.Header__link}
|
|
78
|
+
href={link.href}
|
|
79
|
+
aria-current={link.isActive ? 'page' : undefined}
|
|
80
|
+
{...(link.isExternal && {target: '_blank', rel: 'noopener noreferrer'})}
|
|
86
81
|
>
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
82
|
+
<Text
|
|
83
|
+
size="200"
|
|
84
|
+
variant={link.isActive ? 'default' : 'muted'}
|
|
85
|
+
weight={link.isActive ? 'semibold' : 'normal'}
|
|
86
|
+
>
|
|
87
|
+
{link.title}
|
|
88
|
+
{link.isExternal && (
|
|
89
|
+
<ArrowUpRightIcon
|
|
90
|
+
className={styles.Header__externalLinkIcon}
|
|
91
|
+
size={10}
|
|
92
|
+
aria-label="External link"
|
|
93
|
+
/>
|
|
94
|
+
)}
|
|
95
|
+
</Text>
|
|
96
|
+
</Link>
|
|
97
|
+
</li>
|
|
93
98
|
))}
|
|
94
|
-
</
|
|
99
|
+
</ul>
|
|
95
100
|
<div className={clsx(styles.Header__searchArea, isSearchOpen && styles['Header__searchArea--open'])}>
|
|
96
101
|
<FocusOn enabled={isSearchOpen} onEscapeKey={closeSearch} onClickOutside={closeSearch}>
|
|
97
102
|
<GlobalSearch
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
.wrapper {
|
|
2
2
|
position: sticky;
|
|
3
|
-
top:
|
|
3
|
+
top: 140px;
|
|
4
|
+
scroll-margin-top: 140px;
|
|
4
5
|
}
|
|
5
6
|
|
|
6
7
|
.heading {
|
|
7
8
|
font-size: var(--base-size-12);
|
|
8
|
-
padding-inline-start: var(--base-size-16);
|
|
9
9
|
margin-block-end: var(--base-size-8);
|
|
10
10
|
text-transform: uppercase;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
.item {
|
|
14
|
+
margin-inline-start: 0 !important;
|
|
14
15
|
margin-block-end: var(--base-size-4);
|
|
15
16
|
transition: transform var(--brand-animation-duration-fast) var(--brand-animation-easing-default);
|
|
16
17
|
}
|
|
@@ -18,3 +19,18 @@
|
|
|
18
19
|
.item[aria-current='location'] {
|
|
19
20
|
transform: translateX(var(--base-size-4));
|
|
20
21
|
}
|
|
22
|
+
|
|
23
|
+
@media screen and (min-width: 2048px) {
|
|
24
|
+
.wrapper {
|
|
25
|
+
position: fixed;
|
|
26
|
+
display: flex;
|
|
27
|
+
flex-direction: column;
|
|
28
|
+
min-width: 280px;
|
|
29
|
+
right: 0;
|
|
30
|
+
overflow: auto;
|
|
31
|
+
padding: var(--base-size-40) var(--base-size-40) var(--base-size-40) 0;
|
|
32
|
+
top: 65px;
|
|
33
|
+
max-height: calc(100vh - 65px);
|
|
34
|
+
width: 220px;
|
|
35
|
+
}
|
|
36
|
+
}
|
package/css/global.css
CHANGED
package/css/prose.module.css
CHANGED
|
@@ -33,11 +33,11 @@
|
|
|
33
33
|
/* ---------------------------------------------------------- */
|
|
34
34
|
|
|
35
35
|
.Prose
|
|
36
|
-
:is(h1, h2, h3, h4, h5, h6, p, ul, ol, blockquote, figure, hr, table, pre, dl):not(
|
|
37
|
-
:
|
|
38
|
-
|
|
36
|
+
:is(h1, h2, h3, h4, h5, h6, p, ul, ol, blockquote, figure, hr, table, pre, dl, :global(.custom-component)):not(
|
|
37
|
+
:global(.custom-component)
|
|
38
|
+
:is(h1, h2, h3, h4, h5, h6, p, ul, ol, blockquote, figure, hr, table, pre, dl, :global(.custom-component))
|
|
39
39
|
) {
|
|
40
|
-
margin-block-
|
|
40
|
+
margin-block-end: var(--spacing, 1em);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
/* ---------------------------------------------------------- */
|
|
@@ -235,7 +235,7 @@
|
|
|
235
235
|
display: block;
|
|
236
236
|
max-width: 100%;
|
|
237
237
|
height: auto;
|
|
238
|
-
margin-block-
|
|
238
|
+
margin-block-end: var(--spacing);
|
|
239
239
|
}
|
|
240
240
|
|
|
241
241
|
/* ---------------------------------------------------------- */
|