-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(TabPanel): add story and throw rest props to main component element
- Loading branch information
1 parent
0c8a1ec
commit b50a127
Showing
3 changed files
with
38 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
export interface TabPanelProps extends React.HTMLAttributes<HTMLDivElement> { | ||
value: string | number; | ||
index: number; | ||
index: string | number; | ||
children?: ReactNode; | ||
} |
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 +1,34 @@ | ||
// TODO | ||
import React from 'react'; | ||
import type { Meta, Story } from '@storybook/react'; | ||
import _TabPanel, { TabPanelProps } from '../../src/core/tab-panel'; | ||
import { StoryGroup } from './types'; | ||
|
||
export const TabPanel = _TabPanel; | ||
|
||
export default { | ||
title: `${StoryGroup.DataDisplay}/TabPanel`, | ||
component: TabPanel, | ||
excludeStories: ['TabPanel'], | ||
|
||
argTypes: { | ||
value: { | ||
description: 'TabPanel is visible only when value is equal to index' | ||
} | ||
} | ||
} as Meta; | ||
|
||
const defaultArgs = { | ||
children: 'Asset tab content', | ||
value: 1, | ||
index: 1, | ||
}; | ||
|
||
const BasicTemplate: Story<TabPanelProps> = ({ | ||
...args | ||
}) => ( | ||
<TabPanel {...args} /> | ||
); | ||
|
||
// Basic | ||
export const Basic = BasicTemplate.bind({}); | ||
Basic.args = { ...defaultArgs }; |