From 57861411f37a07af3cd8fcf1520843e5a5e44bfc Mon Sep 17 00:00:00 2001
From: ivar <i@oiee.no>
Date: Wed, 10 Dec 2025 00:17:27 +0100
Subject: Initial commit

---
 app/src/lib/ui/button.svelte | 41 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)
 create mode 100644 app/src/lib/ui/button.svelte

(limited to 'app/src/lib/ui/button.svelte')

diff --git a/app/src/lib/ui/button.svelte b/app/src/lib/ui/button.svelte
new file mode 100644
index 0000000..313cd90
--- /dev/null
+++ b/app/src/lib/ui/button.svelte
@@ -0,0 +1,41 @@
+<script lang="ts">
+    import type { HTMLButtonAttributes } from "svelte/elements";
+    import { Spinner } from "phosphor-svelte";
+    let { children, loading, type = "button", ...restProps }: Props = $props();
+
+    type Props = {
+        loading?: boolean;
+    } & HTMLButtonAttributes;
+</script>
+
+<button {...restProps} {type}>
+    {@render children?.()}
+    {#if loading}
+        <Spinner />
+    {/if}
+</button>
+
+<style>
+    button {
+        border: 1px solid rgba(0, 0, 0, 0.3);
+        background-color: rgba(0, 0, 0, 0.1);
+        align-items: center;
+        border-radius: 3px;
+        padding: 2px 4px;
+        cursor: pointer;
+        display: flex;
+        gap: 3px;
+        transition: 0.1s all ease;
+
+        &:hover,
+        &:focus {
+            background-color: rgba(0, 0, 0, 0.15);
+        }
+
+        &:active {
+            background-color: rgba(0, 0, 0, 0.2);
+            transform: scale(0.96);
+            transition: 0.2s all ease;
+        }
+    }
+</style>
-- 
cgit v1.3

