import { r as registerInstance, h, H as Host } from './index-DBTJNfo7.js';
import { g as getIconName } from './get-icon-props-CgNJbSP4.js';

const headerCss = () => `@charset "UTF-8";:host(limel-header){display:flex;align-items:center;box-sizing:border-box;width:100%;background-color:var(--header-background-color, rgb(var(--contrast-300)));border-top-left-radius:var(--header-top-right-left-border-radius, 0.75rem);border-top-right-radius:var(--header-top-right-left-border-radius, 0.75rem);padding:0.25rem}.information{display:flex;flex-grow:1;align-items:center;min-width:0}.icon{--limel-icon-svg-margin:0.25rem;flex-shrink:0;color:var(--limel-header-icon-color, var(--header-icon-color, rgb(var(--contrast-1100))));background-color:var(--limel-header-icon-background-color, var(--header-icon-background-color, transparent));width:2.25rem;border-radius:0.56rem}.headings{min-width:0;margin-left:0.25rem}.heading,.subheading{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin:0;padding:0}.heading{color:var(--header-heading-color, rgb(var(--contrast-1100)));font-size:1rem;font-weight:500}.subheading{color:var(--header-subheading-color, rgb(var(--contrast-900)));font-size:var(--limel-theme-default-small-font-size);font-weight:400}.subheading__supporting-text{color:var(--header-supporting-text-color, var(--header-subheading-color))}.subheading__supporting-text span{margin:0 0.125rem}slot[name=actions]{flex-shrink:0}:host(limel-header.is-narrow){padding:0.125rem 0.25rem}:host(limel-header.is-narrow) .icon{--limel-icon-svg-margin:0;width:1.25rem}:host(limel-header.is-narrow) .heading{font-size:0.9375rem}:host(limel-header.has-responsive-layout){display:grid;grid-template-columns:repeat(auto-fit, minmax(clamp(50%, var(--header-responsive-breakpoint, 22rem), 100%), 1fr))}:host(limel-header.has-responsive-layout) .headings{padding-right:0.5rem}:host(limel-header.has-responsive-layout) slot[name=actions]{display:flex;justify-content:flex-end}`;

const Header = class {
    constructor(hostRef) {
        registerInstance(this, hostRef);
        /**
         * The visual divider that separates the `subheading` and the `supportingText`.
         * It must be a single character such as `-` or `,`.
         */
        this.subheadingDivider = '·';
    }
    render() {
        return (h(Host, { key: 'a15f9daaa43d8c03c79f30c2a9d543b97185ed6b' }, h("div", { key: 'f9142be782bd6c20605387073db02ede3acd1a2e', class: "information" }, this.renderIcon(), h("div", { key: 'a1919b8bd21f92aeae4be0c26822517780d0bfc1', class: "headings" }, h("h1", { key: '2c6b225fc76359fa6573b25f232a3530bec7508b', class: "heading", title: this.heading }, this.heading), h("h2", { key: '14be7addf9b4a3082dab7373381a8daa30530fa8', class: "subheading", title: this.subheading }, this.subheading, this.renderSupportingText()))), h("slot", { key: '27d8265622b327f77e893d5dc3e736a25d7b4da3', name: "actions" }, h("slot", { key: '03837c68e6f1ae38941702aef2ea6c74fa1b479d' }))));
    }
    renderIcon() {
        var _a, _b, _c, _d, _e;
        const icon = getIconName(this.icon);
        if (!icon) {
            return;
        }
        return (h("limel-icon", { class: "icon", badge: true, name: icon, style: {
                '--limel-header-icon-color': `${(_b = (_a = this.icon) === null || _a === void 0 ? void 0 : _a.color) !== null && _b !== void 0 ? _b : ''}`,
                '--limel-header-icon-background-color': `${(_d = (_c = this.icon) === null || _c === void 0 ? void 0 : _c.backgroundColor) !== null && _d !== void 0 ? _d : ''}`,
                title: `${(_e = this.icon) === null || _e === void 0 ? void 0 : _e.title}`,
            } }));
    }
    renderSupportingText() {
        if (!this.supportingText) {
            return;
        }
        return (h("span", { class: "subheading__supporting-text" }, this.renderSubheadingDivider(), this.supportingText));
    }
    renderSubheadingDivider() {
        if (!this.subheadingDivider) {
            return;
        }
        return h("span", null, this.subheadingDivider);
    }
};
Header.style = headerCss();

export { Header as limel_header };
