M: Improve checkbox structure
This commit is contained in:
parent
0de6b17096
commit
32d12369c2
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue
Block a user