@props([ 'name', 'label' => null, 'type' => 'text', 'value' => null, 'placeholder' => null, 'required' => false, 'disabled' => false, 'hint' => null, 'id' => null, 'wrapClass' => '', ]) @php $value = $value ?? old($name); $id = $id ?? $name; $error = $errors->first($name); $inputClass = 'w-full rounded-xl border bg-white px-3 py-2.5 text-sm shadow-sm outline-none transition placeholder:text-slate-400 focus:ring-4'; $inputClass .= $error ? ' border-rose-300 focus:border-rose-400 focus:ring-rose-200' : ' border-slate-200 focus:border-brand-400 focus:ring-brand-200'; if ($disabled) { $inputClass .= ' cursor-not-allowed bg-slate-50 text-slate-500'; } @endphp
@if($label) @endif merge(['class' => $inputClass]) }} > @if($hint && !$error)
{{ $hint }}
@endif @if($error)
{{ $error }}
@endif