(props: AriaProgressBarProps)
| 5 | import './Form.css'; |
| 6 | |
| 7 | export function ProgressBar(props: AriaProgressBarProps) { |
| 8 | let {label, value = 0, minValue = 0, maxValue = 100, isIndeterminate} = props; |
| 9 | /*- begin highlight -*/ |
| 10 | let {progressBarProps, labelProps} = useProgressBar(props); |
| 11 | /*- end highlight -*/ |
| 12 | |
| 13 | // Calculate the width of the progress fill as a percentage. |
| 14 | let percentage = ((value - minValue) / (maxValue - minValue)) * 100; |
| 15 | |
| 16 | return ( |
| 17 | <div {...progressBarProps} className="react-aria-ProgressBar"> |
| 18 | <label className="react-aria-Label" {...labelProps}> |
| 19 | {label} |
| 20 | </label> |
| 21 | <span className="value">{progressBarProps['aria-valuetext']}</span> |
| 22 | <div className="track inset"> |
| 23 | <div |
| 24 | className="fill" |
| 25 | style={ |
| 26 | {'--percent': (isIndeterminate ? 100 : percentage) + '%'} as CSSProperties & { |
| 27 | '--percent': string; |
| 28 | } |
| 29 | } |
| 30 | /> |
| 31 | </div> |
| 32 | </div> |
| 33 | ); |
| 34 | } |
nothing calls this directly
no test coverage detected