Skip to content

Commit a09e7ce

Browse files
author
Itamar Junior
committed
Add tooltip functionality for document descriptions in company management
1 parent 21640df commit a09e7ce

File tree

1 file changed

+28
-2
lines changed

1 file changed

+28
-2
lines changed

resources/views/livewire/company/company.blade.php

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ class="text-sm rounded border border-gray-300 px-2 py-1 dark:bg-gray-700 dark:te
320320
];
321321
@endphp
322322
<span
323-
class="inline-flex items-center gap-x-1.5 rounded-md px-1.5 py-0.5 text-xs font-medium
323+
class="inline-flex items-center gap-x-1.5 rounded-md px-1.5 py-0.5 text-xs font-medium absolute
324324
{{ $statusClasses[$company->ar_status] ?? $statusClasses['Compliant'] }}">
325325
{{-- Tooltip --}}
326326
{{-- Tooltip Trigger --}}
@@ -507,7 +507,33 @@ class="block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gra
507507
{{ $doc->name }}
508508
</td>
509509
<td class="px-4 py-2">{{ $doc->code }}</td>
510-
<td></td>
510+
<td class="px-4 py-2 flex items-center">
511+
<div x-data="{ tooltip: false }">
512+
{{-- Tooltip --}}
513+
{{-- Tooltip Trigger --}}
514+
<div @mouseover="tooltip = true" @mouseleave="tooltip = false"
515+
class="absolute">
516+
<svg xmlns="http://www.w3.org/2000/svg" fill="none"
517+
viewBox="0 0 24 24" stroke-width="1.5"
518+
stroke="currentColor" class="size-6">
519+
<path stroke-linecap="round" stroke-linejoin="round"
520+
d="m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z" />
521+
</svg>
522+
523+
{{-- Tooltip Box --}}
524+
<div x-show="tooltip"
525+
x-transition:enter="transition ease-out duration-500"
526+
x-transition:enter-start="opacity-0 translate-y-1"
527+
x-transition:enter-end="opacity-100 translate-y-0"
528+
x-transition:leave="transition ease-in duration-150"
529+
x-transition:leave-start="opacity-100 translate-y-0"
530+
x-transition:leave-end="opacity-0 translate-y-1"
531+
class="absolute left-1/2 top-full mt-2 -translate-x-1/2 z-50 w-[200px] rounded-lg bg-gray-700 py-1.5 px-3 font-sans text-sm font-normal text-white text-center">
532+
{{ $doc->description ?? 'No description available.' }}
533+
</div>
534+
</div>
535+
</div>
536+
</td>
511537
<td class="px-4 py-2">{{ $doc->days_from_ard }}</td>
512538
<td class="px-4 py-2">
513539
<div class="flex items-center">

0 commit comments

Comments
 (0)