import {LitElement, html, css} from 'lit'; import {customElement, property} from 'lit/decorators.js'; import {LineMedium, lineColor, LineType, lineWidth} from '../index'; @customElement('obc-horizontal-line') export class ObcHorizontalLine extends LitElement { @property({type: String}) medium: LineMedium = LineMedium.normal; @property({type: String}) lineType: LineType = LineType.fluid; @property({type: Number}) length: number = 1; override render() { if (this.lineType === LineType.connector) { const length = this.length * 24; return html` `; } const color = lineColor(this.medium); const length = this.length * 24 + 1; const width = lineWidth(this.lineType); return html`
`; } static override styles = css` :host { display: block; line-height: 0; } svg { position: relative; left: -0.5px; top: -12px; } `; } declare global { interface HTMLElementTagNameMap { 'obc-horizontal-line': ObcHorizontalLine; } }