Files
Virtnet.bond/themes/lucentui/views/components/dropdown.blade.php
Joseph.Rawlings 56462aac19 Add Laravel IDE discovery files for VS Code integration
- Introduced multiple discovery files to enhance Laravel IDE support in Visual Studio Code.
- Implemented functionality to retrieve and parse test cases, translations, Livewire components, and middleware information.
- Enhanced error handling and logging configurations for better debugging experience.
- Utilized Laravel's service provider for bootstrapping necessary configurations.
2026-03-16 19:55:20 -04:00

34 lines
2.1 KiB
PHP

<div class="relative" x-data="{ open: false, activeIndex: -1 }" @keydown.escape="open = false" @keydown.down.prevent="activeIndex = Math.min(activeIndex + 1, $refs.dropdown.children.length - 1)" @keydown.up.prevent="activeIndex = Math.max(activeIndex - 1, 0)" x-init="$watch('open', value => {
if (value) {
activeIndex = -1;
$nextTick(() => {
let dropdown = $refs.dropdown;
dropdown.style.left = '';
let rect = dropdown.getBoundingClientRect();
let windowWidth = window.innerWidth;
dropdown.style.left = rect.right > windowWidth ? `-${rect.width - 40}px` : '0';
});
}
})">
<button
class="flex flex-row items-center px-2 py-1 text-sm font-medium whitespace-nowrap text-base/80 hover:text-base transition-colors duration-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary/50 focus-visible:ring-offset-2 focus-visible:ring-offset-background rounded-md"
x-on:click="open = !open"
:aria-expanded="open">
{{ $trigger }}
<x-ri-arrow-down-s-line x-bind:class="{ '-rotate-180' : open }"
class="md:block hidden size-4 text-base/50 ease-out duration-300" />
</button>
<div x-ref="dropdown"
class="absolute mt-2 w-48 bg-background-secondary/95 backdrop-blur-xl rounded-xl shadow-xl shadow-black/[0.08] z-10 border border-neutral/40 overflow-hidden ring-1 ring-black/[0.03]"
x-show="open"
x-transition:enter="transition ease-out duration-150" x-transition:enter-start="opacity-0 scale-95 -translate-y-2"
x-transition:enter-end="opacity-100 scale-100 translate-y-0" x-transition:leave="transition ease-in duration-100"
x-transition:leave-start="opacity-100 scale-100" x-transition:leave-end="opacity-0 scale-95"
x-on:click.outside="open = false" x-cloak>
<div class="py-1.5 [&>a]:block [&>a]:px-4 [&>a]:py-2.5 [&>a]:text-sm [&>a]:text-color-base/90 [&>a]:transition-colors [&>a]:duration-150 [&>a:hover]:bg-primary/10 [&>a:hover]:text-primary [&>a:focus]:bg-primary/10 [&>a:focus]:text-primary [&>a:focus]:outline-none">
{{ $content }}
</div>
</div>
</div>