import React from 'react';
import { Input as InputPrimitive, InputProps as InputPropsPrimitive } from '@modulz/primitives';

export type InputProps = InputPropsPrimitive & {
  variant?: 'ghost';
size?: 'large';
}

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

export const Input = React.forwardRef<PrimitiveRefType, InputProps>((props, ref) => {
  return (
    <InputPrimitive {...props} ref={ref}  styleConfig={{"base":{"input":{"normal":{"fontFamily":"Inter,sans-serif","borderTopRightRadius":"2px","backgroundColor":"rgba(255, 255, 255, 1)","paddingRight":"8px","height":"32px","color":"rgba(19, 19, 21, 1)","fontSize":"16px","borderBottomRightRadius":"2px","border":"1px solid","borderColor":"hsl(240, 10%, 90%)","borderBottomLeftRadius":"2px","paddingLeft":"8px","borderTopLeftRadius":"2px"}},"placeholder":{"normal":{"color":"hsl(240, 5%, 85%)"}}},"variants":{"variant":{"ghost":{"input":{"normal":{"backgroundColor":"transparent","border":"1px solid","borderColor":"transparent"}}}},"size":{"large":{"input":{"normal":{"fontSize":"20px","paddingRight":"16px","height":"16px","paddingLeft":"16px"}}}}}}}/>
  );
});


