Skip to content

Commit

Permalink
Changed the Tab component to work with generic props (see mui#13868)
Browse files Browse the repository at this point in the history
  • Loading branch information
croeder committed Mar 21, 2019
1 parent bb19b54 commit 5b0cdee
Showing 1 changed file with 32 additions and 28 deletions.
60 changes: 32 additions & 28 deletions packages/material-ui/src/Tab/Tab.d.ts
Original file line number Diff line number Diff line change
@@ -1,34 +1,38 @@
import * as React from 'react';
import { StandardProps } from '..';
import { ButtonBaseProps } from '../ButtonBase';
import * as React from "react";
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<any>;
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'
| 'labelIcon'
| 'textColorInherit'
| 'textColorPrimary'
| 'textColorSecondary'
| 'selected'
| 'disabled'
| 'fullWidth'
| 'wrapper'
| 'labelContainer'
| 'label'
| 'labelWrapped';
| "root"
| "labelIcon"
| "textColorInherit"
| "textColorPrimary"
| "textColorSecondary"
| "selected"
| "disabled"
| "fullWidth"
| "wrapper"
| "labelContainer"
| "label"
| "labelWrapped";

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

export default Tab;

0 comments on commit 5b0cdee

Please sign in to comment.