base-elements
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -10,3 +10,3 @@ const assert = require('assert') | ||
const cls = opts.class || '' | ||
const size = 'w' + (opts.size || 3) | ||
const size = 'w' + (opts.size || 3) + ' ' + 'h' + (opts.size || 3) | ||
const radius = 'br' + ((opts.radius) | ||
@@ -23,3 +23,3 @@ ? (opts.radius === 100) | ||
assert.equal(typeof radius, 'string', 'base-elements/avatar: radius should be a string') | ||
assert.ok(size === 'w1' || size === 'w1' || size === 'w2' || size === 'w3' || size === 'w4' || size === 'w5', 'base-elements/avatar: size should be >= 1 && <= 5') | ||
assert.ok(size === 'w1 h1' || size === 'w2 h2' || size === 'w3 h3' || size === 'w4 h4' || size === 'w5 h5', 'base-elements/avatar: size should be >= 1 && <= 5') | ||
assert.ok(radius === 'br-100' || radius === 'br0' || radius === 'br1' || radius === 'br2' || radius === 'br3' || radius === 'br4', 'base-elements/avatar: radius should be >= 0 && <= 4 OR 100') | ||
@@ -26,0 +26,0 @@ |
{ | ||
"name": "base-elements", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "A selection of native DOM elements", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -14,9 +14,11 @@ const css = require('sheetify') | ||
module.exports = progressElement | ||
// create a progress bar | ||
// (num, obj?) -> html | ||
module.exports = function (value, opts) { | ||
function progressElement (value, opts) { | ||
opts = opts || {} | ||
const cls = opts.class || '' | ||
const direction = opts.reverse | ||
const _class = opts.class || '' | ||
const reverse = opts.reverse | ||
@@ -26,12 +28,11 @@ assert.equal(typeof value, 'number', 'base-elements/progress: value should be a number') | ||
assert.equal(typeof opts, 'object', 'base-elements/progress: opts should be an object') | ||
assert.equal(typeof cls, 'string', 'base-elements/progress: opts.class should be a string') | ||
assert.equal(typeof _class, 'string', 'base-elements/progress: opts.class should be a string') | ||
const directionClass = (direction) ? ('reverse') : '' | ||
const directionClass = (reverse) ? ('reverse') : '' | ||
const classes = 'w-100 db bn input-reset br-100 h1' + | ||
' ' + _class + | ||
' ' + prefix + | ||
' ' + directionClass | ||
// TODO(yw): patch sheetify so we can create global styles, inline | ||
const classStyle = 'w-100 db bn input-reset br-100 h1 ' + cls + ' ' + prefix + ' ' + directionClass | ||
return html` | ||
<progress class=${classStyle} value=${value}></progress> | ||
` | ||
return html`<progress class=${classes} value=${value}></progress>` | ||
} |
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
149
10218