diff --git a/hexawebshare/src/components/admin/layout/AdminTopbar.stories.svelte b/hexawebshare/src/components/admin/layout/AdminTopbar.stories.svelte new file mode 100644 index 0000000..6b9f1e1 --- /dev/null +++ b/hexawebshare/src/components/admin/layout/AdminTopbar.stories.svelte @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/hexawebshare/src/components/admin/layout/AdminTopbar.svelte b/hexawebshare/src/components/admin/layout/AdminTopbar.svelte index 315da07..5145ad7 100644 --- a/hexawebshare/src/components/admin/layout/AdminTopbar.svelte +++ b/hexawebshare/src/components/admin/layout/AdminTopbar.svelte @@ -2,3 +2,284 @@ SPDX-FileCopyrightText: 2025 hexaTune LLC SPDX-License-Identifier: MIT --> + + + + + {#if isMobileSearchOpen} + + + { + onSearch?.(q); + if (q) isMobileSearchOpen = false; + }} + /> + + + {:else} + + + + + + + + + + + + + + {#if onSearch} + + {/if} + + + + + + + {#if onSearch} + + (isMobileSearchOpen = true)} + > + + + + + + + + {/if} + + + {#if notifications.length > 0} + + {#snippet trigger()} +
+ + + + + + {#if unreadCount > 0} + + {/if} +
+ {/snippet} + + {#snippet children()} + + {/snippet} + + {:else} + console.log('No notifications')} + > + + + + + + + {/if} + + + {#if isLoggedIn} + + {#snippet trigger()} + + {/snippet} + + + + {:else} + @@ -538,3 +530,20 @@ SPDX-License-Identifier: MIT {/if} + + diff --git a/hexawebshare/src/components/core/overlay-navigation/Menu.svelte b/hexawebshare/src/components/core/overlay-navigation/Menu.svelte index ba91d9d..5f517e6 100644 --- a/hexawebshare/src/components/core/overlay-navigation/Menu.svelte +++ b/hexawebshare/src/components/core/overlay-navigation/Menu.svelte @@ -18,7 +18,7 @@ SPDX-License-Identifier: MIT /** * Label text displayed in the menu item */ - label: string; + label?: string; /** * Optional description or subtitle */ @@ -32,6 +32,15 @@ SPDX-License-Identifier: MIT * @default false */ disabled?: boolean; + /** + * Type of the menu item + * @default 'item' + */ + type?: 'item' | 'title' | 'divider'; + /** + * Visual variant of the item + */ + variant?: 'default' | 'error'; /** * Whether the item is active/selected * @default false @@ -142,7 +151,13 @@ SPDX-License-Identifier: MIT // Compute item classes based on state const getItemClasses = (item: MenuItem, index: number) => - [item.active && 'active', item.disabled && 'disabled', focusedIndex === index && 'focus'] + [ + item.type === 'title' && 'menu-title', + item.active && 'active', + item.disabled && 'disabled', + item.variant === 'error' && 'text-error', + focusedIndex === index && 'focus' + ] .filter(Boolean) .join(' '); @@ -278,56 +293,72 @@ SPDX-License-Identifier: MIT VALIDATION: WAI-ARIA Authoring Practices Guide + DaisyUI v4.x menu documentation --> {#each items as item, index (item.id)} -
  • - {#if item.href && !item.disabled} - handleItemClick(item, index)} - onkeydown={(e) => handleKeyDown(e, item, index)} - onfocus={() => handleFocus(index)} - onblur={handleBlur} - > - {#if item.icon} - - {/if} - - - {#if item.description} - + {#if item.type === 'title'} +
  • + +
  • + {:else if item.type === 'divider'} + + {:else} +
  • + {#if item.href && !item.disabled} + handleItemClick(item, index)} + onkeydown={(e) => handleKeyDown(e, item, index)} + onfocus={() => handleFocus(index)} + onblur={handleBlur} + > + {#if item.icon} + {/if} - - - {:else} - - {/if} -
  • + + + {#if item.description} + + {/if} + + + {/if} + + {/if} {#if item.divider && index < items.length - 1} - + {/if} {/each} {/if}