diff --git a/.changeset/fair-dolls-cheat.md b/.changeset/fair-dolls-cheat.md new file mode 100644 index 0000000..c1c48f3 --- /dev/null +++ b/.changeset/fair-dolls-cheat.md @@ -0,0 +1,5 @@ +--- +"@zenml-io/react-component-library": minor +--- + +add progressTick and progressOutstanding diff --git a/src/components/Progress/ProgressItems.stories.tsx b/src/components/Progress/ProgressItems.stories.tsx new file mode 100644 index 0000000..50ff3b2 --- /dev/null +++ b/src/components/Progress/ProgressItems.stories.tsx @@ -0,0 +1,90 @@ +import { Meta } from "@storybook/react"; +import { StoryObj } from "@storybook/react"; +import { ProgressOutstanding, ProgressTick, progressTickVariants } from "./index"; +import React from "react"; + +const meta = { + title: "Elements/Progress", + component: ProgressOutstanding, + parameters: { + layout: "centered" + }, + argTypes: { + size: { + description: "defining the size of the Item", + control: "select", + defaultValue: "sm", + options: ["sm", "md"] + } + }, + decorators: [ + (Story) => ( +
+ +
+ ) + ], + + tags: ["autodocs"] +} satisfies Meta; + +export default meta; + +type Story = StoryObj; + +export const DefaultVariant: Story = { + name: "Default", + args: { + size: "sm" + }, + render: ({ size }) => ( + <> + + + + + + + + ) +}; + +export const TickStory: Story = { + name: "Progress Tick", + args: { + size: "md" + }, + render: ({ size }) => ( + + + + + + ) +}; + +export const OutstandingStory: Story = { + name: "Progress Outstanding", + args: { + size: "md" + }, + render: ({ size }) => +}; diff --git a/src/components/Progress/ProgressItems.tsx b/src/components/Progress/ProgressItems.tsx new file mode 100644 index 0000000..f2f57a2 --- /dev/null +++ b/src/components/Progress/ProgressItems.tsx @@ -0,0 +1,66 @@ +import React, { HTMLAttributes } from "react"; +import { cn } from "../../utilities"; +import { cva, VariantProps } from "class-variance-authority"; + +export const progressTickCircleVariants = cva( + "shrink-0 flex items-center justify-center rounded-rounded border-success-300 bg-success-50", + { + variants: { + size: { + sm: "h-[28px] w-[28px] border-2", + md: "h-7 w-7 border-4" + } + }, + defaultVariants: { + size: "sm" + } + } +); + +export const progressTickVariants = cva("fill-success-300", { + variants: { + size: { + sm: "h-3 w-3", + md: "h-[28px] w-[28px]" + } + }, + defaultVariants: { + size: "sm" + } +}); + +export function ProgressTick({ + className, + children, + size, + ...rest +}: HTMLAttributes & VariantProps) { + return ( +
+ {children} +
+ ); +} + +export const progressOutstandingVariants = cva( + "rounded-rounded border-dashed border-neutral-300 bg-theme-surface-tertiary", + { + variants: { + size: { + sm: "h-[28px] w-[28px] border-2", + md: "h-7 w-7 border-4" + } + }, + defaultVariants: { + size: "sm" + } + } +); + +export function ProgressOutstanding({ + className, + size, + ...rest +}: HTMLAttributes & VariantProps) { + return
; +} diff --git a/src/components/Progress/index.tsx b/src/components/Progress/index.tsx new file mode 100644 index 0000000..7458a51 --- /dev/null +++ b/src/components/Progress/index.tsx @@ -0,0 +1 @@ +export * from "./ProgressItems"; diff --git a/src/components/index.ts b/src/components/index.ts index fd70e9c..c0d3cd4 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -16,3 +16,4 @@ export * from "./Tooltip"; export * from "./Checkbox"; export * from "./Toast"; export * from "./Dialog"; +export * from "./Progress";