@material-ui/system
Advanced tools
Comparing version 3.0.0-alpha.2 to 4.0.0-alpha.0
@@ -35,20 +35,20 @@ import warning from 'warning'; | ||
function getTransformer(theme) { | ||
const themeTransformer = theme.spacing && theme.spacing.unit != null ? theme.spacing.unit : theme.spacing || 8; | ||
const themeSpacing = theme.spacing || 8; | ||
if (typeof themeTransformer === 'number') { | ||
return abs => themeTransformer * abs; | ||
if (typeof themeSpacing === 'number') { | ||
return abs => themeSpacing * abs; | ||
} | ||
if (Array.isArray(themeTransformer)) { | ||
if (Array.isArray(themeSpacing)) { | ||
return abs => { | ||
process.env.NODE_ENV !== "production" ? warning(abs <= themeTransformer.length - 1, [`@material-ui/system: the value provided (${abs}) overflows.`, `The supported values are: ${JSON.stringify(themeTransformer)}.`, `${abs} > ${themeTransformer.length - 1}, you need to add the missing values.`].join('\n')) : void 0; | ||
return themeTransformer[abs]; | ||
process.env.NODE_ENV !== "production" ? warning(abs <= themeSpacing.length - 1, [`@material-ui/system: the value provided (${abs}) overflows.`, `The supported values are: ${JSON.stringify(themeSpacing)}.`, `${abs} > ${themeSpacing.length - 1}, you need to add the missing values.`].join('\n')) : void 0; | ||
return themeSpacing[abs]; | ||
}; | ||
} | ||
if (typeof themeTransformer === 'function') { | ||
return themeTransformer; | ||
if (typeof themeSpacing === 'function') { | ||
return themeSpacing; | ||
} | ||
process.env.NODE_ENV !== "production" ? warning(false, [`@material-ui/system: the \`theme.spacing\` value (${themeTransformer}) is invalid.`, 'It should be a number, an array or a function.'].join('\n')) : void 0; | ||
process.env.NODE_ENV !== "production" ? warning(false, [`@material-ui/system: the \`theme.spacing\` value (${themeSpacing}) is invalid.`, 'It should be a number, an array or a function.'].join('\n')) : void 0; | ||
return () => undefined; | ||
@@ -55,0 +55,0 @@ } |
@@ -1,2 +0,2 @@ | ||
/** @license Material-UI v3.0.0-alpha.2 | ||
/** @license Material-UI v4.0.0-alpha.0 | ||
* | ||
@@ -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": "3.0.0-alpha.2", | ||
"version": "4.0.0-alpha.0", | ||
"description": "Material-UI System - Design system for Material-UI.", | ||
@@ -24,6 +24,6 @@ "main": "./index.js", | ||
}, | ||
"homepage": "https://github.com/mui-org/material-ui/tree/master/packages/material-ui-system", | ||
"homepage": "https://github.com/mui-org/material-ui/tree/next/packages/material-ui-system", | ||
"peerDependencies": { | ||
"react": "^16.3.0", | ||
"react-dom": "^16.3.0" | ||
"react": "^16.8.0", | ||
"react-dom": "^16.8.0" | ||
}, | ||
@@ -41,5 +41,6 @@ "dependencies": { | ||
"engines": { | ||
"node": ">=6.0.0" | ||
"node": ">=8.0.0" | ||
}, | ||
"module": "./index.es.js" | ||
"module": "./esm/index.js", | ||
"typings": "./index.d.ts" | ||
} |
@@ -57,22 +57,22 @@ "use strict"; | ||
function getTransformer(theme) { | ||
var themeTransformer = theme.spacing && theme.spacing.unit != null ? theme.spacing.unit : theme.spacing || 8; | ||
var themeSpacing = theme.spacing || 8; | ||
if (typeof themeTransformer === 'number') { | ||
if (typeof themeSpacing === 'number') { | ||
return function (abs) { | ||
return themeTransformer * abs; | ||
return themeSpacing * abs; | ||
}; | ||
} | ||
if (Array.isArray(themeTransformer)) { | ||
if (Array.isArray(themeSpacing)) { | ||
return function (abs) { | ||
process.env.NODE_ENV !== "production" ? (0, _warning.default)(abs <= themeTransformer.length - 1, ["@material-ui/system: the value provided (".concat(abs, ") overflows."), "The supported values are: ".concat(JSON.stringify(themeTransformer), "."), "".concat(abs, " > ").concat(themeTransformer.length - 1, ", you need to add the missing values.")].join('\n')) : void 0; | ||
return themeTransformer[abs]; | ||
process.env.NODE_ENV !== "production" ? (0, _warning.default)(abs <= themeSpacing.length - 1, ["@material-ui/system: the value provided (".concat(abs, ") overflows."), "The supported values are: ".concat(JSON.stringify(themeSpacing), "."), "".concat(abs, " > ").concat(themeSpacing.length - 1, ", you need to add the missing values.")].join('\n')) : void 0; | ||
return themeSpacing[abs]; | ||
}; | ||
} | ||
if (typeof themeTransformer === 'function') { | ||
return themeTransformer; | ||
if (typeof themeSpacing === 'function') { | ||
return themeSpacing; | ||
} | ||
process.env.NODE_ENV !== "production" ? (0, _warning.default)(false, ["@material-ui/system: the `theme.spacing` value (".concat(themeTransformer, ") is invalid."), 'It should be a number, an array or a function.'].join('\n')) : void 0; | ||
process.env.NODE_ENV !== "production" ? (0, _warning.default)(false, ["@material-ui/system: the `theme.spacing` value (".concat(themeSpacing, ") is invalid."), 'It should be a number, an array or a function.'].join('\n')) : void 0; | ||
return function () { | ||
@@ -79,0 +79,0 @@ return undefined; |
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
432381
55
1805
27