Open gfellerph opened 1 month ago
Rewrite the KLP Login Widget as a web component.
<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>
post-klp
post-klp-login
post-klp-profile
post-menu
role=menu
post-menu-item
role=menuitem
### Tasks - [ ] https://github.com/swisspost/design-system/issues/1242
Props:
Slots:
Texts:
Rewrite the KLP Login Widget as a web component.
Requirements
Proposed structure
post-klp
: Wrapper, discuss naming, sends auth request, hosts API, offers slots for logged in and logged out content, global props as settingspost-klp-login
: Named link (for automatic slot placement and icon)post-klp-profile
: Named wrapper for automatic slot placementpost-menu
: Menu wrapper, hasrole=menu
(https://github.com/swisspost/design-system/discussions/1888)post-menu-item
: Item, hasrole=menuitem