diff --git a/src/components/common/Divider/Divider.stories.tsx b/src/components/common/Divider/Divider.stories.tsx new file mode 100644 index 0000000..d84d5c2 --- /dev/null +++ b/src/components/common/Divider/Divider.stories.tsx @@ -0,0 +1,44 @@ +import type { Meta, StoryObj } from '@storybook/react'; +import Divider from '.'; + +// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export +const meta = { + title: 'Common/Divider', + component: Divider, + tags: ['autodocs'], + args: { + direction: 'vertical', + }, + argTypes: { + direction: { + options: ['vertical', 'horizontal'], + control: { type: 'select' }, + }, + }, +} satisfies Meta; + +export default meta; +type Story = StoryObj; + +// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args +export const Horizontal: Story = { + args: {}, + render: () => { + return ( +
+ +
+ ); + }, +}; + +export const Vertical: Story = { + args: {}, + render: () => { + return ( +
+ +
+ ); + }, +}; diff --git a/src/components/common/Divider/index.tsx b/src/components/common/Divider/index.tsx new file mode 100644 index 0000000..e716fbc --- /dev/null +++ b/src/components/common/Divider/index.tsx @@ -0,0 +1,25 @@ +import { cn } from '@/lib/utils'; +import { cva } from 'class-variance-authority'; + +export interface IDivider { + direction?: 'vertical' | 'horizontal'; + className?: string; +} + +const Divider = ({ direction, className }: IDivider) => { + return
; +}; + +export default Divider; + +export const dividerVariants = cva(['bg-divide'], { + variants: { + direction: { + horizontal: 'w-full h-1', + vertical: 'h-full w-1', + }, + }, + defaultVariants: { + direction: 'horizontal', + }, +});