import { jsx } from "react/jsx-runtime";
import Typography from "@mui/material/Typography";
import { FontVariantToken, Typography as apollo_core_Typography } from "@uipath/apollo-core";
import { forwardRef } from "react";
import { getVariantMapping } from "./ApTypography.utils.js";
const ApTypography = /*#__PURE__*/ forwardRef(({ variant = FontVariantToken.fontSizeM, color, display, align, children, sx, style, ...rest }, ref)=>{
    const { muiVariant, component } = getVariantMapping(variant);
    const variantKey = Object.keys(FontVariantToken).find((key)=>FontVariantToken[key] === variant);
    const typographyToken = apollo_core_Typography[variantKey];
    return /*#__PURE__*/ jsx(Typography, {
        ref: ref,
        variant: muiVariant,
        component: component,
        color: color,
        align: align,
        style: {
            ...typographyToken && {
                fontFamily: typographyToken.fontFamily,
                fontSize: typographyToken.fontSize,
                lineHeight: typographyToken.lineHeight,
                fontWeight: typographyToken.fontWeight,
                ...typographyToken.letterSpacing && {
                    letterSpacing: typographyToken.letterSpacing
                }
            },
            ...display && {
                display
            },
            ...style
        },
        sx: {
            margin: 0,
            ...sx
        },
        ...rest,
        children: children
    });
});
ApTypography.displayName = 'ApTypography';
export { ApTypography };
