Add AdminLTE-style CSS framework to app.css
- Introduced AdminLTE CSS variables for color palette, body colors, card styles, and button styles. - Implemented card components with variants for primary, success, warning, danger, and info. - Added button styles including sizes and outline variants. - Created form controls, select inputs, and input groups with consistent styling. - Included utility classes for text and background colors, gradients, and shadows. - Developed components for badges, alerts, callouts, progress bars, tables, small boxes, and info boxes. - Integrated modal, dropdown, spinner, tooltip, and direct chat styles. - Established timeline and close button styles, with dark mode support for specific components.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
{{--
|
||||
Resource Allocation Card Component - TailAdmin style
|
||||
Resource Allocation Card Component - AdminLTE style
|
||||
For displaying CPU, Memory, and other resource allocation vs entitlement
|
||||
|
||||
Usage:
|
||||
@@ -20,43 +20,185 @@
|
||||
'usageSummary',
|
||||
'entitlementLabel',
|
||||
'description' => null,
|
||||
'gradient' => 'linear-gradient(90deg, #465fff 0%, #8b5cf6 100%)',
|
||||
'gradient' => 'linear-gradient(90deg, #0d6efd 0%, #6f42c1 100%)',
|
||||
'badge' => null,
|
||||
'icon' => null,
|
||||
'iconColor' => 'text-brand-500',
|
||||
'iconColor' => 'primary',
|
||||
])
|
||||
|
||||
<div {{ $attributes->class(['rounded-2xl border border-gray-200 bg-white p-5 transition-colors duration-150 hover:bg-gray-50 dark:border-gray-800 dark:bg-white/[0.03] dark:hover:bg-gray-800/50']) }}>
|
||||
<div class="flex flex-col gap-4">
|
||||
<div class="flex items-start justify-between gap-3">
|
||||
<div class="flex items-start gap-3.5">
|
||||
@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);',
|
||||
];
|
||||
$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);',
|
||||
];
|
||||
@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">
|
||||
@if($icon)
|
||||
<div class="flex size-11 flex-shrink-0 items-center justify-center rounded-xl bg-brand-50 dark:bg-brand-500/10">
|
||||
<x-dynamic-component :component="$icon" class="size-5 {{ $iconColor }} dark:text-brand-400" />
|
||||
<div class="allocation-card-lte-icon" style="{{ $iconBgColors[$iconColor] ?? $iconBgColors['primary'] }}">
|
||||
<x-dynamic-component :component="$icon" style="{{ $iconTextColors[$iconColor] ?? $iconTextColors['primary'] }}" />
|
||||
</div>
|
||||
@endif
|
||||
<div class="min-w-0 space-y-1">
|
||||
<p class="text-theme-xs font-medium text-gray-500 dark:text-gray-400">{{ $label }}</p>
|
||||
<p class="text-xl font-bold text-gray-800 dark:text-white/90">{{ $usageSummary }}</p>
|
||||
<p class="text-theme-xs text-gray-500 dark:text-gray-400">{{ $entitlementLabel }}</p>
|
||||
<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>
|
||||
</div>
|
||||
@if($badge)
|
||||
<span class="flex-shrink-0 rounded-full px-2.5 py-1 text-theme-xs font-medium {{ $badge['class'] ?? 'text-gray-500 bg-gray-100 dark:bg-gray-800 dark:text-gray-400' }}">
|
||||
<span class="allocation-card-lte-badge" @if(isset($badge['class'])) style="{{ $badge['class'] }}" @endif>
|
||||
{{ $badge['label'] ?? '' }}
|
||||
</span>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
@if(!is_null($percent))
|
||||
<div class="space-y-2">
|
||||
<div class="flex items-center justify-between text-theme-xs">
|
||||
<span class="text-gray-500 dark:text-gray-400">Usage</span>
|
||||
<span class="font-semibold text-gray-800 dark:text-white/90">{{ $percent }}%</span>
|
||||
<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>
|
||||
<div class="h-2 overflow-hidden rounded-full bg-gray-200 dark:bg-gray-700">
|
||||
<div class="allocation-card-lte-progress-track">
|
||||
<div
|
||||
class="h-full rounded-full transition-all duration-300"
|
||||
class="allocation-card-lte-progress-bar"
|
||||
style="width: {{ min($percent, 130) }}%; background-image: {{ $gradient }};"
|
||||
></div>
|
||||
</div>
|
||||
@@ -64,7 +206,7 @@
|
||||
@endif
|
||||
|
||||
@if($description)
|
||||
<p class="text-theme-xs text-gray-400 dark:text-gray-500">{{ $description }}</p>
|
||||
<p class="allocation-card-lte-description">{{ $description }}</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user