{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "light-beam",
  "type": "registry:ui",
  "title": "Light Beam",
  "description": "A soft cone of light falling into a dark section from an edge, the way a stage light picks out a speaker. It draws the eye to the headline under it and gives a flat surface depth. It does not move: the light is part of the set, not an event.",
  "author": "ofri-peretz <https://github.com/ofri-peretz>",
  "categories": [
    "decorative",
    "effect"
  ],
  "dependencies": [],
  "registryDependencies": [
    "https://ds.interlace.tools/r/interlace-base.json",
    "https://ds.interlace.tools/r/cn.json"
  ],
  "files": [
    {
      "path": "registry/interlace-ui/effects/light-beam.tsx",
      "target": "components/ui/effects/light-beam.tsx",
      "type": "registry:ui",
      "content": "import * as React from 'react';\n\n// @interlace/light-beam v1.0.0 — Interlace design system.\n// Docs, props and live preview: https://ds.interlace.tools/c/light-beam\n// What changed since: https://ds.interlace.tools/c/light-beam#history\n// Generated banner — keep it, the upgrade diff reads this version.\n\n/**\n * @interlace/ui — LightBeam\n *\n * A soft cone of light falling into a dark section from an edge, the way a\n * stage light picks out a speaker. It draws the eye to the headline under it\n * and gives a flat surface depth. It does not move: the light is part of the\n * set, not an event.\n *\n * ## How it is drawn\n *\n * One element, two gradients. A `conic-gradient` makes the cone's crisp\n * angle and a `radial-gradient` mask fades it out with distance, so the beam\n * has a bright source and a long soft falloff. No SVG, no blur filter, no\n * JavaScript: it renders on the server and paints in the first frame.\n *\n * | Rule | Concept                 | Where in this file                                   |\n * | ---- | ----------------------- | ---------------------------------------------------- |\n * | R4   | Extends native el       | `div` props, minus children                           |\n * | R6   | data-slot               | `light-beam`                                         |\n * | R7   | cn + ...rest            | `cn(…, className)` + `{...props}`                     |\n * | R8   | Enums, not booleans     | `origin`                                             |\n * | R19  | Tokens only             | defaults to `--hero-star`                             |\n * | R23  | CLS=0                   | `absolute inset-0`, never in flow                     |\n * | R25  | Server component        | no hooks → no `'use client'`                          |\n */\n\nimport { cn } from '@/lib/utils';\n\nexport type LightBeamOrigin = 'top-left' | 'top' | 'top-right';\n\nconst ORIGIN: Record<LightBeamOrigin, { x: string; aim: number }> = {\n  'top-left': { x: '8%', aim: 150 },\n  top: { x: '50%', aim: 180 },\n  'top-right': { x: '92%', aim: 210 },\n};\n\nexport interface LightBeamProps\n  extends Omit<React.ComponentPropsWithoutRef<'div'>, 'children' | 'aria-hidden'> {\n  /** Where the light comes from. @default 'top' */\n  origin?: LightBeamOrigin;\n  /** Any CSS colour. @default 'var(--hero-star)' */\n  color?: string;\n  /** Width of the cone, in degrees. @default 36 */\n  angle?: number;\n  /** Brightness at the source, 0 to 1. @default 0.35 */\n  intensity?: number;\n}\n\nexport function LightBeam({\n  origin = 'top',\n  color = 'var(--hero-star)',\n  angle = 36,\n  intensity = 0.35,\n  className,\n  style,\n  ...props\n}: LightBeamProps) {\n  const { x, aim } = ORIGIN[origin];\n  const half = angle / 2;\n  const strength = Math.round(Math.min(Math.max(intensity, 0), 1) * 100);\n  const tint = `color-mix(in oklab, ${color} ${strength}%, transparent)`;\n  return (\n    <div\n      data-slot=\"light-beam\"\n      data-origin={origin}\n      className={cn('pointer-events-none absolute inset-0', className)}\n      style={{\n        background: `conic-gradient(from ${aim - half}deg at ${x} 0%, transparent 0deg, ${tint} ${half}deg, transparent ${angle}deg, transparent 360deg)`,\n        maskImage: `radial-gradient(ellipse 90% 100% at ${x} 0%, black, transparent 85%)`,\n        WebkitMaskImage: `radial-gradient(ellipse 90% 100% at ${x} 0%, black, transparent 85%)`,\n        ...style,\n      }}\n      {...props}\n      aria-hidden\n    />\n  );\n}\n"
    }
  ],
  "meta": {
    "tier": "effect",
    "client": false,
    "minViewport": null,
    "loading": false,
    "version": "1.0.0",
    "since": null
  },
  "docs": "## @interlace/light-beam\n\nInstalled to `components/ui/effects/light-beam.tsx`.\n\n```tsx\nimport { /* … */ } from '@/components/ui/effects/light-beam';\n```\n\nProps, a11y contract, live preview and source: https://ds.interlace.tools/c/light-beam\n\nRequires the `@interlace/interlace-base` CSS baseline (installed automatically as a registry dependency). For the Interlace look, also add `@interlace/theme`."
}
