Skip to content

Commit

Permalink
[Tab] Enable generic props (#15003)
Browse files Browse the repository at this point in the history
* Changed the Tab component to work with generic props (see #13868)

* successfully run yarn prettier with the correct config

* successfully ran yarn typescript
  • Loading branch information
caroe233 authored and eps1lon committed Mar 23, 2019
1 parent be9a959 commit 7ee2a08
Showing 1 changed file with 19 additions and 15 deletions.
34 changes: 19 additions & 15 deletions packages/material-ui/src/Tab/Tab.d.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
import * as React from 'react';
import { StandardProps } from '..';
import { ButtonBaseProps } from '../ButtonBase';
import { ExtendButtonBase } from '../ButtonBase';
import { SimplifiedPropsOf } from '../OverridableComponent';

export interface TabProps extends StandardProps<ButtonBaseProps, TabClassKey, 'onChange'> {
disabled?: boolean;
fullWidth?: boolean;
icon?: string | React.ReactElement;
value?: any;
label?: React.ReactNode;
onChange?: (event: React.ChangeEvent<{ checked: boolean }>, value: any) => void;
onClick?: React.EventHandler<any>;
selected?: boolean;
style?: React.CSSProperties;
textColor?: string | 'secondary' | 'primary' | 'inherit';
}
declare const Tab: ExtendButtonBase<{
props: {
disabled?: boolean;
fullWidth?: boolean;
icon?: string | React.ReactElement;
value?: any;
label?: React.ReactNode;
onChange?: (event: React.ChangeEvent<{ checked: boolean }>, value: any) => void;
onClick?: React.EventHandler<any>;
selected?: boolean;
style?: React.CSSProperties;
textColor?: string | 'secondary' | 'primary' | 'inherit';
};
defaultComponent: 'div';
classKey: TabClassKey;
}>;

export type TabClassKey =
| 'root'
Expand All @@ -29,6 +33,6 @@ export type TabClassKey =
| 'label'
| 'labelWrapped';

declare const Tab: React.ComponentType<TabProps>;
export type TabProps = SimplifiedPropsOf<typeof Tab>;

export default Tab;

0 comments on commit 7ee2a08

Please sign in to comment.