@styled-system/css
Advanced tools
Comparing version 5.0.0-alpha.0 to 5.0.0
@@ -114,3 +114,3 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
var next = {}; | ||
var breakpoints = get(theme, 'breakpoints', ['40em', '52em', '64em']); | ||
var breakpoints = get(theme, 'breakpoints', defaultBreakpoints); | ||
var mediaQueries = [null].concat(breakpoints.map(function (n) { | ||
@@ -117,0 +117,0 @@ return "@media screen and (min-width: " + n + ")"; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
exports.__esModule = true; | ||
exports["default"] = exports.css = exports.responsive = exports.get = void 0; | ||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")); | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } | ||
// based on https://github.com/developit/dlv | ||
var get = function get(obj, key, def, p, undef) { | ||
if (key === void 0) { | ||
key = ''; | ||
} | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } | ||
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } | ||
function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } | ||
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } | ||
// based on https://github.com/developit/dlv | ||
var get = function get(obj) { | ||
var key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; | ||
var def = arguments.length > 2 ? arguments[2] : undefined; | ||
var p = arguments.length > 3 ? arguments[3] : undefined; | ||
var undef = arguments.length > 4 ? arguments[4] : undefined; | ||
key = key.split ? key.split('.') : [key]; | ||
@@ -137,6 +125,6 @@ | ||
var next = {}; | ||
var breakpoints = get(theme, 'breakpoints', ['40em', '52em', '64em']); | ||
var mediaQueries = [null].concat(_toConsumableArray(breakpoints.map(function (n) { | ||
return "@media screen and (min-width: ".concat(n, ")"); | ||
}))); | ||
var breakpoints = get(theme, 'breakpoints', defaultBreakpoints); | ||
var mediaQueries = [null].concat(breakpoints.map(function (n) { | ||
return "@media screen and (min-width: " + n + ")"; | ||
})); | ||
@@ -171,7 +159,8 @@ for (var key in styles) { | ||
var css = function css(args) { | ||
return function () { | ||
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
return function (props) { | ||
if (props === void 0) { | ||
props = {}; | ||
} | ||
var theme = _objectSpread({}, defaultTheme, props.theme || props); | ||
var theme = (0, _extends2["default"])({}, defaultTheme, props.theme || props); | ||
var result = {}; | ||
@@ -190,7 +179,7 @@ var obj = typeof args === 'function' ? args(theme) : args; | ||
var variant = css(get(theme, val))(theme); | ||
result = _objectSpread({}, result, variant); | ||
result = (0, _extends2["default"])({}, result, variant); | ||
continue; | ||
} | ||
if (val && _typeof(val) === 'object') { | ||
if (val && typeof val === 'object') { | ||
result[prop] = css(val)(theme); | ||
@@ -197,0 +186,0 @@ continue; |
{ | ||
"name": "@styled-system/css", | ||
"version": "5.0.0-alpha.0", | ||
"version": "5.0.0", | ||
"description": "Styled System for the `css` prop", | ||
"main": "dist/index.js", | ||
"module": "dist/index.esm.js", | ||
"sideEffects": false, | ||
"scripts": { | ||
"prepare": "babel src -d dist" | ||
}, | ||
"keywords": [ | ||
@@ -20,6 +18,3 @@ "css", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"@babel/cli": "^7.4.4" | ||
}, | ||
"gitHead": "5357d5b7338f1236054dcd026bb27d8ca6a8e146", | ||
"gitHead": "e67157cfd0222c355826adf5ad271534653c00df", | ||
"publishConfig": { | ||
@@ -26,0 +21,0 @@ "access": "public" |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
0
1
13354
345