Files
pocket-id/frontend/src/lib/components/ui/alert/alert.svelte

18 lines
500 B
Svelte
Raw Normal View History

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>