'use client';
import { __decorate } from 'tslib';
import { nothing } from 'lit';
import { property } from 'lit/decorators.js';
import { iconRegistry } from './icon-registry.js';
import SgdsElement from '../../base/sgds-element.js';
import css_248z from './icon.js';

/**
 * @summary Icons offer a form of visual shorthand that we are all familiar with. They can label, inform and aid navigation quickly and effectively in minimal space. Icons must first and foremost communicate meaning. By default, the icon component renders icons from `SgdsIcon` library set
 */
class SgdsIcon extends SgdsElement {
    constructor() {
        super(...arguments);
        /** Specifies a small, medium or large icon, the size is medium by default. */
        this.size = "lg";
    }
    _getIconByName(name) {
        if (!name)
            return;
        const svg = iconRegistry[name];
        if (!svg) {
            console.warn(`Icon not found: ${name}`);
            return;
        }
        return svg;
    }
    render() {
        const icon = this._getIconByName(this.name);
        return icon ? icon : nothing;
    }
}
SgdsIcon.styles = [...SgdsElement.styles, css_248z];
__decorate([
    property({ type: String, reflect: true })
], SgdsIcon.prototype, "name", void 0);
__decorate([
    property({ type: String, reflect: true })
], SgdsIcon.prototype, "size", void 0);

export { SgdsIcon, SgdsIcon as default };
//# sourceMappingURL=sgds-icon.js.map
