diff --git a/packages/gitbook/src/components/Header/Header.tsx b/packages/gitbook/src/components/Header/Header.tsx index 5a092ff5e..23ac0592c 100644 --- a/packages/gitbook/src/components/Header/Header.tsx +++ b/packages/gitbook/src/components/Header/Header.tsx @@ -45,27 +45,27 @@ export function Header(props: { 'w-full', 'flex-none', 'shadow-thinbottom', + 'dark:shadow-light/2', withTopHeader ? null : 'lg:hidden', - 'lg:z-10', - 'dark:shadow-light/1', - `${isCustomizationDefault || !withTopHeader ? 'bg-light' : 'bg-header-background'}`, - `${ - isCustomizationDefault || !withTopHeader - ? 'dark:bg-dark' - : 'bg-header-background' - }`, + isCustomizationDefault || !withTopHeader + ? ['bg-light', 'dark:bg-dark'] + : ['bg-header-background', 'bg-header-background'], + 'text-sm', + 'bg-opacity-9', + 'dark:bg-opacity-9', + 'backdrop-blur-lg', + 'contrast-more:bg-opacity-11', + 'contrast-more:dark:bg-opacity-11', )} >
span]:!text-header-link/7', - '[&_svg]:text-header-link', - 'contrast-more:bg-transparent', - 'contrast-more:ring-header-link', - 'contrast-more:[&>span]:!text-header-link', - 'dark:bg-header-link/3', - 'dark:ring-header-link/3', - '[&>span]:!text-header-link/7', - 'dark:[&_svg]:text-header-link', - 'dark:contrast-more:bg-transparent', - 'dark:contrast-more:ring-header-link', - 'dark:contrast-more:[&>span]:!text-header-link', + // 'bg-header-link/3', + // 'shadow-sm', + // 'ring-header-link/3', + // '[&>span]:!text-header-link/7', + // '[&_svg]:text-header-link', + // 'contrast-more:bg-transparent', + // 'contrast-more:ring-header-link', + // 'contrast-more:[&>span]:!text-header-link', + // 'dark:bg-header-link/3', + // 'dark:ring-header-link/3', + // '[&>span]:!text-header-link/7', + // 'dark:[&_svg]:text-header-link', + // 'dark:contrast-more:bg-transparent', + // 'dark:contrast-more:ring-header-link', + // 'dark:contrast-more:[&>span]:!text-header-link', ] : null } @@ -142,7 +142,7 @@ export function Header(props: { {sections ? (
{link.title} diff --git a/packages/gitbook/src/components/Header/HeaderLinkMore.tsx b/packages/gitbook/src/components/Header/HeaderLinkMore.tsx index 9eb98a313..b682608f0 100644 --- a/packages/gitbook/src/components/Header/HeaderLinkMore.tsx +++ b/packages/gitbook/src/components/Header/HeaderLinkMore.tsx @@ -10,7 +10,7 @@ import React from 'react'; import { ContentRefContext, resolveContentRef } from '@/lib/references'; import { tcls } from '@/lib/tailwind'; -import { Dropdown, DropdownMenu, DropdownMenuItem } from './Dropdown'; +import { Dropdown, DropdownChevron, DropdownMenu, DropdownMenuItem } from './Dropdown'; import styles from './headerLinks.module.css'; /** @@ -30,15 +30,23 @@ export function HeaderLinkMore(props: { const renderButton = () => ( ); diff --git a/packages/gitbook/src/components/Header/HeaderLinks.tsx b/packages/gitbook/src/components/Header/HeaderLinks.tsx index 4522f0782..dba614a64 100644 --- a/packages/gitbook/src/components/Header/HeaderLinks.tsx +++ b/packages/gitbook/src/components/Header/HeaderLinks.tsx @@ -13,7 +13,7 @@ export async function HeaderLinks({ children }: HeaderLinksProps) {
{children} diff --git a/packages/gitbook/src/components/Search/SearchButton.tsx b/packages/gitbook/src/components/Search/SearchButton.tsx index 7a5ba598b..21a55985c 100644 --- a/packages/gitbook/src/components/Search/SearchButton.tsx +++ b/packages/gitbook/src/components/Search/SearchButton.tsx @@ -1,6 +1,7 @@ 'use client'; import { Icon } from '@gitbook/icons'; +import { motion } from 'framer-motion'; import { useEffect, useState } from 'react'; import { useLanguage, tString } from '@/intl/client'; @@ -26,7 +27,22 @@ export function SearchButton(props: { children?: React.ReactNode; style?: ClassV }; return ( - + ); } @@ -96,7 +122,7 @@ const Shortcut = () => { }, []); return ( - { 'text-dark/5', 'contrast-more:text-dark', 'dark:text-light/5', + 'whitespace-nowrap', 'contrast-more:dark:text-light', `[font-feature-settings:"calt",_"case"]`, )} > {operatingSystem === 'mac' ? '⌘' : 'Ctrl +'} K - +
); }; diff --git a/packages/gitbook/src/components/Search/SearchModal.tsx b/packages/gitbook/src/components/Search/SearchModal.tsx index 937485cf7..0480e2944 100644 --- a/packages/gitbook/src/components/Search/SearchModal.tsx +++ b/packages/gitbook/src/components/Search/SearchModal.tsx @@ -56,9 +56,9 @@ export function SearchModal(props: SearchModalProps) { }; }, [isSearchOpened]); - if (state === null) { - return null; - } + // if (state === null) { + // return null; + // } const onChangeQuery = (newQuery: SearchState) => { setSearchState(newQuery); @@ -72,62 +72,72 @@ export function SearchModal(props: SearchModalProps) { }; return ( - <> -
{ - onClose(); - }} - > - - {askState?.type === 'loading' ? ( - - - - ) : null} - - -
- + + {state !== null ? ( + { + onClose(); + }} + > + + {askState?.type === 'loading' ? ( + + + + ) : null} + + + + ) : null} + ); } @@ -183,6 +193,18 @@ function SearchModalBody( return ( { event.stopPropagation(); }} diff --git a/packages/gitbook/src/components/Search/SearchResults.tsx b/packages/gitbook/src/components/Search/SearchResults.tsx index 91d8c992a..7b2c295b6 100644 --- a/packages/gitbook/src/components/Search/SearchResults.tsx +++ b/packages/gitbook/src/components/Search/SearchResults.tsx @@ -174,7 +174,7 @@ export const SearchResults = React.forwardRef(function SearchResults( } return ( -
+
{children} {results.length === 0 ? (