{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "social-links",
  "title": "Social Links",
  "description": "Links to your profiles in three styles: round icons that fill from the bottom and tilt on hover, a list with handles, follower counts and an out arrow, or a dock whose icons grow as the pointer comes near.",
  "dependencies": [
    "motion",
    "clsx",
    "tailwind-merge"
  ],
  "files": [
    {
      "path": "registry/new-york/social-links/social-links.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { motion, useMotionValue, useReducedMotion, useSpring, useTransform, type MotionValue } 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 SocialNetwork = \"github\" | \"x\" | \"linkedin\" | \"instagram\" | \"youtube\" | \"dribbble\" | \"email\" | \"website\";\n\nexport interface SocialLink {\n  network: SocialNetwork;\n  href: string;\n  /** @handle or address, shown in the list style. */\n  handle?: string;\n  /** e.g. \"12.4k\", shown in the list style. */\n  followers?: string;\n  /** Override the default label. */\n  label?: string;\n}\n\nexport interface SocialLinksProps {\n  links?: SocialLink[];\n  /** icons: round buttons that fill on hover. list: rows with handle and followers. dock: icons that grow as the pointer nears. */\n  variant?: \"icons\" | \"list\" | \"dock\";\n  theme?: \"dark\" | \"light\";\n  className?: string;\n}\n\nconst PALETTES = {\n  dark: { text: \"#F5F4F1\", muted: \"rgba(245,244,241,0.55)\", bg: \"rgba(255,255,255,0.05)\", border: \"rgba(255,255,255,0.12)\", fill: \"#F5F4F1\", onFill: \"#0A0A0A\", panel: \"#0E0E0E\", line: \"rgba(255,255,255,0.07)\", focus: \"rgba(245,244,241,0.85)\" },\n  light: { text: \"#0A0A0A\", muted: \"rgba(10,10,10,0.55)\", bg: \"#FFFFFF\", border: \"rgba(10,10,10,0.12)\", fill: \"#0A0A0A\", onFill: \"#FFFFFF\", panel: \"#FFFFFF\", line: \"rgba(10,10,10,0.07)\", focus: \"rgba(10,10,10,0.85)\" },\n};\n\n// Simple monochrome marks on a 24px grid (not the official logos).\nconst GLYPHS: Record<SocialNetwork, React.ReactNode> = {\n  github: <path d=\"M7 4v10M7 14a3 3 0 1 0 0 6 3 3 0 0 0 0-6ZM17 4a3 3 0 1 0 0 6 3 3 0 0 0 0-6ZM17 10c0 4-4 4-10 6\" />,\n  x: <path d=\"M4.5 4.5h4.2l10.8 15h-4.2ZM19 4.5l-5.6 6.3M10.6 13.2 5 19.5\" />,\n  linkedin: (\n    <>\n      <rect x=\"4\" y=\"4\" width=\"16\" height=\"16\" rx=\"3\" />\n      <path d=\"M8.5 10.5V16M8.5 8h.01M12 16v-3.2a2 2 0 0 1 4 0V16M12 10.5V16\" />\n    </>\n  ),\n  instagram: (\n    <>\n      <rect x=\"4\" y=\"4\" width=\"16\" height=\"16\" rx=\"5\" />\n      <circle cx=\"12\" cy=\"12\" r=\"3.6\" />\n      <path d=\"M16.6 7.4h.01\" />\n    </>\n  ),\n  youtube: (\n    <>\n      <rect x=\"3\" y=\"6\" width=\"18\" height=\"12\" rx=\"4\" />\n      <path d=\"m10.5 9.5 4 2.5-4 2.5Z\" />\n    </>\n  ),\n  dribbble: (\n    <>\n      <circle cx=\"12\" cy=\"12\" r=\"8.5\" />\n      <path d=\"M8 4.5c3.5 4 5.8 9 6.6 15M3.6 11c4.4.3 9.5-.8 13.4-4.3M6 18c2.6-3.6 7-5 14.4-3.5\" />\n    </>\n  ),\n  email: (\n    <>\n      <rect x=\"3\" y=\"5\" width=\"18\" height=\"14\" rx=\"2.5\" />\n      <path d=\"m3.5 7.5 7.4 5.2a2 2 0 0 0 2.2 0l7.4-5.2\" />\n    </>\n  ),\n  website: (\n    <>\n      <circle cx=\"12\" cy=\"12\" r=\"8.5\" />\n      <path d=\"M3.5 12h17M12 3.5a13 13 0 0 1 0 17 13 13 0 0 1 0-17Z\" />\n    </>\n  ),\n};\n\nconst LABELS: Record<SocialNetwork, string> = { github: \"GitHub\", x: \"X\", linkedin: \"LinkedIn\", instagram: \"Instagram\", youtube: \"YouTube\", dribbble: \"Dribbble\", email: \"Email\", website: \"Website\" };\n\nconst DEFAULT_LINKS: SocialLink[] = [\n  { network: \"github\", href: \"https://github.com\", handle: \"@mayachen\", followers: \"3.2k\" },\n  { network: \"x\", href: \"https://x.com\", handle: \"@mayadesigns\", followers: \"12.4k\" },\n  { network: \"linkedin\", href: \"https://linkedin.com\", handle: \"in/mayachen\", followers: \"8.1k\" },\n  { network: \"instagram\", href: \"https://instagram.com\", handle: \"@maya.studio\", followers: \"21k\" },\n  { network: \"youtube\", href: \"https://youtube.com\", handle: \"Maya Makes\", followers: \"46k\" },\n  { network: \"email\", href: \"mailto:hello@mayachen.design\", handle: \"hello@mayachen.design\" },\n];\n\nfunction Glyph({ n, size = 18 }: { n: SocialNetwork; size?: number }) {\n  return (\n    <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.7\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n      {GLYPHS[n]}\n    </svg>\n  );\n}\n\nfunction DockItem({ link, mouseX, p, reduce }: { link: SocialLink; mouseX: MotionValue<number>; p: (typeof PALETTES)[\"dark\"]; reduce: boolean }) {\n  const ref = React.useRef<HTMLAnchorElement>(null);\n  const distance = useTransform(mouseX, (x) => {\n    const r = ref.current?.getBoundingClientRect();\n    return r ? x - (r.left + r.width / 2) : Infinity;\n  });\n  const target = useTransform(distance, [-130, 0, 130], [44, reduce ? 44 : 68, 44]);\n  const size = useSpring(target, { stiffness: 320, damping: 24, mass: 0.4 });\n  const icon = useTransform(size, [44, 68], [18, 26]);\n  const label = link.label ?? LABELS[link.network];\n  return (\n    <motion.a ref={ref} href={link.href} target={link.network === \"email\" ? undefined : \"_blank\"} rel=\"noopener noreferrer\" aria-label={label} className=\"group relative flex shrink-0 items-center justify-center rounded-2xl no-underline outline-none focus-visible:ring-2\" style={{ width: size, height: size, background: p.bg, border: `1px solid ${p.border}`, color: p.text, [\"--tw-ring-color\" as string]: p.focus }}>\n      <motion.span className=\"flex items-center justify-center\" style={{ width: icon, height: icon }}>\n        <svg width=\"100%\" height=\"100%\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.7\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n          {GLYPHS[link.network]}\n        </svg>\n      </motion.span>\n      <span className=\"pointer-events-none absolute -top-8 left-1/2 -translate-x-1/2 rounded-md text-[11.5px] font-semibold whitespace-nowrap opacity-0 transition-opacity duration-150 group-hover:opacity-100\" style={{ padding: \"3px 8px\", background: p.fill, color: p.onFill }}>\n        {label}\n      </span>\n    </motion.a>\n  );\n}\n\nexport function SocialLinks({ links = DEFAULT_LINKS, variant = \"icons\", theme = \"dark\", className }: SocialLinksProps) {\n  const p = PALETTES[theme];\n  const reduce = Boolean(useReducedMotion());\n  const mouseX = useMotionValue(Infinity);\n\n  if (variant === \"dock\") {\n    // A fixed width with room for the swell, so growing icons never push the page around.\n    return (\n      <nav aria-label=\"Social links\" className={cn(\"inline-flex items-end justify-center rounded-3xl\", className)} style={{ gap: 10, height: 80, width: links.length * 54 + 64, padding: \"0 12px 10px\", background: p.panel, border: `1px solid ${p.border}`, fontFamily: \"Inter, sans-serif\" }} onMouseMove={(e) => mouseX.set(e.clientX)} onMouseLeave={() => mouseX.set(Infinity)}>\n        {links.map((l) => (\n          <DockItem key={l.network + l.href} link={l} mouseX={mouseX} p={p} reduce={reduce} />\n        ))}\n      </nav>\n    );\n  }\n\n  if (variant === \"list\") {\n    return (\n      <nav aria-label=\"Social links\" className={cn(\"flex w-full flex-col overflow-hidden rounded-2xl\", className)} style={{ background: p.panel, border: `1px solid ${p.border}`, fontFamily: \"Inter, sans-serif\" }}>\n        {links.map((l, i) => (\n          <motion.a key={l.network + l.href} href={l.href} target={l.network === \"email\" ? undefined : \"_blank\"} rel=\"noopener noreferrer\" className=\"group flex items-center no-underline outline-none focus-visible:ring-2 focus-visible:ring-inset\" style={{ gap: 14, padding: \"13px 16px\", borderTop: i ? `1px solid ${p.line}` : undefined, color: p.text, [\"--tw-ring-color\" as string]: p.focus }} initial=\"rest\" whileHover=\"hover\">\n            <span className=\"relative flex shrink-0 items-center justify-center overflow-hidden rounded-xl\" style={{ width: 38, height: 38, background: p.bg, border: `1px solid ${p.border}` }}>\n              <motion.span className=\"absolute inset-0\" style={{ background: p.fill, originY: 1 }} variants={{ rest: { scaleY: 0 }, hover: { scaleY: 1 } }} transition={{ duration: reduce ? 0 : 0.25, ease: [0.22, 1, 0.36, 1] }} />\n              <motion.span className=\"relative flex\" variants={{ rest: { color: p.text }, hover: { color: p.onFill } }} transition={{ duration: 0.2 }}>\n                <Glyph n={l.network} />\n              </motion.span>\n            </span>\n            <span className=\"flex min-w-0 flex-1 flex-col\">\n              <span className=\"text-[14px] font-semibold\">{l.label ?? LABELS[l.network]}</span>\n              {l.handle && <span className=\"truncate text-[12.5px]\" style={{ color: p.muted }}>{l.handle}</span>}\n            </span>\n            {l.followers && <span className=\"shrink-0 text-[12.5px] tabular-nums\" style={{ color: p.muted }}>{l.followers}</span>}\n            <motion.svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke={p.muted} strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\" variants={{ rest: { x: 0, y: 0 }, hover: { x: reduce ? 0 : 2, y: reduce ? 0 : -2 } }}>\n              <path d=\"M7 17 17 7M8 7h9v9\" />\n            </motion.svg>\n          </motion.a>\n        ))}\n      </nav>\n    );\n  }\n\n  return (\n    <nav aria-label=\"Social links\" className={cn(\"flex flex-wrap items-center\", className)} style={{ gap: 8, fontFamily: \"Inter, sans-serif\" }}>\n      {links.map((l, i) => (\n        <motion.a\n          key={l.network + l.href}\n          href={l.href}\n          target={l.network === \"email\" ? undefined : \"_blank\"}\n          rel=\"noopener noreferrer\"\n          aria-label={l.label ?? LABELS[l.network]}\n          className=\"relative flex items-center justify-center overflow-hidden rounded-full no-underline outline-none focus-visible:ring-2\"\n          style={{ width: 42, height: 42, background: p.bg, border: `1px solid ${p.border}`, [\"--tw-ring-color\" as string]: p.focus }}\n          initial=\"rest\"\n          whileHover=\"hover\"\n          whileFocus=\"hover\"\n          whileTap={{ scale: 0.92 }}\n        >\n          <motion.span className=\"absolute inset-0 rounded-full\" style={{ background: p.fill, originY: 1 }} variants={{ rest: { scaleY: 0 }, hover: { scaleY: 1 } }} transition={{ duration: reduce ? 0 : 0.28, ease: [0.22, 1, 0.36, 1] }} />\n          <motion.span className=\"relative flex\" variants={{ rest: { color: p.text, rotate: 0 }, hover: { color: p.onFill, rotate: reduce ? 0 : i % 2 ? 8 : -8 } }} transition={{ type: \"spring\", stiffness: 400, damping: 18 }}>\n            <Glyph n={l.network} />\n          </motion.span>\n        </motion.a>\n      ))}\n    </nav>\n  );\n}\n\nexport default SocialLinks;\n",
      "type": "registry:component"
    }
  ],
  "type": "registry:component"
}