Refactor Lucide icon rendering by replacing nodes with root across components and fix unintended character encoding issues in placeholders and text.
This commit is contained in:
@@ -47,7 +47,7 @@ class UiDialog extends HTMLElement {
|
||||
this.shadowRoot.querySelector('.close-btn').addEventListener('click', () => this.close());
|
||||
dialog.addEventListener('click', e => { if (e.target === dialog) this.close(); });
|
||||
document.addEventListener('keydown', e => { if (e.key === 'Escape') this.close(); });
|
||||
if (window.lucide) lucide.createIcons({ nodes: [this.shadowRoot] });
|
||||
if (window.lucide) lucide.createIcons({ root: this.shadowRoot });
|
||||
}
|
||||
|
||||
open() { this.shadowRoot?.querySelector('dialog')?.showModal(); }
|
||||
|
||||
@@ -29,7 +29,7 @@ class UiEmpty extends HTMLElement {
|
||||
${body ? `<p>${body}</p>` : ''}
|
||||
<slot></slot>
|
||||
</div>`;
|
||||
if (window.lucide) lucide.createIcons({ nodes: [this.shadowRoot] });
|
||||
if (window.lucide) lucide.createIcons({ root: this.shadowRoot });
|
||||
}
|
||||
}
|
||||
customElements.define('ui-empty', UiEmpty);
|
||||
|
||||
@@ -22,7 +22,7 @@ class UiToastContainer extends HTMLElement {
|
||||
});
|
||||
toast.innerHTML = `<i data-lucide="${icons[type] || 'info'}" style="width:16px;height:16px;flex-shrink:0"></i><span>${message}</span>`;
|
||||
this.appendChild(toast);
|
||||
if (window.lucide) lucide.createIcons({ nodes: [toast] });
|
||||
if (window.lucide) lucide.createIcons({ root: toast });
|
||||
|
||||
const style = document.createElement('style');
|
||||
style.textContent = `@keyframes toastIn{from{opacity:0;transform:translateX(1rem)}to{opacity:1;transform:none}}`;
|
||||
|
||||
Reference in New Issue
Block a user