({label, ...props}: ProgressBarProps)
| 12 | } |
| 13 | |
| 14 | export function ProgressBar({label, ...props}: ProgressBarProps) { |
| 15 | return ( |
| 16 | <AriaProgressBar |
| 17 | {...props} |
| 18 | className={composeTailwindRenderProps( |
| 19 | props.className, |
| 20 | 'flex flex-col gap-2 font-sans w-64 max-w-full' |
| 21 | )}> |
| 22 | {({percentage, valueText, isIndeterminate}) => ( |
| 23 | <> |
| 24 | <div className="flex justify-between gap-2"> |
| 25 | <Label>{label}</Label> |
| 26 | <span className="text-sm text-neutral-600 dark:text-neutral-400">{valueText}</span> |
| 27 | </div> |
| 28 | <div className="max-w-full h-2 rounded-full bg-neutral-300 dark:bg-neutral-700 outline outline-1 -outline-offset-1 outline-transparent relative overflow-hidden"> |
| 29 | <div |
| 30 | className={`absolute top-0 h-full rounded-full bg-blue-500 forced-colors:bg-[Highlight] ${isIndeterminate ? 'left-full animate-in duration-1000 slide-in-from-left-[20rem] repeat-infinite ease-out' : 'left-0'}`} |
| 31 | style={{width: (isIndeterminate ? 40 : percentage) + '%'}} |
| 32 | /> |
| 33 | </div> |
| 34 | </> |
| 35 | )} |
| 36 | </AriaProgressBar> |
| 37 | ); |
| 38 | } |
nothing calls this directly
no test coverage detected