2024-12-23 09:59:12 +01:00
|
|
|
<script lang="ts">
|
2025-01-19 15:41:16 +01:00
|
|
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
|
|
|
import { type Variant, alertVariants } from './index.js';
|
|
|
|
|
import { cn } from '$lib/utils/style.js';
|
2024-12-23 09:59:12 +01:00
|
|
|
|
|
|
|
|
type $$Props = HTMLAttributes<HTMLDivElement> & {
|
|
|
|
|
variant?: Variant;
|
|
|
|
|
};
|
|
|
|
|
|
2025-01-19 15:41:16 +01:00
|
|
|
let className: $$Props['class'] = undefined;
|
|
|
|
|
export let variant: $$Props['variant'] = 'default';
|
2024-12-23 09:59:12 +01:00
|
|
|
export { className as class };
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<div class={cn(alertVariants({ variant }), className)} {...$$restProps} role="alert">
|
|
|
|
|
<slot />
|
|
|
|
|
</div>
|