@props([ 'type' => 'text', 'name', 'id' => null, 'label' => null, 'placeholder' => null, 'value' => null, 'disabled' => false, 'required' => false, 'autofocus' => false, 'helper' => null, 'error' => null, 'leadingIcon' => null, 'trailingIcon' => null, ]) @php $id = $id ?? $name; $hasError = $error || $errors->has($name); $inputClasses = 'w-full rounded-lg shadow-sm focus:ring focus:ring-opacity-50 ' . ($leadingIcon ? 'pl-10 ' : '') . ($trailingIcon ? 'pr-10 ' : '') . ($hasError ? 'border-red-300 text-red-900 placeholder-red-300 focus:border-red-500 focus:ring-red-200' : 'border-gray-300 focus:border-primary-500 focus:ring-primary-200'); @endphp
@if ($label) @endif
@if ($leadingIcon)
@endif merge(['class' => $inputClasses]) }} /> @if ($trailingIcon)
@endif
@if ($helper && !$hasError)

{{ $helper }}

@endif @if ($error)

{{ $error }}

@elseif ($errors->has($name))

{{ $errors->first($name) }}

@endif