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:
@@ -1,5 +1,5 @@
|
||||
{{--
|
||||
Alert Component - TailServer Theme
|
||||
Alert Component - TailServer Theme (shadcn-inspired)
|
||||
|
||||
Usage:
|
||||
<x-proxmox::ui.alert>Default alert</x-proxmox::ui.alert>
|
||||
@@ -8,7 +8,7 @@
|
||||
--}}
|
||||
|
||||
@props([
|
||||
'variant' => 'info',
|
||||
'variant' => 'default',
|
||||
'title' => null,
|
||||
'icon' => null,
|
||||
'dismissible' => false,
|
||||
@@ -18,46 +18,36 @@
|
||||
|
||||
@php
|
||||
$variantConfig = [
|
||||
'default' => [
|
||||
'class' => 'bg-card text-card-foreground',
|
||||
'icon' => $icon ?? 'ri-information-line',
|
||||
],
|
||||
'info' => [
|
||||
'bg' => 'bg-gradient-to-r from-info/10 via-info/5 to-transparent',
|
||||
'border' => 'border-info/20',
|
||||
'text' => 'text-info',
|
||||
'class' => 'border-info/20 bg-info/5 text-info [&>svg]:text-info',
|
||||
'icon' => $icon ?? 'ri-information-line',
|
||||
],
|
||||
'success' => [
|
||||
'bg' => 'bg-gradient-to-r from-success/10 via-success/5 to-transparent',
|
||||
'border' => 'border-success/20',
|
||||
'text' => 'text-success',
|
||||
'class' => 'border-success/20 bg-success/5 text-success [&>svg]:text-success',
|
||||
'icon' => $icon ?? 'ri-checkbox-circle-line',
|
||||
],
|
||||
'warning' => [
|
||||
'bg' => 'bg-gradient-to-r from-warning/10 via-warning/5 to-transparent',
|
||||
'border' => 'border-warning/20',
|
||||
'text' => 'text-warning',
|
||||
'class' => 'border-warning/20 bg-warning/5 text-warning [&>svg]:text-warning',
|
||||
'icon' => $icon ?? 'ri-error-warning-line',
|
||||
],
|
||||
'danger' => [
|
||||
'bg' => 'bg-gradient-to-r from-danger/10 via-danger/5 to-transparent',
|
||||
'border' => 'border-danger/20',
|
||||
'text' => 'text-danger',
|
||||
'class' => 'border-danger/20 bg-danger/5 text-danger [&>svg]:text-danger',
|
||||
'icon' => $icon ?? 'ri-error-warning-fill',
|
||||
],
|
||||
'default' => [
|
||||
'bg' => 'bg-gradient-to-r from-neutral/10 via-neutral/5 to-transparent',
|
||||
'border' => 'border-neutral/20',
|
||||
'text' => 'text-base/70',
|
||||
'icon' => $icon ?? 'ri-information-line',
|
||||
],
|
||||
];
|
||||
|
||||
$config = $variantConfig[$variant] ?? $variantConfig['default'];
|
||||
@endphp
|
||||
|
||||
<div
|
||||
role="alert"
|
||||
{{ $attributes->class([
|
||||
'rounded-xl p-4 border',
|
||||
$config['bg'],
|
||||
$config['border'],
|
||||
'relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5',
|
||||
$config['class'],
|
||||
]) }}
|
||||
@if($dismissible || $collapsible)
|
||||
x-data="{
|
||||
@@ -65,56 +55,54 @@
|
||||
@if($collapsible) collapsed: {{ $collapsed ? 'true' : 'false' }} @endif
|
||||
}"
|
||||
x-show="show"
|
||||
x-transition:enter="transition ease-out duration-300"
|
||||
x-transition:enter-start="opacity-0 scale-95"
|
||||
x-transition:enter-end="opacity-100 scale-100"
|
||||
x-transition:leave="transition ease-in duration-200"
|
||||
x-transition:leave-start="opacity-100 scale-100"
|
||||
x-transition:leave-end="opacity-0 scale-95"
|
||||
x-transition:enter="transition ease-out duration-150"
|
||||
x-transition:enter-start="opacity-0"
|
||||
x-transition:enter-end="opacity-100"
|
||||
x-transition:leave="transition ease-in duration-100"
|
||||
x-transition:leave-start="opacity-100"
|
||||
x-transition:leave-end="opacity-0"
|
||||
@endif
|
||||
>
|
||||
<div class="flex items-start gap-3">
|
||||
<x-dynamic-component :component="$config['icon']" class="size-5 {{ $config['text'] }} flex-shrink-0 mt-0.5" />
|
||||
<div class="flex-1 min-w-0">
|
||||
<div class="flex items-center justify-between gap-2">
|
||||
@if($title)
|
||||
<h4 class="text-sm font-semibold text-base">{{ $title }}</h4>
|
||||
@endif
|
||||
<div class="flex items-center gap-1 ml-auto">
|
||||
@if($collapsible)
|
||||
<button
|
||||
type="button"
|
||||
@click="collapsed = !collapsed"
|
||||
class="p-1.5 rounded-lg hover:bg-black/10 transition-all duration-200 {{ $config['text'] }}"
|
||||
>
|
||||
<x-ri-arrow-down-s-line
|
||||
class="size-4 transition-transform duration-300 ease-out"
|
||||
x-bind:class="collapsed ? 'rotate-180' : ''"
|
||||
/>
|
||||
</button>
|
||||
@endif
|
||||
@if($dismissible)
|
||||
<button
|
||||
type="button"
|
||||
@click="show = false"
|
||||
class="p-1.5 rounded-lg hover:bg-black/10 hover:rotate-90 transition-all duration-200 {{ $config['text'] }}"
|
||||
>
|
||||
<x-ri-close-line class="size-4" />
|
||||
</button>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="text-sm text-base/70 leading-relaxed @if($title) mt-1 @endif"
|
||||
@if($collapsible)
|
||||
x-show="!collapsed"
|
||||
x-transition:enter="transition ease-out duration-200"
|
||||
x-transition:enter-start="opacity-0 -translate-y-2"
|
||||
x-transition:enter-end="opacity-100 translate-y-0"
|
||||
@endif
|
||||
>
|
||||
{{ $slot }}
|
||||
</div>
|
||||
<x-dynamic-component :component="$config['icon']" class="size-4" />
|
||||
<div class="flex-1 min-w-0">
|
||||
@if($title)
|
||||
<h5 class="mb-1 font-medium leading-none tracking-tight">{{ $title }}</h5>
|
||||
@endif
|
||||
<div
|
||||
class="text-sm [&_p]:leading-relaxed opacity-90"
|
||||
@if($collapsible)
|
||||
x-show="!collapsed"
|
||||
x-transition:enter="transition ease-out duration-150"
|
||||
x-transition:enter-start="opacity-0"
|
||||
x-transition:enter-end="opacity-100"
|
||||
@endif
|
||||
>
|
||||
{{ $slot }}
|
||||
</div>
|
||||
</div>
|
||||
@if($dismissible || $collapsible)
|
||||
<div class="absolute top-3 right-3 flex items-center gap-1">
|
||||
@if($collapsible)
|
||||
<button
|
||||
type="button"
|
||||
@click="collapsed = !collapsed"
|
||||
class="p-1 rounded hover:bg-black/5 transition-colors"
|
||||
>
|
||||
<x-ri-arrow-down-s-line
|
||||
class="size-4 transition-transform duration-150"
|
||||
x-bind:class="collapsed ? 'rotate-180' : ''"
|
||||
/>
|
||||
</button>
|
||||
@endif
|
||||
@if($dismissible)
|
||||
<button
|
||||
type="button"
|
||||
@click="show = false"
|
||||
class="p-1 rounded hover:bg-black/5 transition-colors"
|
||||
>
|
||||
<x-ri-close-line class="size-4" />
|
||||
</button>
|
||||
@endif
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user