import { type JSX, Show, createSignal } from 'solid-js'; import { Info, TriangleAlert, CircleAlert, CircleCheck, X } from 'lucide-solid'; import { cn } from '../utils/cn'; import { renderIcon } from './icon'; export type NoticeSeverity = 'neutral' | 'info' | 'warning' | 'error' | 'success'; const SEVERITY_ICON = { neutral: Info, info: Info, warning: TriangleAlert, error: CircleAlert, success: CircleCheck }; /** Icon tint per severity. Neutral stays muted; the rest use the kit's tool hues * (the same on-brand, AA-checked colors used by tool/status chips). */ const ICON_TONE: Record = { neutral: 'text-muted-foreground', info: 'text-tool-blue', warning: 'text-tool-amber', error: 'text-tool-red', success: 'text-tool-green', }; /** The default leading icon for a notice: `null` when `icon="none"`, the named * icon when one is given, else the severity glyph. Exported so the `kai-notice` * facade can use it as the fallback inside a `slot="icon"` escape hatch. */ export function noticeIconNode(severity: NoticeSeverity, icon?: string): JSX.Element { if (icon === 'none') return null; if (icon) return renderIcon(icon, { class: cn('size-4 shrink-0', ICON_TONE[severity]) }); const I = SEVERITY_ICON[severity]; return