diff --git a/components/SwitchButtonGroup.tsx b/components/SwitchButtonGroup.tsx index 1fe47d0..016c93c 100644 --- a/components/SwitchButtonGroup.tsx +++ b/components/SwitchButtonGroup.tsx @@ -40,8 +40,8 @@ export default function SwitchButtonGroup({ sizeClasses[size] } ${ value === option.value - ? 'bg-background text-primary shadow-sm' - : 'text-muted-foreground hover:text-foreground hover:bg-background/50' + ? 'bg-primary text-primary-foreground shadow-md' + : 'text-muted-foreground hover:text-foreground hover:bg-muted' }`} style={buttonSx} > diff --git a/components/__tests__/SwitchButtonGroup.test.tsx b/components/__tests__/SwitchButtonGroup.test.tsx index 0fde098..0bd9737 100644 --- a/components/__tests__/SwitchButtonGroup.test.tsx +++ b/components/__tests__/SwitchButtonGroup.test.tsx @@ -22,7 +22,7 @@ describe('SwitchButtonGroup 组件', () => { const buttonB = screen.getByRole('button', { name: /选项B/i }); // 选中的按钮有 bg-background text-primary shadow-sm 类 - expect(buttonA).toHaveClass('bg-background', 'text-primary', 'shadow-sm'); + expect(buttonA).toHaveClass('bg-primary', 'text-primary-foreground', 'shadow-md'); // 未选中的按钮有 text-muted-foreground 类 expect(buttonB).toHaveClass('text-muted-foreground'); }); @@ -123,7 +123,7 @@ describe('SwitchButtonGroup 组件', () => { const button4 = screen.getByRole('button', { name: /^4$/i }); expect(button2).toHaveClass('text-muted-foreground'); - expect(button4).toHaveClass('bg-background', 'text-primary', 'shadow-sm'); + expect(button4).toHaveClass('bg-primary', 'text-primary-foreground', 'shadow-md'); }); it('点击 number 选项时应传回 number 值', () => { diff --git a/pages/Timestamp/index.tsx b/pages/Timestamp/index.tsx index 469002b..b465625 100644 --- a/pages/Timestamp/index.tsx +++ b/pages/Timestamp/index.tsx @@ -98,7 +98,7 @@ export default function Index() { {/* 立即转换 */}