class CustomDataCard extends HTMLElement { static get observedAttributes() { return ['title', 'value', 'icon', 'trend']; } constructor() { super(); this.attachShadow({ mode: 'open' }); } connectedCallback() { this.render(); } attributeChangedCallback(name, oldValue, newValue) { this.render(); } render() { const title = this.getAttribute('title') || ''; const value = this.getAttribute('value') || ''; const icon = this.getAttribute('icon') || 'activity'; const trend = this.getAttribute('trend') || 'neutral'; const trendColor = trend === 'up' ? 'text-green-500' : trend === 'down' ? 'text-red-500' : 'text-yellow-500'; const trendIcon = trend === 'up' ? 'trending-up' : trend === 'down' ? 'trending-down' : 'minus'; this.shadowRoot.innerHTML = `
${title}
${value}