mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 10:21:05 +00:00
parent
422ac528a7
commit
94dceae1fb
11 changed files with 309 additions and 2 deletions
21
src/components/Notification/NotificationIcon.svelte
Normal file
21
src/components/Notification/NotificationIcon.svelte
Normal file
|
@ -0,0 +1,21 @@
|
|||
<script>
|
||||
export let kind = 'error';
|
||||
export let notificationType = 'toast';
|
||||
export let iconDescription = 'closes notification';
|
||||
|
||||
import ErrorFilled20 from 'carbon-icons-svelte/lib/ErrorFilled20';
|
||||
import CheckmarkFilled20 from 'carbon-icons-svelte/lib/CheckmarkFilled20';
|
||||
import WarningFilled20 from 'carbon-icons-svelte/lib/WarningFilled20';
|
||||
import { cx } from '../../lib';
|
||||
|
||||
const icons = {
|
||||
error: ErrorFilled20,
|
||||
success: CheckmarkFilled20,
|
||||
warning: WarningFilled20
|
||||
};
|
||||
</script>
|
||||
|
||||
<svelte:component
|
||||
this={icons[kind]}
|
||||
class={cx(`--${notificationType}-notification__icon`)}
|
||||
title={iconDescription} />
|
Loading…
Add table
Add a link
Reference in a new issue