From 9a11e0f4a38297006b89cc7bb2a60734111582e0 Mon Sep 17 00:00:00 2001
From: Leonardo Bishop <me@leonardobishop.com>
Date: Sun, 10 Mar 2024 00:13:25 +0000
Subject: Migrate to nuxt

---
 components/Control/Button.vue | 82 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 82 insertions(+)
 create mode 100644 components/Control/Button.vue

(limited to 'components/Control/Button.vue')

diff --git a/components/Control/Button.vue b/components/Control/Button.vue
new file mode 100644
index 0000000..efd91c2
--- /dev/null
+++ b/components/Control/Button.vue
@@ -0,0 +1,82 @@
+<script setup lang="ts">
+const props = defineProps({
+  type: {
+    type: String,
+    required: false,    
+    default: 'text',
+  },
+  label: String,
+  icon: Array<String>,
+  disabled: Boolean,
+});
+
+const emit = defineEmits(['click']);
+
+const onClick = (event: MouseEvent) => {
+  if (!props.disabled) {
+    emit('click', event);
+  }
+};
+</script>
+
+<template>
+  <a id="button" :class="{text: type === 'text', solid: type === 'solid', disabled: disabled}" @click.stop="onClick">
+    <font-awesome-icon :icon="icon" />
+    {{ label }}
+  </a>
+</template>
+
+<style scoped>
+#button {
+  display: flex;
+  align-items: center;
+  gap: 0.25rem;
+  user-select: none;
+}
+    
+.text {
+  background-color: transparent;
+  color: var(--color-text-primary);
+  transition: color 0.3s;
+  font-weight: 700;
+  cursor: pointer;
+  
+  &.disabled {
+    color: var(--color-text-mute);
+    cursor: not-allowed;
+  }
+  
+  &:hover {
+    color: var(--color-primary-dark);
+  }
+  
+  &.disabled:hover {
+    color: var(--color-text-mute);
+  }
+}
+
+.solid {
+  background-color: var(--color-primary);
+  transition: background-color 0.3s;
+  color: var(--color-text);
+  padding: 0.25rem 0.5rem;
+  border-radius: 4px;
+  font-weight: 700;
+  cursor: pointer;
+  
+  &.disabled {
+    background-color: var(--color-border);
+    color: var(--color-text-mute);
+    cursor: not-allowed;
+  }
+  
+  &:hover {
+    background-color: var(--color-primary-dark);
+  }
+  
+  &.disabled:hover {
+    background-color: var(--color-border);
+  }
+}
+
+</style>
\ No newline at end of file
-- 
cgit v1.2.3-70-g09d2

