import React from 'react';
import { Switch as SwitchPrimitive, SwitchProps as SwitchPropsPrimitive } from '@modulz/primitives';

export type SwitchProps = SwitchPropsPrimitive

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

export const Switch = React.forwardRef<PrimitiveRefType, SwitchProps>((props, ref) => {
  return (
    <SwitchPrimitive {...props} ref={ref}  styleConfig={{"base":{"switch":{"normal":{"height":"24px","backgroundColor":"hsl(240, 10%, 90%)","borderBottomRightRadius":"9999px","width":"48px","borderTopLeftRadius":"9999px","transition":"background-color 150ms ease-in-out 0ms","borderBottomLeftRadius":"9999px","borderTopRightRadius":"9999px"},"checked":{"backgroundColor":"hsl(240, 3%, 60%)","[data-part-id=\"thumb\"]":{"transform":" translatex(24px)"}}},"thumb":{"normal":{"transition":"background-color 150ms ease-in-out 0ms,transform 150ms ease-in-out 0ms","borderBottomLeftRadius":"9999px","borderTopRightRadius":"9999px","height":"16px","borderBottomRightRadius":"9999px","backgroundColor":"hsl(0, 0%, 100%)","marginLeft":"2px","width":"16px","borderTopLeftRadius":"9999px"}}},"variants":{}}}/>
  );
});


