Add the Nook "Voice Input" component to this project, exactly as Nook ships it. A microphone button that records, with a timer and a level meter. Steps 1. Check for `nook.json` in the project root. If it is missing, run `npx nook-ui@latest init` first (React or Next.js with Tailwind CSS v4). It adds the Nook tokens, the theme and `cn()`. 2. Run `npx nook-ui@latest add voice-input`. It writes `components/ui/voice-input.tsx` together with everything the component needs. Do not write the component from memory. 3. If you cannot run commands, fetch http://localhost:3000/r/voice-input.json, write every entry of `files` to the path it names, install the packages in `dependencies`, and repeat for each name in `registryDependencies`. 4. Use it where I ask. Start from this example: ```tsx "use client"; import * as React from "react"; import { VoiceInput } from "@/components/ui/voice-input"; export default function VoiceInputDefault() { const [clip, setClip] = React.useState<{ url: string; seconds: number } | null>(null); return (
{ setClip((previous) => { if (previous) URL.revokeObjectURL(previous.url); return { url: URL.createObjectURL(audio), seconds }; }); }} /> {clip ? (
Last recording, {clip.seconds} seconds {/* eslint-disable-next-line jsx-a11y/media-has-caption -- the person's own recording, played back to them. */}
) : null}
); } ``` API - `VoiceInput`: The recorder. It hands you the audio; transcription is up to your app. - `onRecordingComplete` (`(audio: Blob, seconds: number) => void`): Called when recording stops. - `maxSeconds` (`number`, default 120): Stops by itself after this long. - `bars` (`number`, default 16): How many level bars to draw. - `disabled` (`boolean`): Prevents recording. Rules - Colors, radii, shadows and motion come from Nook tokens and classes such as `bg-primary`, `text-muted-foreground`, `border-border`, `rounded-lg` and `h-control`. Never hard-code them. - Do not restyle or simplify the file. Change how it looks through `className`, its props and the theme. - It must keep working with the keyboard, in light and dark mode, and in the sharp, soft and bold styles. - Accessibility: The button says whether pressing it starts or stops. The state and any problem (no permission, no support) are written out and announced. The microphone is only requested on press and released on stop. Done when the component renders like the example in light and dark mode and the project type-checks.