Reorganize repo structure and standards references
This commit is contained in:
1 parent
3cb93a81be
commit
be2054274d
5885 files changed
+2588
-195
No files matched your search
@@ -0,0 +1,64 @@
|
||||
import type { Meta, StoryObj } from "@storybook/react";
|
||||
import { Button } from "~/components/ui/button";
|
||||
|
||||
const meta: Meta<typeof Button> = {
|
||||
title: "UI / Buttons / Button",
|
||||
component: Button,
|
||||
tags: ["autodocs"],
|
||||
argTypes: {
|
||||
variant: {
|
||||
control: { type: "select" },
|
||||
options: ["default", "destructive", "outline", "secondary", "ghost", "link"],
|
||||
},
|
||||
size: { control: { type: "inline-radio" }, options: ["xs", "sm", "default", "lg", "icon"] },
|
||||
isLoading: { control: "boolean" },
|
||||
disabled: { control: "boolean" },
|
||||
},
|
||||
args: {
|
||||
variant: "default",
|
||||
size: "default",
|
||||
isLoading: false,
|
||||
disabled: false,
|
||||
children: "Save changes",
|
||||
},
|
||||
};
|
||||
|
||||
export default meta;
|
||||
|
||||
type Story = StoryObj<typeof Button>;
|
||||
|
||||
export const Primary: Story = {};
|
||||
|
||||
export const Destructive: Story = { args: { variant: "destructive", children: "Delete account" } };
|
||||
|
||||
export const Outline: Story = { args: { variant: "outline", children: "Cancel" } };
|
||||
|
||||
export const Secondary: Story = { args: { variant: "secondary", children: "Secondary action" } };
|
||||
|
||||
export const Ghost: Story = { args: { variant: "ghost", children: "Dismiss" } };
|
||||
|
||||
export const LinkLike: Story = { args: { variant: "link", children: "Read the docs" } };
|
||||
|
||||
export const Loading: Story = { args: { isLoading: true, children: "Saving" } };
|
||||
|
||||
export const Disabled: Story = { args: { disabled: true, children: "Unavailable" } };
|
||||
|
||||
export const Sizes: Story = {
|
||||
render: (args) => (
|
||||
<div style={{ display: "flex", gap: 12, alignItems: "center" }}>
|
||||
<Button {...args} size="xs">
|
||||
Extra small
|
||||
</Button>
|
||||
<Button {...args} size="sm">
|
||||
Small
|
||||
</Button>
|
||||
<Button {...args} size="default">
|
||||
Default
|
||||
</Button>
|
||||
<Button {...args} size="lg">
|
||||
Large
|
||||
</Button>
|
||||
</div>
|
||||
),
|
||||
args: { children: undefined },
|
||||
};
|
||||
Reference in new issue
Block a user