diff --git a/src/AutoComplete/AutoComplete.js b/src/AutoComplete/AutoComplete.js index 82294abdb10168..4976f0e4ec9d4b 100644 --- a/src/AutoComplete/AutoComplete.js +++ b/src/AutoComplete/AutoComplete.js @@ -7,8 +7,6 @@ import MenuItem from '../MenuItem'; import Divider from '../Divider'; import Popover from '../Popover/Popover'; import propTypes from '../utils/propTypes'; -import warning from 'warning'; -import deprecated from '../utils/deprecatedPropType'; function getStyles(props, context, state) { const {anchorEl} = state; @@ -168,10 +166,6 @@ class AutoComplete extends Component { * Override the inline-styles of AutoComplete's TextField element. */ textFieldStyle: PropTypes.object, - /** - * If true, will update when focus event triggers. - */ - triggerUpdateOnFocus: deprecated(PropTypes.bool, 'Instead, use openOnFocus. It will be removed with v0.16.0.'), }; static defaultProps = { @@ -246,21 +240,6 @@ class AutoComplete extends Component { } }; - setValue(textValue) { - warning(false, `setValue() is deprecated, use the searchText property. - It will be removed with v0.16.0.`); - - this.setState({ - searchText: textValue, - }); - } - - getValue() { - warning(false, 'getValue() is deprecated. It will be removed with v0.16.0.'); - - return this.state.searchText; - } - handleMouseDown = (event) => { // Keep the TextField focused event.preventDefault(); @@ -355,7 +334,7 @@ class AutoComplete extends Component { }; handleFocus = (event) => { - if (!this.state.open && (this.props.triggerUpdateOnFocus || this.props.openOnFocus)) { + if (!this.state.open && this.props.openOnFocus) { this.setState({ open: true, anchorEl: ReactDOM.findDOMNode(this.refs.searchTextField), @@ -400,7 +379,6 @@ class AutoComplete extends Component { menuProps, listStyle, targetOrigin, - triggerUpdateOnFocus, // eslint-disable-line no-unused-vars onNewRequest, // eslint-disable-line no-unused-vars onUpdateInput, // eslint-disable-line no-unused-vars openOnFocus, // eslint-disable-line no-unused-vars diff --git a/src/Checkbox/Checkbox.js b/src/Checkbox/Checkbox.js index 4efa07cf23f1db..33381e1e75ddc2 100644 --- a/src/Checkbox/Checkbox.js +++ b/src/Checkbox/Checkbox.js @@ -3,7 +3,6 @@ import EnhancedSwitch from '../internal/EnhancedSwitch'; import transitions from '../styles/transitions'; import CheckboxOutline from '../svg-icons/toggle/check-box-outline-blank'; import CheckboxChecked from '../svg-icons/toggle/check-box'; -import deprecated from '../utils/deprecatedPropType'; function getStyles(props, context) { const {checkbox} = context.muiTheme; @@ -104,12 +103,6 @@ class Checkbox extends Component { * Override the inline-styles of the root element. */ style: PropTypes.object, - /** - * The SvgIcon to use for the unchecked state. - * This is useful to create icon toggles. - */ - unCheckedIcon: deprecated(PropTypes.element, - 'Use uncheckedIcon instead. It will be removed with v0.16.0.'), /** * The SvgIcon to use for the unchecked state. * This is useful to create icon toggles. @@ -178,7 +171,6 @@ class Checkbox extends Component { onCheck, // eslint-disable-line no-unused-vars checkedIcon, uncheckedIcon, - unCheckedIcon, ...other, } = this.props; const styles = getStyles(this.props, this.context); @@ -201,8 +193,8 @@ class Checkbox extends Component { style: checkStyles, }); - const unCheckedElement = (unCheckedIcon || uncheckedIcon) ? React.cloneElement((unCheckedIcon || uncheckedIcon), { - style: Object.assign(boxStyles, (unCheckedIcon || uncheckedIcon).props.style), + const unCheckedElement = uncheckedIcon ? React.cloneElement(uncheckedIcon, { + style: Object.assign(boxStyles, uncheckedIcon.props.style), }) : React.createElement(CheckboxOutline, { style: boxStyles, }); diff --git a/src/DatePicker/Calendar.js b/src/DatePicker/Calendar.js index 9fdc3157246da0..5f49fcd9e541e6 100644 --- a/src/DatePicker/Calendar.js +++ b/src/DatePicker/Calendar.js @@ -43,7 +43,6 @@ class Calendar extends Component { onTouchTapOk: PropTypes.func, open: PropTypes.bool, shouldDisableDate: PropTypes.func, - wordings: PropTypes.object, }; static defaultProps = { @@ -299,7 +298,6 @@ class Calendar extends Component { okLabel, onTouchTapCancel, // eslint-disable-line no-unused-vars onTouchTapOk, // eslint-disable-line no-unused-vars - wordings, } = this.props; return ( @@ -364,7 +362,6 @@ class Calendar extends Component { okLabel={okLabel} onTouchTapCancel={onTouchTapCancel} onTouchTapOk={onTouchTapOk} - wordings={wordings} /> } diff --git a/src/DatePicker/CalendarActionButtons.js b/src/DatePicker/CalendarActionButtons.js index 92e44d40e82664..c098595eb856ec 100644 --- a/src/DatePicker/CalendarActionButtons.js +++ b/src/DatePicker/CalendarActionButtons.js @@ -8,11 +8,10 @@ class CalendarActionButton extends Component { okLabel: PropTypes.node, onTouchTapCancel: PropTypes.func, onTouchTapOk: PropTypes.func, - wordings: PropTypes.object, }; render() { - const {cancelLabel, okLabel, wordings} = this.props; + const {cancelLabel, okLabel} = this.props; const styles = { root: { @@ -35,7 +34,7 @@ class CalendarActionButton extends Component { return (
); diff --git a/src/DatePicker/DatePickerDialog.js b/src/DatePicker/DatePickerDialog.js index e7866f2f8c8632..3d7887457dbf8b 100644 --- a/src/DatePicker/DatePickerDialog.js +++ b/src/DatePicker/DatePickerDialog.js @@ -29,7 +29,6 @@ class DatePickerDialog extends Component { open: PropTypes.bool, shouldDisableDate: PropTypes.func, style: PropTypes.object, - wordings: PropTypes.object, }; static defaultProps = { @@ -120,7 +119,6 @@ class DatePickerDialog extends Component { onShow, // eslint-disable-line no-unused-vars shouldDisableDate, style, // eslint-disable-line no-unused-vars - wordings, animation, ...other, } = this.props; @@ -175,7 +173,6 @@ class DatePickerDialog extends Component { onTouchTapOk={this.handleTouchTapOk} okLabel={okLabel} shouldDisableDate={shouldDisableDate} - wordings={wordings} /> diff --git a/src/List/List.js b/src/List/List.js index 99c49fe3e5e74e..ddc281627dd6b6 100644 --- a/src/List/List.js +++ b/src/List/List.js @@ -1,8 +1,5 @@ import React, {Component, PropTypes, Children, isValidElement} from 'react'; -import propTypes from '../utils/propTypes'; import Subheader from '../Subheader'; -import deprecated from '../utils/deprecatedPropType'; -import warning from 'warning'; class List extends Component { static propTypes = { @@ -11,31 +8,10 @@ class List extends Component { * be part of the list. */ children: PropTypes.node, - /** - * If true, the subheader will be indented by 72px. - */ - insetSubheader: deprecated(PropTypes.bool, - 'Refer to the `subheader` property. It will be removed with v0.16.0.'), /** * Override the inline-styles of the root element. */ style: PropTypes.object, - /** - * The subheader string that will be displayed at the top of the list. - */ - subheader: deprecated(PropTypes.node, - 'Instead, nest the `Subheader` component directly inside the `List`. It will be removed with v0.16.0.'), - /** - * Override the inline-styles of the subheader element. - */ - subheaderStyle: deprecated(PropTypes.object, - 'Refer to the `subheader` property. It will be removed with v0.16.0.'), - /** - * @ignore - * ** Breaking change ** List no longer supports `zDepth`. Instead, wrap it in `Paper` - * or another component that provides zDepth. - */ - zDepth: propTypes.zDepth, }; static contextTypes = { @@ -45,28 +21,17 @@ class List extends Component { render() { const { children, - insetSubheader = false, style, - subheader, - subheaderStyle, - zDepth, ...other, } = this.props; const {prepareStyles} = this.context.muiTheme; - warning((typeof zDepth === 'undefined'), 'List no longer supports `zDepth`. Instead, wrap it in `Paper` ' + - 'or another component that provides zDepth. It will be removed with v0.16.0.'); - let hasSubheader = false; - if (subheader) { + const firstChild = Children.toArray(children)[0]; + if (isValidElement(firstChild) && firstChild.type === Subheader) { hasSubheader = true; - } else { - const firstChild = Children.toArray(children)[0]; - if (isValidElement(firstChild) && firstChild.type === Subheader) { - hasSubheader = true; - } } const styles = { @@ -79,11 +44,6 @@ class List extends Component { return (
- {subheader && ( - - {subheader} - - )} {children}
); diff --git a/src/List/MakeSelectable.js b/src/List/MakeSelectable.js index 6c250194fcf671..a18f7b7f16be66 100644 --- a/src/List/MakeSelectable.js +++ b/src/List/MakeSelectable.js @@ -1,6 +1,5 @@ import React, {Component, PropTypes} from 'react'; import {fade} from '../utils/colorManipulator'; -import deprecated from '../utils/deprecatedPropType'; export const MakeSelectable = (Component) => { return class extends Component { @@ -9,24 +8,12 @@ export const MakeSelectable = (Component) => { onChange: PropTypes.func, selectedItemStyle: PropTypes.object, value: PropTypes.any, - valueLink: deprecated(PropTypes.shape({ - value: PropTypes.any, - requestChange: PropTypes.func, - }), `This property is deprecated due to his low popularity. Use the value and onChange property. - It will be removed with v0.16.0.`), }; static contextTypes = { muiTheme: PropTypes.object.isRequired, }; - getValueLink(props) { - return props.valueLink || { - value: props.value, - requestChange: props.onChange, - }; - } - extendChild(child, styles, selectedItemStyle) { if (child && child.type && child.type.muiName === 'ListItem') { const selected = this.isChildSelected(child, this.props); @@ -71,15 +58,14 @@ export const MakeSelectable = (Component) => { }; isChildSelected(child, props) { - return this.getValueLink(props).value === child.props.value; + return props.value === child.props.value; } handleItemTouchTap = (event, item) => { - const valueLink = this.getValueLink(this.props); const itemValue = item.props.value; - if (itemValue !== valueLink.value) { - valueLink.requestChange(event, itemValue); + if (itemValue !== this.props.value) { + this.props.onChange(event, itemValue); } }; diff --git a/src/Menu/Menu.js b/src/Menu/Menu.js index e802a29d48bc7d..3eab59d22c524a 100644 --- a/src/Menu/Menu.js +++ b/src/Menu/Menu.js @@ -2,41 +2,24 @@ import React, {Component, PropTypes} from 'react'; import ReactDOM from 'react-dom'; import shallowEqual from 'recompose/shallowEqual'; import ClickAwayListener from '../internal/ClickAwayListener'; -import autoPrefix from '../utils/autoPrefix'; -import transitions from '../styles/transitions'; import keycode from 'keycode'; import propTypes from '../utils/propTypes'; import List from '../List/List'; -import deprecated from '../utils/deprecatedPropType'; -import warning from 'warning'; import {HotKeyHolder} from './menuUtils'; function getStyles(props, context) { const { - animated, desktop, maxHeight, - openDirection = 'bottom-left', width, } = props; - const openDown = openDirection.split('-')[0] === 'bottom'; - const openLeft = openDirection.split('-')[1] === 'left'; - const {muiTheme} = context; const styles = { root: { // Nested div bacause the List scales x faster than it scales y - transition: animated ? transitions.easeOut('250ms', 'transform') : null, zIndex: muiTheme.zIndex.menu, - top: openDown ? 0 : null, - bottom: !openDown ? 0 : null, - left: !openLeft ? 0 : null, - right: openLeft ? 0 : null, - transform: animated ? 'scaleX(0)' : null, - transformOrigin: openLeft ? 'right' : 'left', - opacity: 0, maxHeight: maxHeight, overflowY: maxHeight ? 'auto' : null, }, @@ -51,10 +34,6 @@ function getStyles(props, context) { userSelect: 'none', width: width, }, - menuItemContainer: { - transition: animated ? transitions.easeOut(null, 'opacity') : null, - opacity: 0, - }, selectedMenuItem: { color: muiTheme.baseTheme.palette.accent1Color, }, @@ -65,13 +44,6 @@ function getStyles(props, context) { class Menu extends Component { static propTypes = { - /** - * If true, the menu will apply transitions when it - * is added to the DOM. In order for transitions to - * work, wrap the menu inside a `ReactTransitionGroup`. - */ - animated: deprecated(PropTypes.bool, `Instead, use a [Popover](/#/components/popover). - It will be removed with v0.16.0.`), /** * If true, the width of the menu will be set automatically * according to the widths of its children, @@ -139,11 +111,6 @@ class Menu extends Component { onItemTouchTap: PropTypes.func, /** @ignore */ onKeyDown: PropTypes.func, - /** - * This is the placement of the menu relative to the `IconButton`. - */ - openDirection: deprecated(propTypes.corners, `Instead, use a [Popover](/#/components/popover). - It will be removed with v0.16.0.`), /** * Override the inline-styles of selected menu items. */ @@ -169,12 +136,6 @@ class Menu extends Component { * proper keyline increments (64px for desktop, 56px otherwise). */ width: propTypes.stringOrNumber, - /** - * @ignore - * Menu no longer supports `zDepth`. Instead, wrap it in `Paper` - * or another component that provides zDepth. - */ - zDepth: propTypes.zDepth, }; static defaultProps = { @@ -212,9 +173,6 @@ class Menu extends Component { if (this.props.autoWidth) { this.setWidth(); } - if (!this.props.animated) { - this.animateOpen(); - } this.setScollPosition(); } @@ -272,20 +230,6 @@ class Menu extends Component { return filteredChildren; } - animateOpen() { - const rootStyle = ReactDOM.findDOMNode(this).style; - const scrollContainerStyle = ReactDOM.findDOMNode(this.refs.scrollContainer).style; - const menuContainers = ReactDOM.findDOMNode(this.refs.list).childNodes; - - autoPrefix.set(rootStyle, 'transform', 'scaleX(1)'); - autoPrefix.set(scrollContainerStyle, 'transform', 'scaleY(1)'); - scrollContainerStyle.opacity = 1; - - for (let i = 0; i < menuContainers.length; ++i) { - menuContainers[i].style.opacity = 1; - } - } - cloneMenuItem(child, childIndex, styles, index) { const { desktop, @@ -329,31 +273,6 @@ class Menu extends Component { this.setFocusIndex(index, true); } - getCascadeChildrenCount(filteredChildren) { - const { - desktop, - maxHeight, - } = this.props; - let count = 1; - let currentHeight = desktop ? 16 : 8; - const menuItemHeight = desktop ? 32 : 48; - - // MaxHeight isn't set - cascade all of the children - if (!maxHeight) return filteredChildren.length; - - // Count all the children that will fit inside the max menu height - filteredChildren.forEach((child) => { - if (currentHeight < maxHeight) { - const childIsADivider = child.type && child.type.muiName === 'Divider'; - - currentHeight += childIsADivider ? 16 : menuItemHeight; - count++; - } - }); - - return count; - } - getMenuItemCount(filteredChildren) { let menuItemCount = 0; filteredChildren.forEach((child) => { @@ -521,7 +440,6 @@ class Menu extends Component { render() { const { - animated, autoWidth, // eslint-disable-line no-unused-vars children, desktop, @@ -530,7 +448,6 @@ class Menu extends Component { listStyle, maxHeight, // eslint-disable-line no-unused-vars multiple, // eslint-disable-line no-unused-vars - openDirection = 'bottom-left', onItemTouchTap, // eslint-disable-line no-unused-vars onEscKeyDown, // eslint-disable-line no-unused-vars selectedMenuItemStyle, // eslint-disable-line no-unused-vars @@ -538,61 +455,31 @@ class Menu extends Component { value, // eslint-disable-line no-unused-vars valueLink, // eslint-disable-line no-unused-vars width, // eslint-disable-line no-unused-vars - zDepth, ...other, } = this.props; - warning((typeof zDepth === 'undefined'), 'Menu no longer supports `zDepth`. Instead, wrap it in `Paper` ' + - 'or another component that provides `zDepth`. It will be removed with v0.16.0.'); - - const {focusIndex} = this.state; - const {prepareStyles} = this.context.muiTheme; const styles = getStyles(this.props, this.context); const mergedRootStyles = Object.assign(styles.root, style); const mergedListStyles = Object.assign(styles.list, listStyle); - const openDown = openDirection.split('-')[0] === 'bottom'; const filteredChildren = this.getFilteredChildren(children); - // Cascade children opacity - let cumulativeDelay = openDown ? 175 : 325; - const cascadeChildrenCount = this.getCascadeChildrenCount(filteredChildren); - const cumulativeDelayIncrement = Math.ceil(150 / cascadeChildrenCount); - let menuItemIndex = 0; const newChildren = React.Children.map(filteredChildren, (child, index) => { const childIsADivider = child.type && child.type.muiName === 'Divider'; const childIsDisabled = child.props.disabled; - let childrenContainerStyles = {}; - - if (animated) { - let transitionDelay = 0; - - // Only cascade the visible menu items - if ((menuItemIndex >= focusIndex - 1) && - (menuItemIndex <= focusIndex + cascadeChildrenCount - 1)) { - cumulativeDelay = openDown ? - cumulativeDelay + cumulativeDelayIncrement : - cumulativeDelay - cumulativeDelayIncrement; - transitionDelay = cumulativeDelay; - } - - childrenContainerStyles = Object.assign({}, styles.menuItemContainer, { - transitionDelay: `${transitionDelay}ms`, - }); - } const clonedChild = childIsADivider ? React.cloneElement(child, {style: styles.divider}) : childIsDisabled ? React.cloneElement(child, {desktop: desktop}) : this.cloneMenuItem(child, menuItemIndex, styles, index); - if (!childIsADivider && !childIsDisabled) menuItemIndex++; + if (!childIsADivider && !childIsDisabled) { + menuItemIndex++; + } - return animated ? ( -
{clonedChild}
- ) : clonedChild; + return clonedChild; }); return ( diff --git a/src/SelectField/SelectField.js b/src/SelectField/SelectField.js index 5f43741e7dfaea..bef272750eb064 100644 --- a/src/SelectField/SelectField.js +++ b/src/SelectField/SelectField.js @@ -1,7 +1,6 @@ import React, {Component, PropTypes} from 'react'; import TextField from '../TextField'; import DropDownMenu from '../DropDownMenu'; -import deprecated from '../utils/deprecatedPropType'; function getStyles(props) { return { @@ -105,11 +104,6 @@ class SelectField extends Component { onChange: PropTypes.func, /** @ignore */ onFocus: PropTypes.func, - /** - * Override the inline-styles of the underlying `DropDownMenu` element. - */ - selectFieldRoot: deprecated(PropTypes.object, - 'Instead, use `menuStyle`. It will be removed with v0.16.0.'), /** * Override the inline-styles of the root element. */ @@ -156,7 +150,6 @@ class SelectField extends Component { underlineFocusStyle, underlineStyle, errorStyle, - selectFieldRoot, disabled, floatingLabelFixed, floatingLabelText, @@ -198,7 +191,7 @@ class SelectField extends Component { > { - if (this.props.disabled) + if (this.props.disabled) { return; + } this.setState({isFocused: true}); - if (this.props.onFocus) this.props.onFocus(event); - }; - - handleInputKeyDown = (event) => { - if (keycode(event) === 'enter' && this.props.onEnterKeyDown) this.props.onEnterKeyDown(event); - if (this.props.onKeyDown) this.props.onKeyDown(event); + if (this.props.onFocus) { + this.props.onFocus(event); + } }; handleHeightChange = (event, height) => { @@ -441,7 +430,6 @@ class TextField extends Component { onBlur: this.handleInputBlur, onChange: this.handleInputChange, onFocus: this.handleInputFocus, - onKeyDown: this.handleInputKeyDown, }; const inputStyleMerged = Object.assign(styles.input, inputStyle); diff --git a/src/TimePicker/TimePicker.js b/src/TimePicker/TimePicker.js index aed78cb943d81c..9c4165320350a9 100644 --- a/src/TimePicker/TimePicker.js +++ b/src/TimePicker/TimePicker.js @@ -1,5 +1,4 @@ import React, {Component, PropTypes} from 'react'; -import warning from 'warning'; import TimePickerDialog from './TimePickerDialog'; import TextField from '../TextField'; import {formatTime} from './timeUtils'; @@ -123,28 +122,6 @@ class TimePicker extends Component { } } - /** - * Deprecated. - * returns timepicker value. - **/ - getTime() { - warning(false, `getTime() method is deprecated. Use the defaultTime property - instead. Or use the TimePicker as a controlled component with the value - property. It will be removed with v0.16.0.`); - return this.state.time; - } - - /** - * Deprecated - * sets timepicker value. - **/ - setTime(time) { - warning(false, `setTime() method is deprecated. Use the defaultTime property - instead. Or use the TimePicker as a controlled component with the value - property. It will be removed with v0.16.0.`); - this.setState({time: time ? time : emptyTime}); - } - /** * Alias for `openDialog()` for an api consistent with TextField. */ diff --git a/src/internal/EnhancedButton.js b/src/internal/EnhancedButton.js index 722bf7d2df459e..1f6680dd7489a1 100644 --- a/src/internal/EnhancedButton.js +++ b/src/internal/EnhancedButton.js @@ -4,7 +4,6 @@ import Events from '../utils/events'; import keycode from 'keycode'; import FocusRipple from './FocusRipple'; import TouchRipple from './TouchRipple'; -import deprecated from '../utils/deprecatedPropType'; let styleInjected = false; let listening = false; @@ -52,8 +51,6 @@ class EnhancedButton extends Component { focusRippleOpacity: PropTypes.number, href: PropTypes.string, keyboardFocused: PropTypes.bool, - linkButton: deprecated(PropTypes.bool, `LinkButton is no longer required when the \`href\` property is provided. - It will be removed with v0.16.0.`), onBlur: PropTypes.func, onClick: PropTypes.func, onFocus: PropTypes.func, @@ -269,7 +266,6 @@ class EnhancedButton extends Component { focusRippleOpacity, // eslint-disable-line no-unused-vars href, keyboardFocused, // eslint-disable-line no-unused-vars - linkButton, // eslint-disable-line no-unused-vars touchRippleColor, // eslint-disable-line no-unused-vars touchRippleOpacity, // eslint-disable-line no-unused-vars onBlur, // eslint-disable-line no-unused-vars diff --git a/src/styles/index.js b/src/styles/index.js index 79c2a98ff2465c..86b1341fa7ad7e 100644 --- a/src/styles/index.js +++ b/src/styles/index.js @@ -6,7 +6,6 @@ export lightBaseTheme from './baseThemes/lightBaseTheme'; export LightRawTheme from './baseThemes/lightBaseTheme'; export getMuiTheme from './getMuiTheme'; export spacing from './spacing'; -export themeManager from './themeManager'; export transitions from './transitions'; export typography from './typography'; export zIndex from './zIndex'; diff --git a/src/styles/raw-themes/dark-raw-theme.js b/src/styles/raw-themes/dark-raw-theme.js deleted file mode 100644 index 551d8fdd2bb1b8..00000000000000 --- a/src/styles/raw-themes/dark-raw-theme.js +++ /dev/null @@ -1,8 +0,0 @@ -import darkBaseTheme from '../baseThemes/darkBaseTheme'; -import deprecatedExport from '../../utils/deprecatedExport'; - -export default deprecatedExport( - darkBaseTheme, - 'material-ui/lib/styles/raw-themes/dark-raw-theme', - 'material-ui/lib/styles/baseThemes/darkBaseTheme' -); diff --git a/src/styles/raw-themes/light-raw-theme.js b/src/styles/raw-themes/light-raw-theme.js deleted file mode 100644 index 13cd3d657128f5..00000000000000 --- a/src/styles/raw-themes/light-raw-theme.js +++ /dev/null @@ -1,8 +0,0 @@ -import lightBaseTheme from '../baseThemes/lightBaseTheme'; -import deprecatedExport from '../../utils/deprecatedExport'; - -export default deprecatedExport( - lightBaseTheme, - 'material-ui/lib/styles/raw-themes/light-raw-theme', - 'material-ui/lib/styles/baseThemes/lightBaseTheme' -); diff --git a/src/styles/themeDecorator.js b/src/styles/themeDecorator.js deleted file mode 100644 index 4839cfc3b6edb9..00000000000000 --- a/src/styles/themeDecorator.js +++ /dev/null @@ -1,26 +0,0 @@ -/* eslint-disable react/prefer-es6-class */ -import React, {PropTypes} from 'react'; -import warning from 'warning'; - -export default (customTheme) => { - warning(false, `ThemeDecorator is deprecated, please use MuiThemeProvider instead. - It will be removed with v0.16.0.`); - - return function(Component) { - return React.createClass({ - childContextTypes: { - muiTheme: PropTypes.object.isRequired, - }, - - getChildContext() { - return { - muiTheme: customTheme, - }; - }, - - render() { - return React.createElement(Component, this.props); - }, - }); - }; -}; diff --git a/src/styles/themeManager.js b/src/styles/themeManager.js deleted file mode 100644 index 89d2511511e4eb..00000000000000 --- a/src/styles/themeManager.js +++ /dev/null @@ -1,31 +0,0 @@ -import merge from 'lodash/merge'; -import getMuiTheme from '../styles/getMuiTheme'; -import warning from 'warning'; - -export default - { - getMuiTheme(baseTheme, muiTheme) { - warning(false, `ThemeManager is deprecated. please import getMuiTheme - directly from "material-ui/styles/getMuiTheme". - It will be removed with v0.16.0.`); - return getMuiTheme(baseTheme, muiTheme); - }, - modifyRawThemeSpacing(muiTheme, spacing) { - warning(false, `modifyRawThemeSpacing is deprecated. please use getMuiTheme - to modify your theme directly. http://www.material-ui.com/#/customization/themes. - It will be removed with v0.16.0.`); - return getMuiTheme(merge({}, muiTheme.baseTheme, {spacing})); - }, - modifyRawThemePalette(muiTheme, palette) { - warning(false, `modifyRawThemePalette is deprecated. please use getMuiTheme - to modify your theme directly. http://www.material-ui.com/#/customization/themes. - It will be removed with v0.16.0.`); - return getMuiTheme(merge({}, muiTheme.baseTheme, {baseTheme: {palette}})); - }, - modifyRawThemeFontFamily(muiTheme, fontFamily) { - warning(false, `modifyRawThemeFontFamily is deprecated. please use getMuiTheme - to modify your theme directly. http://www.material-ui.com/#/customization/themes. - It will be removed with v0.16.0.`); - return getMuiTheme(merge({}, muiTheme.baseTheme, {fontFamily})); - }, - }; diff --git a/src/utils/stylePropable.js b/src/utils/stylePropable.js deleted file mode 100644 index 9680dbdd70c2ee..00000000000000 --- a/src/utils/stylePropable.js +++ /dev/null @@ -1,38 +0,0 @@ -import {PropTypes} from 'react'; -import warning from 'warning'; - -let hasWarned; -const warn = () => { - warning(hasWarned, `The 'material-ui/lib/mixins/style-propable.js' mixin has been deprecated. - It will be removed with v0.16.0.`); - hasWarned = true; -}; - -export const mergeStyles = (...args) => { - warn(); - return Object.assign({}, ...args); -}; - -export default { - - propTypes: { - style: PropTypes.object, - }, - - mergeStyles, - - prepareStyles(...args) { - warn(); - const { - prepareStyles = (style) => (style), - } = (this.state && this.state.muiTheme) || - (this.context && this.context.muiTheme) || - (this.props && this.props.muiTheme) || {}; - - return prepareStyles(mergeStyles(...args)); - }, - - componentWillMount() { - warn(); - }, -}; diff --git a/src/utils/styleResizable.js b/src/utils/styleResizable.js deleted file mode 100644 index 88e2ce01b1e87d..00000000000000 --- a/src/utils/styleResizable.js +++ /dev/null @@ -1,66 +0,0 @@ -import Events from './events'; -import warning from 'warning'; - -let hasWarned; -const warn = () => { - warning(hasWarned, `The 'material-ui/utils/styleResizable.js' mixin has been deprecated. - It will be removed with v0.16.0.` - ); - hasWarned = true; -}; - -const Sizes = { - SMALL: 1, - MEDIUM: 2, - LARGE: 3, -}; - -export default { - - statics: { - Sizes: Sizes, - }, - - getInitialState() { - return { - deviceSize: Sizes.SMALL, - }; - }, - - componentDidMount() { - this.updateDeviceSize(); - if (!this.manuallyBindResize) this.bindResize(); - }, - - componentWillMount() { - warn(); - }, - - componentWillUnmount() { - this.unbindResize(); - }, - - isDeviceSize(desiredSize) { - return this.state.deviceSize >= desiredSize; - }, - - updateDeviceSize() { - const width = window.innerWidth; - - if (width >= 992) { - this.setState({deviceSize: Sizes.LARGE}); - } else if (width >= 768) { - this.setState({deviceSize: Sizes.MEDIUM}); - } else { // width < 768 - this.setState({deviceSize: Sizes.SMALL}); - } - }, - - bindResize() { - Events.on(window, 'resize', this.updateDeviceSize); - }, - - unbindResize() { - Events.off(window, 'resize', this.updateDeviceSize); - }, -}; diff --git a/src/utils/styles.js b/src/utils/styles.js deleted file mode 100644 index 2c2083845c6698..00000000000000 --- a/src/utils/styles.js +++ /dev/null @@ -1,23 +0,0 @@ -import warning from 'warning'; - -let hasWarned; -const warn = () => { - warning(hasWarned, `The 'material-ui/lib/utils/styles.js' utility module has been deprecated. - It will be removed with v0.16.0.`); - hasWarned = true; -}; - -export const mergeStyles = (...args) => { - warn(); - return Object.assign({}, ...args); -}; - -export function prepareStyles(muiTheme, ...styles) { - warn(); - return muiTheme.prepareStyles(...styles); -} - -export default { - mergeStyles, - prepareStyles, -};