{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "icon-box",
  "title": "Icon Box",
  "description": "A feature box with an icon, title and text for features and services grids: in the card style a light follows the pointer along the border, the icon tile lifts and tilts on hover, and a linked box nudges its arrow forward.",
  "dependencies": [
    "motion",
    "clsx",
    "tailwind-merge"
  ],
  "files": [
    {
      "path": "registry/new-york/icon-box/icon-box.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { motion, useReducedMotion } from \"motion/react\";\nimport { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nfunction cn(...inputs: ClassValue[]) {\n  return twMerge(clsx(inputs));\n}\n\nexport type IconBoxIcon = \"bolt\" | \"shield\" | \"chart\" | \"globe\" | \"layers\" | \"sparkles\" | \"lock\" | \"code\";\n\nexport interface IconBoxProps {\n  /** One of the built-in icons or your own node. */\n  icon?: IconBoxIcon | React.ReactNode;\n  title?: string;\n  description?: string;\n  /** Makes the whole box a link, with a \"Learn more\" line. */\n  href?: string;\n  linkLabel?: string;\n  /** card: bordered with a light that follows the pointer. plain: no frame. */\n  variant?: \"card\" | \"plain\";\n  /** vertical: icon above the text. horizontal: icon beside it. */\n  layout?: \"vertical\" | \"horizontal\";\n  /** Colour of the icon tile's glow and the pointer light. */\n  accent?: string;\n  theme?: \"dark\" | \"light\";\n  className?: string;\n}\n\nconst PALETTES = {\n  dark: { text: \"#F5F4F1\", muted: \"rgba(245,244,241,0.58)\", panel: \"#0E0E0E\", border: \"rgba(255,255,255,0.09)\", tile: \"rgba(255,255,255,0.05)\", tileBorder: \"rgba(255,255,255,0.12)\", light: \"rgba(255,255,255,0.4)\", glow: \"rgba(255,255,255,0.06)\", focus: \"rgba(245,244,241,0.85)\" },\n  light: { text: \"#0A0A0A\", muted: \"rgba(10,10,10,0.58)\", panel: \"#FFFFFF\", border: \"rgba(10,10,10,0.1)\", tile: \"rgba(10,10,10,0.04)\", tileBorder: \"rgba(10,10,10,0.1)\", light: \"rgba(10,10,10,0.3)\", glow: \"rgba(10,10,10,0.035)\", focus: \"rgba(10,10,10,0.85)\" },\n};\n\nconst ICONS: Record<IconBoxIcon, string[]> = {\n  bolt: [\"M13 2.5 4.5 13.5h7l-1 8 8.5-11h-7Z\"],\n  shield: [\"M12 3 4.5 6v5.5c0 4.6 3.2 8.2 7.5 9.5 4.3-1.3 7.5-4.9 7.5-9.5V6Z\", \"m9 12 2.2 2.2L15.5 10\"],\n  chart: [\"M4 20h16\", \"M7 16v-4\", \"M12 16V8\", \"M17 16v-7\"],\n  globe: [\"M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z\", \"M3 12h18\", \"M12 3a14 14 0 0 1 0 18 14 14 0 0 1 0-18Z\"],\n  layers: [\"m12 3 9 4.5-9 4.5-9-4.5Z\", \"m3 12 9 4.5 9-4.5\", \"m3 16.5 9 4.5 9-4.5\"],\n  sparkles: [\"M11 3.5c.5 3.8 2 5.3 5.5 5.8-3.5.5-5 2-5.5 5.8-.5-3.8-2-5.3-5.5-5.8 3.5-.5 5-2 5.5-5.8Z\", \"M18 14.5c.3 1.8 1 2.4 2.5 2.7-1.5.3-2.2 1-2.5 2.7-.3-1.7-1-2.4-2.5-2.7 1.5-.3 2.2-.9 2.5-2.7Z\"],\n  lock: [\"M6 11h12a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-6a2 2 0 0 1 2-2Z\", \"M8 11V7.5a4 4 0 0 1 8 0V11\"],\n  code: [\"m8 7-5 5 5 5\", \"m16 7 5 5-5 5\", \"m13.5 5-3 14\"],\n};\n\nexport function IconBox({\n  icon = \"bolt\",\n  title = \"Instant deploys\",\n  description = \"Push to main and your site is live worldwide in under ten seconds, with a preview link for every branch.\",\n  href,\n  linkLabel = \"Learn more\",\n  variant = \"card\",\n  layout = \"vertical\",\n  accent,\n  theme = \"dark\",\n  className,\n}: IconBoxProps) {\n  const p = PALETTES[theme];\n  const reduce = Boolean(useReducedMotion());\n  const ref = React.useRef<HTMLElement>(null);\n  const card = variant === \"card\";\n  const light = accent ?? p.light;\n\n  // The pointer light is two CSS variables on the box, so moving it never re-renders React.\n  const onMove = (e: React.PointerEvent) => {\n    const el = ref.current;\n    if (!el || !card) return;\n    const r = el.getBoundingClientRect();\n    el.style.setProperty(\"--ib-x\", `${e.clientX - r.left}px`);\n    el.style.setProperty(\"--ib-y\", `${e.clientY - r.top}px`);\n  };\n\n  const iconNode =\n    typeof icon === \"string\" && icon in ICONS ? (\n      <svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.6\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n        {ICONS[icon as IconBoxIcon].map((d) => (\n          <path key={d} d={d} />\n        ))}\n      </svg>\n    ) : (\n      icon\n    );\n\n  const body = (\n    <>\n      {card && (\n        <>\n          {/* Border light: a radial gradient masked down to the 1px frame. */}\n          <span\n            aria-hidden=\"true\"\n            className=\"pointer-events-none absolute inset-0 rounded-[inherit] opacity-0 transition-opacity duration-300 group-hover:opacity-100\"\n            style={{\n              padding: 1,\n              background: `radial-gradient(220px circle at var(--ib-x, 50%) var(--ib-y, 0%), ${light}, transparent 70%)`,\n              WebkitMask: \"linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0)\",\n              WebkitMaskComposite: \"xor\",\n              maskComposite: \"exclude\",\n            }}\n          />\n          <span aria-hidden=\"true\" className=\"pointer-events-none absolute inset-0 rounded-[inherit] opacity-0 transition-opacity duration-300 group-hover:opacity-100\" style={{ background: `radial-gradient(320px circle at var(--ib-x, 50%) var(--ib-y, 0%), ${p.glow}, transparent 70%)` }} />\n        </>\n      )}\n      <motion.span\n        className=\"relative flex shrink-0 items-center justify-center\"\n        style={{ width: 44, height: 44, borderRadius: 12, background: p.tile, border: `1px solid ${p.tileBorder}`, color: p.text, boxShadow: accent ? `0 8px 24px -12px ${accent}` : undefined }}\n        variants={{ rest: { y: 0, rotate: 0 }, hover: { y: reduce ? 0 : -3, rotate: reduce ? 0 : -4 } }}\n        transition={{ type: \"spring\", stiffness: 380, damping: 18 }}\n      >\n        {iconNode}\n      </motion.span>\n      <span className=\"relative flex min-w-0 flex-1 flex-col\" style={{ gap: 6 }}>\n        <span className=\"text-[16px] font-semibold tracking-[-0.01em]\" style={{ color: p.text }}>\n          {title}\n        </span>\n        {description && (\n          <span className=\"text-[14px] leading-relaxed\" style={{ color: p.muted }}>\n            {description}\n          </span>\n        )}\n        {href && (\n          <span className=\"mt-auto inline-flex items-center pt-1 text-[13.5px] font-semibold\" style={{ gap: 6, color: p.text }}>\n            {linkLabel}\n            <motion.svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\" variants={{ rest: { x: 0 }, hover: { x: reduce ? 0 : 3 } }} transition={{ type: \"spring\", stiffness: 400, damping: 20 }}>\n              <path d=\"M5 12h14\" />\n              <path d=\"m13 6 6 6-6 6\" />\n            </motion.svg>\n          </span>\n        )}\n      </span>\n    </>\n  );\n\n  const shared = {\n    className: cn(\"group relative flex no-underline outline-none focus-visible:ring-2\", layout === \"horizontal\" ? \"flex-row items-start\" : \"flex-col\", className),\n    style: {\n      gap: layout === \"horizontal\" ? 16 : 18,\n      padding: card ? 22 : 0,\n      borderRadius: 18,\n      background: card ? p.panel : \"transparent\",\n      border: card ? `1px solid ${p.border}` : undefined,\n      fontFamily: \"Inter, sans-serif\",\n      [\"--tw-ring-color\" as string]: p.focus,\n    } as React.CSSProperties,\n    initial: \"rest\",\n    whileHover: \"hover\",\n    whileFocus: \"hover\",\n    onPointerMove: onMove,\n  };\n\n  return href ? (\n    <motion.a ref={ref as React.Ref<HTMLAnchorElement>} href={href} {...shared}>\n      {body}\n    </motion.a>\n  ) : (\n    <motion.div ref={ref as React.Ref<HTMLDivElement>} {...shared}>\n      {body}\n    </motion.div>\n  );\n}\n\nexport default IconBox;\n",
      "type": "registry:component"
    }
  ],
  "type": "registry:component"
}