diff --git a/docs/src/pages/demos/lists/SimpleList.tsx b/docs/src/pages/demos/lists/SimpleList.tsx new file mode 100644 index 00000000000000..3ec1db49258f70 --- /dev/null +++ b/docs/src/pages/demos/lists/SimpleList.tsx @@ -0,0 +1,62 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import { createStyles, Theme, withStyles, WithStyles } from '@material-ui/core/styles'; +import List from '@material-ui/core/List'; +import ListItem, { ListItemProps } from '@material-ui/core/ListItem'; +import ListItemIcon from '@material-ui/core/ListItemIcon'; +import ListItemText from '@material-ui/core/ListItemText'; +import Divider from '@material-ui/core/Divider'; +import InboxIcon from '@material-ui/icons/Inbox'; +import DraftsIcon from '@material-ui/icons/Drafts'; + +const styles = (theme: Theme) => + createStyles({ + root: { + width: '100%', + maxWidth: 360, + backgroundColor: theme.palette.background.paper, + }, + }); + +function ListItemLink(props: ListItemProps<'a', { button?: true }>) { + return ; +} + +export interface SimpleListProps extends WithStyles {} + +function SimpleList(props: SimpleListProps) { + const { classes } = props; + return ( +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ ); +} + +SimpleList.propTypes = { + classes: PropTypes.object.isRequired, +} as any; + +export default withStyles(styles)(SimpleList); diff --git a/packages/material-ui/src/ListItem/ListItem.d.ts b/packages/material-ui/src/ListItem/ListItem.d.ts index 7c5f4182e4e62b..019cf0c719a9be 100644 --- a/packages/material-ui/src/ListItem/ListItem.d.ts +++ b/packages/material-ui/src/ListItem/ListItem.d.ts @@ -1,7 +1,7 @@ import * as React from 'react'; import { StandardProps } from '..'; import ButtonBase, { ButtonBaseProps } from '../ButtonBase'; -import { OverridableComponent, SimplifiedPropsOf, OverrideProps } from '../OverridableComponent'; +import { OverridableComponent, OverrideProps } from '../OverridableComponent'; export interface ListItemTypeMap { props: P & { @@ -36,6 +36,9 @@ export type ListItemClassKey = | 'secondaryAction' | 'selected'; -export type ListItemProps = SimplifiedPropsOf; +export type ListItemProps = OverrideProps< + ListItemTypeMap, + D +>; export default ListItem; diff --git a/pages/demos/lists.js b/pages/demos/lists.js index 91cc79509674e8..a906b1693c5801 100644 --- a/pages/demos/lists.js +++ b/pages/demos/lists.js @@ -4,7 +4,11 @@ import React from 'react'; import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs'; const req = require.context('docs/src/pages/demos/lists', false, /\.md|\.js$/); -const reqSource = require.context('!raw-loader!../../docs/src/pages/demos/lists', false, /\.js$/); +const reqSource = require.context( + '!raw-loader!../../docs/src/pages/demos/lists', + false, + /\.(js|tsx)$/, +); const reqPrefix = 'pages/demos/lists'; function Page() {