import * as React from 'react'; import { AppBar, Avatar, Backdrop, Badge, BottomNavigation, BottomNavigationAction, Button, Card, CardActions, CardContent, CardHeader, CardMedia, Checkbox, Chip, CircularProgress, ClickAwayListener, Collapse, Dialog, DialogTitle, DialogContent, DialogContentText, Divider, Drawer, ExpansionPanel, ExpansionPanelActions, ExpansionPanelDetails, ExpansionPanelSummary, Fade, FormControlLabel, FormGroup, Grid, GridList, GridListTile, Grow, IconButton, Input, InputAdornment, InputLabel, LinearProgress, List, ListItem, ListItemAvatar, ListItemIcon, ListItemSecondaryAction, ListItemText, Menu, MenuItem, MobileStepper, Paper, Popover, Select, Snackbar, SnackbarContent, SwipeableDrawer, Switch, Tab, Table, TableBody, TableCell, TableFooter, TableHead, TablePagination, TableRow, Tabs, TextField, Toolbar, Tooltip, Typography, withMobileDialog, } from '@material-ui/core'; import { withStyles, StyleRulesCallback, WithStyles, Theme, createStyles, } from '@material-ui/core/styles'; import { DialogProps } from '@material-ui/core/Dialog'; const log = console.log; const FakeIcon = () =>
ICON
; const AppBarTest = () => ( Title ); const AvatarTest = () => ; const AvaterClassName = () => ; const BadgeTest = () => ( ); const BottomNavigationTest = () => { const value = 123; return ( } /> Nearby} icon={} /> ); }; const ButtonTest = () => (
); const IconButtonTest = () => (
); const CardTest = () => ( Word of the Day be-nev-o-lent adjective well meaning and kindly.
{'"a benevolent smile"'}
); const CardMediaTest = () => ( R
} title="Shrimp and Chorizo Paella" subheader="September 14, 2016" /> Contemplative Reptile This impressive paella is a perfect party dish and a fun meal to cook together with your guests. Add 1 cup of frozen peas along with the mussels, if you like. Method: Heat 1/2 cup of the broth in a pot until simmering, add saffron and set aside for 10 minutes. Heat oil in a (14- to 16-inch) paella pan or a large, deep skillet over medium-high heat. Add chicken, shrimp and chorizo, and cook, stirring occasionally until lightly browned, 6 to 8 minutes. Transfer shrimp to a large plate and set aside, leaving chicken and chorizo in the pan. Add pimentón, bay leaves, garlic, tomatoes, onion, salt and pepper, and cook, stirring often until thickened and fragrant, about 10 minutes. Add saffron broth and remaining 4 1/2 cups chicken broth; bring to a boil. Add rice and stir very gently to distribute. Top with artichokes and peppers, and cook without stirring, until most of the liquid is absorbed, 15 to 18 minutes. Reduce heat to medium-low, add reserved shrimp and mussels, tucking them down into the rice, and cook again without stirring, until mussels have opened and rice is just tender, 5 to 7 minutes more. (Discard any mussels that don’t open.) Set aside off of the heat to let rest for 10 minutes, and then serve. ); const ChipsTest = () => (
MB} label="Clickable Chip" onClick={log} /> } label="Deletable Chip" onDelete={log} /> } label="Clickable Deletable Chip" onClick={log} onDelete={log} />
); const DialogTest = () => { const emails = ['username@gmail.com', 'user02@gmail.com']; return ( Set backup account
{emails.map(email => ( ))}
Some text
); }; const DividerTest = () => (
); const DrawerTest = () => { const open = { top: false, left: false, bottom: false, right: false, }; return (
List List List List
); }; const SwipeableDrawerTest = () => { const open = { top: false, left: false, bottom: false, right: false, }; return (
List List List List
); }; const ExpansionPanelTest = () => (
}> ... ...
); const GridTest = () => ( ... ... ... ... ); const GridListTest = () => ( alt text , ); const ListTest = () => ( {[0, 1, 2, 3].map(value => ( ))} an item ); const MenuTest = () => { const anchorEl = document.getElementById('foo')!; const options = [ 'Show all notification content', 'Hide sensitive notification content', 'Hide all notification content', ]; return ( {options.map((option, index) => ( {option} ))} ); }; const PaperTest = () => ( This is a sheet of paper. Paper can be used to build surface or other elements for your application. ); const CircularProgessTest = () => (
); const LinearProgressTest = () => (
); const SelectionControlTest = () => { const state = { checkedA: true, checkedB: false, checkedF: true, }; const handleChange = (name: string) => (event: React.SyntheticEvent, checked: boolean) => log({ [name]: checked }); return ( } label="Option A" /> } label="Option B" /> } label="Option C" /> } label="Disabled" /> } label="Disabled" /> } label="Indeterminate" /> } label="Custom color" /> ); }; const SwitchTest = () => { const state = { checkedA: true, checkedB: false, checkedE: true, }; const handleChange = (name: string) => (event: React.SyntheticEvent, checked: boolean) => log({ [name]: checked }); return (
); }; const SnackbarTest = () => (
Note archived} action={[ , , ]} />
); const SnackbarContentTest = () => { const action = ( ); return (
); }; const StepperTest = () => class DotsMobileStepper extends React.Component<{ classes: { root: string }; }> { state = { activeStep: 0, }; handleNext = () => { this.setState({ activeStep: this.state.activeStep + 1, }); }; handleBack = () => { this.setState({ activeStep: this.state.activeStep - 1, }); }; render() { const classes = this.props.classes; const defaultProps = { steps: 2, nextButton: , backButton: , }; return ( ); } }; const TableTest = () => { const styles = (theme: Theme) => { const backgroundColor: string = theme.palette.secondary.light; return createStyles({ paper: { width: '100%', marginTop: theme.spacing.unit * 3, backgroundColor, overflowX: 'auto', }, }); }; let id = 0; function createData(name: string, calories: number, fat: number, carbs: number, protein: number) { id += 1; return { id, name, calories, fat, carbs, protein }; } const data = [ createData('Frozen yoghurt', 159, 6.0, 24, 4.0), createData('Ice cream sandwich', 237, 9.0, 37, 4.3), createData('Eclair', 262, 16.0, 24, 6.0), createData('Cupcake', 305, 3.7, 67, 4.3), createData('Gingerbread', 356, 16.0, 49, 3.9), ]; function BasicTable(props: WithStyles) { const classes = props.classes; return ( Dessert (100g serving) Calories Fat (g) Carbs (g) Protein (g) {data.map(n => { return ( {n.name} {n.calories} {n.fat} {n.carbs} {n.protein} ); })} {}} onChangeRowsPerPage={event => log({ rowsPerPage: event.target.value })} />
); } return withStyles(styles)(BasicTable); }; const TabsTest = () => { const TabContainer: React.SFC = props =>
{props.children}
; type ClassKey = 'root' | 'button'; const styles: StyleRulesCallback = theme => ({ root: { flexGrow: 1, marginTop: theme.spacing.unit * 3, backgroundColor: theme.palette.background.paper, }, button: { display: 'flex', }, }); class BasicTabs extends React.Component> { state = { value: 0, }; handleChange = (event: React.SyntheticEvent, value: number) => { this.setState({ value }); }; render() { const classes = this.props.classes; return (
{this.state.value === 0 && {'Item One'}} {this.state.value === 1 && {'Item Two'}} {this.state.value === 2 && {'Item Three'}}
); } } return withStyles(styles)(BasicTabs); }; const TextFieldTest = () => (
Name} value={'Alice'} /> log({ name: event.currentTarget.value })} />
); const SelectTest = () => ( ); const InputAdornmentTest = () => alert('Hello')} />; const ResponsiveComponentTest = () => { const ResponsiveComponent = withMobileDialog({ breakpoint: 'sm', })(({ children, width, fullScreen }) => (
{children}
)); ; const ResponsiveDialogComponent = withMobileDialog()(Dialog); }; const TooltipComponentTest = () => (
Add} placement="top-start">
); const ClickAwayListenerComponentTest = () => ( {}}>
); const TransitionTest = () => ( <>
{}}>
); const BackdropTest = () => {}} />; const PopoverTest = () => ; const InputLabelTest = () => ( );