finish custom class and improved options overhaul

This commit is contained in:
Elijah Duffy
2025-07-03 14:45:23 -07:00
parent c54002f5fa
commit 02311a0e7b
16 changed files with 170 additions and 131 deletions

View File

@@ -1,20 +1,24 @@
<script lang="ts">
import type { Snippet } from 'svelte';
import type { MouseEventHandler } from 'svelte/elements';
import type { ClassValue, MouseEventHandler } from 'svelte/elements';
interface Props {
icon?: string;
iconPosition?: 'left' | 'right';
disabled?: boolean;
class?: ClassValue | null | undefined;
children: Snippet;
onclick?: MouseEventHandler<HTMLButtonElement>;
}
let {
icon,
iconPosition = 'right',
disabled = false,
class: classValue,
children,
onclick
}: {
icon?: string;
iconPosition?: 'left' | 'right';
disabled?: boolean;
children: Snippet;
onclick?: MouseEventHandler<HTMLButtonElement>;
} = $props();
}: Props = $props();
</script>
{#snippet iconSnippet()}
@@ -24,7 +28,8 @@
<button
class={[
'text-accent hover:text-primary inline-flex cursor-pointer items-center gap-1.5 transition-colors',
disabled && 'pointer-events-none cursor-not-allowed opacity-50'
disabled && 'pointer-events-none cursor-not-allowed opacity-50',
classValue
]}
{onclick}
>