- Bulk replace text-white → text-foreground across 116 component files (preserving text-white/ opacity variants) - Remove hover-glow-cyan, shadow-card-glow-cyan, shadow-button-primary-glow classes from all components - Replace --duration-normal/--duration-immersive/--duration-slow with --sumi-duration-normal/--sumi-duration-slow across 130+ files - Replace --ease-out/--ease-in-out with --sumi-ease-out/--sumi-ease-in-out - Replace focus:ring-blue-500 → focus:ring-primary (4 files) - Remove hover:scale-105/110 and hover:-translate-y-1/0.5 transforms (SUMI anti-pattern: no scale on hover) - Clean up stale kodo- references in comments Co-authored-by: Cursor <cursoragent@cursor.com>
63 lines
2 KiB
TypeScript
63 lines
2 KiB
TypeScript
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">
|
|
<p className="text-muted-foreground">
|
|
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-foreground">Are you sure you want to proceed?</p>
|
|
</Modal>
|
|
</>
|
|
);
|
|
},
|
|
};
|