- 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>
58 lines
1.7 KiB
TypeScript
58 lines
1.7 KiB
TypeScript
import type { Meta, StoryObj } from '@storybook/react';
|
|
import { VirtualizedList } from './virtualized-list';
|
|
|
|
// Generate 1000 items
|
|
const items = Array.from({ length: 1000 }, (_, i) => ({
|
|
id: i,
|
|
text: `Item ${i + 1}`,
|
|
description: `This is the description for item ${i + 1}. Scrolling is optimized.`,
|
|
}));
|
|
|
|
const meta = {
|
|
title: 'UI/VirtualizedList',
|
|
component: VirtualizedList,
|
|
tags: ['autodocs'],
|
|
argTypes: {
|
|
itemHeight: { control: 'number' },
|
|
containerHeight: { control: 'number' },
|
|
overscan: { control: 'number' },
|
|
},
|
|
} satisfies Meta<typeof VirtualizedList<typeof items[0]>>;
|
|
|
|
export default meta;
|
|
type Story = StoryObj<typeof meta>;
|
|
|
|
export const Default: Story = {
|
|
args: {
|
|
items,
|
|
itemHeight: 70,
|
|
containerHeight: 400,
|
|
className: 'border border-border rounded-md',
|
|
renderItem: (item) => (
|
|
<div
|
|
key={item.id}
|
|
className="h-[70px] p-4 border-b border-border flex flex-col justify-center hover:bg-white/5 transition-colors"
|
|
>
|
|
<span className="font-bold text-foreground">{item.text}</span>
|
|
<span className="text-xs text-muted-foreground">{item.description}</span>
|
|
</div>
|
|
),
|
|
},
|
|
};
|
|
|
|
export const SmallItems: Story = {
|
|
args: {
|
|
items,
|
|
itemHeight: 30,
|
|
containerHeight: 300,
|
|
className: 'border border-border rounded-md',
|
|
renderItem: (item) => (
|
|
<div
|
|
key={item.id}
|
|
className="h-[30px] px-4 flex items-center border-b border-white/5 hover:bg-white/5 text-sm"
|
|
>
|
|
{item.text}
|
|
</div>
|
|
),
|
|
},
|
|
};
|