Files
Virtnet.bond/extensions/Servers/Proxmox/views/components/ui/select.blade.php
Joseph.Rawlings af62a16354 Refactor modal close behavior and improve styling
- 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.
2026-02-23 20:02:41 -05:00

66 lines
2.2 KiB
PHP

{{--
Select Component - LucentUI Theme
Migrated from AdminLTE to Tailwind
Usage:
<x-proxmox::ui.select name="country" label="Country">
<option value="us">United States</option>
<option value="uk">United Kingdom</option>
</x-proxmox::ui.select>
--}}
@props([
'name' => null,
'label' => null,
'error' => null,
'hint' => null,
'disabled' => false,
'required' => false,
'size' => 'md',
])
@php
$sizeClasses = [
'sm' => 'h-9 py-1.5 px-3 pr-9 text-xs',
'md' => 'h-10 py-2 px-4 pr-10 text-sm',
'lg' => 'h-12 py-2.5 px-4 pr-11 text-base',
];
$sizeClass = $sizeClasses[$size] ?? $sizeClasses['md'];
$baseClasses = 'block w-full appearance-none bg-background dark:bg-background-secondary border border-neutral rounded-lg shadow-sm text-primary dark:text-base/90 transition-all duration-150 focus:border-primary focus:outline-none focus:ring-2 focus:ring-primary/25 disabled:bg-background-secondary disabled:cursor-not-allowed disabled:opacity-65';
$errorClasses = $error ? 'border-error focus:border-error focus:ring-error/25' : '';
@endphp
<div {{ $attributes->only('class')->class(['flex flex-col gap-2']) }}>
@if($label)
<label @if($name) for="{{ $name }}" @endif class="text-sm font-medium text-secondary dark:text-base/60">
{{ $label }}
@if($required)
<span class="text-error">*</span>
@endif
</label>
@endif
<div class="relative">
<select
@if($name) name="{{ $name }}" id="{{ $name }}" @endif
@if($disabled) disabled @endif
@if($required) required @endif
class="{{ $baseClasses }} {{ $sizeClass }} {{ $errorClasses }}"
{{ $attributes->except('class') }}
>
{{ $slot }}
</select>
<div class="absolute top-1/2 right-4 -translate-y-1/2 pointer-events-none text-secondary dark:text-base/50">
<x-ri-arrow-down-s-line class="size-5" />
</div>
</div>
@if($error)
<p class="text-xs font-medium text-error">{{ $error }}</p>
@elseif($hint)
<p class="text-xs text-secondary dark:text-base/50">{{ $hint }}</p>
@endif
</div>