import { cva, VariantProps } from 'class-variance-authority';

export const switchVariants = cva(
  'peer inline-flex shrink-0 cursor-pointer items-center rounded-full border border-slate-300 transition-colors ' +
    'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 ' +
    'disabled:cursor-not-allowed disabled:opacity-50 ' +
    'data-[state=unchecked]:bg-pmu-jaune data-[state=checked]:bg-pmu-vert',
  {
    variants: {
      zType: {
        default: 'bg-pmu-green',
        destructive: 'data-[state=checked]:bg-destructive',
      },
      zSize: {
        default: 'h-6 w-11',
        sm: 'h-5 w-9',
        lg: 'h-7 w-14',
      },
    },
    defaultVariants: {
      zType: 'default',
      zSize: 'default',
    },
  }
);

export type ZardSwitchVariants = VariantProps<typeof switchVariants>;
