From 47d5558e4a01e0f97dd018956ea6415091346bc5 Mon Sep 17 00:00:00 2001 From: Yaojia Wang Date: Wed, 8 Jul 2026 13:27:32 +0200 Subject: [PATCH] =?UTF-8?q?feat(web):=20NavDrawer=20=E8=A1=A5=20aria-contr?= =?UTF-8?q?ols=20+=20ForeshadowCard=20=E8=AF=AD=E4=B9=89=E5=8C=96=20dl/dt/?= =?UTF-8?q?dd=EF=BC=88a11y=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit NavDrawer 汉堡按钮补 aria-controls 指向抽屉面板(Drawer 新增可选 id prop,默认 nav-drawer);ForeshadowCard 的
行改真
/
结构,可视文案不变,importance 用 sr-only 标签。行为不变。 --- apps/web/components/Drawer.tsx | 4 ++++ apps/web/components/NavDrawer.tsx | 5 +++++ .../components/foreshadow/ForeshadowCard.tsx | 19 ++++++++++++++++--- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/apps/web/components/Drawer.tsx b/apps/web/components/Drawer.tsx index 71d9473..bccc439 100644 --- a/apps/web/components/Drawer.tsx +++ b/apps/web/components/Drawer.tsx @@ -16,6 +16,8 @@ interface DrawerProps { side?: "left" | "right"; // 无障碍标签(role=dialog)。 label: string; + // 抽屉面板 id:供触发按钮 aria-controls 指向(无障碍关联)。 + id?: string; triggerRef?: RefObject; children: ReactNode; } @@ -27,6 +29,7 @@ export function Drawer({ onClose, side = "left", label, + id, triggerRef, children, }: DrawerProps) { @@ -58,6 +61,7 @@ export function Drawer({