+ add base lit components

This commit is contained in:
Mittani
2025-03-23 17:31:18 +01:00
parent bfb1c4f138
commit 44664e0e63
11 changed files with 1486 additions and 1721 deletions
@@ -0,0 +1,33 @@
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>
`;
}
}