@fluid-topics/ft-typography
Version:
Typography components
41 lines (40 loc) • 1.72 kB
JavaScript
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import { html, unsafeStatic } from "lit/static-html.js";
import { property } from "lit/decorators.js";
import { FtLitElement } from "@fluid-topics/ft-wc-utils";
import { FtdsTypographyVariants } from "./ftds-typography.properties";
import { FtdsTypographyStyles } from "./ftds-typography.styles";
export class FtdsTypography extends FtLitElement {
constructor() {
super(...arguments);
this.variant = FtdsTypographyVariants.body2medium;
}
render() {
if (this.element) {
return html `
<${unsafeStatic(this.element)}
part="text"
class="ftds-typography ftds-typography--${this.variant}">
<slot></slot>
</${unsafeStatic(this.element)}>
`;
}
return html `
<slot part="text" class="ftds-typography ftds-typography--${this.variant}"></slot>
`;
}
}
FtdsTypography.styles = [
...FtdsTypographyStyles,
];
__decorate([
property()
], FtdsTypography.prototype, "element", void 0);
__decorate([
property()
], FtdsTypography.prototype, "variant", void 0);