sls/resources/views/components/input.blade.php
kushal.saha 9f25fdd648 refactor: UI Layouts and components
Interview module is refactored to use layouts and re-usable components
along with domain components. Style remains identitical to previous
design.
2026-08-17 07:03:55 +00:00

30 lines
955 B
PHP

@props([
'type' => 'text',
'name' => null,
'value' => null,
'placeholder' => null,
'required' => false,
'disabled' => false,
'size' => 'md', // sm, md, lg
])
@php
$sizeClasses = [
'sm' => 'px-2.5 py-1.5 text-xs',
'md' => 'px-3 py-2 text-xs',
'lg' => 'px-3.5 py-2.5 text-sm',
];
$classes = 'w-full bg-white/5 border border-slate-700/60 rounded-lg text-white outline-none focus:border-indigo-500 focus:ring-1 focus:ring-indigo-500/40 placeholder-slate-500 transition-colors disabled:opacity-50 disabled:cursor-not-allowed ' . ($sizeClasses[$size] ?? $sizeClasses['md']);
@endphp
<input
type="{{ $type }}"
@if($name) name="{{ $name }}" @endif
@if($value !== null) value="{{ $value }}" @endif
@if($placeholder) placeholder="{{ $placeholder }}" @endif
@if($required) required @endif
@if($disabled) disabled @endif
{{ $attributes->merge(['class' => $classes]) }}
/>