-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(storybook): add stories for Card, Flex, Input components
- Loading branch information
1 parent
7b6ab68
commit e0e1cc4
Showing
4 changed files
with
82 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ function App() { | |
return ( | ||
<> | ||
<GlobalStyles /> | ||
<h1>hello world!</h1> | ||
</> | ||
); | ||
} | ||
|
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,24 @@ | ||
import { Meta, StoryObj } from '@storybook/react'; | ||
import Card from '.'; | ||
|
||
const meta: Meta<typeof Card> = { | ||
title: 'common/Card', | ||
component: Card, | ||
tags: ['autodocs'], | ||
}; | ||
|
||
export default meta; | ||
|
||
type Story = StoryObj<typeof Card>; | ||
|
||
export const Default: Story = { | ||
args: { | ||
borderRadius: '12px', | ||
children: <h1>Hello World!</h1>, | ||
}, | ||
render: (args) => ( | ||
<Card {...args} css={{ padding: '12px 24px' }}> | ||
<h1>Hello World!</h1> | ||
</Card> | ||
), | ||
}; |
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,38 @@ | ||
import { Meta, StoryObj } from '@storybook/react'; | ||
import Flex from '.'; | ||
|
||
const meta: Meta<typeof Flex> = { | ||
title: 'common/Flex', | ||
component: Flex, | ||
tags: ['autodocs'], | ||
}; | ||
|
||
export default meta; | ||
|
||
type Story = StoryObj<typeof Flex>; | ||
|
||
export const Default: Story = { | ||
args: { | ||
direction: 'row', | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
xGap: '10px', | ||
yGap: '10px', | ||
}, | ||
render: (args) => ( | ||
<Flex {...args}> | ||
<div style={boxStyle}>Box 1</div> | ||
<div style={boxStyle}>Box 2</div> | ||
<div style={boxStyle}>Box 3</div> | ||
</Flex> | ||
), | ||
}; | ||
|
||
const boxStyle = { | ||
width: '100px', | ||
height: '100px', | ||
backgroundColor: 'lightblue', | ||
display: 'flex', | ||
alignItems: 'center', | ||
justifyContent: 'center', | ||
}; |
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,20 @@ | ||
import { Meta, StoryObj } from '@storybook/react'; | ||
import Input from '.'; | ||
|
||
const meta: Meta<typeof Input> = { | ||
title: 'common/Input', | ||
component: Input, | ||
tags: ['autodocs'], | ||
}; | ||
|
||
export default meta; | ||
|
||
type Story = StoryObj<typeof Input>; | ||
|
||
export const Default: Story = { | ||
args: { | ||
label: '์์ด๋', | ||
placeholder: '์์ด๋๋ฅผ ์ ๋ ฅํด์ฃผ์ธ์.', | ||
}, | ||
render: (args) => <Input {...args} css={{ padding: '12px' }} />, | ||
}; |