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 { ImageViewerModal } from './ImageViewerModal';
|
|
|
|
|
import { Button } from './button';
|
|
|
|
|
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/ImageViewerModal',
|
|
|
|
|
component: ImageViewerModal,
|
|
|
|
|
tags: ['autodocs'],
|
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: () => {
|
|
|
|
|
const [open, setOpen] = useState(false);
|
|
|
|
|
const image = "https://images.unsplash.com/photo-1682687220742-aba13b6e50ba";
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
<Button onClick={() => setOpen(true)}>View Image</Button>
|
|
|
|
|
{open && (
|
|
|
|
|
<ImageViewerModal
|
|
|
|
|
src={image}
|
|
|
|
|
alt="Nature Landscape"
|
|
|
|
|
onClose={() => setOpen(false)}
|
|
|
|
|
/>
|
|
|
|
|
)}
|
|
|
|
|
</>
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const Gallery: Story = {
|
|
|
|
|
render: () => {
|
|
|
|
|
const [open, setOpen] = useState(false);
|
|
|
|
|
const [index, setIndex] = useState(0);
|
|
|
|
|
const images = [
|
|
|
|
|
"https://images.unsplash.com/photo-1682687220742-aba13b6e50ba",
|
|
|
|
|
"https://images.unsplash.com/photo-1682687220063-4742bd7fd538",
|
|
|
|
|
"https://images.unsplash.com/photo-1682687220199-d0124f48f95b"
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
<Button onClick={() => setOpen(true)}>Open Gallery</Button>
|
|
|
|
|
{open && (
|
|
|
|
|
<ImageViewerModal
|
2026-02-12 23:32:08 +00:00
|
|
|
src={images[index] ?? ''}
|
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
|
|
|
alt={`Gallery Image ${index + 1}`}
|
|
|
|
|
onClose={() => setOpen(false)}
|
|
|
|
|
hasNext={index < images.length - 1}
|
|
|
|
|
hasPrev={index > 0}
|
|
|
|
|
onNext={() => setIndex(i => i + 1)}
|
|
|
|
|
onPrev={() => setIndex(i => i - 1)}
|
feat(ui): badge polish, DnD feedback, typography system, image lightbox
Badge component:
- Dismissible variant with X button (onDismiss prop)
- Pulse animation variant (pulse prop)
- Enhanced dot-only mode for standalone colored circles
Drag-and-drop visual feedback:
- PlaylistTrackListSortableItem: opacity + shadow + ring on drag, border insertion line
- QueueView: dragOverIndex tracking, bg-primary/5 drop zone highlight
- PlaylistDetailView: same DnD feedback pattern
Typography standardization:
- 9 utility classes: text-display, text-heading-1..4, text-body-lg, text-body, text-caption, text-label
- Applied to 8 page headings (Dashboard, Settings, Library, Search, etc.)
- DESIGN_TOKENS.md updated with typography reference
Image lightbox:
- Keyboard navigation: ArrowLeft/Right for gallery, Escape to close
- Image counter pill: "2 / 5" with backdrop-blur
- Zoom toggle: click to zoom in/out with scale transition
- Loading skeleton: pulse placeholder while image loads
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-09 22:52:33 +00:00
|
|
|
currentIndex={index + 1}
|
|
|
|
|
totalImages={images.length}
|
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
|
|
|
/>
|
|
|
|
|
)}
|
|
|
|
|
</>
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
};
|