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: '90dbf0da0a0c7ec498538721135e2fdefc4ac238', class: Object.assign({}, block.class()) }, h("bal-hint", { key: '1976d07de449aa8b2897a375f61953f0c705e4ae', 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: 'ae2b48186e4f4c1adbfe7b3ed57a798a55a4cad0' }, h("slot", { key: 'e4a33e9e14ab86a15e78321fbd9f7325e0420ec5' })))));
    }
    static get is() { return "bal-field-hint"; }
    static get encapsulation() { return "scoped"; }
    static get properties() {
        return {
            "hideTitleOnDesktop": {
                "type": "boolean",
                "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,
                "attribute": "hide-title-on-desktop",
                "defaultValue": "false"
            },
            "subject": {
                "type": "string",
                "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,
                "attribute": "subject",
                "defaultValue": "''"
            },
            "closeLabel": {
                "type": "string",
                "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,
                "attribute": "close-label",
                "defaultValue": "'Close'"
            },
            "small": {
                "type": "boolean",
                "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,
                "attribute": "small",
                "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);
