mirror of
https://github.com/kmc7468/arkvault.git
synced 2025-12-16 06:58:46 +00:00
Button 및 Input 컴포넌트를 atoms 디렉터리로 이동 및 리팩토링
This commit is contained in:
28
src/lib/components/atoms/buttons/EntryButton.svelte
Normal file
28
src/lib/components/atoms/buttons/EntryButton.svelte
Normal file
@@ -0,0 +1,28 @@
|
||||
<script lang="ts">
|
||||
import type { Snippet } from "svelte";
|
||||
import type { ClassValue } from "svelte/elements";
|
||||
|
||||
import IconChevronRight from "~icons/material-symbols/chevron-right";
|
||||
|
||||
interface Props {
|
||||
children?: Snippet;
|
||||
class?: ClassValue;
|
||||
onclick?: () => void;
|
||||
}
|
||||
|
||||
let { children, onclick, ...props }: Props = $props();
|
||||
</script>
|
||||
|
||||
<button
|
||||
onclick={onclick && (() => setTimeout(onclick, 100))}
|
||||
class={["rounded-xl active:bg-gray-100", props.class]}
|
||||
>
|
||||
<div class="flex h-full p-2 transition active:scale-95">
|
||||
<div class="flex-grow">
|
||||
{@render children?.()}
|
||||
</div>
|
||||
<div class="flex flex-shrink-0 items-center">
|
||||
<IconChevronRight class="text-xl text-gray-800" />
|
||||
</div>
|
||||
</div>
|
||||
</button>
|
||||
Reference in New Issue
Block a user