feat: add interfaces for secondary menu items with various types and functionalities
This commit is contained in:
@@ -57,6 +57,16 @@ export class DeesAppuiBar extends DeesElement {
|
||||
@property({ type: Boolean })
|
||||
accessor showSearch: boolean = false;
|
||||
|
||||
// Activity log toggle
|
||||
@property({ type: Boolean })
|
||||
accessor showActivityLogToggle: boolean = false;
|
||||
|
||||
@property({ type: Number })
|
||||
accessor activityLogCount: number = 0;
|
||||
|
||||
@property({ type: Boolean })
|
||||
accessor activityLogActive: boolean = false;
|
||||
|
||||
// STATE
|
||||
@state()
|
||||
accessor activeMenu: string | null = null;
|
||||
@@ -177,8 +187,8 @@ export class DeesAppuiBar extends DeesElement {
|
||||
public renderAccountSection(): TemplateResult {
|
||||
return html`
|
||||
${this.showSearch ? html`
|
||||
<dees-icon
|
||||
class="search-icon"
|
||||
<dees-icon
|
||||
class="search-icon"
|
||||
.icon=${'lucide:search'}
|
||||
@click=${this.handleSearchClick}
|
||||
></dees-icon>
|
||||
@@ -206,6 +216,18 @@ export class DeesAppuiBar extends DeesElement {
|
||||
></dees-appui-profiledropdown>
|
||||
</div>
|
||||
` : ''}
|
||||
${this.showActivityLogToggle ? html`
|
||||
<div
|
||||
class="activity-toggle ${this.activityLogActive ? 'active' : ''}"
|
||||
@click=${this.handleActivityToggle}
|
||||
title="Activity Log"
|
||||
>
|
||||
<dees-icon .icon=${'lucide:activity'}></dees-icon>
|
||||
${this.activityLogCount > 0 ? html`
|
||||
<span class="activity-badge">${this.activityLogCount > 99 ? '99+' : this.activityLogCount}</span>
|
||||
` : ''}
|
||||
</div>
|
||||
` : ''}
|
||||
`;
|
||||
}
|
||||
|
||||
@@ -304,9 +326,16 @@ export class DeesAppuiBar extends DeesElement {
|
||||
}
|
||||
|
||||
private handleSearchClick() {
|
||||
this.dispatchEvent(new CustomEvent('search-click', {
|
||||
this.dispatchEvent(new CustomEvent('search-click', {
|
||||
bubbles: true,
|
||||
composed: true
|
||||
composed: true
|
||||
}));
|
||||
}
|
||||
|
||||
private handleActivityToggle() {
|
||||
this.dispatchEvent(new CustomEvent('activity-toggle', {
|
||||
bubbles: true,
|
||||
composed: true
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ export const appuiAppbarStyles = [
|
||||
color: ${cssManager.bdTheme('#00000080', '#ffffff80')};
|
||||
font-size: var(--appbar-font-size);
|
||||
display: grid;
|
||||
grid-template-columns: ${cssManager.cssGridColumns(3, 20)};
|
||||
grid-template-columns: auto 1fr auto;
|
||||
-webkit-app-region: drag;
|
||||
user-select: none;
|
||||
}
|
||||
@@ -233,6 +233,54 @@ export const appuiAppbarStyles = [
|
||||
.user-status.away {
|
||||
background: #ff9800;
|
||||
}
|
||||
|
||||
/* Activity log toggle button */
|
||||
.activity-toggle {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 2px;
|
||||
height: 28px;
|
||||
padding: 0 8px;
|
||||
border-radius: 6px;
|
||||
cursor: default;
|
||||
-webkit-app-region: no-drag;
|
||||
color: ${cssManager.bdTheme('#00000060', '#ffffff60')};
|
||||
border: 1px solid ${cssManager.bdTheme('rgba(0, 0, 0, 0.1)', 'rgba(255, 255, 255, 0.1)')};
|
||||
transition: all 0.15s ease;
|
||||
}
|
||||
|
||||
.activity-toggle:hover {
|
||||
background: ${cssManager.bdTheme('#00000010', '#ffffff15')};
|
||||
color: ${cssManager.bdTheme('#000000', '#ffffff')};
|
||||
border-color: transparent;
|
||||
}
|
||||
|
||||
.activity-toggle.active {
|
||||
background: ${cssManager.bdTheme('#00000015', '#ffffff20')};
|
||||
color: ${cssManager.bdTheme('#000000', '#ffffff')};
|
||||
border-color: transparent;
|
||||
}
|
||||
|
||||
.activity-toggle dees-icon {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.activity-badge {
|
||||
position: relative;
|
||||
margin-left: 4px;
|
||||
min-width: 16px;
|
||||
height: 16px;
|
||||
padding: 0 4px;
|
||||
background: ${cssManager.bdTheme('#525252', '#525252')};
|
||||
color: #fafafa;
|
||||
font-size: 10px;
|
||||
font-weight: 600;
|
||||
border-radius: 8px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
line-height: 1;
|
||||
}
|
||||
`,
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user