mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-29 03:44:40 +00:00
34 lines
912 B
TypeScript
34 lines
912 B
TypeScript
import { LitElement, html, css } from "lit";
|
|
import { customElement, property } from "lit/decorators.js";
|
|
import { classMap } from "lit/directives/class-map.js";
|
|
|
|
@customElement("o-button")
|
|
export class OButton extends LitElement {
|
|
@property({ type: String }) title = "";
|
|
@property({ type: Boolean }) secondary = false;
|
|
@property({ type: Boolean }) block = false;
|
|
@property({ type: Boolean }) blockDesktop = false;
|
|
@property({ type: Boolean }) disable = false;
|
|
|
|
createRenderRoot() {
|
|
return this;
|
|
}
|
|
|
|
render() {
|
|
return html`
|
|
<button
|
|
class=${classMap({
|
|
"c-button": true,
|
|
"c-button--block": this.block,
|
|
"c-button--blockDesktop": this.blockDesktop,
|
|
"c-button--secondary": this.secondary,
|
|
"c-button--disabled": this.disable,
|
|
})}
|
|
?disabled=${this.disable}
|
|
>
|
|
${this.title}
|
|
</button>
|
|
`;
|
|
}
|
|
}
|