{# Settings dropdown (language + theme). Shared by base.html and admin/base.html to kill the former ~100-line copy-paste duplication. Proper Penguin UI dropdown: behaviour is the vendored dropdowns/dropdown-with-icons.html verbatim (isOpen / openedWithKeyboard, x-trap + $focus keyboard nav, x-cloak x-show, @click.outside). Trigger is our gear icon-only button; content is the language form + theme toggle. Needs the Alpine Focus plugin (loaded in base.html) for x-trap / $focus. Self-contained Alpine state + relative positioning; the host only places it (e.g. ml-auto in admin). The panel has NO id on purpose (see profile_menu.html for why — htmx hx-boost settles by id). #}
{{ ui::icon_button(aria_label=t(key='settings', lang=lang | default(value='sk')), attrs='x-on:click="isOpen = ! isOpen" x-on:keydown.space.prevent="openedWithKeyboard = true" x-on:keydown.enter.prevent="openedWithKeyboard = true" x-on:keydown.down.prevent="openedWithKeyboard = true" x-bind:aria-expanded="isOpen || openedWithKeyboard" aria-haspopup="true"', icon='') }}