import React from 'react' import { type Meta, type StoryObj } from '@storybook/react' import { ProgressBar, type ProgressBarProps } from '../index' const meta = { title: 'Components/ProgressBar', component: ProgressBar, args: { value: 25, max: 100, color: 'green', isAnimating: false, label: '25%', isReversed: false, }, parameters: { a11y: { config: { rules: [ { // `label` is an optional prop so this has no accessible by default. consumers can pass in `aria-labelledby` or `aria-label` which can provide an accessible description pending a refactor. id: 'aria-progressbar-name', enabled: false, }, ], }, }, }, } satisfies Meta export default meta type Story = StoryObj export const Playground: Story = { parameters: { docs: { canvas: { sourceState: 'shown', }, }, }, } const colors = [ { title: 'Blue', props: { color: 'blue' }, }, { title: 'Green', props: { color: 'green' }, }, { title: 'Red', props: { color: 'red' }, }, { title: 'Yellow', props: { color: 'yellow' }, }, ] satisfies { title: string; props: Partial }[] export const Colors: Story = { render: () => (
{colors.map(({ title, props }) => ( ))}
), } export const IsAnimating: Story = { args: { isAnimating: true }, } export const ValueAndMax: Story = { render: () => (
), } export const Reversed: Story = { parameters: { backgrounds: { default: 'Purple 700' }, }, args: { isReversed: true }, } export const AccessibleName: Story = { args: { 'aria-label': 'Development goals' }, }