{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "zoom-panel",
  "title": "Zoom Panel",
  "description": "A document thumbnail in the corner that opens into a large panel zoomed into one highlighted band of the picture. No dependencies.",
  "files": [
    {
      "path": "registry/mewo/ui/zoom-panel.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { cn } from \"@/lib/utils\"\n\nexport type ZoomPanelState = \"hidden\" | \"shown\" | \"open\"\n\nexport interface ZoomPanelProps extends React.ComponentProps<\"div\"> {\n  /** hidden; shown as a thumbnail in the corner; open as a large panel zoomed into one band of the picture. */\n  state?: ZoomPanelState\n  /** The picture: a wide image (about 3 : 2) works best. */\n  src?: string\n  /** Its description. */\n  alt?: string\n  /** The caption shown in the open panel. */\n  caption?: string\n}\n\nexport const DEFAULT_SRC = \"https://cataas.com/cat/UVu5vTLianSvI6Ju\"\n\n/**\n * A document in the corner that opens into a large panel: the picture grows and slides with the panel, and two\n * shades leave one band of it clear, like a highlighted line in a ledger. Positioned in its nearest positioned\n * ancestor's bottom corner at the inline end (right in left-to-right text, left in right-to-left).\n */\nexport function ZoomPanel({\n  state = \"shown\",\n  src = DEFAULT_SRC,\n  alt = \"\",\n  caption = \"A record, one line highlighted. Placeholder photograph.\",\n  className,\n  ...props\n}: ZoomPanelProps) {\n  return (\n    <div\n      data-slot=\"zoom-panel\"\n      data-state={state}\n      className={cn(\"[--story-u:min(2.6667cqw,12px)] min-[901px]:[--story-u:0.625cqw] min-[901px]:@max-[900px]:[--story-u:min(2.6667cqw,12px)] text-[length:var(--story-u)]\", \n        \"group absolute end-[calc(var(--story-u)*2)] bottom-[calc(var(--story-u)*2)] h-[calc(var(--story-u)*11)] w-[calc(var(--story-u)*20)] overflow-hidden rounded-sm bg-black text-white\",\n        \"[transition:opacity_0.5s_cubic-bezier(0.455,0.03,0.515,0.955),visibility_0s,right_0.8s_cubic-bezier(0.455,0.03,0.515,0.955),left_0.8s_cubic-bezier(0.455,0.03,0.515,0.955),bottom_0.8s_cubic-bezier(0.455,0.03,0.515,0.955),width_0.8s_cubic-bezier(0.455,0.03,0.515,0.955),height_0.8s_cubic-bezier(0.455,0.03,0.515,0.955)]\",\n        \"data-[state=hidden]:invisible data-[state=hidden]:opacity-0\",\n        \"data-[state=hidden]:[transition:opacity_0.5s_cubic-bezier(0.455,0.03,0.515,0.955),visibility_0s_linear_0.5s,right_0.8s_cubic-bezier(0.455,0.03,0.515,0.955),left_0.8s_cubic-bezier(0.455,0.03,0.515,0.955),bottom_0.8s_cubic-bezier(0.455,0.03,0.515,0.955),width_0.8s_cubic-bezier(0.455,0.03,0.515,0.955),height_0.8s_cubic-bezier(0.455,0.03,0.515,0.955)]\",\n        \"data-[state=open]:end-[calc(var(--story-u)*12)] data-[state=open]:bottom-[4cqh] data-[state=open]:h-[92cqh] data-[state=open]:w-[calc(var(--story-u)*88)]\",\n        \"max-[900px]:inset-x-0 max-[900px]:bottom-[calc(var(--story-u)*1.2)] max-[900px]:mx-auto max-[900px]:h-[calc(var(--story-u)*9.6)] max-[900px]:w-[calc(var(--story-u)*14)]\",\n        \"max-[900px]:data-[state=open]:inset-x-0 max-[900px]:data-[state=open]:bottom-[calc(var(--story-u)*1.2)] max-[900px]:data-[state=open]:h-[42cqh] max-[900px]:data-[state=open]:w-[calc(100cqw-calc(var(--story-u)*4))]\",\n        \"motion-reduce:transition-none\",\n        className\n      )}\n      {...props}\n    >\n      <div className=\"absolute inset-0\">\n        {/* eslint-disable-next-line @next/next/no-img-element -- registry items cannot use next/image */}\n        <img\n          src={src}\n          alt={alt}\n          className={cn(\n            \"absolute top-1/2 left-1/2 h-auto w-full max-w-none -translate-x-1/2 -translate-y-[46%]\",\n            \"[transition:width_0.8s_cubic-bezier(0.455,0.03,0.515,0.955),translate_0.8s_cubic-bezier(0.455,0.03,0.515,0.955)] motion-reduce:transition-none\",\n            \"group-data-[state=open]:w-[180%] group-data-[state=open]:-translate-x-[36%]\"\n          )}\n        />\n        <div\n          className={cn(\n            \"absolute inset-x-0 top-0 h-[43%] bg-black/80 transition-colors duration-400 group-data-[state=open]:bg-black/55\",\n            \"before:absolute before:inset-x-0 before:top-0 before:h-[22%] before:bg-black before:opacity-0 before:transition-opacity before:duration-400 before:content-['']\",\n            \"group-data-[state=open]:before:opacity-100\"\n          )}\n        />\n        <div className=\"absolute inset-x-0 bottom-0 h-[51%] bg-black/80 transition-colors duration-400 group-data-[state=open]:bg-black/55\" />\n      </div>\n      <span\n        aria-hidden=\"true\"\n        className=\"absolute top-[calc(var(--story-u)*1)] left-[calc(var(--story-u)*1)] grid size-[calc(var(--story-u)*4)] place-items-center rounded-lg bg-[rgba(186,186,186,0.2)] backdrop-blur-[12px] transition-opacity duration-300 group-data-[state=open]:opacity-0\"\n      >\n        <svg className=\"size-[calc(var(--story-u)*1.8)]\" viewBox=\"0 0 16 16\">\n          <rect x=\"0.5\" y=\"0.5\" width=\"15\" height=\"15\" rx=\"2\" fill=\"none\" stroke=\"currentColor\" />\n          <rect x=\"9\" y=\"1\" width=\"6\" height=\"6\" fill=\"currentColor\" />\n        </svg>\n      </span>\n      <span\n        aria-hidden=\"true\"\n        className=\"absolute top-[calc(var(--story-u)*2)] left-[calc(var(--story-u)*2)] size-[calc(var(--story-u)*4.8)] p-[calc(var(--story-u)*1.1)] opacity-0 transition-opacity duration-400 group-data-[state=open]:opacity-100 group-data-[state=open]:delay-400\"\n      >\n        <svg viewBox=\"0 0 22 22\">\n          <circle cx=\"11\" cy=\"11\" r=\"10\" fill=\"none\" stroke=\"currentColor\" />\n          <path d=\"M7 11h8\" stroke=\"currentColor\" strokeWidth=\"1.6\" />\n        </svg>\n      </span>\n      <p className=\"absolute inset-x-[calc(var(--story-u)*2)] bottom-[calc(var(--story-u)*1.4)] text-[10px] leading-[1.3] opacity-0 transition-opacity duration-400 group-data-[state=open]:opacity-100 group-data-[state=open]:delay-400\">\n        {caption}\n      </p>\n    </div>\n  )\n}\n",
      "type": "registry:ui"
    }
  ],
  "meta": {
    "added": "2026-10-27"
  },
  "categories": [
    "card",
    "media"
  ],
  "type": "registry:ui"
}