import { LitElement } from 'lit'; import { customElement, property } from 'lit/decorators.js'; import { html, nothing } from 'lit/html.js'; import { spread } from './utils/LitHelper'; import { SpreadController } from './utils/SpreadController'; import { TailwindStylesController } from './utils/TailwindStylesController'; export type DividerStyle = 'none' | 'gradient'; @customElement('mono-card-layout') export class MonoCardLayoutComp extends LitElement { private __spreadController: SpreadController = new SpreadController(this); private __stylesController: TailwindStylesController = new TailwindStylesController( this, ); @property({ type: String, reflect: true, attribute: 'background-image' }) backgroundImage: string = ''; @property({ type: String, reflect: true, attribute: 'divider-style' }) dividerStyle: DividerStyle = 'gradient'; private renderDivider() { switch (this.dividerStyle) { case 'gradient': return html`
`; default: return nothing; } } render() { const attributesToSpread = this.__spreadController.buildSpreadAttributesIgnoring( ['as', 'style', 'class', 'slot'], ); const backgroundStyle = `background-image:url('${this.backgroundImage}');`; return html`
${this.renderDivider()}
`; } } declare global { interface HTMLElementTagNameMap { 'mono-card-layout': MonoCardLayoutComp; } }