preact-material-components
Version:
preact wrapper for "Material Components for the web"
42 lines • 1.4 kB
JavaScript
var __rest = (this && this.__rest) || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
};
import { h } from 'preact';
import MaterialComponent from '../Base/MaterialComponent';
export class Typography extends MaterialComponent {
constructor() {
super(...arguments);
this.componentName = 'typography';
this.mdcProps = [
'headline1',
'headline2',
'headline3',
'headline4',
'headline5',
'headline6',
'subtitle1',
'subtitle2',
'body1',
'body2',
'button',
'caption',
'overline',
'title'
];
}
materialDom(allprops) {
const { tag } = allprops, props = __rest(allprops, ["tag"]);
const Tag = tag ? tag : 'span';
return (h(Tag, Object.assign({}, props, { ref: this.setControlRef }), props.children));
}
}
export default Typography;
//# sourceMappingURL=index.js.map