@khanacademy/wonder-blocks-progress-spinner
Advanced tools
Comparing version 1.0.9 to 1.0.10
@@ -6,2 +6,24 @@ import { createElement, Component } from 'react'; | ||
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) { | ||
@@ -22,3 +44,50 @@ if (key in obj) { | ||
const heights = { | ||
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 _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); | ||
} | ||
var heights = { | ||
xsmall: 16, | ||
@@ -29,3 +98,3 @@ small: 24, | ||
}; | ||
const paths = { | ||
var 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", | ||
@@ -36,9 +105,9 @@ 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", | ||
}; | ||
const colors = { | ||
var colors = { | ||
light: Color.white, | ||
dark: Color.offBlack16 | ||
}; | ||
const StyledSVG = addStyle("svg"); | ||
const StyledPath = addStyle("path"); | ||
const svgs = { | ||
var StyledSVG = addStyle("svg"); | ||
var StyledPath = addStyle("path"); | ||
var svgs = { | ||
light: {}, | ||
@@ -48,4 +117,4 @@ dark: {} | ||
const _generateSVG = (size, light) => { | ||
const svgCache = svgs[light]; | ||
var _generateSVG = function _generateSVG(size, light) { | ||
var svgCache = svgs[light]; | ||
@@ -56,10 +125,10 @@ if (svgCache[size]) { | ||
const height = heights[size]; | ||
const path = paths[size]; | ||
const color = colors[light]; | ||
const svg = createElement(StyledSVG, { | ||
var height = heights[size]; | ||
var path = paths[size]; | ||
var color = colors[light]; | ||
var svg = createElement(StyledSVG, { | ||
xmlns: "http://www.w3.org/2000/svg", | ||
width: height, | ||
height: height, | ||
viewBox: `0 0 ${height} ${height}`, | ||
viewBox: "0 0 ".concat(height, " ").concat(height), | ||
style: styles.loadingSpinner | ||
@@ -81,5 +150,17 @@ }, createElement(StyledPath, { | ||
*/ | ||
class CircularSpinner extends Component { | ||
render() { | ||
const _this$props = this.props, | ||
var CircularSpinner = | ||
/*#__PURE__*/ | ||
function (_React$Component) { | ||
_inherits(CircularSpinner, _React$Component); | ||
function CircularSpinner() { | ||
_classCallCheck(this, CircularSpinner); | ||
return _possibleConstructorReturn(this, _getPrototypeOf(CircularSpinner).apply(this, arguments)); | ||
} | ||
_createClass(CircularSpinner, [{ | ||
key: "render", | ||
value: function render() { | ||
var _this$props = this.props, | ||
size = _this$props.size, | ||
@@ -89,10 +170,12 @@ light = _this$props.light, | ||
const svg = _generateSVG(size, light ? "light" : "dark"); | ||
var svg = _generateSVG(size, light ? "light" : "dark"); | ||
return createElement(View, { | ||
style: [styles.spinnerContainer, style] | ||
}, svg); | ||
} | ||
return createElement(View, { | ||
style: [styles.spinnerContainer, style] | ||
}, svg); | ||
} | ||
}]); | ||
} | ||
return CircularSpinner; | ||
}(Component); | ||
@@ -103,4 +186,3 @@ _defineProperty(CircularSpinner, "defaultProps", { | ||
}); | ||
const rotateKeyFrames = { | ||
var rotateKeyFrames = { | ||
"0%": { | ||
@@ -116,3 +198,3 @@ transform: "rotate(0deg)" | ||
}; | ||
const styles = StyleSheet.create({ | ||
var styles = StyleSheet.create({ | ||
spinnerContainer: { | ||
@@ -119,0 +201,0 @@ justifyContent: "center" |
@@ -133,2 +133,20 @@ module.exports = | ||
// CONCATENATED MODULE: ./packages/wonder-blocks-progress-spinner/components/circular-spinner.js | ||
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); } | ||
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; } | ||
@@ -140,3 +158,3 @@ | ||
const heights = { | ||
var heights = { | ||
xsmall: 16, | ||
@@ -147,3 +165,3 @@ small: 24, | ||
}; | ||
const paths = { | ||
var 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", | ||
@@ -154,9 +172,9 @@ 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", | ||
}; | ||
const colors = { | ||
var colors = { | ||
light: wonder_blocks_color_default.a.white, | ||
dark: wonder_blocks_color_default.a.offBlack16 | ||
}; | ||
const StyledSVG = Object(wonder_blocks_core_["addStyle"])("svg"); | ||
const StyledPath = Object(wonder_blocks_core_["addStyle"])("path"); | ||
const svgs = { | ||
var StyledSVG = Object(wonder_blocks_core_["addStyle"])("svg"); | ||
var StyledPath = Object(wonder_blocks_core_["addStyle"])("path"); | ||
var svgs = { | ||
light: {}, | ||
@@ -166,4 +184,4 @@ dark: {} | ||
const _generateSVG = (size, light) => { | ||
const svgCache = svgs[light]; | ||
var circular_spinner_generateSVG = function _generateSVG(size, light) { | ||
var svgCache = svgs[light]; | ||
@@ -174,10 +192,10 @@ if (svgCache[size]) { | ||
const height = heights[size]; | ||
const path = paths[size]; | ||
const color = colors[light]; | ||
const svg = external_react_["createElement"](StyledSVG, { | ||
var height = heights[size]; | ||
var path = paths[size]; | ||
var color = colors[light]; | ||
var svg = external_react_["createElement"](StyledSVG, { | ||
xmlns: "http://www.w3.org/2000/svg", | ||
width: height, | ||
height: height, | ||
viewBox: `0 0 ${height} ${height}`, | ||
viewBox: "0 0 ".concat(height, " ").concat(height), | ||
style: styles.loadingSpinner | ||
@@ -199,5 +217,17 @@ }, external_react_["createElement"](StyledPath, { | ||
*/ | ||
class circular_spinner_CircularSpinner extends external_react_["Component"] { | ||
render() { | ||
const _this$props = this.props, | ||
var circular_spinner_CircularSpinner = | ||
/*#__PURE__*/ | ||
function (_React$Component) { | ||
_inherits(CircularSpinner, _React$Component); | ||
function CircularSpinner() { | ||
_classCallCheck(this, CircularSpinner); | ||
return _possibleConstructorReturn(this, _getPrototypeOf(CircularSpinner).apply(this, arguments)); | ||
} | ||
_createClass(CircularSpinner, [{ | ||
key: "render", | ||
value: function render() { | ||
var _this$props = this.props, | ||
size = _this$props.size, | ||
@@ -207,10 +237,12 @@ light = _this$props.light, | ||
const svg = _generateSVG(size, light ? "light" : "dark"); | ||
var svg = circular_spinner_generateSVG(size, light ? "light" : "dark"); | ||
return external_react_["createElement"](wonder_blocks_core_["View"], { | ||
style: [styles.spinnerContainer, style] | ||
}, svg); | ||
} | ||
return external_react_["createElement"](wonder_blocks_core_["View"], { | ||
style: [styles.spinnerContainer, style] | ||
}, svg); | ||
} | ||
}]); | ||
} | ||
return CircularSpinner; | ||
}(external_react_["Component"]); | ||
@@ -222,3 +254,4 @@ _defineProperty(circular_spinner_CircularSpinner, "defaultProps", { | ||
const rotateKeyFrames = { | ||
var rotateKeyFrames = { | ||
"0%": { | ||
@@ -234,3 +267,3 @@ transform: "rotate(0deg)" | ||
}; | ||
const styles = external_aphrodite_["StyleSheet"].create({ | ||
var styles = external_aphrodite_["StyleSheet"].create({ | ||
spinnerContainer: { | ||
@@ -237,0 +270,0 @@ justifyContent: "center" |
{ | ||
"name": "@khanacademy/wonder-blocks-progress-spinner", | ||
"version": "1.0.9", | ||
"version": "1.0.10", | ||
"design": "v1", | ||
@@ -18,5 +18,5 @@ "publishConfig": { | ||
"dependencies": { | ||
"@khanacademy/wonder-blocks-color": "^1.0.12", | ||
"@khanacademy/wonder-blocks-core": "^1.2.5", | ||
"@khanacademy/wonder-blocks-spacing": "^2.0.10" | ||
"@khanacademy/wonder-blocks-color": "^1.0.13", | ||
"@khanacademy/wonder-blocks-core": "^1.2.6", | ||
"@khanacademy/wonder-blocks-spacing": "^2.0.11" | ||
}, | ||
@@ -26,3 +26,6 @@ "peerDependencies": { | ||
"react": "^16.4.1" | ||
}, | ||
"devDependencies": { | ||
"wb-dev-build-settings": "^0.0.2" | ||
} | ||
} |
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
56500
633
1