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 @@
{{--
Input Component - TailServer Theme
Input Component - shadcn-style
Usage:
<x-proxmox::ui.input name="email" label="Email" />
@@ -24,36 +24,32 @@
@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'];
$inputClasses = 'block w-full rounded-xl border bg-background leading-6 placeholder-base/40 shadow-sm transition-all duration-200 focus:ring-2 focus:ring-offset-0 focus:shadow-md hover:border-neutral/50 hover:shadow';
$inputClasses = 'flex w-full rounded-md border bg-transparent px-3 py-1 text-sm transition-colors duration-150 file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50';
if ($error) {
$inputClasses .= ' border-danger/50 focus:border-danger focus:ring-danger/25 focus:shadow-danger/10';
$inputClasses .= ' border-danger focus-visible:ring-danger';
} else {
$inputClasses .= ' border-neutral/30 focus:border-primary focus:ring-primary/25 focus:shadow-primary/10';
$inputClasses .= ' border-input';
}
if ($icon) {
$inputClasses .= ' ps-10';
} else {
$inputClasses .= ' ps-3';
$inputClasses .= ' ps-9';
}
if ($iconRight) {
$inputClasses .= ' pe-10';
} else {
$inputClasses .= ' pe-3';
$inputClasses .= ' pe-9';
}
@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>
@@ -61,10 +57,10 @@
</label>
@endif
<div class="relative group/input">
<div class="relative">
@if($icon)
<div class="pointer-events-none absolute inset-y-0 start-0 flex items-center ps-3 text-base/40 transition-colors duration-200 group-focus-within/input:text-primary">
<x-dynamic-component :component="$icon" class="size-5" />
<div class="pointer-events-none absolute inset-y-0 start-0 flex items-center ps-3 text-muted-foreground">
<x-dynamic-component :component="$icon" class="size-4" />
</div>
@endif
@@ -79,15 +75,15 @@
/>
@if($iconRight)
<div class="pointer-events-none absolute inset-y-0 end-0 flex items-center pe-3 text-base/40 transition-colors duration-200 group-focus-within/input:text-primary">
<x-dynamic-component :component="$iconRight" class="size-5" />
<div class="pointer-events-none absolute inset-y-0 end-0 flex items-center pe-3 text-muted-foreground">
<x-dynamic-component :component="$iconRight" class="size-4" />
</div>
@endif
</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>