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 Gauge Component - AdminLTE style
|
||||
Resource Gauge Component - LucentUI Theme
|
||||
Migrated from AdminLTE to Tailwind
|
||||
Shows a circular or linear gauge for resource usage
|
||||
|
||||
Usage:
|
||||
@@ -33,15 +34,15 @@
|
||||
}
|
||||
}
|
||||
|
||||
$bgColors = [
|
||||
'primary' => 'var(--lte-primary, #0d6efd)',
|
||||
'success' => 'var(--lte-success, #198754)',
|
||||
'warning' => 'var(--lte-warning, #ffc107)',
|
||||
'danger' => 'var(--lte-danger, #dc3545)',
|
||||
'info' => 'var(--lte-info, #0dcaf0)',
|
||||
$barColorClasses = [
|
||||
'primary' => 'bg-primary',
|
||||
'success' => 'bg-success',
|
||||
'warning' => 'bg-warning',
|
||||
'danger' => 'bg-error',
|
||||
'info' => 'bg-info',
|
||||
];
|
||||
|
||||
$barColor = $bgColors[$color] ?? $bgColors['primary'];
|
||||
$barColorClass = $barColorClasses[$color] ?? $barColorClasses['primary'];
|
||||
|
||||
$badgeLabel = match(true) {
|
||||
$percent >= 100 => 'Over entitlement',
|
||||
@@ -49,130 +50,41 @@
|
||||
default => 'Healthy',
|
||||
};
|
||||
|
||||
$badgeStyle = match(true) {
|
||||
$percent >= 100 => 'background-color: rgba(220, 53, 69, 0.1); color: var(--lte-danger, #dc3545);',
|
||||
$percent >= 85 => 'background-color: rgba(255, 193, 7, 0.15); color: #997404;',
|
||||
default => 'background-color: rgba(25, 135, 84, 0.1); color: var(--lte-success, #198754);',
|
||||
$badgeClasses = match(true) {
|
||||
$percent >= 100 => 'bg-error/10 text-error',
|
||||
$percent >= 85 => 'bg-warning/15 text-yellow-700 dark:text-yellow-400',
|
||||
default => 'bg-success/10 text-success',
|
||||
};
|
||||
@endphp
|
||||
|
||||
<style>
|
||||
.resource-gauge-lte {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
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);
|
||||
}
|
||||
.resource-gauge-lte-header {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
gap: 0.75rem;
|
||||
}
|
||||
.resource-gauge-lte-info {
|
||||
min-width: 0;
|
||||
}
|
||||
.resource-gauge-lte-label {
|
||||
font-size: 0.8125rem;
|
||||
font-weight: 500;
|
||||
color: var(--lte-secondary, #6c757d);
|
||||
margin-bottom: 0.25rem;
|
||||
}
|
||||
.resource-gauge-lte-value {
|
||||
font-size: 1.25rem;
|
||||
font-weight: 700;
|
||||
color: #212529;
|
||||
line-height: 1.3;
|
||||
}
|
||||
.resource-gauge-lte-sublabel {
|
||||
font-size: 0.8125rem;
|
||||
color: var(--lte-secondary, #6c757d);
|
||||
margin-top: 0.25rem;
|
||||
}
|
||||
.resource-gauge-lte-badge {
|
||||
flex-shrink: 0;
|
||||
padding: 0.25rem 0.625rem;
|
||||
font-size: 0.75rem;
|
||||
font-weight: 500;
|
||||
border-radius: 9999px;
|
||||
}
|
||||
.resource-gauge-lte-progress {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
.resource-gauge-lte-progress-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-size: 0.8125rem;
|
||||
}
|
||||
.resource-gauge-lte-progress-label {
|
||||
color: var(--lte-secondary, #6c757d);
|
||||
}
|
||||
.resource-gauge-lte-progress-value {
|
||||
font-weight: 600;
|
||||
color: #212529;
|
||||
}
|
||||
.resource-gauge-lte-track {
|
||||
height: 0.5rem;
|
||||
background-color: #e9ecef;
|
||||
border-radius: 9999px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.resource-gauge-lte-bar {
|
||||
height: 100%;
|
||||
border-radius: 9999px;
|
||||
transition: width var(--lte-transition-speed, 0.3s) ease;
|
||||
}
|
||||
/* Dark mode */
|
||||
.dark .resource-gauge-lte {
|
||||
background-color: #1f2937;
|
||||
border-color: #374151;
|
||||
}
|
||||
.dark .resource-gauge-lte-value {
|
||||
color: #f3f4f6;
|
||||
}
|
||||
.dark .resource-gauge-lte-progress-value {
|
||||
color: #f3f4f6;
|
||||
}
|
||||
.dark .resource-gauge-lte-track {
|
||||
background-color: #374151;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div {{ $attributes->class(['resource-gauge-lte']) }}>
|
||||
<div class="resource-gauge-lte-header">
|
||||
<div class="resource-gauge-lte-info">
|
||||
<p class="resource-gauge-lte-label">{{ $label }}</p>
|
||||
<p class="resource-gauge-lte-value">
|
||||
<div {{ $attributes->class(['flex flex-col gap-4 bg-background dark:bg-gray-800 border border-neutral dark:border-gray-700 rounded-lg p-5 shadow-sm']) }}>
|
||||
<div class="flex items-start justify-between gap-3">
|
||||
<div class="min-w-0">
|
||||
<p class="text-xs font-medium text-secondary dark:text-gray-400 mb-1">{{ $label }}</p>
|
||||
<p class="text-xl font-bold text-primary dark:text-gray-100 leading-tight">
|
||||
@if($prefix){{ $prefix }}@endif{{ is_numeric($value) ? number_format($value, 1) : $value }}@if($suffix){{ $suffix }}@endif
|
||||
</p>
|
||||
@if($sublabel)
|
||||
<p class="resource-gauge-lte-sublabel">{{ $sublabel }}</p>
|
||||
<p class="text-xs text-secondary dark:text-gray-400 mt-1">{{ $sublabel }}</p>
|
||||
@endif
|
||||
</div>
|
||||
<span class="resource-gauge-lte-badge" style="{{ $badgeStyle }}">
|
||||
<span class="shrink-0 px-2.5 py-1 text-xs font-medium rounded-full {{ $badgeClasses }}">
|
||||
{{ $badgeLabel }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="resource-gauge-lte-progress">
|
||||
<div class="resource-gauge-lte-progress-header">
|
||||
<span class="resource-gauge-lte-progress-label">Usage</span>
|
||||
<span class="resource-gauge-lte-progress-value">{{ number_format($percent, 1) }}%</span>
|
||||
<div class="flex flex-col gap-2">
|
||||
<div class="flex items-center justify-between text-xs">
|
||||
<span class="text-secondary dark:text-gray-400">Usage</span>
|
||||
<span class="font-semibold text-primary dark:text-gray-100">{{ number_format($percent, 1) }}%</span>
|
||||
</div>
|
||||
<div class="resource-gauge-lte-track">
|
||||
<div class="h-2 bg-neutral/30 dark:bg-gray-700 rounded-full overflow-hidden">
|
||||
<div
|
||||
class="resource-gauge-lte-bar"
|
||||
class="{{ $barColorClass }} h-full rounded-full transition-all duration-500"
|
||||
@if($gradient)
|
||||
style="width: {{ min($percent, 130) }}%; background-image: {{ $gradient }};"
|
||||
@else
|
||||
style="width: {{ min($percent, 130) }}%; background-color: {{ $barColor }};"
|
||||
style="width: {{ min($percent, 130) }}%;"
|
||||
@endif
|
||||
></div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user