{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"memory-chip","type":"registry:ui","title":"Memory Chip","description":"A small inline chip confirming a fact was saved to memory — quiet enough to ignore, clear enough to undo.","author":"Scrim UI (https://scrimui.dev)","categories":["memory"],"docs":"https://scrimui.dev/components/memory-chip","dependencies":[],"registryDependencies":[],"files":[{"path":"src/showcase/memory-chip/memory-chip.tsx","content":"\"use client\";\n\nimport * as React from \"react\";\n\n/* ------------------------------------------------------------------ */\n/* Types                                                               */\n/* ------------------------------------------------------------------ */\n\nexport type MemoryChipProps = {\n  variant?: \"saved\" | \"on\";\n  label?: string;\n  onClick?: () => void;\n  className?: string;\n};\n\n/* ------------------------------------------------------------------ */\n/* Icons                                                               */\n/* ------------------------------------------------------------------ */\n\nfunction CheckIcon(props: React.SVGProps<SVGSVGElement>) {\n  return (\n    <svg\n      viewBox=\"0 0 24 24\"\n      fill=\"none\"\n      stroke=\"currentColor\"\n      strokeWidth=\"2.5\"\n      strokeLinecap=\"round\"\n      strokeLinejoin=\"round\"\n      width=\"11\"\n      height=\"11\"\n      {...props}\n    >\n      <path d=\"M20 6 9 17l-5-5\" />\n    </svg>\n  );\n}\n\n/* ------------------------------------------------------------------ */\n/* MemoryChip                                                          */\n/* ------------------------------------------------------------------ */\n\nexport function MemoryChip({\n  variant = \"saved\",\n  label,\n  onClick,\n  className = \"\",\n}: MemoryChipProps) {\n  const saved = variant === \"saved\";\n  const text = label ?? (saved ? \"Saved to memory\" : \"Memory on\");\n\n  const Comp = onClick ? \"button\" : \"span\";\n  return (\n    <Comp\n      {...(onClick ? { type: \"button\" as const, onClick } : {})}\n      className={`inline-flex h-6 max-w-full items-center gap-1.5 rounded-full border px-2.5 text-[11px] font-medium transition-colors ${\n        saved\n          ? \"border-emerald-200 bg-emerald-50 text-emerald-700 dark:border-emerald-900/50 dark:bg-emerald-900/25 dark:text-emerald-300\"\n          : \"border-zinc-200 bg-white text-zinc-600 dark:border-zinc-700 dark:bg-zinc-800 dark:text-zinc-300\"\n      } ${onClick ? \"cursor-pointer hover:bg-zinc-50 dark:hover:bg-zinc-700\" : \"\"} ${className}`}\n    >\n      {saved ? <CheckIcon /> : <span className=\"h-1.5 w-1.5 shrink-0 rounded-full bg-current\" />}\n      <span className=\"truncate\">{text}</span>\n    </Comp>\n  );\n}\n","type":"registry:ui","target":"components/ui/memory-chip.tsx"}]}