2024-08-20 13:57:58 +00:00
|
|
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
|
|
import { fn } from "@storybook/test";
|
|
|
|
import { Plus } from "lucide-react";
|
2024-08-21 15:14:40 +00:00
|
|
|
import { ButtonIcon } from "../src/components/ButtonIcon/ButtonIcon";
|
2024-08-20 13:57:58 +00:00
|
|
|
|
|
|
|
const meta = {
|
|
|
|
title: "Components/ButtonIcon",
|
|
|
|
component: ButtonIcon,
|
|
|
|
parameters: {
|
|
|
|
layout: "centered",
|
|
|
|
},
|
|
|
|
tags: ["autodocs"],
|
|
|
|
argTypes: {
|
|
|
|
variant: {
|
|
|
|
control: { type: "select" },
|
|
|
|
},
|
|
|
|
},
|
|
|
|
args: { onClick: fn() },
|
|
|
|
} satisfies Meta<typeof ButtonIcon>;
|
|
|
|
|
|
|
|
export default meta;
|
|
|
|
type Story = StoryObj<typeof meta>;
|
|
|
|
|
|
|
|
export const Small: Story = {
|
|
|
|
args: {
|
|
|
|
Icon: Plus,
|
|
|
|
variant: "small",
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
export const Big: Story = {
|
|
|
|
args: {
|
|
|
|
Icon: Plus,
|
|
|
|
variant: "big",
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
export const Disabled: Story = {
|
|
|
|
args: {
|
|
|
|
Icon: Plus,
|
|
|
|
disabled: true,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
export const CustomStyle: Story = {
|
|
|
|
args: {
|
|
|
|
Icon: Plus,
|
|
|
|
variant: "big",
|
|
|
|
style: {
|
|
|
|
"--codex-button-icon-background": "red",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|