<!--
    Component: IconButton
    Convenience wrapper — defaults variant to 'icon' and enforces icon-only usage.
    Identical to <Button variant="icon"> but makes intent explicit at the
    call site and prevents accidental children being passed.
-->
<script lang="ts">
import type { ComponentProps } from 'svelte';
import Button from './Button.svelte';
import type { ButtonVariant } from './types';

type BaseProps = Exclude<ComponentProps<typeof Button>, 'children' | 'iconPosition'>;

interface Props extends BaseProps {
    /**
     * Visual variant
     * @default 'icon'
     */
    variant?: Extract<ButtonVariant, 'icon' | 'ghost' | 'secondary'>;
}

let {
    variant = 'icon',
    size = 'md',
    icon,
    active = false,
    animate = true,
    class: className,
    ...rest
}: Props = $props();
</script>

<Button
    {variant}
    {size}
    {icon}
    {active}
    {animate}
    class={className}
    {...rest}
/>
