fix(checkbox): inherit stroke in CheckboxIcon (#4811)

This commit is contained in:
աӄա 2025-02-11 21:06:04 +08:00 committed by GitHub
parent b2e7e04e89
commit 8af2c5d8b1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 26 additions and 18 deletions

View File

@ -0,0 +1,5 @@
---
"@heroui/checkbox": patch
---
inherit stroke in CheckboxIcon (#4802)

View File

@ -6,24 +6,27 @@ function CheckIcon(props: CheckboxIconProps) {
const {isSelected, disableAnimation, ...otherProps} = props;
return (
<svg aria-hidden="true" role="presentation" viewBox="0 0 17 18" {...otherProps}>
<polyline
fill="none"
points="1 9 7 14 15 4"
stroke="currentColor"
strokeDasharray={22}
strokeDashoffset={isSelected ? 44 : 66}
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={2}
style={
!disableAnimation && isSelected
? {
transition: "stroke-dashoffset 250ms linear 0.2s",
}
: {}
}
/>
<svg
aria-hidden="true"
fill="none"
role="presentation"
stroke="currentColor"
strokeDasharray={22}
strokeDashoffset={isSelected ? 44 : 66}
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={2}
style={
!disableAnimation && isSelected
? {
transition: "stroke-dashoffset 250ms linear 0.2s",
}
: {}
}
viewBox="0 0 17 18"
{...otherProps}
>
<polyline points="1 9 7 14 15 4" />
</svg>
);
}