{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "odometer-figures",
  "title": "Odometer Figures",
  "type": "registry:component",
  "description": "Digits roll with a mechanical overshoot",
  "dependencies": [
    "motion@^12.43.0"
  ],
  "files": [
    {
      "path": "src/kavyn/odometer-figures.jsx",
      "type": "registry:file",
      "target": "@components/kavyn/odometer-figures.jsx",
      "content": "'use client'\n\nimport { useEffect, useState } from 'react'\nimport { motion } from 'motion/react'\n\nfunction Digit({ d }) {\n  return (\n    <span className=\"relative inline-block h-[1em] w-[0.62em] overflow-hidden\">\n      <motion.span\n        className=\"absolute inset-x-0 top-0 flex flex-col\"\n        animate={{ y: `${-d}em` }}\n        transition={{ type: 'spring', stiffness: 140, damping: 15, mass: 0.9 }}\n      >\n        {Array.from({ length: 10 }, (_, n) => <span key={n} className=\"h-[1em] leading-none\">{n}</span>)}\n      </motion.span>\n    </span>\n  )\n}\n\n/** @param {{ value?: any, prefix?: any, auto?: any }} props */\nexport default function OdometerFigures({ value = undefined, prefix = '$', auto = true }) {\n  const [v, setV] = useState(value ?? 48210)\n  useEffect(() => { if (value != null) setV(value) }, [value])\n  useEffect(() => {\n    if (!auto || value != null) return\n    const t = setInterval(() => setV((x) => x + Math.floor(Math.random() * 900) + 80), 2200)\n    return () => clearInterval(t)\n  }, [auto, value])\n  const s = v.toLocaleString('en-US')\n  return (\n    <div className=\"flex flex-col items-start gap-2\">\n      <span className=\"text-xs uppercase tracking-widest text-faint\">Revenue today</span>\n      <div className=\"flex items-end font-mono text-5xl font-medium leading-none tracking-tight text-tx tabular-nums\">\n        <span className=\"mr-1 inline-block h-[1em] leading-none text-mute\">{prefix}</span>\n        {s.split('').map((c, i) => (c === ',' ? <span key={`c${i}`} className=\"inline-block h-[1em] w-[0.3em] leading-none text-faint\">,</span> : <Digit key={`d${s.length - i}`} d={+c} />))}\n      </div>\n    </div>\n  )\n}\n"
    }
  ],
  "cssVars": {
    "theme": {
      "color-bg": "var(--bg)",
      "color-panel": "var(--panel)",
      "color-panel2": "var(--panel2)",
      "color-line": "var(--line)",
      "color-line2": "var(--line2)",
      "color-tx": "var(--tx)",
      "color-mute": "var(--mute)",
      "color-faint": "var(--faint)",
      "color-acc": "var(--acc)",
      "color-acc-fg": "var(--acc-fg)"
    },
    "light": {
      "bg": "#ffffff",
      "panel": "#f5f5f7",
      "panel2": "#e8e8ed",
      "line": "#e5e5ea",
      "line2": "#d2d2d7",
      "tx": "#1d1d1f",
      "mute": "#6e6e73",
      "faint": "#a1a1a6",
      "acc": "#1d1d1f",
      "acc-fg": "#ffffff"
    },
    "dark": {
      "bg": "#000000",
      "panel": "#141416",
      "panel2": "#1f1f22",
      "line": "#262628",
      "line2": "#3a3a3d",
      "tx": "#f5f5f7",
      "mute": "#a1a1a6",
      "faint": "#6e6e73",
      "acc": "#f5f5f7",
      "acc-fg": "#000000"
    }
  },
  "css": {
    ".light": {
      "--bg": "#ffffff",
      "--panel": "#f5f5f7",
      "--panel2": "#e8e8ed",
      "--line": "#e5e5ea",
      "--line2": "#d2d2d7",
      "--tx": "#1d1d1f",
      "--mute": "#6e6e73",
      "--faint": "#a1a1a6",
      "--acc": "#1d1d1f",
      "--acc-fg": "#ffffff"
    }
  }
}
