import React from 'react';
import { Dialog as DialogPrimitive, DialogProps as DialogPropsPrimitive } from '@modulz/primitives';

export type DialogProps = DialogPropsPrimitive

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

export const Dialog = React.forwardRef<PrimitiveRefType, DialogProps>((props, ref) => {
  return (
    <DialogPrimitive {...props} ref={ref}  styleConfig={{"base":{"wrapper":{"normal":{"justifyContent":"center","alignItems":"center","display":"flex"}},"content":{"normal":{"maxHeight":"75vh","borderBottomLeftRadius":"4px","borderBottomRightRadius":"4px","borderTopRightRadius":"4px","height":"256px","boxShadow":"0 2px 4px 0 rgba(0, 0, 0, 0.15)","overflow":"auto","width":"auto","borderTopLeftRadius":"4px","minWidth":"256px","backgroundColor":"rgba(128, 128, 128, 1)"}},"overlay":{"normal":{"opacity":"30%","backgroundColor":"rgba(255, 255, 255, 1)"}}},"variants":{}}}/>
  );
});


