import React from 'react';
import { Text as TextPrimitive, TextProps as TextPropsPrimitive } from '@modulz/primitives';

export type TextProps = TextPropsPrimitive & {
  size?: '1' | 1 | '2' | 2 | '3' | 3 | '4' | 4 | '5' | 5 | '6' | 6 | '7' | 7 | '8' | 8 | '9' | 9;
weight?: 'bold' | 'normal' | 'medium';
}

type ExtractRefType<TypesThatMayContainReactRef> = TypesThatMayContainReactRef extends {ref?: React.Ref<infer T>} ? T : unknown;
type PrimitiveRefType = ExtractRefType<TextPropsPrimitive>  

export const Text = React.forwardRef<PrimitiveRefType, TextProps>((props, ref) => {
  return (
    <TextPrimitive {...props} ref={ref}  styleConfig={{"base":{"text":{"normal":{"fontFamily":"Inter,sans-serif","lineHeight":"inherit"}}},"variants":{"size":{"1":{"text":{"normal":{"fontSize":"12px","lineHeight":"18px"}}},"2":{"text":{"normal":{"fontSize":"14px","lineHeight":"21px"}}},"3":{"text":{"normal":{"lineHeight":"24px","fontSize":"16px"}}},"4":{"text":{"normal":{"lineHeight":"30px","fontSize":"20px"}}},"5":{"text":{"normal":{"lineHeight":"36px","fontSize":"24px"}}},"6":{"text":{"normal":{"fontSize":"32px","lineHeight":"48px"}}},"7":{"text":{"normal":{"lineHeight":"48px","fontSize":"48px"}}},"8":{"text":{"normal":{"lineHeight":"72px","fontSize":"64px"}}},"9":{"text":{"normal":{"fontSize":"72px","lineHeight":"96px"}}}},"weight":{"bold":{"text":{"normal":{"fontStyle":"normal","fontWeight":"600"}}},"normal":{"text":{"normal":{"fontStyle":"normal","fontWeight":"400"}}},"medium":{"text":{"normal":{"fontStyle":"normal","fontWeight":"500"}}}}}}}/>
  );
});


