"use strict";
// @ts-nocheck
exports.__esModule = true;
exports.Title = exports.cnTitle = exports.typographyPropWidth = exports.typographyPropTransform = exports.typographyPropFontStyle = exports.typographyPropWeight = exports.typographyPropViewDefault = exports.typographyPropView = exports.typographyPropType = exports.typographyPropSpacing = exports.typographyPropSizeDefault = exports.typographyPropSize = exports.typographyPropDecoration = exports.typographyPropFont = exports.typographyPropDisplay = exports.typographyPropAlign = void 0;
var tslib_1 = require("tslib");
require("./Title.css");
var react_1 = (0, tslib_1.__importDefault)(require("react"));
var react_router_dom_1 = require("react-router-dom");
var bem_1 = require("../../../utils/bem");
var borderImageBase64_1 = require("../../../utils/borderImageBase64");
var PropsWithAsAttributes_1 = require("../../../utils/types/PropsWithAsAttributes");
exports.typographyPropAlign = ['left', 'center', 'right'];
exports.typographyPropDisplay = ['block', 'inlineBlock', 'inline'];
exports.typographyPropFont = ['primary', 'mono'];
exports.typographyPropDecoration = ['underline'];
exports.typographyPropSize = ['hd', 'lg', 'md', 'sm', 'tiny'];
exports.typographyPropSizeDefault = exports.typographyPropSize[0];
exports.typographyPropSpacing = ['xs', 's', 'm', 'l'];
exports.typographyPropType = ['blockquote', 'p', 'h3', 'h2', 'h1'];
exports.typographyPropView = [
    'primary',
    'alert',
    'brand',
    'ghost',
    'link',
    'linkMinor',
    'secondary',
    'success',
    'warning',
];
exports.typographyPropViewDefault = exports.typographyPropView[0];
exports.typographyPropWeight = [
    'black',
    'bold',
    'light',
    'regular',
    'semibold',
    'thin',
];
exports.typographyPropFontStyle = ['italic'];
exports.typographyPropTransform = ['uppercase'];
exports.typographyPropWidth = ['default'];
exports.cnTitle = (0, bem_1.cn)('Title');
exports.Title = (0, PropsWithAsAttributes_1.forwardRefWithAs)(function (props, ref) {
    var _a = props.as, as = _a === void 0 ? 'div' : _a, align = props.align, decoration = props.decoration, display = props.display, font = props.font, _b = props.size, size = _b === void 0 ? exports.typographyPropSizeDefault : _b, spacing = props.spacing, fontStyle = props.fontStyle, transform = props.transform, type = props.type, _c = props.view, view = _c === void 0 ? exports.typographyPropViewDefault : _c, _d = props.weight, weight = _d === void 0 ? 'bold' : _d, width = props.width, color = props.color, className = props.className, children = props.children, parse = props.parse, inverted = props.inverted, otherProps = (0, tslib_1.__rest)(props, ["as", "align", "decoration", "display", "font", "size", "spacing", "fontStyle", "transform", "type", "view", "weight", "width", "color", "className", "children", "parse", "inverted"]);
    var Tag = as;
    if (Tag === 'link') {
        return (react_1["default"].createElement(react_router_dom_1.Link, (0, tslib_1.__assign)({}, otherProps, { className: (0, exports.cnTitle)({
                align: align,
                decoration: decoration,
                display: display,
                font: font,
                size: size,
                spacing: spacing,
                fontStyle: fontStyle,
                transform: transform,
                type: type,
                view: view,
                weight: weight,
                width: width,
                color: color,
                inverted: inverted
            }, [className]), ref: ref }), parse ? (0, borderImageBase64_1.parseContent)(children) : children));
    }
    return (react_1["default"].createElement(Tag, (0, tslib_1.__assign)({}, otherProps, { className: (0, exports.cnTitle)({
            align: align,
            decoration: decoration,
            display: display,
            font: font,
            size: size,
            spacing: spacing,
            fontStyle: fontStyle,
            transform: transform,
            type: type,
            view: view,
            weight: weight,
            width: width,
            inverted: inverted
        }, [className]), ref: ref }), parse ? (0, borderImageBase64_1.parseContent)(children) : children));
});
