@hig/progress-bar
Advanced tools
Comparing version 0.2.0-alpha.2eb35b95 to 0.2.0-alpha.48865d3c
@@ -1,5 +0,110 @@ | ||
import { ProgressBar } from 'hig-react'; | ||
import React, { Component } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import cx from 'classnames'; | ||
ProgressBar.displayName = "ProgressBar"; | ||
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; } | ||
/** | ||
* @param {Number} percent, an integer or float | ||
* @returns {Integer} | ||
*/ | ||
var renderedBarWidth = function renderedBarWidth(percent) { | ||
var percentageWidth = parseInt(percent, 10); | ||
if (!percentageWidth) { | ||
return null; | ||
} | ||
if (percentageWidth >= 100) { | ||
return 101; | ||
} | ||
return percentageWidth; | ||
}; | ||
var ProgressBar = function (_Component) { | ||
_inherits(ProgressBar, _Component); | ||
function ProgressBar() { | ||
_classCallCheck(this, ProgressBar); | ||
return _possibleConstructorReturn(this, (ProgressBar.__proto__ || Object.getPrototypeOf(ProgressBar)).apply(this, arguments)); | ||
} | ||
_createClass(ProgressBar, [{ | ||
key: "fillBarStyles", | ||
value: function fillBarStyles() { | ||
var barWidth = renderedBarWidth(this.props.percentComplete); | ||
return barWidth ? { width: barWidth + "%" } : {}; | ||
} | ||
}, { | ||
key: "render", | ||
value: function render() { | ||
var percentComplete = this.props.percentComplete; | ||
var progressBarClasses = cx("hig__progress-bar", { | ||
"hig__progress-bar--determinate": percentComplete | ||
}); | ||
return React.createElement( | ||
"div", | ||
{ | ||
className: progressBarClasses, | ||
role: "progressbar", | ||
"aria-valuemin": "0", | ||
"aria-valuemax": "100", | ||
"aria-valuenow": percentComplete | ||
}, | ||
React.createElement( | ||
"div", | ||
{ className: "hig__progress-bar__bar", style: this.fillBarStyles() }, | ||
React.createElement("div", { className: "hig__progress-bar__fill" }), | ||
React.createElement( | ||
"svg", | ||
{ | ||
width: "3px", | ||
height: "4px", | ||
viewBox: "0 0 3 4", | ||
version: "1.1", | ||
xmlns: "http://www.w3.org/2000/svg", | ||
xmlnsXlink: "http://www.w3.org/1999/xlink" | ||
}, | ||
React.createElement("polygon", { | ||
id: "end-right", | ||
points: "0 0 2.68 0 1 4 0 4", | ||
fill: "#0ED3BE" | ||
}) | ||
) | ||
) | ||
); | ||
} | ||
}]); | ||
return ProgressBar; | ||
}(Component); | ||
ProgressBar.propTypes = { | ||
/** | ||
* A number from 0 to 100 representing the percent the delayed operation has completed | ||
*/ | ||
percentComplete: PropTypes.number | ||
}; | ||
ProgressBar.__docgenInfo = { | ||
"description": "", | ||
"displayName": "ProgressBar", | ||
"props": { | ||
"percentComplete": { | ||
"type": { | ||
"name": "number" | ||
}, | ||
"required": false, | ||
"description": "A number from 0 to 100 representing the percent the delayed operation has completed" | ||
} | ||
} | ||
}; | ||
export default ProgressBar; |
@@ -5,6 +5,114 @@ 'use strict'; | ||
var higReact = require('hig-react'); | ||
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } | ||
higReact.ProgressBar.displayName = "ProgressBar"; | ||
var React = require('react'); | ||
var React__default = _interopDefault(React); | ||
var PropTypes = _interopDefault(require('prop-types')); | ||
var cx = _interopDefault(require('classnames')); | ||
exports.default = higReact.ProgressBar; | ||
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; } | ||
/** | ||
* @param {Number} percent, an integer or float | ||
* @returns {Integer} | ||
*/ | ||
var renderedBarWidth = function renderedBarWidth(percent) { | ||
var percentageWidth = parseInt(percent, 10); | ||
if (!percentageWidth) { | ||
return null; | ||
} | ||
if (percentageWidth >= 100) { | ||
return 101; | ||
} | ||
return percentageWidth; | ||
}; | ||
var ProgressBar = function (_Component) { | ||
_inherits(ProgressBar, _Component); | ||
function ProgressBar() { | ||
_classCallCheck(this, ProgressBar); | ||
return _possibleConstructorReturn(this, (ProgressBar.__proto__ || Object.getPrototypeOf(ProgressBar)).apply(this, arguments)); | ||
} | ||
_createClass(ProgressBar, [{ | ||
key: "fillBarStyles", | ||
value: function fillBarStyles() { | ||
var barWidth = renderedBarWidth(this.props.percentComplete); | ||
return barWidth ? { width: barWidth + "%" } : {}; | ||
} | ||
}, { | ||
key: "render", | ||
value: function render() { | ||
var percentComplete = this.props.percentComplete; | ||
var progressBarClasses = cx("hig__progress-bar", { | ||
"hig__progress-bar--determinate": percentComplete | ||
}); | ||
return React__default.createElement( | ||
"div", | ||
{ | ||
className: progressBarClasses, | ||
role: "progressbar", | ||
"aria-valuemin": "0", | ||
"aria-valuemax": "100", | ||
"aria-valuenow": percentComplete | ||
}, | ||
React__default.createElement( | ||
"div", | ||
{ className: "hig__progress-bar__bar", style: this.fillBarStyles() }, | ||
React__default.createElement("div", { className: "hig__progress-bar__fill" }), | ||
React__default.createElement( | ||
"svg", | ||
{ | ||
width: "3px", | ||
height: "4px", | ||
viewBox: "0 0 3 4", | ||
version: "1.1", | ||
xmlns: "http://www.w3.org/2000/svg", | ||
xmlnsXlink: "http://www.w3.org/1999/xlink" | ||
}, | ||
React__default.createElement("polygon", { | ||
id: "end-right", | ||
points: "0 0 2.68 0 1 4 0 4", | ||
fill: "#0ED3BE" | ||
}) | ||
) | ||
) | ||
); | ||
} | ||
}]); | ||
return ProgressBar; | ||
}(React.Component); | ||
ProgressBar.propTypes = { | ||
/** | ||
* A number from 0 to 100 representing the percent the delayed operation has completed | ||
*/ | ||
percentComplete: PropTypes.number | ||
}; | ||
ProgressBar.__docgenInfo = { | ||
"description": "", | ||
"displayName": "ProgressBar", | ||
"props": { | ||
"percentComplete": { | ||
"type": { | ||
"name": "number" | ||
}, | ||
"required": false, | ||
"description": "A number from 0 to 100 representing the percent the delayed operation has completed" | ||
} | ||
} | ||
}; | ||
exports.default = ProgressBar; |
{ | ||
"name": "@hig/progress-bar", | ||
"version": "0.2.0-alpha.2eb35b95", | ||
"version": "0.2.0-alpha.48865d3c", | ||
"description": "HIG Progress Bar", | ||
@@ -22,5 +22,3 @@ "author": "Autodesk Inc.", | ||
"classnames": "^2.2.5", | ||
"hig-react": "0.30.0-alpha.2eb35b95", | ||
"prop-types": "^15.6.1", | ||
"react-lifecycles-compat": "^3.0.2" | ||
"prop-types": "^15.6.1" | ||
}, | ||
@@ -31,7 +29,7 @@ "peerDependencies": { | ||
"devDependencies": { | ||
"@hig/babel-preset": "0.2.0-alpha.2eb35b95", | ||
"@hig/eslint-config": "0.2.0-alpha.2eb35b95", | ||
"@hig/scripts": "0.2.0-alpha.2eb35b95", | ||
"@hig/semantic-release-config": "0.2.0-alpha.2eb35b95", | ||
"@hig/styles": "0.2.0-alpha.2eb35b95" | ||
"@hig/babel-preset": "0.2.0-alpha.48865d3c", | ||
"@hig/eslint-config": "0.2.0-alpha.48865d3c", | ||
"@hig/scripts": "0.2.0-alpha.48865d3c", | ||
"@hig/semantic-release-config": "0.2.0-alpha.48865d3c", | ||
"@hig/styles": "^0.1.1" | ||
}, | ||
@@ -38,0 +36,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
3
24675
436
1
- Removedhig-react@0.30.0-alpha.2eb35b95
- Removedreact-lifecycles-compat@^3.0.2
- Removed@babel/runtime@7.26.0(transitive)
- Removed@hig/avatar@0.2.0-alpha.2eb35b95(transitive)
- Removed@hig/icon@0.2.0-alpha.2eb35b95(transitive)
- Removed@hig/icon-button@0.2.0-alpha.2eb35b95(transitive)
- Removed@hig/icons@0.2.0-alpha.2eb35b95(transitive)
- Removed@hig/timestamp@0.2.0-alpha.2eb35b95(transitive)
- Removed@hig/typography@0.2.0-alpha.2eb35b95(transitive)
- Removedasap@2.0.6(transitive)
- Removedcore-js@1.2.7(transitive)
- Removedcreate-react-class@15.7.0(transitive)
- Removeddom-helpers@3.4.0(transitive)
- Removedencoding@0.1.13(transitive)
- Removedfbjs@0.8.18(transitive)
- Removedhig-interface@0.2.0-alpha.2eb35b95(transitive)
- Removedhig-react@0.30.0-alpha.2eb35b95(transitive)
- Removedhig-vanilla@0.2.0-alpha.2eb35b95(transitive)
- Removediconv-lite@0.6.3(transitive)
- Removedis-stream@1.1.0(transitive)
- Removedisomorphic-fetch@2.2.1(transitive)
- Removednode-fetch@1.7.3(transitive)
- Removedpromise@7.3.1(transitive)
- Removedreact@15.7.018.3.1(transitive)
- Removedreact-dom@15.7.018.3.1(transitive)
- Removedreact-flip-move@3.0.5(transitive)
- Removedreact-lifecycles-compat@3.0.4(transitive)
- Removedreact-transition-group@2.9.0(transitive)
- Removedregenerator-runtime@0.14.1(transitive)
- Removedsafer-buffer@2.1.2(transitive)
- Removedscheduler@0.23.2(transitive)
- Removedsetimmediate@1.0.5(transitive)
- Removedua-parser-js@0.7.39(transitive)
- Removedwhatwg-fetch@3.6.20(transitive)