@cloudflare/component-text
Advanced tools
Comparing version 2.0.20 to 2.0.21
@@ -6,3 +6,11 @@ # Change Log | ||
<a name="2.0.20"></a> | ||
<a name="2.0.21"></a> | ||
## [2.0.21](http://stash.cfops.it:7999/fe/stratus/compare/@cloudflare/component-text@2.0.20...@cloudflare/component-text@2.0.21) (2018-09-21) | ||
**Note:** Version bump only for package @cloudflare/component-text | ||
<a name="2.0.20"></a> | ||
## [2.0.20](http://stash.cfops.it:7999/fe/stratus/compare/@cloudflare/component-text@2.0.19...@cloudflare/component-text@2.0.20) (2018-09-10) | ||
@@ -15,3 +23,3 @@ | ||
<a name="2.0.19"></a> | ||
<a name="2.0.19"></a> | ||
## [2.0.19](http://stash.cfops.it:7999/fe/stratus/compare/@cloudflare/component-text@2.0.18...@cloudflare/component-text@2.0.19) (2018-08-22) | ||
@@ -24,3 +32,3 @@ | ||
<a name="2.0.18"></a> | ||
<a name="2.0.18"></a> | ||
## [2.0.18](http://stash.cfops.it:7999/fe/stratus/compare/@cloudflare/component-text@2.0.17...@cloudflare/component-text@2.0.18) (2018-08-17) | ||
@@ -27,0 +35,0 @@ |
@@ -0,12 +1,30 @@ | ||
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); } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } | ||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } | ||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } | ||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { createStyledComponent } from '@cloudflare/style-container'; | ||
const fontSizes = { | ||
var fontSizes = { | ||
normal: 3, | ||
small: 2 | ||
}; | ||
const lineHeights = { | ||
var lineHeights = { | ||
small: 1.25 | ||
}; | ||
const colors = { | ||
var colors = { | ||
info: 'blue.4', | ||
@@ -18,3 +36,3 @@ success: 'green.5', | ||
}; | ||
const fontWeights = { | ||
var fontWeights = { | ||
normal: 400, | ||
@@ -24,3 +42,3 @@ bold: 700, | ||
}; | ||
const textAlign = { | ||
var textAlign = { | ||
start: 'left', | ||
@@ -32,33 +50,47 @@ center: 'center', | ||
const styles = ({ | ||
size, | ||
weight, | ||
align, | ||
type, | ||
case: textCase | ||
}) => ({ | ||
color: type && colors[type], | ||
lineHeight: size && lineHeights[size], | ||
fontSize: size && fontSizes[size], | ||
fontWeight: weight && fontWeights[weight], | ||
textAlign: align && textAlign[align], | ||
textTransform: textCase, | ||
'&:first-letter': { | ||
textTransform: textCase && textCase === 'titlecase' && 'capitalize' | ||
} | ||
}); | ||
var styles = function styles(_ref) { | ||
var size = _ref.size, | ||
weight = _ref.weight, | ||
align = _ref.align, | ||
type = _ref.type, | ||
textCase = _ref.case; | ||
return { | ||
color: type && colors[type], | ||
lineHeight: size && lineHeights[size], | ||
fontSize: size && fontSizes[size], | ||
fontWeight: weight && fontWeights[weight], | ||
textAlign: align && textAlign[align], | ||
textTransform: textCase, | ||
'&:first-letter': { | ||
textTransform: textCase && textCase === 'titlecase' && 'capitalize' | ||
} | ||
}; | ||
}; | ||
class Text extends React.Component { | ||
render() { | ||
const { | ||
className, | ||
children | ||
} = this.props; | ||
return React.createElement("div", { | ||
className: className | ||
}, children); | ||
var Text = | ||
/*#__PURE__*/ | ||
function (_React$Component) { | ||
_inherits(Text, _React$Component); | ||
function Text() { | ||
_classCallCheck(this, Text); | ||
return _possibleConstructorReturn(this, _getPrototypeOf(Text).apply(this, arguments)); | ||
} | ||
} | ||
_createClass(Text, [{ | ||
key: "render", | ||
value: function render() { | ||
var _this$props = this.props, | ||
className = _this$props.className, | ||
children = _this$props.children; | ||
return React.createElement("div", { | ||
className: className | ||
}, children); | ||
} | ||
}]); | ||
return Text; | ||
}(React.Component); | ||
Text.propTypes = { | ||
@@ -65,0 +97,0 @@ size: PropTypes.oneOf(['normal', 'small']), |
@@ -8,3 +8,3 @@ "use strict"; | ||
enumerable: true, | ||
get: function () { | ||
get: function get() { | ||
return _Text.default; | ||
@@ -11,0 +11,0 @@ } |
@@ -16,10 +16,28 @@ "use strict"; | ||
const fontSizes = { | ||
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); } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } | ||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } | ||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } | ||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
var fontSizes = { | ||
normal: 3, | ||
small: 2 | ||
}; | ||
const lineHeights = { | ||
var lineHeights = { | ||
small: 1.25 | ||
}; | ||
const colors = { | ||
var colors = { | ||
info: 'blue.4', | ||
@@ -31,3 +49,3 @@ success: 'green.5', | ||
}; | ||
const fontWeights = { | ||
var fontWeights = { | ||
normal: 400, | ||
@@ -37,3 +55,3 @@ bold: 700, | ||
}; | ||
const textAlign = { | ||
var textAlign = { | ||
start: 'left', | ||
@@ -45,33 +63,47 @@ center: 'center', | ||
const styles = ({ | ||
size, | ||
weight, | ||
align, | ||
type, | ||
case: textCase | ||
}) => ({ | ||
color: type && colors[type], | ||
lineHeight: size && lineHeights[size], | ||
fontSize: size && fontSizes[size], | ||
fontWeight: weight && fontWeights[weight], | ||
textAlign: align && textAlign[align], | ||
textTransform: textCase, | ||
'&:first-letter': { | ||
textTransform: textCase && textCase === 'titlecase' && 'capitalize' | ||
} | ||
}); | ||
var styles = function styles(_ref) { | ||
var size = _ref.size, | ||
weight = _ref.weight, | ||
align = _ref.align, | ||
type = _ref.type, | ||
textCase = _ref.case; | ||
return { | ||
color: type && colors[type], | ||
lineHeight: size && lineHeights[size], | ||
fontSize: size && fontSizes[size], | ||
fontWeight: weight && fontWeights[weight], | ||
textAlign: align && textAlign[align], | ||
textTransform: textCase, | ||
'&:first-letter': { | ||
textTransform: textCase && textCase === 'titlecase' && 'capitalize' | ||
} | ||
}; | ||
}; | ||
class Text extends _react.default.Component { | ||
render() { | ||
const { | ||
className, | ||
children | ||
} = this.props; | ||
return _react.default.createElement("div", { | ||
className: className | ||
}, children); | ||
var Text = | ||
/*#__PURE__*/ | ||
function (_React$Component) { | ||
_inherits(Text, _React$Component); | ||
function Text() { | ||
_classCallCheck(this, Text); | ||
return _possibleConstructorReturn(this, _getPrototypeOf(Text).apply(this, arguments)); | ||
} | ||
} | ||
_createClass(Text, [{ | ||
key: "render", | ||
value: function render() { | ||
var _this$props = this.props, | ||
className = _this$props.className, | ||
children = _this$props.children; | ||
return _react.default.createElement("div", { | ||
className: className | ||
}, children); | ||
} | ||
}]); | ||
return Text; | ||
}(_react.default.Component); | ||
Text.propTypes = { | ||
@@ -78,0 +110,0 @@ size: _propTypes.default.oneOf(['normal', 'small']), |
{ | ||
"name": "@cloudflare/component-text", | ||
"description": "Cloudflare Text Component", | ||
"version": "2.0.20", | ||
"version": "2.0.21", | ||
"main": "lib/index.js", | ||
@@ -15,3 +15,3 @@ "module": "es/index.js", | ||
"dependencies": { | ||
"@cloudflare/style-container": "^4.0.12", | ||
"@cloudflare/style-container": "^4.0.13", | ||
"prop-types": "^15.6.0" | ||
@@ -18,0 +18,0 @@ }, |
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
28059
264