-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c1dde6b
commit 4ce474a
Showing
8 changed files
with
148 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@zenml-io/react-component-library": minor | ||
--- | ||
|
||
add radial progress & progress bar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { Meta } from "@storybook/react"; | ||
import { ProgressBar } from "./index"; | ||
import { StoryObj } from "@storybook/react"; | ||
import React from "react"; | ||
|
||
const meta = { | ||
title: "Elements/Progress/ProgressBar", | ||
component: ProgressBar, | ||
|
||
parameters: { | ||
layout: "centered" | ||
}, | ||
decorators: [ | ||
(Story) => ( | ||
<div className="w-[400px] h-[200px]"> | ||
<Story /> | ||
</div> | ||
) | ||
], | ||
tags: ["autodocs"] | ||
} satisfies Meta<typeof ProgressBar>; | ||
|
||
export default meta; | ||
|
||
type Story = StoryObj<typeof meta>; | ||
|
||
export const DefaultVariant: Story = { | ||
name: "Default", | ||
args: { | ||
className: "rounded-rounded", | ||
value: 45 | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import * as ProgressPrimitive from "@radix-ui/react-progress"; | ||
import React, { ComponentPropsWithoutRef, ElementRef, forwardRef } from "react"; | ||
import { cn } from "../../utilities"; | ||
|
||
const ProgressBar = forwardRef< | ||
ElementRef<typeof ProgressPrimitive.Root>, | ||
ComponentPropsWithoutRef<typeof ProgressPrimitive.Root> | ||
>(({ className, value, ...props }, ref) => ( | ||
<ProgressPrimitive.Root | ||
ref={ref} | ||
className={cn("rounded-full relative h-4 w-full overflow-hidden bg-primary-50", className)} | ||
{...props} | ||
> | ||
<ProgressPrimitive.Indicator | ||
className="h-full w-full flex-1 bg-primary-400 transition-all" | ||
style={{ transform: `translateX(-${100 - (value || 0)}%)` }} | ||
/> | ||
</ProgressPrimitive.Root> | ||
)); | ||
ProgressBar.displayName = ProgressPrimitive.Root.displayName; | ||
|
||
export { ProgressBar }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { Meta } from "@storybook/react"; | ||
import { RadialProgress } from "./index"; | ||
import { StoryObj } from "@storybook/react"; | ||
|
||
const meta = { | ||
title: "Elements/Progress/Radial Progress", | ||
component: RadialProgress, | ||
|
||
parameters: { | ||
layout: "centered" | ||
}, | ||
tags: ["autodocs"] | ||
} satisfies Meta<typeof RadialProgress>; | ||
|
||
export default meta; | ||
|
||
type Story = StoryObj<typeof meta>; | ||
|
||
export const DefaultVariant: Story = { | ||
name: "Default", | ||
args: { | ||
value: 45 | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from "./ProgressItems"; | ||
export * from "./ProgressBar"; |