import { Elena, html } from '@elenajs/core'; type BadgeVariant = 'note' | 'tip' | 'caution' | 'danger' | 'default'; /** * * Inline color-coded chip. Use `text` attribute for label. * */ export class LitroBadge extends Elena(HTMLElement) { static tagName = 'litro-badge'; static props = ['variant', 'text']; variant: BadgeVariant = 'default'; text = ''; render() { const v = (['note', 'tip', 'caution', 'danger'] as string[]).includes(this.variant) ? this.variant : 'default'; return html` ${this.text} `; } } LitroBadge.define(); export default LitroBadge;