refactor: update UI components to shadcn-style

- 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.
This commit is contained in:
2025-12-17 11:47:42 -05:00
parent e7b33a2f6c
commit 7190d7a818
34 changed files with 522 additions and 565 deletions

View File

@@ -1,5 +1,5 @@
{{--
Select Component - TailServer Theme
Select Component - shadcn-style
Usage:
<x-proxmox::ui.select name="country" label="Country">
@@ -20,24 +20,24 @@
@php
$sizeClasses = [
'sm' => 'py-1.5 text-sm',
'md' => 'py-2 text-sm',
'lg' => 'py-2.5 text-base',
'sm' => 'h-8 text-sm',
'md' => 'h-9 text-sm',
'lg' => 'h-10 text-base',
];
$sizeClass = $sizeClasses[$size] ?? $sizeClasses['md'];
$selectClasses = 'block w-full rounded-xl border bg-background px-3 leading-6 shadow-sm transition-all duration-200 focus:ring-2 focus:ring-offset-0 focus:shadow-md hover:border-neutral/50 hover:shadow appearance-none cursor-pointer';
$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/50 focus:border-danger focus:ring-danger/25 focus:shadow-danger/10';
$selectClasses .= ' border-danger focus:ring-danger';
} else {
$selectClasses .= ' border-neutral/30 focus:border-primary focus:ring-primary/25 focus:shadow-primary/10';
$selectClasses .= ' border-input';
}
@endphp
<div {{ $attributes->only('class')->class(['']) }}>
<div {{ $attributes->only('class')->class(['space-y-2']) }}>
@if($label)
<label @if($name) for="{{ $name }}" @endif class="block text-sm font-medium text-base/80 mb-1.5">
<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>
@@ -45,7 +45,7 @@
</label>
@endif
<div class="relative group/select">
<div class="relative">
<select
@if($name) name="{{ $name }}" id="{{ $name }}" @endif
@if($disabled) disabled @endif
@@ -54,14 +54,14 @@
>
{{ $slot }}
</select>
<div class="pointer-events-none absolute inset-y-0 end-0 flex items-center pe-3 text-base/40 transition-all duration-200 group-focus-within/select:text-primary group-hover/select:text-base/60">
<x-ri-arrow-down-s-line class="size-5 transition-transform duration-200 group-focus-within/select:rotate-180" />
<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="mt-1.5 text-xs text-danger">{{ $error }}</p>
<p class="text-[0.8rem] font-medium text-danger">{{ $error }}</p>
@elseif($hint)
<p class="mt-1.5 text-xs text-base/50">{{ $hint }}</p>
<p class="text-[0.8rem] text-muted-foreground">{{ $hint }}</p>
@endif
</div>