diff --git a/src/lib/components/Alert/Alert.svelte b/src/lib/components/Alert/Alert.svelte index 9edc71a..286d694 100644 --- a/src/lib/components/Alert/Alert.svelte +++ b/src/lib/components/Alert/Alert.svelte @@ -4,7 +4,7 @@ import Icon from '$lib/components/Icon/Icon.svelte'; import Text from '$lib/components/Text/Text.svelte'; import CloseButton from '$lib/components/CloseButton/CloseButton.svelte'; - import type { Color } from '$lib/types.js'; + import type { Color, Size } from '$lib/types.js'; import { cleanClass } from '$lib/utils.js'; import { mdiAlertOutline, @@ -16,6 +16,7 @@ type Props = { color?: Color; + size?: Size; icon?: string | false; title?: string; class?: string; @@ -29,6 +30,7 @@ const { color = 'primary', icon: iconOverride, + size = 'large', title, class: className, duration, @@ -40,6 +42,14 @@ let open = $state(true); + const iconSizes: Record = { + tiny: '1em', + small: '1.25em', + medium: '1.5em', + large: '1.75em', + giant: '1.85em', + }; + const handleClose = () => { if (!open) { return; @@ -74,13 +84,13 @@
{#if icon}
- +
{/if}
{#if title} - {title} + {title} {/if} {#if children} {@render children()} diff --git a/src/routes/components/alert/BasicExample.svelte b/src/routes/components/alert/BasicExample.svelte index 55511d0..7f4b6fe 100644 --- a/src/routes/components/alert/BasicExample.svelte +++ b/src/routes/components/alert/BasicExample.svelte @@ -4,9 +4,9 @@ - - - - - + + + + +