pianello-api/resources/views/components/base/disclosure/button.blade.php
Ale Gallo 96c0bfb8ce Committing laravel (part 5)
committing blade templating files and components that might come in handy
2023-11-10 16:41:20 +01:00

24 lines
908 B
PHP

@props(['as' => 'div', 'variant' => null])
@aware(['selectedIndex' => null, 'index' => null, 'id' => null])
<div
class="accordion-header"
id="{{ $id }}"
>
<button
data-tw-merge
data-tw-toggle="collapse"
data-tw-target="#{{ $id }}-collapse"
type="button"
aria-expanded="true"
aria-controls="{{ $id }}-collapse"
{{ $attributes->class(
merge([
'accordion-button outline-none py-4 -my-4 font-medium w-full text-left dark:text-slate-400',
'[&:not(.collapsed)]:text-primary [&:not(.collapsed)]:dark:text-slate-300',
$selectedIndex != $index ? 'collapsed' : null,
$attributes->whereStartsWith('class')->first(),
]),
)->merge($attributes->whereDoesntStartWith('class')->getAttributes()) }}
>{{ $slot }}</button>
</div>