@material-ui/styles
Advanced tools
Comparing version 4.0.0-alpha.4 to 4.0.0-alpha.5
@@ -7,8 +7,6 @@ import _extends from "@babel/runtime/helpers/extends"; | ||
import hoistNonReactStatics from 'hoist-non-react-statics'; | ||
import { chainPropTypes, getDisplayName, ponyfillGlobal } from '@material-ui/utils'; | ||
import { chainPropTypes, getDisplayName } from '@material-ui/utils'; | ||
import makeStyles from '../makeStyles'; | ||
import getThemeProps from '../getThemeProps'; | ||
import useTheme from '../useTheme'; | ||
import mergeClasses from '../mergeClasses'; | ||
import getStylesCreator from '../getStylesCreator'; // Link a style sheet with a component. | ||
import useTheme from '../useTheme'; // Link a style sheet with a component. | ||
// It does not modify the component passed to it; | ||
@@ -43,3 +41,3 @@ // instead, it returns a new component, with a `classes` property. | ||
}, stylesOptions)); | ||
let WithStyles = React.forwardRef(function WithStyles(props, ref) { | ||
const WithStyles = React.forwardRef(function WithStyles(props, ref) { | ||
const { | ||
@@ -79,44 +77,2 @@ innerRef | ||
}); | ||
if (process.env.NODE_ENV === 'test' && !ponyfillGlobal.disableShallowSupport) { | ||
// Generate a fake classes object. | ||
const stylesCreator = getStylesCreator(stylesOrCreator); | ||
const styles = stylesCreator.create(defaultTheme, name); | ||
const classes = Object.keys(styles).reduce((acc, key) => { | ||
acc[key] = `${name}-${key}`; | ||
return acc; | ||
}, {}); | ||
class WithStylesTest extends React.Component { | ||
render() { | ||
// eslint-disable-next-line react/prop-types | ||
const _this$props = this.props, | ||
{ | ||
classes: newClasses, | ||
innerRef | ||
} = _this$props, | ||
other = _objectWithoutPropertiesLoose(_this$props, ["classes", "innerRef"]); | ||
const more = other; | ||
if (withTheme && !more.theme) { | ||
more.theme = defaultTheme; | ||
} | ||
return React.createElement(Component, _extends({ | ||
ref: innerRef, | ||
classes: mergeClasses({ | ||
baseClasses: classes, | ||
newClasses | ||
}) | ||
}, more)); | ||
} | ||
} | ||
WithStylesTest.Original = WithStyles; | ||
WithStyles = WithStylesTest; | ||
WithStyles.classes = classes; | ||
} | ||
process.env.NODE_ENV !== "production" ? WithStyles.propTypes = { | ||
@@ -154,2 +110,3 @@ /** | ||
WithStyles.options = options; | ||
WithStyles.useStyles = useStyles; | ||
} | ||
@@ -156,0 +113,0 @@ |
@@ -6,3 +6,3 @@ import _extends from "@babel/runtime/helpers/extends"; | ||
import hoistNonReactStatics from 'hoist-non-react-statics'; | ||
import { chainPropTypes, getDisplayName, ponyfillGlobal } from '@material-ui/utils'; | ||
import { chainPropTypes, getDisplayName } from '@material-ui/utils'; | ||
import useTheme from '../useTheme'; | ||
@@ -19,3 +19,3 @@ export function withThemeCreator(options = {}) { | ||
let WithTheme = React.forwardRef(function WithTheme(props, ref) { | ||
const WithTheme = React.forwardRef(function WithTheme(props, ref) { | ||
const { | ||
@@ -32,24 +32,2 @@ innerRef | ||
}); | ||
if (process.env.NODE_ENV === 'test' && !ponyfillGlobal.disableShallowSupport) { | ||
class WithThemeTest extends React.Component { | ||
render() { | ||
// eslint-disable-next-line react/prop-types | ||
const _this$props = this.props, | ||
{ | ||
innerRef | ||
} = _this$props, | ||
other = _objectWithoutPropertiesLoose(_this$props, ["innerRef"]); | ||
return React.createElement(Component, _extends({ | ||
theme: defaultTheme, | ||
ref: innerRef | ||
}, other)); | ||
} | ||
} | ||
WithTheme = WithThemeTest; | ||
} | ||
process.env.NODE_ENV !== "production" ? WithTheme.propTypes = { | ||
@@ -56,0 +34,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
/** @license Material-UI v4.0.0-alpha.4 | ||
/** @license Material-UI v4.0.0-alpha.5 | ||
* | ||
@@ -3,0 +3,0 @@ * This source code is licensed under the MIT license found in the |
@@ -1,6 +0,1 @@ | ||
import _classCallCheck from "@babel/runtime/helpers/classCallCheck"; | ||
import _createClass from "@babel/runtime/helpers/createClass"; | ||
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn"; | ||
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf"; | ||
import _inherits from "@babel/runtime/helpers/inherits"; | ||
import _extends from "@babel/runtime/helpers/extends"; | ||
@@ -12,8 +7,6 @@ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties"; | ||
import hoistNonReactStatics from 'hoist-non-react-statics'; | ||
import { chainPropTypes, getDisplayName, ponyfillGlobal } from '@material-ui/utils'; | ||
import { chainPropTypes, getDisplayName } from '@material-ui/utils'; | ||
import makeStyles from '../makeStyles'; | ||
import getThemeProps from '../getThemeProps'; | ||
import useTheme from '../useTheme'; | ||
import mergeClasses from '../mergeClasses'; | ||
import getStylesCreator from '../getStylesCreator'; // Link a style sheet with a component. | ||
import useTheme from '../useTheme'; // Link a style sheet with a component. | ||
// It does not modify the component passed to it; | ||
@@ -83,56 +76,2 @@ // instead, it returns a new component, with a `classes` property. | ||
}); | ||
if (process.env.NODE_ENV === 'test' && !ponyfillGlobal.disableShallowSupport) { | ||
// Generate a fake classes object. | ||
var stylesCreator = getStylesCreator(stylesOrCreator); | ||
var styles = stylesCreator.create(defaultTheme, name); | ||
var classes = Object.keys(styles).reduce(function (acc, key) { | ||
acc[key] = "".concat(name, "-").concat(key); | ||
return acc; | ||
}, {}); | ||
var WithStylesTest = | ||
/*#__PURE__*/ | ||
function (_React$Component) { | ||
_inherits(WithStylesTest, _React$Component); | ||
function WithStylesTest() { | ||
_classCallCheck(this, WithStylesTest); | ||
return _possibleConstructorReturn(this, _getPrototypeOf(WithStylesTest).apply(this, arguments)); | ||
} | ||
_createClass(WithStylesTest, [{ | ||
key: "render", | ||
value: function render() { | ||
// eslint-disable-next-line react/prop-types | ||
var _this$props = this.props, | ||
newClasses = _this$props.classes, | ||
innerRef = _this$props.innerRef, | ||
other = _objectWithoutProperties(_this$props, ["classes", "innerRef"]); | ||
var more = other; | ||
if (withTheme && !more.theme) { | ||
more.theme = defaultTheme; | ||
} | ||
return React.createElement(Component, _extends({ | ||
ref: innerRef, | ||
classes: mergeClasses({ | ||
baseClasses: classes, | ||
newClasses: newClasses | ||
}) | ||
}, more)); | ||
} | ||
}]); | ||
return WithStylesTest; | ||
}(React.Component); | ||
WithStylesTest.Original = WithStyles; | ||
WithStyles = WithStylesTest; | ||
WithStyles.classes = classes; | ||
} | ||
process.env.NODE_ENV !== "production" ? WithStyles.propTypes = { | ||
@@ -170,2 +109,3 @@ /** | ||
WithStyles.options = options; | ||
WithStyles.useStyles = useStyles; | ||
} | ||
@@ -172,0 +112,0 @@ |
@@ -1,6 +0,1 @@ | ||
import _classCallCheck from "@babel/runtime/helpers/classCallCheck"; | ||
import _createClass from "@babel/runtime/helpers/createClass"; | ||
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn"; | ||
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf"; | ||
import _inherits from "@babel/runtime/helpers/inherits"; | ||
import _extends from "@babel/runtime/helpers/extends"; | ||
@@ -11,3 +6,3 @@ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties"; | ||
import hoistNonReactStatics from 'hoist-non-react-statics'; | ||
import { chainPropTypes, getDisplayName, ponyfillGlobal } from '@material-ui/utils'; | ||
import { chainPropTypes, getDisplayName } from '@material-ui/utils'; | ||
import useTheme from '../useTheme'; | ||
@@ -33,36 +28,2 @@ export function withThemeCreator() { | ||
}); | ||
if (process.env.NODE_ENV === 'test' && !ponyfillGlobal.disableShallowSupport) { | ||
var WithThemeTest = | ||
/*#__PURE__*/ | ||
function (_React$Component) { | ||
_inherits(WithThemeTest, _React$Component); | ||
function WithThemeTest() { | ||
_classCallCheck(this, WithThemeTest); | ||
return _possibleConstructorReturn(this, _getPrototypeOf(WithThemeTest).apply(this, arguments)); | ||
} | ||
_createClass(WithThemeTest, [{ | ||
key: "render", | ||
value: function render() { | ||
// eslint-disable-next-line react/prop-types | ||
var _this$props = this.props, | ||
innerRef = _this$props.innerRef, | ||
other = _objectWithoutProperties(_this$props, ["innerRef"]); | ||
return React.createElement(Component, _extends({ | ||
theme: defaultTheme, | ||
ref: innerRef | ||
}, other)); | ||
} | ||
}]); | ||
return WithThemeTest; | ||
}(React.Component); | ||
WithTheme = WithThemeTest; | ||
} | ||
process.env.NODE_ENV !== "production" ? WithTheme.propTypes = { | ||
@@ -69,0 +30,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
/** @license Material-UI v4.0.0-alpha.4 | ||
/** @license Material-UI v4.0.0-alpha.5 | ||
* | ||
@@ -3,0 +3,0 @@ * This source code is licensed under the MIT license found in the |
@@ -5,3 +5,3 @@ { | ||
"author": "Material-UI Team", | ||
"version": "4.0.0-alpha.4", | ||
"version": "4.0.0-alpha.5", | ||
"description": "Material-UI Styles - The styling solution of Material-UI.", | ||
@@ -8,0 +8,0 @@ "main": "./index.js", |
@@ -10,12 +10,2 @@ "use strict"; | ||
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")); | ||
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass")); | ||
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn")); | ||
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf")); | ||
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits")); | ||
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")); | ||
@@ -41,6 +31,2 @@ | ||
var _mergeClasses = _interopRequireDefault(require("../mergeClasses")); | ||
var _getStylesCreator = _interopRequireDefault(require("../getStylesCreator")); | ||
// Link a style sheet with a component. | ||
@@ -111,52 +97,2 @@ // It does not modify the component passed to it; | ||
if (process.env.NODE_ENV === 'test' && !_utils.ponyfillGlobal.disableShallowSupport) { | ||
// Generate a fake classes object. | ||
var stylesCreator = (0, _getStylesCreator.default)(stylesOrCreator); | ||
var styles = stylesCreator.create(defaultTheme, name); | ||
var classes = Object.keys(styles).reduce(function (acc, key) { | ||
acc[key] = "".concat(name, "-").concat(key); | ||
return acc; | ||
}, {}); | ||
var WithStylesTest = | ||
/*#__PURE__*/ | ||
function (_React$Component) { | ||
(0, _inherits2.default)(WithStylesTest, _React$Component); | ||
function WithStylesTest() { | ||
(0, _classCallCheck2.default)(this, WithStylesTest); | ||
return (0, _possibleConstructorReturn2.default)(this, (0, _getPrototypeOf2.default)(WithStylesTest).apply(this, arguments)); | ||
} | ||
(0, _createClass2.default)(WithStylesTest, [{ | ||
key: "render", | ||
value: function render() { | ||
// eslint-disable-next-line react/prop-types | ||
var _this$props = this.props, | ||
newClasses = _this$props.classes, | ||
innerRef = _this$props.innerRef, | ||
other = (0, _objectWithoutProperties2.default)(_this$props, ["classes", "innerRef"]); | ||
var more = other; | ||
if (withTheme && !more.theme) { | ||
more.theme = defaultTheme; | ||
} | ||
return _react.default.createElement(Component, (0, _extends2.default)({ | ||
ref: innerRef, | ||
classes: (0, _mergeClasses.default)({ | ||
baseClasses: classes, | ||
newClasses: newClasses | ||
}) | ||
}, more)); | ||
} | ||
}]); | ||
return WithStylesTest; | ||
}(_react.default.Component); | ||
WithStylesTest.Original = WithStyles; | ||
WithStyles = WithStylesTest; | ||
WithStyles.classes = classes; | ||
} | ||
process.env.NODE_ENV !== "production" ? WithStyles.propTypes = { | ||
@@ -194,2 +130,3 @@ /** | ||
WithStyles.options = options; | ||
WithStyles.useStyles = useStyles; | ||
} | ||
@@ -196,0 +133,0 @@ |
@@ -11,12 +11,2 @@ "use strict"; | ||
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")); | ||
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass")); | ||
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn")); | ||
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf")); | ||
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits")); | ||
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")); | ||
@@ -55,32 +45,2 @@ | ||
if (process.env.NODE_ENV === 'test' && !_utils.ponyfillGlobal.disableShallowSupport) { | ||
var WithThemeTest = | ||
/*#__PURE__*/ | ||
function (_React$Component) { | ||
(0, _inherits2.default)(WithThemeTest, _React$Component); | ||
function WithThemeTest() { | ||
(0, _classCallCheck2.default)(this, WithThemeTest); | ||
return (0, _possibleConstructorReturn2.default)(this, (0, _getPrototypeOf2.default)(WithThemeTest).apply(this, arguments)); | ||
} | ||
(0, _createClass2.default)(WithThemeTest, [{ | ||
key: "render", | ||
value: function render() { | ||
// eslint-disable-next-line react/prop-types | ||
var _this$props = this.props, | ||
innerRef = _this$props.innerRef, | ||
other = (0, _objectWithoutProperties2.default)(_this$props, ["innerRef"]); | ||
return _react.default.createElement(Component, (0, _extends2.default)({ | ||
theme: defaultTheme, | ||
ref: innerRef | ||
}, other)); | ||
} | ||
}]); | ||
return WithThemeTest; | ||
}(_react.default.Component); | ||
WithTheme = WithThemeTest; | ||
} | ||
process.env.NODE_ENV !== "production" ? WithTheme.propTypes = { | ||
@@ -87,0 +47,0 @@ /** |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
99
0
522224
3041