@cloudflare/component-text
Advanced tools
Comparing version 2.3.62 to 3.0.0
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 +18,3 @@ success: 'green.5', | ||
}; | ||
const fontWeights = { | ||
var fontWeights = { | ||
normal: 400, | ||
@@ -24,3 +24,3 @@ bold: 700, | ||
}; | ||
const textAlign = { | ||
var textAlign = { | ||
start: 'left', | ||
@@ -32,26 +32,30 @@ 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 = _ref => { | ||
var { | ||
size, | ||
weight, | ||
align, | ||
type, | ||
case: textCase | ||
} = _ref; | ||
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 _this$props = this.props, | ||
className = _this$props.className, | ||
role = _this$props.role, | ||
children = _this$props.children; | ||
var { | ||
className, | ||
role, | ||
children | ||
} = this.props; | ||
return /*#__PURE__*/React.createElement("div", { | ||
@@ -58,0 +62,0 @@ className: className, |
"use strict"; | ||
function _typeof(obj) { "@babel/helpers - typeof"; 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 _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } | ||
@@ -22,14 +22,18 @@ Object.defineProperty(exports, "__esModule", { | ||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } | ||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } | ||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
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 } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); } | ||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } | ||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } 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 _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } | ||
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 _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
var fontSizes = { | ||
@@ -83,6 +87,8 @@ normal: 3, | ||
var _super = _createSuper(Text); | ||
function Text() { | ||
_classCallCheck(this, Text); | ||
return _possibleConstructorReturn(this, _getPrototypeOf(Text).apply(this, arguments)); | ||
return _super.apply(this, arguments); | ||
} | ||
@@ -89,0 +95,0 @@ |
{ | ||
"name": "@cloudflare/component-text", | ||
"description": "Cloudflare Text Component", | ||
"version": "2.3.62", | ||
"version": "3.0.0", | ||
"main": "lib/index.js", | ||
@@ -10,7 +10,7 @@ "module": "es/index.js", | ||
"publishConfig": { | ||
"registry": "https://registry.npmjs.org/", | ||
"access": "public" | ||
"access": "public", | ||
"main": "lib/index.js", | ||
"module": "es/index.js" | ||
}, | ||
"dependencies": { | ||
"@cloudflare/style-container": "^7.8.46", | ||
"@cloudflare/types": "^6.15.15", | ||
@@ -20,2 +20,3 @@ "prop-types": "^15.6.0" | ||
"peerDependencies": { | ||
"@cloudflare/style-container": "^7.9.0", | ||
"react": "^15.0.0-0 || ^16.0.0-0 || ^17.0.0-0" | ||
@@ -32,4 +33,3 @@ }, | ||
"test-watch": "stratus test --watch" | ||
}, | ||
"gitHead": "db9637310d476ef91a50177d026526ca40cb9330" | ||
} | ||
} | ||
} |
Sorry, the diff of this file is too big to display
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
207
127601
- Removed@cloudflare/style-container@^7.8.46