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":{"borderTopLeftRadius":"9999px","backgroundColor":"rgba(128, 128, 128, 1)","transition":"background-color 150ms ease-in-out 0ms","height":"16px","borderBottomLeftRadius":"9999px","borderTopRightRadius":"9999px","width":"40px","borderBottomRightRadius":"9999px"},"active":{"[data-part-id=\"thumb\"]":{"backgroundColor":"rgba(255, 255, 255, 1)"}},"checked":{"backgroundColor":"rgba(3, 136, 252, 1)","[data-part-id=\"thumb\"]":{"transform":" translatex(24px)"}}},"thumb":{"normal":{"marginLeft":"2px","borderBottomLeftRadius":"9999px","height":"12px","borderTopLeftRadius":"9999px","transition":"background-color 150ms ease-in-out 0ms,transform 150ms ease-in-out 0ms","backgroundColor":"rgba(255, 255, 255, 1)","borderBottomRightRadius":"9999px","width":"12px","borderTopRightRadius":"9999px"}}},"variants":{}}}/>
  );
});


