'use client'; /* ───────────────────────────────────────────────────────────────────────── PixelDivider — horizontal rule with optional label. Pixel surface adds dotted line + diamond ornaments around the label. Decorative (non-interactive); does not forward refs. ───────────────────────────────────────────────────────────────────────── */ import React from 'react'; import { cn, Surface, Tone, surfaceClasses, toneMap, useEffectiveSurface } from '../common'; export interface PixelDividerProps { /** Optional centered label between two rules. */ label?: string; /** Color tone of the label text. */ tone?: Tone; /** Symmetric vertical padding. */ spacing?: 'none' | 'sm' | 'md' | 'lg'; className?: string; /** Surface variant. Falls back to nearest . */ surface?: Surface; } export function PixelDivider({ label, tone = 'neutral', spacing = 'none', className, surface: surfaceProp, }: PixelDividerProps) { const surface = useEffectiveSurface(surfaceProp); const s = surfaceClasses(surface); const spacingClass = spacing === 'lg' ? 'py-10' : spacing === 'md' ? 'py-6' : spacing === 'sm' ? 'py-3' : ''; const rule = surface === 'pixel' ? 'border-t-2 border-dotted' : 'border-t'; if (!label) { return
; } return (
{surface === 'pixel' && } {label} {surface === 'pixel' && }
); }