feat: 全站评论开关,并统一后台表单控件

关闭评论后前台隐藏评论能力;外观/设置/公告改用 AdminField 与 Stepper。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-17 01:22:00 +08:00
parent 442af625f6
commit d93635c961
27 changed files with 989 additions and 479 deletions

View File

@@ -3,7 +3,7 @@
import { Search, X } from "lucide-react";
import type { FormEvent } from "react";
/** 左图标、可清除、Enter 提交;不要再并排「搜索」按钮 */
/** 左图标、可清除、Enter 提交;壳层聚焦与聊天搜索一致 */
export default function AdminSearchField({
value,
onChange,
@@ -30,11 +30,11 @@ export default function AdminSearchField({
};
return (
<form onSubmit={handleSubmit} className="relative flex-1 min-w-0" role="search">
<form onSubmit={handleSubmit} className="admin-field-shell admin-search-shell relative flex-1 min-w-0" role="search">
<Search
size={15}
className="absolute left-3.5 top-1/2 -translate-y-1/2 pointer-events-none"
style={{ color: "var(--ink-3)" }}
className="shrink-0 pointer-events-none"
style={{ color: value ? "var(--accent)" : "var(--ink-3)" }}
aria-hidden
/>
<input
@@ -43,14 +43,14 @@ export default function AdminSearchField({
onChange={(e) => onChange(e.target.value)}
placeholder={placeholder}
aria-label={ariaLabel}
className="field pl-10 pr-9 py-2.5"
className="admin-field-input"
/>
{value ? (
<button
type="button"
onClick={clear}
aria-label="清除搜索"
className="absolute right-2.5 top-1/2 -translate-y-1/2 w-6 h-6 inline-flex items-center justify-center rounded-full transition-colors hover:bg-[var(--panel-2)]"
className="w-6 h-6 inline-flex items-center justify-center rounded-full shrink-0 transition-colors hover:bg-[var(--accent-soft)]"
style={{ color: "var(--ink-3)" }}
>
<X size={14} />