From 5c9c97675f3e7d3978e664520f3fbbe595c78eee Mon Sep 17 00:00:00 2001 From: povilass Date: Tue, 13 Oct 2020 23:20:42 +0300 Subject: [PATCH] [theme] Add missing types for theme overrides (#23028) --- .../material-ui/src/SpeedDial/SpeedDial.d.ts | 6 +-- .../material-ui/src/SpeedDial/SpeedDial.js | 12 ++++-- .../src/SpeedDialAction/SpeedDialAction.d.ts | 6 +-- .../src/SpeedDialAction/SpeedDialAction.js | 9 ++-- .../src/SpeedDialIcon/SpeedDialIcon.d.ts | 2 +- .../src/SpeedDialIcon/SpeedDialIcon.js | 2 +- packages/material-ui/src/index.d.ts | 9 ++++ packages/material-ui/src/index.js | 9 ++++ .../material-ui/src/styles/components.d.ts | 41 +++++++++++++++++++ 9 files changed, 80 insertions(+), 16 deletions(-) diff --git a/packages/material-ui/src/SpeedDial/SpeedDial.d.ts b/packages/material-ui/src/SpeedDial/SpeedDial.d.ts index 78630864a7e5cb..def3d268280549 100644 --- a/packages/material-ui/src/SpeedDial/SpeedDial.d.ts +++ b/packages/material-ui/src/SpeedDial/SpeedDial.d.ts @@ -1,7 +1,7 @@ import * as React from 'react'; -import { InternalStandardProps as StandardProps } from '@material-ui/core'; -import { FabProps } from '@material-ui/core/Fab'; -import { TransitionHandlerProps, TransitionProps } from '@material-ui/core/transitions'; +import { InternalStandardProps as StandardProps } from '..'; +import { FabProps } from '../Fab'; +import { TransitionHandlerProps, TransitionProps } from '../transitions'; export type CloseReason = 'toggle' | 'blur' | 'mouseLeave' | 'escapeKeyDown'; export type OpenReason = 'toggle' | 'focus' | 'mouseEnter'; diff --git a/packages/material-ui/src/SpeedDial/SpeedDial.js b/packages/material-ui/src/SpeedDial/SpeedDial.js index 41039883261111..a5a22ce1b06b14 100644 --- a/packages/material-ui/src/SpeedDial/SpeedDial.js +++ b/packages/material-ui/src/SpeedDial/SpeedDial.js @@ -2,10 +2,14 @@ import * as React from 'react'; import { isFragment } from 'react-is'; import PropTypes from 'prop-types'; import clsx from 'clsx'; -import { duration, withStyles } from '@material-ui/core/styles'; -import Zoom from '@material-ui/core/Zoom'; -import Fab from '@material-ui/core/Fab'; -import { capitalize, isMuiElement, useForkRef, useControlled } from '@material-ui/core/utils'; +import { duration } from '../styles/transitions'; +import withStyles from '../styles/withStyles'; +import Zoom from '../Zoom'; +import Fab from '../Fab'; +import capitalize from '../utils/capitalize'; +import isMuiElement from '../utils/isMuiElement'; +import useForkRef from '../utils/useForkRef'; +import useControlled from '../utils/useControlled'; function getOrientation(direction) { if (direction === 'up' || direction === 'down') { diff --git a/packages/material-ui/src/SpeedDialAction/SpeedDialAction.d.ts b/packages/material-ui/src/SpeedDialAction/SpeedDialAction.d.ts index a46b0318bd262c..67668a77818e01 100644 --- a/packages/material-ui/src/SpeedDialAction/SpeedDialAction.d.ts +++ b/packages/material-ui/src/SpeedDialAction/SpeedDialAction.d.ts @@ -1,7 +1,7 @@ import * as React from 'react'; -import { InternalStandardProps as StandardProps } from '@material-ui/core'; -import { FabProps } from '@material-ui/core/Fab'; -import { TooltipProps } from '@material-ui/core/Tooltip'; +import { InternalStandardProps as StandardProps } from '..'; +import { FabProps } from '../Fab'; +import { TooltipProps } from '../Tooltip'; export interface SpeedDialActionProps extends StandardProps, 'children'> { /** diff --git a/packages/material-ui/src/SpeedDialAction/SpeedDialAction.js b/packages/material-ui/src/SpeedDialAction/SpeedDialAction.js index e8496e37be807c..fb7aa8dbf0a8a5 100644 --- a/packages/material-ui/src/SpeedDialAction/SpeedDialAction.js +++ b/packages/material-ui/src/SpeedDialAction/SpeedDialAction.js @@ -3,10 +3,11 @@ import * as React from 'react'; import PropTypes from 'prop-types'; import clsx from 'clsx'; -import { emphasize, withStyles } from '@material-ui/core/styles'; -import Fab from '@material-ui/core/Fab'; -import Tooltip from '@material-ui/core/Tooltip'; -import { capitalize } from '@material-ui/core/utils'; +import withStyles from '../styles/withStyles'; +import { emphasize } from '../styles/colorManipulator'; +import Fab from '../Fab'; +import Tooltip from '../Tooltip'; +import capitalize from '../utils/capitalize'; export const styles = (theme) => ({ /* Styles applied to the Fab component. */ diff --git a/packages/material-ui/src/SpeedDialIcon/SpeedDialIcon.d.ts b/packages/material-ui/src/SpeedDialIcon/SpeedDialIcon.d.ts index 752a8c69848e08..e796608c84a9fd 100644 --- a/packages/material-ui/src/SpeedDialIcon/SpeedDialIcon.d.ts +++ b/packages/material-ui/src/SpeedDialIcon/SpeedDialIcon.d.ts @@ -1,5 +1,5 @@ import * as React from 'react'; -import { InternalStandardProps as StandardProps } from '@material-ui/core'; +import { InternalStandardProps as StandardProps } from '..'; export interface SpeedDialIconProps extends StandardProps, 'children'> { diff --git a/packages/material-ui/src/SpeedDialIcon/SpeedDialIcon.js b/packages/material-ui/src/SpeedDialIcon/SpeedDialIcon.js index 8a10169945bcb9..59f4d5f2bbca8d 100644 --- a/packages/material-ui/src/SpeedDialIcon/SpeedDialIcon.js +++ b/packages/material-ui/src/SpeedDialIcon/SpeedDialIcon.js @@ -1,7 +1,7 @@ import * as React from 'react'; import PropTypes from 'prop-types'; import clsx from 'clsx'; -import { withStyles } from '@material-ui/core/styles'; +import withStyles from '../styles/withStyles'; import AddIcon from '../internal/svg-icons/Add'; export const styles = (theme) => ({ diff --git a/packages/material-ui/src/index.d.ts b/packages/material-ui/src/index.d.ts index 95fddc0c9dca0e..7d6dd1c58ad3f2 100644 --- a/packages/material-ui/src/index.d.ts +++ b/packages/material-ui/src/index.d.ts @@ -353,6 +353,15 @@ export * from './Snackbar'; export { default as SnackbarContent } from './SnackbarContent'; export * from './SnackbarContent'; +export { default as SpeedDial } from './SpeedDial'; +export * from './SpeedDial'; + +export { default as SpeedDialAction } from './SpeedDialAction'; +export * from './SpeedDialAction'; + +export { default as SpeedDialIcon } from './SpeedDialIcon'; +export * from './SpeedDialIcon'; + export { default as Step } from './Step'; export * from './Step'; diff --git a/packages/material-ui/src/index.js b/packages/material-ui/src/index.js index 2208b7c7152e98..aafa3cae17b32b 100644 --- a/packages/material-ui/src/index.js +++ b/packages/material-ui/src/index.js @@ -279,6 +279,15 @@ export * from './Snackbar'; export { default as SnackbarContent } from './SnackbarContent'; export * from './SnackbarContent'; +export { default as SpeedDial } from './SpeedDial'; +export * from './SpeedDial'; + +export { default as SpeedDialAction } from './SpeedDialAction'; +export * from './SpeedDialAction'; + +export { default as SpeedDialIcon } from './SpeedDialIcon'; +export * from './SpeedDialIcon'; + export { default as Step } from './Step'; export * from './Step'; diff --git a/packages/material-ui/src/styles/components.d.ts b/packages/material-ui/src/styles/components.d.ts index 60a24cd80093b6..d81ee3f8a794ab 100644 --- a/packages/material-ui/src/styles/components.d.ts +++ b/packages/material-ui/src/styles/components.d.ts @@ -3,10 +3,23 @@ import { ComponentsOverrides } from './overrides'; import { ComponentsVariants } from './variants'; export interface Components { + MuiAlert?: { + defaultProps?: ComponentsProps['MuiAlert']; + styleOverrides?: ComponentsOverrides['MuiAlert']; + variants?: ComponentsVariants['MuiAlert']; + }; + MuiAlertTitle?: { + defaultProps?: ComponentsProps['MuiAlertTitle']; + styleOverrides?: ComponentsOverrides['MuiAlertTitle']; + }; MuiAppBar?: { defaultProps?: ComponentsProps['MuiAppBar']; styleOverrides?: ComponentsOverrides['MuiAppBar']; }; + MuiAutocomplete?: { + defaultProps?: ComponentsProps['MuiAutocomplete']; + styleOverrides?: ComponentsOverrides['MuiAutocomplete']; + }; MuiAvatar?: { defaultProps?: ComponentsProps['MuiAvatar']; styleOverrides?: ComponentsOverrides['MuiAvatar']; @@ -270,6 +283,14 @@ export interface Components { defaultProps?: ComponentsProps['MuiOutlinedInput']; styleOverrides?: ComponentsOverrides['MuiOutlinedInput']; }; + MuiPagination?: { + defaultProps?: ComponentsProps['MuiPagination']; + styleOverrides?: ComponentsOverrides['MuiPagination']; + }; + MuiPaginationItem?: { + defaultProps?: ComponentsProps['MuiPaginationItem']; + styleOverrides?: ComponentsOverrides['MuiPaginationItem']; + }; MuiPaper?: { defaultProps?: ComponentsProps['MuiPaper']; styleOverrides?: ComponentsOverrides['MuiPaper']; @@ -303,6 +324,18 @@ export interface Components { defaultProps?: ComponentsProps['MuiSnackbarContent']; styleOverrides?: ComponentsOverrides['MuiSnackbarContent']; }; + MuiSpeedDial?: { + defaultProps?: ComponentsProps['MuiSpeedDial']; + styleOverrides?: ComponentsOverrides['MuiSpeedDial']; + }; + MuiSpeedDialAction?: { + defaultProps?: ComponentsProps['MuiSpeedDialAction']; + styleOverrides?: ComponentsOverrides['MuiSpeedDialAction']; + }; + MuiSpeedDialIcon?: { + defaultProps?: ComponentsProps['MuiSpeedDialIcon']; + styleOverrides?: ComponentsOverrides['MuiSpeedDialIcon']; + }; MuiStep?: { defaultProps?: ComponentsProps['MuiStep']; styleOverrides?: ComponentsOverrides['MuiStep']; @@ -387,6 +420,14 @@ export interface Components { defaultProps?: ComponentsProps['MuiTextField']; styleOverrides?: ComponentsOverrides['MuiTextField']; }; + MuiToggleButton?: { + defaultProps?: ComponentsProps['MuiToggleButton']; + styleOverrides?: ComponentsOverrides['MuiToggleButton']; + }; + MuiToggleButtonGroup?: { + defaultProps?: ComponentsProps['MuiToggleButtonGroup']; + styleOverrides?: ComponentsOverrides['MuiToggleButtonGroup']; + }; MuiToolbar?: { defaultProps?: ComponentsProps['MuiToolbar']; styleOverrides?: ComponentsOverrides['MuiToolbar'];