From de68eb45cf8a194a1623ac88e622b4bb86110e7e Mon Sep 17 00:00:00 2001 From: p-sw Date: Fri, 24 May 2024 22:21:38 +0900 Subject: [PATCH] refactor: make button stories plain --- packages/react/stories/Button.stories.ts | 50 ----------------------- packages/react/stories/Button.stories.tsx | 32 +++++++++++++++ 2 files changed, 32 insertions(+), 50 deletions(-) delete mode 100644 packages/react/stories/Button.stories.ts create mode 100644 packages/react/stories/Button.stories.tsx diff --git a/packages/react/stories/Button.stories.ts b/packages/react/stories/Button.stories.ts deleted file mode 100644 index 30f82e3..0000000 --- a/packages/react/stories/Button.stories.ts +++ /dev/null @@ -1,50 +0,0 @@ -import type { Meta, StoryObj } from "@storybook/react"; -import { Button } from "../components/Button"; - -const meta: Meta = { - title: "React/Button", - component: Button, - tags: ["autodocs"], - argTypes: { - size: { options: ["sm", "md", "lg"], control: "select" }, - border: { options: ["none", "solid", "outline"], control: "select" }, - background: { - options: ["default", "ghost", "link"], - control: "select", - }, - decoration: { options: ["none", "link"], control: "select" }, - onClick: { table: { disable: true } }, - preset: { options: ["default", "ghost", "link"], control: "select" }, - }, - args: { children: "Button", onClick: () => console.log("clicked") }, -}; - -export default meta; -type Story = StoryObj; - -export const Default: Story = { - args: { - preset: "default", - }, -}; - -export const Ghost: Story = { - args: { - preset: "ghost", - }, -}; - -export const Outline: Story = { - args: { - border: "outline", - background: "ghost", - decoration: "none", - size: "md", - }, -}; - -export const Link: Story = { - args: { - preset: "link", - }, -}; diff --git a/packages/react/stories/Button.stories.tsx b/packages/react/stories/Button.stories.tsx new file mode 100644 index 0000000..74faf5d --- /dev/null +++ b/packages/react/stories/Button.stories.tsx @@ -0,0 +1,32 @@ +import { Button } from "../components/Button"; + +export default { + title: "React/Button", +}; + +export const Default = () => { + return ; +}; +export const Ghost = () => { + return ; +}; + +export const Outline = () => { + return ( + + ); +}; + +export const Link = () => { + return ; +}; + +export const AsChild = () => { + return ( + + ); +};