import * as React from 'react'; import { Knob } from '../components/Knob'; import { Arc } from '../primitives/Arc'; import { GlowFilter } from '../primitives/GlowFilter'; import { Pointer } from '../primitives/Pointer'; import { KnobLabel, KnobValue } from '../primitives/Text'; import { useKnobTheme } from '../core/theme'; import type { SkinProps } from './shared'; export interface RubberKnobProps extends SkinProps { /** Glow/accent color. */ color?: string; trackColor?: string; textColor?: string; labelColor?: string; arcFrom?: 'min' | 'center'; } /** Soft-touch rubber knob with a glowing halo — modern synth hardware. */ export const RubberKnob = React.forwardRef(function RubberKnob({ size = 90, color: colorProp, trackColor, textColor, labelColor, arcFrom = 'min', label, showValue = false, unit, format, focusRing, className, style, ...core }, ref) { const theme = useKnobTheme(); const color = colorProp ?? theme.accent ?? '#ff9640'; const id = React.useId(); const bodyId = `${id}-body`; const glowId = `${id}-glow`; const c = size / 2; const bodyR = size / 2 - size * 0.17; return ( format(v) : unit ? (v: number) => `${v}${unit}` : undefined)}> {/* rubber grip */} {/* top sheen */} {showValue && ( )} {label && ( {label} )} ); });