"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.UILabel = exports.labelGlobalStyle = void 0;
const react_1 = __importDefault(require("react"));
const react_2 = require("@fluentui/react");
const types_1 = require("../types");
exports.labelGlobalStyle = {
    fontWeight: 'bold',
    fontSize: '13px',
    color: 'var(--vscode-input-foreground)',
    padding: '4px 0'
};
/**
 * UILabel component
 * based on https://developer.microsoft.com/en-us/fluentui#/controls/web/label
 *
 * @exports
 * @class UILabel
 * @extends {React.Component<ILabelProps, {}>}
 */
class UILabel extends react_1.default.Component {
    /**
     * Initializes component properties.
     *
     * @param {UILabelProps} props
     */
    constructor(props) {
        super(props);
    }
    /**
     * @returns {JSX.Element}
     */
    render() {
        const labelStyles = (props) => {
            return {
                ...{
                    root: [
                        {
                            marginTop: 25,
                            ...exports.labelGlobalStyle
                        },
                        props.disabled && {
                            opacity: '0.4'
                        },
                        props.required && {
                            selectors: {
                                '::after': {
                                    content: types_1.REQUIRED_LABEL_INDICATOR,
                                    color: 'var(--vscode-inputValidation-errorBorder)',
                                    paddingRight: 12
                                }
                            }
                        }
                    ]
                }
            };
        };
        return react_1.default.createElement(react_2.Label, { ...this.props, styles: labelStyles });
    }
}
exports.UILabel = UILabel;
//# sourceMappingURL=UILabel.js.map