feat(storybook): complete UI component coverage (batches 6-9)
- Batch 6: FAB, FormField, FloatingInput, AvatarUpload
- Batch 7: Modal, ConfirmationDialog, ImageViewerModal, ErrorDisplay, LoadingState
- Batch 8: DataList, WaveformVisualizer, OptimizedImage, VirtualizedList
- Batch 9: ImageCropper, LoadingSpinner, FocusTrap
- Achieved total coverage for src/components/ui
2026-02-02 18:50:45 +00:00
|
|
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
|
|
|
import { WaveformVisualizer } from './WaveformVisualizer';
|
|
|
|
|
import { useState } from 'react';
|
|
|
|
|
|
2026-02-12 23:32:08 +00:00
|
|
|
const meta: Meta = {
|
feat(storybook): complete UI component coverage (batches 6-9)
- Batch 6: FAB, FormField, FloatingInput, AvatarUpload
- Batch 7: Modal, ConfirmationDialog, ImageViewerModal, ErrorDisplay, LoadingState
- Batch 8: DataList, WaveformVisualizer, OptimizedImage, VirtualizedList
- Batch 9: ImageCropper, LoadingSpinner, FocusTrap
- Achieved total coverage for src/components/ui
2026-02-02 18:50:45 +00:00
|
|
|
title: 'UI/WaveformVisualizer',
|
|
|
|
|
component: WaveformVisualizer,
|
|
|
|
|
tags: ['autodocs'],
|
|
|
|
|
argTypes: {
|
|
|
|
|
progress: { control: { type: 'range', min: 0, max: 100 } },
|
|
|
|
|
height: { control: 'number' },
|
|
|
|
|
color: { control: 'color' },
|
|
|
|
|
playedColor: { control: 'color' },
|
|
|
|
|
},
|
|
|
|
|
decorators: [
|
|
|
|
|
(Story) => (
|
2026-02-07 14:10:32 +00:00
|
|
|
<div className="bg-card p-6 rounded-lg">
|
feat(storybook): complete UI component coverage (batches 6-9)
- Batch 6: FAB, FormField, FloatingInput, AvatarUpload
- Batch 7: Modal, ConfirmationDialog, ImageViewerModal, ErrorDisplay, LoadingState
- Batch 8: DataList, WaveformVisualizer, OptimizedImage, VirtualizedList
- Batch 9: ImageCropper, LoadingSpinner, FocusTrap
- Achieved total coverage for src/components/ui
2026-02-02 18:50:45 +00:00
|
|
|
<Story />
|
|
|
|
|
</div>
|
|
|
|
|
),
|
|
|
|
|
],
|
2026-02-12 23:32:08 +00:00
|
|
|
};
|
feat(storybook): complete UI component coverage (batches 6-9)
- Batch 6: FAB, FormField, FloatingInput, AvatarUpload
- Batch 7: Modal, ConfirmationDialog, ImageViewerModal, ErrorDisplay, LoadingState
- Batch 8: DataList, WaveformVisualizer, OptimizedImage, VirtualizedList
- Batch 9: ImageCropper, LoadingSpinner, FocusTrap
- Achieved total coverage for src/components/ui
2026-02-02 18:50:45 +00:00
|
|
|
|
|
|
|
|
export default meta;
|
|
|
|
|
type Story = StoryObj<typeof meta>;
|
|
|
|
|
|
|
|
|
|
export const Default: Story = {
|
|
|
|
|
render: (args) => {
|
|
|
|
|
const [progress, setProgress] = useState(30);
|
|
|
|
|
return (
|
|
|
|
|
<WaveformVisualizer
|
|
|
|
|
{...args}
|
|
|
|
|
progress={progress}
|
|
|
|
|
onSeek={setProgress}
|
|
|
|
|
/>
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const CustomColors: Story = {
|
|
|
|
|
args: {
|
|
|
|
|
progress: 60,
|
|
|
|
|
color: '#333',
|
|
|
|
|
playedColor: '#ff0055',
|
|
|
|
|
height: 100,
|
|
|
|
|
},
|
|
|
|
|
render: (args) => {
|
|
|
|
|
const [progress, setProgress] = useState(args.progress);
|
|
|
|
|
return (
|
|
|
|
|
<WaveformVisualizer
|
|
|
|
|
{...args}
|
|
|
|
|
progress={progress}
|
|
|
|
|
onSeek={setProgress}
|
|
|
|
|
/>
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const CustomData: Story = {
|
|
|
|
|
render: () => {
|
|
|
|
|
const [progress, setProgress] = useState(45);
|
|
|
|
|
// Generate sine wave data
|
|
|
|
|
const data = Array.from({ length: 50 }, (_, i) =>
|
|
|
|
|
(Math.sin(i * 0.5) + 1) / 2
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<WaveformVisualizer
|
|
|
|
|
progress={progress}
|
|
|
|
|
onSeek={setProgress}
|
|
|
|
|
waveformData={data}
|
|
|
|
|
height={120}
|
|
|
|
|
/>
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
};
|