Files
Virtnet.bond/extensions/Servers/Proxmox/views/components/ui/tooltip.blade.php
Joseph.Rawlings 7190d7a818 refactor: update UI components to shadcn-style
- 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.
2025-12-17 11:47:42 -05:00

49 lines
1.3 KiB
PHP

{{--
Tooltip Component - shadcn-style
Usage:
<x-proxmox::ui.tooltip text="This is a tooltip">
<button>Hover me</button>
</x-proxmox::ui.tooltip>
--}}
@props([
'text',
'position' => 'top', // top, bottom, left, right
])
@php
$positions = [
'top' => 'bottom-full left-1/2 -translate-x-1/2 mb-2',
'bottom' => 'top-full left-1/2 -translate-x-1/2 mt-2',
'left' => 'right-full top-1/2 -translate-y-1/2 mr-2',
'right' => 'left-full top-1/2 -translate-y-1/2 ml-2',
];
@endphp
<div
x-data="{ show: false }"
@mouseenter="show = true"
@mouseleave="show = false"
class="relative inline-block"
{{ $attributes }}
>
{{ $slot }}
<div
x-show="show"
x-cloak
x-transition:enter="transition ease-out duration-100"
x-transition:enter-start="opacity-0"
x-transition:enter-end="opacity-100"
x-transition:leave="transition ease-in duration-75"
x-transition:leave-start="opacity-100"
x-transition:leave-end="opacity-0"
class="absolute z-50 {{ $positions[$position] ?? $positions['top'] }} pointer-events-none"
>
<div class="overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground">
{{ $text }}
</div>
</div>
</div>