diff --git a/packages/ra-ui-materialui/src/input/Labeled.js b/packages/ra-ui-materialui/src/input/Labeled.tsx similarity index 100% rename from packages/ra-ui-materialui/src/input/Labeled.js rename to packages/ra-ui-materialui/src/input/Labeled.tsx diff --git a/packages/ra-ui-materialui/src/input/ReferenceError.js b/packages/ra-ui-materialui/src/input/ReferenceError.tsx similarity index 100% rename from packages/ra-ui-materialui/src/input/ReferenceError.js rename to packages/ra-ui-materialui/src/input/ReferenceError.tsx diff --git a/packages/ra-ui-materialui/src/input/SearchInput.js b/packages/ra-ui-materialui/src/input/SearchInput.tsx similarity index 57% rename from packages/ra-ui-materialui/src/input/SearchInput.js rename to packages/ra-ui-materialui/src/input/SearchInput.tsx index 0aaa2103687..ea7fb988b0a 100644 --- a/packages/ra-ui-materialui/src/input/SearchInput.js +++ b/packages/ra-ui-materialui/src/input/SearchInput.tsx @@ -1,20 +1,24 @@ -import React from 'react'; +import React, { FunctionComponent } from 'react'; import PropTypes from 'prop-types'; import SearchIcon from '@material-ui/icons/Search'; -import InputAdornment from '@material-ui/core/InputAdornment'; -import { withStyles, createStyles } from '@material-ui/core/styles'; -import { useTranslate } from 'ra-core'; +import { makeStyles, InputAdornment } from '@material-ui/core'; +import { TextFieldProps } from '@material-ui/core/TextField'; +import { useTranslate, InputProps } from 'ra-core'; import TextInput from './TextInput'; -const searchFilterStyles = createStyles({ +const useStyles = makeStyles({ input: { marginTop: 32, }, }); -const SearchInput = ({ classes, ...props }) => { +const SearchInput: FunctionComponent< + InputProps & Omit +> = ({ classes: classesOverride, ...props }) => { const translate = useTranslate(); + const classes = useStyles({ classes: classesOverride }); + return (