{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "shop-category-mosaic",
  "type": "registry:component",
  "title": "Category Mosaic",
  "description": "A mosaic of shop categories with gradient scenes and product silhouettes. Tiles wipe in on scroll and zoom their image on hover while an arrow and tagline slide in.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "ecommerce",
    "ecommerce",
    "categories",
    "mosaic",
    "grid",
    "hover zoom",
    "collections"
  ],
  "docs": "https://hyperblur.dev/effects/shop-category-mosaic",
  "files": [
    {
      "path": "registry/hyperblur/shop-category-mosaic.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/shop-category-mosaic.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface ShopMosaicCategory {\n  name: string;\n  count: number;\n  href: string;\n  tagline?: string;\n  image?: string;\n  palette?: [string, string, string];\n  object?: \"bottle\" | \"chair\" | \"lamp\" | \"shoe\" | \"bag\" | \"plant\";\n}\n\nexport interface ShopCategoryMosaicProps extends Omit<React.HTMLAttributes<HTMLElement>, \"title\"> {\n  eyebrow?: string;\n  title?: string;\n  subtitle?: string;\n  categories?: ShopMosaicCategory[];\n  cta?: { label: string; href: string };\n  accent?: string;\n  onCategoryClick?: (category: ShopMosaicCategory, index: number) => void;\n}\n\nconst defaultCategories: ShopMosaicCategory[] = [\n  { name: \"Living room\", count: 214, href: \"#\", tagline: \"Sofas, side tables and soft light\", palette: [\"#c2410c\", \"#7c2d12\", \"#1c0f08\"], object: \"chair\" },\n  { name: \"Lighting\", count: 96, href: \"#\", tagline: \"New from Studio Halde\", palette: [\"#eab308\", \"#713f12\", \"#120d04\"], object: \"lamp\" },\n  { name: \"Ceramics\", count: 138, href: \"#\", palette: [\"#5eead4\", \"#115e59\", \"#041311\"], object: \"bottle\" },\n  { name: \"Footwear\", count: 72, href: \"#\", palette: [\"#a78bfa\", \"#4c1d95\", \"#0d0716\"], object: \"shoe\" },\n  { name: \"Bags\", count: 58, href: \"#\", palette: [\"#fb7185\", \"#881337\", \"#14050a\"], object: \"bag\" },\n  { name: \"Plants & pots\", count: 121, href: \"#\", tagline: \"Delivered potted and ready\", palette: [\"#4ade80\", \"#14532d\", \"#04110a\"], object: \"plant\" },\n];\n\nconst css = `\n.hb-yja {\n  --hb-yja-accent: #fb923c;\n  position: relative;\n  box-sizing: border-box;\n  width: 100%;\n  overflow: hidden;\n  container-type: inline-size;\n  background: #0a0a0a;\n  color: #ededed;\n  font-family: inherit;\n  -webkit-font-smoothing: antialiased;\n}\n.hb-yja *, .hb-yja *::before, .hb-yja *::after { box-sizing: border-box; }\n.hb-yja-inner { max-width: 1120px; margin: 0 auto; padding: 72px 20px; }\n@container (min-width: 800px) { .hb-yja-inner { padding: 96px 32px; } }\n.hb-yja-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 40px; margin-bottom: 32px; }\n.hb-yja-eyebrow { margin: 0 0 12px; color: var(--hb-yja-accent); font-size: 13px; font-weight: 600; }\n.hb-yja-title { margin: 0; font-size: clamp(30px, 4.6cqw, 46px); line-height: 1.05; letter-spacing: -.035em; font-weight: 650; }\n.hb-yja-sub { margin: 12px 0 0; max-width: 460px; color: #8f8f8f; font-size: 16px; line-height: 1.6; }\n.hb-yja-cta {\n  display: inline-flex;\n  align-items: center;\n  gap: 8px;\n  height: 42px;\n  padding: 0 18px;\n  border: 1px solid rgba(255, 255, 255, .12);\n  border-radius: 999px;\n  color: #ededed;\n  font-size: 14px;\n  font-weight: 500;\n  text-decoration: none;\n  transition: background .2s ease, border-color .2s ease;\n}\n.hb-yja-cta:hover { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .2); }\n.hb-yja-cta:focus-visible { outline: 2px solid var(--hb-yja-accent); outline-offset: 3px; }\n.hb-yja-grid {\n  display: grid;\n  gap: 12px;\n  grid-template-columns: repeat(2, minmax(0, 1fr));\n  grid-auto-rows: 170px;\n}\n.hb-yja-tile:nth-child(1) { grid-column: span 2; grid-row: span 2; }\n.hb-yja-tile:nth-child(6) { grid-column: span 2; }\n@container (min-width: 760px) {\n  .hb-yja-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 190px; gap: 14px; }\n  .hb-yja-tile:nth-child(1) { grid-column: span 2; grid-row: span 2; }\n  .hb-yja-tile:nth-child(2) { grid-column: span 2; }\n  .hb-yja-tile:nth-child(5) { grid-column: span 2; }\n  .hb-yja-tile:nth-child(6) { grid-column: span 2; }\n}\n.hb-yja-tile {\n  position: relative;\n  display: flex;\n  flex-direction: column;\n  justify-content: flex-end;\n  overflow: hidden;\n  padding: 18px;\n  border-radius: 20px;\n  color: #fff;\n  text-decoration: none;\n  isolation: isolate;\n  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);\n  clip-path: inset(0 0 100% 0 round 20px);\n  transition: box-shadow .3s ease;\n}\n.hb-yja-seen .hb-yja-tile { animation: hb-yja-wipe .9s cubic-bezier(.7, 0, .2, 1) forwards; animation-delay: calc(var(--hb-yja-i) * 90ms); }\n.hb-yja-tile:hover { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22); }\n.hb-yja-tile:focus-visible { outline: 2px solid var(--hb-yja-accent); outline-offset: 3px; }\n.hb-yja-img {\n  position: absolute;\n  inset: 0;\n  z-index: -2;\n  transform: scale(1.001);\n  transition: transform 1.1s cubic-bezier(.2, .8, .2, 1);\n}\n.hb-yja-tile:hover .hb-yja-img, .hb-yja-tile:focus-visible .hb-yja-img { transform: scale(1.09); }\n.hb-yja-img svg { position: absolute; right: 6%; bottom: 0; height: 88%; width: auto; max-width: 70%; }\n.hb-yja-tile::after {\n  content: \"\";\n  position: absolute;\n  inset: 0;\n  z-index: -1;\n  background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, .65));\n}\n.hb-yja-tag {\n  position: absolute;\n  top: 16px;\n  left: 16px;\n  padding: 5px 10px;\n  border-radius: 999px;\n  background: rgba(0, 0, 0, .35);\n  backdrop-filter: blur(8px);\n  border: 1px solid rgba(255, 255, 255, .14);\n  font-size: 12px;\n  font-weight: 500;\n  font-variant-numeric: tabular-nums;\n}\n.hb-yja-name { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 19px; font-weight: 640; letter-spacing: -.02em; }\n.hb-yja-tile:nth-child(1) .hb-yja-name { font-size: clamp(22px, 3.2cqw, 32px); }\n.hb-yja-line { display: block; margin: 4px 0 0; color: rgba(255, 255, 255, .72); font-size: 13.5px; max-height: 0; opacity: 0; overflow: hidden; transition: max-height .4s ease, opacity .4s ease; }\n.hb-yja-tile:nth-child(1) .hb-yja-line, .hb-yja-tile:hover .hb-yja-line, .hb-yja-tile:focus-visible .hb-yja-line { max-height: 40px; opacity: 1; }\n.hb-yja-arrow {\n  flex: none;\n  display: grid;\n  place-items: center;\n  width: 34px;\n  height: 34px;\n  border-radius: 50%;\n  background: #fff;\n  color: #0a0a0a;\n  transform: translate(-6px, 6px) scale(.7);\n  opacity: 0;\n  transition: transform .35s cubic-bezier(.2, .8, .2, 1), opacity .3s ease;\n}\n.hb-yja-tile:hover .hb-yja-arrow, .hb-yja-tile:focus-visible .hb-yja-arrow { transform: none; opacity: 1; }\n@keyframes hb-yja-wipe { to { clip-path: inset(0 0 0 0 round 20px); } }\n@media (prefers-reduced-motion: reduce) {\n  .hb-yja *, .hb-yja *::before, .hb-yja *::after { animation: none !important; transition: none !important; }\n  .hb-yja-tile { clip-path: none; }\n}\n`;\n\nfunction lighten(hex: string, amount: number) {\n  const m = /^#([0-9a-f]{6})$/i.exec(hex.trim());\n  if (!m) return hex;\n  const n = parseInt(m[1], 16);\n  const ch = [(n >> 16) & 255, (n >> 8) & 255, n & 255].map((v) => Math.round(v + (255 - v) * amount));\n  return `rgb(${ch[0]}, ${ch[1]}, ${ch[2]})`;\n}\n\nfunction ObjectArt({ kind, light }: { kind: NonNullable<ShopMosaicCategory[\"object\"]>; light: string }) {\n  const shade = \"rgba(0,0,0,.28)\";\n  if (kind === \"chair\") {\n    return (\n      <svg viewBox=\"0 0 200 200\" aria-hidden=\"true\">\n        <ellipse cx=\"100\" cy=\"190\" rx=\"80\" ry=\"8\" fill={shade} />\n        <rect x=\"34\" y=\"70\" width=\"132\" height=\"70\" rx=\"26\" fill={light} opacity=\".9\" />\n        <rect x=\"22\" y=\"104\" width=\"156\" height=\"50\" rx=\"20\" fill={light} />\n        <rect x=\"40\" y=\"150\" width=\"10\" height=\"38\" rx=\"4\" fill={light} opacity=\".7\" />\n        <rect x=\"150\" y=\"150\" width=\"10\" height=\"38\" rx=\"4\" fill={light} opacity=\".7\" />\n        <rect x=\"34\" y=\"70\" width=\"132\" height=\"14\" rx=\"7\" fill=\"#fff\" opacity=\".18\" />\n      </svg>\n    );\n  }\n  if (kind === \"lamp\") {\n    return (\n      <svg viewBox=\"0 0 120 200\" aria-hidden=\"true\">\n        <ellipse cx=\"60\" cy=\"40\" rx=\"50\" ry=\"60\" fill={light} opacity=\".22\" />\n        <path d=\"M28 70 40 20h40l12 50Z\" fill={light} />\n        <rect x=\"57\" y=\"70\" width=\"6\" height=\"110\" fill={light} opacity=\".8\" />\n        <ellipse cx=\"60\" cy=\"186\" rx=\"30\" ry=\"7\" fill={light} opacity=\".85\" />\n      </svg>\n    );\n  }\n  if (kind === \"bottle\") {\n    return (\n      <svg viewBox=\"0 0 160 200\" aria-hidden=\"true\">\n        <ellipse cx=\"80\" cy=\"194\" rx=\"70\" ry=\"6\" fill={shade} />\n        <path d=\"M44 40h20v24c18 8 26 30 26 60v66H18v-66c0-30 8-52 26-60Z\" fill={light} />\n        <path d=\"M108 100c0-20 22-20 22 0v90h-22Z\" fill={light} opacity=\".6\" />\n        <rect x=\"18\" y=\"120\" width=\"72\" height=\"8\" fill=\"#fff\" opacity=\".2\" />\n      </svg>\n    );\n  }\n  if (kind === \"shoe\") {\n    return (\n      <svg viewBox=\"0 0 220 140\" aria-hidden=\"true\">\n        <ellipse cx=\"110\" cy=\"134\" rx=\"100\" ry=\"6\" fill={shade} />\n        <path d=\"M14 96c0-22 10-40 24-50l30 22c22 14 60 18 100 22 26 3 40 14 40 28v10H14Z\" fill={light} />\n        <rect x=\"14\" y=\"118\" width=\"194\" height=\"10\" rx=\"5\" fill=\"#fff\" opacity=\".85\" />\n        <path d=\"M60 60l10 8M74 70l10 7M88 78l10 6\" stroke=\"#fff\" strokeOpacity=\".5\" strokeWidth=\"4\" strokeLinecap=\"round\" />\n      </svg>\n    );\n  }\n  if (kind === \"bag\") {\n    return (\n      <svg viewBox=\"0 0 160 200\" aria-hidden=\"true\">\n        <ellipse cx=\"80\" cy=\"194\" rx=\"70\" ry=\"6\" fill={shade} />\n        <path d=\"M52 70c0-40 56-40 56 0\" stroke={light} strokeWidth=\"9\" fill=\"none\" />\n        <rect x=\"22\" y=\"66\" width=\"116\" height=\"124\" rx=\"18\" fill={light} />\n        <rect x=\"64\" y=\"104\" width=\"32\" height=\"12\" rx=\"6\" fill=\"#fff\" opacity=\".4\" />\n      </svg>\n    );\n  }\n  return (\n    <svg viewBox=\"0 0 160 200\" aria-hidden=\"true\">\n      <path d=\"M80 120C60 90 30 86 20 50c30 4 50 24 60 70Z\" fill={light} opacity=\".75\" />\n      <path d=\"M80 120c10-50 40-70 66-72-6 34-34 50-66 72Z\" fill={light} />\n      <path d=\"M80 124c-4-40 2-80 14-104 8 30 4 70-14 104Z\" fill={light} opacity=\".9\" />\n      <path d=\"M44 124h72l-10 70H54Z\" fill=\"#fff\" opacity=\".88\" />\n    </svg>\n  );\n}\n\nexport function ShopCategoryMosaic({\n  eyebrow = \"Shop by category\",\n  title = \"Made for slow mornings at home\",\n  subtitle = \"Six collections from independent makers in Copenhagen, Kyoto and Oaxaca. Free returns for 60 days.\",\n  categories = defaultCategories,\n  cta = { label: \"View all 700 products\", href: \"#\" },\n  accent = \"#fb923c\",\n  onCategoryClick,\n  className,\n  style,\n  ...rest\n}: ShopCategoryMosaicProps) {\n  const [seen, setSeen] = React.useState(false);\n  const gridRef = React.useRef<HTMLDivElement>(null);\n\n  React.useEffect(() => {\n    const el = gridRef.current;\n    if (!el) return;\n    const io = new IntersectionObserver(\n      (entries) => {\n        if (entries.some((e) => e.isIntersecting)) {\n          setSeen(true);\n          io.disconnect();\n        }\n      },\n      { threshold: 0.05 },\n    );\n    io.observe(el);\n    return () => io.disconnect();\n  }, []);\n\n  return (\n    <section\n      className={[\"hb-yja\", seen ? \"hb-yja-seen\" : \"\", className].filter(Boolean).join(\" \")}\n      style={{ \"--hb-yja-accent\": accent, ...style } as React.CSSProperties}\n      {...rest}\n    >\n      <style href=\"hb-shop-category-mosaic\" precedence=\"default\">{css}</style>\n      <div className=\"hb-yja-inner\">\n        <div className=\"hb-yja-head\">\n          <div>\n            {eyebrow ? <p className=\"hb-yja-eyebrow\">{eyebrow}</p> : null}\n            <h2 className=\"hb-yja-title\">{title}</h2>\n            {subtitle ? <p className=\"hb-yja-sub\">{subtitle}</p> : null}\n          </div>\n          {cta ? (\n            <a className=\"hb-yja-cta\" href={cta.href}>\n              {cta.label}\n              <svg width=\"14\" height=\"14\" viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\">\n                <path d=\"M3 8h10m-4-4 4 4-4 4\" stroke=\"currentColor\" strokeWidth=\"1.6\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n              </svg>\n            </a>\n          ) : null}\n        </div>\n        <div className=\"hb-yja-grid\" ref={gridRef}>\n          {categories.map((c, i) => {\n            const [p1, p2, p3] = c.palette ?? [accent, \"#3f3f46\", \"#0a0a0a\"];\n            const bg = c.image\n              ? `center / cover no-repeat url(\"${c.image}\")`\n              : `radial-gradient(70% 80% at 75% 35%, ${p1}, transparent 70%), radial-gradient(60% 60% at 10% 100%, ${p2}, transparent 70%), linear-gradient(160deg, ${p2}, ${p3})`;\n            return (\n              <a key={c.name} className=\"hb-yja-tile\" href={c.href} onClick={() => onCategoryClick?.(c, i)} style={{ \"--hb-yja-i\": i } as React.CSSProperties}>\n                <span className=\"hb-yja-img\" style={{ background: bg }} aria-hidden=\"true\">\n                  {c.image ? null : <ObjectArt kind={c.object ?? \"bag\"} light={lighten(p1, 0.45)} />}\n                </span>\n                <span className=\"hb-yja-tag\">{c.count} items</span>\n                <span className=\"hb-yja-name\">\n                  {c.name}\n                  <span className=\"hb-yja-arrow\" aria-hidden=\"true\">\n                    <svg width=\"14\" height=\"14\" viewBox=\"0 0 16 16\" fill=\"none\">\n                      <path d=\"M5 11 11 5M6 5h5v5\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n                    </svg>\n                  </span>\n                </span>\n                {c.tagline ? <span className=\"hb-yja-line\">{c.tagline}</span> : null}\n              </a>\n            );\n          })}\n        </div>\n      </div>\n    </section>\n  );\n}\n"
    }
  ]
}