{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "honeycomb-hero",
  "title": "Honeycomb Hero",
  "author": "AlgorizeTech",
  "description": "Ask the user to pick one of 16 hero variants: https://avaraui.com/view/hero. This is the Honeycomb hero. Skip the question if the user already named one. A travel hero on a dark ground that shifts colour: a light line over a huge white word whose letters turn the theme's primary where they cross the photographs, and a honeycomb of hexagonal photographs with a primary hexagonal call to action set among them. The large hexagon is the slide on screen; its photograph fills the background, tinted with that photograph's own tone, so the whole section changes colour as, every four seconds or on the arrows at the foot, every hexagon moves one step along the ring, endlessly.",
  "dependencies": [
    "lucide-react"
  ],
  "registryDependencies": [
    "utils"
  ],
  "files": [
    {
      "path": "src/components/custom/blocks/HoneycombHeroBlock.tsx",
      "content": "\"use client\";\n\nimport React, { forwardRef, useCallback, useEffect, useLayoutEffect, useRef, useState } from \"react\";\nimport { ChevronLeft, ChevronRight, Compass } from \"lucide-react\";\nimport { cn } from \"@/lib/utils\";\nimport { accentTokens } from \"@/lib/accent\";\n\n// ==========================================\n// HONEYCOMB HERO\n// A travel hero on a dark, shifting ground: a light line over a huge white\n// word on the left, and on the right a honeycomb of hexagonal photographs\n// with a primary hexagonal call to action set among them. The\n// large hexagon is the slide on screen — its photograph is also the\n// background, tinted with that photograph's own tone, so the colour behind\n// everything changes with the slide — and the smaller ones are the queue.\n// Every few seconds, or on the arrows at the foot, every hexagon moves one\n// step along the honeycomb: the next photo grows into the feature spot while\n// the feature slides to the back of the queue. The loop never ends. Where\n// the huge word crosses the photographs, its letters turn the primary. Every\n// accent reads the theme's tokens where the section sits, so a theme change\n// repaints it.\n// ==========================================\n\nexport interface HoneycombImage {\n  src: string;\n  alt: string;\n  /**\n   * The colour behind everything while this photograph is featured — keep\n   * it deep, the copy is white. Defaults to `background`.\n   */\n  tone?: string;\n}\n\nexport interface HoneycombHeroProps extends Omit<React.HTMLAttributes<HTMLElement>, \"onChange\"> {\n  /** The light line above the accent word. */\n  title?: string;\n  /** The huge, tracked, upper-case word, in white. */\n  titleAccent?: string;\n  /** The letters of the huge word that cross the photographs; the primary by default. */\n  titleOverlapColor?: string;\n  subtitle?: string;\n  /** The words in the call-to-action hexagon; a `\\n` breaks the line. */\n  primaryActionLabel?: string;\n  primaryActionHref?: string;\n  /**\n   * The photographs, in queue order — the first is featured at the start.\n   * Nine cells are visible; fewer photographs are repeated around the ring.\n   */\n  images?: HoneycombImage[];\n  /** Links along the foot; an empty array hides them. */\n  socialLinks?: { label: string; href: string }[];\n  /** Milliseconds between steps; `0` turns autoplay off. */\n  interval?: number;\n  onChange?: (index: number) => void;\n  /**\n   * Sets `--primary` for the section — the word, the rule, the arrows and the\n   * call to action. The theme's primary by default.\n   */\n  accent?: string;\n  color?: string;\n  /** The tone for photographs without their own; a deep shade of the primary by default. */\n  background?: string;\n  /** Pass `next/link` to keep client-side navigation. */\n  linkComponent?: React.ElementType;\n}\n\n// ------------------------------------------\n// The honeycomb, measured from the design. The stage is 553 × 583 units,\n// anchored to the right edge of the section; hexagons are pointy-top, 160\n// units wide (the feature is 320), on a lattice with a 160 horizontal and\n// 139 vertical step. Positions are percentages of the stage, so the\n// composition holds at any size — and whatever falls past the right edge is\n// clipped, as in the design.\n// ------------------------------------------\nconst STAGE_W = 553;\nconst STAGE_H = 583;\nconst SMALL = 160;\nconst HEX_H = 2 / Math.sqrt(3); // height ÷ width of a pointy-top hexagon\n\nconst pct = (v: number, of: number) => `${((v / of) * 100).toFixed(3)}%`;\n\ninterface Slot {\n  left: string;\n  top: string;\n  width: string;\n}\n\nconst slot = (cx: number, cy: number, w = SMALL): Slot => ({\n  left: pct(cx - w / 2, STAGE_W),\n  top: pct(cy - (w * HEX_H) / 2, STAGE_H),\n  width: pct(w, STAGE_W),\n});\n\n/**\n * The queue, in the order a photograph travels: it enters at the last slot\n * and moves along the ring — bottom, bottom-right, red-house, beach, far\n * coast, corner, top-right, top — until it reaches the feature at slot 0.\n * Every hop is between neighbouring cells, so the motion reads as one wave.\n */\nconst SLOTS: Slot[] = [\n  slot(160, 340, 320), // 0 · feature\n  slot(333, 150), // 1 · top\n  slot(493, 150), // 2 · top-right, clipped by the edge\n  slot(573, 11), // 3 · corner, mostly clipped\n  slot(583, 300), // 4 · far right, a sliver\n  slot(423, 300), // 5 · right\n  slot(503, 439), // 6 · lower right, clipped\n  slot(423, 578), // 7 · bottom right, clipped by the foot\n  slot(255, 578), // 8 · bottom, clipped by the foot\n];\nconst CTA_SLOT = slot(343, 439);\nconst CELLS = SLOTS.length;\n\n// A pointy-top regular hexagon.\nconst HEX_CLIP = \"polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%)\";\n// The same hexagon as SVG points, in a 100-wide box.\nconst HEX_POINTS = [\n  [50, 0],\n  [100, 25],\n  [100, 75],\n  [50, 100],\n  [0, 75],\n  [0, 25],\n]\n  .map(([x, y]) => `${x},${((y / 100) * 100 * HEX_H).toFixed(2)}`)\n  .join(\" \");\n\nconst prefersReducedMotion = () =>\n  typeof window !== \"undefined\" && window.matchMedia?.(\"(prefers-reduced-motion: reduce)\").matches;\n\n// ------------------------------------------\n// Motion. GSAP's power3.inOut for the cells; power2.inOut for the background,\n// run as its two exact halves (power2.in, then power2.out).\n// ------------------------------------------\nconst EASE_TRAVEL =\n  \"linear(0, 0, .0002, .0012, .0039, .0094, .0195, .0361, .0617, .0988, .1505, .2204, .3121, .4299, .5701, .6879, .7796, .8495, .9012, .9383, .9639, .9805, .9906, .9961, .9988, .9998, 1, 1)\";\nconst EASE_IN_HALF = \"cubic-bezier(0.3333, 0, 0.6667, 0)\";\nconst EASE_OUT_HALF = \"cubic-bezier(0.3333, 1, 0.6667, 1)\";\n\ntype StyleTarget = Record<string, string>;\n\n/**\n * Take `el` from wherever it is on screen to `to`. A move already running is\n * dropped where it stands and the new one starts from there and runs its full\n * length — what GSAP's `killTweensOf` / `overwrite: \"auto\"` do. (A CSS\n * transition would shorten a move that reverses back to where it started.)\n * During `delay` the element holds its current place. Without `options` the\n * values are simply set.\n */\nfunction moveTo(\n  el: HTMLElement,\n  running: WeakMap<HTMLElement, Animation>,\n  to: StyleTarget,\n  options?: KeyframeAnimationOptions & { keyframes?: (from: StyleTarget) => Keyframe[] },\n) {\n  const current = running.get(el);\n  running.delete(el);\n  if (!options || typeof el.animate !== \"function\") {\n    current?.cancel();\n    Object.assign(el.style, to);\n    return;\n  }\n  // Read the on-screen values before the running move is dropped.\n  const cs = getComputedStyle(el);\n  const from: StyleTarget = {};\n  for (const key of Object.keys(to)) from[key] = cs.getPropertyValue(key);\n  current?.cancel();\n  Object.assign(el.style, to);\n  if (!current && Object.keys(to).every((key) => from[key] === to[key])) return;\n  const { keyframes, ...timing } = options;\n  try {\n    running.set(el, el.animate(keyframes ? keyframes(from) : [from, to], { fill: \"backwards\", ...timing }));\n  } catch {\n    // An engine without `linear()` easing: the element just takes its place.\n  }\n}\n\n// ------------------------------------------\n// Defaults — Lofoten and the fjords, from Unsplash, each with a deep tone\n// drawn from the photograph, so the ground shifts colour as the queue turns.\n// ------------------------------------------\n\nconst DEFAULT_IMAGES: HoneycombImage[] = [\n  { src: \"https://res.cloudinary.com/dodndg7ai/image/upload/f_webp,q_auto,w_1400,c_limit/v1790158809/photo-1628344253777-f73a64d8f983-1790158812202.jpg\", alt: \"A waterfall pouring through a green gorge\", tone: \"#0f2e22\" },\n  { src: \"https://res.cloudinary.com/dodndg7ai/image/upload/f_webp,q_auto,w_1400,c_limit/v1790158811/photo-1663428520845-056989f8a664-1790158812204.jpg\", alt: \"Red cabins at Hamnøy under a mountain\", tone: \"#1f2140\" },\n  { src: \"https://res.cloudinary.com/dodndg7ai/image/upload/f_webp,q_auto,w_1400,c_limit/v1790158812/photo-1710762634126-4c0e8fba44d8-1790158812206.jpg\", alt: \"A snowy village below white peaks\", tone: \"#18233a\" },\n  { src: \"https://res.cloudinary.com/dodndg7ai/image/upload/f_webp,q_auto,w_1400,c_limit/v1790158815/photo-1593378026483-2a1fd46a35bd-1790158812215.jpg\", alt: \"Green aurora above snowy mountains\", tone: \"#0b2a2d\" },\n  { src: \"https://res.cloudinary.com/dodndg7ai/image/upload/f_webp,q_auto,w_1400,c_limit/v1790158812/photo-1695496896465-9e59091a8ed1-1790158812205.jpg\", alt: \"Turquoise water between mountain ridges\", tone: \"#082f3d\" },\n  { src: \"https://res.cloudinary.com/dodndg7ai/image/upload/f_webp,q_auto,w_1400,c_limit/v1790158812/photo-1721335916916-37c319adce3a-1790158812206.jpg\", alt: \"A sandy beach beneath a rocky headland\", tone: \"#1d2b36\" },\n  { src: \"https://res.cloudinary.com/dodndg7ai/image/upload/f_webp,q_auto,w_1400,c_limit/v1790166049/photo-1527004013197-933c4bb611b3-1790166052225.jpg\", alt: \"A red cabin on a rocky shore\", tone: \"#2a1f3d\" },\n  { src: \"https://res.cloudinary.com/dodndg7ai/image/upload/f_webp,q_auto,w_1400,c_limit/v1790158811/photo-1682952986992-de7082fb213d-1790158812205.jpg\", alt: \"Waterfalls running down the wall of a fjord\", tone: \"#132a3b\" },\n  { src: \"https://res.cloudinary.com/dodndg7ai/image/upload/f_webp,q_auto,w_1400,c_limit/v1790158809/photo-1607888566357-ec0b61abee46-1790158812198.jpg\", alt: \"A waterfall beside a wooden viewpoint\", tone: \"#1c2b17\" },\n];\n\nconst DEFAULT_SOCIAL = [\n  { label: \"Instagram\", href: \"#\" },\n  { label: \"YouTube\", href: \"#\" },\n  { label: \"TikTok\", href: \"#\" },\n  { label: \"Pinterest\", href: \"#\" },\n];\n\n/** A deep shade of the primary, for photographs without a tone of their own. */\nconst DEFAULT_BACKGROUND = \"color-mix(in oklab, var(--primary) 16%, #05080a)\";\n\n// ------------------------------------------\n// Root\n// ------------------------------------------\nexport const HoneycombHero = forwardRef<HTMLElement, HoneycombHeroProps>(\n  (\n    {\n      title = \"Wander the\",\n      titleAccent = \"Fjords\",\n      titleOverlapColor = \"var(--primary)\",\n      subtitle = \"Waterfalls that drop straight into the sea, red cabins at the water's edge and skies that glow green after dark — small-group journeys through the far north.\",\n      primaryActionLabel = \"Plan\\nyour trip\",\n      primaryActionHref = \"#\",\n      images = DEFAULT_IMAGES,\n      socialLinks = DEFAULT_SOCIAL,\n      interval = 4000,\n      onChange,\n      accent,\n      color,\n      background = DEFAULT_BACKGROUND,\n      linkComponent: Link = \"a\",\n      className,\n      style,\n      ...props\n    },\n    ref,\n  ) => {\n    const rootRef = useRef<HTMLElement | null>(null);\n    const stageRef = useRef<HTMLDivElement>(null);\n    const headingRef = useRef<HTMLHeadingElement>(null);\n    const cellRefs = useRef<(HTMLDivElement | null)[]>([]);\n    const bgRefs = useRef<(HTMLDivElement | null)[]>([]);\n    const placedRef = useRef(false);\n    const movesRef = useRef(new WeakMap<HTMLElement, Animation>());\n\n    // Nine cells; each carries one photograph for good. Fewer photographs\n    // than cells are repeated around the ring.\n    const n = Math.max(images.length, 1);\n    const cells = Array.from({ length: CELLS }, (_, i) => images[i % n]);\n\n    // `offset` is how many steps the queue has moved; cell i sits in slot\n    // (i - offset) mod 9, so the cell in slot 0 is the feature.\n    const [offset, setOffset] = useState(0);\n    const [hidden, setHidden] = useState(false);\n    const [onScreen, setOnScreen] = useState(true);\n    const [cut, setCut] = useState<number | null>(null);\n\n    const slotOf = useCallback((i: number, off: number) => (((i - off) % CELLS) + CELLS) % CELLS, []);\n    const featureCell = slotOf(0, -offset); // the cell in slot 0\n    const featureIndex = featureCell % n;\n    const toneOf = (img: HoneycombImage | undefined) => img?.tone ?? background;\n    const tone = toneOf(images[featureIndex]);\n\n    const go = useCallback((dir: 1 | -1) => setOffset((o) => o + dir), []);\n\n    useEffect(() => {\n      onChange?.(featureIndex);\n    }, [featureIndex, onChange]);\n\n    // ---- Place the cells, then move them a step at a time. The cell heading\n    // for the feature rises above the rest; the one leaving it drops behind.\n    useLayoutEffect(() => {\n      const reduced = prefersReducedMotion();\n      const animate = placedRef.current && !reduced;\n      cells.forEach((_, i) => {\n        const el = cellRefs.current[i];\n        if (!el) return;\n        const k = slotOf(i, offset);\n        const target = { ...SLOTS[k] };\n        el.style.zIndex = String(k === 0 ? 30 : k === CELLS - 1 ? 5 : 20 - k);\n        // A step taken mid-move drops the old move where it stands, so it\n        // never runs on through the new one's stagger delay.\n        moveTo(\n          el,\n          movesRef.current,\n          target,\n          animate ? { duration: 1150, easing: EASE_TRAVEL, delay: k * 45 } : undefined,\n        );\n      });\n      placedRef.current = true;\n      // eslint-disable-next-line react-hooks/exhaustive-deps\n    }, [offset, n]);\n\n    // ---- The background follows the feature.\n    useEffect(() => {\n      const reduced = prefersReducedMotion();\n      bgRefs.current.forEach((el, i) => {\n        if (!el) return;\n        const to = i === featureIndex ? 1 : 0;\n        moveTo(\n          el,\n          movesRef.current,\n          { opacity: String(to) },\n          reduced\n            ? undefined\n            : {\n                duration: 1400,\n                keyframes: (from) => {\n                  const start = parseFloat(from.opacity);\n                  return [\n                    { opacity: start, easing: EASE_IN_HALF },\n                    { opacity: (start + to) / 2, offset: 0.5, easing: EASE_OUT_HALF },\n                    { opacity: to },\n                  ];\n                },\n              },\n        );\n      });\n    }, [featureIndex]);\n\n    // ---- The accent word turns the primary where it crosses the photographs:\n    // a coloured copy is clipped at the stage's left edge.\n    useLayoutEffect(() => {\n      const root = rootRef.current;\n      const stage = stageRef.current;\n      const h1 = headingRef.current;\n      if (!root || !stage || !h1) return;\n      const measure = () => {\n        const s = stage.getBoundingClientRect();\n        const h = h1.getBoundingClientRect();\n        // Only when the stage sits beside the text, not below it.\n        const beside = s.top < h.bottom && s.bottom > h.top;\n        setCut(beside ? Math.max(0, s.left - h.left) : null);\n      };\n      measure();\n      if (typeof ResizeObserver === \"undefined\") return;\n      const ro = new ResizeObserver(measure);\n      ro.observe(root);\n      return () => ro.disconnect();\n    }, []);\n\n    // ---- Autoplay: held while the tab is hidden or the section is off screen.\n    const paused = hidden || !onScreen;\n    useEffect(() => {\n      if (interval <= 0 || paused) return;\n      const t = window.setTimeout(() => go(1), interval);\n      return () => window.clearTimeout(t);\n    }, [offset, interval, paused, go]);\n\n    useEffect(() => {\n      const onVisibility = () => setHidden(document.hidden);\n      document.addEventListener(\"visibilitychange\", onVisibility);\n      return () => document.removeEventListener(\"visibilitychange\", onVisibility);\n    }, []);\n\n    useEffect(() => {\n      const el = rootRef.current;\n      if (!el || typeof IntersectionObserver === \"undefined\") return;\n      const io = new IntersectionObserver((entries) => setOnScreen(entries.some((e) => e.isIntersecting)), { threshold: 0.2 });\n      io.observe(el);\n      return () => io.disconnect();\n    }, []);\n\n    const onKeyDown = (e: React.KeyboardEvent) => {\n      if (e.key === \"ArrowRight\") {\n        e.preventDefault();\n        go(1);\n      } else if (e.key === \"ArrowLeft\") {\n        e.preventDefault();\n        go(-1);\n      }\n    };\n\n    const arrow =\n      \"grid size-7 place-items-center rounded-sm text-primary outline-none transition-transform duration-300 hover:scale-125 focus-visible:ring-2 focus-visible:ring-primary\";\n\n    return (\n      <section\n        ref={(node) => {\n          rootRef.current = node;\n          if (typeof ref === \"function\") ref(node);\n          else if (ref) (ref as React.MutableRefObject<HTMLElement | null>).current = node;\n        }}\n        onKeyDown={onKeyDown}\n        // `--hc-bg` is the featured photograph's tone; everything painted with it\n        // eases to the next one as the queue turns.\n        style={{ ...accentTokens(accent || color), \"--hc-bg\": tone, ...style } as React.CSSProperties}\n        className={cn(\n          // No `dark` class here: it would redeclare `--primary` from the\n          // stylesheet and cut the section off from a theme set on <html>.\n          \"relative isolate w-full overflow-hidden bg-[var(--hc-bg)] text-white transition-[background-color] duration-[1400ms] ease-in-out [container-type:inline-size]\",\n          \"lg:aspect-[948/583] lg:max-h-[54rem] lg:min-h-[36rem]\",\n          className,\n        )}\n        {...props}\n      >\n        {/* ---- The background: the feature photograph, tinted with its own\n            tone. Each layer carries its tint, so crossfading the layers\n            crossfades the colour too. ---- */}\n        <div className=\"absolute inset-0\" aria-hidden>\n          {images.map((img, i) => (\n            <div\n              key={img.src + i}\n              ref={(el) => {\n                bgRefs.current[i] = el;\n              }}\n              className=\"absolute inset-0\"\n              style={{ opacity: i === 0 ? 1 : 0, \"--hc-tone\": toneOf(img) } as React.CSSProperties}\n            >\n              <img src={img.src} alt=\"\" draggable={false} className=\"absolute inset-0 h-full w-full object-cover [filter:saturate(0.55)_brightness(0.7)]\" />\n              <div className=\"absolute inset-0 bg-[var(--hc-tone)] opacity-80 mix-blend-color\" />\n              <div className=\"absolute inset-0 bg-[var(--hc-tone)] opacity-55\" />\n              <div className=\"absolute inset-0 bg-[linear-gradient(90deg,var(--hc-tone)_0%,transparent_45%),linear-gradient(180deg,transparent_60%,var(--hc-tone)_100%)] opacity-90\" />\n            </div>\n          ))}\n        </div>\n\n        <div className=\"relative flex flex-col lg:absolute lg:inset-0 lg:block\">\n          {/* ---- Copy ---- */}\n          <div className=\"relative z-20 px-[8cqw] pb-4 pt-14 lg:absolute lg:left-0 lg:top-1/2 lg:w-[46%] lg:-translate-y-[46%] lg:px-0 lg:pb-0 lg:pl-[14.8cqw] lg:pt-0\">\n            <p className=\"font-sans text-[clamp(1.25rem,3.6cqw,2.4rem)] font-light tracking-[0.04em] text-white/90\">{title}</p>\n\n            <div className=\"relative mt-[0.1em]\">\n              {/* The rule runs in from the section's left edge. */}\n              <span\n                aria-hidden\n                className=\"absolute top-1/2 hidden h-[3px] -translate-y-1/2 bg-primary lg:block\"\n                style={{ left: \"-14.8cqw\", width: \"8.4cqw\" }}\n              />\n              <h1\n                ref={headingRef}\n                className=\"relative inline-block whitespace-nowrap font-sans text-[clamp(2.75rem,9.4cqw,7.5rem)] font-extrabold uppercase leading-[0.95] tracking-[0.02em] text-white\"\n              >\n                {titleAccent}\n                {cut !== null && (\n                  <span\n                    aria-hidden\n                    className=\"absolute inset-0 transition-colors duration-[1400ms] ease-in-out [text-shadow:0_2px_24px_rgb(0_0_0/0.35)]\"\n                    style={{ color: titleOverlapColor, clipPath: `inset(-0.2em -0.1em -0.2em ${cut}px)` }}\n                  >\n                    {titleAccent}\n                  </span>\n                )}\n              </h1>\n            </div>\n\n            {subtitle && (\n              <p className=\"mt-[1.2em] max-w-[min(26rem,60cqw)] font-sans text-[clamp(0.85rem,1.5cqw,1.05rem)] font-light leading-[1.75] text-white/85 lg:max-w-[24cqw]\">\n                {subtitle}\n              </p>\n            )}\n          </div>\n\n          {/* ---- The honeycomb stage ---- */}\n          <div\n            ref={stageRef}\n            role=\"group\"\n            aria-roledescription=\"carousel\"\n            aria-label=\"Photographs\"\n            className={cn(\n              \"relative z-10 mx-auto w-full max-w-[34rem] overflow-hidden lg:absolute lg:inset-y-0 lg:right-0 lg:mx-0 lg:h-full lg:w-auto lg:max-w-none lg:overflow-visible\",\n              // Below the desktop layout the stage is cut by its own box, so the\n              // cells dissolve into the teal at the top, right and foot instead\n              // of ending on a hard line.\n              \"[mask-image:linear-gradient(to_right,black_84%,transparent_100%),linear-gradient(to_bottom,transparent_0%,black_7%,black_92%,transparent_100%)] [mask-composite:intersect] [-webkit-mask-composite:source-in] lg:[mask-image:none]\",\n            )}\n            style={{ aspectRatio: `${STAGE_W} / ${STAGE_H}` }}\n          >\n            {cells.map((img, i) => {\n              const k = slotOf(i, offset);\n              return (\n                <div\n                  key={i}\n                  ref={(el) => {\n                    cellRefs.current[i] = el;\n                  }}\n                  className=\"absolute will-change-[left,top,width]\"\n                  style={{ aspectRatio: `1 / ${HEX_H}` }}\n                  aria-hidden={k !== 0}\n                >\n                  {/* A hair of inset keeps a gap between neighbours. */}\n                  <div\n                    className=\"absolute inset-[3.5%] overflow-hidden bg-[var(--hc-bg)] transition-[background-color] duration-[1400ms]\"\n                    style={{ clipPath: HEX_CLIP }}\n                  >\n                    <img src={img.src} alt={k === 0 ? img.alt : \"\"} draggable={false} className=\"h-full w-full object-cover\" />\n                    <div\n                      className=\"absolute inset-0 bg-[var(--hc-bg)] transition-[opacity,background-color] duration-1000\"\n                      style={{ opacity: k === 0 ? 0 : 0.18 }}\n                    />\n                  </div>\n                </div>\n              );\n            })}\n\n            {/* The call to action: a primary cell in the honeycomb. A hairline\n                hexagon inside it echoes the photographs around it; on hover the\n                compass turns and the inner cell swells, on focus it goes solid. */}\n            <div className=\"absolute z-40\" style={{ ...CTA_SLOT, aspectRatio: `1 / ${HEX_H}` }}>\n              <Link\n                href={primaryActionHref}\n                className=\"group absolute inset-[3.5%] grid place-items-center bg-primary text-primary-foreground outline-none transition-[filter,transform] duration-300 hover:brightness-110 active:scale-[0.97]\"\n                style={{ clipPath: HEX_CLIP }}\n              >\n                <svg\n                  aria-hidden\n                  viewBox={`0 0 100 ${(100 * HEX_H).toFixed(2)}`}\n                  preserveAspectRatio=\"none\"\n                  className=\"absolute inset-[11%] h-[78%] w-[78%] overflow-visible opacity-35 transition-[opacity,transform] duration-500 ease-out group-hover:opacity-70 group-focus-visible:opacity-100 motion-safe:group-hover:scale-105\"\n                >\n                  <polygon\n                    points={HEX_POINTS}\n                    fill=\"none\"\n                    stroke=\"currentColor\"\n                    strokeWidth={1}\n                    vectorEffect=\"non-scaling-stroke\"\n                    className=\"group-focus-visible:[stroke-width:2]\"\n                  />\n                </svg>\n                <span className=\"relative flex flex-col items-center gap-[0.55em] text-center text-[clamp(0.65rem,1.65cqw,1.2rem)]\">\n                  <Compass\n                    aria-hidden\n                    strokeWidth={1.75}\n                    className=\"size-[1.85em] transition-transform duration-500 ease-out motion-safe:group-hover:rotate-45\"\n                  />\n                  <span className=\"block whitespace-pre-line font-sans font-semibold leading-[1.15] tracking-[-0.01em]\">\n                    {primaryActionLabel}\n                  </span>\n                </span>\n              </Link>\n            </div>\n\n            <span className=\"sr-only\" aria-live=\"polite\">\n              {images[featureIndex]?.alt}\n            </span>\n          </div>\n\n          {/* ---- Foot: arrows and links ---- */}\n          <div className=\"relative z-20 flex flex-wrap items-center gap-x-[4cqw] gap-y-3 px-[8cqw] pb-8 pt-6 lg:absolute lg:bottom-[3.8%] lg:left-[2.6cqw] lg:p-0\">\n            <div className=\"flex items-center gap-1\">\n              <button type=\"button\" onClick={() => go(-1)} aria-label=\"Previous photograph\" className={arrow}>\n                <ChevronLeft size={16} strokeWidth={2.5} />\n              </button>\n              <button type=\"button\" onClick={() => go(1)} aria-label=\"Next photograph\" className={arrow}>\n                <ChevronRight size={16} strokeWidth={2.5} />\n              </button>\n            </div>\n            {socialLinks.length > 0 && (\n              <nav aria-label=\"Social\" className=\"flex flex-wrap items-center gap-x-[4cqw] gap-y-2 text-[clamp(0.65rem,1.1cqw,0.8rem)] tracking-[0.08em] text-white/70\">\n                {socialLinks.map((s) => (\n                  <Link key={s.label} href={s.href} className=\"transition-colors hover:text-white\">\n                    {s.label}\n                  </Link>\n                ))}\n              </nav>\n            )}\n          </div>\n        </div>\n      </section>\n    );\n  },\n);\nHoneycombHero.displayName = \"HoneycombHero\";\n\nexport default HoneycombHero;\n",
      "type": "registry:component",
      "target": "components/custom/blocks/HoneycombHeroBlock.tsx"
    },
    {
      "path": "src/lib/accent.ts",
      "content": "import type { CSSProperties } from \"react\";\n\n/**\n * Bridging the docs colour picker into a preview.\n *\n * Most blocks are already written against the `--primary` token (`bg-primary`,\n * `ring-primary/30`, `text-primary-foreground`…). Rather than teaching each one a\n * bespoke `color` prop, a demo can repoint that token for its own subtree and\n * every one of those classes follows along.\n */\n\n/** The swatches the picker offers, as concrete CSS colours. */\nconst PRESET_HEX: Record<string, string> = {\n  lavender: \"#9b8afb\",\n  indigo: \"#6366f1\",\n  rose: \"#f43f5e\",\n  emerald: \"#10b981\",\n  zinc: \"#18181b\",\n};\n\n/** True when the picker sits on \"Default\" — the page theme should win. */\nexport function isDefaultAccent(color?: string): boolean {\n  return !color || color === \"primary\" || color === \"default\";\n}\n\n/**\n * Turns a picker value into a CSS colour, or null for \"Default\" — meaning\n * nothing should be overridden, so the theme (and the sidebar customizer)\n * keeps control.\n */\nexport function resolveAccent(color?: string): string | null {\n  if (isDefaultAccent(color)) return null;\n  return PRESET_HEX[color as string] ?? (color as string);\n}\n\n/**\n * The picker value in a form every block accepts. Blocks know the older swatch\n * names but not \"lavender\" — and since that is also a CSS named colour\n * (#e6e6fa), a block that passes unknown names straight through would paint\n * the wrong shade, while others fall back to a different palette. Demos that\n * hand the picker value to such a block run it through this first. Every\n * other value is returned untouched.\n */\nexport function toBlockColor(color: string): string;\nexport function toBlockColor(color: string | undefined): string | undefined;\nexport function toBlockColor(color?: string): string | undefined {\n  return color === \"lavender\" ? PRESET_HEX.lavender : color;\n}\n\nfunction parseHex(input: string): [number, number, number] | null {\n  const hex = input.trim().replace(/^#/, \"\");\n  if (/^[a-f\\d]{3}$/i.test(hex)) {\n    const [r, g, b] = hex.split(\"\");\n    return [parseInt(r + r, 16), parseInt(g + g, 16), parseInt(b + b, 16)];\n  }\n  if (/^[a-f\\d]{6}$/i.test(hex)) {\n    return [\n      parseInt(hex.slice(0, 2), 16),\n      parseInt(hex.slice(2, 4), 16),\n      parseInt(hex.slice(4, 6), 16),\n    ];\n  }\n  return null;\n}\n\n/** Legible foreground for content sitting on a filled `color` swatch. */\nexport function accentForeground(color: string): string {\n  const rgb = parseHex(color);\n  if (!rgb) return \"#ffffff\";\n  const channel = (v: number) => {\n    const c = v / 255;\n    return c <= 0.03928 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4);\n  };\n  const luminance =\n    0.2126 * channel(rgb[0]) +\n    0.7152 * channel(rgb[1]) +\n    0.0722 * channel(rgb[2]);\n  return luminance > 0.45 ? \"#09090b\" : \"#ffffff\";\n}\n\n/** The theme tokens a picked accent repoints, as `--name` → value. */\nexport function accentTokens(color?: string): Record<string, string> {\n  const resolved = resolveAccent(color);\n  if (!resolved) return {};\n  return {\n    \"--primary\": resolved,\n    \"--primary-foreground\": accentForeground(resolved),\n    \"--ring\": resolved,\n  };\n}\n\n/**\n * Inline style repointing `--primary` at the picked accent for one subtree.\n * `--primary-foreground` is derived alongside it, otherwise a light pick leaves\n * `text-primary-foreground` content unreadable on its own fill. Returns `{}` on\n * \"Default\" so the page theme still wins.\n */\nexport function accentStyle(color?: string): CSSProperties {\n  return accentTokens(color) as CSSProperties;\n}\n",
      "type": "registry:component",
      "target": "lib/accent.ts"
    }
  ],
  "docs": "Named export: HoneycombHero. Pass `title` and `titleAccent` (its letters that cross the photographs take `titleOverlapColor`, the primary by default), `subtitle`, `primaryActionLabel` (a \\n breaks the line; a compass sits above it in the hexagon) and `primaryActionHref`, `images` ({ src, alt, tone? }[] in queue order — nine cells are visible; tone is the deep colour behind everything while that photograph is featured), `socialLinks`, `interval` in ms (0 turns autoplay off) and `onChange`. The overlapping letters, rule, arrows and call to action follow the theme's primary (the hexagon's compass and label primary-foreground); `accent` sets --primary for the section, `background` is the tone for photographs without one (a deep shade of the primary by default); `linkComponent` takes next/link.",
  "categories": [
    "marketing",
    "layout"
  ],
  "type": "registry:component"
}
