{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "core-progress-bar",
  "type": "registry:lib",
  "title": "core/progress-bar",
  "description": "Framework-free behaviour shared by the ui-* components (progress-bar); no DOM, no lit. Copied from @purpurabog/ui 2.3.0; the package is the maintained source, this copy is yours to change. Icons from the Carbon Design System (Apache-2.0, © IBM Corp.; see THIRD-PARTY-NOTICES.md in the package).",
  "dependencies": [],
  "registryDependencies": [],
  "files": [
    {
      "path": "src/core/progress-bar.ts",
      "type": "registry:lib",
      "target": "components/ui/core/progress-bar.ts",
      "content": "/**\n * Carbon `ProgressBar` rules: what the bar shows for a value, a maximum and a status. Shared by\n * `<ui-progress-bar>` and the React ProgressBar.\n */\nexport type ProgressBarStatus = 'active' | 'finished' | 'error';\n\n/**\n * The value the bar reports (Carbon): clamped to [0, max]; `error` empties it, `finished` fills\n * it; undefined while indeterminate (no value, or NaN).\n */\nexport function progressValue(value: number | undefined, max: number, status: ProgressBarStatus): number | undefined {\n    if (status === 'error') return 0;\n    if (status === 'finished') return max;\n    if (value === undefined || Number.isNaN(value)) return undefined;\n    return Math.min(Math.max(value, 0), max);\n}\n\n/** How much of the track is filled, 0–1 (0 while indeterminate or with no room). */\nexport function progressRatio(value: number | undefined, max: number): number {\n    return value === undefined || max <= 0 ? 0 : value / max;\n}\n"
    }
  ]
}
