Comparing version 3.0.0 to 3.1.0
58
dist.js
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -6,22 +6,28 @@ Object.defineProperty(exports, "__esModule", { | ||
}); | ||
exports.Tag = exports.omit = undefined; | ||
exports.default = exports.Tag = exports.omit = void 0; | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
var _react = _interopRequireDefault(require("react")); | ||
var _react = require('react'); | ||
var _styledSystem = require("styled-system"); | ||
var _react2 = _interopRequireDefault(_react); | ||
var _htmlTags = _interopRequireDefault(require("html-tags")); | ||
var _styledSystem = require('styled-system'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var _htmlTags = require('html-tags'); | ||
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; } | ||
var _htmlTags2 = _interopRequireDefault(_htmlTags); | ||
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 _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } | ||
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } | ||
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } | ||
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } | ||
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; } } | ||
var allPropTypes = Object.keys(_styledSystem.styles).filter(function (key) { | ||
@@ -32,7 +38,7 @@ return typeof _styledSystem.styles[key] === 'function'; | ||
}, {}); | ||
var omitProps = [].concat(_toConsumableArray(Object.keys(allPropTypes)), ['theme']); | ||
var omit = exports.omit = function omit(obj, keys) { | ||
var omit = function omit(obj, keys) { | ||
var next = {}; | ||
for (var key in obj) { | ||
@@ -42,13 +48,16 @@ if (keys.indexOf(key) > -1) continue; | ||
} | ||
return next; | ||
}; | ||
var Tag = _react2.default.forwardRef(function (_ref, ref) { | ||
exports.omit = omit; | ||
var Tag = _react.default.forwardRef(function (_ref, ref) { | ||
var _ref$is = _ref.is, | ||
Tag = _ref$is === undefined ? 'div' : _ref$is, | ||
Tag = _ref$is === void 0 ? 'div' : _ref$is, | ||
_ref$omitProps = _ref.omitProps, | ||
omitProps = _ref$omitProps === undefined ? [] : _ref$omitProps, | ||
props = _objectWithoutProperties(_ref, ['is', 'omitProps']); | ||
omitProps = _ref$omitProps === void 0 ? [] : _ref$omitProps, | ||
props = _objectWithoutProperties(_ref, ["is", "omitProps"]); | ||
return _react2.default.createElement(Tag, _extends({ | ||
return _react.default.createElement(Tag, _objectSpread({ | ||
ref: ref | ||
@@ -60,3 +69,2 @@ }, omit(props, omitProps))); | ||
Tag.displayName = 'Clean.div'; | ||
Tag.defaultProps = { | ||
@@ -66,5 +74,8 @@ omitProps: omitProps | ||
_htmlTags2.default.forEach(function (tag) { | ||
Tag[tag] = _react2.default.forwardRef(function (props, ref) { | ||
return _react2.default.createElement(Tag, _extends({ ref: ref, is: tag }, props)); | ||
_htmlTags.default.forEach(function (tag) { | ||
Tag[tag] = _react.default.forwardRef(function (props, ref) { | ||
return _react.default.createElement(Tag, _objectSpread({ | ||
ref: ref, | ||
is: tag | ||
}, props)); | ||
}); | ||
@@ -74,2 +85,3 @@ Tag[tag].displayName = 'Clean.' + tag; | ||
exports.default = Tag; | ||
var _default = Tag; | ||
exports.default = _default; |
{ | ||
"name": "clean-tag", | ||
"version": "3.0.0", | ||
"version": "3.1.0", | ||
"description": "", | ||
@@ -16,20 +16,19 @@ "main": "dist.js", | ||
"html-tags": "^2.0.0", | ||
"react": "^16.8.1", | ||
"react": "^16.8.5", | ||
"styled-system": "^3.2.1" | ||
}, | ||
"devDependencies": { | ||
"ava": "^0.25.0", | ||
"babel-cli": "^6.26.0", | ||
"babel-preset-env": "^1.6.1", | ||
"babel-preset-stage-0": "^6.24.1", | ||
"babel-register": "^6.26.0", | ||
"nyc": "^11.4.1", | ||
"react-test-renderer": "^16.8.1" | ||
"@babel/cli": "^7.2.3", | ||
"@babel/core": "^7.4.0", | ||
"@babel/preset-env": "^7.4.2", | ||
"@babel/register": "^7.4.0", | ||
"ava": "^1.3.1", | ||
"nyc": "^13.3.0", | ||
"react-test-renderer": "^16.8.5" | ||
}, | ||
"ava": { | ||
"require": [ | ||
"babel-register" | ||
], | ||
"babel": "inherit" | ||
"@babel/register" | ||
] | ||
} | ||
} |
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
6915
5
98
Updatedreact@^16.8.5