| 15 | >; |
| 16 | |
| 17 | export const Progress = <T extends ValidComponent = "div">( |
| 18 | props: PolymorphicProps<T, progressProps<T>>, |
| 19 | ) => { |
| 20 | const [local, rest] = splitProps(props as progressProps, [ |
| 21 | "class", |
| 22 | "children", |
| 23 | ]); |
| 24 | |
| 25 | return ( |
| 26 | <ProgressPrimitive |
| 27 | class={cn("flex w-full flex-col gap-2", local.class)} |
| 28 | {...rest} |
| 29 | > |
| 30 | {local.children} |
| 31 | <ProgressPrimitive.Track class="h-2 overflow-hidden rounded-full bg-primary/20"> |
| 32 | <ProgressPrimitive.Fill class="h-full w-[--kb-progress-fill-width] bg-primary transition-all duration-500 ease-linear data-[progress=complete]:bg-primary" /> |
| 33 | </ProgressPrimitive.Track> |
| 34 | </ProgressPrimitive> |
| 35 | ); |
| 36 | }; |