diff --git a/packages/ui/src/components/progress.tsx b/packages/ui/src/components/progress.tsx index 0cc75e45..446ab746 100644 --- a/packages/ui/src/components/progress.tsx +++ b/packages/ui/src/components/progress.tsx @@ -4,28 +4,50 @@ import { cn } from '../lib/cn'; interface ProgressProps extends React.HTMLAttributes { value?: number; indicatorClassName?: string; + /** + * When true, the bar shows an animated marquee instead of a fixed + * width — useful when we know a job is running but don't yet know + * the total size (e.g. a download whose Content-Length is unknown). + */ + indeterminate?: boolean; } const Progress = React.forwardRef( - ({ className, value = 0, indicatorClassName, ...props }, ref) => { + ({ className, value = 0, indicatorClassName, indeterminate = false, ...props }, ref) => { const clamped = Math.max(0, Math.min(100, value)); return (
-
+ {indeterminate ? ( +
+ ) : ( +
+ )}
); - } + }, ); Progress.displayName = 'Progress'; diff --git a/packages/ui/src/styles/theme.css b/packages/ui/src/styles/theme.css index 23dd490a..1e02b17f 100644 --- a/packages/ui/src/styles/theme.css +++ b/packages/ui/src/styles/theme.css @@ -247,3 +247,12 @@ -webkit-backdrop-filter: saturate(180%) blur(12px); } } + +@keyframes progress-marquee { + 0% { + transform: translateX(-100%); + } + 100% { + transform: translateX(400%); + } +}