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 @@
|
||||
{{--
|
||||
Resource Allocation Card Component - AdminLTE style
|
||||
Resource Allocation Card Component - LucentUI Theme
|
||||
Migrated from AdminLTE to Tailwind
|
||||
For displaying CPU, Memory, and other resource allocation vs entitlement
|
||||
|
||||
Usage:
|
||||
@@ -10,7 +11,7 @@
|
||||
entitlement-label="4 vCPU entitlement"
|
||||
description="Live hypervisor usage sampled directly from the cluster."
|
||||
gradient="linear-gradient(90deg, #38bdf8 0%, #6366f1 100%)"
|
||||
:badge="['label' => 'Healthy', 'class' => 'text-success-500 bg-success-50 dark:bg-success-500/15']"
|
||||
:badge="['label' => 'Healthy', 'class' => 'text-success bg-success/10']"
|
||||
/>
|
||||
--}}
|
||||
|
||||
@@ -27,178 +28,53 @@
|
||||
])
|
||||
|
||||
@php
|
||||
$iconBgColors = [
|
||||
'primary' => 'background-color: rgba(13, 110, 253, 0.1);',
|
||||
'success' => 'background-color: rgba(25, 135, 84, 0.1);',
|
||||
'warning' => 'background-color: rgba(255, 193, 7, 0.1);',
|
||||
'danger' => 'background-color: rgba(220, 53, 69, 0.1);',
|
||||
'info' => 'background-color: rgba(13, 202, 240, 0.1);',
|
||||
$iconBgClasses = [
|
||||
'primary' => 'bg-primary/10',
|
||||
'success' => 'bg-success/10',
|
||||
'warning' => 'bg-warning/10',
|
||||
'danger' => 'bg-error/10',
|
||||
'info' => 'bg-info/10',
|
||||
];
|
||||
$iconTextColors = [
|
||||
'primary' => 'color: var(--lte-primary, #0d6efd);',
|
||||
'success' => 'color: var(--lte-success, #198754);',
|
||||
'warning' => 'color: var(--lte-warning, #ffc107);',
|
||||
'danger' => 'color: var(--lte-danger, #dc3545);',
|
||||
'info' => 'color: var(--lte-info, #0dcaf0);',
|
||||
$iconTextClasses = [
|
||||
'primary' => 'text-primary',
|
||||
'success' => 'text-success',
|
||||
'warning' => 'text-warning',
|
||||
'danger' => 'text-error',
|
||||
'info' => 'text-info',
|
||||
];
|
||||
@endphp
|
||||
|
||||
<style>
|
||||
.allocation-card-lte {
|
||||
background-color: #fff;
|
||||
border: 1px solid var(--lte-border-color, #dee2e6);
|
||||
border-radius: var(--lte-border-radius, 0.375rem);
|
||||
padding: 1.25rem;
|
||||
box-shadow: var(--lte-card-shadow);
|
||||
transition: background-color var(--lte-transition-speed, 0.3s) ease;
|
||||
}
|
||||
.allocation-card-lte:hover {
|
||||
background-color: #f8f9fa;
|
||||
}
|
||||
.allocation-card-lte-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
}
|
||||
.allocation-card-lte-header {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
gap: 0.75rem;
|
||||
}
|
||||
.allocation-card-lte-main {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 0.875rem;
|
||||
}
|
||||
.allocation-card-lte-icon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 2.75rem;
|
||||
height: 2.75rem;
|
||||
flex-shrink: 0;
|
||||
border-radius: calc(var(--lte-border-radius, 0.375rem) + 2px);
|
||||
}
|
||||
.allocation-card-lte-icon svg {
|
||||
width: 1.25rem;
|
||||
height: 1.25rem;
|
||||
}
|
||||
.allocation-card-lte-info {
|
||||
min-width: 0;
|
||||
}
|
||||
.allocation-card-lte-label {
|
||||
font-size: 0.8125rem;
|
||||
font-weight: 500;
|
||||
color: var(--lte-secondary, #6c757d);
|
||||
margin-bottom: 0.25rem;
|
||||
}
|
||||
.allocation-card-lte-value {
|
||||
font-size: 1.25rem;
|
||||
font-weight: 700;
|
||||
color: #212529;
|
||||
line-height: 1.3;
|
||||
}
|
||||
.allocation-card-lte-entitlement {
|
||||
font-size: 0.8125rem;
|
||||
color: var(--lte-secondary, #6c757d);
|
||||
margin-top: 0.25rem;
|
||||
}
|
||||
.allocation-card-lte-badge {
|
||||
flex-shrink: 0;
|
||||
padding: 0.25rem 0.625rem;
|
||||
font-size: 0.75rem;
|
||||
font-weight: 500;
|
||||
border-radius: 9999px;
|
||||
background-color: rgba(25, 135, 84, 0.1);
|
||||
color: var(--lte-success, #198754);
|
||||
}
|
||||
.allocation-card-lte-progress-section {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
.allocation-card-lte-progress-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-size: 0.8125rem;
|
||||
}
|
||||
.allocation-card-lte-progress-label {
|
||||
color: var(--lte-secondary, #6c757d);
|
||||
}
|
||||
.allocation-card-lte-progress-value {
|
||||
font-weight: 600;
|
||||
color: #212529;
|
||||
}
|
||||
.allocation-card-lte-progress-track {
|
||||
height: 0.5rem;
|
||||
background-color: #e9ecef;
|
||||
border-radius: 9999px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.allocation-card-lte-progress-bar {
|
||||
height: 100%;
|
||||
border-radius: 9999px;
|
||||
transition: width var(--lte-transition-speed, 0.3s) ease;
|
||||
}
|
||||
.allocation-card-lte-description {
|
||||
font-size: 0.8125rem;
|
||||
color: #adb5bd;
|
||||
}
|
||||
/* Dark mode */
|
||||
.dark .allocation-card-lte {
|
||||
background-color: #1f2937;
|
||||
border-color: #374151;
|
||||
}
|
||||
.dark .allocation-card-lte:hover {
|
||||
background-color: #374151;
|
||||
}
|
||||
.dark .allocation-card-lte-value {
|
||||
color: #f3f4f6;
|
||||
}
|
||||
.dark .allocation-card-lte-progress-value {
|
||||
color: #f3f4f6;
|
||||
}
|
||||
.dark .allocation-card-lte-progress-track {
|
||||
background-color: #374151;
|
||||
}
|
||||
.dark .allocation-card-lte-description {
|
||||
color: #6b7280;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div {{ $attributes->class(['allocation-card-lte']) }}>
|
||||
<div class="allocation-card-lte-content">
|
||||
<div class="allocation-card-lte-header">
|
||||
<div class="allocation-card-lte-main">
|
||||
<div {{ $attributes->class(['bg-background border border-neutral rounded-lg p-5 shadow-sm transition-colors duration-200 hover:bg-background-secondary/30']) }}>
|
||||
<div class="flex flex-col gap-4">
|
||||
<div class="flex items-start justify-between gap-3">
|
||||
<div class="flex items-start gap-3.5">
|
||||
@if($icon)
|
||||
<div class="allocation-card-lte-icon" style="{{ $iconBgColors[$iconColor] ?? $iconBgColors['primary'] }}">
|
||||
<x-dynamic-component :component="$icon" style="{{ $iconTextColors[$iconColor] ?? $iconTextColors['primary'] }}" />
|
||||
<div class="flex items-center justify-center size-11 shrink-0 rounded-lg {{ $iconBgClasses[$iconColor] ?? $iconBgClasses['primary'] }}">
|
||||
<x-dynamic-component :component="$icon" class="size-5 {{ $iconTextClasses[$iconColor] ?? $iconTextClasses['primary'] }}" />
|
||||
</div>
|
||||
@endif
|
||||
<div class="allocation-card-lte-info">
|
||||
<p class="allocation-card-lte-label">{{ $label }}</p>
|
||||
<p class="allocation-card-lte-value">{{ $usageSummary }}</p>
|
||||
<p class="allocation-card-lte-entitlement">{{ $entitlementLabel }}</p>
|
||||
<div class="min-w-0">
|
||||
<p class="text-xs font-medium text-base/60 mb-1">{{ $label }}</p>
|
||||
<p class="text-xl font-bold text-base leading-tight">{{ $usageSummary }}</p>
|
||||
<p class="text-xs text-base/60 mt-1">{{ $entitlementLabel }}</p>
|
||||
</div>
|
||||
</div>
|
||||
@if($badge)
|
||||
<span class="allocation-card-lte-badge" @if(isset($badge['class'])) style="{{ $badge['class'] }}" @endif>
|
||||
<span class="shrink-0 px-2.5 py-1 text-xs font-medium rounded-full {{ $badge['class'] ?? 'bg-success/10 text-success' }}">
|
||||
{{ $badge['label'] ?? '' }}
|
||||
</span>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
@if(!is_null($percent))
|
||||
<div class="allocation-card-lte-progress-section">
|
||||
<div class="allocation-card-lte-progress-header">
|
||||
<span class="allocation-card-lte-progress-label">Usage</span>
|
||||
<span class="allocation-card-lte-progress-value">{{ $percent }}%</span>
|
||||
<div class="flex flex-col gap-2">
|
||||
<div class="flex items-center justify-between text-xs">
|
||||
<span class="text-base/60">Usage</span>
|
||||
<span class="font-semibold text-base">{{ $percent }}%</span>
|
||||
</div>
|
||||
<div class="allocation-card-lte-progress-track">
|
||||
<div class="h-2 bg-background-secondary rounded-full overflow-hidden">
|
||||
<div
|
||||
class="allocation-card-lte-progress-bar"
|
||||
class="h-full rounded-full transition-all duration-300"
|
||||
style="width: {{ min($percent, 130) }}%; background-image: {{ $gradient }};"
|
||||
></div>
|
||||
</div>
|
||||
@@ -206,7 +82,7 @@
|
||||
@endif
|
||||
|
||||
@if($description)
|
||||
<p class="allocation-card-lte-description">{{ $description }}</p>
|
||||
<p class="text-xs text-base/50">{{ $description }}</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user