Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export type TabsComponents = {
Tab: React.FunctionComponent;
Panel: React.FunctionComponent;
Container: React.FunctionComponent<{ children: (...args: any) => React.ReactNode }>;
};
export const Tabs: React.FunctionComponent & TabsComponents = ({ children, ...props }) => (
<_Tabs use={ReakitTabs} {...props}>
{children}
);
Tabs.Tab = Tab;
Tabs.Panel = TabPanel;
Tabs.Container = ReakitTabs.Container;
export const tabsPropTypes = {
align: PropTypes.oneOf(['left', 'center', 'right']) as PropTypes.Validator,
children: PropTypes.node.isRequired,
className: PropTypes.string,
isFitted: PropTypes.bool,
type: PropTypes.oneOf(['default', 'boxed']) as PropTypes.Validator
};
Tabs.propTypes = tabsPropTypes;
export const tabsDefaultProps: Partial = {
align: undefined,
className: undefined,
isFitted: false,
type: 'default'
};
export type TabsComponents = {
Tab: React.FunctionComponent;
Panel: React.FunctionComponent;
Container: React.FunctionComponent<{ children: (...args: any) => React.ReactNode }>;
};
export const Tabs: React.FunctionComponent & TabsComponents = ({ children, ...props }) => (
<_Tabs use={ReakitTabs} {...props}>
{children}
);
Tabs.Tab = Tab;
Tabs.Panel = TabPanel;
Tabs.Container = ReakitTabs.Container;
Tabs.propTypes = {
align: PropTypes.oneOf(['left', 'center', 'right']) as PropTypes.Validator,
children: PropTypes.node.isRequired,
className: PropTypes.string,
isFitted: PropTypes.bool,
type: PropTypes.oneOf(['default', 'boxed']) as PropTypes.Validator
};
Tabs.defaultProps = {
align: undefined,
className: undefined,
isFitted: false,
type: 'default'
};
const C: React.FunctionComponent & TabsComponents = Tabs;
type Props = {
children: Node,
className?: string,
/** Visual type of the tab */
type?: 'default' | 'boxed'
};
const Tabs = ({ children, ...props }: Props) => (
<_Tabs use={ReakitTabs} {...props}>
{children}
);
Tabs.Tab = Tab;
Tabs.Panel = TabPanel;
Tabs.Container = ReakitTabs.Container;
Tabs.defaultProps = {
className: undefined,
type: 'default'
};
export default Tabs;