/** * Range field — a native `` (styled like TickSlider's own * track/thumb) paired with an editable number+unit box on the same row, and * the min/max bounds labelled underneath the track. Used where a continuous * value (not a small named set of steps — see TickSlider for that case) * needs its exact number visible and editable, not just discoverable via the * track's own tooltip (e.g. Sidebar Width, border width/radius, spacing). */ interface RangeFieldProps { value: number; min: number; max: number; step?: number; /** Appended to the number box and the min/max labels (e.g. '%', 'px'). */ unit?: string; onChange: ( value: number ) => void; /** Plain text label above the row. Omit where a heading already sits above. */ label?: string; ariaLabel?: string; /** Min/max labels under the track. Off where the row has no room for them. */ showScale?: boolean; } export default function RangeField( { value, min, max, step = 1, unit = '', onChange, label, ariaLabel, showScale = true, }: RangeFieldProps ) { const clamp = ( next: number ) => Math.max( min, Math.min( max, next ) ); const percent = max > min ? ( ( value - min ) / ( max - min ) ) * 100 : 0; return (