"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 Text = (0, react_1.forwardRef)(({ as: Component = 'p', size = 'md', weight = 'normal', align = 'left', color = 'default', decoration = 'none', transform = 'none', style: fontStyle = 'normal', variant = 'body', truncate = false, noOfLines, isTruncated, isDisabled = false, isReadOnly = false, isRequired = false, isInvalid = false, 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 || isTruncated ? {
            overflow: 'hidden',
            textOverflow: 'ellipsis',
            whiteSpace: 'nowrap'
        } : {}),
        textDecoration: decoration,
        textTransform: transform,
        fontStyle
    };
    const ariaProps = {
        'aria-disabled': isDisabled ? true : undefined,
        'aria-readonly': isReadOnly ? true : undefined,
        'aria-required': isRequired ? true : undefined,
        'aria-invalid': isInvalid ? true : undefined
    };
    return ((0, jsx_runtime_1.jsx)("div", { className: `bf-text-wrapper ${wrapperClassName}`, "data-size": size, "data-weight": weight, "data-align": align, "data-color": color, "data-decoration": decoration, "data-transform": transform, "data-style": fontStyle, "data-variant": variant, "data-truncate": truncate || isTruncated, "data-lines": noOfLines, "data-disabled": isDisabled, "data-readonly": isReadOnly, "data-required": isRequired, "data-invalid": isInvalid, children: (0, jsx_runtime_1.jsx)(Component, { ref: ref, ...ariaProps, className: `bf-text ${className}`, style: style, ...props, children: children }) }));
});
Text.displayName = 'Text';
exports.default = (0, react_1.memo)(Text);
//# sourceMappingURL=Text.js.map