Browse code

Update

Benjamin Roth authored on05/02/2026 17:13:25
Showing1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,21 @@
1
+import { LitElement, html, css } from 'lit';
2
+
3
+export class WinzerMenuGroup extends LitElement {
4
+    static properties = { items: { type: Array } };
5
+    static styles = css`
6
+        :host { display: block; margin-bottom: 20px; }
7
+        .menu-group { background-color: var(--bg-card); border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow-sm); }
8
+        .menu-item { display: flex; align-items: center; padding: 16px 20px; cursor: pointer; background: var(--bg-white); border-bottom: 1px solid var(--border-color); font-size: 0.95rem; font-weight: 600; color: var(--text-dark); }
9
+        .menu-item:last-child { border-bottom: none; }
10
+        .menu-item:active { background-color: #f9f9f9; }
11
+        .menu-icon { width: 24px; height: 24px; margin-right: 16px; color: var(--primary-color); display: flex; justify-content: center; align-items: center; }
12
+        .menu-icon svg { width: 100%; height: 100%; display: block; }
13
+        .chevron { margin-left: auto; color: var(--primary-color); width: 18px; height: 18px; }
14
+    `;
15
+    _handleItemClick(item) { this.dispatchEvent(new CustomEvent('item-click', { detail: { action: item.action, label: item.label }, bubbles: true, composed: true })); }
16
+    render() {
17
+        if (!this.items || this.items.length === 0) return html``;
18
+        return html`<div class="menu-group">${this.items.map(item => html`<div class="menu-item" @click="${() => this._handleItemClick(item)}"><div class="menu-icon"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">${item.icon}</svg></div><span>${item.label}</span><svg class="chevron" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M9 18l6-6-6-6"/></svg></div>`)}</div>`;
19
+    }
20
+}
21
+customElements.define('winzer-menu-group', WinzerMenuGroup);