Files
investbrain/resources/views/components/ib-drawer.blade.php
T

47 lines
1.2 KiB
PHP
Raw Normal View History

2024-08-03 23:52:53 -05:00
@props([
'key' => 'drawer',
'showClose' => true,
'closeOnEscape' => true,
'title' => null,
'subtitle' => null
])
<div
x-data="{ open: false }"
x-on:toggle-{{ $key }}.window="open = !open"
x-show="open"
@if($closeOnEscape)
@keydown.window.escape="open = false"
@endif
x-trap="open"
x-bind:inert="!open"
class="fixed inset-0 flex justify-end z-50"
x-transition.opacity
x-cloak
>
<div @click="open = false" class="fixed inset-0 bg-black opacity-50"></div>
2024-10-22 16:48:53 -05:00
<x-card
2024-10-25 16:12:57 -05:00
{{ $attributes->merge(['class' => 'min-h-screen w-full md:w-3/4 xl:w-3/5 rounded-none px-8 transition overflow-y-scroll']) }}
2024-08-03 23:52:53 -05:00
>
@if($title)
<x-slot:title>
{!! strip_tags($title) !!}
</x-slot:title>
@endif
@if($subtitle)
<x-slot:subtitle>
{!! strip_tags($subtitle) !!}
</x-slot:subtitle>
@endif
2024-08-03 23:52:53 -05:00
@if ($showClose)
<x-button icon="o-x-mark" title="{{ __('Close') }}" class="btn-ghost btn-circle btn-sm absolute top-4 right-4 " @click="open = false" />
2024-08-03 23:52:53 -05:00
@endif
{{ $slot }}
</x-card>
</div>