@docusaurus/theme-classic 0.0.0-5051 → 0.0.0-5052
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/lib/theme/Navbar/Content/index.js +2 -2
- package/lib/theme/Navbar/Search/index.d.ts +1 -1
- package/lib/theme/Navbar/Search/index.js +3 -2
- package/lib/theme/NavbarItem/SearchNavbarItem.d.ts +1 -1
- package/lib/theme/NavbarItem/SearchNavbarItem.js +2 -2
- package/lib/validateThemeConfig.js +1 -0
- package/package.json +13 -13
- package/src/theme/Navbar/Content/index.tsx +2 -2
- package/src/theme/Navbar/Search/index.tsx +6 -2
- package/src/theme/NavbarItem/SearchNavbarItem.tsx +5 -2
- package/src/theme-classic.d.ts +2 -0
- package/src/validateThemeConfig.ts +1 -0
|
@@ -42,7 +42,7 @@ export default function NavbarContent() {
|
|
|
42
42
|
const mobileSidebar = useNavbarMobileSidebar();
|
|
43
43
|
const items = useNavbarItems();
|
|
44
44
|
const [leftItems, rightItems] = splitNavbarItems(items);
|
|
45
|
-
const
|
|
45
|
+
const searchBarItem = items.find((item) => item.type === 'search');
|
|
46
46
|
return (
|
|
47
47
|
<NavbarContentLayout
|
|
48
48
|
left={
|
|
@@ -59,7 +59,7 @@ export default function NavbarContent() {
|
|
|
59
59
|
<>
|
|
60
60
|
<NavbarItems items={rightItems} />
|
|
61
61
|
<NavbarColorModeToggle className={styles.colorModeToggle} />
|
|
62
|
-
{
|
|
62
|
+
{!searchBarItem && (
|
|
63
63
|
<NavbarSearch>
|
|
64
64
|
<SearchBar />
|
|
65
65
|
</NavbarSearch>
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
|
+
import clsx from 'clsx';
|
|
8
9
|
import styles from './styles.module.css';
|
|
9
|
-
export default function NavbarSearch({children}) {
|
|
10
|
-
return <div className={styles.searchBox}>{children}</div>;
|
|
10
|
+
export default function NavbarSearch({children, className}) {
|
|
11
|
+
return <div className={clsx(className, styles.searchBox)}>{children}</div>;
|
|
11
12
|
}
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
*/
|
|
7
7
|
/// <reference types="react" />
|
|
8
8
|
import type { Props } from '@theme/NavbarItem/SearchNavbarItem';
|
|
9
|
-
export default function SearchNavbarItem({ mobile }: Props): JSX.Element | null;
|
|
9
|
+
export default function SearchNavbarItem({ mobile, className, }: Props): JSX.Element | null;
|
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import SearchBar from '@theme/SearchBar';
|
|
9
9
|
import NavbarSearch from '@theme/Navbar/Search';
|
|
10
|
-
export default function SearchNavbarItem({mobile}) {
|
|
10
|
+
export default function SearchNavbarItem({mobile, className}) {
|
|
11
11
|
if (mobile) {
|
|
12
12
|
return null;
|
|
13
13
|
}
|
|
14
14
|
return (
|
|
15
|
-
<NavbarSearch>
|
|
15
|
+
<NavbarSearch className={className}>
|
|
16
16
|
<SearchBar />
|
|
17
17
|
</NavbarSearch>
|
|
18
18
|
);
|
|
@@ -177,6 +177,7 @@ const LocaleDropdownNavbarItemSchema = NavbarItemBaseSchema.append({
|
|
|
177
177
|
});
|
|
178
178
|
const SearchItemSchema = utils_validation_1.Joi.object({
|
|
179
179
|
type: utils_validation_1.Joi.string().equal('search').required(),
|
|
180
|
+
className: utils_validation_1.Joi.string(),
|
|
180
181
|
});
|
|
181
182
|
const NavbarItemSchema = utils_validation_1.Joi.object({
|
|
182
183
|
position: NavbarItemPosition,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/theme-classic",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-5052",
|
|
4
4
|
"description": "Classic theme for Docusaurus",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "src/theme-classic.d.ts",
|
|
@@ -20,15 +20,15 @@
|
|
|
20
20
|
"copy:watch": "node ../../admin/scripts/copyUntypedFiles.js --watch"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@docusaurus/core": "0.0.0-
|
|
24
|
-
"@docusaurus/plugin-content-blog": "0.0.0-
|
|
25
|
-
"@docusaurus/plugin-content-docs": "0.0.0-
|
|
26
|
-
"@docusaurus/plugin-content-pages": "0.0.0-
|
|
27
|
-
"@docusaurus/theme-common": "0.0.0-
|
|
28
|
-
"@docusaurus/theme-translations": "0.0.0-
|
|
29
|
-
"@docusaurus/utils": "0.0.0-
|
|
30
|
-
"@docusaurus/utils-common": "0.0.0-
|
|
31
|
-
"@docusaurus/utils-validation": "0.0.0-
|
|
23
|
+
"@docusaurus/core": "0.0.0-5052",
|
|
24
|
+
"@docusaurus/plugin-content-blog": "0.0.0-5052",
|
|
25
|
+
"@docusaurus/plugin-content-docs": "0.0.0-5052",
|
|
26
|
+
"@docusaurus/plugin-content-pages": "0.0.0-5052",
|
|
27
|
+
"@docusaurus/theme-common": "0.0.0-5052",
|
|
28
|
+
"@docusaurus/theme-translations": "0.0.0-5052",
|
|
29
|
+
"@docusaurus/utils": "0.0.0-5052",
|
|
30
|
+
"@docusaurus/utils-common": "0.0.0-5052",
|
|
31
|
+
"@docusaurus/utils-validation": "0.0.0-5052",
|
|
32
32
|
"@mdx-js/react": "^1.6.22",
|
|
33
33
|
"clsx": "^1.1.1",
|
|
34
34
|
"copy-text-to-clipboard": "^3.0.1",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"tslib": "^2.4.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@docusaurus/module-type-aliases": "0.0.0-
|
|
47
|
-
"@docusaurus/types": "0.0.0-
|
|
46
|
+
"@docusaurus/module-type-aliases": "0.0.0-5052",
|
|
47
|
+
"@docusaurus/types": "0.0.0-5052",
|
|
48
48
|
"@types/mdx-js__react": "^1.5.5",
|
|
49
49
|
"@types/nprogress": "^0.2.0",
|
|
50
50
|
"@types/prismjs": "^1.26.0",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"engines": {
|
|
61
61
|
"node": ">=14"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "4a38a12418dc0d2bfa287bd38392fabf04222556"
|
|
64
64
|
}
|
|
@@ -56,7 +56,7 @@ export default function NavbarContent(): JSX.Element {
|
|
|
56
56
|
const items = useNavbarItems();
|
|
57
57
|
const [leftItems, rightItems] = splitNavbarItems(items);
|
|
58
58
|
|
|
59
|
-
const
|
|
59
|
+
const searchBarItem = items.find((item) => item.type === 'search');
|
|
60
60
|
|
|
61
61
|
return (
|
|
62
62
|
<NavbarContentLayout
|
|
@@ -74,7 +74,7 @@ export default function NavbarContent(): JSX.Element {
|
|
|
74
74
|
<>
|
|
75
75
|
<NavbarItems items={rightItems} />
|
|
76
76
|
<NavbarColorModeToggle className={styles.colorModeToggle} />
|
|
77
|
-
{
|
|
77
|
+
{!searchBarItem && (
|
|
78
78
|
<NavbarSearch>
|
|
79
79
|
<SearchBar />
|
|
80
80
|
</NavbarSearch>
|
|
@@ -6,10 +6,14 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import React from 'react';
|
|
9
|
+
import clsx from 'clsx';
|
|
9
10
|
import type {Props} from '@theme/Navbar/Search';
|
|
10
11
|
|
|
11
12
|
import styles from './styles.module.css';
|
|
12
13
|
|
|
13
|
-
export default function NavbarSearch({
|
|
14
|
-
|
|
14
|
+
export default function NavbarSearch({
|
|
15
|
+
children,
|
|
16
|
+
className,
|
|
17
|
+
}: Props): JSX.Element {
|
|
18
|
+
return <div className={clsx(className, styles.searchBox)}>{children}</div>;
|
|
15
19
|
}
|
|
@@ -10,13 +10,16 @@ import SearchBar from '@theme/SearchBar';
|
|
|
10
10
|
import NavbarSearch from '@theme/Navbar/Search';
|
|
11
11
|
import type {Props} from '@theme/NavbarItem/SearchNavbarItem';
|
|
12
12
|
|
|
13
|
-
export default function SearchNavbarItem({
|
|
13
|
+
export default function SearchNavbarItem({
|
|
14
|
+
mobile,
|
|
15
|
+
className,
|
|
16
|
+
}: Props): JSX.Element | null {
|
|
14
17
|
if (mobile) {
|
|
15
18
|
return null;
|
|
16
19
|
}
|
|
17
20
|
|
|
18
21
|
return (
|
|
19
|
-
<NavbarSearch>
|
|
22
|
+
<NavbarSearch className={className}>
|
|
20
23
|
<SearchBar />
|
|
21
24
|
</NavbarSearch>
|
|
22
25
|
);
|
package/src/theme-classic.d.ts
CHANGED
|
@@ -777,6 +777,7 @@ declare module '@theme/Navbar/Search' {
|
|
|
777
777
|
|
|
778
778
|
export interface Props {
|
|
779
779
|
readonly children: ReactNode;
|
|
780
|
+
readonly className?: string;
|
|
780
781
|
}
|
|
781
782
|
|
|
782
783
|
export default function NavbarSearch(props: Props): JSX.Element;
|
|
@@ -834,6 +835,7 @@ declare module '@theme/NavbarItem/DropdownNavbarItem' {
|
|
|
834
835
|
declare module '@theme/NavbarItem/SearchNavbarItem' {
|
|
835
836
|
export interface Props {
|
|
836
837
|
readonly mobile?: boolean;
|
|
838
|
+
readonly className?: string;
|
|
837
839
|
}
|
|
838
840
|
|
|
839
841
|
export default function SearchNavbarItem(props: Props): JSX.Element;
|