{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "progress-bar",
  "type": "registry:component",
  "title": "ProgressBar",
  "description": "A pill-shaped bar that fills from 0 to `value`% on SPRING_SMOOTH. Solid dusty-rose accent on a neutral track, with an optional tabular `${value}%` label beside it. No overshoot.",
  "dependencies": [
    "remotion",
    "zod",
    "react"
  ],
  "files": [
    {
      "path": "registry/components/progress-bar/ProgressBar.tsx",
      "type": "registry:component",
      "target": "components/onda/progress-bar/ProgressBar.tsx",
      "content": "import React from 'react';\nimport { useCurrentFrame, useVideoConfig, interpolate, spring } from 'remotion';\nimport { SPRING_SMOOTH } from '../../../lib/motion';\nimport { PlacementBox } from '../../../lib/canvas';\nimport { progressBarSchema, type ProgressBarProps } from './schema';\n\nexport { progressBarSchema, type ProgressBarProps };\n\n/**\n * A horizontal bar that fills from 0 to `value`% on `SPRING_SMOOTH`. Solid\n * dusty-rose accent on a neutral track. Optional `${value}%` label sits to\n * the right of the bar — one calm, single-focal moment, no overshoot.\n *\n * @example\n * <ProgressBar value={72} />\n */\nexport const ProgressBar: React.FC<ProgressBarProps> = ({\n  value, delay, duration, height, radius,\n  trackColor, accentColor, showValue, color, fontSize, fontFamily, placement,\n}) => {\n  const frame = useCurrentFrame();\n  const { fps } = useVideoConfig();\n  const local = Math.max(0, frame - delay);\n\n  const progress = spring({\n    frame: local,\n    fps,\n    config: SPRING_SMOOTH,\n    durationInFrames: duration,\n  });\n\n  // Clamp the fill at 100% so out-of-range `value` never overflows the track.\n  // Schema already enforces 0–100, but this keeps the component correct under\n  // any caller mistake or future schema relaxation.\n  const targetPct = Math.max(0, Math.min(100, value));\n\n  const fillPct = interpolate(progress, [0, 1], [0, targetPct], {\n    extrapolateLeft: 'clamp',\n    extrapolateRight: 'clamp',\n  });\n\n  return (\n    <PlacementBox placement={placement}>\n    <div\n      style={{\n        display: 'flex',\n        flexDirection: 'row',\n        alignItems: 'center',\n        gap: 24,\n        color,\n        fontSize,\n        fontFamily,\n        fontWeight: 500,\n        // Without an explicit width the row shrinks to its label content and\n        // the `flex: 1` track collapses to zero. 80% of canvas gives the bar\n        // somewhere to grow into while leaving generous side margins. Same\n        // gotcha as BarChart — see CLAUDE.md component contract.\n        width: '80%',\n        maxWidth: 800,\n        // Self-center inside any wider parent. Flex-centering parents\n        // are unaffected; non-flex parents (e.g. a fixed-width wrapper)\n        // would otherwise leave the bar flush-left.\n        marginInline: 'auto',\n      }}\n    >\n      <div\n        style={{\n          position: 'relative',\n          flex: 1,\n          height,\n          background: trackColor,\n          borderRadius: radius,\n          overflow: 'hidden',\n        }}\n      >\n        <div\n          style={{\n            width: `${fillPct}%`,\n            height: '100%',\n            background: accentColor,\n            borderRadius: radius,\n          }}\n        />\n      </div>\n      {showValue ? (\n        <div\n          style={{\n            flexShrink: 0,\n            color,\n            // Reserve enough space for \"100%\" so the bar's right edge does not\n            // shift as the label renders. A monospace tabular feel without\n            // changing the font family.\n            minWidth: '4ch',\n            textAlign: 'right',\n            fontVariantNumeric: 'tabular-nums',\n          }}\n        >\n          {Math.round(targetPct)}%\n        </div>\n      ) : null}\n    </div>\n    </PlacementBox>\n  );\n};\n"
    },
    {
      "path": "registry/components/progress-bar/schema.ts",
      "type": "registry:component",
      "target": "components/onda/progress-bar/schema.ts",
      "content": "import { z } from 'zod';\nimport { DURATION } from '../../../lib/motion';\nimport { placementSchema } from '../../../lib/canvas-schemas';\n\n/** Zod schema for {@link ProgressBar} props. */\nexport const progressBarSchema = z.object({\n  /** Discriminator literal — matches this entry's registry slug. Auto-populated when omitted (`schema.parse({})` works as before). Lets consumers build `z.discriminatedUnion('kind', [...])` directly over onda schemas. */\n  kind: z.literal('progress-bar').default('progress-bar'),\n  /** Target fill, 0–100. The bar grows from 0 to this value. */\n  value: z.number().min(0).max(100).default(64),\n  /** Frames before the animation starts. */\n  delay: z.number().int().min(0).default(0),\n  /** Frames to reach the full target value. Bars want more time than text. */\n  duration: z.number().int().min(1).default(DURATION.slow),\n  /** Bar thickness in px. */\n  height: z.number().default(12),\n  /** Border-radius in px. Defaults to a full pill. */\n  radius: z.number().default(999),\n  /** Track color — the unfilled portion. Defaults to `--onda-border-lit`. */\n  trackColor: z.string().default('var(--onda-border-lit, #26262E)'),\n  /** Fill color — the earned accent. Defaults to `--onda-accent`. */\n  accentColor: z.string().default('var(--onda-accent, #D96B82)'),\n  /** Whether to render the `${value}%` label beside the bar. */\n  showValue: z.boolean().default(true),\n  /** Label color. Defaults to `--onda-text`. */\n  color: z.string().default('var(--onda-text, #F2F2F4)'),\n  /** Label font size in px. */\n  fontSize: z.number().default(28),\n  /** Onda display font. */\n  fontFamily: z.string().default('var(--onda-font-display, \"Clash Display\", sans-serif)'),\n  /** Where on the canvas this sits. Region (`'center'`, `'upper-third'`, ...) or `{ x, y, anchor }` in 0..1 canvas fractions. Coordinates may be negative or >1 for off-canvas. */\n  placement: placementSchema.optional(),\n});\n\n/** Inferred props for {@link ProgressBar}. */\nexport type ProgressBarProps = z.infer<typeof progressBarSchema>;\n"
    },
    {
      "path": "registry/components/progress-bar/progress-bar.meta.json",
      "type": "registry:file",
      "target": "components/onda/progress-bar/progress-bar.meta.json",
      "content": "{\n  \"name\": \"progress-bar\",\n  \"title\": \"ProgressBar\",\n  \"description\": \"A pill-shaped bar that fills from 0 to `value`% on SPRING_SMOOTH. Solid dusty-rose accent on a neutral track, with an optional tabular `${value}%` label beside it. No overshoot.\",\n  \"pickWhen\": \"a percentage in a horizontal layout — loading, capacity, share. Use `pie-reveal` for the ring; `progress-steps` for ordered milestones.\",\n  \"category\": \"data\",\n  \"tags\": [\n    \"data\",\n    \"progress\",\n    \"bar\",\n    \"primitive\",\n    \"spring\"\n  ],\n  \"dependencies\": [\n    \"remotion\",\n    \"zod\",\n    \"react\"\n  ]\n}\n"
    },
    {
      "path": "registry/components/progress-bar/README.md",
      "type": "registry:file",
      "target": "components/onda/progress-bar/README.md",
      "content": "# ProgressBar\n\nA pill-shaped bar that fills from 0 to `value`% on `SPRING_SMOOTH`. The fill is a single solid stroke of dusty rose on a neutral track; an optional tabular `${value}%` label sits to the right. One focal moment, no overshoot, no gradient — just the bar settling into its number.\n\n## Props\n\n| Name | Type | Default | Notes |\n| --- | --- | --- | --- |\n| `value` | `number` (0–100) | `64` | Target fill percentage. Bar grows from 0 to this value. |\n| `delay` | `integer ≥ 0` | `0` | Frames before the animation starts. |\n| `duration` | `integer ≥ 1` | `DURATION.slow` (24) | Frames to reach the full target value. Bars want more time than text. |\n| `height` | `number` | `12` | Bar thickness in px. |\n| `radius` | `number` | `999` | Border-radius in px. Defaults to a full pill. |\n| `trackColor` | `string` | `\"#26262E\"` | Track (unfilled) color — defaults to `--onda-border-lit`. |\n| `accentColor` | `string` | `\"#D96B82\"` | Fill color — defaults to `--onda-accent`. |\n| `showValue` | `boolean` | `true` | Render the `${value}%` label beside the bar. |\n| `color` | `string` | `\"#F2F2F4\"` | Label color — defaults to `--onda-text`. |\n| `fontSize` | `number` | `28` | Label font size in px. |\n| `fontFamily` | `string` | `'\"Clash Display\", sans-serif'` | The Onda display font. |\n| `placement` | `Placement?` | – | Where on the canvas this sits. Region (`\"center\"`, `\"upper-third\"`, …) or `{ x, y, anchor }` in 0..1 canvas fractions. Coordinates may be negative or >1 for off-canvas. |\n\n## Usage\n\n```tsx\nimport { Composition } from 'remotion';\nimport { ProgressBar, progressBarSchema } from './components/onda/progress-bar/ProgressBar';\n\nexport const Root: React.FC = () => (\n  <Composition\n    id=\"MyProgress\"\n    component={ProgressBar}\n    durationInFrames={60}\n    fps={30}\n    width={1080}\n    height={1920}\n    schema={progressBarSchema}\n    defaultProps={{\n      value: 72,\n      delay: 0,\n      duration: 24,\n      height: 12,\n      radius: 999,\n      trackColor: '#26262E',\n      accentColor: '#D96B82',\n      showValue: true,\n      color: '#F2F2F4',\n      fontSize: 28,\n      fontFamily: '\"Clash Display\", sans-serif',\n    }}\n  />\n);\n```\n\n## Motion notes\n\n- Spring is `SPRING_SMOOTH` from `lib/motion.ts` — the Onda house default. **No overshoot.** The bar does not bounce past its target value.\n- Duration defaults to `DURATION.slow` (24 frames ≈ 0.8s at 30fps) — bars want more time than text.\n- `interpolate` clamps at both ends, so the component is correct on frame 0 and on any frame past `delay + duration`.\n- The fill is a solid color, never a gradient — restraint is the brand.\n- The outer wrapper is `width: 80%` with `maxWidth: 800` so the `flex: 1` track has space to grow into. Wrap in a `<Sequence>` or a parent that centers it for typical scene layouts.\n"
    }
  ],
  "registryDependencies": [
    "lib-motion"
  ]
}
