From b7e39b59fd0fc7b5610ebff29035bf622079e0d8 Mon Sep 17 00:00:00 2001
From: ivarlovlie <git@ivarlovlie.no>
Date: Wed, 5 Oct 2022 20:45:21 +0800
Subject: refactor: Change file structure

---
 apps/kit/src/lib/components/button.svelte | 103 ------------------------------
 1 file changed, 103 deletions(-)
 delete mode 100644 apps/kit/src/lib/components/button.svelte

(limited to 'apps/kit/src/lib/components/button.svelte')

diff --git a/apps/kit/src/lib/components/button.svelte b/apps/kit/src/lib/components/button.svelte
deleted file mode 100644
index cbc09e2..0000000
--- a/apps/kit/src/lib/components/button.svelte
+++ /dev/null
@@ -1,103 +0,0 @@
-<script context="module" lang="ts">
-    export type ButtonKind = "primary" | "secondary" | "white";
-    export type ButtonSize = "sm" | "lg" | "md" | "xl";
-</script>
-
-<script lang="ts">
-    import pwKey from "$actions/pwKey";
-
-    import { SpinnerIcon } from "./icons";
-
-    export let kind = "primary" as ButtonKind;
-    export let size = "md" as ButtonSize;
-    export let type: "button" | "submit" | "reset" = "button";
-    export let id: string | undefined = undefined;
-    export let tabindex: string | undefined = undefined;
-    export let style: string | undefined = undefined;
-    export let title: string | undefined = undefined;
-    export let disabled: boolean | null = false;
-    export let href: string | undefined = undefined;
-    export let text: string;
-    export let loading = false;
-    export let fullWidth = false;
-    export let _pwKey: string | undefined = undefined;
-
-    let sizeClasses = "";
-    let kindClasses = "";
-    let spinnerTextClasses = "";
-    let spinnerMarginClasses = "";
-
-    $: shared_props = {
-        type: type,
-        id: id || null,
-        title: title || null,
-        disabled: disabled || loading || null,
-        tabindex: tabindex || null,
-        style: style || null,
-    } as any;
-
-    $: switch (size) {
-        case "sm":
-            sizeClasses = "px-2.5 py-1.5 text-xs";
-            spinnerMarginClasses = "mr-2";
-            break;
-        case "md":
-            sizeClasses = "px-3 py-2 text-sm";
-            spinnerMarginClasses = "mr-2";
-            break;
-        case "lg":
-            sizeClasses = "px-3 py-2 text-lg";
-            spinnerMarginClasses = "mr-2";
-            break;
-        case "xl":
-            sizeClasses = "px-6 py-3 text-xl";
-            spinnerMarginClasses = "mr-2";
-            break;
-    }
-
-    $: switch (kind) {
-        case "secondary":
-            kindClasses = "border-transparent text-teal-800 bg-teal-100 hover:bg-teal-200 focus:ring-teal-500";
-            spinnerTextClasses = "teal-800";
-            break;
-        case "primary":
-            kindClasses = "border-transparent text-teal-900 bg-teal-300 hover:bg-teal-400 focus:ring-teal-500";
-            spinnerTextClasses = "text-teal-900";
-            break;
-        case "white":
-            kindClasses = "border-gray-300 text-gray-700 bg-white hover:bg-gray-50 focus:ring-gray-400";
-            spinnerTextClasses = "text-gray-700";
-            break;
-    }
-</script>
-
-{#if href}
-    <a
-        use:pwKey={_pwKey}
-        {...shared_props}
-        {href}
-        class="{sizeClasses} {kindClasses} {loading ? 'disabled:' : ''} {$$restProps.class ?? ''} {fullWidth
-            ? 'w-full justify-center'
-            : ''} inline-flex items-center border font-medium rounded shadow-sm focus:outline-none focus:ring-2"
-    >
-        {#if loading}
-            <SpinnerIcon class={spinnerTextClasses + " " + spinnerMarginClasses} />
-        {/if}
-        {text}
-    </a>
-{:else}
-    <button
-        use:pwKey={_pwKey}
-        {...shared_props}
-        on:click
-        class="{sizeClasses} {kindClasses} {$$restProps.class ?? ''}
-        {fullWidth
-            ? 'w-full justify-center'
-            : ''} inline-flex items-center border font-medium rounded shadow-sm focus:outline-none focus:ring-2"
-    >
-        {#if loading}
-            <SpinnerIcon class={spinnerTextClasses + " " + spinnerMarginClasses} />
-        {/if}
-        {text}
-    </button>
-{/if}
-- 
cgit v1.3

