'use client';
'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var tslib = require('tslib');
var lit = require('lit');
var decorators_js = require('lit/decorators.js');
var iconRegistry = require('./icon-registry.cjs.js');
var sgdsElement = require('../../base/sgds-element.cjs.js');
var icon = require('./icon.cjs.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["default"] {
    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.iconRegistry[name];
        if (!svg) {
            console.warn(`Icon not found: ${name}`);
            return;
        }
        return svg;
    }
    render() {
        const icon = this._getIconByName(this.name);
        return icon ? icon : lit.nothing;
    }
}
SgdsIcon.styles = [...sgdsElement["default"].styles, icon["default"]];
tslib.__decorate([
    decorators_js.property({ type: String, reflect: true })
], SgdsIcon.prototype, "name", void 0);
tslib.__decorate([
    decorators_js.property({ type: String, reflect: true })
], SgdsIcon.prototype, "size", void 0);

exports.SgdsIcon = SgdsIcon;
exports["default"] = SgdsIcon;
//# sourceMappingURL=sgds-icon.cjs.js.map
