import type { Meta, StoryObj, ReactRenderer } from "@storybook/react-vite"; import { PartialStoryFn } from "storybook/internal/types"; import { Table, TableBody, TableCell, TableHeader, TableHeaderCell, TableRow } from "../table"; import { Button, buttonVariants } from "./Button"; import { Loader } from "../loader"; import { HrefButton } from "./HrefButton"; const meta = { title: "Components/Button", component: Button, tags: ["autodocs"], argTypes: { variant: { control: { type: "select", }, options: ["contained", "light", "outlined", "text", "ghost"], }, size: { control: { type: "select", }, options: ["small", "medium", "large"], }, color: { control: { type: "select", }, options: ["yellow", "gray", "red", "orange", "green", "blue"], }, }, parameters: { layout: "fullscreen", }, decorators: [ (Story) => (
), ] as ((story: PartialStoryFn) => React.JSX.Element)[], } satisfies Meta; export default meta; type Story = StoryObj; export const Basic: Story = { args: { variant: "contained", size: "medium", color: "yellow", children: "My button", loading: undefined, disabled: false, selected: false, withRipple: false, }, }; const variants = ["contained", "light", "outlined", "text", "ghost"] as const; const colors = [ "yellow", "yellow-alpha", "gray", "gray-alpha", "red", "orange", "green", "blue", ] as const; export const Context = () => { return (

Sizes

Variants

States

Width

As child

Icons

{" "}

Custom

Class only

simple <div>

HrefButton

simple <a>
); }; export const Tables = () => { const tableDefaultState = ( <> {colors.map((color) => ( {color} ))} {variants.map((variant) => ( {variant} {colors.map((color) => (
))}
))}
); const tableSelectedState = ( <> {colors.map((color) => ( {color} ))} {variants.map((variant) => ( {variant} {colors.map((color) => (
))}
))}
); return (

Default state with Melodineo bg

{tableDefaultState}

Selected state with Melodineo bg

{tableSelectedState}

Default state

{tableDefaultState}

Only Selected state

{tableSelectedState}

Default state with Map

{tableDefaultState}

Selected state with Map

{tableSelectedState}
); };