M: Improve checkbox structure

This commit is contained in:
Ivan 2024-12-20 13:36:42 +03:00
parent d11ccb45c4
commit 2b73f5e6af
2 changed files with 6 additions and 16 deletions

View File

@ -65,6 +65,7 @@ function Checkbox({
<div
className={clsx(
'max-w-[1rem] min-w-[1rem] h-4', // prettier: split lines
'pt-[0.1rem] pl-[0.1rem]',
'border rounded-sm',
'cc-animate-color',
{
@ -73,11 +74,7 @@ function Checkbox({
}
)}
>
{value ? (
<div className='mt-[1px] ml-[1px]'>
<CheckboxChecked />
</div>
) : null}
{value ? <CheckboxChecked /> : null}
</div>
{label ? <span className={clsx('text-start text-sm whitespace-nowrap select-text', cursor)}>{label}</span> : null}
</button>

View File

@ -66,6 +66,7 @@ function CheckboxTristate({
<div
className={clsx(
'w-4 h-4', // prettier: split lines
'pt-[0.1rem] pl-[0.1rem]',
'border rounded-sm',
'cc-animate-color',
{
@ -74,16 +75,8 @@ function CheckboxTristate({
}
)}
>
{value ? (
<div className='mt-[1px] ml-[1px]'>
<CheckboxChecked />
</div>
) : null}
{value == null ? (
<div className='mt-[1px] ml-[1px]'>
<CheckboxNull />
</div>
) : null}
{value ? <CheckboxChecked /> : null}
{value == null ? <CheckboxNull /> : null}
</div>
{label ? <span className={clsx('text-start text-sm whitespace-nowrap select-text', cursor)}>{label}</span> : null}
</button>