Skip to content

Commit

Permalink
Merge pull request #49 from bleu-fi/joao/click-629-implement-onboardi…
Browse files Browse the repository at this point in the history
…ng-flow

Add progress component
  • Loading branch information
luizakp authored Apr 3, 2024
2 parents 93abee9 + d8fb861 commit c15b6df
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/components/ui/Progress.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import * as ProgressPrimitive from "@radix-ui/react-progress";
import * as React from "react";

import { cn } from "#/lib/utils";

const Progress = React.forwardRef<
React.ElementRef<typeof ProgressPrimitive.Root>,
React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>
>(({ className, value, ...props }, ref) => (
<ProgressPrimitive.Root
ref={ref}
className={cn(
"relative h-4 w-full overflow-hidden rounded-full bg-secondary",
className
)}
{...props}
>
<ProgressPrimitive.Indicator
className="size-full flex-1 bg-primary transition-all"
style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
/>
</ProgressPrimitive.Root>
));
Progress.displayName = ProgressPrimitive.Root.displayName;

export { Progress };
1 change: 1 addition & 0 deletions src/components/ui/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@ export * from "./Textarea";
export * from "./Tooltip";
export * from "./Toast";
export * from "./Toaster";
export * from "./Progress";
export * from "./Spinner";
export * from "./KpiCard";

0 comments on commit c15b6df

Please sign in to comment.