"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const jsx_runtime_1 = require("react/jsx-runtime");
const react_1 = require("react");
const acui_1 = require("@Acme Corporation/acui");
const Heading = (0, react_1.forwardRef)(({ as: Component = 'h2', size = 'md', weight = 'bold', align = 'left', color = 'default', truncate = false, noOfLines, className = '', wrapperClassName = '', children, ...props }, ref) => {
    const theme = (0, acui_1.useTheme)();
    const style = {
        ...(noOfLines && {
            display: '-webkit-box',
            WebkitLineClamp: noOfLines,
            WebkitBoxOrient: 'vertical',
            overflow: 'hidden',
            textOverflow: 'ellipsis'
        }),
        ...(truncate && {
            overflow: 'hidden',
            textOverflow: 'ellipsis',
            whiteSpace: 'nowrap'
        })
    };
    const ariaProps = {
        'aria-level': Component === 'h1' ? 1 :
            Component === 'h2' ? 2 :
                Component === 'h3' ? 3 :
                    Component === 'h4' ? 4 :
                        Component === 'h5' ? 5 :
                            Component === 'h6' ? 6 : undefined
    };
    return ((0, jsx_runtime_1.jsx)("div", { className: `bf-heading-wrapper ${wrapperClassName}`, "data-size": size, "data-weight": weight, "data-align": align, "data-color": color, "data-truncate": truncate, "data-lines": noOfLines, children: (0, jsx_runtime_1.jsx)(Component, { ref: ref, ...ariaProps, className: `bf-heading ${className}`, style: style, ...props, children: children }) }));
});
Heading.displayName = 'Heading';
exports.default = (0, react_1.memo)(Heading);
//# sourceMappingURL=Heading.js.map