feat(component): add Notification

Closes #20
This commit is contained in:
Eric Liu 2019-12-20 18:56:56 -08:00
commit 94dceae1fb
11 changed files with 309 additions and 2 deletions

View file

@ -0,0 +1,25 @@
<script>
export let title = 'title';
export let subtitle = '';
export let caption = 'caption';
export let notificationType = 'toast';
import { cx } from '../../lib';
</script>
{#if notificationType === 'toast'}
<div class={cx('--toast-notification__details')}>
<h3 class={cx('--toast-notification__title')}>{title}</h3>
<div class={cx('--toast-notification__subtitle')}>{subtitle}</div>
<div class={cx('--toast-notification__caption')}>{caption}</div>
<slot />
</div>
{/if}
{#if notificationType === 'inline'}
<div class={cx('--inline-notification__text-wrapper')}>
<p class={cx('--inline-notification__title')}>{title}</p>
<div class={cx('--inline-notification__subtitle')}>{subtitle}</div>
<slot />
</div>
{/if}