|
1
|
import { motion } from "motion/react" |
|
2
|
|
|
3
|
interface ProgressBarProps { |
|
4
|
/** |
|
5
|
* The duration of the animation in seconds. |
|
6
|
* |
|
7
|
* @default 2 |
|
8
|
*/ |
|
9
|
duration?: number |
|
10
|
} |
|
11
|
|
|
12
|
export const ProgressBar = ({ duration = 2 }: ProgressBarProps) => { |
|
13
|
return ( |
|
14
|
<motion.div |
|
15
|
className="bg-ui-fg-subtle size-full" |
|
16
|
initial={{ |
|
17
|
width: "0%", |
|
18
|
}} |
|
19
|
transition={{ |
|
20
|
delay: 0.2, |
|
21
|
duration, |
|
22
|
ease: "linear", |
|
23
|
}} |
|
24
|
animate={{ |
|
25
|
width: "90%", |
|
26
|
}} |
|
27
|
exit={{ |
|
28
|
width: "100%", |
|
29
|
transition: { duration: 0.2, ease: "linear" }, |
|
30
|
}} |
|
31
|
/> |
|
32
|
) |
|
33
|
} |