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 { Modal } from './modal';
|
|
|
|
|
import { Button } from './button';
|
|
|
|
|
import { useState } from 'react';
|
|
|
|
|
|
|
|
|
|
const meta = {
|
|
|
|
|
title: 'UI/Modal',
|
|
|
|
|
component: Modal,
|
|
|
|
|
tags: ['autodocs'],
|
|
|
|
|
argTypes: {
|
|
|
|
|
size: {
|
|
|
|
|
control: 'select',
|
|
|
|
|
options: ['sm', 'md', 'lg', 'xl', 'full'],
|
|
|
|
|
},
|
|
|
|
|
clickOutsideToClose: { control: 'boolean' },
|
|
|
|
|
},
|
|
|
|
|
} satisfies Meta<typeof Modal>;
|
|
|
|
|
|
|
|
|
|
export default meta;
|
|
|
|
|
type Story = StoryObj<typeof meta>;
|
|
|
|
|
|
|
|
|
|
export const Default: Story = {
|
|
|
|
|
render: (args) => {
|
|
|
|
|
const [open, setOpen] = useState(false);
|
|
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
<Button onClick={() => setOpen(true)}>Open Modal</Button>
|
|
|
|
|
<Modal {...args} open={open} onClose={() => setOpen(false)} title="Example Modal">
|
|
|
|
|
<div className="py-4">
|
refactor: Phase 3a — Global color class migration to SUMI semantics
- Replace all kodo-* color classes across ~100 TSX files:
kodo-void → background, kodo-ink → card, kodo-graphite → muted,
kodo-steel → muted-foreground, kodo-cyan → primary, kodo-magenta → destructive,
kodo-lime → success, kodo-red → destructive, kodo-gold → warning
- Replace cyan-500, magenta-500, lime-500 default Tailwind colors with
semantic equivalents (primary, destructive, success)
- Fix WaveformVisualizer hardcoded hex colors to SUMI values
- Delete global-effects.css (conflicting, redundant with index.css)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 00:51:49 +00:00
|
|
|
<p className="text-muted-foreground">
|
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
|
|
|
This is a standard modal dialog. It can contain any content.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</Modal>
|
|
|
|
|
</>
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const WithFooter: Story = {
|
|
|
|
|
render: (args) => {
|
|
|
|
|
const [open, setOpen] = useState(false);
|
|
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
<Button onClick={() => setOpen(true)}>Modal with Footer</Button>
|
|
|
|
|
<Modal
|
|
|
|
|
{...args}
|
|
|
|
|
open={open}
|
|
|
|
|
onClose={() => setOpen(false)}
|
|
|
|
|
title="Confirmation"
|
|
|
|
|
footer={
|
|
|
|
|
<>
|
|
|
|
|
<Button variant="ghost" onClick={() => setOpen(false)}>Cancel</Button>
|
|
|
|
|
<Button onClick={() => setOpen(false)}>Confirm</Button>
|
|
|
|
|
</>
|
|
|
|
|
}
|
|
|
|
|
>
|
|
|
|
|
<p className="text-white">Are you sure you want to proceed?</p>
|
|
|
|
|
</Modal>
|
|
|
|
|
</>
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
};
|