@@ -15,11 +15,11 @@ import { ITabsProps } from '../types';
1515import { toTabs } from '../utils/toTabs' ;
1616import { TabsContext } from '../utils/useTabsContext' ;
1717import { StyledTabs } from '../styled/StyledTabs' ;
18+ import { Tab } from './Tab' ;
19+ import { TabList } from './TabList' ;
20+ import { TabPanel } from './TabPanel' ;
1821
19- /**
20- * @extends HTMLAttributes<HTMLDivElement>
21- */
22- export const Tabs = forwardRef < HTMLDivElement , ITabsProps > (
22+ export const TabsComponent = forwardRef < HTMLDivElement , ITabsProps > (
2323 (
2424 { isVertical, children, onChange, selectedItem : controlledSelectedItem , ...otherProps } ,
2525 ref
@@ -55,14 +55,27 @@ export const Tabs = forwardRef<HTMLDivElement, ITabsProps>(
5555 }
5656) ;
5757
58- Tabs . propTypes = {
58+ TabsComponent . propTypes = {
5959 isVertical : PropTypes . bool ,
6060 selectedItem : PropTypes . any ,
6161 onChange : PropTypes . func
6262} ;
6363
64- Tabs . defaultProps = {
64+ TabsComponent . defaultProps = {
6565 isVertical : false
6666} ;
6767
68- Tabs . displayName = 'Tabs' ;
68+ TabsComponent . displayName = 'Tabs' ;
69+
70+ /**
71+ * @extends HTMLAttributes<HTMLDivElement>
72+ */
73+ export const Tabs = TabsComponent as typeof TabsComponent & {
74+ Tab : typeof Tab ;
75+ TabList : typeof TabList ;
76+ TabPanel : typeof TabPanel ;
77+ } ;
78+
79+ Tabs . Tab = Tab ;
80+ Tabs . TabList = TabList ;
81+ Tabs . TabPanel = TabPanel ;
0 commit comments