{{-- Premium Form Input Component Modern input with elegant focus states, icons, and AI integration. --}}
{{-- Label Row --}} @if ($label || $rightText)
@if ($label) @if ($help) {!! $help !!} @endif @endif
@if ($rightText && $rightPosition == 'top') @endif @if($ai) @php $aiName = $name; $locale = null; if (preg_match('/^(.*)\[(.*)\]$/', $name, $matches)) { $aiName = $matches[1]; $locale = $matches[2]; } @endphp
@endif
@endif {{-- Input Row --}}
@if ($type == 'color') {{-- Color Picker with Swatch --}}
@elseif ($type == 'range') {{-- Range Slider --}}
@elseif ($type == 'number') {{-- Enlightened Numeric Input (Steve Jobs × Jony Ive Edition) - Uses text input with inputmode="numeric" for clean mobile keyboard without ugly spinners - Beautiful +/− stepper buttons for quick adjustments - Smooth transitions and proper touch targets - Input sanitization to only allow numbers --}} @php $minValue = $min; $maxValue = $max; $stepValue = $step ?? 1; $allowNegative = $minValue === null || $minValue < 0; @endphp
{{-- Decrement Button --}} {{-- Input Field --}}
@if ($prefix)
{{ $prefix }}
@endif @if ($suffix)
{{ $suffix }}
@endif
{{-- Increment Button --}}
@else {{-- Standard Input --}}
@if ($icon)
@endif @if ($prefix)
{{ $prefix }}
@endif @if ($suffix)
{{ $suffix }}
@endif {{-- Calendar icon for date and datetime-local inputs --}} @if (in_array($type, ['datetime-local', 'date']))
@endif
@if ($type == 'password') @if($generatePassword) @endif @endif @endif
{{-- Error / Help Text --}}
@error($nameToDotNotation)

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

@else @if ($text)

{!! $text !!}

@endif @enderror @if ($rightText && $rightPosition == 'bottom') @endif
@if($mailPassword) @endif