styled-system
Advanced tools
Comparing version 1.0.8 to 1.1.0
'use strict'; | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
var React = require('react'); | ||
var cleanElement = function cleanElement(Component) { | ||
var Cleaned = function Cleaned(props) { | ||
var next = {}; | ||
var keys = Object.keys(Cleaned.propTypes || {}); | ||
for (var key in props) { | ||
if (keys.includes(key)) continue; | ||
next[key] = props[key]; | ||
return function (_React$Component) { | ||
_inherits(Cleaned, _React$Component); | ||
function Cleaned() { | ||
_classCallCheck(this, Cleaned); | ||
return _possibleConstructorReturn(this, (Cleaned.__proto__ || Object.getPrototypeOf(Cleaned)).apply(this, arguments)); | ||
} | ||
return React.createElement(Component, next); | ||
}; | ||
_createClass(Cleaned, [{ | ||
key: 'render', | ||
value: function render() { | ||
var next = {}; | ||
var keys = Object.keys(Cleaned.propTypes || {}); | ||
for (var key in this.props) { | ||
if (keys.includes(key)) continue; | ||
next[key] = this.props[key]; | ||
} | ||
return Cleaned; | ||
return React.createElement(Component, next); | ||
} | ||
}]); | ||
return Cleaned; | ||
}(React.Component); | ||
}; | ||
module.exports = cleanElement; |
@@ -16,3 +16,5 @@ 'use strict'; | ||
var textAlign = require('./text-align'); | ||
var lineHeight = require('./line-height'); | ||
var fontWeight = require('./font-weight'); | ||
var letterSpacing = require('./letter-spacing'); | ||
var alignItems = require('./align-items'); | ||
@@ -50,3 +52,5 @@ var justifyContent = require('./justify-content'); | ||
textAlign: textAlign, | ||
lineHeight: lineHeight, | ||
fontWeight: fontWeight, | ||
letterSpacing: letterSpacing, | ||
alignItems: alignItems, | ||
@@ -53,0 +57,0 @@ justifyContent: justifyContent, |
{ | ||
"name": "styled-system", | ||
"version": "1.0.8", | ||
"version": "1.1.0", | ||
"description": "Design system utilities for styled-components, glamorous, and other css-in-js libraries", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -100,3 +100,3 @@ # styled-system | ||
- [width](#width-responsive) | ||
- [fontSize](#fontSize-responsive) | ||
- [fontSize](#fontsize-responsive) | ||
- [color](#color-responsive) (and background-color) | ||
@@ -106,3 +106,5 @@ - [Responsive Styles](#responsive-styles) | ||
- [textAlign](#textalign-responsive) | ||
- [lineHeight](#lineheight) | ||
- [fontWeight](#fontweight) | ||
- [letterSpacing](#letterspacing) | ||
- [alignItems](#alignitems-responsive) | ||
@@ -124,3 +126,3 @@ - [justifyContent](#justifycontent-responsive) | ||
- [theme](#theme) | ||
- [propTypes](#proptype) | ||
- [propTypes](#proptypes) | ||
- [cleanElement](#cleanelement) | ||
@@ -240,2 +242,10 @@ - [removeProps](#removeprops) | ||
### lineHeight | ||
```js | ||
import { lineHeight } from 'styled-system' | ||
// <Text lineHeight={1} /> | ||
// props.theme.lineHeights[1] | ||
``` | ||
### fontWeight | ||
@@ -249,2 +259,10 @@ | ||
### letterSpacing | ||
```js | ||
import { letterSpacing } from 'styled-system' | ||
// <Text letterSpacing={1} /> | ||
// props.theme.letterSpacings[1] | ||
``` | ||
### alignItems (responsive) | ||
@@ -523,3 +541,3 @@ | ||
const checkedStyle = pseudoStyle('checked', 'checkedSyle')({ | ||
const checkedStyle = pseudoStyle('checked', 'checkedStyle')({ | ||
// keys for theme-based values | ||
@@ -526,0 +544,0 @@ color: 'colors', |
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
39455
35
653
657