-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update aliases and add Button component story
- Loading branch information
1 parent
9c086d1
commit b8b3005
Showing
3 changed files
with
112 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
/* eslint-disable react/jsx-no-literals */ | ||
import { Button } from "@/components/ui/button"; | ||
|
||
import { | ||
ChevronRightIcon, | ||
EnvelopeOpenIcon, | ||
ReloadIcon, | ||
} from "@radix-ui/react-icons"; | ||
|
||
import type { Meta, StoryObj } from "@storybook/react"; | ||
|
||
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export | ||
const meta = { | ||
title: "Ui/Button", | ||
component: Button, | ||
parameters: { | ||
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout | ||
layout: "centered", | ||
}, | ||
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs | ||
tags: ["autodocs"], | ||
} satisfies Meta<typeof Button>; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof meta>; | ||
|
||
// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args | ||
export const Primary: Story = { | ||
args: { | ||
variant: "default", | ||
children: "Button", | ||
}, | ||
}; | ||
|
||
export const Secondary: Story = { | ||
args: { | ||
variant: "secondary", | ||
children: "Button", | ||
}, | ||
}; | ||
|
||
export const Destructive: Story = { | ||
args: { | ||
variant: "destructive", | ||
children: "Button", | ||
}, | ||
}; | ||
|
||
export const Outline: Story = { | ||
args: { | ||
variant: "outline", | ||
children: "Button", | ||
}, | ||
}; | ||
|
||
export const Ghost: Story = { | ||
args: { | ||
variant: "ghost", | ||
children: "Button", | ||
}, | ||
}; | ||
|
||
export const Link: Story = { | ||
args: { | ||
variant: "link", | ||
children: "Button", | ||
}, | ||
}; | ||
|
||
export const Icon: Story = { | ||
args: { | ||
variant: "default", | ||
children: <ChevronRightIcon className="w-4 h-4" />, | ||
}, | ||
}; | ||
|
||
export const WithIcon: Story = { | ||
args: { | ||
variant: "default", | ||
children: ( | ||
<> | ||
<EnvelopeOpenIcon className="mr-2 h-4 w-4" /> | ||
</> | ||
), | ||
}, | ||
}; | ||
|
||
export const Loading: Story = { | ||
args: { | ||
variant: "default", | ||
disabled: true, | ||
children: ( | ||
<> | ||
<ReloadIcon className="mr-2 h-4 w-4 animate-spin" /> | ||
Please wait... | ||
</> | ||
), | ||
}, | ||
}; | ||
|
||
export const Disabled: Story = { | ||
args: { | ||
variant: "default", | ||
children: "Button", | ||
disabled: true, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters