{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "toast",
  "title": "Toast",
  "description": "Astro notifications with status icons, actions, stacking, and promise states.",
  "dependencies": [
    "@data-slot/toast",
    "@lucide/astro",
    "cn"
  ],
  "registryDependencies": [
    "@gnostic/button"
  ],
  "files": [
    {
      "path": "packages/ui/src/components/ui/toast/index.ts",
      "content": "export { default as Toast } from './toast.astro'\nexport { default as ToastAction } from './toast-action.astro'\nexport { default as ToastClose } from './toast-close.astro'\nexport { default as ToastContent } from './toast-content.astro'\nexport { default as ToastDescription } from './toast-description.astro'\nexport { default as ToastIcon } from './toast-icon.astro'\nexport { default as ToastItem } from './toast-item.astro'\nexport { default as ToastTemplate } from './toast-template.astro'\nexport { default as ToastTitle } from './toast-title.astro'\nexport { default as ToastViewport } from './toast-viewport.astro'\n\nexport type { ToastProps } from './types.ts'\n",
      "type": "registry:file",
      "target": "~/src/components/ui/toast/index.ts"
    },
    {
      "path": "packages/ui/src/components/ui/toast/toast-action.astro",
      "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport { cn } from \"cn\"\nimport { buttonVariants } from \"../button/button-variants.ts\"\n\ntype Props = HTMLAttributes<\"button\">\nconst { class: className, type = \"button\", ...props } = Astro.props\n---\n\n<button\n  data-slot=\"toast-action\"\n  type={type}\n  class={cn(\"shrink-0\", buttonVariants({ size: \"xs\" }), className)}\n  {...props}\n>\n  <slot />\n</button>\n",
      "type": "registry:file",
      "target": "~/src/components/ui/toast/toast-action.astro"
    },
    {
      "path": "packages/ui/src/components/ui/toast/toast-close.astro",
      "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport XIcon from \"@lucide/astro/icons/x\"\nimport { cn } from \"cn\"\n\ntype Props = HTMLAttributes<\"button\">\nconst {\n  class: className,\n  type = \"button\",\n  \"aria-label\": label = \"Close notification\",\n  ...props\n} = Astro.props\n---\n\n<button\n  data-slot=\"toast-close\"\n  type={type}\n  aria-label={label}\n  class={cn(\"inline-flex size-7 shrink-0 cursor-pointer items-center justify-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:ring-[3px] focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4\", className)}\n  {...props}\n>\n  <slot>\n    <XIcon aria-hidden=\"true\" />\n  </slot>\n</button>\n",
      "type": "registry:file",
      "target": "~/src/components/ui/toast/toast-close.astro"
    },
    {
      "path": "packages/ui/src/components/ui/toast/toast-content.astro",
      "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport { cn } from \"cn\"\n\ntype Props = HTMLAttributes<\"div\">\nconst { class: className, ...props } = Astro.props\n---\n\n<div\n  data-slot=\"toast-content\"\n  class={cn(\"flex min-w-0 flex-1 flex-col gap-0.5 overflow-hidden\", className)}\n  {...props}\n>\n  <slot />\n</div>\n",
      "type": "registry:file",
      "target": "~/src/components/ui/toast/toast-content.astro"
    },
    {
      "path": "packages/ui/src/components/ui/toast/toast-description.astro",
      "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport { cn } from \"cn\"\n\ntype Props = HTMLAttributes<\"div\">\nconst { class: className, ...props } = Astro.props\n---\n\n<div\n  data-slot=\"toast-description\"\n  class={cn(\"text-muted-foreground wrap-anywhere\", className)}\n  {...props}\n>\n  <slot />\n</div>\n",
      "type": "registry:file",
      "target": "~/src/components/ui/toast/toast-description.astro"
    },
    {
      "path": "packages/ui/src/components/ui/toast/toast-icon.astro",
      "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport CircleAlertIcon from \"@lucide/astro/icons/circle-exclamation-point\"\nimport CircleCheckIcon from \"@lucide/astro/icons/circle-check\"\nimport InfoIcon from \"@lucide/astro/icons/info\"\nimport LoaderCircleIcon from \"@lucide/astro/icons/loader-circle\"\nimport TriangleAlertIcon from \"@lucide/astro/icons/triangle-exclamation-point\"\nimport { cn } from \"cn\"\n\ntype Props = HTMLAttributes<\"div\">\nconst { class: className, ...props } = Astro.props\n---\n\n<div\n  data-slot=\"toast-icon\"\n  aria-hidden=\"true\"\n  class={cn(\"shrink-0 self-center group-has-[[data-slot=toast-description]:not([hidden])]/toast:self-start group-data-[type=default]/toast:hidden [&_svg]:pointer-events-none [&_svg]:hidden [&_svg]:h-lh [&_svg]:w-4 group-data-[type=success]/toast:text-success group-data-[type=error]/toast:text-destructive group-data-[type=info]/toast:text-info group-data-[type=warning]/toast:text-warning group-data-[type=loading]/toast:opacity-80 group-data-[type=success]/toast:[&>[data-toast-icon=success]]:block group-data-[type=error]/toast:[&>[data-toast-icon=error]]:block group-data-[type=info]/toast:[&>[data-toast-icon=info]]:block group-data-[type=warning]/toast:[&>[data-toast-icon=warning]]:block group-data-[type=loading]/toast:[&>[data-toast-icon=loading]]:block group-data-[type=loading]/toast:[&>[data-toast-icon=loading]]:animate-spin motion-reduce:[&_svg]:animate-none\", className)}\n  {...props}\n>\n  <slot>\n    <CircleCheckIcon data-toast-icon=\"success\" />\n    <CircleAlertIcon data-toast-icon=\"error\" />\n    <InfoIcon data-toast-icon=\"info\" />\n    <TriangleAlertIcon data-toast-icon=\"warning\" />\n    <LoaderCircleIcon data-toast-icon=\"loading\" />\n  </slot>\n</div>\n",
      "type": "registry:file",
      "target": "~/src/components/ui/toast/toast-icon.astro"
    },
    {
      "path": "packages/ui/src/components/ui/toast/toast-item.astro",
      "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport { cn } from \"cn\"\n\ntype Props = HTMLAttributes<\"li\">\nconst { class: className, ...props } = Astro.props\n---\n\n<li\n  data-slot=\"toast-item\"\n  role=\"status\"\n  aria-atomic=\"true\"\n  class={cn(\"rounded-lg pointer-events-auto absolute inset-x-0 bottom-0 flex w-full touch-none items-center gap-2 border bg-popover px-3.5 py-3 text-sm text-popover-foreground opacity-0 shadow-lg/5 outline-none select-none origin-bottom not-dark:bg-clip-padding before:pointer-events-none before:absolute before:inset-0 before:rounded-[inherit] before:shadow-[0_1px_--theme(--color-black/4%)] dark:before:shadow-[0_-1px_--theme(--color-white/6%)] group-data-[position*=top]/toast-viewport:top-0 group-data-[position*=top]/toast-viewport:bottom-auto group-data-[position*=top]/toast-viewport:origin-top [--toast-base-y:0px] [--toast-scale:1] [--toast-x:var(--toast-swipe-amount-x,0px)] [--toast-y:calc(var(--toast-lift,-1)*-100%)] transform-[translate3d(var(--toast-x),var(--toast-y),0)_scale(var(--toast-scale))] [transition:transform_.32s_cubic-bezier(.22,1,.36,1),opacity_.32s,height_.15s] data-[mounted=true]:[--toast-y:calc(var(--toast-base-y)+var(--toast-swipe-amount-y,0px))] [&[data-mounted=true][data-visible=true]:not([data-removed=true])]:opacity-100 [&[data-front=false][data-expanded=false]]:[--toast-base-y:calc(var(--toast-collapsed-offset-y,0px)*var(--toast-lift,-1))] [&[data-front=false][data-expanded=false]]:[--toast-scale:calc(max(0,1-var(--toast-index,0)*.05))] [&[data-front=false][data-expanded=false]]:h-(--toast-front-height) data-[expanded=true]:[--toast-base-y:calc(var(--toast-offset,0px)*var(--toast-lift,-1))] data-[expanded=true]:h-(--toast-initial-height) [&[data-front=false][data-expanded=false]]:*:opacity-0 [&[data-front=false][data-expanded=false]]:*:pointer-events-none data-[visible=false]:pointer-events-none data-[removed=true]:[--toast-y:calc(var(--toast-base-y)+var(--toast-lift,-1)*-100%)] [&[data-removed=true][data-swipe-out=true]]:[--toast-x:var(--toast-swipe-end-x,0px)] [&[data-removed=true][data-swipe-out=true]]:[--toast-y:calc(var(--toast-base-y)+var(--toast-swipe-end-y,0px))] data-[swiping=true]:transition-none after:absolute after:left-0 after:bottom-full after:h-[calc(var(--toast-gap)+1px)] after:w-full group-data-[position*=top]/toast-viewport:after:top-full group-data-[position*=top]/toast-viewport:after:bottom-auto motion-reduce:transition-none group/toast\", className)}\n  {...props}\n>\n  <slot />\n</li>\n",
      "type": "registry:file",
      "target": "~/src/components/ui/toast/toast-item.astro"
    },
    {
      "path": "packages/ui/src/components/ui/toast/toast-template.astro",
      "content": "---\nimport { cn } from \"cn\"\n\nimport ToastAction from \"./toast-action.astro\"\nimport ToastClose from \"./toast-close.astro\"\nimport ToastContent from \"./toast-content.astro\"\nimport ToastDescription from \"./toast-description.astro\"\nimport ToastIcon from \"./toast-icon.astro\"\nimport ToastItem from \"./toast-item.astro\"\nimport ToastTitle from \"./toast-title.astro\"\n\ntype Props = astroHTML.JSX.HTMLAttributes\nconst { class: className, ...props } = Astro.props\n---\n\n<template data-slot=\"toast-template\" class={cn(className)} {...props}>\n  <slot>\n    <ToastItem>\n      <ToastIcon />\n      <ToastContent>\n        <ToastTitle />\n        <ToastDescription />\n      </ToastContent>\n      <ToastAction />\n      <ToastClose />\n    </ToastItem>\n  </slot>\n</template>\n",
      "type": "registry:file",
      "target": "~/src/components/ui/toast/toast-template.astro"
    },
    {
      "path": "packages/ui/src/components/ui/toast/toast-title.astro",
      "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport { cn } from \"cn\"\n\ntype Props = HTMLAttributes<\"div\">\nconst { class: className, ...props } = Astro.props\n---\n\n<div data-slot=\"toast-title\" class={cn(\"font-medium wrap-anywhere\", className)} {...props}>\n  <slot />\n</div>\n",
      "type": "registry:file",
      "target": "~/src/components/ui/toast/toast-title.astro"
    },
    {
      "path": "packages/ui/src/components/ui/toast/toast-viewport.astro",
      "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport { cn } from \"cn\"\n\ntype Props = HTMLAttributes<\"ol\">\nconst {\n  class: className,\n  \"aria-label\": label = \"Notifications\",\n  ...props\n} = Astro.props\n---\n\n<ol\n  data-slot=\"toast-viewport\"\n  role=\"region\"\n  aria-label={label}\n  class={cn(\"pointer-events-none fixed z-60 m-0 h-[var(--toast-stack-size,0px)] w-[calc(100%-var(--toast-inset)*2)] max-w-90 list-none p-0 font-sans [--toast-inset:--spacing(4)] [--toast-gap:12px] [--toast-collapsed-peek:12px] sm:[--toast-inset:--spacing(8)] data-[position*=top]:top-(--toast-inset) data-[position*=bottom]:bottom-(--toast-inset) data-[position*=left]:left-(--toast-inset) data-[position*=right]:right-(--toast-inset) data-[position*=center]:left-1/2 data-[position*=center]:-translate-x-1/2 group/toast-viewport\", className)}\n  {...props}\n>\n  <slot />\n</ol>\n",
      "type": "registry:file",
      "target": "~/src/components/ui/toast/toast-viewport.astro"
    },
    {
      "path": "packages/ui/src/components/ui/toast/toast.astro",
      "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\nimport { cn } from \"cn\"\n\nimport ToastTemplate from \"./toast-template.astro\"\nimport ToastViewport from \"./toast-viewport.astro\"\nimport type { ToastProps } from \"./types.ts\"\n\ntype Props = HTMLAttributes<\"div\"> & ToastProps\n\nconst {\n  class: className,\n  position = \"bottom-right\",\n  limit = 3,\n  duration = 5000,\n  pauseOnHover = true,\n  pauseOnFocus = true,\n  portal = true,\n  ...props\n} = Astro.props\n---\n\n<div\n  data-slot=\"toast\"\n  data-position={position}\n  data-limit={limit}\n  data-duration={duration}\n  data-pause-on-hover={String(pauseOnHover)}\n  data-pause-on-focus={String(pauseOnFocus)}\n  data-portal={String(portal)}\n  class={cn(className)}\n  {...props}\n>\n  <slot>\n    <ToastTemplate />\n    <ToastViewport />\n  </slot>\n</div>\n\n<script>\n  import { createToast, type ToastController } from \"@data-slot/toast\"\n\n  const controllers = new Map<Element, ToastController>()\n  const init = () => {\n    for (const [root, controller] of controllers) {\n      if (!root.isConnected) {\n        controller.destroy()\n        controllers.delete(root)\n      }\n    }\n    document.querySelectorAll('[data-slot=\"toast\"]').forEach((root) => {\n      if (!controllers.has(root)) controllers.set(root, createToast(root))\n    })\n  }\n\n  init()\n  document.addEventListener(\"astro:page-load\", init)\n  document.addEventListener(\"astro:before-swap\", () => {\n    for (const controller of controllers.values()) controller.destroy()\n    controllers.clear()\n  })\n</script>\n",
      "type": "registry:file",
      "target": "~/src/components/ui/toast/toast.astro"
    },
    {
      "path": "packages/ui/src/components/ui/toast/types.ts",
      "content": "import type { ToastPosition } from '@data-slot/toast'\nimport type {\n    ToastShowOptions as ToastShowOptionsType,\n    ToastAction as ToastActionType,\n    ToastUpdateOptions as ToastUpdateOptionsType,\n    ToastPromiseOptions as ToastPromiseOptionsType,\n    ToastOptions as ToastOptionsType,\n} from '@data-slot/toast'\n\nexport type ToastAction = ToastActionType\nexport type ToastUpdateOptions = ToastUpdateOptionsType\nexport type ToastPromiseOptions<T> = ToastPromiseOptionsType<T>\nexport type ToastOptions = ToastOptionsType\nexport type ToastShowOptions = ToastShowOptionsType\n\n/** Options for a notification stack. */\nexport interface ToastProps {\n    /**\n     * Position of the stack in the page viewport.\n     * @default \"bottom-right\"\n     */\n    position?: ToastPosition\n    /**\n     * Maximum number of visible notifications.\n     * @default 3\n     */\n    limit?: number\n    /**\n     * Time before dismissal, in milliseconds. Use 0 to keep a toast open.\n     * @default 5000\n     */\n    duration?: number\n    /**\n     * Pause dismissal while the pointer is over the stack.\n     * @default true\n     */\n    pauseOnHover?: boolean\n    /**\n     * Pause dismissal while focus is inside the stack.\n     * @default true\n     */\n    pauseOnFocus?: boolean\n    /**\n     * Move the viewport to document.body to escape clipping containers.\n     * @default true\n     */\n    portal?: boolean\n}\n",
      "type": "registry:file",
      "target": "~/src/components/ui/toast/types.ts"
    }
  ],
  "meta": {
    "framework": "astro",
    "source": "@gnostic/ui",
    "testedDependencies": {
      "@data-slot/toast": "^1.1.2",
      "@lucide/astro": "^1.68.0",
      "cn": "0.5.2"
    }
  },
  "docs": "https://ui.gnosticai.com/components/toast",
  "categories": [
    "ui"
  ],
  "type": "registry:ui"
}
