add progress bar component and styling

This commit is contained in:
Novattz
2025-11-12 15:03:07 +01:00
parent 0a5f00d3fb
commit 9f3cf1cb1f
3 changed files with 62 additions and 1 deletions

View File

@@ -0,0 +1,22 @@
interface ProgressBarProps {
progress: number
}
/**
* Simple progress bar component
*/
const ProgressBar = ({ progress }: ProgressBarProps) => {
return (
<div className="progress-container">
<div className="progress-bar">
<div
className="progress-fill"
style={{ width: `${Math.min(progress, 100)}%` }}
/>
</div>
<span className="progress-text">{Math.round(progress)}%</span>
</div>
)
}
export default ProgressBar

View File

@@ -1,2 +1,2 @@
@forward './loading';
@forward './updater';
@forward './progress_bar';

View File

@@ -0,0 +1,39 @@
@use '../../themes/index' as *;
@use '../../abstracts/index' as *;
/*
Progress bar component styles
*/
.progress-container {
width: 100%;
max-width: 400px;
margin: 1.5rem auto;
display: flex;
flex-direction: column;
gap: 0.5rem;
align-items: center;
}
.progress-bar {
width: 100%;
height: 8px;
background: var(--border-dark);
border-radius: 4px;
overflow: hidden;
box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}
.progress-fill {
height: 100%;
background: var(--primary-color);
transition: width 0.3s ease;
border-radius: 4px;
position: relative;
}
.progress-text {
font-size: 0.9rem;
color: var(--text-secondary);
font-weight: var(--medium);
}