SchwarzIT / onyx

🚀 A design system and Vue.js component library created by Schwarz IT
https://onyx.schwarz
Apache License 2.0
40 stars 4 forks source link

Implement OnyxFlyoutMenu #883

Open MajaZarkova opened 2 months ago

MajaZarkova commented 2 months ago

Open Questions/To-dos

Why?

This component is needed and will be used inside the NavMenuItem. This is just a support component. It's responsible for handling keyboard navigation, rendering and opening of the flyout.

Image

Design

Figma Link (Context Area section)

Acceptance criteria

Definition of Done

Approval

Reference implementations

CoreUI Reference

Image

ARIA

https://www.w3.org/WAI/ARIA/apg/patterns/menubar/examples/menubar-navigation/ https://www.w3.org/WAI/ARIA/apg/patterns/menu-button/ https://www.w3.org/WAI/ARIA/apg/patterns/disclosure/examples/disclosure-navigation/ https://www.w3.org/WAI/ARIA/apg/patterns/menubar/

larsrickert commented 1 month ago

As discussed, this would be our prefered API for the nav bar:

<template>
  <OnyxNavBar>
    <OnyxNavButton>
      Item 1
      <OnyxBadge dot />
    </OnyxNavButton>

    <OnyxNavButton>
      Item 2

      <template #children>
        <OnyxNavItem> I am child 1 </OnyxNavItem>
        <OnyxNavItem> I am child 2 </OnyxNavItem>
        <OnyxNavItem> I am child 3 </OnyxNavItem>
      </template>
    </OnyxNavButton>

    <OnyxUserMenu>
      <OnyxListItem @click="handleLogout">
        <OnyxIcon />
        Logout
      </OnyxListItem>

      <OnyxListItem @click="router.push('/settings')"> Settings </OnyxListItem>
    </OnyxUserMenu>
  </OnyxNavBar>
</template>