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 @@
|
||||
{{--
|
||||
Action Toolbar Button Component - TailAdmin style
|
||||
Action Toolbar Button Component - AdminLTE style
|
||||
Individual button for VM control actions
|
||||
|
||||
Usage:
|
||||
@@ -15,7 +15,7 @@
|
||||
'action' => null,
|
||||
'icon' => null,
|
||||
'label',
|
||||
'variant' => 'default', // default, danger, warning, success
|
||||
'variant' => 'default', // default, danger, warning, success, primary
|
||||
'disabled' => false,
|
||||
'loading' => false,
|
||||
'confirm' => null,
|
||||
@@ -23,50 +23,152 @@
|
||||
])
|
||||
|
||||
@php
|
||||
$variants = [
|
||||
'default' => 'border border-gray-300 bg-white text-gray-700 shadow-theme-xs hover:bg-gray-50 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-300 dark:hover:bg-gray-700',
|
||||
'primary' => 'border border-brand-200 bg-brand-50 text-brand-600 hover:bg-brand-100 dark:border-brand-800 dark:bg-brand-500/10 dark:text-brand-400 dark:hover:bg-brand-500/20',
|
||||
'success' => 'border border-success-200 bg-success-50 text-success-600 hover:bg-success-100 dark:border-success-800 dark:bg-success-500/10 dark:text-success-400 dark:hover:bg-success-500/20',
|
||||
'warning' => 'border border-warning-200 bg-warning-50 text-warning-600 hover:bg-warning-100 dark:border-warning-800 dark:bg-warning-500/10 dark:text-warning-400 dark:hover:bg-warning-500/20',
|
||||
'danger' => 'border border-error-200 bg-error-50 text-error-600 hover:bg-error-100 dark:border-error-800 dark:bg-error-500/10 dark:text-error-400 dark:hover:bg-error-500/20',
|
||||
];
|
||||
|
||||
$sizes = [
|
||||
'sm' => 'h-9 px-3 text-theme-xs',
|
||||
'md' => 'h-10 px-4 text-theme-sm',
|
||||
'lg' => 'h-11 px-5 text-theme-sm',
|
||||
$sizeStyles = [
|
||||
'sm' => 'height: 2.25rem; padding: 0 0.75rem; font-size: 0.8125rem;',
|
||||
'md' => 'height: 2.5rem; padding: 0 1rem; font-size: 0.875rem;',
|
||||
'lg' => 'height: 2.75rem; padding: 0 1.25rem; font-size: 0.875rem;',
|
||||
];
|
||||
|
||||
$iconSizes = [
|
||||
'sm' => 'size-3.5',
|
||||
'md' => 'size-4',
|
||||
'lg' => 'size-4.5',
|
||||
'sm' => 'width: 0.875rem; height: 0.875rem;',
|
||||
'md' => 'width: 1rem; height: 1rem;',
|
||||
'lg' => 'width: 1.125rem; height: 1.125rem;',
|
||||
];
|
||||
@endphp
|
||||
|
||||
<style>
|
||||
.action-btn-lte {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 0.5rem;
|
||||
white-space: nowrap;
|
||||
font-weight: 500;
|
||||
border-radius: var(--lte-border-radius, 0.375rem);
|
||||
border: 1px solid transparent;
|
||||
transition: all var(--lte-transition-speed, 0.3s) ease;
|
||||
cursor: pointer;
|
||||
}
|
||||
.action-btn-lte:focus {
|
||||
outline: none;
|
||||
box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
|
||||
}
|
||||
.action-btn-lte:disabled {
|
||||
opacity: 0.5;
|
||||
pointer-events: none;
|
||||
}
|
||||
.action-btn-lte-default {
|
||||
background-color: #fff;
|
||||
border-color: var(--lte-border-color, #dee2e6);
|
||||
color: #495057;
|
||||
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
.action-btn-lte-default:hover {
|
||||
background-color: #f8f9fa;
|
||||
border-color: #adb5bd;
|
||||
}
|
||||
.action-btn-lte-primary {
|
||||
background-color: rgba(13, 110, 253, 0.1);
|
||||
border-color: rgba(13, 110, 253, 0.2);
|
||||
color: var(--lte-primary, #0d6efd);
|
||||
}
|
||||
.action-btn-lte-primary:hover {
|
||||
background-color: rgba(13, 110, 253, 0.15);
|
||||
border-color: rgba(13, 110, 253, 0.3);
|
||||
}
|
||||
.action-btn-lte-success {
|
||||
background-color: rgba(25, 135, 84, 0.1);
|
||||
border-color: rgba(25, 135, 84, 0.2);
|
||||
color: var(--lte-success, #198754);
|
||||
}
|
||||
.action-btn-lte-success:hover {
|
||||
background-color: rgba(25, 135, 84, 0.15);
|
||||
border-color: rgba(25, 135, 84, 0.3);
|
||||
}
|
||||
.action-btn-lte-warning {
|
||||
background-color: rgba(255, 193, 7, 0.15);
|
||||
border-color: rgba(255, 193, 7, 0.3);
|
||||
color: #997404;
|
||||
}
|
||||
.action-btn-lte-warning:hover {
|
||||
background-color: rgba(255, 193, 7, 0.25);
|
||||
border-color: rgba(255, 193, 7, 0.4);
|
||||
}
|
||||
.action-btn-lte-danger {
|
||||
background-color: rgba(220, 53, 69, 0.1);
|
||||
border-color: rgba(220, 53, 69, 0.2);
|
||||
color: var(--lte-danger, #dc3545);
|
||||
}
|
||||
.action-btn-lte-danger:hover {
|
||||
background-color: rgba(220, 53, 69, 0.15);
|
||||
border-color: rgba(220, 53, 69, 0.3);
|
||||
}
|
||||
.action-btn-lte-loading {
|
||||
cursor: wait;
|
||||
}
|
||||
/* Spinner */
|
||||
.action-btn-spinner-lte {
|
||||
animation: spin 1s linear infinite;
|
||||
}
|
||||
@keyframes spin {
|
||||
from { transform: rotate(0deg); }
|
||||
to { transform: rotate(360deg); }
|
||||
}
|
||||
/* Dark mode */
|
||||
.dark .action-btn-lte-default {
|
||||
background-color: #1f2937;
|
||||
border-color: #374151;
|
||||
color: #d1d5db;
|
||||
}
|
||||
.dark .action-btn-lte-default:hover {
|
||||
background-color: #374151;
|
||||
border-color: #4b5563;
|
||||
}
|
||||
.dark .action-btn-lte-primary {
|
||||
background-color: rgba(13, 110, 253, 0.15);
|
||||
border-color: rgba(13, 110, 253, 0.25);
|
||||
}
|
||||
.dark .action-btn-lte-success {
|
||||
background-color: rgba(25, 135, 84, 0.15);
|
||||
border-color: rgba(25, 135, 84, 0.25);
|
||||
}
|
||||
.dark .action-btn-lte-warning {
|
||||
background-color: rgba(255, 193, 7, 0.15);
|
||||
border-color: rgba(255, 193, 7, 0.25);
|
||||
color: #ffc107;
|
||||
}
|
||||
.dark .action-btn-lte-danger {
|
||||
background-color: rgba(220, 53, 69, 0.15);
|
||||
border-color: rgba(220, 53, 69, 0.25);
|
||||
}
|
||||
</style>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
@if($confirm)
|
||||
x-data=""
|
||||
@click="if(confirm('{{ $confirm }}')) { $wire.call('{{ $action }}') }"
|
||||
@endif
|
||||
style="{{ $sizeStyles[$size] ?? $sizeStyles['md'] }}"
|
||||
{{ $attributes->merge([
|
||||
'disabled' => $disabled || $loading,
|
||||
])->class([
|
||||
'inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-lg font-medium transition-colors duration-150 focus:outline-none focus-visible:ring-3 focus-visible:ring-brand-500/20',
|
||||
$variants[$variant] ?? $variants['default'],
|
||||
$sizes[$size] ?? $sizes['md'],
|
||||
'pointer-events-none opacity-50' => $disabled,
|
||||
'cursor-wait' => $loading,
|
||||
'action-btn-lte',
|
||||
'action-btn-lte-default' => $variant === 'default',
|
||||
'action-btn-lte-primary' => $variant === 'primary',
|
||||
'action-btn-lte-success' => $variant === 'success',
|
||||
'action-btn-lte-warning' => $variant === 'warning',
|
||||
'action-btn-lte-danger' => $variant === 'danger',
|
||||
'action-btn-lte-loading' => $loading,
|
||||
]) }}
|
||||
>
|
||||
@if($loading)
|
||||
<svg class="animate-spin {{ $iconSizes[$size] ?? 'size-4' }}" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
|
||||
<svg class="action-btn-spinner-lte" style="{{ $iconSizes[$size] ?? $iconSizes['md'] }}" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
|
||||
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
|
||||
<path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
|
||||
</svg>
|
||||
@elseif($icon)
|
||||
<x-dynamic-component :component="$icon" class="{{ $iconSizes[$size] ?? 'size-4' }}" />
|
||||
<x-dynamic-component :component="$icon" style="{{ $iconSizes[$size] ?? $iconSizes['md'] }}" />
|
||||
@endif
|
||||
<span>{{ $label }}</span>
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user