{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "timer",
  "title": "Timer",
  "description": "A countdown timer with its own controls: the time left in large numbers, Start, then Pause and Cancel, Resume when paused, and at zero \"Time's up\" with Dismiss and Restart.",
  "registryDependencies": [
    "@ouro/button",
    "@ouro/lib-announce",
    "@ouro/lib-class-name-check",
    "@ouro/lib-cn",
    "@ouro/lib-env",
    "@ouro/lib-feedback",
    "@ouro/lib-use-dev-messages",
    "@ouro/lib-use-timer"
  ],
  "files": [
    {
      "path": "registry/ouro/components/ouro/timer/timer-styles.ts",
      "content": "import { announce } from \"@/registry/ouro/lib/ouro/announce\";\nimport { buzz, chime, createChimeContext } from \"@/registry/ouro/lib/ouro/feedback\";\nimport type { TimerDoneEvent } from \"@/registry/ouro/lib/ouro/use-timer\";\n\n/** The words a timer shows and says, for apps in other languages. */\nexport interface TimerLabels {\n  /** @default \"Start\" */\n  start?: string | undefined;\n  /** @default \"Pause\" */\n  pause?: string | undefined;\n  /** @default \"Resume\" */\n  resume?: string | undefined;\n  /** @default \"Cancel\" */\n  cancel?: string | undefined;\n  /** @default \"Dismiss\" */\n  dismiss?: string | undefined;\n  /** @default \"Restart\" */\n  restart?: string | undefined;\n  /**\n   * What it shows, and screen readers hear, at zero. @default \"Time's up\"\n   *\n   * @claim \"What it shows, and screen readers\" registry/ouro/components/ouro/timer/timer.test.tsx verify:testExists(registry/ouro/components/ouro/timer/timer.test.tsx::Timer > says, chimes and buzzes once at zero, shows Time's up, then dismisses or restarts)\n   */\n  done?: string | undefined;\n  /** What it shows after the time while paused. @default \"Paused\" */\n  paused?: string | undefined;\n  /** TimerTray's link to the timer's page. @default \"Go to\" */\n  goTo?: string | undefined;\n}\n\nexport const timerWords = {\n  start: \"Start\",\n  pause: \"Pause\",\n  resume: \"Resume\",\n  cancel: \"Cancel\",\n  dismiss: \"Dismiss\",\n  restart: \"Restart\",\n  done: \"Time's up\",\n  paused: \"Paused\",\n  goTo: \"Go to\",\n} as const satisfies Required<TimerLabels>;\n\n/** The words to use: the app's where it gave them, else the defaults. */\nexport function wordsFor(labels: TimerLabels | undefined): Required<{ [Key in keyof TimerLabels]: string }> {\n  return { ...timerWords, ...Object.fromEntries(Object.entries(labels ?? {}).filter(([, word]) => word !== undefined)) };\n}\n\n/** A finished timer sounds only when it ended a moment ago, not when a page opens long after. */\nconst FRESH_MS = 60_000;\n\n// One audio context for every timer on the page, made in the click that starts a timer, which\n// is when browsers allow sound to start.\nlet context: AudioContext | null | undefined;\n\n/** Makes the page's chime context, from a click. */\nexport function primeAlert(): void {\n  context ??= createChimeContext();\n}\n\n/** How a timer sounds when its time is up: once, or again until it is stopped. */\nexport type TimerAlert = \"once\" | \"repeat\";\n\n/** The ways a timer can sound when its time is up. @internal */\nexport const timerAlerts = [\"once\", \"repeat\"] as const satisfies readonly TimerAlert[];\n\n/**\n * How often a repeating alert sounds again, in ms: every 2.5 seconds, as Spoonjoy's kitchen timer did.\n *\n * @claim \"every 2.5 seconds, as Spoonjoy's kitchen\" registry/ouro/components/ouro/timer/timer.test.tsx verify:testExists(registry/ouro/components/ouro/timer/timer.test.tsx::Timer > chimes and buzzes again every 2.5 seconds with alert=repeat, says it once, and stops on Dismiss)\n */\nexport const REPEAT_MS = 2500;\n\n/** How long a repeating alert keeps sounding unless stopped, in seconds. */\nexport const REPEAT_FOR = 120;\n\n/**\n * `repeatFor` when it is a length (finite and above 0), else {@link REPEAT_FOR}, so a bad value never rings forever.\n *\n * @claim \"`repeatFor` when it is a length\" registry/ouro/components/ouro/timer/timer.test.tsx verify:fileLine(registry/ouro/components/ouro/timer/timer.test.tsx, /takes a repeatFor that is not finite and above 0 as two minutes/)\n */\nexport function repeatLength(seconds: number): number {\n  return Number.isFinite(seconds) && seconds > 0 ? seconds : REPEAT_FOR;\n}\n\n/** The repeating alerts sounding now, by timer (its `timerId`, or the view's own key). */\nconst repeating = new Map<string, ReturnType<typeof setInterval>>();\n\n/** How a view sounds its timer's alert. */\nexport interface AlertOptions {\n  /** Keeps it quiet: the alert is only said. */\n  silent: boolean;\n  /** Sounds again at {@link REPEAT_MS} intervals until stopped or `repeatFor` seconds pass. */\n  repeat: boolean;\n  /** How long a repeating alert lasts, in seconds from when the time was up. */\n  repeatFor: number;\n  /** Which timer it is, so any view of it can stop it. */\n  key: string;\n}\n\n/**\n * The alert at zero: said once, and chimed and buzzed unless silent or stale; with `repeat`,\n * chimed and buzzed again until {@link stopAlert} or the end of `repeatFor`.\n *\n * @claim \"The alert at zero: said once\" registry/ouro/components/ouro/timer/timer-tray.test.tsx verify:testExists(registry/ouro/components/ouro/timer/timer-tray.test.tsx::TimerTray > follows the Timer on the page, and alerts once at zero even when both show it)\n * @claim \"The alert at zero: said once\" registry/ouro/components/ouro/timer/timer.test.tsx verify:testExists(registry/ouro/components/ouro/timer/timer.test.tsx::Timer > keeps its time through a reload with a timerId, and stays quiet about a timer that ended long ago)\n * @claim \"The alert at zero: said once\" registry/ouro/components/ouro/timer/timer.test.tsx verify:testExists(registry/ouro/components/ouro/timer/timer.test.tsx::Timer > only says the time is up when silent)\n */\nexport function alertDone(label: string, done: string, event: TimerDoneEvent, { silent, repeat, repeatFor, key }: AlertOptions): void {\n  if (!event.first) return;\n  announce(`${label}: ${done}`);\n  if (silent || Date.now() - event.endedAt > FRESH_MS) return;\n  void chime({ context });\n  buzz();\n  if (!repeat) return;\n  repeating.set(\n    key,\n    setInterval(() => {\n      if (Date.now() - event.endedAt >= repeatFor * 1000) return stopAlert(key);\n      void chime({ context });\n      buzz();\n    }, REPEAT_MS),\n  );\n}\n\n/** How many views of a timer are mounted (a `Timer`, a tray's row), by key. */\nconst views = new Map<string, number>();\n\n/**\n * Counts a view of a timer while it is mounted. The function it returns uncounts it, and stops\n * the timer's repeating alert once no view of the timer is left, so nothing rings with no\n * Dismiss on screen.\n *\n * @claim \"stops the timer's repeating alert once\" registry/ouro/components/ouro/timer/timer.test.tsx verify:testExists(registry/ouro/components/ouro/timer/timer.test.tsx::Timer > stops a repeating alert when the last view of its timer goes)\n */\nexport function registerView(key: string): () => void {\n  views.set(key, (views.get(key) ?? 0) + 1);\n  return () => {\n    const left = views.get(key)! - 1;\n    views.set(key, left);\n    // A commit unmounts the old view before mounting its replacement.\n    queueMicrotask(() => {\n      if (views.get(key) === 0) stopAlert(key);\n    });\n  };\n}\n\n/** Stops a timer's repeating alert, if it has one: on Dismiss, Restart or Cancel in any view of it. */\nexport function stopAlert(key: string): void {\n  clearInterval(repeating.get(key));\n  // Stryker disable next-line CallExpression: clearing the interval stops the alert; this only frees its entry.\n  repeating.delete(key);\n}\n\n/**\n * The time when it is up: the destructive color mixed 20% toward the foreground, for contrast on the page.\n *\n * @claim \"The time when it is up\" registry/ouro/components/ouro/timer/timer-styles.ts verify:fileLine(registry/ouro/components/ouro/timer/timer-styles.ts, /text-\\[color-mix\\(in_oklab,var\\(--destructive\\)_80%,var\\(--foreground\\)\\)\\]/)\n */\nexport const doneText = \"text-[color-mix(in_oklab,var(--destructive)_80%,var(--foreground))]\";\n",
      "type": "registry:ui",
      "target": "@components/ouro/timer/timer-styles.ts"
    },
    {
      "path": "registry/ouro/components/ouro/timer/timer.tsx",
      "content": "\"use client\";\n\nimport { useEffect, useId, useRef, type HTMLAttributes, type JSX, type Ref } from \"react\";\nimport { useAppearanceClassNameCheck } from \"@/registry/ouro/lib/ouro/class-name-check\";\nimport { cn } from \"@/registry/ouro/lib/ouro/cn\";\nimport { useDevWarnings } from \"@/registry/ouro/lib/ouro/use-dev-messages\";\nimport { formatDuration, useTimer, type TimerDoneEvent } from \"@/registry/ouro/lib/ouro/use-timer\";\nimport { Button } from \"@/registry/ouro/components/ouro/button/button\";\nimport {\n  alertDone,\n  doneText,\n  primeAlert,\n  registerView,\n  REPEAT_FOR,\n  repeatLength,\n  stopAlert,\n  timerAlerts,\n  wordsFor,\n  type TimerAlert,\n  type TimerLabels,\n} from \"@/registry/ouro/components/ouro/timer/timer-styles\";\n\nexport type { TimerAlert, TimerLabels } from \"@/registry/ouro/components/ouro/timer/timer-styles\";\n\n/** The props Timer adds to the `<div>` attributes it passes through. */\nexport interface TimerOwnProps {\n  /** How long it runs, in seconds: `duration={600}`. */\n  duration: number;\n  /** What the timer is for, shown above the time and naming it for screen readers: \"Pasta\", \"Break\". */\n  label: string;\n  /**\n   * Keeps the timer through a reload and a closed tab, and shares it with a `TimerTray` and\n   * every other `Timer` or `useTimer` given the same `timerId`. Without it the timer ends with\n   * the component. (`id` is the element's, as on any `<div>`.)\n   * @claim \"Keeps the timer through a reload\" registry/ouro/components/ouro/timer/timer.test.tsx verify:testExists(registry/ouro/components/ouro/timer/timer.test.tsx::Timer > keeps its time through a reload with a timerId, and stays quiet about a timer that ended long ago)\n   * @claim \"Keeps the timer through a reload\" registry/ouro/components/ouro/timer/timer.test.tsx verify:testExists(registry/ouro/components/ouro/timer/timer.test.tsx::Timer > passes id to the element, and keeps and shares the timer only by timerId)\n   */\n  timerId?: string | undefined;\n  /**\n   * Called once when the timer reaches zero, including when it ended while the page was closed.\n   *\n   * @claim \"Called once when the timer reaches\" registry/ouro/components/ouro/timer/timer.test.tsx verify:testExists(registry/ouro/components/ouro/timer/timer.test.tsx::Timer > keeps its time through a reload with a timerId, and stays quiet about a timer that ended long ago)\n   * @claim \"Called once when the timer reaches\" registry/ouro/components/ouro/timer/timer.test.tsx verify:testExists(registry/ouro/components/ouro/timer/timer.test.tsx::Timer > says, chimes and buzzes once at zero, shows Time's up, then dismisses or restarts)\n   */\n  onDone?: ((event: TimerDoneEvent) => void) | undefined;\n  /**\n   * No chime and no vibration at zero; it still shows and says that the time is up.\n   *\n   * @claim \"No chime and no vibration at\" registry/ouro/components/ouro/timer/timer.test.tsx verify:testExists(registry/ouro/components/ouro/timer/timer.test.tsx::Timer > only says the time is up when silent)\n   */\n  silent?: boolean | undefined;\n  /**\n   * How it sounds when the time is up. `once` chimes and vibrates once. `repeat` chimes and vibrates again\n   * every 2.5 seconds, for a timer that may finish while the person is across the room, until\n   * they dismiss, restart or cancel it (here, in a `TimerTray` or in any view with its\n   * `timerId`) or `repeatFor` seconds pass. Either way screen readers hear \"Time's up\" once,\n   * and `silent` keeps it quiet.\n   * @default \"once\"\n   * @claim \"every 2.5 seconds, for a timer\" registry/ouro/components/ouro/timer/timer.test.tsx verify:testExists(registry/ouro/components/ouro/timer/timer.test.tsx::Timer > chimes and buzzes again every 2.5 seconds with alert=repeat, says it once, and stops on Dismiss)\n   * @claim \"until they dismiss, restart or cancel\" registry/ouro/components/ouro/timer/timer.test.tsx verify:testExists(registry/ouro/components/ouro/timer/timer.test.tsx::Timer > stops a repeating alert on Restart, when a timer without a timerId goes, and when its repeatFor has passed)\n   * @claim \"until they dismiss, restart or cancel\" registry/ouro/components/ouro/timer/timer-tray.test.tsx verify:testExists(registry/ouro/components/ouro/timer/timer-tray.test.tsx::TimerTray > stops the Timer's repeating alert when the tray dismisses the timer)\n   * @claim \"Either way screen readers hear\" registry/ouro/components/ouro/timer/timer.test.tsx verify:testExists(registry/ouro/components/ouro/timer/timer.test.tsx::Timer > chimes and buzzes again every 2.5 seconds with alert=repeat, says it once, and stops on Dismiss)\n   */\n  alert?: TimerAlert | (string & { 'Use \"once\" or \"repeat\"': never }) | undefined;\n  /**\n   * With `alert=\"repeat\"`, how long it keeps sounding, in seconds from when the time was up,\n   * unless stopped. A value that is not finite and above 0 is taken as 120, and development\n   * warns. The alert also stops once no view of the timer (a `Timer` or a `TimerTray` row with\n   * its `timerId`) is left on the page.\n   * @default 120\n   * @claim \"A value that is not finite\" registry/ouro/components/ouro/timer/timer.test.tsx verify:fileLine(registry/ouro/components/ouro/timer/timer.test.tsx, /takes a repeatFor that is not finite and above 0 as two minutes/)\n   * @claim \"The alert also stops once no\" registry/ouro/components/ouro/timer/timer.test.tsx verify:testExists(registry/ouro/components/ouro/timer/timer.test.tsx::Timer > stops a repeating alert when the last view of its timer goes)\n   * @claim \"how long it keeps sounding, in\" registry/ouro/components/ouro/timer/timer.test.tsx verify:testExists(registry/ouro/components/ouro/timer/timer.test.tsx::Timer > keeps a repeating alert going for two minutes by default)\n   */\n  repeatFor?: number | undefined;\n  /** How large the time is: `md` beside other content, `lg` as a screen's focus. @default \"md\" */\n  size?: \"md\" | \"lg\" | (string & { 'Use \"md\" or \"lg\"': never }) | undefined;\n  /** The words it shows and says, for apps in other languages. */\n  labels?: TimerLabels | undefined;\n  /** Layout only: margins, width (`mt-6`). Appearance classes warn in development. */\n  className?: string | undefined;\n  ref?: Ref<HTMLDivElement> | undefined;\n\n  /** Not a prop. The length is `duration`, in seconds: `<Timer duration={600} />`. */\n  seconds?: { 'Use duration={600} (seconds)': never };\n  /** Not a prop. The length is `duration`, in seconds: `<Timer duration={10 * 60} />`. */\n  minutes?: { 'Use duration={10 * 60} (seconds)': never };\n  /** Not a prop. Ouro UI says `onDone`: `<Timer onDone={() => …} />`. */\n  onComplete?: { 'Use onDone={() => ...}': never };\n  /** Not a prop. Ouro UI says `onDone`: `<Timer onDone={() => …} />`. */\n  onEnd?: { 'Use onDone={() => ...}': never };\n  /** Not a prop. Turn the sound off with `silent`: `<Timer silent />`. */\n  sound?: { 'Use silent to turn the chime off': never };\n  /** Not a prop. A timer is kept and shared by `timerId`: `<Timer timerId=\"pasta\" />`. */\n  autoSaveId?: { 'Use timerId=\"pasta\"': never };\n  /** Not a prop. A timer is kept and shared by `timerId`: `<Timer timerId=\"pasta\" />`. */\n  storageKey?: { 'Use timerId=\"pasta\"': never };\n}\n\n/** Props for {@link Timer}: its own props and the `<div>` attributes it passes through. */\nexport type TimerProps = Omit<HTMLAttributes<HTMLDivElement>, keyof TimerOwnProps> & TimerOwnProps;\n\nconst sizes = {\n  md: \"text-4xl leading-10\",\n  lg: \"text-6xl leading-none sm:text-7xl\",\n} as const;\n\n/** \"10 min\", \"1 h 30 min\", \"45 s\": the length beside the label. */\nfunction lengthOf(seconds: number): string {\n  if (seconds < 60) return `${seconds} s`;\n  // Round the whole length to minutes first, so 59 min 30 s reads \"1 h\", never \"60 min\".\n  const total = Math.round(seconds / 60);\n  const hours = Math.floor(total / 60);\n  const minutes = total % 60;\n  return hours > 0 ? `${hours} h${minutes ? ` ${minutes} min` : \"\"}` : `${minutes} min`;\n}\n\n/**\n * A countdown timer with its own controls: the time left in large numbers, Start, then Pause\n * and Cancel, Resume when paused, and at zero \"Time's up\" with Dismiss and Restart. It keeps\n * time by the clock, so it stays right in a background tab and, with `timerId`, across a reload.\n * At zero it chimes and vibrates (unless `silent`), again every 2.5 seconds until stopped with\n * `alert=\"repeat\"`, and screen readers hear \"Pasta: Time's up\" once; the time itself is a\n * `timer` region, read when the person asks rather than every second.\n *\n * Give timers that should outlive their screen a `timerId` and list them in a `TimerTray`, so a\n * person who moves on can still see and stop them.\n *\n * Use `Progress` instead for how far a task has got, and `useTimer` for a timer of your own design.\n *\n * @group Feedback\n * @see https://ui.ouroboros.bot/docs/timer\n *\n * @example\n * <Timer label=\"Pasta\" duration={600} timerId=\"pasta\" />\n * <Timer label=\"Roast\" duration={5400} timerId=\"roast\" alert=\"repeat\" />\n * @claim \"At zero it chimes and vibrates\" registry/ouro/components/ouro/timer/timer.test.tsx verify:testExists(registry/ouro/components/ouro/timer/timer.test.tsx::Timer > says, chimes and buzzes once at zero, shows Time's up, then dismisses or restarts)\n * @claim \"A countdown timer with its own\" registry/ouro/components/ouro/timer/timer-tray.test.tsx verify:testExists(registry/ouro/components/ouro/timer/timer-tray.test.tsx::TimerTray > is a region listing the running, paused and finished timers with their time, and hides idle ones)\n * @claim \"At zero it chimes and vibrates\" registry/ouro/components/ouro/timer/timer-tray.test.tsx verify:testExists(registry/ouro/components/ouro/timer/timer-tray.test.tsx::TimerTray > is a region listing the running, paused and finished timers with their time, and hides idle ones)\n * @claim \"At zero it chimes and vibrates\" registry/ouro/components/ouro/timer/timer-tray.test.tsx verify:testExists(registry/ouro/components/ouro/timer/timer-tray.test.tsx::TimerTray > follows the Timer on the page, and alerts once at zero even when both show it)\n */\nexport function Timer(props: TimerProps): JSX.Element {\n  const {\n    duration,\n    label,\n    timerId,\n    onDone,\n    silent,\n    alert: alertProp = \"once\",\n    repeatFor: repeatForProp = REPEAT_FOR,\n    size: sizeProp = \"md\",\n    labels,\n    className,\n    // Guard props (hint types), dropped here so they never reach the DOM.\n    seconds,\n    minutes,\n    onComplete,\n    onEnd,\n    sound,\n    autoSaveId,\n    storageKey,\n    ...rest\n  } = props;\n  const size = sizeProp === \"lg\" ? \"lg\" : \"md\";\n  // Stryker disable next-line StringLiteral: any alert but \"repeat\" sounds once, so the fallback's name changes nothing.\n  const alert = timerAlerts.includes(alertProp as TimerAlert) ? (alertProp as TimerAlert) : \"once\";\n  const repeatFor = repeatLength(repeatForProp);\n  const words = wordsFor(labels);\n  useAppearanceClassNameCheck(\n    \"Timer\",\n    className,\n    process.env.NODE_ENV !== \"production\"\n      ? (token: string) => `remove \"${token}\"; use size=\"lg\" for a larger time`\n      : /* istanbul ignore next @preserve -- production only */ \"\",\n  );\n  useDevWarnings(\n    \"Timer\",\n    process.env.NODE_ENV !== \"production\"\n      ? () => [\n          size !== sizeProp && [`size=\"${String(sizeProp)}\" is not a size; use \"md\" or \"lg\"`, '<Timer size=\"lg\" />'],\n          alert !== alertProp && [`alert=\"${String(alertProp)}\" is not an alert; use \"once\" or \"repeat\"`, '<Timer alert=\"repeat\" />'],\n          repeatFor !== repeatForProp && [`repeatFor={${String(repeatForProp)}} is not a length; it is in seconds and above 0`, '<Timer alert=\"repeat\" repeatFor={120} />'],\n          !(duration > 0) && [`duration={${String(duration)}} is not a length; it is in seconds and above 0`, \"<Timer duration={600} />\"],\n          seconds !== undefined && [\"seconds is not a prop\", `<Timer duration={${typeof seconds === \"number\" ? seconds : 600}} />`],\n          minutes !== undefined && [\"minutes is not a prop\", `<Timer duration={${typeof minutes === \"number\" ? minutes : 10} * 60} />`],\n          onComplete !== undefined && [\"onComplete is not a prop\", \"<Timer onDone={() => {}} />\"],\n          onEnd !== undefined && [\"onEnd is not a prop\", \"<Timer onDone={() => {}} />\"],\n          sound !== undefined && [\"sound is not a prop\", \"<Timer silent />\"],\n          autoSaveId !== undefined && [\"autoSaveId is not a prop\", '<Timer timerId=\"pasta\" />'],\n          storageKey !== undefined && [\"storageKey is not a prop\", '<Timer timerId=\"pasta\" />'],\n        ]\n      : /* istanbul ignore next @preserve -- production only */ undefined,\n  );\n  // A repeating alert is the timer's: any view of it stops it, so it is keyed by timerId when there is one.\n  const ownKey = useId();\n  const key = timerId ?? ownKey;\n  const timer = useTimer({\n    duration,\n    timerId,\n    onDone: (event) => {\n      alertDone(label, words.done, event, { silent: silent === true, repeat: alert === \"repeat\", repeatFor, key });\n      onDone?.(event);\n    },\n  });\n  const primary = useRef<HTMLButtonElement>(null);\n  const { status } = timer;\n  const done = status === \"done\";\n  // Dismiss, Restart or Cancel, here or in another view, stops a repeating alert.\n  useEffect(() => {\n    if (!done) stopAlert(key);\n  }, [done, key]);\n  // The alert stops once no view of the timer is left (without a timerId, this is its only view).\n  useEffect(() => registerView(key), [key]);\n\n  const act = () => {\n    if (status === \"running\") return timer.pause();\n    if (status === \"paused\") return timer.resume();\n    if (done) {\n      timer.reset();\n      return;\n    }\n    if (!silent) primeAlert();\n    timer.start();\n  };\n  const other = () => {\n    if (done) {\n      if (!silent) primeAlert();\n      timer.start();\n      return;\n    }\n    timer.reset();\n    // The button goes with the running timer; focus stays on the one that remains.\n    primary.current!.focus();\n  };\n\n  return (\n    <div {...rest} data-ouro=\"timer\" data-status={status} role=\"group\" aria-label={label} className={cn(\"grid min-w-0 gap-3\", className)}>\n      <div className=\"grid min-w-0 gap-1\">\n        <p className={cn(\"m-0 min-w-0 truncate text-sm leading-5 font-medium\", done ? doneText : \"text-muted-foreground\")}>\n          {done ? words.done : `${label} · ${lengthOf(timer.duration)}`}\n        </p>\n        <p role=\"timer\" className={cn(\"m-0 font-semibold tabular-nums\", sizes[size], done ? doneText : \"text-foreground\")}>\n          {formatDuration(timer.remaining)}\n          {status === \"paused\" ? <span className=\"ms-3 align-middle text-sm font-medium text-muted-foreground\">{words.paused}</span> : null}\n        </p>\n      </div>\n      <div className=\"flex flex-wrap gap-2\">\n        <Button\n          ref={primary}\n          data-ouro-control=\"timer\"\n          data-ouro-part=\"primary\"\n          tone={done ? \"destructive\" : \"primary\"}\n          variant={status === \"running\" ? \"soft\" : \"solid\"}\n          onClick={act}\n        >\n          {status === \"running\" ? words.pause : status === \"paused\" ? words.resume : done ? words.dismiss : words.start}\n        </Button>\n        {status !== \"idle\" ? (\n          <Button data-ouro-control=\"timer\" data-ouro-part=\"secondary\" variant=\"plain\" tone=\"secondary\" onClick={other}>\n            {done ? words.restart : words.cancel}\n          </Button>\n        ) : null}\n      </div>\n    </div>\n  );\n}\n",
      "type": "registry:ui",
      "target": "@components/ouro/timer/timer.tsx"
    }
  ],
  "docs": "A countdown timer with its own controls: the time left in large numbers, Start, then Pause and Cancel, Resume when paused, and at zero \"Time's up\" with Dismiss and Restart. Import: import { Timer } from \"@/components/ouro/timer/timer\", with @/components replaced by your components alias (aliases.components in components.json, such as ~/components). Also installed: button, the helpers they import in lib/ouro. Needs ouro-base in your stylesheet: add that item once per app, from the same place as this one, if you have not. Docs: https://ui.ouroboros.bot/docs/timer.md Ouro UI v1.3.257.",
  "type": "registry:ui"
}