Migrate UI components from AdminLTE to LucentUI Theme using Tailwind CSS
- Updated tab-panel component to use Tailwind for styling and transitions. - Refactored table-row component to implement Tailwind classes for hover effects and borders. - Converted table-td component to utilize Tailwind for alignment and text styles. - Changed table-th component to apply Tailwind for header styling and sorting indicators. - Revised table component to adopt Tailwind for layout, borders, and responsive design. - Enhanced tabs component with Tailwind for navigation styles and transitions. - Updated toggle component to use Tailwind for switch styles and accessibility. - Refactored tooltip component to implement Tailwind for positioning and styling. - Added visual enhancements to app.css for improved UI interactions and animations.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
{{--
|
||||
Server Status Indicator Component - AdminLTE style
|
||||
Server Status Indicator Component - LucentUI Theme
|
||||
Migrated from AdminLTE to Tailwind
|
||||
|
||||
Usage:
|
||||
<x-proxmox::ui.server-status status="running" />
|
||||
@@ -60,117 +61,73 @@
|
||||
|
||||
$config = $statusConfig[strtolower($status)] ?? $statusConfig['unknown'];
|
||||
|
||||
$colorStyles = [
|
||||
'success' => 'color: var(--lte-success, #198754);',
|
||||
'warning' => 'color: #997404;',
|
||||
'danger' => 'color: var(--lte-danger, #dc3545);',
|
||||
'info' => 'color: var(--lte-info, #0dcaf0);',
|
||||
'muted' => 'color: var(--lte-secondary, #6c757d);',
|
||||
$colorClasses = [
|
||||
'success' => 'text-success',
|
||||
'warning' => 'text-yellow-600 dark:text-yellow-400',
|
||||
'danger' => 'text-error',
|
||||
'info' => 'text-info',
|
||||
'muted' => 'text-secondary dark:text-gray-400',
|
||||
];
|
||||
|
||||
$bgStyles = [
|
||||
'success' => 'background-color: rgba(25, 135, 84, 0.1);',
|
||||
'warning' => 'background-color: rgba(255, 193, 7, 0.15);',
|
||||
'danger' => 'background-color: rgba(220, 53, 69, 0.1);',
|
||||
'info' => 'background-color: rgba(13, 202, 240, 0.1);',
|
||||
'muted' => 'background-color: #f8f9fa;',
|
||||
$bgClasses = [
|
||||
'success' => 'bg-success/10',
|
||||
'warning' => 'bg-warning/15',
|
||||
'danger' => 'bg-error/10',
|
||||
'info' => 'bg-info/10',
|
||||
'muted' => 'bg-neutral/20 dark:bg-gray-700',
|
||||
];
|
||||
|
||||
$dotStyles = [
|
||||
'success' => 'background-color: var(--lte-success, #198754);',
|
||||
'warning' => 'background-color: var(--lte-warning, #ffc107);',
|
||||
'danger' => 'background-color: var(--lte-danger, #dc3545);',
|
||||
'info' => 'background-color: var(--lte-info, #0dcaf0);',
|
||||
'muted' => 'background-color: #adb5bd;',
|
||||
$dotClasses = [
|
||||
'success' => 'bg-success',
|
||||
'warning' => 'bg-warning',
|
||||
'danger' => 'bg-error',
|
||||
'info' => 'bg-info',
|
||||
'muted' => 'bg-neutral',
|
||||
];
|
||||
|
||||
$sizeStyles = [
|
||||
'sm' => 'font-size: 0.75rem; padding: 0.25rem 0.5rem;',
|
||||
'md' => 'font-size: 0.8125rem; padding: 0.375rem 0.625rem;',
|
||||
'lg' => 'font-size: 0.875rem; padding: 0.5rem 0.75rem;',
|
||||
$sizeClasses = [
|
||||
'sm' => 'text-xs px-2 py-1',
|
||||
'md' => 'text-xs px-2.5 py-1.5',
|
||||
'lg' => 'text-sm px-3 py-2',
|
||||
];
|
||||
|
||||
$dotSizeStyles = [
|
||||
'sm' => 'width: 0.375rem; height: 0.375rem;',
|
||||
'md' => 'width: 0.5rem; height: 0.5rem;',
|
||||
'lg' => 'width: 0.625rem; height: 0.625rem;',
|
||||
$dotSizeClasses = [
|
||||
'sm' => 'w-1.5 h-1.5',
|
||||
'md' => 'w-2 h-2',
|
||||
'lg' => 'w-2.5 h-2.5',
|
||||
];
|
||||
@endphp
|
||||
|
||||
<style>
|
||||
.server-status-lte {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
font-weight: 500;
|
||||
border-radius: 9999px;
|
||||
}
|
||||
.server-status-lte-minimal {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
}
|
||||
.server-status-lte-dot-wrapper {
|
||||
position: relative;
|
||||
display: flex;
|
||||
}
|
||||
.server-status-lte-dot {
|
||||
position: relative;
|
||||
display: inline-flex;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.server-status-lte-pulse {
|
||||
position: absolute;
|
||||
display: inline-flex;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 50%;
|
||||
opacity: 0.6;
|
||||
animation: pulse-lte 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
|
||||
}
|
||||
@keyframes pulse-lte {
|
||||
0%, 100% {
|
||||
opacity: 0.6;
|
||||
transform: scale(1);
|
||||
}
|
||||
50% {
|
||||
opacity: 0;
|
||||
transform: scale(1.5);
|
||||
}
|
||||
}
|
||||
/* Dark mode */
|
||||
.dark .server-status-lte-muted {
|
||||
background-color: #374151 !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
@if($minimal)
|
||||
{{-- Minimal dot-only variant --}}
|
||||
<div
|
||||
{{ $attributes }}
|
||||
class="server-status-lte-minimal"
|
||||
style="gap: {{ $showLabel ? '0.375rem' : '0' }};"
|
||||
{{ $attributes->class(['inline-flex items-center', $showLabel ? 'gap-1.5' : '']) }}
|
||||
>
|
||||
<span class="server-status-lte-dot-wrapper" style="{{ $dotSizeStyles[$size] ?? $dotSizeStyles['md'] }}">
|
||||
<span class="relative flex {{ $dotSizeClasses[$size] ?? $dotSizeClasses['md'] }}">
|
||||
@if($config['pulse'])
|
||||
<span class="server-status-lte-pulse" style="{{ $dotStyles[$config['color']] ?? $dotStyles['muted'] }}"></span>
|
||||
<span class="absolute inline-flex w-full h-full rounded-full {{ $dotClasses[$config['color']] ?? $dotClasses['muted'] }} opacity-60 animate-ping"></span>
|
||||
@endif
|
||||
<span class="server-status-lte-dot" style="{{ $dotSizeStyles[$size] ?? $dotSizeStyles['md'] }} {{ $dotStyles[$config['color']] ?? $dotStyles['muted'] }}"></span>
|
||||
<span class="relative inline-flex rounded-full {{ $dotSizeClasses[$size] ?? $dotSizeClasses['md'] }} {{ $dotClasses[$config['color']] ?? $dotClasses['muted'] }}"></span>
|
||||
</span>
|
||||
@if($showLabel)
|
||||
<span style="font-weight: 500; {{ $colorStyles[$config['color']] ?? $colorStyles['muted'] }}">{{ $config['label'] }}</span>
|
||||
<span class="font-medium {{ $colorClasses[$config['color']] ?? $colorClasses['muted'] }}">{{ $config['label'] }}</span>
|
||||
@endif
|
||||
</div>
|
||||
@else
|
||||
{{-- Full badge variant --}}
|
||||
<div
|
||||
{{ $attributes }}
|
||||
class="server-status-lte {{ $config['color'] === 'muted' ? 'server-status-lte-muted' : '' }}"
|
||||
style="{{ $bgStyles[$config['color']] ?? $bgStyles['muted'] }} {{ $colorStyles[$config['color']] ?? $colorStyles['muted'] }} {{ $sizeStyles[$size] ?? $sizeStyles['md'] }} gap: 0.5rem;"
|
||||
{{ $attributes->class([
|
||||
'inline-flex items-center gap-2 font-medium rounded-full',
|
||||
$bgClasses[$config['color']] ?? $bgClasses['muted'],
|
||||
$colorClasses[$config['color']] ?? $colorClasses['muted'],
|
||||
$sizeClasses[$size] ?? $sizeClasses['md'],
|
||||
]) }}
|
||||
>
|
||||
<span class="server-status-lte-dot-wrapper" style="{{ $dotSizeStyles[$size] ?? $dotSizeStyles['md'] }}">
|
||||
<span class="relative flex {{ $dotSizeClasses[$size] ?? $dotSizeClasses['md'] }}">
|
||||
@if($config['pulse'])
|
||||
<span class="server-status-lte-pulse" style="background-color: currentColor;"></span>
|
||||
<span class="absolute inline-flex w-full h-full rounded-full bg-current opacity-60 animate-ping"></span>
|
||||
@endif
|
||||
<span class="server-status-lte-dot" style="{{ $dotSizeStyles[$size] ?? $dotSizeStyles['md'] }} background-color: currentColor;"></span>
|
||||
<span class="relative inline-flex rounded-full {{ $dotSizeClasses[$size] ?? $dotSizeClasses['md'] }} bg-current"></span>
|
||||
</span>
|
||||
@if($showLabel)
|
||||
<span>{{ $config['label'] }}</span>
|
||||
|
||||
Reference in New Issue
Block a user