- Refactored select component to align with shadcn design principles. - Updated server status indicator component for consistency with shadcn style. - Modified spinner component to follow shadcn design guidelines. - Enhanced stat card component with shadcn-inspired styles. - Adjusted tab panel component to reflect shadcn design updates. - Revamped table row and table data cell components to match shadcn aesthetics. - Updated table header cell component for improved styling consistency. - Refined table component to align with shadcn design principles. - Enhanced tabs component with shadcn-inspired styles. - Updated toggle component to follow shadcn design guidelines. - Refactored tooltip component to align with shadcn design principles. - Updated server card component to reflect shadcn-inspired design.
68 lines
2.2 KiB
PHP
68 lines
2.2 KiB
PHP
{{--
|
|
Select Component - shadcn-style
|
|
|
|
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-8 text-sm',
|
|
'md' => 'h-9 text-sm',
|
|
'lg' => 'h-10 text-base',
|
|
];
|
|
$sizeClass = $sizeClasses[$size] ?? $sizeClasses['md'];
|
|
|
|
$selectClasses = 'flex w-full items-center justify-between whitespace-nowrap rounded-md border bg-transparent px-3 py-2 text-sm ring-offset-background transition-colors duration-150 placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 appearance-none cursor-pointer';
|
|
|
|
if ($error) {
|
|
$selectClasses .= ' border-danger focus:ring-danger';
|
|
} else {
|
|
$selectClasses .= ' border-input';
|
|
}
|
|
@endphp
|
|
|
|
<div {{ $attributes->only('class')->class(['space-y-2']) }}>
|
|
@if($label)
|
|
<label @if($name) for="{{ $name }}" @endif class="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70">
|
|
{{ $label }}
|
|
@if($required)
|
|
<span class="text-danger">*</span>
|
|
@endif
|
|
</label>
|
|
@endif
|
|
|
|
<div class="relative">
|
|
<select
|
|
@if($name) name="{{ $name }}" id="{{ $name }}" @endif
|
|
@if($disabled) disabled @endif
|
|
@if($required) required @endif
|
|
{{ $attributes->except('class')->class([$selectClasses, $sizeClass]) }}
|
|
>
|
|
{{ $slot }}
|
|
</select>
|
|
<div class="pointer-events-none absolute inset-y-0 end-0 flex items-center pe-3 text-muted-foreground">
|
|
<x-ri-arrow-down-s-line class="size-4 opacity-50" />
|
|
</div>
|
|
</div>
|
|
|
|
@if($error)
|
|
<p class="text-[0.8rem] font-medium text-danger">{{ $error }}</p>
|
|
@elseif($hint)
|
|
<p class="text-[0.8rem] text-muted-foreground">{{ $hint }}</p>
|
|
@endif
|
|
</div>
|