@khanacademy/wonder-blocks-progress-spinner
Advanced tools
Comparing version 1.1.24 to 1.1.25
@@ -1,123 +0,7 @@ | ||
import { createElement, Component } from 'react'; | ||
import { Component, createElement } from 'react'; | ||
import { StyleSheet } from 'aphrodite'; | ||
import { addStyle, View } from '@khanacademy/wonder-blocks-core'; | ||
import { View, addStyle } from '@khanacademy/wonder-blocks-core'; | ||
import Color from '@khanacademy/wonder-blocks-color'; | ||
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 _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 _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 : 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); | ||
} | ||
function _isNativeReflectConstruct() { | ||
if (typeof Reflect === "undefined" || !Reflect.construct) return false; | ||
if (Reflect.construct.sham) return false; | ||
if (typeof Proxy === "function") return true; | ||
try { | ||
Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); | ||
return true; | ||
} catch (e) { | ||
return false; | ||
} | ||
} | ||
function _assertThisInitialized(self) { | ||
if (self === void 0) { | ||
throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); | ||
} | ||
return self; | ||
} | ||
function _possibleConstructorReturn(self, call) { | ||
if (call && (typeof call === "object" || typeof call === "function")) { | ||
return call; | ||
} | ||
return _assertThisInitialized(self); | ||
} | ||
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); | ||
}; | ||
} | ||
var heights = { | ||
const heights = { | ||
xsmall: 16, | ||
@@ -128,3 +12,3 @@ small: 24, | ||
}; | ||
var paths = { | ||
const paths = { | ||
xsmall: "M7.237.741C7.165.393 6.95.154 6.656.053A1.01 1.01 0 0 0 6.18.01c-.053.009-.053.009-.087.017C2.553.949 0 4.214 0 7.91 0 12.36 3.598 16 8 16c4.4 0 8-3.647 8-8.112a1.02 1.02 0 0 0-.118-.423.877.877 0 0 0-.808-.48.909.909 0 0 0-.81.46c-.09.151-.13.296-.146.455-.08 3.493-2.737 6.207-6.118 6.207-3.41 0-6.118-2.74-6.118-6.196 0-2.843 1.936-5.291 4.644-6.022.1-.028.224-.082.352-.177a.928.928 0 0 0 .36-.97z", | ||
@@ -135,7 +19,7 @@ small: "M10.598.943c-.093-.449-.362-.748-.732-.875a1.314 1.314 0 0 0-.723-.033C3.83 1.417 0 6.317 0 11.864 0 18.538 5.398 24 12 24c6.598 0 12-5.471 12-12.16a1.333 1.333 0 0 0-.154-.548c-.193-.368-.544-.606-1.023-.606-.472 0-.825.229-1.035.585-.117.2-.169.39-.189.582-.124 5.472-4.294 9.73-9.599 9.73-5.349 0-9.599-4.3-9.599-9.72 0-4.46 3.036-8.299 7.28-9.444.127-.036.291-.107.458-.232.373-.28.57-.711.46-1.244z", | ||
}; | ||
var colors = { | ||
const colors = { | ||
light: Color.white, | ||
dark: Color.offBlack16 | ||
}; | ||
var StyledPath = addStyle("path"); | ||
const StyledPath = addStyle("path"); | ||
@@ -146,49 +30,35 @@ /** | ||
*/ | ||
var CircularSpinner = /*#__PURE__*/function (_React$Component) { | ||
_inherits(CircularSpinner, _React$Component); | ||
var _super = _createSuper(CircularSpinner); | ||
function CircularSpinner() { | ||
_classCallCheck(this, CircularSpinner); | ||
return _super.apply(this, arguments); | ||
class CircularSpinner extends Component { | ||
render() { | ||
const { | ||
size, | ||
light, | ||
style | ||
} = this.props; | ||
const height = heights[size]; | ||
const path = paths[size]; | ||
const color = light ? colors.light : colors.dark; | ||
const svg = /*#__PURE__*/createElement("svg", { | ||
xmlns: "http://www.w3.org/2000/svg", | ||
width: height, | ||
height: height, | ||
viewBox: `0 0 ${height} ${height}` | ||
}, /*#__PURE__*/createElement(StyledPath, { | ||
style: [styles.loadingSpinner, { | ||
fill: color | ||
}], | ||
fillRule: "nonzero", | ||
d: path | ||
})); | ||
return /*#__PURE__*/createElement(View, { | ||
style: [styles.spinnerContainer, style] | ||
}, svg); | ||
} | ||
_createClass(CircularSpinner, [{ | ||
key: "render", | ||
value: function render() { | ||
var _this$props = this.props, | ||
size = _this$props.size, | ||
light = _this$props.light, | ||
style = _this$props.style; | ||
var height = heights[size]; | ||
var path = paths[size]; | ||
var color = light ? colors.light : colors.dark; | ||
var svg = /*#__PURE__*/createElement("svg", { | ||
xmlns: "http://www.w3.org/2000/svg", | ||
width: height, | ||
height: height, | ||
viewBox: "0 0 ".concat(height, " ").concat(height) | ||
}, /*#__PURE__*/createElement(StyledPath, { | ||
style: [styles.loadingSpinner, { | ||
fill: color | ||
}], | ||
fillRule: "nonzero", | ||
d: path | ||
})); | ||
return /*#__PURE__*/createElement(View, { | ||
style: [styles.spinnerContainer, style] | ||
}, svg); | ||
} | ||
}]); | ||
return CircularSpinner; | ||
}(Component); | ||
_defineProperty(CircularSpinner, "defaultProps", { | ||
} | ||
CircularSpinner.defaultProps = { | ||
size: "large", | ||
light: false | ||
}); | ||
var rotateKeyFrames = { | ||
}; | ||
const rotateKeyFrames = { | ||
"0%": { | ||
@@ -204,3 +74,3 @@ transform: "rotate(0deg)" | ||
}; | ||
var styles = StyleSheet.create({ | ||
const styles = StyleSheet.create({ | ||
spinnerContainer: { | ||
@@ -207,0 +77,0 @@ justifyContent: "center" |
@@ -137,31 +137,7 @@ module.exports = | ||
// CONCATENATED MODULE: ./packages/wonder-blocks-progress-spinner/src/components/circular-spinner.js | ||
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 _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 _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); } | ||
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; } 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 _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } | ||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
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; } | ||
var heights = { | ||
const heights = { | ||
xsmall: 16, | ||
@@ -172,3 +148,3 @@ small: 24, | ||
}; | ||
var paths = { | ||
const paths = { | ||
xsmall: "M7.237.741C7.165.393 6.95.154 6.656.053A1.01 1.01 0 0 0 6.18.01c-.053.009-.053.009-.087.017C2.553.949 0 4.214 0 7.91 0 12.36 3.598 16 8 16c4.4 0 8-3.647 8-8.112a1.02 1.02 0 0 0-.118-.423.877.877 0 0 0-.808-.48.909.909 0 0 0-.81.46c-.09.151-.13.296-.146.455-.08 3.493-2.737 6.207-6.118 6.207-3.41 0-6.118-2.74-6.118-6.196 0-2.843 1.936-5.291 4.644-6.022.1-.028.224-.082.352-.177a.928.928 0 0 0 .36-.97z", | ||
@@ -179,7 +155,7 @@ small: "M10.598.943c-.093-.449-.362-.748-.732-.875a1.314 1.314 0 0 0-.723-.033C3.83 1.417 0 6.317 0 11.864 0 18.538 5.398 24 12 24c6.598 0 12-5.471 12-12.16a1.333 1.333 0 0 0-.154-.548c-.193-.368-.544-.606-1.023-.606-.472 0-.825.229-1.035.585-.117.2-.169.39-.189.582-.124 5.472-4.294 9.73-9.599 9.73-5.349 0-9.599-4.3-9.599-9.72 0-4.46 3.036-8.299 7.28-9.444.127-.036.291-.107.458-.232.373-.28.57-.711.46-1.244z", | ||
}; | ||
var colors = { | ||
const colors = { | ||
light: wonder_blocks_color_default.a.white, | ||
dark: wonder_blocks_color_default.a.offBlack16 | ||
}; | ||
var StyledPath = Object(wonder_blocks_core_["addStyle"])("path"); | ||
const StyledPath = Object(wonder_blocks_core_["addStyle"])("path"); | ||
@@ -190,51 +166,35 @@ /** | ||
*/ | ||
var circular_spinner_CircularSpinner = /*#__PURE__*/function (_React$Component) { | ||
_inherits(CircularSpinner, _React$Component); | ||
var _super = _createSuper(CircularSpinner); | ||
function CircularSpinner() { | ||
_classCallCheck(this, CircularSpinner); | ||
return _super.apply(this, arguments); | ||
class circular_spinner_CircularSpinner extends external_react_["Component"] { | ||
render() { | ||
const { | ||
size, | ||
light, | ||
style | ||
} = this.props; | ||
const height = heights[size]; | ||
const path = paths[size]; | ||
const color = light ? colors.light : colors.dark; | ||
const svg = /*#__PURE__*/external_react_["createElement"]("svg", { | ||
xmlns: "http://www.w3.org/2000/svg", | ||
width: height, | ||
height: height, | ||
viewBox: `0 0 ${height} ${height}` | ||
}, /*#__PURE__*/external_react_["createElement"](StyledPath, { | ||
style: [styles.loadingSpinner, { | ||
fill: color | ||
}], | ||
fillRule: "nonzero", | ||
d: path | ||
})); | ||
return /*#__PURE__*/external_react_["createElement"](wonder_blocks_core_["View"], { | ||
style: [styles.spinnerContainer, style] | ||
}, svg); | ||
} | ||
_createClass(CircularSpinner, [{ | ||
key: "render", | ||
value: function render() { | ||
var _this$props = this.props, | ||
size = _this$props.size, | ||
light = _this$props.light, | ||
style = _this$props.style; | ||
var height = heights[size]; | ||
var path = paths[size]; | ||
var color = light ? colors.light : colors.dark; | ||
var svg = /*#__PURE__*/external_react_["createElement"]("svg", { | ||
xmlns: "http://www.w3.org/2000/svg", | ||
width: height, | ||
height: height, | ||
viewBox: "0 0 ".concat(height, " ").concat(height) | ||
}, /*#__PURE__*/external_react_["createElement"](StyledPath, { | ||
style: [styles.loadingSpinner, { | ||
fill: color | ||
}], | ||
fillRule: "nonzero", | ||
d: path | ||
})); | ||
return /*#__PURE__*/external_react_["createElement"](wonder_blocks_core_["View"], { | ||
style: [styles.spinnerContainer, style] | ||
}, svg); | ||
} | ||
}]); | ||
return CircularSpinner; | ||
}(external_react_["Component"]); | ||
_defineProperty(circular_spinner_CircularSpinner, "defaultProps", { | ||
} | ||
circular_spinner_CircularSpinner.defaultProps = { | ||
size: "large", | ||
light: false | ||
}); | ||
var rotateKeyFrames = { | ||
}; | ||
const rotateKeyFrames = { | ||
"0%": { | ||
@@ -250,3 +210,3 @@ transform: "rotate(0deg)" | ||
}; | ||
var styles = external_aphrodite_["StyleSheet"].create({ | ||
const styles = external_aphrodite_["StyleSheet"].create({ | ||
spinnerContainer: { | ||
@@ -253,0 +213,0 @@ justifyContent: "center" |
{ | ||
"name": "@khanacademy/wonder-blocks-progress-spinner", | ||
"version": "1.1.24", | ||
"version": "1.1.25", | ||
"design": "v1", | ||
@@ -18,5 +18,6 @@ "publishConfig": { | ||
"dependencies": { | ||
"@khanacademy/wonder-blocks-color": "^1.1.17", | ||
"@khanacademy/wonder-blocks-core": "^3.1.3", | ||
"@khanacademy/wonder-blocks-spacing": "^3.0.2" | ||
"@babel/runtime": "^7.13.10", | ||
"@khanacademy/wonder-blocks-color": "^1.1.18", | ||
"@khanacademy/wonder-blocks-core": "^3.1.4", | ||
"@khanacademy/wonder-blocks-spacing": "^3.0.3" | ||
}, | ||
@@ -28,5 +29,5 @@ "peerDependencies": { | ||
"devDependencies": { | ||
"wb-dev-build-settings": "^0.0.4" | ||
"wb-dev-build-settings": "^0.1.0" | ||
}, | ||
"gitHead": "b7d7425c7f2e02cd9b9ac6ac7e9fe12ead2bd8ab" | ||
"gitHead": "8022bb419eed74be37f71f71c7621854794a731c" | ||
} |
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
51170
6
11
489