From a9072370ca1eb9a5cce928b1d487db0f307edea6 Mon Sep 17 00:00:00 2001
From: ivarlovlie <git@ivarlovlie.no>
Date: Tue, 20 Sep 2022 15:24:27 +0800
Subject: feat: Move old apps into it's own directory

---
 .../web-shared/src/components/user-menu.svelte     | 99 ++++++++++++++++++++++
 1 file changed, 99 insertions(+)
 create mode 100644 old-apps/web-shared/src/components/user-menu.svelte

(limited to 'old-apps/web-shared/src/components/user-menu.svelte')

diff --git a/old-apps/web-shared/src/components/user-menu.svelte b/old-apps/web-shared/src/components/user-menu.svelte
new file mode 100644
index 0000000..c0195f4
--- /dev/null
+++ b/old-apps/web-shared/src/components/user-menu.svelte
@@ -0,0 +1,99 @@
+<script>
+	import {onMount} from "svelte";
+	import {Menu, MenuItem, MenuItemSeparator} from "./menu";
+
+	let userMenuTrigger;
+	let showUserMenu = false;
+	
+	export let avatar = "";
+	export let name;
+	export let secondary = "";
+	let userMenuId;
+	
+	onMount(() => {
+		userMenuTrigger = document.getElementById("open-user-menu");
+	});
+</script>
+
+<button class="reset user-menu-control"
+        id="open-user-menu"
+        aria-controls="{userMenuId}"
+        on:click={() => showUserMenu = true}>
+    {#if avatar}
+        <figure class="user-menu-control__img-wrapper radius-50%">
+            <img class="user-menu-control__img"
+                 src="{avatar}"
+                 alt="User picture">
+        </figure>
+    {/if}
+
+    <div class="margin-x-xs user-menu__meta">
+        <p class="user-menu__meta-title text-sm line-height-1 padding-y-xxxxs font-semibold color-contrast-higher text-truncate">{name}</p>
+        {#if secondary}
+            <p class="text-xs color-contrast-medium line-height-1 padding-bottom-xxxxs">{secondary}</p>
+        {/if}
+    </div>
+
+    <svg class="icon icon--xxs"
+         aria-hidden="true"
+         viewBox="0 0 12 12">
+        <polyline points="1 4 6 9 11 4"
+                  fill="none"
+                  stroke="currentColor"
+                  stroke-linecap="round"
+                  stroke-linejoin="round"
+                  stroke-width="2"/>
+    </svg>
+</button>
+
+<Menu trigger={userMenuTrigger}
+      bind:id={userMenuId}
+      bind:show="{showUserMenu}">
+    <div slot="options">
+        <MenuItem>
+            <svg class="icon menu__icon"
+                 aria-hidden="true"
+                 viewBox="0 0 16 16">
+                <circle cx="8"
+                        cy="3.5"
+                        r="3.5"/>
+                <path d="M14.747,14.15a6.995,6.995,0,0,0-13.494,0A1.428,1.428,0,0,0,1.5,15.4a1.531,1.531,0,0,0,1.209.6H13.288a1.531,1.531,0,0,0,1.209-.6A1.428,1.428,0,0,0,14.747,14.15Z"/>
+            </svg>
+            <span>Profile</span>
+
+        </MenuItem>
+
+        <MenuItem>
+            <svg class="icon menu__icon"
+                 aria-hidden="true"
+                 viewBox="0 0 16 16">
+                <g fill="currentColor">
+                    <path d="M15.135,6.784c-1.303-0.326-1.921-1.818-1.23-2.969c0.322-0.536,0.225-0.998-0.094-1.316l-0.31-0.31 c-0.318-0.318-0.78-0.415-1.316-0.094c-1.152,0.691-2.644,0.073-2.969-1.23C9.065,0.258,8.669,0,8.219,0H7.781 c-0.45,0-0.845,0.258-0.997,0.865c-0.326,1.303-1.818,1.921-2.969,1.23C3.279,1.773,2.816,1.87,2.498,2.188l-0.31,0.31 C1.87,2.816,1.773,3.279,2.095,3.815c0.691,1.152,0.073,2.644-1.23,2.969C0.26,6.935,0,7.33,0,7.781v0.438 c0,0.45,0.258,0.845,0.865,0.997c1.303,0.326,1.921,1.818,1.23,2.969c-0.322,0.536-0.225,0.998,0.094,1.316l0.31,0.31 c0.319,0.319,0.782,0.415,1.316,0.094c1.152-0.691,2.644-0.073,2.969,1.23C6.935,15.742,7.331,16,7.781,16h0.438 c0.45,0,0.845-0.258,0.997-0.865c0.326-1.303,1.818-1.921,2.969-1.23c0.535,0.321,0.997,0.225,1.316-0.094l0.31-0.31 c0.318-0.318,0.415-0.78,0.094-1.316c-0.691-1.152-0.073-2.644,1.23-2.969C15.742,9.065,16,8.669,16,8.219V7.781 C16,7.33,15.74,6.935,15.135,6.784z M8,11c-1.657,0-3-1.343-3-3s1.343-3,3-3s3,1.343,3,3S9.657,11,8,11z"></path>
+                </g>
+            </svg>
+            <span>Settings</span>
+        </MenuItem>
+
+        <MenuItem>
+            <svg class="icon menu__icon"
+                 aria-hidden="true"
+                 viewBox="0 0 16 16">
+                <circle cx="10.5"
+                        cy="2.5"
+                        r="2.5"/>
+                <circle cx="5.5"
+                        cy="6.5"
+                        r="2.5"/>
+                <path d="M15.826,10.124A5.455,5.455,0,0,0,9.46,6.107,3.932,3.932,0,0,1,9.5,6.5,3.97,3.97,0,0,1,8.452,9.176,6.963,6.963,0,0,1,11.539,12h2.829a1.5,1.5,0,0,0,1.458-1.876Z"/>
+                <path d="M10.826,14.124a5.5,5.5,0,0,0-10.652,0A1.5,1.5,0,0,0,1.632,16H9.368a1.5,1.5,0,0,0,1.458-1.876Z"/>
+            </svg>
+            <span>Team</span>
+        </MenuItem>
+
+        <MenuItemSeparator/>
+
+        <MenuItem danger="true" on:click={() => logout_user()}>
+            Logout
+        </MenuItem>
+    </div>
+</Menu>
-- 
cgit v1.3

