From a714ddd5a2b57376293139d3ba64a7bfdfdc6b8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=A8=E9=9C=96=E9=93=83?= <2712495353@qq.com> Date: Thu, 9 Jul 2026 23:51:15 +0800 Subject: [PATCH] =?UTF-8?q?style:=20=E5=A2=9E=E5=BC=BA=20SwitchButtonGroup?= =?UTF-8?q?=20=E7=9A=84=E4=BA=A4=E4=BA=92=E6=A0=B7=E5=BC=8F=E5=B9=B6?= =?UTF-8?q?=E7=A7=BB=E9=99=A4=E5=86=97=E4=BD=99=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/SwitchButtonGroup.tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/components/SwitchButtonGroup.tsx b/src/components/SwitchButtonGroup.tsx index 5035b14..c46a6f1 100644 --- a/src/components/SwitchButtonGroup.tsx +++ b/src/components/SwitchButtonGroup.tsx @@ -15,7 +15,6 @@ export interface SwitchButtonGroupProps exte options: SwitchOption[]; onChange: (value: T) => void; size?: 'small' | 'medium' | 'large'; - buttonClassName?: string; } const SIZE_CLASSES = { @@ -24,8 +23,10 @@ const SIZE_CLASSES = { large: 'text-base h-11 px-4 py-2 rounded-lg', } as const; -const SELECTED_CLASSES = 'bg-background text-foreground shadow-sm font-semibold fade-in-zoom-95'; -const UNSELECTED_CLASSES = 'hover:bg-background/50 hover:text-foreground/80'; +const SELECTED_CLASSES = + 'bg-background text-foreground shadow-sm font-semibold fade-in-zoom-95 hover:shadow-md active:scale-[0.98] focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-muted'; +const UNSELECTED_CLASSES = + 'hover:bg-background/50 hover:text-foreground/80 active:scale-[0.98] focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-muted'; export default function SwitchButtonGroup({ value, @@ -33,7 +34,6 @@ export default function SwitchButtonGroup({ onChange, size = 'medium', className, - buttonClassName, ...props }: SwitchButtonGroupProps) { return ( @@ -54,7 +54,6 @@ export default function SwitchButtonGroup({ 'flex-1 transition-all', SIZE_CLASSES[size], value === option.value ? SELECTED_CLASSES : UNSELECTED_CLASSES, - buttonClassName, )} > {option.label}