// @ts-nocheck
import { __assign, __rest } from "tslib";
import './Title.css';
import React from 'react';
import { Link } from 'react-router-dom';
import { cn } from '../../../utils/bem';
import { parseContent } from '../../../utils/borderImageBase64';
import { forwardRefWithAs } from '../../../utils/types/PropsWithAsAttributes';
export var typographyPropAlign = ['left', 'center', 'right'];
export var typographyPropDisplay = ['block', 'inlineBlock', 'inline'];
export var typographyPropFont = ['primary', 'mono'];
export var typographyPropDecoration = ['underline'];
export var typographyPropSize = ['hd', 'lg', 'md', 'sm', 'tiny'];
export var typographyPropSizeDefault = typographyPropSize[0];
export var typographyPropSpacing = ['xs', 's', 'm', 'l'];
export var typographyPropType = ['blockquote', 'p', 'h3', 'h2', 'h1'];
export var typographyPropView = [
    'primary',
    'alert',
    'brand',
    'ghost',
    'link',
    'linkMinor',
    'secondary',
    'success',
    'warning',
];
export var typographyPropViewDefault = typographyPropView[0];
export var typographyPropWeight = [
    'black',
    'bold',
    'light',
    'regular',
    'semibold',
    'thin',
];
export var typographyPropFontStyle = ['italic'];
export var typographyPropTransform = ['uppercase'];
export var typographyPropWidth = ['default'];
export var cnTitle = cn('Title');
export var Title = 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 ? typographyPropSizeDefault : _b, spacing = props.spacing, fontStyle = props.fontStyle, transform = props.transform, type = props.type, _c = props.view, view = _c === void 0 ? 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 = __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.createElement(Link, __assign({}, otherProps, { className: 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 ? parseContent(children) : children));
    }
    return (React.createElement(Tag, __assign({}, otherProps, { className: 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 ? parseContent(children) : children));
});
