{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "tempo-control",
  "title": "TempoControl",
  "description": "Animation tempo picker: a fieldset of four native radios (AUTO, 12, 60, 0) in the segmented appearance. Shows the OS reduced-motion override honestly; disabled without a TempoProvider.",
  "registryDependencies": [
    "https://frame12.dev/r/frame12-styles.json",
    "https://frame12.dev/r/use-tempo.json",
    "https://frame12.dev/r/tempo.json"
  ],
  "files": [
    {
      "path": "ui/tempo-control.tsx",
      "content": "'use client';\n\nimport * as React from 'react';\nimport { TEMPOS, useTempo, type Tempo } from '@/hooks/use-tempo';\n\nexport interface TempoControlProps {\n  /** Group label. Visually hidden unless `showLegend` is set. */\n  legend?: string;\n  /** Shows the legend visibly above the options. */\n  showLegend?: boolean;\n  /** Prefix for the radio ids (`${idPrefix}-auto`, `${idPrefix}-twos`, …). */\n  idPrefix?: string;\n  className?: string;\n}\n\nexport const TEMPO_OPTIONS: ReadonlyArray<{ value: Tempo; label: string; unit: string; meaning: string }> = [\n  { value: 'auto', label: 'AUTO', unit: 'own', meaning: \"each component's own motion\" },\n  { value: 'twos', label: '12', unit: 'twos', meaning: 'on twos' },\n  { value: 'ones', label: '60', unit: 'smooth', meaning: 'smooth' },\n  { value: 'still', label: '0', unit: 'still', meaning: 'no motion' },\n];\n\n// Bundlers (Next.js, webpack, Vite) statically replace `process.env.NODE_ENV`. Declared locally so\n// browser-only TypeScript consumers without @types/node still compile (as in panel.tsx).\ndeclare const process: { env: { NODE_ENV?: string } };\n\nconst isDev = (): boolean => {\n  try {\n    return process.env.NODE_ENV !== 'production';\n  } catch {\n    return false;\n  }\n};\n\n/**\n * The viewer's animation tempo as one native radio group: a `<fieldset>` + `<legend>` with four\n * radio inputs in the segmented appearance. Arrow keys move and select; Tab enters and leaves\n * the group as one stop. Must sit inside a TempoProvider; without one it renders disabled.\n */\nexport function TempoControl({\n  legend = 'Animation tempo',\n  showLegend = false,\n  idPrefix,\n  className = '',\n}: TempoControlProps) {\n  const { tempo, setTempo, inProvider, reduced, ancestorStill } = useTempo();\n  const autoId = React.useId().replace(/:/g, '');\n  const prefix = idPrefix ?? `f12-tempo-${autoId}`;\n  const noteId = `${prefix}-note`;\n\n  React.useEffect(() => {\n    if (!inProvider && isDev()) {\n      console.warn(\n        'TempoControl: no TempoProvider above this control, so it is disabled. Wrap your app (or this section) in <TempoProvider>.',\n      );\n    }\n  }, [inProvider]);\n\n  // The OS (or an outer `still`) wins: show the effective state, keep the stored choice editable.\n  // The reduced-motion note is always rendered inside a provider and shown by a\n  // `prefers-reduced-motion` media query, so its space exists from first paint (the server cannot\n  // know the OS setting; inserting it after hydration would shift the layout).\n  const REDUCED_NOTE = '0 · your system setting. Your choice applies when your system allows motion.';\n  const note = !inProvider\n    ? 'Unavailable: no tempo provider on this page.'\n    : ancestorStill && !reduced\n      ? '0 · set for this whole page. Your choice applies when that allows motion.'\n      : null;\n  const describedBy = note || reduced ? noteId : undefined;\n\n  return (\n    <fieldset\n      className={`f12-tempo${className ? ` ${className}` : ''}`}\n      disabled={!inProvider}\n      data-tempo={tempo}\n      data-effective={!inProvider ? undefined : reduced || ancestorStill ? 'still' : tempo}\n    >\n      <legend className={showLegend ? 'f12-tempo-legend' : 'f12-sr-only'}>{legend}</legend>\n      <div className=\"f12-rng f12-tempo-rng\">\n        {TEMPOS.map((value) => {\n          const opt = TEMPO_OPTIONS.find((o) => o.value === value)!;\n          const id = `${prefix}-${value}`;\n          return (\n            <label key={value} className=\"f12-rng-btn f12-tempo-opt\" htmlFor={id}>\n              <input\n                id={id}\n                className=\"f12-tempo-input\"\n                type=\"radio\"\n                name={prefix}\n                value={value}\n                checked={tempo === value}\n                onChange={() => setTempo(value)}\n                aria-describedby={describedBy}\n              />\n              <span className=\"f12-rng-n\" aria-hidden=\"true\">\n                {opt.label}\n              </span>\n              <span className=\"f12-rng-u\" aria-hidden=\"true\">\n                {opt.unit}\n              </span>\n              <span className=\"f12-sr-only\">{`${opt.label}, ${opt.meaning}`}</span>\n            </label>\n          );\n        })}\n      </div>\n      {note ? (\n        <p className=\"f12-tempo-note\" id={noteId}>\n          {note}\n        </p>\n      ) : (\n        <p className=\"f12-tempo-note f12-tempo-note-reduced\" id={noteId}>\n          {REDUCED_NOTE}\n        </p>\n      )}\n    </fieldset>\n  );\n}\n",
      "type": "registry:ui",
      "target": "components/frame12/tempo-control.tsx"
    }
  ],
  "type": "registry:ui"
}