{
  "name": "progress",
  "type": "ui:component",
  "title": "Progress, ProgressRing & Skeleton",
  "description": "Determinate/indeterminate linear Progress bar, native SVG ProgressRing, and shimmer Skeleton placeholders for async function*.",
  "dependencies": [],
  "registryDependencies": [
    "theme"
  ],
  "files": [
    {
      "path": "src/ui/progress.tsx",
      "target": "src/ui/progress.tsx",
      "sha256": "f16ce024a508a0d593d3f9e56983b2fd1c68cc067eccb0603b23f340d45e1b56",
      "content": "import './theme.css';\nimport { scope } from '@fierst/aster';\n\nconst progScope = scope`\n  :scope {\n    display: grid;\n    gap: 0.35rem;\n    font-family: var(--aster-font-sans);\n  }\n  .prog-meta {\n    display: flex;\n    justify-content: space-between;\n    font-size: 0.82rem;\n    color: var(--aster-on-surface-variant);\n  }\n  .prog-val { font-family: var(--aster-font-mono); font-weight: 600; color: var(--aster-on-surface); }\n  .track {\n    position: relative;\n    height: 8px;\n    border-radius: var(--aster-radius-full);\n    background: var(--aster-primary-container);\n    overflow: hidden;\n  }\n  .fill {\n    height: 100%;\n    border-radius: var(--aster-radius-full);\n    background: var(--aster-primary);\n    transition: width var(--aster-dur-med) var(--aster-ease-spring);\n  }\n  .fill.is-indeterminate {\n    width: 38%;\n    animation: aster-indet 1.25s var(--aster-ease-standard) infinite;\n  }\n  @keyframes aster-indet {\n    0% { transform: translateX(-110%); }\n    100% { transform: translateX(300%); }\n  }\n`;\n\nexport function Progress({\n  value,\n  max = 100,\n  label,\n  showValue = false,\n  class: extraClass,\n}: {\n  value?: number;\n  max?: number;\n  label?: string;\n  showValue?: boolean;\n  class?: string;\n}) {\n  max = Number.isFinite(max) && max > 0 ? max : 100;\n  const indeterminate = value === undefined || !Number.isFinite(value);\n  const current = indeterminate ? undefined : Math.max(0, Math.min(max, value));\n  const pct = ((current ?? 0) / max) * 100;\n\n  return (\n    <div class={[progScope, extraClass].filter(Boolean).join(' ')}>\n      {label || (showValue && !indeterminate) ? (\n        <div class=\"prog-meta\">\n          <span>{label ?? ''}</span>\n          {showValue && !indeterminate ? <span class=\"prog-val\">{Math.round(pct)}%</span> : null}\n        </div>\n      ) : null}\n      <div\n        class=\"track\"\n        role=\"progressbar\"\n        aria-label={label ?? 'Progress'}\n        aria-valuemin={0}\n        aria-valuemax={max}\n        aria-valuenow={current}\n      >\n        <div\n          class=\"fill\"\n          class:is-indeterminate={indeterminate}\n          style={indeterminate ? undefined : { width: `${pct}%` }}\n        />\n      </div>\n    </div>\n  );\n}\n\nconst ringScope = scope`\n  :scope {\n    position: relative;\n    display: inline-grid;\n    place-items: center;\n  }\n  svg { transform: rotate(-90deg); }\n  .bg-ring { stroke: var(--aster-primary-container); fill: none; }\n  .fg-ring {\n    stroke: var(--aster-primary);\n    fill: none;\n    stroke-linecap: round;\n    transition: stroke-dashoffset var(--aster-dur-med) var(--aster-ease-spring);\n  }\n  .ring-label {\n    position: absolute;\n    font-family: var(--aster-font-mono);\n    font-size: 0.74rem;\n    font-weight: 650;\n    color: var(--aster-on-surface);\n  }\n`;\n\nexport function ProgressRing({\n  value,\n  size = 52,\n  strokeWidth = 5,\n  showLabel = true,\n  label = 'Progress',\n  class: extraClass,\n}: {\n  value: number;\n  size?: number;\n  strokeWidth?: number;\n  showLabel?: boolean;\n  label?: string;\n  class?: string;\n}) {\n  const clamped = Math.max(0, Math.min(100, Number.isFinite(value) ? value : 0));\n  const r = (size - strokeWidth) / 2;\n  const c = 2 * Math.PI * r;\n  const offset = c * (1 - clamped / 100);\n\n  return (\n    <div\n      aria-label={label}\n      class={[ringScope, extraClass].filter(Boolean).join(' ')}\n      role=\"progressbar\"\n      aria-valuemin={0}\n      aria-valuemax={100}\n      aria-valuenow={Math.round(clamped)}\n      style={{ width: `${size}px`, height: `${size}px` }}\n    >\n      <svg width={size} height={size} viewBox={`0 0 ${size} ${size}`} aria-hidden=\"true\">\n        <circle class=\"bg-ring\" cx={size / 2} cy={size / 2} r={r} stroke-width={strokeWidth} />\n        <circle\n          class=\"fg-ring\"\n          cx={size / 2}\n          cy={size / 2}\n          r={r}\n          stroke-width={strokeWidth}\n          stroke-dasharray={c}\n          stroke-dashoffset={offset}\n        />\n      </svg>\n      {showLabel ? <span class=\"ring-label\">{Math.round(clamped)}%</span> : null}\n    </div>\n  );\n}\n\nconst skelScope = scope`\n  :scope {\n    display: block;\n    background: linear-gradient(\n      90deg,\n      var(--aster-surface-low) 25%,\n      var(--aster-surface-high) 50%,\n      var(--aster-surface-low) 75%\n    );\n    background-size: 200% 100%;\n    animation: aster-shimmer 1.4s ease-in-out infinite;\n    border-radius: var(--aster-radius-sm);\n  }\n  :scope.shape-circle { border-radius: var(--aster-radius-full); }\n  :scope.shape-pill { border-radius: var(--aster-radius-full); }\n  @keyframes aster-shimmer {\n    0% { background-position: 200% 0; }\n    100% { background-position: -200% 0; }\n  }\n`;\n\nexport function Skeleton({\n  width = '100%',\n  height = '1rem',\n  shape = 'rect',\n  class: extraClass,\n}: {\n  width?: string;\n  height?: string;\n  shape?: 'rect' | 'pill' | 'circle';\n  class?: string;\n}) {\n  return (\n    <span\n      aria-hidden=\"true\"\n      class={[skelScope, shape !== 'rect' ? `shape-${shape}` : '', extraClass]\n        .filter(Boolean)\n        .join(' ')}\n      style={{ width, height }}\n    />\n  );\n}\n"
    }
  ]
}
