{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "sonner",
  "title": "sonner",
  "dependencies": [
    "sonner@^2"
  ],
  "registryDependencies": [
    "@dwellir/dwellir-theme",
    "@dwellir/utils",
    "@dwellir/button",
    "@dwellir/rune-icons"
  ],
  "files": [
    {
      "path": "components/ui/sonner.tsx",
      "content": "'use client';\n\nimport { Toaster as Sonner, type ToasterProps as SonnerProps } from 'sonner';\nimport {\n  RuneError,\n  RuneInfo,\n  RuneLoader,\n  RuneSuccess,\n  RuneWarning,\n} from '@/components/brand/rune-icons';\nimport { buttonVariants } from '@/components/ui/button';\nimport { cn } from '@/lib/utils';\n\n/*\n * The toasts take the popover's surface. The type colours only the icon, with\n * the same inks as the alert tones; info has no colour of its own.\n */\nconst TOAST_ICONS: NonNullable<SonnerProps['icons']> = {\n  success: <RuneSuccess className=\"size-4 text-accent-ink\" />,\n  info: <RuneInfo className=\"size-4 text-foreground\" />,\n  warning: <RuneWarning className=\"size-4 text-warning-ink\" />,\n  error: <RuneError className=\"size-4 text-destructive\" />,\n  loading: <RuneLoader className=\"size-4 animate-spin text-muted-foreground\" />,\n};\n\ntype ToastClassNames = NonNullable<NonNullable<SonnerProps['toastOptions']>['classNames']>;\n\n/*\n * Sonner only places and stacks the toasts (unstyled). The stacked toasts\n * behind the front one hide their content, as sonner's own look does.\n */\nconst TOAST_CLASSES: ToastClassNames = {\n  toast:\n    'flex w-(--width) items-start gap-3 rounded-xl border border-border bg-popover p-4 font-sans text-sm text-popover-foreground shadow-popover outline-none focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring has-[[data-close-button]]:pr-10 data-[expanded=false]:data-[front=false]:*:opacity-0',\n  icon: 'relative flex size-5 shrink-0 items-center justify-center',\n  content: 'flex min-w-0 flex-1 flex-col gap-0.5',\n  title: 'leading-snug font-bold',\n  description: 'leading-snug text-muted-foreground',\n  actionButton: buttonVariants({ size: 'xs', className: 'shrink-0 self-center' }),\n  cancelButton: buttonVariants({ variant: 'ghost', size: 'xs', className: 'shrink-0 self-center' }),\n  closeButton:\n    'absolute top-3 right-3 grid size-6 place-items-center rounded-full text-muted-foreground transition-colors outline-none hover:bg-muted hover:text-foreground focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring',\n};\n\n/* The caller's classes join the defaults key by key, so cn() lets them override one. */\nfunction mergeClassNames(custom: ToastClassNames = {}): ToastClassNames {\n  const keys = new Set([...Object.keys(TOAST_CLASSES), ...Object.keys(custom)]);\n  return Object.fromEntries(\n    [...keys].map((key) => {\n      const name = key as keyof ToastClassNames;\n      return [name, cn(TOAST_CLASSES[name], custom[name])];\n    }),\n  );\n}\n\n/*\n * Mount once, in the root layout. Show toasts with toast() from 'sonner'.\n * theme and richColors are accepted, so upstream's call sites compile, but have\n * no effect: sonner's dark and rich colour rules also reach unstyled toasts and\n * would paint over the tokens (a light description on a light popover). The\n * toasts follow .dark on <html>; the type colours only the icon. icons replace\n * the defaults one type at a time.\n */\nfunction Toaster({\n  toastOptions,\n  icons,\n  theme: _theme,\n  richColors: _richColors,\n  ...props\n}: SonnerProps) {\n  return (\n    /* Sonner's list is fixed to the viewport; this wrapper only names the part. */\n    <div data-slot=\"toaster\" className=\"contents\">\n      <Sonner\n        icons={{ ...TOAST_ICONS, ...icons }}\n        toastOptions={{\n          ...toastOptions,\n          unstyled: true,\n          classNames: mergeClassNames(toastOptions?.classNames),\n        }}\n        {...props}\n      />\n    </div>\n  );\n}\n\nexport { Toaster };\n",
      "type": "registry:ui"
    }
  ],
  "type": "registry:ui"
}