import { h } from "@stencil/core";
export class DgaIcon {
    constructor() {
        this.variant = 'bulk';
        this.type = 'rounded';
    }
    // Initialize class name on component load
    componentDidLoad() {
        this.updateIcon();
    }
    // Update class name when properties change
    updateIcon() {
        if (this.container) {
            // Convert the name to lowercase, replace "Icon" suffix, and separate words with hyphens
            const className = this.icon
                .replace(/([a-z])([A-Z])/g, '$1-$2')
                .replace(/([A-Z])([0-9])/g, '$1-$2')
                .replace(/([a-z])([0-9])/g, '$1-$2')
                .toLowerCase()
                .replace('-icon', '')
                .replace('icon', '')
                .trim();
            // Build the final class string
            const iconClass = `hgi-${this.variant || ''} ${this.type ? `hgi-${this.type}` : ''} hgi-${className}`;
            // Apply the class to the icon element
            this.container.className = iconClass;
        }
    }
    render() {
        return (h("div", { key: '11735823b55e093a2b08abd757a3f176afb0dd65', style: {
                width: '100%',
                height: '100%',
                display: 'flex',
                alignItems: 'center',
                justifyContent: 'center',
                fontSize: 'inherit',
            } }, h("i", { key: 'fa28053e0bb5a5bc7071cfd74f9c8f03adab9f1c', style: {
                fontSize: `${this.size ? `${this.size}px` : 'inherit'}`,
                color: this.color,
            }, ref: el => (this.container = el) })));
    }
    static get is() { return "dga-icon"; }
    static get encapsulation() { return "shadow"; }
    static get originalStyleUrls() {
        return {
            "$": ["dga-icon.scss"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["dga-icon.css"]
        };
    }
    static get properties() {
        return {
            "icon": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "icon",
                "reflect": false
            },
            "size": {
                "type": "number",
                "mutable": false,
                "complexType": {
                    "original": "number",
                    "resolved": "number",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "size",
                "reflect": false
            },
            "color": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "color",
                "reflect": false
            },
            "variant": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "'stroke' | 'solid' | 'duotone' | 'twotone' | 'bulk'",
                    "resolved": "\"bulk\" | \"duotone\" | \"solid\" | \"stroke\" | \"twotone\"",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "variant",
                "reflect": false,
                "defaultValue": "'bulk'"
            },
            "type": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "'rounded' | 'sharp' | 'standard'",
                    "resolved": "\"rounded\" | \"sharp\" | \"standard\"",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "type",
                "reflect": false,
                "defaultValue": "'rounded'"
            }
        };
    }
    static get watchers() {
        return [{
                "propName": "icon",
                "methodName": "updateIcon"
            }, {
                "propName": "variant",
                "methodName": "updateIcon"
            }, {
                "propName": "type",
                "methodName": "updateIcon"
            }];
    }
}
//# sourceMappingURL=dga-icon.js.map
