import { h } from "@stencil/core";
/**
 * Result 结果页组件
 * 反馈一系列操作任务的处理结果，常用于步骤完成后展示
 */
export class Result {
    /** 结果状态，决定图标与主题色 */
    status = 'info';
    /** 标题（使用默认值使其成为 required string，避免与 HTMLElement.title 类型冲突） */
    title = '';
    /** 副标题 */
    subTitle;
    /** 自定义图标文本（覆盖默认状态图标） */
    icon;
    /** 状态 → 默认图标符号 映射 */
    static ICON_MAP = {
        success: '✅',
        error: '❌',
        warning: '⚠️',
        info: 'ℹ️',
        '404': '🔍',
        '403': '🔒',
        '500': '🛠️',
    };
    /** 状态 → 主题色令牌 映射 */
    static COLOR_MAP = {
        success: 'var(--hb-color-success)',
        error: 'var(--hb-color-danger)',
        warning: 'var(--hb-color-warning)',
        info: 'var(--hb-color-info)',
        '404': 'var(--hb-color-text-secondary)',
        '403': 'var(--hb-color-text-secondary)',
        '500': 'var(--hb-color-text-secondary)',
    };
    getColor() {
        return Result.COLOR_MAP[this.status] || 'var(--hb-color-info)';
    }
    getIcon() {
        return this.icon !== undefined ? this.icon : Result.ICON_MAP[this.status] || Result.ICON_MAP.info;
    }
    render() {
        const color = this.getColor();
        return (h("div", { key: '2c814e1b6953b94d65a6fbf1434263f622bb7286', class: { 'hb-result': true, [`hb-result--${this.status}`]: true } }, h("div", { key: '6065f1880a74904cced635430c1f3b484476cc63', class: "hb-result__icon", style: { color } }, h("span", { key: 'fd61023ad0cdf6436680f20bbcb735f4960ffbe5', class: "hb-result__icon-symbol" }, this.getIcon())), this.title && h("div", { key: '44a7cfc18a4886b1530e9dfbed4764f35f61d143', class: "hb-result__title" }, this.title), this.subTitle !== undefined && h("div", { key: '86c42321700d9a7f3055025dbfbc71b358611739', class: "hb-result__subtitle" }, this.subTitle), h("div", { key: '63fbc78625a878e196acd65aa361440cba746b19', class: "hb-result__extra" }, h("slot", { key: 'cefb1bfb4444bc1d47a37eb4887af9e21fa18a85' }))));
    }
    static get is() { return "hb-result"; }
    static get encapsulation() { return "shadow"; }
    static get originalStyleUrls() {
        return {
            "$": ["result.css"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["result.css"]
        };
    }
    static get properties() {
        return {
            "status": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "ResultStatus",
                    "resolved": "\"403\" | \"404\" | \"500\" | \"error\" | \"info\" | \"success\" | \"warning\"",
                    "references": {
                        "ResultStatus": {
                            "location": "local",
                            "path": "/Users/vscoderwhy/Desktop/product/web-common/huibo-ui/src/components/Result/Result.tsx",
                            "id": "src/components/Result/Result.tsx::ResultStatus"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "\u7ED3\u679C\u72B6\u6001\uFF0C\u51B3\u5B9A\u56FE\u6807\u4E0E\u4E3B\u9898\u8272"
                },
                "getter": false,
                "setter": false,
                "attribute": "status",
                "reflect": false,
                "defaultValue": "'info'"
            },
            "title": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "\u6807\u9898\uFF08\u4F7F\u7528\u9ED8\u8BA4\u503C\u4F7F\u5176\u6210\u4E3A required string\uFF0C\u907F\u514D\u4E0E HTMLElement.title \u7C7B\u578B\u51B2\u7A81\uFF09"
                },
                "getter": false,
                "setter": false,
                "attribute": "title",
                "reflect": false,
                "defaultValue": "''"
            },
            "subTitle": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "\u526F\u6807\u9898"
                },
                "getter": false,
                "setter": false,
                "attribute": "sub-title",
                "reflect": false
            },
            "icon": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "\u81EA\u5B9A\u4E49\u56FE\u6807\u6587\u672C\uFF08\u8986\u76D6\u9ED8\u8BA4\u72B6\u6001\u56FE\u6807\uFF09"
                },
                "getter": false,
                "setter": false,
                "attribute": "icon",
                "reflect": false
            }
        };
    }
}
//# sourceMappingURL=Result.js.map
