{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "divider",
  "title": "Divider",
  "description": "A horizontal or vertical divider with solid, dashed, dotted and gradient styles, an optional label with start, center or end position, an accent color and a draw-in animation on scroll.",
  "dependencies": [
    "motion",
    "clsx",
    "tailwind-merge"
  ],
  "files": [
    {
      "path": "registry/new-york/divider/divider.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { motion } 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 DividerOrientation = \"horizontal\" | \"vertical\";\nexport type DividerVariant = \"solid\" | \"dashed\" | \"dotted\" | \"gradient\";\nexport type DividerLabelPosition = \"start\" | \"center\" | \"end\";\n\nexport interface DividerProps {\n  orientation?: DividerOrientation;\n  variant?: DividerVariant;\n  label?: React.ReactNode;\n  labelPosition?: DividerLabelPosition;\n  thickness?: number;\n  spacing?: number;\n  accent?: boolean;\n  accentColor?: string;\n  animated?: boolean;\n  theme?: \"dark\" | \"light\";\n  className?: string;\n}\n\nconst PALETTES = {\n  dark: { line: \"rgba(255,255,255,0.14)\", text: \"rgba(245,244,241,0.5)\" },\n  light: { line: \"rgba(10,10,10,0.16)\", text: \"rgba(10,10,10,0.5)\" },\n};\n\nexport function Divider({ orientation = \"horizontal\", variant = \"solid\", label, labelPosition = \"center\", thickness = 1, spacing = 16, accent = false, accentColor = \"#F2A841\", animated = false, theme = \"dark\", className }: DividerProps) {\n  const p = PALETTES[theme];\n  const vertical = orientation === \"vertical\";\n  const color = accent ? accentColor : p.line;\n\n  const dotRadius = Math.max(1.2, thickness * 0.75);\n  const dotTile = Math.ceil(dotRadius * 2 + 1);\n  const lineBackground = (side: \"start\" | \"end\" | \"full\"): string => {\n    const dir = vertical ? \"to bottom\" : \"to right\";\n    if (variant === \"dashed\") return `repeating-linear-gradient(${dir}, ${color} 0 7px, transparent 7px 12px)`;\n    if (variant === \"dotted\") return `radial-gradient(circle at center, ${color} ${dotRadius}px, transparent ${dotRadius + 0.6}px)`;\n    if (variant === \"gradient\") {\n      const solid = accent ? accentColor : theme === \"dark\" ? \"rgba(255,255,255,0.32)\" : \"rgba(10,10,10,0.3)\";\n      if (side === \"start\") return `linear-gradient(${dir}, transparent, ${solid})`;\n      if (side === \"end\") return `linear-gradient(${dir}, ${solid}, transparent)`;\n      return `linear-gradient(${dir}, transparent, ${solid}, transparent)`;\n    }\n    return color;\n  };\n\n  const renderLine = (side: \"start\" | \"end\" | \"full\", origin: string, flex: number) => (\n    <motion.span\n      key={side}\n      aria-hidden=\"true\"\n      className=\"block\"\n      style={{\n        flex,\n        ...(vertical ? { width: variant === \"dotted\" ? dotTile : thickness, minHeight: 8 } : { height: variant === \"dotted\" ? dotTile : thickness, minWidth: 8 }),\n        borderRadius: variant === \"dotted\" ? 0 : thickness,\n        background: variant === \"solid\" ? color : undefined,\n        backgroundImage: variant === \"solid\" ? undefined : lineBackground(side),\n        ...(variant === \"dotted\" ? { backgroundSize: vertical ? `${dotTile}px 8px` : `8px ${dotTile}px`, backgroundRepeat: vertical ? \"repeat-y\" : \"repeat-x\" } : {}),\n        transformOrigin: origin,\n      }}\n      initial={animated ? (vertical ? { scaleY: 0 } : { scaleX: 0 }) : false}\n      whileInView={animated ? (vertical ? { scaleY: 1 } : { scaleX: 1 }) : undefined}\n      viewport={{ once: true, amount: 0.6 }}\n      transition={{ duration: 0.7, ease: [0.16, 1, 0.3, 1] }}\n    />\n  );\n\n  const labelEl = label ? (\n    <span className=\"shrink-0 font-medium\" style={{ color: accent ? accentColor : p.text, fontSize: 12.5, letterSpacing: \"0.04em\", fontFamily: \"Inter, sans-serif\", textTransform: typeof label === \"string\" ? \"uppercase\" : undefined }}>\n      {label}\n    </span>\n  ) : null;\n\n  const startFlex = labelPosition === \"start\" ? 0.12 : 1;\n  const endFlex = labelPosition === \"end\" ? 0.12 : 1;\n\n  return (\n    <div\n      role=\"separator\"\n      aria-orientation={orientation}\n      className={cn(\"flex items-center\", vertical ? \"h-full flex-col self-stretch\" : \"w-full\", className)}\n      style={{ gap: 14, ...(vertical ? { marginLeft: spacing, marginRight: spacing } : { marginTop: spacing, marginBottom: spacing }) }}\n    >\n      {label ? (\n        <>\n          {renderLine(\"start\", vertical ? \"bottom\" : \"right\", startFlex)}\n          {labelEl}\n          {renderLine(\"end\", vertical ? \"top\" : \"left\", endFlex)}\n        </>\n      ) : (\n        renderLine(\"full\", vertical ? \"top\" : \"left\", 1)\n      )}\n    </div>\n  );\n}\n",
      "type": "registry:component"
    }
  ],
  "type": "registry:component"
}