{{-- Input Component - shadcn-style Usage: --}} @props([ 'type' => 'text', 'name' => null, 'label' => null, 'placeholder' => null, 'icon' => null, 'iconRight' => null, 'error' => null, 'hint' => null, 'disabled' => false, 'readonly' => false, 'required' => false, 'size' => 'md', ]) @php $sizeClasses = [ 'sm' => 'h-8 text-sm', 'md' => 'h-9 text-sm', 'lg' => 'h-10 text-base', ]; $sizeClass = $sizeClasses[$size] ?? $sizeClasses['md']; $inputClasses = 'flex w-full rounded-md border bg-transparent px-3 py-1 text-sm transition-colors duration-150 file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50'; if ($error) { $inputClasses .= ' border-danger focus-visible:ring-danger'; } else { $inputClasses .= ' border-input'; } if ($icon) { $inputClasses .= ' ps-9'; } if ($iconRight) { $inputClasses .= ' pe-9'; } @endphp
only('class')->class(['space-y-2']) }}> @if($label) @endif
@if($icon)
@endif except('class')->class([$inputClasses, $sizeClass]) }} /> @if($iconRight)
@endif
@if($error)

{{ $error }}

@elseif($hint)

{{ $hint }}

@endif