{"version":3,"file":"index.cjs","sources":["../../../../src/components/Switch/Switch.tsx"],"sourcesContent":["import * as RadixSwitch from '@radix-ui/react-switch';\nimport { forwardRef, useId } from 'react';\nimport { FormRoot } from '@/components/FormContainer';\nimport { GenericLabel } from '@/components/GenericLabel';\nimport { cn } from '@/lib/cva';\nimport styles from './Switch.module.css';\nimport { SwitchProps } from './Switch.types';\n\nexport const Switch = forwardRef<HTMLButtonElement, SwitchProps>(\n  ({ checked, disabled, orientation, dir, label, id, className, ...props }, ref) => {\n    const defaultId = useId();\n    return (\n      <FormRoot\n        $orientation={orientation}\n        $dir={dir}\n        className={styles.wrapper}\n      >\n        <RadixSwitch.Root\n          ref={ref}\n          id={id ?? defaultId}\n          disabled={disabled}\n          aria-label={`${label}`}\n          checked={checked}\n          {...props}\n          className={cn(styles.switch, className)}\n        >\n          <RadixSwitch.Thumb className={styles.switch__thumb} />\n        </RadixSwitch.Root>\n        {label && (\n          <GenericLabel\n            htmlFor={id ?? defaultId}\n            disabled={disabled}\n          >\n            {label}\n          </GenericLabel>\n        )}\n      </FormRoot>\n    );\n  }\n);\n"],"names":["forwardRef","useId","jsxs","FormRoot","styles","jsx","RadixSwitch","cn","GenericLabel"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQO,MAAM,MAAA,GAASA,gBAAA;AAAA,EACpB,CAAC,EAAE,OAAA,EAAS,QAAA,EAAU,WAAA,EAAa,GAAA,EAAK,KAAA,EAAO,EAAA,EAAI,SAAA,EAAW,GAAG,KAAA,EAAM,EAAG,GAAA,KAAQ;AAChF,IAAA,MAAM,YAAYC,WAAA,EAAM;AACxB,IAAA,uBACEC,eAAA;AAAA,MAACC,iBAAA;AAAA,MAAA;AAAA,QACC,YAAA,EAAc,WAAA;AAAA,QACd,IAAA,EAAM,GAAA;AAAA,QACN,WAAWC,qBAAA,CAAO,OAAA;AAAA,QAElB,QAAA,EAAA;AAAA,0BAAAC,cAAA;AAAA,YAACC,sBAAA,CAAY,IAAA;AAAA,YAAZ;AAAA,cACC,GAAA;AAAA,cACA,IAAI,EAAA,IAAM,SAAA;AAAA,cACV,QAAA;AAAA,cACA,YAAA,EAAY,GAAG,KAAK,CAAA,CAAA;AAAA,cACpB,OAAA;AAAA,cACC,GAAG,KAAA;AAAA,cACJ,SAAA,EAAWC,MAAA,CAAGH,qBAAA,CAAO,MAAA,EAAQ,SAAS,CAAA;AAAA,cAEtC,yCAACE,sBAAA,CAAY,KAAA,EAAZ,EAAkB,SAAA,EAAWF,sBAAO,aAAA,EAAe;AAAA;AAAA,WACtD;AAAA,UACC,KAAA,oBACCC,cAAA;AAAA,YAACG,yBAAA;AAAA,YAAA;AAAA,cACC,SAAS,EAAA,IAAM,SAAA;AAAA,cACf,QAAA;AAAA,cAEC,QAAA,EAAA;AAAA;AAAA;AACH;AAAA;AAAA,KAEJ;AAAA,EAEJ;AACF;;"}