You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
981 B
32 lines
981 B
<script lang="ts">
|
|
import './toast.css';
|
|
/**
|
|
* Eidos `<Toast>` — root component. Wraps Soma's `<Toast.Provider>`
|
|
* to set up the toaster context for descendants (Viewport, Item, …).
|
|
*
|
|
* <Toast {toaster}>
|
|
* <Toast.Viewport>
|
|
* {#each toaster.toasts as t}
|
|
* <Toast.Item toast={t}>
|
|
* <Toast.Title>{t.title}</Toast.Title>
|
|
* <Toast.Description>{t.description}</Toast.Description>
|
|
* <Toast.Close />
|
|
* </Toast.Item>
|
|
* {/each}
|
|
* </Toast.Viewport>
|
|
* </Toast>
|
|
*
|
|
* For the auto-mount ergonomic shape, see `<Toaster />` (separate
|
|
* export — not attached as `Toast.<>` because it's a competing root,
|
|
* not a child).
|
|
*/
|
|
import * as Toast from '$soma/components/toast';
|
|
import type { ToastProps } from './types';
|
|
|
|
let { toaster, label, children, ...rest }: ToastProps = $props();
|
|
</script>
|
|
|
|
<Toast.Provider {toaster} {label} {...rest}>
|
|
{@render children?.()}
|
|
</Toast.Provider>
|