fix(CopyButton): 修复 review 反馈并补充测试 (#66)

* fix: remove non-functional animation classes from CopyButton
* test(CopyButton): 补充单元测试覆盖边界场景
* fix: unify CopyButton imports to named export across all consumers
* fix(CopyButton): add aria-label for screen reader accessibility
This commit is contained in:
LingandRX
2026-06-05 21:15:48 +08:00
committed by 雨霖铃
parent 2c45ddada9
commit 4d038203a7
10 changed files with 204 additions and 9 deletions
+2 -1
View File
@@ -53,6 +53,7 @@ export const CopyButton: React.FC<CopyButtonProps> = ({
type="button"
onClick={handleCopy}
title={tooltip ?? t('buttons.copy')}
aria-label={tooltip ?? t('buttons.copy')}
className={cn(
buttonVariants({ variant, size }),
copied &&
@@ -62,7 +63,7 @@ export const CopyButton: React.FC<CopyButtonProps> = ({
{...props}
>
{copied ? (
<Check className="h-[1.2em] w-[1.2em] animate-in fade-in zoom-in-75 duration-200" />
<Check className="h-[1.2em] w-[1.2em]" />
) : (
<Copy className="h-[1.2em] w-[1.2em]" />
)}