Skip to content

Commit

Permalink
[theme] Add missing types for theme overrides (mui#23028)
Browse files Browse the repository at this point in the history
  • Loading branch information
povilass authored Oct 13, 2020
1 parent 6f59621 commit 5c9c976
Show file tree
Hide file tree
Showing 9 changed files with 80 additions and 16 deletions.
6 changes: 3 additions & 3 deletions packages/material-ui/src/SpeedDial/SpeedDial.d.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
12 changes: 8 additions & 4 deletions packages/material-ui/src/SpeedDial/SpeedDial.js
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down
6 changes: 3 additions & 3 deletions packages/material-ui/src/SpeedDialAction/SpeedDialAction.d.ts
Original file line number Diff line number Diff line change
@@ -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<Partial<TooltipProps>, 'children'> {
/**
Expand Down
9 changes: 5 additions & 4 deletions packages/material-ui/src/SpeedDialAction/SpeedDialAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down
2 changes: 1 addition & 1 deletion packages/material-ui/src/SpeedDialIcon/SpeedDialIcon.d.ts
Original file line number Diff line number Diff line change
@@ -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<React.HTMLAttributes<HTMLSpanElement>, 'children'> {
Expand Down
2 changes: 1 addition & 1 deletion packages/material-ui/src/SpeedDialIcon/SpeedDialIcon.js
Original file line number Diff line number Diff line change
@@ -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) => ({
Expand Down
9 changes: 9 additions & 0 deletions packages/material-ui/src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
9 changes: 9 additions & 0 deletions packages/material-ui/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
41 changes: 41 additions & 0 deletions packages/material-ui/src/styles/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
Expand Down Expand Up @@ -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'];
Expand Down Expand Up @@ -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'];
Expand Down Expand Up @@ -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'];
Expand Down

0 comments on commit 5c9c976

Please sign in to comment.