preact-material-design
Version:
A set of material components for Preact.
103 lines • 3.95 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 Card = (function (_super) {
__extends(Card, _super);
function Card() {
return _super !== null && _super.apply(this, arguments) || this;
}
Card.prototype.render = function () {
var _a = this.props, children = _a.children, style = _a.style;
return h("div", { class: "pmd-card", style: style }, children);
};
return Card;
}(Component));
export { Card };
var CardText = (function (_super) {
__extends(CardText, _super);
function CardText() {
return _super !== null && _super.apply(this, arguments) || this;
}
CardText.prototype.render = function () {
var children = this.props.children;
return h("div", { class: "pmd-card-text pmd-card--includes-padding" }, children);
};
return CardText;
}(Component));
export { CardText };
var CardMedia = (function (_super) {
__extends(CardMedia, _super);
function CardMedia() {
return _super !== null && _super.apply(this, arguments) || this;
}
CardMedia.prototype.render = function () {
var children = this.props.children;
return h("div", { class: "pmd-card-media" }, children);
};
return CardMedia;
}(Component));
export { CardMedia };
var CardTitle = (function (_super) {
__extends(CardTitle, _super);
function CardTitle() {
return _super !== null && _super.apply(this, arguments) || this;
}
CardTitle.prototype.render = function () {
var children = this.props.children;
return h("div", { class: "pmd-card-title pmd-card--includes-padding" }, children);
};
return CardTitle;
}(Component));
export { CardTitle };
var CardSubtitle = (function (_super) {
__extends(CardSubtitle, _super);
function CardSubtitle() {
return _super !== null && _super.apply(this, arguments) || this;
}
CardSubtitle.prototype.render = function () {
var children = this.props.children;
return h("div", { class: "pmd-card-subtitle pmd-card--includes-padding" }, children);
};
return CardSubtitle;
}(Component));
export { CardSubtitle };
var CardActions = (function (_super) {
__extends(CardActions, _super);
function CardActions() {
return _super !== null && _super.apply(this, arguments) || this;
}
CardActions.prototype.render = function () {
var _a = this.props, children = _a.children, vertical = _a.vertical;
var classes = ['pmd-card-actions'];
if (vertical) {
classes.push('pmd-card-actions--vertical');
}
return h("div", { class: classes.join(' ') }, children);
};
return CardActions;
}(Component));
export { CardActions };
var CardMediaArea = (function (_super) {
__extends(CardMediaArea, _super);
function CardMediaArea() {
return _super !== null && _super.apply(this, arguments) || this;
}
CardMediaArea.prototype.render = function () {
var _a = this.props, children = _a.children, media = _a.media;
return h("div", { class: "pmd-card-media-area" },
h("div", { class: "pmd-card-media-area__content" }, children),
h("div", { class: "pmd-card-media-area__media" }, media));
};
return CardMediaArea;
}(Component));
export { CardMediaArea };
export * from './CardHeader';
//# sourceMappingURL=Card.js.map