import type { Meta, StoryObj } from "@storybook/react-vite"; import { ProgressBar } from "@shared/components/ProgressBar"; const meta: Meta = { title: "Primitives/ProgressBar", component: ProgressBar, tags: ["autodocs"], parameters: { layout: "padded" }, args: { value: 0.5, height: 6, thresholded: false }, argTypes: { value: { control: { type: "range", min: 0, max: 1, step: 0.01 } }, height: { control: { type: "number" } }, thresholded: { control: "boolean" }, }, decorators: [ (S) => (
), ], }; export default meta; type Story = StoryObj; /** Drag the value slider, toggle thresholded, change height in controls. */ export const Playground: Story = {}; export const ThresholdLadder: Story = { render: () => (
{[0, 0.25, 0.5, 0.79, 0.85, 0.95, 0.98, 1].map((v) => (
{Math.round(v * 100)}%
))}
), }; export const InContext_UsageMeter: Story = { decorators: [ (S) => (
), ], render: () => (
Docs processed 412 / 500
Approaching the free-plan cap
), };