{{-- Input Component A text input with authorization support, labels, helper text, and error display. Props: - id: string (required) - Input element ID - label: string|null - Label text - helper: string|null - Helper text below input - error: string|null - Error message (auto-resolved from validation bag if not provided) - type: string - Input type (text, email, password, etc.) - placeholder: string|null - Placeholder text - disabled: bool - Whether input is disabled - required: bool - Whether input is required - canGate: string|null - Gate/ability to check - canResource: mixed|null - Resource to check against - canHide: bool - Hide instead of disable when unauthorized Usage: --}} @if(!$hidden)
only(['class', 'x-show', 'x-if', 'x-cloak'])->merge(['class' => 'space-y-1']) }}> {{-- Label --}} @if($label) @endif {{-- Input --}} except(['class', 'x-show', 'x-if', 'x-cloak'])->class([ 'block w-full rounded-lg border px-3 py-2 text-sm transition-colors duration-200', 'bg-white dark:bg-gray-800', 'text-gray-900 dark:text-gray-100', 'placeholder-gray-400 dark:placeholder-gray-500', 'focus:outline-none focus:ring-2 focus:ring-offset-0', // Normal state 'border-gray-300 dark:border-gray-600 focus:border-violet-500 focus:ring-violet-500/20' => !$error, // Error state 'border-red-500 dark:border-red-500 focus:border-red-500 focus:ring-red-500/20' => $error, // Disabled state 'bg-gray-50 dark:bg-gray-900 text-gray-500 dark:text-gray-400 cursor-not-allowed' => $disabled, ]) }} /> {{-- Helper text --}} @if($helper && !$error)

{{ $helper }}

@endif {{-- Error message --}} @if($error)

{{ $error }}

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

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

@endif
@endif