import { progressPropDefs } from "@radix-ui/themes/props" import type { Meta, StoryObj } from "@storybook/react" import { Progress } from "./Progress" /** * The Progress component displays the completion progress of a task. * It can be used to show loading states, form completion, or any other progress indicator. */ const meta = { title: "base/components/Progress", component: Progress, parameters: { layout: "centered", }, tags: ["autodocs"], argTypes: { size: { control: { type: "select" }, options: progressPropDefs.size.values, }, variant: { control: { type: "select" }, options: progressPropDefs.variant.values, }, color: { control: { type: "select" }, options: progressPropDefs.color.values, }, radius: { control: { type: "select" }, options: progressPropDefs.radius.values, }, value: { control: { type: "range", min: 0, max: 100, step: 1 }, }, }, } satisfies Meta export default meta type Story = StoryObj /** * Default progress component with 50% completion. */ export const Default: Story = { args: { value: 50, }, render: args => (
), } /** * Different sizes of progress bars. */ export const Sizes: Story = { render: args => (
{progressPropDefs.size.values.map(size => (
{`Size ${size}`}
))}
), } /** * Different variants of progress bars. */ export const Variants: Story = { render: args => (
{progressPropDefs.variant.values.map(variant => (
{variant}
))}
), } /** * Progress bars with different colors. */ export const Colors: Story = { render: args => (
{progressPropDefs.color.values.map(color => (
{color}
))}
), } /** * Progress bars with different corner radii. */ export const Radius: Story = { render: args => (
{progressPropDefs.radius.values.map(radius => (
{radius}
))}
), }