@docusaurus/theme-classic 0.0.0-4864 → 0.0.0-4865

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.
@@ -692,6 +692,16 @@ declare module '@theme/Navbar/MobileSidebar/Header' {
692
692
  export default function NavbarMobileSidebarHeader(): JSX.Element;
693
693
  }
694
694
 
695
+ declare module '@theme/Navbar/Search' {
696
+ import type {ReactNode} from 'react';
697
+
698
+ export interface Props {
699
+ readonly children: ReactNode;
700
+ }
701
+
702
+ export default function NavbarSearch(props: Props): JSX.Element;
703
+ }
704
+
695
705
  declare module '@theme/NavbarItem/DefaultNavbarItem' {
696
706
  import type {Props as NavbarNavLinkProps} from '@theme/NavbarItem/NavbarNavLink';
697
707
 
@@ -15,6 +15,7 @@ import {
15
15
  } from '@docusaurus/theme-common';
16
16
  import NavbarMobileSidebarToggle from '@theme/Navbar/MobileSidebar/Toggle';
17
17
  import NavbarLogo from '@theme/Navbar/Logo';
18
+ import NavbarSearch from '@theme/Navbar/Search';
18
19
  import styles from './styles.module.css';
19
20
 
20
21
  function useNavbarItems() {
@@ -62,7 +63,11 @@ export default function NavbarContent() {
62
63
  <>
63
64
  <NavbarItems items={rightItems} />
64
65
  <NavbarColorModeToggle className={styles.colorModeToggle} />
65
- {autoAddSearchBar && <SearchBar />}
66
+ {autoAddSearchBar && (
67
+ <NavbarSearch>
68
+ <SearchBar />
69
+ </NavbarSearch>
70
+ )}
66
71
  </>
67
72
  }
68
73
  />
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import React from 'react';
8
+ import styles from './styles.module.css';
9
+ export default function NavbarSearch({children}) {
10
+ return <div className={styles.searchBox}>{children}</div>;
11
+ }
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ @media (max-width: 996px) {
9
+ .searchBox {
10
+ position: absolute;
11
+ right: var(--ifm-navbar-padding-horizontal);
12
+ }
13
+ }
14
+
15
+ @media (min-width: 997px) {
16
+ .searchBox {
17
+ padding: var(--ifm-navbar-item-padding-vertical)
18
+ var(--ifm-navbar-item-padding-horizontal);
19
+ }
20
+ }
@@ -6,10 +6,15 @@
6
6
  */
7
7
  import React from 'react';
8
8
  import SearchBar from '@theme/SearchBar';
9
+ import NavbarSearch from '@theme/Navbar/Search';
9
10
  export default function SearchNavbarItem({mobile}) {
10
11
  if (mobile) {
11
12
  return null;
12
13
  }
13
14
 
14
- return <SearchBar />;
15
+ return (
16
+ <NavbarSearch>
17
+ <SearchBar />
18
+ </NavbarSearch>
19
+ );
15
20
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docusaurus/theme-classic",
3
- "version": "0.0.0-4864",
3
+ "version": "0.0.0-4865",
4
4
  "description": "Classic theme for Docusaurus",
5
5
  "main": "lib/index.js",
6
6
  "types": "src/theme-classic.d.ts",
@@ -21,15 +21,15 @@
21
21
  "format:lib-next": "prettier --config ../../.prettierrc --write \"lib-next/**/*.{js,ts,jsx,tsc}\""
22
22
  },
23
23
  "dependencies": {
24
- "@docusaurus/core": "0.0.0-4864",
25
- "@docusaurus/plugin-content-blog": "0.0.0-4864",
26
- "@docusaurus/plugin-content-docs": "0.0.0-4864",
27
- "@docusaurus/plugin-content-pages": "0.0.0-4864",
28
- "@docusaurus/theme-common": "0.0.0-4864",
29
- "@docusaurus/theme-translations": "0.0.0-4864",
30
- "@docusaurus/utils": "0.0.0-4864",
31
- "@docusaurus/utils-common": "0.0.0-4864",
32
- "@docusaurus/utils-validation": "0.0.0-4864",
24
+ "@docusaurus/core": "0.0.0-4865",
25
+ "@docusaurus/plugin-content-blog": "0.0.0-4865",
26
+ "@docusaurus/plugin-content-docs": "0.0.0-4865",
27
+ "@docusaurus/plugin-content-pages": "0.0.0-4865",
28
+ "@docusaurus/theme-common": "0.0.0-4865",
29
+ "@docusaurus/theme-translations": "0.0.0-4865",
30
+ "@docusaurus/utils": "0.0.0-4865",
31
+ "@docusaurus/utils-common": "0.0.0-4865",
32
+ "@docusaurus/utils-validation": "0.0.0-4865",
33
33
  "@mdx-js/react": "^1.6.22",
34
34
  "clsx": "^1.1.1",
35
35
  "copy-text-to-clipboard": "^3.0.1",
@@ -45,8 +45,8 @@
45
45
  "@babel/cli": "^7.17.6",
46
46
  "@babel/core": "^7.17.9",
47
47
  "@babel/preset-typescript": "^7.16.7",
48
- "@docusaurus/module-type-aliases": "0.0.0-4864",
49
- "@docusaurus/types": "0.0.0-4864",
48
+ "@docusaurus/module-type-aliases": "0.0.0-4865",
49
+ "@docusaurus/types": "0.0.0-4865",
50
50
  "@types/mdx-js__react": "^1.5.5",
51
51
  "@types/prismjs": "^1.26.0",
52
52
  "@types/rtlcss": "^3.1.3",
@@ -62,5 +62,5 @@
62
62
  "engines": {
63
63
  "node": ">=14"
64
64
  },
65
- "gitHead": "ae6d7c8caecd661cd85ab05c9d7e9ecd935725a1"
65
+ "gitHead": "3bfec620587180f9e7dad2bf2a2713172be65fe7"
66
66
  }
@@ -17,6 +17,7 @@ import {
17
17
  } from '@docusaurus/theme-common';
18
18
  import NavbarMobileSidebarToggle from '@theme/Navbar/MobileSidebar/Toggle';
19
19
  import NavbarLogo from '@theme/Navbar/Logo';
20
+ import NavbarSearch from '@theme/Navbar/Search';
20
21
  import styles from './styles.module.css';
21
22
 
22
23
  function useNavbarItems() {
@@ -73,7 +74,11 @@ export default function NavbarContent(): JSX.Element {
73
74
  <>
74
75
  <NavbarItems items={rightItems} />
75
76
  <NavbarColorModeToggle className={styles.colorModeToggle} />
76
- {autoAddSearchBar && <SearchBar />}
77
+ {autoAddSearchBar && (
78
+ <NavbarSearch>
79
+ <SearchBar />
80
+ </NavbarSearch>
81
+ )}
77
82
  </>
78
83
  }
79
84
  />
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ import React from 'react';
9
+ import type {Props} from '@theme/Navbar/Search';
10
+
11
+ import styles from './styles.module.css';
12
+
13
+ export default function NavbarSearch({children}: Props): JSX.Element {
14
+ return <div className={styles.searchBox}>{children}</div>;
15
+ }
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ @media (max-width: 996px) {
9
+ .searchBox {
10
+ position: absolute;
11
+ right: var(--ifm-navbar-padding-horizontal);
12
+ }
13
+ }
14
+
15
+ @media (min-width: 997px) {
16
+ .searchBox {
17
+ padding: var(--ifm-navbar-item-padding-vertical)
18
+ var(--ifm-navbar-item-padding-horizontal);
19
+ }
20
+ }
@@ -8,11 +8,16 @@
8
8
  import React from 'react';
9
9
  import type {Props} from '@theme/NavbarItem/SearchNavbarItem';
10
10
  import SearchBar from '@theme/SearchBar';
11
+ import NavbarSearch from '@theme/Navbar/Search';
11
12
 
12
13
  export default function SearchNavbarItem({mobile}: Props): JSX.Element | null {
13
14
  if (mobile) {
14
15
  return null;
15
16
  }
16
17
 
17
- return <SearchBar />;
18
+ return (
19
+ <NavbarSearch>
20
+ <SearchBar />
21
+ </NavbarSearch>
22
+ );
18
23
  }
@@ -692,6 +692,16 @@ declare module '@theme/Navbar/MobileSidebar/Header' {
692
692
  export default function NavbarMobileSidebarHeader(): JSX.Element;
693
693
  }
694
694
 
695
+ declare module '@theme/Navbar/Search' {
696
+ import type {ReactNode} from 'react';
697
+
698
+ export interface Props {
699
+ readonly children: ReactNode;
700
+ }
701
+
702
+ export default function NavbarSearch(props: Props): JSX.Element;
703
+ }
704
+
695
705
  declare module '@theme/NavbarItem/DefaultNavbarItem' {
696
706
  import type {Props as NavbarNavLinkProps} from '@theme/NavbarItem/NavbarNavLink';
697
707