fix: Progress Bar widget animation inconsistency (#11915) (#32462)

## Description
- Fixed the issue where the animation of the progress bar wouldn't work
if the value was going from zero or going to zero.
- Made the animation consistent even when the introduced value is less
than zero.

Fixes #11915

## Automation

/ok-to-test tags=""

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!CAUTION]  
> If you modify the content in this section, you are likely to disrupt
the CI result for your PR.

<!-- end of auto-generated comment: Cypress test results  -->

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit


- **Bug Fixes**
- Improved the `ProgressWidget` to correctly handle negative progress
values by ensuring the progress bar width is never negative.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
Afonso Ribeiro 2024-04-29 12:20:05 +01:00 committed by GitHub
parent 6dfc093541
commit ac3500a2ae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -149,7 +149,7 @@ const DeterminateLinearProgress = styled.div<{
&:after {
background: ${({ fillColor }) => fillColor};
${({ value }) => value && `width: ${value}%`};
${({ value }) => value !== undefined && `width: ${Math.max(0, value)}%;`}
transition: width 0.4s ease;
position: absolute;
content: "";