// Toast — eidos compound API, disciplined option C. // // Two distinct roots, NOT one wrapping the other: // // - `` — manual compound. Wraps Soma's Provider; consumer // iterates `toaster.toasts` themselves. Children attached explicitly: // Viewport, Item, Status, Main, Title, Description, // Action, Close. // // - `` — imperative auto-mount. Renders the entire // Provider+Viewport+Item loop with a default card template. Pass a // `toaster` from `createToaster()`. Lives at the same import level // as `Toast`, exported separately because it's a competing root — // not a child of `Toast`. // // import { Toast, Toaster, createToaster } from '$uix/eidos/components/toast'; // // const t = createToaster(); // // // Imperative form: // // // // Manual compound form: // // // {#each t.toasts as toast} // // // // {toast.title} // {toast.description} // // // // {/each} // // import ToastComponent from './toast.svelte'; import Viewport from './toast-viewport.svelte'; import Item from './toast-item.svelte'; import Status from './toast-status.svelte'; import Main from './toast-main.svelte'; import Title from './toast-title.svelte'; import Description from './toast-description.svelte'; import Action from './toast-action.svelte'; import Close from './toast-close.svelte'; type ToastNamespace = typeof ToastComponent & { Viewport: typeof Viewport; Item: typeof Item; Status: typeof Status; Main: typeof Main; Title: typeof Title; Description: typeof Description; Action: typeof Action; Close: typeof Close; }; const Toast = ToastComponent as ToastNamespace; Toast.Viewport = Viewport; Toast.Item = Item; Toast.Status = Status; Toast.Main = Main; Toast.Title = Title; Toast.Description = Description; Toast.Action = Action; Toast.Close = Close; export { Toast }; export default Toast; // Imperative auto-mount (separate root — not attached to Toast). export { default as Toaster } from './toaster.svelte'; // Re-export Soma's imperative API so consumers don't reach into headless directly. export { createToaster, type ToastData, type CreateToastOpts, type PromiseToastOpts, type ToasterConfig, type SwipeDirection } from '$soma/components/toast'; export type { ToasterProps, ToastProps, ToastViewportProps as ViewportProps, ToastItemProps as ItemProps, ToastStatusProps as StatusProps, ToastMainProps as MainProps, ToastTitleProps as TitleProps, ToastDescriptionProps as DescriptionProps, ToastActionProps as ActionProps, ToastCloseProps as CloseProps, ToastPosition } from './types';