{"version":3,"sources":["../src/Toggle/Toggle.tsx","../src/Toggle/Toggle.types.ts"],"sourcesContent":["import * as Switch from \"@radix-ui/react-switch\";\nimport { cva, cx } from \"cva\";\nimport type { FunctionComponent } from \"react\";\nimport type { SwitchProps } from \"@radix-ui/react-switch\";\nimport type { VariantProps } from \"cva\";\nimport type { Simplify } from \"type-fest\";\nimport type { ToggleSize } from \"./Toggle.types\";\n\nconst toggleRecipe = cva({\n  base: \"kn-toggle\",\n  variants: {\n    size: {\n      large: \"kn-toggle-large\",\n      small: \"kn-toggle-small\",\n    } satisfies Record<ToggleSize, string>,\n  },\n});\n\nconst switchThumbRecipe = cva({\n  base: \"kn-toggle-thumb\",\n  variants: {\n    size: {\n      large: \"kn-toggle-thumb-large\",\n      small: \"kn-toggle-thumb-small\",\n    } satisfies Record<ToggleSize, string>,\n  },\n});\n\ntype ToggleVariants = Simplify<VariantProps<typeof toggleRecipe>>;\n\nexport type ToggleProps = SwitchProps &\n  ToggleVariants & {\n    thumbClassName?: string;\n  };\n\nexport const Toggle: FunctionComponent<ToggleProps> = ({\n  size = \"large\",\n  className,\n  thumbClassName,\n  ...props\n}) => {\n  return (\n    <Switch.Root {...props} className={cx(toggleRecipe({ size }), className)}>\n      <Switch.Thumb className={cx(switchThumbRecipe({ size }), thumbClassName)} />\n    </Switch.Root>\n  );\n};\n\nToggle.displayName = \"Toggle\";\n\nexport default Toggle;\n","export const toggleSizes = [\"small\", \"large\"] as const;\n\nexport type ToggleSize = (typeof toggleSizes)[number];\n"],"mappings":";;;;;;;AAAA,YAAY,YAAY;AACxB,SAAS,KAAK,UAAU;AA0ClB;AAnCN,IAAM,eAAe,IAAI;AAAA,EACvB,MAAM;AAAA,EACN,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,OAAO;AAAA,MACP,OAAO;AAAA,IACT;AAAA,EACF;AACF,CAAC;AAED,IAAM,oBAAoB,IAAI;AAAA,EAC5B,MAAM;AAAA,EACN,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,OAAO;AAAA,MACP,OAAO;AAAA,IACT;AAAA,EACF;AACF,CAAC;AASM,IAAM,SAAyC,CAAC,OAKjD;AALiD,eACrD;AAAA,WAAO;AAAA,IACP;AAAA,IACA;AAAA,EAtCF,IAmCuD,IAIlD,kBAJkD,IAIlD;AAAA,IAHH;AAAA,IACA;AAAA,IACA;AAAA;AAGA,SACE,oBAAQ,aAAP,iCAAgB,QAAhB,EAAuB,WAAW,GAAG,aAAa,EAAE,KAAK,CAAC,GAAG,SAAS,GACrE,8BAAQ,cAAP,EAAa,WAAW,GAAG,kBAAkB,EAAE,KAAK,CAAC,GAAG,cAAc,GAAG,IAC5E;AAEJ;AAEA,OAAO,cAAc;AAErB,IAAO,iBAAQ;;;AClDR,IAAM,cAAc,CAAC,SAAS,OAAO;","names":[]}