{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "micro-progress-pill",
  "type": "registry:component",
  "title": "Progress Pill",
  "description": "A task pill with a striped liquid fill, a wavy leading edge and rolling percent digits. Tap to pause and it squishes and greys out; at 100 it contracts into a green done chip with a drawn check.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "micro",
    "progress",
    "upload",
    "pause",
    "status",
    "pill",
    "micro"
  ],
  "docs": "https://hyperblur.dev/effects/micro-progress-pill",
  "files": [
    {
      "path": "registry/hyperblur/micro-progress-pill.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/micro-progress-pill.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface MicroProgressPillProps extends Omit<React.HTMLAttributes<HTMLDivElement>, \"children\"> {\n  value?: number;\n  label?: string;\n  doneLabel?: string;\n  pausedLabel?: string;\n  speed?: number;\n  autoPlay?: boolean;\n  paused?: boolean;\n  defaultPaused?: boolean;\n  accent?: string;\n  onPausedChange?: (paused: boolean) => void;\n  onComplete?: () => void;\n}\n\nconst css = `\n.hb-wf12 {\n  --hb-wf12-c: #2f7bff;\n  position: relative;\n  display: inline-flex;\n  width: 100%;\n  max-width: 300px;\n  height: 46px;\n  box-sizing: border-box;\n  font-family: inherit;\n  color: #ededed;\n  transition: max-width 0.55s cubic-bezier(0.3, 1.25, 0.45, 1);\n}\n.hb-wf12 *, .hb-wf12 *::before, .hb-wf12 *::after { box-sizing: border-box; }\n.hb-wf12[data-done=\"true\"] { max-width: 150px; }\n.hb-wf12-b {\n  position: relative;\n  display: flex;\n  align-items: center;\n  gap: 10px;\n  width: 100%;\n  height: 100%;\n  margin: 0;\n  padding: 0 14px 0 6px;\n  border: 1px solid #262626;\n  border-radius: 999px;\n  background: #101010;\n  color: inherit;\n  font: inherit;\n  text-align: left;\n  cursor: pointer;\n  overflow: hidden;\n  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 10px 24px -14px rgba(0,0,0,0.9);\n  transition: transform 0.3s cubic-bezier(0.3, 1.7, 0.45, 1), border-color 0.3s ease, background 0.4s ease;\n  -webkit-tap-highlight-color: transparent;\n}\n.hb-wf12-b:active { transform: scale(0.97, 0.92); transition-duration: 0.08s; }\n.hb-wf12-b:focus-visible { outline: 2px solid var(--hb-wf12-c); outline-offset: 3px; }\n.hb-wf12[data-done=\"true\"] .hb-wf12-b { border-color: color-mix(in srgb, #3ddc84 50%, #262626); background: color-mix(in srgb, #3ddc84 12%, #101010); cursor: default; }\n.hb-wf12-fl {\n  position: absolute;\n  left: 0;\n  top: 0;\n  bottom: 0;\n  background: linear-gradient(90deg, color-mix(in srgb, var(--hb-wf12-c) 18%, transparent), color-mix(in srgb, var(--hb-wf12-c) 42%, transparent));\n  transition: background 0.4s ease, opacity 0.4s ease;\n  pointer-events: none;\n}\n.hb-wf12-fl::before {\n  content: \"\";\n  position: absolute;\n  inset: 0;\n  background: repeating-linear-gradient(115deg, rgba(255,255,255,0.07) 0 8px, transparent 8px 16px);\n  background-size: 37.5px 100%;\n  animation: hb-wf12-str 0.9s linear infinite;\n}\n@keyframes hb-wf12-str { to { background-position: 37.5px 0; } }\n.hb-wf12-wv {\n  position: absolute;\n  top: 0;\n  right: -7px;\n  width: 8px;\n  height: 200%;\n  color: color-mix(in srgb, var(--hb-wf12-c) 42%, transparent);\n  animation: hb-wf12-wv 1.4s linear infinite;\n}\n@keyframes hb-wf12-wv { from { transform: translateY(0); } to { transform: translateY(-50%); } }\n.hb-wf12[data-paused=\"true\"] .hb-wf12-fl { background: linear-gradient(90deg, rgba(255,255,255,0.05), rgba(255,255,255,0.12)); }\n.hb-wf12[data-paused=\"true\"] .hb-wf12-wv { color: rgba(255,255,255,0.12); }\n.hb-wf12[data-paused=\"true\"] .hb-wf12-fl::before, .hb-wf12[data-paused=\"true\"] .hb-wf12-wv { animation-play-state: paused; }\n.hb-wf12[data-done=\"true\"] .hb-wf12-fl { opacity: 0; }\n.hb-wf12-ic {\n  position: relative;\n  flex: none;\n  display: grid;\n  place-items: center;\n  width: 32px;\n  height: 32px;\n  border-radius: 999px;\n  background: #1c1c1c;\n  border: 1px solid #2c2c2c;\n  color: #e8e8e8;\n  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;\n}\n.hb-wf12[data-done=\"true\"] .hb-wf12-ic { background: #3ddc84; border-color: #3ddc84; color: #04210f; animation: hb-wf12-pop 0.5s cubic-bezier(0.2, 1.8, 0.4, 1); }\n@keyframes hb-wf12-pop { 0% { transform: scale(0.6); } 60% { transform: scale(1.15); } 100% { transform: none; } }\n.hb-wf12-ic svg { position: absolute; width: 14px; height: 14px; transition: opacity 0.18s ease, transform 0.28s cubic-bezier(0.3, 1.6, 0.5, 1); }\n.hb-wf12-ic [data-k] { opacity: 0; transform: scale(0.4); }\n.hb-wf12-ic [data-k=\"on\"] { opacity: 1; transform: none; }\n.hb-wf12-ck path { stroke-dasharray: 16; stroke-dashoffset: 16; }\n.hb-wf12[data-done=\"true\"] .hb-wf12-ck path { animation: hb-wf12-draw 0.35s ease-out 0.12s forwards; }\n@keyframes hb-wf12-draw { to { stroke-dashoffset: 0; } }\n.hb-wf12-tx { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; line-height: 1; }\n.hb-wf12-t1 { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n.hb-wf12-t2 { font-family: var(--font-mono), ui-monospace, monospace; font-size: 10.5px; color: #8a8a8a; white-space: nowrap; }\n.hb-wf12[data-done=\"true\"] .hb-wf12-t2 { display: none; }\n.hb-wf12-pc {\n  position: relative;\n  flex: none;\n  display: inline-flex;\n  font-family: var(--font-mono), ui-monospace, monospace;\n  font-size: 13px;\n  font-weight: 600;\n  font-variant-numeric: tabular-nums;\n  height: 16px;\n  overflow: hidden;\n  line-height: 16px;\n}\n.hb-wf12[data-done=\"true\"] .hb-wf12-pc { display: none; }\n.hb-wf12-dg { display: block; height: 16px; overflow: hidden; width: 1ch; }\n.hb-wf12-col { display: flex; flex-direction: column; transition: transform 0.35s cubic-bezier(0.3, 1.3, 0.45, 1); }\n.hb-wf12-col span { display: block; height: 16px; }\n.hb-wf12-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }\n@media (prefers-reduced-motion: reduce) {\n  .hb-wf12, .hb-wf12-b, .hb-wf12-fl, .hb-wf12-ic, .hb-wf12-ic svg, .hb-wf12-col { transition: none; }\n  .hb-wf12-fl::before, .hb-wf12-wv, .hb-wf12[data-done=\"true\"] .hb-wf12-ic { animation: none; }\n  .hb-wf12[data-done=\"true\"] .hb-wf12-ck path { animation: none; stroke-dashoffset: 0; }\n}\n`;\n\nconst digits = Array.from({ length: 10 }, (_, i) => i);\n\nexport function MicroProgressPill({\n  value,\n  label = \"Uploading 3 files\",\n  doneLabel = \"Uploaded\",\n  pausedLabel = \"Paused\",\n  speed = 9,\n  autoPlay = false,\n  paused,\n  defaultPaused = false,\n  accent = \"#2f7bff\",\n  onPausedChange,\n  onComplete,\n  className = \"\",\n  style,\n  ...rest\n}: MicroProgressPillProps) {\n  const [innerP, setInnerP] = React.useState(0);\n  const [innerPaused, setInnerPaused] = React.useState(defaultPaused);\n  const isPaused = paused ?? innerPaused;\n  const p = Math.max(0, Math.min(100, value ?? innerP));\n  const done = p >= 100;\n  const cb = React.useRef({ onComplete });\n  const fired = React.useRef(false);\n\n  React.useEffect(() => {\n    cb.current = { onComplete };\n  });\n\n  React.useEffect(() => {\n    if (value !== undefined || isPaused || done) return;\n    let raf = 0;\n    let last = performance.now();\n    const step = (t: number) => {\n      const dt = (t - last) / 1000;\n      last = t;\n      setInnerP((cur) => {\n        const slow = cur > 82 ? 0.45 : cur < 12 ? 1.6 : 1;\n        return Math.min(100, cur + speed * slow * dt);\n      });\n      raf = requestAnimationFrame(step);\n    };\n    raf = requestAnimationFrame(step);\n    return () => cancelAnimationFrame(raf);\n  }, [value, isPaused, done, speed]);\n\n  React.useEffect(() => {\n    if (done && !fired.current) {\n      fired.current = true;\n      cb.current.onComplete?.();\n    }\n    if (!done) fired.current = false;\n  }, [done]);\n\n  React.useEffect(() => {\n    if (!done || !autoPlay || value !== undefined) return;\n    const t = window.setTimeout(() => setInnerP(0), 2200);\n    return () => window.clearTimeout(t);\n  }, [done, autoPlay, value]);\n\n  const toggle = () => {\n    if (done) return;\n    const next = !isPaused;\n    if (paused === undefined) setInnerPaused(next);\n    onPausedChange?.(next);\n  };\n\n  const pct = Math.floor(p);\n  const left = Math.max(0, Math.ceil((100 - p) / speed));\n  const chars = String(pct).padStart(2, \"0\").split(\"\");\n\n  return (\n    <div\n      className={`hb-wf12 ${className}`}\n      data-done={done}\n      data-paused={isPaused}\n      role=\"progressbar\"\n      aria-label={label}\n      aria-valuemin={0}\n      aria-valuemax={100}\n      aria-valuenow={pct}\n      aria-valuetext={done ? doneLabel : isPaused ? `${pausedLabel}, ${pct}%` : `${pct}%`}\n      style={{ ...style, [\"--hb-wf12-c\" as string]: accent }}\n      {...rest}\n    >\n      <style href=\"hb-micro-progress-pill\" precedence=\"default\">\n        {css}\n      </style>\n      <button\n        type=\"button\"\n        className=\"hb-wf12-b\"\n        aria-label={done ? doneLabel : isPaused ? `Resume: ${label}` : `Pause: ${label}`}\n        aria-pressed={done ? undefined : isPaused}\n        aria-disabled={done || undefined}\n        onClick={toggle}\n      >\n        <span className=\"hb-wf12-fl\" style={{ width: `${p.toFixed(2)}%` }} aria-hidden=\"true\">\n          <svg className=\"hb-wf12-wv\" viewBox=\"0 0 8 92\" preserveAspectRatio=\"none\">\n            <path d=\"M0 0h4c4 5.75 4 5.75 0 11.5s-4 5.75 0 11.5 4 5.75 0 11.5-4 5.75 0 11.5 4 5.75 0 11.5-4 5.75 0 11.5 4 5.75 0 11.5-4 5.75 0 11.5H0z\" fill=\"currentColor\" />\n          </svg>\n        </span>\n        <span className=\"hb-wf12-ic\" aria-hidden=\"true\">\n          <svg data-k={!done && !isPaused ? \"on\" : \"off\"} viewBox=\"0 0 16 16\" fill=\"currentColor\">\n            <rect x=\"4\" y=\"3.5\" width=\"2.6\" height=\"9\" rx=\"1\" />\n            <rect x=\"9.4\" y=\"3.5\" width=\"2.6\" height=\"9\" rx=\"1\" />\n          </svg>\n          <svg data-k={!done && isPaused ? \"on\" : \"off\"} viewBox=\"0 0 16 16\" fill=\"currentColor\">\n            <path d=\"M5.2 3.6c0-.7.8-1.2 1.4-.8l5.6 3.9c.5.4.5 1.2 0 1.6l-5.6 3.9c-.6.4-1.4 0-1.4-.8z\" />\n          </svg>\n          <svg className=\"hb-wf12-ck\" data-k={done ? \"on\" : \"off\"} viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n            <path d=\"M3.5 8.5l3 3 6-7\" />\n          </svg>\n        </span>\n        <span className=\"hb-wf12-tx\">\n          <span className=\"hb-wf12-t1\">{done ? doneLabel : label}</span>\n          <span className=\"hb-wf12-t2\">{isPaused ? `${pausedLabel} · tap to resume` : `${left}s left · tap to pause`}</span>\n        </span>\n        <span className=\"hb-wf12-pc\" aria-hidden=\"true\">\n          {chars.map((c, i) => (\n            <span key={`${chars.length}-${i}`} className=\"hb-wf12-dg\">\n              <span className=\"hb-wf12-col\" style={{ transform: `translateY(${-Number(c) * 16}px)` }}>\n                {digits.map((d) => (\n                  <span key={d}>{d}</span>\n                ))}\n              </span>\n            </span>\n          ))}\n          %\n        </span>\n      </button>\n      <span className=\"hb-wf12-sr\" aria-live=\"polite\">\n        {done ? doneLabel : \"\"}\n      </span>\n    </div>\n  );\n}\n"
    }
  ]
}