- Refactored select component to align with shadcn design principles. - Updated server status indicator component for consistency with shadcn style. - Modified spinner component to follow shadcn design guidelines. - Enhanced stat card component with shadcn-inspired styles. - Adjusted tab panel component to reflect shadcn design updates. - Revamped table row and table data cell components to match shadcn aesthetics. - Updated table header cell component for improved styling consistency. - Refined table component to align with shadcn design principles. - Enhanced tabs component with shadcn-inspired styles. - Updated toggle component to follow shadcn design guidelines. - Refactored tooltip component to align with shadcn design principles. - Updated server card component to reflect shadcn-inspired design.
99 lines
3.2 KiB
PHP
99 lines
3.2 KiB
PHP
{{--
|
|
Info Notice / Alert Banner Component - shadcn-style
|
|
Collapsible notice banners for important information
|
|
|
|
Usage:
|
|
<x-proxmox::ui.notice-banner
|
|
title="Cloud-init Configuration Notice"
|
|
variant="info"
|
|
:collapsible="true"
|
|
storage-key="overview-notice-collapsed"
|
|
>
|
|
<p>Your notice content here...</p>
|
|
</x-proxmox::ui.notice-banner>
|
|
--}}
|
|
|
|
@props([
|
|
'title' => null,
|
|
'variant' => 'info', // info, warning, danger, success
|
|
'collapsible' => false,
|
|
'storageKey' => null,
|
|
'icon' => null,
|
|
'showCondition' => null, // Alpine.js expression for conditional display
|
|
])
|
|
|
|
@php
|
|
$variants = [
|
|
'info' => [
|
|
'bg' => 'bg-info/10',
|
|
'border' => 'border-info/20',
|
|
'icon' => $icon ?? 'ri-information-line',
|
|
'iconColor' => 'text-info',
|
|
],
|
|
'warning' => [
|
|
'bg' => 'bg-warning/10',
|
|
'border' => 'border-warning/20',
|
|
'icon' => $icon ?? 'ri-alert-line',
|
|
'iconColor' => 'text-warning',
|
|
],
|
|
'danger' => [
|
|
'bg' => 'bg-danger/10',
|
|
'border' => 'border-danger/20',
|
|
'icon' => $icon ?? 'ri-error-warning-line',
|
|
'iconColor' => 'text-danger',
|
|
],
|
|
'success' => [
|
|
'bg' => 'bg-success/10',
|
|
'border' => 'border-success/20',
|
|
'icon' => $icon ?? 'ri-checkbox-circle-line',
|
|
'iconColor' => 'text-success',
|
|
],
|
|
];
|
|
|
|
$config = $variants[$variant] ?? $variants['info'];
|
|
@endphp
|
|
|
|
<div
|
|
@if($collapsible)
|
|
x-data="{
|
|
isCollapsed: {{ $storageKey ? "localStorage.getItem('$storageKey') === 'true'" : 'false' }},
|
|
toggle() {
|
|
this.isCollapsed = !this.isCollapsed;
|
|
@if($storageKey)
|
|
localStorage.setItem('{{ $storageKey }}', this.isCollapsed);
|
|
@endif
|
|
}
|
|
}"
|
|
@endif
|
|
@if($showCondition)
|
|
x-show="{{ $showCondition }}"
|
|
x-transition
|
|
@endif
|
|
{{ $attributes->class([
|
|
$config['bg'],
|
|
'border',
|
|
$config['border'],
|
|
'rounded-lg p-4',
|
|
]) }}
|
|
>
|
|
<div class="flex items-start gap-3">
|
|
<x-dynamic-component :component="$config['icon']" class="size-4 {{ $config['iconColor'] }} flex-shrink-0 mt-0.5" />
|
|
<div class="flex-1 min-w-0">
|
|
@if($title)
|
|
<div class="flex items-center justify-between mb-2">
|
|
<h3 class="text-sm font-medium">{{ $title }}</h3>
|
|
@if($collapsible)
|
|
<button @click="toggle()" type="button" class="text-muted-foreground hover:text-foreground transition-colors duration-150">
|
|
<x-ri-arrow-down-s-line x-bind:class="isCollapsed ? 'size-4 transition-transform rotate-180' : 'size-4 transition-transform'" />
|
|
</button>
|
|
@endif
|
|
</div>
|
|
@endif
|
|
|
|
<div @if($collapsible) x-show="!isCollapsed" x-transition @endif class="text-sm text-muted-foreground">
|
|
{{ $slot }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|