import type { Meta, StoryObj } from "@storybook/react-vite"; import { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption } from "./core"; const meta = { title: "Components/Table", component: Table, parameters: { layout: "centered", }, tags: ["autodocs"], } satisfies Meta; export default meta; type Story = StoryObj; export const Default: Story = { render() { return ( Name Email Role John Doe john@example.com Admin Jane Smith jane@example.com User Bob Wilson bob@example.com Moderator
); }, }; export const WithCaption: Story = { render() { return ( A list of recent users Name Email Status Alice Johnson alice@example.com Active Charlie Brown charlie@example.com Inactive
); }, }; export const WithFooter: Story = { render() { return ( Product Quantity Price Total Product A 2 $10.00 $20.00 Product B 1 $25.00 $25.00 Product C 3 $15.00 $45.00 Total $90.00
); }, }; export const WithActions: Story = { render() { return ( Name Email Role Actions John Doe john@example.com Admin Jane Smith jane@example.com User
); }, }; export const WithBadges: Story = { render() { return ( Project Status Priority Assignee Website Redesign In Progress High John Doe Mobile App Planned Medium Jane Smith API Integration Completed Low Bob Wilson
); }, }; export const WithCheckboxes: Story = { render() { return ( Name Email Role John Doe john@example.com Admin Jane Smith jane@example.com User Bob Wilson bob@example.com Moderator
); }, }; export const EmptyState: Story = { render() { return ( Name Email Role No results found.
); }, }; export const LargeDataset: Story = { render() { return ( ID Name Email Department Status {Array.from({ length: 15 }, (_, i) => ( {1000 + i} User {i + 1} user{i + 1}@example.com {["Engineering", "Sales", "Marketing", "Support"][i % 4]} {i % 2 === 0 ? "Active" : "Inactive"} ))}
); }, }; export const CustomStyling: Story = { render() { return ( Name Email Role John Doe john@example.com Admin Jane Smith jane@example.com User
); }, }; export const ResponsiveTable: Story = { render() { return (
Name Email Department Location Status John Doe john@example.com Engineering New York Active Jane Smith jane@example.com Marketing San Francisco Active
); }, };