-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
70 changed files
with
5,225 additions
and
7,379 deletions.
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
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Diff not rendered.
Oops, something went wrong.
Diff not rendered.
Diff not rendered.
Large diffs are not rendered by default.
Oops, something went wrong.
Diff not rendered.
Diff not rendered.
Large diffs are not rendered by default.
Oops, something went wrong.
Diff not rendered.
Diff not rendered.
Large diffs are not rendered by default.
Oops, something went wrong.
Diff not rendered.
Diff not rendered.
Large diffs are not rendered by default.
Oops, something went wrong.
Diff not rendered.
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
64 changes: 45 additions & 19 deletions
64
src/components/common/CommonModal/CommonModal.stories.tsx
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 |
---|---|---|
@@ -1,26 +1,52 @@ | ||
import { Button } from '@offer-ui/react' | ||
import type { Meta, Story } from '@storybook/react' | ||
import type { Meta, StoryObj } from '@storybook/react' | ||
import { useState } from 'react' | ||
import type { CommonModalProps } from './types' | ||
import { CommonModal } from './index' | ||
import { CommonModal as CommonModalComponent } from './index' | ||
|
||
export default { | ||
component: CommonModal, | ||
type CommonModal = typeof CommonModalComponent | ||
|
||
const meta: Meta<CommonModal> = { | ||
component: CommonModalComponent, | ||
title: 'Common/CommonModal' | ||
} as Meta<CommonModalProps> | ||
} | ||
|
||
export default meta | ||
|
||
const Template: Story<CommonModalProps> = args => ( | ||
<CommonModal {...args} isOpen /> | ||
) | ||
const DefaultWithHooks = (args: CommonModalProps) => { | ||
const [isOpen, setIsOpen] = useState(false) | ||
|
||
return ( | ||
<> | ||
<button | ||
type="button" | ||
onClick={() => { | ||
setIsOpen(true) | ||
}}> | ||
open | ||
</button> | ||
<CommonModalComponent | ||
{...args} | ||
isOpen={isOpen} | ||
onClose={() => { | ||
setIsOpen(false) | ||
}} | ||
/> | ||
</> | ||
) | ||
} | ||
|
||
export const Default = Template.bind({}) | ||
Default.args = { | ||
description: '지금 바로 Offer에서 첫 거래를 시작해볼까요?', | ||
hasLogo: true, | ||
title: '부드러운 냉장고님 반가워요!', | ||
buttons: [ | ||
<Button key="first">첫 판매하기</Button>, | ||
<Button key="ok" styleType="ghost"> | ||
괜찮아요 | ||
</Button> | ||
] | ||
export const Default: StoryObj<CommonModal> = { | ||
args: { | ||
description: '지금 바로 Offer에서 첫 거래를 시작해볼까요?', | ||
hasLogo: true, | ||
title: '부드러운 냉장고님 반가워요!', | ||
buttons: [ | ||
<Button key="first">첫 판매하기</Button>, | ||
<Button key="ok" styleType="ghost"> | ||
괜찮아요 | ||
</Button> | ||
] | ||
}, | ||
render: args => <DefaultWithHooks {...args} /> | ||
} |
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 |
---|---|---|
@@ -1,31 +1,30 @@ | ||
import type { Meta, Story } from '@storybook/react' | ||
import type { TabsProps } from './types' | ||
import { Tab, Tabs } from './index' | ||
import type { Meta, StoryObj } from '@storybook/react' | ||
import { Tabs as TabsComponent, Tab } from './index' | ||
|
||
export default { | ||
argTypes: { | ||
defaultTabIndex: { | ||
control: 'number' | ||
} | ||
}, | ||
component: Tabs, | ||
type Tabs = typeof TabsComponent | ||
|
||
const meta: Meta<Tabs> = { | ||
component: TabsComponent, | ||
title: 'Common/Tabs' | ||
} as Meta<TabsProps> | ||
} | ||
|
||
export default meta | ||
|
||
const Template: Story<TabsProps> = args => ( | ||
<div> | ||
<Tabs {...args}> | ||
<Tabs.List> | ||
<Tab>1</Tab> | ||
<Tab>2</Tab> | ||
<Tab>3</Tab> | ||
</Tabs.List> | ||
<Tabs.Panels> | ||
<Tabs.Panel>HeadLess Tabs Content 1</Tabs.Panel> | ||
<Tabs.Panel>HeadLess Tabs Content 2</Tabs.Panel> | ||
<Tabs.Panel>HeadLess Tabs Content 3</Tabs.Panel> | ||
</Tabs.Panels> | ||
</Tabs> | ||
</div> | ||
) | ||
export const Default = Template.bind({}) | ||
export const Default: StoryObj<Tabs> = { | ||
render: args => ( | ||
<div> | ||
<TabsComponent {...args}> | ||
<TabsComponent.List> | ||
<Tab>1</Tab> | ||
<Tab>2</Tab> | ||
<Tab>3</Tab> | ||
</TabsComponent.List> | ||
<TabsComponent.Panels> | ||
<TabsComponent.Panel>HeadLess Tabs Content 1</TabsComponent.Panel> | ||
<TabsComponent.Panel>HeadLess Tabs Content 2</TabsComponent.Panel> | ||
<TabsComponent.Panel>HeadLess Tabs Content 3</TabsComponent.Panel> | ||
</TabsComponent.Panels> | ||
</TabsComponent> | ||
</div> | ||
) | ||
} |
Oops, something went wrong.