{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "postage-stamp",
  "title": "Postage Stamp",
  "author": "VenusUI",
  "description": "A perforated stamp with a photo that takes a postmark when you press it.",
  "files": [
    {
      "path": "registry/default/ui/postage-stamp.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface PostageStampProps extends Omit<React.ComponentProps<\"button\">, \"value\"> {\n  src: string\n  alt: string\n  title: string\n  country: string\n  /** Face value, for example \"85c\". */\n  value: string\n  /** Text around the postmark. */\n  postmark?: { place: string; date: string }\n  cancelled?: boolean\n  defaultCancelled?: boolean\n  onCancelledChange?: (cancelled: boolean) => void\n}\n\nconst HOLE = 5\n\n/**\n * A perforated postage stamp with a photo. Press it to bring the postmark\n * down; press again to lift it.\n */\nfunction PostageStamp({\n  src,\n  alt,\n  title,\n  country,\n  value,\n  postmark = { place: \"Air mail\", date: \"12 JUN 26\" },\n  cancelled: cancelledProp,\n  defaultCancelled = false,\n  onCancelledChange,\n  className,\n  style,\n  onClick,\n  ...props\n}: PostageStampProps) {\n  const [internal, setInternal] = React.useState(defaultCancelled)\n  const cancelled = cancelledProp ?? internal\n  const id = React.useId().replace(/[^a-zA-Z0-9]/g, \"\")\n  const tile = HOLE * 3\n  const mask = `linear-gradient(#000 0 0) center / calc(100% - ${tile}px) calc(100% - ${tile}px) no-repeat, radial-gradient(circle ${HOLE}px, transparent 96%, #000) ${-tile / 2}px ${-tile / 2}px / ${tile}px ${tile}px round`\n\n  return (\n    <button\n      type=\"button\"\n      data-slot=\"postage-stamp\"\n      aria-pressed={cancelled}\n      aria-label={`${title} stamp, ${country}, ${value}. ${cancelled ? \"Postmarked\" : \"Press to postmark\"}`}\n      onClick={(event) => {\n        onClick?.(event)\n        if (event.defaultPrevented) return\n        setInternal(!cancelled)\n        onCancelledChange?.(!cancelled)\n      }}\n      style={style}\n      className={cn(\"group relative block w-48 max-w-full rounded-sm outline-none drop-shadow-[0_6px_8px_rgb(0_0_0/0.28)] transition-transform hover:-rotate-1 focus-visible:ring-3 focus-visible:ring-ring/60 motion-reduce:transition-none\", className)}\n      {...props}\n    >\n      <span className=\"block bg-[#fbf7ee] p-3.5 text-neutral-800\" style={{ mask, WebkitMask: mask }}>\n        <span className=\"relative block overflow-hidden\">\n          <img src={src} alt={alt} draggable={false} className=\"aspect-[4/5] w-full bg-neutral-300 object-cover saturate-[0.85]\" />\n          <span className=\"absolute inset-x-0 top-0 flex items-start justify-between bg-linear-to-b from-black/55 to-transparent p-1.5 pb-6 text-white\">\n            <span className=\"text-[9px] font-semibold tracking-[0.16em] uppercase\">{country}</span>\n            <span className=\"font-serif text-lg leading-none font-semibold\">{value}</span>\n          </span>\n          <span className=\"absolute inset-x-0 bottom-0 bg-linear-to-t from-black/60 to-transparent p-1.5 pt-6 text-left font-serif text-xs text-white italic\">{title}</span>\n        </span>\n      </span>\n      {cancelled ? (\n        <svg aria-hidden=\"true\" viewBox=\"0 0 170 110\" className=\"animate-postage-stamp-thud pointer-events-none absolute top-[22%] -left-[14%] w-[118%] text-neutral-900/75 mix-blend-multiply motion-reduce:animate-none\">\n          <defs>\n            <path id={`${id}-arc`} d=\"M16 55a34 34 0 1 1 68 0\" />\n            <path id={`${id}-low`} d=\"M20 57a30 30 0 0 0 60 0\" />\n          </defs>\n          <g fill=\"none\" stroke=\"currentColor\">\n            <circle cx=\"50\" cy=\"55\" r=\"43\" strokeWidth=\"2\" />\n            <circle cx=\"50\" cy=\"55\" r=\"27\" strokeWidth=\"1.2\" />\n            {[33, 44, 55, 66, 77].map((y) => (\n              <path key={y} d={`M97 ${y}q9-6 18 0t18 0 18 0 17 0`} strokeWidth=\"2\" />\n            ))}\n          </g>\n          <g fill=\"currentColor\" fontFamily=\"ui-monospace, monospace\" fontWeight=\"700\">\n            <text fontSize=\"9.5\" letterSpacing=\"1.2\">\n              <textPath href={`#${id}-arc`} startOffset=\"50%\" textAnchor=\"middle\">\n                {postmark.place.toUpperCase()}\n              </textPath>\n            </text>\n            <text x=\"50\" y=\"58\" fontSize=\"8.5\" textAnchor=\"middle\">\n              {postmark.date}\n            </text>\n          </g>\n        </svg>\n      ) : null}\n    </button>\n  )\n}\n\nexport { PostageStamp }\n",
      "type": "registry:ui"
    }
  ],
  "cssVars": {
    "theme": {
      "animate-postage-stamp-thud": "postage-stamp-thud 0.28s cubic-bezier(0.3, 1.4, 0.6, 1) both"
    }
  },
  "css": {
    "@keyframes postage-stamp-thud": {
      "0%": {
        "transform": "scale(1.5)",
        "opacity": "0"
      },
      "100%": {
        "transform": "scale(1)",
        "opacity": "1"
      }
    }
  },
  "meta": {
    "version": "0.1.0"
  },
  "categories": [
    "cards",
    "interactive"
  ],
  "type": "registry:ui"
}