import React from "react"; import { Progress } from "./"; import type { TypeProgressProps } from "./ProgressTypes"; import type { Meta, StoryObj } from "@storybook/react"; const meta: Meta = { title: "Components/Progress", component: Progress, args: { value: 33, max: 100, "aria-label": "Credits remaining", }, argTypes: { value: { control: { type: "range", min: 0, max: 100, step: 1 } }, max: { control: { type: "number" } }, }, decorators: [ (Story) => (
), ], }; export default meta; type Story = StoryObj; export const Default: Story = { render: (args: TypeProgressProps) => , }; Default.storyName = "Default"; export const Empty: Story = { args: { value: 0, }, }; export const Full: Story = { args: { value: 100, }, }; export const CustomValueLabel: Story = { render: (args: TypeProgressProps) => { const getValueLabel = (value: number, max: number) => `${value} of ${max} credits remaining`; const label = getValueLabel(args.value, args.max ?? 100); return (

aria-valuetext: "{label}"

); }, args: { value: 33, max: 100, }, }; export const CustomGradient: Story = { args: { value: 67, indicatorStyle: { background: `radial-gradient( ellipse at left, rgba(32, 91, 195, 1) 0%, rgba(62, 86, 210, 1) 15%, rgba(92, 81, 225, 1) 30%, rgba(151, 71, 255, 1) 61%, rgba(197, 101, 250, 1) 80%, rgba(242, 130, 245, 1) 100% )`, }, }, }; export const CustomTrackAndIndicator: Story = { args: { value: 67, "aria-label": "Progress", trackStyle: { backgroundColor: "#F59E0B", }, indicatorStyle: { backgroundColor: "#059669", }, }, }; CustomTrackAndIndicator.storyName = "Custom Track and Indicator"; export const TailwindClassOverride: Story = { name: "🚀 Tailwind class override", render: (args: TypeProgressProps) => (
), args: { value: 50, max: 100, "aria-label": "Credits remaining", }, };