- toolbar and fixes
This commit is contained in:
Jérémy Guillot
2024-06-29 14:51:10 +02:00
parent b04055ec22
commit 858a5bed06
20 changed files with 404 additions and 68 deletions

View File

@@ -0,0 +1,29 @@
{# templates/components/DropdownMenu.html.twig #}
<div {{ attributes }} >
<div data-controller="dropdown" class="relative inline-block">
<twig:ToolBarButton
icon="{{ icon }}"
text="{{ text }}"
action="toggle"
data-dropdown-target="button"
/>
<div class="absolute left-0 mt-2 w-max z-10 bg-gray-800 rounded-sm shadow-lg hidden"
data-dropdown-target="menu" data-controller="toolbar">
<div class="py-1">
{% for item in items %}
<a href="#"
class="block px-4 py-2 text-sm text-white hover:text-green-500"
data-action="toolbar#{{ item.action }}"
{% if item.data is defined %}
{% for key, value in item.data %}
data-{{ key }}="{{ value }}"
{% endfor %}
{% endif %}
>
{{ item.text }}
</a>
{% endfor %}
</div>
</div>
</div>
</div>