- Changed badge, button, card, dropdown, input, modal, select, table, tabs, toggle, and tooltip components to align with the TailAdmin design system. - Updated class names and styles for consistency across components. - Enhanced accessibility and responsiveness in various components. - Improved hover and focus states for better user experience.
49 lines
1.3 KiB
PHP
49 lines
1.3 KiB
PHP
{{--
|
|
Tooltip Component - TailAdmin 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-150"
|
|
x-transition:enter-start="opacity-0"
|
|
x-transition:enter-end="opacity-100"
|
|
x-transition:leave="transition ease-in duration-100"
|
|
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-lg bg-gray-900 px-3 py-1.5 text-theme-xs font-medium text-white shadow-theme-md dark:bg-gray-700">
|
|
{{ $text }}
|
|
</div>
|
|
</div>
|
|
</div>
|