{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"lamp-hero","type":"registry:ui","title":"Lamp Hero","description":"Hero section lit by a glowing light tube whose cone swings open and the heading rises into the light when it scrolls into view.","dependencies":[],"registryDependencies":["utils"],"files":[{"path":"registry/ui/lamp-hero.tsx","type":"registry:ui","content":"\"use client\";\n\nimport { useEffect, useRef, useState, type CSSProperties, type ReactNode } from \"react\";\nimport { cn } from \"@/lib/utils\";\n\n// The cone is a conic-gradient whose half-angle (--lh-spread) is a registered\n// @property, so the browser can transition it: the light literally swings open.\nconst css = `\n@property --lh-spread{syntax:'<angle>';inherits:true;initial-value:0deg}\n.lh{--lh-spread:6deg}\n.lh[data-lit]{--lh-spread:var(--lh-open)}\n.lh{--e:cubic-bezier(.16,1,.3,1);transition:--lh-spread 1.4s var(--e) .15s}\n.lh-cone{background:conic-gradient(from 180deg at 50% 0%,var(--lh-c) 0deg,color-mix(in oklab,var(--lh-c) 35%,transparent) calc(var(--lh-spread)*.6),transparent var(--lh-spread),transparent calc(360deg - var(--lh-spread)),color-mix(in oklab,var(--lh-c) 35%,transparent) calc(360deg - var(--lh-spread)*.6),var(--lh-c) 360deg);\n  -webkit-mask:radial-gradient(ellipse 60% 100% at 50% 0%,#000 25%,transparent 75%);mask:radial-gradient(ellipse 60% 100% at 50% 0%,#000 25%,transparent 75%);opacity:.55}\n.lh-fade{opacity:0;transition:opacity 1.2s var(--e) .2s}\n.lh[data-lit] .lh-fade{opacity:1}\n.lh-bar{width:6rem;transition:width 1.4s var(--e) .15s,opacity .8s var(--e) .15s;opacity:.4}\n.lh[data-lit] .lh-bar{width:min(32rem,80vw);opacity:1}\n.lh-glow{width:8rem;transition:width 1.4s var(--e) .15s,opacity 1s var(--e) .15s;opacity:.3}\n.lh[data-lit] .lh-glow{width:min(26rem,70vw);opacity:1}\n.lh-rise{opacity:0;translate:0 2.5rem;filter:blur(6px);transition:opacity 1s var(--e) .45s,translate 1.2s var(--e) .45s,filter 1s var(--e) .45s}\n.lh[data-lit] .lh-rise{opacity:1;translate:0 0;filter:blur(0)}\n@media (prefers-reduced-motion:reduce){.lh,.lh *{transition:none!important}}\n`;\n\nexport interface LampHeroProps {\n  /** Light color. */\n  color?: string;\n  /** Half-angle of the light cone when open, in degrees. */\n  spread?: number;\n  title?: ReactNode;\n  subtitle?: ReactNode;\n  /** Buttons or anything else under the subtitle. */\n  children?: ReactNode;\n  /** Light up only the first time it scrolls into view. */\n  once?: boolean;\n  className?: string;\n}\n\nexport function LampHero({\n  color = \"#5eead4\",\n  spread = 32,\n  title = \"Light the way to launch\",\n  subtitle = \"Everything your team needs to ship polished interfaces, beautifully lit and ready to go.\",\n  children,\n  once = true,\n  className,\n}: LampHeroProps) {\n  const ref = useRef<HTMLElement>(null);\n  const [lit, setLit] = useState(false);\n\n  useEffect(() => {\n    const el = ref.current;\n    if (!el) return;\n    const io = new IntersectionObserver(\n      ([e]) => {\n        if (e.isIntersecting) {\n          setLit(true);\n          if (once) io.disconnect();\n        } else if (!once) setLit(false);\n      },\n      { threshold: 0.35 },\n    );\n    io.observe(el);\n    return () => io.disconnect();\n  }, [once]);\n\n  return (\n    <section\n      ref={ref}\n      data-lit={lit || undefined}\n      className={cn(\"lh relative isolate flex min-h-[26rem] w-full flex-col items-center justify-center overflow-hidden bg-background pt-24 pb-12\", className)}\n      style={{ \"--lh-c\": color, \"--lh-open\": `${spread}deg` } as CSSProperties}\n    >\n      <style href=\"lamp-hero\" precedence=\"default\">\n        {css}\n      </style>\n\n      <div className=\"relative w-full max-w-3xl\">\n        <div aria-hidden className=\"pointer-events-none absolute left-1/2 -top-20 -z-10 h-0 w-0\">\n          {/* light pooling above the fixture */}\n          <div className=\"lh-fade absolute -top-16 left-1/2 h-32 w-[40rem] -translate-x-1/2 rounded-[100%] blur-3xl\" style={{ background: `color-mix(in oklab, ${color} 18%, transparent)` }} />\n          {/* the cone */}\n          <div className=\"lh-cone absolute top-0 left-1/2 h-[36rem] w-[64rem] -translate-x-1/2\" />\n          {/* soft bloom right under the tube */}\n          <div className=\"lh-glow absolute -top-6 left-1/2 h-16 -translate-x-1/2 rounded-full blur-2xl\" style={{ background: color }} />\n          {/* the tube itself */}\n          <div className=\"lh-bar absolute -top-px left-1/2 h-[3px] -translate-x-1/2 rounded-full\" style={{ background: color, boxShadow: `0 0 12px 1px ${color}` }} />\n          <div className=\"lh-bar absolute -top-px left-1/2 h-px -translate-x-1/2 rounded-full bg-white/80 blur-[0.5px]\" />\n        </div>\n\n        <div className=\"lh-rise flex flex-col items-center px-6 text-center\">\n          <h1 className=\"bg-gradient-to-b from-foreground to-foreground/55 bg-clip-text text-4xl font-semibold tracking-tight text-balance text-transparent sm:text-6xl\">\n            {title}\n          </h1>\n          {subtitle && <p className=\"mt-5 max-w-xl text-base text-pretty text-muted-foreground sm:text-lg\">{subtitle}</p>}\n          {children && <div className=\"mt-8 flex flex-wrap items-center justify-center gap-3\">{children}</div>}\n        </div>\n      </div>\n    </section>\n  );\n}\n"}]}