import { __decorate, __metadata } from "tslib";
import { h, Host } from "@stencil/core";
import { BEM } from "../../../utils/bem";
import { balBreakpoints } from "../../../index";
import { ListenToBreakpoints } from "../../../utils/breakpoints";
export class FieldHint {
    constructor() {
        /**
         * Hide the title on desktop.
         */
        this.hideTitleOnDesktop = false;
        /**
         * Text of the inputs label
         */
        this.subject = '';
        /**
         * Text for the close button.
         */
        this.closeLabel = 'Close';
        /**
         * Disables the close button for tablet and desktop
         */
        this.small = false;
        this.isDesktop = balBreakpoints.isDesktop;
    }
    breakpointListener(breakpoints) {
        this.isDesktop = breakpoints.desktop;
    }
    render() {
        const block = BEM.block('field-hint');
        return (h(Host, { key: 'a5f895c418c0dfa249da93d3bc39f5563d31b547', class: Object.assign({}, block.class()) }, h("bal-hint", { key: '83d9c59c6fce044b361fbd471bf83780314c62e9', class: Object.assign({}, block.element('hint').class()), "data-testid": "bal-field-hint", closeLabel: this.closeLabel, small: this.small }, this.subject && !(this.hideTitleOnDesktop && this.isDesktop) ? (h("bal-hint-title", null, this.subject)) : (''), h("bal-hint-text", { key: '38b6ef5120c8b5adef31a05ad54f474ed55305f5' }, h("slot", { key: '040d24c305badac88e0bb64d21e513a067f6e177' })))));
    }
    static get is() { return "bal-field-hint"; }
    static get encapsulation() { return "scoped"; }
    static get properties() {
        return {
            "hideTitleOnDesktop": {
                "type": "boolean",
                "attribute": "hide-title-on-desktop",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Hide the title on desktop."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "false"
            },
            "subject": {
                "type": "string",
                "attribute": "subject",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Text of the inputs label"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "''"
            },
            "closeLabel": {
                "type": "string",
                "attribute": "close-label",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Text for the close button."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "'Close'"
            },
            "small": {
                "type": "boolean",
                "attribute": "small",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Disables the close button for tablet and desktop"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "false"
            }
        };
    }
    static get states() {
        return {
            "isDesktop": {}
        };
    }
}
__decorate([
    ListenToBreakpoints(),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", void 0)
], FieldHint.prototype, "breakpointListener", null);
