refactor: improve checkbox component accessibility and styling
This commit is contained in:
@@ -11,21 +11,22 @@
|
|||||||
])
|
])
|
||||||
|
|
||||||
<div @class([
|
<div @class([
|
||||||
'flex flex-row items-center gap-4 pr-2 py-1 form-control min-w-fit dark:hover:bg-coolgray-100',
|
'flex flex-row items-center gap-4 pr-2 py-1 form-control min-w-fit',
|
||||||
'w-full' => $fullWidth,
|
'w-full' => $fullWidth,
|
||||||
|
'dark:hover:bg-coolgray-100 cursor-pointer' => !$disabled,
|
||||||
])>
|
])>
|
||||||
<label @class([
|
<label @class(['flex gap-4 items-center px-0 min-w-fit label w-full'])>
|
||||||
'flex gap-4 items-center px-0 min-w-fit label w-full cursor-pointer',
|
|
||||||
])>
|
|
||||||
<span class="flex flex-grow gap-2">
|
<span class="flex flex-grow gap-2">
|
||||||
@if ($label)
|
@if ($label)
|
||||||
{!! $label !!}
|
@if ($disabled)
|
||||||
|
<span class="opacity-60">{!! $label !!}</span>
|
||||||
@else
|
@else
|
||||||
{{ $id }}
|
{!! $label !!}
|
||||||
@endif
|
@endif
|
||||||
@if ($helper)
|
@if ($helper)
|
||||||
<x-helper :helper="$helper" />
|
<x-helper :helper="$helper" />
|
||||||
@endif
|
@endif
|
||||||
|
@endif
|
||||||
</span>
|
</span>
|
||||||
@if ($instantSave)
|
@if ($instantSave)
|
||||||
<input type="checkbox" @disabled($disabled) {{ $attributes->merge(['class' => $defaultClass]) }}
|
<input type="checkbox" @disabled($disabled) {{ $attributes->merge(['class' => $defaultClass]) }}
|
||||||
|
Reference in New Issue
Block a user