/**
* EDC Empty State Component
*
* Reusable empty state component for displaying when no data is available.
* Supports custom icon, title, description, and action button.
*
* @customElement edc-empty-state
*/
import { css, html, LitElement, nothing } from 'lit';
import { customElement, property } from 'lit/decorators.js';
@customElement('edc-empty-state')
export class EdcEmptyState extends LitElement {
@property({ type: String })
icon: string = '📦';
@property({ type: String })
title: string = 'No items found';
@property({ type: String })
description?: string;
@property({ type: String, attribute: 'action-label' })
actionLabel?: string;
private handleAction() {
this.dispatchEvent(new CustomEvent('action', {
bubbles: true,
composed: true
}));
}
render() {
return html`
${this.icon}
${this.title}
${this.description ? html`
${this.description}
` : nothing}
${this.actionLabel ? html`
` : nothing}
`;
}
static styles = css`
:host {
display: block;
}
.empty-state {
text-align: center;
padding: 4rem 2rem;
color: #666;
}
.empty-icon {
font-size: 3rem;
margin-bottom: 1rem;
opacity: 0.5;
animation: fadeIn 0.5s ease-out;
}
@keyframes fadeIn {
from {
opacity: 0;
transform: scale(0.9);
}
to {
opacity: 0.5;
transform: scale(1);
}
}
.empty-title {
margin: 0 0 0.5rem 0;
font-size: 1.25rem;
font-weight: 600;
color: #333;
}
.empty-description {
margin: 0 0 1.5rem 0;
color: #666;
line-height: 1.5;
}
.empty-action {
padding: 0.75rem 1.5rem;
border: 1px solid var(--tems-color-primary, #e91e63);
border-radius: 8px;
background: transparent;
color: var(--tems-color-primary, #e91e63);
font-size: 0.9rem;
font-weight: 600;
cursor: pointer;
transition: all 0.2s ease;
}
.empty-action:hover {
background: var(--tems-color-primary, #e91e63);
color: white;
}
`;
}
declare global {
interface HTMLElementTagNameMap {
'edc-empty-state': EdcEmptyState;
}
}