feat(web): 命令面板 combobox+可见入口 + sticky 导航壳 + 焦点环统一 + 抽屉锁滚动/关闭按钮 + 主题首帧修复 + 设置徽标/datalist
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
"use client";
|
||||
|
||||
import { useRef, useState } from "react";
|
||||
import { Menu } from "lucide-react";
|
||||
import { Menu, Search } from "lucide-react";
|
||||
|
||||
import { Button } from "@/components/ui/Button";
|
||||
import { openCommandPalette } from "@/components/command/CommandPalette";
|
||||
import type { ActiveNav } from "@/lib/nav/items";
|
||||
import { focusRing } from "@/lib/ui/variants";
|
||||
import { Drawer } from "./Drawer";
|
||||
import { NavItems } from "./NavItems";
|
||||
|
||||
@@ -18,6 +20,11 @@ export function NavDrawer({ projectId, activeNav }: NavDrawerProps) {
|
||||
const [open, setOpen] = useState(false);
|
||||
const triggerRef = useRef<HTMLButtonElement>(null);
|
||||
|
||||
const openSearch = (): void => {
|
||||
setOpen(false);
|
||||
openCommandPalette();
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<Button
|
||||
@@ -38,6 +45,19 @@ export function NavDrawer({ projectId, activeNav }: NavDrawerProps) {
|
||||
label="主导航"
|
||||
triggerRef={triggerRef}
|
||||
>
|
||||
<div className="px-2 pb-2">
|
||||
<button
|
||||
type="button"
|
||||
onClick={openSearch}
|
||||
className={`flex w-full items-center gap-2 rounded border border-line bg-bg px-3 py-2 text-sm text-ink-soft transition-colors hover:text-cinnabar ${focusRing}`}
|
||||
>
|
||||
<Search className="h-4 w-4 shrink-0" aria-hidden="true" />
|
||||
搜索命令或页面
|
||||
<kbd className="ml-auto rounded border border-line bg-panel px-1 font-mono text-2xs">
|
||||
⌘K
|
||||
</kbd>
|
||||
</button>
|
||||
</div>
|
||||
<NavItems
|
||||
projectId={projectId}
|
||||
activeNav={activeNav}
|
||||
|
||||
Reference in New Issue
Block a user