# Toast

```ts
import { Toast } from '@iyulab/components';
```

Programmatically display toast notifications. Creates `u-alert` elements dynamically and mounts them in a toast container.

The message is **text** — it is set as the alert's text content, so an error message from a server or a name typed by
a user cannot inject markup.

## Usage

```ts
// Shorthand methods
Toast.success('File saved.');
Toast.error('Upload failed.', { duration: 5000 });
Toast.warning('Low disk space.', { closable: true });
Toast.info('Update available.');
Toast.notice('New message received.', { position: 'bottom-right' });
Toast.message('Hello!', { title: 'Greetings' });

Toast.DefaultOptions = {
  position: 'bottom-center',
  duration: 3000
};

// Full control
await Toast.show('success', 'Custom message', {
  title: 'Done',
  position: 'top-center',
  duration: 3000,
  appearance: 'outlined',
  closable: true
});
```

## API

| Method | Description |
|--------|-------------|
| `Toast.message(content, options?)` | Plain message (no status icon) |
| `Toast.notice(content, options?)` | Notice toast |
| `Toast.info(content, options?)` | Info toast |
| `Toast.success(content, options?)` | Success toast |
| `Toast.warning(content, options?)` | Warning toast |
| `Toast.error(content, options?)` | Error toast |
| `Toast.show(status?, content?, options?)` | Generic toast with custom options |
| `Toast.DefaultOptions` | Global default options applied to every toast call (per-call options win) |

## ToastOptions

```ts
interface ToastOptions {
  target?: HTMLElement;       // mount point (default: document.body)
  appearance?: AlertAppearance; // 'soft' | 'outlined' — default: 'soft'
  title?: string;             // Optional title override
  position?: ToastPosition;
  duration?: number;          // Auto-dismiss ms (0 = no auto-dismiss)
  closable?: boolean;
}

type ToastPosition =
  | 'top-left'    | 'top-center'    | 'top-right'
  | 'middle-left' | 'middle-center' | 'middle-right'
  | 'bottom-left' | 'bottom-center' | 'bottom-right';
```
