Mercurial > packages > framework
comparison publishable/resources/views/components/dropdown.blade.php @ 2:b44434aaa767
Moving around the components.
Made a big step in the right direction with the Builder and named joins being accessible.
| author | luka |
|---|---|
| date | Wed, 18 Jun 2025 22:28:47 -0400 |
| parents | resources/views/components/dropdown.blade.php@56d9c64d64aa |
| children |
comparison
equal
deleted
inserted
replaced
| 1:56d9c64d64aa | 2:b44434aaa767 |
|---|---|
| 1 @props(['align' => 'right', 'width' => '48', 'contentClasses' => 'py-1 bg-white']) | |
| 2 | |
| 3 @php | |
| 4 $alignmentClasses = match ($align) { | |
| 5 'left' => 'ltr:origin-top-left rtl:origin-top-right start-0', | |
| 6 'top' => 'origin-top', | |
| 7 default => 'ltr:origin-top-right rtl:origin-top-left end-0', | |
| 8 }; | |
| 9 | |
| 10 $width = match ($width) { | |
| 11 '48' => 'w-48', | |
| 12 default => $width, | |
| 13 }; | |
| 14 @endphp | |
| 15 | |
| 16 <div class="relative" x-data="{ open: false }" @click.outside="open = false" @close.stop="open = false"> | |
| 17 <div @click="open = ! open"> | |
| 18 {{ $trigger }} | |
| 19 </div> | |
| 20 | |
| 21 <div x-show="open" x-transition:enter="transition ease-out duration-200" x-transition:enter-start="opacity-0 scale-95" | |
| 22 x-transition:enter-end="opacity-100 scale-100" x-transition:leave="transition ease-in duration-75" | |
| 23 x-transition:leave-start="opacity-100 scale-100" x-transition:leave-end="opacity-0 scale-95" | |
| 24 class="absolute z-50 mt-2 {{ $width }} rounded-md shadow-lg {{ $alignmentClasses }}" | |
| 25 style="display: none;" @click="open = false"> | |
| 26 <div class="rounded-md ring-1 ring-black ring-opacity-5 {{ $contentClasses }}"> | |
| 27 {{ $content }} | |
| 28 </div> | |
| 29 </div> | |
| 30 </div> |
