refactor: improve checkbox component accessibility and styling

This commit is contained in:
Andras Bacsai
2025-01-12 18:45:15 +01:00
parent 18f03dc173
commit 7eaf5d73f6

View File

@@ -11,20 +11,21 @@
]) ])
<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)
@else <span class="opacity-60">{!! $label !!}</span>
{{ $id }} @else
@endif {!! $label !!}
@if ($helper) @endif
<x-helper :helper="$helper" /> @if ($helper)
<x-helper :helper="$helper" />
@endif
@endif @endif
</span> </span>
@if ($instantSave) @if ($instantSave)