{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"tab-overload","type":"registry:block","title":"Tab Overload","description":"Overlapping browser windows where the highlight follows the hovered tab","dependencies":[],"files":[{"path":"illustrations/tab-overload/tab-overload.tsx","type":"registry:block","content":"\"use client\";\n\nimport { useId } from \"react\";\n\n/*\n * Tab Overload – a small card illustration, in a single self-contained file.\n * Three overlapping browser windows; the front one is active with colored dots, an outline and a glow.\n * Hover a window behind it and the highlight moves over to that one.\n * The artwork is drawn on a 360 × 240 viewBox and fades out towards the right and bottom edge.\n */\n\nexport type TabOverloadProps = {\n  className?: string;\n  /** Accessible description of the scene */\n  label?: string;\n};\n\n/** Offsets of the three windows (top-left corner of each frame) */\nconst windows = [\n  { n: 1, x: 30, y: 68 },\n  { n: 2, x: 125, y: 56 },\n  { n: 3, x: 220, y: 44 },\n] as const;\n\nexport function TabOverload({\n  className,\n  label = \"Three overlapping browser windows full of placeholder content\",\n}: TabOverloadProps) {\n  const id = \"ui-to\" + useId().replace(/[^a-zA-Z0-9_-]/g, \"\");\n\n  return (\n    <div className={[\"ui-to\", className].filter(Boolean).join(\" \")} role=\"img\" aria-label={label}>\n      {/* React 19 hoists this into <head> once, no matter how many instances render */}\n      <style href=\"ui-tab-overload\" precedence=\"default\">\n        {css}\n      </style>\n      <svg className=\"ui-to-art\" viewBox=\"0 0 360 240\" aria-hidden=\"true\">\n        <defs>\n          <linearGradient id={`${id}-blob-h`} x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"0%\">\n            <stop offset=\"0%\" stopColor=\"#FFB89E\" stopOpacity=\"0.3\" />\n            <stop offset=\"50%\" stopColor=\"#C8A8E5\" stopOpacity=\"0.3\" />\n            <stop offset=\"100%\" stopColor=\"#A8B5FF\" stopOpacity=\"0.3\" />\n          </linearGradient>\n          <linearGradient id={`${id}-blob-v`} x1=\"0%\" y1=\"100%\" x2=\"0%\" y2=\"0%\">\n            <stop offset=\"0%\" stopColor=\"#FF6B5C\" stopOpacity=\"0.3\" />\n            <stop offset=\"100%\" stopColor=\"#FFB89E\" stopOpacity=\"0.3\" />\n          </linearGradient>\n          <filter id={`${id}-blur`} x=\"-200%\" y=\"-200%\" width=\"500%\" height=\"500%\">\n            <feGaussianBlur stdDeviation=\"12\" />\n          </filter>\n          <linearGradient id={`${id}-stroke`} x1=\"100%\" y1=\"0%\" x2=\"0%\" y2=\"100%\">\n            <stop offset=\"0%\" stopColor=\"#B5C0FF\" />\n            <stop offset=\"40%\" stopColor=\"#D5BBEF\" />\n            <stop offset=\"75%\" stopColor=\"#FFC5AB\" />\n            <stop offset=\"100%\" stopColor=\"#FFB5BC\" />\n          </linearGradient>\n        </defs>\n\n        {/* Each window: glow → frame → content; the next window covers any overflow */}\n        {windows.map(({ n, x, y }) => (\n          <g key={n}>\n            <g className={`ui-to-blobs ui-to-blobs-${n}`}>\n              <ellipse\n                cx={x + 70}\n                cy={y + 8}\n                rx=\"90\"\n                ry=\"14\"\n                fill={`url(#${id}-blob-h)`}\n                filter={`url(#${id}-blur)`}\n              />\n              <ellipse\n                cx={x + 8}\n                cy={y + 96}\n                rx=\"14\"\n                ry=\"90\"\n                fill={`url(#${id}-blob-v)`}\n                filter={`url(#${id}-blur)`}\n              />\n            </g>\n            <g className={`ui-to-tab ui-to-tab-${n}`} transform={`translate(${x} ${y})`}>\n              {/* Outer gray frame, reaching well past the edges */}\n              <rect className=\"ui-to-frame\" width=\"380\" height=\"300\" rx=\"6\" fill=\"#F4F5F7\" stroke=\"#E4E7EC\" strokeWidth=\"0.7\" />\n              <circle className=\"ui-to-dot\" cx=\"14\" cy=\"14\" r=\"3\" fill=\"#CCCCCC\" />\n              <circle className=\"ui-to-dot\" cx=\"24\" cy=\"14\" r=\"3\" fill=\"#CCCCCC\" />\n              <circle className=\"ui-to-dot\" cx=\"34\" cy=\"14\" r=\"3\" fill=\"#CCCCCC\" />\n              <rect className=\"ui-to-page\" x=\"4\" y=\"24\" width=\"372\" height=\"272\" rx=\"5\" fill=\"#FFFFFF\" stroke=\"#E4E7EC\" strokeWidth=\"0.7\" />\n            </g>\n            <g className={`ui-to-content ui-to-content-${n}`} transform={`translate(${x} ${y})`}>\n              <rect className=\"ui-to-bar\" x=\"12\" y=\"36\" width=\"30\" height=\"30\" rx=\"4\" fill=\"#EFF1F4\" />\n              <rect className=\"ui-to-bar\" x=\"52\" y=\"38\" width=\"100\" height=\"6\" rx=\"2\" fill=\"#EFF1F4\" />\n              <rect className=\"ui-to-bar\" x=\"52\" y=\"46\" width=\"100\" height=\"6\" rx=\"2\" fill=\"#EFF1F4\" />\n              <rect className=\"ui-to-bar\" x=\"52\" y=\"54\" width=\"35\" height=\"6\" rx=\"2\" fill=\"#EFF1F4\" />\n              <rect className=\"ui-to-bar\" x=\"12\" y=\"72\" width=\"140\" height=\"6\" rx=\"2\" fill=\"#EFF1F4\" />\n              <rect className=\"ui-to-bar\" x=\"12\" y=\"80\" width=\"140\" height=\"6\" rx=\"2\" fill=\"#EFF1F4\" />\n              <rect className=\"ui-to-bar\" x=\"12\" y=\"88\" width=\"55\" height=\"6\" rx=\"2\" fill=\"#EFF1F4\" />\n            </g>\n          </g>\n        ))}\n\n        {/* Active-window decoration (colored dots + outline), shown on one window at a time */}\n        {windows.map(({ n, x, y }) => (\n          <g key={n} className={`ui-to-front ui-to-front-${n}`}>\n            <circle cx={x + 14} cy={y + 14} r=\"3\" fill=\"#FF6B5C\" />\n            <circle cx={x + 24} cy={y + 14} r=\"3\" fill=\"#FFB89E\" />\n            <circle cx={x + 34} cy={y + 14} r=\"3\" fill=\"#A8B5FF\" />\n            <path\n              d={`M ${x} 240 L ${x} ${y + 6} A 6 6 0 0 1 ${x + 6} ${y} L ${n === 3 ? 360 : x + 95} ${y}`}\n              fill=\"none\"\n              stroke={`url(#${id}-stroke)`}\n              strokeWidth=\"0.8\"\n            />\n          </g>\n        ))}\n      </svg>\n    </div>\n  );\n}\n\n/* ---------- Styles ---------- */\n\nconst css = /* css */ `\n.ui-to {\n  position: relative;\n  width: 100%;\n  aspect-ratio: 3 / 2;\n  overflow: hidden;\n  /* Fade out towards the right and bottom edge */\n  -webkit-mask-image:\n    linear-gradient(to right, #000 70%, transparent 100%),\n    linear-gradient(to bottom, #000 70%, transparent 100%);\n  -webkit-mask-composite: source-in;\n  mask-image:\n    linear-gradient(to right, #000 70%, transparent 100%),\n    linear-gradient(to bottom, #000 70%, transparent 100%);\n  mask-composite: intersect;\n}\n.ui-to-art {\n  position: absolute;\n  inset: 0;\n  display: block;\n  width: 100%;\n  height: 100%;\n}\n\n/* Placeholder blocks shimmer softly */\n.ui-to-bar { animation: ui-to-shimmer 2.4s ease-in-out infinite; }\n@keyframes ui-to-shimmer {\n  0%, 100% { fill: #EFF1F4; }\n  50% { fill: #DDE1E5; }\n}\n\n/* The highlight follows the hovered window; the front window is active by default */\n.ui-to-blobs,\n.ui-to-front {\n  opacity: 0;\n  pointer-events: none;\n  transition: opacity 0.3s ease;\n}\n.ui-to-content {\n  opacity: 0.2;\n  pointer-events: none;\n  transition: opacity 0.3s ease;\n}\n.ui-to-blobs-3,\n.ui-to-front-3,\n.ui-to-content-3 { opacity: 1; }\n\n.ui-to-art:has(.ui-to-tab-1:hover) .ui-to-blobs-1,\n.ui-to-art:has(.ui-to-tab-1:hover) .ui-to-front-1,\n.ui-to-art:has(.ui-to-tab-1:hover) .ui-to-content-1,\n.ui-to-art:has(.ui-to-tab-2:hover) .ui-to-blobs-2,\n.ui-to-art:has(.ui-to-tab-2:hover) .ui-to-front-2,\n.ui-to-art:has(.ui-to-tab-2:hover) .ui-to-content-2 { opacity: 1; }\n\n.ui-to-art:has(.ui-to-tab-1:hover, .ui-to-tab-2:hover) .ui-to-blobs-3,\n.ui-to-art:has(.ui-to-tab-1:hover, .ui-to-tab-2:hover) .ui-to-front-3 { opacity: 0; }\n.ui-to-art:has(.ui-to-tab-1:hover, .ui-to-tab-2:hover) .ui-to-content-3 { opacity: 0.2; }\n\n@media (prefers-reduced-motion: reduce) {\n  .ui-to-bar { animation: none; }\n  .ui-to-blobs, .ui-to-front, .ui-to-content { transition: none; }\n}\n\n/* Dark mode: follows a .dark class or data-theme=\"dark\" on any ancestor, e.g. <html> */\n:where(.dark, [data-theme=\"dark\"]) .ui-to-frame { fill: #1b1b1d; stroke: rgba(255, 255, 255, 0.1); }\n:where(.dark, [data-theme=\"dark\"]) .ui-to-dot { fill: #3a3a3f; }\n:where(.dark, [data-theme=\"dark\"]) .ui-to-page { fill: #232326; stroke: rgba(255, 255, 255, 0.08); }\n:where(.dark, [data-theme=\"dark\"]) .ui-to-bar { fill: #2e2e32; }\n@media (prefers-reduced-motion: no-preference) {\n  :where(.dark, [data-theme=\"dark\"]) .ui-to-bar { animation-name: ui-to-shimmer-dark; }\n}\n@keyframes ui-to-shimmer-dark {\n  0%, 100% { fill: #2e2e32; }\n  50% { fill: #3a3a3f; }\n}\n`;\n"}]}