lumatoast 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +0 -0
- package/README.md +522 -0
- package/dist/index.cjs +1011 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +366 -0
- package/dist/index.d.ts +366 -0
- package/dist/index.js +972 -0
- package/dist/index.js.map +1 -0
- package/dist/styles.css +819 -0
- package/dist/styles.css.map +1 -0
- package/package.json +74 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/core/tokens.ts","../src/core/constants.ts","../src/utils/id.ts","../src/utils/events.ts","../src/core/manager.ts","../src/core/toast.ts","../src/renderer/gestures.ts","../src/utils/dom.ts","../src/renderer/container.ts","../src/icons/success.ts","../src/icons/error.ts","../src/icons/warning.ts","../src/icons/info.ts","../src/icons/loading.ts","../src/components/toast.ts","../src/renderer/animations.ts","../src/renderer/renderer.ts"],"names":["toast"],"mappings":";;;AAmBO,IAAM,cAAA,GAAoB;AAC1B,IAAM,gBAAA,GAAoB;AAC1B,IAAM,aAAA,GAAoB;AAC1B,IAAM,iBAAA,GAAoB;AAI1B,IAAM,kBAAA,GAAqB;AAC3B,IAAM,iBAAA,GAAqB;AAC3B,IAAM,kBAAA,GAAqB;AAI3B,IAAM,cAAA,GAAiB;AACvB,IAAM,YAAA,GAAiB;AAIvB,IAAM,YAAA,GAAe;AAKrB,IAAM,QAAA,GAAW;AAAA;AAAA,EAEpB,KAAA,EAAS,cAAA;AAAA,EACT,MAAA,EAAS,eAAA;AAAA,EACT,OAAA,EAAS,gBAAA;AAAA,EACT,GAAA,EAAS,YAAA;AAAA;AAAA,EAGT,EAAA,EAAc,WAAA;AAAA,EACd,YAAA,EAAc,qBAAA;AAAA,EACd,YAAA,EAAc,qBAAA;AAAA,EACd,MAAA,EAAc,eAAA;AAAA,EACd,QAAA,EAAc,iBAAA;AAAA;AAAA,EAGd,IAAA,EAAgB,aAAA;AA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AA,EACZ,CAAA;AAEA,EAAA,OAAA,CAAQ,gBAAA,CAAiB,iBAAiB,mBAAmB,CAAA;AAG7D,EAAA,MAAA,CAAO,WAAW,MAAM;AACpB,IAAA,IAAI,QAAQ,WAAA,EAAa;AACrB,MAAA,OAAA,CAAQ,mBAAA,CAAoB,iBAAiB,mBAAmB,CAAA;AAChE,MAAA,OAAA,EAAQ;AAAA,IACZ;AAAA,EACJ,CAAA,EAAG,oBAAoB,EAAE,CAAA;AAC7B","file":"index.cjs","sourcesContent":["/**\n * LumaToast design tokens.\n *\n * These constants map to CSS custom properties used by the themes.\n * Override any of these in your CSS to customise LumaToast globally\n * or per-theme without writing extra class selectors.\n *\n * @example\n * ```css\n * :root {\n * --luma-bg: #1a1a2e;\n * --luma-radius: 24px;\n * --luma-font: \"Inter\", sans-serif;\n * }\n * ```\n */\n\n// ── Duration tokens (ms) ──────────────────────────────────────────────────────\n\nexport const DURATION_SHORT = 2000;\nexport const DURATION_DEFAULT = 4000;\nexport const DURATION_LONG = 6000;\nexport const DURATION_INFINITE = Infinity;\n\n// ── Animation tokens (ms) ─────────────────────────────────────────────────────\n\nexport const ANIMATION_ENTER_MS = 320;\nexport const ANIMATION_EXIT_MS = 300;\nexport const ANIMATION_STACK_MS = 280;\n\n// ── Layout tokens ─────────────────────────────────────────────────────────────\n\nexport const TOAST_WIDTH_PX = 340;\nexport const TOAST_GAP_PX = 12;\n\n// ── Z-index ───────────────────────────────────────────────────────────────────\n\nexport const Z_INDEX_BASE = 1000;\n\n// ── CSS variable names (single source of truth) ───────────────────────────────\n// All --luma-* CSS properties that users can override.\n\nexport const CSS_VARS = {\n // Card layout\n WIDTH: \"--luma-width\",\n RADIUS: \"--luma-radius\",\n PADDING: \"--luma-padding\",\n GAP: \"--luma-gap\",\n\n // Background & border\n BG: \"--luma-bg\",\n BORDER_COLOR: \"--luma-border-color\",\n BORDER_WIDTH: \"--luma-border-width\",\n SHADOW: \"--luma-shadow\",\n BACKDROP: \"--luma-backdrop\",\n\n // Typography\n FONT: \"--luma-font\",\n TITLE_SIZE: \"--luma-title-size\",\n TITLE_WEIGHT: \"--luma-title-weight\",\n TITLE_COLOR: \"--luma-title-color\",\n DESC_SIZE: \"--luma-desc-size\",\n DESC_COLOR: \"--luma-desc-color\",\n LINE_HEIGHT: \"--luma-line-height\",\n LETTER_SPACING: \"--luma-letter-spacing\",\n\n // Icon\n ICON_SIZE: \"--luma-icon-size\",\n\n // Close button\n CLOSE_COLOR: \"--luma-close-color\",\n CLOSE_SIZE: \"--luma-close-size\",\n\n // Action button\n ACTION_BG: \"--luma-action-bg\",\n ACTION_COLOR: \"--luma-action-color\",\n ACTION_HOVER_BG: \"--luma-action-hover-bg\",\n ACTION_RADIUS: \"--luma-action-radius\",\n ACTION_PADDING: \"--luma-action-padding\",\n ACTION_SIZE: \"--luma-action-size\",\n ACTION_WEIGHT: \"--luma-action-weight\",\n ACTION_BORDER: \"--luma-action-border\",\n ACTION_HOVER_BORDER: \"--luma-action-hover-border\",\n\n // Progress bar\n PROGRESS_HEIGHT: \"--luma-progress-height\",\n PROGRESS_RADIUS: \"--luma-progress-radius\",\n PROGRESS_SUCCESS: \"--luma-progress-success\",\n PROGRESS_ERROR: \"--luma-progress-error\",\n PROGRESS_WARNING: \"--luma-progress-warning\",\n PROGRESS_INFO: \"--luma-progress-info\",\n PROGRESS_LOADING: \"--luma-progress-loading\",\n PROGRESS_CUSTOM: \"--luma-progress-custom\",\n\n // Accent colors (used for type-specific accents like border-left)\n ACCENT_SUCCESS: \"--luma-accent-success\",\n ACCENT_ERROR: \"--luma-accent-error\",\n ACCENT_WARNING: \"--luma-accent-warning\",\n ACCENT_INFO: \"--luma-accent-info\",\n\n // Animation durations (set by animationSpeed config)\n DURATION_ENTER: \"--luma-duration-enter\",\n DURATION_EXIT: \"--luma-duration-exit\",\n DURATION_STACK: \"--luma-duration-stack\",\n} as const;\n\n// ── CSS class names (single source of truth) ──────────────────────────────────\n\nexport const CLASS_CONTAINER = \"luma-toast-container\";\nexport const CLASS_TOAST = \"luma-toast\";\nexport const CLASS_CARD = \"luma-toast-card\";\nexport const CLASS_ICON = \"luma-toast-icon\";\nexport const CLASS_CONTENT = \"luma-toast-content\";\nexport const CLASS_TITLE = \"luma-toast-title\";\nexport const CLASS_DESCRIPTION = \"luma-toast-description\";\nexport const CLASS_ACTION = \"luma-toast-action\";\nexport const CLASS_CLOSE = \"luma-toast-close\";\nexport const CLASS_PROGRESS = \"luma-progress\";\nexport const CLASS_EXIT = \"luma-toast-exit\";","import {\n DURATION_DEFAULT,\n TOAST_GAP_PX,\n Z_INDEX_BASE\n} from \"./tokens\";\n\nexport const DEFAULT_DURATION = DURATION_DEFAULT;\nexport const DEFAULT_POSITION = \"top-right\" as const;\nexport const DEFAULT_THEME = \"linear\" as const;\nexport const DEFAULT_DISMISSIBLE = true;\nexport const DEFAULT_SHOW_ICON = true;\nexport const DEFAULT_CLOSE_ON_CLICK = false;\nexport const DEFAULT_PROGRESS_POS = \"bottom\" as const;\nexport const DEFAULT_ANIMATION_ENTER = \"slide\" as const;\nexport const DEFAULT_ANIMATION_EXIT = \"slide\" as const;\nexport const DEFAULT_ANIMATION_SPEED = \"normal\" as const;\nexport const MAX_VISIBLE_TOASTS = 5;\nexport const STACK_GAP = TOAST_GAP_PX;\nexport { Z_INDEX_BASE };","/**\n * Generates unique IDs for every toast.\n * Format: toast-<timestamp>-<counter>\n *\n * Example:\n * toast-1758189234567-1\n * toast-1758189234571-2\n */\n\nlet counter = 0;\n\nexport function createToastId(prefix = \"toast\"): string {\n counter += 1;\n\n return `${prefix}-${Date.now()}-${counter}`;\n}","export type Listener<T> = (payload: T) => void;\n\n/**\n * Tiny event emitter used internally by LumaToast.\n */\nexport class EventEmitter<T> {\n private listeners = new Set<Listener<T>>();\n\n subscribe(listener: Listener<T>): () => void {\n this.listeners.add(listener);\n\n // Return unsubscribe function.\n return () => {\n this.listeners.delete(listener);\n };\n }\n\n emit(payload: T): void {\n this.listeners.forEach((listener) => listener(payload));\n }\n\n clear(): void {\n this.listeners.clear();\n }\n}","import {\n DEFAULT_DISMISSIBLE,\n DEFAULT_DURATION,\n DEFAULT_POSITION,\n DEFAULT_THEME,\n DEFAULT_SHOW_ICON,\n DEFAULT_CLOSE_ON_CLICK,\n DEFAULT_PROGRESS_POS,\n DEFAULT_ANIMATION_ENTER,\n DEFAULT_ANIMATION_EXIT,\n DEFAULT_ANIMATION_SPEED,\n MAX_VISIBLE_TOASTS\n} from \"./constants\";\n\nimport type {\n ToastItem,\n ToastOptions,\n ToastPosition,\n ToastTheme,\n ToastType,\n ToastUpdateOptions,\n ToastProgressPosition,\n ToastAnimationEnter,\n ToastAnimationExit,\n ToastAnimationSpeed,\n} from \"./types\";\n\nimport { createToastId } from \"../utils/id\";\nimport { EventEmitter } from \"../utils/events\";\n\n// ── Global configuration ───────────────────────────────────────────────────────\n\nexport interface ToastConfig {\n /** Default auto-dismiss duration in ms. Default: 4000 */\n duration?: number;\n /** Default screen position. Default: \"top-right\" */\n position?: ToastPosition;\n /** Default visual theme. Default: \"linear\" */\n theme?: ToastTheme;\n /** Default dismissible flag. Default: true */\n dismissible?: boolean;\n /** Maximum number of toasts visible at once. Default: 5 */\n maxVisible?: number;\n /** Show the type icon by default. Default: true */\n showIcon?: boolean;\n /** Dismiss on card body click by default. Default: false */\n closeOnClick?: boolean;\n /** Default progress bar placement. Default: \"bottom\" */\n progressPosition?: ToastProgressPosition;\n /** Default enter animation. Default: \"slide\" */\n animationEnter?: ToastAnimationEnter;\n /** Default exit animation. Default: \"slide\" */\n animationExit?: ToastAnimationExit;\n /**\n * Global animation speed preset.\n * Applies `--luma-duration-enter/exit/stack` CSS variables on <html>.\n * Default: \"normal\"\n */\n animationSpeed?: ToastAnimationSpeed;\n}\n\nlet globalConfig: Required<ToastConfig> = {\n duration: DEFAULT_DURATION,\n position: DEFAULT_POSITION,\n theme: DEFAULT_THEME,\n dismissible: DEFAULT_DISMISSIBLE,\n maxVisible: MAX_VISIBLE_TOASTS,\n showIcon: DEFAULT_SHOW_ICON,\n closeOnClick: DEFAULT_CLOSE_ON_CLICK,\n progressPosition: DEFAULT_PROGRESS_POS,\n animationEnter: DEFAULT_ANIMATION_ENTER,\n animationExit: DEFAULT_ANIMATION_EXIT,\n animationSpeed: DEFAULT_ANIMATION_SPEED,\n};\n\n// Speed → CSS duration values (ms)\nconst SPEED_MAP: Record<ToastAnimationSpeed, { enter: number; exit: number; stack: number }> = {\n slow: { enter: 500, exit: 450, stack: 400 },\n normal: { enter: 320, exit: 300, stack: 280 },\n fast: { enter: 180, exit: 160, stack: 150 },\n};\n\n/**\n * Apply animation speed CSS variables to <html> so all toasts pick them up.\n */\nfunction applyAnimationSpeed(speed: ToastAnimationSpeed): void {\n if (typeof document === \"undefined\") return;\n\n const { enter, exit, stack } = SPEED_MAP[speed];\n const root = document.documentElement;\n\n root.style.setProperty(\"--luma-duration-enter\", `${enter}ms`);\n root.style.setProperty(\"--luma-duration-exit\", `${exit}ms`);\n root.style.setProperty(\"--luma-duration-stack\", `${stack}ms`);\n}\n\n/**\n * Set global defaults for all toasts.\n * Per-toast options always override these.\n *\n * @example\n * configure({\n * position: \"bottom-right\",\n * theme: \"minimal\",\n * duration: 3000,\n * progressPosition: \"top\",\n * animationEnter: \"scale\",\n * animationSpeed: \"fast\",\n * });\n */\nexport function configure(config: ToastConfig): void {\n globalConfig = { ...globalConfig, ...config };\n\n if (config.animationSpeed) {\n applyAnimationSpeed(config.animationSpeed);\n }\n}\n\n// ── ToastManager ──────────────────────────────────────────────────────────────\n\nexport class ToastManager {\n private visible: ToastItem[] = [];\n private queue: ToastItem[] = [];\n\n readonly changes = new EventEmitter<ToastItem[]>();\n\n /**\n * Returns all visible toasts.\n */\n getToasts(): ToastItem[] {\n return [...this.visible];\n }\n\n /**\n * Create a new toast.\n */\n create(type: ToastType, options: ToastOptions = {}): ToastItem {\n const toast: ToastItem = {\n id: options.id ?? createToastId(),\n type,\n title: options.title,\n description: options.description,\n duration: options.duration ?? globalConfig.duration,\n dismissible: options.dismissible ?? globalConfig.dismissible,\n position: options.position ?? globalConfig.position,\n theme: options.theme ?? globalConfig.theme,\n action: options.action,\n // customization\n className: options.className,\n style: options.style,\n showIcon: options.showIcon ?? globalConfig.showIcon,\n closeOnClick: options.closeOnClick ?? globalConfig.closeOnClick,\n progressPosition: options.progressPosition ?? globalConfig.progressPosition,\n animationEnter: options.animationEnter ?? globalConfig.animationEnter,\n animationExit: options.animationExit ?? globalConfig.animationExit,\n // internal\n createdAt: Date.now(),\n visible: false\n };\n\n if (this.visible.length >= globalConfig.maxVisible) {\n this.queue.push(toast);\n } else {\n toast.visible = true;\n this.visible.push(toast);\n this.changes.emit(this.getToasts());\n }\n\n return toast;\n }\n\n /**\n * Remove a toast by id.\n */\n dismiss(id: string): void {\n const index = this.visible.findIndex((t) => t.id === id);\n\n if (index === -1) return;\n\n this.visible.splice(index, 1);\n\n if (this.queue.length > 0) {\n const next = this.queue.shift()!;\n next.visible = true;\n this.visible.push(next);\n }\n\n this.changes.emit(this.getToasts());\n }\n\n /**\n * Remove all visible and queued toasts.\n */\n dismissAll(): void {\n this.visible = [];\n this.queue = [];\n this.changes.emit([]);\n }\n\n /**\n * Remove the most recently added visible toast.\n */\n dismissLatest(): void {\n const latest = this.visible[this.visible.length - 1];\n if (!latest) return;\n this.dismiss(latest.id);\n }\n\n /**\n * Update an existing toast by id.\n * Works on both visible and queued toasts.\n */\n update(id: string, updates: ToastUpdateOptions): ToastItem | null {\n const visibleToast = this.visible.find((t) => t.id === id);\n\n if (visibleToast) {\n Object.assign(visibleToast, updates);\n\n if (updates.duration !== undefined) {\n visibleToast.createdAt = Date.now();\n }\n\n this.changes.emit(this.getToasts());\n return visibleToast;\n }\n\n const queuedToast = this.queue.find((t) => t.id === id);\n\n if (queuedToast) {\n Object.assign(queuedToast, updates);\n\n if (updates.duration !== undefined) {\n queuedToast.createdAt = Date.now();\n }\n\n return queuedToast;\n }\n\n return null;\n }\n}\n\nexport const toastManager = new ToastManager();","import type {\n ToastOptions,\n ToastUpdateOptions,\n PromiseToastOptions\n} from \"./types\";\nimport { toastManager, configure } from \"./manager\";\n\nexport const toast = {\n /**\n * Show a success toast.\n */\n success(message: string, options: ToastOptions = {}) {\n return toastManager.create(\"success\", {\n ...options,\n description: message\n });\n },\n\n /**\n * Show an error toast.\n */\n error(message: string, options: ToastOptions = {}) {\n return toastManager.create(\"error\", {\n ...options,\n description: message\n });\n },\n\n /**\n * Show a warning toast.\n */\n warning(message: string, options: ToastOptions = {}) {\n return toastManager.create(\"warning\", {\n ...options,\n description: message\n });\n },\n\n /**\n * Show an info toast.\n */\n info(message: string, options: ToastOptions = {}) {\n return toastManager.create(\"info\", {\n ...options,\n description: message\n });\n },\n\n /**\n * Show a persistent loading toast that must be dismissed manually\n * or converted via `toast.update()` / `toast.promise()`.\n */\n loading(message: string, options: ToastOptions = {}) {\n return toastManager.create(\"loading\", {\n ...options,\n duration: Infinity,\n dismissible: false,\n description: message\n });\n },\n\n /**\n * Show a fully custom toast.\n * You control the title, description, action, theme, and position.\n *\n * @example\n * toast.custom(\"Custom notification\", { title: \"Hey!\", theme: \"cyberpunk\" });\n */\n custom(message: string, options: ToastOptions = {}) {\n return toastManager.create(\"custom\", {\n ...options,\n description: message\n });\n },\n\n /**\n * Dismiss a toast by id.\n */\n dismiss(id: string) {\n toastManager.dismiss(id);\n },\n\n /**\n * Dismiss all visible and queued toasts.\n */\n dismissAll() {\n toastManager.dismissAll();\n },\n\n /**\n * Dismiss the most recently added visible toast.\n */\n dismissLatest() {\n toastManager.dismissLatest();\n },\n\n /**\n * Update an existing toast's properties.\n * Useful for transitioning a loading toast to success or error.\n */\n update(id: string, updates: ToastUpdateOptions) {\n return toastManager.update(id, updates);\n },\n\n /**\n * Track a promise: show a loading toast, then auto-transition to\n * success or error based on the promise outcome.\n *\n * @example\n * toast.promise(fetch(\"/api/save\"), {\n * loading: { description: \"Saving...\" },\n * success: { description: \"Saved!\" },\n * error: { description: \"Failed to save.\" }\n * });\n */\n promise<T>(\n promise: Promise<T>,\n options: PromiseToastOptions\n ): Promise<T> {\n const loadingToast = toast.loading(\n options.loading.description ?? \"\",\n { ...options.loading }\n );\n\n return promise\n .then((result) => {\n toast.update(loadingToast.id, {\n type: \"success\",\n ...options.success,\n duration: options.success.duration ?? 3000,\n dismissible: true\n });\n\n return result;\n })\n .catch((error) => {\n toast.update(loadingToast.id, {\n type: \"error\",\n ...options.error,\n duration: options.error.duration ?? 4000,\n dismissible: true\n });\n\n throw error;\n });\n },\n\n /**\n * Subscribe to toast state changes.\n * Returns an unsubscribe function.\n *\n * @example\n * const unsub = toast.subscribe((toasts) => console.log(toasts));\n * // later:\n * unsub();\n */\n subscribe(listener: (toasts: ReturnType<typeof toastManager.getToasts>) => void) {\n return toastManager.changes.subscribe(listener);\n },\n\n /**\n * Set global defaults for all toasts.\n * Per-toast options always override these.\n *\n * @example\n * toast.configure({ position: \"bottom-right\", theme: \"minimal\", duration: 3000 });\n */\n configure\n};\n\nexport { toastManager };","import { toast } from \"../core/toast\";\nimport type { ToastPosition } from \"../core/types\";\n\nconst DISMISS_THRESHOLD = 120;\nconst MAX_ROTATION = 8;\nconst EXIT_DISTANCE = 450;\n\n/**\n * Attach swipe-to-dismiss gesture to a toast element.\n *\n * - Left/right positions → swipe horizontally to dismiss\n * - Center positions → swipe in the direction away from the edge\n * - Top positions → swipe up to dismiss\n * - Bottom positions → swipe down to dismiss\n *\n * Pauses the auto-dismiss timer while the user is dragging.\n */\nexport function attachSwipeGesture(\n element: HTMLElement,\n toastId: string,\n position: ToastPosition,\n onPause: () => void,\n onResume: () => void\n): void {\n const isVertical = position === \"top-center\" || position === \"bottom-center\";\n const isBottom = position.startsWith(\"bottom\");\n\n let startX = 0;\n let startY = 0;\n let currentX = 0;\n let currentY = 0;\n let dragging = false;\n\n const card = element.querySelector(\".luma-toast-card\") as HTMLElement;\n\n // Allow the axis we're not using for dragging to scroll the page normally.\n card.style.touchAction = isVertical ? \"pan-x\" : \"pan-y\";\n\n const handlePointerDown = (event: PointerEvent) => {\n const target = event.target as HTMLElement;\n\n // Don't start swipe from buttons or links.\n if (\n target.closest(\".luma-toast-close\") ||\n target.closest(\".luma-toast-action\")\n ) {\n return;\n }\n\n dragging = true;\n startX = event.clientX;\n startY = event.clientY;\n currentX = 0;\n currentY = 0;\n\n onPause();\n\n element.style.transition = \"none\";\n element.setPointerCapture(event.pointerId);\n };\n\n const handlePointerMove = (event: PointerEvent) => {\n if (!dragging) return;\n\n currentX = event.clientX - startX;\n currentY = event.clientY - startY;\n\n if (isVertical) {\n // Top-center / bottom-center: drag vertically.\n const clampedY = isBottom\n ? Math.max(0, currentY) // bottom: only drag down\n : Math.min(0, currentY); // top: only drag up\n\n element.style.transform = `translate3d(0, ${clampedY}px, 0)`;\n element.style.opacity = `${Math.max(0.35, 1 - Math.abs(clampedY) / 180)}`;\n } else {\n // Left / right / top-left / etc.: drag horizontally.\n const rotate =\n Math.sign(currentX) *\n Math.min(Math.abs(currentX) / 20, MAX_ROTATION);\n\n element.style.transform = `translate3d(${currentX}px, 0, 0) rotate(${rotate}deg)`;\n element.style.opacity = `${Math.max(0.35, 1 - Math.abs(currentX) / 180)}`;\n }\n };\n\n const handlePointerUp = (event: PointerEvent) => {\n if (!dragging) return;\n\n dragging = false;\n element.releasePointerCapture(event.pointerId);\n\n element.style.transition =\n \"transform 280ms cubic-bezier(.2,.8,.2,1), opacity 220ms ease\";\n\n const delta = isVertical ? currentY : currentX;\n\n if (Math.abs(delta) >= DISMISS_THRESHOLD) {\n // Fly off screen in the drag direction.\n if (isVertical) {\n const exitY = delta > 0 ? EXIT_DISTANCE : -EXIT_DISTANCE;\n element.style.transform = `translate3d(0, ${exitY}px, 0)`;\n } else {\n const exitX = delta > 0 ? EXIT_DISTANCE : -EXIT_DISTANCE;\n const exitRotate = delta > 0 ? 12 : -12;\n element.style.transform = `translate3d(${exitX}px, 0, 0) rotate(${exitRotate}deg)`;\n }\n\n element.style.opacity = \"0\";\n\n setTimeout(() => {\n toast.dismiss(toastId);\n }, 280);\n\n return;\n }\n\n // Not far enough — spring back.\n element.style.transform = \"\";\n element.style.opacity = \"1\";\n\n onResume();\n };\n\n element.addEventListener(\"pointerdown\", handlePointerDown);\n element.addEventListener(\"pointermove\", handlePointerMove);\n element.addEventListener(\"pointerup\", handlePointerUp);\n element.addEventListener(\"pointercancel\", handlePointerUp);\n}","/**\n * Creates an HTML element with optional CSS class names.\n */\nexport function createElement<K extends keyof HTMLElementTagNameMap>(\n tag: K,\n classNames: string[] = []\n): HTMLElementTagNameMap[K] {\n const element = document.createElement(tag);\n\n if (classNames.length) {\n element.classList.add(...classNames);\n }\n\n return element;\n}\n\n/**\n * Removes all child nodes from an element.\n * Used internally when re-rendering content in-place.\n */\nexport function clearElement(element: HTMLElement): void {\n while (element.firstChild) {\n element.removeChild(element.firstChild);\n }\n}\n\n/**\n * Safely applies inline styles and CSS custom properties to an element.\n * Protects against prototype pollution and ensures CSS variables are properly set via setProperty().\n */\nexport function applyStyles(element: HTMLElement, style?: Record<string, string>): void {\n if (!style || typeof style !== \"object\") return;\n\n for (const [key, value] of Object.entries(style)) {\n if (key === \"__proto__\" || key === \"constructor\" || key === \"prototype\") continue;\n if (typeof value !== \"string\") continue;\n\n if (key.startsWith(\"--\")) {\n element.style.setProperty(key, value);\n } else {\n (element.style as any)[key] = value;\n }\n }\n}","import type { ToastPosition } from \"../core/types\";\nimport { createElement } from \"../utils/dom\";\n\nconst CONTAINER_CLASS = \"luma-toast-container\";\n\nconst containers = new Map<ToastPosition, HTMLElement>();\n\nexport function getContainer(position: ToastPosition): HTMLElement {\n const existing = containers.get(position);\n\n if (existing) return existing;\n\n const container = createElement(\"div\", [\n CONTAINER_CLASS,\n `luma-${position}`\n ]);\n\n container.dataset.position = position;\n container.setAttribute(\"role\", \"region\");\n container.setAttribute(\"aria-live\", \"polite\");\n container.setAttribute(\"aria-atomic\", \"false\");\n container.setAttribute(\"aria-relevant\", \"additions removals\");\n\n document.body.appendChild(container);\n\n containers.set(position, container);\n\n return container;\n}\n\nexport function removeContainer(position: ToastPosition) {\n const container = containers.get(position);\n\n if (!container) return;\n\n container.remove();\n containers.delete(position);\n}","export const successIcon = `\n<svg viewBox=\"0 0 24 24\" width=\"20\" height=\"20\" fill=\"none\">\n <circle cx=\"12\" cy=\"12\" r=\"10\" fill=\"#22C55E\"/>\n <path\n d=\"M7.5 12.5L10.5 15.5L16.5 9.5\"\n stroke=\"white\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n</svg>\n`;","export const errorIcon = `\n<svg viewBox=\"0 0 24 24\" width=\"20\" height=\"20\" fill=\"none\">\n <circle cx=\"12\" cy=\"12\" r=\"10\" fill=\"#EF4444\"/>\n <path\n d=\"M9 9L15 15M15 9L9 15\"\n stroke=\"white\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n />\n</svg>\n`;","export const warningIcon = `\n<svg viewBox=\"0 0 24 24\" width=\"20\" height=\"20\" fill=\"none\">\n <path\n d=\"M12 3L22 20H2L12 3Z\"\n fill=\"#F59E0B\"\n />\n <path\n d=\"M12 9V13\"\n stroke=\"white\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n />\n <circle cx=\"12\" cy=\"17\" r=\"1\" fill=\"white\"/>\n</svg>\n`;","export const infoIcon = `\n<svg viewBox=\"0 0 24 24\" width=\"20\" height=\"20\" fill=\"none\">\n <circle cx=\"12\" cy=\"12\" r=\"10\" fill=\"#3B82F6\"/>\n <path\n d=\"M12 11V16\"\n stroke=\"white\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n />\n <circle cx=\"12\" cy=\"8\" r=\"1.2\" fill=\"white\"/>\n</svg>\n`;","export const loadingIcon = `\n<svg class=\"luma-loading-icon\"\n viewBox=\"0 0 24 24\"\n width=\"20\"\n height=\"20\"\n fill=\"none\">\n\n <circle\n cx=\"12\"\n cy=\"12\"\n r=\"9\"\n stroke=\"#64748B\"\n stroke-width=\"2\"\n opacity=\".25\"\n />\n\n <path\n d=\"M12 3\n A9 9 0 0 1 21 12\"\n stroke=\"#60A5FA\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n />\n</svg>\n`;","import type { ToastItem } from \"../core/types\";\nimport { createElement, applyStyles } from \"../utils/dom\";\nimport { toast } from \"../core/toast\";\nimport { successIcon } from \"../icons/success\";\nimport { errorIcon } from \"../icons/error\";\nimport { warningIcon } from \"../icons/warning\";\nimport { infoIcon } from \"../icons/info\";\nimport { loadingIcon } from \"../icons/loading\";\n\n/**\n * Build the full wrapper + card DOM element for a toast.\n * The wrapper carries animation data attributes and ARIA roles.\n * The card is the visual surface (themed, bordered, etc.).\n */\nexport function renderToast(toastItem: ToastItem): HTMLDivElement {\n // ── Wrapper ──────────────────────────────────────────────────────────────\n const classes = [\n \"luma-toast\",\n `luma-${toastItem.type}`,\n `luma-theme-${toastItem.theme}`,\n ];\n\n if (toastItem.className) {\n classes.push(...toastItem.className.trim().split(/\\s+/));\n }\n\n const wrapper = createElement(\"div\", classes);\n\n wrapper.dataset.toastId = toastItem.id;\n\n // Animation data attributes — CSS selectors drive the actual keyframes.\n wrapper.dataset.enter = toastItem.animationEnter;\n wrapper.dataset.exit = toastItem.animationExit;\n\n // ARIA\n wrapper.setAttribute(\"role\", toastItem.type === \"error\" ? \"alert\" : \"status\");\n wrapper.setAttribute(\"aria-live\", toastItem.type === \"error\" ? \"assertive\" : \"polite\");\n\n // ── Card ─────────────────────────────────────────────────────────────────\n const card = createElement(\"div\", [\"luma-toast-card\"]);\n\n // Inline style overrides (safely sets CSS variables & properties).\n applyStyles(card, toastItem.style);\n\n // Close on card body click.\n if (toastItem.closeOnClick) {\n card.style.cursor = \"pointer\";\n card.addEventListener(\"click\", (e) => {\n // Don't double-fire if the close button or action button was clicked.\n const target = e.target as HTMLElement;\n if (\n target.closest(\".luma-toast-close\") ||\n target.closest(\".luma-toast-action\")\n ) return;\n\n toast.dismiss(toastItem.id);\n });\n }\n\n // ── Icon ──────────────────────────────────────────────────────────────────\n if (toastItem.showIcon) {\n const icon = createElement(\"div\", [\"luma-toast-icon\"]);\n icon.innerHTML = getIcon(toastItem.type);\n card.appendChild(icon);\n }\n\n // ── Content ───────────────────────────────────────────────────────────────\n const content = createElement(\"div\", [\"luma-toast-content\"]);\n\n if (toastItem.title) {\n const title = createElement(\"div\", [\"luma-toast-title\"]);\n title.textContent = toastItem.title;\n content.appendChild(title);\n }\n\n if (toastItem.description) {\n const desc = createElement(\"div\", [\"luma-toast-description\"]);\n desc.textContent = toastItem.description;\n content.appendChild(desc);\n }\n\n if (toastItem.action) {\n const action = buildActionButton(toastItem);\n content.appendChild(action);\n }\n\n card.appendChild(content);\n\n // ── Close button ──────────────────────────────────────────────────────────\n const close = createElement(\"button\", [\"luma-toast-close\"]);\n close.type = \"button\";\n close.textContent = \"×\";\n close.setAttribute(\"aria-label\", \"Dismiss notification\");\n close.setAttribute(\"title\", \"Dismiss\");\n\n if (!toastItem.dismissible) {\n close.style.display = \"none\";\n }\n\n close.addEventListener(\"pointerdown\", (e) => e.stopPropagation());\n close.addEventListener(\"click\", (e) => {\n e.stopPropagation();\n toast.dismiss(toastItem.id);\n });\n\n card.appendChild(close);\n\n // ── Progress bar ──────────────────────────────────────────────────────────\n if (Number.isFinite(toastItem.duration)) {\n const progress = buildProgressBar(toastItem);\n\n if (toastItem.progressPosition === \"top\") {\n card.insertBefore(progress, card.firstChild);\n } else {\n card.appendChild(progress);\n }\n }\n\n wrapper.appendChild(card);\n\n return wrapper;\n}\n\n// ── Action button builder ─────────────────────────────────────────────────────\n\nfunction buildActionButton(toastItem: ToastItem): HTMLButtonElement {\n const variant = toastItem.action?.variant ?? \"solid\";\n\n const action = createElement(\"button\", [\n \"luma-toast-action\",\n `luma-action-${variant}`,\n ]);\n\n action.type = \"button\";\n action.textContent = toastItem.action!.label;\n action.setAttribute(\"aria-label\", toastItem.action!.label);\n\n action.addEventListener(\"pointerdown\", (e) => e.stopPropagation());\n action.addEventListener(\"click\", (e) => {\n e.stopPropagation();\n toastItem.action?.onClick();\n toast.dismiss(toastItem.id);\n });\n\n return action;\n}\n\n// ── Progress bar builder ──────────────────────────────────────────────────────\n\nfunction buildProgressBar(toastItem: ToastItem): HTMLDivElement {\n const progress = createElement(\"div\", [\"luma-progress\"]);\n\n const elapsed = Date.now() - toastItem.createdAt;\n\n progress.style.animationDuration = `${toastItem.duration}ms`;\n // Negative delay makes the animation start mid-way (accounts for render lag).\n progress.style.animationDelay = `-${elapsed}ms`;\n\n if (toastItem.progressPosition === \"top\") {\n progress.classList.add(\"luma-progress-top\");\n }\n\n return progress;\n}\n\n// ── Icon resolver ─────────────────────────────────────────────────────────────\n\nfunction getIcon(type: ToastItem[\"type\"]): string {\n switch (type) {\n case \"success\": return successIcon;\n case \"error\": return errorIcon;\n case \"warning\": return warningIcon;\n case \"loading\": return loadingIcon;\n case \"info\":\n default: return infoIcon;\n }\n}","import { ANIMATION_STACK_MS } from \"../core/tokens\";\n\nconst previousPositions = new Map<string, DOMRect>();\n\nconst prefersReducedMotion = () =>\n window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n\n/**\n * Snapshot current positions of all rendered toasts (FLIP step 1: First).\n * Must be called before any DOM mutations.\n */\nexport function recordPositions(elements: Map<string, HTMLElement>): void {\n previousPositions.clear();\n\n elements.forEach((element, id) => {\n previousPositions.set(id, element.getBoundingClientRect());\n });\n}\n\n/**\n * Animate each toast from its old position to its new position (FLIP steps 2–4).\n * Skips toasts that are mid-removal so they don't fight the exit animation.\n */\nexport function animateStack(elements: Map<string, HTMLElement>): void {\n if (prefersReducedMotion()) return;\n\n elements.forEach((element, id) => {\n // Don't fight the exit animation on toasts being removed.\n if (element.dataset.removing === \"true\") return;\n\n const previous = previousPositions.get(id);\n if (!previous) return;\n\n const next = element.getBoundingClientRect();\n const deltaY = previous.top - next.top;\n\n if (deltaY === 0) return;\n\n // Invert: jump to where it was.\n element.style.transition = \"none\";\n element.style.transform = `translateY(${deltaY}px)`;\n\n // Play: let CSS transition it to the natural position.\n requestAnimationFrame(() => {\n element.style.transition = `transform ${ANIMATION_STACK_MS}ms cubic-bezier(.2,.8,.2,1)`;\n element.style.transform = \"\";\n });\n });\n}\n\n/**\n * Update z-index so newer toasts appear on top.\n */\nexport function updateDepth(elements: Map<string, HTMLElement>): void {\n const list = [...elements.values()];\n\n list.forEach((element, index) => {\n element.style.zIndex = String(1000 - index);\n element.style.removeProperty(\"--luma-scale\");\n });\n}","import { toast } from \"../core/toast\";\nimport type { ToastItem, ToastPosition } from \"../core/types\";\nimport { attachSwipeGesture } from \"./gestures\";\nimport type { TimerState } from \"../utils/timer\";\nimport { getContainer, removeContainer } from \"./container\";\nimport { renderToast } from \"../components/toast\";\nimport { recordPositions, animateStack, updateDepth } from \"./animations\";\nimport { loadingIcon } from \"../icons/loading\";\nimport { infoIcon } from \"../icons/info\";\nimport { warningIcon } from \"../icons/warning\";\nimport { errorIcon } from \"../icons/error\";\nimport { successIcon } from \"../icons/success\";\nimport { ANIMATION_EXIT_MS } from \"../core/tokens\";\nimport { applyStyles } from \"../utils/dom\";\n\nlet initialized = false;\n\n/** Keeps rendered DOM elements by toast ID. */\nconst renderedToasts = new Map<string, HTMLElement>();\n\n/** Keeps timer state for every toast. */\nconst timers = new Map<string, TimerState>();\n\n/**\n * Initialize the DOM renderer. Must be called once before showing toasts.\n * Safe to call multiple times — subsequent calls are no-ops.\n */\nexport function initializeRenderer() {\n if (typeof window === \"undefined\") return;\n if (initialized) return;\n initialized = true;\n\n toast.subscribe(syncToasts);\n window.addEventListener(\"keydown\", handleEscapeKey);\n}\n\n// ── Keyboard support ──────────────────────────────────────────────────────────\n\nfunction handleEscapeKey(event: KeyboardEvent) {\n if (event.key !== \"Escape\") return;\n toast.dismissLatest();\n}\n\n// ── Core sync loop ────────────────────────────────────────────────────────────\n\nfunction syncToasts(toasts: ToastItem[]) {\n // Snapshot positions before DOM mutations (FLIP step 1: First).\n recordPositions(renderedToasts);\n\n const activeIds = new Set(toasts.map((t) => t.id));\n\n // Remove dismissed toasts.\n for (const [id, element] of renderedToasts.entries()) {\n if (!activeIds.has(id)) {\n removeToast(id, element);\n }\n }\n\n // Group toasts by position so each container is managed independently.\n const grouped = new Map<ToastPosition, ToastItem[]>();\n\n toasts.forEach((toastItem) => {\n const list = grouped.get(toastItem.position) ?? [];\n list.push(toastItem);\n grouped.set(toastItem.position, list);\n });\n\n // Render or patch each group.\n grouped.forEach((positionToasts, position) => {\n const container = getContainer(position);\n\n positionToasts.forEach((toastItem) => {\n const existing = renderedToasts.get(toastItem.id);\n\n if (existing) {\n // Patch the existing DOM element in-place.\n patchToast(existing, toastItem);\n\n // If the toast transitioned from loading → success/error,\n // start the auto-dismiss timer now.\n if (\n Number.isFinite(toastItem.duration) &&\n !timers.has(toastItem.id)\n ) {\n startTimer(toastItem, existing);\n }\n\n return;\n }\n\n // New toast: render and mount.\n const element = renderToast(toastItem);\n container.appendChild(element);\n renderedToasts.set(toastItem.id, element);\n startTimer(toastItem, element);\n });\n });\n\n // FLIP: animate existing toasts from their old positions to new ones.\n requestAnimationFrame(() => {\n animateStack(renderedToasts);\n updateDepth(renderedToasts);\n });\n}\n\n// ── In-place DOM patching (for toast.update) ──────────────────────────────────\n\nfunction patchToast(element: HTMLElement, toastItem: ToastItem) {\n // Update wrapper classes (type + theme).\n const baseClasses = [\n \"luma-toast\",\n `luma-${toastItem.type}`,\n `luma-theme-${toastItem.theme}`,\n ];\n\n if (toastItem.className) {\n baseClasses.push(...toastItem.className.trim().split(/\\s+/));\n }\n\n element.className = baseClasses.join(\" \");\n\n // Preserve data-removing if set.\n element.dataset.enter = toastItem.animationEnter;\n element.dataset.exit = toastItem.animationExit;\n\n const card = element.querySelector(\".luma-toast-card\") as HTMLElement;\n if (!card) return;\n\n // Inline style overrides.\n applyStyles(card, toastItem.style);\n\n // --- Icon ---\n const iconSlot = card.querySelector(\".luma-toast-icon\") as HTMLElement | null;\n\n if (toastItem.showIcon) {\n if (iconSlot) {\n iconSlot.innerHTML = resolveIcon(toastItem.type);\n }\n // Icon was hidden before — we don't re-add it here to keep patching simple.\n // The full element will be reconstructed on next dismiss+show.\n } else {\n iconSlot?.remove();\n }\n\n // --- Title ---\n const title = card.querySelector(\".luma-toast-title\") as HTMLElement | null;\n\n if (toastItem.title) {\n if (title) {\n title.textContent = toastItem.title;\n } else {\n const node = document.createElement(\"div\");\n node.className = \"luma-toast-title\";\n node.textContent = toastItem.title;\n card.querySelector(\".luma-toast-content\")?.prepend(node);\n }\n } else {\n title?.remove();\n }\n\n // --- Description ---\n const description = card.querySelector(\".luma-toast-description\") as HTMLElement | null;\n\n if (toastItem.description) {\n if (description) {\n description.textContent = toastItem.description;\n } else {\n const node = document.createElement(\"div\");\n node.className = \"luma-toast-description\";\n node.textContent = toastItem.description;\n card.querySelector(\".luma-toast-content\")?.appendChild(node);\n }\n } else {\n description?.remove();\n }\n\n // --- Close button ---\n const close = card.querySelector(\".luma-toast-close\") as HTMLButtonElement | null;\n if (close) {\n close.style.display = toastItem.dismissible ? \"\" : \"none\";\n }\n\n // --- Progress bar ---\n const existingProgress = card.querySelector(\".luma-progress\") as HTMLElement | null;\n\n if (Number.isFinite(toastItem.duration)) {\n if (!existingProgress) {\n // Loading → Success/Error: create the progress bar for the first time.\n const progress = document.createElement(\"div\");\n progress.className = \"luma-progress\";\n progress.style.animationDuration = `${toastItem.duration}ms`;\n\n if (toastItem.progressPosition === \"top\") {\n progress.classList.add(\"luma-progress-top\");\n card.insertBefore(progress, card.firstChild);\n } else {\n card.appendChild(progress);\n }\n }\n // If it already exists, leave it — do not reset the animation.\n } else {\n existingProgress?.remove();\n }\n}\n\nfunction resolveIcon(type: ToastItem[\"type\"]): string {\n switch (type) {\n case \"success\": return successIcon;\n case \"error\": return errorIcon;\n case \"warning\": return warningIcon;\n case \"loading\": return loadingIcon;\n case \"info\":\n default: return infoIcon;\n }\n}\n\n// ── Timer management ──────────────────────────────────────────────────────────\n\nfunction startTimer(toastItem: ToastItem, element: HTMLElement) {\n const { duration } = toastItem;\n\n // Loading toasts have duration = Infinity — no auto-dismiss.\n if (!Number.isFinite(duration)) {\n timers.delete(toastItem.id);\n return;\n }\n\n const timer: TimerState = {\n timeoutId: 0,\n startedAt: Date.now(),\n remaining: duration\n };\n\n const schedule = () => {\n timer.startedAt = Date.now();\n timer.timeoutId = window.setTimeout(() => {\n toast.dismiss(toastItem.id);\n }, timer.remaining);\n };\n\n schedule();\n timers.set(toastItem.id, timer);\n\n attachHoverEvents(element, toastItem.id);\n attachSwipeGesture(\n element,\n toastItem.id,\n toastItem.position,\n () => pauseTimer(toastItem.id, element),\n () => resumeTimer(toastItem.id, element)\n );\n}\n\nfunction pauseTimer(id: string, element: HTMLElement) {\n const timer = timers.get(id);\n if (!timer) return;\n\n clearTimeout(timer.timeoutId);\n timer.remaining -= Date.now() - timer.startedAt;\n\n const progress = element.querySelector(\".luma-progress\") as HTMLElement | null;\n if (progress) progress.style.animationPlayState = \"paused\";\n}\n\nfunction resumeTimer(id: string, element: HTMLElement) {\n const timer = timers.get(id);\n if (!timer) return;\n\n timer.startedAt = Date.now();\n timer.timeoutId = window.setTimeout(() => {\n toast.dismiss(id);\n }, timer.remaining);\n\n const progress = element.querySelector(\".luma-progress\") as HTMLElement | null;\n if (progress) progress.style.animationPlayState = \"running\";\n}\n\nfunction attachHoverEvents(element: HTMLElement, toastId: string) {\n element.addEventListener(\"mouseenter\", () => pauseTimer(toastId, element));\n element.addEventListener(\"mouseleave\", () => resumeTimer(toastId, element));\n}\n\n// ── Toast removal with exit animation ────────────────────────────────────────\n\nfunction removeToast(id: string, element: HTMLElement) {\n const timer = timers.get(id);\n\n if (timer) {\n clearTimeout(timer.timeoutId);\n timers.delete(id);\n }\n\n if (element.dataset.removing === \"true\") return;\n element.dataset.removing = \"true\";\n\n // Trigger exit animation class.\n // CSS uses [data-exit=\"slide\"] / [data-exit=\"fade\"] / [data-exit=\"none\"]\n // selectors on .luma-toast-exit to apply the right transform.\n requestAnimationFrame(() => {\n element.classList.add(\"luma-toast-exit\");\n });\n\n const cleanup = () => {\n const container = element.parentElement as HTMLElement | null;\n\n element.remove();\n renderedToasts.delete(id);\n\n // Remove the position container if it's now empty.\n if (container && container.childElementCount === 0) {\n const position = container.dataset.position as ToastPosition;\n removeContainer(position);\n }\n };\n\n // Primary: wait for the CSS transition to finish.\n const handleTransitionEnd = (event: TransitionEvent) => {\n if (event.target !== element) return;\n element.removeEventListener(\"transitionend\", handleTransitionEnd);\n cleanup();\n };\n\n element.addEventListener(\"transitionend\", handleTransitionEnd);\n\n // Fallback: in case transitionend never fires (reduced motion, no CSS).\n window.setTimeout(() => {\n if (element.isConnected) {\n element.removeEventListener(\"transitionend\", handleTransitionEnd);\n cleanup();\n }\n }, ANIMATION_EXIT_MS + 50);\n}\n"]}
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
type ToastType = "success" | "error" | "warning" | "info" | "loading" | "custom";
|
|
2
|
+
type ToastTheme = "linear" | "aurora" | "vision" | "minimal" | "cupertino" | "material" | "terminal" | "github" | "cyberpunk";
|
|
3
|
+
type ToastPosition = "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right";
|
|
4
|
+
/** Where the progress bar is rendered inside the card. */
|
|
5
|
+
type ToastProgressPosition = "top" | "bottom";
|
|
6
|
+
/** Enter animation style. */
|
|
7
|
+
type ToastAnimationEnter = "slide" | "fade" | "scale" | "bounce" | "none";
|
|
8
|
+
/** Exit animation style. */
|
|
9
|
+
type ToastAnimationExit = "slide" | "fade" | "none";
|
|
10
|
+
/** Global animation speed preset. */
|
|
11
|
+
type ToastAnimationSpeed = "slow" | "normal" | "fast";
|
|
12
|
+
/** Action button visual variant. */
|
|
13
|
+
type ToastActionVariant = "solid" | "outline" | "ghost";
|
|
14
|
+
interface ToastAction {
|
|
15
|
+
label: string;
|
|
16
|
+
onClick: () => void;
|
|
17
|
+
/** Visual style of the action button. Default: "solid" */
|
|
18
|
+
variant?: ToastActionVariant;
|
|
19
|
+
}
|
|
20
|
+
interface ToastOptions {
|
|
21
|
+
/** Stable id — useful for `toast.update()`. Auto-generated if omitted. */
|
|
22
|
+
id?: string;
|
|
23
|
+
/** Bold title text rendered above the description. */
|
|
24
|
+
title?: string;
|
|
25
|
+
/** Body text of the toast. */
|
|
26
|
+
description?: string;
|
|
27
|
+
/** Auto-dismiss delay in ms. Use `Infinity` to never auto-dismiss. Default: 4000 */
|
|
28
|
+
duration?: number;
|
|
29
|
+
/** Show the × close button. Default: true */
|
|
30
|
+
dismissible?: boolean;
|
|
31
|
+
/** Screen position of the toast. Default: "top-right" */
|
|
32
|
+
position?: ToastPosition;
|
|
33
|
+
/** Visual theme preset. Default: "linear" */
|
|
34
|
+
theme?: ToastTheme;
|
|
35
|
+
/** Action button shown inside the toast. */
|
|
36
|
+
action?: ToastAction;
|
|
37
|
+
/** Extra CSS class(es) added to the toast wrapper element. */
|
|
38
|
+
className?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Inline styles applied to the toast card.
|
|
41
|
+
* Supports both regular CSS properties and CSS custom properties.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* style: { "--luma-bg": "#1a1a2e", borderRadius: "24px" }
|
|
45
|
+
*/
|
|
46
|
+
style?: Record<string, string>;
|
|
47
|
+
/** Show the type icon. Default: true */
|
|
48
|
+
showIcon?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Dismiss the toast when the user clicks anywhere on the card body.
|
|
51
|
+
* Default: false
|
|
52
|
+
*/
|
|
53
|
+
closeOnClick?: boolean;
|
|
54
|
+
/** Where the progress bar is placed inside the card. Default: "bottom" */
|
|
55
|
+
progressPosition?: ToastProgressPosition;
|
|
56
|
+
/** Enter animation style. Default: "slide" */
|
|
57
|
+
animationEnter?: ToastAnimationEnter;
|
|
58
|
+
/** Exit animation style. Default: "slide" */
|
|
59
|
+
animationExit?: ToastAnimationExit;
|
|
60
|
+
}
|
|
61
|
+
interface ToastItem extends ToastOptions {
|
|
62
|
+
id: string;
|
|
63
|
+
type: ToastType;
|
|
64
|
+
title?: string;
|
|
65
|
+
description?: string;
|
|
66
|
+
action?: ToastAction;
|
|
67
|
+
duration: number;
|
|
68
|
+
dismissible: boolean;
|
|
69
|
+
position: ToastPosition;
|
|
70
|
+
theme: ToastTheme;
|
|
71
|
+
showIcon: boolean;
|
|
72
|
+
closeOnClick: boolean;
|
|
73
|
+
progressPosition: ToastProgressPosition;
|
|
74
|
+
animationEnter: ToastAnimationEnter;
|
|
75
|
+
animationExit: ToastAnimationExit;
|
|
76
|
+
createdAt: number;
|
|
77
|
+
visible: boolean;
|
|
78
|
+
}
|
|
79
|
+
interface ToastUpdateOptions {
|
|
80
|
+
type?: ToastType;
|
|
81
|
+
title?: string;
|
|
82
|
+
description?: string;
|
|
83
|
+
duration?: number;
|
|
84
|
+
dismissible?: boolean;
|
|
85
|
+
action?: ToastAction;
|
|
86
|
+
theme?: ToastTheme;
|
|
87
|
+
className?: string;
|
|
88
|
+
style?: Record<string, string>;
|
|
89
|
+
showIcon?: boolean;
|
|
90
|
+
progressPosition?: ToastProgressPosition;
|
|
91
|
+
}
|
|
92
|
+
interface PromiseToastOptions {
|
|
93
|
+
loading: ToastOptions;
|
|
94
|
+
success: ToastOptions;
|
|
95
|
+
error: ToastOptions;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
type Listener<T> = (payload: T) => void;
|
|
99
|
+
/**
|
|
100
|
+
* Tiny event emitter used internally by LumaToast.
|
|
101
|
+
*/
|
|
102
|
+
declare class EventEmitter<T> {
|
|
103
|
+
private listeners;
|
|
104
|
+
subscribe(listener: Listener<T>): () => void;
|
|
105
|
+
emit(payload: T): void;
|
|
106
|
+
clear(): void;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
interface ToastConfig {
|
|
110
|
+
/** Default auto-dismiss duration in ms. Default: 4000 */
|
|
111
|
+
duration?: number;
|
|
112
|
+
/** Default screen position. Default: "top-right" */
|
|
113
|
+
position?: ToastPosition;
|
|
114
|
+
/** Default visual theme. Default: "linear" */
|
|
115
|
+
theme?: ToastTheme;
|
|
116
|
+
/** Default dismissible flag. Default: true */
|
|
117
|
+
dismissible?: boolean;
|
|
118
|
+
/** Maximum number of toasts visible at once. Default: 5 */
|
|
119
|
+
maxVisible?: number;
|
|
120
|
+
/** Show the type icon by default. Default: true */
|
|
121
|
+
showIcon?: boolean;
|
|
122
|
+
/** Dismiss on card body click by default. Default: false */
|
|
123
|
+
closeOnClick?: boolean;
|
|
124
|
+
/** Default progress bar placement. Default: "bottom" */
|
|
125
|
+
progressPosition?: ToastProgressPosition;
|
|
126
|
+
/** Default enter animation. Default: "slide" */
|
|
127
|
+
animationEnter?: ToastAnimationEnter;
|
|
128
|
+
/** Default exit animation. Default: "slide" */
|
|
129
|
+
animationExit?: ToastAnimationExit;
|
|
130
|
+
/**
|
|
131
|
+
* Global animation speed preset.
|
|
132
|
+
* Applies `--luma-duration-enter/exit/stack` CSS variables on <html>.
|
|
133
|
+
* Default: "normal"
|
|
134
|
+
*/
|
|
135
|
+
animationSpeed?: ToastAnimationSpeed;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Set global defaults for all toasts.
|
|
139
|
+
* Per-toast options always override these.
|
|
140
|
+
*
|
|
141
|
+
* @example
|
|
142
|
+
* configure({
|
|
143
|
+
* position: "bottom-right",
|
|
144
|
+
* theme: "minimal",
|
|
145
|
+
* duration: 3000,
|
|
146
|
+
* progressPosition: "top",
|
|
147
|
+
* animationEnter: "scale",
|
|
148
|
+
* animationSpeed: "fast",
|
|
149
|
+
* });
|
|
150
|
+
*/
|
|
151
|
+
declare function configure(config: ToastConfig): void;
|
|
152
|
+
declare class ToastManager {
|
|
153
|
+
private visible;
|
|
154
|
+
private queue;
|
|
155
|
+
readonly changes: EventEmitter<ToastItem[]>;
|
|
156
|
+
/**
|
|
157
|
+
* Returns all visible toasts.
|
|
158
|
+
*/
|
|
159
|
+
getToasts(): ToastItem[];
|
|
160
|
+
/**
|
|
161
|
+
* Create a new toast.
|
|
162
|
+
*/
|
|
163
|
+
create(type: ToastType, options?: ToastOptions): ToastItem;
|
|
164
|
+
/**
|
|
165
|
+
* Remove a toast by id.
|
|
166
|
+
*/
|
|
167
|
+
dismiss(id: string): void;
|
|
168
|
+
/**
|
|
169
|
+
* Remove all visible and queued toasts.
|
|
170
|
+
*/
|
|
171
|
+
dismissAll(): void;
|
|
172
|
+
/**
|
|
173
|
+
* Remove the most recently added visible toast.
|
|
174
|
+
*/
|
|
175
|
+
dismissLatest(): void;
|
|
176
|
+
/**
|
|
177
|
+
* Update an existing toast by id.
|
|
178
|
+
* Works on both visible and queued toasts.
|
|
179
|
+
*/
|
|
180
|
+
update(id: string, updates: ToastUpdateOptions): ToastItem | null;
|
|
181
|
+
}
|
|
182
|
+
declare const toastManager: ToastManager;
|
|
183
|
+
|
|
184
|
+
declare const toast: {
|
|
185
|
+
/**
|
|
186
|
+
* Show a success toast.
|
|
187
|
+
*/
|
|
188
|
+
success(message: string, options?: ToastOptions): ToastItem;
|
|
189
|
+
/**
|
|
190
|
+
* Show an error toast.
|
|
191
|
+
*/
|
|
192
|
+
error(message: string, options?: ToastOptions): ToastItem;
|
|
193
|
+
/**
|
|
194
|
+
* Show a warning toast.
|
|
195
|
+
*/
|
|
196
|
+
warning(message: string, options?: ToastOptions): ToastItem;
|
|
197
|
+
/**
|
|
198
|
+
* Show an info toast.
|
|
199
|
+
*/
|
|
200
|
+
info(message: string, options?: ToastOptions): ToastItem;
|
|
201
|
+
/**
|
|
202
|
+
* Show a persistent loading toast that must be dismissed manually
|
|
203
|
+
* or converted via `toast.update()` / `toast.promise()`.
|
|
204
|
+
*/
|
|
205
|
+
loading(message: string, options?: ToastOptions): ToastItem;
|
|
206
|
+
/**
|
|
207
|
+
* Show a fully custom toast.
|
|
208
|
+
* You control the title, description, action, theme, and position.
|
|
209
|
+
*
|
|
210
|
+
* @example
|
|
211
|
+
* toast.custom("Custom notification", { title: "Hey!", theme: "cyberpunk" });
|
|
212
|
+
*/
|
|
213
|
+
custom(message: string, options?: ToastOptions): ToastItem;
|
|
214
|
+
/**
|
|
215
|
+
* Dismiss a toast by id.
|
|
216
|
+
*/
|
|
217
|
+
dismiss(id: string): void;
|
|
218
|
+
/**
|
|
219
|
+
* Dismiss all visible and queued toasts.
|
|
220
|
+
*/
|
|
221
|
+
dismissAll(): void;
|
|
222
|
+
/**
|
|
223
|
+
* Dismiss the most recently added visible toast.
|
|
224
|
+
*/
|
|
225
|
+
dismissLatest(): void;
|
|
226
|
+
/**
|
|
227
|
+
* Update an existing toast's properties.
|
|
228
|
+
* Useful for transitioning a loading toast to success or error.
|
|
229
|
+
*/
|
|
230
|
+
update(id: string, updates: ToastUpdateOptions): ToastItem | null;
|
|
231
|
+
/**
|
|
232
|
+
* Track a promise: show a loading toast, then auto-transition to
|
|
233
|
+
* success or error based on the promise outcome.
|
|
234
|
+
*
|
|
235
|
+
* @example
|
|
236
|
+
* toast.promise(fetch("/api/save"), {
|
|
237
|
+
* loading: { description: "Saving..." },
|
|
238
|
+
* success: { description: "Saved!" },
|
|
239
|
+
* error: { description: "Failed to save." }
|
|
240
|
+
* });
|
|
241
|
+
*/
|
|
242
|
+
promise<T>(promise: Promise<T>, options: PromiseToastOptions): Promise<T>;
|
|
243
|
+
/**
|
|
244
|
+
* Subscribe to toast state changes.
|
|
245
|
+
* Returns an unsubscribe function.
|
|
246
|
+
*
|
|
247
|
+
* @example
|
|
248
|
+
* const unsub = toast.subscribe((toasts) => console.log(toasts));
|
|
249
|
+
* // later:
|
|
250
|
+
* unsub();
|
|
251
|
+
*/
|
|
252
|
+
subscribe(listener: (toasts: ReturnType<typeof toastManager.getToasts>) => void): () => void;
|
|
253
|
+
/**
|
|
254
|
+
* Set global defaults for all toasts.
|
|
255
|
+
* Per-toast options always override these.
|
|
256
|
+
*
|
|
257
|
+
* @example
|
|
258
|
+
* toast.configure({ position: "bottom-right", theme: "minimal", duration: 3000 });
|
|
259
|
+
*/
|
|
260
|
+
configure: typeof configure;
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* LumaToast design tokens.
|
|
265
|
+
*
|
|
266
|
+
* These constants map to CSS custom properties used by the themes.
|
|
267
|
+
* Override any of these in your CSS to customise LumaToast globally
|
|
268
|
+
* or per-theme without writing extra class selectors.
|
|
269
|
+
*
|
|
270
|
+
* @example
|
|
271
|
+
* ```css
|
|
272
|
+
* :root {
|
|
273
|
+
* --luma-bg: #1a1a2e;
|
|
274
|
+
* --luma-radius: 24px;
|
|
275
|
+
* --luma-font: "Inter", sans-serif;
|
|
276
|
+
* }
|
|
277
|
+
* ```
|
|
278
|
+
*/
|
|
279
|
+
declare const DURATION_SHORT = 2000;
|
|
280
|
+
declare const DURATION_DEFAULT = 4000;
|
|
281
|
+
declare const DURATION_LONG = 6000;
|
|
282
|
+
declare const DURATION_INFINITE: number;
|
|
283
|
+
declare const ANIMATION_ENTER_MS = 320;
|
|
284
|
+
declare const ANIMATION_EXIT_MS = 300;
|
|
285
|
+
declare const ANIMATION_STACK_MS = 280;
|
|
286
|
+
declare const TOAST_WIDTH_PX = 340;
|
|
287
|
+
declare const TOAST_GAP_PX = 12;
|
|
288
|
+
declare const Z_INDEX_BASE = 1000;
|
|
289
|
+
declare const CSS_VARS: {
|
|
290
|
+
readonly WIDTH: "--luma-width";
|
|
291
|
+
readonly RADIUS: "--luma-radius";
|
|
292
|
+
readonly PADDING: "--luma-padding";
|
|
293
|
+
readonly GAP: "--luma-gap";
|
|
294
|
+
readonly BG: "--luma-bg";
|
|
295
|
+
readonly BORDER_COLOR: "--luma-border-color";
|
|
296
|
+
readonly BORDER_WIDTH: "--luma-border-width";
|
|
297
|
+
readonly SHADOW: "--luma-shadow";
|
|
298
|
+
readonly BACKDROP: "--luma-backdrop";
|
|
299
|
+
readonly FONT: "--luma-font";
|
|
300
|
+
readonly TITLE_SIZE: "--luma-title-size";
|
|
301
|
+
readonly TITLE_WEIGHT: "--luma-title-weight";
|
|
302
|
+
readonly TITLE_COLOR: "--luma-title-color";
|
|
303
|
+
readonly DESC_SIZE: "--luma-desc-size";
|
|
304
|
+
readonly DESC_COLOR: "--luma-desc-color";
|
|
305
|
+
readonly LINE_HEIGHT: "--luma-line-height";
|
|
306
|
+
readonly LETTER_SPACING: "--luma-letter-spacing";
|
|
307
|
+
readonly ICON_SIZE: "--luma-icon-size";
|
|
308
|
+
readonly CLOSE_COLOR: "--luma-close-color";
|
|
309
|
+
readonly CLOSE_SIZE: "--luma-close-size";
|
|
310
|
+
readonly ACTION_BG: "--luma-action-bg";
|
|
311
|
+
readonly ACTION_COLOR: "--luma-action-color";
|
|
312
|
+
readonly ACTION_HOVER_BG: "--luma-action-hover-bg";
|
|
313
|
+
readonly ACTION_RADIUS: "--luma-action-radius";
|
|
314
|
+
readonly ACTION_PADDING: "--luma-action-padding";
|
|
315
|
+
readonly ACTION_SIZE: "--luma-action-size";
|
|
316
|
+
readonly ACTION_WEIGHT: "--luma-action-weight";
|
|
317
|
+
readonly ACTION_BORDER: "--luma-action-border";
|
|
318
|
+
readonly ACTION_HOVER_BORDER: "--luma-action-hover-border";
|
|
319
|
+
readonly PROGRESS_HEIGHT: "--luma-progress-height";
|
|
320
|
+
readonly PROGRESS_RADIUS: "--luma-progress-radius";
|
|
321
|
+
readonly PROGRESS_SUCCESS: "--luma-progress-success";
|
|
322
|
+
readonly PROGRESS_ERROR: "--luma-progress-error";
|
|
323
|
+
readonly PROGRESS_WARNING: "--luma-progress-warning";
|
|
324
|
+
readonly PROGRESS_INFO: "--luma-progress-info";
|
|
325
|
+
readonly PROGRESS_LOADING: "--luma-progress-loading";
|
|
326
|
+
readonly PROGRESS_CUSTOM: "--luma-progress-custom";
|
|
327
|
+
readonly ACCENT_SUCCESS: "--luma-accent-success";
|
|
328
|
+
readonly ACCENT_ERROR: "--luma-accent-error";
|
|
329
|
+
readonly ACCENT_WARNING: "--luma-accent-warning";
|
|
330
|
+
readonly ACCENT_INFO: "--luma-accent-info";
|
|
331
|
+
readonly DURATION_ENTER: "--luma-duration-enter";
|
|
332
|
+
readonly DURATION_EXIT: "--luma-duration-exit";
|
|
333
|
+
readonly DURATION_STACK: "--luma-duration-stack";
|
|
334
|
+
};
|
|
335
|
+
declare const CLASS_CONTAINER = "luma-toast-container";
|
|
336
|
+
declare const CLASS_TOAST = "luma-toast";
|
|
337
|
+
declare const CLASS_CARD = "luma-toast-card";
|
|
338
|
+
declare const CLASS_ICON = "luma-toast-icon";
|
|
339
|
+
declare const CLASS_CONTENT = "luma-toast-content";
|
|
340
|
+
declare const CLASS_TITLE = "luma-toast-title";
|
|
341
|
+
declare const CLASS_DESCRIPTION = "luma-toast-description";
|
|
342
|
+
declare const CLASS_ACTION = "luma-toast-action";
|
|
343
|
+
declare const CLASS_CLOSE = "luma-toast-close";
|
|
344
|
+
declare const CLASS_PROGRESS = "luma-progress";
|
|
345
|
+
declare const CLASS_EXIT = "luma-toast-exit";
|
|
346
|
+
|
|
347
|
+
declare const DEFAULT_DURATION = 4000;
|
|
348
|
+
declare const DEFAULT_POSITION: "top-right";
|
|
349
|
+
declare const DEFAULT_THEME: "linear";
|
|
350
|
+
declare const DEFAULT_DISMISSIBLE = true;
|
|
351
|
+
declare const DEFAULT_SHOW_ICON = true;
|
|
352
|
+
declare const DEFAULT_CLOSE_ON_CLICK = false;
|
|
353
|
+
declare const DEFAULT_PROGRESS_POS: "bottom";
|
|
354
|
+
declare const DEFAULT_ANIMATION_ENTER: "slide";
|
|
355
|
+
declare const DEFAULT_ANIMATION_EXIT: "slide";
|
|
356
|
+
declare const DEFAULT_ANIMATION_SPEED: "normal";
|
|
357
|
+
declare const MAX_VISIBLE_TOASTS = 5;
|
|
358
|
+
declare const STACK_GAP = 12;
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* Initialize the DOM renderer. Must be called once before showing toasts.
|
|
362
|
+
* Safe to call multiple times — subsequent calls are no-ops.
|
|
363
|
+
*/
|
|
364
|
+
declare function initializeRenderer(): void;
|
|
365
|
+
|
|
366
|
+
export { ANIMATION_ENTER_MS, ANIMATION_EXIT_MS, ANIMATION_STACK_MS, CLASS_ACTION, CLASS_CARD, CLASS_CLOSE, CLASS_CONTAINER, CLASS_CONTENT, CLASS_DESCRIPTION, CLASS_EXIT, CLASS_ICON, CLASS_PROGRESS, CLASS_TITLE, CLASS_TOAST, CSS_VARS, DEFAULT_ANIMATION_ENTER, DEFAULT_ANIMATION_EXIT, DEFAULT_ANIMATION_SPEED, DEFAULT_CLOSE_ON_CLICK, DEFAULT_DISMISSIBLE, DEFAULT_DURATION, DEFAULT_POSITION, DEFAULT_PROGRESS_POS, DEFAULT_SHOW_ICON, DEFAULT_THEME, DURATION_DEFAULT, DURATION_INFINITE, DURATION_LONG, DURATION_SHORT, MAX_VISIBLE_TOASTS, type PromiseToastOptions, STACK_GAP, TOAST_GAP_PX, TOAST_WIDTH_PX, type ToastAction, type ToastActionVariant, type ToastAnimationEnter, type ToastAnimationExit, type ToastAnimationSpeed, type ToastItem, type ToastOptions, type ToastPosition, type ToastProgressPosition, type ToastTheme, type ToastType, type ToastUpdateOptions, Z_INDEX_BASE, configure, initializeRenderer, toast, toastManager };
|