diff --git a/packages/components/package.json b/packages/components/package.json index 6aacca192..95792ccea 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -55,15 +55,15 @@ "@radix-ui/react-navigation-menu": "^1.2.0", "clsx": "2.1.1", "fuzzy": "0.1.3", - "nextra": "4.0.0-app-router.41", - "nextra-theme-docs": "4.0.0-app-router.41", + "nextra": "4.0.0-app-router.42", + "nextra-theme-docs": "4.0.0-app-router.42", "react-paginate": "8.2.0", "react-player": "2.16.0", "semver": "^7.3.8", "tailwind-merge": "^2.5.2" }, "devDependencies": { - "@svgr/babel-plugin-remove-jsx-attribute": "^8.0.0", + "@svgr/plugin-svgo": "^8.1.0", "@theguild/editor": "workspace:*", "@theguild/tailwind-config": "0.6.2", "@types/dedent": "0.7.2", diff --git a/packages/components/src/components/hive-navigation/index.tsx b/packages/components/src/components/hive-navigation/index.tsx index 3599d1811..1a59a4811 100644 --- a/packages/components/src/components/hive-navigation/index.tsx +++ b/packages/components/src/components/hive-navigation/index.tsx @@ -5,6 +5,7 @@ import React, { FC, forwardRef, Fragment, + ReactElement, ReactNode, useEffect, useRef, @@ -55,6 +56,7 @@ export type HiveNavigationProps = { logo?: ReactNode; navLinks?: { href: string; children: ReactNode }[]; developerMenu: DeveloperMenuProps['developerMenu']; + search?: ReactElement; searchProps?: ComponentProps; }; @@ -83,7 +85,7 @@ export function HiveNavigation({ }, ], developerMenu, - searchProps, + search = , }: HiveNavigationProps) { const containerRef = useRef(null!); @@ -152,10 +154,7 @@ export function HiveNavigation({ {children} - + {search} {/* eslint-disable-next-line tailwindcss/no-custom-classname */} - {commands[index]} + {commands[index]} diff --git a/packages/components/src/server/theme-layout.tsx b/packages/components/src/server/theme-layout.tsx index d3fccb8ac..ebdb9ef07 100644 --- a/packages/components/src/server/theme-layout.tsx +++ b/packages/components/src/server/theme-layout.tsx @@ -1,4 +1,4 @@ -import { ComponentProps, FC, ReactNode } from 'react'; +import { ComponentProps, FC, ReactElement, ReactNode } from 'react'; import { Metadata } from 'next'; import { PageMapItem } from 'nextra'; import { Layout, Navbar } from 'nextra-theme-docs'; @@ -74,6 +74,7 @@ export const GuildLayout: FC<{ */ navbarProps: NavbarProps; pageMap?: PageMapItem[]; + search?: ReactElement; }> = async ({ children, websiteName, @@ -83,6 +84,7 @@ export const GuildLayout: FC<{ logo, layoutProps, navbarProps, + search, ...props }) => { const [meta, ...pageMap] = props.pageMap || (await getPageMap()); @@ -128,11 +130,13 @@ export const GuildLayout: FC<{ description={description} /> } + search={search} navbar={ =16.13.1' react-dom: '>=16.13.1' - nextra-theme-docs@4.0.0-app-router.41: - resolution: {integrity: sha512-GG1zdPCuV6/fM5pHTq0DeUny0C2cmgNZwSqSg3PsILNXefcxyoEzCq4HAcLUcmq/r0oJ3oF5kUAkfbXViq2qcA==} + nextra-theme-docs@4.0.0-app-router.42: + resolution: {integrity: sha512-ebpBxpNF40FuKvVwu9fuZgOv3MAqHxkWrHAAhTI+s6jebsigE37Von+H3yPJqVM5mmmco2Ob/FfKJcMqr7k4Og==} peerDependencies: next: '>=14' - nextra: 4.0.0-app-router.41 + nextra: 4.0.0-app-router.42 react: '>=18' react-dom: '>=18' @@ -6161,8 +6161,8 @@ packages: react: '>=16.13.1' react-dom: '>=16.13.1' - nextra@4.0.0-app-router.41: - resolution: {integrity: sha512-1joHzlwcTsV2hH1EJ2HlBGYdTSZ5Zd0ACtgC4ooQ4PFXrKJY+SUqau31DXvjDJUJ8njB3W2qJrZE5Hh173a8XA==} + nextra@4.0.0-app-router.42: + resolution: {integrity: sha512-sJm4NRR+uNErCTf0ruZ1+XlhdF3zNQrRwOgo8zGXiYKTb9ek1XbYoOI70qLDvTfV+7k7C75nbLOHqKsqNKljaA==} engines: {node: '>=18'} peerDependencies: next: '>=14' @@ -6861,8 +6861,8 @@ packages: resolution: {integrity: sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==} engines: {node: '>= 0.6'} - react-compiler-runtime@19.0.0-beta-df7b47d-20241124: - resolution: {integrity: sha512-HLFbEf5rEhynZNxI/f1y26Hw0SCvFWh9aS0gCaDndak202oOAvRhy0qsUhmVyaeuRYqIxvPeltMvqDfvO+9/Fw==} + react-compiler-runtime@0.0.0-experimental-22c6e49-20241219: + resolution: {integrity: sha512-bOAGaRL1ldfIIpbDsl+uV025Ta6RS6/cOjvvh8r2Vo7KtqB+RSvihVYRsWQz7ECKNPWdq5MClS845acwAwieDw==} peerDependencies: react: ^17.0.0 || ^18.0.0 || ^19.0.0 @@ -11073,8 +11073,8 @@ snapshots: '@typescript-eslint/parser': 8.17.0(eslint@9.17.0(jiti@1.21.6))(typescript@5.7.2) eslint: 9.17.0(jiti@1.21.6) eslint-config-prettier: 9.1.0(eslint@9.17.0(jiti@1.21.6)) - eslint-import-resolver-typescript: 3.7.0(eslint-plugin-import@2.31.0)(eslint@9.17.0(jiti@1.21.6)) - eslint-plugin-import: 2.31.0(@typescript-eslint/parser@8.17.0(eslint@9.17.0(jiti@1.21.6))(typescript@5.7.2))(eslint-import-resolver-typescript@3.7.0)(eslint@9.17.0(jiti@1.21.6)) + eslint-import-resolver-typescript: 3.7.0(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.17.0(eslint@9.17.0(jiti@1.21.6))(typescript@5.7.2))(eslint@9.17.0(jiti@1.21.6)))(eslint@9.17.0(jiti@1.21.6)) + eslint-plugin-import: 2.31.0(@typescript-eslint/parser@8.17.0(eslint@9.17.0(jiti@1.21.6))(typescript@5.7.2))(eslint-import-resolver-typescript@3.7.0(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.17.0(eslint@9.17.0(jiti@1.21.6))(typescript@5.7.2))(eslint@9.17.0(jiti@1.21.6)))(eslint@9.17.0(jiti@1.21.6)))(eslint@9.17.0(jiti@1.21.6)) eslint-plugin-jsonc: 2.18.2(eslint@9.17.0(jiti@1.21.6)) eslint-plugin-jsx-a11y: 6.10.2(eslint@9.17.0(jiti@1.21.6)) eslint-plugin-mdx: 3.1.5(eslint@9.17.0(jiti@1.21.6)) @@ -13089,7 +13089,7 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-import-resolver-typescript@3.7.0(eslint-plugin-import@2.31.0)(eslint@9.17.0(jiti@1.21.6)): + eslint-import-resolver-typescript@3.7.0(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.17.0(eslint@9.17.0(jiti@1.21.6))(typescript@5.7.2))(eslint@9.17.0(jiti@1.21.6)))(eslint@9.17.0(jiti@1.21.6)): dependencies: '@nolyfill/is-core-module': 1.0.39 debug: 4.4.0 @@ -13101,7 +13101,7 @@ snapshots: is-glob: 4.0.3 stable-hash: 0.0.4 optionalDependencies: - eslint-plugin-import: 2.31.0(@typescript-eslint/parser@8.17.0(eslint@9.17.0(jiti@1.21.6))(typescript@5.7.2))(eslint-import-resolver-typescript@3.7.0)(eslint@9.17.0(jiti@1.21.6)) + eslint-plugin-import: 2.31.0(@typescript-eslint/parser@8.17.0(eslint@9.17.0(jiti@1.21.6))(typescript@5.7.2))(eslint-import-resolver-typescript@3.7.0(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.17.0(eslint@9.17.0(jiti@1.21.6))(typescript@5.7.2))(eslint@9.17.0(jiti@1.21.6)))(eslint@9.17.0(jiti@1.21.6)))(eslint@9.17.0(jiti@1.21.6)) transitivePeerDependencies: - supports-color @@ -13132,14 +13132,14 @@ snapshots: - bluebird - supports-color - eslint-module-utils@2.12.0(@typescript-eslint/parser@8.17.0(eslint@9.17.0(jiti@1.21.6))(typescript@5.7.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.7.0)(eslint@9.17.0(jiti@1.21.6)): + eslint-module-utils@2.12.0(@typescript-eslint/parser@8.17.0(eslint@9.17.0(jiti@1.21.6))(typescript@5.7.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.7.0(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.17.0(eslint@9.17.0(jiti@1.21.6))(typescript@5.7.2))(eslint@9.17.0(jiti@1.21.6)))(eslint@9.17.0(jiti@1.21.6)))(eslint@9.17.0(jiti@1.21.6)): dependencies: debug: 3.2.7 optionalDependencies: '@typescript-eslint/parser': 8.17.0(eslint@9.17.0(jiti@1.21.6))(typescript@5.7.2) eslint: 9.17.0(jiti@1.21.6) eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 3.7.0(eslint-plugin-import@2.31.0)(eslint@9.17.0(jiti@1.21.6)) + eslint-import-resolver-typescript: 3.7.0(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.17.0(eslint@9.17.0(jiti@1.21.6))(typescript@5.7.2))(eslint@9.17.0(jiti@1.21.6)))(eslint@9.17.0(jiti@1.21.6)) transitivePeerDependencies: - supports-color @@ -13150,7 +13150,7 @@ snapshots: eslint: 9.17.0(jiti@1.21.6) eslint-compat-utils: 0.5.1(eslint@9.17.0(jiti@1.21.6)) - eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.17.0(eslint@9.17.0(jiti@1.21.6))(typescript@5.7.2))(eslint-import-resolver-typescript@3.7.0)(eslint@9.17.0(jiti@1.21.6)): + eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.17.0(eslint@9.17.0(jiti@1.21.6))(typescript@5.7.2))(eslint-import-resolver-typescript@3.7.0(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.17.0(eslint@9.17.0(jiti@1.21.6))(typescript@5.7.2))(eslint@9.17.0(jiti@1.21.6)))(eslint@9.17.0(jiti@1.21.6)))(eslint@9.17.0(jiti@1.21.6)): dependencies: '@rtsao/scc': 1.1.0 array-includes: 3.1.8 @@ -13161,7 +13161,7 @@ snapshots: doctrine: 2.1.0 eslint: 9.17.0(jiti@1.21.6) eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.12.0(@typescript-eslint/parser@8.17.0(eslint@9.17.0(jiti@1.21.6))(typescript@5.7.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.7.0)(eslint@9.17.0(jiti@1.21.6)) + eslint-module-utils: 2.12.0(@typescript-eslint/parser@8.17.0(eslint@9.17.0(jiti@1.21.6))(typescript@5.7.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.7.0(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.17.0(eslint@9.17.0(jiti@1.21.6))(typescript@5.7.2))(eslint@9.17.0(jiti@1.21.6)))(eslint@9.17.0(jiti@1.21.6)))(eslint@9.17.0(jiti@1.21.6)) hasown: 2.0.2 is-core-module: 2.16.0 is-glob: 4.0.3 @@ -15531,15 +15531,15 @@ snapshots: scroll-into-view-if-needed: 3.1.0 zod: 3.24.1 - nextra-theme-docs@4.0.0-app-router.41(@types/react@18.3.18)(next@15.1.1(@babel/core@7.26.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(nextra@4.0.0-app-router.41(acorn@8.14.0)(next@15.1.1(@babel/core@7.26.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.7.2))(react-dom@18.3.1(react@18.3.1))(react@18.3.1): + nextra-theme-docs@4.0.0-app-router.42(@types/react@18.3.18)(next@15.1.1(@babel/core@7.26.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(nextra@4.0.0-app-router.42(acorn@8.14.0)(next@15.1.1(@babel/core@7.26.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.7.2))(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: '@headlessui/react': 2.2.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) clsx: 2.1.1 next: 15.1.1(@babel/core@7.26.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) next-themes: 0.4.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - nextra: 4.0.0-app-router.41(acorn@8.14.0)(next@15.1.1(@babel/core@7.26.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.7.2) + nextra: 4.0.0-app-router.42(acorn@8.14.0)(next@15.1.1(@babel/core@7.26.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.7.2) react: 18.3.1 - react-compiler-runtime: 19.0.0-beta-df7b47d-20241124(react@18.3.1) + react-compiler-runtime: 0.0.0-experimental-22c6e49-20241219(react@18.3.1) react-dom: 18.3.1(react@18.3.1) scroll-into-view-if-needed: 3.1.0 zod: 3.24.1 @@ -15594,7 +15594,7 @@ snapshots: - supports-color - typescript - nextra@4.0.0-app-router.41(acorn@8.14.0)(next@15.1.1(@babel/core@7.26.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.7.2): + nextra@4.0.0-app-router.42(acorn@8.14.0)(next@15.1.1(@babel/core@7.26.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.7.2): dependencies: '@formatjs/intl-localematcher': 0.5.9 '@headlessui/react': 2.2.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -15617,7 +15617,7 @@ snapshots: negotiator: 1.0.0 next: 15.1.1(@babel/core@7.26.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 - react-compiler-runtime: 19.0.0-beta-df7b47d-20241124(react@18.3.1) + react-compiler-runtime: 0.0.0-experimental-22c6e49-20241219(react@18.3.1) react-dom: 18.3.1(react@18.3.1) react-medium-image-zoom: 5.2.12(react-dom@18.3.1(react@18.3.1))(react@18.3.1) rehype-katex: 7.0.1 @@ -16287,7 +16287,7 @@ snapshots: range-parser@1.2.1: {} - react-compiler-runtime@19.0.0-beta-df7b47d-20241124(react@18.3.1): + react-compiler-runtime@0.0.0-experimental-22c6e49-20241219(react@18.3.1): dependencies: react: 18.3.1