- Changed modal close event from `@click.away` to `@click.self` for better control over closing modals. - Updated various modal button styles for consistency and improved accessibility. - Adjusted transition durations for modal animations to enhance user experience. - Added aria-labels to close buttons for better screen reader support.
93 lines
3.5 KiB
PHP
93 lines
3.5 KiB
PHP
{{--
|
|
Input Component - LucentUI Theme
|
|
Migrated from AdminLTE to Tailwind
|
|
|
|
Usage:
|
|
<x-proxmox::ui.input name="email" label="Email" />
|
|
<x-proxmox::ui.input name="search" placeholder="Search..." icon="ri-search-line" />
|
|
<x-proxmox::ui.input name="password" type="password" label="Password" error="Password is required" />
|
|
--}}
|
|
|
|
@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-xs',
|
|
'md' => 'h-10',
|
|
'lg' => 'h-12 text-base',
|
|
];
|
|
$sizeClass = $sizeClasses[$size] ?? $sizeClasses['md'];
|
|
|
|
$inputClasses = 'w-full px-4 py-2 text-sm text-primary dark:text-base/90 bg-background dark:bg-background-secondary border border-neutral rounded-lg placeholder:text-secondary/50 dark:placeholder:text-base/30 focus:border-primary focus:outline-none focus:ring-2 focus:ring-primary/25 transition-all duration-150 disabled:opacity-50 disabled:cursor-not-allowed';
|
|
|
|
$errorClasses = $error ? 'border-error focus:border-error focus:ring-error/25' : '';
|
|
@endphp
|
|
|
|
<div {{ $attributes->only('class')->class(['mb-3']) }}>
|
|
@if($label)
|
|
<label @if($name) for="{{ $name }}" @endif class="block mb-2 font-medium text-sm text-secondary dark:text-base/60">
|
|
{{ $label }}
|
|
@if($required)
|
|
<span class="text-error">*</span>
|
|
@endif
|
|
</label>
|
|
@endif
|
|
|
|
@if($icon || $iconRight)
|
|
<div class="relative flex items-stretch">
|
|
@if($icon)
|
|
<span class="flex items-center px-3 bg-background-secondary border border-r-0 border-neutral rounded-l-lg text-secondary dark:text-base/50">
|
|
<x-dynamic-component :component="$icon" class="size-4" />
|
|
</span>
|
|
@endif
|
|
|
|
<input
|
|
type="{{ $type }}"
|
|
@if($name) name="{{ $name }}" id="{{ $name }}" @endif
|
|
@if($placeholder) placeholder="{{ $placeholder }}" @endif
|
|
@if($disabled) disabled @endif
|
|
@if($readonly) readonly @endif
|
|
@if($required) required @endif
|
|
class="{{ $inputClasses }} {{ $sizeClass }} {{ $errorClasses }} {{ $icon ? 'rounded-l-none' : '' }} {{ $iconRight ? 'rounded-r-none' : '' }}"
|
|
{{ $attributes->except('class') }}
|
|
/>
|
|
|
|
@if($iconRight)
|
|
<span class="flex items-center px-3 bg-background-secondary border border-l-0 border-neutral rounded-r-lg text-secondary dark:text-base/50">
|
|
<x-dynamic-component :component="$iconRight" class="size-4" />
|
|
</span>
|
|
@endif
|
|
</div>
|
|
@else
|
|
<input
|
|
type="{{ $type }}"
|
|
@if($name) name="{{ $name }}" id="{{ $name }}" @endif
|
|
@if($placeholder) placeholder="{{ $placeholder }}" @endif
|
|
@if($disabled) disabled @endif
|
|
@if($readonly) readonly @endif
|
|
@if($required) required @endif
|
|
class="{{ $inputClasses }} {{ $sizeClass }} {{ $errorClasses }}"
|
|
{{ $attributes->except('class') }}
|
|
/>
|
|
@endif
|
|
|
|
@if($error)
|
|
<div class="mt-1 text-sm text-error">{{ $error }}</div>
|
|
@elseif($hint)
|
|
<div class="mt-1 text-sm text-secondary dark:text-base/50">{{ $hint }}</div>
|
|
@endif
|
|
</div>
|