swisspost / design-system

The Swiss Post Design System pattern library for a consistent and accessible user experience across the web platform.
https://design-system.post.ch
Apache License 2.0
120 stars 14 forks source link

[component]: KLP Login Widget #3392

Open gfellerph opened 1 month ago

gfellerph commented 1 month ago

Rewrite the KLP Login Widget as a web component.

Requirements

Proposed structure

<post-klp>
  <!-- Logged out -->
  <post-klp-login login-url="/login">Login</post-klp-login>

  <!-- Logged in -->
  <post-klp-profile>
    <post-menu-trigger for="login-widget">
      <button>
        <post-avatar email="johan@email.com" firstname="Johan" lastname="Johansson"
          >Open User navigation</post-avatar
        >
        <post-badge>10 <span class="visually-hidden">new messages available</span></post-badge>
      </button>
    </post-menu-trigger>
    <post-menu id="login-widget">
      <post-avatar email="johan@email.com" firstname="Johan" lastname="Johansson"></post-avatar>
      <hr />
      <post-menu-item href="">
        <post-icon name="profil"></post-icon>
        Profil
      </post-menu-item>
      <post-menu-item href="">
        <post-icon name="mail"></post-icon>
        Nachrichten
        <post-badge>10 <span class="visually-hidden">new messages</span></post-badge>
      </post-menu-item>
      <post-menu-item href="">
        <post-icon name="settings"></post-icon>
        Einstellungen
      </post-menu-item>
      <post-menu-item href="">
        <post-icon name="switch-accounts"></post-icon>
        Konto wechseln
      </post-menu-item>
      <post-menu-item href="">
        <post-icon name="logout"></post-icon>
        Logout
      </post-menu-item>
    </post-menu>
  </post-klp-profile>
</post-klp>
### Tasks
- [ ] https://github.com/swisspost/design-system/issues/1242
gfellerph commented 3 weeks ago

Props:

Slots:

Texts: