chore: Add aria attributes to CheckInput component

This commit is contained in:
kwaroran
2024-06-30 05:26:33 +09:00
parent bdd25aed5c
commit 4a9f054f4f

View File

@@ -14,6 +14,7 @@
class={"flex items-center space-x-2 cursor-pointer" + (className ? " " + className : "") + (grayText ? " text-textcolor2" : " text-textcolor")}
class:mr-2={margin}
aria-describedby="{name} {check ? 'abled' : 'disabled'}"
aria-labelledby="{name} {check ? 'abled' : 'disabled'}"
>
<input
class="hidden"
@@ -23,10 +24,14 @@
on:change={() => {
onChange(check)
}}
aria-describedby="{name} {check ? 'abled' : 'disabled'}"
aria-labelledby="{name} {check ? 'abled' : 'disabled'}"
/>
<span
class="w-5 h-5 min-w-5 min-h-5 rounded-md border-2 border-darkborderc flex justify-center items-center {check ? 'bg-borderc' : 'bg-darkbutton'} transition-colors duration-200"
aria-hidden="true"
aria-describedby="{name} {check ? 'abled' : 'disabled'}"
aria-labelledby="{name} {check ? 'abled' : 'disabled'}"
>
{#if check}
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="white" class="w-3 h-3" aria-hidden="true">