{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "toast-stack",
  "title": "Toast stack",
  "description": "Self-contained toaster with toast() API: cards stack and expand on hover, swipe away with a drag, morph from loading to success or error for promises, and pause their timers on hover.",
  "dependencies": [
    "lucide-react",
    "motion"
  ],
  "registryDependencies": [
    "https://goodui.dev/r/goodui-motion.json",
    "https://goodui.dev/r/locale.json",
    "https://goodui.dev/r/sounds.json"
  ],
  "files": [
    {
      "path": "registry/components/feedback/toast-stack.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { AnimatePresence, animate, motion, useMotionValue, useReducedMotion, useTransform, type PanInfo } from \"motion/react\"\nimport { Info, TriangleAlert, X } from \"lucide-react\"\nimport { cn } from \"@/lib/utils\"\nimport { useLabels } from \"@/lib/goodui-locale\"\nimport type { SoundName } from \"@/lib/goodui-sounds\"\nimport { GooduiTokens, ease, spring as springs } from \"@/lib/goodui-motion\"\n\nconst CSS = `\n@keyframes pc-toast-stack-spin { to { transform: rotate(360deg) } }\n@keyframes pc-toast-stack-timer { from { transform: scaleX(1) } to { transform: scaleX(0) } }\n.pc-toast-stack-spin { animation: pc-toast-stack-spin .8s linear infinite; transform-box: view-box; transform-origin: center; }\n.pc-toast-stack-timer { transform-origin: left; animation: pc-toast-stack-timer var(--pc-toast-duration) linear forwards; }\n.pc-toast-stack-timer[data-paused=\"true\"] { animation-play-state: paused; }\n[dir=\"rtl\"] .pc-toast-stack-timer { transform-origin: right; }\n@media (prefers-reduced-motion: reduce) {\n  .pc-toast-stack-spin { animation-duration: 2.4s }\n  .pc-toast-stack-timer { display: none }\n}\n`\n\n/* ---------------------------------------------------------------- store */\n\nexport type ToastType = \"default\" | \"success\" | \"error\" | \"warning\" | \"info\" | \"loading\"\n\nexport type ToastAction = {\n  label: string\n  onClick: () => void\n}\n\nexport type ToastOptions = {\n  /** Reuse an id to update a toast in place. */\n  id?: string | number\n  /** Second line under the title, in muted text. */\n  description?: React.ReactNode\n  /** Picks the icon: success, error, warning, info, a spinner for loading, none for default. */\n  type?: ToastType\n  /** Milliseconds before it closes. Infinity keeps it open. Loading toasts never close on their own. */\n  duration?: number\n  /** One button on the toast; clicking it runs onClick and closes the toast. */\n  action?: ToastAction\n  /** Replaces the icon picked by type. */\n  icon?: React.ReactNode\n  /** Show the close button and allow swiping. */\n  dismissible?: boolean\n  /** Called whenever the toast closes: timeout, swipe, close button, Esc, action or toast.dismiss(). */\n  onDismiss?: () => void\n}\n\nexport type ToastRecord = Omit<ToastOptions, \"id\"> & {\n  id: string | number\n  title: React.ReactNode\n  type: ToastType\n  /** Increments on every update so timers restart. */\n  version: number\n}\n\nlet records: ToastRecord[] = []\nlet counter = 0\nconst listeners = new Set<() => void>()\nconst EMPTY: ToastRecord[] = []\n\nfunction emit() {\n  for (const l of listeners) l()\n}\nfunction subscribe(l: () => void) {\n  listeners.add(l)\n  return () => {\n    listeners.delete(l)\n  }\n}\n\nfunction upsert(title: React.ReactNode, options: ToastOptions = {}) {\n  const id = options.id ?? `t${++counter}`\n  const existing = records.find((r) => r.id === id)\n  if (existing) {\n    records = records.map((r) =>\n      r.id === id ? { ...r, ...options, id, title, type: options.type ?? r.type, version: r.version + 1 } : r,\n    )\n  } else {\n    records = [{ dismissible: true, ...options, id, title, type: options.type ?? \"default\", version: 0 }, ...records]\n  }\n  emit()\n  return id\n}\n\nfunction dismiss(id?: string | number) {\n  if (id === undefined) {\n    records.forEach((r) => r.onDismiss?.())\n    records = []\n  } else {\n    records.find((r) => r.id === id)?.onDismiss?.()\n    records = records.filter((r) => r.id !== id)\n  }\n  emit()\n}\n\nfunction resolve<A>(value: React.ReactNode | ((arg: A) => React.ReactNode), arg: A): React.ReactNode {\n  return typeof value === \"function\" ? value(arg) : value\n}\n\nexport type ToastPromiseMessages<T> = {\n  loading: React.ReactNode\n  success: React.ReactNode | ((data: T) => React.ReactNode)\n  error: React.ReactNode | ((error: unknown) => React.ReactNode)\n  description?: React.ReactNode\n  /** Shown on the success toast, e.g. an \"Undo\" or \"View\" button. */\n  action?: ToastAction\n}\n\n/**\n * Show a toast from anywhere. Returns its id.\n * `toast(\"Saved\")`, `toast.success(...)`, `toast.error(...)`, `toast.promise(p, {...})`, `toast.dismiss(id?)`.\n */\nexport const toast = Object.assign((title: React.ReactNode, options?: ToastOptions) => upsert(title, options), {\n  success: (title: React.ReactNode, options?: ToastOptions) => upsert(title, { ...options, type: \"success\" }),\n  error: (title: React.ReactNode, options?: ToastOptions) => upsert(title, { ...options, type: \"error\" }),\n  warning: (title: React.ReactNode, options?: ToastOptions) => upsert(title, { ...options, type: \"warning\" }),\n  info: (title: React.ReactNode, options?: ToastOptions) => upsert(title, { ...options, type: \"info\" }),\n  loading: (title: React.ReactNode, options?: ToastOptions) => upsert(title, { ...options, type: \"loading\" }),\n  dismiss,\n  promise<T>(promise: Promise<T> | (() => Promise<T>), messages: ToastPromiseMessages<T>, options?: ToastOptions) {\n    const id = upsert(messages.loading, { ...options, type: \"loading\", description: messages.description })\n    const p = typeof promise === \"function\" ? promise() : promise\n    p.then(\n      (data) => {\n        if (records.some((r) => r.id === id))\n          upsert(resolve(messages.success, data), { ...options, id, type: \"success\", description: undefined, action: messages.action })\n      },\n      (error: unknown) => {\n        if (records.some((r) => r.id === id)) upsert(resolve(messages.error, error), { ...options, id, type: \"error\", description: undefined })\n      },\n    )\n    return p\n  },\n})\n\n/** Subscribe to the toast list, e.g. to render a custom toaster. */\nexport function useToasts() {\n  return React.useSyncExternalStore(subscribe, () => records, () => EMPTY)\n}\n\n/* ---------------------------------------------------------------- toaster */\n\nexport type ToasterPosition = \"top-left\" | \"top-center\" | \"top-right\" | \"bottom-left\" | \"bottom-center\" | \"bottom-right\"\n\nexport type ToasterLabels = { notifications: string; close: string }\nconst DEFAULT_LABELS: ToasterLabels = { notifications: \"Notifications (Alt+T)\", close: \"Close notification\" }\n\nexport type ToasterProps = Omit<React.ComponentProps<\"section\">, \"children\"> & {\n  /** Screen corner or edge the stack is pinned to; top positions stack downward, bottom ones upward. */\n  position?: ToasterPosition\n  /** Toasts visible in the collapsed stack. */\n  visibleToasts?: number\n  /** Default auto-dismiss time in ms. */\n  duration?: number\n  /** Space between toasts when expanded, in px. */\n  gap?: number\n  /** Keep the stack expanded instead of expanding on hover. */\n  expand?: boolean\n  /** Thin bar showing the time left. */\n  showTimer?: boolean\n  /** Text for built-in controls and screen readers; pass translations here. */\n  labels?: Partial<ToasterLabels>\n  /** Plays a sound for each new toast by type (success, error, warning, otherwise \"notify\") when the visitor has sounds on (lib/goodui-sounds); a sound name is used for every type. Off by default. */\n  sound?: boolean | SoundName\n}\n\n// Optional UI sound: the sound module is loaded only when `sound` is on, so silent apps pay nothing.\nfunction useCue(sound: boolean | SoundName | undefined) {\n  React.useEffect(() => {\n    if (sound) void import(\"@/lib/goodui-sounds\")\n  }, [sound])\n  return React.useCallback(\n    (fallback: SoundName, o?: { rate?: number; exact?: boolean }) => {\n      if (!sound) return\n      void import(\"@/lib/goodui-sounds\").then((m) => m.play(sound === true || o?.exact ? fallback : sound, { rate: o?.rate }))\n    },\n    [sound],\n  )\n}\n\nconst ICONS: Record<\"warning\" | \"info\", React.ReactNode> = {\n  warning: <TriangleAlert className=\"size-[18px] text-amber-600 dark:text-amber-400\" />,\n  info: <Info className=\"size-[18px] text-sky-600 dark:text-sky-400\" />,\n}\n\n/**\n * One icon for loading, success and error, so a promise toast morphs instead of swapping: the spinner's arc closes\n * into a ring, keeps spinning until it is whole (a closed ring hides the rotation stopping), then the mark draws in.\n */\nfunction StatusIcon({ type, reduce }: { type: \"loading\" | \"success\" | \"error\"; reduce: boolean }) {\n  const loading = type === \"loading\"\n  const [spin, setSpin] = React.useState(loading)\n  if (loading && !spin) setSpin(true)\n  const draw = (shown: boolean, delay: number) => ({\n    initial: { pathLength: 0, opacity: 0 },\n    animate: { pathLength: shown ? 1 : 0, opacity: shown ? 1 : 0 },\n    transition: reduce ? { duration: 0 } : { duration: 0.24, delay: shown ? delay : 0, ease: ease.out, opacity: { duration: 0.01, delay: shown ? delay : 0 } },\n  })\n  return (\n    <motion.svg\n      viewBox=\"0 0 24 24\"\n      fill=\"none\"\n      aria-hidden=\"true\"\n      className={cn(\n        \"size-[18px] overflow-visible transition-colors duration-300\",\n        loading ? \"text-muted-foreground\" : type === \"success\" ? \"text-emerald-600 dark:text-emerald-400\" : \"text-rose-600 dark:text-rose-400\",\n      )}\n      animate={loading || reduce ? { scale: 1 } : { scale: [1, 1.16, 1] }}\n      transition={{ duration: 0.4, delay: loading ? 0 : 0.2, ease: ease.out }}\n    >\n      <motion.circle cx=\"12\" cy=\"12\" r=\"11\" fill=\"currentColor\" initial={false} animate={{ opacity: loading ? 0 : 0.16 }} transition={{ duration: reduce ? 0 : 0.3 }} />\n      <circle cx=\"12\" cy=\"12\" r=\"9\" stroke=\"currentColor\" strokeOpacity=\".2\" strokeWidth=\"2.5\" />\n      <g className={spin ? \"pc-toast-stack-spin\" : undefined}>\n        <motion.circle\n          cx=\"12\"\n          cy=\"12\"\n          r=\"9\"\n          stroke=\"currentColor\"\n          strokeWidth=\"2.5\"\n          strokeLinecap=\"round\"\n          transform=\"rotate(-90 12 12)\"\n          initial={{ pathLength: loading ? 0.25 : 0 }}\n          animate={{ pathLength: loading ? 0.25 : 1 }}\n          transition={reduce ? { duration: 0 } : { duration: 0.34, ease: ease.out }}\n          onAnimationComplete={() => {\n            if (!loading) setSpin(false)\n          }}\n        />\n      </g>\n      <motion.path d=\"M7.5 12.5l3 3 6-6.5\" stroke=\"currentColor\" strokeWidth=\"2.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" {...draw(type === \"success\", 0.2)} />\n      <motion.path d=\"M8.5 8.5l7 7\" stroke=\"currentColor\" strokeWidth=\"2.5\" strokeLinecap=\"round\" {...draw(type === \"error\", 0.2)} />\n      <motion.path d=\"M15.5 8.5l-7 7\" stroke=\"currentColor\" strokeWidth=\"2.5\" strokeLinecap=\"round\" {...draw(type === \"error\", 0.3)} />\n    </motion.svg>\n  )\n}\n\n/** Sonner's stack: each older toast sits 14px further back and 5% smaller, moving on 400ms. */\nconst PEEK = 14\nconst STACK_MOVE = { duration: 0.4, ease: ease.out }\n\nconst POSITION: Record<ToasterPosition, string> = {\n  \"top-left\": \"top-4 left-4 sm:top-6 sm:left-6\",\n  \"top-center\": \"top-4 left-1/2 -translate-x-1/2 sm:top-6\",\n  \"top-right\": \"top-4 right-4 sm:top-6 sm:right-6\",\n  \"bottom-left\": \"bottom-4 left-4 sm:bottom-6 sm:left-6\",\n  \"bottom-center\": \"bottom-4 left-1/2 -translate-x-1/2 sm:bottom-6\",\n  \"bottom-right\": \"bottom-4 right-4 sm:bottom-6 sm:right-6\",\n}\n\n/** Renders the toasts. Mount once near the root of the app. */\nexport function Toaster({\n  position = \"bottom-right\",\n  visibleToasts = 3,\n  duration = 4000,\n  gap = 14,\n  expand = false,\n  showTimer = true,\n  labels,\n  sound,\n  className,\n  ...props\n}: ToasterProps) {\n  const l = useLabels(\"toast-stack\", DEFAULT_LABELS, labels)\n  const toasts = useToasts()\n  const cue = useCue(sound)\n  const reduce = useReducedMotion() ?? false\n  const [hovered, setHovered] = React.useState(false)\n  const [focused, setFocused] = React.useState(false)\n  const [hidden, setHidden] = React.useState(false)\n  const [heights, setHeights] = React.useState<Record<string, number>>({})\n  const listRef = React.useRef<HTMLOListElement>(null)\n\n  React.useEffect(() => {\n    const onVisibility = () => setHidden(document.hidden)\n    onVisibility()\n    document.addEventListener(\"visibilitychange\", onVisibility)\n    return () => document.removeEventListener(\"visibilitychange\", onVisibility)\n  }, [])\n\n  // Alt+T jumps to the newest toast, like most toasters.\n  React.useEffect(() => {\n    const onKey = (e: KeyboardEvent) => {\n      if (e.altKey && e.code === \"KeyT\") listRef.current?.querySelector<HTMLElement>(\"li\")?.focus()\n    }\n    window.addEventListener(\"keydown\", onKey)\n    return () => window.removeEventListener(\"keydown\", onKey)\n  }, [])\n\n  // Collapse once the list empties, or the pointer may never \"leave\" it.\n  React.useEffect(() => {\n    if (toasts.length === 0) {\n      setHovered(false)\n      setFocused(false)\n    }\n  }, [toasts.length])\n\n  // A sound for every new toast, and again when a loading toast turns into its result.\n  const seen = React.useRef(new Map<string | number, ToastType>())\n  React.useEffect(() => {\n    const map = seen.current\n    for (const t of toasts) {\n      const prev = map.get(t.id)\n      map.set(t.id, t.type)\n      if (t.type === \"loading\" || prev === t.type || (prev !== undefined && prev !== \"loading\")) continue\n      cue(t.type === \"success\" || t.type === \"error\" || t.type === \"warning\" ? t.type : \"notify\")\n    }\n    for (const id of map.keys()) if (!toasts.some((t) => t.id === id)) map.delete(id)\n  }, [toasts, cue])\n\n  const setHeight = React.useCallback((id: string | number, h: number | null) => {\n    setHeights((prev) => {\n      const key = String(id)\n      if (h === null) {\n        if (!(key in prev)) return prev\n        const next = { ...prev }\n        delete next[key]\n        return next\n      }\n      return prev[key] === h ? prev : { ...prev, [key]: h }\n    })\n  }, [])\n\n  const expanded = expand || hovered || focused\n  const top = position.startsWith(\"top\")\n  const front = toasts[0]\n  const frontHeight = front ? heights[String(front.id)] : undefined\n  const offsets: number[] = []\n  let acc = 0\n  toasts.forEach((t, i) => {\n    offsets[i] = acc\n    acc += (heights[String(t.id)] ?? 64) + gap\n  })\n  const shown = toasts.slice(0, expanded ? toasts.length : visibleToasts + 1)\n  const listHeight = expanded ? Math.max(0, acc - gap) : (frontHeight ?? 0) + Math.min(toasts.length - 1, visibleToasts - 1) * PEEK\n\n  return (\n    <section\n      aria-label={l.notifications}\n      aria-live=\"polite\"\n      aria-relevant=\"additions text\"\n      aria-atomic=\"false\"\n      tabIndex={-1}\n      className={cn(\"pointer-events-none fixed z-[100] w-[calc(100vw-2rem)] sm:w-[360px]\", POSITION[position], className)}\n      {...props}\n    >\n      <GooduiTokens />\n      <style href=\"pc-toast-stack\" precedence=\"default\">\n        {CSS}\n      </style>\n      <ol\n        ref={listRef}\n        className=\"pointer-events-auto relative\"\n        style={{ height: toasts.length ? listHeight : 0 }}\n        onMouseEnter={() => setHovered(true)}\n        onMouseLeave={() => setHovered(false)}\n        onFocus={() => setFocused(true)}\n        onBlur={(e) => {\n          if (!listRef.current?.contains(e.relatedTarget as Node | null)) setFocused(false)\n        }}\n      >\n        <AnimatePresence initial={false}>\n          {shown.map((t, i) => (\n            <ToastItem\n              key={t.id}\n              toast={t}\n              index={i}\n              expanded={expanded}\n              top={top}\n              offset={offsets[i] ?? 0}\n              frontHeight={frontHeight}\n              height={heights[String(t.id)]}\n              hiddenInStack={!expanded && i >= visibleToasts}\n              paused={hovered || focused || hidden}\n              duration={t.duration ?? duration}\n              total={toasts.length}\n              reduce={reduce}\n              showTimer={showTimer}\n              closeLabel={l.close}\n              onHeight={setHeight}\n            />\n          ))}\n        </AnimatePresence>\n      </ol>\n    </section>\n  )\n}\n\ntype ToastItemProps = {\n  toast: ToastRecord\n  index: number\n  expanded: boolean\n  top: boolean\n  offset: number\n  frontHeight?: number\n  height?: number\n  hiddenInStack: boolean\n  paused: boolean\n  duration: number\n  total: number\n  reduce: boolean\n  showTimer: boolean\n  closeLabel: string\n  onHeight: (id: string | number, h: number | null) => void\n}\n\nfunction ToastItem({\n  toast: t,\n  index,\n  expanded,\n  top,\n  offset,\n  frontHeight,\n  height,\n  hiddenInStack,\n  paused,\n  duration,\n  total,\n  reduce,\n  showTimer,\n  closeLabel,\n  onHeight,\n}: ToastItemProps) {\n  const contentRef = React.useRef<HTMLDivElement>(null)\n  const x = useMotionValue(0)\n  const dragOpacity = useTransform(x, [-220, -60, 0, 60, 220], [0, 1, 1, 1, 0])\n  // +1 stacks downward from the top edge, -1 stacks upward from the bottom edge.\n  const dir = top ? 1 : -1\n  const isFront = index === 0\n  const remaining = React.useRef(duration)\n  const timed = t.type !== \"loading\" && Number.isFinite(duration)\n  const close = React.useCallback(() => dismiss(t.id), [t.id])\n\n  React.useLayoutEffect(() => {\n    const el = contentRef.current\n    if (!el) return\n    const measure = () => onHeight(t.id, el.offsetHeight)\n    measure()\n    const ro = new ResizeObserver(measure)\n    ro.observe(el)\n    return () => ro.disconnect()\n  }, [t.id, onHeight])\n  React.useEffect(() => () => onHeight(t.id, null), [t.id, onHeight])\n\n  // A new version (e.g. a promise resolving) restarts the timer.\n  React.useEffect(() => {\n    remaining.current = duration\n  }, [t.version, duration])\n\n  React.useEffect(() => {\n    if (!timed || paused) return\n    const start = performance.now()\n    const id = window.setTimeout(close, remaining.current)\n    return () => {\n      window.clearTimeout(id)\n      remaining.current = Math.max(0, remaining.current - (performance.now() - start))\n    }\n  }, [timed, paused, close, t.version])\n\n  const onDragEnd = (_: unknown, info: PanInfo) => {\n    // Sonner: 45px, or any drag quicker than .11px/ms.\n    if (Math.abs(info.offset.x) > 45 || (Math.abs(info.velocity.x) > 110 && Math.abs(info.offset.x) > 8)) {\n      const side = Math.sign(info.offset.x || info.velocity.x) || 1\n      animate(x, side * 420, { duration: reduce ? 0 : 0.2, ease: \"easeOut\" }).then(close)\n    }\n  }\n\n  // Collapsed: older toasts shrink behind the front one and only peek out.\n  const collapsedScale = 1 - index * 0.05\n  const y = dir * (expanded ? offset : index * PEEK)\n  const targetHeight = expanded || isFront ? height : frontHeight\n  const spring = reduce ? { duration: 0 } : { default: springs.ui, y: STACK_MOVE, scale: STACK_MOVE }\n  const status = !t.icon && (t.type === \"loading\" || t.type === \"success\" || t.type === \"error\") ? t.type : null\n  const icon = status ? <StatusIcon type={status} reduce={reduce} /> : (t.icon ?? (t.type === \"warning\" || t.type === \"info\" ? ICONS[t.type] : null))\n  const canSwipe = t.dismissible !== false && (expanded || isFront)\n\n  return (\n    <motion.li\n      data-type={t.type}\n      tabIndex={expanded || isFront ? 0 : -1}\n      onKeyDown={(e) => {\n        if (e.key === \"Escape\" && t.dismissible !== false) {\n          e.stopPropagation()\n          close()\n        }\n      }}\n      className={cn(\n        \"absolute inset-x-0 rounded-[14px] outline-none focus-visible:ring-3 focus-visible:ring-ring/50\",\n        top ? \"top-0 origin-bottom\" : \"bottom-0 origin-top\",\n        hiddenInStack && \"pointer-events-none\",\n      )}\n      style={{ zIndex: total - index }}\n      initial={reduce ? { opacity: 0 } : { opacity: 0, y: -dir * 40, scale: 0.95 }}\n      animate={{\n        opacity: hiddenInStack ? 0 : 1,\n        y,\n        scale: expanded ? 1 : collapsedScale,\n        height: targetHeight ?? \"auto\",\n      }}\n      exit={reduce ? { opacity: 0, transition: { duration: 0.15 } } : { opacity: 0, scale: 0.95, transition: { duration: 0.2, ease: ease.out } }}\n      transition={spring}\n    >\n      <motion.div\n        drag={canSwipe ? \"x\" : false}\n        dragSnapToOrigin\n        dragElastic={0.6}\n        onDragEnd={onDragEnd}\n        style={{ x, opacity: dragOpacity }}\n        className=\"h-full cursor-grab touch-pan-y overflow-hidden rounded-[14px] bg-popover text-popover-foreground shadow-[var(--pc-e3)] active:cursor-grabbing\"\n      >\n        <motion.div\n          ref={contentRef}\n          className=\"group/toast relative flex items-start gap-3 p-4 pe-10\"\n          aria-hidden={!(expanded || isFront) || undefined}\n          // visibility, not just opacity: a covered toast's buttons must leave the tab order and the accessibility tree.\n          animate={expanded || isFront ? { opacity: 1, visibility: \"visible\" } : { opacity: 0, transitionEnd: { visibility: \"hidden\" } }}\n          transition={reduce ? { duration: 0 } : { duration: 0.2 }}\n        >\n          <AnimatePresence mode=\"popLayout\" initial={false}>\n            {icon && (\n              <motion.span\n                key={status ? \"status\" : t.type}\n                className=\"mt-px flex shrink-0\"\n                initial={reduce ? { opacity: 0 } : { opacity: 0, scale: 0.8 }}\n                animate={{ opacity: 1, scale: 1 }}\n                exit={reduce ? { opacity: 0 } : { opacity: 0, scale: 0.8 }}\n                transition={reduce ? { duration: 0 } : springs.play}\n              >\n                {icon}\n              </motion.span>\n            )}\n          </AnimatePresence>\n          <motion.div\n            key={t.version}\n            className=\"min-w-0 flex-1\"\n            initial={t.version && !reduce ? { opacity: 0, filter: \"blur(4px)\" } : false}\n            animate={{ opacity: 1, filter: \"blur(0px)\" }}\n            transition={{ duration: 0.2, ease: ease.out }}\n          >\n            <div className=\"text-sm leading-5 font-medium\">{t.title}</div>\n            {t.description && <div className=\"mt-0.5 text-sm leading-5 text-muted-foreground\">{t.description}</div>}\n          </motion.div>\n          {t.action && (\n            <button\n              type=\"button\"\n              tabIndex={expanded || isFront ? undefined : -1}\n              onPointerDownCapture={(e) => e.stopPropagation()}\n              onClick={() => {\n                t.action?.onClick()\n                close()\n              }}\n              className=\"pc-press shrink-0 self-center rounded-md bg-primary px-2.5 py-1 text-xs font-medium text-primary-foreground transition-opacity outline-none hover:opacity-90 focus-visible:ring-3 focus-visible:ring-ring/50\"\n            >\n              {t.action.label}\n            </button>\n          )}\n          {t.dismissible !== false && (\n            <button\n              type=\"button\"\n              tabIndex={expanded || isFront ? undefined : -1}\n              aria-label={closeLabel}\n              onPointerDownCapture={(e) => e.stopPropagation()}\n              onClick={close}\n              className=\"pc-press absolute end-3 top-3 grid size-6 place-items-center rounded-md text-muted-foreground opacity-60 transition-opacity outline-none group-hover/toast:opacity-100 hover:bg-muted hover:text-foreground focus-visible:opacity-100 focus-visible:ring-3 focus-visible:ring-ring/50\"\n            >\n              <X className=\"size-3.5\" />\n            </button>\n          )}\n          {showTimer && timed && (\n            <span\n              key={`timer-${t.version}`}\n              aria-hidden=\"true\"\n              data-paused={paused}\n              className=\"pc-toast-stack-timer absolute inset-x-0 bottom-0 h-0.5 bg-foreground/10\"\n              style={{ [\"--pc-toast-duration\" as string]: `${duration}ms` }}\n            />\n          )}\n        </motion.div>\n      </motion.div>\n    </motion.li>\n  )\n}\n\n",
      "type": "registry:component",
      "target": "components/goodui/toast-stack.tsx"
    }
  ],
  "categories": [
    "components",
    "feedback"
  ],
  "type": "registry:component"
}