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';
|
2026-02-05 21:31:35 +00:00
|
|
|
import {
|
|
|
|
|
OptimizedImage,
|
|
|
|
|
OptimizedImageSkeleton,
|
|
|
|
|
} from '@/components/ui/optimized-image';
|
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
|
|
|
|
2026-02-12 23:32:08 +00:00
|
|
|
const meta: Meta = {
|
2026-02-05 21:31:35 +00:00
|
|
|
title: 'UI/OptimizedImage',
|
|
|
|
|
component: OptimizedImage,
|
|
|
|
|
tags: ['autodocs'],
|
|
|
|
|
argTypes: {
|
|
|
|
|
width: { control: 'number' },
|
|
|
|
|
height: { control: 'number' },
|
|
|
|
|
priority: { control: 'boolean' },
|
|
|
|
|
},
|
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 = {
|
2026-02-05 21:31:35 +00:00
|
|
|
args: {
|
|
|
|
|
src: 'https://images.unsplash.com/photo-1707343843437-caacff5cfa74',
|
|
|
|
|
alt: 'Example Image',
|
|
|
|
|
width: 600,
|
|
|
|
|
height: 400,
|
|
|
|
|
className: 'rounded-lg object-cover',
|
|
|
|
|
},
|
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 const WithPlaceholder: Story = {
|
2026-02-05 21:31:35 +00:00
|
|
|
args: {
|
|
|
|
|
src: 'https://images.unsplash.com/photo-1682687220063-4742bd7fd538',
|
|
|
|
|
alt: 'Loading Image',
|
|
|
|
|
width: 600,
|
|
|
|
|
height: 400,
|
|
|
|
|
className: 'rounded-lg object-cover',
|
2026-02-12 01:09:29 +00:00
|
|
|
placeholder: <span className="text-foreground">Loading...</span>,
|
2026-02-05 21:31:35 +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 const ErrorState: Story = {
|
2026-02-05 21:31:35 +00:00
|
|
|
args: {
|
|
|
|
|
src: 'https://invalid-url.com/image.jpg',
|
|
|
|
|
alt: 'Broken Image',
|
|
|
|
|
width: 600,
|
|
|
|
|
height: 400,
|
|
|
|
|
className: 'rounded-lg bg-red-100',
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const Loading: Story = {
|
|
|
|
|
render: () => (
|
|
|
|
|
<OptimizedImageSkeleton
|
|
|
|
|
width={600}
|
|
|
|
|
height={400}
|
|
|
|
|
className="min-h-layout-story"
|
|
|
|
|
/>
|
|
|
|
|
),
|
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
|
|
|
};
|