preact-material-design
Version:
A set of material components for Preact.
34 lines • 1.25 kB
JavaScript
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
import { h, Component } from 'preact';
var Icon = (function (_super) {
__extends(Icon, _super);
function Icon() {
return _super !== null && _super.apply(this, arguments) || this;
}
Icon.prototype.render = function () {
var _a = this.props, icon = _a.icon, noClearance = _a.noClearance, size = _a.size;
var iconClasses = [
'pmd-icon',
"pmd-icon--size-" + size
];
if (noClearance) {
iconClasses.push('pmd-icon--no-clearance');
}
return h("i", { class: iconClasses.join(' ') }, icon);
};
return Icon;
}(Component));
export { Icon };
Icon.defaultProps = {
size: 'normal',
};
//# sourceMappingURL=Icon.js.map