# Voice Input Component Spec Status: Proposal (MVP scope approved) ## Goals - Provide a reusable, accessible, privacy-respecting voice input for forms and composers. - Drop-in across Orangecat (onboarding, create forms, timeline/messages, My Cat). - Align with SSOT/DRY/SoC, a11y, security, and performance principles. ## Non-goals - Server-side transcription (MVP). Future: optional local Whisper endpoint. - Persisting audio/transcripts (beyond the hosting form’s state). ## API Component: `VoiceInputButton` ``` interface VoiceInputButtonProps { onTranscript: (text: string) => void; // receives final transcript lang?: string; // BCP-47 (default: 'en-US') size?: 'sm' | 'md'; // UI size className?: string; // Tailwind classes (literal only) disabled?: boolean; // disabled state ariaLabel?: string; // accessibility label } ``` Hook: `useVoiceInput` ``` interface UseVoiceInputArgs { lang?: string } interface UseVoiceInputReturn { supported: boolean; listening: boolean; start: () => void; stop: () => void; } ``` Usage ``` import { VoiceInputButton } from '@/components/ui/VoiceInputButton'; function DescriptionField() { const [value, setValue] = useState(''); return (